@sit-onyx/modelcontextprotocol 0.1.0 → 0.1.1-dev-20260622141700

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3,7 +3,6 @@ import { createRequire } from "node:module";
3
3
  import { error, log } from "node:console";
4
4
  import { parseArgs } from "node:util";
5
5
  import { StreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/streamableHttp.js";
6
- import { randomUUID } from "node:crypto";
7
6
  import { createServer as createServer$1 } from "node:http";
8
7
  import { McpServer, ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js";
9
8
  import { Readable } from "node:stream";
@@ -19,7 +18,7 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
19
18
  var __getProtoOf = Object.getPrototypeOf;
20
19
  var __hasOwnProp = Object.prototype.hasOwnProperty;
21
20
  var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
22
- var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
21
+ var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
23
22
  var __exportAll = (all, no_symbols) => {
24
23
  let target = {};
25
24
  for (var name in all) __defProp(target, name, {
@@ -75,12 +74,12 @@ var package_default = {
75
74
  "@types/node": "catalog:",
76
75
  "@types/tar-stream": "^3.1.4",
77
76
  "query-registry": "^4.3.0",
78
- "tar-stream": "^3.1.8",
77
+ "tar-stream": "^3.2.0",
79
78
  "typescript": "catalog:",
79
+ "unplugin-dts": "catalog:",
80
80
  "vite": "catalog:",
81
- "vite-plugin-dts": "^4.5.4",
82
- "vue-component-meta": "^3.2.6",
83
- "zod": "^4.3.6"
81
+ "vue-component-meta": "catalog:",
82
+ "zod": "^4.4.3"
84
83
  },
85
84
  engines: { "node": ">=20" }
86
85
  };
@@ -90,10 +89,17 @@ var package_default = {
90
89
  * MCP server running as a http server.
91
90
  * `HOST` and `PORT` environment variable can be used to change the server settings.
92
91
  */
93
- var run = async (server) => {
94
- const transport = new StreamableHTTPServerTransport({ sessionIdGenerator: () => randomUUID() });
95
- await server.connect(transport);
96
- const httpServer = createServer$1((req, res) => transport.handleRequest(req, res));
92
+ var run = async (getServer) => {
93
+ const httpServer = createServer$1(async (req, res) => {
94
+ const server = getServer();
95
+ const transport = new StreamableHTTPServerTransport();
96
+ res.on("close", () => {
97
+ transport.close();
98
+ server.close();
99
+ });
100
+ await server.connect(transport);
101
+ await transport.handleRequest(req, res);
102
+ });
97
103
  const PORT = Number.parseInt(process.env["PORT"] ?? "3000");
98
104
  const HOST = process.env["HOST"] ?? "0.0.0.0";
99
105
  httpServer.listen(PORT, HOST);
@@ -123,7 +129,9 @@ var cached$1 = (func) => {
123
129
  return cache.get(cacheKey);
124
130
  };
125
131
  };
126
- Object.freeze({ status: "aborted" });
132
+ //#endregion
133
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
134
+ var _a$1;
127
135
  function $constructor(name, initializer, params) {
128
136
  function init(inst, def) {
129
137
  if (!inst._zod) Object.defineProperty(inst, "_zod", {
@@ -174,13 +182,14 @@ var $ZodEncodeError = class extends Error {
174
182
  this.name = "ZodEncodeError";
175
183
  }
176
184
  };
177
- var globalConfig = {};
185
+ (_a$1 = globalThis).__zod_globalConfig ?? (_a$1.__zod_globalConfig = {});
186
+ var globalConfig = globalThis.__zod_globalConfig;
178
187
  function config(newConfig) {
179
188
  if (newConfig) Object.assign(globalConfig, newConfig);
180
189
  return globalConfig;
181
190
  }
182
191
  //#endregion
183
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/util.js
192
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js
184
193
  function getEnumValues(entries) {
185
194
  const numericValues = Object.values(entries).filter((v) => typeof v === "number");
186
195
  return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
@@ -208,17 +217,13 @@ function cleanRegex(source) {
208
217
  return source.slice(start, end);
209
218
  }
210
219
  function floatSafeRemainder(val, step) {
211
- const valDecCount = (val.toString().split(".")[1] || "").length;
212
- const stepString = step.toString();
213
- let stepDecCount = (stepString.split(".")[1] || "").length;
214
- if (stepDecCount === 0 && /\d?e-\d?/.test(stepString)) {
215
- const match = stepString.match(/\d?e-(\d?)/);
216
- if (match?.[1]) stepDecCount = Number.parseInt(match[1]);
217
- }
218
- const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
219
- return Number.parseInt(val.toFixed(decCount).replace(".", "")) % Number.parseInt(step.toFixed(decCount).replace(".", "")) / 10 ** decCount;
220
+ const ratio = val / step;
221
+ const roundedRatio = Math.round(ratio);
222
+ const tolerance = Number.EPSILON * Math.max(Math.abs(ratio), 1);
223
+ if (Math.abs(ratio - roundedRatio) < tolerance) return 0;
224
+ return ratio - roundedRatio;
220
225
  }
221
- var EVALUATING = Symbol("evaluating");
226
+ var EVALUATING = /* @__PURE__*/ Symbol("evaluating");
222
227
  function defineLazy(object, key, getter) {
223
228
  let value = void 0;
224
229
  Object.defineProperty(object, key, {
@@ -259,7 +264,8 @@ var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace :
259
264
  function isObject(data) {
260
265
  return typeof data === "object" && data !== null && !Array.isArray(data);
261
266
  }
262
- var allowsEval = cached(() => {
267
+ var allowsEval = /* @__PURE__*/ cached(() => {
268
+ if (globalConfig.jitless) return false;
263
269
  if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) return false;
264
270
  try {
265
271
  new Function("");
@@ -281,9 +287,11 @@ function isPlainObject(o) {
281
287
  function shallowClone(o) {
282
288
  if (isPlainObject(o)) return { ...o };
283
289
  if (Array.isArray(o)) return [...o];
290
+ if (o instanceof Map) return new Map(o);
291
+ if (o instanceof Set) return new Set(o);
284
292
  return o;
285
293
  }
286
- var propertyKeyTypes = new Set([
294
+ var propertyKeyTypes = /* @__PURE__*/ new Set([
287
295
  "string",
288
296
  "number",
289
297
  "symbol"
@@ -387,6 +395,7 @@ function safeExtend(schema, shape) {
387
395
  } }));
388
396
  }
389
397
  function merge(a, b) {
398
+ if (a._zod.def.checks?.length) throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
390
399
  return clone(a, mergeDefs(a._zod.def, {
391
400
  get shape() {
392
401
  const _shape = {
@@ -399,7 +408,7 @@ function merge(a, b) {
399
408
  get catchall() {
400
409
  return b._zod.def.catchall;
401
410
  },
402
- checks: []
411
+ checks: b._zod.def.checks ?? []
403
412
  }));
404
413
  }
405
414
  function partial(Class, schema, mask) {
@@ -452,6 +461,11 @@ function aborted(x, startIndex = 0) {
452
461
  for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue !== true) return true;
453
462
  return false;
454
463
  }
464
+ function explicitlyAborted(x, startIndex = 0) {
465
+ if (x.aborted === true) return true;
466
+ for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue === false) return true;
467
+ return false;
468
+ }
455
469
  function prefixIssues(path, issues) {
456
470
  return issues.map((iss) => {
457
471
  var _a;
@@ -464,15 +478,12 @@ function unwrapMessage(message) {
464
478
  return typeof message === "string" ? message : message?.message;
465
479
  }
466
480
  function finalizeIssue(iss, ctx, config) {
467
- const full = {
468
- ...iss,
469
- path: iss.path ?? []
470
- };
471
- if (!iss.message) full.message = unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input";
472
- delete full.inst;
473
- delete full.continue;
474
- if (!ctx?.reportInput) delete full.input;
475
- return full;
481
+ const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input";
482
+ const { inst: _inst, continue: _continue, input: _input, ...rest } = iss;
483
+ rest.path ?? (rest.path = []);
484
+ rest.message = message;
485
+ if (ctx?.reportInput) rest.input = _input;
486
+ return rest;
476
487
  }
477
488
  function getLengthableOrigin(input) {
478
489
  if (Array.isArray(input)) return "array";
@@ -490,7 +501,7 @@ function issue(...args) {
490
501
  return { ...iss };
491
502
  }
492
503
  //#endregion
493
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/errors.js
504
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.js
494
505
  var initializer$1 = (inst, def) => {
495
506
  inst.name = "$ZodError";
496
507
  Object.defineProperty(inst, "_zod", {
@@ -523,23 +534,26 @@ function flattenError(error, mapper = (issue) => issue.message) {
523
534
  }
524
535
  function formatError(error, mapper = (issue) => issue.message) {
525
536
  const fieldErrors = { _errors: [] };
526
- const processError = (error) => {
527
- for (const issue of error.issues) if (issue.code === "invalid_union" && issue.errors.length) issue.errors.map((issues) => processError({ issues }));
528
- else if (issue.code === "invalid_key") processError({ issues: issue.issues });
529
- else if (issue.code === "invalid_element") processError({ issues: issue.issues });
530
- else if (issue.path.length === 0) fieldErrors._errors.push(mapper(issue));
537
+ const processError = (error, path = []) => {
538
+ for (const issue of error.issues) if (issue.code === "invalid_union" && issue.errors.length) issue.errors.map((issues) => processError({ issues }, [...path, ...issue.path]));
539
+ else if (issue.code === "invalid_key") processError({ issues: issue.issues }, [...path, ...issue.path]);
540
+ else if (issue.code === "invalid_element") processError({ issues: issue.issues }, [...path, ...issue.path]);
531
541
  else {
532
- let curr = fieldErrors;
533
- let i = 0;
534
- while (i < issue.path.length) {
535
- const el = issue.path[i];
536
- if (!(i === issue.path.length - 1)) curr[el] = curr[el] || { _errors: [] };
537
- else {
538
- curr[el] = curr[el] || { _errors: [] };
539
- curr[el]._errors.push(mapper(issue));
542
+ const fullpath = [...path, ...issue.path];
543
+ if (fullpath.length === 0) fieldErrors._errors.push(mapper(issue));
544
+ else {
545
+ let curr = fieldErrors;
546
+ let i = 0;
547
+ while (i < fullpath.length) {
548
+ const el = fullpath[i];
549
+ if (!(i === fullpath.length - 1)) curr[el] = curr[el] || { _errors: [] };
550
+ else {
551
+ curr[el] = curr[el] || { _errors: [] };
552
+ curr[el]._errors.push(mapper(issue));
553
+ }
554
+ curr = curr[el];
555
+ i++;
540
556
  }
541
- curr = curr[el];
542
- i++;
543
557
  }
544
558
  }
545
559
  };
@@ -547,9 +561,12 @@ function formatError(error, mapper = (issue) => issue.message) {
547
561
  return fieldErrors;
548
562
  }
549
563
  //#endregion
550
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/parse.js
564
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/parse.js
551
565
  var _parse = (_Err) => (schema, value, _ctx, _params) => {
552
- const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
566
+ const ctx = _ctx ? {
567
+ ..._ctx,
568
+ async: false
569
+ } : { async: false };
553
570
  const result = schema._zod.run({
554
571
  value,
555
572
  issues: []
@@ -562,9 +579,12 @@ var _parse = (_Err) => (schema, value, _ctx, _params) => {
562
579
  }
563
580
  return result.value;
564
581
  };
565
- var parse$1 = /* @__PURE__ */ _parse($ZodRealError);
582
+ var parse$1 = /* @__PURE__*/ _parse($ZodRealError);
566
583
  var _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
567
- const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
584
+ const ctx = _ctx ? {
585
+ ..._ctx,
586
+ async: true
587
+ } : { async: true };
568
588
  let result = schema._zod.run({
569
589
  value,
570
590
  issues: []
@@ -577,7 +597,7 @@ var _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
577
597
  }
578
598
  return result.value;
579
599
  };
580
- var parseAsync$1 = /* @__PURE__ */ _parseAsync($ZodRealError);
600
+ var parseAsync$1 = /* @__PURE__*/ _parseAsync($ZodRealError);
581
601
  var _safeParse = (_Err) => (schema, value, _ctx) => {
582
602
  const ctx = _ctx ? {
583
603
  ..._ctx,
@@ -596,9 +616,12 @@ var _safeParse = (_Err) => (schema, value, _ctx) => {
596
616
  data: result.value
597
617
  };
598
618
  };
599
- var safeParse$1 = /* @__PURE__ */ _safeParse($ZodRealError);
619
+ var safeParse$1 = /* @__PURE__*/ _safeParse($ZodRealError);
600
620
  var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
601
- const ctx = _ctx ? Object.assign(_ctx, { async: true }) : { async: true };
621
+ const ctx = _ctx ? {
622
+ ..._ctx,
623
+ async: true
624
+ } : { async: true };
602
625
  let result = schema._zod.run({
603
626
  value,
604
627
  issues: []
@@ -612,38 +635,55 @@ var _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
612
635
  data: result.value
613
636
  };
614
637
  };
615
- var safeParseAsync$1 = /* @__PURE__ */ _safeParseAsync($ZodRealError);
638
+ var safeParseAsync$1 = /* @__PURE__*/ _safeParseAsync($ZodRealError);
616
639
  var _encode = (_Err) => (schema, value, _ctx) => {
617
- const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
640
+ const ctx = _ctx ? {
641
+ ..._ctx,
642
+ direction: "backward"
643
+ } : { direction: "backward" };
618
644
  return _parse(_Err)(schema, value, ctx);
619
645
  };
620
646
  var _decode = (_Err) => (schema, value, _ctx) => {
621
647
  return _parse(_Err)(schema, value, _ctx);
622
648
  };
623
649
  var _encodeAsync = (_Err) => async (schema, value, _ctx) => {
624
- const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
650
+ const ctx = _ctx ? {
651
+ ..._ctx,
652
+ direction: "backward"
653
+ } : { direction: "backward" };
625
654
  return _parseAsync(_Err)(schema, value, ctx);
626
655
  };
627
656
  var _decodeAsync = (_Err) => async (schema, value, _ctx) => {
628
657
  return _parseAsync(_Err)(schema, value, _ctx);
629
658
  };
630
659
  var _safeEncode = (_Err) => (schema, value, _ctx) => {
631
- const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
660
+ const ctx = _ctx ? {
661
+ ..._ctx,
662
+ direction: "backward"
663
+ } : { direction: "backward" };
632
664
  return _safeParse(_Err)(schema, value, ctx);
633
665
  };
634
666
  var _safeDecode = (_Err) => (schema, value, _ctx) => {
635
667
  return _safeParse(_Err)(schema, value, _ctx);
636
668
  };
637
669
  var _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
638
- const ctx = _ctx ? Object.assign(_ctx, { direction: "backward" }) : { direction: "backward" };
670
+ const ctx = _ctx ? {
671
+ ..._ctx,
672
+ direction: "backward"
673
+ } : { direction: "backward" };
639
674
  return _safeParseAsync(_Err)(schema, value, ctx);
640
675
  };
641
676
  var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
642
677
  return _safeParseAsync(_Err)(schema, value, _ctx);
643
678
  };
644
679
  //#endregion
645
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/regexes.js
646
- var cuid = /^[cC][^\s-]{8,}$/;
680
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/regexes.js
681
+ /**
682
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
683
+ * (timestamps embedded in the id). Use {@link cuid2} instead.
684
+ * See https://github.com/paralleldrive/cuid.
685
+ */
686
+ var cuid = /^[cC][0-9a-z]{6,}$/;
647
687
  var cuid2 = /^[0-9a-z]+$/;
648
688
  var ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
649
689
  var xid = /^[0-9a-vA-V]{20}$/;
@@ -672,9 +712,10 @@ var cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]
672
712
  var cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
673
713
  var base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
674
714
  var base64url = /^[A-Za-z0-9_-]*$/;
715
+ var httpProtocol = /^https?$/;
675
716
  var e164 = /^\+[1-9]\d{6,14}$/;
676
717
  var dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
677
- var date$1 = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
718
+ var date$1 = /*@__PURE__*/ new RegExp(`^${dateSource}$`);
678
719
  function timeSource(args) {
679
720
  const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
680
721
  return typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
@@ -701,8 +742,8 @@ var _null$2 = /^null$/i;
701
742
  var lowercase = /^[^A-Z]*$/;
702
743
  var uppercase = /^[^a-z]*$/;
703
744
  //#endregion
704
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/checks.js
705
- var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
745
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/checks.js
746
+ var $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
706
747
  var _a;
707
748
  inst._zod ?? (inst._zod = {});
708
749
  inst._zod.def = def;
@@ -713,7 +754,7 @@ var numericOriginMap = {
713
754
  bigint: "bigint",
714
755
  object: "date"
715
756
  };
716
- var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst, def) => {
757
+ var $ZodCheckLessThan = /*@__PURE__*/ $constructor("$ZodCheckLessThan", (inst, def) => {
717
758
  $ZodCheck.init(inst, def);
718
759
  const origin = numericOriginMap[typeof def.value];
719
760
  inst._zod.onattach.push((inst) => {
@@ -735,7 +776,7 @@ var $ZodCheckLessThan = /* @__PURE__ */ $constructor("$ZodCheckLessThan", (inst,
735
776
  });
736
777
  };
737
778
  });
738
- var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan", (inst, def) => {
779
+ var $ZodCheckGreaterThan = /*@__PURE__*/ $constructor("$ZodCheckGreaterThan", (inst, def) => {
739
780
  $ZodCheck.init(inst, def);
740
781
  const origin = numericOriginMap[typeof def.value];
741
782
  inst._zod.onattach.push((inst) => {
@@ -757,7 +798,7 @@ var $ZodCheckGreaterThan = /* @__PURE__ */ $constructor("$ZodCheckGreaterThan",
757
798
  });
758
799
  };
759
800
  });
760
- var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (inst, def) => {
801
+ var $ZodCheckMultipleOf = /*@__PURE__*/ $constructor("$ZodCheckMultipleOf", (inst, def) => {
761
802
  $ZodCheck.init(inst, def);
762
803
  inst._zod.onattach.push((inst) => {
763
804
  var _a;
@@ -776,7 +817,7 @@ var $ZodCheckMultipleOf = /* @__PURE__ */ $constructor("$ZodCheckMultipleOf", (i
776
817
  });
777
818
  };
778
819
  });
779
- var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat", (inst, def) => {
820
+ var $ZodCheckNumberFormat = /*@__PURE__*/ $constructor("$ZodCheckNumberFormat", (inst, def) => {
780
821
  $ZodCheck.init(inst, def);
781
822
  def.format = def.format || "float64";
782
823
  const isInt = def.format?.includes("int");
@@ -847,7 +888,7 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
847
888
  });
848
889
  };
849
890
  });
850
- var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (inst, def) => {
891
+ var $ZodCheckMaxLength = /*@__PURE__*/ $constructor("$ZodCheckMaxLength", (inst, def) => {
851
892
  var _a;
852
893
  $ZodCheck.init(inst, def);
853
894
  (_a = inst._zod.def).when ?? (_a.when = (payload) => {
@@ -873,7 +914,7 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
873
914
  });
874
915
  };
875
916
  });
876
- var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (inst, def) => {
917
+ var $ZodCheckMinLength = /*@__PURE__*/ $constructor("$ZodCheckMinLength", (inst, def) => {
877
918
  var _a;
878
919
  $ZodCheck.init(inst, def);
879
920
  (_a = inst._zod.def).when ?? (_a.when = (payload) => {
@@ -899,7 +940,7 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
899
940
  });
900
941
  };
901
942
  });
902
- var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals", (inst, def) => {
943
+ var $ZodCheckLengthEquals = /*@__PURE__*/ $constructor("$ZodCheckLengthEquals", (inst, def) => {
903
944
  var _a;
904
945
  $ZodCheck.init(inst, def);
905
946
  (_a = inst._zod.def).when ?? (_a.when = (payload) => {
@@ -935,7 +976,7 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
935
976
  });
936
977
  };
937
978
  });
938
- var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat", (inst, def) => {
979
+ var $ZodCheckStringFormat = /*@__PURE__*/ $constructor("$ZodCheckStringFormat", (inst, def) => {
939
980
  var _a, _b;
940
981
  $ZodCheck.init(inst, def);
941
982
  inst._zod.onattach.push((inst) => {
@@ -961,7 +1002,7 @@ var $ZodCheckStringFormat = /* @__PURE__ */ $constructor("$ZodCheckStringFormat"
961
1002
  });
962
1003
  else (_b = inst._zod).check ?? (_b.check = () => {});
963
1004
  });
964
- var $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def) => {
1005
+ var $ZodCheckRegex = /*@__PURE__*/ $constructor("$ZodCheckRegex", (inst, def) => {
965
1006
  $ZodCheckStringFormat.init(inst, def);
966
1007
  inst._zod.check = (payload) => {
967
1008
  def.pattern.lastIndex = 0;
@@ -977,15 +1018,15 @@ var $ZodCheckRegex = /* @__PURE__ */ $constructor("$ZodCheckRegex", (inst, def)
977
1018
  });
978
1019
  };
979
1020
  });
980
- var $ZodCheckLowerCase = /* @__PURE__ */ $constructor("$ZodCheckLowerCase", (inst, def) => {
1021
+ var $ZodCheckLowerCase = /*@__PURE__*/ $constructor("$ZodCheckLowerCase", (inst, def) => {
981
1022
  def.pattern ?? (def.pattern = lowercase);
982
1023
  $ZodCheckStringFormat.init(inst, def);
983
1024
  });
984
- var $ZodCheckUpperCase = /* @__PURE__ */ $constructor("$ZodCheckUpperCase", (inst, def) => {
1025
+ var $ZodCheckUpperCase = /*@__PURE__*/ $constructor("$ZodCheckUpperCase", (inst, def) => {
985
1026
  def.pattern ?? (def.pattern = uppercase);
986
1027
  $ZodCheckStringFormat.init(inst, def);
987
1028
  });
988
- var $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst, def) => {
1029
+ var $ZodCheckIncludes = /*@__PURE__*/ $constructor("$ZodCheckIncludes", (inst, def) => {
989
1030
  $ZodCheck.init(inst, def);
990
1031
  const escapedRegex = escapeRegex(def.includes);
991
1032
  const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);
@@ -1008,7 +1049,7 @@ var $ZodCheckIncludes = /* @__PURE__ */ $constructor("$ZodCheckIncludes", (inst,
1008
1049
  });
1009
1050
  };
1010
1051
  });
1011
- var $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (inst, def) => {
1052
+ var $ZodCheckStartsWith = /*@__PURE__*/ $constructor("$ZodCheckStartsWith", (inst, def) => {
1012
1053
  $ZodCheck.init(inst, def);
1013
1054
  const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
1014
1055
  def.pattern ?? (def.pattern = pattern);
@@ -1030,7 +1071,7 @@ var $ZodCheckStartsWith = /* @__PURE__ */ $constructor("$ZodCheckStartsWith", (i
1030
1071
  });
1031
1072
  };
1032
1073
  });
1033
- var $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst, def) => {
1074
+ var $ZodCheckEndsWith = /*@__PURE__*/ $constructor("$ZodCheckEndsWith", (inst, def) => {
1034
1075
  $ZodCheck.init(inst, def);
1035
1076
  const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
1036
1077
  def.pattern ?? (def.pattern = pattern);
@@ -1052,14 +1093,14 @@ var $ZodCheckEndsWith = /* @__PURE__ */ $constructor("$ZodCheckEndsWith", (inst,
1052
1093
  });
1053
1094
  };
1054
1095
  });
1055
- var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (inst, def) => {
1096
+ var $ZodCheckOverwrite = /*@__PURE__*/ $constructor("$ZodCheckOverwrite", (inst, def) => {
1056
1097
  $ZodCheck.init(inst, def);
1057
1098
  inst._zod.check = (payload) => {
1058
1099
  payload.value = def.tx(payload.value);
1059
1100
  };
1060
1101
  });
1061
1102
  //#endregion
1062
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/doc.js
1103
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/doc.js
1063
1104
  var Doc = class {
1064
1105
  constructor(args = []) {
1065
1106
  this.content = [];
@@ -1090,15 +1131,15 @@ var Doc = class {
1090
1131
  }
1091
1132
  };
1092
1133
  //#endregion
1093
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/versions.js
1134
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/versions.js
1094
1135
  var version$1 = {
1095
1136
  major: 4,
1096
- minor: 3,
1097
- patch: 6
1137
+ minor: 4,
1138
+ patch: 3
1098
1139
  };
1099
1140
  //#endregion
1100
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/schemas.js
1101
- var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1141
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/schemas.js
1142
+ var $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
1102
1143
  var _a;
1103
1144
  inst ?? (inst = {});
1104
1145
  inst._zod.def = def;
@@ -1118,6 +1159,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1118
1159
  let asyncResult;
1119
1160
  for (const ch of checks) {
1120
1161
  if (ch._zod.def.when) {
1162
+ if (explicitlyAborted(payload)) continue;
1121
1163
  if (!ch._zod.def.when(payload)) continue;
1122
1164
  } else if (isAborted) continue;
1123
1165
  const currLen = payload.issues.length;
@@ -1186,7 +1228,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
1186
1228
  version: 1
1187
1229
  }));
1188
1230
  });
1189
- var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
1231
+ var $ZodString = /*@__PURE__*/ $constructor("$ZodString", (inst, def) => {
1190
1232
  $ZodType.init(inst, def);
1191
1233
  inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$2(inst._zod.bag);
1192
1234
  inst._zod.parse = (payload, _) => {
@@ -1203,15 +1245,15 @@ var $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
1203
1245
  return payload;
1204
1246
  };
1205
1247
  });
1206
- var $ZodStringFormat = /* @__PURE__ */ $constructor("$ZodStringFormat", (inst, def) => {
1248
+ var $ZodStringFormat = /*@__PURE__*/ $constructor("$ZodStringFormat", (inst, def) => {
1207
1249
  $ZodCheckStringFormat.init(inst, def);
1208
1250
  $ZodString.init(inst, def);
1209
1251
  });
1210
- var $ZodGUID = /* @__PURE__ */ $constructor("$ZodGUID", (inst, def) => {
1252
+ var $ZodGUID = /*@__PURE__*/ $constructor("$ZodGUID", (inst, def) => {
1211
1253
  def.pattern ?? (def.pattern = guid);
1212
1254
  $ZodStringFormat.init(inst, def);
1213
1255
  });
1214
- var $ZodUUID = /* @__PURE__ */ $constructor("$ZodUUID", (inst, def) => {
1256
+ var $ZodUUID = /*@__PURE__*/ $constructor("$ZodUUID", (inst, def) => {
1215
1257
  if (def.version) {
1216
1258
  const v = {
1217
1259
  v1: 1,
@@ -1228,15 +1270,28 @@ var $ZodUUID = /* @__PURE__ */ $constructor("$ZodUUID", (inst, def) => {
1228
1270
  } else def.pattern ?? (def.pattern = uuid());
1229
1271
  $ZodStringFormat.init(inst, def);
1230
1272
  });
1231
- var $ZodEmail = /* @__PURE__ */ $constructor("$ZodEmail", (inst, def) => {
1273
+ var $ZodEmail = /*@__PURE__*/ $constructor("$ZodEmail", (inst, def) => {
1232
1274
  def.pattern ?? (def.pattern = email);
1233
1275
  $ZodStringFormat.init(inst, def);
1234
1276
  });
1235
- var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
1277
+ var $ZodURL = /*@__PURE__*/ $constructor("$ZodURL", (inst, def) => {
1236
1278
  $ZodStringFormat.init(inst, def);
1237
1279
  inst._zod.check = (payload) => {
1238
1280
  try {
1239
1281
  const trimmed = payload.value.trim();
1282
+ if (!def.normalize && def.protocol?.source === httpProtocol.source) {
1283
+ if (!/^https?:\/\//i.test(trimmed)) {
1284
+ payload.issues.push({
1285
+ code: "invalid_format",
1286
+ format: "url",
1287
+ note: "Invalid URL format",
1288
+ input: payload.value,
1289
+ inst,
1290
+ continue: !def.abort
1291
+ });
1292
+ return;
1293
+ }
1294
+ }
1240
1295
  const url = new URL(trimmed);
1241
1296
  if (def.hostname) {
1242
1297
  def.hostname.lastIndex = 0;
@@ -1276,56 +1331,61 @@ var $ZodURL = /* @__PURE__ */ $constructor("$ZodURL", (inst, def) => {
1276
1331
  }
1277
1332
  };
1278
1333
  });
1279
- var $ZodEmoji = /* @__PURE__ */ $constructor("$ZodEmoji", (inst, def) => {
1334
+ var $ZodEmoji = /*@__PURE__*/ $constructor("$ZodEmoji", (inst, def) => {
1280
1335
  def.pattern ?? (def.pattern = emoji());
1281
1336
  $ZodStringFormat.init(inst, def);
1282
1337
  });
1283
- var $ZodNanoID = /* @__PURE__ */ $constructor("$ZodNanoID", (inst, def) => {
1338
+ var $ZodNanoID = /*@__PURE__*/ $constructor("$ZodNanoID", (inst, def) => {
1284
1339
  def.pattern ?? (def.pattern = nanoid);
1285
1340
  $ZodStringFormat.init(inst, def);
1286
1341
  });
1287
- var $ZodCUID = /* @__PURE__ */ $constructor("$ZodCUID", (inst, def) => {
1342
+ /**
1343
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
1344
+ * (timestamps embedded in the id). Use {@link $ZodCUID2} instead.
1345
+ * See https://github.com/paralleldrive/cuid.
1346
+ */
1347
+ var $ZodCUID = /*@__PURE__*/ $constructor("$ZodCUID", (inst, def) => {
1288
1348
  def.pattern ?? (def.pattern = cuid);
1289
1349
  $ZodStringFormat.init(inst, def);
1290
1350
  });
1291
- var $ZodCUID2 = /* @__PURE__ */ $constructor("$ZodCUID2", (inst, def) => {
1351
+ var $ZodCUID2 = /*@__PURE__*/ $constructor("$ZodCUID2", (inst, def) => {
1292
1352
  def.pattern ?? (def.pattern = cuid2);
1293
1353
  $ZodStringFormat.init(inst, def);
1294
1354
  });
1295
- var $ZodULID = /* @__PURE__ */ $constructor("$ZodULID", (inst, def) => {
1355
+ var $ZodULID = /*@__PURE__*/ $constructor("$ZodULID", (inst, def) => {
1296
1356
  def.pattern ?? (def.pattern = ulid);
1297
1357
  $ZodStringFormat.init(inst, def);
1298
1358
  });
1299
- var $ZodXID = /* @__PURE__ */ $constructor("$ZodXID", (inst, def) => {
1359
+ var $ZodXID = /*@__PURE__*/ $constructor("$ZodXID", (inst, def) => {
1300
1360
  def.pattern ?? (def.pattern = xid);
1301
1361
  $ZodStringFormat.init(inst, def);
1302
1362
  });
1303
- var $ZodKSUID = /* @__PURE__ */ $constructor("$ZodKSUID", (inst, def) => {
1363
+ var $ZodKSUID = /*@__PURE__*/ $constructor("$ZodKSUID", (inst, def) => {
1304
1364
  def.pattern ?? (def.pattern = ksuid);
1305
1365
  $ZodStringFormat.init(inst, def);
1306
1366
  });
1307
- var $ZodISODateTime = /* @__PURE__ */ $constructor("$ZodISODateTime", (inst, def) => {
1367
+ var $ZodISODateTime = /*@__PURE__*/ $constructor("$ZodISODateTime", (inst, def) => {
1308
1368
  def.pattern ?? (def.pattern = datetime$1(def));
1309
1369
  $ZodStringFormat.init(inst, def);
1310
1370
  });
1311
- var $ZodISODate = /* @__PURE__ */ $constructor("$ZodISODate", (inst, def) => {
1371
+ var $ZodISODate = /*@__PURE__*/ $constructor("$ZodISODate", (inst, def) => {
1312
1372
  def.pattern ?? (def.pattern = date$1);
1313
1373
  $ZodStringFormat.init(inst, def);
1314
1374
  });
1315
- var $ZodISOTime = /* @__PURE__ */ $constructor("$ZodISOTime", (inst, def) => {
1375
+ var $ZodISOTime = /*@__PURE__*/ $constructor("$ZodISOTime", (inst, def) => {
1316
1376
  def.pattern ?? (def.pattern = time$1(def));
1317
1377
  $ZodStringFormat.init(inst, def);
1318
1378
  });
1319
- var $ZodISODuration = /* @__PURE__ */ $constructor("$ZodISODuration", (inst, def) => {
1379
+ var $ZodISODuration = /*@__PURE__*/ $constructor("$ZodISODuration", (inst, def) => {
1320
1380
  def.pattern ?? (def.pattern = duration$1);
1321
1381
  $ZodStringFormat.init(inst, def);
1322
1382
  });
1323
- var $ZodIPv4 = /* @__PURE__ */ $constructor("$ZodIPv4", (inst, def) => {
1383
+ var $ZodIPv4 = /*@__PURE__*/ $constructor("$ZodIPv4", (inst, def) => {
1324
1384
  def.pattern ?? (def.pattern = ipv4);
1325
1385
  $ZodStringFormat.init(inst, def);
1326
1386
  inst._zod.bag.format = `ipv4`;
1327
1387
  });
1328
- var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
1388
+ var $ZodIPv6 = /*@__PURE__*/ $constructor("$ZodIPv6", (inst, def) => {
1329
1389
  def.pattern ?? (def.pattern = ipv6);
1330
1390
  $ZodStringFormat.init(inst, def);
1331
1391
  inst._zod.bag.format = `ipv6`;
@@ -1343,11 +1403,11 @@ var $ZodIPv6 = /* @__PURE__ */ $constructor("$ZodIPv6", (inst, def) => {
1343
1403
  }
1344
1404
  };
1345
1405
  });
1346
- var $ZodCIDRv4 = /* @__PURE__ */ $constructor("$ZodCIDRv4", (inst, def) => {
1406
+ var $ZodCIDRv4 = /*@__PURE__*/ $constructor("$ZodCIDRv4", (inst, def) => {
1347
1407
  def.pattern ?? (def.pattern = cidrv4);
1348
1408
  $ZodStringFormat.init(inst, def);
1349
1409
  });
1350
- var $ZodCIDRv6 = /* @__PURE__ */ $constructor("$ZodCIDRv6", (inst, def) => {
1410
+ var $ZodCIDRv6 = /*@__PURE__*/ $constructor("$ZodCIDRv6", (inst, def) => {
1351
1411
  def.pattern ?? (def.pattern = cidrv6);
1352
1412
  $ZodStringFormat.init(inst, def);
1353
1413
  inst._zod.check = (payload) => {
@@ -1373,6 +1433,7 @@ var $ZodCIDRv6 = /* @__PURE__ */ $constructor("$ZodCIDRv6", (inst, def) => {
1373
1433
  });
1374
1434
  function isValidBase64(data) {
1375
1435
  if (data === "") return true;
1436
+ if (/\s/.test(data)) return false;
1376
1437
  if (data.length % 4 !== 0) return false;
1377
1438
  try {
1378
1439
  atob(data);
@@ -1381,7 +1442,7 @@ function isValidBase64(data) {
1381
1442
  return false;
1382
1443
  }
1383
1444
  }
1384
- var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
1445
+ var $ZodBase64 = /*@__PURE__*/ $constructor("$ZodBase64", (inst, def) => {
1385
1446
  def.pattern ?? (def.pattern = base64);
1386
1447
  $ZodStringFormat.init(inst, def);
1387
1448
  inst._zod.bag.contentEncoding = "base64";
@@ -1401,7 +1462,7 @@ function isValidBase64URL(data) {
1401
1462
  const base64 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
1402
1463
  return isValidBase64(base64.padEnd(Math.ceil(base64.length / 4) * 4, "="));
1403
1464
  }
1404
- var $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) => {
1465
+ var $ZodBase64URL = /*@__PURE__*/ $constructor("$ZodBase64URL", (inst, def) => {
1405
1466
  def.pattern ?? (def.pattern = base64url);
1406
1467
  $ZodStringFormat.init(inst, def);
1407
1468
  inst._zod.bag.contentEncoding = "base64url";
@@ -1416,7 +1477,7 @@ var $ZodBase64URL = /* @__PURE__ */ $constructor("$ZodBase64URL", (inst, def) =>
1416
1477
  });
1417
1478
  };
1418
1479
  });
1419
- var $ZodE164 = /* @__PURE__ */ $constructor("$ZodE164", (inst, def) => {
1480
+ var $ZodE164 = /*@__PURE__*/ $constructor("$ZodE164", (inst, def) => {
1420
1481
  def.pattern ?? (def.pattern = e164);
1421
1482
  $ZodStringFormat.init(inst, def);
1422
1483
  });
@@ -1435,7 +1496,7 @@ function isValidJWT(token, algorithm = null) {
1435
1496
  return false;
1436
1497
  }
1437
1498
  }
1438
- var $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => {
1499
+ var $ZodJWT = /*@__PURE__*/ $constructor("$ZodJWT", (inst, def) => {
1439
1500
  $ZodStringFormat.init(inst, def);
1440
1501
  inst._zod.check = (payload) => {
1441
1502
  if (isValidJWT(payload.value, def.alg)) return;
@@ -1448,7 +1509,7 @@ var $ZodJWT = /* @__PURE__ */ $constructor("$ZodJWT", (inst, def) => {
1448
1509
  });
1449
1510
  };
1450
1511
  });
1451
- var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
1512
+ var $ZodNumber = /*@__PURE__*/ $constructor("$ZodNumber", (inst, def) => {
1452
1513
  $ZodType.init(inst, def);
1453
1514
  inst._zod.pattern = inst._zod.bag.pattern ?? number$1;
1454
1515
  inst._zod.parse = (payload, _ctx) => {
@@ -1468,11 +1529,11 @@ var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
1468
1529
  return payload;
1469
1530
  };
1470
1531
  });
1471
- var $ZodNumberFormat = /* @__PURE__ */ $constructor("$ZodNumberFormat", (inst, def) => {
1532
+ var $ZodNumberFormat = /*@__PURE__*/ $constructor("$ZodNumberFormat", (inst, def) => {
1472
1533
  $ZodCheckNumberFormat.init(inst, def);
1473
1534
  $ZodNumber.init(inst, def);
1474
1535
  });
1475
- var $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
1536
+ var $ZodBoolean = /*@__PURE__*/ $constructor("$ZodBoolean", (inst, def) => {
1476
1537
  $ZodType.init(inst, def);
1477
1538
  inst._zod.pattern = boolean$1;
1478
1539
  inst._zod.parse = (payload, _ctx) => {
@@ -1490,7 +1551,7 @@ var $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
1490
1551
  return payload;
1491
1552
  };
1492
1553
  });
1493
- var $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
1554
+ var $ZodNull = /*@__PURE__*/ $constructor("$ZodNull", (inst, def) => {
1494
1555
  $ZodType.init(inst, def);
1495
1556
  inst._zod.pattern = _null$2;
1496
1557
  inst._zod.values = new Set([null]);
@@ -1506,11 +1567,11 @@ var $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
1506
1567
  return payload;
1507
1568
  };
1508
1569
  });
1509
- var $ZodUnknown = /* @__PURE__ */ $constructor("$ZodUnknown", (inst, def) => {
1570
+ var $ZodUnknown = /*@__PURE__*/ $constructor("$ZodUnknown", (inst, def) => {
1510
1571
  $ZodType.init(inst, def);
1511
1572
  inst._zod.parse = (payload) => payload;
1512
1573
  });
1513
- var $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
1574
+ var $ZodNever = /*@__PURE__*/ $constructor("$ZodNever", (inst, def) => {
1514
1575
  $ZodType.init(inst, def);
1515
1576
  inst._zod.parse = (payload, _ctx) => {
1516
1577
  payload.issues.push({
@@ -1526,7 +1587,7 @@ function handleArrayResult(result, final, index) {
1526
1587
  if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
1527
1588
  final.value[index] = result.value;
1528
1589
  }
1529
- var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
1590
+ var $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => {
1530
1591
  $ZodType.init(inst, def);
1531
1592
  inst._zod.parse = (payload, ctx) => {
1532
1593
  const input = payload.value;
@@ -1554,13 +1615,23 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
1554
1615
  return payload;
1555
1616
  };
1556
1617
  });
1557
- function handlePropertyResult(result, final, key, input, isOptionalOut) {
1618
+ function handlePropertyResult(result, final, key, input, isOptionalIn, isOptionalOut) {
1619
+ const isPresent = key in input;
1558
1620
  if (result.issues.length) {
1559
- if (isOptionalOut && !(key in input)) return;
1621
+ if (isOptionalIn && isOptionalOut && !isPresent) return;
1560
1622
  final.issues.push(...prefixIssues(key, result.issues));
1561
1623
  }
1624
+ if (!isPresent && !isOptionalIn) {
1625
+ if (!result.issues.length) final.issues.push({
1626
+ code: "invalid_type",
1627
+ expected: "nonoptional",
1628
+ input: void 0,
1629
+ path: [key]
1630
+ });
1631
+ return;
1632
+ }
1562
1633
  if (result.value === void 0) {
1563
- if (key in input) final.value[key] = void 0;
1634
+ if (isPresent) final.value[key] = void 0;
1564
1635
  } else final.value[key] = result.value;
1565
1636
  }
1566
1637
  function normalizeDef(def) {
@@ -1580,8 +1651,10 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
1580
1651
  const keySet = def.keySet;
1581
1652
  const _catchall = def.catchall._zod;
1582
1653
  const t = _catchall.def.type;
1654
+ const isOptionalIn = _catchall.optin === "optional";
1583
1655
  const isOptionalOut = _catchall.optout === "optional";
1584
1656
  for (const key in input) {
1657
+ if (key === "__proto__") continue;
1585
1658
  if (keySet.has(key)) continue;
1586
1659
  if (t === "never") {
1587
1660
  unrecognized.push(key);
@@ -1591,8 +1664,8 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
1591
1664
  value: input[key],
1592
1665
  issues: []
1593
1666
  }, ctx);
1594
- if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalOut)));
1595
- else handlePropertyResult(r, payload, key, input, isOptionalOut);
1667
+ if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut)));
1668
+ else handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
1596
1669
  }
1597
1670
  if (unrecognized.length) payload.issues.push({
1598
1671
  code: "unrecognized_keys",
@@ -1605,7 +1678,7 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
1605
1678
  return payload;
1606
1679
  });
1607
1680
  }
1608
- var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
1681
+ var $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
1609
1682
  $ZodType.init(inst, def);
1610
1683
  if (!Object.getOwnPropertyDescriptor(def, "shape")?.get) {
1611
1684
  const sh = def.shape;
@@ -1628,13 +1701,13 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
1628
1701
  }
1629
1702
  return propValues;
1630
1703
  });
1631
- const isObject$2 = isObject;
1704
+ const isObject$1 = isObject;
1632
1705
  const catchall = def.catchall;
1633
1706
  let value;
1634
1707
  inst._zod.parse = (payload, ctx) => {
1635
1708
  value ?? (value = _normalized.value);
1636
1709
  const input = payload.value;
1637
- if (!isObject$2(input)) {
1710
+ if (!isObject$1(input)) {
1638
1711
  payload.issues.push({
1639
1712
  expected: "object",
1640
1713
  code: "invalid_type",
@@ -1648,19 +1721,20 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
1648
1721
  const shape = value.shape;
1649
1722
  for (const key of value.keys) {
1650
1723
  const el = shape[key];
1724
+ const isOptionalIn = el._zod.optin === "optional";
1651
1725
  const isOptionalOut = el._zod.optout === "optional";
1652
1726
  const r = el._zod.run({
1653
1727
  value: input[key],
1654
1728
  issues: []
1655
1729
  }, ctx);
1656
- if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalOut)));
1657
- else handlePropertyResult(r, payload, key, input, isOptionalOut);
1730
+ if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut)));
1731
+ else handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
1658
1732
  }
1659
1733
  if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload;
1660
1734
  return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
1661
1735
  };
1662
1736
  });
1663
- var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
1737
+ var $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) => {
1664
1738
  $ZodObject.init(inst, def);
1665
1739
  const superParse = inst._zod.parse;
1666
1740
  const _normalized = cached(() => normalizeDef(def));
@@ -1683,9 +1757,11 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
1683
1757
  for (const key of normalized.keys) {
1684
1758
  const id = ids[key];
1685
1759
  const k = esc(key);
1686
- const isOptionalOut = shape[key]?._zod?.optout === "optional";
1760
+ const schema = shape[key];
1761
+ const isOptionalIn = schema?._zod?.optin === "optional";
1762
+ const isOptionalOut = schema?._zod?.optout === "optional";
1687
1763
  doc.write(`const ${id} = ${parseStr(key)};`);
1688
- if (isOptionalOut) doc.write(`
1764
+ if (isOptionalIn && isOptionalOut) doc.write(`
1689
1765
  if (${id}.issues.length) {
1690
1766
  if (${k} in input) {
1691
1767
  payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
@@ -1703,6 +1779,32 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
1703
1779
  newResult[${k}] = ${id}.value;
1704
1780
  }
1705
1781
 
1782
+ `);
1783
+ else if (!isOptionalIn) doc.write(`
1784
+ const ${id}_present = ${k} in input;
1785
+ if (${id}.issues.length) {
1786
+ payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
1787
+ ...iss,
1788
+ path: iss.path ? [${k}, ...iss.path] : [${k}]
1789
+ })));
1790
+ }
1791
+ if (!${id}_present && !${id}.issues.length) {
1792
+ payload.issues.push({
1793
+ code: "invalid_type",
1794
+ expected: "nonoptional",
1795
+ input: undefined,
1796
+ path: [${k}]
1797
+ });
1798
+ }
1799
+
1800
+ if (${id}_present) {
1801
+ if (${id}.value === undefined) {
1802
+ newResult[${k}] = undefined;
1803
+ } else {
1804
+ newResult[${k}] = ${id}.value;
1805
+ }
1806
+ }
1807
+
1706
1808
  `);
1707
1809
  else doc.write(`
1708
1810
  if (${id}.issues.length) {
@@ -1728,7 +1830,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
1728
1830
  return (payload, ctx) => fn(shape, payload, ctx);
1729
1831
  };
1730
1832
  let fastpass;
1731
- const isObject$1 = isObject;
1833
+ const isObject$2 = isObject;
1732
1834
  const jit = !globalConfig.jitless;
1733
1835
  const fastEnabled = jit && allowsEval.value;
1734
1836
  const catchall = def.catchall;
@@ -1736,7 +1838,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
1736
1838
  inst._zod.parse = (payload, ctx) => {
1737
1839
  value ?? (value = _normalized.value);
1738
1840
  const input = payload.value;
1739
- if (!isObject$1(input)) {
1841
+ if (!isObject$2(input)) {
1740
1842
  payload.issues.push({
1741
1843
  expected: "object",
1742
1844
  code: "invalid_type",
@@ -1772,7 +1874,7 @@ function handleUnionResults(results, final, inst, ctx) {
1772
1874
  });
1773
1875
  return final;
1774
1876
  }
1775
- var $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
1877
+ var $ZodUnion = /*@__PURE__*/ $constructor("$ZodUnion", (inst, def) => {
1776
1878
  $ZodType.init(inst, def);
1777
1879
  defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0);
1778
1880
  defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
@@ -1785,10 +1887,9 @@ var $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
1785
1887
  return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`);
1786
1888
  }
1787
1889
  });
1788
- const single = def.options.length === 1;
1789
- const first = def.options[0]._zod.run;
1890
+ const first = def.options.length === 1 ? def.options[0]._zod.run : null;
1790
1891
  inst._zod.parse = (payload, ctx) => {
1791
- if (single) return first(payload, ctx);
1892
+ if (first) return first(payload, ctx);
1792
1893
  let async = false;
1793
1894
  const results = [];
1794
1895
  for (const option of def.options) {
@@ -1810,7 +1911,7 @@ var $ZodUnion = /* @__PURE__ */ $constructor("$ZodUnion", (inst, def) => {
1810
1911
  });
1811
1912
  };
1812
1913
  });
1813
- var $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => {
1914
+ var $ZodIntersection = /*@__PURE__*/ $constructor("$ZodIntersection", (inst, def) => {
1814
1915
  $ZodType.init(inst, def);
1815
1916
  inst._zod.parse = (payload, ctx) => {
1816
1917
  const input = payload.value;
@@ -1909,7 +2010,7 @@ function handleIntersectionResults(result, left, right) {
1909
2010
  result.value = merged.data;
1910
2011
  return result;
1911
2012
  }
1912
- var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
2013
+ var $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
1913
2014
  $ZodType.init(inst, def);
1914
2015
  inst._zod.parse = (payload, ctx) => {
1915
2016
  const input = payload.value;
@@ -1929,17 +2030,34 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
1929
2030
  const recordKeys = /* @__PURE__ */ new Set();
1930
2031
  for (const key of values) if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
1931
2032
  recordKeys.add(typeof key === "number" ? key.toString() : key);
2033
+ const keyResult = def.keyType._zod.run({
2034
+ value: key,
2035
+ issues: []
2036
+ }, ctx);
2037
+ if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
2038
+ if (keyResult.issues.length) {
2039
+ payload.issues.push({
2040
+ code: "invalid_key",
2041
+ origin: "record",
2042
+ issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
2043
+ input: key,
2044
+ path: [key],
2045
+ inst
2046
+ });
2047
+ continue;
2048
+ }
2049
+ const outKey = keyResult.value;
1932
2050
  const result = def.valueType._zod.run({
1933
2051
  value: input[key],
1934
2052
  issues: []
1935
2053
  }, ctx);
1936
2054
  if (result instanceof Promise) proms.push(result.then((result) => {
1937
2055
  if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
1938
- payload.value[key] = result.value;
2056
+ payload.value[outKey] = result.value;
1939
2057
  }));
1940
2058
  else {
1941
2059
  if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
1942
- payload.value[key] = result.value;
2060
+ payload.value[outKey] = result.value;
1943
2061
  }
1944
2062
  }
1945
2063
  let unrecognized;
@@ -1957,6 +2075,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
1957
2075
  payload.value = {};
1958
2076
  for (const key of Reflect.ownKeys(input)) {
1959
2077
  if (key === "__proto__") continue;
2078
+ if (!Object.prototype.propertyIsEnumerable.call(input, key)) continue;
1960
2079
  let keyResult = def.keyType._zod.run({
1961
2080
  value: key,
1962
2081
  issues: []
@@ -2000,7 +2119,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
2000
2119
  return payload;
2001
2120
  };
2002
2121
  });
2003
- var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
2122
+ var $ZodEnum = /*@__PURE__*/ $constructor("$ZodEnum", (inst, def) => {
2004
2123
  $ZodType.init(inst, def);
2005
2124
  const values = getEnumValues(def.entries);
2006
2125
  const valuesSet = new Set(values);
@@ -2018,7 +2137,7 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
2018
2137
  return payload;
2019
2138
  };
2020
2139
  });
2021
- var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
2140
+ var $ZodLiteral = /*@__PURE__*/ $constructor("$ZodLiteral", (inst, def) => {
2022
2141
  $ZodType.init(inst, def);
2023
2142
  if (def.values.length === 0) throw new Error("Cannot create literal schema with no valid values");
2024
2143
  const values = new Set(def.values);
@@ -2036,28 +2155,31 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
2036
2155
  return payload;
2037
2156
  };
2038
2157
  });
2039
- var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) => {
2158
+ var $ZodTransform = /*@__PURE__*/ $constructor("$ZodTransform", (inst, def) => {
2040
2159
  $ZodType.init(inst, def);
2160
+ inst._zod.optin = "optional";
2041
2161
  inst._zod.parse = (payload, ctx) => {
2042
2162
  if (ctx.direction === "backward") throw new $ZodEncodeError(inst.constructor.name);
2043
2163
  const _out = def.transform(payload.value, payload);
2044
2164
  if (ctx.async) return (_out instanceof Promise ? _out : Promise.resolve(_out)).then((output) => {
2045
2165
  payload.value = output;
2166
+ payload.fallback = true;
2046
2167
  return payload;
2047
2168
  });
2048
2169
  if (_out instanceof Promise) throw new $ZodAsyncError();
2049
2170
  payload.value = _out;
2171
+ payload.fallback = true;
2050
2172
  return payload;
2051
2173
  };
2052
2174
  });
2053
2175
  function handleOptionalResult(result, input) {
2054
- if (result.issues.length && input === void 0) return {
2176
+ if (input === void 0 && (result.issues.length || result.fallback)) return {
2055
2177
  issues: [],
2056
2178
  value: void 0
2057
2179
  };
2058
2180
  return result;
2059
2181
  }
2060
- var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
2182
+ var $ZodOptional = /*@__PURE__*/ $constructor("$ZodOptional", (inst, def) => {
2061
2183
  $ZodType.init(inst, def);
2062
2184
  inst._zod.optin = "optional";
2063
2185
  inst._zod.optout = "optional";
@@ -2070,15 +2192,16 @@ var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
2070
2192
  });
2071
2193
  inst._zod.parse = (payload, ctx) => {
2072
2194
  if (def.innerType._zod.optin === "optional") {
2195
+ const input = payload.value;
2073
2196
  const result = def.innerType._zod.run(payload, ctx);
2074
- if (result instanceof Promise) return result.then((r) => handleOptionalResult(r, payload.value));
2075
- return handleOptionalResult(result, payload.value);
2197
+ if (result instanceof Promise) return result.then((r) => handleOptionalResult(r, input));
2198
+ return handleOptionalResult(result, input);
2076
2199
  }
2077
2200
  if (payload.value === void 0) return payload;
2078
2201
  return def.innerType._zod.run(payload, ctx);
2079
2202
  };
2080
2203
  });
2081
- var $ZodExactOptional = /* @__PURE__ */ $constructor("$ZodExactOptional", (inst, def) => {
2204
+ var $ZodExactOptional = /*@__PURE__*/ $constructor("$ZodExactOptional", (inst, def) => {
2082
2205
  $ZodOptional.init(inst, def);
2083
2206
  defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2084
2207
  defineLazy(inst._zod, "pattern", () => def.innerType._zod.pattern);
@@ -2086,7 +2209,7 @@ var $ZodExactOptional = /* @__PURE__ */ $constructor("$ZodExactOptional", (inst,
2086
2209
  return def.innerType._zod.run(payload, ctx);
2087
2210
  };
2088
2211
  });
2089
- var $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => {
2212
+ var $ZodNullable = /*@__PURE__*/ $constructor("$ZodNullable", (inst, def) => {
2090
2213
  $ZodType.init(inst, def);
2091
2214
  defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
2092
2215
  defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
@@ -2102,7 +2225,7 @@ var $ZodNullable = /* @__PURE__ */ $constructor("$ZodNullable", (inst, def) => {
2102
2225
  return def.innerType._zod.run(payload, ctx);
2103
2226
  };
2104
2227
  });
2105
- var $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => {
2228
+ var $ZodDefault = /*@__PURE__*/ $constructor("$ZodDefault", (inst, def) => {
2106
2229
  $ZodType.init(inst, def);
2107
2230
  inst._zod.optin = "optional";
2108
2231
  defineLazy(inst._zod, "values", () => def.innerType._zod.values);
@@ -2124,7 +2247,7 @@ function handleDefaultResult(payload, def) {
2124
2247
  if (payload.value === void 0) payload.value = def.defaultValue;
2125
2248
  return payload;
2126
2249
  }
2127
- var $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) => {
2250
+ var $ZodPrefault = /*@__PURE__*/ $constructor("$ZodPrefault", (inst, def) => {
2128
2251
  $ZodType.init(inst, def);
2129
2252
  inst._zod.optin = "optional";
2130
2253
  defineLazy(inst._zod, "values", () => def.innerType._zod.values);
@@ -2134,7 +2257,7 @@ var $ZodPrefault = /* @__PURE__ */ $constructor("$ZodPrefault", (inst, def) => {
2134
2257
  return def.innerType._zod.run(payload, ctx);
2135
2258
  };
2136
2259
  });
2137
- var $ZodNonOptional = /* @__PURE__ */ $constructor("$ZodNonOptional", (inst, def) => {
2260
+ var $ZodNonOptional = /*@__PURE__*/ $constructor("$ZodNonOptional", (inst, def) => {
2138
2261
  $ZodType.init(inst, def);
2139
2262
  defineLazy(inst._zod, "values", () => {
2140
2263
  const v = def.innerType._zod.values;
@@ -2155,9 +2278,9 @@ function handleNonOptionalResult(payload, inst) {
2155
2278
  });
2156
2279
  return payload;
2157
2280
  }
2158
- var $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
2281
+ var $ZodCatch = /*@__PURE__*/ $constructor("$ZodCatch", (inst, def) => {
2159
2282
  $ZodType.init(inst, def);
2160
- defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
2283
+ inst._zod.optin = "optional";
2161
2284
  defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
2162
2285
  defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2163
2286
  inst._zod.parse = (payload, ctx) => {
@@ -2172,6 +2295,7 @@ var $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
2172
2295
  input: payload.value
2173
2296
  });
2174
2297
  payload.issues = [];
2298
+ payload.fallback = true;
2175
2299
  }
2176
2300
  return payload;
2177
2301
  });
@@ -2183,11 +2307,12 @@ var $ZodCatch = /* @__PURE__ */ $constructor("$ZodCatch", (inst, def) => {
2183
2307
  input: payload.value
2184
2308
  });
2185
2309
  payload.issues = [];
2310
+ payload.fallback = true;
2186
2311
  }
2187
2312
  return payload;
2188
2313
  };
2189
2314
  });
2190
- var $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => {
2315
+ var $ZodPipe = /*@__PURE__*/ $constructor("$ZodPipe", (inst, def) => {
2191
2316
  $ZodType.init(inst, def);
2192
2317
  defineLazy(inst._zod, "values", () => def.in._zod.values);
2193
2318
  defineLazy(inst._zod, "optin", () => def.in._zod.optin);
@@ -2211,10 +2336,11 @@ function handlePipeResult(left, next, ctx) {
2211
2336
  }
2212
2337
  return next._zod.run({
2213
2338
  value: left.value,
2214
- issues: left.issues
2339
+ issues: left.issues,
2340
+ fallback: left.fallback
2215
2341
  }, ctx);
2216
2342
  }
2217
- var $ZodReadonly = /* @__PURE__ */ $constructor("$ZodReadonly", (inst, def) => {
2343
+ var $ZodReadonly = /*@__PURE__*/ $constructor("$ZodReadonly", (inst, def) => {
2218
2344
  $ZodType.init(inst, def);
2219
2345
  defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
2220
2346
  defineLazy(inst._zod, "values", () => def.innerType._zod.values);
@@ -2231,7 +2357,7 @@ function handleReadonlyResult(payload) {
2231
2357
  payload.value = Object.freeze(payload.value);
2232
2358
  return payload;
2233
2359
  }
2234
- var $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
2360
+ var $ZodCustom = /*@__PURE__*/ $constructor("$ZodCustom", (inst, def) => {
2235
2361
  $ZodCheck.init(inst, def);
2236
2362
  $ZodType.init(inst, def);
2237
2363
  inst._zod.parse = (payload, _) => {
@@ -2258,7 +2384,7 @@ function handleRefineResult(result, payload, input, inst) {
2258
2384
  }
2259
2385
  }
2260
2386
  //#endregion
2261
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/registries.js
2387
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/registries.js
2262
2388
  var _a;
2263
2389
  var $ZodRegistry = class {
2264
2390
  constructor() {
@@ -2305,15 +2431,15 @@ function registry() {
2305
2431
  (_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
2306
2432
  var globalRegistry = globalThis.__zod_globalRegistry;
2307
2433
  //#endregion
2308
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/api.js
2309
- /* @__NO_SIDE_EFFECTS__ */
2434
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/api.js
2435
+ // @__NO_SIDE_EFFECTS__
2310
2436
  function _string(Class, params) {
2311
2437
  return new Class({
2312
2438
  type: "string",
2313
2439
  ...normalizeParams(params)
2314
2440
  });
2315
2441
  }
2316
- /* @__NO_SIDE_EFFECTS__ */
2442
+ // @__NO_SIDE_EFFECTS__
2317
2443
  function _email(Class, params) {
2318
2444
  return new Class({
2319
2445
  type: "string",
@@ -2323,7 +2449,7 @@ function _email(Class, params) {
2323
2449
  ...normalizeParams(params)
2324
2450
  });
2325
2451
  }
2326
- /* @__NO_SIDE_EFFECTS__ */
2452
+ // @__NO_SIDE_EFFECTS__
2327
2453
  function _guid(Class, params) {
2328
2454
  return new Class({
2329
2455
  type: "string",
@@ -2333,7 +2459,7 @@ function _guid(Class, params) {
2333
2459
  ...normalizeParams(params)
2334
2460
  });
2335
2461
  }
2336
- /* @__NO_SIDE_EFFECTS__ */
2462
+ // @__NO_SIDE_EFFECTS__
2337
2463
  function _uuid(Class, params) {
2338
2464
  return new Class({
2339
2465
  type: "string",
@@ -2343,7 +2469,7 @@ function _uuid(Class, params) {
2343
2469
  ...normalizeParams(params)
2344
2470
  });
2345
2471
  }
2346
- /* @__NO_SIDE_EFFECTS__ */
2472
+ // @__NO_SIDE_EFFECTS__
2347
2473
  function _uuidv4(Class, params) {
2348
2474
  return new Class({
2349
2475
  type: "string",
@@ -2354,7 +2480,7 @@ function _uuidv4(Class, params) {
2354
2480
  ...normalizeParams(params)
2355
2481
  });
2356
2482
  }
2357
- /* @__NO_SIDE_EFFECTS__ */
2483
+ // @__NO_SIDE_EFFECTS__
2358
2484
  function _uuidv6(Class, params) {
2359
2485
  return new Class({
2360
2486
  type: "string",
@@ -2365,7 +2491,7 @@ function _uuidv6(Class, params) {
2365
2491
  ...normalizeParams(params)
2366
2492
  });
2367
2493
  }
2368
- /* @__NO_SIDE_EFFECTS__ */
2494
+ // @__NO_SIDE_EFFECTS__
2369
2495
  function _uuidv7(Class, params) {
2370
2496
  return new Class({
2371
2497
  type: "string",
@@ -2376,7 +2502,7 @@ function _uuidv7(Class, params) {
2376
2502
  ...normalizeParams(params)
2377
2503
  });
2378
2504
  }
2379
- /* @__NO_SIDE_EFFECTS__ */
2505
+ // @__NO_SIDE_EFFECTS__
2380
2506
  function _url(Class, params) {
2381
2507
  return new Class({
2382
2508
  type: "string",
@@ -2386,7 +2512,7 @@ function _url(Class, params) {
2386
2512
  ...normalizeParams(params)
2387
2513
  });
2388
2514
  }
2389
- /* @__NO_SIDE_EFFECTS__ */
2515
+ // @__NO_SIDE_EFFECTS__
2390
2516
  function _emoji(Class, params) {
2391
2517
  return new Class({
2392
2518
  type: "string",
@@ -2396,7 +2522,7 @@ function _emoji(Class, params) {
2396
2522
  ...normalizeParams(params)
2397
2523
  });
2398
2524
  }
2399
- /* @__NO_SIDE_EFFECTS__ */
2525
+ // @__NO_SIDE_EFFECTS__
2400
2526
  function _nanoid(Class, params) {
2401
2527
  return new Class({
2402
2528
  type: "string",
@@ -2406,7 +2532,12 @@ function _nanoid(Class, params) {
2406
2532
  ...normalizeParams(params)
2407
2533
  });
2408
2534
  }
2409
- /* @__NO_SIDE_EFFECTS__ */
2535
+ /**
2536
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
2537
+ * (timestamps embedded in the id). Use {@link _cuid2} instead.
2538
+ * See https://github.com/paralleldrive/cuid.
2539
+ */
2540
+ // @__NO_SIDE_EFFECTS__
2410
2541
  function _cuid(Class, params) {
2411
2542
  return new Class({
2412
2543
  type: "string",
@@ -2416,7 +2547,7 @@ function _cuid(Class, params) {
2416
2547
  ...normalizeParams(params)
2417
2548
  });
2418
2549
  }
2419
- /* @__NO_SIDE_EFFECTS__ */
2550
+ // @__NO_SIDE_EFFECTS__
2420
2551
  function _cuid2(Class, params) {
2421
2552
  return new Class({
2422
2553
  type: "string",
@@ -2426,7 +2557,7 @@ function _cuid2(Class, params) {
2426
2557
  ...normalizeParams(params)
2427
2558
  });
2428
2559
  }
2429
- /* @__NO_SIDE_EFFECTS__ */
2560
+ // @__NO_SIDE_EFFECTS__
2430
2561
  function _ulid(Class, params) {
2431
2562
  return new Class({
2432
2563
  type: "string",
@@ -2436,7 +2567,7 @@ function _ulid(Class, params) {
2436
2567
  ...normalizeParams(params)
2437
2568
  });
2438
2569
  }
2439
- /* @__NO_SIDE_EFFECTS__ */
2570
+ // @__NO_SIDE_EFFECTS__
2440
2571
  function _xid(Class, params) {
2441
2572
  return new Class({
2442
2573
  type: "string",
@@ -2446,7 +2577,7 @@ function _xid(Class, params) {
2446
2577
  ...normalizeParams(params)
2447
2578
  });
2448
2579
  }
2449
- /* @__NO_SIDE_EFFECTS__ */
2580
+ // @__NO_SIDE_EFFECTS__
2450
2581
  function _ksuid(Class, params) {
2451
2582
  return new Class({
2452
2583
  type: "string",
@@ -2456,7 +2587,7 @@ function _ksuid(Class, params) {
2456
2587
  ...normalizeParams(params)
2457
2588
  });
2458
2589
  }
2459
- /* @__NO_SIDE_EFFECTS__ */
2590
+ // @__NO_SIDE_EFFECTS__
2460
2591
  function _ipv4(Class, params) {
2461
2592
  return new Class({
2462
2593
  type: "string",
@@ -2466,7 +2597,7 @@ function _ipv4(Class, params) {
2466
2597
  ...normalizeParams(params)
2467
2598
  });
2468
2599
  }
2469
- /* @__NO_SIDE_EFFECTS__ */
2600
+ // @__NO_SIDE_EFFECTS__
2470
2601
  function _ipv6(Class, params) {
2471
2602
  return new Class({
2472
2603
  type: "string",
@@ -2476,7 +2607,7 @@ function _ipv6(Class, params) {
2476
2607
  ...normalizeParams(params)
2477
2608
  });
2478
2609
  }
2479
- /* @__NO_SIDE_EFFECTS__ */
2610
+ // @__NO_SIDE_EFFECTS__
2480
2611
  function _cidrv4(Class, params) {
2481
2612
  return new Class({
2482
2613
  type: "string",
@@ -2486,7 +2617,7 @@ function _cidrv4(Class, params) {
2486
2617
  ...normalizeParams(params)
2487
2618
  });
2488
2619
  }
2489
- /* @__NO_SIDE_EFFECTS__ */
2620
+ // @__NO_SIDE_EFFECTS__
2490
2621
  function _cidrv6(Class, params) {
2491
2622
  return new Class({
2492
2623
  type: "string",
@@ -2496,7 +2627,7 @@ function _cidrv6(Class, params) {
2496
2627
  ...normalizeParams(params)
2497
2628
  });
2498
2629
  }
2499
- /* @__NO_SIDE_EFFECTS__ */
2630
+ // @__NO_SIDE_EFFECTS__
2500
2631
  function _base64(Class, params) {
2501
2632
  return new Class({
2502
2633
  type: "string",
@@ -2506,7 +2637,7 @@ function _base64(Class, params) {
2506
2637
  ...normalizeParams(params)
2507
2638
  });
2508
2639
  }
2509
- /* @__NO_SIDE_EFFECTS__ */
2640
+ // @__NO_SIDE_EFFECTS__
2510
2641
  function _base64url(Class, params) {
2511
2642
  return new Class({
2512
2643
  type: "string",
@@ -2516,7 +2647,7 @@ function _base64url(Class, params) {
2516
2647
  ...normalizeParams(params)
2517
2648
  });
2518
2649
  }
2519
- /* @__NO_SIDE_EFFECTS__ */
2650
+ // @__NO_SIDE_EFFECTS__
2520
2651
  function _e164(Class, params) {
2521
2652
  return new Class({
2522
2653
  type: "string",
@@ -2526,7 +2657,7 @@ function _e164(Class, params) {
2526
2657
  ...normalizeParams(params)
2527
2658
  });
2528
2659
  }
2529
- /* @__NO_SIDE_EFFECTS__ */
2660
+ // @__NO_SIDE_EFFECTS__
2530
2661
  function _jwt(Class, params) {
2531
2662
  return new Class({
2532
2663
  type: "string",
@@ -2536,7 +2667,7 @@ function _jwt(Class, params) {
2536
2667
  ...normalizeParams(params)
2537
2668
  });
2538
2669
  }
2539
- /* @__NO_SIDE_EFFECTS__ */
2670
+ // @__NO_SIDE_EFFECTS__
2540
2671
  function _isoDateTime(Class, params) {
2541
2672
  return new Class({
2542
2673
  type: "string",
@@ -2548,7 +2679,7 @@ function _isoDateTime(Class, params) {
2548
2679
  ...normalizeParams(params)
2549
2680
  });
2550
2681
  }
2551
- /* @__NO_SIDE_EFFECTS__ */
2682
+ // @__NO_SIDE_EFFECTS__
2552
2683
  function _isoDate(Class, params) {
2553
2684
  return new Class({
2554
2685
  type: "string",
@@ -2557,7 +2688,7 @@ function _isoDate(Class, params) {
2557
2688
  ...normalizeParams(params)
2558
2689
  });
2559
2690
  }
2560
- /* @__NO_SIDE_EFFECTS__ */
2691
+ // @__NO_SIDE_EFFECTS__
2561
2692
  function _isoTime(Class, params) {
2562
2693
  return new Class({
2563
2694
  type: "string",
@@ -2567,7 +2698,7 @@ function _isoTime(Class, params) {
2567
2698
  ...normalizeParams(params)
2568
2699
  });
2569
2700
  }
2570
- /* @__NO_SIDE_EFFECTS__ */
2701
+ // @__NO_SIDE_EFFECTS__
2571
2702
  function _isoDuration(Class, params) {
2572
2703
  return new Class({
2573
2704
  type: "string",
@@ -2576,7 +2707,7 @@ function _isoDuration(Class, params) {
2576
2707
  ...normalizeParams(params)
2577
2708
  });
2578
2709
  }
2579
- /* @__NO_SIDE_EFFECTS__ */
2710
+ // @__NO_SIDE_EFFECTS__
2580
2711
  function _number(Class, params) {
2581
2712
  return new Class({
2582
2713
  type: "number",
@@ -2584,7 +2715,7 @@ function _number(Class, params) {
2584
2715
  ...normalizeParams(params)
2585
2716
  });
2586
2717
  }
2587
- /* @__NO_SIDE_EFFECTS__ */
2718
+ // @__NO_SIDE_EFFECTS__
2588
2719
  function _int(Class, params) {
2589
2720
  return new Class({
2590
2721
  type: "number",
@@ -2594,32 +2725,32 @@ function _int(Class, params) {
2594
2725
  ...normalizeParams(params)
2595
2726
  });
2596
2727
  }
2597
- /* @__NO_SIDE_EFFECTS__ */
2728
+ // @__NO_SIDE_EFFECTS__
2598
2729
  function _boolean(Class, params) {
2599
2730
  return new Class({
2600
2731
  type: "boolean",
2601
2732
  ...normalizeParams(params)
2602
2733
  });
2603
2734
  }
2604
- /* @__NO_SIDE_EFFECTS__ */
2735
+ // @__NO_SIDE_EFFECTS__
2605
2736
  function _null$1(Class, params) {
2606
2737
  return new Class({
2607
2738
  type: "null",
2608
2739
  ...normalizeParams(params)
2609
2740
  });
2610
2741
  }
2611
- /* @__NO_SIDE_EFFECTS__ */
2742
+ // @__NO_SIDE_EFFECTS__
2612
2743
  function _unknown(Class) {
2613
2744
  return new Class({ type: "unknown" });
2614
2745
  }
2615
- /* @__NO_SIDE_EFFECTS__ */
2746
+ // @__NO_SIDE_EFFECTS__
2616
2747
  function _never(Class, params) {
2617
2748
  return new Class({
2618
2749
  type: "never",
2619
2750
  ...normalizeParams(params)
2620
2751
  });
2621
2752
  }
2622
- /* @__NO_SIDE_EFFECTS__ */
2753
+ // @__NO_SIDE_EFFECTS__
2623
2754
  function _lt(value, params) {
2624
2755
  return new $ZodCheckLessThan({
2625
2756
  check: "less_than",
@@ -2628,7 +2759,7 @@ function _lt(value, params) {
2628
2759
  inclusive: false
2629
2760
  });
2630
2761
  }
2631
- /* @__NO_SIDE_EFFECTS__ */
2762
+ // @__NO_SIDE_EFFECTS__
2632
2763
  function _lte(value, params) {
2633
2764
  return new $ZodCheckLessThan({
2634
2765
  check: "less_than",
@@ -2637,7 +2768,7 @@ function _lte(value, params) {
2637
2768
  inclusive: true
2638
2769
  });
2639
2770
  }
2640
- /* @__NO_SIDE_EFFECTS__ */
2771
+ // @__NO_SIDE_EFFECTS__
2641
2772
  function _gt(value, params) {
2642
2773
  return new $ZodCheckGreaterThan({
2643
2774
  check: "greater_than",
@@ -2646,7 +2777,7 @@ function _gt(value, params) {
2646
2777
  inclusive: false
2647
2778
  });
2648
2779
  }
2649
- /* @__NO_SIDE_EFFECTS__ */
2780
+ // @__NO_SIDE_EFFECTS__
2650
2781
  function _gte(value, params) {
2651
2782
  return new $ZodCheckGreaterThan({
2652
2783
  check: "greater_than",
@@ -2655,7 +2786,7 @@ function _gte(value, params) {
2655
2786
  inclusive: true
2656
2787
  });
2657
2788
  }
2658
- /* @__NO_SIDE_EFFECTS__ */
2789
+ // @__NO_SIDE_EFFECTS__
2659
2790
  function _multipleOf(value, params) {
2660
2791
  return new $ZodCheckMultipleOf({
2661
2792
  check: "multiple_of",
@@ -2663,7 +2794,7 @@ function _multipleOf(value, params) {
2663
2794
  value
2664
2795
  });
2665
2796
  }
2666
- /* @__NO_SIDE_EFFECTS__ */
2797
+ // @__NO_SIDE_EFFECTS__
2667
2798
  function _maxLength(maximum, params) {
2668
2799
  return new $ZodCheckMaxLength({
2669
2800
  check: "max_length",
@@ -2671,7 +2802,7 @@ function _maxLength(maximum, params) {
2671
2802
  maximum
2672
2803
  });
2673
2804
  }
2674
- /* @__NO_SIDE_EFFECTS__ */
2805
+ // @__NO_SIDE_EFFECTS__
2675
2806
  function _minLength(minimum, params) {
2676
2807
  return new $ZodCheckMinLength({
2677
2808
  check: "min_length",
@@ -2679,7 +2810,7 @@ function _minLength(minimum, params) {
2679
2810
  minimum
2680
2811
  });
2681
2812
  }
2682
- /* @__NO_SIDE_EFFECTS__ */
2813
+ // @__NO_SIDE_EFFECTS__
2683
2814
  function _length(length, params) {
2684
2815
  return new $ZodCheckLengthEquals({
2685
2816
  check: "length_equals",
@@ -2687,7 +2818,7 @@ function _length(length, params) {
2687
2818
  length
2688
2819
  });
2689
2820
  }
2690
- /* @__NO_SIDE_EFFECTS__ */
2821
+ // @__NO_SIDE_EFFECTS__
2691
2822
  function _regex(pattern, params) {
2692
2823
  return new $ZodCheckRegex({
2693
2824
  check: "string_format",
@@ -2696,7 +2827,7 @@ function _regex(pattern, params) {
2696
2827
  pattern
2697
2828
  });
2698
2829
  }
2699
- /* @__NO_SIDE_EFFECTS__ */
2830
+ // @__NO_SIDE_EFFECTS__
2700
2831
  function _lowercase(params) {
2701
2832
  return new $ZodCheckLowerCase({
2702
2833
  check: "string_format",
@@ -2704,7 +2835,7 @@ function _lowercase(params) {
2704
2835
  ...normalizeParams(params)
2705
2836
  });
2706
2837
  }
2707
- /* @__NO_SIDE_EFFECTS__ */
2838
+ // @__NO_SIDE_EFFECTS__
2708
2839
  function _uppercase(params) {
2709
2840
  return new $ZodCheckUpperCase({
2710
2841
  check: "string_format",
@@ -2712,7 +2843,7 @@ function _uppercase(params) {
2712
2843
  ...normalizeParams(params)
2713
2844
  });
2714
2845
  }
2715
- /* @__NO_SIDE_EFFECTS__ */
2846
+ // @__NO_SIDE_EFFECTS__
2716
2847
  function _includes(includes, params) {
2717
2848
  return new $ZodCheckIncludes({
2718
2849
  check: "string_format",
@@ -2721,7 +2852,7 @@ function _includes(includes, params) {
2721
2852
  includes
2722
2853
  });
2723
2854
  }
2724
- /* @__NO_SIDE_EFFECTS__ */
2855
+ // @__NO_SIDE_EFFECTS__
2725
2856
  function _startsWith(prefix, params) {
2726
2857
  return new $ZodCheckStartsWith({
2727
2858
  check: "string_format",
@@ -2730,7 +2861,7 @@ function _startsWith(prefix, params) {
2730
2861
  prefix
2731
2862
  });
2732
2863
  }
2733
- /* @__NO_SIDE_EFFECTS__ */
2864
+ // @__NO_SIDE_EFFECTS__
2734
2865
  function _endsWith(suffix, params) {
2735
2866
  return new $ZodCheckEndsWith({
2736
2867
  check: "string_format",
@@ -2739,34 +2870,34 @@ function _endsWith(suffix, params) {
2739
2870
  suffix
2740
2871
  });
2741
2872
  }
2742
- /* @__NO_SIDE_EFFECTS__ */
2873
+ // @__NO_SIDE_EFFECTS__
2743
2874
  function _overwrite(tx) {
2744
2875
  return new $ZodCheckOverwrite({
2745
2876
  check: "overwrite",
2746
2877
  tx
2747
2878
  });
2748
2879
  }
2749
- /* @__NO_SIDE_EFFECTS__ */
2880
+ // @__NO_SIDE_EFFECTS__
2750
2881
  function _normalize(form) {
2751
2882
  return /* @__PURE__ */ _overwrite((input) => input.normalize(form));
2752
2883
  }
2753
- /* @__NO_SIDE_EFFECTS__ */
2884
+ // @__NO_SIDE_EFFECTS__
2754
2885
  function _trim() {
2755
2886
  return /* @__PURE__ */ _overwrite((input) => input.trim());
2756
2887
  }
2757
- /* @__NO_SIDE_EFFECTS__ */
2888
+ // @__NO_SIDE_EFFECTS__
2758
2889
  function _toLowerCase() {
2759
2890
  return /* @__PURE__ */ _overwrite((input) => input.toLowerCase());
2760
2891
  }
2761
- /* @__NO_SIDE_EFFECTS__ */
2892
+ // @__NO_SIDE_EFFECTS__
2762
2893
  function _toUpperCase() {
2763
2894
  return /* @__PURE__ */ _overwrite((input) => input.toUpperCase());
2764
2895
  }
2765
- /* @__NO_SIDE_EFFECTS__ */
2896
+ // @__NO_SIDE_EFFECTS__
2766
2897
  function _slugify() {
2767
2898
  return /* @__PURE__ */ _overwrite((input) => slugify(input));
2768
2899
  }
2769
- /* @__NO_SIDE_EFFECTS__ */
2900
+ // @__NO_SIDE_EFFECTS__
2770
2901
  function _array(Class, element, params) {
2771
2902
  return new Class({
2772
2903
  type: "array",
@@ -2774,7 +2905,7 @@ function _array(Class, element, params) {
2774
2905
  ...normalizeParams(params)
2775
2906
  });
2776
2907
  }
2777
- /* @__NO_SIDE_EFFECTS__ */
2908
+ // @__NO_SIDE_EFFECTS__
2778
2909
  function _refine(Class, fn, _params) {
2779
2910
  return new Class({
2780
2911
  type: "custom",
@@ -2783,8 +2914,8 @@ function _refine(Class, fn, _params) {
2783
2914
  ...normalizeParams(_params)
2784
2915
  });
2785
2916
  }
2786
- /* @__NO_SIDE_EFFECTS__ */
2787
- function _superRefine(fn) {
2917
+ // @__NO_SIDE_EFFECTS__
2918
+ function _superRefine(fn, params) {
2788
2919
  const ch = /* @__PURE__ */ _check((payload) => {
2789
2920
  payload.addIssue = (issue$2) => {
2790
2921
  if (typeof issue$2 === "string") payload.issues.push(issue(issue$2, payload.value, ch._zod.def));
@@ -2799,10 +2930,10 @@ function _superRefine(fn) {
2799
2930
  }
2800
2931
  };
2801
2932
  return fn(payload.value, payload);
2802
- });
2933
+ }, params);
2803
2934
  return ch;
2804
2935
  }
2805
- /* @__NO_SIDE_EFFECTS__ */
2936
+ // @__NO_SIDE_EFFECTS__
2806
2937
  function _check(fn, params) {
2807
2938
  const ch = new $ZodCheck({
2808
2939
  check: "custom",
@@ -2812,7 +2943,7 @@ function _check(fn, params) {
2812
2943
  return ch;
2813
2944
  }
2814
2945
  //#endregion
2815
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/to-json-schema.js
2946
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.js
2816
2947
  function initializeContext(params) {
2817
2948
  let target = params?.target ?? "draft-2020-12";
2818
2949
  if (target === "draft-4") target = "draft-04";
@@ -2878,7 +3009,7 @@ function process$1(schema, ctx, _params = {
2878
3009
  delete result.schema.examples;
2879
3010
  delete result.schema.default;
2880
3011
  }
2881
- if (ctx.io === "input" && result.schema._prefault) (_a = result.schema).default ?? (_a.default = result.schema._prefault);
3012
+ if (ctx.io === "input" && "_prefault" in result.schema) (_a = result.schema).default ?? (_a.default = result.schema._prefault);
2882
3013
  delete result.schema._prefault;
2883
3014
  return ctx.seen.get(schema).schema;
2884
3015
  }
@@ -3018,10 +3149,15 @@ function finalize(ctx, schema) {
3018
3149
  result.$id = ctx.external.uri(id);
3019
3150
  }
3020
3151
  Object.assign(result, root.def ?? root.schema);
3152
+ const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
3153
+ if (rootMetaId !== void 0 && result.id === rootMetaId) delete result.id;
3021
3154
  const defs = ctx.external?.defs ?? {};
3022
3155
  for (const entry of ctx.seen.entries()) {
3023
3156
  const seen = entry[1];
3024
- if (seen.def && seen.defId) defs[seen.defId] = seen.def;
3157
+ if (seen.def && seen.defId) {
3158
+ if (seen.def.id === seen.defId) delete seen.def.id;
3159
+ defs[seen.defId] = seen.def;
3160
+ }
3025
3161
  }
3026
3162
  if (ctx.external) {} else if (Object.keys(defs).length > 0) if (ctx.target === "draft-2020-12") result.$defs = defs;
3027
3163
  else result.definitions = defs;
@@ -3055,7 +3191,10 @@ function isTransforming(_schema, _ctx) {
3055
3191
  if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault") return isTransforming(def.innerType, ctx);
3056
3192
  if (def.type === "intersection") return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
3057
3193
  if (def.type === "record" || def.type === "map") return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
3058
- if (def.type === "pipe") return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
3194
+ if (def.type === "pipe") {
3195
+ if (_schema._zod.traits.has("$ZodCodec")) return true;
3196
+ return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
3197
+ }
3059
3198
  if (def.type === "object") {
3060
3199
  for (const key in def.shape) if (isTransforming(def.shape[key], ctx)) return true;
3061
3200
  return false;
@@ -3097,7 +3236,7 @@ var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) =
3097
3236
  return finalize(ctx, schema);
3098
3237
  };
3099
3238
  //#endregion
3100
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/core/json-schema-processors.js
3239
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema-processors.js
3101
3240
  var formatMap = {
3102
3241
  guid: "uuid",
3103
3242
  url: "uri",
@@ -3131,24 +3270,19 @@ var numberProcessor = (schema, ctx, _json, _params) => {
3131
3270
  const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
3132
3271
  if (typeof format === "string" && format.includes("int")) json.type = "integer";
3133
3272
  else json.type = "number";
3134
- if (typeof exclusiveMinimum === "number") if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
3273
+ const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
3274
+ const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
3275
+ const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
3276
+ if (exMin) if (legacy) {
3135
3277
  json.minimum = exclusiveMinimum;
3136
3278
  json.exclusiveMinimum = true;
3137
3279
  } else json.exclusiveMinimum = exclusiveMinimum;
3138
- if (typeof minimum === "number") {
3139
- json.minimum = minimum;
3140
- if (typeof exclusiveMinimum === "number" && ctx.target !== "draft-04") if (exclusiveMinimum >= minimum) delete json.minimum;
3141
- else delete json.exclusiveMinimum;
3142
- }
3143
- if (typeof exclusiveMaximum === "number") if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") {
3280
+ else if (typeof minimum === "number") json.minimum = minimum;
3281
+ if (exMax) if (legacy) {
3144
3282
  json.maximum = exclusiveMaximum;
3145
3283
  json.exclusiveMaximum = true;
3146
3284
  } else json.exclusiveMaximum = exclusiveMaximum;
3147
- if (typeof maximum === "number") {
3148
- json.maximum = maximum;
3149
- if (typeof exclusiveMaximum === "number" && ctx.target !== "draft-04") if (exclusiveMaximum <= maximum) delete json.maximum;
3150
- else delete json.exclusiveMaximum;
3151
- }
3285
+ else if (typeof maximum === "number") json.maximum = maximum;
3152
3286
  if (typeof multipleOf === "number") json.multipleOf = multipleOf;
3153
3287
  };
3154
3288
  var booleanProcessor = (_schema, _ctx, json, _params) => {
@@ -3164,7 +3298,6 @@ var nullProcessor = (_schema, ctx, json, _params) => {
3164
3298
  var neverProcessor = (_schema, _ctx, json, _params) => {
3165
3299
  json.not = {};
3166
3300
  };
3167
- var unknownProcessor = (_schema, _ctx, _json, _params) => {};
3168
3301
  var enumProcessor = (schema, _ctx, json, _params) => {
3169
3302
  const def = schema._zod.def;
3170
3303
  const values = getEnumValues(def.entries);
@@ -3352,7 +3485,8 @@ var catchProcessor = (schema, ctx, json, params) => {
3352
3485
  };
3353
3486
  var pipeProcessor = (schema, ctx, _json, params) => {
3354
3487
  const def = schema._zod.def;
3355
- const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
3488
+ const inIsTransform = def.in._zod.traits.has("$ZodTransform");
3489
+ const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
3356
3490
  process$1(innerType, ctx, params);
3357
3491
  const seen = ctx.seen.get(schema);
3358
3492
  seen.ref = innerType;
@@ -3371,29 +3505,29 @@ var optionalProcessor = (schema, ctx, _json, params) => {
3371
3505
  seen.ref = def.innerType;
3372
3506
  };
3373
3507
  //#endregion
3374
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/iso.js
3375
- var ZodISODateTime = /* @__PURE__ */ $constructor("ZodISODateTime", (inst, def) => {
3508
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/iso.js
3509
+ var ZodISODateTime = /*@__PURE__*/ $constructor("ZodISODateTime", (inst, def) => {
3376
3510
  $ZodISODateTime.init(inst, def);
3377
3511
  ZodStringFormat.init(inst, def);
3378
3512
  });
3379
3513
  function datetime(params) {
3380
3514
  return /* @__PURE__ */ _isoDateTime(ZodISODateTime, params);
3381
3515
  }
3382
- var ZodISODate = /* @__PURE__ */ $constructor("ZodISODate", (inst, def) => {
3516
+ var ZodISODate = /*@__PURE__*/ $constructor("ZodISODate", (inst, def) => {
3383
3517
  $ZodISODate.init(inst, def);
3384
3518
  ZodStringFormat.init(inst, def);
3385
3519
  });
3386
3520
  function date(params) {
3387
3521
  return /* @__PURE__ */ _isoDate(ZodISODate, params);
3388
3522
  }
3389
- var ZodISOTime = /* @__PURE__ */ $constructor("ZodISOTime", (inst, def) => {
3523
+ var ZodISOTime = /*@__PURE__*/ $constructor("ZodISOTime", (inst, def) => {
3390
3524
  $ZodISOTime.init(inst, def);
3391
3525
  ZodStringFormat.init(inst, def);
3392
3526
  });
3393
3527
  function time(params) {
3394
3528
  return /* @__PURE__ */ _isoTime(ZodISOTime, params);
3395
3529
  }
3396
- var ZodISODuration = /* @__PURE__ */ $constructor("ZodISODuration", (inst, def) => {
3530
+ var ZodISODuration = /*@__PURE__*/ $constructor("ZodISODuration", (inst, def) => {
3397
3531
  $ZodISODuration.init(inst, def);
3398
3532
  ZodStringFormat.init(inst, def);
3399
3533
  });
@@ -3401,7 +3535,7 @@ function duration(params) {
3401
3535
  return /* @__PURE__ */ _isoDuration(ZodISODuration, params);
3402
3536
  }
3403
3537
  //#endregion
3404
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/errors.js
3538
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/errors.js
3405
3539
  var initializer = (inst, issues) => {
3406
3540
  $ZodError.init(inst, issues);
3407
3541
  inst.name = "ZodError";
@@ -3421,10 +3555,9 @@ var initializer = (inst, issues) => {
3421
3555
  } }
3422
3556
  });
3423
3557
  };
3424
- $constructor("ZodError", initializer);
3425
- var ZodRealError = $constructor("ZodError", initializer, { Parent: Error });
3558
+ var ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, { Parent: Error });
3426
3559
  //#endregion
3427
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/parse.js
3560
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/parse.js
3428
3561
  var parse = /* @__PURE__ */ _parse(ZodRealError);
3429
3562
  var parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
3430
3563
  var safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
@@ -3438,8 +3571,44 @@ var safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
3438
3571
  var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
3439
3572
  var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
3440
3573
  //#endregion
3441
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/classic/schemas.js
3442
- var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
3574
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/schemas.js
3575
+ var _installedGroups = /* @__PURE__ */ new WeakMap();
3576
+ function _installLazyMethods(inst, group, methods) {
3577
+ const proto = Object.getPrototypeOf(inst);
3578
+ let installed = _installedGroups.get(proto);
3579
+ if (!installed) {
3580
+ installed = /* @__PURE__ */ new Set();
3581
+ _installedGroups.set(proto, installed);
3582
+ }
3583
+ if (installed.has(group)) return;
3584
+ installed.add(group);
3585
+ for (const key in methods) {
3586
+ const fn = methods[key];
3587
+ Object.defineProperty(proto, key, {
3588
+ configurable: true,
3589
+ enumerable: false,
3590
+ get() {
3591
+ const bound = fn.bind(this);
3592
+ Object.defineProperty(this, key, {
3593
+ configurable: true,
3594
+ writable: true,
3595
+ enumerable: true,
3596
+ value: bound
3597
+ });
3598
+ return bound;
3599
+ },
3600
+ set(v) {
3601
+ Object.defineProperty(this, key, {
3602
+ configurable: true,
3603
+ writable: true,
3604
+ enumerable: true,
3605
+ value: v
3606
+ });
3607
+ }
3608
+ });
3609
+ }
3610
+ }
3611
+ var ZodType = /*@__PURE__*/ $constructor("ZodType", (inst, def) => {
3443
3612
  $ZodType.init(inst, def);
3444
3613
  Object.assign(inst["~standard"], { jsonSchema: {
3445
3614
  input: createStandardJSONSchemaMethod(inst, "input"),
@@ -3449,20 +3618,6 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
3449
3618
  inst.def = def;
3450
3619
  inst.type = def.type;
3451
3620
  Object.defineProperty(inst, "_def", { value: def });
3452
- inst.check = (...checks) => {
3453
- return inst.clone(mergeDefs(def, { checks: [...def.checks ?? [], ...checks.map((ch) => typeof ch === "function" ? { _zod: {
3454
- check: ch,
3455
- def: { check: "custom" },
3456
- onattach: []
3457
- } } : ch)] }), { parent: true });
3458
- };
3459
- inst.with = inst.check;
3460
- inst.clone = (def, params) => clone(inst, def, params);
3461
- inst.brand = () => inst;
3462
- inst.register = ((reg, meta) => {
3463
- reg.add(inst, meta);
3464
- return inst;
3465
- });
3466
3621
  inst.parse = (data, params) => parse(inst, data, params, { callee: inst.parse });
3467
3622
  inst.safeParse = (data, params) => safeParse(inst, data, params);
3468
3623
  inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync });
@@ -3476,47 +3631,110 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
3476
3631
  inst.safeDecode = (data, params) => safeDecode(inst, data, params);
3477
3632
  inst.safeEncodeAsync = async (data, params) => safeEncodeAsync(inst, data, params);
3478
3633
  inst.safeDecodeAsync = async (data, params) => safeDecodeAsync(inst, data, params);
3479
- inst.refine = (check, params) => inst.check(refine(check, params));
3480
- inst.superRefine = (refinement) => inst.check(superRefine(refinement));
3481
- inst.overwrite = (fn) => inst.check(/* @__PURE__ */ _overwrite(fn));
3482
- inst.optional = () => optional(inst);
3483
- inst.exactOptional = () => exactOptional(inst);
3484
- inst.nullable = () => nullable(inst);
3485
- inst.nullish = () => optional(nullable(inst));
3486
- inst.nonoptional = (params) => nonoptional(inst, params);
3487
- inst.array = () => array(inst);
3488
- inst.or = (arg) => union([inst, arg]);
3489
- inst.and = (arg) => intersection(inst, arg);
3490
- inst.transform = (tx) => pipe(inst, transform(tx));
3491
- inst.default = (def) => _default(inst, def);
3492
- inst.prefault = (def) => prefault(inst, def);
3493
- inst.catch = (params) => _catch(inst, params);
3494
- inst.pipe = (target) => pipe(inst, target);
3495
- inst.readonly = () => readonly(inst);
3496
- inst.describe = (description) => {
3497
- const cl = inst.clone();
3498
- globalRegistry.add(cl, { description });
3499
- return cl;
3500
- };
3634
+ _installLazyMethods(inst, "ZodType", {
3635
+ check(...chks) {
3636
+ const def = this.def;
3637
+ return this.clone(mergeDefs(def, { checks: [...def.checks ?? [], ...chks.map((ch) => typeof ch === "function" ? { _zod: {
3638
+ check: ch,
3639
+ def: { check: "custom" },
3640
+ onattach: []
3641
+ } } : ch)] }), { parent: true });
3642
+ },
3643
+ with(...chks) {
3644
+ return this.check(...chks);
3645
+ },
3646
+ clone(def, params) {
3647
+ return clone(this, def, params);
3648
+ },
3649
+ brand() {
3650
+ return this;
3651
+ },
3652
+ register(reg, meta) {
3653
+ reg.add(this, meta);
3654
+ return this;
3655
+ },
3656
+ refine(check, params) {
3657
+ return this.check(refine(check, params));
3658
+ },
3659
+ superRefine(refinement, params) {
3660
+ return this.check(superRefine(refinement, params));
3661
+ },
3662
+ overwrite(fn) {
3663
+ return this.check(/* @__PURE__ */ _overwrite(fn));
3664
+ },
3665
+ optional() {
3666
+ return optional(this);
3667
+ },
3668
+ exactOptional() {
3669
+ return exactOptional(this);
3670
+ },
3671
+ nullable() {
3672
+ return nullable(this);
3673
+ },
3674
+ nullish() {
3675
+ return optional(nullable(this));
3676
+ },
3677
+ nonoptional(params) {
3678
+ return nonoptional(this, params);
3679
+ },
3680
+ array() {
3681
+ return array(this);
3682
+ },
3683
+ or(arg) {
3684
+ return union([this, arg]);
3685
+ },
3686
+ and(arg) {
3687
+ return intersection(this, arg);
3688
+ },
3689
+ transform(tx) {
3690
+ return pipe(this, transform(tx));
3691
+ },
3692
+ default(d) {
3693
+ return _default(this, d);
3694
+ },
3695
+ prefault(d) {
3696
+ return prefault(this, d);
3697
+ },
3698
+ catch(params) {
3699
+ return _catch(this, params);
3700
+ },
3701
+ pipe(target) {
3702
+ return pipe(this, target);
3703
+ },
3704
+ readonly() {
3705
+ return readonly(this);
3706
+ },
3707
+ describe(description) {
3708
+ const cl = this.clone();
3709
+ globalRegistry.add(cl, { description });
3710
+ return cl;
3711
+ },
3712
+ meta(...args) {
3713
+ if (args.length === 0) return globalRegistry.get(this);
3714
+ const cl = this.clone();
3715
+ globalRegistry.add(cl, args[0]);
3716
+ return cl;
3717
+ },
3718
+ isOptional() {
3719
+ return this.safeParse(void 0).success;
3720
+ },
3721
+ isNullable() {
3722
+ return this.safeParse(null).success;
3723
+ },
3724
+ apply(fn) {
3725
+ return fn(this);
3726
+ }
3727
+ });
3501
3728
  Object.defineProperty(inst, "description", {
3502
3729
  get() {
3503
3730
  return globalRegistry.get(inst)?.description;
3504
3731
  },
3505
3732
  configurable: true
3506
3733
  });
3507
- inst.meta = (...args) => {
3508
- if (args.length === 0) return globalRegistry.get(inst);
3509
- const cl = inst.clone();
3510
- globalRegistry.add(cl, args[0]);
3511
- return cl;
3512
- };
3513
- inst.isOptional = () => inst.safeParse(void 0).success;
3514
- inst.isNullable = () => inst.safeParse(null).success;
3515
- inst.apply = (fn) => fn(inst);
3516
3734
  return inst;
3517
3735
  });
3518
3736
  /** @internal */
3519
- var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
3737
+ var _ZodString = /*@__PURE__*/ $constructor("_ZodString", (inst, def) => {
3520
3738
  $ZodString.init(inst, def);
3521
3739
  ZodType.init(inst, def);
3522
3740
  inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params);
@@ -3524,23 +3742,55 @@ var _ZodString = /* @__PURE__ */ $constructor("_ZodString", (inst, def) => {
3524
3742
  inst.format = bag.format ?? null;
3525
3743
  inst.minLength = bag.minimum ?? null;
3526
3744
  inst.maxLength = bag.maximum ?? null;
3527
- inst.regex = (...args) => inst.check(/* @__PURE__ */ _regex(...args));
3528
- inst.includes = (...args) => inst.check(/* @__PURE__ */ _includes(...args));
3529
- inst.startsWith = (...args) => inst.check(/* @__PURE__ */ _startsWith(...args));
3530
- inst.endsWith = (...args) => inst.check(/* @__PURE__ */ _endsWith(...args));
3531
- inst.min = (...args) => inst.check(/* @__PURE__ */ _minLength(...args));
3532
- inst.max = (...args) => inst.check(/* @__PURE__ */ _maxLength(...args));
3533
- inst.length = (...args) => inst.check(/* @__PURE__ */ _length(...args));
3534
- inst.nonempty = (...args) => inst.check(/* @__PURE__ */ _minLength(1, ...args));
3535
- inst.lowercase = (params) => inst.check(/* @__PURE__ */ _lowercase(params));
3536
- inst.uppercase = (params) => inst.check(/* @__PURE__ */ _uppercase(params));
3537
- inst.trim = () => inst.check(/* @__PURE__ */ _trim());
3538
- inst.normalize = (...args) => inst.check(/* @__PURE__ */ _normalize(...args));
3539
- inst.toLowerCase = () => inst.check(/* @__PURE__ */ _toLowerCase());
3540
- inst.toUpperCase = () => inst.check(/* @__PURE__ */ _toUpperCase());
3541
- inst.slugify = () => inst.check(/* @__PURE__ */ _slugify());
3542
- });
3543
- var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
3745
+ _installLazyMethods(inst, "_ZodString", {
3746
+ regex(...args) {
3747
+ return this.check(/* @__PURE__ */ _regex(...args));
3748
+ },
3749
+ includes(...args) {
3750
+ return this.check(/* @__PURE__ */ _includes(...args));
3751
+ },
3752
+ startsWith(...args) {
3753
+ return this.check(/* @__PURE__ */ _startsWith(...args));
3754
+ },
3755
+ endsWith(...args) {
3756
+ return this.check(/* @__PURE__ */ _endsWith(...args));
3757
+ },
3758
+ min(...args) {
3759
+ return this.check(/* @__PURE__ */ _minLength(...args));
3760
+ },
3761
+ max(...args) {
3762
+ return this.check(/* @__PURE__ */ _maxLength(...args));
3763
+ },
3764
+ length(...args) {
3765
+ return this.check(/* @__PURE__ */ _length(...args));
3766
+ },
3767
+ nonempty(...args) {
3768
+ return this.check(/* @__PURE__ */ _minLength(1, ...args));
3769
+ },
3770
+ lowercase(params) {
3771
+ return this.check(/* @__PURE__ */ _lowercase(params));
3772
+ },
3773
+ uppercase(params) {
3774
+ return this.check(/* @__PURE__ */ _uppercase(params));
3775
+ },
3776
+ trim() {
3777
+ return this.check(/* @__PURE__ */ _trim());
3778
+ },
3779
+ normalize(...args) {
3780
+ return this.check(/* @__PURE__ */ _normalize(...args));
3781
+ },
3782
+ toLowerCase() {
3783
+ return this.check(/* @__PURE__ */ _toLowerCase());
3784
+ },
3785
+ toUpperCase() {
3786
+ return this.check(/* @__PURE__ */ _toUpperCase());
3787
+ },
3788
+ slugify() {
3789
+ return this.check(/* @__PURE__ */ _slugify());
3790
+ }
3791
+ });
3792
+ });
3793
+ var ZodString = /*@__PURE__*/ $constructor("ZodString", (inst, def) => {
3544
3794
  $ZodString.init(inst, def);
3545
3795
  _ZodString.init(inst, def);
3546
3796
  inst.email = (params) => inst.check(/* @__PURE__ */ _email(ZodEmail, params));
@@ -3574,105 +3824,142 @@ var ZodString = /* @__PURE__ */ $constructor("ZodString", (inst, def) => {
3574
3824
  function string$1(params) {
3575
3825
  return /* @__PURE__ */ _string(ZodString, params);
3576
3826
  }
3577
- var ZodStringFormat = /* @__PURE__ */ $constructor("ZodStringFormat", (inst, def) => {
3827
+ var ZodStringFormat = /*@__PURE__*/ $constructor("ZodStringFormat", (inst, def) => {
3578
3828
  $ZodStringFormat.init(inst, def);
3579
3829
  _ZodString.init(inst, def);
3580
3830
  });
3581
- var ZodEmail = /* @__PURE__ */ $constructor("ZodEmail", (inst, def) => {
3831
+ var ZodEmail = /*@__PURE__*/ $constructor("ZodEmail", (inst, def) => {
3582
3832
  $ZodEmail.init(inst, def);
3583
3833
  ZodStringFormat.init(inst, def);
3584
3834
  });
3585
- var ZodGUID = /* @__PURE__ */ $constructor("ZodGUID", (inst, def) => {
3835
+ var ZodGUID = /*@__PURE__*/ $constructor("ZodGUID", (inst, def) => {
3586
3836
  $ZodGUID.init(inst, def);
3587
3837
  ZodStringFormat.init(inst, def);
3588
3838
  });
3589
- var ZodUUID = /* @__PURE__ */ $constructor("ZodUUID", (inst, def) => {
3839
+ var ZodUUID = /*@__PURE__*/ $constructor("ZodUUID", (inst, def) => {
3590
3840
  $ZodUUID.init(inst, def);
3591
3841
  ZodStringFormat.init(inst, def);
3592
3842
  });
3593
- var ZodURL = /* @__PURE__ */ $constructor("ZodURL", (inst, def) => {
3843
+ var ZodURL = /*@__PURE__*/ $constructor("ZodURL", (inst, def) => {
3594
3844
  $ZodURL.init(inst, def);
3595
3845
  ZodStringFormat.init(inst, def);
3596
3846
  });
3597
- var ZodEmoji = /* @__PURE__ */ $constructor("ZodEmoji", (inst, def) => {
3847
+ var ZodEmoji = /*@__PURE__*/ $constructor("ZodEmoji", (inst, def) => {
3598
3848
  $ZodEmoji.init(inst, def);
3599
3849
  ZodStringFormat.init(inst, def);
3600
3850
  });
3601
- var ZodNanoID = /* @__PURE__ */ $constructor("ZodNanoID", (inst, def) => {
3851
+ var ZodNanoID = /*@__PURE__*/ $constructor("ZodNanoID", (inst, def) => {
3602
3852
  $ZodNanoID.init(inst, def);
3603
3853
  ZodStringFormat.init(inst, def);
3604
3854
  });
3605
- var ZodCUID = /* @__PURE__ */ $constructor("ZodCUID", (inst, def) => {
3855
+ /**
3856
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
3857
+ * (timestamps embedded in the id). Use {@link ZodCUID2} instead.
3858
+ * See https://github.com/paralleldrive/cuid.
3859
+ */
3860
+ var ZodCUID = /*@__PURE__*/ $constructor("ZodCUID", (inst, def) => {
3606
3861
  $ZodCUID.init(inst, def);
3607
3862
  ZodStringFormat.init(inst, def);
3608
3863
  });
3609
- var ZodCUID2 = /* @__PURE__ */ $constructor("ZodCUID2", (inst, def) => {
3864
+ var ZodCUID2 = /*@__PURE__*/ $constructor("ZodCUID2", (inst, def) => {
3610
3865
  $ZodCUID2.init(inst, def);
3611
3866
  ZodStringFormat.init(inst, def);
3612
3867
  });
3613
- var ZodULID = /* @__PURE__ */ $constructor("ZodULID", (inst, def) => {
3868
+ var ZodULID = /*@__PURE__*/ $constructor("ZodULID", (inst, def) => {
3614
3869
  $ZodULID.init(inst, def);
3615
3870
  ZodStringFormat.init(inst, def);
3616
3871
  });
3617
- var ZodXID = /* @__PURE__ */ $constructor("ZodXID", (inst, def) => {
3872
+ var ZodXID = /*@__PURE__*/ $constructor("ZodXID", (inst, def) => {
3618
3873
  $ZodXID.init(inst, def);
3619
3874
  ZodStringFormat.init(inst, def);
3620
3875
  });
3621
- var ZodKSUID = /* @__PURE__ */ $constructor("ZodKSUID", (inst, def) => {
3876
+ var ZodKSUID = /*@__PURE__*/ $constructor("ZodKSUID", (inst, def) => {
3622
3877
  $ZodKSUID.init(inst, def);
3623
3878
  ZodStringFormat.init(inst, def);
3624
3879
  });
3625
- var ZodIPv4 = /* @__PURE__ */ $constructor("ZodIPv4", (inst, def) => {
3880
+ var ZodIPv4 = /*@__PURE__*/ $constructor("ZodIPv4", (inst, def) => {
3626
3881
  $ZodIPv4.init(inst, def);
3627
3882
  ZodStringFormat.init(inst, def);
3628
3883
  });
3629
- var ZodIPv6 = /* @__PURE__ */ $constructor("ZodIPv6", (inst, def) => {
3884
+ var ZodIPv6 = /*@__PURE__*/ $constructor("ZodIPv6", (inst, def) => {
3630
3885
  $ZodIPv6.init(inst, def);
3631
3886
  ZodStringFormat.init(inst, def);
3632
3887
  });
3633
- var ZodCIDRv4 = /* @__PURE__ */ $constructor("ZodCIDRv4", (inst, def) => {
3888
+ var ZodCIDRv4 = /*@__PURE__*/ $constructor("ZodCIDRv4", (inst, def) => {
3634
3889
  $ZodCIDRv4.init(inst, def);
3635
3890
  ZodStringFormat.init(inst, def);
3636
3891
  });
3637
- var ZodCIDRv6 = /* @__PURE__ */ $constructor("ZodCIDRv6", (inst, def) => {
3892
+ var ZodCIDRv6 = /*@__PURE__*/ $constructor("ZodCIDRv6", (inst, def) => {
3638
3893
  $ZodCIDRv6.init(inst, def);
3639
3894
  ZodStringFormat.init(inst, def);
3640
3895
  });
3641
- var ZodBase64 = /* @__PURE__ */ $constructor("ZodBase64", (inst, def) => {
3896
+ var ZodBase64 = /*@__PURE__*/ $constructor("ZodBase64", (inst, def) => {
3642
3897
  $ZodBase64.init(inst, def);
3643
3898
  ZodStringFormat.init(inst, def);
3644
3899
  });
3645
- var ZodBase64URL = /* @__PURE__ */ $constructor("ZodBase64URL", (inst, def) => {
3900
+ var ZodBase64URL = /*@__PURE__*/ $constructor("ZodBase64URL", (inst, def) => {
3646
3901
  $ZodBase64URL.init(inst, def);
3647
3902
  ZodStringFormat.init(inst, def);
3648
3903
  });
3649
- var ZodE164 = /* @__PURE__ */ $constructor("ZodE164", (inst, def) => {
3904
+ var ZodE164 = /*@__PURE__*/ $constructor("ZodE164", (inst, def) => {
3650
3905
  $ZodE164.init(inst, def);
3651
3906
  ZodStringFormat.init(inst, def);
3652
3907
  });
3653
- var ZodJWT = /* @__PURE__ */ $constructor("ZodJWT", (inst, def) => {
3908
+ var ZodJWT = /*@__PURE__*/ $constructor("ZodJWT", (inst, def) => {
3654
3909
  $ZodJWT.init(inst, def);
3655
3910
  ZodStringFormat.init(inst, def);
3656
3911
  });
3657
- var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
3912
+ var ZodNumber = /*@__PURE__*/ $constructor("ZodNumber", (inst, def) => {
3658
3913
  $ZodNumber.init(inst, def);
3659
3914
  ZodType.init(inst, def);
3660
3915
  inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
3661
- inst.gt = (value, params) => inst.check(/* @__PURE__ */ _gt(value, params));
3662
- inst.gte = (value, params) => inst.check(/* @__PURE__ */ _gte(value, params));
3663
- inst.min = (value, params) => inst.check(/* @__PURE__ */ _gte(value, params));
3664
- inst.lt = (value, params) => inst.check(/* @__PURE__ */ _lt(value, params));
3665
- inst.lte = (value, params) => inst.check(/* @__PURE__ */ _lte(value, params));
3666
- inst.max = (value, params) => inst.check(/* @__PURE__ */ _lte(value, params));
3667
- inst.int = (params) => inst.check(int(params));
3668
- inst.safe = (params) => inst.check(int(params));
3669
- inst.positive = (params) => inst.check(/* @__PURE__ */ _gt(0, params));
3670
- inst.nonnegative = (params) => inst.check(/* @__PURE__ */ _gte(0, params));
3671
- inst.negative = (params) => inst.check(/* @__PURE__ */ _lt(0, params));
3672
- inst.nonpositive = (params) => inst.check(/* @__PURE__ */ _lte(0, params));
3673
- inst.multipleOf = (value, params) => inst.check(/* @__PURE__ */ _multipleOf(value, params));
3674
- inst.step = (value, params) => inst.check(/* @__PURE__ */ _multipleOf(value, params));
3675
- inst.finite = () => inst;
3916
+ _installLazyMethods(inst, "ZodNumber", {
3917
+ gt(value, params) {
3918
+ return this.check(/* @__PURE__ */ _gt(value, params));
3919
+ },
3920
+ gte(value, params) {
3921
+ return this.check(/* @__PURE__ */ _gte(value, params));
3922
+ },
3923
+ min(value, params) {
3924
+ return this.check(/* @__PURE__ */ _gte(value, params));
3925
+ },
3926
+ lt(value, params) {
3927
+ return this.check(/* @__PURE__ */ _lt(value, params));
3928
+ },
3929
+ lte(value, params) {
3930
+ return this.check(/* @__PURE__ */ _lte(value, params));
3931
+ },
3932
+ max(value, params) {
3933
+ return this.check(/* @__PURE__ */ _lte(value, params));
3934
+ },
3935
+ int(params) {
3936
+ return this.check(int(params));
3937
+ },
3938
+ safe(params) {
3939
+ return this.check(int(params));
3940
+ },
3941
+ positive(params) {
3942
+ return this.check(/* @__PURE__ */ _gt(0, params));
3943
+ },
3944
+ nonnegative(params) {
3945
+ return this.check(/* @__PURE__ */ _gte(0, params));
3946
+ },
3947
+ negative(params) {
3948
+ return this.check(/* @__PURE__ */ _lt(0, params));
3949
+ },
3950
+ nonpositive(params) {
3951
+ return this.check(/* @__PURE__ */ _lte(0, params));
3952
+ },
3953
+ multipleOf(value, params) {
3954
+ return this.check(/* @__PURE__ */ _multipleOf(value, params));
3955
+ },
3956
+ step(value, params) {
3957
+ return this.check(/* @__PURE__ */ _multipleOf(value, params));
3958
+ },
3959
+ finite() {
3960
+ return this;
3961
+ }
3962
+ });
3676
3963
  const bag = inst._zod.bag;
3677
3964
  inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
3678
3965
  inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
@@ -3683,14 +3970,14 @@ var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
3683
3970
  function number(params) {
3684
3971
  return /* @__PURE__ */ _number(ZodNumber, params);
3685
3972
  }
3686
- var ZodNumberFormat = /* @__PURE__ */ $constructor("ZodNumberFormat", (inst, def) => {
3973
+ var ZodNumberFormat = /*@__PURE__*/ $constructor("ZodNumberFormat", (inst, def) => {
3687
3974
  $ZodNumberFormat.init(inst, def);
3688
3975
  ZodNumber.init(inst, def);
3689
3976
  });
3690
3977
  function int(params) {
3691
3978
  return /* @__PURE__ */ _int(ZodNumberFormat, params);
3692
3979
  }
3693
- var ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
3980
+ var ZodBoolean = /*@__PURE__*/ $constructor("ZodBoolean", (inst, def) => {
3694
3981
  $ZodBoolean.init(inst, def);
3695
3982
  ZodType.init(inst, def);
3696
3983
  inst._zod.processJSONSchema = (ctx, json, params) => booleanProcessor(inst, ctx, json, params);
@@ -3698,7 +3985,7 @@ var ZodBoolean = /* @__PURE__ */ $constructor("ZodBoolean", (inst, def) => {
3698
3985
  function boolean(params) {
3699
3986
  return /* @__PURE__ */ _boolean(ZodBoolean, params);
3700
3987
  }
3701
- var ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => {
3988
+ var ZodNull = /*@__PURE__*/ $constructor("ZodNull", (inst, def) => {
3702
3989
  $ZodNull.init(inst, def);
3703
3990
  ZodType.init(inst, def);
3704
3991
  inst._zod.processJSONSchema = (ctx, json, params) => nullProcessor(inst, ctx, json, params);
@@ -3706,15 +3993,15 @@ var ZodNull = /* @__PURE__ */ $constructor("ZodNull", (inst, def) => {
3706
3993
  function _null(params) {
3707
3994
  return /* @__PURE__ */ _null$1(ZodNull, params);
3708
3995
  }
3709
- var ZodUnknown = /* @__PURE__ */ $constructor("ZodUnknown", (inst, def) => {
3996
+ var ZodUnknown = /*@__PURE__*/ $constructor("ZodUnknown", (inst, def) => {
3710
3997
  $ZodUnknown.init(inst, def);
3711
3998
  ZodType.init(inst, def);
3712
- inst._zod.processJSONSchema = (ctx, json, params) => unknownProcessor(inst, ctx, json, params);
3999
+ inst._zod.processJSONSchema = (ctx, json, params) => void 0;
3713
4000
  });
3714
4001
  function unknown() {
3715
4002
  return /* @__PURE__ */ _unknown(ZodUnknown);
3716
4003
  }
3717
- var ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
4004
+ var ZodNever = /*@__PURE__*/ $constructor("ZodNever", (inst, def) => {
3718
4005
  $ZodNever.init(inst, def);
3719
4006
  ZodType.init(inst, def);
3720
4007
  inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor(inst, ctx, json, params);
@@ -3722,59 +4009,95 @@ var ZodNever = /* @__PURE__ */ $constructor("ZodNever", (inst, def) => {
3722
4009
  function never(params) {
3723
4010
  return /* @__PURE__ */ _never(ZodNever, params);
3724
4011
  }
3725
- var ZodArray = /* @__PURE__ */ $constructor("ZodArray", (inst, def) => {
4012
+ var ZodArray = /*@__PURE__*/ $constructor("ZodArray", (inst, def) => {
3726
4013
  $ZodArray.init(inst, def);
3727
4014
  ZodType.init(inst, def);
3728
4015
  inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params);
3729
4016
  inst.element = def.element;
3730
- inst.min = (minLength, params) => inst.check(/* @__PURE__ */ _minLength(minLength, params));
3731
- inst.nonempty = (params) => inst.check(/* @__PURE__ */ _minLength(1, params));
3732
- inst.max = (maxLength, params) => inst.check(/* @__PURE__ */ _maxLength(maxLength, params));
3733
- inst.length = (len, params) => inst.check(/* @__PURE__ */ _length(len, params));
3734
- inst.unwrap = () => inst.element;
4017
+ _installLazyMethods(inst, "ZodArray", {
4018
+ min(n, params) {
4019
+ return this.check(/* @__PURE__ */ _minLength(n, params));
4020
+ },
4021
+ nonempty(params) {
4022
+ return this.check(/* @__PURE__ */ _minLength(1, params));
4023
+ },
4024
+ max(n, params) {
4025
+ return this.check(/* @__PURE__ */ _maxLength(n, params));
4026
+ },
4027
+ length(n, params) {
4028
+ return this.check(/* @__PURE__ */ _length(n, params));
4029
+ },
4030
+ unwrap() {
4031
+ return this.element;
4032
+ }
4033
+ });
3735
4034
  });
3736
4035
  function array(element, params) {
3737
4036
  return /* @__PURE__ */ _array(ZodArray, element, params);
3738
4037
  }
3739
- var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
4038
+ var ZodObject = /*@__PURE__*/ $constructor("ZodObject", (inst, def) => {
3740
4039
  $ZodObjectJIT.init(inst, def);
3741
4040
  ZodType.init(inst, def);
3742
4041
  inst._zod.processJSONSchema = (ctx, json, params) => objectProcessor(inst, ctx, json, params);
3743
4042
  defineLazy(inst, "shape", () => {
3744
4043
  return def.shape;
3745
4044
  });
3746
- inst.keyof = () => _enum(Object.keys(inst._zod.def.shape));
3747
- inst.catchall = (catchall) => inst.clone({
3748
- ...inst._zod.def,
3749
- catchall
3750
- });
3751
- inst.passthrough = () => inst.clone({
3752
- ...inst._zod.def,
3753
- catchall: unknown()
3754
- });
3755
- inst.loose = () => inst.clone({
3756
- ...inst._zod.def,
3757
- catchall: unknown()
3758
- });
3759
- inst.strict = () => inst.clone({
3760
- ...inst._zod.def,
3761
- catchall: never()
3762
- });
3763
- inst.strip = () => inst.clone({
3764
- ...inst._zod.def,
3765
- catchall: void 0
4045
+ _installLazyMethods(inst, "ZodObject", {
4046
+ keyof() {
4047
+ return _enum(Object.keys(this._zod.def.shape));
4048
+ },
4049
+ catchall(catchall) {
4050
+ return this.clone({
4051
+ ...this._zod.def,
4052
+ catchall
4053
+ });
4054
+ },
4055
+ passthrough() {
4056
+ return this.clone({
4057
+ ...this._zod.def,
4058
+ catchall: unknown()
4059
+ });
4060
+ },
4061
+ loose() {
4062
+ return this.clone({
4063
+ ...this._zod.def,
4064
+ catchall: unknown()
4065
+ });
4066
+ },
4067
+ strict() {
4068
+ return this.clone({
4069
+ ...this._zod.def,
4070
+ catchall: never()
4071
+ });
4072
+ },
4073
+ strip() {
4074
+ return this.clone({
4075
+ ...this._zod.def,
4076
+ catchall: void 0
4077
+ });
4078
+ },
4079
+ extend(incoming) {
4080
+ return extend(this, incoming);
4081
+ },
4082
+ safeExtend(incoming) {
4083
+ return safeExtend(this, incoming);
4084
+ },
4085
+ merge(other) {
4086
+ return merge(this, other);
4087
+ },
4088
+ pick(mask) {
4089
+ return pick(this, mask);
4090
+ },
4091
+ omit(mask) {
4092
+ return omit(this, mask);
4093
+ },
4094
+ partial(...args) {
4095
+ return partial(ZodOptional, this, args[0]);
4096
+ },
4097
+ required(...args) {
4098
+ return required(ZodNonOptional, this, args[0]);
4099
+ }
3766
4100
  });
3767
- inst.extend = (incoming) => {
3768
- return extend(inst, incoming);
3769
- };
3770
- inst.safeExtend = (incoming) => {
3771
- return safeExtend(inst, incoming);
3772
- };
3773
- inst.merge = (other) => merge(inst, other);
3774
- inst.pick = (mask) => pick(inst, mask);
3775
- inst.omit = (mask) => omit(inst, mask);
3776
- inst.partial = (...args) => partial(ZodOptional, inst, args[0]);
3777
- inst.required = (...args) => required(ZodNonOptional, inst, args[0]);
3778
4101
  });
3779
4102
  function object(shape, params) {
3780
4103
  return new ZodObject({
@@ -3791,7 +4114,7 @@ function looseObject(shape, params) {
3791
4114
  ...normalizeParams(params)
3792
4115
  });
3793
4116
  }
3794
- var ZodUnion = /* @__PURE__ */ $constructor("ZodUnion", (inst, def) => {
4117
+ var ZodUnion = /*@__PURE__*/ $constructor("ZodUnion", (inst, def) => {
3795
4118
  $ZodUnion.init(inst, def);
3796
4119
  ZodType.init(inst, def);
3797
4120
  inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params);
@@ -3804,7 +4127,7 @@ function union(options, params) {
3804
4127
  ...normalizeParams(params)
3805
4128
  });
3806
4129
  }
3807
- var ZodIntersection = /* @__PURE__ */ $constructor("ZodIntersection", (inst, def) => {
4130
+ var ZodIntersection = /*@__PURE__*/ $constructor("ZodIntersection", (inst, def) => {
3808
4131
  $ZodIntersection.init(inst, def);
3809
4132
  ZodType.init(inst, def);
3810
4133
  inst._zod.processJSONSchema = (ctx, json, params) => intersectionProcessor(inst, ctx, json, params);
@@ -3816,7 +4139,7 @@ function intersection(left, right) {
3816
4139
  right
3817
4140
  });
3818
4141
  }
3819
- var ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
4142
+ var ZodRecord = /*@__PURE__*/ $constructor("ZodRecord", (inst, def) => {
3820
4143
  $ZodRecord.init(inst, def);
3821
4144
  ZodType.init(inst, def);
3822
4145
  inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params);
@@ -3824,6 +4147,12 @@ var ZodRecord = /* @__PURE__ */ $constructor("ZodRecord", (inst, def) => {
3824
4147
  inst.valueType = def.valueType;
3825
4148
  });
3826
4149
  function record(keyType, valueType, params) {
4150
+ if (!valueType || !valueType._zod) return new ZodRecord({
4151
+ type: "record",
4152
+ keyType: string$1(),
4153
+ valueType: keyType,
4154
+ ...normalizeParams(valueType)
4155
+ });
3827
4156
  return new ZodRecord({
3828
4157
  type: "record",
3829
4158
  keyType,
@@ -3831,7 +4160,7 @@ function record(keyType, valueType, params) {
3831
4160
  ...normalizeParams(params)
3832
4161
  });
3833
4162
  }
3834
- var ZodEnum = /* @__PURE__ */ $constructor("ZodEnum", (inst, def) => {
4163
+ var ZodEnum = /*@__PURE__*/ $constructor("ZodEnum", (inst, def) => {
3835
4164
  $ZodEnum.init(inst, def);
3836
4165
  ZodType.init(inst, def);
3837
4166
  inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
@@ -3868,7 +4197,7 @@ function _enum(values, params) {
3868
4197
  ...normalizeParams(params)
3869
4198
  });
3870
4199
  }
3871
- var ZodLiteral = /* @__PURE__ */ $constructor("ZodLiteral", (inst, def) => {
4200
+ var ZodLiteral = /*@__PURE__*/ $constructor("ZodLiteral", (inst, def) => {
3872
4201
  $ZodLiteral.init(inst, def);
3873
4202
  ZodType.init(inst, def);
3874
4203
  inst._zod.processJSONSchema = (ctx, json, params) => literalProcessor(inst, ctx, json, params);
@@ -3885,7 +4214,7 @@ function literal(value, params) {
3885
4214
  ...normalizeParams(params)
3886
4215
  });
3887
4216
  }
3888
- var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
4217
+ var ZodTransform = /*@__PURE__*/ $constructor("ZodTransform", (inst, def) => {
3889
4218
  $ZodTransform.init(inst, def);
3890
4219
  ZodType.init(inst, def);
3891
4220
  inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx, json, params);
@@ -3905,9 +4234,11 @@ var ZodTransform = /* @__PURE__ */ $constructor("ZodTransform", (inst, def) => {
3905
4234
  const output = def.transform(payload.value, payload);
3906
4235
  if (output instanceof Promise) return output.then((output) => {
3907
4236
  payload.value = output;
4237
+ payload.fallback = true;
3908
4238
  return payload;
3909
4239
  });
3910
4240
  payload.value = output;
4241
+ payload.fallback = true;
3911
4242
  return payload;
3912
4243
  };
3913
4244
  });
@@ -3917,7 +4248,7 @@ function transform(fn) {
3917
4248
  transform: fn
3918
4249
  });
3919
4250
  }
3920
- var ZodOptional = /* @__PURE__ */ $constructor("ZodOptional", (inst, def) => {
4251
+ var ZodOptional = /*@__PURE__*/ $constructor("ZodOptional", (inst, def) => {
3921
4252
  $ZodOptional.init(inst, def);
3922
4253
  ZodType.init(inst, def);
3923
4254
  inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
@@ -3929,7 +4260,7 @@ function optional(innerType) {
3929
4260
  innerType
3930
4261
  });
3931
4262
  }
3932
- var ZodExactOptional = /* @__PURE__ */ $constructor("ZodExactOptional", (inst, def) => {
4263
+ var ZodExactOptional = /*@__PURE__*/ $constructor("ZodExactOptional", (inst, def) => {
3933
4264
  $ZodExactOptional.init(inst, def);
3934
4265
  ZodType.init(inst, def);
3935
4266
  inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
@@ -3941,7 +4272,7 @@ function exactOptional(innerType) {
3941
4272
  innerType
3942
4273
  });
3943
4274
  }
3944
- var ZodNullable = /* @__PURE__ */ $constructor("ZodNullable", (inst, def) => {
4275
+ var ZodNullable = /*@__PURE__*/ $constructor("ZodNullable", (inst, def) => {
3945
4276
  $ZodNullable.init(inst, def);
3946
4277
  ZodType.init(inst, def);
3947
4278
  inst._zod.processJSONSchema = (ctx, json, params) => nullableProcessor(inst, ctx, json, params);
@@ -3953,7 +4284,7 @@ function nullable(innerType) {
3953
4284
  innerType
3954
4285
  });
3955
4286
  }
3956
- var ZodDefault = /* @__PURE__ */ $constructor("ZodDefault", (inst, def) => {
4287
+ var ZodDefault = /*@__PURE__*/ $constructor("ZodDefault", (inst, def) => {
3957
4288
  $ZodDefault.init(inst, def);
3958
4289
  ZodType.init(inst, def);
3959
4290
  inst._zod.processJSONSchema = (ctx, json, params) => defaultProcessor(inst, ctx, json, params);
@@ -3969,7 +4300,7 @@ function _default(innerType, defaultValue) {
3969
4300
  }
3970
4301
  });
3971
4302
  }
3972
- var ZodPrefault = /* @__PURE__ */ $constructor("ZodPrefault", (inst, def) => {
4303
+ var ZodPrefault = /*@__PURE__*/ $constructor("ZodPrefault", (inst, def) => {
3973
4304
  $ZodPrefault.init(inst, def);
3974
4305
  ZodType.init(inst, def);
3975
4306
  inst._zod.processJSONSchema = (ctx, json, params) => prefaultProcessor(inst, ctx, json, params);
@@ -3984,7 +4315,7 @@ function prefault(innerType, defaultValue) {
3984
4315
  }
3985
4316
  });
3986
4317
  }
3987
- var ZodNonOptional = /* @__PURE__ */ $constructor("ZodNonOptional", (inst, def) => {
4318
+ var ZodNonOptional = /*@__PURE__*/ $constructor("ZodNonOptional", (inst, def) => {
3988
4319
  $ZodNonOptional.init(inst, def);
3989
4320
  ZodType.init(inst, def);
3990
4321
  inst._zod.processJSONSchema = (ctx, json, params) => nonoptionalProcessor(inst, ctx, json, params);
@@ -3997,7 +4328,7 @@ function nonoptional(innerType, params) {
3997
4328
  ...normalizeParams(params)
3998
4329
  });
3999
4330
  }
4000
- var ZodCatch = /* @__PURE__ */ $constructor("ZodCatch", (inst, def) => {
4331
+ var ZodCatch = /*@__PURE__*/ $constructor("ZodCatch", (inst, def) => {
4001
4332
  $ZodCatch.init(inst, def);
4002
4333
  ZodType.init(inst, def);
4003
4334
  inst._zod.processJSONSchema = (ctx, json, params) => catchProcessor(inst, ctx, json, params);
@@ -4011,7 +4342,7 @@ function _catch(innerType, catchValue) {
4011
4342
  catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
4012
4343
  });
4013
4344
  }
4014
- var ZodPipe = /* @__PURE__ */ $constructor("ZodPipe", (inst, def) => {
4345
+ var ZodPipe = /*@__PURE__*/ $constructor("ZodPipe", (inst, def) => {
4015
4346
  $ZodPipe.init(inst, def);
4016
4347
  ZodType.init(inst, def);
4017
4348
  inst._zod.processJSONSchema = (ctx, json, params) => pipeProcessor(inst, ctx, json, params);
@@ -4025,7 +4356,7 @@ function pipe(in_, out) {
4025
4356
  out
4026
4357
  });
4027
4358
  }
4028
- var ZodReadonly = /* @__PURE__ */ $constructor("ZodReadonly", (inst, def) => {
4359
+ var ZodReadonly = /*@__PURE__*/ $constructor("ZodReadonly", (inst, def) => {
4029
4360
  $ZodReadonly.init(inst, def);
4030
4361
  ZodType.init(inst, def);
4031
4362
  inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor(inst, ctx, json, params);
@@ -4037,7 +4368,7 @@ function readonly(innerType) {
4037
4368
  innerType
4038
4369
  });
4039
4370
  }
4040
- var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
4371
+ var ZodCustom = /*@__PURE__*/ $constructor("ZodCustom", (inst, def) => {
4041
4372
  $ZodCustom.init(inst, def);
4042
4373
  ZodType.init(inst, def);
4043
4374
  inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
@@ -4045,11 +4376,11 @@ var ZodCustom = /* @__PURE__ */ $constructor("ZodCustom", (inst, def) => {
4045
4376
  function refine(fn, _params = {}) {
4046
4377
  return /* @__PURE__ */ _refine(ZodCustom, fn, _params);
4047
4378
  }
4048
- function superRefine(fn) {
4049
- return /* @__PURE__ */ _superRefine(fn);
4379
+ function superRefine(fn, params) {
4380
+ return /* @__PURE__ */ _superRefine(fn, params);
4050
4381
  }
4051
4382
  //#endregion
4052
- //#region ../../node_modules/.pnpm/zod-package-json@2.1.0_zod@4.3.6/node_modules/zod-package-json/dist/package-json.js
4383
+ //#region ../../node_modules/.pnpm/zod-package-json@2.1.0_zod@4.4.3/node_modules/zod-package-json/dist/package-json.js
4053
4384
  var Bugs = union([string$1(), object({
4054
4385
  url: optional(string$1()),
4055
4386
  email: optional(string$1())
@@ -4071,8 +4402,11 @@ var Person = union([string$1(), object({
4071
4402
  url: optional(string$1())
4072
4403
  })]);
4073
4404
  var Repository = union([string$1(), object({
4405
+ /** Repository type (e.g., `git`). */
4074
4406
  type: string$1(),
4407
+ /** Machine-readable repository URL (e.g., `https://github.com/user/repo.git`). */
4075
4408
  url: string$1(),
4409
+ /** Directory in a monorepo where the package's source code is located. */
4076
4410
  directory: optional(string$1())
4077
4411
  })]);
4078
4412
  var DevEngineDependency = object({
@@ -4093,56 +4427,119 @@ var DevEngines = object({
4093
4427
  packageManager: optional(DevEngineDependencies)
4094
4428
  });
4095
4429
  var PackageJson = looseObject({
4430
+ /** Package name. */
4096
4431
  name: string$1(),
4432
+ /** Package semver version number. */
4097
4433
  version: string$1(),
4434
+ /** Description for the package. */
4098
4435
  description: optional(string$1()),
4436
+ /** List of keywords for searching the package. */
4099
4437
  keywords: optional(array(string$1())),
4438
+ /** URL of the package's homepage. */
4100
4439
  homepage: optional(string$1()),
4440
+ /** Issue tracker for the package. */
4101
4441
  bugs: optional(Bugs),
4442
+ /** SPDX license expression or a custom license. */
4102
4443
  license: optional(string$1()),
4444
+ /** Author of the package. */
4103
4445
  author: optional(Person),
4446
+ /** Contributors to the package. */
4104
4447
  contributors: optional(array(Person)),
4448
+ /** Maintainers of the package. */
4105
4449
  maintainers: optional(array(Person)),
4450
+ /** Funding options for the package. */
4106
4451
  funding: optional(Funding),
4452
+ /** File patterns for files to be included when publishing the package. */
4107
4453
  files: optional(array(string$1())),
4454
+ /** Package exports. @see {@link https://nodejs.org/api/packages.html#exports} */
4108
4455
  exports: optional(union([
4109
4456
  _null(),
4110
4457
  string$1(),
4111
4458
  array(string$1()),
4112
4459
  record(string$1(), unknown())
4113
4460
  ])),
4461
+ /** Type for all the `.js` files in the package, usually `module`. */
4114
4462
  type: optional(literal(["module", "commonjs"])),
4463
+ /** Main entry point for the package, usually CommonJS. */
4115
4464
  main: optional(string$1()),
4465
+ /**
4466
+ Main entry point for the package when used in a browser environment.
4467
+ @see {@link https://docs.npmjs.com/cli/v10/configuring-npm/package-json#browser}
4468
+ @see {@link https://gist.github.com/defunctzombie/4339901/49493836fb873ddaa4b8a7aa0ef2352119f69211}
4469
+ */
4116
4470
  browser: optional(union([string$1(), record(string$1(), union([string$1(), boolean()]))])),
4471
+ /** Executable files. */
4117
4472
  bin: optional(union([string$1(), record(string$1(), string$1())])),
4473
+ /** Documentation to be used with the `man` command. */
4118
4474
  man: optional(union([string$1(), array(string$1())])),
4475
+ /** Directories in the package. */
4119
4476
  directories: optional(record(string$1(), string$1())),
4477
+ /** Repository for the package's source code. */
4120
4478
  repository: optional(Repository),
4479
+ /** Scripts used in the package. */
4121
4480
  scripts: optional(record(string$1(), string$1())),
4481
+ /** Configuration values for scripts. */
4122
4482
  config: optional(record(string$1(), unknown())),
4483
+ /** Production dependencies. */
4123
4484
  dependencies: optional(record(string$1(), string$1())),
4485
+ /** Development dependencies. */
4124
4486
  devDependencies: optional(record(string$1(), string$1())),
4487
+ /** Peer dependencies. */
4125
4488
  peerDependencies: optional(record(string$1(), string$1())),
4489
+ /** Metadata about peer dependencies. */
4126
4490
  peerDependenciesMeta: optional(record(string$1(), object({ optional: boolean() }))),
4491
+ /** Dependencies bundled with the package. */
4127
4492
  bundleDependencies: optional(union([boolean(), array(string$1())])),
4493
+ /** Dependencies bundled with the package (equivalent to `bundleDependencies`). */
4128
4494
  bundledDependencies: optional(union([boolean(), array(string$1())])),
4495
+ /** Optional dependencies. */
4129
4496
  optionalDependencies: optional(record(string$1(), string$1())),
4497
+ /** Overrides for dependency resolution using npm. */
4130
4498
  overrides: optional(record(string$1(), unknown())),
4499
+ /** Runtime systems supported by the package. */
4131
4500
  engines: optional(record(string$1(), string$1())),
4501
+ /** Operating systems supported by the package. */
4132
4502
  os: optional(array(string$1())),
4503
+ /** CPU architectures supported by the package. */
4133
4504
  cpu: optional(array(string$1())),
4505
+ /** Version of libc required to build or run this package on Linux. */
4134
4506
  libc: optional(string$1()),
4507
+ /** Tooling required to develop the package. */
4135
4508
  devEngines: optional(DevEngines),
4509
+ /** True if the package should not be published. */
4136
4510
  private: optional(boolean()),
4511
+ /** Configuration values used at publishing time. */
4137
4512
  publishConfig: optional(record(string$1(), unknown())),
4513
+ /** File patterns for locating local workspaces. */
4138
4514
  workspaces: optional(array(string$1())),
4515
+ /** Deprecation message. */
4139
4516
  deprecated: optional(string$1()),
4517
+ /** Main ESM entry point for the package. */
4140
4518
  module: optional(string$1()),
4519
+ /** Main TypeScript declaration file. */
4141
4520
  types: optional(string$1()),
4521
+ /** Main TypeScript declaration file (equivalent to `types`). */
4142
4522
  typings: optional(string$1()),
4523
+ /**
4524
+ TypeScript types resolutions.
4525
+ @see {@link https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html#version-selection-with-typesversions}
4526
+ */
4143
4527
  typesVersions: optional(record(string$1(), record(string$1(), array(string$1())))),
4528
+ /**
4529
+ Corepack package manager.
4530
+ @see {@link https://nodejs.org/api/corepack.html}
4531
+ */
4144
4532
  packageManager: optional(string$1()),
4533
+ /**
4534
+ False if importing modules from the package does not cause side effects.
4535
+ True or a list of file patterns if importing modules from the package causes side effects.
4536
+ @see {@link https://webpack.js.org/guides/tree-shaking/#mark-the-file-as-side-effect-free}
4537
+ */
4145
4538
  sideEffects: optional(union([boolean(), array(string$1())])),
4539
+ /**
4540
+ Imports map.
4541
+ @see {@link https://nodejs.org/api/packages.html#imports}
4542
+ */
4146
4543
  imports: optional(record(string$1(), unknown()))
4147
4544
  });
4148
4545
  //#endregion
@@ -4351,7 +4748,7 @@ var QuickLRU = class extends Map {
4351
4748
  }
4352
4749
  };
4353
4750
  //#endregion
4354
- //#region ../../node_modules/.pnpm/query-registry@4.3.0_zod@4.3.6/node_modules/query-registry/dist/cache.js
4751
+ //#region ../../node_modules/.pnpm/query-registry@4.3.0_zod@4.4.3/node_modules/query-registry/dist/cache.js
4355
4752
  /**
4356
4753
  Internal cache for all requests.
4357
4754
  @see {@link https://github.com/sindresorhus/quick-lru}
@@ -4472,7 +4869,7 @@ var init_builtin_modules = __esmMin((() => {
4472
4869
  ];
4473
4870
  }));
4474
4871
  //#endregion
4475
- //#region ../../node_modules/.pnpm/query-registry@4.3.0_zod@4.3.6/node_modules/query-registry/dist/assert-valid-package-name.js
4872
+ //#region ../../node_modules/.pnpm/query-registry@4.3.0_zod@4.4.3/node_modules/query-registry/dist/assert-valid-package-name.js
4476
4873
  var import_lib = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
4477
4874
  var builtins = (init_builtin_modules(), __toCommonJS(builtin_modules_exports).default);
4478
4875
  var scopedPackagePattern = /* @__PURE__ */ new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$");
@@ -4538,12 +4935,13 @@ function assertValidPackageName(name) {
4538
4935
  } });
4539
4936
  }
4540
4937
  //#endregion
4541
- //#region ../../node_modules/.pnpm/query-registry@4.3.0_zod@4.3.6/node_modules/query-registry/dist/dist-tags.js
4938
+ //#region ../../node_modules/.pnpm/query-registry@4.3.0_zod@4.4.3/node_modules/query-registry/dist/dist-tags.js
4542
4939
  /**
4543
4940
  `DistTags` describes the mapping of distribution tags to semver version numbers
4544
4941
  (e.g., `{ "latest": "1.0.0" }`).
4545
4942
  */
4546
4943
  var DistTags = object({
4944
+ /** Latest semver version number. */
4547
4945
  latest: string$1(),
4548
4946
  next: string$1().optional(),
4549
4947
  alpha: string$1().optional(),
@@ -4553,7 +4951,7 @@ var DistTags = object({
4553
4951
  dev: string$1().optional()
4554
4952
  }).catchall(string$1());
4555
4953
  //#endregion
4556
- //#region ../../node_modules/.pnpm/query-registry@4.3.0_zod@4.3.6/node_modules/query-registry/dist/fetch-data.js
4954
+ //#region ../../node_modules/.pnpm/query-registry@4.3.0_zod@4.4.3/node_modules/query-registry/dist/fetch-data.js
4557
4955
  async function fetchData(schema, url, headers) {
4558
4956
  const cacheKey = JSON.stringify({
4559
4957
  url,
@@ -4566,22 +4964,35 @@ async function fetchData(schema, url, headers) {
4566
4964
  return schema.parse(json);
4567
4965
  }
4568
4966
  //#endregion
4569
- //#region ../../node_modules/.pnpm/query-registry@4.3.0_zod@4.3.6/node_modules/query-registry/dist/npm-registry.js
4967
+ //#region ../../node_modules/.pnpm/query-registry@4.3.0_zod@4.4.3/node_modules/query-registry/dist/npm-registry.js
4570
4968
  /** Base URL for the {@link https://registry.npmjs.org | npm registry API}. */
4571
4969
  var npmRegistryUrl = "https://registry.npmjs.org";
4572
4970
  //#endregion
4573
- //#region ../../node_modules/.pnpm/query-registry@4.3.0_zod@4.3.6/node_modules/query-registry/dist/get-package-manifest.js
4971
+ //#region ../../node_modules/.pnpm/query-registry@4.3.0_zod@4.4.3/node_modules/query-registry/dist/get-package-manifest.js
4574
4972
  /**
4575
4973
  `Dist` describes the distribution metadata generated by the registry.
4576
4974
  @see {@link https://github.com/npm/registry/blob/master/docs/responses/package-metadata.md#dist}
4577
4975
  */
4578
4976
  var Dist = object({
4977
+ /** Tarball URL. */
4579
4978
  tarball: string$1(),
4979
+ /** SHA1 sum of the tarball. */
4580
4980
  shasum: string$1(),
4981
+ /** String in the format `<hashAlgorithm>-<base64-hash>`. */
4581
4982
  integrity: string$1().optional(),
4983
+ /** Number of files in the tarball. */
4582
4984
  fileCount: number().optional(),
4985
+ /** Total unpacked size in bytes of the files in the tarball. */
4583
4986
  unpackedSize: number().optional(),
4987
+ /**
4988
+ PGP signature in the format `<package>@<version>:<integrity>`.
4989
+ @deprecated {@link https://docs.npmjs.com/about-registry-signatures#migrating-from-pgp-to-ecdsa-signatures}
4990
+ */
4584
4991
  "npm-signature": string$1().optional(),
4992
+ /**
4993
+ ECDSA registry signatures.
4994
+ @see {@link https://docs.npmjs.com/about-registry-signatures}
4995
+ */
4585
4996
  signatures: array(object({
4586
4997
  keyid: string$1(),
4587
4998
  sig: string$1()
@@ -4589,23 +5000,68 @@ var Dist = object({
4589
5000
  });
4590
5001
  var PackageManifest = object({
4591
5002
  ...PackageJson.shape,
5003
+ /** Package version ID in the format `<name>@<version>` (e.g., `foo@1.0.0`). */
4592
5004
  _id: string$1(),
5005
+ /** Distribution metadata generated by the registry. */
4593
5006
  dist: Dist,
5007
+ /** Text extracted from the README file. */
4594
5008
  readme: string$1().optional(),
5009
+ /** Name of the README file. */
4595
5010
  readmeFilename: string$1().optional(),
5011
+ /** Commit corresponding to the published package version. */
4596
5012
  gitHead: string$1().optional(),
5013
+ /** True if the package contains a shrinkwrap file. */
4597
5014
  _hasShrinkwrap: boolean().optional(),
5015
+ /** Node.js version used to publish the package. */
4598
5016
  _nodeVersion: string$1().optional(),
5017
+ /** npm CLI version used to publish the package. */
4599
5018
  _npmVersion: string$1().optional(),
5019
+ /** npm user who published the specific version of the package. */
4600
5020
  _npmUser: PackageJson.shape.author.optional(),
5021
+ /** Internal npm registry data. */
4601
5022
  _npmOperationalInternal: object({
4602
5023
  host: string$1().optional(),
4603
5024
  tmp: string$1().optional()
4604
5025
  }).optional(),
5026
+ /**
5027
+ Runtime systems supported by the package.
5028
+
5029
+ @remarks
5030
+ In some old packages (like `lodash@0.1.0`) the `engines` property is an array of strings
5031
+ instead of an object and with catch it becomes `undefined`.
5032
+ */
4605
5033
  engines: record(string$1(), string$1()).optional().catch(void 0),
5034
+ /**
5035
+ SPDX license expression or a custom license.
5036
+
5037
+ @remarks
5038
+ In some old packages (like `eslint@0.0.6`) the `license` property is an object
5039
+ and with catch `license` becomes `undefined`.
5040
+ */
4606
5041
  license: string$1().optional().catch(void 0),
5042
+ /**
5043
+ URL of the package's homepage.
5044
+
5045
+ @remarks
5046
+ In some old packages (like `fs-extra@0.0.1`) the `homepage` property is an array
5047
+ of strings and with catch it becomes `undefined`.
5048
+ */
4607
5049
  homepage: string$1().optional().catch(void 0),
5050
+ /**
5051
+ Deprecation status/message.
5052
+
5053
+ @remarks
5054
+ In some packages (like `react@16.14.0`) the `deprecated` property is a boolean
5055
+ instead of a deprecation message.
5056
+ */
4608
5057
  deprecated: union([string$1(), boolean()]).optional(),
5058
+ /**
5059
+ Type for all the `.js` files in the package, usually `module`.
5060
+
5061
+ @remarks
5062
+ In some old packages (like `mongoose@0.0.1`) the `type` property value is a string
5063
+ different from `module` or `commonjs` and with catch it becomes `undefined`.
5064
+ */
4609
5065
  type: literal(["module", "commonjs"]).optional().catch(void 0)
4610
5066
  });
4611
5067
  /**
@@ -4622,11 +5078,15 @@ async function getPackageManifest(name, versionOrTag = "latest", registry = npmR
4622
5078
  return await fetchData(PackageManifest, urlJoin(registry, name, versionOrTag));
4623
5079
  }
4624
5080
  //#endregion
4625
- //#region ../../node_modules/.pnpm/query-registry@4.3.0_zod@4.3.6/node_modules/query-registry/dist/get-abbreviated-packument.js
5081
+ //#region ../../node_modules/.pnpm/query-registry@4.3.0_zod@4.4.3/node_modules/query-registry/dist/get-abbreviated-packument.js
4626
5082
  var AbbreviatedPackument = object({
5083
+ /** Package name. */
4627
5084
  name: string$1(),
5085
+ /** Timestamp of when the package was last modified in ISO 8601 format (e.g., `2021-11-23T19:12:24.006Z`). */
4628
5086
  modified: string$1(),
5087
+ /** Mapping of distribution tags to semver version numbers e.g., `{ "latest": "1.0.0" }`). */
4629
5088
  "dist-tags": DistTags,
5089
+ /** Mapping of semver version numbers to the required metadata for installing a package version. */
4630
5090
  versions: record(string$1(), object({
4631
5091
  ...PackageManifest.pick({
4632
5092
  name: true,
@@ -4646,6 +5106,7 @@ var AbbreviatedPackument = object({
4646
5106
  os: true,
4647
5107
  _hasShrinkwrap: true
4648
5108
  }).shape,
5109
+ /** True if the package contains an `install` script. */
4649
5110
  hasInstallScript: boolean().optional()
4650
5111
  }))
4651
5112
  });
@@ -4754,7 +5215,7 @@ var require_fast_fifo = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4754
5215
  };
4755
5216
  }));
4756
5217
  //#endregion
4757
- //#region ../../node_modules/.pnpm/b4a@1.8.0/node_modules/b4a/index.js
5218
+ //#region ../../node_modules/.pnpm/b4a@1.8.1/node_modules/b4a/index.js
4758
5219
  var require_b4a = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4759
5220
  function isBuffer(value) {
4760
5221
  return Buffer.isBuffer(value) || value instanceof Uint8Array;
@@ -5128,22 +5589,57 @@ var require_text_decoder = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5128
5589
  }
5129
5590
  }));
5130
5591
  //#endregion
5131
- //#region ../../node_modules/.pnpm/streamx@2.25.0/node_modules/streamx/index.js
5592
+ //#region ../../node_modules/.pnpm/streamx@2.27.0/node_modules/streamx/lib/errors.js
5593
+ var require_errors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5594
+ module.exports = class StreamError extends Error {
5595
+ constructor(msg, code, fn = StreamError) {
5596
+ super(msg);
5597
+ this.code = code;
5598
+ if (Error.captureStackTrace) Error.captureStackTrace(this, fn);
5599
+ }
5600
+ static isStreamDestroyed(err) {
5601
+ return err && err.code === "STREAM_DESTROYED";
5602
+ }
5603
+ static isPrematureClose(err) {
5604
+ return err && err.code === "PREMATURE_CLOSE";
5605
+ }
5606
+ static isAborted(err) {
5607
+ return err && err.code === "ABORTED";
5608
+ }
5609
+ static isBadArgument(err) {
5610
+ return err && err.code === "BAD_ARGUMENT";
5611
+ }
5612
+ get name() {
5613
+ return "StreamError";
5614
+ }
5615
+ static STREAM_DESTROYED() {
5616
+ return new StreamError("Stream was destroyed", "STREAM_DESTROYED", StreamError.STREAM_DESTROYED);
5617
+ }
5618
+ static PREMATURE_CLOSE(msg = "Premature close") {
5619
+ return new StreamError(msg, "PREMATURE_CLOSE", StreamError.PREMATURE_CLOSE);
5620
+ }
5621
+ static ABORTED() {
5622
+ return new StreamError("Stream aborted", "ABORTED", StreamError.ABORTED);
5623
+ }
5624
+ static BAD_ARGUMENT(msg = "Bad argument") {
5625
+ return new StreamError(msg, "BAD_ARGUMENT", StreamError.BAD_ARGUMENT);
5626
+ }
5627
+ };
5628
+ }));
5629
+ //#endregion
5630
+ //#region ../../node_modules/.pnpm/streamx@2.27.0/node_modules/streamx/index.js
5132
5631
  var require_streamx = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5133
5632
  var { EventEmitter } = require_default();
5134
- var STREAM_DESTROYED = /* @__PURE__ */ new Error("Stream was destroyed");
5135
- var PREMATURE_CLOSE = /* @__PURE__ */ new Error("Premature close");
5136
5633
  var FIFO = require_fast_fifo();
5137
5634
  var TextDecoder = require_text_decoder();
5635
+ var StreamError = require_errors();
5138
5636
  var qmt = typeof queueMicrotask === "undefined" ? (fn) => global.process.nextTick(fn) : queueMicrotask;
5139
- var MAX = (1 << 29) - 1;
5140
5637
  var OPENING = 1;
5141
5638
  var PREDESTROYING = 2;
5142
5639
  var DESTROYING = 4;
5143
5640
  var DESTROYED = 8;
5144
- var NOT_OPENING = MAX ^ OPENING;
5145
- var NOT_PREDESTROYING = MAX ^ PREDESTROYING;
5146
- var READ_ACTIVE = 16;
5641
+ var NOT_OPENING = 536870910;
5642
+ var NOT_PREDESTROYING = 536870909;
5147
5643
  var READ_UPDATING = 32;
5148
5644
  var READ_PRIMARY = 64;
5149
5645
  var READ_QUEUED = 128;
@@ -5155,25 +5651,23 @@ var require_streamx = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5155
5651
  var READ_EMITTED_READABLE = 8192;
5156
5652
  var READ_DONE = 16384;
5157
5653
  var READ_NEXT_TICK = 32768;
5158
- var READ_NEEDS_PUSH = 65536;
5159
5654
  var READ_READ_AHEAD = 131072;
5160
- var READ_FLOWING = READ_RESUMED | READ_PIPE_DRAINED;
5161
- var READ_ACTIVE_AND_NEEDS_PUSH = READ_ACTIVE | READ_NEEDS_PUSH;
5162
- var READ_PRIMARY_AND_ACTIVE = READ_PRIMARY | READ_ACTIVE;
5163
- var READ_EMIT_READABLE_AND_QUEUED = READ_EMIT_READABLE | READ_QUEUED;
5164
- var READ_RESUMED_READ_AHEAD = READ_RESUMED | READ_READ_AHEAD;
5165
- var READ_NOT_ACTIVE = MAX ^ READ_ACTIVE;
5166
- var READ_NON_PRIMARY = MAX ^ READ_PRIMARY;
5167
- var READ_NON_PRIMARY_AND_PUSHED = MAX ^ (READ_PRIMARY | READ_NEEDS_PUSH);
5168
- var READ_PUSHED = MAX ^ READ_NEEDS_PUSH;
5169
- var READ_PAUSED = MAX ^ READ_RESUMED;
5170
- var READ_NOT_QUEUED = MAX ^ (READ_QUEUED | READ_EMITTED_READABLE);
5171
- var READ_NOT_ENDING = MAX ^ READ_ENDING;
5172
- var READ_PIPE_NOT_DRAINED = MAX ^ READ_FLOWING;
5173
- var READ_NOT_NEXT_TICK = MAX ^ READ_NEXT_TICK;
5174
- var READ_NOT_UPDATING = MAX ^ READ_UPDATING;
5175
- var READ_NO_READ_AHEAD = MAX ^ READ_READ_AHEAD;
5176
- var READ_PAUSED_NO_READ_AHEAD = MAX ^ READ_RESUMED_READ_AHEAD;
5655
+ var READ_FLOWING = 768;
5656
+ var READ_ACTIVE_AND_NEEDS_PUSH = 65552;
5657
+ var READ_PRIMARY_AND_ACTIVE = 80;
5658
+ var READ_EMIT_READABLE_AND_QUEUED = 4224;
5659
+ var READ_RESUMED_READ_AHEAD = 131328;
5660
+ var READ_NOT_ACTIVE = 536870895;
5661
+ var READ_NON_PRIMARY_AND_PUSHED = 536805311;
5662
+ var READ_PUSHED = 536805375;
5663
+ var READ_PAUSED = 536870655;
5664
+ var READ_NOT_QUEUED = 536862591;
5665
+ var READ_NOT_ENDING = 536869887;
5666
+ var READ_PIPE_NOT_DRAINED = 536870143;
5667
+ var READ_NOT_NEXT_TICK = 536838143;
5668
+ var READ_NOT_UPDATING = 536870879;
5669
+ var READ_NO_READ_AHEAD = 536739839;
5670
+ var READ_PAUSED_NO_READ_AHEAD = 536739583;
5177
5671
  var WRITE_ACTIVE = 1 << 18;
5178
5672
  var WRITE_UPDATING = 2 << 18;
5179
5673
  var WRITE_PRIMARY = 4 << 18;
@@ -5185,42 +5679,42 @@ var require_streamx = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5185
5679
  var WRITE_WRITING = 256 << 18;
5186
5680
  var WRITE_FINISHING = 512 << 18;
5187
5681
  var WRITE_CORKED = 1024 << 18;
5188
- var WRITE_NOT_ACTIVE = MAX ^ (WRITE_ACTIVE | WRITE_WRITING);
5189
- var WRITE_NON_PRIMARY = MAX ^ WRITE_PRIMARY;
5190
- var WRITE_NOT_FINISHING = MAX ^ (WRITE_ACTIVE | WRITE_FINISHING);
5191
- var WRITE_DRAINED = MAX ^ WRITE_UNDRAINED;
5192
- var WRITE_NOT_QUEUED = MAX ^ WRITE_QUEUED;
5193
- var WRITE_NOT_NEXT_TICK = MAX ^ WRITE_NEXT_TICK;
5194
- var WRITE_NOT_UPDATING = MAX ^ WRITE_UPDATING;
5195
- var WRITE_NOT_CORKED = MAX ^ WRITE_CORKED;
5196
- var ACTIVE = READ_ACTIVE | WRITE_ACTIVE;
5197
- var NOT_ACTIVE = MAX ^ ACTIVE;
5198
- var DONE = READ_DONE | WRITE_DONE;
5199
- var DESTROY_STATUS = DESTROYED | 6;
5200
- var OPEN_STATUS = DESTROY_STATUS | OPENING;
5201
- var AUTO_DESTROY = DESTROY_STATUS | DONE;
5202
- var NON_PRIMARY = WRITE_NON_PRIMARY & READ_NON_PRIMARY;
5203
- var ACTIVE_OR_TICKING = WRITE_NEXT_TICK | READ_NEXT_TICK;
5204
- var IS_OPENING = OPEN_STATUS | ACTIVE_OR_TICKING & NOT_ACTIVE;
5205
- var READ_PRIMARY_STATUS = READ_ENDING | 16399;
5206
- var READ_STATUS = READ_DONE | 143;
5207
- var READ_ENDING_STATUS = READ_ENDING | 143;
5682
+ var WRITE_NOT_ACTIVE = 469499903;
5683
+ var WRITE_NON_PRIMARY = 535822335;
5684
+ var WRITE_NOT_FINISHING = 402391039;
5685
+ var WRITE_DRAINED = 532676607;
5686
+ var WRITE_NOT_QUEUED = 534773759;
5687
+ var WRITE_NOT_NEXT_TICK = 503316479;
5688
+ var WRITE_NOT_UPDATING = 536346623;
5689
+ var WRITE_NOT_CORKED = 268435455;
5690
+ var ACTIVE = 262160;
5691
+ var NOT_ACTIVE = 536608751;
5692
+ var DONE = 8404992;
5693
+ var DESTROY_STATUS = 14;
5694
+ var OPEN_STATUS = 15;
5695
+ var AUTO_DESTROY = 8405006;
5696
+ var NON_PRIMARY = 535822271;
5697
+ var ACTIVE_OR_TICKING = 33587200;
5698
+ var IS_OPENING = 33587215;
5699
+ var READ_PRIMARY_STATUS = 17423;
5700
+ var READ_STATUS = 16527;
5701
+ var READ_ENDING_STATUS = 1167;
5208
5702
  var READ_READABLE_STATUS = 12431;
5209
5703
  var SHOULD_NOT_READ = 214047;
5210
- var READ_BACKPRESSURE_STATUS = READ_ENDING | 16398;
5704
+ var READ_BACKPRESSURE_STATUS = 17422;
5211
5705
  var READ_UPDATE_SYNC_STATUS = 32879;
5212
- var READ_NEXT_TICK_OR_OPENING = READ_NEXT_TICK | OPENING;
5213
- var WRITE_PRIMARY_STATUS = WRITE_FINISHING | 8388623;
5214
- var WRITE_QUEUED_AND_UNDRAINED = WRITE_QUEUED | WRITE_UNDRAINED;
5215
- var WRITE_QUEUED_AND_ACTIVE = WRITE_QUEUED | WRITE_ACTIVE;
5706
+ var READ_NEXT_TICK_OR_OPENING = 32769;
5707
+ var WRITE_PRIMARY_STATUS = 142606351;
5708
+ var WRITE_QUEUED_AND_UNDRAINED = 6291456;
5709
+ var WRITE_QUEUED_AND_ACTIVE = 2359296;
5216
5710
  var WRITE_DRAIN_STATUS = 6553615;
5217
5711
  var WRITE_STATUS = 270794767;
5218
- var WRITE_PRIMARY_AND_ACTIVE = WRITE_PRIMARY | WRITE_ACTIVE;
5219
- var WRITE_ACTIVE_AND_WRITING = WRITE_ACTIVE | WRITE_WRITING;
5712
+ var WRITE_PRIMARY_AND_ACTIVE = 1310720;
5713
+ var WRITE_ACTIVE_AND_WRITING = 67371008;
5220
5714
  var WRITE_FINISHING_STATUS = 144965647;
5221
5715
  var WRITE_BACKPRESSURE_STATUS = 146800654;
5222
5716
  var WRITE_UPDATE_SYNC_STATUS = 35127311;
5223
- var WRITE_DROP_DATA = WRITE_DONE | 134217742;
5717
+ var WRITE_DROP_DATA = 142606350;
5224
5718
  var asyncIterator = Symbol.asyncIterator || Symbol("asyncIterator");
5225
5719
  var WritableState = class {
5226
5720
  constructor(stream, { highWaterMark = 16384, map = null, mapWritable, byteLength, byteLengthWritable } = {}) {
@@ -5342,7 +5836,7 @@ var require_streamx = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5342
5836
  return (this.stream._duplexState & READ_DONE) !== 0;
5343
5837
  }
5344
5838
  pipe(pipeTo, cb) {
5345
- if (this.pipeTo !== null) throw new Error("Can only pipe to one destination");
5839
+ if (this.pipeTo !== null) throw StreamError.BAD_ARGUMENT("Can only pipe to one destination");
5346
5840
  if (typeof cb !== "function") cb = null;
5347
5841
  this.stream._duplexState |= READ_PIPE_DRAINED;
5348
5842
  this.pipeTo = pipeTo;
@@ -5501,14 +5995,14 @@ var require_streamx = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5501
5995
  if (stream === this.to) {
5502
5996
  this.to = null;
5503
5997
  if (this.from !== null) {
5504
- if ((this.from._duplexState & READ_DONE) === 0 || !this.pipeToFinished) this.from.destroy(this.error || /* @__PURE__ */ new Error("Writable stream closed prematurely"));
5998
+ if ((this.from._duplexState & READ_DONE) === 0 || !this.pipeToFinished) this.from.destroy(this.error || StreamError.PREMATURE_CLOSE("Writable stream closed"));
5505
5999
  return;
5506
6000
  }
5507
6001
  }
5508
6002
  if (stream === this.from) {
5509
6003
  this.from = null;
5510
6004
  if (this.to !== null) {
5511
- if ((stream._duplexState & READ_DONE) === 0) this.to.destroy(this.error || /* @__PURE__ */ new Error("Readable stream closed before ending"));
6005
+ if ((stream._duplexState & READ_DONE) === 0) this.to.destroy(this.error || StreamError.PREMATURE_CLOSE("Readable stream closed"));
5512
6006
  return;
5513
6007
  }
5514
6008
  }
@@ -5534,7 +6028,7 @@ var require_streamx = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5534
6028
  }
5535
6029
  function afterDestroy(err) {
5536
6030
  const stream = this.stream;
5537
- if (!err && this.error !== STREAM_DESTROYED) err = this.error;
6031
+ if (!err && !StreamError.isStreamDestroyed(this.error)) err = this.error;
5538
6032
  if (err) stream.emit("error", err);
5539
6033
  stream._duplexState |= DESTROYED;
5540
6034
  stream.emit("close");
@@ -5600,7 +6094,7 @@ var require_streamx = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5600
6094
  function newListener(name) {
5601
6095
  if (this._readableState !== null) {
5602
6096
  if (name === "data") {
5603
- this._duplexState |= READ_EMIT_DATA | READ_RESUMED_READ_AHEAD;
6097
+ this._duplexState |= 133376;
5604
6098
  this._readableState.updateNextTick();
5605
6099
  }
5606
6100
  if (name === "readable") {
@@ -5650,7 +6144,7 @@ var require_streamx = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5650
6144
  }
5651
6145
  destroy(err) {
5652
6146
  if ((this._duplexState & DESTROY_STATUS) === 0) {
5653
- if (!err) err = STREAM_DESTROYED;
6147
+ if (!err) err = StreamError.STREAM_DESTROYED();
5654
6148
  this._duplexState = (this._duplexState | DESTROYING) & NON_PRIMARY;
5655
6149
  if (this._readableState !== null) {
5656
6150
  this._readableState.highWaterMark = 0;
@@ -5671,7 +6165,7 @@ var require_streamx = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5671
6165
  var Readable = class Readable extends Stream {
5672
6166
  constructor(opts) {
5673
6167
  super(opts);
5674
- this._duplexState |= WRITE_DONE | 131073;
6168
+ this._duplexState |= 8519681;
5675
6169
  this._readableState = new ReadableState(this, opts);
5676
6170
  if (opts) {
5677
6171
  if (this._readableState.readAhead === false) this._duplexState &= READ_NO_READ_AHEAD;
@@ -5680,6 +6174,15 @@ var require_streamx = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5680
6174
  if (opts.encoding) this.setEncoding(opts.encoding);
5681
6175
  }
5682
6176
  }
6177
+ static deferred(fn, opts) {
6178
+ const out = new PassThrough(opts);
6179
+ fn().then((src) => {
6180
+ if (src === null) return out.end();
6181
+ if (out.destroying) return;
6182
+ pipeline(src, out, noop);
6183
+ }).catch((err) => out.destroy(err));
6184
+ return out;
6185
+ }
5683
6186
  setEncoding(encoding) {
5684
6187
  const dec = new TextDecoder(encoding);
5685
6188
  const map = this._readableState.map || echo;
@@ -5798,7 +6301,7 @@ var require_streamx = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5798
6301
  function ondata(data) {
5799
6302
  if (promiseReject === null) return;
5800
6303
  if (error) promiseReject(error);
5801
- else if (data === null && (stream._duplexState & READ_DONE) === 0) promiseReject(STREAM_DESTROYED);
6304
+ else if (data === null && (stream._duplexState & READ_DONE) === 0) promiseReject(StreamError.STREAM_DESTROYED());
5802
6305
  else promiseResolve({
5803
6306
  value: data,
5804
6307
  done: data === null
@@ -5826,7 +6329,7 @@ var require_streamx = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5826
6329
  var Writable = class extends Stream {
5827
6330
  constructor(opts) {
5828
6331
  super(opts);
5829
- this._duplexState |= OPENING | READ_DONE;
6332
+ this._duplexState |= 16385;
5830
6333
  this._writableState = new WritableState(this, opts);
5831
6334
  if (opts) {
5832
6335
  if (opts.writev) this._writev = opts.writev;
@@ -5972,7 +6475,7 @@ var require_streamx = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5972
6475
  function pipeline(stream, ...streams) {
5973
6476
  const all = Array.isArray(stream) ? [...stream, ...streams] : [stream, ...streams];
5974
6477
  const done = all.length && typeof all[all.length - 1] === "function" ? all.pop() : null;
5975
- if (all.length < 2) throw new Error("Pipeline requires at least 2 streams");
6478
+ if (all.length < 2) throw StreamError.BAD_ARGUMENT("Pipeline requires at least 2 streams");
5976
6479
  let src = all[0];
5977
6480
  let dest = null;
5978
6481
  let error = null;
@@ -5995,15 +6498,15 @@ var require_streamx = /* @__PURE__ */ __commonJSMin(((exports, module) => {
5995
6498
  fin = true;
5996
6499
  if (!autoDestroy) done(error);
5997
6500
  });
5998
- if (autoDestroy) dest.on("close", () => done(error || (fin ? null : PREMATURE_CLOSE)));
6501
+ if (autoDestroy) dest.on("close", () => done(error || (fin ? null : StreamError.PREMATURE_CLOSE())));
5999
6502
  }
6000
6503
  return dest;
6001
6504
  function errorHandle(s, rd, wr, onerror) {
6002
6505
  s.on("error", onerror);
6003
6506
  s.on("close", onclose);
6004
6507
  function onclose() {
6005
- if (rd && s._readableState && !s._readableState.ended) return onerror(PREMATURE_CLOSE);
6006
- if (wr && s._writableState && !s._writableState.ended) return onerror(PREMATURE_CLOSE);
6508
+ if (rd && s._readableState && !s._readableState.ended) return onerror(StreamError.PREMATURE_CLOSE());
6509
+ if (wr && s._writableState && !s._writableState.ended) return onerror(StreamError.PREMATURE_CLOSE());
6007
6510
  }
6008
6511
  }
6009
6512
  function onerror(err) {
@@ -6035,7 +6538,7 @@ var require_streamx = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6035
6538
  }
6036
6539
  function getStreamError(stream, opts = {}) {
6037
6540
  const err = stream._readableState && stream._readableState.error || stream._writableState && stream._writableState.error;
6038
- return !opts.all && err === STREAM_DESTROYED ? null : err;
6541
+ return !opts.all && StreamError.isStreamDestroyed(err) ? null : err;
6039
6542
  }
6040
6543
  function isReadStreamx(stream) {
6041
6544
  return isStreamx(stream) && stream.readable;
@@ -6051,7 +6554,7 @@ var require_streamx = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6051
6554
  }
6052
6555
  function noop() {}
6053
6556
  function abort() {
6054
- this.destroy(/* @__PURE__ */ new Error("Stream aborted."));
6557
+ this.destroy(StreamError.ABORTED());
6055
6558
  }
6056
6559
  function isWritev(s) {
6057
6560
  return s._writev !== Writable.prototype._writev && s._writev !== Duplex.prototype._writev;
@@ -6076,7 +6579,7 @@ var require_streamx = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6076
6579
  };
6077
6580
  }));
6078
6581
  //#endregion
6079
- //#region ../../node_modules/.pnpm/tar-stream@3.1.8/node_modules/tar-stream/headers.js
6582
+ //#region ../../node_modules/.pnpm/tar-stream@3.2.0/node_modules/tar-stream/headers.js
6080
6583
  var require_headers = /* @__PURE__ */ __commonJSMin(((exports) => {
6081
6584
  var b4a = require_b4a();
6082
6585
  var ZEROS = "0000000000000000000";
@@ -6188,6 +6691,7 @@ var require_headers = /* @__PURE__ */ __commonJSMin(((exports) => {
6188
6691
  uid,
6189
6692
  gid,
6190
6693
  size,
6694
+ byteOffset: 0,
6191
6695
  mtime: /* @__PURE__ */ new Date(1e3 * mtime),
6192
6696
  type,
6193
6697
  linkname,
@@ -6199,10 +6703,10 @@ var require_headers = /* @__PURE__ */ __commonJSMin(((exports) => {
6199
6703
  };
6200
6704
  };
6201
6705
  function isUSTAR(buf) {
6202
- return b4a.equals(USTAR_MAGIC, buf.subarray(MAGIC_OFFSET, MAGIC_OFFSET + 6));
6706
+ return b4a.equals(USTAR_MAGIC, buf.subarray(MAGIC_OFFSET, 263));
6203
6707
  }
6204
6708
  function isGNU(buf) {
6205
- return b4a.equals(GNU_MAGIC, buf.subarray(MAGIC_OFFSET, MAGIC_OFFSET + 6)) && b4a.equals(GNU_VER, buf.subarray(VERSION_OFFSET, VERSION_OFFSET + 2));
6709
+ return b4a.equals(GNU_MAGIC, buf.subarray(MAGIC_OFFSET, 263)) && b4a.equals(GNU_VER, buf.subarray(VERSION_OFFSET, 265));
6206
6710
  }
6207
6711
  function clamp(index, len, defaultValue) {
6208
6712
  if (typeof index !== "number") return defaultValue;
@@ -6311,13 +6815,14 @@ var require_headers = /* @__PURE__ */ __commonJSMin(((exports) => {
6311
6815
  }
6312
6816
  }));
6313
6817
  //#endregion
6314
- //#region ../../node_modules/.pnpm/tar-stream@3.1.8/node_modules/tar-stream/extract.js
6818
+ //#region ../../node_modules/.pnpm/tar-stream@3.2.0/node_modules/tar-stream/extract.js
6315
6819
  var require_extract = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6316
6820
  var { Writable, Readable, getStreamError } = require_streamx();
6317
6821
  var FIFO = require_fast_fifo();
6318
6822
  var b4a = require_b4a();
6319
6823
  var headers = require_headers();
6320
6824
  var EMPTY = b4a.alloc(0);
6825
+ var MAX_HEADER_SIZE = 4 * 1024 * 1024;
6321
6826
  var BufferList = class {
6322
6827
  constructor() {
6323
6828
  this.buffered = 0;
@@ -6330,7 +6835,7 @@ var require_extract = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6330
6835
  this.queue.push(buffer);
6331
6836
  }
6332
6837
  shiftFirst(size) {
6333
- return this._buffered === 0 ? null : this._next(size);
6838
+ return this.buffered === 0 ? null : this._next(size);
6334
6839
  }
6335
6840
  shift(size) {
6336
6841
  if (size > this.buffered) return null;
@@ -6427,6 +6932,7 @@ var require_extract = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6427
6932
  return false;
6428
6933
  }
6429
6934
  if (!this._header) return true;
6935
+ this._header.byteOffset = this._buffer.shifted;
6430
6936
  switch (this._header.type) {
6431
6937
  case "gnu-long-path":
6432
6938
  case "gnu-long-link-path":
@@ -6434,10 +6940,18 @@ var require_extract = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6434
6940
  case "pax-header":
6435
6941
  this._longHeader = true;
6436
6942
  this._missing = this._header.size;
6943
+ if (this._missing > MAX_HEADER_SIZE) {
6944
+ this._continueWrite(/* @__PURE__ */ new Error("Header exceeds max size"));
6945
+ return false;
6946
+ }
6437
6947
  return true;
6438
6948
  }
6439
6949
  this._locked = true;
6440
6950
  this._applyLongHeaders();
6951
+ if (!(this._header.size >= 0)) {
6952
+ this._continueWrite(/* @__PURE__ */ new Error("Invalid header"));
6953
+ return false;
6954
+ }
6441
6955
  if (this._header.size === 0 || this._header.type === "directory") {
6442
6956
  this.emit("entry", this._header, this._createStream(), this._unlockBound);
6443
6957
  return true;
@@ -6652,7 +7166,7 @@ var require_extract = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6652
7166
  }
6653
7167
  }));
6654
7168
  //#endregion
6655
- //#region ../../node_modules/.pnpm/tar-stream@3.1.8/node_modules/tar-stream/constants.js
7169
+ //#region ../../node_modules/.pnpm/tar-stream@3.2.0/node_modules/tar-stream/constants.js
6656
7170
  var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6657
7171
  var constants = {
6658
7172
  S_IFMT: 61440,
@@ -6669,7 +7183,7 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6669
7183
  }
6670
7184
  }));
6671
7185
  //#endregion
6672
- //#region ../../node_modules/.pnpm/tar-stream@3.1.8/node_modules/tar-stream/pack.js
7186
+ //#region ../../node_modules/.pnpm/tar-stream@3.2.0/node_modules/tar-stream/pack.js
6673
7187
  var require_pack = /* @__PURE__ */ __commonJSMin(((exports, module) => {
6674
7188
  var { Readable, Writable, getStreamError } = require_streamx();
6675
7189
  var b4a = require_b4a();
@@ -6896,6 +7410,7 @@ var import_tar_stream = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin((
6896
7410
  exports.pack = require_pack();
6897
7411
  })))(), 1);
6898
7412
  var SuccessfulAbort = class {
7413
+ data;
6899
7414
  constructor(data) {
6900
7415
  this.data = data;
6901
7416
  }
@@ -7101,8 +7616,8 @@ ${icons.map(({ aliases, name }) => `- \`${name}\` (aliases: ${aliases.join(", ")
7101
7616
  })
7102
7617
  ];
7103
7618
  //#endregion
7104
- //#region ../../node_modules/.pnpm/zod@4.3.6/node_modules/zod/v4/mini/schemas.js
7105
- var ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
7619
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/mini/schemas.js
7620
+ var ZodMiniType = /*@__PURE__*/ $constructor("ZodMiniType", (inst, def) => {
7106
7621
  if (!inst._zod) throw new Error("Uninitialized schema in ZodMiniType.");
7107
7622
  $ZodType.init(inst, def);
7108
7623
  inst.def = def;
@@ -7130,11 +7645,11 @@ var ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
7130
7645
  });
7131
7646
  inst.apply = (fn) => fn(inst);
7132
7647
  });
7133
- var ZodMiniString = /* @__PURE__ */ $constructor("ZodMiniString", (inst, def) => {
7648
+ var ZodMiniString = /*@__PURE__*/ $constructor("ZodMiniString", (inst, def) => {
7134
7649
  $ZodString.init(inst, def);
7135
7650
  ZodMiniType.init(inst, def);
7136
7651
  });
7137
- /* @__NO_SIDE_EFFECTS__ */
7652
+ // @__NO_SIDE_EFFECTS__
7138
7653
  function string(params) {
7139
7654
  return /* @__PURE__ */ _string(ZodMiniString, params);
7140
7655
  }
@@ -7193,9 +7708,9 @@ var createServer = ({ resourcesAsTools }) => {
7193
7708
  * MCP server running via stdio.
7194
7709
  * All logging has to use stderr, otherwise the logging to stdio will break the transport.
7195
7710
  */
7196
- var run$1 = async (server) => {
7711
+ var run$1 = async (getServer) => {
7197
7712
  const transport = new StdioServerTransport();
7198
- await server.connect(transport);
7713
+ await getServer().connect(transport);
7199
7714
  error("MCP Server running on stdio.");
7200
7715
  };
7201
7716
  //#endregion
@@ -7240,7 +7755,8 @@ Usage:
7240
7755
  onyx-mcp [options]
7241
7756
 
7242
7757
  Options:
7243
- -t, --transport <stdio|http> Which kind of MCP server should be started (default: stdio).
7758
+ -t, --transport <stdio|http> Which kind of MCP server should be started (default: stdio).
7759
+ The "http" transport considers PORT and HOST environment variables, when starting the server.
7244
7760
  -r, --resourcesAsTools Some LLM Coding Assistants (e.g. Gemini) are not able to to use MCP resources (yet).
7245
7761
  This setting makes resources also available as tools to support these Coding Assistants.
7246
7762
  -h, --help Show this help text and quit.
@@ -7251,8 +7767,8 @@ Options:
7251
7767
  process.exit(0);
7252
7768
  } else {
7253
7769
  if (!Object.keys(SUPPORTED_TRANSPORTS).includes(transport)) throw new Error(`Unsupported transport: ${transport}`);
7254
- const server = createServer({ resourcesAsTools });
7255
- await SUPPORTED_TRANSPORTS[transport](server);
7770
+ const getServer = () => createServer({ resourcesAsTools });
7771
+ await SUPPORTED_TRANSPORTS[transport](getServer);
7256
7772
  }
7257
7773
  }
7258
7774
  //#endregion