@settlemint/sdk-utils 2.5.1-mainf0c7fb9b → 2.5.1-mainffd47926

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.
@@ -10,7 +10,9 @@ var __export = (target, all) => {
10
10
  };
11
11
 
12
12
  //#endregion
13
- //#region ../../node_modules/zod/dist/esm/v4/core/core.js
13
+ //#region ../../node_modules/zod/v4/core/core.js
14
+ /** A special constant with type `never` */
15
+ const NEVER = Object.freeze({ status: "aborted" });
14
16
  function $constructor(name, initializer$2, params) {
15
17
  function init(inst, def) {
16
18
  var _a;
@@ -61,7 +63,7 @@ function config(newConfig) {
61
63
  }
62
64
 
63
65
  //#endregion
64
- //#region ../../node_modules/zod/dist/esm/v4/core/util.js
66
+ //#region ../../node_modules/zod/v4/core/util.js
65
67
  var util_exports = {};
66
68
  __export(util_exports, {
67
69
  BIGINT_FORMAT_RANGES: () => BIGINT_FORMAT_RANGES,
@@ -76,6 +78,7 @@ __export(util_exports, {
76
78
  assertNotEqual: () => assertNotEqual,
77
79
  assignProp: () => assignProp,
78
80
  cached: () => cached,
81
+ captureStackTrace: () => captureStackTrace,
79
82
  cleanEnum: () => cleanEnum,
80
83
  cleanRegex: () => cleanRegex,
81
84
  clone: () => clone,
@@ -214,10 +217,14 @@ function randomString(length = 10) {
214
217
  function esc(str) {
215
218
  return JSON.stringify(str);
216
219
  }
220
+ const captureStackTrace = Error.captureStackTrace ? Error.captureStackTrace : (..._args) => {};
217
221
  function isObject(data) {
218
222
  return typeof data === "object" && data !== null && !Array.isArray(data);
219
223
  }
220
224
  const allowsEval = cached(() => {
225
+ if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) {
226
+ return false;
227
+ }
221
228
  try {
222
229
  const F = Function;
223
230
  new F("");
@@ -226,9 +233,6 @@ const allowsEval = cached(() => {
226
233
  return false;
227
234
  }
228
235
  });
229
- function _isObject(o) {
230
- return Object.prototype.toString.call(o) === "[object Object]";
231
- }
232
236
  function isPlainObject(o) {
233
237
  if (isObject(o) === false) return false;
234
238
  const ctor = o.constructor;
@@ -408,6 +412,9 @@ function omit(schema, mask) {
408
412
  });
409
413
  }
410
414
  function extend(schema, shape) {
415
+ if (!isPlainObject(shape)) {
416
+ throw new Error("Invalid input to extend: expected a plain object");
417
+ }
411
418
  const def = {
412
419
  ...schema._zod.def,
413
420
  get shape() {
@@ -495,7 +502,7 @@ function required(Class$1, schema, mask) {
495
502
  }
496
503
  function aborted(x, startIndex = 0) {
497
504
  for (let i = startIndex; i < x.issues.length; i++) {
498
- if (x.issues[i].continue !== true) return true;
505
+ if (x.issues[i]?.continue !== true) return true;
499
506
  }
500
507
  return false;
501
508
  }
@@ -559,7 +566,7 @@ var Class = class {
559
566
  };
560
567
 
561
568
  //#endregion
562
- //#region ../../node_modules/zod/dist/esm/v4/core/errors.js
569
+ //#region ../../node_modules/zod/v4/core/errors.js
563
570
  const initializer$1 = (inst, def) => {
564
571
  inst.name = "$ZodError";
565
572
  Object.defineProperty(inst, "_zod", {
@@ -576,13 +583,17 @@ const initializer$1 = (inst, def) => {
576
583
  },
577
584
  enumerable: true
578
585
  });
586
+ Object.defineProperty(inst, "toString", {
587
+ value: () => inst.message,
588
+ enumerable: false
589
+ });
579
590
  };
580
591
  const $ZodError = $constructor("$ZodError", initializer$1);
581
592
  const $ZodRealError = $constructor("$ZodError", initializer$1, { Parent: Error });
582
- function flattenError(error$37, mapper = (issue$1) => issue$1.message) {
593
+ function flattenError(error$39, mapper = (issue$1) => issue$1.message) {
583
594
  const fieldErrors = {};
584
595
  const formErrors = [];
585
- for (const sub of error$37.issues) {
596
+ for (const sub of error$39.issues) {
586
597
  if (sub.path.length > 0) {
587
598
  fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
588
599
  fieldErrors[sub.path[0]].push(mapper(sub));
@@ -595,13 +606,13 @@ function flattenError(error$37, mapper = (issue$1) => issue$1.message) {
595
606
  fieldErrors
596
607
  };
597
608
  }
598
- function formatError(error$37, _mapper) {
609
+ function formatError(error$39, _mapper) {
599
610
  const mapper = _mapper || function(issue$1) {
600
611
  return issue$1.message;
601
612
  };
602
613
  const fieldErrors = { _errors: [] };
603
- const processError = (error$38) => {
604
- for (const issue$1 of error$38.issues) {
614
+ const processError = (error$40) => {
615
+ for (const issue$1 of error$40.issues) {
605
616
  if (issue$1.code === "invalid_union" && issue$1.errors.length) {
606
617
  issue$1.errors.map((issues) => processError({ issues }));
607
618
  } else if (issue$1.code === "invalid_key") {
@@ -628,17 +639,17 @@ function formatError(error$37, _mapper) {
628
639
  }
629
640
  }
630
641
  };
631
- processError(error$37);
642
+ processError(error$39);
632
643
  return fieldErrors;
633
644
  }
634
- function treeifyError(error$37, _mapper) {
645
+ function treeifyError(error$39, _mapper) {
635
646
  const mapper = _mapper || function(issue$1) {
636
647
  return issue$1.message;
637
648
  };
638
649
  const result = { errors: [] };
639
- const processError = (error$38, path = []) => {
650
+ const processError = (error$40, path = []) => {
640
651
  var _a, _b;
641
- for (const issue$1 of error$38.issues) {
652
+ for (const issue$1 of error$40.issues) {
642
653
  if (issue$1.code === "invalid_union" && issue$1.errors.length) {
643
654
  issue$1.errors.map((issues) => processError({ issues }, issue$1.path));
644
655
  } else if (issue$1.code === "invalid_key") {
@@ -673,7 +684,7 @@ function treeifyError(error$37, _mapper) {
673
684
  }
674
685
  }
675
686
  };
676
- processError(error$37);
687
+ processError(error$39);
677
688
  return result;
678
689
  }
679
690
  /** Format a ZodError as a human-readable string in the following form.
@@ -721,9 +732,9 @@ function toDotPath(path) {
721
732
  }
722
733
  return segs.join("");
723
734
  }
724
- function prettifyError(error$37) {
735
+ function prettifyError(error$39) {
725
736
  const lines = [];
726
- const issues = [...error$37.issues].sort((a, b) => a.path.length - b.path.length);
737
+ const issues = [...error$39.issues].sort((a, b) => a.path.length - b.path.length);
727
738
  for (const issue$1 of issues) {
728
739
  lines.push(`✖ ${issue$1.message}`);
729
740
  if (issue$1.path?.length) lines.push(` → at ${toDotPath(issue$1.path)}`);
@@ -732,7 +743,7 @@ function prettifyError(error$37) {
732
743
  }
733
744
 
734
745
  //#endregion
735
- //#region ../../node_modules/zod/dist/esm/v4/core/parse.js
746
+ //#region ../../node_modules/zod/v4/core/parse.js
736
747
  const _parse = (_Err) => (schema, value, _ctx, _params) => {
737
748
  const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
738
749
  const result = schema._zod.run({
@@ -744,7 +755,7 @@ const _parse = (_Err) => (schema, value, _ctx, _params) => {
744
755
  }
745
756
  if (result.issues.length) {
746
757
  const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
747
- Error.captureStackTrace(e, _params?.callee);
758
+ captureStackTrace(e, _params?.callee);
748
759
  throw e;
749
760
  }
750
761
  return result.value;
@@ -759,7 +770,7 @@ const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
759
770
  if (result instanceof Promise) result = await result;
760
771
  if (result.issues.length) {
761
772
  const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
762
- Error.captureStackTrace(e, params?.callee);
773
+ captureStackTrace(e, params?.callee);
763
774
  throw e;
764
775
  }
765
776
  return result.value;
@@ -804,10 +815,9 @@ const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
804
815
  const safeParseAsync$1 = /* @__PURE__ */ _safeParseAsync($ZodRealError);
805
816
 
806
817
  //#endregion
807
- //#region ../../node_modules/zod/dist/esm/v4/core/regexes.js
818
+ //#region ../../node_modules/zod/v4/core/regexes.js
808
819
  var regexes_exports = {};
809
820
  __export(regexes_exports, {
810
- _emoji: () => _emoji$1,
811
821
  base64: () => base64$1,
812
822
  base64url: () => base64url$1,
813
823
  bigint: () => bigint$2,
@@ -893,27 +903,23 @@ const base64url$1 = /^[A-Za-z0-9_-]*$/;
893
903
  const hostname = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/;
894
904
  const domain = /^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/;
895
905
  const e164$1 = /^\+(?:[0-9]){6,14}[0-9]$/;
896
- 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])))`;
906
+ 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])))`;
897
907
  const date$3 = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
898
908
  function timeSource(args) {
899
- let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
900
- if (args.precision) {
901
- regex = `${regex}\\.\\d{${args.precision}}`;
902
- } else if (args.precision == null) {
903
- regex = `${regex}(\\.\\d+)?`;
904
- }
909
+ const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
910
+ 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+)?)?`;
905
911
  return regex;
906
912
  }
907
913
  function time$1(args) {
908
914
  return new RegExp(`^${timeSource(args)}$`);
909
915
  }
910
916
  function datetime$1(args) {
911
- let regex = `${dateSource}T${timeSource(args)}`;
912
- const opts = [];
913
- opts.push(args.local ? `Z?` : `Z`);
914
- if (args.offset) opts.push(`([+-]\\d{2}:?\\d{2})`);
915
- regex = `${regex}(${opts.join("|")})`;
916
- return new RegExp(`^${regex}$`);
917
+ const time$2 = timeSource({ precision: args.precision });
918
+ const opts = ["Z"];
919
+ if (args.local) opts.push("");
920
+ if (args.offset) opts.push(`([+-]\\d{2}:\\d{2})`);
921
+ const timeRegex = `${time$2}(?:${opts.join("|")})`;
922
+ return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
917
923
  }
918
924
  const string$2 = (params) => {
919
925
  const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
@@ -929,7 +935,7 @@ const lowercase = /^[^A-Z]*$/;
929
935
  const uppercase = /^[^a-z]*$/;
930
936
 
931
937
  //#endregion
932
- //#region ../../node_modules/zod/dist/esm/v4/core/checks.js
938
+ //#region ../../node_modules/zod/v4/core/checks.js
933
939
  const $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
934
940
  var _a;
935
941
  inst._zod ?? (inst._zod = {});
@@ -1120,11 +1126,12 @@ const $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntForma
1120
1126
  };
1121
1127
  });
1122
1128
  const $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, def) => {
1129
+ var _a;
1123
1130
  $ZodCheck.init(inst, def);
1124
- inst._zod.when = (payload) => {
1131
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1125
1132
  const val = payload.value;
1126
1133
  return !nullish$1(val) && val.size !== undefined;
1127
- };
1134
+ });
1128
1135
  inst._zod.onattach.push((inst$1) => {
1129
1136
  const curr = inst$1._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
1130
1137
  if (def.maximum < curr) inst$1._zod.bag.maximum = def.maximum;
@@ -1144,11 +1151,12 @@ const $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst,
1144
1151
  };
1145
1152
  });
1146
1153
  const $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, def) => {
1154
+ var _a;
1147
1155
  $ZodCheck.init(inst, def);
1148
- inst._zod.when = (payload) => {
1156
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1149
1157
  const val = payload.value;
1150
1158
  return !nullish$1(val) && val.size !== undefined;
1151
- };
1159
+ });
1152
1160
  inst._zod.onattach.push((inst$1) => {
1153
1161
  const curr = inst$1._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
1154
1162
  if (def.minimum > curr) inst$1._zod.bag.minimum = def.minimum;
@@ -1168,11 +1176,12 @@ const $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst,
1168
1176
  };
1169
1177
  });
1170
1178
  const $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (inst, def) => {
1179
+ var _a;
1171
1180
  $ZodCheck.init(inst, def);
1172
- inst._zod.when = (payload) => {
1181
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1173
1182
  const val = payload.value;
1174
1183
  return !nullish$1(val) && val.size !== undefined;
1175
- };
1184
+ });
1176
1185
  inst._zod.onattach.push((inst$1) => {
1177
1186
  const bag = inst$1._zod.bag;
1178
1187
  bag.minimum = def.size;
@@ -1193,6 +1202,8 @@ const $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals",
1193
1202
  code: "too_small",
1194
1203
  minimum: def.size
1195
1204
  },
1205
+ inclusive: true,
1206
+ exact: true,
1196
1207
  input: payload.value,
1197
1208
  inst,
1198
1209
  continue: !def.abort
@@ -1200,11 +1211,12 @@ const $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals",
1200
1211
  };
1201
1212
  });
1202
1213
  const $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
1214
+ var _a;
1203
1215
  $ZodCheck.init(inst, def);
1204
- inst._zod.when = (payload) => {
1216
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1205
1217
  const val = payload.value;
1206
1218
  return !nullish$1(val) && val.length !== undefined;
1207
- };
1219
+ });
1208
1220
  inst._zod.onattach.push((inst$1) => {
1209
1221
  const curr = inst$1._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
1210
1222
  if (def.maximum < curr) inst$1._zod.bag.maximum = def.maximum;
@@ -1226,11 +1238,12 @@ const $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (i
1226
1238
  };
1227
1239
  });
1228
1240
  const $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
1241
+ var _a;
1229
1242
  $ZodCheck.init(inst, def);
1230
- inst._zod.when = (payload) => {
1243
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1231
1244
  const val = payload.value;
1232
1245
  return !nullish$1(val) && val.length !== undefined;
1233
- };
1246
+ });
1234
1247
  inst._zod.onattach.push((inst$1) => {
1235
1248
  const curr = inst$1._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
1236
1249
  if (def.minimum > curr) inst$1._zod.bag.minimum = def.minimum;
@@ -1252,11 +1265,12 @@ const $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (i
1252
1265
  };
1253
1266
  });
1254
1267
  const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
1268
+ var _a;
1255
1269
  $ZodCheck.init(inst, def);
1256
- inst._zod.when = (payload) => {
1270
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
1257
1271
  const val = payload.value;
1258
1272
  return !nullish$1(val) && val.length !== undefined;
1259
- };
1273
+ });
1260
1274
  inst._zod.onattach.push((inst$1) => {
1261
1275
  const bag = inst$1._zod.bag;
1262
1276
  bag.minimum = def.length;
@@ -1278,6 +1292,8 @@ const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEqual
1278
1292
  code: "too_small",
1279
1293
  minimum: def.length
1280
1294
  },
1295
+ inclusive: true,
1296
+ exact: true,
1281
1297
  input: payload.value,
1282
1298
  inst,
1283
1299
  continue: !def.abort
@@ -1285,7 +1301,7 @@ const $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEqual
1285
1301
  };
1286
1302
  });
1287
1303
  const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
1288
- var _a;
1304
+ var _a, _b;
1289
1305
  $ZodCheck.init(inst, def);
1290
1306
  inst._zod.onattach.push((inst$1) => {
1291
1307
  const bag = inst$1._zod.bag;
@@ -1295,8 +1311,7 @@ const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringForma
1295
1311
  bag.patterns.add(def.pattern);
1296
1312
  }
1297
1313
  });
1298
- (_a = inst._zod).check ?? (_a.check = (payload) => {
1299
- if (!def.pattern) throw new Error("Not implemented.");
1314
+ if (def.pattern) (_a = inst._zod).check ?? (_a.check = (payload) => {
1300
1315
  def.pattern.lastIndex = 0;
1301
1316
  if (def.pattern.test(payload.value)) return;
1302
1317
  payload.issues.push({
@@ -1309,6 +1324,7 @@ const $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringForma
1309
1324
  continue: !def.abort
1310
1325
  });
1311
1326
  });
1327
+ else (_b = inst._zod).check ?? (_b.check = () => {});
1312
1328
  });
1313
1329
  const $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def) => {
1314
1330
  $ZodCheckStringFormat.init(inst, def);
@@ -1432,7 +1448,6 @@ const $ZodCheckMimeType = /* @__PURE__ */ $constructor("$ZodCheckMimeType", (ins
1432
1448
  code: "invalid_value",
1433
1449
  values: def.mime,
1434
1450
  input: payload.value.type,
1435
- path: ["type"],
1436
1451
  inst
1437
1452
  });
1438
1453
  };
@@ -1445,7 +1460,7 @@ const $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (i
1445
1460
  });
1446
1461
 
1447
1462
  //#endregion
1448
- //#region ../../node_modules/zod/dist/esm/v4/core/doc.js
1463
+ //#region ../../node_modules/zod/v4/core/doc.js
1449
1464
  var Doc = class {
1450
1465
  constructor(args = []) {
1451
1466
  this.content = [];
@@ -1481,19 +1496,18 @@ var Doc = class {
1481
1496
  };
1482
1497
 
1483
1498
  //#endregion
1484
- //#region ../../node_modules/zod/dist/esm/v4/core/versions.js
1499
+ //#region ../../node_modules/zod/v4/core/versions.js
1485
1500
  const version = {
1486
1501
  major: 4,
1487
1502
  minor: 0,
1488
- patch: 0
1503
+ patch: 5
1489
1504
  };
1490
1505
 
1491
1506
  //#endregion
1492
- //#region ../../node_modules/zod/dist/esm/v4/core/schemas.js
1507
+ //#region ../../node_modules/zod/v4/core/schemas.js
1493
1508
  const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1494
1509
  var _a;
1495
1510
  inst ?? (inst = {});
1496
- inst._zod.id = def.type + "_" + randomString(10);
1497
1511
  inst._zod.def = def;
1498
1512
  inst._zod.bag = inst._zod.bag || {};
1499
1513
  inst._zod.version = version;
@@ -1516,13 +1530,11 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1516
1530
  let isAborted = aborted(payload);
1517
1531
  let asyncResult;
1518
1532
  for (const ch of checks$1) {
1519
- if (ch._zod.when) {
1520
- const shouldRun = ch._zod.when(payload);
1533
+ if (ch._zod.def.when) {
1534
+ const shouldRun = ch._zod.def.when(payload);
1521
1535
  if (!shouldRun) continue;
1522
- } else {
1523
- if (isAborted) {
1524
- continue;
1525
- }
1536
+ } else if (isAborted) {
1537
+ continue;
1526
1538
  }
1527
1539
  const currLen = payload.issues.length;
1528
1540
  const _ = ch._zod.check(payload);
@@ -1622,7 +1634,9 @@ const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
1622
1634
  $ZodStringFormat.init(inst, def);
1623
1635
  inst._zod.check = (payload) => {
1624
1636
  try {
1625
- const url$1 = new URL(payload.value);
1637
+ const orig = payload.value;
1638
+ const url$1 = new URL(orig);
1639
+ const href = url$1.href;
1626
1640
  if (def.hostname) {
1627
1641
  def.hostname.lastIndex = 0;
1628
1642
  if (!def.hostname.test(url$1.hostname)) {
@@ -1651,6 +1665,11 @@ const $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
1651
1665
  });
1652
1666
  }
1653
1667
  }
1668
+ if (!orig.endsWith("/") && href.endsWith("/")) {
1669
+ payload.value = href.slice(0, -1);
1670
+ } else {
1671
+ payload.value = href;
1672
+ }
1654
1673
  return;
1655
1674
  } catch (_) {
1656
1675
  payload.issues.push({
@@ -1821,6 +1840,7 @@ function isValidJWT(token, algorithm = null) {
1821
1840
  const tokensParts = token.split(".");
1822
1841
  if (tokensParts.length !== 3) return false;
1823
1842
  const [header] = tokensParts;
1843
+ if (!header) return false;
1824
1844
  const parsedHeader = JSON.parse(atob(header));
1825
1845
  if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT") return false;
1826
1846
  if (!parsedHeader.alg) return false;
@@ -1843,6 +1863,19 @@ const $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => {
1843
1863
  });
1844
1864
  };
1845
1865
  });
1866
+ const $ZodCustomStringFormat = /* @__PURE__ */ $constructor("$ZodCustomStringFormat", (inst, def) => {
1867
+ $ZodStringFormat.init(inst, def);
1868
+ inst._zod.check = (payload) => {
1869
+ if (def.fn(payload.value)) return;
1870
+ payload.issues.push({
1871
+ code: "invalid_format",
1872
+ format: def.format,
1873
+ input: payload.value,
1874
+ inst,
1875
+ continue: !def.abort
1876
+ });
1877
+ };
1878
+ });
1846
1879
  const $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
1847
1880
  $ZodType.init(inst, def);
1848
1881
  inst._zod.pattern = inst._zod.bag.pattern ?? number$2;
@@ -1894,12 +1927,11 @@ const $ZodBigInt = /* @__PURE__ */ $constructor("$ZodBigInt", (inst, def) => {
1894
1927
  if (def.coerce) try {
1895
1928
  payload.value = BigInt(payload.value);
1896
1929
  } catch (_) {}
1897
- const { value: input } = payload;
1898
- if (typeof input === "bigint") return payload;
1930
+ if (typeof payload.value === "bigint") return payload;
1899
1931
  payload.issues.push({
1900
1932
  expected: "bigint",
1901
1933
  code: "invalid_type",
1902
- input,
1934
+ input: payload.value,
1903
1935
  inst
1904
1936
  });
1905
1937
  return payload;
@@ -1912,7 +1944,7 @@ const $ZodBigIntFormat = /* @__PURE__ */ $constructor("$ZodBigInt", (inst, def)
1912
1944
  const $ZodSymbol = /* @__PURE__ */ $constructor("$ZodSymbol", (inst, def) => {
1913
1945
  $ZodType.init(inst, def);
1914
1946
  inst._zod.parse = (payload, _ctx) => {
1915
- const { value: input } = payload;
1947
+ const input = payload.value;
1916
1948
  if (typeof input === "symbol") return payload;
1917
1949
  payload.issues.push({
1918
1950
  expected: "symbol",
@@ -1927,8 +1959,10 @@ const $ZodUndefined = /* @__PURE__ */ $constructor("$ZodUndefined", (inst, def)
1927
1959
  $ZodType.init(inst, def);
1928
1960
  inst._zod.pattern = _undefined$2;
1929
1961
  inst._zod.values = new Set([undefined]);
1962
+ inst._zod.optin = "optional";
1963
+ inst._zod.optout = "optional";
1930
1964
  inst._zod.parse = (payload, _ctx) => {
1931
- const { value: input } = payload;
1965
+ const input = payload.value;
1932
1966
  if (typeof input === "undefined") return payload;
1933
1967
  payload.issues.push({
1934
1968
  expected: "undefined",
@@ -1944,7 +1978,7 @@ const $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
1944
1978
  inst._zod.pattern = _null$2;
1945
1979
  inst._zod.values = new Set([null]);
1946
1980
  inst._zod.parse = (payload, _ctx) => {
1947
- const { value: input } = payload;
1981
+ const input = payload.value;
1948
1982
  if (input === null) return payload;
1949
1983
  payload.issues.push({
1950
1984
  expected: "null",
@@ -1978,7 +2012,7 @@ const $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
1978
2012
  const $ZodVoid = /* @__PURE__ */ $constructor("$ZodVoid", (inst, def) => {
1979
2013
  $ZodType.init(inst, def);
1980
2014
  inst._zod.parse = (payload, _ctx) => {
1981
- const { value: input } = payload;
2015
+ const input = payload.value;
1982
2016
  if (typeof input === "undefined") return payload;
1983
2017
  payload.issues.push({
1984
2018
  expected: "void",
@@ -2109,19 +2143,20 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
2109
2143
  "payload",
2110
2144
  "ctx"
2111
2145
  ]);
2112
- const { keys, optionalKeys: optionalKeys$1 } = _normalized.value;
2146
+ const normalized = _normalized.value;
2113
2147
  const parseStr = (key) => {
2114
2148
  const k = esc(key);
2115
2149
  return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
2116
2150
  };
2117
2151
  doc.write(`const input = payload.value;`);
2118
2152
  const ids = Object.create(null);
2119
- for (const key of keys) {
2120
- ids[key] = randomString(15);
2153
+ let counter = 0;
2154
+ for (const key of normalized.keys) {
2155
+ ids[key] = `key_${counter++}`;
2121
2156
  }
2122
2157
  doc.write(`const newResult = {}`);
2123
- for (const key of keys) {
2124
- if (optionalKeys$1.has(key)) {
2158
+ for (const key of normalized.keys) {
2159
+ if (normalized.optionalKeys.has(key)) {
2125
2160
  const id = ids[key];
2126
2161
  doc.write(`const ${id} = ${parseStr(key)};`);
2127
2162
  const k = esc(key);
@@ -2166,7 +2201,7 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
2166
2201
  const jit = !globalConfig.jitless;
2167
2202
  const allowsEval$1 = allowsEval;
2168
2203
  const fastEnabled = jit && allowsEval$1.value;
2169
- const { catchall } = def;
2204
+ const catchall = def.catchall;
2170
2205
  let value;
2171
2206
  inst._zod.parse = (payload, ctx) => {
2172
2207
  value ?? (value = _normalized.value);
@@ -2196,12 +2231,10 @@ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
2196
2231
  const isOptional = el._zod.optin === "optional" && el._zod.optout === "optional";
2197
2232
  if (r instanceof Promise) {
2198
2233
  proms.push(r.then((r$1) => isOptional ? handleOptionalObjectResult(r$1, payload, key, input) : handleObjectResult(r$1, payload, key)));
2234
+ } else if (isOptional) {
2235
+ handleOptionalObjectResult(r, payload, key, input);
2199
2236
  } else {
2200
- if (isOptional) {
2201
- handleOptionalObjectResult(r, payload, key, input);
2202
- } else {
2203
- handleObjectResult(r, payload, key);
2204
- }
2237
+ handleObjectResult(r, payload, key);
2205
2238
  }
2206
2239
  }
2207
2240
  }
@@ -2259,6 +2292,8 @@ function handleUnionResults(results, final, inst, ctx) {
2259
2292
  }
2260
2293
  const $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
2261
2294
  $ZodType.init(inst, def);
2295
+ defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : undefined);
2296
+ defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : undefined);
2262
2297
  defineLazy(inst._zod, "values", () => {
2263
2298
  if (def.options.every((o) => o._zod.values)) {
2264
2299
  return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
@@ -2315,7 +2350,7 @@ const $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUn
2315
2350
  const opts = def.options;
2316
2351
  const map$1 = new Map();
2317
2352
  for (const o of opts) {
2318
- const values = o._zod.propValues[def.discriminator];
2353
+ const values = o._zod.propValues?.[def.discriminator];
2319
2354
  if (!values || values.size === 0) throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(o)}"`);
2320
2355
  for (const v of values) {
2321
2356
  if (map$1.has(v)) {
@@ -2358,7 +2393,7 @@ const $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUn
2358
2393
  const $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => {
2359
2394
  $ZodType.init(inst, def);
2360
2395
  inst._zod.parse = (payload, ctx) => {
2361
- const { value: input } = payload;
2396
+ const input = payload.value;
2362
2397
  const left = def.left._zod.run({
2363
2398
  value: input,
2364
2399
  issues: []
@@ -2815,6 +2850,9 @@ const $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) =>
2815
2850
  return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : undefined;
2816
2851
  });
2817
2852
  inst._zod.parse = (payload, ctx) => {
2853
+ if (def.innerType._zod.optin === "optional") {
2854
+ return def.innerType._zod.run(payload, ctx);
2855
+ }
2818
2856
  if (payload.value === undefined) {
2819
2857
  return payload;
2820
2858
  }
@@ -2914,7 +2952,7 @@ const $ZodSuccess = /* @__PURE__ */ $constructor("$ZodSuccess", (inst, def) => {
2914
2952
  });
2915
2953
  const $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
2916
2954
  $ZodType.init(inst, def);
2917
- defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
2955
+ inst._zod.optin = "optional";
2918
2956
  defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
2919
2957
  defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2920
2958
  inst._zod.parse = (payload, ctx) => {
@@ -2965,6 +3003,7 @@ const $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => {
2965
3003
  defineLazy(inst._zod, "values", () => def.in._zod.values);
2966
3004
  defineLazy(inst._zod, "optin", () => def.in._zod.optin);
2967
3005
  defineLazy(inst._zod, "optout", () => def.out._zod.optout);
3006
+ defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
2968
3007
  inst._zod.parse = (payload, ctx) => {
2969
3008
  const left = def.in._zod.run(payload, ctx);
2970
3009
  if (left instanceof Promise) {
@@ -2985,6 +3024,7 @@ function handlePipeResult(left, def, ctx) {
2985
3024
  const $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => {
2986
3025
  $ZodType.init(inst, def);
2987
3026
  defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
3027
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2988
3028
  defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
2989
3029
  defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
2990
3030
  inst._zod.parse = (payload, ctx) => {
@@ -3035,7 +3075,7 @@ const $ZodTemplateLiteral = /* @__PURE__ */ $constructor("$ZodTemplateLiteral",
3035
3075
  input: payload.value,
3036
3076
  inst,
3037
3077
  code: "invalid_format",
3038
- format: "template_literal",
3078
+ format: def.format ?? "template_literal",
3039
3079
  pattern: inst._zod.pattern.source
3040
3080
  });
3041
3081
  return payload;
@@ -3095,8 +3135,8 @@ function handleRefineResult(result, payload, input, inst) {
3095
3135
  }
3096
3136
 
3097
3137
  //#endregion
3098
- //#region ../../node_modules/zod/dist/esm/v4/locales/ar.js
3099
- const error$36 = () => {
3138
+ //#region ../../node_modules/zod/v4/locales/ar.js
3139
+ const error$38 = () => {
3100
3140
  const Sizable = {
3101
3141
  string: {
3102
3142
  unit: "حرف",
@@ -3118,7 +3158,7 @@ const error$36 = () => {
3118
3158
  function getSizing(origin) {
3119
3159
  return Sizable[origin] ?? null;
3120
3160
  }
3121
- const parsedType$2 = (data) => {
3161
+ const parsedType$3 = (data) => {
3122
3162
  const t = typeof data;
3123
3163
  switch (t) {
3124
3164
  case "number": {
@@ -3170,7 +3210,7 @@ const error$36 = () => {
3170
3210
  };
3171
3211
  return (issue$1) => {
3172
3212
  switch (issue$1.code) {
3173
- case "invalid_type": return `مدخلات غير مقبولة: يفترض إدخال ${issue$1.expected}، ولكن تم إدخال ${parsedType$2(issue$1.input)}`;
3213
+ case "invalid_type": return `مدخلات غير مقبولة: يفترض إدخال ${issue$1.expected}، ولكن تم إدخال ${parsedType$3(issue$1.input)}`;
3174
3214
  case "invalid_value":
3175
3215
  if (issue$1.values.length === 1) return `مدخلات غير مقبولة: يفترض إدخال ${stringifyPrimitive(issue$1.values[0])}`;
3176
3216
  return `اختيار غير مقبول: يتوقع انتقاء أحد هذه الخيارات: ${joinValues(issue$1.values, "|")}`;
@@ -3206,12 +3246,12 @@ const error$36 = () => {
3206
3246
  };
3207
3247
  };
3208
3248
  function ar_default() {
3209
- return { localeError: error$36() };
3249
+ return { localeError: error$38() };
3210
3250
  }
3211
3251
 
3212
3252
  //#endregion
3213
- //#region ../../node_modules/zod/dist/esm/v4/locales/az.js
3214
- const error$35 = () => {
3253
+ //#region ../../node_modules/zod/v4/locales/az.js
3254
+ const error$37 = () => {
3215
3255
  const Sizable = {
3216
3256
  string: {
3217
3257
  unit: "simvol",
@@ -3233,7 +3273,7 @@ const error$35 = () => {
3233
3273
  function getSizing(origin) {
3234
3274
  return Sizable[origin] ?? null;
3235
3275
  }
3236
- const parsedType$2 = (data) => {
3276
+ const parsedType$3 = (data) => {
3237
3277
  const t = typeof data;
3238
3278
  switch (t) {
3239
3279
  case "number": {
@@ -3285,7 +3325,7 @@ const error$35 = () => {
3285
3325
  };
3286
3326
  return (issue$1) => {
3287
3327
  switch (issue$1.code) {
3288
- case "invalid_type": return `Yanlış dəyər: gözlənilən ${issue$1.expected}, daxil olan ${parsedType$2(issue$1.input)}`;
3328
+ case "invalid_type": return `Yanlış dəyər: gözlənilən ${issue$1.expected}, daxil olan ${parsedType$3(issue$1.input)}`;
3289
3329
  case "invalid_value":
3290
3330
  if (issue$1.values.length === 1) return `Yanlış dəyər: gözlənilən ${stringifyPrimitive(issue$1.values[0])}`;
3291
3331
  return `Yanlış seçim: aşağıdakılardan biri olmalıdır: ${joinValues(issue$1.values, "|")}`;
@@ -3319,11 +3359,11 @@ const error$35 = () => {
3319
3359
  };
3320
3360
  };
3321
3361
  function az_default() {
3322
- return { localeError: error$35() };
3362
+ return { localeError: error$37() };
3323
3363
  }
3324
3364
 
3325
3365
  //#endregion
3326
- //#region ../../node_modules/zod/dist/esm/v4/locales/be.js
3366
+ //#region ../../node_modules/zod/v4/locales/be.js
3327
3367
  function getBelarusianPlural(count, one, few, many) {
3328
3368
  const absCount = Math.abs(count);
3329
3369
  const lastDigit = absCount % 10;
@@ -3339,7 +3379,7 @@ function getBelarusianPlural(count, one, few, many) {
3339
3379
  }
3340
3380
  return many;
3341
3381
  }
3342
- const error$34 = () => {
3382
+ const error$36 = () => {
3343
3383
  const Sizable = {
3344
3384
  string: {
3345
3385
  unit: {
@@ -3377,7 +3417,7 @@ const error$34 = () => {
3377
3417
  function getSizing(origin) {
3378
3418
  return Sizable[origin] ?? null;
3379
3419
  }
3380
- const parsedType$2 = (data) => {
3420
+ const parsedType$3 = (data) => {
3381
3421
  const t = typeof data;
3382
3422
  switch (t) {
3383
3423
  case "number": {
@@ -3429,7 +3469,7 @@ const error$34 = () => {
3429
3469
  };
3430
3470
  return (issue$1) => {
3431
3471
  switch (issue$1.code) {
3432
- case "invalid_type": return `Няправільны ўвод: чакаўся ${issue$1.expected}, атрымана ${parsedType$2(issue$1.input)}`;
3472
+ case "invalid_type": return `Няправільны ўвод: чакаўся ${issue$1.expected}, атрымана ${parsedType$3(issue$1.input)}`;
3433
3473
  case "invalid_value":
3434
3474
  if (issue$1.values.length === 1) return `Няправільны ўвод: чакалася ${stringifyPrimitive(issue$1.values[0])}`;
3435
3475
  return `Няправільны варыянт: чакаўся адзін з ${joinValues(issue$1.values, "|")}`;
@@ -3471,12 +3511,12 @@ const error$34 = () => {
3471
3511
  };
3472
3512
  };
3473
3513
  function be_default() {
3474
- return { localeError: error$34() };
3514
+ return { localeError: error$36() };
3475
3515
  }
3476
3516
 
3477
3517
  //#endregion
3478
- //#region ../../node_modules/zod/dist/esm/v4/locales/ca.js
3479
- const error$33 = () => {
3518
+ //#region ../../node_modules/zod/v4/locales/ca.js
3519
+ const error$35 = () => {
3480
3520
  const Sizable = {
3481
3521
  string: {
3482
3522
  unit: "caràcters",
@@ -3498,7 +3538,7 @@ const error$33 = () => {
3498
3538
  function getSizing(origin) {
3499
3539
  return Sizable[origin] ?? null;
3500
3540
  }
3501
- const parsedType$2 = (data) => {
3541
+ const parsedType$3 = (data) => {
3502
3542
  const t = typeof data;
3503
3543
  switch (t) {
3504
3544
  case "number": {
@@ -3550,7 +3590,7 @@ const error$33 = () => {
3550
3590
  };
3551
3591
  return (issue$1) => {
3552
3592
  switch (issue$1.code) {
3553
- case "invalid_type": return `Tipus invàlid: s'esperava ${issue$1.expected}, s'ha rebut ${parsedType$2(issue$1.input)}`;
3593
+ case "invalid_type": return `Tipus invàlid: s'esperava ${issue$1.expected}, s'ha rebut ${parsedType$3(issue$1.input)}`;
3554
3594
  case "invalid_value":
3555
3595
  if (issue$1.values.length === 1) return `Valor invàlid: s'esperava ${stringifyPrimitive(issue$1.values[0])}`;
3556
3596
  return `Opció invàlida: s'esperava una de ${joinValues(issue$1.values, " o ")}`;
@@ -3588,12 +3628,12 @@ const error$33 = () => {
3588
3628
  };
3589
3629
  };
3590
3630
  function ca_default() {
3591
- return { localeError: error$33() };
3631
+ return { localeError: error$35() };
3592
3632
  }
3593
3633
 
3594
3634
  //#endregion
3595
- //#region ../../node_modules/zod/dist/esm/v4/locales/cs.js
3596
- const error$32 = () => {
3635
+ //#region ../../node_modules/zod/v4/locales/cs.js
3636
+ const error$34 = () => {
3597
3637
  const Sizable = {
3598
3638
  string: {
3599
3639
  unit: "znaků",
@@ -3615,7 +3655,7 @@ const error$32 = () => {
3615
3655
  function getSizing(origin) {
3616
3656
  return Sizable[origin] ?? null;
3617
3657
  }
3618
- const parsedType$2 = (data) => {
3658
+ const parsedType$3 = (data) => {
3619
3659
  const t = typeof data;
3620
3660
  switch (t) {
3621
3661
  case "number": {
@@ -3685,7 +3725,7 @@ const error$32 = () => {
3685
3725
  };
3686
3726
  return (issue$1) => {
3687
3727
  switch (issue$1.code) {
3688
- case "invalid_type": return `Neplatný vstup: očekáváno ${issue$1.expected}, obdrženo ${parsedType$2(issue$1.input)}`;
3728
+ case "invalid_type": return `Neplatný vstup: očekáváno ${issue$1.expected}, obdrženo ${parsedType$3(issue$1.input)}`;
3689
3729
  case "invalid_value":
3690
3730
  if (issue$1.values.length === 1) return `Neplatný vstup: očekáváno ${stringifyPrimitive(issue$1.values[0])}`;
3691
3731
  return `Neplatná možnost: očekávána jedna z hodnot ${joinValues(issue$1.values, "|")}`;
@@ -3723,12 +3763,12 @@ const error$32 = () => {
3723
3763
  };
3724
3764
  };
3725
3765
  function cs_default() {
3726
- return { localeError: error$32() };
3766
+ return { localeError: error$34() };
3727
3767
  }
3728
3768
 
3729
3769
  //#endregion
3730
- //#region ../../node_modules/zod/dist/esm/v4/locales/de.js
3731
- const error$31 = () => {
3770
+ //#region ../../node_modules/zod/v4/locales/de.js
3771
+ const error$33 = () => {
3732
3772
  const Sizable = {
3733
3773
  string: {
3734
3774
  unit: "Zeichen",
@@ -3750,7 +3790,7 @@ const error$31 = () => {
3750
3790
  function getSizing(origin) {
3751
3791
  return Sizable[origin] ?? null;
3752
3792
  }
3753
- const parsedType$2 = (data) => {
3793
+ const parsedType$3 = (data) => {
3754
3794
  const t = typeof data;
3755
3795
  switch (t) {
3756
3796
  case "number": {
@@ -3802,7 +3842,7 @@ const error$31 = () => {
3802
3842
  };
3803
3843
  return (issue$1) => {
3804
3844
  switch (issue$1.code) {
3805
- case "invalid_type": return `Ungültige Eingabe: erwartet ${issue$1.expected}, erhalten ${parsedType$2(issue$1.input)}`;
3845
+ case "invalid_type": return `Ungültige Eingabe: erwartet ${issue$1.expected}, erhalten ${parsedType$3(issue$1.input)}`;
3806
3846
  case "invalid_value":
3807
3847
  if (issue$1.values.length === 1) return `Ungültige Eingabe: erwartet ${stringifyPrimitive(issue$1.values[0])}`;
3808
3848
  return `Ungültige Option: erwartet eine von ${joinValues(issue$1.values, "|")}`;
@@ -3838,12 +3878,12 @@ const error$31 = () => {
3838
3878
  };
3839
3879
  };
3840
3880
  function de_default() {
3841
- return { localeError: error$31() };
3881
+ return { localeError: error$33() };
3842
3882
  }
3843
3883
 
3844
3884
  //#endregion
3845
- //#region ../../node_modules/zod/dist/esm/v4/locales/en.js
3846
- const parsedType$1 = (data) => {
3885
+ //#region ../../node_modules/zod/v4/locales/en.js
3886
+ const parsedType$2 = (data) => {
3847
3887
  const t = typeof data;
3848
3888
  switch (t) {
3849
3889
  case "number": {
@@ -3863,7 +3903,7 @@ const parsedType$1 = (data) => {
3863
3903
  }
3864
3904
  return t;
3865
3905
  };
3866
- const error$30 = () => {
3906
+ const error$32 = () => {
3867
3907
  const Sizable = {
3868
3908
  string: {
3869
3909
  unit: "characters",
@@ -3917,7 +3957,7 @@ const error$30 = () => {
3917
3957
  };
3918
3958
  return (issue$1) => {
3919
3959
  switch (issue$1.code) {
3920
- case "invalid_type": return `Invalid input: expected ${issue$1.expected}, received ${parsedType$1(issue$1.input)}`;
3960
+ case "invalid_type": return `Invalid input: expected ${issue$1.expected}, received ${parsedType$2(issue$1.input)}`;
3921
3961
  case "invalid_value":
3922
3962
  if (issue$1.values.length === 1) return `Invalid input: expected ${stringifyPrimitive(issue$1.values[0])}`;
3923
3963
  return `Invalid option: expected one of ${joinValues(issue$1.values, "|")}`;
@@ -3955,12 +3995,127 @@ const error$30 = () => {
3955
3995
  };
3956
3996
  };
3957
3997
  function en_default() {
3958
- return { localeError: error$30() };
3998
+ return { localeError: error$32() };
3959
3999
  }
3960
4000
 
3961
4001
  //#endregion
3962
- //#region ../../node_modules/zod/dist/esm/v4/locales/es.js
3963
- const error$29 = () => {
4002
+ //#region ../../node_modules/zod/v4/locales/eo.js
4003
+ const parsedType$1 = (data) => {
4004
+ const t = typeof data;
4005
+ switch (t) {
4006
+ case "number": {
4007
+ return Number.isNaN(data) ? "NaN" : "nombro";
4008
+ }
4009
+ case "object": {
4010
+ if (Array.isArray(data)) {
4011
+ return "tabelo";
4012
+ }
4013
+ if (data === null) {
4014
+ return "senvalora";
4015
+ }
4016
+ if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
4017
+ return data.constructor.name;
4018
+ }
4019
+ }
4020
+ }
4021
+ return t;
4022
+ };
4023
+ const error$31 = () => {
4024
+ const Sizable = {
4025
+ string: {
4026
+ unit: "karaktrojn",
4027
+ verb: "havi"
4028
+ },
4029
+ file: {
4030
+ unit: "bajtojn",
4031
+ verb: "havi"
4032
+ },
4033
+ array: {
4034
+ unit: "elementojn",
4035
+ verb: "havi"
4036
+ },
4037
+ set: {
4038
+ unit: "elementojn",
4039
+ verb: "havi"
4040
+ }
4041
+ };
4042
+ function getSizing(origin) {
4043
+ return Sizable[origin] ?? null;
4044
+ }
4045
+ const Nouns = {
4046
+ regex: "enigo",
4047
+ email: "retadreso",
4048
+ url: "URL",
4049
+ emoji: "emoĝio",
4050
+ uuid: "UUID",
4051
+ uuidv4: "UUIDv4",
4052
+ uuidv6: "UUIDv6",
4053
+ nanoid: "nanoid",
4054
+ guid: "GUID",
4055
+ cuid: "cuid",
4056
+ cuid2: "cuid2",
4057
+ ulid: "ULID",
4058
+ xid: "XID",
4059
+ ksuid: "KSUID",
4060
+ datetime: "ISO-datotempo",
4061
+ date: "ISO-dato",
4062
+ time: "ISO-tempo",
4063
+ duration: "ISO-daŭro",
4064
+ ipv4: "IPv4-adreso",
4065
+ ipv6: "IPv6-adreso",
4066
+ cidrv4: "IPv4-rango",
4067
+ cidrv6: "IPv6-rango",
4068
+ base64: "64-ume kodita karaktraro",
4069
+ base64url: "URL-64-ume kodita karaktraro",
4070
+ json_string: "JSON-karaktraro",
4071
+ e164: "E.164-nombro",
4072
+ jwt: "JWT",
4073
+ template_literal: "enigo"
4074
+ };
4075
+ return (issue$1) => {
4076
+ switch (issue$1.code) {
4077
+ case "invalid_type": return `Nevalida enigo: atendiĝis ${issue$1.expected}, riceviĝis ${parsedType$1(issue$1.input)}`;
4078
+ case "invalid_value":
4079
+ if (issue$1.values.length === 1) return `Nevalida enigo: atendiĝis ${stringifyPrimitive(issue$1.values[0])}`;
4080
+ return `Nevalida opcio: atendiĝis unu el ${joinValues(issue$1.values, "|")}`;
4081
+ case "too_big": {
4082
+ const adj = issue$1.inclusive ? "<=" : "<";
4083
+ const sizing = getSizing(issue$1.origin);
4084
+ if (sizing) return `Tro granda: atendiĝis ke ${issue$1.origin ?? "valoro"} havu ${adj}${issue$1.maximum.toString()} ${sizing.unit ?? "elementojn"}`;
4085
+ return `Tro granda: atendiĝis ke ${issue$1.origin ?? "valoro"} havu ${adj}${issue$1.maximum.toString()}`;
4086
+ }
4087
+ case "too_small": {
4088
+ const adj = issue$1.inclusive ? ">=" : ">";
4089
+ const sizing = getSizing(issue$1.origin);
4090
+ if (sizing) {
4091
+ return `Tro malgranda: atendiĝis ke ${issue$1.origin} havu ${adj}${issue$1.minimum.toString()} ${sizing.unit}`;
4092
+ }
4093
+ return `Tro malgranda: atendiĝis ke ${issue$1.origin} estu ${adj}${issue$1.minimum.toString()}`;
4094
+ }
4095
+ case "invalid_format": {
4096
+ const _issue = issue$1;
4097
+ if (_issue.format === "starts_with") return `Nevalida karaktraro: devas komenciĝi per "${_issue.prefix}"`;
4098
+ if (_issue.format === "ends_with") return `Nevalida karaktraro: devas finiĝi per "${_issue.suffix}"`;
4099
+ if (_issue.format === "includes") return `Nevalida karaktraro: devas inkluzivi "${_issue.includes}"`;
4100
+ if (_issue.format === "regex") return `Nevalida karaktraro: devas kongrui kun la modelo ${_issue.pattern}`;
4101
+ return `Nevalida ${Nouns[_issue.format] ?? issue$1.format}`;
4102
+ }
4103
+ case "not_multiple_of": return `Nevalida nombro: devas esti oblo de ${issue$1.divisor}`;
4104
+ case "unrecognized_keys": return `Nekonata${issue$1.keys.length > 1 ? "j" : ""} ŝlosilo${issue$1.keys.length > 1 ? "j" : ""}: ${joinValues(issue$1.keys, ", ")}`;
4105
+ case "invalid_key": return `Nevalida ŝlosilo en ${issue$1.origin}`;
4106
+ case "invalid_union": return "Nevalida enigo";
4107
+ case "invalid_element": return `Nevalida valoro en ${issue$1.origin}`;
4108
+ default: return `Nevalida enigo`;
4109
+ }
4110
+ };
4111
+ };
4112
+ function eo_default() {
4113
+ return { localeError: error$31() };
4114
+ }
4115
+
4116
+ //#endregion
4117
+ //#region ../../node_modules/zod/v4/locales/es.js
4118
+ const error$30 = () => {
3964
4119
  const Sizable = {
3965
4120
  string: {
3966
4121
  unit: "caracteres",
@@ -3982,7 +4137,7 @@ const error$29 = () => {
3982
4137
  function getSizing(origin) {
3983
4138
  return Sizable[origin] ?? null;
3984
4139
  }
3985
- const parsedType$2 = (data) => {
4140
+ const parsedType$3 = (data) => {
3986
4141
  const t = typeof data;
3987
4142
  switch (t) {
3988
4143
  case "number": {
@@ -4034,7 +4189,7 @@ const error$29 = () => {
4034
4189
  };
4035
4190
  return (issue$1) => {
4036
4191
  switch (issue$1.code) {
4037
- case "invalid_type": return `Entrada inválida: se esperaba ${issue$1.expected}, recibido ${parsedType$2(issue$1.input)}`;
4192
+ case "invalid_type": return `Entrada inválida: se esperaba ${issue$1.expected}, recibido ${parsedType$3(issue$1.input)}`;
4038
4193
  case "invalid_value":
4039
4194
  if (issue$1.values.length === 1) return `Entrada inválida: se esperaba ${stringifyPrimitive(issue$1.values[0])}`;
4040
4195
  return `Opción inválida: se esperaba una de ${joinValues(issue$1.values, "|")}`;
@@ -4070,12 +4225,12 @@ const error$29 = () => {
4070
4225
  };
4071
4226
  };
4072
4227
  function es_default() {
4073
- return { localeError: error$29() };
4228
+ return { localeError: error$30() };
4074
4229
  }
4075
4230
 
4076
4231
  //#endregion
4077
- //#region ../../node_modules/zod/dist/esm/v4/locales/fa.js
4078
- const error$28 = () => {
4232
+ //#region ../../node_modules/zod/v4/locales/fa.js
4233
+ const error$29 = () => {
4079
4234
  const Sizable = {
4080
4235
  string: {
4081
4236
  unit: "کاراکتر",
@@ -4097,7 +4252,7 @@ const error$28 = () => {
4097
4252
  function getSizing(origin) {
4098
4253
  return Sizable[origin] ?? null;
4099
4254
  }
4100
- const parsedType$2 = (data) => {
4255
+ const parsedType$3 = (data) => {
4101
4256
  const t = typeof data;
4102
4257
  switch (t) {
4103
4258
  case "number": {
@@ -4149,7 +4304,7 @@ const error$28 = () => {
4149
4304
  };
4150
4305
  return (issue$1) => {
4151
4306
  switch (issue$1.code) {
4152
- case "invalid_type": return `ورودی نامعتبر: می‌بایست ${issue$1.expected} می‌بود، ${parsedType$2(issue$1.input)} دریافت شد`;
4307
+ case "invalid_type": return `ورودی نامعتبر: می‌بایست ${issue$1.expected} می‌بود، ${parsedType$3(issue$1.input)} دریافت شد`;
4153
4308
  case "invalid_value":
4154
4309
  if (issue$1.values.length === 1) {
4155
4310
  return `ورودی نامعتبر: می‌بایست ${stringifyPrimitive(issue$1.values[0])} می‌بود`;
@@ -4197,12 +4352,12 @@ const error$28 = () => {
4197
4352
  };
4198
4353
  };
4199
4354
  function fa_default() {
4200
- return { localeError: error$28() };
4355
+ return { localeError: error$29() };
4201
4356
  }
4202
4357
 
4203
4358
  //#endregion
4204
- //#region ../../node_modules/zod/dist/esm/v4/locales/fi.js
4205
- const error$27 = () => {
4359
+ //#region ../../node_modules/zod/v4/locales/fi.js
4360
+ const error$28 = () => {
4206
4361
  const Sizable = {
4207
4362
  string: {
4208
4363
  unit: "merkkiä",
@@ -4240,7 +4395,7 @@ const error$27 = () => {
4240
4395
  function getSizing(origin) {
4241
4396
  return Sizable[origin] ?? null;
4242
4397
  }
4243
- const parsedType$2 = (data) => {
4398
+ const parsedType$3 = (data) => {
4244
4399
  const t = typeof data;
4245
4400
  switch (t) {
4246
4401
  case "number": {
@@ -4292,7 +4447,7 @@ const error$27 = () => {
4292
4447
  };
4293
4448
  return (issue$1) => {
4294
4449
  switch (issue$1.code) {
4295
- case "invalid_type": return `Virheellinen tyyppi: odotettiin ${issue$1.expected}, oli ${parsedType$2(issue$1.input)}`;
4450
+ case "invalid_type": return `Virheellinen tyyppi: odotettiin ${issue$1.expected}, oli ${parsedType$3(issue$1.input)}`;
4296
4451
  case "invalid_value":
4297
4452
  if (issue$1.values.length === 1) return `Virheellinen syöte: täytyy olla ${stringifyPrimitive(issue$1.values[0])}`;
4298
4453
  return `Virheellinen valinta: täytyy olla yksi seuraavista: ${joinValues(issue$1.values, "|")}`;
@@ -4332,12 +4487,12 @@ const error$27 = () => {
4332
4487
  };
4333
4488
  };
4334
4489
  function fi_default() {
4335
- return { localeError: error$27() };
4490
+ return { localeError: error$28() };
4336
4491
  }
4337
4492
 
4338
4493
  //#endregion
4339
- //#region ../../node_modules/zod/dist/esm/v4/locales/fr.js
4340
- const error$26 = () => {
4494
+ //#region ../../node_modules/zod/v4/locales/fr.js
4495
+ const error$27 = () => {
4341
4496
  const Sizable = {
4342
4497
  string: {
4343
4498
  unit: "caractères",
@@ -4359,7 +4514,7 @@ const error$26 = () => {
4359
4514
  function getSizing(origin) {
4360
4515
  return Sizable[origin] ?? null;
4361
4516
  }
4362
- const parsedType$2 = (data) => {
4517
+ const parsedType$3 = (data) => {
4363
4518
  const t = typeof data;
4364
4519
  switch (t) {
4365
4520
  case "number": {
@@ -4411,7 +4566,7 @@ const error$26 = () => {
4411
4566
  };
4412
4567
  return (issue$1) => {
4413
4568
  switch (issue$1.code) {
4414
- case "invalid_type": return `Entrée invalide : ${issue$1.expected} attendu, ${parsedType$2(issue$1.input)} reçu`;
4569
+ case "invalid_type": return `Entrée invalide : ${issue$1.expected} attendu, ${parsedType$3(issue$1.input)} reçu`;
4415
4570
  case "invalid_value":
4416
4571
  if (issue$1.values.length === 1) return `Entrée invalide : ${stringifyPrimitive(issue$1.values[0])} attendu`;
4417
4572
  return `Option invalide : une valeur parmi ${joinValues(issue$1.values, "|")} attendue`;
@@ -4447,12 +4602,12 @@ const error$26 = () => {
4447
4602
  };
4448
4603
  };
4449
4604
  function fr_default() {
4450
- return { localeError: error$26() };
4605
+ return { localeError: error$27() };
4451
4606
  }
4452
4607
 
4453
4608
  //#endregion
4454
- //#region ../../node_modules/zod/dist/esm/v4/locales/fr-CA.js
4455
- const error$25 = () => {
4609
+ //#region ../../node_modules/zod/v4/locales/fr-CA.js
4610
+ const error$26 = () => {
4456
4611
  const Sizable = {
4457
4612
  string: {
4458
4613
  unit: "caractères",
@@ -4474,7 +4629,7 @@ const error$25 = () => {
4474
4629
  function getSizing(origin) {
4475
4630
  return Sizable[origin] ?? null;
4476
4631
  }
4477
- const parsedType$2 = (data) => {
4632
+ const parsedType$3 = (data) => {
4478
4633
  const t = typeof data;
4479
4634
  switch (t) {
4480
4635
  case "number": {
@@ -4526,7 +4681,7 @@ const error$25 = () => {
4526
4681
  };
4527
4682
  return (issue$1) => {
4528
4683
  switch (issue$1.code) {
4529
- case "invalid_type": return `Entrée invalide : attendu ${issue$1.expected}, reçu ${parsedType$2(issue$1.input)}`;
4684
+ case "invalid_type": return `Entrée invalide : attendu ${issue$1.expected}, reçu ${parsedType$3(issue$1.input)}`;
4530
4685
  case "invalid_value":
4531
4686
  if (issue$1.values.length === 1) return `Entrée invalide : attendu ${stringifyPrimitive(issue$1.values[0])}`;
4532
4687
  return `Option invalide : attendu l'une des valeurs suivantes ${joinValues(issue$1.values, "|")}`;
@@ -4564,12 +4719,12 @@ const error$25 = () => {
4564
4719
  };
4565
4720
  };
4566
4721
  function fr_CA_default() {
4567
- return { localeError: error$25() };
4722
+ return { localeError: error$26() };
4568
4723
  }
4569
4724
 
4570
4725
  //#endregion
4571
- //#region ../../node_modules/zod/dist/esm/v4/locales/he.js
4572
- const error$24 = () => {
4726
+ //#region ../../node_modules/zod/v4/locales/he.js
4727
+ const error$25 = () => {
4573
4728
  const Sizable = {
4574
4729
  string: {
4575
4730
  unit: "אותיות",
@@ -4591,7 +4746,7 @@ const error$24 = () => {
4591
4746
  function getSizing(origin) {
4592
4747
  return Sizable[origin] ?? null;
4593
4748
  }
4594
- const parsedType$2 = (data) => {
4749
+ const parsedType$3 = (data) => {
4595
4750
  const t = typeof data;
4596
4751
  switch (t) {
4597
4752
  case "number": {
@@ -4643,7 +4798,7 @@ const error$24 = () => {
4643
4798
  };
4644
4799
  return (issue$1) => {
4645
4800
  switch (issue$1.code) {
4646
- case "invalid_type": return `קלט לא תקין: צריך ${issue$1.expected}, התקבל ${parsedType$2(issue$1.input)}`;
4801
+ case "invalid_type": return `קלט לא תקין: צריך ${issue$1.expected}, התקבל ${parsedType$3(issue$1.input)}`;
4647
4802
  case "invalid_value":
4648
4803
  if (issue$1.values.length === 1) return `קלט לא תקין: צריך ${stringifyPrimitive(issue$1.values[0])}`;
4649
4804
  return `קלט לא תקין: צריך אחת מהאפשרויות ${joinValues(issue$1.values, "|")}`;
@@ -4679,12 +4834,12 @@ const error$24 = () => {
4679
4834
  };
4680
4835
  };
4681
4836
  function he_default() {
4682
- return { localeError: error$24() };
4837
+ return { localeError: error$25() };
4683
4838
  }
4684
4839
 
4685
4840
  //#endregion
4686
- //#region ../../node_modules/zod/dist/esm/v4/locales/hu.js
4687
- const error$23 = () => {
4841
+ //#region ../../node_modules/zod/v4/locales/hu.js
4842
+ const error$24 = () => {
4688
4843
  const Sizable = {
4689
4844
  string: {
4690
4845
  unit: "karakter",
@@ -4706,7 +4861,7 @@ const error$23 = () => {
4706
4861
  function getSizing(origin) {
4707
4862
  return Sizable[origin] ?? null;
4708
4863
  }
4709
- const parsedType$2 = (data) => {
4864
+ const parsedType$3 = (data) => {
4710
4865
  const t = typeof data;
4711
4866
  switch (t) {
4712
4867
  case "number": {
@@ -4758,7 +4913,7 @@ const error$23 = () => {
4758
4913
  };
4759
4914
  return (issue$1) => {
4760
4915
  switch (issue$1.code) {
4761
- case "invalid_type": return `Érvénytelen bemenet: a várt érték ${issue$1.expected}, a kapott érték ${parsedType$2(issue$1.input)}`;
4916
+ case "invalid_type": return `Érvénytelen bemenet: a várt érték ${issue$1.expected}, a kapott érték ${parsedType$3(issue$1.input)}`;
4762
4917
  case "invalid_value":
4763
4918
  if (issue$1.values.length === 1) return `Érvénytelen bemenet: a várt érték ${stringifyPrimitive(issue$1.values[0])}`;
4764
4919
  return `Érvénytelen opció: valamelyik érték várt ${joinValues(issue$1.values, "|")}`;
@@ -4794,12 +4949,12 @@ const error$23 = () => {
4794
4949
  };
4795
4950
  };
4796
4951
  function hu_default() {
4797
- return { localeError: error$23() };
4952
+ return { localeError: error$24() };
4798
4953
  }
4799
4954
 
4800
4955
  //#endregion
4801
- //#region ../../node_modules/zod/dist/esm/v4/locales/id.js
4802
- const error$22 = () => {
4956
+ //#region ../../node_modules/zod/v4/locales/id.js
4957
+ const error$23 = () => {
4803
4958
  const Sizable = {
4804
4959
  string: {
4805
4960
  unit: "karakter",
@@ -4821,7 +4976,7 @@ const error$22 = () => {
4821
4976
  function getSizing(origin) {
4822
4977
  return Sizable[origin] ?? null;
4823
4978
  }
4824
- const parsedType$2 = (data) => {
4979
+ const parsedType$3 = (data) => {
4825
4980
  const t = typeof data;
4826
4981
  switch (t) {
4827
4982
  case "number": {
@@ -4873,7 +5028,7 @@ const error$22 = () => {
4873
5028
  };
4874
5029
  return (issue$1) => {
4875
5030
  switch (issue$1.code) {
4876
- case "invalid_type": return `Input tidak valid: diharapkan ${issue$1.expected}, diterima ${parsedType$2(issue$1.input)}`;
5031
+ case "invalid_type": return `Input tidak valid: diharapkan ${issue$1.expected}, diterima ${parsedType$3(issue$1.input)}`;
4877
5032
  case "invalid_value":
4878
5033
  if (issue$1.values.length === 1) return `Input tidak valid: diharapkan ${stringifyPrimitive(issue$1.values[0])}`;
4879
5034
  return `Pilihan tidak valid: diharapkan salah satu dari ${joinValues(issue$1.values, "|")}`;
@@ -4909,12 +5064,12 @@ const error$22 = () => {
4909
5064
  };
4910
5065
  };
4911
5066
  function id_default() {
4912
- return { localeError: error$22() };
5067
+ return { localeError: error$23() };
4913
5068
  }
4914
5069
 
4915
5070
  //#endregion
4916
- //#region ../../node_modules/zod/dist/esm/v4/locales/it.js
4917
- const error$21 = () => {
5071
+ //#region ../../node_modules/zod/v4/locales/it.js
5072
+ const error$22 = () => {
4918
5073
  const Sizable = {
4919
5074
  string: {
4920
5075
  unit: "caratteri",
@@ -4936,7 +5091,7 @@ const error$21 = () => {
4936
5091
  function getSizing(origin) {
4937
5092
  return Sizable[origin] ?? null;
4938
5093
  }
4939
- const parsedType$2 = (data) => {
5094
+ const parsedType$3 = (data) => {
4940
5095
  const t = typeof data;
4941
5096
  switch (t) {
4942
5097
  case "number": {
@@ -4988,7 +5143,7 @@ const error$21 = () => {
4988
5143
  };
4989
5144
  return (issue$1) => {
4990
5145
  switch (issue$1.code) {
4991
- case "invalid_type": return `Input non valido: atteso ${issue$1.expected}, ricevuto ${parsedType$2(issue$1.input)}`;
5146
+ case "invalid_type": return `Input non valido: atteso ${issue$1.expected}, ricevuto ${parsedType$3(issue$1.input)}`;
4992
5147
  case "invalid_value":
4993
5148
  if (issue$1.values.length === 1) return `Input non valido: atteso ${stringifyPrimitive(issue$1.values[0])}`;
4994
5149
  return `Opzione non valida: atteso uno tra ${joinValues(issue$1.values, "|")}`;
@@ -5024,12 +5179,12 @@ const error$21 = () => {
5024
5179
  };
5025
5180
  };
5026
5181
  function it_default() {
5027
- return { localeError: error$21() };
5182
+ return { localeError: error$22() };
5028
5183
  }
5029
5184
 
5030
5185
  //#endregion
5031
- //#region ../../node_modules/zod/dist/esm/v4/locales/ja.js
5032
- const error$20 = () => {
5186
+ //#region ../../node_modules/zod/v4/locales/ja.js
5187
+ const error$21 = () => {
5033
5188
  const Sizable = {
5034
5189
  string: {
5035
5190
  unit: "文字",
@@ -5051,7 +5206,7 @@ const error$20 = () => {
5051
5206
  function getSizing(origin) {
5052
5207
  return Sizable[origin] ?? null;
5053
5208
  }
5054
- const parsedType$2 = (data) => {
5209
+ const parsedType$3 = (data) => {
5055
5210
  const t = typeof data;
5056
5211
  switch (t) {
5057
5212
  case "number": {
@@ -5103,21 +5258,21 @@ const error$20 = () => {
5103
5258
  };
5104
5259
  return (issue$1) => {
5105
5260
  switch (issue$1.code) {
5106
- case "invalid_type": return `無効な入力: ${issue$1.expected}が期待されましたが、${parsedType$2(issue$1.input)}が入力されました`;
5261
+ case "invalid_type": return `無効な入力: ${issue$1.expected}が期待されましたが、${parsedType$3(issue$1.input)}が入力されました`;
5107
5262
  case "invalid_value":
5108
5263
  if (issue$1.values.length === 1) return `無効な入力: ${stringifyPrimitive(issue$1.values[0])}が期待されました`;
5109
5264
  return `無効な選択: ${joinValues(issue$1.values, "、")}のいずれかである必要があります`;
5110
5265
  case "too_big": {
5111
- const adj = issue$1.inclusive ? "<=" : "<";
5266
+ const adj = issue$1.inclusive ? "以下である" : "より小さい";
5112
5267
  const sizing = getSizing(issue$1.origin);
5113
- if (sizing) return `大きすぎる値: ${issue$1.origin ?? "値"}は${issue$1.maximum.toString()}${sizing.unit ?? "要素"}${adj}である必要があります`;
5114
- return `大きすぎる値: ${issue$1.origin ?? "値"}は${issue$1.maximum.toString()}${adj}である必要があります`;
5268
+ if (sizing) return `大きすぎる値: ${issue$1.origin ?? "値"}は${issue$1.maximum.toString()}${sizing.unit ?? "要素"}${adj}必要があります`;
5269
+ return `大きすぎる値: ${issue$1.origin ?? "値"}は${issue$1.maximum.toString()}${adj}必要があります`;
5115
5270
  }
5116
5271
  case "too_small": {
5117
- const adj = issue$1.inclusive ? ">=" : ">";
5272
+ const adj = issue$1.inclusive ? "以上である" : "より大きい";
5118
5273
  const sizing = getSizing(issue$1.origin);
5119
- if (sizing) return `小さすぎる値: ${issue$1.origin}は${issue$1.minimum.toString()}${sizing.unit}${adj}である必要があります`;
5120
- return `小さすぎる値: ${issue$1.origin}は${issue$1.minimum.toString()}${adj}である必要があります`;
5274
+ if (sizing) return `小さすぎる値: ${issue$1.origin}は${issue$1.minimum.toString()}${sizing.unit}${adj}必要があります`;
5275
+ return `小さすぎる値: ${issue$1.origin}は${issue$1.minimum.toString()}${adj}必要があります`;
5121
5276
  }
5122
5277
  case "invalid_format": {
5123
5278
  const _issue = issue$1;
@@ -5137,12 +5292,12 @@ const error$20 = () => {
5137
5292
  };
5138
5293
  };
5139
5294
  function ja_default() {
5140
- return { localeError: error$20() };
5295
+ return { localeError: error$21() };
5141
5296
  }
5142
5297
 
5143
5298
  //#endregion
5144
- //#region ../../node_modules/zod/dist/esm/v4/locales/kh.js
5145
- const error$19 = () => {
5299
+ //#region ../../node_modules/zod/v4/locales/kh.js
5300
+ const error$20 = () => {
5146
5301
  const Sizable = {
5147
5302
  string: {
5148
5303
  unit: "តួអក្សរ",
@@ -5164,7 +5319,7 @@ const error$19 = () => {
5164
5319
  function getSizing(origin) {
5165
5320
  return Sizable[origin] ?? null;
5166
5321
  }
5167
- const parsedType$2 = (data) => {
5322
+ const parsedType$3 = (data) => {
5168
5323
  const t = typeof data;
5169
5324
  switch (t) {
5170
5325
  case "number": {
@@ -5216,7 +5371,7 @@ const error$19 = () => {
5216
5371
  };
5217
5372
  return (issue$1) => {
5218
5373
  switch (issue$1.code) {
5219
- case "invalid_type": return `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${issue$1.expected} ប៉ុន្តែទទួលបាន ${parsedType$2(issue$1.input)}`;
5374
+ case "invalid_type": return `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${issue$1.expected} ប៉ុន្តែទទួលបាន ${parsedType$3(issue$1.input)}`;
5220
5375
  case "invalid_value":
5221
5376
  if (issue$1.values.length === 1) return `ទិន្នន័យបញ្ចូលមិនត្រឹមត្រូវ៖ ត្រូវការ ${stringifyPrimitive(issue$1.values[0])}`;
5222
5377
  return `ជម្រើសមិនត្រឹមត្រូវ៖ ត្រូវជាមួយក្នុងចំណោម ${joinValues(issue$1.values, "|")}`;
@@ -5254,12 +5409,12 @@ const error$19 = () => {
5254
5409
  };
5255
5410
  };
5256
5411
  function kh_default() {
5257
- return { localeError: error$19() };
5412
+ return { localeError: error$20() };
5258
5413
  }
5259
5414
 
5260
5415
  //#endregion
5261
- //#region ../../node_modules/zod/dist/esm/v4/locales/ko.js
5262
- const error$18 = () => {
5416
+ //#region ../../node_modules/zod/v4/locales/ko.js
5417
+ const error$19 = () => {
5263
5418
  const Sizable = {
5264
5419
  string: {
5265
5420
  unit: "문자",
@@ -5281,7 +5436,7 @@ const error$18 = () => {
5281
5436
  function getSizing(origin) {
5282
5437
  return Sizable[origin] ?? null;
5283
5438
  }
5284
- const parsedType$2 = (data) => {
5439
+ const parsedType$3 = (data) => {
5285
5440
  const t = typeof data;
5286
5441
  switch (t) {
5287
5442
  case "number": {
@@ -5333,7 +5488,7 @@ const error$18 = () => {
5333
5488
  };
5334
5489
  return (issue$1) => {
5335
5490
  switch (issue$1.code) {
5336
- case "invalid_type": return `잘못된 입력: 예상 타입은 ${issue$1.expected}, 받은 타입은 ${parsedType$2(issue$1.input)}입니다`;
5491
+ case "invalid_type": return `잘못된 입력: 예상 타입은 ${issue$1.expected}, 받은 타입은 ${parsedType$3(issue$1.input)}입니다`;
5337
5492
  case "invalid_value":
5338
5493
  if (issue$1.values.length === 1) return `잘못된 입력: 값은 ${stringifyPrimitive(issue$1.values[0])} 이어야 합니다`;
5339
5494
  return `잘못된 옵션: ${joinValues(issue$1.values, "또는 ")} 중 하나여야 합니다`;
@@ -5375,12 +5530,12 @@ const error$18 = () => {
5375
5530
  };
5376
5531
  };
5377
5532
  function ko_default() {
5378
- return { localeError: error$18() };
5533
+ return { localeError: error$19() };
5379
5534
  }
5380
5535
 
5381
5536
  //#endregion
5382
- //#region ../../node_modules/zod/dist/esm/v4/locales/mk.js
5383
- const error$17 = () => {
5537
+ //#region ../../node_modules/zod/v4/locales/mk.js
5538
+ const error$18 = () => {
5384
5539
  const Sizable = {
5385
5540
  string: {
5386
5541
  unit: "знаци",
@@ -5402,7 +5557,7 @@ const error$17 = () => {
5402
5557
  function getSizing(origin) {
5403
5558
  return Sizable[origin] ?? null;
5404
5559
  }
5405
- const parsedType$2 = (data) => {
5560
+ const parsedType$3 = (data) => {
5406
5561
  const t = typeof data;
5407
5562
  switch (t) {
5408
5563
  case "number": {
@@ -5454,7 +5609,7 @@ const error$17 = () => {
5454
5609
  };
5455
5610
  return (issue$1) => {
5456
5611
  switch (issue$1.code) {
5457
- case "invalid_type": return `Грешен внес: се очекува ${issue$1.expected}, примено ${parsedType$2(issue$1.input)}`;
5612
+ case "invalid_type": return `Грешен внес: се очекува ${issue$1.expected}, примено ${parsedType$3(issue$1.input)}`;
5458
5613
  case "invalid_value":
5459
5614
  if (issue$1.values.length === 1) return `Invalid input: expected ${stringifyPrimitive(issue$1.values[0])}`;
5460
5615
  return `Грешана опција: се очекува една ${joinValues(issue$1.values, "|")}`;
@@ -5492,12 +5647,12 @@ const error$17 = () => {
5492
5647
  };
5493
5648
  };
5494
5649
  function mk_default() {
5495
- return { localeError: error$17() };
5650
+ return { localeError: error$18() };
5496
5651
  }
5497
5652
 
5498
5653
  //#endregion
5499
- //#region ../../node_modules/zod/dist/esm/v4/locales/ms.js
5500
- const error$16 = () => {
5654
+ //#region ../../node_modules/zod/v4/locales/ms.js
5655
+ const error$17 = () => {
5501
5656
  const Sizable = {
5502
5657
  string: {
5503
5658
  unit: "aksara",
@@ -5519,7 +5674,7 @@ const error$16 = () => {
5519
5674
  function getSizing(origin) {
5520
5675
  return Sizable[origin] ?? null;
5521
5676
  }
5522
- const parsedType$2 = (data) => {
5677
+ const parsedType$3 = (data) => {
5523
5678
  const t = typeof data;
5524
5679
  switch (t) {
5525
5680
  case "number": {
@@ -5571,7 +5726,7 @@ const error$16 = () => {
5571
5726
  };
5572
5727
  return (issue$1) => {
5573
5728
  switch (issue$1.code) {
5574
- case "invalid_type": return `Input tidak sah: dijangka ${issue$1.expected}, diterima ${parsedType$2(issue$1.input)}`;
5729
+ case "invalid_type": return `Input tidak sah: dijangka ${issue$1.expected}, diterima ${parsedType$3(issue$1.input)}`;
5575
5730
  case "invalid_value":
5576
5731
  if (issue$1.values.length === 1) return `Input tidak sah: dijangka ${stringifyPrimitive(issue$1.values[0])}`;
5577
5732
  return `Pilihan tidak sah: dijangka salah satu daripada ${joinValues(issue$1.values, "|")}`;
@@ -5607,12 +5762,12 @@ const error$16 = () => {
5607
5762
  };
5608
5763
  };
5609
5764
  function ms_default() {
5610
- return { localeError: error$16() };
5765
+ return { localeError: error$17() };
5611
5766
  }
5612
5767
 
5613
5768
  //#endregion
5614
- //#region ../../node_modules/zod/dist/esm/v4/locales/nl.js
5615
- const error$15 = () => {
5769
+ //#region ../../node_modules/zod/v4/locales/nl.js
5770
+ const error$16 = () => {
5616
5771
  const Sizable = {
5617
5772
  string: { unit: "tekens" },
5618
5773
  file: { unit: "bytes" },
@@ -5622,7 +5777,7 @@ const error$15 = () => {
5622
5777
  function getSizing(origin) {
5623
5778
  return Sizable[origin] ?? null;
5624
5779
  }
5625
- const parsedType$2 = (data) => {
5780
+ const parsedType$3 = (data) => {
5626
5781
  const t = typeof data;
5627
5782
  switch (t) {
5628
5783
  case "number": {
@@ -5674,7 +5829,7 @@ const error$15 = () => {
5674
5829
  };
5675
5830
  return (issue$1) => {
5676
5831
  switch (issue$1.code) {
5677
- case "invalid_type": return `Ongeldige invoer: verwacht ${issue$1.expected}, ontving ${parsedType$2(issue$1.input)}`;
5832
+ case "invalid_type": return `Ongeldige invoer: verwacht ${issue$1.expected}, ontving ${parsedType$3(issue$1.input)}`;
5678
5833
  case "invalid_value":
5679
5834
  if (issue$1.values.length === 1) return `Ongeldige invoer: verwacht ${stringifyPrimitive(issue$1.values[0])}`;
5680
5835
  return `Ongeldige optie: verwacht één van ${joinValues(issue$1.values, "|")}`;
@@ -5712,12 +5867,12 @@ const error$15 = () => {
5712
5867
  };
5713
5868
  };
5714
5869
  function nl_default() {
5715
- return { localeError: error$15() };
5870
+ return { localeError: error$16() };
5716
5871
  }
5717
5872
 
5718
5873
  //#endregion
5719
- //#region ../../node_modules/zod/dist/esm/v4/locales/no.js
5720
- const error$14 = () => {
5874
+ //#region ../../node_modules/zod/v4/locales/no.js
5875
+ const error$15 = () => {
5721
5876
  const Sizable = {
5722
5877
  string: {
5723
5878
  unit: "tegn",
@@ -5739,7 +5894,7 @@ const error$14 = () => {
5739
5894
  function getSizing(origin) {
5740
5895
  return Sizable[origin] ?? null;
5741
5896
  }
5742
- const parsedType$2 = (data) => {
5897
+ const parsedType$3 = (data) => {
5743
5898
  const t = typeof data;
5744
5899
  switch (t) {
5745
5900
  case "number": {
@@ -5791,7 +5946,7 @@ const error$14 = () => {
5791
5946
  };
5792
5947
  return (issue$1) => {
5793
5948
  switch (issue$1.code) {
5794
- case "invalid_type": return `Ugyldig input: forventet ${issue$1.expected}, fikk ${parsedType$2(issue$1.input)}`;
5949
+ case "invalid_type": return `Ugyldig input: forventet ${issue$1.expected}, fikk ${parsedType$3(issue$1.input)}`;
5795
5950
  case "invalid_value":
5796
5951
  if (issue$1.values.length === 1) return `Ugyldig verdi: forventet ${stringifyPrimitive(issue$1.values[0])}`;
5797
5952
  return `Ugyldig valg: forventet en av ${joinValues(issue$1.values, "|")}`;
@@ -5827,12 +5982,12 @@ const error$14 = () => {
5827
5982
  };
5828
5983
  };
5829
5984
  function no_default() {
5830
- return { localeError: error$14() };
5985
+ return { localeError: error$15() };
5831
5986
  }
5832
5987
 
5833
5988
  //#endregion
5834
- //#region ../../node_modules/zod/dist/esm/v4/locales/ota.js
5835
- const error$13 = () => {
5989
+ //#region ../../node_modules/zod/v4/locales/ota.js
5990
+ const error$14 = () => {
5836
5991
  const Sizable = {
5837
5992
  string: {
5838
5993
  unit: "harf",
@@ -5854,7 +6009,7 @@ const error$13 = () => {
5854
6009
  function getSizing(origin) {
5855
6010
  return Sizable[origin] ?? null;
5856
6011
  }
5857
- const parsedType$2 = (data) => {
6012
+ const parsedType$3 = (data) => {
5858
6013
  const t = typeof data;
5859
6014
  switch (t) {
5860
6015
  case "number": {
@@ -5906,7 +6061,7 @@ const error$13 = () => {
5906
6061
  };
5907
6062
  return (issue$1) => {
5908
6063
  switch (issue$1.code) {
5909
- case "invalid_type": return `Fâsit giren: umulan ${issue$1.expected}, alınan ${parsedType$2(issue$1.input)}`;
6064
+ case "invalid_type": return `Fâsit giren: umulan ${issue$1.expected}, alınan ${parsedType$3(issue$1.input)}`;
5910
6065
  case "invalid_value":
5911
6066
  if (issue$1.values.length === 1) return `Fâsit giren: umulan ${stringifyPrimitive(issue$1.values[0])}`;
5912
6067
  return `Fâsit tercih: mûteberler ${joinValues(issue$1.values, "|")}`;
@@ -5942,11 +6097,138 @@ const error$13 = () => {
5942
6097
  };
5943
6098
  };
5944
6099
  function ota_default() {
6100
+ return { localeError: error$14() };
6101
+ }
6102
+
6103
+ //#endregion
6104
+ //#region ../../node_modules/zod/v4/locales/ps.js
6105
+ const error$13 = () => {
6106
+ const Sizable = {
6107
+ string: {
6108
+ unit: "توکي",
6109
+ verb: "ولري"
6110
+ },
6111
+ file: {
6112
+ unit: "بایټس",
6113
+ verb: "ولري"
6114
+ },
6115
+ array: {
6116
+ unit: "توکي",
6117
+ verb: "ولري"
6118
+ },
6119
+ set: {
6120
+ unit: "توکي",
6121
+ verb: "ولري"
6122
+ }
6123
+ };
6124
+ function getSizing(origin) {
6125
+ return Sizable[origin] ?? null;
6126
+ }
6127
+ const parsedType$3 = (data) => {
6128
+ const t = typeof data;
6129
+ switch (t) {
6130
+ case "number": {
6131
+ return Number.isNaN(data) ? "NaN" : "عدد";
6132
+ }
6133
+ case "object": {
6134
+ if (Array.isArray(data)) {
6135
+ return "ارې";
6136
+ }
6137
+ if (data === null) {
6138
+ return "null";
6139
+ }
6140
+ if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
6141
+ return data.constructor.name;
6142
+ }
6143
+ }
6144
+ }
6145
+ return t;
6146
+ };
6147
+ const Nouns = {
6148
+ regex: "ورودي",
6149
+ email: "بریښنالیک",
6150
+ url: "یو آر ال",
6151
+ emoji: "ایموجي",
6152
+ uuid: "UUID",
6153
+ uuidv4: "UUIDv4",
6154
+ uuidv6: "UUIDv6",
6155
+ nanoid: "nanoid",
6156
+ guid: "GUID",
6157
+ cuid: "cuid",
6158
+ cuid2: "cuid2",
6159
+ ulid: "ULID",
6160
+ xid: "XID",
6161
+ ksuid: "KSUID",
6162
+ datetime: "نیټه او وخت",
6163
+ date: "نېټه",
6164
+ time: "وخت",
6165
+ duration: "موده",
6166
+ ipv4: "د IPv4 پته",
6167
+ ipv6: "د IPv6 پته",
6168
+ cidrv4: "د IPv4 ساحه",
6169
+ cidrv6: "د IPv6 ساحه",
6170
+ base64: "base64-encoded متن",
6171
+ base64url: "base64url-encoded متن",
6172
+ json_string: "JSON متن",
6173
+ e164: "د E.164 شمېره",
6174
+ jwt: "JWT",
6175
+ template_literal: "ورودي"
6176
+ };
6177
+ return (issue$1) => {
6178
+ switch (issue$1.code) {
6179
+ case "invalid_type": return `ناسم ورودي: باید ${issue$1.expected} وای, مګر ${parsedType$3(issue$1.input)} ترلاسه شو`;
6180
+ case "invalid_value":
6181
+ if (issue$1.values.length === 1) {
6182
+ return `ناسم ورودي: باید ${stringifyPrimitive(issue$1.values[0])} وای`;
6183
+ }
6184
+ return `ناسم انتخاب: باید یو له ${joinValues(issue$1.values, "|")} څخه وای`;
6185
+ case "too_big": {
6186
+ const adj = issue$1.inclusive ? "<=" : "<";
6187
+ const sizing = getSizing(issue$1.origin);
6188
+ if (sizing) {
6189
+ return `ډیر لوی: ${issue$1.origin ?? "ارزښت"} باید ${adj}${issue$1.maximum.toString()} ${sizing.unit ?? "عنصرونه"} ولري`;
6190
+ }
6191
+ return `ډیر لوی: ${issue$1.origin ?? "ارزښت"} باید ${adj}${issue$1.maximum.toString()} وي`;
6192
+ }
6193
+ case "too_small": {
6194
+ const adj = issue$1.inclusive ? ">=" : ">";
6195
+ const sizing = getSizing(issue$1.origin);
6196
+ if (sizing) {
6197
+ return `ډیر کوچنی: ${issue$1.origin} باید ${adj}${issue$1.minimum.toString()} ${sizing.unit} ولري`;
6198
+ }
6199
+ return `ډیر کوچنی: ${issue$1.origin} باید ${adj}${issue$1.minimum.toString()} وي`;
6200
+ }
6201
+ case "invalid_format": {
6202
+ const _issue = issue$1;
6203
+ if (_issue.format === "starts_with") {
6204
+ return `ناسم متن: باید د "${_issue.prefix}" سره پیل شي`;
6205
+ }
6206
+ if (_issue.format === "ends_with") {
6207
+ return `ناسم متن: باید د "${_issue.suffix}" سره پای ته ورسيږي`;
6208
+ }
6209
+ if (_issue.format === "includes") {
6210
+ return `ناسم متن: باید "${_issue.includes}" ولري`;
6211
+ }
6212
+ if (_issue.format === "regex") {
6213
+ return `ناسم متن: باید د ${_issue.pattern} سره مطابقت ولري`;
6214
+ }
6215
+ return `${Nouns[_issue.format] ?? issue$1.format} ناسم دی`;
6216
+ }
6217
+ case "not_multiple_of": return `ناسم عدد: باید د ${issue$1.divisor} مضرب وي`;
6218
+ case "unrecognized_keys": return `ناسم ${issue$1.keys.length > 1 ? "کلیډونه" : "کلیډ"}: ${joinValues(issue$1.keys, ", ")}`;
6219
+ case "invalid_key": return `ناسم کلیډ په ${issue$1.origin} کې`;
6220
+ case "invalid_union": return `ناسمه ورودي`;
6221
+ case "invalid_element": return `ناسم عنصر په ${issue$1.origin} کې`;
6222
+ default: return `ناسمه ورودي`;
6223
+ }
6224
+ };
6225
+ };
6226
+ function ps_default() {
5945
6227
  return { localeError: error$13() };
5946
6228
  }
5947
6229
 
5948
6230
  //#endregion
5949
- //#region ../../node_modules/zod/dist/esm/v4/locales/pl.js
6231
+ //#region ../../node_modules/zod/v4/locales/pl.js
5950
6232
  const error$12 = () => {
5951
6233
  const Sizable = {
5952
6234
  string: {
@@ -5969,7 +6251,7 @@ const error$12 = () => {
5969
6251
  function getSizing(origin) {
5970
6252
  return Sizable[origin] ?? null;
5971
6253
  }
5972
- const parsedType$2 = (data) => {
6254
+ const parsedType$3 = (data) => {
5973
6255
  const t = typeof data;
5974
6256
  switch (t) {
5975
6257
  case "number": {
@@ -6021,7 +6303,7 @@ const error$12 = () => {
6021
6303
  };
6022
6304
  return (issue$1) => {
6023
6305
  switch (issue$1.code) {
6024
- case "invalid_type": return `Nieprawidłowe dane wejściowe: oczekiwano ${issue$1.expected}, otrzymano ${parsedType$2(issue$1.input)}`;
6306
+ case "invalid_type": return `Nieprawidłowe dane wejściowe: oczekiwano ${issue$1.expected}, otrzymano ${parsedType$3(issue$1.input)}`;
6025
6307
  case "invalid_value":
6026
6308
  if (issue$1.values.length === 1) return `Nieprawidłowe dane wejściowe: oczekiwano ${stringifyPrimitive(issue$1.values[0])}`;
6027
6309
  return `Nieprawidłowa opcja: oczekiwano jednej z wartości ${joinValues(issue$1.values, "|")}`;
@@ -6063,7 +6345,7 @@ function pl_default() {
6063
6345
  }
6064
6346
 
6065
6347
  //#endregion
6066
- //#region ../../node_modules/zod/dist/esm/v4/locales/pt.js
6348
+ //#region ../../node_modules/zod/v4/locales/pt.js
6067
6349
  const error$11 = () => {
6068
6350
  const Sizable = {
6069
6351
  string: {
@@ -6086,7 +6368,7 @@ const error$11 = () => {
6086
6368
  function getSizing(origin) {
6087
6369
  return Sizable[origin] ?? null;
6088
6370
  }
6089
- const parsedType$2 = (data) => {
6371
+ const parsedType$3 = (data) => {
6090
6372
  const t = typeof data;
6091
6373
  switch (t) {
6092
6374
  case "number": {
@@ -6138,7 +6420,7 @@ const error$11 = () => {
6138
6420
  };
6139
6421
  return (issue$1) => {
6140
6422
  switch (issue$1.code) {
6141
- case "invalid_type": return `Tipo inválido: esperado ${issue$1.expected}, recebido ${parsedType$2(issue$1.input)}`;
6423
+ case "invalid_type": return `Tipo inválido: esperado ${issue$1.expected}, recebido ${parsedType$3(issue$1.input)}`;
6142
6424
  case "invalid_value":
6143
6425
  if (issue$1.values.length === 1) return `Entrada inválida: esperado ${stringifyPrimitive(issue$1.values[0])}`;
6144
6426
  return `Opção inválida: esperada uma das ${joinValues(issue$1.values, "|")}`;
@@ -6178,7 +6460,7 @@ function pt_default() {
6178
6460
  }
6179
6461
 
6180
6462
  //#endregion
6181
- //#region ../../node_modules/zod/dist/esm/v4/locales/ru.js
6463
+ //#region ../../node_modules/zod/v4/locales/ru.js
6182
6464
  function getRussianPlural(count, one, few, many) {
6183
6465
  const absCount = Math.abs(count);
6184
6466
  const lastDigit = absCount % 10;
@@ -6232,7 +6514,7 @@ const error$10 = () => {
6232
6514
  function getSizing(origin) {
6233
6515
  return Sizable[origin] ?? null;
6234
6516
  }
6235
- const parsedType$2 = (data) => {
6517
+ const parsedType$3 = (data) => {
6236
6518
  const t = typeof data;
6237
6519
  switch (t) {
6238
6520
  case "number": {
@@ -6284,7 +6566,7 @@ const error$10 = () => {
6284
6566
  };
6285
6567
  return (issue$1) => {
6286
6568
  switch (issue$1.code) {
6287
- case "invalid_type": return `Неверный ввод: ожидалось ${issue$1.expected}, получено ${parsedType$2(issue$1.input)}`;
6569
+ case "invalid_type": return `Неверный ввод: ожидалось ${issue$1.expected}, получено ${parsedType$3(issue$1.input)}`;
6288
6570
  case "invalid_value":
6289
6571
  if (issue$1.values.length === 1) return `Неверный ввод: ожидалось ${stringifyPrimitive(issue$1.values[0])}`;
6290
6572
  return `Неверный вариант: ожидалось одно из ${joinValues(issue$1.values, "|")}`;
@@ -6330,7 +6612,7 @@ function ru_default() {
6330
6612
  }
6331
6613
 
6332
6614
  //#endregion
6333
- //#region ../../node_modules/zod/dist/esm/v4/locales/sl.js
6615
+ //#region ../../node_modules/zod/v4/locales/sl.js
6334
6616
  const error$9 = () => {
6335
6617
  const Sizable = {
6336
6618
  string: {
@@ -6353,7 +6635,7 @@ const error$9 = () => {
6353
6635
  function getSizing(origin) {
6354
6636
  return Sizable[origin] ?? null;
6355
6637
  }
6356
- const parsedType$2 = (data) => {
6638
+ const parsedType$3 = (data) => {
6357
6639
  const t = typeof data;
6358
6640
  switch (t) {
6359
6641
  case "number": {
@@ -6405,7 +6687,7 @@ const error$9 = () => {
6405
6687
  };
6406
6688
  return (issue$1) => {
6407
6689
  switch (issue$1.code) {
6408
- case "invalid_type": return `Neveljaven vnos: pričakovano ${issue$1.expected}, prejeto ${parsedType$2(issue$1.input)}`;
6690
+ case "invalid_type": return `Neveljaven vnos: pričakovano ${issue$1.expected}, prejeto ${parsedType$3(issue$1.input)}`;
6409
6691
  case "invalid_value":
6410
6692
  if (issue$1.values.length === 1) return `Neveljaven vnos: pričakovano ${stringifyPrimitive(issue$1.values[0])}`;
6411
6693
  return `Neveljavna možnost: pričakovano eno izmed ${joinValues(issue$1.values, "|")}`;
@@ -6447,7 +6729,7 @@ function sl_default() {
6447
6729
  }
6448
6730
 
6449
6731
  //#endregion
6450
- //#region ../../node_modules/zod/dist/esm/v4/locales/sv.js
6732
+ //#region ../../node_modules/zod/v4/locales/sv.js
6451
6733
  const error$8 = () => {
6452
6734
  const Sizable = {
6453
6735
  string: {
@@ -6470,7 +6752,7 @@ const error$8 = () => {
6470
6752
  function getSizing(origin) {
6471
6753
  return Sizable[origin] ?? null;
6472
6754
  }
6473
- const parsedType$2 = (data) => {
6755
+ const parsedType$3 = (data) => {
6474
6756
  const t = typeof data;
6475
6757
  switch (t) {
6476
6758
  case "number": {
@@ -6522,7 +6804,7 @@ const error$8 = () => {
6522
6804
  };
6523
6805
  return (issue$1) => {
6524
6806
  switch (issue$1.code) {
6525
- case "invalid_type": return `Ogiltig inmatning: förväntat ${issue$1.expected}, fick ${parsedType$2(issue$1.input)}`;
6807
+ case "invalid_type": return `Ogiltig inmatning: förväntat ${issue$1.expected}, fick ${parsedType$3(issue$1.input)}`;
6526
6808
  case "invalid_value":
6527
6809
  if (issue$1.values.length === 1) return `Ogiltig inmatning: förväntat ${stringifyPrimitive(issue$1.values[0])}`;
6528
6810
  return `Ogiltigt val: förväntade en av ${joinValues(issue$1.values, "|")}`;
@@ -6566,7 +6848,7 @@ function sv_default() {
6566
6848
  }
6567
6849
 
6568
6850
  //#endregion
6569
- //#region ../../node_modules/zod/dist/esm/v4/locales/ta.js
6851
+ //#region ../../node_modules/zod/v4/locales/ta.js
6570
6852
  const error$7 = () => {
6571
6853
  const Sizable = {
6572
6854
  string: {
@@ -6589,7 +6871,7 @@ const error$7 = () => {
6589
6871
  function getSizing(origin) {
6590
6872
  return Sizable[origin] ?? null;
6591
6873
  }
6592
- const parsedType$2 = (data) => {
6874
+ const parsedType$3 = (data) => {
6593
6875
  const t = typeof data;
6594
6876
  switch (t) {
6595
6877
  case "number": {
@@ -6641,7 +6923,7 @@ const error$7 = () => {
6641
6923
  };
6642
6924
  return (issue$1) => {
6643
6925
  switch (issue$1.code) {
6644
- case "invalid_type": return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${issue$1.expected}, பெறப்பட்டது ${parsedType$2(issue$1.input)}`;
6926
+ case "invalid_type": return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${issue$1.expected}, பெறப்பட்டது ${parsedType$3(issue$1.input)}`;
6645
6927
  case "invalid_value":
6646
6928
  if (issue$1.values.length === 1) return `தவறான உள்ளீடு: எதிர்பார்க்கப்பட்டது ${stringifyPrimitive(issue$1.values[0])}`;
6647
6929
  return `தவறான விருப்பம்: எதிர்பார்க்கப்பட்டது ${joinValues(issue$1.values, "|")} இல் ஒன்று`;
@@ -6683,7 +6965,7 @@ function ta_default() {
6683
6965
  }
6684
6966
 
6685
6967
  //#endregion
6686
- //#region ../../node_modules/zod/dist/esm/v4/locales/th.js
6968
+ //#region ../../node_modules/zod/v4/locales/th.js
6687
6969
  const error$6 = () => {
6688
6970
  const Sizable = {
6689
6971
  string: {
@@ -6706,7 +6988,7 @@ const error$6 = () => {
6706
6988
  function getSizing(origin) {
6707
6989
  return Sizable[origin] ?? null;
6708
6990
  }
6709
- const parsedType$2 = (data) => {
6991
+ const parsedType$3 = (data) => {
6710
6992
  const t = typeof data;
6711
6993
  switch (t) {
6712
6994
  case "number": {
@@ -6758,7 +7040,7 @@ const error$6 = () => {
6758
7040
  };
6759
7041
  return (issue$1) => {
6760
7042
  switch (issue$1.code) {
6761
- case "invalid_type": return `ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${issue$1.expected} แต่ได้รับ ${parsedType$2(issue$1.input)}`;
7043
+ case "invalid_type": return `ประเภทข้อมูลไม่ถูกต้อง: ควรเป็น ${issue$1.expected} แต่ได้รับ ${parsedType$3(issue$1.input)}`;
6762
7044
  case "invalid_value":
6763
7045
  if (issue$1.values.length === 1) return `ค่าไม่ถูกต้อง: ควรเป็น ${stringifyPrimitive(issue$1.values[0])}`;
6764
7046
  return `ตัวเลือกไม่ถูกต้อง: ควรเป็นหนึ่งใน ${joinValues(issue$1.values, "|")}`;
@@ -6800,7 +7082,7 @@ function th_default() {
6800
7082
  }
6801
7083
 
6802
7084
  //#endregion
6803
- //#region ../../node_modules/zod/dist/esm/v4/locales/tr.js
7085
+ //#region ../../node_modules/zod/v4/locales/tr.js
6804
7086
  const parsedType = (data) => {
6805
7087
  const t = typeof data;
6806
7088
  switch (t) {
@@ -6913,7 +7195,7 @@ function tr_default() {
6913
7195
  }
6914
7196
 
6915
7197
  //#endregion
6916
- //#region ../../node_modules/zod/dist/esm/v4/locales/ua.js
7198
+ //#region ../../node_modules/zod/v4/locales/ua.js
6917
7199
  const error$4 = () => {
6918
7200
  const Sizable = {
6919
7201
  string: {
@@ -6936,7 +7218,7 @@ const error$4 = () => {
6936
7218
  function getSizing(origin) {
6937
7219
  return Sizable[origin] ?? null;
6938
7220
  }
6939
- const parsedType$2 = (data) => {
7221
+ const parsedType$3 = (data) => {
6940
7222
  const t = typeof data;
6941
7223
  switch (t) {
6942
7224
  case "number": {
@@ -6988,7 +7270,7 @@ const error$4 = () => {
6988
7270
  };
6989
7271
  return (issue$1) => {
6990
7272
  switch (issue$1.code) {
6991
- case "invalid_type": return `Неправильні вхідні дані: очікується ${issue$1.expected}, отримано ${parsedType$2(issue$1.input)}`;
7273
+ case "invalid_type": return `Неправильні вхідні дані: очікується ${issue$1.expected}, отримано ${parsedType$3(issue$1.input)}`;
6992
7274
  case "invalid_value":
6993
7275
  if (issue$1.values.length === 1) return `Неправильні вхідні дані: очікується ${stringifyPrimitive(issue$1.values[0])}`;
6994
7276
  return `Неправильна опція: очікується одне з ${joinValues(issue$1.values, "|")}`;
@@ -7028,7 +7310,7 @@ function ua_default() {
7028
7310
  }
7029
7311
 
7030
7312
  //#endregion
7031
- //#region ../../node_modules/zod/dist/esm/v4/locales/ur.js
7313
+ //#region ../../node_modules/zod/v4/locales/ur.js
7032
7314
  const error$3 = () => {
7033
7315
  const Sizable = {
7034
7316
  string: {
@@ -7051,7 +7333,7 @@ const error$3 = () => {
7051
7333
  function getSizing(origin) {
7052
7334
  return Sizable[origin] ?? null;
7053
7335
  }
7054
- const parsedType$2 = (data) => {
7336
+ const parsedType$3 = (data) => {
7055
7337
  const t = typeof data;
7056
7338
  switch (t) {
7057
7339
  case "number": {
@@ -7103,7 +7385,7 @@ const error$3 = () => {
7103
7385
  };
7104
7386
  return (issue$1) => {
7105
7387
  switch (issue$1.code) {
7106
- case "invalid_type": return `غلط ان پٹ: ${issue$1.expected} متوقع تھا، ${parsedType$2(issue$1.input)} موصول ہوا`;
7388
+ case "invalid_type": return `غلط ان پٹ: ${issue$1.expected} متوقع تھا، ${parsedType$3(issue$1.input)} موصول ہوا`;
7107
7389
  case "invalid_value":
7108
7390
  if (issue$1.values.length === 1) return `غلط ان پٹ: ${stringifyPrimitive(issue$1.values[0])} متوقع تھا`;
7109
7391
  return `غلط آپشن: ${joinValues(issue$1.values, "|")} میں سے ایک متوقع تھا`;
@@ -7145,7 +7427,7 @@ function ur_default() {
7145
7427
  }
7146
7428
 
7147
7429
  //#endregion
7148
- //#region ../../node_modules/zod/dist/esm/v4/locales/vi.js
7430
+ //#region ../../node_modules/zod/v4/locales/vi.js
7149
7431
  const error$2 = () => {
7150
7432
  const Sizable = {
7151
7433
  string: {
@@ -7168,7 +7450,7 @@ const error$2 = () => {
7168
7450
  function getSizing(origin) {
7169
7451
  return Sizable[origin] ?? null;
7170
7452
  }
7171
- const parsedType$2 = (data) => {
7453
+ const parsedType$3 = (data) => {
7172
7454
  const t = typeof data;
7173
7455
  switch (t) {
7174
7456
  case "number": {
@@ -7220,7 +7502,7 @@ const error$2 = () => {
7220
7502
  };
7221
7503
  return (issue$1) => {
7222
7504
  switch (issue$1.code) {
7223
- 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)}`;
7505
+ 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)}`;
7224
7506
  case "invalid_value":
7225
7507
  if (issue$1.values.length === 1) return `Đầu vào không hợp lệ: mong đợi ${stringifyPrimitive(issue$1.values[0])}`;
7226
7508
  return `Tùy chọn không hợp lệ: mong đợi một trong các giá trị ${joinValues(issue$1.values, "|")}`;
@@ -7260,7 +7542,7 @@ function vi_default() {
7260
7542
  }
7261
7543
 
7262
7544
  //#endregion
7263
- //#region ../../node_modules/zod/dist/esm/v4/locales/zh-CN.js
7545
+ //#region ../../node_modules/zod/v4/locales/zh-CN.js
7264
7546
  const error$1 = () => {
7265
7547
  const Sizable = {
7266
7548
  string: {
@@ -7283,7 +7565,7 @@ const error$1 = () => {
7283
7565
  function getSizing(origin) {
7284
7566
  return Sizable[origin] ?? null;
7285
7567
  }
7286
- const parsedType$2 = (data) => {
7568
+ const parsedType$3 = (data) => {
7287
7569
  const t = typeof data;
7288
7570
  switch (t) {
7289
7571
  case "number": {
@@ -7335,7 +7617,7 @@ const error$1 = () => {
7335
7617
  };
7336
7618
  return (issue$1) => {
7337
7619
  switch (issue$1.code) {
7338
- case "invalid_type": return `无效输入:期望 ${issue$1.expected},实际接收 ${parsedType$2(issue$1.input)}`;
7620
+ case "invalid_type": return `无效输入:期望 ${issue$1.expected},实际接收 ${parsedType$3(issue$1.input)}`;
7339
7621
  case "invalid_value":
7340
7622
  if (issue$1.values.length === 1) return `无效输入:期望 ${stringifyPrimitive(issue$1.values[0])}`;
7341
7623
  return `无效选项:期望以下之一 ${joinValues(issue$1.values, "|")}`;
@@ -7375,7 +7657,7 @@ function zh_CN_default() {
7375
7657
  }
7376
7658
 
7377
7659
  //#endregion
7378
- //#region ../../node_modules/zod/dist/esm/v4/locales/zh-TW.js
7660
+ //#region ../../node_modules/zod/v4/locales/zh-TW.js
7379
7661
  const error = () => {
7380
7662
  const Sizable = {
7381
7663
  string: {
@@ -7398,7 +7680,7 @@ const error = () => {
7398
7680
  function getSizing(origin) {
7399
7681
  return Sizable[origin] ?? null;
7400
7682
  }
7401
- const parsedType$2 = (data) => {
7683
+ const parsedType$3 = (data) => {
7402
7684
  const t = typeof data;
7403
7685
  switch (t) {
7404
7686
  case "number": {
@@ -7450,7 +7732,7 @@ const error = () => {
7450
7732
  };
7451
7733
  return (issue$1) => {
7452
7734
  switch (issue$1.code) {
7453
- case "invalid_type": return `無效的輸入值:預期為 ${issue$1.expected},但收到 ${parsedType$2(issue$1.input)}`;
7735
+ case "invalid_type": return `無效的輸入值:預期為 ${issue$1.expected},但收到 ${parsedType$3(issue$1.input)}`;
7454
7736
  case "invalid_value":
7455
7737
  if (issue$1.values.length === 1) return `無效的輸入值:預期為 ${stringifyPrimitive(issue$1.values[0])}`;
7456
7738
  return `無效的選項:預期為以下其中之一 ${joinValues(issue$1.values, "|")}`;
@@ -7492,7 +7774,7 @@ function zh_TW_default() {
7492
7774
  }
7493
7775
 
7494
7776
  //#endregion
7495
- //#region ../../node_modules/zod/dist/esm/v4/locales/index.js
7777
+ //#region ../../node_modules/zod/v4/locales/index.js
7496
7778
  var locales_exports = {};
7497
7779
  __export(locales_exports, {
7498
7780
  ar: () => ar_default,
@@ -7502,6 +7784,7 @@ __export(locales_exports, {
7502
7784
  cs: () => cs_default,
7503
7785
  de: () => de_default,
7504
7786
  en: () => en_default,
7787
+ eo: () => eo_default,
7505
7788
  es: () => es_default,
7506
7789
  fa: () => fa_default,
7507
7790
  fi: () => fi_default,
@@ -7520,6 +7803,7 @@ __export(locales_exports, {
7520
7803
  no: () => no_default,
7521
7804
  ota: () => ota_default,
7522
7805
  pl: () => pl_default,
7806
+ ps: () => ps_default,
7523
7807
  pt: () => pt_default,
7524
7808
  ru: () => ru_default,
7525
7809
  sl: () => sl_default,
@@ -7535,12 +7819,12 @@ __export(locales_exports, {
7535
7819
  });
7536
7820
 
7537
7821
  //#endregion
7538
- //#region ../../node_modules/zod/dist/esm/v4/core/registries.js
7822
+ //#region ../../node_modules/zod/v4/core/registries.js
7539
7823
  const $output = Symbol("ZodOutput");
7540
7824
  const $input = Symbol("ZodInput");
7541
7825
  var $ZodRegistry = class {
7542
7826
  constructor() {
7543
- this._map = new WeakMap();
7827
+ this._map = new Map();
7544
7828
  this._idmap = new Map();
7545
7829
  }
7546
7830
  add(schema, ..._meta) {
@@ -7554,7 +7838,16 @@ var $ZodRegistry = class {
7554
7838
  }
7555
7839
  return this;
7556
7840
  }
7841
+ clear() {
7842
+ this._map = new Map();
7843
+ this._idmap = new Map();
7844
+ return this;
7845
+ }
7557
7846
  remove(schema) {
7847
+ const meta = this._map.get(schema);
7848
+ if (meta && typeof meta === "object" && "id" in meta) {
7849
+ this._idmap.delete(meta.id);
7850
+ }
7558
7851
  this._map.delete(schema);
7559
7852
  return this;
7560
7853
  }
@@ -7580,7 +7873,7 @@ function registry() {
7580
7873
  const globalRegistry = /* @__PURE__ */ registry();
7581
7874
 
7582
7875
  //#endregion
7583
- //#region ../../node_modules/zod/dist/esm/v4/core/api.js
7876
+ //#region ../../node_modules/zod/v4/core/api.js
7584
7877
  function _string(Class$1, params) {
7585
7878
  return new Class$1({
7586
7879
  type: "string",
@@ -7795,6 +8088,13 @@ function _jwt(Class$1, params) {
7795
8088
  ...normalizeParams(params)
7796
8089
  });
7797
8090
  }
8091
+ const TimePrecision = {
8092
+ Any: null,
8093
+ Minute: -1,
8094
+ Second: 0,
8095
+ Millisecond: 3,
8096
+ Microsecond: 6
8097
+ };
7798
8098
  function _isoDateTime(Class$1, params) {
7799
8099
  return new Class$1({
7800
8100
  type: "string",
@@ -8361,8 +8661,8 @@ function _refine(Class$1, fn, _params) {
8361
8661
  return schema;
8362
8662
  }
8363
8663
  function _stringbool(Classes, _params) {
8364
- const { case: _case, error: error$37, truthy, falsy } = normalizeParams(_params);
8365
- let truthyArray = truthy ?? [
8664
+ const params = normalizeParams(_params);
8665
+ let truthyArray = params.truthy ?? [
8366
8666
  "true",
8367
8667
  "1",
8368
8668
  "yes",
@@ -8370,7 +8670,7 @@ function _stringbool(Classes, _params) {
8370
8670
  "y",
8371
8671
  "enabled"
8372
8672
  ];
8373
- let falsyArray = falsy ?? [
8673
+ let falsyArray = params.falsy ?? [
8374
8674
  "false",
8375
8675
  "0",
8376
8676
  "no",
@@ -8378,7 +8678,7 @@ function _stringbool(Classes, _params) {
8378
8678
  "n",
8379
8679
  "disabled"
8380
8680
  ];
8381
- if (_case !== "sensitive") {
8681
+ if (params.case !== "sensitive") {
8382
8682
  truthyArray = truthyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
8383
8683
  falsyArray = falsyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
8384
8684
  }
@@ -8392,7 +8692,7 @@ function _stringbool(Classes, _params) {
8392
8692
  type: "transform",
8393
8693
  transform: (input, payload) => {
8394
8694
  let data = input;
8395
- if (_case !== "sensitive") data = data.toLowerCase();
8695
+ if (params.case !== "sensitive") data = data.toLowerCase();
8396
8696
  if (truthySet.has(data)) {
8397
8697
  return true;
8398
8698
  } else if (falsySet.has(data)) {
@@ -8408,31 +8708,47 @@ function _stringbool(Classes, _params) {
8408
8708
  return {};
8409
8709
  }
8410
8710
  },
8411
- error: error$37
8711
+ error: params.error
8412
8712
  });
8413
8713
  const innerPipe = new _Pipe({
8414
8714
  type: "pipe",
8415
8715
  in: new _String({
8416
8716
  type: "string",
8417
- error: error$37
8717
+ error: params.error
8418
8718
  }),
8419
8719
  out: tx,
8420
- error: error$37
8720
+ error: params.error
8421
8721
  });
8422
8722
  const outerPipe = new _Pipe({
8423
8723
  type: "pipe",
8424
8724
  in: innerPipe,
8425
8725
  out: new _Boolean({
8426
8726
  type: "boolean",
8427
- error: error$37
8727
+ error: params.error
8428
8728
  }),
8429
- error: error$37
8729
+ error: params.error
8430
8730
  });
8431
8731
  return outerPipe;
8432
8732
  }
8733
+ function _stringFormat(Class$1, format, fnOrRegex, _params = {}) {
8734
+ const params = normalizeParams(_params);
8735
+ const def = {
8736
+ ...normalizeParams(_params),
8737
+ check: "string_format",
8738
+ type: "string",
8739
+ format,
8740
+ fn: typeof fnOrRegex === "function" ? fnOrRegex : (val) => fnOrRegex.test(val),
8741
+ ...params
8742
+ };
8743
+ if (fnOrRegex instanceof RegExp) {
8744
+ def.pattern = fnOrRegex;
8745
+ }
8746
+ const inst = new Class$1(def);
8747
+ return inst;
8748
+ }
8433
8749
 
8434
8750
  //#endregion
8435
- //#region ../../node_modules/zod/dist/esm/v4/core/function.js
8751
+ //#region ../../node_modules/zod/v4/core/function.js
8436
8752
  var $ZodFunction = class {
8437
8753
  constructor(def) {
8438
8754
  this._def = def;
@@ -8503,7 +8819,7 @@ function _function(params) {
8503
8819
  }
8504
8820
 
8505
8821
  //#endregion
8506
- //#region ../../node_modules/zod/dist/esm/v4/core/to-json-schema.js
8822
+ //#region ../../node_modules/zod/v4/core/to-json-schema.js
8507
8823
  var JSONSchemaGenerator = class {
8508
8824
  constructor(params) {
8509
8825
  this.counter = 0;
@@ -8539,431 +8855,435 @@ var JSONSchemaGenerator = class {
8539
8855
  const result = {
8540
8856
  schema: {},
8541
8857
  count: 1,
8542
- cycle: undefined
8543
- };
8544
- this.seen.set(schema, result);
8545
- if (schema._zod.toJSONSchema) {
8546
- result.schema = schema._zod.toJSONSchema();
8547
- }
8548
- const params = {
8549
- ..._params,
8550
- schemaPath: [..._params.schemaPath, schema],
8858
+ cycle: undefined,
8551
8859
  path: _params.path
8552
8860
  };
8553
- const parent = schema._zod.parent;
8554
- if (parent) {
8555
- result.ref = parent;
8556
- this.process(parent, params);
8557
- this.seen.get(parent).isParent = true;
8861
+ this.seen.set(schema, result);
8862
+ const overrideSchema = schema._zod.toJSONSchema?.();
8863
+ if (overrideSchema) {
8864
+ result.schema = overrideSchema;
8558
8865
  } else {
8559
- const _json = result.schema;
8560
- switch (def.type) {
8561
- case "string": {
8562
- const json$1 = _json;
8563
- json$1.type = "string";
8564
- const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
8565
- if (typeof minimum === "number") json$1.minLength = minimum;
8566
- if (typeof maximum === "number") json$1.maxLength = maximum;
8567
- if (format) {
8568
- json$1.format = formatMap[format] ?? format;
8569
- if (json$1.format === "") delete json$1.format;
8866
+ const params = {
8867
+ ..._params,
8868
+ schemaPath: [..._params.schemaPath, schema],
8869
+ path: _params.path
8870
+ };
8871
+ const parent = schema._zod.parent;
8872
+ if (parent) {
8873
+ result.ref = parent;
8874
+ this.process(parent, params);
8875
+ this.seen.get(parent).isParent = true;
8876
+ } else {
8877
+ const _json = result.schema;
8878
+ switch (def.type) {
8879
+ case "string": {
8880
+ const json$1 = _json;
8881
+ json$1.type = "string";
8882
+ const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
8883
+ if (typeof minimum === "number") json$1.minLength = minimum;
8884
+ if (typeof maximum === "number") json$1.maxLength = maximum;
8885
+ if (format) {
8886
+ json$1.format = formatMap[format] ?? format;
8887
+ if (json$1.format === "") delete json$1.format;
8888
+ }
8889
+ if (contentEncoding) json$1.contentEncoding = contentEncoding;
8890
+ if (patterns && patterns.size > 0) {
8891
+ const regexes = [...patterns];
8892
+ if (regexes.length === 1) json$1.pattern = regexes[0].source;
8893
+ else if (regexes.length > 1) {
8894
+ result.schema.allOf = [...regexes.map((regex) => ({
8895
+ ...this.target === "draft-7" ? { type: "string" } : {},
8896
+ pattern: regex.source
8897
+ }))];
8898
+ }
8899
+ }
8900
+ break;
8570
8901
  }
8571
- if (contentEncoding) json$1.contentEncoding = contentEncoding;
8572
- if (patterns && patterns.size > 0) {
8573
- const regexes = [...patterns];
8574
- if (regexes.length === 1) json$1.pattern = regexes[0].source;
8575
- else if (regexes.length > 1) {
8576
- result.schema.allOf = [...regexes.map((regex) => ({
8577
- ...this.target === "draft-7" ? { type: "string" } : {},
8578
- pattern: regex.source
8579
- }))];
8902
+ case "number": {
8903
+ const json$1 = _json;
8904
+ const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
8905
+ if (typeof format === "string" && format.includes("int")) json$1.type = "integer";
8906
+ else json$1.type = "number";
8907
+ if (typeof exclusiveMinimum === "number") json$1.exclusiveMinimum = exclusiveMinimum;
8908
+ if (typeof minimum === "number") {
8909
+ json$1.minimum = minimum;
8910
+ if (typeof exclusiveMinimum === "number") {
8911
+ if (exclusiveMinimum >= minimum) delete json$1.minimum;
8912
+ else delete json$1.exclusiveMinimum;
8913
+ }
8580
8914
  }
8915
+ if (typeof exclusiveMaximum === "number") json$1.exclusiveMaximum = exclusiveMaximum;
8916
+ if (typeof maximum === "number") {
8917
+ json$1.maximum = maximum;
8918
+ if (typeof exclusiveMaximum === "number") {
8919
+ if (exclusiveMaximum <= maximum) delete json$1.maximum;
8920
+ else delete json$1.exclusiveMaximum;
8921
+ }
8922
+ }
8923
+ if (typeof multipleOf === "number") json$1.multipleOf = multipleOf;
8924
+ break;
8581
8925
  }
8582
- break;
8583
- }
8584
- case "number": {
8585
- const json$1 = _json;
8586
- const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
8587
- if (typeof format === "string" && format.includes("int")) json$1.type = "integer";
8588
- else json$1.type = "number";
8589
- if (typeof exclusiveMinimum === "number") json$1.exclusiveMinimum = exclusiveMinimum;
8590
- if (typeof minimum === "number") {
8591
- json$1.minimum = minimum;
8592
- if (typeof exclusiveMinimum === "number") {
8593
- if (exclusiveMinimum >= minimum) delete json$1.minimum;
8594
- else delete json$1.exclusiveMinimum;
8926
+ case "boolean": {
8927
+ const json$1 = _json;
8928
+ json$1.type = "boolean";
8929
+ break;
8930
+ }
8931
+ case "bigint": {
8932
+ if (this.unrepresentable === "throw") {
8933
+ throw new Error("BigInt cannot be represented in JSON Schema");
8595
8934
  }
8935
+ break;
8596
8936
  }
8597
- if (typeof exclusiveMaximum === "number") json$1.exclusiveMaximum = exclusiveMaximum;
8598
- if (typeof maximum === "number") {
8599
- json$1.maximum = maximum;
8600
- if (typeof exclusiveMaximum === "number") {
8601
- if (exclusiveMaximum <= maximum) delete json$1.maximum;
8602
- else delete json$1.exclusiveMaximum;
8937
+ case "symbol": {
8938
+ if (this.unrepresentable === "throw") {
8939
+ throw new Error("Symbols cannot be represented in JSON Schema");
8603
8940
  }
8941
+ break;
8604
8942
  }
8605
- if (typeof multipleOf === "number") json$1.multipleOf = multipleOf;
8606
- break;
8607
- }
8608
- case "boolean": {
8609
- const json$1 = _json;
8610
- json$1.type = "boolean";
8611
- break;
8612
- }
8613
- case "bigint": {
8614
- if (this.unrepresentable === "throw") {
8615
- throw new Error("BigInt cannot be represented in JSON Schema");
8943
+ case "null": {
8944
+ _json.type = "null";
8945
+ break;
8616
8946
  }
8617
- break;
8618
- }
8619
- case "symbol": {
8620
- if (this.unrepresentable === "throw") {
8621
- throw new Error("Symbols cannot be represented in JSON Schema");
8947
+ case "any": {
8948
+ break;
8622
8949
  }
8623
- break;
8624
- }
8625
- case "undefined": {
8626
- const json$1 = _json;
8627
- json$1.type = "null";
8628
- break;
8629
- }
8630
- case "null": {
8631
- _json.type = "null";
8632
- break;
8633
- }
8634
- case "any": {
8635
- break;
8636
- }
8637
- case "unknown": {
8638
- break;
8639
- }
8640
- case "never": {
8641
- _json.not = {};
8642
- break;
8643
- }
8644
- case "void": {
8645
- if (this.unrepresentable === "throw") {
8646
- throw new Error("Void cannot be represented in JSON Schema");
8950
+ case "unknown": {
8951
+ break;
8647
8952
  }
8648
- break;
8649
- }
8650
- case "date": {
8651
- if (this.unrepresentable === "throw") {
8652
- throw new Error("Date cannot be represented in JSON Schema");
8953
+ case "undefined": {
8954
+ if (this.unrepresentable === "throw") {
8955
+ throw new Error("Undefined cannot be represented in JSON Schema");
8956
+ }
8957
+ break;
8653
8958
  }
8654
- break;
8655
- }
8656
- case "array": {
8657
- const json$1 = _json;
8658
- const { minimum, maximum } = schema._zod.bag;
8659
- if (typeof minimum === "number") json$1.minItems = minimum;
8660
- if (typeof maximum === "number") json$1.maxItems = maximum;
8661
- json$1.type = "array";
8662
- json$1.items = this.process(def.element, {
8663
- ...params,
8664
- path: [...params.path, "items"]
8665
- });
8666
- break;
8667
- }
8668
- case "object": {
8669
- const json$1 = _json;
8670
- json$1.type = "object";
8671
- json$1.properties = {};
8672
- const shape = def.shape;
8673
- for (const key in shape) {
8674
- json$1.properties[key] = this.process(shape[key], {
8675
- ...params,
8676
- path: [
8677
- ...params.path,
8678
- "properties",
8679
- key
8680
- ]
8681
- });
8959
+ case "void": {
8960
+ if (this.unrepresentable === "throw") {
8961
+ throw new Error("Void cannot be represented in JSON Schema");
8962
+ }
8963
+ break;
8682
8964
  }
8683
- const allKeys = new Set(Object.keys(shape));
8684
- const requiredKeys = new Set([...allKeys].filter((key) => {
8685
- const v = def.shape[key]._zod;
8686
- if (this.io === "input") {
8687
- return v.optin === undefined;
8688
- } else {
8689
- return v.optout === undefined;
8965
+ case "never": {
8966
+ _json.not = {};
8967
+ break;
8968
+ }
8969
+ case "date": {
8970
+ if (this.unrepresentable === "throw") {
8971
+ throw new Error("Date cannot be represented in JSON Schema");
8690
8972
  }
8691
- }));
8692
- if (requiredKeys.size > 0) {
8693
- json$1.required = Array.from(requiredKeys);
8973
+ break;
8694
8974
  }
8695
- if (def.catchall?._zod.def.type === "never") {
8696
- json$1.additionalProperties = false;
8697
- } else if (!def.catchall) {
8698
- if (this.io === "output") json$1.additionalProperties = false;
8699
- } else if (def.catchall) {
8700
- json$1.additionalProperties = this.process(def.catchall, {
8975
+ case "array": {
8976
+ const json$1 = _json;
8977
+ const { minimum, maximum } = schema._zod.bag;
8978
+ if (typeof minimum === "number") json$1.minItems = minimum;
8979
+ if (typeof maximum === "number") json$1.maxItems = maximum;
8980
+ json$1.type = "array";
8981
+ json$1.items = this.process(def.element, {
8701
8982
  ...params,
8702
- path: [...params.path, "additionalProperties"]
8983
+ path: [...params.path, "items"]
8703
8984
  });
8985
+ break;
8704
8986
  }
8705
- break;
8706
- }
8707
- case "union": {
8708
- const json$1 = _json;
8709
- json$1.anyOf = def.options.map((x, i) => this.process(x, {
8710
- ...params,
8711
- path: [
8712
- ...params.path,
8713
- "anyOf",
8714
- i
8715
- ]
8716
- }));
8717
- break;
8718
- }
8719
- case "intersection": {
8720
- const json$1 = _json;
8721
- const a = this.process(def.left, {
8722
- ...params,
8723
- path: [
8724
- ...params.path,
8725
- "allOf",
8726
- 0
8727
- ]
8728
- });
8729
- const b = this.process(def.right, {
8730
- ...params,
8731
- path: [
8732
- ...params.path,
8733
- "allOf",
8734
- 1
8735
- ]
8736
- });
8737
- const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
8738
- const allOf = [...isSimpleIntersection(a) ? a.allOf : [a], ...isSimpleIntersection(b) ? b.allOf : [b]];
8739
- json$1.allOf = allOf;
8740
- break;
8741
- }
8742
- case "tuple": {
8743
- const json$1 = _json;
8744
- json$1.type = "array";
8745
- const prefixItems = def.items.map((x, i) => this.process(x, {
8746
- ...params,
8747
- path: [
8748
- ...params.path,
8749
- "prefixItems",
8750
- i
8751
- ]
8752
- }));
8753
- if (this.target === "draft-2020-12") {
8754
- json$1.prefixItems = prefixItems;
8755
- } else {
8756
- json$1.items = prefixItems;
8987
+ case "object": {
8988
+ const json$1 = _json;
8989
+ json$1.type = "object";
8990
+ json$1.properties = {};
8991
+ const shape = def.shape;
8992
+ for (const key in shape) {
8993
+ json$1.properties[key] = this.process(shape[key], {
8994
+ ...params,
8995
+ path: [
8996
+ ...params.path,
8997
+ "properties",
8998
+ key
8999
+ ]
9000
+ });
9001
+ }
9002
+ const allKeys = new Set(Object.keys(shape));
9003
+ const requiredKeys = new Set([...allKeys].filter((key) => {
9004
+ const v = def.shape[key]._zod;
9005
+ if (this.io === "input") {
9006
+ return v.optin === undefined;
9007
+ } else {
9008
+ return v.optout === undefined;
9009
+ }
9010
+ }));
9011
+ if (requiredKeys.size > 0) {
9012
+ json$1.required = Array.from(requiredKeys);
9013
+ }
9014
+ if (def.catchall?._zod.def.type === "never") {
9015
+ json$1.additionalProperties = false;
9016
+ } else if (!def.catchall) {
9017
+ if (this.io === "output") json$1.additionalProperties = false;
9018
+ } else if (def.catchall) {
9019
+ json$1.additionalProperties = this.process(def.catchall, {
9020
+ ...params,
9021
+ path: [...params.path, "additionalProperties"]
9022
+ });
9023
+ }
9024
+ break;
8757
9025
  }
8758
- if (def.rest) {
8759
- const rest = this.process(def.rest, {
9026
+ case "union": {
9027
+ const json$1 = _json;
9028
+ json$1.anyOf = def.options.map((x, i) => this.process(x, {
8760
9029
  ...params,
8761
- path: [...params.path, "items"]
9030
+ path: [
9031
+ ...params.path,
9032
+ "anyOf",
9033
+ i
9034
+ ]
9035
+ }));
9036
+ break;
9037
+ }
9038
+ case "intersection": {
9039
+ const json$1 = _json;
9040
+ const a = this.process(def.left, {
9041
+ ...params,
9042
+ path: [
9043
+ ...params.path,
9044
+ "allOf",
9045
+ 0
9046
+ ]
9047
+ });
9048
+ const b = this.process(def.right, {
9049
+ ...params,
9050
+ path: [
9051
+ ...params.path,
9052
+ "allOf",
9053
+ 1
9054
+ ]
8762
9055
  });
9056
+ const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
9057
+ const allOf = [...isSimpleIntersection(a) ? a.allOf : [a], ...isSimpleIntersection(b) ? b.allOf : [b]];
9058
+ json$1.allOf = allOf;
9059
+ break;
9060
+ }
9061
+ case "tuple": {
9062
+ const json$1 = _json;
9063
+ json$1.type = "array";
9064
+ const prefixItems = def.items.map((x, i) => this.process(x, {
9065
+ ...params,
9066
+ path: [
9067
+ ...params.path,
9068
+ "prefixItems",
9069
+ i
9070
+ ]
9071
+ }));
8763
9072
  if (this.target === "draft-2020-12") {
8764
- json$1.items = rest;
9073
+ json$1.prefixItems = prefixItems;
8765
9074
  } else {
8766
- json$1.additionalItems = rest;
9075
+ json$1.items = prefixItems;
9076
+ }
9077
+ if (def.rest) {
9078
+ const rest = this.process(def.rest, {
9079
+ ...params,
9080
+ path: [...params.path, "items"]
9081
+ });
9082
+ if (this.target === "draft-2020-12") {
9083
+ json$1.items = rest;
9084
+ } else {
9085
+ json$1.additionalItems = rest;
9086
+ }
8767
9087
  }
9088
+ if (def.rest) {
9089
+ json$1.items = this.process(def.rest, {
9090
+ ...params,
9091
+ path: [...params.path, "items"]
9092
+ });
9093
+ }
9094
+ const { minimum, maximum } = schema._zod.bag;
9095
+ if (typeof minimum === "number") json$1.minItems = minimum;
9096
+ if (typeof maximum === "number") json$1.maxItems = maximum;
9097
+ break;
8768
9098
  }
8769
- if (def.rest) {
8770
- json$1.items = this.process(def.rest, {
9099
+ case "record": {
9100
+ const json$1 = _json;
9101
+ json$1.type = "object";
9102
+ json$1.propertyNames = this.process(def.keyType, {
8771
9103
  ...params,
8772
- path: [...params.path, "items"]
9104
+ path: [...params.path, "propertyNames"]
8773
9105
  });
9106
+ json$1.additionalProperties = this.process(def.valueType, {
9107
+ ...params,
9108
+ path: [...params.path, "additionalProperties"]
9109
+ });
9110
+ break;
8774
9111
  }
8775
- const { minimum, maximum } = schema._zod.bag;
8776
- if (typeof minimum === "number") json$1.minItems = minimum;
8777
- if (typeof maximum === "number") json$1.maxItems = maximum;
8778
- break;
8779
- }
8780
- case "record": {
8781
- const json$1 = _json;
8782
- json$1.type = "object";
8783
- json$1.propertyNames = this.process(def.keyType, {
8784
- ...params,
8785
- path: [...params.path, "propertyNames"]
8786
- });
8787
- json$1.additionalProperties = this.process(def.valueType, {
8788
- ...params,
8789
- path: [...params.path, "additionalProperties"]
8790
- });
8791
- break;
8792
- }
8793
- case "map": {
8794
- if (this.unrepresentable === "throw") {
8795
- throw new Error("Map cannot be represented in JSON Schema");
9112
+ case "map": {
9113
+ if (this.unrepresentable === "throw") {
9114
+ throw new Error("Map cannot be represented in JSON Schema");
9115
+ }
9116
+ break;
8796
9117
  }
8797
- break;
8798
- }
8799
- case "set": {
8800
- if (this.unrepresentable === "throw") {
8801
- throw new Error("Set cannot be represented in JSON Schema");
9118
+ case "set": {
9119
+ if (this.unrepresentable === "throw") {
9120
+ throw new Error("Set cannot be represented in JSON Schema");
9121
+ }
9122
+ break;
9123
+ }
9124
+ case "enum": {
9125
+ const json$1 = _json;
9126
+ const values = getEnumValues(def.entries);
9127
+ if (values.every((v) => typeof v === "number")) json$1.type = "number";
9128
+ if (values.every((v) => typeof v === "string")) json$1.type = "string";
9129
+ json$1.enum = values;
9130
+ break;
8802
9131
  }
8803
- break;
8804
- }
8805
- case "enum": {
8806
- const json$1 = _json;
8807
- const values = getEnumValues(def.entries);
8808
- if (values.every((v) => typeof v === "number")) json$1.type = "number";
8809
- if (values.every((v) => typeof v === "string")) json$1.type = "string";
8810
- json$1.enum = values;
8811
- break;
8812
- }
8813
- case "literal": {
8814
- const json$1 = _json;
8815
- const vals = [];
8816
- for (const val of def.values) {
8817
- if (val === undefined) {
8818
- if (this.unrepresentable === "throw") {
8819
- throw new Error("Literal `undefined` cannot be represented in JSON Schema");
8820
- } else {}
8821
- } else if (typeof val === "bigint") {
8822
- if (this.unrepresentable === "throw") {
8823
- throw new Error("BigInt literals cannot be represented in JSON Schema");
9132
+ case "literal": {
9133
+ const json$1 = _json;
9134
+ const vals = [];
9135
+ for (const val of def.values) {
9136
+ if (val === undefined) {
9137
+ if (this.unrepresentable === "throw") {
9138
+ throw new Error("Literal `undefined` cannot be represented in JSON Schema");
9139
+ } else {}
9140
+ } else if (typeof val === "bigint") {
9141
+ if (this.unrepresentable === "throw") {
9142
+ throw new Error("BigInt literals cannot be represented in JSON Schema");
9143
+ } else {
9144
+ vals.push(Number(val));
9145
+ }
8824
9146
  } else {
8825
- vals.push(Number(val));
9147
+ vals.push(val);
8826
9148
  }
9149
+ }
9150
+ if (vals.length === 0) {} else if (vals.length === 1) {
9151
+ const val = vals[0];
9152
+ json$1.type = val === null ? "null" : typeof val;
9153
+ json$1.const = val;
8827
9154
  } else {
8828
- vals.push(val);
9155
+ if (vals.every((v) => typeof v === "number")) json$1.type = "number";
9156
+ if (vals.every((v) => typeof v === "string")) json$1.type = "string";
9157
+ if (vals.every((v) => typeof v === "boolean")) json$1.type = "string";
9158
+ if (vals.every((v) => v === null)) json$1.type = "null";
9159
+ json$1.enum = vals;
8829
9160
  }
9161
+ break;
8830
9162
  }
8831
- if (vals.length === 0) {} else if (vals.length === 1) {
8832
- const val = vals[0];
8833
- json$1.type = val === null ? "null" : typeof val;
8834
- json$1.const = val;
8835
- } else {
8836
- if (vals.every((v) => typeof v === "number")) json$1.type = "number";
8837
- if (vals.every((v) => typeof v === "string")) json$1.type = "string";
8838
- if (vals.every((v) => typeof v === "boolean")) json$1.type = "string";
8839
- if (vals.every((v) => v === null)) json$1.type = "null";
8840
- json$1.enum = vals;
8841
- }
8842
- break;
8843
- }
8844
- case "file": {
8845
- const json$1 = _json;
8846
- const file$1 = {
8847
- type: "string",
8848
- format: "binary",
8849
- contentEncoding: "binary"
8850
- };
8851
- const { minimum, maximum, mime } = schema._zod.bag;
8852
- if (minimum !== undefined) file$1.minLength = minimum;
8853
- if (maximum !== undefined) file$1.maxLength = maximum;
8854
- if (mime) {
8855
- if (mime.length === 1) {
8856
- file$1.contentMediaType = mime[0];
8857
- Object.assign(json$1, file$1);
9163
+ case "file": {
9164
+ const json$1 = _json;
9165
+ const file$1 = {
9166
+ type: "string",
9167
+ format: "binary",
9168
+ contentEncoding: "binary"
9169
+ };
9170
+ const { minimum, maximum, mime } = schema._zod.bag;
9171
+ if (minimum !== undefined) file$1.minLength = minimum;
9172
+ if (maximum !== undefined) file$1.maxLength = maximum;
9173
+ if (mime) {
9174
+ if (mime.length === 1) {
9175
+ file$1.contentMediaType = mime[0];
9176
+ Object.assign(json$1, file$1);
9177
+ } else {
9178
+ json$1.anyOf = mime.map((m) => {
9179
+ const mFile = {
9180
+ ...file$1,
9181
+ contentMediaType: m
9182
+ };
9183
+ return mFile;
9184
+ });
9185
+ }
8858
9186
  } else {
8859
- json$1.anyOf = mime.map((m) => {
8860
- const mFile = {
8861
- ...file$1,
8862
- contentMediaType: m
8863
- };
8864
- return mFile;
8865
- });
9187
+ Object.assign(json$1, file$1);
8866
9188
  }
8867
- } else {
8868
- Object.assign(json$1, file$1);
9189
+ break;
8869
9190
  }
8870
- break;
8871
- }
8872
- case "transform": {
8873
- if (this.unrepresentable === "throw") {
8874
- throw new Error("Transforms cannot be represented in JSON Schema");
9191
+ case "transform": {
9192
+ if (this.unrepresentable === "throw") {
9193
+ throw new Error("Transforms cannot be represented in JSON Schema");
9194
+ }
9195
+ break;
8875
9196
  }
8876
- break;
8877
- }
8878
- case "nullable": {
8879
- const inner = this.process(def.innerType, params);
8880
- _json.anyOf = [inner, { type: "null" }];
8881
- break;
8882
- }
8883
- case "nonoptional": {
8884
- this.process(def.innerType, params);
8885
- result.ref = def.innerType;
8886
- break;
8887
- }
8888
- case "success": {
8889
- const json$1 = _json;
8890
- json$1.type = "boolean";
8891
- break;
8892
- }
8893
- case "default": {
8894
- this.process(def.innerType, params);
8895
- result.ref = def.innerType;
8896
- _json.default = def.defaultValue;
8897
- break;
8898
- }
8899
- case "prefault": {
8900
- this.process(def.innerType, params);
8901
- result.ref = def.innerType;
8902
- if (this.io === "input") _json._prefault = def.defaultValue;
8903
- break;
8904
- }
8905
- case "catch": {
8906
- this.process(def.innerType, params);
8907
- result.ref = def.innerType;
8908
- let catchValue;
8909
- try {
8910
- catchValue = def.catchValue(undefined);
8911
- } catch {
8912
- throw new Error("Dynamic catch values are not supported in JSON Schema");
9197
+ case "nullable": {
9198
+ const inner = this.process(def.innerType, params);
9199
+ _json.anyOf = [inner, { type: "null" }];
9200
+ break;
8913
9201
  }
8914
- _json.default = catchValue;
8915
- break;
8916
- }
8917
- case "nan": {
8918
- if (this.unrepresentable === "throw") {
8919
- throw new Error("NaN cannot be represented in JSON Schema");
9202
+ case "nonoptional": {
9203
+ this.process(def.innerType, params);
9204
+ result.ref = def.innerType;
9205
+ break;
8920
9206
  }
8921
- break;
8922
- }
8923
- case "template_literal": {
8924
- const json$1 = _json;
8925
- const pattern = schema._zod.pattern;
8926
- if (!pattern) throw new Error("Pattern not found in template literal");
8927
- json$1.type = "string";
8928
- json$1.pattern = pattern.source;
8929
- break;
8930
- }
8931
- case "pipe": {
8932
- const innerType = this.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
8933
- this.process(innerType, params);
8934
- result.ref = innerType;
8935
- break;
8936
- }
8937
- case "readonly": {
8938
- this.process(def.innerType, params);
8939
- result.ref = def.innerType;
8940
- _json.readOnly = true;
8941
- break;
8942
- }
8943
- case "promise": {
8944
- this.process(def.innerType, params);
8945
- result.ref = def.innerType;
8946
- break;
8947
- }
8948
- case "optional": {
8949
- this.process(def.innerType, params);
8950
- result.ref = def.innerType;
8951
- break;
8952
- }
8953
- case "lazy": {
8954
- const innerType = schema._zod.innerType;
8955
- this.process(innerType, params);
8956
- result.ref = innerType;
8957
- break;
8958
- }
8959
- case "custom": {
8960
- if (this.unrepresentable === "throw") {
8961
- throw new Error("Custom types cannot be represented in JSON Schema");
9207
+ case "success": {
9208
+ const json$1 = _json;
9209
+ json$1.type = "boolean";
9210
+ break;
9211
+ }
9212
+ case "default": {
9213
+ this.process(def.innerType, params);
9214
+ result.ref = def.innerType;
9215
+ _json.default = JSON.parse(JSON.stringify(def.defaultValue));
9216
+ break;
9217
+ }
9218
+ case "prefault": {
9219
+ this.process(def.innerType, params);
9220
+ result.ref = def.innerType;
9221
+ if (this.io === "input") _json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
9222
+ break;
9223
+ }
9224
+ case "catch": {
9225
+ this.process(def.innerType, params);
9226
+ result.ref = def.innerType;
9227
+ let catchValue;
9228
+ try {
9229
+ catchValue = def.catchValue(undefined);
9230
+ } catch {
9231
+ throw new Error("Dynamic catch values are not supported in JSON Schema");
9232
+ }
9233
+ _json.default = catchValue;
9234
+ break;
9235
+ }
9236
+ case "nan": {
9237
+ if (this.unrepresentable === "throw") {
9238
+ throw new Error("NaN cannot be represented in JSON Schema");
9239
+ }
9240
+ break;
9241
+ }
9242
+ case "template_literal": {
9243
+ const json$1 = _json;
9244
+ const pattern = schema._zod.pattern;
9245
+ if (!pattern) throw new Error("Pattern not found in template literal");
9246
+ json$1.type = "string";
9247
+ json$1.pattern = pattern.source;
9248
+ break;
9249
+ }
9250
+ case "pipe": {
9251
+ const innerType = this.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
9252
+ this.process(innerType, params);
9253
+ result.ref = innerType;
9254
+ break;
9255
+ }
9256
+ case "readonly": {
9257
+ this.process(def.innerType, params);
9258
+ result.ref = def.innerType;
9259
+ _json.readOnly = true;
9260
+ break;
9261
+ }
9262
+ case "promise": {
9263
+ this.process(def.innerType, params);
9264
+ result.ref = def.innerType;
9265
+ break;
9266
+ }
9267
+ case "optional": {
9268
+ this.process(def.innerType, params);
9269
+ result.ref = def.innerType;
9270
+ break;
9271
+ }
9272
+ case "lazy": {
9273
+ const innerType = schema._zod.innerType;
9274
+ this.process(innerType, params);
9275
+ result.ref = innerType;
9276
+ break;
9277
+ }
9278
+ case "custom": {
9279
+ if (this.unrepresentable === "throw") {
9280
+ throw new Error("Custom types cannot be represented in JSON Schema");
9281
+ }
9282
+ break;
9283
+ }
9284
+ default: {
9285
+ def;
8962
9286
  }
8963
- break;
8964
- }
8965
- default: {
8966
- def;
8967
9287
  }
8968
9288
  }
8969
9289
  }
@@ -8990,12 +9310,15 @@ var JSONSchemaGenerator = class {
8990
9310
  const defsSegment = this.target === "draft-2020-12" ? "$defs" : "definitions";
8991
9311
  if (params.external) {
8992
9312
  const externalId = params.external.registry.get(entry[0])?.id;
8993
- if (externalId) return { ref: params.external.uri(externalId) };
9313
+ const uriGenerator = params.external.uri ?? ((id$1) => id$1);
9314
+ if (externalId) {
9315
+ return { ref: uriGenerator(externalId) };
9316
+ }
8994
9317
  const id = entry[1].defId ?? entry[1].schema.id ?? `schema${this.counter++}`;
8995
9318
  entry[1].defId = id;
8996
9319
  return {
8997
9320
  defId: id,
8998
- ref: `${params.external.uri("__shared")}#/${defsSegment}/${id}`
9321
+ ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}`
8999
9322
  };
9000
9323
  }
9001
9324
  if (entry[1] === root) {
@@ -9023,6 +9346,14 @@ var JSONSchemaGenerator = class {
9023
9346
  }
9024
9347
  schema$1.$ref = ref;
9025
9348
  };
9349
+ if (params.cycles === "throw") {
9350
+ for (const entry of this.seen.entries()) {
9351
+ const seen = entry[1];
9352
+ if (seen.cycle) {
9353
+ throw new Error("Cycle detected: " + `#/${seen.cycle?.join("/")}/<root>` + "\n\nSet the `cycles` parameter to `\"ref\"` to resolve cyclical schemas with defs.");
9354
+ }
9355
+ }
9356
+ }
9026
9357
  for (const entry of this.seen.entries()) {
9027
9358
  const seen = entry[1];
9028
9359
  if (schema === entry[0]) {
@@ -9042,11 +9373,7 @@ var JSONSchemaGenerator = class {
9042
9373
  continue;
9043
9374
  }
9044
9375
  if (seen.cycle) {
9045
- if (params.cycles === "throw") {
9046
- throw new Error("Cycle detected: " + `#/${seen.cycle?.join("/")}/<root>` + "\n\nSet the `cycles` parameter to `\"ref\"` to resolve cyclical schemas with defs.");
9047
- } else if (params.cycles === "ref") {
9048
- extractToDef(entry);
9049
- }
9376
+ extractToDef(entry);
9050
9377
  continue;
9051
9378
  }
9052
9379
  if (seen.count > 1) {
@@ -9078,7 +9405,8 @@ var JSONSchemaGenerator = class {
9078
9405
  }
9079
9406
  if (!seen.isParent) this.override({
9080
9407
  zodSchema,
9081
- jsonSchema: schema$1
9408
+ jsonSchema: schema$1,
9409
+ path: seen.path ?? []
9082
9410
  });
9083
9411
  };
9084
9412
  for (const entry of [...this.seen.entries()].reverse()) {
@@ -9092,6 +9420,11 @@ var JSONSchemaGenerator = class {
9092
9420
  } else {
9093
9421
  console.warn(`Invalid target: ${this.target}`);
9094
9422
  }
9423
+ if (params.external?.uri) {
9424
+ const id = params.external.registry.get(schema)?.id;
9425
+ if (!id) throw new Error("Schema is missing an `id` property");
9426
+ result.$id = params.external.uri(id);
9427
+ }
9095
9428
  Object.assign(result, root.def);
9096
9429
  const defs = params.external?.defs ?? {};
9097
9430
  for (const entry of this.seen.entries()) {
@@ -9100,11 +9433,13 @@ var JSONSchemaGenerator = class {
9100
9433
  defs[seen.defId] = seen.def;
9101
9434
  }
9102
9435
  }
9103
- if (!params.external && Object.keys(defs).length > 0) {
9104
- if (this.target === "draft-2020-12") {
9105
- result.$defs = defs;
9106
- } else {
9107
- result.definitions = defs;
9436
+ if (params.external) {} else {
9437
+ if (Object.keys(defs).length > 0) {
9438
+ if (this.target === "draft-2020-12") {
9439
+ result.$defs = defs;
9440
+ } else {
9441
+ result.definitions = defs;
9442
+ }
9108
9443
  }
9109
9444
  }
9110
9445
  try {
@@ -9125,7 +9460,7 @@ function toJSONSchema(input, _params) {
9125
9460
  const schemas = {};
9126
9461
  const external = {
9127
9462
  registry: input,
9128
- uri: _params?.uri || ((id) => id),
9463
+ uri: _params?.uri,
9129
9464
  defs
9130
9465
  };
9131
9466
  for (const entry of input._idmap.entries()) {
@@ -9236,11 +9571,11 @@ function isTransforming(_schema, _ctx) {
9236
9571
  }
9237
9572
 
9238
9573
  //#endregion
9239
- //#region ../../node_modules/zod/dist/esm/v4/core/json-schema.js
9574
+ //#region ../../node_modules/zod/v4/core/json-schema.js
9240
9575
  var json_schema_exports = {};
9241
9576
 
9242
9577
  //#endregion
9243
- //#region ../../node_modules/zod/dist/esm/v4/core/index.js
9578
+ //#region ../../node_modules/zod/v4/core/index.js
9244
9579
  var core_exports = {};
9245
9580
  __export(core_exports, {
9246
9581
  $ZodAny: () => $ZodAny,
@@ -9279,6 +9614,7 @@ __export(core_exports, {
9279
9614
  $ZodCheckStringFormat: () => $ZodCheckStringFormat,
9280
9615
  $ZodCheckUpperCase: () => $ZodCheckUpperCase,
9281
9616
  $ZodCustom: () => $ZodCustom,
9617
+ $ZodCustomStringFormat: () => $ZodCustomStringFormat,
9282
9618
  $ZodDate: () => $ZodDate,
9283
9619
  $ZodDefault: () => $ZodDefault,
9284
9620
  $ZodDiscriminatedUnion: () => $ZodDiscriminatedUnion,
@@ -9343,6 +9679,8 @@ __export(core_exports, {
9343
9679
  Doc: () => Doc,
9344
9680
  JSONSchema: () => json_schema_exports,
9345
9681
  JSONSchemaGenerator: () => JSONSchemaGenerator,
9682
+ NEVER: () => NEVER,
9683
+ TimePrecision: () => TimePrecision,
9346
9684
  _any: () => _any,
9347
9685
  _array: () => _array,
9348
9686
  _base64: () => _base64,
@@ -9432,6 +9770,7 @@ __export(core_exports, {
9432
9770
  _size: () => _size,
9433
9771
  _startsWith: () => _startsWith,
9434
9772
  _string: () => _string,
9773
+ _stringFormat: () => _stringFormat,
9435
9774
  _stringbool: () => _stringbool,
9436
9775
  _success: () => _success,
9437
9776
  _symbol: () => _symbol,
@@ -9481,7 +9820,7 @@ __export(core_exports, {
9481
9820
  });
9482
9821
 
9483
9822
  //#endregion
9484
- //#region ../../node_modules/zod/dist/esm/v4/classic/iso.js
9823
+ //#region ../../node_modules/zod/v4/classic/iso.js
9485
9824
  var iso_exports = {};
9486
9825
  __export(iso_exports, {
9487
9826
  ZodISODate: () => ZodISODate,
@@ -9523,7 +9862,7 @@ function duration(params) {
9523
9862
  }
9524
9863
 
9525
9864
  //#endregion
9526
- //#region ../../node_modules/zod/dist/esm/v4/classic/errors.js
9865
+ //#region ../../node_modules/zod/v4/classic/errors.js
9527
9866
  const initializer = (inst, issues) => {
9528
9867
  $ZodError.init(inst, issues);
9529
9868
  inst.name = "ZodError";
@@ -9541,14 +9880,14 @@ const ZodError = $constructor("ZodError", initializer);
9541
9880
  const ZodRealError = $constructor("ZodError", initializer, { Parent: Error });
9542
9881
 
9543
9882
  //#endregion
9544
- //#region ../../node_modules/zod/dist/esm/v4/classic/parse.js
9883
+ //#region ../../node_modules/zod/v4/classic/parse.js
9545
9884
  const parse = /* @__PURE__ */ _parse(ZodRealError);
9546
9885
  const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
9547
9886
  const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
9548
9887
  const safeParseAsync = /* @__PURE__ */ _safeParseAsync(ZodRealError);
9549
9888
 
9550
9889
  //#endregion
9551
- //#region ../../node_modules/zod/dist/esm/v4/classic/schemas.js
9890
+ //#region ../../node_modules/zod/v4/classic/schemas.js
9552
9891
  const ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
9553
9892
  $ZodType.init(inst, def);
9554
9893
  inst.def = def;
@@ -9816,6 +10155,13 @@ const ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
9816
10155
  function jwt(params) {
9817
10156
  return _jwt(ZodJWT, params);
9818
10157
  }
10158
+ const ZodCustomStringFormat = /* @__PURE__ */ $constructor("ZodCustomStringFormat", (inst, def) => {
10159
+ $ZodCustomStringFormat.init(inst, def);
10160
+ ZodStringFormat.init(inst, def);
10161
+ });
10162
+ function stringFormat(format, fnOrRegex, _params = {}) {
10163
+ return _stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);
10164
+ }
9819
10165
  const ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
9820
10166
  $ZodNumber.init(inst, def);
9821
10167
  ZodType.init(inst, def);
@@ -9985,9 +10331,7 @@ function keyof(schema) {
9985
10331
  const ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
9986
10332
  $ZodObject.init(inst, def);
9987
10333
  ZodType.init(inst, def);
9988
- defineLazy(inst, "shape", () => {
9989
- return Object.fromEntries(Object.entries(inst._zod.def.shape));
9990
- });
10334
+ defineLazy(inst, "shape", () => def.shape);
9991
10335
  inst.keyof = () => _enum(Object.keys(inst._zod.def.shape));
9992
10336
  inst.catchall = (catchall) => inst.clone({
9993
10337
  ...inst._zod.def,
@@ -10432,11 +10776,8 @@ const ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
10432
10776
  $ZodCustom.init(inst, def);
10433
10777
  ZodType.init(inst, def);
10434
10778
  });
10435
- function check(fn, params) {
10436
- const ch = new $ZodCheck({
10437
- check: "custom",
10438
- ...normalizeParams(params)
10439
- });
10779
+ function check(fn) {
10780
+ const ch = new $ZodCheck({ check: "custom" });
10440
10781
  ch._zod.check = fn;
10441
10782
  return ch;
10442
10783
  }
@@ -10446,7 +10787,7 @@ function custom(fn, _params) {
10446
10787
  function refine(fn, _params = {}) {
10447
10788
  return _refine(ZodCustom, fn, _params);
10448
10789
  }
10449
- function superRefine(fn, params) {
10790
+ function superRefine(fn) {
10450
10791
  const ch = check((payload) => {
10451
10792
  payload.addIssue = (issue$1) => {
10452
10793
  if (typeof issue$1 === "string") {
@@ -10462,7 +10803,7 @@ function superRefine(fn, params) {
10462
10803
  }
10463
10804
  };
10464
10805
  return fn(payload.value, payload);
10465
- }, params);
10806
+ });
10466
10807
  return ch;
10467
10808
  }
10468
10809
  function _instanceof(cls, params = { error: `Input not instance of ${cls.name}` }) {
@@ -10500,7 +10841,7 @@ function preprocess(fn, schema) {
10500
10841
  }
10501
10842
 
10502
10843
  //#endregion
10503
- //#region ../../node_modules/zod/dist/esm/v4/classic/compat.js
10844
+ //#region ../../node_modules/zod/v4/classic/compat.js
10504
10845
  /** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
10505
10846
  const ZodIssueCode = {
10506
10847
  invalid_type: "invalid_type",
@@ -10515,10 +10856,6 @@ const ZodIssueCode = {
10515
10856
  invalid_value: "invalid_value",
10516
10857
  custom: "custom"
10517
10858
  };
10518
- /** @deprecated Not necessary in Zod 4. */
10519
- const INVALID = Object.freeze({ status: "aborted" });
10520
- /** A special constant with type `never` */
10521
- const NEVER = INVALID;
10522
10859
  /** @deprecated Use `z.config(params)` instead. */
10523
10860
  function setErrorMap(map$1) {
10524
10861
  config({ customError: map$1 });
@@ -10527,9 +10864,12 @@ function setErrorMap(map$1) {
10527
10864
  function getErrorMap() {
10528
10865
  return config().customError;
10529
10866
  }
10867
+ /** @deprecated Do not use. Stub definition, only included for zod-to-json-schema compatibility. */
10868
+ var ZodFirstPartyTypeKind;
10869
+ (function(ZodFirstPartyTypeKind$1) {})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
10530
10870
 
10531
10871
  //#endregion
10532
- //#region ../../node_modules/zod/dist/esm/v4/classic/coerce.js
10872
+ //#region ../../node_modules/zod/v4/classic/coerce.js
10533
10873
  var coerce_exports = {};
10534
10874
  __export(coerce_exports, {
10535
10875
  bigint: () => bigint,
@@ -10555,13 +10895,14 @@ function date(params) {
10555
10895
  }
10556
10896
 
10557
10897
  //#endregion
10558
- //#region ../../node_modules/zod/dist/esm/v4/classic/external.js
10898
+ //#region ../../node_modules/zod/v4/classic/external.js
10559
10899
  var external_exports = {};
10560
10900
  __export(external_exports, {
10561
10901
  $brand: () => $brand,
10562
10902
  $input: () => $input,
10563
10903
  $output: () => $output,
10564
10904
  NEVER: () => NEVER,
10905
+ TimePrecision: () => TimePrecision,
10565
10906
  ZodAny: () => ZodAny,
10566
10907
  ZodArray: () => ZodArray,
10567
10908
  ZodBase64: () => ZodBase64,
@@ -10575,6 +10916,7 @@ __export(external_exports, {
10575
10916
  ZodCUID2: () => ZodCUID2,
10576
10917
  ZodCatch: () => ZodCatch,
10577
10918
  ZodCustom: () => ZodCustom,
10919
+ ZodCustomStringFormat: () => ZodCustomStringFormat,
10578
10920
  ZodDate: () => ZodDate,
10579
10921
  ZodDefault: () => ZodDefault,
10580
10922
  ZodDiscriminatedUnion: () => ZodDiscriminatedUnion,
@@ -10584,6 +10926,7 @@ __export(external_exports, {
10584
10926
  ZodEnum: () => ZodEnum,
10585
10927
  ZodError: () => ZodError,
10586
10928
  ZodFile: () => ZodFile,
10929
+ ZodFirstPartyTypeKind: () => ZodFirstPartyTypeKind,
10587
10930
  ZodGUID: () => ZodGUID,
10588
10931
  ZodIPv4: () => ZodIPv4,
10589
10932
  ZodIPv6: () => ZodIPv6,
@@ -10736,6 +11079,7 @@ __export(external_exports, {
10736
11079
  startsWith: () => _startsWith,
10737
11080
  strictObject: () => strictObject,
10738
11081
  string: () => string$1,
11082
+ stringFormat: () => stringFormat,
10739
11083
  stringbool: () => stringbool,
10740
11084
  success: () => success,
10741
11085
  superRefine: () => superRefine,
@@ -10766,11 +11110,11 @@ __export(external_exports, {
10766
11110
  config(en_default());
10767
11111
 
10768
11112
  //#endregion
10769
- //#region ../../node_modules/zod/dist/esm/v4/classic/index.js
11113
+ //#region ../../node_modules/zod/v4/classic/index.js
10770
11114
  var classic_default = external_exports;
10771
11115
 
10772
11116
  //#endregion
10773
- //#region ../../node_modules/zod/dist/esm/v4/index.js
11117
+ //#region ../../node_modules/zod/v4/index.js
10774
11118
  var v4_default = classic_default;
10775
11119
 
10776
11120
  //#endregion
@@ -10791,12 +11135,12 @@ var v4_default = classic_default;
10791
11135
  function validate(schema, value) {
10792
11136
  try {
10793
11137
  return schema.parse(value);
10794
- } catch (error$37) {
10795
- if (error$37 instanceof ZodError) {
10796
- const formattedErrors = error$37.issues.map((err) => `- ${err.path.join(".")}: ${err.message}`).join("\n");
10797
- throw new Error(`Validation error${error$37.issues.length > 1 ? "s" : ""}:\n${formattedErrors}`);
11138
+ } catch (error$39) {
11139
+ if (error$39 instanceof ZodError) {
11140
+ const formattedErrors = error$39.issues.map((err) => `- ${err.path.join(".")}: ${err.message}`).join("\n");
11141
+ throw new Error(`Validation error${error$39.issues.length > 1 ? "s" : ""}:\n${formattedErrors}`);
10798
11142
  }
10799
- throw error$37;
11143
+ throw error$39;
10800
11144
  }
10801
11145
  }
10802
11146