@settlemint/sdk-viem 2.4.1-prb0c72988 → 2.4.1-prb593b885

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/viem.js CHANGED
@@ -16,7 +16,9 @@ var __export = (target, all) => {
16
16
  };
17
17
 
18
18
  //#endregion
19
- //#region ../../node_modules/zod/dist/esm/v4/core/core.js
19
+ //#region ../../node_modules/zod/v4/core/core.js
20
+ /** A special constant with type `never` */
21
+ const NEVER = Object.freeze({ status: "aborted" });
20
22
  function $constructor(name, initializer$2, params) {
21
23
  function init(inst, def) {
22
24
  var _a;
@@ -67,7 +69,7 @@ function config(newConfig) {
67
69
  }
68
70
 
69
71
  //#endregion
70
- //#region ../../node_modules/zod/dist/esm/v4/core/util.js
72
+ //#region ../../node_modules/zod/v4/core/util.js
71
73
  var util_exports = {};
72
74
  __export(util_exports, {
73
75
  BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
@@ -82,6 +84,7 @@ __export(util_exports, {
82
84
  assertNotEqual: () => assertNotEqual,
83
85
  assignProp: () => assignProp,
84
86
  cached: () => cached,
87
+ captureStackTrace: () => captureStackTrace,
85
88
  cleanEnum: () => cleanEnum,
86
89
  cleanRegex: () => cleanRegex,
87
90
  clone: () => clone,
@@ -220,10 +223,14 @@ function randomString(length = 10) {
220
223
  function esc(str) {
221
224
  return JSON.stringify(str);
222
225
  }
226
+ const captureStackTrace = Error.captureStackTrace ? Error.captureStackTrace : (..._args) => {};
223
227
  function isObject(data) {
224
228
  return typeof data === "object" && data !== null && !Array.isArray(data);
225
229
  }
226
230
  const allowsEval = cached(() => {
231
+ if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
232
+ return false;
233
+ }
227
234
  try {
228
235
  const F = Function;
229
236
  new F("");
@@ -232,9 +239,6 @@ const allowsEval = cached(() => {
232
239
  return false;
233
240
  }
234
241
  });
235
- function _isObject(o) {
236
- return Object.prototype.toString.call(o) === "[object Object]";
237
- }
238
242
  function isPlainObject(o) {
239
243
  if (isObject(o) === false) return false;
240
244
  const ctor = o.constructor;
@@ -414,6 +418,9 @@ function omit(schema, mask) {
414
418
  });
415
419
  }
416
420
  function extend(schema, shape) {
421
+ if (!isPlainObject(shape)) {
422
+ throw new Error("Invalid input to extend: expected a plain object");
423
+ }
417
424
  const def = {
418
425
  ...schema._zod.def,
419
426
  get shape() {
@@ -501,7 +508,7 @@ function required(Class$1, schema, mask) {
501
508
  }
502
509
  function aborted(x, startIndex = 0) {
503
510
  for (let i = startIndex; i < x.issues.length; i++) {
504
- if (x.issues[i].continue !== true) return true;
511
+ if (x.issues[i]?.continue !== true) return true;
505
512
  }
506
513
  return false;
507
514
  }
@@ -565,7 +572,7 @@ var Class = class {
565
572
  };
566
573
 
567
574
  //#endregion
568
- //#region ../../node_modules/zod/dist/esm/v4/core/errors.js
575
+ //#region ../../node_modules/zod/v4/core/errors.js
569
576
  const initializer$1 = (inst, def) => {
570
577
  inst.name = "$ZodError";
571
578
  Object.defineProperty(inst, "_zod", {
@@ -582,13 +589,17 @@ const initializer$1 = (inst, def) => {
582
589
  },
583
590
  enumerable: true
584
591
  });
592
+ Object.defineProperty(inst, "toString", {
593
+ value: () => inst.message,
594
+ enumerable: false
595
+ });
585
596
  };
586
597
  const $ZodError = $constructor("$ZodError", initializer$1);
587
598
  const $ZodRealError = $constructor("$ZodError", initializer$1, { Parent: Error });
588
- function flattenError(error$37, mapper = (issue$1) => issue$1.message) {
599
+ function flattenError(error$39, mapper = (issue$1) => issue$1.message) {
589
600
  const fieldErrors = {};
590
601
  const formErrors = [];
591
- for (const sub of error$37.issues) {
602
+ for (const sub of error$39.issues) {
592
603
  if (sub.path.length > 0) {
593
604
  fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
594
605
  fieldErrors[sub.path[0]].push(mapper(sub));
@@ -601,13 +612,13 @@ function flattenError(error$37, mapper = (issue$1) => issue$1.message) {
601
612
  fieldErrors
602
613
  };
603
614
  }
604
- function formatError(error$37, _mapper) {
615
+ function formatError(error$39, _mapper) {
605
616
  const mapper = _mapper || function(issue$1) {
606
617
  return issue$1.message;
607
618
  };
608
619
  const fieldErrors = { _errors: [] };
609
- const processError = (error$38) => {
610
- for (const issue$1 of error$38.issues) {
620
+ const processError = (error$40) => {
621
+ for (const issue$1 of error$40.issues) {
611
622
  if (issue$1.code === "invalid_union" && issue$1.errors.length) {
612
623
  issue$1.errors.map((issues) => processError({ issues }));
613
624
  } else if (issue$1.code === "invalid_key") {
@@ -634,17 +645,17 @@ function formatError(error$37, _mapper) {
634
645
  }
635
646
  }
636
647
  };
637
- processError(error$37);
648
+ processError(error$39);
638
649
  return fieldErrors;
639
650
  }
640
- function treeifyError(error$37, _mapper) {
651
+ function treeifyError(error$39, _mapper) {
641
652
  const mapper = _mapper || function(issue$1) {
642
653
  return issue$1.message;
643
654
  };
644
655
  const result = { errors: [] };
645
- const processError = (error$38, path = []) => {
656
+ const processError = (error$40, path = []) => {
646
657
  var _a, _b;
647
- for (const issue$1 of error$38.issues) {
658
+ for (const issue$1 of error$40.issues) {
648
659
  if (issue$1.code === "invalid_union" && issue$1.errors.length) {
649
660
  issue$1.errors.map((issues) => processError({ issues }, issue$1.path));
650
661
  } else if (issue$1.code === "invalid_key") {
@@ -679,7 +690,7 @@ function treeifyError(error$37, _mapper) {
679
690
  }
680
691
  }
681
692
  };
682
- processError(error$37);
693
+ processError(error$39);
683
694
  return result;
684
695
  }
685
696
  /** Format a ZodError as a human-readable string in the following form.
@@ -727,9 +738,9 @@ function toDotPath(path) {
727
738
  }
728
739
  return segs.join("");
729
740
  }
730
- function prettifyError(error$37) {
741
+ function prettifyError(error$39) {
731
742
  const lines = [];
732
- const issues = [...error$37.issues].sort((a, b) => a.path.length - b.path.length);
743
+ const issues = [...error$39.issues].sort((a, b) => a.path.length - b.path.length);
733
744
  for (const issue$1 of issues) {
734
745
  lines.push(`✖ ${issue$1.message}`);
735
746
  if (issue$1.path?.length) lines.push(` → at ${toDotPath(issue$1.path)}`);
@@ -738,7 +749,7 @@ function prettifyError(error$37) {
738
749
  }
739
750
 
740
751
  //#endregion
741
- //#region ../../node_modules/zod/dist/esm/v4/core/parse.js
752
+ //#region ../../node_modules/zod/v4/core/parse.js
742
753
  const _parse = (_Err) => (schema, value, _ctx, _params) => {
743
754
  const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
744
755
  const result = schema._zod.run({
@@ -750,7 +761,7 @@ const _parse = (_Err) => (schema, value, _ctx, _params) => {
750
761
  }
751
762
  if (result.issues.length) {
752
763
  const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
753
- Error.captureStackTrace(e, _params?.callee);
764
+ captureStackTrace(e, _params?.callee);
754
765
  throw e;
755
766
  }
756
767
  return result.value;
@@ -765,7 +776,7 @@ const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
765
776
  if (result instanceof Promise) result = await result;
766
777
  if (result.issues.length) {
767
778
  const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
768
- Error.captureStackTrace(e, params?.callee);
779
+ captureStackTrace(e, params?.callee);
769
780
  throw e;
770
781
  }
771
782
  return result.value;
@@ -810,10 +821,9 @@ const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
810
821
  const safeParseAsync$1 = /* @__PURE__ */ _safeParseAsync($ZodRealError);
811
822
 
812
823
  //#endregion
813
- //#region ../../node_modules/zod/dist/esm/v4/core/regexes.js
824
+ //#region ../../node_modules/zod/v4/core/regexes.js
814
825
  var regexes_exports = {};
815
826
  __export(regexes_exports, {
816
- _emoji: () => _emoji$1,
817
827
  base64: () => base64$1,
818
828
  base64url: () => base64url$1,
819
829
  bigint: () => bigint$2,
@@ -899,27 +909,23 @@ const base64url$1 = /^[A-Za-z0-9_-]*$/;
899
909
  const hostname = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;
900
910
  const domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
901
911
  const e164$1 = /^\+(?:[0-9]){6,14}[0-9]$/;
902
- const 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])))`;
912
+ const 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])))`;
903
913
  const date$3 = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
904
914
  function timeSource(args) {
905
- let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
906
- if (args.precision) {
907
- regex = `${regex}\\.\\d{${args.precision}}`;
908
- } else if (args.precision == null) {
909
- regex = `${regex}(\\.\\d+)?`;
910
- }
915
+ const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
916
+ const regex = 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+)?)?`;
911
917
  return regex;
912
918
  }
913
919
  function time$1(args) {
914
920
  return new RegExp(`^${timeSource(args)}$`);
915
921
  }
916
922
  function datetime$1(args) {
917
- let regex = `${dateSource}T${timeSource(args)}`;
918
- const opts = [];
919
- opts.push(args.local ? `Z?` : `Z`);
920
- if (args.offset) opts.push(`([+-]\\d{2}:?\\d{2})`);
921
- regex = `${regex}(${opts.join("|")})`;
922
- return new RegExp(`^${regex}$`);
923
+ const time$2 = timeSource({ precision: args.precision });
924
+ const opts = ["Z"];
925
+ if (args.local) opts.push("");
926
+ if (args.offset) opts.push(`([+-]\\d{2}:\\d{2})`);
927
+ const timeRegex = `${time$2}(?:${opts.join("|")})`;
928
+ return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
923
929
  }
924
930
  const string$2 = (params) => {
925
931
  const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
@@ -935,7 +941,7 @@ const lowercase = /^[^A-Z]*$/;
935
941
  const uppercase = /^[^a-z]*$/;
936
942
 
937
943
  //#endregion
938
- //#region ../../node_modules/zod/dist/esm/v4/core/checks.js
944
+ //#region ../../node_modules/zod/v4/core/checks.js
939
945
  const $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
940
946
  var _a;
941
947
  inst._zod ?? (inst._zod = {});
@@ -1126,11 +1132,12 @@ const $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntForma
1126
1132
  };
1127
1133
  });
1128
1134
  const $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, def) => {
1135
+ var _a;
1129
1136
  $ZodCheck.init(inst, def);
1130
- inst._zod.when = (payload) => {
1137
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1131
1138
  const val = payload.value;
1132
1139
  return !nullish$1(val) && val.size !== undefined;
1133
- };
1140
+ });
1134
1141
  inst._zod.onattach.push((inst$1) => {
1135
1142
  const curr = inst$1._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
1136
1143
  if (def.maximum < curr) inst$1._zod.bag.maximum = def.maximum;
@@ -1150,11 +1157,12 @@ const $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst,
1150
1157
  };
1151
1158
  });
1152
1159
  const $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, def) => {
1160
+ var _a;
1153
1161
  $ZodCheck.init(inst, def);
1154
- inst._zod.when = (payload) => {
1162
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1155
1163
  const val = payload.value;
1156
1164
  return !nullish$1(val) && val.size !== undefined;
1157
- };
1165
+ });
1158
1166
  inst._zod.onattach.push((inst$1) => {
1159
1167
  const curr = inst$1._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
1160
1168
  if (def.minimum > curr) inst$1._zod.bag.minimum = def.minimum;
@@ -1174,11 +1182,12 @@ const $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst,
1174
1182
  };
1175
1183
  });
1176
1184
  const $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (inst, def) => {
1185
+ var _a;
1177
1186
  $ZodCheck.init(inst, def);
1178
- inst._zod.when = (payload) => {
1187
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1179
1188
  const val = payload.value;
1180
1189
  return !nullish$1(val) && val.size !== undefined;
1181
- };
1190
+ });
1182
1191
  inst._zod.onattach.push((inst$1) => {
1183
1192
  const bag = inst$1._zod.bag;
1184
1193
  bag.minimum = def.size;
@@ -1199,6 +1208,8 @@ const $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals",
1199
1208
  code: "too_small",
1200
1209
  minimum: def.size
1201
1210
  },
1211
+ inclusive: true,
1212
+ exact: true,
1202
1213
  input: payload.value,
1203
1214
  inst,
1204
1215
  continue: !def.abort
@@ -1206,11 +1217,12 @@ const $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals",
1206
1217
  };
1207
1218
  });
1208
1219
  const $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
1220
+ var _a;
1209
1221
  $ZodCheck.init(inst, def);
1210
- inst._zod.when = (payload) => {
1222
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1211
1223
  const val = payload.value;
1212
1224
  return !nullish$1(val) && val.length !== undefined;
1213
- };
1225
+ });
1214
1226
  inst._zod.onattach.push((inst$1) => {
1215
1227
  const curr = inst$1._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
1216
1228
  if (def.maximum < curr) inst$1._zod.bag.maximum = def.maximum;
@@ -1232,11 +1244,12 @@ const $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (i
1232
1244
  };
1233
1245
  });
1234
1246
  const $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
1247
+ var _a;
1235
1248
  $ZodCheck.init(inst, def);
1236
- inst._zod.when = (payload) => {
1249
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1237
1250
  const val = payload.value;
1238
1251
  return !nullish$1(val) && val.length !== undefined;
1239
- };
1252
+ });
1240
1253
  inst._zod.onattach.push((inst$1) => {
1241
1254
  const curr = inst$1._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
1242
1255
  if (def.minimum > curr) inst$1._zod.bag.minimum = def.minimum;
@@ -1258,11 +1271,12 @@ const $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (i
1258
1271
  };
1259
1272
  });
1260
1273
  const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
1274
+ var _a;
1261
1275
  $ZodCheck.init(inst, def);
1262
- inst._zod.when = (payload) => {
1276
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1263
1277
  const val = payload.value;
1264
1278
  return !nullish$1(val) && val.length !== undefined;
1265
- };
1279
+ });
1266
1280
  inst._zod.onattach.push((inst$1) => {
1267
1281
  const bag = inst$1._zod.bag;
1268
1282
  bag.minimum = def.length;
@@ -1284,6 +1298,8 @@ const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEqual
1284
1298
  code: "too_small",
1285
1299
  minimum: def.length
1286
1300
  },
1301
+ inclusive: true,
1302
+ exact: true,
1287
1303
  input: payload.value,
1288
1304
  inst,
1289
1305
  continue: !def.abort
@@ -1291,7 +1307,7 @@ const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEqual
1291
1307
  };
1292
1308
  });
1293
1309
  const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
1294
- var _a;
1310
+ var _a, _b;
1295
1311
  $ZodCheck.init(inst, def);
1296
1312
  inst._zod.onattach.push((inst$1) => {
1297
1313
  const bag = inst$1._zod.bag;
@@ -1301,8 +1317,7 @@ const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringForma
1301
1317
  bag.patterns.add(def.pattern);
1302
1318
  }
1303
1319
  });
1304
- (_a = inst._zod).check ?? (_a.check = (payload) => {
1305
- if (!def.pattern) throw new Error("Not implemented.");
1320
+ if (def.pattern) (_a = inst._zod).check ?? (_a.check = (payload) => {
1306
1321
  def.pattern.lastIndex = 0;
1307
1322
  if (def.pattern.test(payload.value)) return;
1308
1323
  payload.issues.push({
@@ -1315,6 +1330,7 @@ const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringForma
1315
1330
  continue: !def.abort
1316
1331
  });
1317
1332
  });
1333
+ else (_b = inst._zod).check ?? (_b.check = () => {});
1318
1334
  });
1319
1335
  const $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def) => {
1320
1336
  $ZodCheckStringFormat.init(inst, def);
@@ -1438,7 +1454,6 @@ const $ZodCheckMimeType = /* @__PURE__ */ $constructor("$ZodCheckMimeType", (ins
1438
1454
  code: "invalid_value",
1439
1455
  values: def.mime,
1440
1456
  input: payload.value.type,
1441
- path: ["type"],
1442
1457
  inst
1443
1458
  });
1444
1459
  };
@@ -1451,7 +1466,7 @@ const $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (i
1451
1466
  });
1452
1467
 
1453
1468
  //#endregion
1454
- //#region ../../node_modules/zod/dist/esm/v4/core/doc.js
1469
+ //#region ../../node_modules/zod/v4/core/doc.js
1455
1470
  var Doc = class {
1456
1471
  constructor(args = []) {
1457
1472
  this.content = [];
@@ -1487,19 +1502,18 @@ var Doc = class {
1487
1502
  };
1488
1503
 
1489
1504
  //#endregion
1490
- //#region ../../node_modules/zod/dist/esm/v4/core/versions.js
1505
+ //#region ../../node_modules/zod/v4/core/versions.js
1491
1506
  const version = {
1492
1507
  major: 4,
1493
1508
  minor: 0,
1494
- patch: 0
1509
+ patch: 2
1495
1510
  };
1496
1511
 
1497
1512
  //#endregion
1498
- //#region ../../node_modules/zod/dist/esm/v4/core/schemas.js
1513
+ //#region ../../node_modules/zod/v4/core/schemas.js
1499
1514
  const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1500
1515
  var _a;
1501
1516
  inst ?? (inst = {});
1502
- inst._zod.id = def.type + "_" + randomString(10);
1503
1517
  inst._zod.def = def;
1504
1518
  inst._zod.bag = inst._zod.bag || {};
1505
1519
  inst._zod.version = version;
@@ -1522,13 +1536,11 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1522
1536
  let isAborted = aborted(payload);
1523
1537
  let asyncResult;
1524
1538
  for (const ch of checks$1) {
1525
- if (ch._zod.when) {
1526
- const shouldRun = ch._zod.when(payload);
1539
+ if (ch._zod.def.when) {
1540
+ const shouldRun = ch._zod.def.when(payload);
1527
1541
  if (!shouldRun) continue;
1528
- } else {
1529
- if (isAborted) {
1530
- continue;
1531
- }
1542
+ } else if (isAborted) {
1543
+ continue;
1532
1544
  }
1533
1545
  const currLen = payload.issues.length;
1534
1546
  const _ = ch._zod.check(payload);
@@ -1628,7 +1640,9 @@ const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
1628
1640
  $ZodStringFormat.init(inst, def);
1629
1641
  inst._zod.check = (payload) => {
1630
1642
  try {
1631
- const url$1 = new URL(payload.value);
1643
+ const orig = payload.value;
1644
+ const url$1 = new URL(orig);
1645
+ const href = url$1.href;
1632
1646
  if (def.hostname) {
1633
1647
  def.hostname.lastIndex = 0;
1634
1648
  if (!def.hostname.test(url$1.hostname)) {
@@ -1657,6 +1671,11 @@ const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
1657
1671
  });
1658
1672
  }
1659
1673
  }
1674
+ if (!orig.endsWith("/") && href.endsWith("/")) {
1675
+ payload.value = href.slice(0, -1);
1676
+ } else {
1677
+ payload.value = href;
1678
+ }
1660
1679
  return;
1661
1680
  } catch (_) {
1662
1681
  payload.issues.push({
@@ -1827,6 +1846,7 @@ function isValidJWT(token, algorithm = null) {
1827
1846
  const tokensParts = token.split(".");
1828
1847
  if (tokensParts.length !== 3) return false;
1829
1848
  const [header] = tokensParts;
1849
+ if (!header) return false;
1830
1850
  const parsedHeader = JSON.parse(atob(header));
1831
1851
  if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT") return false;
1832
1852
  if (!parsedHeader.alg) return false;
@@ -1849,6 +1869,19 @@ const $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => {
1849
1869
  });
1850
1870
  };
1851
1871
  });
1872
+ const $ZodCustomStringFormat = /* @__PURE__ */ $constructor("$ZodCustomStringFormat", (inst, def) => {
1873
+ $ZodStringFormat.init(inst, def);
1874
+ inst._zod.check = (payload) => {
1875
+ if (def.fn(payload.value)) return;
1876
+ payload.issues.push({
1877
+ code: "invalid_format",
1878
+ format: def.format,
1879
+ input: payload.value,
1880
+ inst,
1881
+ continue: !def.abort
1882
+ });
1883
+ };
1884
+ });
1852
1885
  const $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
1853
1886
  $ZodType.init(inst, def);
1854
1887
  inst._zod.pattern = inst._zod.bag.pattern ?? number$2;
@@ -1900,12 +1933,11 @@ const $ZodBigInt = /* @__PURE__ */ $constructor("$ZodBigInt", (inst, def) => {
1900
1933
  if (def.coerce) try {
1901
1934
  payload.value = BigInt(payload.value);
1902
1935
  } catch (_) {}
1903
- const { value: input } = payload;
1904
- if (typeof input === "bigint") return payload;
1936
+ if (typeof payload.value === "bigint") return payload;
1905
1937
  payload.issues.push({
1906
1938
  expected: "bigint",
1907
1939
  code: "invalid_type",
1908
- input,
1940
+ input: payload.value,
1909
1941
  inst
1910
1942
  });
1911
1943
  return payload;
@@ -1918,7 +1950,7 @@ const $ZodBigIntFormat = /* @__PURE__ */ $constructor("$ZodBigInt", (inst, def)
1918
1950
  const $ZodSymbol = /* @__PURE__ */ $constructor("$ZodSymbol", (inst, def) => {
1919
1951
  $ZodType.init(inst, def);
1920
1952
  inst._zod.parse = (payload, _ctx) => {
1921
- const { value: input } = payload;
1953
+ const input = payload.value;
1922
1954
  if (typeof input === "symbol") return payload;
1923
1955
  payload.issues.push({
1924
1956
  expected: "symbol",
@@ -1933,8 +1965,10 @@ const $ZodUndefined = /* @__PURE__ */ $constructor("$ZodUndefined", (inst, def)
1933
1965
  $ZodType.init(inst, def);
1934
1966
  inst._zod.pattern = _undefined$2;
1935
1967
  inst._zod.values = new Set([undefined]);
1968
+ inst._zod.optin = "optional";
1969
+ inst._zod.optout = "optional";
1936
1970
  inst._zod.parse = (payload, _ctx) => {
1937
- const { value: input } = payload;
1971
+ const input = payload.value;
1938
1972
  if (typeof input === "undefined") return payload;
1939
1973
  payload.issues.push({
1940
1974
  expected: "undefined",
@@ -1950,7 +1984,7 @@ const $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
1950
1984
  inst._zod.pattern = _null$2;
1951
1985
  inst._zod.values = new Set([null]);
1952
1986
  inst._zod.parse = (payload, _ctx) => {
1953
- const { value: input } = payload;
1987
+ const input = payload.value;
1954
1988
  if (input === null) return payload;
1955
1989
  payload.issues.push({
1956
1990
  expected: "null",
@@ -1984,7 +2018,7 @@ const $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
1984
2018
  const $ZodVoid = /* @__PURE__ */ $constructor("$ZodVoid", (inst, def) => {
1985
2019
  $ZodType.init(inst, def);
1986
2020
  inst._zod.parse = (payload, _ctx) => {
1987
- const { value: input } = payload;
2021
+ const input = payload.value;
1988
2022
  if (typeof input === "undefined") return payload;
1989
2023
  payload.issues.push({
1990
2024
  expected: "void",
@@ -2115,19 +2149,20 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
2115
2149
  "payload",
2116
2150
  "ctx"
2117
2151
  ]);
2118
- const { keys, optionalKeys: optionalKeys$1 } = _normalized.value;
2152
+ const normalized = _normalized.value;
2119
2153
  const parseStr = (key) => {
2120
2154
  const k = esc(key);
2121
2155
  return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
2122
2156
  };
2123
2157
  doc.write(`const input = payload.value;`);
2124
2158
  const ids = Object.create(null);
2125
- for (const key of keys) {
2126
- ids[key] = randomString(15);
2159
+ let counter = 0;
2160
+ for (const key of normalized.keys) {
2161
+ ids[key] = `key_${counter++}`;
2127
2162
  }
2128
2163
  doc.write(`const newResult = {}`);
2129
- for (const key of keys) {
2130
- if (optionalKeys$1.has(key)) {
2164
+ for (const key of normalized.keys) {
2165
+ if (normalized.optionalKeys.has(key)) {
2131
2166
  const id = ids[key];
2132
2167
  doc.write(`const ${id} = ${parseStr(key)};`);
2133
2168
  const k = esc(key);
@@ -2172,7 +2207,7 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
2172
2207
  const jit = !globalConfig.jitless;
2173
2208
  const allowsEval$1 = allowsEval;
2174
2209
  const fastEnabled = jit && allowsEval$1.value;
2175
- const { catchall } = def;
2210
+ const catchall = def.catchall;
2176
2211
  let value;
2177
2212
  inst._zod.parse = (payload, ctx) => {
2178
2213
  value ?? (value = _normalized.value);
@@ -2202,12 +2237,10 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
2202
2237
  const isOptional = el._zod.optin === "optional" && el._zod.optout === "optional";
2203
2238
  if (r instanceof Promise) {
2204
2239
  proms.push(r.then((r$1) => isOptional ? handleOptionalObjectResult(r$1, payload, key, input) : handleObjectResult(r$1, payload, key)));
2240
+ } else if (isOptional) {
2241
+ handleOptionalObjectResult(r, payload, key, input);
2205
2242
  } else {
2206
- if (isOptional) {
2207
- handleOptionalObjectResult(r, payload, key, input);
2208
- } else {
2209
- handleObjectResult(r, payload, key);
2210
- }
2243
+ handleObjectResult(r, payload, key);
2211
2244
  }
2212
2245
  }
2213
2246
  }
@@ -2265,6 +2298,8 @@ function handleUnionResults(results, final, inst, ctx) {
2265
2298
  }
2266
2299
  const $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
2267
2300
  $ZodType.init(inst, def);
2301
+ defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : undefined);
2302
+ defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : undefined);
2268
2303
  defineLazy(inst._zod, "values", () => {
2269
2304
  if (def.options.every((o) => o._zod.values)) {
2270
2305
  return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
@@ -2364,7 +2399,7 @@ const $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUn
2364
2399
  const $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => {
2365
2400
  $ZodType.init(inst, def);
2366
2401
  inst._zod.parse = (payload, ctx) => {
2367
- const { value: input } = payload;
2402
+ const input = payload.value;
2368
2403
  const left = def.left._zod.run({
2369
2404
  value: input,
2370
2405
  issues: []
@@ -2821,6 +2856,9 @@ const $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) =>
2821
2856
  return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : undefined;
2822
2857
  });
2823
2858
  inst._zod.parse = (payload, ctx) => {
2859
+ if (def.innerType._zod.optin === "optional") {
2860
+ return def.innerType._zod.run(payload, ctx);
2861
+ }
2824
2862
  if (payload.value === undefined) {
2825
2863
  return payload;
2826
2864
  }
@@ -2920,7 +2958,7 @@ const $ZodSuccess = /* @__PURE__ */ $constructor("$ZodSuccess", (inst, def) => {
2920
2958
  });
2921
2959
  const $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
2922
2960
  $ZodType.init(inst, def);
2923
- defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
2961
+ inst._zod.optin = "optional";
2924
2962
  defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
2925
2963
  defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2926
2964
  inst._zod.parse = (payload, ctx) => {
@@ -2991,6 +3029,7 @@ function handlePipeResult(left, def, ctx) {
2991
3029
  const $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => {
2992
3030
  $ZodType.init(inst, def);
2993
3031
  defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
3032
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2994
3033
  defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
2995
3034
  defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
2996
3035
  inst._zod.parse = (payload, ctx) => {
@@ -3041,7 +3080,7 @@ const $ZodTemplateLiteral = /* @__PURE__ */ $constructor("$ZodTemplateLiteral",
3041
3080
  input: payload.value,
3042
3081
  inst,
3043
3082
  code: "invalid_format",
3044
- format: "template_literal",
3083
+ format: def.format ?? "template_literal",
3045
3084
  pattern: inst._zod.pattern.source
3046
3085
  });
3047
3086
  return payload;
@@ -3101,8 +3140,8 @@ function handleRefineResult(result, payload, input, inst) {
3101
3140
  }
3102
3141
 
3103
3142
  //#endregion
3104
- //#region ../../node_modules/zod/dist/esm/v4/locales/ar.js
3105
- const error$36 = () => {
3143
+ //#region ../../node_modules/zod/v4/locales/ar.js
3144
+ const error$38 = () => {
3106
3145
  const Sizable = {
3107
3146
  string: {
3108
3147
  unit: "حرف",
@@ -3124,7 +3163,7 @@ const error$36 = () => {
3124
3163
  function getSizing(origin) {
3125
3164
  return Sizable[origin] ?? null;
3126
3165
  }
3127
- const parsedType$2 = (data) => {
3166
+ const parsedType$3 = (data) => {
3128
3167
  const t = typeof data;
3129
3168
  switch (t) {
3130
3169
  case "number": {
@@ -3176,7 +3215,7 @@ const error$36 = () => {
3176
3215
  };
3177
3216
  return (issue$1) => {
3178
3217
  switch (issue$1.code) {
3179
- case "invalid_type": return `مدخلات غير مقبولة: يفترض إدخال ${issue$1.expected}، ولكن تم إدخال ${parsedType$2(issue$1.input)}`;
3218
+ case "invalid_type": return `مدخلات غير مقبولة: يفترض إدخال ${issue$1.expected}، ولكن تم إدخال ${parsedType$3(issue$1.input)}`;
3180
3219
  case "invalid_value":
3181
3220
  if (issue$1.values.length === 1) return `مدخلات غير مقبولة: يفترض إدخال ${stringifyPrimitive(issue$1.values[0])}`;
3182
3221
  return `اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${joinValues(issue$1.values, "|")}`;
@@ -3212,12 +3251,12 @@ const error$36 = () => {
3212
3251
  };
3213
3252
  };
3214
3253
  function ar_default() {
3215
- return { localeError: error$36() };
3254
+ return { localeError: error$38() };
3216
3255
  }
3217
3256
 
3218
3257
  //#endregion
3219
- //#region ../../node_modules/zod/dist/esm/v4/locales/az.js
3220
- const error$35 = () => {
3258
+ //#region ../../node_modules/zod/v4/locales/az.js
3259
+ const error$37 = () => {
3221
3260
  const Sizable = {
3222
3261
  string: {
3223
3262
  unit: "simvol",
@@ -3239,7 +3278,7 @@ const error$35 = () => {
3239
3278
  function getSizing(origin) {
3240
3279
  return Sizable[origin] ?? null;
3241
3280
  }
3242
- const parsedType$2 = (data) => {
3281
+ const parsedType$3 = (data) => {
3243
3282
  const t = typeof data;
3244
3283
  switch (t) {
3245
3284
  case "number": {
@@ -3291,7 +3330,7 @@ const error$35 = () => {
3291
3330
  };
3292
3331
  return (issue$1) => {
3293
3332
  switch (issue$1.code) {
3294
- case "invalid_type": return `Yanlış dəyər: gözlənilən ${issue$1.expected}, daxil olan ${parsedType$2(issue$1.input)}`;
3333
+ case "invalid_type": return `Yanlış dəyər: gözlənilən ${issue$1.expected}, daxil olan ${parsedType$3(issue$1.input)}`;
3295
3334
  case "invalid_value":
3296
3335
  if (issue$1.values.length === 1) return `Yanlış dəyər: gözlənilən ${stringifyPrimitive(issue$1.values[0])}`;
3297
3336
  return `Yanlış seçim: aşağıdakılardan biri olmalıdır: ${joinValues(issue$1.values, "|")}`;
@@ -3325,11 +3364,11 @@ const error$35 = () => {
3325
3364
  };
3326
3365
  };
3327
3366
  function az_default() {
3328
- return { localeError: error$35() };
3367
+ return { localeError: error$37() };
3329
3368
  }
3330
3369
 
3331
3370
  //#endregion
3332
- //#region ../../node_modules/zod/dist/esm/v4/locales/be.js
3371
+ //#region ../../node_modules/zod/v4/locales/be.js
3333
3372
  function getBelarusianPlural(count, one, few, many) {
3334
3373
  const absCount = Math.abs(count);
3335
3374
  const lastDigit = absCount % 10;
@@ -3345,7 +3384,7 @@ function getBelarusianPlural(count, one, few, many) {
3345
3384
  }
3346
3385
  return many;
3347
3386
  }
3348
- const error$34 = () => {
3387
+ const error$36 = () => {
3349
3388
  const Sizable = {
3350
3389
  string: {
3351
3390
  unit: {
@@ -3383,7 +3422,7 @@ const error$34 = () => {
3383
3422
  function getSizing(origin) {
3384
3423
  return Sizable[origin] ?? null;
3385
3424
  }
3386
- const parsedType$2 = (data) => {
3425
+ const parsedType$3 = (data) => {
3387
3426
  const t = typeof data;
3388
3427
  switch (t) {
3389
3428
  case "number": {
@@ -3435,7 +3474,7 @@ const error$34 = () => {
3435
3474
  };
3436
3475
  return (issue$1) => {
3437
3476
  switch (issue$1.code) {
3438
- case "invalid_type": return `Няправільны ўвод: чакаўся ${issue$1.expected}, атрымана ${parsedType$2(issue$1.input)}`;
3477
+ case "invalid_type": return `Няправільны ўвод: чакаўся ${issue$1.expected}, атрымана ${parsedType$3(issue$1.input)}`;
3439
3478
  case "invalid_value":
3440
3479
  if (issue$1.values.length === 1) return `Няправільны ўвод: чакалася ${stringifyPrimitive(issue$1.values[0])}`;
3441
3480
  return `Няправільны варыянт: чакаўся адзін з ${joinValues(issue$1.values, "|")}`;
@@ -3477,12 +3516,12 @@ const error$34 = () => {
3477
3516
  };
3478
3517
  };
3479
3518
  function be_default() {
3480
- return { localeError: error$34() };
3519
+ return { localeError: error$36() };
3481
3520
  }
3482
3521
 
3483
3522
  //#endregion
3484
- //#region ../../node_modules/zod/dist/esm/v4/locales/ca.js
3485
- const error$33 = () => {
3523
+ //#region ../../node_modules/zod/v4/locales/ca.js
3524
+ const error$35 = () => {
3486
3525
  const Sizable = {
3487
3526
  string: {
3488
3527
  unit: "caràcters",
@@ -3504,7 +3543,7 @@ const error$33 = () => {
3504
3543
  function getSizing(origin) {
3505
3544
  return Sizable[origin] ?? null;
3506
3545
  }
3507
- const parsedType$2 = (data) => {
3546
+ const parsedType$3 = (data) => {
3508
3547
  const t = typeof data;
3509
3548
  switch (t) {
3510
3549
  case "number": {
@@ -3556,7 +3595,7 @@ const error$33 = () => {
3556
3595
  };
3557
3596
  return (issue$1) => {
3558
3597
  switch (issue$1.code) {
3559
- case "invalid_type": return `Tipus invàlid: s'esperava ${issue$1.expected}, s'ha rebut ${parsedType$2(issue$1.input)}`;
3598
+ case "invalid_type": return `Tipus invàlid: s'esperava ${issue$1.expected}, s'ha rebut ${parsedType$3(issue$1.input)}`;
3560
3599
  case "invalid_value":
3561
3600
  if (issue$1.values.length === 1) return `Valor invàlid: s'esperava ${stringifyPrimitive(issue$1.values[0])}`;
3562
3601
  return `Opció invàlida: s'esperava una de ${joinValues(issue$1.values, " o ")}`;
@@ -3594,12 +3633,12 @@ const error$33 = () => {
3594
3633
  };
3595
3634
  };
3596
3635
  function ca_default() {
3597
- return { localeError: error$33() };
3636
+ return { localeError: error$35() };
3598
3637
  }
3599
3638
 
3600
3639
  //#endregion
3601
- //#region ../../node_modules/zod/dist/esm/v4/locales/cs.js
3602
- const error$32 = () => {
3640
+ //#region ../../node_modules/zod/v4/locales/cs.js
3641
+ const error$34 = () => {
3603
3642
  const Sizable = {
3604
3643
  string: {
3605
3644
  unit: "znaků",
@@ -3621,7 +3660,7 @@ const error$32 = () => {
3621
3660
  function getSizing(origin) {
3622
3661
  return Sizable[origin] ?? null;
3623
3662
  }
3624
- const parsedType$2 = (data) => {
3663
+ const parsedType$3 = (data) => {
3625
3664
  const t = typeof data;
3626
3665
  switch (t) {
3627
3666
  case "number": {
@@ -3691,7 +3730,7 @@ const error$32 = () => {
3691
3730
  };
3692
3731
  return (issue$1) => {
3693
3732
  switch (issue$1.code) {
3694
- case "invalid_type": return `Neplatný vstup: očekáváno ${issue$1.expected}, obdrženo ${parsedType$2(issue$1.input)}`;
3733
+ case "invalid_type": return `Neplatný vstup: očekáváno ${issue$1.expected}, obdrženo ${parsedType$3(issue$1.input)}`;
3695
3734
  case "invalid_value":
3696
3735
  if (issue$1.values.length === 1) return `Neplatný vstup: očekáváno ${stringifyPrimitive(issue$1.values[0])}`;
3697
3736
  return `Neplatná možnost: očekávána jedna z hodnot ${joinValues(issue$1.values, "|")}`;
@@ -3729,12 +3768,12 @@ const error$32 = () => {
3729
3768
  };
3730
3769
  };
3731
3770
  function cs_default() {
3732
- return { localeError: error$32() };
3771
+ return { localeError: error$34() };
3733
3772
  }
3734
3773
 
3735
3774
  //#endregion
3736
- //#region ../../node_modules/zod/dist/esm/v4/locales/de.js
3737
- const error$31 = () => {
3775
+ //#region ../../node_modules/zod/v4/locales/de.js
3776
+ const error$33 = () => {
3738
3777
  const Sizable = {
3739
3778
  string: {
3740
3779
  unit: "Zeichen",
@@ -3756,7 +3795,7 @@ const error$31 = () => {
3756
3795
  function getSizing(origin) {
3757
3796
  return Sizable[origin] ?? null;
3758
3797
  }
3759
- const parsedType$2 = (data) => {
3798
+ const parsedType$3 = (data) => {
3760
3799
  const t = typeof data;
3761
3800
  switch (t) {
3762
3801
  case "number": {
@@ -3808,7 +3847,7 @@ const error$31 = () => {
3808
3847
  };
3809
3848
  return (issue$1) => {
3810
3849
  switch (issue$1.code) {
3811
- case "invalid_type": return `Ungültige Eingabe: erwartet ${issue$1.expected}, erhalten ${parsedType$2(issue$1.input)}`;
3850
+ case "invalid_type": return `Ungültige Eingabe: erwartet ${issue$1.expected}, erhalten ${parsedType$3(issue$1.input)}`;
3812
3851
  case "invalid_value":
3813
3852
  if (issue$1.values.length === 1) return `Ungültige Eingabe: erwartet ${stringifyPrimitive(issue$1.values[0])}`;
3814
3853
  return `Ungültige Option: erwartet eine von ${joinValues(issue$1.values, "|")}`;
@@ -3844,12 +3883,12 @@ const error$31 = () => {
3844
3883
  };
3845
3884
  };
3846
3885
  function de_default() {
3847
- return { localeError: error$31() };
3886
+ return { localeError: error$33() };
3848
3887
  }
3849
3888
 
3850
3889
  //#endregion
3851
- //#region ../../node_modules/zod/dist/esm/v4/locales/en.js
3852
- const parsedType$1 = (data) => {
3890
+ //#region ../../node_modules/zod/v4/locales/en.js
3891
+ const parsedType$2 = (data) => {
3853
3892
  const t = typeof data;
3854
3893
  switch (t) {
3855
3894
  case "number": {
@@ -3869,7 +3908,7 @@ const parsedType$1 = (data) => {
3869
3908
  }
3870
3909
  return t;
3871
3910
  };
3872
- const error$30 = () => {
3911
+ const error$32 = () => {
3873
3912
  const Sizable = {
3874
3913
  string: {
3875
3914
  unit: "characters",
@@ -3923,7 +3962,7 @@ const error$30 = () => {
3923
3962
  };
3924
3963
  return (issue$1) => {
3925
3964
  switch (issue$1.code) {
3926
- case "invalid_type": return `Invalid input: expected ${issue$1.expected}, received ${parsedType$1(issue$1.input)}`;
3965
+ case "invalid_type": return `Invalid input: expected ${issue$1.expected}, received ${parsedType$2(issue$1.input)}`;
3927
3966
  case "invalid_value":
3928
3967
  if (issue$1.values.length === 1) return `Invalid input: expected ${stringifyPrimitive(issue$1.values[0])}`;
3929
3968
  return `Invalid option: expected one of ${joinValues(issue$1.values, "|")}`;
@@ -3961,12 +4000,127 @@ const error$30 = () => {
3961
4000
  };
3962
4001
  };
3963
4002
  function en_default() {
3964
- return { localeError: error$30() };
4003
+ return { localeError: error$32() };
3965
4004
  }
3966
4005
 
3967
4006
  //#endregion
3968
- //#region ../../node_modules/zod/dist/esm/v4/locales/es.js
3969
- const error$29 = () => {
4007
+ //#region ../../node_modules/zod/v4/locales/eo.js
4008
+ const parsedType$1 = (data) => {
4009
+ const t = typeof data;
4010
+ switch (t) {
4011
+ case "number": {
4012
+ return Number.isNaN(data) ? "NaN" : "nombro";
4013
+ }
4014
+ case "object": {
4015
+ if (Array.isArray(data)) {
4016
+ return "tabelo";
4017
+ }
4018
+ if (data === null) {
4019
+ return "senvalora";
4020
+ }
4021
+ if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
4022
+ return data.constructor.name;
4023
+ }
4024
+ }
4025
+ }
4026
+ return t;
4027
+ };
4028
+ const error$31 = () => {
4029
+ const Sizable = {
4030
+ string: {
4031
+ unit: "karaktrojn",
4032
+ verb: "havi"
4033
+ },
4034
+ file: {
4035
+ unit: "bajtojn",
4036
+ verb: "havi"
4037
+ },
4038
+ array: {
4039
+ unit: "elementojn",
4040
+ verb: "havi"
4041
+ },
4042
+ set: {
4043
+ unit: "elementojn",
4044
+ verb: "havi"
4045
+ }
4046
+ };
4047
+ function getSizing(origin) {
4048
+ return Sizable[origin] ?? null;
4049
+ }
4050
+ const Nouns = {
4051
+ regex: "enigo",
4052
+ email: "retadreso",
4053
+ url: "URL",
4054
+ emoji: "emoĝio",
4055
+ uuid: "UUID",
4056
+ uuidv4: "UUIDv4",
4057
+ uuidv6: "UUIDv6",
4058
+ nanoid: "nanoid",
4059
+ guid: "GUID",
4060
+ cuid: "cuid",
4061
+ cuid2: "cuid2",
4062
+ ulid: "ULID",
4063
+ xid: "XID",
4064
+ ksuid: "KSUID",
4065
+ datetime: "ISO-datotempo",
4066
+ date: "ISO-dato",
4067
+ time: "ISO-tempo",
4068
+ duration: "ISO-daŭro",
4069
+ ipv4: "IPv4-adreso",
4070
+ ipv6: "IPv6-adreso",
4071
+ cidrv4: "IPv4-rango",
4072
+ cidrv6: "IPv6-rango",
4073
+ base64: "64-ume kodita karaktraro",
4074
+ base64url: "URL-64-ume kodita karaktraro",
4075
+ json_string: "JSON-karaktraro",
4076
+ e164: "E.164-nombro",
4077
+ jwt: "JWT",
4078
+ template_literal: "enigo"
4079
+ };
4080
+ return (issue$1) => {
4081
+ switch (issue$1.code) {
4082
+ case "invalid_type": return `Nevalida enigo: atendiĝis ${issue$1.expected}, riceviĝis ${parsedType$1(issue$1.input)}`;
4083
+ case "invalid_value":
4084
+ if (issue$1.values.length === 1) return `Nevalida enigo: atendiĝis ${stringifyPrimitive(issue$1.values[0])}`;
4085
+ return `Nevalida opcio: atendiĝis unu el ${joinValues(issue$1.values, "|")}`;
4086
+ case "too_big": {
4087
+ const adj = issue$1.inclusive ? "<=" : "<";
4088
+ const sizing = getSizing(issue$1.origin);
4089
+ if (sizing) return `Tro granda: atendiĝis ke ${issue$1.origin ?? "valoro"} havu ${adj}${issue$1.maximum.toString()} ${sizing.unit ?? "elementojn"}`;
4090
+ return `Tro granda: atendiĝis ke ${issue$1.origin ?? "valoro"} havu ${adj}${issue$1.maximum.toString()}`;
4091
+ }
4092
+ case "too_small": {
4093
+ const adj = issue$1.inclusive ? ">=" : ">";
4094
+ const sizing = getSizing(issue$1.origin);
4095
+ if (sizing) {
4096
+ return `Tro malgranda: atendiĝis ke ${issue$1.origin} havu ${adj}${issue$1.minimum.toString()} ${sizing.unit}`;
4097
+ }
4098
+ return `Tro malgranda: atendiĝis ke ${issue$1.origin} estu ${adj}${issue$1.minimum.toString()}`;
4099
+ }
4100
+ case "invalid_format": {
4101
+ const _issue = issue$1;
4102
+ if (_issue.format === "starts_with") return `Nevalida karaktraro: devas komenciĝi per "${_issue.prefix}"`;
4103
+ if (_issue.format === "ends_with") return `Nevalida karaktraro: devas finiĝi per "${_issue.suffix}"`;
4104
+ if (_issue.format === "includes") return `Nevalida karaktraro: devas inkluzivi "${_issue.includes}"`;
4105
+ if (_issue.format === "regex") return `Nevalida karaktraro: devas kongrui kun la modelo ${_issue.pattern}`;
4106
+ return `Nevalida ${Nouns[_issue.format] ?? issue$1.format}`;
4107
+ }
4108
+ case "not_multiple_of": return `Nevalida nombro: devas esti oblo de ${issue$1.divisor}`;
4109
+ case "unrecognized_keys": return `Nekonata${issue$1.keys.length > 1 ? "j" : ""} ŝlosilo${issue$1.keys.length > 1 ? "j" : ""}: ${joinValues(issue$1.keys, ", ")}`;
4110
+ case "invalid_key": return `Nevalida ŝlosilo en ${issue$1.origin}`;
4111
+ case "invalid_union": return "Nevalida enigo";
4112
+ case "invalid_element": return `Nevalida valoro en ${issue$1.origin}`;
4113
+ default: return `Nevalida enigo`;
4114
+ }
4115
+ };
4116
+ };
4117
+ function eo_default() {
4118
+ return { localeError: error$31() };
4119
+ }
4120
+
4121
+ //#endregion
4122
+ //#region ../../node_modules/zod/v4/locales/es.js
4123
+ const error$30 = () => {
3970
4124
  const Sizable = {
3971
4125
  string: {
3972
4126
  unit: "caracteres",
@@ -3988,7 +4142,7 @@ const error$29 = () => {
3988
4142
  function getSizing(origin) {
3989
4143
  return Sizable[origin] ?? null;
3990
4144
  }
3991
- const parsedType$2 = (data) => {
4145
+ const parsedType$3 = (data) => {
3992
4146
  const t = typeof data;
3993
4147
  switch (t) {
3994
4148
  case "number": {
@@ -4040,7 +4194,7 @@ const error$29 = () => {
4040
4194
  };
4041
4195
  return (issue$1) => {
4042
4196
  switch (issue$1.code) {
4043
- case "invalid_type": return `Entrada inválida: se esperaba ${issue$1.expected}, recibido ${parsedType$2(issue$1.input)}`;
4197
+ case "invalid_type": return `Entrada inválida: se esperaba ${issue$1.expected}, recibido ${parsedType$3(issue$1.input)}`;
4044
4198
  case "invalid_value":
4045
4199
  if (issue$1.values.length === 1) return `Entrada inválida: se esperaba ${stringifyPrimitive(issue$1.values[0])}`;
4046
4200
  return `Opción inválida: se esperaba una de ${joinValues(issue$1.values, "|")}`;
@@ -4076,12 +4230,12 @@ const error$29 = () => {
4076
4230
  };
4077
4231
  };
4078
4232
  function es_default() {
4079
- return { localeError: error$29() };
4233
+ return { localeError: error$30() };
4080
4234
  }
4081
4235
 
4082
4236
  //#endregion
4083
- //#region ../../node_modules/zod/dist/esm/v4/locales/fa.js
4084
- const error$28 = () => {
4237
+ //#region ../../node_modules/zod/v4/locales/fa.js
4238
+ const error$29 = () => {
4085
4239
  const Sizable = {
4086
4240
  string: {
4087
4241
  unit: "کاراکتر",
@@ -4103,7 +4257,7 @@ const error$28 = () => {
4103
4257
  function getSizing(origin) {
4104
4258
  return Sizable[origin] ?? null;
4105
4259
  }
4106
- const parsedType$2 = (data) => {
4260
+ const parsedType$3 = (data) => {
4107
4261
  const t = typeof data;
4108
4262
  switch (t) {
4109
4263
  case "number": {
@@ -4155,7 +4309,7 @@ const error$28 = () => {
4155
4309
  };
4156
4310
  return (issue$1) => {
4157
4311
  switch (issue$1.code) {
4158
- case "invalid_type": return `ورودی نامعتبر: می‌بایست ${issue$1.expected} می‌بود، ${parsedType$2(issue$1.input)} دریافت شد`;
4312
+ case "invalid_type": return `ورودی نامعتبر: می‌بایست ${issue$1.expected} می‌بود، ${parsedType$3(issue$1.input)} دریافت شد`;
4159
4313
  case "invalid_value":
4160
4314
  if (issue$1.values.length === 1) {
4161
4315
  return `ورودی نامعتبر: می‌بایست ${stringifyPrimitive(issue$1.values[0])} می‌بود`;
@@ -4203,12 +4357,12 @@ const error$28 = () => {
4203
4357
  };
4204
4358
  };
4205
4359
  function fa_default() {
4206
- return { localeError: error$28() };
4360
+ return { localeError: error$29() };
4207
4361
  }
4208
4362
 
4209
4363
  //#endregion
4210
- //#region ../../node_modules/zod/dist/esm/v4/locales/fi.js
4211
- const error$27 = () => {
4364
+ //#region ../../node_modules/zod/v4/locales/fi.js
4365
+ const error$28 = () => {
4212
4366
  const Sizable = {
4213
4367
  string: {
4214
4368
  unit: "merkkiä",
@@ -4246,7 +4400,7 @@ const error$27 = () => {
4246
4400
  function getSizing(origin) {
4247
4401
  return Sizable[origin] ?? null;
4248
4402
  }
4249
- const parsedType$2 = (data) => {
4403
+ const parsedType$3 = (data) => {
4250
4404
  const t = typeof data;
4251
4405
  switch (t) {
4252
4406
  case "number": {
@@ -4298,7 +4452,7 @@ const error$27 = () => {
4298
4452
  };
4299
4453
  return (issue$1) => {
4300
4454
  switch (issue$1.code) {
4301
- case "invalid_type": return `Virheellinen tyyppi: odotettiin ${issue$1.expected}, oli ${parsedType$2(issue$1.input)}`;
4455
+ case "invalid_type": return `Virheellinen tyyppi: odotettiin ${issue$1.expected}, oli ${parsedType$3(issue$1.input)}`;
4302
4456
  case "invalid_value":
4303
4457
  if (issue$1.values.length === 1) return `Virheellinen syöte: täytyy olla ${stringifyPrimitive(issue$1.values[0])}`;
4304
4458
  return `Virheellinen valinta: täytyy olla yksi seuraavista: ${joinValues(issue$1.values, "|")}`;
@@ -4338,12 +4492,12 @@ const error$27 = () => {
4338
4492
  };
4339
4493
  };
4340
4494
  function fi_default() {
4341
- return { localeError: error$27() };
4495
+ return { localeError: error$28() };
4342
4496
  }
4343
4497
 
4344
4498
  //#endregion
4345
- //#region ../../node_modules/zod/dist/esm/v4/locales/fr.js
4346
- const error$26 = () => {
4499
+ //#region ../../node_modules/zod/v4/locales/fr.js
4500
+ const error$27 = () => {
4347
4501
  const Sizable = {
4348
4502
  string: {
4349
4503
  unit: "caractères",
@@ -4365,7 +4519,7 @@ const error$26 = () => {
4365
4519
  function getSizing(origin) {
4366
4520
  return Sizable[origin] ?? null;
4367
4521
  }
4368
- const parsedType$2 = (data) => {
4522
+ const parsedType$3 = (data) => {
4369
4523
  const t = typeof data;
4370
4524
  switch (t) {
4371
4525
  case "number": {
@@ -4417,7 +4571,7 @@ const error$26 = () => {
4417
4571
  };
4418
4572
  return (issue$1) => {
4419
4573
  switch (issue$1.code) {
4420
- case "invalid_type": return `Entrée invalide : ${issue$1.expected} attendu, ${parsedType$2(issue$1.input)} reçu`;
4574
+ case "invalid_type": return `Entrée invalide : ${issue$1.expected} attendu, ${parsedType$3(issue$1.input)} reçu`;
4421
4575
  case "invalid_value":
4422
4576
  if (issue$1.values.length === 1) return `Entrée invalide : ${stringifyPrimitive(issue$1.values[0])} attendu`;
4423
4577
  return `Option invalide : une valeur parmi ${joinValues(issue$1.values, "|")} attendue`;
@@ -4453,12 +4607,12 @@ const error$26 = () => {
4453
4607
  };
4454
4608
  };
4455
4609
  function fr_default() {
4456
- return { localeError: error$26() };
4610
+ return { localeError: error$27() };
4457
4611
  }
4458
4612
 
4459
4613
  //#endregion
4460
- //#region ../../node_modules/zod/dist/esm/v4/locales/fr-CA.js
4461
- const error$25 = () => {
4614
+ //#region ../../node_modules/zod/v4/locales/fr-CA.js
4615
+ const error$26 = () => {
4462
4616
  const Sizable = {
4463
4617
  string: {
4464
4618
  unit: "caractères",
@@ -4480,7 +4634,7 @@ const error$25 = () => {
4480
4634
  function getSizing(origin) {
4481
4635
  return Sizable[origin] ?? null;
4482
4636
  }
4483
- const parsedType$2 = (data) => {
4637
+ const parsedType$3 = (data) => {
4484
4638
  const t = typeof data;
4485
4639
  switch (t) {
4486
4640
  case "number": {
@@ -4532,7 +4686,7 @@ const error$25 = () => {
4532
4686
  };
4533
4687
  return (issue$1) => {
4534
4688
  switch (issue$1.code) {
4535
- case "invalid_type": return `Entrée invalide : attendu ${issue$1.expected}, reçu ${parsedType$2(issue$1.input)}`;
4689
+ case "invalid_type": return `Entrée invalide : attendu ${issue$1.expected}, reçu ${parsedType$3(issue$1.input)}`;
4536
4690
  case "invalid_value":
4537
4691
  if (issue$1.values.length === 1) return `Entrée invalide : attendu ${stringifyPrimitive(issue$1.values[0])}`;
4538
4692
  return `Option invalide : attendu l'une des valeurs suivantes ${joinValues(issue$1.values, "|")}`;
@@ -4570,12 +4724,12 @@ const error$25 = () => {
4570
4724
  };
4571
4725
  };
4572
4726
  function fr_CA_default() {
4573
- return { localeError: error$25() };
4727
+ return { localeError: error$26() };
4574
4728
  }
4575
4729
 
4576
4730
  //#endregion
4577
- //#region ../../node_modules/zod/dist/esm/v4/locales/he.js
4578
- const error$24 = () => {
4731
+ //#region ../../node_modules/zod/v4/locales/he.js
4732
+ const error$25 = () => {
4579
4733
  const Sizable = {
4580
4734
  string: {
4581
4735
  unit: "אותיות",
@@ -4597,7 +4751,7 @@ const error$24 = () => {
4597
4751
  function getSizing(origin) {
4598
4752
  return Sizable[origin] ?? null;
4599
4753
  }
4600
- const parsedType$2 = (data) => {
4754
+ const parsedType$3 = (data) => {
4601
4755
  const t = typeof data;
4602
4756
  switch (t) {
4603
4757
  case "number": {
@@ -4649,7 +4803,7 @@ const error$24 = () => {
4649
4803
  };
4650
4804
  return (issue$1) => {
4651
4805
  switch (issue$1.code) {
4652
- case "invalid_type": return `קלט לא תקין: צריך ${issue$1.expected}, התקבל ${parsedType$2(issue$1.input)}`;
4806
+ case "invalid_type": return `קלט לא תקין: צריך ${issue$1.expected}, התקבל ${parsedType$3(issue$1.input)}`;
4653
4807
  case "invalid_value":
4654
4808
  if (issue$1.values.length === 1) return `קלט לא תקין: צריך ${stringifyPrimitive(issue$1.values[0])}`;
4655
4809
  return `קלט לא תקין: צריך אחת מהאפשרויות ${joinValues(issue$1.values, "|")}`;
@@ -4685,12 +4839,12 @@ const error$24 = () => {
4685
4839
  };
4686
4840
  };
4687
4841
  function he_default() {
4688
- return { localeError: error$24() };
4842
+ return { localeError: error$25() };
4689
4843
  }
4690
4844
 
4691
4845
  //#endregion
4692
- //#region ../../node_modules/zod/dist/esm/v4/locales/hu.js
4693
- const error$23 = () => {
4846
+ //#region ../../node_modules/zod/v4/locales/hu.js
4847
+ const error$24 = () => {
4694
4848
  const Sizable = {
4695
4849
  string: {
4696
4850
  unit: "karakter",
@@ -4712,7 +4866,7 @@ const error$23 = () => {
4712
4866
  function getSizing(origin) {
4713
4867
  return Sizable[origin] ?? null;
4714
4868
  }
4715
- const parsedType$2 = (data) => {
4869
+ const parsedType$3 = (data) => {
4716
4870
  const t = typeof data;
4717
4871
  switch (t) {
4718
4872
  case "number": {
@@ -4764,7 +4918,7 @@ const error$23 = () => {
4764
4918
  };
4765
4919
  return (issue$1) => {
4766
4920
  switch (issue$1.code) {
4767
- case "invalid_type": return `Érvénytelen bemenet: a várt érték ${issue$1.expected}, a kapott érték ${parsedType$2(issue$1.input)}`;
4921
+ case "invalid_type": return `Érvénytelen bemenet: a várt érték ${issue$1.expected}, a kapott érték ${parsedType$3(issue$1.input)}`;
4768
4922
  case "invalid_value":
4769
4923
  if (issue$1.values.length === 1) return `Érvénytelen bemenet: a várt érték ${stringifyPrimitive(issue$1.values[0])}`;
4770
4924
  return `Érvénytelen opció: valamelyik érték várt ${joinValues(issue$1.values, "|")}`;
@@ -4800,12 +4954,12 @@ const error$23 = () => {
4800
4954
  };
4801
4955
  };
4802
4956
  function hu_default() {
4803
- return { localeError: error$23() };
4957
+ return { localeError: error$24() };
4804
4958
  }
4805
4959
 
4806
4960
  //#endregion
4807
- //#region ../../node_modules/zod/dist/esm/v4/locales/id.js
4808
- const error$22 = () => {
4961
+ //#region ../../node_modules/zod/v4/locales/id.js
4962
+ const error$23 = () => {
4809
4963
  const Sizable = {
4810
4964
  string: {
4811
4965
  unit: "karakter",
@@ -4827,7 +4981,7 @@ const error$22 = () => {
4827
4981
  function getSizing(origin) {
4828
4982
  return Sizable[origin] ?? null;
4829
4983
  }
4830
- const parsedType$2 = (data) => {
4984
+ const parsedType$3 = (data) => {
4831
4985
  const t = typeof data;
4832
4986
  switch (t) {
4833
4987
  case "number": {
@@ -4879,7 +5033,7 @@ const error$22 = () => {
4879
5033
  };
4880
5034
  return (issue$1) => {
4881
5035
  switch (issue$1.code) {
4882
- case "invalid_type": return `Input tidak valid: diharapkan ${issue$1.expected}, diterima ${parsedType$2(issue$1.input)}`;
5036
+ case "invalid_type": return `Input tidak valid: diharapkan ${issue$1.expected}, diterima ${parsedType$3(issue$1.input)}`;
4883
5037
  case "invalid_value":
4884
5038
  if (issue$1.values.length === 1) return `Input tidak valid: diharapkan ${stringifyPrimitive(issue$1.values[0])}`;
4885
5039
  return `Pilihan tidak valid: diharapkan salah satu dari ${joinValues(issue$1.values, "|")}`;
@@ -4915,12 +5069,12 @@ const error$22 = () => {
4915
5069
  };
4916
5070
  };
4917
5071
  function id_default() {
4918
- return { localeError: error$22() };
5072
+ return { localeError: error$23() };
4919
5073
  }
4920
5074
 
4921
5075
  //#endregion
4922
- //#region ../../node_modules/zod/dist/esm/v4/locales/it.js
4923
- const error$21 = () => {
5076
+ //#region ../../node_modules/zod/v4/locales/it.js
5077
+ const error$22 = () => {
4924
5078
  const Sizable = {
4925
5079
  string: {
4926
5080
  unit: "caratteri",
@@ -4942,7 +5096,7 @@ const error$21 = () => {
4942
5096
  function getSizing(origin) {
4943
5097
  return Sizable[origin] ?? null;
4944
5098
  }
4945
- const parsedType$2 = (data) => {
5099
+ const parsedType$3 = (data) => {
4946
5100
  const t = typeof data;
4947
5101
  switch (t) {
4948
5102
  case "number": {
@@ -4994,7 +5148,7 @@ const error$21 = () => {
4994
5148
  };
4995
5149
  return (issue$1) => {
4996
5150
  switch (issue$1.code) {
4997
- case "invalid_type": return `Input non valido: atteso ${issue$1.expected}, ricevuto ${parsedType$2(issue$1.input)}`;
5151
+ case "invalid_type": return `Input non valido: atteso ${issue$1.expected}, ricevuto ${parsedType$3(issue$1.input)}`;
4998
5152
  case "invalid_value":
4999
5153
  if (issue$1.values.length === 1) return `Input non valido: atteso ${stringifyPrimitive(issue$1.values[0])}`;
5000
5154
  return `Opzione non valida: atteso uno tra ${joinValues(issue$1.values, "|")}`;
@@ -5030,12 +5184,12 @@ const error$21 = () => {
5030
5184
  };
5031
5185
  };
5032
5186
  function it_default() {
5033
- return { localeError: error$21() };
5187
+ return { localeError: error$22() };
5034
5188
  }
5035
5189
 
5036
5190
  //#endregion
5037
- //#region ../../node_modules/zod/dist/esm/v4/locales/ja.js
5038
- const error$20 = () => {
5191
+ //#region ../../node_modules/zod/v4/locales/ja.js
5192
+ const error$21 = () => {
5039
5193
  const Sizable = {
5040
5194
  string: {
5041
5195
  unit: "文字",
@@ -5057,7 +5211,7 @@ const error$20 = () => {
5057
5211
  function getSizing(origin) {
5058
5212
  return Sizable[origin] ?? null;
5059
5213
  }
5060
- const parsedType$2 = (data) => {
5214
+ const parsedType$3 = (data) => {
5061
5215
  const t = typeof data;
5062
5216
  switch (t) {
5063
5217
  case "number": {
@@ -5109,21 +5263,21 @@ const error$20 = () => {
5109
5263
  };
5110
5264
  return (issue$1) => {
5111
5265
  switch (issue$1.code) {
5112
- case "invalid_type": return `無効な入力: ${issue$1.expected}が期待されましたが、${parsedType$2(issue$1.input)}が入力されました`;
5266
+ case "invalid_type": return `無効な入力: ${issue$1.expected}が期待されましたが、${parsedType$3(issue$1.input)}が入力されました`;
5113
5267
  case "invalid_value":
5114
5268
  if (issue$1.values.length === 1) return `無効な入力: ${stringifyPrimitive(issue$1.values[0])}が期待されました`;
5115
5269
  return `無効な選択: ${joinValues(issue$1.values, "、")}のいずれかである必要があります`;
5116
5270
  case "too_big": {
5117
- const adj = issue$1.inclusive ? "<=" : "<";
5271
+ const adj = issue$1.inclusive ? "以下である" : "より小さい";
5118
5272
  const sizing = getSizing(issue$1.origin);
5119
- if (sizing) return `大きすぎる値: ${issue$1.origin ?? "値"}は${issue$1.maximum.toString()}${sizing.unit ?? "要素"}${adj}である必要があります`;
5120
- return `大きすぎる値: ${issue$1.origin ?? "値"}は${issue$1.maximum.toString()}${adj}である必要があります`;
5273
+ if (sizing) return `大きすぎる値: ${issue$1.origin ?? "値"}は${issue$1.maximum.toString()}${sizing.unit ?? "要素"}${adj}必要があります`;
5274
+ return `大きすぎる値: ${issue$1.origin ?? "値"}は${issue$1.maximum.toString()}${adj}必要があります`;
5121
5275
  }
5122
5276
  case "too_small": {
5123
- const adj = issue$1.inclusive ? ">=" : ">";
5277
+ const adj = issue$1.inclusive ? "以上である" : "より大きい";
5124
5278
  const sizing = getSizing(issue$1.origin);
5125
- if (sizing) return `小さすぎる値: ${issue$1.origin}は${issue$1.minimum.toString()}${sizing.unit}${adj}である必要があります`;
5126
- return `小さすぎる値: ${issue$1.origin}は${issue$1.minimum.toString()}${adj}である必要があります`;
5279
+ if (sizing) return `小さすぎる値: ${issue$1.origin}は${issue$1.minimum.toString()}${sizing.unit}${adj}必要があります`;
5280
+ return `小さすぎる値: ${issue$1.origin}は${issue$1.minimum.toString()}${adj}必要があります`;
5127
5281
  }
5128
5282
  case "invalid_format": {
5129
5283
  const _issue = issue$1;
@@ -5143,12 +5297,12 @@ const error$20 = () => {
5143
5297
  };
5144
5298
  };
5145
5299
  function ja_default() {
5146
- return { localeError: error$20() };
5300
+ return { localeError: error$21() };
5147
5301
  }
5148
5302
 
5149
5303
  //#endregion
5150
- //#region ../../node_modules/zod/dist/esm/v4/locales/kh.js
5151
- const error$19 = () => {
5304
+ //#region ../../node_modules/zod/v4/locales/kh.js
5305
+ const error$20 = () => {
5152
5306
  const Sizable = {
5153
5307
  string: {
5154
5308
  unit: "តួអក្សរ",
@@ -5170,7 +5324,7 @@ const error$19 = () => {
5170
5324
  function getSizing(origin) {
5171
5325
  return Sizable[origin] ?? null;
5172
5326
  }
5173
- const parsedType$2 = (data) => {
5327
+ const parsedType$3 = (data) => {
5174
5328
  const t = typeof data;
5175
5329
  switch (t) {
5176
5330
  case "number": {
@@ -5222,7 +5376,7 @@ const error$19 = () => {
5222
5376
  };
5223
5377
  return (issue$1) => {
5224
5378
  switch (issue$1.code) {
5225
- case "invalid_type": return `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${issue$1.expected} ប៉ុន្តែទទួលបាន ${parsedType$2(issue$1.input)}`;
5379
+ case "invalid_type": return `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${issue$1.expected} ប៉ុន្តែទទួលបាន ${parsedType$3(issue$1.input)}`;
5226
5380
  case "invalid_value":
5227
5381
  if (issue$1.values.length === 1) return `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${stringifyPrimitive(issue$1.values[0])}`;
5228
5382
  return `ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${joinValues(issue$1.values, "|")}`;
@@ -5260,12 +5414,12 @@ const error$19 = () => {
5260
5414
  };
5261
5415
  };
5262
5416
  function kh_default() {
5263
- return { localeError: error$19() };
5417
+ return { localeError: error$20() };
5264
5418
  }
5265
5419
 
5266
5420
  //#endregion
5267
- //#region ../../node_modules/zod/dist/esm/v4/locales/ko.js
5268
- const error$18 = () => {
5421
+ //#region ../../node_modules/zod/v4/locales/ko.js
5422
+ const error$19 = () => {
5269
5423
  const Sizable = {
5270
5424
  string: {
5271
5425
  unit: "문자",
@@ -5287,7 +5441,7 @@ const error$18 = () => {
5287
5441
  function getSizing(origin) {
5288
5442
  return Sizable[origin] ?? null;
5289
5443
  }
5290
- const parsedType$2 = (data) => {
5444
+ const parsedType$3 = (data) => {
5291
5445
  const t = typeof data;
5292
5446
  switch (t) {
5293
5447
  case "number": {
@@ -5339,7 +5493,7 @@ const error$18 = () => {
5339
5493
  };
5340
5494
  return (issue$1) => {
5341
5495
  switch (issue$1.code) {
5342
- case "invalid_type": return `잘못된 입력: 예상 타입은 ${issue$1.expected}, 받은 타입은 ${parsedType$2(issue$1.input)}입니다`;
5496
+ case "invalid_type": return `잘못된 입력: 예상 타입은 ${issue$1.expected}, 받은 타입은 ${parsedType$3(issue$1.input)}입니다`;
5343
5497
  case "invalid_value":
5344
5498
  if (issue$1.values.length === 1) return `잘못된 입력: 값은 ${stringifyPrimitive(issue$1.values[0])} 이어야 합니다`;
5345
5499
  return `잘못된 옵션: ${joinValues(issue$1.values, "또는 ")} 중 하나여야 합니다`;
@@ -5381,12 +5535,12 @@ const error$18 = () => {
5381
5535
  };
5382
5536
  };
5383
5537
  function ko_default() {
5384
- return { localeError: error$18() };
5538
+ return { localeError: error$19() };
5385
5539
  }
5386
5540
 
5387
5541
  //#endregion
5388
- //#region ../../node_modules/zod/dist/esm/v4/locales/mk.js
5389
- const error$17 = () => {
5542
+ //#region ../../node_modules/zod/v4/locales/mk.js
5543
+ const error$18 = () => {
5390
5544
  const Sizable = {
5391
5545
  string: {
5392
5546
  unit: "знаци",
@@ -5408,7 +5562,7 @@ const error$17 = () => {
5408
5562
  function getSizing(origin) {
5409
5563
  return Sizable[origin] ?? null;
5410
5564
  }
5411
- const parsedType$2 = (data) => {
5565
+ const parsedType$3 = (data) => {
5412
5566
  const t = typeof data;
5413
5567
  switch (t) {
5414
5568
  case "number": {
@@ -5460,7 +5614,7 @@ const error$17 = () => {
5460
5614
  };
5461
5615
  return (issue$1) => {
5462
5616
  switch (issue$1.code) {
5463
- case "invalid_type": return `Грешен внес: се очекува ${issue$1.expected}, примено ${parsedType$2(issue$1.input)}`;
5617
+ case "invalid_type": return `Грешен внес: се очекува ${issue$1.expected}, примено ${parsedType$3(issue$1.input)}`;
5464
5618
  case "invalid_value":
5465
5619
  if (issue$1.values.length === 1) return `Invalid input: expected ${stringifyPrimitive(issue$1.values[0])}`;
5466
5620
  return `Грешана опција: се очекува една ${joinValues(issue$1.values, "|")}`;
@@ -5498,12 +5652,12 @@ const error$17 = () => {
5498
5652
  };
5499
5653
  };
5500
5654
  function mk_default() {
5501
- return { localeError: error$17() };
5655
+ return { localeError: error$18() };
5502
5656
  }
5503
5657
 
5504
5658
  //#endregion
5505
- //#region ../../node_modules/zod/dist/esm/v4/locales/ms.js
5506
- const error$16 = () => {
5659
+ //#region ../../node_modules/zod/v4/locales/ms.js
5660
+ const error$17 = () => {
5507
5661
  const Sizable = {
5508
5662
  string: {
5509
5663
  unit: "aksara",
@@ -5525,7 +5679,7 @@ const error$16 = () => {
5525
5679
  function getSizing(origin) {
5526
5680
  return Sizable[origin] ?? null;
5527
5681
  }
5528
- const parsedType$2 = (data) => {
5682
+ const parsedType$3 = (data) => {
5529
5683
  const t = typeof data;
5530
5684
  switch (t) {
5531
5685
  case "number": {
@@ -5577,7 +5731,7 @@ const error$16 = () => {
5577
5731
  };
5578
5732
  return (issue$1) => {
5579
5733
  switch (issue$1.code) {
5580
- case "invalid_type": return `Input tidak sah: dijangka ${issue$1.expected}, diterima ${parsedType$2(issue$1.input)}`;
5734
+ case "invalid_type": return `Input tidak sah: dijangka ${issue$1.expected}, diterima ${parsedType$3(issue$1.input)}`;
5581
5735
  case "invalid_value":
5582
5736
  if (issue$1.values.length === 1) return `Input tidak sah: dijangka ${stringifyPrimitive(issue$1.values[0])}`;
5583
5737
  return `Pilihan tidak sah: dijangka salah satu daripada ${joinValues(issue$1.values, "|")}`;
@@ -5613,12 +5767,12 @@ const error$16 = () => {
5613
5767
  };
5614
5768
  };
5615
5769
  function ms_default() {
5616
- return { localeError: error$16() };
5770
+ return { localeError: error$17() };
5617
5771
  }
5618
5772
 
5619
5773
  //#endregion
5620
- //#region ../../node_modules/zod/dist/esm/v4/locales/nl.js
5621
- const error$15 = () => {
5774
+ //#region ../../node_modules/zod/v4/locales/nl.js
5775
+ const error$16 = () => {
5622
5776
  const Sizable = {
5623
5777
  string: { unit: "tekens" },
5624
5778
  file: { unit: "bytes" },
@@ -5628,7 +5782,7 @@ const error$15 = () => {
5628
5782
  function getSizing(origin) {
5629
5783
  return Sizable[origin] ?? null;
5630
5784
  }
5631
- const parsedType$2 = (data) => {
5785
+ const parsedType$3 = (data) => {
5632
5786
  const t = typeof data;
5633
5787
  switch (t) {
5634
5788
  case "number": {
@@ -5680,7 +5834,7 @@ const error$15 = () => {
5680
5834
  };
5681
5835
  return (issue$1) => {
5682
5836
  switch (issue$1.code) {
5683
- case "invalid_type": return `Ongeldige invoer: verwacht ${issue$1.expected}, ontving ${parsedType$2(issue$1.input)}`;
5837
+ case "invalid_type": return `Ongeldige invoer: verwacht ${issue$1.expected}, ontving ${parsedType$3(issue$1.input)}`;
5684
5838
  case "invalid_value":
5685
5839
  if (issue$1.values.length === 1) return `Ongeldige invoer: verwacht ${stringifyPrimitive(issue$1.values[0])}`;
5686
5840
  return `Ongeldige optie: verwacht één van ${joinValues(issue$1.values, "|")}`;
@@ -5718,12 +5872,12 @@ const error$15 = () => {
5718
5872
  };
5719
5873
  };
5720
5874
  function nl_default() {
5721
- return { localeError: error$15() };
5875
+ return { localeError: error$16() };
5722
5876
  }
5723
5877
 
5724
5878
  //#endregion
5725
- //#region ../../node_modules/zod/dist/esm/v4/locales/no.js
5726
- const error$14 = () => {
5879
+ //#region ../../node_modules/zod/v4/locales/no.js
5880
+ const error$15 = () => {
5727
5881
  const Sizable = {
5728
5882
  string: {
5729
5883
  unit: "tegn",
@@ -5745,7 +5899,7 @@ const error$14 = () => {
5745
5899
  function getSizing(origin) {
5746
5900
  return Sizable[origin] ?? null;
5747
5901
  }
5748
- const parsedType$2 = (data) => {
5902
+ const parsedType$3 = (data) => {
5749
5903
  const t = typeof data;
5750
5904
  switch (t) {
5751
5905
  case "number": {
@@ -5797,7 +5951,7 @@ const error$14 = () => {
5797
5951
  };
5798
5952
  return (issue$1) => {
5799
5953
  switch (issue$1.code) {
5800
- case "invalid_type": return `Ugyldig input: forventet ${issue$1.expected}, fikk ${parsedType$2(issue$1.input)}`;
5954
+ case "invalid_type": return `Ugyldig input: forventet ${issue$1.expected}, fikk ${parsedType$3(issue$1.input)}`;
5801
5955
  case "invalid_value":
5802
5956
  if (issue$1.values.length === 1) return `Ugyldig verdi: forventet ${stringifyPrimitive(issue$1.values[0])}`;
5803
5957
  return `Ugyldig valg: forventet en av ${joinValues(issue$1.values, "|")}`;
@@ -5833,12 +5987,12 @@ const error$14 = () => {
5833
5987
  };
5834
5988
  };
5835
5989
  function no_default() {
5836
- return { localeError: error$14() };
5990
+ return { localeError: error$15() };
5837
5991
  }
5838
5992
 
5839
5993
  //#endregion
5840
- //#region ../../node_modules/zod/dist/esm/v4/locales/ota.js
5841
- const error$13 = () => {
5994
+ //#region ../../node_modules/zod/v4/locales/ota.js
5995
+ const error$14 = () => {
5842
5996
  const Sizable = {
5843
5997
  string: {
5844
5998
  unit: "harf",
@@ -5860,7 +6014,7 @@ const error$13 = () => {
5860
6014
  function getSizing(origin) {
5861
6015
  return Sizable[origin] ?? null;
5862
6016
  }
5863
- const parsedType$2 = (data) => {
6017
+ const parsedType$3 = (data) => {
5864
6018
  const t = typeof data;
5865
6019
  switch (t) {
5866
6020
  case "number": {
@@ -5912,7 +6066,7 @@ const error$13 = () => {
5912
6066
  };
5913
6067
  return (issue$1) => {
5914
6068
  switch (issue$1.code) {
5915
- case "invalid_type": return `Fâsit giren: umulan ${issue$1.expected}, alınan ${parsedType$2(issue$1.input)}`;
6069
+ case "invalid_type": return `Fâsit giren: umulan ${issue$1.expected}, alınan ${parsedType$3(issue$1.input)}`;
5916
6070
  case "invalid_value":
5917
6071
  if (issue$1.values.length === 1) return `Fâsit giren: umulan ${stringifyPrimitive(issue$1.values[0])}`;
5918
6072
  return `Fâsit tercih: mûteberler ${joinValues(issue$1.values, "|")}`;
@@ -5948,11 +6102,138 @@ const error$13 = () => {
5948
6102
  };
5949
6103
  };
5950
6104
  function ota_default() {
6105
+ return { localeError: error$14() };
6106
+ }
6107
+
6108
+ //#endregion
6109
+ //#region ../../node_modules/zod/v4/locales/ps.js
6110
+ const error$13 = () => {
6111
+ const Sizable = {
6112
+ string: {
6113
+ unit: "توکي",
6114
+ verb: "ولري"
6115
+ },
6116
+ file: {
6117
+ unit: "بایټس",
6118
+ verb: "ولري"
6119
+ },
6120
+ array: {
6121
+ unit: "توکي",
6122
+ verb: "ولري"
6123
+ },
6124
+ set: {
6125
+ unit: "توکي",
6126
+ verb: "ولري"
6127
+ }
6128
+ };
6129
+ function getSizing(origin) {
6130
+ return Sizable[origin] ?? null;
6131
+ }
6132
+ const parsedType$3 = (data) => {
6133
+ const t = typeof data;
6134
+ switch (t) {
6135
+ case "number": {
6136
+ return Number.isNaN(data) ? "NaN" : "عدد";
6137
+ }
6138
+ case "object": {
6139
+ if (Array.isArray(data)) {
6140
+ return "ارې";
6141
+ }
6142
+ if (data === null) {
6143
+ return "null";
6144
+ }
6145
+ if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
6146
+ return data.constructor.name;
6147
+ }
6148
+ }
6149
+ }
6150
+ return t;
6151
+ };
6152
+ const Nouns = {
6153
+ regex: "ورودي",
6154
+ email: "بریښنالیک",
6155
+ url: "یو آر ال",
6156
+ emoji: "ایموجي",
6157
+ uuid: "UUID",
6158
+ uuidv4: "UUIDv4",
6159
+ uuidv6: "UUIDv6",
6160
+ nanoid: "nanoid",
6161
+ guid: "GUID",
6162
+ cuid: "cuid",
6163
+ cuid2: "cuid2",
6164
+ ulid: "ULID",
6165
+ xid: "XID",
6166
+ ksuid: "KSUID",
6167
+ datetime: "نیټه او وخت",
6168
+ date: "نېټه",
6169
+ time: "وخت",
6170
+ duration: "موده",
6171
+ ipv4: "د IPv4 پته",
6172
+ ipv6: "د IPv6 پته",
6173
+ cidrv4: "د IPv4 ساحه",
6174
+ cidrv6: "د IPv6 ساحه",
6175
+ base64: "base64-encoded متن",
6176
+ base64url: "base64url-encoded متن",
6177
+ json_string: "JSON متن",
6178
+ e164: "د E.164 شمېره",
6179
+ jwt: "JWT",
6180
+ template_literal: "ورودي"
6181
+ };
6182
+ return (issue$1) => {
6183
+ switch (issue$1.code) {
6184
+ case "invalid_type": return `ناسم ورودي: باید ${issue$1.expected} وای, مګر ${parsedType$3(issue$1.input)} ترلاسه شو`;
6185
+ case "invalid_value":
6186
+ if (issue$1.values.length === 1) {
6187
+ return `ناسم ورودي: باید ${stringifyPrimitive(issue$1.values[0])} وای`;
6188
+ }
6189
+ return `ناسم انتخاب: باید یو له ${joinValues(issue$1.values, "|")} څخه وای`;
6190
+ case "too_big": {
6191
+ const adj = issue$1.inclusive ? "<=" : "<";
6192
+ const sizing = getSizing(issue$1.origin);
6193
+ if (sizing) {
6194
+ return `ډیر لوی: ${issue$1.origin ?? "ارزښت"} باید ${adj}${issue$1.maximum.toString()} ${sizing.unit ?? "عنصرونه"} ولري`;
6195
+ }
6196
+ return `ډیر لوی: ${issue$1.origin ?? "ارزښت"} باید ${adj}${issue$1.maximum.toString()} وي`;
6197
+ }
6198
+ case "too_small": {
6199
+ const adj = issue$1.inclusive ? ">=" : ">";
6200
+ const sizing = getSizing(issue$1.origin);
6201
+ if (sizing) {
6202
+ return `ډیر کوچنی: ${issue$1.origin} باید ${adj}${issue$1.minimum.toString()} ${sizing.unit} ولري`;
6203
+ }
6204
+ return `ډیر کوچنی: ${issue$1.origin} باید ${adj}${issue$1.minimum.toString()} وي`;
6205
+ }
6206
+ case "invalid_format": {
6207
+ const _issue = issue$1;
6208
+ if (_issue.format === "starts_with") {
6209
+ return `ناسم متن: باید د "${_issue.prefix}" سره پیل شي`;
6210
+ }
6211
+ if (_issue.format === "ends_with") {
6212
+ return `ناسم متن: باید د "${_issue.suffix}" سره پای ته ورسيږي`;
6213
+ }
6214
+ if (_issue.format === "includes") {
6215
+ return `ناسم متن: باید "${_issue.includes}" ولري`;
6216
+ }
6217
+ if (_issue.format === "regex") {
6218
+ return `ناسم متن: باید د ${_issue.pattern} سره مطابقت ولري`;
6219
+ }
6220
+ return `${Nouns[_issue.format] ?? issue$1.format} ناسم دی`;
6221
+ }
6222
+ case "not_multiple_of": return `ناسم عدد: باید د ${issue$1.divisor} مضرب وي`;
6223
+ case "unrecognized_keys": return `ناسم ${issue$1.keys.length > 1 ? "کلیډونه" : "کلیډ"}: ${joinValues(issue$1.keys, ", ")}`;
6224
+ case "invalid_key": return `ناسم کلیډ په ${issue$1.origin} کې`;
6225
+ case "invalid_union": return `ناسمه ورودي`;
6226
+ case "invalid_element": return `ناسم عنصر په ${issue$1.origin} کې`;
6227
+ default: return `ناسمه ورودي`;
6228
+ }
6229
+ };
6230
+ };
6231
+ function ps_default() {
5951
6232
  return { localeError: error$13() };
5952
6233
  }
5953
6234
 
5954
6235
  //#endregion
5955
- //#region ../../node_modules/zod/dist/esm/v4/locales/pl.js
6236
+ //#region ../../node_modules/zod/v4/locales/pl.js
5956
6237
  const error$12 = () => {
5957
6238
  const Sizable = {
5958
6239
  string: {
@@ -5975,7 +6256,7 @@ const error$12 = () => {
5975
6256
  function getSizing(origin) {
5976
6257
  return Sizable[origin] ?? null;
5977
6258
  }
5978
- const parsedType$2 = (data) => {
6259
+ const parsedType$3 = (data) => {
5979
6260
  const t = typeof data;
5980
6261
  switch (t) {
5981
6262
  case "number": {
@@ -6027,7 +6308,7 @@ const error$12 = () => {
6027
6308
  };
6028
6309
  return (issue$1) => {
6029
6310
  switch (issue$1.code) {
6030
- case "invalid_type": return `Nieprawidłowe dane wejściowe: oczekiwano ${issue$1.expected}, otrzymano ${parsedType$2(issue$1.input)}`;
6311
+ case "invalid_type": return `Nieprawidłowe dane wejściowe: oczekiwano ${issue$1.expected}, otrzymano ${parsedType$3(issue$1.input)}`;
6031
6312
  case "invalid_value":
6032
6313
  if (issue$1.values.length === 1) return `Nieprawidłowe dane wejściowe: oczekiwano ${stringifyPrimitive(issue$1.values[0])}`;
6033
6314
  return `Nieprawidłowa opcja: oczekiwano jednej z wartości ${joinValues(issue$1.values, "|")}`;
@@ -6069,7 +6350,7 @@ function pl_default() {
6069
6350
  }
6070
6351
 
6071
6352
  //#endregion
6072
- //#region ../../node_modules/zod/dist/esm/v4/locales/pt.js
6353
+ //#region ../../node_modules/zod/v4/locales/pt.js
6073
6354
  const error$11 = () => {
6074
6355
  const Sizable = {
6075
6356
  string: {
@@ -6092,7 +6373,7 @@ const error$11 = () => {
6092
6373
  function getSizing(origin) {
6093
6374
  return Sizable[origin] ?? null;
6094
6375
  }
6095
- const parsedType$2 = (data) => {
6376
+ const parsedType$3 = (data) => {
6096
6377
  const t = typeof data;
6097
6378
  switch (t) {
6098
6379
  case "number": {
@@ -6144,7 +6425,7 @@ const error$11 = () => {
6144
6425
  };
6145
6426
  return (issue$1) => {
6146
6427
  switch (issue$1.code) {
6147
- case "invalid_type": return `Tipo inválido: esperado ${issue$1.expected}, recebido ${parsedType$2(issue$1.input)}`;
6428
+ case "invalid_type": return `Tipo inválido: esperado ${issue$1.expected}, recebido ${parsedType$3(issue$1.input)}`;
6148
6429
  case "invalid_value":
6149
6430
  if (issue$1.values.length === 1) return `Entrada inválida: esperado ${stringifyPrimitive(issue$1.values[0])}`;
6150
6431
  return `Opção inválida: esperada uma das ${joinValues(issue$1.values, "|")}`;
@@ -6184,7 +6465,7 @@ function pt_default() {
6184
6465
  }
6185
6466
 
6186
6467
  //#endregion
6187
- //#region ../../node_modules/zod/dist/esm/v4/locales/ru.js
6468
+ //#region ../../node_modules/zod/v4/locales/ru.js
6188
6469
  function getRussianPlural(count, one, few, many) {
6189
6470
  const absCount = Math.abs(count);
6190
6471
  const lastDigit = absCount % 10;
@@ -6238,7 +6519,7 @@ const error$10 = () => {
6238
6519
  function getSizing(origin) {
6239
6520
  return Sizable[origin] ?? null;
6240
6521
  }
6241
- const parsedType$2 = (data) => {
6522
+ const parsedType$3 = (data) => {
6242
6523
  const t = typeof data;
6243
6524
  switch (t) {
6244
6525
  case "number": {
@@ -6290,7 +6571,7 @@ const error$10 = () => {
6290
6571
  };
6291
6572
  return (issue$1) => {
6292
6573
  switch (issue$1.code) {
6293
- case "invalid_type": return `Неверный ввод: ожидалось ${issue$1.expected}, получено ${parsedType$2(issue$1.input)}`;
6574
+ case "invalid_type": return `Неверный ввод: ожидалось ${issue$1.expected}, получено ${parsedType$3(issue$1.input)}`;
6294
6575
  case "invalid_value":
6295
6576
  if (issue$1.values.length === 1) return `Неверный ввод: ожидалось ${stringifyPrimitive(issue$1.values[0])}`;
6296
6577
  return `Неверный вариант: ожидалось одно из ${joinValues(issue$1.values, "|")}`;
@@ -6336,7 +6617,7 @@ function ru_default() {
6336
6617
  }
6337
6618
 
6338
6619
  //#endregion
6339
- //#region ../../node_modules/zod/dist/esm/v4/locales/sl.js
6620
+ //#region ../../node_modules/zod/v4/locales/sl.js
6340
6621
  const error$9 = () => {
6341
6622
  const Sizable = {
6342
6623
  string: {
@@ -6359,7 +6640,7 @@ const error$9 = () => {
6359
6640
  function getSizing(origin) {
6360
6641
  return Sizable[origin] ?? null;
6361
6642
  }
6362
- const parsedType$2 = (data) => {
6643
+ const parsedType$3 = (data) => {
6363
6644
  const t = typeof data;
6364
6645
  switch (t) {
6365
6646
  case "number": {
@@ -6411,7 +6692,7 @@ const error$9 = () => {
6411
6692
  };
6412
6693
  return (issue$1) => {
6413
6694
  switch (issue$1.code) {
6414
- case "invalid_type": return `Neveljaven vnos: pričakovano ${issue$1.expected}, prejeto ${parsedType$2(issue$1.input)}`;
6695
+ case "invalid_type": return `Neveljaven vnos: pričakovano ${issue$1.expected}, prejeto ${parsedType$3(issue$1.input)}`;
6415
6696
  case "invalid_value":
6416
6697
  if (issue$1.values.length === 1) return `Neveljaven vnos: pričakovano ${stringifyPrimitive(issue$1.values[0])}`;
6417
6698
  return `Neveljavna možnost: pričakovano eno izmed ${joinValues(issue$1.values, "|")}`;
@@ -6453,7 +6734,7 @@ function sl_default() {
6453
6734
  }
6454
6735
 
6455
6736
  //#endregion
6456
- //#region ../../node_modules/zod/dist/esm/v4/locales/sv.js
6737
+ //#region ../../node_modules/zod/v4/locales/sv.js
6457
6738
  const error$8 = () => {
6458
6739
  const Sizable = {
6459
6740
  string: {
@@ -6476,7 +6757,7 @@ const error$8 = () => {
6476
6757
  function getSizing(origin) {
6477
6758
  return Sizable[origin] ?? null;
6478
6759
  }
6479
- const parsedType$2 = (data) => {
6760
+ const parsedType$3 = (data) => {
6480
6761
  const t = typeof data;
6481
6762
  switch (t) {
6482
6763
  case "number": {
@@ -6528,7 +6809,7 @@ const error$8 = () => {
6528
6809
  };
6529
6810
  return (issue$1) => {
6530
6811
  switch (issue$1.code) {
6531
- case "invalid_type": return `Ogiltig inmatning: förväntat ${issue$1.expected}, fick ${parsedType$2(issue$1.input)}`;
6812
+ case "invalid_type": return `Ogiltig inmatning: förväntat ${issue$1.expected}, fick ${parsedType$3(issue$1.input)}`;
6532
6813
  case "invalid_value":
6533
6814
  if (issue$1.values.length === 1) return `Ogiltig inmatning: förväntat ${stringifyPrimitive(issue$1.values[0])}`;
6534
6815
  return `Ogiltigt val: förväntade en av ${joinValues(issue$1.values, "|")}`;
@@ -6572,7 +6853,7 @@ function sv_default() {
6572
6853
  }
6573
6854
 
6574
6855
  //#endregion
6575
- //#region ../../node_modules/zod/dist/esm/v4/locales/ta.js
6856
+ //#region ../../node_modules/zod/v4/locales/ta.js
6576
6857
  const error$7 = () => {
6577
6858
  const Sizable = {
6578
6859
  string: {
@@ -6595,7 +6876,7 @@ const error$7 = () => {
6595
6876
  function getSizing(origin) {
6596
6877
  return Sizable[origin] ?? null;
6597
6878
  }
6598
- const parsedType$2 = (data) => {
6879
+ const parsedType$3 = (data) => {
6599
6880
  const t = typeof data;
6600
6881
  switch (t) {
6601
6882
  case "number": {
@@ -6647,7 +6928,7 @@ const error$7 = () => {
6647
6928
  };
6648
6929
  return (issue$1) => {
6649
6930
  switch (issue$1.code) {
6650
- case "invalid_type": return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${issue$1.expected}, பெறப்பட்டது ${parsedType$2(issue$1.input)}`;
6931
+ case "invalid_type": return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${issue$1.expected}, பெறப்பட்டது ${parsedType$3(issue$1.input)}`;
6651
6932
  case "invalid_value":
6652
6933
  if (issue$1.values.length === 1) return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${stringifyPrimitive(issue$1.values[0])}`;
6653
6934
  return `தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${joinValues(issue$1.values, "|")} இல் ஒன்று`;
@@ -6689,7 +6970,7 @@ function ta_default() {
6689
6970
  }
6690
6971
 
6691
6972
  //#endregion
6692
- //#region ../../node_modules/zod/dist/esm/v4/locales/th.js
6973
+ //#region ../../node_modules/zod/v4/locales/th.js
6693
6974
  const error$6 = () => {
6694
6975
  const Sizable = {
6695
6976
  string: {
@@ -6712,7 +6993,7 @@ const error$6 = () => {
6712
6993
  function getSizing(origin) {
6713
6994
  return Sizable[origin] ?? null;
6714
6995
  }
6715
- const parsedType$2 = (data) => {
6996
+ const parsedType$3 = (data) => {
6716
6997
  const t = typeof data;
6717
6998
  switch (t) {
6718
6999
  case "number": {
@@ -6764,7 +7045,7 @@ const error$6 = () => {
6764
7045
  };
6765
7046
  return (issue$1) => {
6766
7047
  switch (issue$1.code) {
6767
- case "invalid_type": return `ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${issue$1.expected} แต่ได้รับ ${parsedType$2(issue$1.input)}`;
7048
+ case "invalid_type": return `ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${issue$1.expected} แต่ได้รับ ${parsedType$3(issue$1.input)}`;
6768
7049
  case "invalid_value":
6769
7050
  if (issue$1.values.length === 1) return `ค่าไม่ถูกต้อง: ควรเป็น ${stringifyPrimitive(issue$1.values[0])}`;
6770
7051
  return `ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${joinValues(issue$1.values, "|")}`;
@@ -6806,7 +7087,7 @@ function th_default() {
6806
7087
  }
6807
7088
 
6808
7089
  //#endregion
6809
- //#region ../../node_modules/zod/dist/esm/v4/locales/tr.js
7090
+ //#region ../../node_modules/zod/v4/locales/tr.js
6810
7091
  const parsedType = (data) => {
6811
7092
  const t = typeof data;
6812
7093
  switch (t) {
@@ -6919,7 +7200,7 @@ function tr_default() {
6919
7200
  }
6920
7201
 
6921
7202
  //#endregion
6922
- //#region ../../node_modules/zod/dist/esm/v4/locales/ua.js
7203
+ //#region ../../node_modules/zod/v4/locales/ua.js
6923
7204
  const error$4 = () => {
6924
7205
  const Sizable = {
6925
7206
  string: {
@@ -6942,7 +7223,7 @@ const error$4 = () => {
6942
7223
  function getSizing(origin) {
6943
7224
  return Sizable[origin] ?? null;
6944
7225
  }
6945
- const parsedType$2 = (data) => {
7226
+ const parsedType$3 = (data) => {
6946
7227
  const t = typeof data;
6947
7228
  switch (t) {
6948
7229
  case "number": {
@@ -6994,7 +7275,7 @@ const error$4 = () => {
6994
7275
  };
6995
7276
  return (issue$1) => {
6996
7277
  switch (issue$1.code) {
6997
- case "invalid_type": return `Неправильні вхідні дані: очікується ${issue$1.expected}, отримано ${parsedType$2(issue$1.input)}`;
7278
+ case "invalid_type": return `Неправильні вхідні дані: очікується ${issue$1.expected}, отримано ${parsedType$3(issue$1.input)}`;
6998
7279
  case "invalid_value":
6999
7280
  if (issue$1.values.length === 1) return `Неправильні вхідні дані: очікується ${stringifyPrimitive(issue$1.values[0])}`;
7000
7281
  return `Неправильна опція: очікується одне з ${joinValues(issue$1.values, "|")}`;
@@ -7034,7 +7315,7 @@ function ua_default() {
7034
7315
  }
7035
7316
 
7036
7317
  //#endregion
7037
- //#region ../../node_modules/zod/dist/esm/v4/locales/ur.js
7318
+ //#region ../../node_modules/zod/v4/locales/ur.js
7038
7319
  const error$3 = () => {
7039
7320
  const Sizable = {
7040
7321
  string: {
@@ -7057,7 +7338,7 @@ const error$3 = () => {
7057
7338
  function getSizing(origin) {
7058
7339
  return Sizable[origin] ?? null;
7059
7340
  }
7060
- const parsedType$2 = (data) => {
7341
+ const parsedType$3 = (data) => {
7061
7342
  const t = typeof data;
7062
7343
  switch (t) {
7063
7344
  case "number": {
@@ -7109,7 +7390,7 @@ const error$3 = () => {
7109
7390
  };
7110
7391
  return (issue$1) => {
7111
7392
  switch (issue$1.code) {
7112
- case "invalid_type": return `غلط ان پٹ: ${issue$1.expected} متوقع تھا، ${parsedType$2(issue$1.input)} موصول ہوا`;
7393
+ case "invalid_type": return `غلط ان پٹ: ${issue$1.expected} متوقع تھا، ${parsedType$3(issue$1.input)} موصول ہوا`;
7113
7394
  case "invalid_value":
7114
7395
  if (issue$1.values.length === 1) return `غلط ان پٹ: ${stringifyPrimitive(issue$1.values[0])} متوقع تھا`;
7115
7396
  return `غلط آپشن: ${joinValues(issue$1.values, "|")} میں سے ایک متوقع تھا`;
@@ -7151,7 +7432,7 @@ function ur_default() {
7151
7432
  }
7152
7433
 
7153
7434
  //#endregion
7154
- //#region ../../node_modules/zod/dist/esm/v4/locales/vi.js
7435
+ //#region ../../node_modules/zod/v4/locales/vi.js
7155
7436
  const error$2 = () => {
7156
7437
  const Sizable = {
7157
7438
  string: {
@@ -7174,7 +7455,7 @@ const error$2 = () => {
7174
7455
  function getSizing(origin) {
7175
7456
  return Sizable[origin] ?? null;
7176
7457
  }
7177
- const parsedType$2 = (data) => {
7458
+ const parsedType$3 = (data) => {
7178
7459
  const t = typeof data;
7179
7460
  switch (t) {
7180
7461
  case "number": {
@@ -7226,7 +7507,7 @@ const error$2 = () => {
7226
7507
  };
7227
7508
  return (issue$1) => {
7228
7509
  switch (issue$1.code) {
7229
- case "invalid_type": return `Đầu vào không hợp lệ: mong đợi ${issue$1.expected}, nhận được ${parsedType$2(issue$1.input)}`;
7510
+ case "invalid_type": return `Đầu vào không hợp lệ: mong đợi ${issue$1.expected}, nhận được ${parsedType$3(issue$1.input)}`;
7230
7511
  case "invalid_value":
7231
7512
  if (issue$1.values.length === 1) return `Đầu vào không hợp lệ: mong đợi ${stringifyPrimitive(issue$1.values[0])}`;
7232
7513
  return `Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${joinValues(issue$1.values, "|")}`;
@@ -7266,7 +7547,7 @@ function vi_default() {
7266
7547
  }
7267
7548
 
7268
7549
  //#endregion
7269
- //#region ../../node_modules/zod/dist/esm/v4/locales/zh-CN.js
7550
+ //#region ../../node_modules/zod/v4/locales/zh-CN.js
7270
7551
  const error$1 = () => {
7271
7552
  const Sizable = {
7272
7553
  string: {
@@ -7289,7 +7570,7 @@ const error$1 = () => {
7289
7570
  function getSizing(origin) {
7290
7571
  return Sizable[origin] ?? null;
7291
7572
  }
7292
- const parsedType$2 = (data) => {
7573
+ const parsedType$3 = (data) => {
7293
7574
  const t = typeof data;
7294
7575
  switch (t) {
7295
7576
  case "number": {
@@ -7341,7 +7622,7 @@ const error$1 = () => {
7341
7622
  };
7342
7623
  return (issue$1) => {
7343
7624
  switch (issue$1.code) {
7344
- case "invalid_type": return `无效输入:期望 ${issue$1.expected},实际接收 ${parsedType$2(issue$1.input)}`;
7625
+ case "invalid_type": return `无效输入:期望 ${issue$1.expected},实际接收 ${parsedType$3(issue$1.input)}`;
7345
7626
  case "invalid_value":
7346
7627
  if (issue$1.values.length === 1) return `无效输入:期望 ${stringifyPrimitive(issue$1.values[0])}`;
7347
7628
  return `无效选项:期望以下之一 ${joinValues(issue$1.values, "|")}`;
@@ -7381,7 +7662,7 @@ function zh_CN_default() {
7381
7662
  }
7382
7663
 
7383
7664
  //#endregion
7384
- //#region ../../node_modules/zod/dist/esm/v4/locales/zh-TW.js
7665
+ //#region ../../node_modules/zod/v4/locales/zh-TW.js
7385
7666
  const error = () => {
7386
7667
  const Sizable = {
7387
7668
  string: {
@@ -7404,7 +7685,7 @@ const error = () => {
7404
7685
  function getSizing(origin) {
7405
7686
  return Sizable[origin] ?? null;
7406
7687
  }
7407
- const parsedType$2 = (data) => {
7688
+ const parsedType$3 = (data) => {
7408
7689
  const t = typeof data;
7409
7690
  switch (t) {
7410
7691
  case "number": {
@@ -7456,7 +7737,7 @@ const error = () => {
7456
7737
  };
7457
7738
  return (issue$1) => {
7458
7739
  switch (issue$1.code) {
7459
- case "invalid_type": return `無效的輸入值:預期為 ${issue$1.expected},但收到 ${parsedType$2(issue$1.input)}`;
7740
+ case "invalid_type": return `無效的輸入值:預期為 ${issue$1.expected},但收到 ${parsedType$3(issue$1.input)}`;
7460
7741
  case "invalid_value":
7461
7742
  if (issue$1.values.length === 1) return `無效的輸入值:預期為 ${stringifyPrimitive(issue$1.values[0])}`;
7462
7743
  return `無效的選項:預期為以下其中之一 ${joinValues(issue$1.values, "|")}`;
@@ -7498,7 +7779,7 @@ function zh_TW_default() {
7498
7779
  }
7499
7780
 
7500
7781
  //#endregion
7501
- //#region ../../node_modules/zod/dist/esm/v4/locales/index.js
7782
+ //#region ../../node_modules/zod/v4/locales/index.js
7502
7783
  var locales_exports = {};
7503
7784
  __export(locales_exports, {
7504
7785
  ar: () => ar_default,
@@ -7508,6 +7789,7 @@ __export(locales_exports, {
7508
7789
  cs: () => cs_default,
7509
7790
  de: () => de_default,
7510
7791
  en: () => en_default,
7792
+ eo: () => eo_default,
7511
7793
  es: () => es_default,
7512
7794
  fa: () => fa_default,
7513
7795
  fi: () => fi_default,
@@ -7526,6 +7808,7 @@ __export(locales_exports, {
7526
7808
  no: () => no_default,
7527
7809
  ota: () => ota_default,
7528
7810
  pl: () => pl_default,
7811
+ ps: () => ps_default,
7529
7812
  pt: () => pt_default,
7530
7813
  ru: () => ru_default,
7531
7814
  sl: () => sl_default,
@@ -7541,12 +7824,12 @@ __export(locales_exports, {
7541
7824
  });
7542
7825
 
7543
7826
  //#endregion
7544
- //#region ../../node_modules/zod/dist/esm/v4/core/registries.js
7827
+ //#region ../../node_modules/zod/v4/core/registries.js
7545
7828
  const $output = Symbol("ZodOutput");
7546
7829
  const $input = Symbol("ZodInput");
7547
7830
  var $ZodRegistry = class {
7548
7831
  constructor() {
7549
- this._map = new WeakMap();
7832
+ this._map = new Map();
7550
7833
  this._idmap = new Map();
7551
7834
  }
7552
7835
  add(schema, ..._meta) {
@@ -7560,7 +7843,16 @@ var $ZodRegistry = class {
7560
7843
  }
7561
7844
  return this;
7562
7845
  }
7846
+ clear() {
7847
+ this._map = new Map();
7848
+ this._idmap = new Map();
7849
+ return this;
7850
+ }
7563
7851
  remove(schema) {
7852
+ const meta = this._map.get(schema);
7853
+ if (meta && typeof meta === "object" && "id" in meta) {
7854
+ this._idmap.delete(meta.id);
7855
+ }
7564
7856
  this._map.delete(schema);
7565
7857
  return this;
7566
7858
  }
@@ -7586,7 +7878,7 @@ function registry() {
7586
7878
  const globalRegistry = /* @__PURE__ */ registry();
7587
7879
 
7588
7880
  //#endregion
7589
- //#region ../../node_modules/zod/dist/esm/v4/core/api.js
7881
+ //#region ../../node_modules/zod/v4/core/api.js
7590
7882
  function _string(Class$1, params) {
7591
7883
  return new Class$1({
7592
7884
  type: "string",
@@ -7801,6 +8093,13 @@ function _jwt(Class$1, params) {
7801
8093
  ...normalizeParams(params)
7802
8094
  });
7803
8095
  }
8096
+ const TimePrecision = {
8097
+ Any: null,
8098
+ Minute: -1,
8099
+ Second: 0,
8100
+ Millisecond: 3,
8101
+ Microsecond: 6
8102
+ };
7804
8103
  function _isoDateTime(Class$1, params) {
7805
8104
  return new Class$1({
7806
8105
  type: "string",
@@ -8367,8 +8666,8 @@ function _refine(Class$1, fn, _params) {
8367
8666
  return schema;
8368
8667
  }
8369
8668
  function _stringbool(Classes, _params) {
8370
- const { case: _case, error: error$37, truthy, falsy } = normalizeParams(_params);
8371
- let truthyArray = truthy ?? [
8669
+ const params = normalizeParams(_params);
8670
+ let truthyArray = params.truthy ?? [
8372
8671
  "true",
8373
8672
  "1",
8374
8673
  "yes",
@@ -8376,7 +8675,7 @@ function _stringbool(Classes, _params) {
8376
8675
  "y",
8377
8676
  "enabled"
8378
8677
  ];
8379
- let falsyArray = falsy ?? [
8678
+ let falsyArray = params.falsy ?? [
8380
8679
  "false",
8381
8680
  "0",
8382
8681
  "no",
@@ -8384,7 +8683,7 @@ function _stringbool(Classes, _params) {
8384
8683
  "n",
8385
8684
  "disabled"
8386
8685
  ];
8387
- if (_case !== "sensitive") {
8686
+ if (params.case !== "sensitive") {
8388
8687
  truthyArray = truthyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
8389
8688
  falsyArray = falsyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
8390
8689
  }
@@ -8398,7 +8697,7 @@ function _stringbool(Classes, _params) {
8398
8697
  type: "transform",
8399
8698
  transform: (input, payload) => {
8400
8699
  let data = input;
8401
- if (_case !== "sensitive") data = data.toLowerCase();
8700
+ if (params.case !== "sensitive") data = data.toLowerCase();
8402
8701
  if (truthySet.has(data)) {
8403
8702
  return true;
8404
8703
  } else if (falsySet.has(data)) {
@@ -8414,31 +8713,47 @@ function _stringbool(Classes, _params) {
8414
8713
  return {};
8415
8714
  }
8416
8715
  },
8417
- error: error$37
8716
+ error: params.error
8418
8717
  });
8419
8718
  const innerPipe = new _Pipe({
8420
8719
  type: "pipe",
8421
8720
  in: new _String({
8422
8721
  type: "string",
8423
- error: error$37
8722
+ error: params.error
8424
8723
  }),
8425
8724
  out: tx,
8426
- error: error$37
8725
+ error: params.error
8427
8726
  });
8428
8727
  const outerPipe = new _Pipe({
8429
8728
  type: "pipe",
8430
8729
  in: innerPipe,
8431
8730
  out: new _Boolean({
8432
8731
  type: "boolean",
8433
- error: error$37
8732
+ error: params.error
8434
8733
  }),
8435
- error: error$37
8734
+ error: params.error
8436
8735
  });
8437
8736
  return outerPipe;
8438
8737
  }
8738
+ function _stringFormat(Class$1, format, fnOrRegex, _params = {}) {
8739
+ const params = normalizeParams(_params);
8740
+ const def = {
8741
+ ...normalizeParams(_params),
8742
+ check: "string_format",
8743
+ type: "string",
8744
+ format,
8745
+ fn: typeof fnOrRegex === "function" ? fnOrRegex : (val) => fnOrRegex.test(val),
8746
+ ...params
8747
+ };
8748
+ if (fnOrRegex instanceof RegExp) {
8749
+ def.pattern = fnOrRegex;
8750
+ }
8751
+ const inst = new Class$1(def);
8752
+ return inst;
8753
+ }
8439
8754
 
8440
8755
  //#endregion
8441
- //#region ../../node_modules/zod/dist/esm/v4/core/function.js
8756
+ //#region ../../node_modules/zod/v4/core/function.js
8442
8757
  var $ZodFunction = class {
8443
8758
  constructor(def) {
8444
8759
  this._def = def;
@@ -8509,7 +8824,7 @@ function _function(params) {
8509
8824
  }
8510
8825
 
8511
8826
  //#endregion
8512
- //#region ../../node_modules/zod/dist/esm/v4/core/to-json-schema.js
8827
+ //#region ../../node_modules/zod/v4/core/to-json-schema.js
8513
8828
  var JSONSchemaGenerator = class {
8514
8829
  constructor(params) {
8515
8830
  this.counter = 0;
@@ -8545,431 +8860,435 @@ var JSONSchemaGenerator = class {
8545
8860
  const result = {
8546
8861
  schema: {},
8547
8862
  count: 1,
8548
- cycle: undefined
8549
- };
8550
- this.seen.set(schema, result);
8551
- if (schema._zod.toJSONSchema) {
8552
- result.schema = schema._zod.toJSONSchema();
8553
- }
8554
- const params = {
8555
- ..._params,
8556
- schemaPath: [..._params.schemaPath, schema],
8863
+ cycle: undefined,
8557
8864
  path: _params.path
8558
8865
  };
8559
- const parent = schema._zod.parent;
8560
- if (parent) {
8561
- result.ref = parent;
8562
- this.process(parent, params);
8563
- this.seen.get(parent).isParent = true;
8866
+ this.seen.set(schema, result);
8867
+ const overrideSchema = schema._zod.toJSONSchema?.();
8868
+ if (overrideSchema) {
8869
+ result.schema = overrideSchema;
8564
8870
  } else {
8565
- const _json = result.schema;
8566
- switch (def.type) {
8567
- case "string": {
8568
- const json$1 = _json;
8569
- json$1.type = "string";
8570
- const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
8571
- if (typeof minimum === "number") json$1.minLength = minimum;
8572
- if (typeof maximum === "number") json$1.maxLength = maximum;
8573
- if (format) {
8574
- json$1.format = formatMap[format] ?? format;
8575
- if (json$1.format === "") delete json$1.format;
8871
+ const params = {
8872
+ ..._params,
8873
+ schemaPath: [..._params.schemaPath, schema],
8874
+ path: _params.path
8875
+ };
8876
+ const parent = schema._zod.parent;
8877
+ if (parent) {
8878
+ result.ref = parent;
8879
+ this.process(parent, params);
8880
+ this.seen.get(parent).isParent = true;
8881
+ } else {
8882
+ const _json = result.schema;
8883
+ switch (def.type) {
8884
+ case "string": {
8885
+ const json$1 = _json;
8886
+ json$1.type = "string";
8887
+ const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
8888
+ if (typeof minimum === "number") json$1.minLength = minimum;
8889
+ if (typeof maximum === "number") json$1.maxLength = maximum;
8890
+ if (format) {
8891
+ json$1.format = formatMap[format] ?? format;
8892
+ if (json$1.format === "") delete json$1.format;
8893
+ }
8894
+ if (contentEncoding) json$1.contentEncoding = contentEncoding;
8895
+ if (patterns && patterns.size > 0) {
8896
+ const regexes = [...patterns];
8897
+ if (regexes.length === 1) json$1.pattern = regexes[0].source;
8898
+ else if (regexes.length > 1) {
8899
+ result.schema.allOf = [...regexes.map((regex) => ({
8900
+ ...this.target === "draft-7" ? { type: "string" } : {},
8901
+ pattern: regex.source
8902
+ }))];
8903
+ }
8904
+ }
8905
+ break;
8576
8906
  }
8577
- if (contentEncoding) json$1.contentEncoding = contentEncoding;
8578
- if (patterns && patterns.size > 0) {
8579
- const regexes = [...patterns];
8580
- if (regexes.length === 1) json$1.pattern = regexes[0].source;
8581
- else if (regexes.length > 1) {
8582
- result.schema.allOf = [...regexes.map((regex) => ({
8583
- ...this.target === "draft-7" ? { type: "string" } : {},
8584
- pattern: regex.source
8585
- }))];
8907
+ case "number": {
8908
+ const json$1 = _json;
8909
+ const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
8910
+ if (typeof format === "string" && format.includes("int")) json$1.type = "integer";
8911
+ else json$1.type = "number";
8912
+ if (typeof exclusiveMinimum === "number") json$1.exclusiveMinimum = exclusiveMinimum;
8913
+ if (typeof minimum === "number") {
8914
+ json$1.minimum = minimum;
8915
+ if (typeof exclusiveMinimum === "number") {
8916
+ if (exclusiveMinimum >= minimum) delete json$1.minimum;
8917
+ else delete json$1.exclusiveMinimum;
8918
+ }
8586
8919
  }
8920
+ if (typeof exclusiveMaximum === "number") json$1.exclusiveMaximum = exclusiveMaximum;
8921
+ if (typeof maximum === "number") {
8922
+ json$1.maximum = maximum;
8923
+ if (typeof exclusiveMaximum === "number") {
8924
+ if (exclusiveMaximum <= maximum) delete json$1.maximum;
8925
+ else delete json$1.exclusiveMaximum;
8926
+ }
8927
+ }
8928
+ if (typeof multipleOf === "number") json$1.multipleOf = multipleOf;
8929
+ break;
8587
8930
  }
8588
- break;
8589
- }
8590
- case "number": {
8591
- const json$1 = _json;
8592
- const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
8593
- if (typeof format === "string" && format.includes("int")) json$1.type = "integer";
8594
- else json$1.type = "number";
8595
- if (typeof exclusiveMinimum === "number") json$1.exclusiveMinimum = exclusiveMinimum;
8596
- if (typeof minimum === "number") {
8597
- json$1.minimum = minimum;
8598
- if (typeof exclusiveMinimum === "number") {
8599
- if (exclusiveMinimum >= minimum) delete json$1.minimum;
8600
- else delete json$1.exclusiveMinimum;
8931
+ case "boolean": {
8932
+ const json$1 = _json;
8933
+ json$1.type = "boolean";
8934
+ break;
8935
+ }
8936
+ case "bigint": {
8937
+ if (this.unrepresentable === "throw") {
8938
+ throw new Error("BigInt cannot be represented in JSON Schema");
8601
8939
  }
8940
+ break;
8602
8941
  }
8603
- if (typeof exclusiveMaximum === "number") json$1.exclusiveMaximum = exclusiveMaximum;
8604
- if (typeof maximum === "number") {
8605
- json$1.maximum = maximum;
8606
- if (typeof exclusiveMaximum === "number") {
8607
- if (exclusiveMaximum <= maximum) delete json$1.maximum;
8608
- else delete json$1.exclusiveMaximum;
8942
+ case "symbol": {
8943
+ if (this.unrepresentable === "throw") {
8944
+ throw new Error("Symbols cannot be represented in JSON Schema");
8609
8945
  }
8946
+ break;
8610
8947
  }
8611
- if (typeof multipleOf === "number") json$1.multipleOf = multipleOf;
8612
- break;
8613
- }
8614
- case "boolean": {
8615
- const json$1 = _json;
8616
- json$1.type = "boolean";
8617
- break;
8618
- }
8619
- case "bigint": {
8620
- if (this.unrepresentable === "throw") {
8621
- throw new Error("BigInt cannot be represented in JSON Schema");
8948
+ case "null": {
8949
+ _json.type = "null";
8950
+ break;
8622
8951
  }
8623
- break;
8624
- }
8625
- case "symbol": {
8626
- if (this.unrepresentable === "throw") {
8627
- throw new Error("Symbols cannot be represented in JSON Schema");
8952
+ case "any": {
8953
+ break;
8628
8954
  }
8629
- break;
8630
- }
8631
- case "undefined": {
8632
- const json$1 = _json;
8633
- json$1.type = "null";
8634
- break;
8635
- }
8636
- case "null": {
8637
- _json.type = "null";
8638
- break;
8639
- }
8640
- case "any": {
8641
- break;
8642
- }
8643
- case "unknown": {
8644
- break;
8645
- }
8646
- case "never": {
8647
- _json.not = {};
8648
- break;
8649
- }
8650
- case "void": {
8651
- if (this.unrepresentable === "throw") {
8652
- throw new Error("Void cannot be represented in JSON Schema");
8955
+ case "unknown": {
8956
+ break;
8653
8957
  }
8654
- break;
8655
- }
8656
- case "date": {
8657
- if (this.unrepresentable === "throw") {
8658
- throw new Error("Date cannot be represented in JSON Schema");
8958
+ case "undefined": {
8959
+ if (this.unrepresentable === "throw") {
8960
+ throw new Error("Undefined cannot be represented in JSON Schema");
8961
+ }
8962
+ break;
8659
8963
  }
8660
- break;
8661
- }
8662
- case "array": {
8663
- const json$1 = _json;
8664
- const { minimum, maximum } = schema._zod.bag;
8665
- if (typeof minimum === "number") json$1.minItems = minimum;
8666
- if (typeof maximum === "number") json$1.maxItems = maximum;
8667
- json$1.type = "array";
8668
- json$1.items = this.process(def.element, {
8669
- ...params,
8670
- path: [...params.path, "items"]
8671
- });
8672
- break;
8673
- }
8674
- case "object": {
8675
- const json$1 = _json;
8676
- json$1.type = "object";
8677
- json$1.properties = {};
8678
- const shape = def.shape;
8679
- for (const key in shape) {
8680
- json$1.properties[key] = this.process(shape[key], {
8681
- ...params,
8682
- path: [
8683
- ...params.path,
8684
- "properties",
8685
- key
8686
- ]
8687
- });
8964
+ case "void": {
8965
+ if (this.unrepresentable === "throw") {
8966
+ throw new Error("Void cannot be represented in JSON Schema");
8967
+ }
8968
+ break;
8688
8969
  }
8689
- const allKeys = new Set(Object.keys(shape));
8690
- const requiredKeys = new Set([...allKeys].filter((key) => {
8691
- const v = def.shape[key]._zod;
8692
- if (this.io === "input") {
8693
- return v.optin === undefined;
8694
- } else {
8695
- return v.optout === undefined;
8970
+ case "never": {
8971
+ _json.not = {};
8972
+ break;
8973
+ }
8974
+ case "date": {
8975
+ if (this.unrepresentable === "throw") {
8976
+ throw new Error("Date cannot be represented in JSON Schema");
8696
8977
  }
8697
- }));
8698
- if (requiredKeys.size > 0) {
8699
- json$1.required = Array.from(requiredKeys);
8978
+ break;
8700
8979
  }
8701
- if (def.catchall?._zod.def.type === "never") {
8702
- json$1.additionalProperties = false;
8703
- } else if (!def.catchall) {
8704
- if (this.io === "output") json$1.additionalProperties = false;
8705
- } else if (def.catchall) {
8706
- json$1.additionalProperties = this.process(def.catchall, {
8980
+ case "array": {
8981
+ const json$1 = _json;
8982
+ const { minimum, maximum } = schema._zod.bag;
8983
+ if (typeof minimum === "number") json$1.minItems = minimum;
8984
+ if (typeof maximum === "number") json$1.maxItems = maximum;
8985
+ json$1.type = "array";
8986
+ json$1.items = this.process(def.element, {
8707
8987
  ...params,
8708
- path: [...params.path, "additionalProperties"]
8988
+ path: [...params.path, "items"]
8709
8989
  });
8990
+ break;
8710
8991
  }
8711
- break;
8712
- }
8713
- case "union": {
8714
- const json$1 = _json;
8715
- json$1.anyOf = def.options.map((x, i) => this.process(x, {
8716
- ...params,
8717
- path: [
8718
- ...params.path,
8719
- "anyOf",
8720
- i
8721
- ]
8722
- }));
8723
- break;
8724
- }
8725
- case "intersection": {
8726
- const json$1 = _json;
8727
- const a = this.process(def.left, {
8728
- ...params,
8729
- path: [
8730
- ...params.path,
8731
- "allOf",
8732
- 0
8733
- ]
8734
- });
8735
- const b = this.process(def.right, {
8736
- ...params,
8737
- path: [
8738
- ...params.path,
8739
- "allOf",
8740
- 1
8741
- ]
8742
- });
8743
- const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
8744
- const allOf = [...isSimpleIntersection(a) ? a.allOf : [a], ...isSimpleIntersection(b) ? b.allOf : [b]];
8745
- json$1.allOf = allOf;
8746
- break;
8747
- }
8748
- case "tuple": {
8749
- const json$1 = _json;
8750
- json$1.type = "array";
8751
- const prefixItems = def.items.map((x, i) => this.process(x, {
8752
- ...params,
8753
- path: [
8754
- ...params.path,
8755
- "prefixItems",
8756
- i
8757
- ]
8758
- }));
8759
- if (this.target === "draft-2020-12") {
8760
- json$1.prefixItems = prefixItems;
8761
- } else {
8762
- json$1.items = prefixItems;
8992
+ case "object": {
8993
+ const json$1 = _json;
8994
+ json$1.type = "object";
8995
+ json$1.properties = {};
8996
+ const shape = def.shape;
8997
+ for (const key in shape) {
8998
+ json$1.properties[key] = this.process(shape[key], {
8999
+ ...params,
9000
+ path: [
9001
+ ...params.path,
9002
+ "properties",
9003
+ key
9004
+ ]
9005
+ });
9006
+ }
9007
+ const allKeys = new Set(Object.keys(shape));
9008
+ const requiredKeys = new Set([...allKeys].filter((key) => {
9009
+ const v = def.shape[key]._zod;
9010
+ if (this.io === "input") {
9011
+ return v.optin === undefined;
9012
+ } else {
9013
+ return v.optout === undefined;
9014
+ }
9015
+ }));
9016
+ if (requiredKeys.size > 0) {
9017
+ json$1.required = Array.from(requiredKeys);
9018
+ }
9019
+ if (def.catchall?._zod.def.type === "never") {
9020
+ json$1.additionalProperties = false;
9021
+ } else if (!def.catchall) {
9022
+ if (this.io === "output") json$1.additionalProperties = false;
9023
+ } else if (def.catchall) {
9024
+ json$1.additionalProperties = this.process(def.catchall, {
9025
+ ...params,
9026
+ path: [...params.path, "additionalProperties"]
9027
+ });
9028
+ }
9029
+ break;
8763
9030
  }
8764
- if (def.rest) {
8765
- const rest = this.process(def.rest, {
9031
+ case "union": {
9032
+ const json$1 = _json;
9033
+ json$1.anyOf = def.options.map((x, i) => this.process(x, {
8766
9034
  ...params,
8767
- path: [...params.path, "items"]
9035
+ path: [
9036
+ ...params.path,
9037
+ "anyOf",
9038
+ i
9039
+ ]
9040
+ }));
9041
+ break;
9042
+ }
9043
+ case "intersection": {
9044
+ const json$1 = _json;
9045
+ const a = this.process(def.left, {
9046
+ ...params,
9047
+ path: [
9048
+ ...params.path,
9049
+ "allOf",
9050
+ 0
9051
+ ]
9052
+ });
9053
+ const b = this.process(def.right, {
9054
+ ...params,
9055
+ path: [
9056
+ ...params.path,
9057
+ "allOf",
9058
+ 1
9059
+ ]
8768
9060
  });
9061
+ const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
9062
+ const allOf = [...isSimpleIntersection(a) ? a.allOf : [a], ...isSimpleIntersection(b) ? b.allOf : [b]];
9063
+ json$1.allOf = allOf;
9064
+ break;
9065
+ }
9066
+ case "tuple": {
9067
+ const json$1 = _json;
9068
+ json$1.type = "array";
9069
+ const prefixItems = def.items.map((x, i) => this.process(x, {
9070
+ ...params,
9071
+ path: [
9072
+ ...params.path,
9073
+ "prefixItems",
9074
+ i
9075
+ ]
9076
+ }));
8769
9077
  if (this.target === "draft-2020-12") {
8770
- json$1.items = rest;
9078
+ json$1.prefixItems = prefixItems;
8771
9079
  } else {
8772
- json$1.additionalItems = rest;
9080
+ json$1.items = prefixItems;
9081
+ }
9082
+ if (def.rest) {
9083
+ const rest = this.process(def.rest, {
9084
+ ...params,
9085
+ path: [...params.path, "items"]
9086
+ });
9087
+ if (this.target === "draft-2020-12") {
9088
+ json$1.items = rest;
9089
+ } else {
9090
+ json$1.additionalItems = rest;
9091
+ }
8773
9092
  }
9093
+ if (def.rest) {
9094
+ json$1.items = this.process(def.rest, {
9095
+ ...params,
9096
+ path: [...params.path, "items"]
9097
+ });
9098
+ }
9099
+ const { minimum, maximum } = schema._zod.bag;
9100
+ if (typeof minimum === "number") json$1.minItems = minimum;
9101
+ if (typeof maximum === "number") json$1.maxItems = maximum;
9102
+ break;
8774
9103
  }
8775
- if (def.rest) {
8776
- json$1.items = this.process(def.rest, {
9104
+ case "record": {
9105
+ const json$1 = _json;
9106
+ json$1.type = "object";
9107
+ json$1.propertyNames = this.process(def.keyType, {
8777
9108
  ...params,
8778
- path: [...params.path, "items"]
9109
+ path: [...params.path, "propertyNames"]
8779
9110
  });
9111
+ json$1.additionalProperties = this.process(def.valueType, {
9112
+ ...params,
9113
+ path: [...params.path, "additionalProperties"]
9114
+ });
9115
+ break;
8780
9116
  }
8781
- const { minimum, maximum } = schema._zod.bag;
8782
- if (typeof minimum === "number") json$1.minItems = minimum;
8783
- if (typeof maximum === "number") json$1.maxItems = maximum;
8784
- break;
8785
- }
8786
- case "record": {
8787
- const json$1 = _json;
8788
- json$1.type = "object";
8789
- json$1.propertyNames = this.process(def.keyType, {
8790
- ...params,
8791
- path: [...params.path, "propertyNames"]
8792
- });
8793
- json$1.additionalProperties = this.process(def.valueType, {
8794
- ...params,
8795
- path: [...params.path, "additionalProperties"]
8796
- });
8797
- break;
8798
- }
8799
- case "map": {
8800
- if (this.unrepresentable === "throw") {
8801
- throw new Error("Map cannot be represented in JSON Schema");
9117
+ case "map": {
9118
+ if (this.unrepresentable === "throw") {
9119
+ throw new Error("Map cannot be represented in JSON Schema");
9120
+ }
9121
+ break;
8802
9122
  }
8803
- break;
8804
- }
8805
- case "set": {
8806
- if (this.unrepresentable === "throw") {
8807
- throw new Error("Set cannot be represented in JSON Schema");
9123
+ case "set": {
9124
+ if (this.unrepresentable === "throw") {
9125
+ throw new Error("Set cannot be represented in JSON Schema");
9126
+ }
9127
+ break;
9128
+ }
9129
+ case "enum": {
9130
+ const json$1 = _json;
9131
+ const values = getEnumValues(def.entries);
9132
+ if (values.every((v) => typeof v === "number")) json$1.type = "number";
9133
+ if (values.every((v) => typeof v === "string")) json$1.type = "string";
9134
+ json$1.enum = values;
9135
+ break;
8808
9136
  }
8809
- break;
8810
- }
8811
- case "enum": {
8812
- const json$1 = _json;
8813
- const values = getEnumValues(def.entries);
8814
- if (values.every((v) => typeof v === "number")) json$1.type = "number";
8815
- if (values.every((v) => typeof v === "string")) json$1.type = "string";
8816
- json$1.enum = values;
8817
- break;
8818
- }
8819
- case "literal": {
8820
- const json$1 = _json;
8821
- const vals = [];
8822
- for (const val of def.values) {
8823
- if (val === undefined) {
8824
- if (this.unrepresentable === "throw") {
8825
- throw new Error("Literal `undefined` cannot be represented in JSON Schema");
8826
- } else {}
8827
- } else if (typeof val === "bigint") {
8828
- if (this.unrepresentable === "throw") {
8829
- throw new Error("BigInt literals cannot be represented in JSON Schema");
9137
+ case "literal": {
9138
+ const json$1 = _json;
9139
+ const vals = [];
9140
+ for (const val of def.values) {
9141
+ if (val === undefined) {
9142
+ if (this.unrepresentable === "throw") {
9143
+ throw new Error("Literal `undefined` cannot be represented in JSON Schema");
9144
+ } else {}
9145
+ } else if (typeof val === "bigint") {
9146
+ if (this.unrepresentable === "throw") {
9147
+ throw new Error("BigInt literals cannot be represented in JSON Schema");
9148
+ } else {
9149
+ vals.push(Number(val));
9150
+ }
8830
9151
  } else {
8831
- vals.push(Number(val));
9152
+ vals.push(val);
8832
9153
  }
9154
+ }
9155
+ if (vals.length === 0) {} else if (vals.length === 1) {
9156
+ const val = vals[0];
9157
+ json$1.type = val === null ? "null" : typeof val;
9158
+ json$1.const = val;
8833
9159
  } else {
8834
- vals.push(val);
9160
+ if (vals.every((v) => typeof v === "number")) json$1.type = "number";
9161
+ if (vals.every((v) => typeof v === "string")) json$1.type = "string";
9162
+ if (vals.every((v) => typeof v === "boolean")) json$1.type = "string";
9163
+ if (vals.every((v) => v === null)) json$1.type = "null";
9164
+ json$1.enum = vals;
8835
9165
  }
9166
+ break;
8836
9167
  }
8837
- if (vals.length === 0) {} else if (vals.length === 1) {
8838
- const val = vals[0];
8839
- json$1.type = val === null ? "null" : typeof val;
8840
- json$1.const = val;
8841
- } else {
8842
- if (vals.every((v) => typeof v === "number")) json$1.type = "number";
8843
- if (vals.every((v) => typeof v === "string")) json$1.type = "string";
8844
- if (vals.every((v) => typeof v === "boolean")) json$1.type = "string";
8845
- if (vals.every((v) => v === null)) json$1.type = "null";
8846
- json$1.enum = vals;
8847
- }
8848
- break;
8849
- }
8850
- case "file": {
8851
- const json$1 = _json;
8852
- const file$1 = {
8853
- type: "string",
8854
- format: "binary",
8855
- contentEncoding: "binary"
8856
- };
8857
- const { minimum, maximum, mime } = schema._zod.bag;
8858
- if (minimum !== undefined) file$1.minLength = minimum;
8859
- if (maximum !== undefined) file$1.maxLength = maximum;
8860
- if (mime) {
8861
- if (mime.length === 1) {
8862
- file$1.contentMediaType = mime[0];
8863
- Object.assign(json$1, file$1);
9168
+ case "file": {
9169
+ const json$1 = _json;
9170
+ const file$1 = {
9171
+ type: "string",
9172
+ format: "binary",
9173
+ contentEncoding: "binary"
9174
+ };
9175
+ const { minimum, maximum, mime } = schema._zod.bag;
9176
+ if (minimum !== undefined) file$1.minLength = minimum;
9177
+ if (maximum !== undefined) file$1.maxLength = maximum;
9178
+ if (mime) {
9179
+ if (mime.length === 1) {
9180
+ file$1.contentMediaType = mime[0];
9181
+ Object.assign(json$1, file$1);
9182
+ } else {
9183
+ json$1.anyOf = mime.map((m) => {
9184
+ const mFile = {
9185
+ ...file$1,
9186
+ contentMediaType: m
9187
+ };
9188
+ return mFile;
9189
+ });
9190
+ }
8864
9191
  } else {
8865
- json$1.anyOf = mime.map((m) => {
8866
- const mFile = {
8867
- ...file$1,
8868
- contentMediaType: m
8869
- };
8870
- return mFile;
8871
- });
9192
+ Object.assign(json$1, file$1);
8872
9193
  }
8873
- } else {
8874
- Object.assign(json$1, file$1);
9194
+ break;
8875
9195
  }
8876
- break;
8877
- }
8878
- case "transform": {
8879
- if (this.unrepresentable === "throw") {
8880
- throw new Error("Transforms cannot be represented in JSON Schema");
9196
+ case "transform": {
9197
+ if (this.unrepresentable === "throw") {
9198
+ throw new Error("Transforms cannot be represented in JSON Schema");
9199
+ }
9200
+ break;
8881
9201
  }
8882
- break;
8883
- }
8884
- case "nullable": {
8885
- const inner = this.process(def.innerType, params);
8886
- _json.anyOf = [inner, { type: "null" }];
8887
- break;
8888
- }
8889
- case "nonoptional": {
8890
- this.process(def.innerType, params);
8891
- result.ref = def.innerType;
8892
- break;
8893
- }
8894
- case "success": {
8895
- const json$1 = _json;
8896
- json$1.type = "boolean";
8897
- break;
8898
- }
8899
- case "default": {
8900
- this.process(def.innerType, params);
8901
- result.ref = def.innerType;
8902
- _json.default = def.defaultValue;
8903
- break;
8904
- }
8905
- case "prefault": {
8906
- this.process(def.innerType, params);
8907
- result.ref = def.innerType;
8908
- if (this.io === "input") _json._prefault = def.defaultValue;
8909
- break;
8910
- }
8911
- case "catch": {
8912
- this.process(def.innerType, params);
8913
- result.ref = def.innerType;
8914
- let catchValue;
8915
- try {
8916
- catchValue = def.catchValue(undefined);
8917
- } catch {
8918
- throw new Error("Dynamic catch values are not supported in JSON Schema");
9202
+ case "nullable": {
9203
+ const inner = this.process(def.innerType, params);
9204
+ _json.anyOf = [inner, { type: "null" }];
9205
+ break;
8919
9206
  }
8920
- _json.default = catchValue;
8921
- break;
8922
- }
8923
- case "nan": {
8924
- if (this.unrepresentable === "throw") {
8925
- throw new Error("NaN cannot be represented in JSON Schema");
9207
+ case "nonoptional": {
9208
+ this.process(def.innerType, params);
9209
+ result.ref = def.innerType;
9210
+ break;
8926
9211
  }
8927
- break;
8928
- }
8929
- case "template_literal": {
8930
- const json$1 = _json;
8931
- const pattern = schema._zod.pattern;
8932
- if (!pattern) throw new Error("Pattern not found in template literal");
8933
- json$1.type = "string";
8934
- json$1.pattern = pattern.source;
8935
- break;
8936
- }
8937
- case "pipe": {
8938
- const innerType = this.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
8939
- this.process(innerType, params);
8940
- result.ref = innerType;
8941
- break;
8942
- }
8943
- case "readonly": {
8944
- this.process(def.innerType, params);
8945
- result.ref = def.innerType;
8946
- _json.readOnly = true;
8947
- break;
8948
- }
8949
- case "promise": {
8950
- this.process(def.innerType, params);
8951
- result.ref = def.innerType;
8952
- break;
8953
- }
8954
- case "optional": {
8955
- this.process(def.innerType, params);
8956
- result.ref = def.innerType;
8957
- break;
8958
- }
8959
- case "lazy": {
8960
- const innerType = schema._zod.innerType;
8961
- this.process(innerType, params);
8962
- result.ref = innerType;
8963
- break;
8964
- }
8965
- case "custom": {
8966
- if (this.unrepresentable === "throw") {
8967
- throw new Error("Custom types cannot be represented in JSON Schema");
9212
+ case "success": {
9213
+ const json$1 = _json;
9214
+ json$1.type = "boolean";
9215
+ break;
9216
+ }
9217
+ case "default": {
9218
+ this.process(def.innerType, params);
9219
+ result.ref = def.innerType;
9220
+ _json.default = JSON.parse(JSON.stringify(def.defaultValue));
9221
+ break;
9222
+ }
9223
+ case "prefault": {
9224
+ this.process(def.innerType, params);
9225
+ result.ref = def.innerType;
9226
+ if (this.io === "input") _json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
9227
+ break;
9228
+ }
9229
+ case "catch": {
9230
+ this.process(def.innerType, params);
9231
+ result.ref = def.innerType;
9232
+ let catchValue;
9233
+ try {
9234
+ catchValue = def.catchValue(undefined);
9235
+ } catch {
9236
+ throw new Error("Dynamic catch values are not supported in JSON Schema");
9237
+ }
9238
+ _json.default = catchValue;
9239
+ break;
9240
+ }
9241
+ case "nan": {
9242
+ if (this.unrepresentable === "throw") {
9243
+ throw new Error("NaN cannot be represented in JSON Schema");
9244
+ }
9245
+ break;
9246
+ }
9247
+ case "template_literal": {
9248
+ const json$1 = _json;
9249
+ const pattern = schema._zod.pattern;
9250
+ if (!pattern) throw new Error("Pattern not found in template literal");
9251
+ json$1.type = "string";
9252
+ json$1.pattern = pattern.source;
9253
+ break;
9254
+ }
9255
+ case "pipe": {
9256
+ const innerType = this.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
9257
+ this.process(innerType, params);
9258
+ result.ref = innerType;
9259
+ break;
9260
+ }
9261
+ case "readonly": {
9262
+ this.process(def.innerType, params);
9263
+ result.ref = def.innerType;
9264
+ _json.readOnly = true;
9265
+ break;
9266
+ }
9267
+ case "promise": {
9268
+ this.process(def.innerType, params);
9269
+ result.ref = def.innerType;
9270
+ break;
9271
+ }
9272
+ case "optional": {
9273
+ this.process(def.innerType, params);
9274
+ result.ref = def.innerType;
9275
+ break;
9276
+ }
9277
+ case "lazy": {
9278
+ const innerType = schema._zod.innerType;
9279
+ this.process(innerType, params);
9280
+ result.ref = innerType;
9281
+ break;
9282
+ }
9283
+ case "custom": {
9284
+ if (this.unrepresentable === "throw") {
9285
+ throw new Error("Custom types cannot be represented in JSON Schema");
9286
+ }
9287
+ break;
9288
+ }
9289
+ default: {
9290
+ def;
8968
9291
  }
8969
- break;
8970
- }
8971
- default: {
8972
- def;
8973
9292
  }
8974
9293
  }
8975
9294
  }
@@ -8996,12 +9315,15 @@ var JSONSchemaGenerator = class {
8996
9315
  const defsSegment = this.target === "draft-2020-12" ? "$defs" : "definitions";
8997
9316
  if (params.external) {
8998
9317
  const externalId = params.external.registry.get(entry[0])?.id;
8999
- if (externalId) return { ref: params.external.uri(externalId) };
9318
+ const uriGenerator = params.external.uri ?? ((id$1) => id$1);
9319
+ if (externalId) {
9320
+ return { ref: uriGenerator(externalId) };
9321
+ }
9000
9322
  const id = entry[1].defId ?? entry[1].schema.id ?? `schema${this.counter++}`;
9001
9323
  entry[1].defId = id;
9002
9324
  return {
9003
9325
  defId: id,
9004
- ref: `${params.external.uri("__shared")}#/${defsSegment}/${id}`
9326
+ ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}`
9005
9327
  };
9006
9328
  }
9007
9329
  if (entry[1] === root) {
@@ -9029,6 +9351,14 @@ var JSONSchemaGenerator = class {
9029
9351
  }
9030
9352
  schema$1.$ref = ref;
9031
9353
  };
9354
+ if (params.cycles === "throw") {
9355
+ for (const entry of this.seen.entries()) {
9356
+ const seen = entry[1];
9357
+ if (seen.cycle) {
9358
+ throw new Error("Cycle detected: " + `#/${seen.cycle?.join("/")}/<root>` + "\n\nSet the `cycles` parameter to `\"ref\"` to resolve cyclical schemas with defs.");
9359
+ }
9360
+ }
9361
+ }
9032
9362
  for (const entry of this.seen.entries()) {
9033
9363
  const seen = entry[1];
9034
9364
  if (schema === entry[0]) {
@@ -9048,11 +9378,7 @@ var JSONSchemaGenerator = class {
9048
9378
  continue;
9049
9379
  }
9050
9380
  if (seen.cycle) {
9051
- if (params.cycles === "throw") {
9052
- throw new Error("Cycle detected: " + `#/${seen.cycle?.join("/")}/<root>` + "\n\nSet the `cycles` parameter to `\"ref\"` to resolve cyclical schemas with defs.");
9053
- } else if (params.cycles === "ref") {
9054
- extractToDef(entry);
9055
- }
9381
+ extractToDef(entry);
9056
9382
  continue;
9057
9383
  }
9058
9384
  if (seen.count > 1) {
@@ -9084,7 +9410,8 @@ var JSONSchemaGenerator = class {
9084
9410
  }
9085
9411
  if (!seen.isParent) this.override({
9086
9412
  zodSchema,
9087
- jsonSchema: schema$1
9413
+ jsonSchema: schema$1,
9414
+ path: seen.path ?? []
9088
9415
  });
9089
9416
  };
9090
9417
  for (const entry of [...this.seen.entries()].reverse()) {
@@ -9098,6 +9425,11 @@ var JSONSchemaGenerator = class {
9098
9425
  } else {
9099
9426
  console.warn(`Invalid target: ${this.target}`);
9100
9427
  }
9428
+ if (params.external?.uri) {
9429
+ const id = params.external.registry.get(schema)?.id;
9430
+ if (!id) throw new Error("Schema is missing an `id` property");
9431
+ result.$id = params.external.uri(id);
9432
+ }
9101
9433
  Object.assign(result, root.def);
9102
9434
  const defs = params.external?.defs ?? {};
9103
9435
  for (const entry of this.seen.entries()) {
@@ -9106,11 +9438,13 @@ var JSONSchemaGenerator = class {
9106
9438
  defs[seen.defId] = seen.def;
9107
9439
  }
9108
9440
  }
9109
- if (!params.external && Object.keys(defs).length > 0) {
9110
- if (this.target === "draft-2020-12") {
9111
- result.$defs = defs;
9112
- } else {
9113
- result.definitions = defs;
9441
+ if (params.external) {} else {
9442
+ if (Object.keys(defs).length > 0) {
9443
+ if (this.target === "draft-2020-12") {
9444
+ result.$defs = defs;
9445
+ } else {
9446
+ result.definitions = defs;
9447
+ }
9114
9448
  }
9115
9449
  }
9116
9450
  try {
@@ -9131,7 +9465,7 @@ function toJSONSchema(input, _params) {
9131
9465
  const schemas = {};
9132
9466
  const external = {
9133
9467
  registry: input,
9134
- uri: _params?.uri || ((id) => id),
9468
+ uri: _params?.uri,
9135
9469
  defs
9136
9470
  };
9137
9471
  for (const entry of input._idmap.entries()) {
@@ -9242,11 +9576,11 @@ function isTransforming(_schema, _ctx) {
9242
9576
  }
9243
9577
 
9244
9578
  //#endregion
9245
- //#region ../../node_modules/zod/dist/esm/v4/core/json-schema.js
9579
+ //#region ../../node_modules/zod/v4/core/json-schema.js
9246
9580
  var json_schema_exports = {};
9247
9581
 
9248
9582
  //#endregion
9249
- //#region ../../node_modules/zod/dist/esm/v4/core/index.js
9583
+ //#region ../../node_modules/zod/v4/core/index.js
9250
9584
  var core_exports = {};
9251
9585
  __export(core_exports, {
9252
9586
  $ZodAny: () => $ZodAny,
@@ -9285,6 +9619,7 @@ __export(core_exports, {
9285
9619
  $ZodCheckStringFormat: () => $ZodCheckStringFormat,
9286
9620
  $ZodCheckUpperCase: () => $ZodCheckUpperCase,
9287
9621
  $ZodCustom: () => $ZodCustom,
9622
+ $ZodCustomStringFormat: () => $ZodCustomStringFormat,
9288
9623
  $ZodDate: () => $ZodDate,
9289
9624
  $ZodDefault: () => $ZodDefault,
9290
9625
  $ZodDiscriminatedUnion: () => $ZodDiscriminatedUnion,
@@ -9349,6 +9684,8 @@ __export(core_exports, {
9349
9684
  Doc: () => Doc,
9350
9685
  JSONSchema: () => json_schema_exports,
9351
9686
  JSONSchemaGenerator: () => JSONSchemaGenerator,
9687
+ NEVER: () => NEVER,
9688
+ TimePrecision: () => TimePrecision,
9352
9689
  _any: () => _any,
9353
9690
  _array: () => _array,
9354
9691
  _base64: () => _base64,
@@ -9438,6 +9775,7 @@ __export(core_exports, {
9438
9775
  _size: () => _size,
9439
9776
  _startsWith: () => _startsWith,
9440
9777
  _string: () => _string,
9778
+ _stringFormat: () => _stringFormat,
9441
9779
  _stringbool: () => _stringbool,
9442
9780
  _success: () => _success,
9443
9781
  _symbol: () => _symbol,
@@ -9487,7 +9825,7 @@ __export(core_exports, {
9487
9825
  });
9488
9826
 
9489
9827
  //#endregion
9490
- //#region ../../node_modules/zod/dist/esm/v4/classic/iso.js
9828
+ //#region ../../node_modules/zod/v4/classic/iso.js
9491
9829
  var iso_exports = {};
9492
9830
  __export(iso_exports, {
9493
9831
  ZodISODate: () => ZodISODate,
@@ -9529,7 +9867,7 @@ function duration(params) {
9529
9867
  }
9530
9868
 
9531
9869
  //#endregion
9532
- //#region ../../node_modules/zod/dist/esm/v4/classic/errors.js
9870
+ //#region ../../node_modules/zod/v4/classic/errors.js
9533
9871
  const initializer = (inst, issues) => {
9534
9872
  $ZodError.init(inst, issues);
9535
9873
  inst.name = "ZodError";
@@ -9547,14 +9885,14 @@ const ZodError = $constructor("ZodError", initializer);
9547
9885
  const ZodRealError = $constructor("ZodError", initializer, { Parent: Error });
9548
9886
 
9549
9887
  //#endregion
9550
- //#region ../../node_modules/zod/dist/esm/v4/classic/parse.js
9888
+ //#region ../../node_modules/zod/v4/classic/parse.js
9551
9889
  const parse = /* @__PURE__ */ _parse(ZodRealError);
9552
9890
  const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
9553
9891
  const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
9554
9892
  const safeParseAsync = /* @__PURE__ */ _safeParseAsync(ZodRealError);
9555
9893
 
9556
9894
  //#endregion
9557
- //#region ../../node_modules/zod/dist/esm/v4/classic/schemas.js
9895
+ //#region ../../node_modules/zod/v4/classic/schemas.js
9558
9896
  const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
9559
9897
  $ZodType.init(inst, def);
9560
9898
  inst.def = def;
@@ -9822,6 +10160,13 @@ const ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
9822
10160
  function jwt(params) {
9823
10161
  return _jwt(ZodJWT, params);
9824
10162
  }
10163
+ const ZodCustomStringFormat = /* @__PURE__ */ $constructor("ZodCustomStringFormat", (inst, def) => {
10164
+ $ZodCustomStringFormat.init(inst, def);
10165
+ ZodStringFormat.init(inst, def);
10166
+ });
10167
+ function stringFormat(format, fnOrRegex, _params = {}) {
10168
+ return _stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
10169
+ }
9825
10170
  const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
9826
10171
  $ZodNumber.init(inst, def);
9827
10172
  ZodType.init(inst, def);
@@ -9991,9 +10336,7 @@ function keyof(schema) {
9991
10336
  const ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
9992
10337
  $ZodObject.init(inst, def);
9993
10338
  ZodType.init(inst, def);
9994
- defineLazy(inst, "shape", () => {
9995
- return Object.fromEntries(Object.entries(inst._zod.def.shape));
9996
- });
10339
+ defineLazy(inst, "shape", () => def.shape);
9997
10340
  inst.keyof = () => _enum(Object.keys(inst._zod.def.shape));
9998
10341
  inst.catchall = (catchall) => inst.clone({
9999
10342
  ...inst._zod.def,
@@ -10438,11 +10781,8 @@ const ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
10438
10781
  $ZodCustom.init(inst, def);
10439
10782
  ZodType.init(inst, def);
10440
10783
  });
10441
- function check(fn, params) {
10442
- const ch = new $ZodCheck({
10443
- check: "custom",
10444
- ...normalizeParams(params)
10445
- });
10784
+ function check(fn) {
10785
+ const ch = new $ZodCheck({ check: "custom" });
10446
10786
  ch._zod.check = fn;
10447
10787
  return ch;
10448
10788
  }
@@ -10452,7 +10792,7 @@ function custom(fn, _params) {
10452
10792
  function refine(fn, _params = {}) {
10453
10793
  return _refine(ZodCustom, fn, _params);
10454
10794
  }
10455
- function superRefine(fn, params) {
10795
+ function superRefine(fn) {
10456
10796
  const ch = check((payload) => {
10457
10797
  payload.addIssue = (issue$1) => {
10458
10798
  if (typeof issue$1 === "string") {
@@ -10468,7 +10808,7 @@ function superRefine(fn, params) {
10468
10808
  }
10469
10809
  };
10470
10810
  return fn(payload.value, payload);
10471
- }, params);
10811
+ });
10472
10812
  return ch;
10473
10813
  }
10474
10814
  function _instanceof(cls, params = { error: `Input not instance of ${cls.name}` }) {
@@ -10506,7 +10846,7 @@ function preprocess(fn, schema) {
10506
10846
  }
10507
10847
 
10508
10848
  //#endregion
10509
- //#region ../../node_modules/zod/dist/esm/v4/classic/compat.js
10849
+ //#region ../../node_modules/zod/v4/classic/compat.js
10510
10850
  /** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
10511
10851
  const ZodIssueCode = {
10512
10852
  invalid_type: "invalid_type",
@@ -10521,10 +10861,6 @@ const ZodIssueCode = {
10521
10861
  invalid_value: "invalid_value",
10522
10862
  custom: "custom"
10523
10863
  };
10524
- /** @deprecated Not necessary in Zod 4. */
10525
- const INVALID = Object.freeze({ status: "aborted" });
10526
- /** A special constant with type `never` */
10527
- const NEVER = INVALID;
10528
10864
  /** @deprecated Use `z.config(params)` instead. */
10529
10865
  function setErrorMap(map$1) {
10530
10866
  config({ customError: map$1 });
@@ -10535,7 +10871,7 @@ function getErrorMap() {
10535
10871
  }
10536
10872
 
10537
10873
  //#endregion
10538
- //#region ../../node_modules/zod/dist/esm/v4/classic/coerce.js
10874
+ //#region ../../node_modules/zod/v4/classic/coerce.js
10539
10875
  var coerce_exports = {};
10540
10876
  __export(coerce_exports, {
10541
10877
  bigint: () => bigint,
@@ -10561,13 +10897,14 @@ function date(params) {
10561
10897
  }
10562
10898
 
10563
10899
  //#endregion
10564
- //#region ../../node_modules/zod/dist/esm/v4/classic/external.js
10900
+ //#region ../../node_modules/zod/v4/classic/external.js
10565
10901
  var external_exports = {};
10566
10902
  __export(external_exports, {
10567
10903
  $brand: () => $brand,
10568
10904
  $input: () => $input,
10569
10905
  $output: () => $output,
10570
10906
  NEVER: () => NEVER,
10907
+ TimePrecision: () => TimePrecision,
10571
10908
  ZodAny: () => ZodAny,
10572
10909
  ZodArray: () => ZodArray,
10573
10910
  ZodBase64: () => ZodBase64,
@@ -10581,6 +10918,7 @@ __export(external_exports, {
10581
10918
  ZodCUID2: () => ZodCUID2,
10582
10919
  ZodCatch: () => ZodCatch,
10583
10920
  ZodCustom: () => ZodCustom,
10921
+ ZodCustomStringFormat: () => ZodCustomStringFormat,
10584
10922
  ZodDate: () => ZodDate,
10585
10923
  ZodDefault: () => ZodDefault,
10586
10924
  ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
@@ -10742,6 +11080,7 @@ __export(external_exports, {
10742
11080
  startsWith: () => _startsWith,
10743
11081
  strictObject: () => strictObject,
10744
11082
  string: () => string$1,
11083
+ stringFormat: () => stringFormat,
10745
11084
  stringbool: () => stringbool,
10746
11085
  success: () => success,
10747
11086
  superRefine: () => superRefine,
@@ -10772,11 +11111,11 @@ __export(external_exports, {
10772
11111
  config(en_default());
10773
11112
 
10774
11113
  //#endregion
10775
- //#region ../../node_modules/zod/dist/esm/v4/classic/index.js
11114
+ //#region ../../node_modules/zod/v4/classic/index.js
10776
11115
  var classic_default = external_exports;
10777
11116
 
10778
11117
  //#endregion
10779
- //#region ../../node_modules/zod/dist/esm/v4/index.js
11118
+ //#region ../../node_modules/zod/v4/index.js
10780
11119
  var v4_default = classic_default;
10781
11120
 
10782
11121
  //#endregion