@deepseek-ai/dsh-api-remotes 0.0.1-rc.1

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/lib/client.js ADDED
@@ -0,0 +1,4416 @@
1
+ window.__ModuleLoader__.load({
2
+ id: "@deepseek-ai/dsh-api-remotes",
3
+ factory: (require) => {
4
+ var module = { exports: {} };
5
+ var exports = module.exports;
6
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
7
+ //#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
8
+ var _a$1;
9
+ function $constructor(name, initializer, params) {
10
+ function init(inst, def) {
11
+ if (!inst._zod) Object.defineProperty(inst, "_zod", {
12
+ value: {
13
+ def,
14
+ constr: _,
15
+ traits: /* @__PURE__ */ new Set()
16
+ },
17
+ enumerable: false
18
+ });
19
+ if (inst._zod.traits.has(name)) return;
20
+ inst._zod.traits.add(name);
21
+ initializer(inst, def);
22
+ const proto = _.prototype;
23
+ const keys = Object.keys(proto);
24
+ for (let i = 0; i < keys.length; i++) {
25
+ const k = keys[i];
26
+ if (!(k in inst)) inst[k] = proto[k].bind(inst);
27
+ }
28
+ }
29
+ const Parent = params?.Parent ?? Object;
30
+ class Definition extends Parent {}
31
+ Object.defineProperty(Definition, "name", { value: name });
32
+ function _(def) {
33
+ var _a;
34
+ const inst = params?.Parent ? new Definition() : this;
35
+ init(inst, def);
36
+ (_a = inst._zod).deferred ?? (_a.deferred = []);
37
+ for (const fn of inst._zod.deferred) fn();
38
+ return inst;
39
+ }
40
+ Object.defineProperty(_, "init", { value: init });
41
+ Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => {
42
+ if (params?.Parent && inst instanceof params.Parent) return true;
43
+ return inst?._zod?.traits?.has(name);
44
+ } });
45
+ Object.defineProperty(_, "name", { value: name });
46
+ return _;
47
+ }
48
+ var $ZodAsyncError = class extends Error {
49
+ constructor() {
50
+ super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
51
+ }
52
+ };
53
+ var $ZodEncodeError = class extends Error {
54
+ constructor(name) {
55
+ super(`Encountered unidirectional transform during encode: ${name}`);
56
+ this.name = "ZodEncodeError";
57
+ }
58
+ };
59
+ (_a$1 = globalThis).__zod_globalConfig ?? (_a$1.__zod_globalConfig = {});
60
+ const globalConfig = globalThis.__zod_globalConfig;
61
+ function config(newConfig) {
62
+ if (newConfig) Object.assign(globalConfig, newConfig);
63
+ return globalConfig;
64
+ }
65
+ //#endregion
66
+ //#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js
67
+ function getEnumValues(entries) {
68
+ const numericValues = Object.values(entries).filter((v) => typeof v === "number");
69
+ return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
70
+ }
71
+ function jsonStringifyReplacer(_, value) {
72
+ if (typeof value === "bigint") return value.toString();
73
+ return value;
74
+ }
75
+ function cached(getter) {
76
+ return { get value() {
77
+ {
78
+ const value = getter();
79
+ Object.defineProperty(this, "value", { value });
80
+ return value;
81
+ }
82
+ throw new Error("cached value already set");
83
+ } };
84
+ }
85
+ function nullish(input) {
86
+ return input === null || input === void 0;
87
+ }
88
+ function cleanRegex(source) {
89
+ const start = source.startsWith("^") ? 1 : 0;
90
+ const end = source.endsWith("$") ? source.length - 1 : source.length;
91
+ return source.slice(start, end);
92
+ }
93
+ function floatSafeRemainder(val, step) {
94
+ const ratio = val / step;
95
+ const roundedRatio = Math.round(ratio);
96
+ const tolerance = Number.EPSILON * Math.max(Math.abs(ratio), 1);
97
+ if (Math.abs(ratio - roundedRatio) < tolerance) return 0;
98
+ return ratio - roundedRatio;
99
+ }
100
+ const EVALUATING = /* @__PURE__*/ Symbol("evaluating");
101
+ function defineLazy(object, key, getter) {
102
+ let value = void 0;
103
+ Object.defineProperty(object, key, {
104
+ get() {
105
+ if (value === EVALUATING) return;
106
+ if (value === void 0) {
107
+ value = EVALUATING;
108
+ value = getter();
109
+ }
110
+ return value;
111
+ },
112
+ set(v) {
113
+ Object.defineProperty(object, key, { value: v });
114
+ },
115
+ configurable: true
116
+ });
117
+ }
118
+ function assignProp(target, prop, value) {
119
+ Object.defineProperty(target, prop, {
120
+ value,
121
+ writable: true,
122
+ enumerable: true,
123
+ configurable: true
124
+ });
125
+ }
126
+ function mergeDefs(...defs) {
127
+ const mergedDescriptors = {};
128
+ for (const def of defs) Object.assign(mergedDescriptors, Object.getOwnPropertyDescriptors(def));
129
+ return Object.defineProperties({}, mergedDescriptors);
130
+ }
131
+ function esc(str) {
132
+ return JSON.stringify(str);
133
+ }
134
+ function slugify(input) {
135
+ return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
136
+ }
137
+ const captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {};
138
+ function isObject(data) {
139
+ return typeof data === "object" && data !== null && !Array.isArray(data);
140
+ }
141
+ const allowsEval = /* @__PURE__*/ cached(() => {
142
+ if (globalConfig.jitless) return false;
143
+ if (typeof navigator !== "undefined" && navigator?.userAgent?.includes("Cloudflare")) return false;
144
+ try {
145
+ new Function("");
146
+ return true;
147
+ } catch (_) {
148
+ return false;
149
+ }
150
+ });
151
+ function isPlainObject(o) {
152
+ if (isObject(o) === false) return false;
153
+ const ctor = o.constructor;
154
+ if (ctor === void 0) return true;
155
+ if (typeof ctor !== "function") return true;
156
+ const prot = ctor.prototype;
157
+ if (isObject(prot) === false) return false;
158
+ if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) return false;
159
+ return true;
160
+ }
161
+ function shallowClone(o) {
162
+ if (isPlainObject(o)) return { ...o };
163
+ if (Array.isArray(o)) return [...o];
164
+ if (o instanceof Map) return new Map(o);
165
+ if (o instanceof Set) return new Set(o);
166
+ return o;
167
+ }
168
+ const propertyKeyTypes = /* @__PURE__*/ new Set([
169
+ "string",
170
+ "number",
171
+ "symbol"
172
+ ]);
173
+ function escapeRegex(str) {
174
+ return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
175
+ }
176
+ function clone(inst, def, params) {
177
+ const cl = new inst._zod.constr(def ?? inst._zod.def);
178
+ if (!def || params?.parent) cl._zod.parent = inst;
179
+ return cl;
180
+ }
181
+ function normalizeParams(_params) {
182
+ const params = _params;
183
+ if (!params) return {};
184
+ if (typeof params === "string") return { error: () => params };
185
+ if (params?.message !== void 0) {
186
+ if (params?.error !== void 0) throw new Error("Cannot specify both `message` and `error` params");
187
+ params.error = params.message;
188
+ }
189
+ delete params.message;
190
+ if (typeof params.error === "string") return {
191
+ ...params,
192
+ error: () => params.error
193
+ };
194
+ return params;
195
+ }
196
+ function optionalKeys(shape) {
197
+ return Object.keys(shape).filter((k) => {
198
+ return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
199
+ });
200
+ }
201
+ const NUMBER_FORMAT_RANGES = {
202
+ safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
203
+ int32: [-2147483648, 2147483647],
204
+ uint32: [0, 4294967295],
205
+ float32: [-34028234663852886e22, 34028234663852886e22],
206
+ float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
207
+ };
208
+ function pick(schema, mask) {
209
+ const currDef = schema._zod.def;
210
+ const checks = currDef.checks;
211
+ if (checks && checks.length > 0) throw new Error(".pick() cannot be used on object schemas containing refinements");
212
+ return clone(schema, mergeDefs(schema._zod.def, {
213
+ get shape() {
214
+ const newShape = {};
215
+ for (const key in mask) {
216
+ if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`);
217
+ if (!mask[key]) continue;
218
+ newShape[key] = currDef.shape[key];
219
+ }
220
+ assignProp(this, "shape", newShape);
221
+ return newShape;
222
+ },
223
+ checks: []
224
+ }));
225
+ }
226
+ function omit(schema, mask) {
227
+ const currDef = schema._zod.def;
228
+ const checks = currDef.checks;
229
+ if (checks && checks.length > 0) throw new Error(".omit() cannot be used on object schemas containing refinements");
230
+ return clone(schema, mergeDefs(schema._zod.def, {
231
+ get shape() {
232
+ const newShape = { ...schema._zod.def.shape };
233
+ for (const key in mask) {
234
+ if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`);
235
+ if (!mask[key]) continue;
236
+ delete newShape[key];
237
+ }
238
+ assignProp(this, "shape", newShape);
239
+ return newShape;
240
+ },
241
+ checks: []
242
+ }));
243
+ }
244
+ function extend(schema, shape) {
245
+ if (!isPlainObject(shape)) throw new Error("Invalid input to extend: expected a plain object");
246
+ const checks = schema._zod.def.checks;
247
+ if (checks && checks.length > 0) {
248
+ const existingShape = schema._zod.def.shape;
249
+ for (const key in shape) if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
250
+ }
251
+ return clone(schema, mergeDefs(schema._zod.def, { get shape() {
252
+ const _shape = {
253
+ ...schema._zod.def.shape,
254
+ ...shape
255
+ };
256
+ assignProp(this, "shape", _shape);
257
+ return _shape;
258
+ } }));
259
+ }
260
+ function safeExtend(schema, shape) {
261
+ if (!isPlainObject(shape)) throw new Error("Invalid input to safeExtend: expected a plain object");
262
+ return clone(schema, mergeDefs(schema._zod.def, { get shape() {
263
+ const _shape = {
264
+ ...schema._zod.def.shape,
265
+ ...shape
266
+ };
267
+ assignProp(this, "shape", _shape);
268
+ return _shape;
269
+ } }));
270
+ }
271
+ function merge(a, b) {
272
+ if (a._zod.def.checks?.length) throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
273
+ return clone(a, mergeDefs(a._zod.def, {
274
+ get shape() {
275
+ const _shape = {
276
+ ...a._zod.def.shape,
277
+ ...b._zod.def.shape
278
+ };
279
+ assignProp(this, "shape", _shape);
280
+ return _shape;
281
+ },
282
+ get catchall() {
283
+ return b._zod.def.catchall;
284
+ },
285
+ checks: b._zod.def.checks ?? []
286
+ }));
287
+ }
288
+ function partial(Class, schema, mask) {
289
+ const checks = schema._zod.def.checks;
290
+ if (checks && checks.length > 0) throw new Error(".partial() cannot be used on object schemas containing refinements");
291
+ return clone(schema, mergeDefs(schema._zod.def, {
292
+ get shape() {
293
+ const oldShape = schema._zod.def.shape;
294
+ const shape = { ...oldShape };
295
+ if (mask) for (const key in mask) {
296
+ if (!(key in oldShape)) throw new Error(`Unrecognized key: "${key}"`);
297
+ if (!mask[key]) continue;
298
+ shape[key] = Class ? new Class({
299
+ type: "optional",
300
+ innerType: oldShape[key]
301
+ }) : oldShape[key];
302
+ }
303
+ else for (const key in oldShape) shape[key] = Class ? new Class({
304
+ type: "optional",
305
+ innerType: oldShape[key]
306
+ }) : oldShape[key];
307
+ assignProp(this, "shape", shape);
308
+ return shape;
309
+ },
310
+ checks: []
311
+ }));
312
+ }
313
+ function required(Class, schema, mask) {
314
+ return clone(schema, mergeDefs(schema._zod.def, { get shape() {
315
+ const oldShape = schema._zod.def.shape;
316
+ const shape = { ...oldShape };
317
+ if (mask) for (const key in mask) {
318
+ if (!(key in shape)) throw new Error(`Unrecognized key: "${key}"`);
319
+ if (!mask[key]) continue;
320
+ shape[key] = new Class({
321
+ type: "nonoptional",
322
+ innerType: oldShape[key]
323
+ });
324
+ }
325
+ else for (const key in oldShape) shape[key] = new Class({
326
+ type: "nonoptional",
327
+ innerType: oldShape[key]
328
+ });
329
+ assignProp(this, "shape", shape);
330
+ return shape;
331
+ } }));
332
+ }
333
+ function aborted(x, startIndex = 0) {
334
+ if (x.aborted === true) return true;
335
+ for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue !== true) return true;
336
+ return false;
337
+ }
338
+ function explicitlyAborted(x, startIndex = 0) {
339
+ if (x.aborted === true) return true;
340
+ for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue === false) return true;
341
+ return false;
342
+ }
343
+ function prefixIssues(path, issues) {
344
+ return issues.map((iss) => {
345
+ var _a;
346
+ (_a = iss).path ?? (_a.path = []);
347
+ iss.path.unshift(path);
348
+ return iss;
349
+ });
350
+ }
351
+ function unwrapMessage(message) {
352
+ return typeof message === "string" ? message : message?.message;
353
+ }
354
+ function finalizeIssue(iss, ctx, config) {
355
+ 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";
356
+ const { inst: _inst, continue: _continue, input: _input, ...rest } = iss;
357
+ rest.path ?? (rest.path = []);
358
+ rest.message = message;
359
+ if (ctx?.reportInput) rest.input = _input;
360
+ return rest;
361
+ }
362
+ function getLengthableOrigin(input) {
363
+ if (Array.isArray(input)) return "array";
364
+ if (typeof input === "string") return "string";
365
+ return "unknown";
366
+ }
367
+ function issue(...args) {
368
+ const [iss, input, inst] = args;
369
+ if (typeof iss === "string") return {
370
+ message: iss,
371
+ code: "custom",
372
+ input,
373
+ inst
374
+ };
375
+ return { ...iss };
376
+ }
377
+ //#endregion
378
+ //#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.js
379
+ const initializer$1 = (inst, def) => {
380
+ inst.name = "$ZodError";
381
+ Object.defineProperty(inst, "_zod", {
382
+ value: inst._zod,
383
+ enumerable: false
384
+ });
385
+ Object.defineProperty(inst, "issues", {
386
+ value: def,
387
+ enumerable: false
388
+ });
389
+ inst.message = JSON.stringify(def, jsonStringifyReplacer, 2);
390
+ Object.defineProperty(inst, "toString", {
391
+ value: () => inst.message,
392
+ enumerable: false
393
+ });
394
+ };
395
+ const $ZodError = $constructor("$ZodError", initializer$1);
396
+ const $ZodRealError = $constructor("$ZodError", initializer$1, { Parent: Error });
397
+ function flattenError(error, mapper = (issue) => issue.message) {
398
+ const fieldErrors = {};
399
+ const formErrors = [];
400
+ for (const sub of error.issues) if (sub.path.length > 0) {
401
+ fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
402
+ fieldErrors[sub.path[0]].push(mapper(sub));
403
+ } else formErrors.push(mapper(sub));
404
+ return {
405
+ formErrors,
406
+ fieldErrors
407
+ };
408
+ }
409
+ function formatError(error, mapper = (issue) => issue.message) {
410
+ const fieldErrors = { _errors: [] };
411
+ const processError = (error, path = []) => {
412
+ for (const issue of error.issues) if (issue.code === "invalid_union" && issue.errors.length) issue.errors.map((issues) => processError({ issues }, [...path, ...issue.path]));
413
+ else if (issue.code === "invalid_key") processError({ issues: issue.issues }, [...path, ...issue.path]);
414
+ else if (issue.code === "invalid_element") processError({ issues: issue.issues }, [...path, ...issue.path]);
415
+ else {
416
+ const fullpath = [...path, ...issue.path];
417
+ if (fullpath.length === 0) fieldErrors._errors.push(mapper(issue));
418
+ else {
419
+ let curr = fieldErrors;
420
+ let i = 0;
421
+ while (i < fullpath.length) {
422
+ const el = fullpath[i];
423
+ if (!(i === fullpath.length - 1)) curr[el] = curr[el] || { _errors: [] };
424
+ else {
425
+ curr[el] = curr[el] || { _errors: [] };
426
+ curr[el]._errors.push(mapper(issue));
427
+ }
428
+ curr = curr[el];
429
+ i++;
430
+ }
431
+ }
432
+ }
433
+ };
434
+ processError(error);
435
+ return fieldErrors;
436
+ }
437
+ //#endregion
438
+ //#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/parse.js
439
+ const _parse = (_Err) => (schema, value, _ctx, _params) => {
440
+ const ctx = _ctx ? {
441
+ ..._ctx,
442
+ async: false
443
+ } : { async: false };
444
+ const result = schema._zod.run({
445
+ value,
446
+ issues: []
447
+ }, ctx);
448
+ if (result instanceof Promise) throw new $ZodAsyncError();
449
+ if (result.issues.length) {
450
+ const e = new ((_params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
451
+ captureStackTrace(e, _params?.callee);
452
+ throw e;
453
+ }
454
+ return result.value;
455
+ };
456
+ const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
457
+ const ctx = _ctx ? {
458
+ ..._ctx,
459
+ async: true
460
+ } : { async: true };
461
+ let result = schema._zod.run({
462
+ value,
463
+ issues: []
464
+ }, ctx);
465
+ if (result instanceof Promise) result = await result;
466
+ if (result.issues.length) {
467
+ const e = new ((params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
468
+ captureStackTrace(e, params?.callee);
469
+ throw e;
470
+ }
471
+ return result.value;
472
+ };
473
+ const _safeParse = (_Err) => (schema, value, _ctx) => {
474
+ const ctx = _ctx ? {
475
+ ..._ctx,
476
+ async: false
477
+ } : { async: false };
478
+ const result = schema._zod.run({
479
+ value,
480
+ issues: []
481
+ }, ctx);
482
+ if (result instanceof Promise) throw new $ZodAsyncError();
483
+ return result.issues.length ? {
484
+ success: false,
485
+ error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
486
+ } : {
487
+ success: true,
488
+ data: result.value
489
+ };
490
+ };
491
+ const safeParse$1 = /* @__PURE__*/ _safeParse($ZodRealError);
492
+ const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
493
+ const ctx = _ctx ? {
494
+ ..._ctx,
495
+ async: true
496
+ } : { async: true };
497
+ let result = schema._zod.run({
498
+ value,
499
+ issues: []
500
+ }, ctx);
501
+ if (result instanceof Promise) result = await result;
502
+ return result.issues.length ? {
503
+ success: false,
504
+ error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
505
+ } : {
506
+ success: true,
507
+ data: result.value
508
+ };
509
+ };
510
+ const safeParseAsync$1 = /* @__PURE__*/ _safeParseAsync($ZodRealError);
511
+ const _encode = (_Err) => (schema, value, _ctx) => {
512
+ const ctx = _ctx ? {
513
+ ..._ctx,
514
+ direction: "backward"
515
+ } : { direction: "backward" };
516
+ return _parse(_Err)(schema, value, ctx);
517
+ };
518
+ const _decode = (_Err) => (schema, value, _ctx) => {
519
+ return _parse(_Err)(schema, value, _ctx);
520
+ };
521
+ const _encodeAsync = (_Err) => async (schema, value, _ctx) => {
522
+ const ctx = _ctx ? {
523
+ ..._ctx,
524
+ direction: "backward"
525
+ } : { direction: "backward" };
526
+ return _parseAsync(_Err)(schema, value, ctx);
527
+ };
528
+ const _decodeAsync = (_Err) => async (schema, value, _ctx) => {
529
+ return _parseAsync(_Err)(schema, value, _ctx);
530
+ };
531
+ const _safeEncode = (_Err) => (schema, value, _ctx) => {
532
+ const ctx = _ctx ? {
533
+ ..._ctx,
534
+ direction: "backward"
535
+ } : { direction: "backward" };
536
+ return _safeParse(_Err)(schema, value, ctx);
537
+ };
538
+ const _safeDecode = (_Err) => (schema, value, _ctx) => {
539
+ return _safeParse(_Err)(schema, value, _ctx);
540
+ };
541
+ const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
542
+ const ctx = _ctx ? {
543
+ ..._ctx,
544
+ direction: "backward"
545
+ } : { direction: "backward" };
546
+ return _safeParseAsync(_Err)(schema, value, ctx);
547
+ };
548
+ const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
549
+ return _safeParseAsync(_Err)(schema, value, _ctx);
550
+ };
551
+ //#endregion
552
+ //#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/regexes.js
553
+ /**
554
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
555
+ * (timestamps embedded in the id). Use {@link cuid2} instead.
556
+ * See https://github.com/paralleldrive/cuid.
557
+ */
558
+ const cuid = /^[cC][0-9a-z]{6,}$/;
559
+ const cuid2 = /^[0-9a-z]+$/;
560
+ const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
561
+ const xid = /^[0-9a-vA-V]{20}$/;
562
+ const ksuid = /^[A-Za-z0-9]{27}$/;
563
+ const nanoid = /^[a-zA-Z0-9_-]{21}$/;
564
+ /** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */
565
+ const duration$1 = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
566
+ /** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */
567
+ const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;
568
+ /** Returns a regex for validating an RFC 9562/4122 UUID.
569
+ *
570
+ * @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */
571
+ const uuid = (version) => {
572
+ if (!version) return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;
573
+ return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
574
+ };
575
+ /** Practical email validation */
576
+ const email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
577
+ const _emoji$1 = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
578
+ function emoji() {
579
+ return new RegExp(_emoji$1, "u");
580
+ }
581
+ const ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
582
+ const ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;
583
+ const cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
584
+ const 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])$/;
585
+ const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
586
+ const base64url = /^[A-Za-z0-9_-]*$/;
587
+ const httpProtocol = /^https?$/;
588
+ const e164 = /^\+[1-9]\d{6,14}$/;
589
+ const dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
590
+ const date$1 = /*@__PURE__*/ new RegExp(`^${dateSource}$`);
591
+ function timeSource(args) {
592
+ const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
593
+ 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+)?)?`;
594
+ }
595
+ function time$1(args) {
596
+ return new RegExp(`^${timeSource(args)}$`);
597
+ }
598
+ function datetime$1(args) {
599
+ const time = timeSource({ precision: args.precision });
600
+ const opts = ["Z"];
601
+ if (args.local) opts.push("");
602
+ if (args.offset) opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
603
+ const timeRegex = `${time}(?:${opts.join("|")})`;
604
+ return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
605
+ }
606
+ const string$1 = (params) => {
607
+ const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
608
+ return new RegExp(`^${regex}$`);
609
+ };
610
+ const integer = /^-?\d+$/;
611
+ const number$1 = /^-?\d+(?:\.\d+)?$/;
612
+ const lowercase = /^[^A-Z]*$/;
613
+ const uppercase = /^[^a-z]*$/;
614
+ //#endregion
615
+ //#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/checks.js
616
+ const $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
617
+ var _a;
618
+ inst._zod ?? (inst._zod = {});
619
+ inst._zod.def = def;
620
+ (_a = inst._zod).onattach ?? (_a.onattach = []);
621
+ });
622
+ const numericOriginMap = {
623
+ number: "number",
624
+ bigint: "bigint",
625
+ object: "date"
626
+ };
627
+ const $ZodCheckLessThan = /*@__PURE__*/ $constructor("$ZodCheckLessThan", (inst, def) => {
628
+ $ZodCheck.init(inst, def);
629
+ const origin = numericOriginMap[typeof def.value];
630
+ inst._zod.onattach.push((inst) => {
631
+ const bag = inst._zod.bag;
632
+ const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
633
+ if (def.value < curr) if (def.inclusive) bag.maximum = def.value;
634
+ else bag.exclusiveMaximum = def.value;
635
+ });
636
+ inst._zod.check = (payload) => {
637
+ if (def.inclusive ? payload.value <= def.value : payload.value < def.value) return;
638
+ payload.issues.push({
639
+ origin,
640
+ code: "too_big",
641
+ maximum: typeof def.value === "object" ? def.value.getTime() : def.value,
642
+ input: payload.value,
643
+ inclusive: def.inclusive,
644
+ inst,
645
+ continue: !def.abort
646
+ });
647
+ };
648
+ });
649
+ const $ZodCheckGreaterThan = /*@__PURE__*/ $constructor("$ZodCheckGreaterThan", (inst, def) => {
650
+ $ZodCheck.init(inst, def);
651
+ const origin = numericOriginMap[typeof def.value];
652
+ inst._zod.onattach.push((inst) => {
653
+ const bag = inst._zod.bag;
654
+ const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
655
+ if (def.value > curr) if (def.inclusive) bag.minimum = def.value;
656
+ else bag.exclusiveMinimum = def.value;
657
+ });
658
+ inst._zod.check = (payload) => {
659
+ if (def.inclusive ? payload.value >= def.value : payload.value > def.value) return;
660
+ payload.issues.push({
661
+ origin,
662
+ code: "too_small",
663
+ minimum: typeof def.value === "object" ? def.value.getTime() : def.value,
664
+ input: payload.value,
665
+ inclusive: def.inclusive,
666
+ inst,
667
+ continue: !def.abort
668
+ });
669
+ };
670
+ });
671
+ const $ZodCheckMultipleOf = /*@__PURE__*/ $constructor("$ZodCheckMultipleOf", (inst, def) => {
672
+ $ZodCheck.init(inst, def);
673
+ inst._zod.onattach.push((inst) => {
674
+ var _a;
675
+ (_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
676
+ });
677
+ inst._zod.check = (payload) => {
678
+ if (typeof payload.value !== typeof def.value) throw new Error("Cannot mix number and bigint in multiple_of check.");
679
+ if (typeof payload.value === "bigint" ? payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0) return;
680
+ payload.issues.push({
681
+ origin: typeof payload.value,
682
+ code: "not_multiple_of",
683
+ divisor: def.value,
684
+ input: payload.value,
685
+ inst,
686
+ continue: !def.abort
687
+ });
688
+ };
689
+ });
690
+ const $ZodCheckNumberFormat = /*@__PURE__*/ $constructor("$ZodCheckNumberFormat", (inst, def) => {
691
+ $ZodCheck.init(inst, def);
692
+ def.format = def.format || "float64";
693
+ const isInt = def.format?.includes("int");
694
+ const origin = isInt ? "int" : "number";
695
+ const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
696
+ inst._zod.onattach.push((inst) => {
697
+ const bag = inst._zod.bag;
698
+ bag.format = def.format;
699
+ bag.minimum = minimum;
700
+ bag.maximum = maximum;
701
+ if (isInt) bag.pattern = integer;
702
+ });
703
+ inst._zod.check = (payload) => {
704
+ const input = payload.value;
705
+ if (isInt) {
706
+ if (!Number.isInteger(input)) {
707
+ payload.issues.push({
708
+ expected: origin,
709
+ format: def.format,
710
+ code: "invalid_type",
711
+ continue: false,
712
+ input,
713
+ inst
714
+ });
715
+ return;
716
+ }
717
+ if (!Number.isSafeInteger(input)) {
718
+ if (input > 0) payload.issues.push({
719
+ input,
720
+ code: "too_big",
721
+ maximum: Number.MAX_SAFE_INTEGER,
722
+ note: "Integers must be within the safe integer range.",
723
+ inst,
724
+ origin,
725
+ inclusive: true,
726
+ continue: !def.abort
727
+ });
728
+ else payload.issues.push({
729
+ input,
730
+ code: "too_small",
731
+ minimum: Number.MIN_SAFE_INTEGER,
732
+ note: "Integers must be within the safe integer range.",
733
+ inst,
734
+ origin,
735
+ inclusive: true,
736
+ continue: !def.abort
737
+ });
738
+ return;
739
+ }
740
+ }
741
+ if (input < minimum) payload.issues.push({
742
+ origin: "number",
743
+ input,
744
+ code: "too_small",
745
+ minimum,
746
+ inclusive: true,
747
+ inst,
748
+ continue: !def.abort
749
+ });
750
+ if (input > maximum) payload.issues.push({
751
+ origin: "number",
752
+ input,
753
+ code: "too_big",
754
+ maximum,
755
+ inclusive: true,
756
+ inst,
757
+ continue: !def.abort
758
+ });
759
+ };
760
+ });
761
+ const $ZodCheckMaxLength = /*@__PURE__*/ $constructor("$ZodCheckMaxLength", (inst, def) => {
762
+ var _a;
763
+ $ZodCheck.init(inst, def);
764
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
765
+ const val = payload.value;
766
+ return !nullish(val) && val.length !== void 0;
767
+ });
768
+ inst._zod.onattach.push((inst) => {
769
+ const curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
770
+ if (def.maximum < curr) inst._zod.bag.maximum = def.maximum;
771
+ });
772
+ inst._zod.check = (payload) => {
773
+ const input = payload.value;
774
+ if (input.length <= def.maximum) return;
775
+ const origin = getLengthableOrigin(input);
776
+ payload.issues.push({
777
+ origin,
778
+ code: "too_big",
779
+ maximum: def.maximum,
780
+ inclusive: true,
781
+ input,
782
+ inst,
783
+ continue: !def.abort
784
+ });
785
+ };
786
+ });
787
+ const $ZodCheckMinLength = /*@__PURE__*/ $constructor("$ZodCheckMinLength", (inst, def) => {
788
+ var _a;
789
+ $ZodCheck.init(inst, def);
790
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
791
+ const val = payload.value;
792
+ return !nullish(val) && val.length !== void 0;
793
+ });
794
+ inst._zod.onattach.push((inst) => {
795
+ const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
796
+ if (def.minimum > curr) inst._zod.bag.minimum = def.minimum;
797
+ });
798
+ inst._zod.check = (payload) => {
799
+ const input = payload.value;
800
+ if (input.length >= def.minimum) return;
801
+ const origin = getLengthableOrigin(input);
802
+ payload.issues.push({
803
+ origin,
804
+ code: "too_small",
805
+ minimum: def.minimum,
806
+ inclusive: true,
807
+ input,
808
+ inst,
809
+ continue: !def.abort
810
+ });
811
+ };
812
+ });
813
+ const $ZodCheckLengthEquals = /*@__PURE__*/ $constructor("$ZodCheckLengthEquals", (inst, def) => {
814
+ var _a;
815
+ $ZodCheck.init(inst, def);
816
+ (_a = inst._zod.def).when ?? (_a.when = (payload) => {
817
+ const val = payload.value;
818
+ return !nullish(val) && val.length !== void 0;
819
+ });
820
+ inst._zod.onattach.push((inst) => {
821
+ const bag = inst._zod.bag;
822
+ bag.minimum = def.length;
823
+ bag.maximum = def.length;
824
+ bag.length = def.length;
825
+ });
826
+ inst._zod.check = (payload) => {
827
+ const input = payload.value;
828
+ const length = input.length;
829
+ if (length === def.length) return;
830
+ const origin = getLengthableOrigin(input);
831
+ const tooBig = length > def.length;
832
+ payload.issues.push({
833
+ origin,
834
+ ...tooBig ? {
835
+ code: "too_big",
836
+ maximum: def.length
837
+ } : {
838
+ code: "too_small",
839
+ minimum: def.length
840
+ },
841
+ inclusive: true,
842
+ exact: true,
843
+ input: payload.value,
844
+ inst,
845
+ continue: !def.abort
846
+ });
847
+ };
848
+ });
849
+ const $ZodCheckStringFormat = /*@__PURE__*/ $constructor("$ZodCheckStringFormat", (inst, def) => {
850
+ var _a, _b;
851
+ $ZodCheck.init(inst, def);
852
+ inst._zod.onattach.push((inst) => {
853
+ const bag = inst._zod.bag;
854
+ bag.format = def.format;
855
+ if (def.pattern) {
856
+ bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
857
+ bag.patterns.add(def.pattern);
858
+ }
859
+ });
860
+ if (def.pattern) (_a = inst._zod).check ?? (_a.check = (payload) => {
861
+ def.pattern.lastIndex = 0;
862
+ if (def.pattern.test(payload.value)) return;
863
+ payload.issues.push({
864
+ origin: "string",
865
+ code: "invalid_format",
866
+ format: def.format,
867
+ input: payload.value,
868
+ ...def.pattern ? { pattern: def.pattern.toString() } : {},
869
+ inst,
870
+ continue: !def.abort
871
+ });
872
+ });
873
+ else (_b = inst._zod).check ?? (_b.check = () => {});
874
+ });
875
+ const $ZodCheckRegex = /*@__PURE__*/ $constructor("$ZodCheckRegex", (inst, def) => {
876
+ $ZodCheckStringFormat.init(inst, def);
877
+ inst._zod.check = (payload) => {
878
+ def.pattern.lastIndex = 0;
879
+ if (def.pattern.test(payload.value)) return;
880
+ payload.issues.push({
881
+ origin: "string",
882
+ code: "invalid_format",
883
+ format: "regex",
884
+ input: payload.value,
885
+ pattern: def.pattern.toString(),
886
+ inst,
887
+ continue: !def.abort
888
+ });
889
+ };
890
+ });
891
+ const $ZodCheckLowerCase = /*@__PURE__*/ $constructor("$ZodCheckLowerCase", (inst, def) => {
892
+ def.pattern ?? (def.pattern = lowercase);
893
+ $ZodCheckStringFormat.init(inst, def);
894
+ });
895
+ const $ZodCheckUpperCase = /*@__PURE__*/ $constructor("$ZodCheckUpperCase", (inst, def) => {
896
+ def.pattern ?? (def.pattern = uppercase);
897
+ $ZodCheckStringFormat.init(inst, def);
898
+ });
899
+ const $ZodCheckIncludes = /*@__PURE__*/ $constructor("$ZodCheckIncludes", (inst, def) => {
900
+ $ZodCheck.init(inst, def);
901
+ const escapedRegex = escapeRegex(def.includes);
902
+ const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);
903
+ def.pattern = pattern;
904
+ inst._zod.onattach.push((inst) => {
905
+ const bag = inst._zod.bag;
906
+ bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
907
+ bag.patterns.add(pattern);
908
+ });
909
+ inst._zod.check = (payload) => {
910
+ if (payload.value.includes(def.includes, def.position)) return;
911
+ payload.issues.push({
912
+ origin: "string",
913
+ code: "invalid_format",
914
+ format: "includes",
915
+ includes: def.includes,
916
+ input: payload.value,
917
+ inst,
918
+ continue: !def.abort
919
+ });
920
+ };
921
+ });
922
+ const $ZodCheckStartsWith = /*@__PURE__*/ $constructor("$ZodCheckStartsWith", (inst, def) => {
923
+ $ZodCheck.init(inst, def);
924
+ const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
925
+ def.pattern ?? (def.pattern = pattern);
926
+ inst._zod.onattach.push((inst) => {
927
+ const bag = inst._zod.bag;
928
+ bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
929
+ bag.patterns.add(pattern);
930
+ });
931
+ inst._zod.check = (payload) => {
932
+ if (payload.value.startsWith(def.prefix)) return;
933
+ payload.issues.push({
934
+ origin: "string",
935
+ code: "invalid_format",
936
+ format: "starts_with",
937
+ prefix: def.prefix,
938
+ input: payload.value,
939
+ inst,
940
+ continue: !def.abort
941
+ });
942
+ };
943
+ });
944
+ const $ZodCheckEndsWith = /*@__PURE__*/ $constructor("$ZodCheckEndsWith", (inst, def) => {
945
+ $ZodCheck.init(inst, def);
946
+ const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
947
+ def.pattern ?? (def.pattern = pattern);
948
+ inst._zod.onattach.push((inst) => {
949
+ const bag = inst._zod.bag;
950
+ bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
951
+ bag.patterns.add(pattern);
952
+ });
953
+ inst._zod.check = (payload) => {
954
+ if (payload.value.endsWith(def.suffix)) return;
955
+ payload.issues.push({
956
+ origin: "string",
957
+ code: "invalid_format",
958
+ format: "ends_with",
959
+ suffix: def.suffix,
960
+ input: payload.value,
961
+ inst,
962
+ continue: !def.abort
963
+ });
964
+ };
965
+ });
966
+ const $ZodCheckOverwrite = /*@__PURE__*/ $constructor("$ZodCheckOverwrite", (inst, def) => {
967
+ $ZodCheck.init(inst, def);
968
+ inst._zod.check = (payload) => {
969
+ payload.value = def.tx(payload.value);
970
+ };
971
+ });
972
+ //#endregion
973
+ //#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/doc.js
974
+ var Doc = class {
975
+ constructor(args = []) {
976
+ this.content = [];
977
+ this.indent = 0;
978
+ if (this) this.args = args;
979
+ }
980
+ indented(fn) {
981
+ this.indent += 1;
982
+ fn(this);
983
+ this.indent -= 1;
984
+ }
985
+ write(arg) {
986
+ if (typeof arg === "function") {
987
+ arg(this, { execution: "sync" });
988
+ arg(this, { execution: "async" });
989
+ return;
990
+ }
991
+ const lines = arg.split("\n").filter((x) => x);
992
+ const minIndent = Math.min(...lines.map((x) => x.length - x.trimStart().length));
993
+ const dedented = lines.map((x) => x.slice(minIndent)).map((x) => " ".repeat(this.indent * 2) + x);
994
+ for (const line of dedented) this.content.push(line);
995
+ }
996
+ compile() {
997
+ const F = Function;
998
+ const args = this?.args;
999
+ const lines = [...(this?.content ?? [``]).map((x) => ` ${x}`)];
1000
+ return new F(...args, lines.join("\n"));
1001
+ }
1002
+ };
1003
+ //#endregion
1004
+ //#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/versions.js
1005
+ const version = {
1006
+ major: 4,
1007
+ minor: 4,
1008
+ patch: 3
1009
+ };
1010
+ //#endregion
1011
+ //#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/schemas.js
1012
+ const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
1013
+ var _a;
1014
+ inst ?? (inst = {});
1015
+ inst._zod.def = def;
1016
+ inst._zod.bag = inst._zod.bag || {};
1017
+ inst._zod.version = version;
1018
+ const checks = [...inst._zod.def.checks ?? []];
1019
+ if (inst._zod.traits.has("$ZodCheck")) checks.unshift(inst);
1020
+ for (const ch of checks) for (const fn of ch._zod.onattach) fn(inst);
1021
+ if (checks.length === 0) {
1022
+ (_a = inst._zod).deferred ?? (_a.deferred = []);
1023
+ inst._zod.deferred?.push(() => {
1024
+ inst._zod.run = inst._zod.parse;
1025
+ });
1026
+ } else {
1027
+ const runChecks = (payload, checks, ctx) => {
1028
+ let isAborted = aborted(payload);
1029
+ let asyncResult;
1030
+ for (const ch of checks) {
1031
+ if (ch._zod.def.when) {
1032
+ if (explicitlyAborted(payload)) continue;
1033
+ if (!ch._zod.def.when(payload)) continue;
1034
+ } else if (isAborted) continue;
1035
+ const currLen = payload.issues.length;
1036
+ const _ = ch._zod.check(payload);
1037
+ if (_ instanceof Promise && ctx?.async === false) throw new $ZodAsyncError();
1038
+ if (asyncResult || _ instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
1039
+ await _;
1040
+ if (payload.issues.length === currLen) return;
1041
+ if (!isAborted) isAborted = aborted(payload, currLen);
1042
+ });
1043
+ else {
1044
+ if (payload.issues.length === currLen) continue;
1045
+ if (!isAborted) isAborted = aborted(payload, currLen);
1046
+ }
1047
+ }
1048
+ if (asyncResult) return asyncResult.then(() => {
1049
+ return payload;
1050
+ });
1051
+ return payload;
1052
+ };
1053
+ const handleCanaryResult = (canary, payload, ctx) => {
1054
+ if (aborted(canary)) {
1055
+ canary.aborted = true;
1056
+ return canary;
1057
+ }
1058
+ const checkResult = runChecks(payload, checks, ctx);
1059
+ if (checkResult instanceof Promise) {
1060
+ if (ctx.async === false) throw new $ZodAsyncError();
1061
+ return checkResult.then((checkResult) => inst._zod.parse(checkResult, ctx));
1062
+ }
1063
+ return inst._zod.parse(checkResult, ctx);
1064
+ };
1065
+ inst._zod.run = (payload, ctx) => {
1066
+ if (ctx.skipChecks) return inst._zod.parse(payload, ctx);
1067
+ if (ctx.direction === "backward") {
1068
+ const canary = inst._zod.parse({
1069
+ value: payload.value,
1070
+ issues: []
1071
+ }, {
1072
+ ...ctx,
1073
+ skipChecks: true
1074
+ });
1075
+ if (canary instanceof Promise) return canary.then((canary) => {
1076
+ return handleCanaryResult(canary, payload, ctx);
1077
+ });
1078
+ return handleCanaryResult(canary, payload, ctx);
1079
+ }
1080
+ const result = inst._zod.parse(payload, ctx);
1081
+ if (result instanceof Promise) {
1082
+ if (ctx.async === false) throw new $ZodAsyncError();
1083
+ return result.then((result) => runChecks(result, checks, ctx));
1084
+ }
1085
+ return runChecks(result, checks, ctx);
1086
+ };
1087
+ }
1088
+ defineLazy(inst, "~standard", () => ({
1089
+ validate: (value) => {
1090
+ try {
1091
+ const r = safeParse$1(inst, value);
1092
+ return r.success ? { value: r.data } : { issues: r.error?.issues };
1093
+ } catch (_) {
1094
+ return safeParseAsync$1(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
1095
+ }
1096
+ },
1097
+ vendor: "zod",
1098
+ version: 1
1099
+ }));
1100
+ });
1101
+ const $ZodString = /*@__PURE__*/ $constructor("$ZodString", (inst, def) => {
1102
+ $ZodType.init(inst, def);
1103
+ inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$1(inst._zod.bag);
1104
+ inst._zod.parse = (payload, _) => {
1105
+ if (def.coerce) try {
1106
+ payload.value = String(payload.value);
1107
+ } catch (_) {}
1108
+ if (typeof payload.value === "string") return payload;
1109
+ payload.issues.push({
1110
+ expected: "string",
1111
+ code: "invalid_type",
1112
+ input: payload.value,
1113
+ inst
1114
+ });
1115
+ return payload;
1116
+ };
1117
+ });
1118
+ const $ZodStringFormat = /*@__PURE__*/ $constructor("$ZodStringFormat", (inst, def) => {
1119
+ $ZodCheckStringFormat.init(inst, def);
1120
+ $ZodString.init(inst, def);
1121
+ });
1122
+ const $ZodGUID = /*@__PURE__*/ $constructor("$ZodGUID", (inst, def) => {
1123
+ def.pattern ?? (def.pattern = guid);
1124
+ $ZodStringFormat.init(inst, def);
1125
+ });
1126
+ const $ZodUUID = /*@__PURE__*/ $constructor("$ZodUUID", (inst, def) => {
1127
+ if (def.version) {
1128
+ const v = {
1129
+ v1: 1,
1130
+ v2: 2,
1131
+ v3: 3,
1132
+ v4: 4,
1133
+ v5: 5,
1134
+ v6: 6,
1135
+ v7: 7,
1136
+ v8: 8
1137
+ }[def.version];
1138
+ if (v === void 0) throw new Error(`Invalid UUID version: "${def.version}"`);
1139
+ def.pattern ?? (def.pattern = uuid(v));
1140
+ } else def.pattern ?? (def.pattern = uuid());
1141
+ $ZodStringFormat.init(inst, def);
1142
+ });
1143
+ const $ZodEmail = /*@__PURE__*/ $constructor("$ZodEmail", (inst, def) => {
1144
+ def.pattern ?? (def.pattern = email);
1145
+ $ZodStringFormat.init(inst, def);
1146
+ });
1147
+ const $ZodURL = /*@__PURE__*/ $constructor("$ZodURL", (inst, def) => {
1148
+ $ZodStringFormat.init(inst, def);
1149
+ inst._zod.check = (payload) => {
1150
+ try {
1151
+ const trimmed = payload.value.trim();
1152
+ if (!def.normalize && def.protocol?.source === httpProtocol.source) {
1153
+ if (!/^https?:\/\//i.test(trimmed)) {
1154
+ payload.issues.push({
1155
+ code: "invalid_format",
1156
+ format: "url",
1157
+ note: "Invalid URL format",
1158
+ input: payload.value,
1159
+ inst,
1160
+ continue: !def.abort
1161
+ });
1162
+ return;
1163
+ }
1164
+ }
1165
+ const url = new URL(trimmed);
1166
+ if (def.hostname) {
1167
+ def.hostname.lastIndex = 0;
1168
+ if (!def.hostname.test(url.hostname)) payload.issues.push({
1169
+ code: "invalid_format",
1170
+ format: "url",
1171
+ note: "Invalid hostname",
1172
+ pattern: def.hostname.source,
1173
+ input: payload.value,
1174
+ inst,
1175
+ continue: !def.abort
1176
+ });
1177
+ }
1178
+ if (def.protocol) {
1179
+ def.protocol.lastIndex = 0;
1180
+ if (!def.protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol)) payload.issues.push({
1181
+ code: "invalid_format",
1182
+ format: "url",
1183
+ note: "Invalid protocol",
1184
+ pattern: def.protocol.source,
1185
+ input: payload.value,
1186
+ inst,
1187
+ continue: !def.abort
1188
+ });
1189
+ }
1190
+ if (def.normalize) payload.value = url.href;
1191
+ else payload.value = trimmed;
1192
+ return;
1193
+ } catch (_) {
1194
+ payload.issues.push({
1195
+ code: "invalid_format",
1196
+ format: "url",
1197
+ input: payload.value,
1198
+ inst,
1199
+ continue: !def.abort
1200
+ });
1201
+ }
1202
+ };
1203
+ });
1204
+ const $ZodEmoji = /*@__PURE__*/ $constructor("$ZodEmoji", (inst, def) => {
1205
+ def.pattern ?? (def.pattern = emoji());
1206
+ $ZodStringFormat.init(inst, def);
1207
+ });
1208
+ const $ZodNanoID = /*@__PURE__*/ $constructor("$ZodNanoID", (inst, def) => {
1209
+ def.pattern ?? (def.pattern = nanoid);
1210
+ $ZodStringFormat.init(inst, def);
1211
+ });
1212
+ /**
1213
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
1214
+ * (timestamps embedded in the id). Use {@link $ZodCUID2} instead.
1215
+ * See https://github.com/paralleldrive/cuid.
1216
+ */
1217
+ const $ZodCUID = /*@__PURE__*/ $constructor("$ZodCUID", (inst, def) => {
1218
+ def.pattern ?? (def.pattern = cuid);
1219
+ $ZodStringFormat.init(inst, def);
1220
+ });
1221
+ const $ZodCUID2 = /*@__PURE__*/ $constructor("$ZodCUID2", (inst, def) => {
1222
+ def.pattern ?? (def.pattern = cuid2);
1223
+ $ZodStringFormat.init(inst, def);
1224
+ });
1225
+ const $ZodULID = /*@__PURE__*/ $constructor("$ZodULID", (inst, def) => {
1226
+ def.pattern ?? (def.pattern = ulid);
1227
+ $ZodStringFormat.init(inst, def);
1228
+ });
1229
+ const $ZodXID = /*@__PURE__*/ $constructor("$ZodXID", (inst, def) => {
1230
+ def.pattern ?? (def.pattern = xid);
1231
+ $ZodStringFormat.init(inst, def);
1232
+ });
1233
+ const $ZodKSUID = /*@__PURE__*/ $constructor("$ZodKSUID", (inst, def) => {
1234
+ def.pattern ?? (def.pattern = ksuid);
1235
+ $ZodStringFormat.init(inst, def);
1236
+ });
1237
+ const $ZodISODateTime = /*@__PURE__*/ $constructor("$ZodISODateTime", (inst, def) => {
1238
+ def.pattern ?? (def.pattern = datetime$1(def));
1239
+ $ZodStringFormat.init(inst, def);
1240
+ });
1241
+ const $ZodISODate = /*@__PURE__*/ $constructor("$ZodISODate", (inst, def) => {
1242
+ def.pattern ?? (def.pattern = date$1);
1243
+ $ZodStringFormat.init(inst, def);
1244
+ });
1245
+ const $ZodISOTime = /*@__PURE__*/ $constructor("$ZodISOTime", (inst, def) => {
1246
+ def.pattern ?? (def.pattern = time$1(def));
1247
+ $ZodStringFormat.init(inst, def);
1248
+ });
1249
+ const $ZodISODuration = /*@__PURE__*/ $constructor("$ZodISODuration", (inst, def) => {
1250
+ def.pattern ?? (def.pattern = duration$1);
1251
+ $ZodStringFormat.init(inst, def);
1252
+ });
1253
+ const $ZodIPv4 = /*@__PURE__*/ $constructor("$ZodIPv4", (inst, def) => {
1254
+ def.pattern ?? (def.pattern = ipv4);
1255
+ $ZodStringFormat.init(inst, def);
1256
+ inst._zod.bag.format = `ipv4`;
1257
+ });
1258
+ const $ZodIPv6 = /*@__PURE__*/ $constructor("$ZodIPv6", (inst, def) => {
1259
+ def.pattern ?? (def.pattern = ipv6);
1260
+ $ZodStringFormat.init(inst, def);
1261
+ inst._zod.bag.format = `ipv6`;
1262
+ inst._zod.check = (payload) => {
1263
+ try {
1264
+ new URL(`http://[${payload.value}]`);
1265
+ } catch {
1266
+ payload.issues.push({
1267
+ code: "invalid_format",
1268
+ format: "ipv6",
1269
+ input: payload.value,
1270
+ inst,
1271
+ continue: !def.abort
1272
+ });
1273
+ }
1274
+ };
1275
+ });
1276
+ const $ZodCIDRv4 = /*@__PURE__*/ $constructor("$ZodCIDRv4", (inst, def) => {
1277
+ def.pattern ?? (def.pattern = cidrv4);
1278
+ $ZodStringFormat.init(inst, def);
1279
+ });
1280
+ const $ZodCIDRv6 = /*@__PURE__*/ $constructor("$ZodCIDRv6", (inst, def) => {
1281
+ def.pattern ?? (def.pattern = cidrv6);
1282
+ $ZodStringFormat.init(inst, def);
1283
+ inst._zod.check = (payload) => {
1284
+ const parts = payload.value.split("/");
1285
+ try {
1286
+ if (parts.length !== 2) throw new Error();
1287
+ const [address, prefix] = parts;
1288
+ if (!prefix) throw new Error();
1289
+ const prefixNum = Number(prefix);
1290
+ if (`${prefixNum}` !== prefix) throw new Error();
1291
+ if (prefixNum < 0 || prefixNum > 128) throw new Error();
1292
+ new URL(`http://[${address}]`);
1293
+ } catch {
1294
+ payload.issues.push({
1295
+ code: "invalid_format",
1296
+ format: "cidrv6",
1297
+ input: payload.value,
1298
+ inst,
1299
+ continue: !def.abort
1300
+ });
1301
+ }
1302
+ };
1303
+ });
1304
+ function isValidBase64(data) {
1305
+ if (data === "") return true;
1306
+ if (/\s/.test(data)) return false;
1307
+ if (data.length % 4 !== 0) return false;
1308
+ try {
1309
+ atob(data);
1310
+ return true;
1311
+ } catch {
1312
+ return false;
1313
+ }
1314
+ }
1315
+ const $ZodBase64 = /*@__PURE__*/ $constructor("$ZodBase64", (inst, def) => {
1316
+ def.pattern ?? (def.pattern = base64);
1317
+ $ZodStringFormat.init(inst, def);
1318
+ inst._zod.bag.contentEncoding = "base64";
1319
+ inst._zod.check = (payload) => {
1320
+ if (isValidBase64(payload.value)) return;
1321
+ payload.issues.push({
1322
+ code: "invalid_format",
1323
+ format: "base64",
1324
+ input: payload.value,
1325
+ inst,
1326
+ continue: !def.abort
1327
+ });
1328
+ };
1329
+ });
1330
+ function isValidBase64URL(data) {
1331
+ if (!base64url.test(data)) return false;
1332
+ const base64 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
1333
+ return isValidBase64(base64.padEnd(Math.ceil(base64.length / 4) * 4, "="));
1334
+ }
1335
+ const $ZodBase64URL = /*@__PURE__*/ $constructor("$ZodBase64URL", (inst, def) => {
1336
+ def.pattern ?? (def.pattern = base64url);
1337
+ $ZodStringFormat.init(inst, def);
1338
+ inst._zod.bag.contentEncoding = "base64url";
1339
+ inst._zod.check = (payload) => {
1340
+ if (isValidBase64URL(payload.value)) return;
1341
+ payload.issues.push({
1342
+ code: "invalid_format",
1343
+ format: "base64url",
1344
+ input: payload.value,
1345
+ inst,
1346
+ continue: !def.abort
1347
+ });
1348
+ };
1349
+ });
1350
+ const $ZodE164 = /*@__PURE__*/ $constructor("$ZodE164", (inst, def) => {
1351
+ def.pattern ?? (def.pattern = e164);
1352
+ $ZodStringFormat.init(inst, def);
1353
+ });
1354
+ function isValidJWT(token, algorithm = null) {
1355
+ try {
1356
+ const tokensParts = token.split(".");
1357
+ if (tokensParts.length !== 3) return false;
1358
+ const [header] = tokensParts;
1359
+ if (!header) return false;
1360
+ const parsedHeader = JSON.parse(atob(header));
1361
+ if ("typ" in parsedHeader && parsedHeader?.typ !== "JWT") return false;
1362
+ if (!parsedHeader.alg) return false;
1363
+ if (algorithm && (!("alg" in parsedHeader) || parsedHeader.alg !== algorithm)) return false;
1364
+ return true;
1365
+ } catch {
1366
+ return false;
1367
+ }
1368
+ }
1369
+ const $ZodJWT = /*@__PURE__*/ $constructor("$ZodJWT", (inst, def) => {
1370
+ $ZodStringFormat.init(inst, def);
1371
+ inst._zod.check = (payload) => {
1372
+ if (isValidJWT(payload.value, def.alg)) return;
1373
+ payload.issues.push({
1374
+ code: "invalid_format",
1375
+ format: "jwt",
1376
+ input: payload.value,
1377
+ inst,
1378
+ continue: !def.abort
1379
+ });
1380
+ };
1381
+ });
1382
+ const $ZodNumber = /*@__PURE__*/ $constructor("$ZodNumber", (inst, def) => {
1383
+ $ZodType.init(inst, def);
1384
+ inst._zod.pattern = inst._zod.bag.pattern ?? number$1;
1385
+ inst._zod.parse = (payload, _ctx) => {
1386
+ if (def.coerce) try {
1387
+ payload.value = Number(payload.value);
1388
+ } catch (_) {}
1389
+ const input = payload.value;
1390
+ if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) return payload;
1391
+ const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : void 0 : void 0;
1392
+ payload.issues.push({
1393
+ expected: "number",
1394
+ code: "invalid_type",
1395
+ input,
1396
+ inst,
1397
+ ...received ? { received } : {}
1398
+ });
1399
+ return payload;
1400
+ };
1401
+ });
1402
+ const $ZodNumberFormat = /*@__PURE__*/ $constructor("$ZodNumberFormat", (inst, def) => {
1403
+ $ZodCheckNumberFormat.init(inst, def);
1404
+ $ZodNumber.init(inst, def);
1405
+ });
1406
+ const $ZodUnknown = /*@__PURE__*/ $constructor("$ZodUnknown", (inst, def) => {
1407
+ $ZodType.init(inst, def);
1408
+ inst._zod.parse = (payload) => payload;
1409
+ });
1410
+ const $ZodNever = /*@__PURE__*/ $constructor("$ZodNever", (inst, def) => {
1411
+ $ZodType.init(inst, def);
1412
+ inst._zod.parse = (payload, _ctx) => {
1413
+ payload.issues.push({
1414
+ expected: "never",
1415
+ code: "invalid_type",
1416
+ input: payload.value,
1417
+ inst
1418
+ });
1419
+ return payload;
1420
+ };
1421
+ });
1422
+ function handleArrayResult(result, final, index) {
1423
+ if (result.issues.length) final.issues.push(...prefixIssues(index, result.issues));
1424
+ final.value[index] = result.value;
1425
+ }
1426
+ const $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => {
1427
+ $ZodType.init(inst, def);
1428
+ inst._zod.parse = (payload, ctx) => {
1429
+ const input = payload.value;
1430
+ if (!Array.isArray(input)) {
1431
+ payload.issues.push({
1432
+ expected: "array",
1433
+ code: "invalid_type",
1434
+ input,
1435
+ inst
1436
+ });
1437
+ return payload;
1438
+ }
1439
+ payload.value = Array(input.length);
1440
+ const proms = [];
1441
+ for (let i = 0; i < input.length; i++) {
1442
+ const item = input[i];
1443
+ const result = def.element._zod.run({
1444
+ value: item,
1445
+ issues: []
1446
+ }, ctx);
1447
+ if (result instanceof Promise) proms.push(result.then((result) => handleArrayResult(result, payload, i)));
1448
+ else handleArrayResult(result, payload, i);
1449
+ }
1450
+ if (proms.length) return Promise.all(proms).then(() => payload);
1451
+ return payload;
1452
+ };
1453
+ });
1454
+ function handlePropertyResult(result, final, key, input, isOptionalIn, isOptionalOut) {
1455
+ const isPresent = key in input;
1456
+ if (result.issues.length) {
1457
+ if (isOptionalIn && isOptionalOut && !isPresent) return;
1458
+ final.issues.push(...prefixIssues(key, result.issues));
1459
+ }
1460
+ if (!isPresent && !isOptionalIn) {
1461
+ if (!result.issues.length) final.issues.push({
1462
+ code: "invalid_type",
1463
+ expected: "nonoptional",
1464
+ input: void 0,
1465
+ path: [key]
1466
+ });
1467
+ return;
1468
+ }
1469
+ if (result.value === void 0) {
1470
+ if (isPresent) final.value[key] = void 0;
1471
+ } else final.value[key] = result.value;
1472
+ }
1473
+ function normalizeDef(def) {
1474
+ const keys = Object.keys(def.shape);
1475
+ for (const k of keys) if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
1476
+ const okeys = optionalKeys(def.shape);
1477
+ return {
1478
+ ...def,
1479
+ keys,
1480
+ keySet: new Set(keys),
1481
+ numKeys: keys.length,
1482
+ optionalKeys: new Set(okeys)
1483
+ };
1484
+ }
1485
+ function handleCatchall(proms, input, payload, ctx, def, inst) {
1486
+ const unrecognized = [];
1487
+ const keySet = def.keySet;
1488
+ const _catchall = def.catchall._zod;
1489
+ const t = _catchall.def.type;
1490
+ const isOptionalIn = _catchall.optin === "optional";
1491
+ const isOptionalOut = _catchall.optout === "optional";
1492
+ for (const key in input) {
1493
+ if (key === "__proto__") continue;
1494
+ if (keySet.has(key)) continue;
1495
+ if (t === "never") {
1496
+ unrecognized.push(key);
1497
+ continue;
1498
+ }
1499
+ const r = _catchall.run({
1500
+ value: input[key],
1501
+ issues: []
1502
+ }, ctx);
1503
+ if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut)));
1504
+ else handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
1505
+ }
1506
+ if (unrecognized.length) payload.issues.push({
1507
+ code: "unrecognized_keys",
1508
+ keys: unrecognized,
1509
+ input,
1510
+ inst
1511
+ });
1512
+ if (!proms.length) return payload;
1513
+ return Promise.all(proms).then(() => {
1514
+ return payload;
1515
+ });
1516
+ }
1517
+ const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
1518
+ $ZodType.init(inst, def);
1519
+ if (!Object.getOwnPropertyDescriptor(def, "shape")?.get) {
1520
+ const sh = def.shape;
1521
+ Object.defineProperty(def, "shape", { get: () => {
1522
+ const newSh = { ...sh };
1523
+ Object.defineProperty(def, "shape", { value: newSh });
1524
+ return newSh;
1525
+ } });
1526
+ }
1527
+ const _normalized = cached(() => normalizeDef(def));
1528
+ defineLazy(inst._zod, "propValues", () => {
1529
+ const shape = def.shape;
1530
+ const propValues = {};
1531
+ for (const key in shape) {
1532
+ const field = shape[key]._zod;
1533
+ if (field.values) {
1534
+ propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
1535
+ for (const v of field.values) propValues[key].add(v);
1536
+ }
1537
+ }
1538
+ return propValues;
1539
+ });
1540
+ const isObject$1 = isObject;
1541
+ const catchall = def.catchall;
1542
+ let value;
1543
+ inst._zod.parse = (payload, ctx) => {
1544
+ value ?? (value = _normalized.value);
1545
+ const input = payload.value;
1546
+ if (!isObject$1(input)) {
1547
+ payload.issues.push({
1548
+ expected: "object",
1549
+ code: "invalid_type",
1550
+ input,
1551
+ inst
1552
+ });
1553
+ return payload;
1554
+ }
1555
+ payload.value = {};
1556
+ const proms = [];
1557
+ const shape = value.shape;
1558
+ for (const key of value.keys) {
1559
+ const el = shape[key];
1560
+ const isOptionalIn = el._zod.optin === "optional";
1561
+ const isOptionalOut = el._zod.optout === "optional";
1562
+ const r = el._zod.run({
1563
+ value: input[key],
1564
+ issues: []
1565
+ }, ctx);
1566
+ if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut)));
1567
+ else handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
1568
+ }
1569
+ if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload;
1570
+ return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
1571
+ };
1572
+ });
1573
+ const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) => {
1574
+ $ZodObject.init(inst, def);
1575
+ const superParse = inst._zod.parse;
1576
+ const _normalized = cached(() => normalizeDef(def));
1577
+ const generateFastpass = (shape) => {
1578
+ const doc = new Doc([
1579
+ "shape",
1580
+ "payload",
1581
+ "ctx"
1582
+ ]);
1583
+ const normalized = _normalized.value;
1584
+ const parseStr = (key) => {
1585
+ const k = esc(key);
1586
+ return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
1587
+ };
1588
+ doc.write(`const input = payload.value;`);
1589
+ const ids = Object.create(null);
1590
+ let counter = 0;
1591
+ for (const key of normalized.keys) ids[key] = `key_${counter++}`;
1592
+ doc.write(`const newResult = {};`);
1593
+ for (const key of normalized.keys) {
1594
+ const id = ids[key];
1595
+ const k = esc(key);
1596
+ const schema = shape[key];
1597
+ const isOptionalIn = schema?._zod?.optin === "optional";
1598
+ const isOptionalOut = schema?._zod?.optout === "optional";
1599
+ doc.write(`const ${id} = ${parseStr(key)};`);
1600
+ if (isOptionalIn && isOptionalOut) doc.write(`
1601
+ if (${id}.issues.length) {
1602
+ if (${k} in input) {
1603
+ payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
1604
+ ...iss,
1605
+ path: iss.path ? [${k}, ...iss.path] : [${k}]
1606
+ })));
1607
+ }
1608
+ }
1609
+
1610
+ if (${id}.value === undefined) {
1611
+ if (${k} in input) {
1612
+ newResult[${k}] = undefined;
1613
+ }
1614
+ } else {
1615
+ newResult[${k}] = ${id}.value;
1616
+ }
1617
+
1618
+ `);
1619
+ else if (!isOptionalIn) doc.write(`
1620
+ const ${id}_present = ${k} in input;
1621
+ if (${id}.issues.length) {
1622
+ payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
1623
+ ...iss,
1624
+ path: iss.path ? [${k}, ...iss.path] : [${k}]
1625
+ })));
1626
+ }
1627
+ if (!${id}_present && !${id}.issues.length) {
1628
+ payload.issues.push({
1629
+ code: "invalid_type",
1630
+ expected: "nonoptional",
1631
+ input: undefined,
1632
+ path: [${k}]
1633
+ });
1634
+ }
1635
+
1636
+ if (${id}_present) {
1637
+ if (${id}.value === undefined) {
1638
+ newResult[${k}] = undefined;
1639
+ } else {
1640
+ newResult[${k}] = ${id}.value;
1641
+ }
1642
+ }
1643
+
1644
+ `);
1645
+ else doc.write(`
1646
+ if (${id}.issues.length) {
1647
+ payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
1648
+ ...iss,
1649
+ path: iss.path ? [${k}, ...iss.path] : [${k}]
1650
+ })));
1651
+ }
1652
+
1653
+ if (${id}.value === undefined) {
1654
+ if (${k} in input) {
1655
+ newResult[${k}] = undefined;
1656
+ }
1657
+ } else {
1658
+ newResult[${k}] = ${id}.value;
1659
+ }
1660
+
1661
+ `);
1662
+ }
1663
+ doc.write(`payload.value = newResult;`);
1664
+ doc.write(`return payload;`);
1665
+ const fn = doc.compile();
1666
+ return (payload, ctx) => fn(shape, payload, ctx);
1667
+ };
1668
+ let fastpass;
1669
+ const isObject$2 = isObject;
1670
+ const jit = !globalConfig.jitless;
1671
+ const fastEnabled = jit && allowsEval.value;
1672
+ const catchall = def.catchall;
1673
+ let value;
1674
+ inst._zod.parse = (payload, ctx) => {
1675
+ value ?? (value = _normalized.value);
1676
+ const input = payload.value;
1677
+ if (!isObject$2(input)) {
1678
+ payload.issues.push({
1679
+ expected: "object",
1680
+ code: "invalid_type",
1681
+ input,
1682
+ inst
1683
+ });
1684
+ return payload;
1685
+ }
1686
+ if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {
1687
+ if (!fastpass) fastpass = generateFastpass(def.shape);
1688
+ payload = fastpass(payload, ctx);
1689
+ if (!catchall) return payload;
1690
+ return handleCatchall([], input, payload, ctx, value, inst);
1691
+ }
1692
+ return superParse(payload, ctx);
1693
+ };
1694
+ });
1695
+ function handleUnionResults(results, final, inst, ctx) {
1696
+ for (const result of results) if (result.issues.length === 0) {
1697
+ final.value = result.value;
1698
+ return final;
1699
+ }
1700
+ const nonaborted = results.filter((r) => !aborted(r));
1701
+ if (nonaborted.length === 1) {
1702
+ final.value = nonaborted[0].value;
1703
+ return nonaborted[0];
1704
+ }
1705
+ final.issues.push({
1706
+ code: "invalid_union",
1707
+ input: final.value,
1708
+ inst,
1709
+ errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
1710
+ });
1711
+ return final;
1712
+ }
1713
+ const $ZodUnion = /*@__PURE__*/ $constructor("$ZodUnion", (inst, def) => {
1714
+ $ZodType.init(inst, def);
1715
+ defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0);
1716
+ defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
1717
+ defineLazy(inst._zod, "values", () => {
1718
+ if (def.options.every((o) => o._zod.values)) return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
1719
+ });
1720
+ defineLazy(inst._zod, "pattern", () => {
1721
+ if (def.options.every((o) => o._zod.pattern)) {
1722
+ const patterns = def.options.map((o) => o._zod.pattern);
1723
+ return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`);
1724
+ }
1725
+ });
1726
+ const first = def.options.length === 1 ? def.options[0]._zod.run : null;
1727
+ inst._zod.parse = (payload, ctx) => {
1728
+ if (first) return first(payload, ctx);
1729
+ let async = false;
1730
+ const results = [];
1731
+ for (const option of def.options) {
1732
+ const result = option._zod.run({
1733
+ value: payload.value,
1734
+ issues: []
1735
+ }, ctx);
1736
+ if (result instanceof Promise) {
1737
+ results.push(result);
1738
+ async = true;
1739
+ } else {
1740
+ if (result.issues.length === 0) return result;
1741
+ results.push(result);
1742
+ }
1743
+ }
1744
+ if (!async) return handleUnionResults(results, payload, inst, ctx);
1745
+ return Promise.all(results).then((results) => {
1746
+ return handleUnionResults(results, payload, inst, ctx);
1747
+ });
1748
+ };
1749
+ });
1750
+ const $ZodIntersection = /*@__PURE__*/ $constructor("$ZodIntersection", (inst, def) => {
1751
+ $ZodType.init(inst, def);
1752
+ inst._zod.parse = (payload, ctx) => {
1753
+ const input = payload.value;
1754
+ const left = def.left._zod.run({
1755
+ value: input,
1756
+ issues: []
1757
+ }, ctx);
1758
+ const right = def.right._zod.run({
1759
+ value: input,
1760
+ issues: []
1761
+ }, ctx);
1762
+ if (left instanceof Promise || right instanceof Promise) return Promise.all([left, right]).then(([left, right]) => {
1763
+ return handleIntersectionResults(payload, left, right);
1764
+ });
1765
+ return handleIntersectionResults(payload, left, right);
1766
+ };
1767
+ });
1768
+ function mergeValues(a, b) {
1769
+ if (a === b) return {
1770
+ valid: true,
1771
+ data: a
1772
+ };
1773
+ if (a instanceof Date && b instanceof Date && +a === +b) return {
1774
+ valid: true,
1775
+ data: a
1776
+ };
1777
+ if (isPlainObject(a) && isPlainObject(b)) {
1778
+ const bKeys = Object.keys(b);
1779
+ const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);
1780
+ const newObj = {
1781
+ ...a,
1782
+ ...b
1783
+ };
1784
+ for (const key of sharedKeys) {
1785
+ const sharedValue = mergeValues(a[key], b[key]);
1786
+ if (!sharedValue.valid) return {
1787
+ valid: false,
1788
+ mergeErrorPath: [key, ...sharedValue.mergeErrorPath]
1789
+ };
1790
+ newObj[key] = sharedValue.data;
1791
+ }
1792
+ return {
1793
+ valid: true,
1794
+ data: newObj
1795
+ };
1796
+ }
1797
+ if (Array.isArray(a) && Array.isArray(b)) {
1798
+ if (a.length !== b.length) return {
1799
+ valid: false,
1800
+ mergeErrorPath: []
1801
+ };
1802
+ const newArray = [];
1803
+ for (let index = 0; index < a.length; index++) {
1804
+ const itemA = a[index];
1805
+ const itemB = b[index];
1806
+ const sharedValue = mergeValues(itemA, itemB);
1807
+ if (!sharedValue.valid) return {
1808
+ valid: false,
1809
+ mergeErrorPath: [index, ...sharedValue.mergeErrorPath]
1810
+ };
1811
+ newArray.push(sharedValue.data);
1812
+ }
1813
+ return {
1814
+ valid: true,
1815
+ data: newArray
1816
+ };
1817
+ }
1818
+ return {
1819
+ valid: false,
1820
+ mergeErrorPath: []
1821
+ };
1822
+ }
1823
+ function handleIntersectionResults(result, left, right) {
1824
+ const unrecKeys = /* @__PURE__ */ new Map();
1825
+ let unrecIssue;
1826
+ for (const iss of left.issues) if (iss.code === "unrecognized_keys") {
1827
+ unrecIssue ?? (unrecIssue = iss);
1828
+ for (const k of iss.keys) {
1829
+ if (!unrecKeys.has(k)) unrecKeys.set(k, {});
1830
+ unrecKeys.get(k).l = true;
1831
+ }
1832
+ } else result.issues.push(iss);
1833
+ for (const iss of right.issues) if (iss.code === "unrecognized_keys") for (const k of iss.keys) {
1834
+ if (!unrecKeys.has(k)) unrecKeys.set(k, {});
1835
+ unrecKeys.get(k).r = true;
1836
+ }
1837
+ else result.issues.push(iss);
1838
+ const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);
1839
+ if (bothKeys.length && unrecIssue) result.issues.push({
1840
+ ...unrecIssue,
1841
+ keys: bothKeys
1842
+ });
1843
+ if (aborted(result)) return result;
1844
+ const merged = mergeValues(left.value, right.value);
1845
+ if (!merged.valid) throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
1846
+ result.value = merged.data;
1847
+ return result;
1848
+ }
1849
+ const $ZodEnum = /*@__PURE__*/ $constructor("$ZodEnum", (inst, def) => {
1850
+ $ZodType.init(inst, def);
1851
+ const values = getEnumValues(def.entries);
1852
+ const valuesSet = new Set(values);
1853
+ inst._zod.values = valuesSet;
1854
+ inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
1855
+ inst._zod.parse = (payload, _ctx) => {
1856
+ const input = payload.value;
1857
+ if (valuesSet.has(input)) return payload;
1858
+ payload.issues.push({
1859
+ code: "invalid_value",
1860
+ values,
1861
+ input,
1862
+ inst
1863
+ });
1864
+ return payload;
1865
+ };
1866
+ });
1867
+ const $ZodLiteral = /*@__PURE__*/ $constructor("$ZodLiteral", (inst, def) => {
1868
+ $ZodType.init(inst, def);
1869
+ if (def.values.length === 0) throw new Error("Cannot create literal schema with no valid values");
1870
+ const values = new Set(def.values);
1871
+ inst._zod.values = values;
1872
+ inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
1873
+ inst._zod.parse = (payload, _ctx) => {
1874
+ const input = payload.value;
1875
+ if (values.has(input)) return payload;
1876
+ payload.issues.push({
1877
+ code: "invalid_value",
1878
+ values: def.values,
1879
+ input,
1880
+ inst
1881
+ });
1882
+ return payload;
1883
+ };
1884
+ });
1885
+ const $ZodTransform = /*@__PURE__*/ $constructor("$ZodTransform", (inst, def) => {
1886
+ $ZodType.init(inst, def);
1887
+ inst._zod.optin = "optional";
1888
+ inst._zod.parse = (payload, ctx) => {
1889
+ if (ctx.direction === "backward") throw new $ZodEncodeError(inst.constructor.name);
1890
+ const _out = def.transform(payload.value, payload);
1891
+ if (ctx.async) return (_out instanceof Promise ? _out : Promise.resolve(_out)).then((output) => {
1892
+ payload.value = output;
1893
+ payload.fallback = true;
1894
+ return payload;
1895
+ });
1896
+ if (_out instanceof Promise) throw new $ZodAsyncError();
1897
+ payload.value = _out;
1898
+ payload.fallback = true;
1899
+ return payload;
1900
+ };
1901
+ });
1902
+ function handleOptionalResult(result, input) {
1903
+ if (input === void 0 && (result.issues.length || result.fallback)) return {
1904
+ issues: [],
1905
+ value: void 0
1906
+ };
1907
+ return result;
1908
+ }
1909
+ const $ZodOptional = /*@__PURE__*/ $constructor("$ZodOptional", (inst, def) => {
1910
+ $ZodType.init(inst, def);
1911
+ inst._zod.optin = "optional";
1912
+ inst._zod.optout = "optional";
1913
+ defineLazy(inst._zod, "values", () => {
1914
+ return def.innerType._zod.values ? new Set([...def.innerType._zod.values, void 0]) : void 0;
1915
+ });
1916
+ defineLazy(inst._zod, "pattern", () => {
1917
+ const pattern = def.innerType._zod.pattern;
1918
+ return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0;
1919
+ });
1920
+ inst._zod.parse = (payload, ctx) => {
1921
+ if (def.innerType._zod.optin === "optional") {
1922
+ const input = payload.value;
1923
+ const result = def.innerType._zod.run(payload, ctx);
1924
+ if (result instanceof Promise) return result.then((r) => handleOptionalResult(r, input));
1925
+ return handleOptionalResult(result, input);
1926
+ }
1927
+ if (payload.value === void 0) return payload;
1928
+ return def.innerType._zod.run(payload, ctx);
1929
+ };
1930
+ });
1931
+ const $ZodExactOptional = /*@__PURE__*/ $constructor("$ZodExactOptional", (inst, def) => {
1932
+ $ZodOptional.init(inst, def);
1933
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
1934
+ defineLazy(inst._zod, "pattern", () => def.innerType._zod.pattern);
1935
+ inst._zod.parse = (payload, ctx) => {
1936
+ return def.innerType._zod.run(payload, ctx);
1937
+ };
1938
+ });
1939
+ const $ZodNullable = /*@__PURE__*/ $constructor("$ZodNullable", (inst, def) => {
1940
+ $ZodType.init(inst, def);
1941
+ defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
1942
+ defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
1943
+ defineLazy(inst._zod, "pattern", () => {
1944
+ const pattern = def.innerType._zod.pattern;
1945
+ return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0;
1946
+ });
1947
+ defineLazy(inst._zod, "values", () => {
1948
+ return def.innerType._zod.values ? new Set([...def.innerType._zod.values, null]) : void 0;
1949
+ });
1950
+ inst._zod.parse = (payload, ctx) => {
1951
+ if (payload.value === null) return payload;
1952
+ return def.innerType._zod.run(payload, ctx);
1953
+ };
1954
+ });
1955
+ const $ZodDefault = /*@__PURE__*/ $constructor("$ZodDefault", (inst, def) => {
1956
+ $ZodType.init(inst, def);
1957
+ inst._zod.optin = "optional";
1958
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
1959
+ inst._zod.parse = (payload, ctx) => {
1960
+ if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
1961
+ if (payload.value === void 0) {
1962
+ payload.value = def.defaultValue;
1963
+ /**
1964
+ * $ZodDefault returns the default value immediately in forward direction.
1965
+ * It doesn't pass the default value into the validator ("prefault"). There's no reason to pass the default value through validation. The validity of the default is enforced by TypeScript statically. Otherwise, it's the responsibility of the user to ensure the default is valid. In the case of pipes with divergent in/out types, you can specify the default on the `in` schema of your ZodPipe to set a "prefault" for the pipe. */
1966
+ return payload;
1967
+ }
1968
+ const result = def.innerType._zod.run(payload, ctx);
1969
+ if (result instanceof Promise) return result.then((result) => handleDefaultResult(result, def));
1970
+ return handleDefaultResult(result, def);
1971
+ };
1972
+ });
1973
+ function handleDefaultResult(payload, def) {
1974
+ if (payload.value === void 0) payload.value = def.defaultValue;
1975
+ return payload;
1976
+ }
1977
+ const $ZodPrefault = /*@__PURE__*/ $constructor("$ZodPrefault", (inst, def) => {
1978
+ $ZodType.init(inst, def);
1979
+ inst._zod.optin = "optional";
1980
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
1981
+ inst._zod.parse = (payload, ctx) => {
1982
+ if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
1983
+ if (payload.value === void 0) payload.value = def.defaultValue;
1984
+ return def.innerType._zod.run(payload, ctx);
1985
+ };
1986
+ });
1987
+ const $ZodNonOptional = /*@__PURE__*/ $constructor("$ZodNonOptional", (inst, def) => {
1988
+ $ZodType.init(inst, def);
1989
+ defineLazy(inst._zod, "values", () => {
1990
+ const v = def.innerType._zod.values;
1991
+ return v ? new Set([...v].filter((x) => x !== void 0)) : void 0;
1992
+ });
1993
+ inst._zod.parse = (payload, ctx) => {
1994
+ const result = def.innerType._zod.run(payload, ctx);
1995
+ if (result instanceof Promise) return result.then((result) => handleNonOptionalResult(result, inst));
1996
+ return handleNonOptionalResult(result, inst);
1997
+ };
1998
+ });
1999
+ function handleNonOptionalResult(payload, inst) {
2000
+ if (!payload.issues.length && payload.value === void 0) payload.issues.push({
2001
+ code: "invalid_type",
2002
+ expected: "nonoptional",
2003
+ input: payload.value,
2004
+ inst
2005
+ });
2006
+ return payload;
2007
+ }
2008
+ const $ZodCatch = /*@__PURE__*/ $constructor("$ZodCatch", (inst, def) => {
2009
+ $ZodType.init(inst, def);
2010
+ inst._zod.optin = "optional";
2011
+ defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
2012
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2013
+ inst._zod.parse = (payload, ctx) => {
2014
+ if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
2015
+ const result = def.innerType._zod.run(payload, ctx);
2016
+ if (result instanceof Promise) return result.then((result) => {
2017
+ payload.value = result.value;
2018
+ if (result.issues.length) {
2019
+ payload.value = def.catchValue({
2020
+ ...payload,
2021
+ error: { issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config())) },
2022
+ input: payload.value
2023
+ });
2024
+ payload.issues = [];
2025
+ payload.fallback = true;
2026
+ }
2027
+ return payload;
2028
+ });
2029
+ payload.value = result.value;
2030
+ if (result.issues.length) {
2031
+ payload.value = def.catchValue({
2032
+ ...payload,
2033
+ error: { issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config())) },
2034
+ input: payload.value
2035
+ });
2036
+ payload.issues = [];
2037
+ payload.fallback = true;
2038
+ }
2039
+ return payload;
2040
+ };
2041
+ });
2042
+ const $ZodPipe = /*@__PURE__*/ $constructor("$ZodPipe", (inst, def) => {
2043
+ $ZodType.init(inst, def);
2044
+ defineLazy(inst._zod, "values", () => def.in._zod.values);
2045
+ defineLazy(inst._zod, "optin", () => def.in._zod.optin);
2046
+ defineLazy(inst._zod, "optout", () => def.out._zod.optout);
2047
+ defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
2048
+ inst._zod.parse = (payload, ctx) => {
2049
+ if (ctx.direction === "backward") {
2050
+ const right = def.out._zod.run(payload, ctx);
2051
+ if (right instanceof Promise) return right.then((right) => handlePipeResult(right, def.in, ctx));
2052
+ return handlePipeResult(right, def.in, ctx);
2053
+ }
2054
+ const left = def.in._zod.run(payload, ctx);
2055
+ if (left instanceof Promise) return left.then((left) => handlePipeResult(left, def.out, ctx));
2056
+ return handlePipeResult(left, def.out, ctx);
2057
+ };
2058
+ });
2059
+ function handlePipeResult(left, next, ctx) {
2060
+ if (left.issues.length) {
2061
+ left.aborted = true;
2062
+ return left;
2063
+ }
2064
+ return next._zod.run({
2065
+ value: left.value,
2066
+ issues: left.issues,
2067
+ fallback: left.fallback
2068
+ }, ctx);
2069
+ }
2070
+ const $ZodReadonly = /*@__PURE__*/ $constructor("$ZodReadonly", (inst, def) => {
2071
+ $ZodType.init(inst, def);
2072
+ defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
2073
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2074
+ defineLazy(inst._zod, "optin", () => def.innerType?._zod?.optin);
2075
+ defineLazy(inst._zod, "optout", () => def.innerType?._zod?.optout);
2076
+ inst._zod.parse = (payload, ctx) => {
2077
+ if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
2078
+ const result = def.innerType._zod.run(payload, ctx);
2079
+ if (result instanceof Promise) return result.then(handleReadonlyResult);
2080
+ return handleReadonlyResult(result);
2081
+ };
2082
+ });
2083
+ function handleReadonlyResult(payload) {
2084
+ payload.value = Object.freeze(payload.value);
2085
+ return payload;
2086
+ }
2087
+ const $ZodCustom = /*@__PURE__*/ $constructor("$ZodCustom", (inst, def) => {
2088
+ $ZodCheck.init(inst, def);
2089
+ $ZodType.init(inst, def);
2090
+ inst._zod.parse = (payload, _) => {
2091
+ return payload;
2092
+ };
2093
+ inst._zod.check = (payload) => {
2094
+ const input = payload.value;
2095
+ const r = def.fn(input);
2096
+ if (r instanceof Promise) return r.then((r) => handleRefineResult(r, payload, input, inst));
2097
+ handleRefineResult(r, payload, input, inst);
2098
+ };
2099
+ });
2100
+ function handleRefineResult(result, payload, input, inst) {
2101
+ if (!result) {
2102
+ const _iss = {
2103
+ code: "custom",
2104
+ input,
2105
+ inst,
2106
+ path: [...inst._zod.def.path ?? []],
2107
+ continue: !inst._zod.def.abort
2108
+ };
2109
+ if (inst._zod.def.params) _iss.params = inst._zod.def.params;
2110
+ payload.issues.push(issue(_iss));
2111
+ }
2112
+ }
2113
+ //#endregion
2114
+ //#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/registries.js
2115
+ var _a;
2116
+ var $ZodRegistry = class {
2117
+ constructor() {
2118
+ this._map = /* @__PURE__ */ new WeakMap();
2119
+ this._idmap = /* @__PURE__ */ new Map();
2120
+ }
2121
+ add(schema, ..._meta) {
2122
+ const meta = _meta[0];
2123
+ this._map.set(schema, meta);
2124
+ if (meta && typeof meta === "object" && "id" in meta) this._idmap.set(meta.id, schema);
2125
+ return this;
2126
+ }
2127
+ clear() {
2128
+ this._map = /* @__PURE__ */ new WeakMap();
2129
+ this._idmap = /* @__PURE__ */ new Map();
2130
+ return this;
2131
+ }
2132
+ remove(schema) {
2133
+ const meta = this._map.get(schema);
2134
+ if (meta && typeof meta === "object" && "id" in meta) this._idmap.delete(meta.id);
2135
+ this._map.delete(schema);
2136
+ return this;
2137
+ }
2138
+ get(schema) {
2139
+ const p = schema._zod.parent;
2140
+ if (p) {
2141
+ const pm = { ...this.get(p) ?? {} };
2142
+ delete pm.id;
2143
+ const f = {
2144
+ ...pm,
2145
+ ...this._map.get(schema)
2146
+ };
2147
+ return Object.keys(f).length ? f : void 0;
2148
+ }
2149
+ return this._map.get(schema);
2150
+ }
2151
+ has(schema) {
2152
+ return this._map.has(schema);
2153
+ }
2154
+ };
2155
+ function registry() {
2156
+ return new $ZodRegistry();
2157
+ }
2158
+ (_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
2159
+ const globalRegistry = globalThis.__zod_globalRegistry;
2160
+ //#endregion
2161
+ //#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/api.js
2162
+ // @__NO_SIDE_EFFECTS__
2163
+ function _string(Class, params) {
2164
+ return new Class({
2165
+ type: "string",
2166
+ ...normalizeParams(params)
2167
+ });
2168
+ }
2169
+ // @__NO_SIDE_EFFECTS__
2170
+ function _email(Class, params) {
2171
+ return new Class({
2172
+ type: "string",
2173
+ format: "email",
2174
+ check: "string_format",
2175
+ abort: false,
2176
+ ...normalizeParams(params)
2177
+ });
2178
+ }
2179
+ // @__NO_SIDE_EFFECTS__
2180
+ function _guid(Class, params) {
2181
+ return new Class({
2182
+ type: "string",
2183
+ format: "guid",
2184
+ check: "string_format",
2185
+ abort: false,
2186
+ ...normalizeParams(params)
2187
+ });
2188
+ }
2189
+ // @__NO_SIDE_EFFECTS__
2190
+ function _uuid(Class, params) {
2191
+ return new Class({
2192
+ type: "string",
2193
+ format: "uuid",
2194
+ check: "string_format",
2195
+ abort: false,
2196
+ ...normalizeParams(params)
2197
+ });
2198
+ }
2199
+ // @__NO_SIDE_EFFECTS__
2200
+ function _uuidv4(Class, params) {
2201
+ return new Class({
2202
+ type: "string",
2203
+ format: "uuid",
2204
+ check: "string_format",
2205
+ abort: false,
2206
+ version: "v4",
2207
+ ...normalizeParams(params)
2208
+ });
2209
+ }
2210
+ // @__NO_SIDE_EFFECTS__
2211
+ function _uuidv6(Class, params) {
2212
+ return new Class({
2213
+ type: "string",
2214
+ format: "uuid",
2215
+ check: "string_format",
2216
+ abort: false,
2217
+ version: "v6",
2218
+ ...normalizeParams(params)
2219
+ });
2220
+ }
2221
+ // @__NO_SIDE_EFFECTS__
2222
+ function _uuidv7(Class, params) {
2223
+ return new Class({
2224
+ type: "string",
2225
+ format: "uuid",
2226
+ check: "string_format",
2227
+ abort: false,
2228
+ version: "v7",
2229
+ ...normalizeParams(params)
2230
+ });
2231
+ }
2232
+ // @__NO_SIDE_EFFECTS__
2233
+ function _url(Class, params) {
2234
+ return new Class({
2235
+ type: "string",
2236
+ format: "url",
2237
+ check: "string_format",
2238
+ abort: false,
2239
+ ...normalizeParams(params)
2240
+ });
2241
+ }
2242
+ // @__NO_SIDE_EFFECTS__
2243
+ function _emoji(Class, params) {
2244
+ return new Class({
2245
+ type: "string",
2246
+ format: "emoji",
2247
+ check: "string_format",
2248
+ abort: false,
2249
+ ...normalizeParams(params)
2250
+ });
2251
+ }
2252
+ // @__NO_SIDE_EFFECTS__
2253
+ function _nanoid(Class, params) {
2254
+ return new Class({
2255
+ type: "string",
2256
+ format: "nanoid",
2257
+ check: "string_format",
2258
+ abort: false,
2259
+ ...normalizeParams(params)
2260
+ });
2261
+ }
2262
+ /**
2263
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
2264
+ * (timestamps embedded in the id). Use {@link _cuid2} instead.
2265
+ * See https://github.com/paralleldrive/cuid.
2266
+ */
2267
+ // @__NO_SIDE_EFFECTS__
2268
+ function _cuid(Class, params) {
2269
+ return new Class({
2270
+ type: "string",
2271
+ format: "cuid",
2272
+ check: "string_format",
2273
+ abort: false,
2274
+ ...normalizeParams(params)
2275
+ });
2276
+ }
2277
+ // @__NO_SIDE_EFFECTS__
2278
+ function _cuid2(Class, params) {
2279
+ return new Class({
2280
+ type: "string",
2281
+ format: "cuid2",
2282
+ check: "string_format",
2283
+ abort: false,
2284
+ ...normalizeParams(params)
2285
+ });
2286
+ }
2287
+ // @__NO_SIDE_EFFECTS__
2288
+ function _ulid(Class, params) {
2289
+ return new Class({
2290
+ type: "string",
2291
+ format: "ulid",
2292
+ check: "string_format",
2293
+ abort: false,
2294
+ ...normalizeParams(params)
2295
+ });
2296
+ }
2297
+ // @__NO_SIDE_EFFECTS__
2298
+ function _xid(Class, params) {
2299
+ return new Class({
2300
+ type: "string",
2301
+ format: "xid",
2302
+ check: "string_format",
2303
+ abort: false,
2304
+ ...normalizeParams(params)
2305
+ });
2306
+ }
2307
+ // @__NO_SIDE_EFFECTS__
2308
+ function _ksuid(Class, params) {
2309
+ return new Class({
2310
+ type: "string",
2311
+ format: "ksuid",
2312
+ check: "string_format",
2313
+ abort: false,
2314
+ ...normalizeParams(params)
2315
+ });
2316
+ }
2317
+ // @__NO_SIDE_EFFECTS__
2318
+ function _ipv4(Class, params) {
2319
+ return new Class({
2320
+ type: "string",
2321
+ format: "ipv4",
2322
+ check: "string_format",
2323
+ abort: false,
2324
+ ...normalizeParams(params)
2325
+ });
2326
+ }
2327
+ // @__NO_SIDE_EFFECTS__
2328
+ function _ipv6(Class, params) {
2329
+ return new Class({
2330
+ type: "string",
2331
+ format: "ipv6",
2332
+ check: "string_format",
2333
+ abort: false,
2334
+ ...normalizeParams(params)
2335
+ });
2336
+ }
2337
+ // @__NO_SIDE_EFFECTS__
2338
+ function _cidrv4(Class, params) {
2339
+ return new Class({
2340
+ type: "string",
2341
+ format: "cidrv4",
2342
+ check: "string_format",
2343
+ abort: false,
2344
+ ...normalizeParams(params)
2345
+ });
2346
+ }
2347
+ // @__NO_SIDE_EFFECTS__
2348
+ function _cidrv6(Class, params) {
2349
+ return new Class({
2350
+ type: "string",
2351
+ format: "cidrv6",
2352
+ check: "string_format",
2353
+ abort: false,
2354
+ ...normalizeParams(params)
2355
+ });
2356
+ }
2357
+ // @__NO_SIDE_EFFECTS__
2358
+ function _base64(Class, params) {
2359
+ return new Class({
2360
+ type: "string",
2361
+ format: "base64",
2362
+ check: "string_format",
2363
+ abort: false,
2364
+ ...normalizeParams(params)
2365
+ });
2366
+ }
2367
+ // @__NO_SIDE_EFFECTS__
2368
+ function _base64url(Class, params) {
2369
+ return new Class({
2370
+ type: "string",
2371
+ format: "base64url",
2372
+ check: "string_format",
2373
+ abort: false,
2374
+ ...normalizeParams(params)
2375
+ });
2376
+ }
2377
+ // @__NO_SIDE_EFFECTS__
2378
+ function _e164(Class, params) {
2379
+ return new Class({
2380
+ type: "string",
2381
+ format: "e164",
2382
+ check: "string_format",
2383
+ abort: false,
2384
+ ...normalizeParams(params)
2385
+ });
2386
+ }
2387
+ // @__NO_SIDE_EFFECTS__
2388
+ function _jwt(Class, params) {
2389
+ return new Class({
2390
+ type: "string",
2391
+ format: "jwt",
2392
+ check: "string_format",
2393
+ abort: false,
2394
+ ...normalizeParams(params)
2395
+ });
2396
+ }
2397
+ // @__NO_SIDE_EFFECTS__
2398
+ function _isoDateTime(Class, params) {
2399
+ return new Class({
2400
+ type: "string",
2401
+ format: "datetime",
2402
+ check: "string_format",
2403
+ offset: false,
2404
+ local: false,
2405
+ precision: null,
2406
+ ...normalizeParams(params)
2407
+ });
2408
+ }
2409
+ // @__NO_SIDE_EFFECTS__
2410
+ function _isoDate(Class, params) {
2411
+ return new Class({
2412
+ type: "string",
2413
+ format: "date",
2414
+ check: "string_format",
2415
+ ...normalizeParams(params)
2416
+ });
2417
+ }
2418
+ // @__NO_SIDE_EFFECTS__
2419
+ function _isoTime(Class, params) {
2420
+ return new Class({
2421
+ type: "string",
2422
+ format: "time",
2423
+ check: "string_format",
2424
+ precision: null,
2425
+ ...normalizeParams(params)
2426
+ });
2427
+ }
2428
+ // @__NO_SIDE_EFFECTS__
2429
+ function _isoDuration(Class, params) {
2430
+ return new Class({
2431
+ type: "string",
2432
+ format: "duration",
2433
+ check: "string_format",
2434
+ ...normalizeParams(params)
2435
+ });
2436
+ }
2437
+ // @__NO_SIDE_EFFECTS__
2438
+ function _number(Class, params) {
2439
+ return new Class({
2440
+ type: "number",
2441
+ checks: [],
2442
+ ...normalizeParams(params)
2443
+ });
2444
+ }
2445
+ // @__NO_SIDE_EFFECTS__
2446
+ function _int(Class, params) {
2447
+ return new Class({
2448
+ type: "number",
2449
+ check: "number_format",
2450
+ abort: false,
2451
+ format: "safeint",
2452
+ ...normalizeParams(params)
2453
+ });
2454
+ }
2455
+ // @__NO_SIDE_EFFECTS__
2456
+ function _unknown(Class) {
2457
+ return new Class({ type: "unknown" });
2458
+ }
2459
+ // @__NO_SIDE_EFFECTS__
2460
+ function _never(Class, params) {
2461
+ return new Class({
2462
+ type: "never",
2463
+ ...normalizeParams(params)
2464
+ });
2465
+ }
2466
+ // @__NO_SIDE_EFFECTS__
2467
+ function _lt(value, params) {
2468
+ return new $ZodCheckLessThan({
2469
+ check: "less_than",
2470
+ ...normalizeParams(params),
2471
+ value,
2472
+ inclusive: false
2473
+ });
2474
+ }
2475
+ // @__NO_SIDE_EFFECTS__
2476
+ function _lte(value, params) {
2477
+ return new $ZodCheckLessThan({
2478
+ check: "less_than",
2479
+ ...normalizeParams(params),
2480
+ value,
2481
+ inclusive: true
2482
+ });
2483
+ }
2484
+ // @__NO_SIDE_EFFECTS__
2485
+ function _gt(value, params) {
2486
+ return new $ZodCheckGreaterThan({
2487
+ check: "greater_than",
2488
+ ...normalizeParams(params),
2489
+ value,
2490
+ inclusive: false
2491
+ });
2492
+ }
2493
+ // @__NO_SIDE_EFFECTS__
2494
+ function _gte(value, params) {
2495
+ return new $ZodCheckGreaterThan({
2496
+ check: "greater_than",
2497
+ ...normalizeParams(params),
2498
+ value,
2499
+ inclusive: true
2500
+ });
2501
+ }
2502
+ // @__NO_SIDE_EFFECTS__
2503
+ function _multipleOf(value, params) {
2504
+ return new $ZodCheckMultipleOf({
2505
+ check: "multiple_of",
2506
+ ...normalizeParams(params),
2507
+ value
2508
+ });
2509
+ }
2510
+ // @__NO_SIDE_EFFECTS__
2511
+ function _maxLength(maximum, params) {
2512
+ return new $ZodCheckMaxLength({
2513
+ check: "max_length",
2514
+ ...normalizeParams(params),
2515
+ maximum
2516
+ });
2517
+ }
2518
+ // @__NO_SIDE_EFFECTS__
2519
+ function _minLength(minimum, params) {
2520
+ return new $ZodCheckMinLength({
2521
+ check: "min_length",
2522
+ ...normalizeParams(params),
2523
+ minimum
2524
+ });
2525
+ }
2526
+ // @__NO_SIDE_EFFECTS__
2527
+ function _length(length, params) {
2528
+ return new $ZodCheckLengthEquals({
2529
+ check: "length_equals",
2530
+ ...normalizeParams(params),
2531
+ length
2532
+ });
2533
+ }
2534
+ // @__NO_SIDE_EFFECTS__
2535
+ function _regex(pattern, params) {
2536
+ return new $ZodCheckRegex({
2537
+ check: "string_format",
2538
+ format: "regex",
2539
+ ...normalizeParams(params),
2540
+ pattern
2541
+ });
2542
+ }
2543
+ // @__NO_SIDE_EFFECTS__
2544
+ function _lowercase(params) {
2545
+ return new $ZodCheckLowerCase({
2546
+ check: "string_format",
2547
+ format: "lowercase",
2548
+ ...normalizeParams(params)
2549
+ });
2550
+ }
2551
+ // @__NO_SIDE_EFFECTS__
2552
+ function _uppercase(params) {
2553
+ return new $ZodCheckUpperCase({
2554
+ check: "string_format",
2555
+ format: "uppercase",
2556
+ ...normalizeParams(params)
2557
+ });
2558
+ }
2559
+ // @__NO_SIDE_EFFECTS__
2560
+ function _includes(includes, params) {
2561
+ return new $ZodCheckIncludes({
2562
+ check: "string_format",
2563
+ format: "includes",
2564
+ ...normalizeParams(params),
2565
+ includes
2566
+ });
2567
+ }
2568
+ // @__NO_SIDE_EFFECTS__
2569
+ function _startsWith(prefix, params) {
2570
+ return new $ZodCheckStartsWith({
2571
+ check: "string_format",
2572
+ format: "starts_with",
2573
+ ...normalizeParams(params),
2574
+ prefix
2575
+ });
2576
+ }
2577
+ // @__NO_SIDE_EFFECTS__
2578
+ function _endsWith(suffix, params) {
2579
+ return new $ZodCheckEndsWith({
2580
+ check: "string_format",
2581
+ format: "ends_with",
2582
+ ...normalizeParams(params),
2583
+ suffix
2584
+ });
2585
+ }
2586
+ // @__NO_SIDE_EFFECTS__
2587
+ function _overwrite(tx) {
2588
+ return new $ZodCheckOverwrite({
2589
+ check: "overwrite",
2590
+ tx
2591
+ });
2592
+ }
2593
+ // @__NO_SIDE_EFFECTS__
2594
+ function _normalize(form) {
2595
+ return /* @__PURE__ */ _overwrite((input) => input.normalize(form));
2596
+ }
2597
+ // @__NO_SIDE_EFFECTS__
2598
+ function _trim() {
2599
+ return /* @__PURE__ */ _overwrite((input) => input.trim());
2600
+ }
2601
+ // @__NO_SIDE_EFFECTS__
2602
+ function _toLowerCase() {
2603
+ return /* @__PURE__ */ _overwrite((input) => input.toLowerCase());
2604
+ }
2605
+ // @__NO_SIDE_EFFECTS__
2606
+ function _toUpperCase() {
2607
+ return /* @__PURE__ */ _overwrite((input) => input.toUpperCase());
2608
+ }
2609
+ // @__NO_SIDE_EFFECTS__
2610
+ function _slugify() {
2611
+ return /* @__PURE__ */ _overwrite((input) => slugify(input));
2612
+ }
2613
+ // @__NO_SIDE_EFFECTS__
2614
+ function _array(Class, element, params) {
2615
+ return new Class({
2616
+ type: "array",
2617
+ element,
2618
+ ...normalizeParams(params)
2619
+ });
2620
+ }
2621
+ // @__NO_SIDE_EFFECTS__
2622
+ function _refine(Class, fn, _params) {
2623
+ return new Class({
2624
+ type: "custom",
2625
+ check: "custom",
2626
+ fn,
2627
+ ...normalizeParams(_params)
2628
+ });
2629
+ }
2630
+ // @__NO_SIDE_EFFECTS__
2631
+ function _superRefine(fn, params) {
2632
+ const ch = /* @__PURE__ */ _check((payload) => {
2633
+ payload.addIssue = (issue$2) => {
2634
+ if (typeof issue$2 === "string") payload.issues.push(issue(issue$2, payload.value, ch._zod.def));
2635
+ else {
2636
+ const _issue = issue$2;
2637
+ if (_issue.fatal) _issue.continue = false;
2638
+ _issue.code ?? (_issue.code = "custom");
2639
+ _issue.input ?? (_issue.input = payload.value);
2640
+ _issue.inst ?? (_issue.inst = ch);
2641
+ _issue.continue ?? (_issue.continue = !ch._zod.def.abort);
2642
+ payload.issues.push(issue(_issue));
2643
+ }
2644
+ };
2645
+ return fn(payload.value, payload);
2646
+ }, params);
2647
+ return ch;
2648
+ }
2649
+ // @__NO_SIDE_EFFECTS__
2650
+ function _check(fn, params) {
2651
+ const ch = new $ZodCheck({
2652
+ check: "custom",
2653
+ ...normalizeParams(params)
2654
+ });
2655
+ ch._zod.check = fn;
2656
+ return ch;
2657
+ }
2658
+ //#endregion
2659
+ //#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.js
2660
+ function initializeContext(params) {
2661
+ let target = params?.target ?? "draft-2020-12";
2662
+ if (target === "draft-4") target = "draft-04";
2663
+ if (target === "draft-7") target = "draft-07";
2664
+ return {
2665
+ processors: params.processors ?? {},
2666
+ metadataRegistry: params?.metadata ?? globalRegistry,
2667
+ target,
2668
+ unrepresentable: params?.unrepresentable ?? "throw",
2669
+ override: params?.override ?? (() => {}),
2670
+ io: params?.io ?? "output",
2671
+ counter: 0,
2672
+ seen: /* @__PURE__ */ new Map(),
2673
+ cycles: params?.cycles ?? "ref",
2674
+ reused: params?.reused ?? "inline",
2675
+ external: params?.external ?? void 0
2676
+ };
2677
+ }
2678
+ function process(schema, ctx, _params = {
2679
+ path: [],
2680
+ schemaPath: []
2681
+ }) {
2682
+ var _a;
2683
+ const def = schema._zod.def;
2684
+ const seen = ctx.seen.get(schema);
2685
+ if (seen) {
2686
+ seen.count++;
2687
+ if (_params.schemaPath.includes(schema)) seen.cycle = _params.path;
2688
+ return seen.schema;
2689
+ }
2690
+ const result = {
2691
+ schema: {},
2692
+ count: 1,
2693
+ cycle: void 0,
2694
+ path: _params.path
2695
+ };
2696
+ ctx.seen.set(schema, result);
2697
+ const overrideSchema = schema._zod.toJSONSchema?.();
2698
+ if (overrideSchema) result.schema = overrideSchema;
2699
+ else {
2700
+ const params = {
2701
+ ..._params,
2702
+ schemaPath: [..._params.schemaPath, schema],
2703
+ path: _params.path
2704
+ };
2705
+ if (schema._zod.processJSONSchema) schema._zod.processJSONSchema(ctx, result.schema, params);
2706
+ else {
2707
+ const _json = result.schema;
2708
+ const processor = ctx.processors[def.type];
2709
+ if (!processor) throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`);
2710
+ processor(schema, ctx, _json, params);
2711
+ }
2712
+ const parent = schema._zod.parent;
2713
+ if (parent) {
2714
+ if (!result.ref) result.ref = parent;
2715
+ process(parent, ctx, params);
2716
+ ctx.seen.get(parent).isParent = true;
2717
+ }
2718
+ }
2719
+ const meta = ctx.metadataRegistry.get(schema);
2720
+ if (meta) Object.assign(result.schema, meta);
2721
+ if (ctx.io === "input" && isTransforming(schema)) {
2722
+ delete result.schema.examples;
2723
+ delete result.schema.default;
2724
+ }
2725
+ if (ctx.io === "input" && "_prefault" in result.schema) (_a = result.schema).default ?? (_a.default = result.schema._prefault);
2726
+ delete result.schema._prefault;
2727
+ return ctx.seen.get(schema).schema;
2728
+ }
2729
+ function extractDefs(ctx, schema) {
2730
+ const root = ctx.seen.get(schema);
2731
+ if (!root) throw new Error("Unprocessed schema. This is a bug in Zod.");
2732
+ const idToSchema = /* @__PURE__ */ new Map();
2733
+ for (const entry of ctx.seen.entries()) {
2734
+ const id = ctx.metadataRegistry.get(entry[0])?.id;
2735
+ if (id) {
2736
+ const existing = idToSchema.get(id);
2737
+ if (existing && existing !== entry[0]) throw new Error(`Duplicate schema id "${id}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
2738
+ idToSchema.set(id, entry[0]);
2739
+ }
2740
+ }
2741
+ const makeURI = (entry) => {
2742
+ const defsSegment = ctx.target === "draft-2020-12" ? "$defs" : "definitions";
2743
+ if (ctx.external) {
2744
+ const externalId = ctx.external.registry.get(entry[0])?.id;
2745
+ const uriGenerator = ctx.external.uri ?? ((id) => id);
2746
+ if (externalId) return { ref: uriGenerator(externalId) };
2747
+ const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;
2748
+ entry[1].defId = id;
2749
+ return {
2750
+ defId: id,
2751
+ ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}`
2752
+ };
2753
+ }
2754
+ if (entry[1] === root) return { ref: "#" };
2755
+ const defUriPrefix = `#/${defsSegment}/`;
2756
+ const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;
2757
+ return {
2758
+ defId,
2759
+ ref: defUriPrefix + defId
2760
+ };
2761
+ };
2762
+ const extractToDef = (entry) => {
2763
+ if (entry[1].schema.$ref) return;
2764
+ const seen = entry[1];
2765
+ const { ref, defId } = makeURI(entry);
2766
+ seen.def = { ...seen.schema };
2767
+ if (defId) seen.defId = defId;
2768
+ const schema = seen.schema;
2769
+ for (const key in schema) delete schema[key];
2770
+ schema.$ref = ref;
2771
+ };
2772
+ if (ctx.cycles === "throw") for (const entry of ctx.seen.entries()) {
2773
+ const seen = entry[1];
2774
+ if (seen.cycle) throw new Error(`Cycle detected: #/${seen.cycle?.join("/")}/<root>
2775
+
2776
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
2777
+ }
2778
+ for (const entry of ctx.seen.entries()) {
2779
+ const seen = entry[1];
2780
+ if (schema === entry[0]) {
2781
+ extractToDef(entry);
2782
+ continue;
2783
+ }
2784
+ if (ctx.external) {
2785
+ const ext = ctx.external.registry.get(entry[0])?.id;
2786
+ if (schema !== entry[0] && ext) {
2787
+ extractToDef(entry);
2788
+ continue;
2789
+ }
2790
+ }
2791
+ if (ctx.metadataRegistry.get(entry[0])?.id) {
2792
+ extractToDef(entry);
2793
+ continue;
2794
+ }
2795
+ if (seen.cycle) {
2796
+ extractToDef(entry);
2797
+ continue;
2798
+ }
2799
+ if (seen.count > 1) {
2800
+ if (ctx.reused === "ref") {
2801
+ extractToDef(entry);
2802
+ continue;
2803
+ }
2804
+ }
2805
+ }
2806
+ }
2807
+ function finalize(ctx, schema) {
2808
+ const root = ctx.seen.get(schema);
2809
+ if (!root) throw new Error("Unprocessed schema. This is a bug in Zod.");
2810
+ const flattenRef = (zodSchema) => {
2811
+ const seen = ctx.seen.get(zodSchema);
2812
+ if (seen.ref === null) return;
2813
+ const schema = seen.def ?? seen.schema;
2814
+ const _cached = { ...schema };
2815
+ const ref = seen.ref;
2816
+ seen.ref = null;
2817
+ if (ref) {
2818
+ flattenRef(ref);
2819
+ const refSeen = ctx.seen.get(ref);
2820
+ const refSchema = refSeen.schema;
2821
+ if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) {
2822
+ schema.allOf = schema.allOf ?? [];
2823
+ schema.allOf.push(refSchema);
2824
+ } else Object.assign(schema, refSchema);
2825
+ Object.assign(schema, _cached);
2826
+ if (zodSchema._zod.parent === ref) for (const key in schema) {
2827
+ if (key === "$ref" || key === "allOf") continue;
2828
+ if (!(key in _cached)) delete schema[key];
2829
+ }
2830
+ if (refSchema.$ref && refSeen.def) for (const key in schema) {
2831
+ if (key === "$ref" || key === "allOf") continue;
2832
+ if (key in refSeen.def && JSON.stringify(schema[key]) === JSON.stringify(refSeen.def[key])) delete schema[key];
2833
+ }
2834
+ }
2835
+ const parent = zodSchema._zod.parent;
2836
+ if (parent && parent !== ref) {
2837
+ flattenRef(parent);
2838
+ const parentSeen = ctx.seen.get(parent);
2839
+ if (parentSeen?.schema.$ref) {
2840
+ schema.$ref = parentSeen.schema.$ref;
2841
+ if (parentSeen.def) for (const key in schema) {
2842
+ if (key === "$ref" || key === "allOf") continue;
2843
+ if (key in parentSeen.def && JSON.stringify(schema[key]) === JSON.stringify(parentSeen.def[key])) delete schema[key];
2844
+ }
2845
+ }
2846
+ }
2847
+ ctx.override({
2848
+ zodSchema,
2849
+ jsonSchema: schema,
2850
+ path: seen.path ?? []
2851
+ });
2852
+ };
2853
+ for (const entry of [...ctx.seen.entries()].reverse()) flattenRef(entry[0]);
2854
+ const result = {};
2855
+ if (ctx.target === "draft-2020-12") result.$schema = "https://json-schema.org/draft/2020-12/schema";
2856
+ else if (ctx.target === "draft-07") result.$schema = "http://json-schema.org/draft-07/schema#";
2857
+ else if (ctx.target === "draft-04") result.$schema = "http://json-schema.org/draft-04/schema#";
2858
+ else if (ctx.target === "openapi-3.0") {}
2859
+ if (ctx.external?.uri) {
2860
+ const id = ctx.external.registry.get(schema)?.id;
2861
+ if (!id) throw new Error("Schema is missing an `id` property");
2862
+ result.$id = ctx.external.uri(id);
2863
+ }
2864
+ Object.assign(result, root.def ?? root.schema);
2865
+ const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
2866
+ if (rootMetaId !== void 0 && result.id === rootMetaId) delete result.id;
2867
+ const defs = ctx.external?.defs ?? {};
2868
+ for (const entry of ctx.seen.entries()) {
2869
+ const seen = entry[1];
2870
+ if (seen.def && seen.defId) {
2871
+ if (seen.def.id === seen.defId) delete seen.def.id;
2872
+ defs[seen.defId] = seen.def;
2873
+ }
2874
+ }
2875
+ if (ctx.external) {} else if (Object.keys(defs).length > 0) if (ctx.target === "draft-2020-12") result.$defs = defs;
2876
+ else result.definitions = defs;
2877
+ try {
2878
+ const finalized = JSON.parse(JSON.stringify(result));
2879
+ Object.defineProperty(finalized, "~standard", {
2880
+ value: {
2881
+ ...schema["~standard"],
2882
+ jsonSchema: {
2883
+ input: createStandardJSONSchemaMethod(schema, "input", ctx.processors),
2884
+ output: createStandardJSONSchemaMethod(schema, "output", ctx.processors)
2885
+ }
2886
+ },
2887
+ enumerable: false,
2888
+ writable: false
2889
+ });
2890
+ return finalized;
2891
+ } catch (_err) {
2892
+ throw new Error("Error converting schema to JSON.");
2893
+ }
2894
+ }
2895
+ function isTransforming(_schema, _ctx) {
2896
+ const ctx = _ctx ?? { seen: /* @__PURE__ */ new Set() };
2897
+ if (ctx.seen.has(_schema)) return false;
2898
+ ctx.seen.add(_schema);
2899
+ const def = _schema._zod.def;
2900
+ if (def.type === "transform") return true;
2901
+ if (def.type === "array") return isTransforming(def.element, ctx);
2902
+ if (def.type === "set") return isTransforming(def.valueType, ctx);
2903
+ if (def.type === "lazy") return isTransforming(def.getter(), ctx);
2904
+ 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);
2905
+ if (def.type === "intersection") return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
2906
+ if (def.type === "record" || def.type === "map") return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
2907
+ if (def.type === "pipe") {
2908
+ if (_schema._zod.traits.has("$ZodCodec")) return true;
2909
+ return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);
2910
+ }
2911
+ if (def.type === "object") {
2912
+ for (const key in def.shape) if (isTransforming(def.shape[key], ctx)) return true;
2913
+ return false;
2914
+ }
2915
+ if (def.type === "union") {
2916
+ for (const option of def.options) if (isTransforming(option, ctx)) return true;
2917
+ return false;
2918
+ }
2919
+ if (def.type === "tuple") {
2920
+ for (const item of def.items) if (isTransforming(item, ctx)) return true;
2921
+ if (def.rest && isTransforming(def.rest, ctx)) return true;
2922
+ return false;
2923
+ }
2924
+ return false;
2925
+ }
2926
+ /**
2927
+ * Creates a toJSONSchema method for a schema instance.
2928
+ * This encapsulates the logic of initializing context, processing, extracting defs, and finalizing.
2929
+ */
2930
+ const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
2931
+ const ctx = initializeContext({
2932
+ ...params,
2933
+ processors
2934
+ });
2935
+ process(schema, ctx);
2936
+ extractDefs(ctx, schema);
2937
+ return finalize(ctx, schema);
2938
+ };
2939
+ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
2940
+ const { libraryOptions, target } = params ?? {};
2941
+ const ctx = initializeContext({
2942
+ ...libraryOptions ?? {},
2943
+ target,
2944
+ io,
2945
+ processors
2946
+ });
2947
+ process(schema, ctx);
2948
+ extractDefs(ctx, schema);
2949
+ return finalize(ctx, schema);
2950
+ };
2951
+ //#endregion
2952
+ //#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema-processors.js
2953
+ const formatMap = {
2954
+ guid: "uuid",
2955
+ url: "uri",
2956
+ datetime: "date-time",
2957
+ json_string: "json-string",
2958
+ regex: ""
2959
+ };
2960
+ const stringProcessor = (schema, ctx, _json, _params) => {
2961
+ const json = _json;
2962
+ json.type = "string";
2963
+ const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
2964
+ if (typeof minimum === "number") json.minLength = minimum;
2965
+ if (typeof maximum === "number") json.maxLength = maximum;
2966
+ if (format) {
2967
+ json.format = formatMap[format] ?? format;
2968
+ if (json.format === "") delete json.format;
2969
+ if (format === "time") delete json.format;
2970
+ }
2971
+ if (contentEncoding) json.contentEncoding = contentEncoding;
2972
+ if (patterns && patterns.size > 0) {
2973
+ const regexes = [...patterns];
2974
+ if (regexes.length === 1) json.pattern = regexes[0].source;
2975
+ else if (regexes.length > 1) json.allOf = [...regexes.map((regex) => ({
2976
+ ...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
2977
+ pattern: regex.source
2978
+ }))];
2979
+ }
2980
+ };
2981
+ const numberProcessor = (schema, ctx, _json, _params) => {
2982
+ const json = _json;
2983
+ const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
2984
+ if (typeof format === "string" && format.includes("int")) json.type = "integer";
2985
+ else json.type = "number";
2986
+ const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
2987
+ const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
2988
+ const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
2989
+ if (exMin) if (legacy) {
2990
+ json.minimum = exclusiveMinimum;
2991
+ json.exclusiveMinimum = true;
2992
+ } else json.exclusiveMinimum = exclusiveMinimum;
2993
+ else if (typeof minimum === "number") json.minimum = minimum;
2994
+ if (exMax) if (legacy) {
2995
+ json.maximum = exclusiveMaximum;
2996
+ json.exclusiveMaximum = true;
2997
+ } else json.exclusiveMaximum = exclusiveMaximum;
2998
+ else if (typeof maximum === "number") json.maximum = maximum;
2999
+ if (typeof multipleOf === "number") json.multipleOf = multipleOf;
3000
+ };
3001
+ const neverProcessor = (_schema, _ctx, json, _params) => {
3002
+ json.not = {};
3003
+ };
3004
+ const enumProcessor = (schema, _ctx, json, _params) => {
3005
+ const def = schema._zod.def;
3006
+ const values = getEnumValues(def.entries);
3007
+ if (values.every((v) => typeof v === "number")) json.type = "number";
3008
+ if (values.every((v) => typeof v === "string")) json.type = "string";
3009
+ json.enum = values;
3010
+ };
3011
+ const literalProcessor = (schema, ctx, json, _params) => {
3012
+ const def = schema._zod.def;
3013
+ const vals = [];
3014
+ for (const val of def.values) if (val === void 0) {
3015
+ if (ctx.unrepresentable === "throw") throw new Error("Literal `undefined` cannot be represented in JSON Schema");
3016
+ } else if (typeof val === "bigint") if (ctx.unrepresentable === "throw") throw new Error("BigInt literals cannot be represented in JSON Schema");
3017
+ else vals.push(Number(val));
3018
+ else vals.push(val);
3019
+ if (vals.length === 0) {} else if (vals.length === 1) {
3020
+ const val = vals[0];
3021
+ json.type = val === null ? "null" : typeof val;
3022
+ if (ctx.target === "draft-04" || ctx.target === "openapi-3.0") json.enum = [val];
3023
+ else json.const = val;
3024
+ } else {
3025
+ if (vals.every((v) => typeof v === "number")) json.type = "number";
3026
+ if (vals.every((v) => typeof v === "string")) json.type = "string";
3027
+ if (vals.every((v) => typeof v === "boolean")) json.type = "boolean";
3028
+ if (vals.every((v) => v === null)) json.type = "null";
3029
+ json.enum = vals;
3030
+ }
3031
+ };
3032
+ const customProcessor = (_schema, ctx, _json, _params) => {
3033
+ if (ctx.unrepresentable === "throw") throw new Error("Custom types cannot be represented in JSON Schema");
3034
+ };
3035
+ const transformProcessor = (_schema, ctx, _json, _params) => {
3036
+ if (ctx.unrepresentable === "throw") throw new Error("Transforms cannot be represented in JSON Schema");
3037
+ };
3038
+ const arrayProcessor = (schema, ctx, _json, params) => {
3039
+ const json = _json;
3040
+ const def = schema._zod.def;
3041
+ const { minimum, maximum } = schema._zod.bag;
3042
+ if (typeof minimum === "number") json.minItems = minimum;
3043
+ if (typeof maximum === "number") json.maxItems = maximum;
3044
+ json.type = "array";
3045
+ json.items = process(def.element, ctx, {
3046
+ ...params,
3047
+ path: [...params.path, "items"]
3048
+ });
3049
+ };
3050
+ const objectProcessor = (schema, ctx, _json, params) => {
3051
+ const json = _json;
3052
+ const def = schema._zod.def;
3053
+ json.type = "object";
3054
+ json.properties = {};
3055
+ const shape = def.shape;
3056
+ for (const key in shape) json.properties[key] = process(shape[key], ctx, {
3057
+ ...params,
3058
+ path: [
3059
+ ...params.path,
3060
+ "properties",
3061
+ key
3062
+ ]
3063
+ });
3064
+ const allKeys = new Set(Object.keys(shape));
3065
+ const requiredKeys = new Set([...allKeys].filter((key) => {
3066
+ const v = def.shape[key]._zod;
3067
+ if (ctx.io === "input") return v.optin === void 0;
3068
+ else return v.optout === void 0;
3069
+ }));
3070
+ if (requiredKeys.size > 0) json.required = Array.from(requiredKeys);
3071
+ if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
3072
+ else if (!def.catchall) {
3073
+ if (ctx.io === "output") json.additionalProperties = false;
3074
+ } else if (def.catchall) json.additionalProperties = process(def.catchall, ctx, {
3075
+ ...params,
3076
+ path: [...params.path, "additionalProperties"]
3077
+ });
3078
+ };
3079
+ const unionProcessor = (schema, ctx, json, params) => {
3080
+ const def = schema._zod.def;
3081
+ const isExclusive = def.inclusive === false;
3082
+ const options = def.options.map((x, i) => process(x, ctx, {
3083
+ ...params,
3084
+ path: [
3085
+ ...params.path,
3086
+ isExclusive ? "oneOf" : "anyOf",
3087
+ i
3088
+ ]
3089
+ }));
3090
+ if (isExclusive) json.oneOf = options;
3091
+ else json.anyOf = options;
3092
+ };
3093
+ const intersectionProcessor = (schema, ctx, json, params) => {
3094
+ const def = schema._zod.def;
3095
+ const a = process(def.left, ctx, {
3096
+ ...params,
3097
+ path: [
3098
+ ...params.path,
3099
+ "allOf",
3100
+ 0
3101
+ ]
3102
+ });
3103
+ const b = process(def.right, ctx, {
3104
+ ...params,
3105
+ path: [
3106
+ ...params.path,
3107
+ "allOf",
3108
+ 1
3109
+ ]
3110
+ });
3111
+ const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
3112
+ json.allOf = [...isSimpleIntersection(a) ? a.allOf : [a], ...isSimpleIntersection(b) ? b.allOf : [b]];
3113
+ };
3114
+ const nullableProcessor = (schema, ctx, json, params) => {
3115
+ const def = schema._zod.def;
3116
+ const inner = process(def.innerType, ctx, params);
3117
+ const seen = ctx.seen.get(schema);
3118
+ if (ctx.target === "openapi-3.0") {
3119
+ seen.ref = def.innerType;
3120
+ json.nullable = true;
3121
+ } else json.anyOf = [inner, { type: "null" }];
3122
+ };
3123
+ const nonoptionalProcessor = (schema, ctx, _json, params) => {
3124
+ const def = schema._zod.def;
3125
+ process(def.innerType, ctx, params);
3126
+ const seen = ctx.seen.get(schema);
3127
+ seen.ref = def.innerType;
3128
+ };
3129
+ const defaultProcessor = (schema, ctx, json, params) => {
3130
+ const def = schema._zod.def;
3131
+ process(def.innerType, ctx, params);
3132
+ const seen = ctx.seen.get(schema);
3133
+ seen.ref = def.innerType;
3134
+ json.default = JSON.parse(JSON.stringify(def.defaultValue));
3135
+ };
3136
+ const prefaultProcessor = (schema, ctx, json, params) => {
3137
+ const def = schema._zod.def;
3138
+ process(def.innerType, ctx, params);
3139
+ const seen = ctx.seen.get(schema);
3140
+ seen.ref = def.innerType;
3141
+ if (ctx.io === "input") json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
3142
+ };
3143
+ const catchProcessor = (schema, ctx, json, params) => {
3144
+ const def = schema._zod.def;
3145
+ process(def.innerType, ctx, params);
3146
+ const seen = ctx.seen.get(schema);
3147
+ seen.ref = def.innerType;
3148
+ let catchValue;
3149
+ try {
3150
+ catchValue = def.catchValue(void 0);
3151
+ } catch {
3152
+ throw new Error("Dynamic catch values are not supported in JSON Schema");
3153
+ }
3154
+ json.default = catchValue;
3155
+ };
3156
+ const pipeProcessor = (schema, ctx, _json, params) => {
3157
+ const def = schema._zod.def;
3158
+ const inIsTransform = def.in._zod.traits.has("$ZodTransform");
3159
+ const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
3160
+ process(innerType, ctx, params);
3161
+ const seen = ctx.seen.get(schema);
3162
+ seen.ref = innerType;
3163
+ };
3164
+ const readonlyProcessor = (schema, ctx, json, params) => {
3165
+ const def = schema._zod.def;
3166
+ process(def.innerType, ctx, params);
3167
+ const seen = ctx.seen.get(schema);
3168
+ seen.ref = def.innerType;
3169
+ json.readOnly = true;
3170
+ };
3171
+ const optionalProcessor = (schema, ctx, _json, params) => {
3172
+ const def = schema._zod.def;
3173
+ process(def.innerType, ctx, params);
3174
+ const seen = ctx.seen.get(schema);
3175
+ seen.ref = def.innerType;
3176
+ };
3177
+ //#endregion
3178
+ //#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/iso.js
3179
+ const ZodISODateTime = /*@__PURE__*/ $constructor("ZodISODateTime", (inst, def) => {
3180
+ $ZodISODateTime.init(inst, def);
3181
+ ZodStringFormat.init(inst, def);
3182
+ });
3183
+ function datetime(params) {
3184
+ return /* @__PURE__ */ _isoDateTime(ZodISODateTime, params);
3185
+ }
3186
+ const ZodISODate = /*@__PURE__*/ $constructor("ZodISODate", (inst, def) => {
3187
+ $ZodISODate.init(inst, def);
3188
+ ZodStringFormat.init(inst, def);
3189
+ });
3190
+ function date(params) {
3191
+ return /* @__PURE__ */ _isoDate(ZodISODate, params);
3192
+ }
3193
+ const ZodISOTime = /*@__PURE__*/ $constructor("ZodISOTime", (inst, def) => {
3194
+ $ZodISOTime.init(inst, def);
3195
+ ZodStringFormat.init(inst, def);
3196
+ });
3197
+ function time(params) {
3198
+ return /* @__PURE__ */ _isoTime(ZodISOTime, params);
3199
+ }
3200
+ const ZodISODuration = /*@__PURE__*/ $constructor("ZodISODuration", (inst, def) => {
3201
+ $ZodISODuration.init(inst, def);
3202
+ ZodStringFormat.init(inst, def);
3203
+ });
3204
+ function duration(params) {
3205
+ return /* @__PURE__ */ _isoDuration(ZodISODuration, params);
3206
+ }
3207
+ //#endregion
3208
+ //#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/errors.js
3209
+ const initializer = (inst, issues) => {
3210
+ $ZodError.init(inst, issues);
3211
+ inst.name = "ZodError";
3212
+ Object.defineProperties(inst, {
3213
+ format: { value: (mapper) => formatError(inst, mapper) },
3214
+ flatten: { value: (mapper) => flattenError(inst, mapper) },
3215
+ addIssue: { value: (issue) => {
3216
+ inst.issues.push(issue);
3217
+ inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
3218
+ } },
3219
+ addIssues: { value: (issues) => {
3220
+ inst.issues.push(...issues);
3221
+ inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
3222
+ } },
3223
+ isEmpty: { get() {
3224
+ return inst.issues.length === 0;
3225
+ } }
3226
+ });
3227
+ };
3228
+ const ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, { Parent: Error });
3229
+ //#endregion
3230
+ //#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/parse.js
3231
+ const parse = /* @__PURE__ */ _parse(ZodRealError);
3232
+ const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
3233
+ const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
3234
+ const safeParseAsync = /* @__PURE__ */ _safeParseAsync(ZodRealError);
3235
+ const encode = /* @__PURE__ */ _encode(ZodRealError);
3236
+ const decode = /* @__PURE__ */ _decode(ZodRealError);
3237
+ const encodeAsync = /* @__PURE__ */ _encodeAsync(ZodRealError);
3238
+ const decodeAsync = /* @__PURE__ */ _decodeAsync(ZodRealError);
3239
+ const safeEncode = /* @__PURE__ */ _safeEncode(ZodRealError);
3240
+ const safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
3241
+ const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
3242
+ const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
3243
+ //#endregion
3244
+ //#region ../../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/schemas.js
3245
+ const _installedGroups = /* @__PURE__ */ new WeakMap();
3246
+ function _installLazyMethods(inst, group, methods) {
3247
+ const proto = Object.getPrototypeOf(inst);
3248
+ let installed = _installedGroups.get(proto);
3249
+ if (!installed) {
3250
+ installed = /* @__PURE__ */ new Set();
3251
+ _installedGroups.set(proto, installed);
3252
+ }
3253
+ if (installed.has(group)) return;
3254
+ installed.add(group);
3255
+ for (const key in methods) {
3256
+ const fn = methods[key];
3257
+ Object.defineProperty(proto, key, {
3258
+ configurable: true,
3259
+ enumerable: false,
3260
+ get() {
3261
+ const bound = fn.bind(this);
3262
+ Object.defineProperty(this, key, {
3263
+ configurable: true,
3264
+ writable: true,
3265
+ enumerable: true,
3266
+ value: bound
3267
+ });
3268
+ return bound;
3269
+ },
3270
+ set(v) {
3271
+ Object.defineProperty(this, key, {
3272
+ configurable: true,
3273
+ writable: true,
3274
+ enumerable: true,
3275
+ value: v
3276
+ });
3277
+ }
3278
+ });
3279
+ }
3280
+ }
3281
+ const ZodType = /*@__PURE__*/ $constructor("ZodType", (inst, def) => {
3282
+ $ZodType.init(inst, def);
3283
+ Object.assign(inst["~standard"], { jsonSchema: {
3284
+ input: createStandardJSONSchemaMethod(inst, "input"),
3285
+ output: createStandardJSONSchemaMethod(inst, "output")
3286
+ } });
3287
+ inst.toJSONSchema = createToJSONSchemaMethod(inst, {});
3288
+ inst.def = def;
3289
+ inst.type = def.type;
3290
+ Object.defineProperty(inst, "_def", { value: def });
3291
+ inst.parse = (data, params) => parse(inst, data, params, { callee: inst.parse });
3292
+ inst.safeParse = (data, params) => safeParse(inst, data, params);
3293
+ inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync });
3294
+ inst.safeParseAsync = async (data, params) => safeParseAsync(inst, data, params);
3295
+ inst.spa = inst.safeParseAsync;
3296
+ inst.encode = (data, params) => encode(inst, data, params);
3297
+ inst.decode = (data, params) => decode(inst, data, params);
3298
+ inst.encodeAsync = async (data, params) => encodeAsync(inst, data, params);
3299
+ inst.decodeAsync = async (data, params) => decodeAsync(inst, data, params);
3300
+ inst.safeEncode = (data, params) => safeEncode(inst, data, params);
3301
+ inst.safeDecode = (data, params) => safeDecode(inst, data, params);
3302
+ inst.safeEncodeAsync = async (data, params) => safeEncodeAsync(inst, data, params);
3303
+ inst.safeDecodeAsync = async (data, params) => safeDecodeAsync(inst, data, params);
3304
+ _installLazyMethods(inst, "ZodType", {
3305
+ check(...chks) {
3306
+ const def = this.def;
3307
+ return this.clone(mergeDefs(def, { checks: [...def.checks ?? [], ...chks.map((ch) => typeof ch === "function" ? { _zod: {
3308
+ check: ch,
3309
+ def: { check: "custom" },
3310
+ onattach: []
3311
+ } } : ch)] }), { parent: true });
3312
+ },
3313
+ with(...chks) {
3314
+ return this.check(...chks);
3315
+ },
3316
+ clone(def, params) {
3317
+ return clone(this, def, params);
3318
+ },
3319
+ brand() {
3320
+ return this;
3321
+ },
3322
+ register(reg, meta) {
3323
+ reg.add(this, meta);
3324
+ return this;
3325
+ },
3326
+ refine(check, params) {
3327
+ return this.check(refine(check, params));
3328
+ },
3329
+ superRefine(refinement, params) {
3330
+ return this.check(superRefine(refinement, params));
3331
+ },
3332
+ overwrite(fn) {
3333
+ return this.check(/* @__PURE__ */ _overwrite(fn));
3334
+ },
3335
+ optional() {
3336
+ return optional(this);
3337
+ },
3338
+ exactOptional() {
3339
+ return exactOptional(this);
3340
+ },
3341
+ nullable() {
3342
+ return nullable(this);
3343
+ },
3344
+ nullish() {
3345
+ return optional(nullable(this));
3346
+ },
3347
+ nonoptional(params) {
3348
+ return nonoptional(this, params);
3349
+ },
3350
+ array() {
3351
+ return array(this);
3352
+ },
3353
+ or(arg) {
3354
+ return union([this, arg]);
3355
+ },
3356
+ and(arg) {
3357
+ return intersection(this, arg);
3358
+ },
3359
+ transform(tx) {
3360
+ return pipe(this, transform(tx));
3361
+ },
3362
+ default(d) {
3363
+ return _default(this, d);
3364
+ },
3365
+ prefault(d) {
3366
+ return prefault(this, d);
3367
+ },
3368
+ catch(params) {
3369
+ return _catch(this, params);
3370
+ },
3371
+ pipe(target) {
3372
+ return pipe(this, target);
3373
+ },
3374
+ readonly() {
3375
+ return readonly(this);
3376
+ },
3377
+ describe(description) {
3378
+ const cl = this.clone();
3379
+ globalRegistry.add(cl, { description });
3380
+ return cl;
3381
+ },
3382
+ meta(...args) {
3383
+ if (args.length === 0) return globalRegistry.get(this);
3384
+ const cl = this.clone();
3385
+ globalRegistry.add(cl, args[0]);
3386
+ return cl;
3387
+ },
3388
+ isOptional() {
3389
+ return this.safeParse(void 0).success;
3390
+ },
3391
+ isNullable() {
3392
+ return this.safeParse(null).success;
3393
+ },
3394
+ apply(fn) {
3395
+ return fn(this);
3396
+ }
3397
+ });
3398
+ Object.defineProperty(inst, "description", {
3399
+ get() {
3400
+ return globalRegistry.get(inst)?.description;
3401
+ },
3402
+ configurable: true
3403
+ });
3404
+ return inst;
3405
+ });
3406
+ /** @internal */
3407
+ const _ZodString = /*@__PURE__*/ $constructor("_ZodString", (inst, def) => {
3408
+ $ZodString.init(inst, def);
3409
+ ZodType.init(inst, def);
3410
+ inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params);
3411
+ const bag = inst._zod.bag;
3412
+ inst.format = bag.format ?? null;
3413
+ inst.minLength = bag.minimum ?? null;
3414
+ inst.maxLength = bag.maximum ?? null;
3415
+ _installLazyMethods(inst, "_ZodString", {
3416
+ regex(...args) {
3417
+ return this.check(/* @__PURE__ */ _regex(...args));
3418
+ },
3419
+ includes(...args) {
3420
+ return this.check(/* @__PURE__ */ _includes(...args));
3421
+ },
3422
+ startsWith(...args) {
3423
+ return this.check(/* @__PURE__ */ _startsWith(...args));
3424
+ },
3425
+ endsWith(...args) {
3426
+ return this.check(/* @__PURE__ */ _endsWith(...args));
3427
+ },
3428
+ min(...args) {
3429
+ return this.check(/* @__PURE__ */ _minLength(...args));
3430
+ },
3431
+ max(...args) {
3432
+ return this.check(/* @__PURE__ */ _maxLength(...args));
3433
+ },
3434
+ length(...args) {
3435
+ return this.check(/* @__PURE__ */ _length(...args));
3436
+ },
3437
+ nonempty(...args) {
3438
+ return this.check(/* @__PURE__ */ _minLength(1, ...args));
3439
+ },
3440
+ lowercase(params) {
3441
+ return this.check(/* @__PURE__ */ _lowercase(params));
3442
+ },
3443
+ uppercase(params) {
3444
+ return this.check(/* @__PURE__ */ _uppercase(params));
3445
+ },
3446
+ trim() {
3447
+ return this.check(/* @__PURE__ */ _trim());
3448
+ },
3449
+ normalize(...args) {
3450
+ return this.check(/* @__PURE__ */ _normalize(...args));
3451
+ },
3452
+ toLowerCase() {
3453
+ return this.check(/* @__PURE__ */ _toLowerCase());
3454
+ },
3455
+ toUpperCase() {
3456
+ return this.check(/* @__PURE__ */ _toUpperCase());
3457
+ },
3458
+ slugify() {
3459
+ return this.check(/* @__PURE__ */ _slugify());
3460
+ }
3461
+ });
3462
+ });
3463
+ const ZodString = /*@__PURE__*/ $constructor("ZodString", (inst, def) => {
3464
+ $ZodString.init(inst, def);
3465
+ _ZodString.init(inst, def);
3466
+ inst.email = (params) => inst.check(/* @__PURE__ */ _email(ZodEmail, params));
3467
+ inst.url = (params) => inst.check(/* @__PURE__ */ _url(ZodURL, params));
3468
+ inst.jwt = (params) => inst.check(/* @__PURE__ */ _jwt(ZodJWT, params));
3469
+ inst.emoji = (params) => inst.check(/* @__PURE__ */ _emoji(ZodEmoji, params));
3470
+ inst.guid = (params) => inst.check(/* @__PURE__ */ _guid(ZodGUID, params));
3471
+ inst.uuid = (params) => inst.check(/* @__PURE__ */ _uuid(ZodUUID, params));
3472
+ inst.uuidv4 = (params) => inst.check(/* @__PURE__ */ _uuidv4(ZodUUID, params));
3473
+ inst.uuidv6 = (params) => inst.check(/* @__PURE__ */ _uuidv6(ZodUUID, params));
3474
+ inst.uuidv7 = (params) => inst.check(/* @__PURE__ */ _uuidv7(ZodUUID, params));
3475
+ inst.nanoid = (params) => inst.check(/* @__PURE__ */ _nanoid(ZodNanoID, params));
3476
+ inst.guid = (params) => inst.check(/* @__PURE__ */ _guid(ZodGUID, params));
3477
+ inst.cuid = (params) => inst.check(/* @__PURE__ */ _cuid(ZodCUID, params));
3478
+ inst.cuid2 = (params) => inst.check(/* @__PURE__ */ _cuid2(ZodCUID2, params));
3479
+ inst.ulid = (params) => inst.check(/* @__PURE__ */ _ulid(ZodULID, params));
3480
+ inst.base64 = (params) => inst.check(/* @__PURE__ */ _base64(ZodBase64, params));
3481
+ inst.base64url = (params) => inst.check(/* @__PURE__ */ _base64url(ZodBase64URL, params));
3482
+ inst.xid = (params) => inst.check(/* @__PURE__ */ _xid(ZodXID, params));
3483
+ inst.ksuid = (params) => inst.check(/* @__PURE__ */ _ksuid(ZodKSUID, params));
3484
+ inst.ipv4 = (params) => inst.check(/* @__PURE__ */ _ipv4(ZodIPv4, params));
3485
+ inst.ipv6 = (params) => inst.check(/* @__PURE__ */ _ipv6(ZodIPv6, params));
3486
+ inst.cidrv4 = (params) => inst.check(/* @__PURE__ */ _cidrv4(ZodCIDRv4, params));
3487
+ inst.cidrv6 = (params) => inst.check(/* @__PURE__ */ _cidrv6(ZodCIDRv6, params));
3488
+ inst.e164 = (params) => inst.check(/* @__PURE__ */ _e164(ZodE164, params));
3489
+ inst.datetime = (params) => inst.check(datetime(params));
3490
+ inst.date = (params) => inst.check(date(params));
3491
+ inst.time = (params) => inst.check(time(params));
3492
+ inst.duration = (params) => inst.check(duration(params));
3493
+ });
3494
+ function string(params) {
3495
+ return /* @__PURE__ */ _string(ZodString, params);
3496
+ }
3497
+ const ZodStringFormat = /*@__PURE__*/ $constructor("ZodStringFormat", (inst, def) => {
3498
+ $ZodStringFormat.init(inst, def);
3499
+ _ZodString.init(inst, def);
3500
+ });
3501
+ const ZodEmail = /*@__PURE__*/ $constructor("ZodEmail", (inst, def) => {
3502
+ $ZodEmail.init(inst, def);
3503
+ ZodStringFormat.init(inst, def);
3504
+ });
3505
+ const ZodGUID = /*@__PURE__*/ $constructor("ZodGUID", (inst, def) => {
3506
+ $ZodGUID.init(inst, def);
3507
+ ZodStringFormat.init(inst, def);
3508
+ });
3509
+ const ZodUUID = /*@__PURE__*/ $constructor("ZodUUID", (inst, def) => {
3510
+ $ZodUUID.init(inst, def);
3511
+ ZodStringFormat.init(inst, def);
3512
+ });
3513
+ const ZodURL = /*@__PURE__*/ $constructor("ZodURL", (inst, def) => {
3514
+ $ZodURL.init(inst, def);
3515
+ ZodStringFormat.init(inst, def);
3516
+ });
3517
+ const ZodEmoji = /*@__PURE__*/ $constructor("ZodEmoji", (inst, def) => {
3518
+ $ZodEmoji.init(inst, def);
3519
+ ZodStringFormat.init(inst, def);
3520
+ });
3521
+ const ZodNanoID = /*@__PURE__*/ $constructor("ZodNanoID", (inst, def) => {
3522
+ $ZodNanoID.init(inst, def);
3523
+ ZodStringFormat.init(inst, def);
3524
+ });
3525
+ /**
3526
+ * @deprecated CUID v1 is deprecated by its authors due to information leakage
3527
+ * (timestamps embedded in the id). Use {@link ZodCUID2} instead.
3528
+ * See https://github.com/paralleldrive/cuid.
3529
+ */
3530
+ const ZodCUID = /*@__PURE__*/ $constructor("ZodCUID", (inst, def) => {
3531
+ $ZodCUID.init(inst, def);
3532
+ ZodStringFormat.init(inst, def);
3533
+ });
3534
+ const ZodCUID2 = /*@__PURE__*/ $constructor("ZodCUID2", (inst, def) => {
3535
+ $ZodCUID2.init(inst, def);
3536
+ ZodStringFormat.init(inst, def);
3537
+ });
3538
+ const ZodULID = /*@__PURE__*/ $constructor("ZodULID", (inst, def) => {
3539
+ $ZodULID.init(inst, def);
3540
+ ZodStringFormat.init(inst, def);
3541
+ });
3542
+ const ZodXID = /*@__PURE__*/ $constructor("ZodXID", (inst, def) => {
3543
+ $ZodXID.init(inst, def);
3544
+ ZodStringFormat.init(inst, def);
3545
+ });
3546
+ const ZodKSUID = /*@__PURE__*/ $constructor("ZodKSUID", (inst, def) => {
3547
+ $ZodKSUID.init(inst, def);
3548
+ ZodStringFormat.init(inst, def);
3549
+ });
3550
+ const ZodIPv4 = /*@__PURE__*/ $constructor("ZodIPv4", (inst, def) => {
3551
+ $ZodIPv4.init(inst, def);
3552
+ ZodStringFormat.init(inst, def);
3553
+ });
3554
+ const ZodIPv6 = /*@__PURE__*/ $constructor("ZodIPv6", (inst, def) => {
3555
+ $ZodIPv6.init(inst, def);
3556
+ ZodStringFormat.init(inst, def);
3557
+ });
3558
+ const ZodCIDRv4 = /*@__PURE__*/ $constructor("ZodCIDRv4", (inst, def) => {
3559
+ $ZodCIDRv4.init(inst, def);
3560
+ ZodStringFormat.init(inst, def);
3561
+ });
3562
+ const ZodCIDRv6 = /*@__PURE__*/ $constructor("ZodCIDRv6", (inst, def) => {
3563
+ $ZodCIDRv6.init(inst, def);
3564
+ ZodStringFormat.init(inst, def);
3565
+ });
3566
+ const ZodBase64 = /*@__PURE__*/ $constructor("ZodBase64", (inst, def) => {
3567
+ $ZodBase64.init(inst, def);
3568
+ ZodStringFormat.init(inst, def);
3569
+ });
3570
+ const ZodBase64URL = /*@__PURE__*/ $constructor("ZodBase64URL", (inst, def) => {
3571
+ $ZodBase64URL.init(inst, def);
3572
+ ZodStringFormat.init(inst, def);
3573
+ });
3574
+ const ZodE164 = /*@__PURE__*/ $constructor("ZodE164", (inst, def) => {
3575
+ $ZodE164.init(inst, def);
3576
+ ZodStringFormat.init(inst, def);
3577
+ });
3578
+ const ZodJWT = /*@__PURE__*/ $constructor("ZodJWT", (inst, def) => {
3579
+ $ZodJWT.init(inst, def);
3580
+ ZodStringFormat.init(inst, def);
3581
+ });
3582
+ const ZodNumber = /*@__PURE__*/ $constructor("ZodNumber", (inst, def) => {
3583
+ $ZodNumber.init(inst, def);
3584
+ ZodType.init(inst, def);
3585
+ inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
3586
+ _installLazyMethods(inst, "ZodNumber", {
3587
+ gt(value, params) {
3588
+ return this.check(/* @__PURE__ */ _gt(value, params));
3589
+ },
3590
+ gte(value, params) {
3591
+ return this.check(/* @__PURE__ */ _gte(value, params));
3592
+ },
3593
+ min(value, params) {
3594
+ return this.check(/* @__PURE__ */ _gte(value, params));
3595
+ },
3596
+ lt(value, params) {
3597
+ return this.check(/* @__PURE__ */ _lt(value, params));
3598
+ },
3599
+ lte(value, params) {
3600
+ return this.check(/* @__PURE__ */ _lte(value, params));
3601
+ },
3602
+ max(value, params) {
3603
+ return this.check(/* @__PURE__ */ _lte(value, params));
3604
+ },
3605
+ int(params) {
3606
+ return this.check(int(params));
3607
+ },
3608
+ safe(params) {
3609
+ return this.check(int(params));
3610
+ },
3611
+ positive(params) {
3612
+ return this.check(/* @__PURE__ */ _gt(0, params));
3613
+ },
3614
+ nonnegative(params) {
3615
+ return this.check(/* @__PURE__ */ _gte(0, params));
3616
+ },
3617
+ negative(params) {
3618
+ return this.check(/* @__PURE__ */ _lt(0, params));
3619
+ },
3620
+ nonpositive(params) {
3621
+ return this.check(/* @__PURE__ */ _lte(0, params));
3622
+ },
3623
+ multipleOf(value, params) {
3624
+ return this.check(/* @__PURE__ */ _multipleOf(value, params));
3625
+ },
3626
+ step(value, params) {
3627
+ return this.check(/* @__PURE__ */ _multipleOf(value, params));
3628
+ },
3629
+ finite() {
3630
+ return this;
3631
+ }
3632
+ });
3633
+ const bag = inst._zod.bag;
3634
+ inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
3635
+ inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
3636
+ inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? .5);
3637
+ inst.isFinite = true;
3638
+ inst.format = bag.format ?? null;
3639
+ });
3640
+ function number(params) {
3641
+ return /* @__PURE__ */ _number(ZodNumber, params);
3642
+ }
3643
+ const ZodNumberFormat = /*@__PURE__*/ $constructor("ZodNumberFormat", (inst, def) => {
3644
+ $ZodNumberFormat.init(inst, def);
3645
+ ZodNumber.init(inst, def);
3646
+ });
3647
+ function int(params) {
3648
+ return /* @__PURE__ */ _int(ZodNumberFormat, params);
3649
+ }
3650
+ const ZodUnknown = /*@__PURE__*/ $constructor("ZodUnknown", (inst, def) => {
3651
+ $ZodUnknown.init(inst, def);
3652
+ ZodType.init(inst, def);
3653
+ inst._zod.processJSONSchema = (ctx, json, params) => void 0;
3654
+ });
3655
+ function unknown() {
3656
+ return /* @__PURE__ */ _unknown(ZodUnknown);
3657
+ }
3658
+ const ZodNever = /*@__PURE__*/ $constructor("ZodNever", (inst, def) => {
3659
+ $ZodNever.init(inst, def);
3660
+ ZodType.init(inst, def);
3661
+ inst._zod.processJSONSchema = (ctx, json, params) => neverProcessor(inst, ctx, json, params);
3662
+ });
3663
+ function never(params) {
3664
+ return /* @__PURE__ */ _never(ZodNever, params);
3665
+ }
3666
+ const ZodArray = /*@__PURE__*/ $constructor("ZodArray", (inst, def) => {
3667
+ $ZodArray.init(inst, def);
3668
+ ZodType.init(inst, def);
3669
+ inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params);
3670
+ inst.element = def.element;
3671
+ _installLazyMethods(inst, "ZodArray", {
3672
+ min(n, params) {
3673
+ return this.check(/* @__PURE__ */ _minLength(n, params));
3674
+ },
3675
+ nonempty(params) {
3676
+ return this.check(/* @__PURE__ */ _minLength(1, params));
3677
+ },
3678
+ max(n, params) {
3679
+ return this.check(/* @__PURE__ */ _maxLength(n, params));
3680
+ },
3681
+ length(n, params) {
3682
+ return this.check(/* @__PURE__ */ _length(n, params));
3683
+ },
3684
+ unwrap() {
3685
+ return this.element;
3686
+ }
3687
+ });
3688
+ });
3689
+ function array(element, params) {
3690
+ return /* @__PURE__ */ _array(ZodArray, element, params);
3691
+ }
3692
+ const ZodObject = /*@__PURE__*/ $constructor("ZodObject", (inst, def) => {
3693
+ $ZodObjectJIT.init(inst, def);
3694
+ ZodType.init(inst, def);
3695
+ inst._zod.processJSONSchema = (ctx, json, params) => objectProcessor(inst, ctx, json, params);
3696
+ defineLazy(inst, "shape", () => {
3697
+ return def.shape;
3698
+ });
3699
+ _installLazyMethods(inst, "ZodObject", {
3700
+ keyof() {
3701
+ return _enum(Object.keys(this._zod.def.shape));
3702
+ },
3703
+ catchall(catchall) {
3704
+ return this.clone({
3705
+ ...this._zod.def,
3706
+ catchall
3707
+ });
3708
+ },
3709
+ passthrough() {
3710
+ return this.clone({
3711
+ ...this._zod.def,
3712
+ catchall: unknown()
3713
+ });
3714
+ },
3715
+ loose() {
3716
+ return this.clone({
3717
+ ...this._zod.def,
3718
+ catchall: unknown()
3719
+ });
3720
+ },
3721
+ strict() {
3722
+ return this.clone({
3723
+ ...this._zod.def,
3724
+ catchall: never()
3725
+ });
3726
+ },
3727
+ strip() {
3728
+ return this.clone({
3729
+ ...this._zod.def,
3730
+ catchall: void 0
3731
+ });
3732
+ },
3733
+ extend(incoming) {
3734
+ return extend(this, incoming);
3735
+ },
3736
+ safeExtend(incoming) {
3737
+ return safeExtend(this, incoming);
3738
+ },
3739
+ merge(other) {
3740
+ return merge(this, other);
3741
+ },
3742
+ pick(mask) {
3743
+ return pick(this, mask);
3744
+ },
3745
+ omit(mask) {
3746
+ return omit(this, mask);
3747
+ },
3748
+ partial(...args) {
3749
+ return partial(ZodOptional, this, args[0]);
3750
+ },
3751
+ required(...args) {
3752
+ return required(ZodNonOptional, this, args[0]);
3753
+ }
3754
+ });
3755
+ });
3756
+ function object(shape, params) {
3757
+ return new ZodObject({
3758
+ type: "object",
3759
+ shape: shape ?? {},
3760
+ ...normalizeParams(params)
3761
+ });
3762
+ }
3763
+ const ZodUnion = /*@__PURE__*/ $constructor("ZodUnion", (inst, def) => {
3764
+ $ZodUnion.init(inst, def);
3765
+ ZodType.init(inst, def);
3766
+ inst._zod.processJSONSchema = (ctx, json, params) => unionProcessor(inst, ctx, json, params);
3767
+ inst.options = def.options;
3768
+ });
3769
+ function union(options, params) {
3770
+ return new ZodUnion({
3771
+ type: "union",
3772
+ options,
3773
+ ...normalizeParams(params)
3774
+ });
3775
+ }
3776
+ const ZodIntersection = /*@__PURE__*/ $constructor("ZodIntersection", (inst, def) => {
3777
+ $ZodIntersection.init(inst, def);
3778
+ ZodType.init(inst, def);
3779
+ inst._zod.processJSONSchema = (ctx, json, params) => intersectionProcessor(inst, ctx, json, params);
3780
+ });
3781
+ function intersection(left, right) {
3782
+ return new ZodIntersection({
3783
+ type: "intersection",
3784
+ left,
3785
+ right
3786
+ });
3787
+ }
3788
+ const ZodEnum = /*@__PURE__*/ $constructor("ZodEnum", (inst, def) => {
3789
+ $ZodEnum.init(inst, def);
3790
+ ZodType.init(inst, def);
3791
+ inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
3792
+ inst.enum = def.entries;
3793
+ inst.options = Object.values(def.entries);
3794
+ const keys = new Set(Object.keys(def.entries));
3795
+ inst.extract = (values, params) => {
3796
+ const newEntries = {};
3797
+ for (const value of values) if (keys.has(value)) newEntries[value] = def.entries[value];
3798
+ else throw new Error(`Key ${value} not found in enum`);
3799
+ return new ZodEnum({
3800
+ ...def,
3801
+ checks: [],
3802
+ ...normalizeParams(params),
3803
+ entries: newEntries
3804
+ });
3805
+ };
3806
+ inst.exclude = (values, params) => {
3807
+ const newEntries = { ...def.entries };
3808
+ for (const value of values) if (keys.has(value)) delete newEntries[value];
3809
+ else throw new Error(`Key ${value} not found in enum`);
3810
+ return new ZodEnum({
3811
+ ...def,
3812
+ checks: [],
3813
+ ...normalizeParams(params),
3814
+ entries: newEntries
3815
+ });
3816
+ };
3817
+ });
3818
+ function _enum(values, params) {
3819
+ return new ZodEnum({
3820
+ type: "enum",
3821
+ entries: Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values,
3822
+ ...normalizeParams(params)
3823
+ });
3824
+ }
3825
+ const ZodLiteral = /*@__PURE__*/ $constructor("ZodLiteral", (inst, def) => {
3826
+ $ZodLiteral.init(inst, def);
3827
+ ZodType.init(inst, def);
3828
+ inst._zod.processJSONSchema = (ctx, json, params) => literalProcessor(inst, ctx, json, params);
3829
+ inst.values = new Set(def.values);
3830
+ Object.defineProperty(inst, "value", { get() {
3831
+ if (def.values.length > 1) throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");
3832
+ return def.values[0];
3833
+ } });
3834
+ });
3835
+ function literal(value, params) {
3836
+ return new ZodLiteral({
3837
+ type: "literal",
3838
+ values: Array.isArray(value) ? value : [value],
3839
+ ...normalizeParams(params)
3840
+ });
3841
+ }
3842
+ const ZodTransform = /*@__PURE__*/ $constructor("ZodTransform", (inst, def) => {
3843
+ $ZodTransform.init(inst, def);
3844
+ ZodType.init(inst, def);
3845
+ inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx, json, params);
3846
+ inst._zod.parse = (payload, _ctx) => {
3847
+ if (_ctx.direction === "backward") throw new $ZodEncodeError(inst.constructor.name);
3848
+ payload.addIssue = (issue$1) => {
3849
+ if (typeof issue$1 === "string") payload.issues.push(issue(issue$1, payload.value, def));
3850
+ else {
3851
+ const _issue = issue$1;
3852
+ if (_issue.fatal) _issue.continue = false;
3853
+ _issue.code ?? (_issue.code = "custom");
3854
+ _issue.input ?? (_issue.input = payload.value);
3855
+ _issue.inst ?? (_issue.inst = inst);
3856
+ payload.issues.push(issue(_issue));
3857
+ }
3858
+ };
3859
+ const output = def.transform(payload.value, payload);
3860
+ if (output instanceof Promise) return output.then((output) => {
3861
+ payload.value = output;
3862
+ payload.fallback = true;
3863
+ return payload;
3864
+ });
3865
+ payload.value = output;
3866
+ payload.fallback = true;
3867
+ return payload;
3868
+ };
3869
+ });
3870
+ function transform(fn) {
3871
+ return new ZodTransform({
3872
+ type: "transform",
3873
+ transform: fn
3874
+ });
3875
+ }
3876
+ const ZodOptional = /*@__PURE__*/ $constructor("ZodOptional", (inst, def) => {
3877
+ $ZodOptional.init(inst, def);
3878
+ ZodType.init(inst, def);
3879
+ inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
3880
+ inst.unwrap = () => inst._zod.def.innerType;
3881
+ });
3882
+ function optional(innerType) {
3883
+ return new ZodOptional({
3884
+ type: "optional",
3885
+ innerType
3886
+ });
3887
+ }
3888
+ const ZodExactOptional = /*@__PURE__*/ $constructor("ZodExactOptional", (inst, def) => {
3889
+ $ZodExactOptional.init(inst, def);
3890
+ ZodType.init(inst, def);
3891
+ inst._zod.processJSONSchema = (ctx, json, params) => optionalProcessor(inst, ctx, json, params);
3892
+ inst.unwrap = () => inst._zod.def.innerType;
3893
+ });
3894
+ function exactOptional(innerType) {
3895
+ return new ZodExactOptional({
3896
+ type: "optional",
3897
+ innerType
3898
+ });
3899
+ }
3900
+ const ZodNullable = /*@__PURE__*/ $constructor("ZodNullable", (inst, def) => {
3901
+ $ZodNullable.init(inst, def);
3902
+ ZodType.init(inst, def);
3903
+ inst._zod.processJSONSchema = (ctx, json, params) => nullableProcessor(inst, ctx, json, params);
3904
+ inst.unwrap = () => inst._zod.def.innerType;
3905
+ });
3906
+ function nullable(innerType) {
3907
+ return new ZodNullable({
3908
+ type: "nullable",
3909
+ innerType
3910
+ });
3911
+ }
3912
+ const ZodDefault = /*@__PURE__*/ $constructor("ZodDefault", (inst, def) => {
3913
+ $ZodDefault.init(inst, def);
3914
+ ZodType.init(inst, def);
3915
+ inst._zod.processJSONSchema = (ctx, json, params) => defaultProcessor(inst, ctx, json, params);
3916
+ inst.unwrap = () => inst._zod.def.innerType;
3917
+ inst.removeDefault = inst.unwrap;
3918
+ });
3919
+ function _default(innerType, defaultValue) {
3920
+ return new ZodDefault({
3921
+ type: "default",
3922
+ innerType,
3923
+ get defaultValue() {
3924
+ return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
3925
+ }
3926
+ });
3927
+ }
3928
+ const ZodPrefault = /*@__PURE__*/ $constructor("ZodPrefault", (inst, def) => {
3929
+ $ZodPrefault.init(inst, def);
3930
+ ZodType.init(inst, def);
3931
+ inst._zod.processJSONSchema = (ctx, json, params) => prefaultProcessor(inst, ctx, json, params);
3932
+ inst.unwrap = () => inst._zod.def.innerType;
3933
+ });
3934
+ function prefault(innerType, defaultValue) {
3935
+ return new ZodPrefault({
3936
+ type: "prefault",
3937
+ innerType,
3938
+ get defaultValue() {
3939
+ return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
3940
+ }
3941
+ });
3942
+ }
3943
+ const ZodNonOptional = /*@__PURE__*/ $constructor("ZodNonOptional", (inst, def) => {
3944
+ $ZodNonOptional.init(inst, def);
3945
+ ZodType.init(inst, def);
3946
+ inst._zod.processJSONSchema = (ctx, json, params) => nonoptionalProcessor(inst, ctx, json, params);
3947
+ inst.unwrap = () => inst._zod.def.innerType;
3948
+ });
3949
+ function nonoptional(innerType, params) {
3950
+ return new ZodNonOptional({
3951
+ type: "nonoptional",
3952
+ innerType,
3953
+ ...normalizeParams(params)
3954
+ });
3955
+ }
3956
+ const ZodCatch = /*@__PURE__*/ $constructor("ZodCatch", (inst, def) => {
3957
+ $ZodCatch.init(inst, def);
3958
+ ZodType.init(inst, def);
3959
+ inst._zod.processJSONSchema = (ctx, json, params) => catchProcessor(inst, ctx, json, params);
3960
+ inst.unwrap = () => inst._zod.def.innerType;
3961
+ inst.removeCatch = inst.unwrap;
3962
+ });
3963
+ function _catch(innerType, catchValue) {
3964
+ return new ZodCatch({
3965
+ type: "catch",
3966
+ innerType,
3967
+ catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
3968
+ });
3969
+ }
3970
+ const ZodPipe = /*@__PURE__*/ $constructor("ZodPipe", (inst, def) => {
3971
+ $ZodPipe.init(inst, def);
3972
+ ZodType.init(inst, def);
3973
+ inst._zod.processJSONSchema = (ctx, json, params) => pipeProcessor(inst, ctx, json, params);
3974
+ inst.in = def.in;
3975
+ inst.out = def.out;
3976
+ });
3977
+ function pipe(in_, out) {
3978
+ return new ZodPipe({
3979
+ type: "pipe",
3980
+ in: in_,
3981
+ out
3982
+ });
3983
+ }
3984
+ const ZodReadonly = /*@__PURE__*/ $constructor("ZodReadonly", (inst, def) => {
3985
+ $ZodReadonly.init(inst, def);
3986
+ ZodType.init(inst, def);
3987
+ inst._zod.processJSONSchema = (ctx, json, params) => readonlyProcessor(inst, ctx, json, params);
3988
+ inst.unwrap = () => inst._zod.def.innerType;
3989
+ });
3990
+ function readonly(innerType) {
3991
+ return new ZodReadonly({
3992
+ type: "readonly",
3993
+ innerType
3994
+ });
3995
+ }
3996
+ const ZodCustom = /*@__PURE__*/ $constructor("ZodCustom", (inst, def) => {
3997
+ $ZodCustom.init(inst, def);
3998
+ ZodType.init(inst, def);
3999
+ inst._zod.processJSONSchema = (ctx, json, params) => customProcessor(inst, ctx, json, params);
4000
+ });
4001
+ function refine(fn, _params = {}) {
4002
+ return /* @__PURE__ */ _refine(ZodCustom, fn, _params);
4003
+ }
4004
+ function superRefine(fn, params) {
4005
+ return /* @__PURE__ */ _superRefine(fn, params);
4006
+ }
4007
+ //#endregion
4008
+ //#region ../../goal/goal/lib/typert.remote-client.js
4009
+ const _deepseek_ai_dsh_goal_goals_clear_parameter_0$schema = intersection(string(), unknown());
4010
+ const _deepseek_ai_dsh_goal_goals_clear_parameter_1$schema = object({
4011
+ "id": intersection(string(), unknown()).readonly(),
4012
+ "revision": number().readonly()
4013
+ });
4014
+ const _deepseek_ai_dsh_goal_goals_clear_result$schema = object({
4015
+ "id": intersection(string(), unknown()).readonly(),
4016
+ "revision": number().readonly()
4017
+ });
4018
+ const _deepseek_ai_dsh_goal_goals_complete_parameter_0$schema = intersection(string(), unknown());
4019
+ const _deepseek_ai_dsh_goal_goals_complete_parameter_1$schema = object({
4020
+ "id": intersection(string(), unknown()).readonly(),
4021
+ "revision": number().readonly()
4022
+ });
4023
+ const _deepseek_ai_dsh_goal_goals_complete_result$schema = object({
4024
+ "roundsStarted": number().readonly(),
4025
+ "createdAt": number().readonly(),
4026
+ "updatedAt": number().readonly(),
4027
+ "activation": union([literal("armed"), literal("disarmed")]).readonly(),
4028
+ "objective": string().readonly(),
4029
+ "phase": union([
4030
+ literal("active"),
4031
+ literal("paused"),
4032
+ literal("blocked"),
4033
+ literal("complete")
4034
+ ]).readonly(),
4035
+ "blockedReason": object({
4036
+ "code": string().readonly(),
4037
+ "message": string().readonly()
4038
+ }).readonly().optional(),
4039
+ "maxGoalRounds": number().readonly(),
4040
+ "id": intersection(string(), unknown()).readonly(),
4041
+ "revision": number().readonly()
4042
+ });
4043
+ const _deepseek_ai_dsh_goal_goals_create_parameter_0$schema = intersection(string(), unknown());
4044
+ const _deepseek_ai_dsh_goal_goals_create_parameter_1$schema = object({
4045
+ "objective": string().readonly(),
4046
+ "maxGoalRounds": number().readonly().optional()
4047
+ });
4048
+ const _deepseek_ai_dsh_goal_goals_create_result$schema = object({ "ref": object({
4049
+ "id": intersection(string(), unknown()).readonly(),
4050
+ "revision": number().readonly()
4051
+ }).readonly() });
4052
+ const _deepseek_ai_dsh_goal_goals_edit_parameter_0$schema = intersection(string(), unknown());
4053
+ const _deepseek_ai_dsh_goal_goals_edit_parameter_1$schema = object({
4054
+ "id": intersection(string(), unknown()).readonly(),
4055
+ "revision": number().readonly()
4056
+ });
4057
+ const _deepseek_ai_dsh_goal_goals_edit_parameter_2$schema = object({
4058
+ "objective": string().readonly().optional(),
4059
+ "maxGoalRounds": number().readonly().optional()
4060
+ });
4061
+ const _deepseek_ai_dsh_goal_goals_edit_result$schema = object({
4062
+ "roundsStarted": number().readonly(),
4063
+ "createdAt": number().readonly(),
4064
+ "updatedAt": number().readonly(),
4065
+ "activation": union([literal("armed"), literal("disarmed")]).readonly(),
4066
+ "objective": string().readonly(),
4067
+ "phase": union([
4068
+ literal("active"),
4069
+ literal("paused"),
4070
+ literal("blocked"),
4071
+ literal("complete")
4072
+ ]).readonly(),
4073
+ "blockedReason": object({
4074
+ "code": string().readonly(),
4075
+ "message": string().readonly()
4076
+ }).readonly().optional(),
4077
+ "maxGoalRounds": number().readonly(),
4078
+ "id": intersection(string(), unknown()).readonly(),
4079
+ "revision": number().readonly()
4080
+ });
4081
+ const _deepseek_ai_dsh_goal_goals_pause_parameter_0$schema = intersection(string(), unknown());
4082
+ const _deepseek_ai_dsh_goal_goals_pause_parameter_1$schema = object({
4083
+ "id": intersection(string(), unknown()).readonly(),
4084
+ "revision": number().readonly()
4085
+ });
4086
+ const _deepseek_ai_dsh_goal_goals_pause_result$schema = object({
4087
+ "roundsStarted": number().readonly(),
4088
+ "createdAt": number().readonly(),
4089
+ "updatedAt": number().readonly(),
4090
+ "activation": union([literal("armed"), literal("disarmed")]).readonly(),
4091
+ "objective": string().readonly(),
4092
+ "phase": union([
4093
+ literal("active"),
4094
+ literal("paused"),
4095
+ literal("blocked"),
4096
+ literal("complete")
4097
+ ]).readonly(),
4098
+ "blockedReason": object({
4099
+ "code": string().readonly(),
4100
+ "message": string().readonly()
4101
+ }).readonly().optional(),
4102
+ "maxGoalRounds": number().readonly(),
4103
+ "id": intersection(string(), unknown()).readonly(),
4104
+ "revision": number().readonly()
4105
+ });
4106
+ const _deepseek_ai_dsh_goal_goals_resume_parameter_0$schema = intersection(string(), unknown());
4107
+ const _deepseek_ai_dsh_goal_goals_resume_parameter_1$schema = object({
4108
+ "id": intersection(string(), unknown()).readonly(),
4109
+ "revision": number().readonly()
4110
+ });
4111
+ const _deepseek_ai_dsh_goal_goals_resume_result$schema = object({
4112
+ "roundsStarted": number().readonly(),
4113
+ "createdAt": number().readonly(),
4114
+ "updatedAt": number().readonly(),
4115
+ "activation": union([literal("armed"), literal("disarmed")]).readonly(),
4116
+ "objective": string().readonly(),
4117
+ "phase": union([
4118
+ literal("active"),
4119
+ literal("paused"),
4120
+ literal("blocked"),
4121
+ literal("complete")
4122
+ ]).readonly(),
4123
+ "blockedReason": object({
4124
+ "code": string().readonly(),
4125
+ "message": string().readonly()
4126
+ }).readonly().optional(),
4127
+ "maxGoalRounds": number().readonly(),
4128
+ "id": intersection(string(), unknown()).readonly(),
4129
+ "revision": number().readonly()
4130
+ });
4131
+ const TYPERT_REMOTE = {
4132
+ package: "@deepseek-ai/dsh-goal",
4133
+ descriptors: [
4134
+ {
4135
+ id: "@deepseek-ai/dsh-goal#goals/clear",
4136
+ service: "goals",
4137
+ namespace: "goals",
4138
+ method: "clear",
4139
+ invocation: { kind: "direct" },
4140
+ scope: {
4141
+ context: "agent",
4142
+ wire: "agentId"
4143
+ },
4144
+ parameters: [{
4145
+ name: "agent",
4146
+ wire: "agentId",
4147
+ source: "lookup",
4148
+ lookup: "agent",
4149
+ codec: {
4150
+ mode: "strict",
4151
+ typeSymbol: "@deepseek-ai/dsh-session/types#SessionId",
4152
+ schema: _deepseek_ai_dsh_goal_goals_clear_parameter_0$schema
4153
+ }
4154
+ }, {
4155
+ name: "ref",
4156
+ wire: "ref",
4157
+ source: "json",
4158
+ codec: {
4159
+ mode: "strict",
4160
+ typeSymbol: "@deepseek-ai/dsh-goal/client#GoalRef",
4161
+ schema: _deepseek_ai_dsh_goal_goals_clear_parameter_1$schema
4162
+ }
4163
+ }],
4164
+ result: {
4165
+ mode: "strict",
4166
+ typeSymbol: "@deepseek-ai/dsh-goal/client#GoalRef",
4167
+ schema: _deepseek_ai_dsh_goal_goals_clear_result$schema
4168
+ },
4169
+ sourceLocation: {
4170
+ "file": "packages/goal/goal/src/index.ts",
4171
+ "line": 377,
4172
+ "column": 3
4173
+ }
4174
+ },
4175
+ {
4176
+ id: "@deepseek-ai/dsh-goal#goals/complete",
4177
+ service: "goals",
4178
+ namespace: "goals",
4179
+ method: "complete",
4180
+ invocation: { kind: "direct" },
4181
+ scope: {
4182
+ context: "agent",
4183
+ wire: "agentId"
4184
+ },
4185
+ parameters: [{
4186
+ name: "agent",
4187
+ wire: "agentId",
4188
+ source: "lookup",
4189
+ lookup: "agent",
4190
+ codec: {
4191
+ mode: "strict",
4192
+ typeSymbol: "@deepseek-ai/dsh-session/types#SessionId",
4193
+ schema: _deepseek_ai_dsh_goal_goals_complete_parameter_0$schema
4194
+ }
4195
+ }, {
4196
+ name: "ref",
4197
+ wire: "ref",
4198
+ source: "json",
4199
+ codec: {
4200
+ mode: "strict",
4201
+ typeSymbol: "@deepseek-ai/dsh-goal/client#GoalRef",
4202
+ schema: _deepseek_ai_dsh_goal_goals_complete_parameter_1$schema
4203
+ }
4204
+ }],
4205
+ result: {
4206
+ mode: "strict",
4207
+ typeSymbol: "@deepseek-ai/dsh-goal/client#GoalView",
4208
+ schema: _deepseek_ai_dsh_goal_goals_complete_result$schema
4209
+ },
4210
+ sourceLocation: {
4211
+ "file": "packages/goal/goal/src/index.ts",
4212
+ "line": 337,
4213
+ "column": 3
4214
+ }
4215
+ },
4216
+ {
4217
+ id: "@deepseek-ai/dsh-goal#goals/create",
4218
+ service: "goals",
4219
+ namespace: "goals",
4220
+ method: "create",
4221
+ implementation: "remoteExportCreate",
4222
+ invocation: { kind: "direct" },
4223
+ scope: {
4224
+ context: "agent",
4225
+ wire: "agentId"
4226
+ },
4227
+ parameters: [{
4228
+ name: "agent",
4229
+ wire: "agentId",
4230
+ source: "lookup",
4231
+ lookup: "agent",
4232
+ codec: {
4233
+ mode: "strict",
4234
+ typeSymbol: "@deepseek-ai/dsh-session/types#SessionId",
4235
+ schema: _deepseek_ai_dsh_goal_goals_create_parameter_0$schema
4236
+ }
4237
+ }, {
4238
+ name: "request",
4239
+ wire: "request",
4240
+ source: "json",
4241
+ codec: {
4242
+ mode: "strict",
4243
+ typeSymbol: "@deepseek-ai/dsh-goal/client#CreateGoalRequest",
4244
+ schema: _deepseek_ai_dsh_goal_goals_create_parameter_1$schema
4245
+ }
4246
+ }],
4247
+ result: {
4248
+ mode: "strict",
4249
+ typeSymbol: "@deepseek-ai/dsh-goal/client#CreateGoalResult",
4250
+ schema: _deepseek_ai_dsh_goal_goals_create_result$schema
4251
+ },
4252
+ sourceLocation: {
4253
+ "file": "packages/goal/goal/src/index.ts",
4254
+ "line": 586,
4255
+ "column": 3
4256
+ }
4257
+ },
4258
+ {
4259
+ id: "@deepseek-ai/dsh-goal#goals/edit",
4260
+ service: "goals",
4261
+ namespace: "goals",
4262
+ method: "edit",
4263
+ invocation: { kind: "direct" },
4264
+ scope: {
4265
+ context: "agent",
4266
+ wire: "agentId"
4267
+ },
4268
+ parameters: [
4269
+ {
4270
+ name: "agent",
4271
+ wire: "agentId",
4272
+ source: "lookup",
4273
+ lookup: "agent",
4274
+ codec: {
4275
+ mode: "strict",
4276
+ typeSymbol: "@deepseek-ai/dsh-session/types#SessionId",
4277
+ schema: _deepseek_ai_dsh_goal_goals_edit_parameter_0$schema
4278
+ }
4279
+ },
4280
+ {
4281
+ name: "ref",
4282
+ wire: "ref",
4283
+ source: "json",
4284
+ codec: {
4285
+ mode: "strict",
4286
+ typeSymbol: "@deepseek-ai/dsh-goal/client#GoalRef",
4287
+ schema: _deepseek_ai_dsh_goal_goals_edit_parameter_1$schema
4288
+ }
4289
+ },
4290
+ {
4291
+ name: "request",
4292
+ wire: "request",
4293
+ source: "json",
4294
+ codec: {
4295
+ mode: "strict",
4296
+ typeSymbol: "@deepseek-ai/dsh-goal/client#EditGoalRequest",
4297
+ schema: _deepseek_ai_dsh_goal_goals_edit_parameter_2$schema
4298
+ }
4299
+ }
4300
+ ],
4301
+ result: {
4302
+ mode: "strict",
4303
+ typeSymbol: "@deepseek-ai/dsh-goal/client#GoalView",
4304
+ schema: _deepseek_ai_dsh_goal_goals_edit_result$schema
4305
+ },
4306
+ sourceLocation: {
4307
+ "file": "packages/goal/goal/src/index.ts",
4308
+ "line": 277,
4309
+ "column": 3
4310
+ }
4311
+ },
4312
+ {
4313
+ id: "@deepseek-ai/dsh-goal#goals/pause",
4314
+ service: "goals",
4315
+ namespace: "goals",
4316
+ method: "pause",
4317
+ invocation: { kind: "direct" },
4318
+ scope: {
4319
+ context: "agent",
4320
+ wire: "agentId"
4321
+ },
4322
+ parameters: [{
4323
+ name: "agent",
4324
+ wire: "agentId",
4325
+ source: "lookup",
4326
+ lookup: "agent",
4327
+ codec: {
4328
+ mode: "strict",
4329
+ typeSymbol: "@deepseek-ai/dsh-session/types#SessionId",
4330
+ schema: _deepseek_ai_dsh_goal_goals_pause_parameter_0$schema
4331
+ }
4332
+ }, {
4333
+ name: "ref",
4334
+ wire: "ref",
4335
+ source: "json",
4336
+ codec: {
4337
+ mode: "strict",
4338
+ typeSymbol: "@deepseek-ai/dsh-goal/client#GoalRef",
4339
+ schema: _deepseek_ai_dsh_goal_goals_pause_parameter_1$schema
4340
+ }
4341
+ }],
4342
+ result: {
4343
+ mode: "strict",
4344
+ typeSymbol: "@deepseek-ai/dsh-goal/client#GoalView",
4345
+ schema: _deepseek_ai_dsh_goal_goals_pause_result$schema
4346
+ },
4347
+ sourceLocation: {
4348
+ "file": "packages/goal/goal/src/index.ts",
4349
+ "line": 299,
4350
+ "column": 3
4351
+ }
4352
+ },
4353
+ {
4354
+ id: "@deepseek-ai/dsh-goal#goals/resume",
4355
+ service: "goals",
4356
+ namespace: "goals",
4357
+ method: "resume",
4358
+ invocation: { kind: "direct" },
4359
+ scope: {
4360
+ context: "agent",
4361
+ wire: "agentId"
4362
+ },
4363
+ parameters: [{
4364
+ name: "agent",
4365
+ wire: "agentId",
4366
+ source: "lookup",
4367
+ lookup: "agent",
4368
+ codec: {
4369
+ mode: "strict",
4370
+ typeSymbol: "@deepseek-ai/dsh-session/types#SessionId",
4371
+ schema: _deepseek_ai_dsh_goal_goals_resume_parameter_0$schema
4372
+ }
4373
+ }, {
4374
+ name: "ref",
4375
+ wire: "ref",
4376
+ source: "json",
4377
+ codec: {
4378
+ mode: "strict",
4379
+ typeSymbol: "@deepseek-ai/dsh-goal/client#GoalRef",
4380
+ schema: _deepseek_ai_dsh_goal_goals_resume_parameter_1$schema
4381
+ }
4382
+ }],
4383
+ result: {
4384
+ mode: "strict",
4385
+ typeSymbol: "@deepseek-ai/dsh-goal/client#GoalView",
4386
+ schema: _deepseek_ai_dsh_goal_goals_resume_result$schema
4387
+ },
4388
+ sourceLocation: {
4389
+ "file": "packages/goal/goal/src/index.ts",
4390
+ "line": 311,
4391
+ "column": 3
4392
+ }
4393
+ }
4394
+ ]
4395
+ };
4396
+ //#endregion
4397
+ //#region lib/types/client/index.js
4398
+ /** Platform-neutral assembly of generated Host Remote contributions. */
4399
+ /** Required service: the typed Client Remote contribution mount. */
4400
+ const inject = ["remote"];
4401
+ /**
4402
+ * Mount the Host capabilities explicitly selected for this Client assembly.
4403
+ * @param ctx - Client Cordis root carrying the typed API service.
4404
+ * @returns disposer after every selected Remote namespace is ready.
4405
+ */
4406
+ async function apply(ctx) {
4407
+ return await ctx.remote.$mount(TYPERT_REMOTE);
4408
+ }
4409
+ //#endregion
4410
+ exports.apply = apply;
4411
+ exports.inject = inject;
4412
+ return module.exports;
4413
+ }
4414
+ });
4415
+
4416
+ //# sourceMappingURL=client.js.map