dsh-run2skill 0.3.1 → 0.5.0-alpha.2

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 CHANGED
@@ -6,70 +6,14 @@ window.__ModuleLoader__.load({
6
6
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
7
7
  let react = require("react");
8
8
  let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
9
- //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
10
- var _a$1;
11
- function $constructor(name, initializer, params) {
12
- function init(inst, def) {
13
- if (!inst._zod) Object.defineProperty(inst, "_zod", {
14
- value: {
15
- def,
16
- constr: _,
17
- traits: /* @__PURE__ */ new Set()
18
- },
19
- enumerable: false
20
- });
21
- if (inst._zod.traits.has(name)) return;
22
- inst._zod.traits.add(name);
23
- initializer(inst, def);
24
- const proto = _.prototype;
25
- const keys = Object.keys(proto);
26
- for (let i = 0; i < keys.length; i++) {
27
- const k = keys[i];
28
- if (!(k in inst)) inst[k] = proto[k].bind(inst);
29
- }
30
- }
31
- const Parent = params?.Parent ?? Object;
32
- class Definition extends Parent {}
33
- Object.defineProperty(Definition, "name", { value: name });
34
- function _(def) {
35
- var _a;
36
- const inst = params?.Parent ? new Definition() : this;
37
- init(inst, def);
38
- (_a = inst._zod).deferred ?? (_a.deferred = []);
39
- for (const fn of inst._zod.deferred) fn();
40
- return inst;
41
- }
42
- Object.defineProperty(_, "init", { value: init });
43
- Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => {
44
- if (params?.Parent && inst instanceof params.Parent) return true;
45
- return inst?._zod?.traits?.has(name);
46
- } });
47
- Object.defineProperty(_, "name", { value: name });
48
- return _;
49
- }
50
- var $ZodAsyncError = class extends Error {
51
- constructor() {
52
- super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
53
- }
54
- };
55
- var $ZodEncodeError = class extends Error {
56
- constructor(name) {
57
- super(`Encountered unidirectional transform during encode: ${name}`);
58
- this.name = "ZodEncodeError";
59
- }
60
- };
61
- (_a$1 = globalThis).__zod_globalConfig ?? (_a$1.__zod_globalConfig = {});
62
- const globalConfig = globalThis.__zod_globalConfig;
63
- function config(newConfig) {
64
- if (newConfig) Object.assign(globalConfig, newConfig);
65
- return globalConfig;
66
- }
67
- //#endregion
68
- //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js
9
+ //#region node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/util.js
69
10
  function getEnumValues(entries) {
70
11
  const numericValues = Object.values(entries).filter((v) => typeof v === "number");
71
12
  return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
72
13
  }
14
+ function joinValues(array, separator = "|") {
15
+ return array.map((val) => stringifyPrimitive(val)).join(separator);
16
+ }
73
17
  function jsonStringifyReplacer(_, value) {
74
18
  if (typeof value === "bigint") return value.toString();
75
19
  return value;
@@ -94,7 +38,7 @@ window.__ModuleLoader__.load({
94
38
  function floatSafeRemainder(val, step) {
95
39
  const ratio = val / step;
96
40
  const roundedRatio = Math.round(ratio);
97
- const tolerance = Number.EPSILON * Math.max(Math.abs(ratio), 1);
41
+ const tolerance = 4 * Number.EPSILON * Math.max(Math.abs(ratio), 1);
98
42
  if (Math.abs(ratio - roundedRatio) < tolerance) return 0;
99
43
  return ratio - roundedRatio;
100
44
  }
@@ -197,18 +141,23 @@ window.__ModuleLoader__.load({
197
141
  };
198
142
  return params;
199
143
  }
144
+ function stringifyPrimitive(value) {
145
+ if (typeof value === "bigint") return value.toString() + "n";
146
+ if (typeof value === "string") return `"${value}"`;
147
+ return `${value}`;
148
+ }
200
149
  function optionalKeys(shape) {
201
150
  return Object.keys(shape).filter((k) => {
202
- return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
151
+ return shape[k]._zod.optin !== void 0 && shape[k]._zod.optout === "optional";
203
152
  });
204
153
  }
205
- const NUMBER_FORMAT_RANGES = {
154
+ const NUMBER_FORMAT_RANGES = /*@__PURE__*/ (() => ({
206
155
  safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
207
156
  int32: [-2147483648, 2147483647],
208
157
  uint32: [0, 4294967295],
209
158
  float32: [-34028234663852886e22, 34028234663852886e22],
210
159
  float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
211
- };
160
+ }))();
212
161
  function pick(schema, mask) {
213
162
  const currDef = schema._zod.def;
214
163
  const checks = currDef.checks;
@@ -216,10 +165,10 @@ window.__ModuleLoader__.load({
216
165
  return clone(schema, mergeDefs(schema._zod.def, {
217
166
  get shape() {
218
167
  const newShape = {};
219
- for (const key in mask) {
220
- if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`);
168
+ for (const key of Reflect.ownKeys(mask)) {
169
+ if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) throw new Error(`Unrecognized key: "${String(key)}"`);
221
170
  if (!mask[key]) continue;
222
- newShape[key] = currDef.shape[key];
171
+ assignProp(newShape, key, currDef.shape[key]);
223
172
  }
224
173
  assignProp(this, "shape", newShape);
225
174
  return newShape;
@@ -234,8 +183,8 @@ window.__ModuleLoader__.load({
234
183
  return clone(schema, mergeDefs(schema._zod.def, {
235
184
  get shape() {
236
185
  const newShape = { ...schema._zod.def.shape };
237
- for (const key in mask) {
238
- if (!(key in currDef.shape)) throw new Error(`Unrecognized key: "${key}"`);
186
+ for (const key of Reflect.ownKeys(mask)) {
187
+ if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) throw new Error(`Unrecognized key: "${String(key)}"`);
239
188
  if (!mask[key]) continue;
240
189
  delete newShape[key];
241
190
  }
@@ -250,7 +199,7 @@ window.__ModuleLoader__.load({
250
199
  const checks = schema._zod.def.checks;
251
200
  if (checks && checks.length > 0) {
252
201
  const existingShape = schema._zod.def.shape;
253
- 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.");
202
+ for (const key of Reflect.ownKeys(shape)) if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
254
203
  }
255
204
  return clone(schema, mergeDefs(schema._zod.def, { get shape() {
256
205
  const _shape = {
@@ -273,6 +222,7 @@ window.__ModuleLoader__.load({
273
222
  } }));
274
223
  }
275
224
  function merge(a, b) {
225
+ if (!b?._zod?.def) throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");
276
226
  if (a._zod.def.checks?.length) throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
277
227
  return clone(a, mergeDefs(a._zod.def, {
278
228
  get shape() {
@@ -289,22 +239,22 @@ window.__ModuleLoader__.load({
289
239
  checks: b._zod.def.checks ?? []
290
240
  }));
291
241
  }
292
- function partial(Class, schema, mask) {
242
+ function partial(Class, schema, mask, name = "partial") {
293
243
  const checks = schema._zod.def.checks;
294
- if (checks && checks.length > 0) throw new Error(".partial() cannot be used on object schemas containing refinements");
244
+ if (checks && checks.length > 0) throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
295
245
  return clone(schema, mergeDefs(schema._zod.def, {
296
246
  get shape() {
297
247
  const oldShape = schema._zod.def.shape;
298
248
  const shape = { ...oldShape };
299
- if (mask) for (const key in mask) {
300
- if (!(key in oldShape)) throw new Error(`Unrecognized key: "${key}"`);
249
+ if (mask) for (const key of Reflect.ownKeys(mask)) {
250
+ if (!Object.prototype.hasOwnProperty.call(oldShape, key)) throw new Error(`Unrecognized key: "${String(key)}"`);
301
251
  if (!mask[key]) continue;
302
252
  shape[key] = Class ? new Class({
303
253
  type: "optional",
304
254
  innerType: oldShape[key]
305
255
  }) : oldShape[key];
306
256
  }
307
- else for (const key in oldShape) shape[key] = Class ? new Class({
257
+ else for (const key of Reflect.ownKeys(oldShape)) shape[key] = Class ? new Class({
308
258
  type: "optional",
309
259
  innerType: oldShape[key]
310
260
  }) : oldShape[key];
@@ -318,15 +268,15 @@ window.__ModuleLoader__.load({
318
268
  return clone(schema, mergeDefs(schema._zod.def, { get shape() {
319
269
  const oldShape = schema._zod.def.shape;
320
270
  const shape = { ...oldShape };
321
- if (mask) for (const key in mask) {
322
- if (!(key in shape)) throw new Error(`Unrecognized key: "${key}"`);
271
+ if (mask) for (const key of Reflect.ownKeys(mask)) {
272
+ if (!Object.prototype.hasOwnProperty.call(shape, key)) throw new Error(`Unrecognized key: "${String(key)}"`);
323
273
  if (!mask[key]) continue;
324
274
  shape[key] = new Class({
325
275
  type: "nonoptional",
326
276
  innerType: oldShape[key]
327
277
  });
328
278
  }
329
- else for (const key in oldShape) shape[key] = new Class({
279
+ else for (const key of Reflect.ownKeys(oldShape)) shape[key] = new Class({
330
280
  type: "nonoptional",
331
281
  innerType: oldShape[key]
332
282
  });
@@ -355,19 +305,54 @@ window.__ModuleLoader__.load({
355
305
  function unwrapMessage(message) {
356
306
  return typeof message === "string" ? message : message?.message;
357
307
  }
308
+ function attachSchema(issues, start, inst) {
309
+ var _a;
310
+ for (let i = start; i < issues.length; i++) (_a = issues[i]).schema ?? (_a.schema = inst);
311
+ }
358
312
  function finalizeIssue(iss, ctx, config) {
359
- 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";
360
- const { inst: _inst, continue: _continue, input: _input, ...rest } = iss;
313
+ var _a;
314
+ const traits = iss.inst?._zod?.traits;
315
+ if (traits?.has("$ZodType")) {
316
+ if (traits.has("$ZodCheck")) (_a = iss).schema ?? (_a.schema = iss.inst);
317
+ else iss.schema = iss.inst;
318
+ }
319
+ const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : void 0;
320
+ const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(schemaError?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input";
321
+ const { inst: _inst, schema: _schema, continue: _continue, input: _input, ...rest } = iss;
361
322
  rest.path ?? (rest.path = []);
362
323
  rest.message = message;
363
324
  if (ctx?.reportInput) rest.input = _input;
364
325
  return rest;
365
326
  }
327
+ const highSurrogate = /[\uD800-\uDBFF]/;
328
+ function codePointLength(str) {
329
+ const units = str.length;
330
+ if (!highSurrogate.test(str)) return units;
331
+ let count = units;
332
+ for (let i = 0; i < units - 1; i++) if ((str.charCodeAt(i) & 64512) === 55296 && (str.charCodeAt(i + 1) & 64512) === 56320) {
333
+ count--;
334
+ i++;
335
+ }
336
+ return count;
337
+ }
366
338
  function getLengthableOrigin(input) {
367
339
  if (Array.isArray(input)) return "array";
368
340
  if (typeof input === "string") return "string";
369
341
  return "unknown";
370
342
  }
343
+ function parsedType(data) {
344
+ const t = typeof data;
345
+ switch (t) {
346
+ case "number": return Number.isNaN(data) ? "nan" : "number";
347
+ case "object": {
348
+ if (data === null) return "null";
349
+ if (Array.isArray(data)) return "array";
350
+ const obj = data;
351
+ if (obj && Object.getPrototypeOf(obj) !== Object.prototype && "constructor" in obj && obj.constructor) return obj.constructor.name;
352
+ }
353
+ }
354
+ return t;
355
+ }
371
356
  function issue(...args) {
372
357
  const [iss, input, inst] = args;
373
358
  if (typeof iss === "string") return {
@@ -378,33 +363,330 @@ window.__ModuleLoader__.load({
378
363
  };
379
364
  return { ...iss };
380
365
  }
381
- //#endregion
382
- //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.js
383
- const initializer$1 = (inst, def) => {
384
- inst.name = "$ZodError";
385
- Object.defineProperty(inst, "_zod", {
386
- value: inst._zod,
387
- enumerable: false
366
+ /**
367
+ * Installs a trait's members on its prototype. Each value builds that member for the instance on first read; the built value shadows the accessor as an own property, so a detached `const { parse } = schema` keeps working.
368
+ *
369
+ * Call this from a `proto` initializer, which runs once per prototype — never per instance.
370
+ */
371
+ function members(proto, table) {
372
+ for (const key in table) {
373
+ const desc = Object.getOwnPropertyDescriptor(table, key);
374
+ if (desc.get) Object.defineProperty(proto, key, {
375
+ ...desc,
376
+ enumerable: false
377
+ });
378
+ else defineBound(proto, key, desc.value);
379
+ }
380
+ }
381
+ /** Shadows a prototype member with an own value, so a getter that builds from the instance runs once. */
382
+ function own(inst, key, value, enumerable = true) {
383
+ Object.defineProperty(inst, key, {
384
+ configurable: true,
385
+ writable: true,
386
+ enumerable,
387
+ value
388
388
  });
389
- Object.defineProperty(inst, "issues", {
390
- value: def,
391
- enumerable: false
389
+ return value;
390
+ }
391
+ /** Like {@link own}, for a member that was never an own data property and has to stay out of `Object.keys`. */
392
+ function hide(inst, key, value) {
393
+ return own(inst, key, value, false);
394
+ }
395
+ function defineBound(proto, key, fn) {
396
+ Object.defineProperty(proto, key, {
397
+ configurable: true,
398
+ get() {
399
+ return this == null ? fn : own(this, key, fn.bind(this));
400
+ },
401
+ set(value) {
402
+ own(this, key, value);
403
+ }
392
404
  });
393
- inst.message = JSON.stringify(def, jsonStringifyReplacer, 2);
394
- Object.defineProperty(inst, "toString", {
395
- value: () => inst.message,
396
- enumerable: false
405
+ }
406
+ /** Returns the prototype to install on, or `undefined` if this group is already installed on it. */
407
+ function claim(inst, sentinel) {
408
+ const proto = Object.getPrototypeOf(inst);
409
+ return sentinel in proto ? void 0 : proto;
410
+ }
411
+ let installing;
412
+ let broke = false;
413
+ const breaker = {
414
+ configurable: true,
415
+ get() {
416
+ broke = true;
417
+ }
418
+ };
419
+ /**
420
+ * Installs a lazily-derived internal on the `_zod` prototype of `inst`'s
421
+ * constructor, computed from the internals object itself and cached there on
422
+ * first read. One accessor per constructor rather than one per instance.
423
+ */
424
+ function defineLazyInternal(inst, key, compute) {
425
+ const proto = Object.getPrototypeOf(inst._zod);
426
+ if (key in proto && installing !== inst._zod) {
427
+ installing = void 0;
428
+ return;
429
+ }
430
+ installing = inst._zod;
431
+ Object.defineProperty(proto, key, {
432
+ configurable: true,
433
+ get() {
434
+ Object.defineProperty(this, key, breaker);
435
+ const outer = broke;
436
+ broke = false;
437
+ try {
438
+ const value = compute(this);
439
+ if (broke) delete this[key];
440
+ else Object.defineProperty(this, key, {
441
+ configurable: true,
442
+ writable: true,
443
+ value
444
+ });
445
+ broke = broke || outer;
446
+ return value;
447
+ } catch (err) {
448
+ delete this[key];
449
+ broke = broke || outer;
450
+ throw err;
451
+ }
452
+ },
453
+ set(value) {
454
+ Object.defineProperty(this, key, {
455
+ configurable: true,
456
+ writable: true,
457
+ value
458
+ });
459
+ }
397
460
  });
461
+ }
462
+ /**
463
+ * Installs `key` on `inst`'s prototype, computed by `make` on first read and cached there as an own
464
+ * data property. One accessor per constructor rather than one per instance, because an own accessor
465
+ * puts every instance after the first into v8 dictionary mode. The key doubles as the sentinel.
466
+ */
467
+ function installLazyProp(inst, key, make, enumerable) {
468
+ const proto = claim(inst, key);
469
+ if (!proto) return;
470
+ Object.defineProperty(proto, key, {
471
+ configurable: true,
472
+ get() {
473
+ const desc = {
474
+ configurable: true,
475
+ writable: true,
476
+ enumerable,
477
+ value: void 0
478
+ };
479
+ Object.defineProperty(this, key, desc);
480
+ desc.value = make(this);
481
+ Object.defineProperty(this, key, desc);
482
+ return desc.value;
483
+ },
484
+ set(value) {
485
+ Object.defineProperty(this, key, {
486
+ configurable: true,
487
+ writable: true,
488
+ enumerable,
489
+ value
490
+ });
491
+ }
492
+ });
493
+ }
494
+ /** Marks the thunk `_catch` synthesises for a constant catch value. `Function.length` cannot tell that thunk from a user callback — rest and defaulted parameters both report arity 0 — and a user callback reads `ctx.error`, whose issues only finalize correctly against the caller's per-parse error map. Provenance can say what arity cannot. A plain string key rather than `Symbol.for`, whose call at module scope no bundler can prove pure — the same shape that anchored `urlCanParse` into every build. */
495
+ const CONSTANT_CATCH = "~constantCatch";
496
+ /** Wraps a constant catch value in a thunk tagged with {@link CONSTANT_CATCH}. */
497
+ function constantCatch(value) {
498
+ const fn = () => value;
499
+ fn[CONSTANT_CATCH] = true;
500
+ return fn;
501
+ }
502
+ //#endregion
503
+ //#region node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/core.js
504
+ var _a$1;
505
+ const _zodDesc$1 = {
506
+ value: void 0,
507
+ enumerable: false
508
+ };
509
+ let _E = "captureStackTrace" in Error ? Error : null;
510
+ function newError(Definition) {
511
+ const E = _E;
512
+ if (E) {
513
+ const saved = E.stackTraceLimit;
514
+ if (typeof saved === "number") {
515
+ try {
516
+ E.stackTraceLimit = 0;
517
+ } catch {
518
+ _E = null;
519
+ return new Definition();
520
+ }
521
+ try {
522
+ return new Definition();
523
+ } finally {
524
+ E.stackTraceLimit = saved;
525
+ }
526
+ }
527
+ }
528
+ return new Definition();
529
+ }
530
+ function $constructor(name, initializer, proto, params) {
531
+ const zodProto = {};
532
+ function Internals(def) {
533
+ this.def = def;
534
+ this.constr = _;
535
+ this.traits = /* @__PURE__ */ new Set();
536
+ }
537
+ Internals.prototype = zodProto;
538
+ const protoMembers = proto;
539
+ const initialized = protoMembers && /* @__PURE__ */ new WeakSet();
540
+ function init(inst, def) {
541
+ if (!inst._zod) {
542
+ _zodDesc$1.value = new Internals(def);
543
+ try {
544
+ Object.defineProperty(inst, "_zod", _zodDesc$1);
545
+ } finally {
546
+ _zodDesc$1.value = void 0;
547
+ }
548
+ }
549
+ if (inst._zod.traits.has(name)) return;
550
+ inst._zod.traits.add(name);
551
+ initializer(inst, def);
552
+ if (initialized) {
553
+ const own = Object.getPrototypeOf(inst);
554
+ const ctorProto = inst._zod.constr.prototype;
555
+ let up = own;
556
+ while (up && up !== ctorProto) up = Object.getPrototypeOf(up);
557
+ const target = up ?? own;
558
+ if (!initialized.has(target)) {
559
+ initialized.add(target);
560
+ members(target, protoMembers);
561
+ }
562
+ }
563
+ const proto = _.prototype;
564
+ for (const k in proto) {
565
+ if (!Object.prototype.hasOwnProperty.call(proto, k)) continue;
566
+ if (!(k in inst)) inst[k] = proto[k].bind(inst);
567
+ }
568
+ }
569
+ const Parent = params?.Parent ?? Object;
570
+ class Definition extends Parent {}
571
+ Object.defineProperty(Definition, "name", { value: name });
572
+ function _(def) {
573
+ const inst = params?.Parent ? newError(Definition) : this;
574
+ init(inst, def);
575
+ const deferred = inst._zod.deferred;
576
+ if (deferred) {
577
+ for (const fn of deferred) fn();
578
+ inst._zod.deferred = void 0;
579
+ }
580
+ const pp = globalThis.__zod_globalConfig?.postProcessor;
581
+ if (pp) pp(inst);
582
+ return inst;
583
+ }
584
+ Object.defineProperty(_, "init", { value: init });
585
+ Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => {
586
+ if (params?.Parent && inst instanceof params.Parent) return true;
587
+ return inst?._zod?.traits?.has(name);
588
+ } });
589
+ Object.defineProperty(_, "name", { value: name });
590
+ return _;
591
+ }
592
+ var $ZodAsyncError = class extends Error {
593
+ constructor() {
594
+ super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
595
+ }
596
+ };
597
+ var $ZodEncodeError = class extends Error {
598
+ constructor(name) {
599
+ super(`Encountered unidirectional transform during encode: ${name}`);
600
+ this.name = "ZodEncodeError";
601
+ }
602
+ };
603
+ (_a$1 = globalThis).__zod_globalConfig ?? (_a$1.__zod_globalConfig = {});
604
+ const globalConfig = globalThis.__zod_globalConfig;
605
+ function config(newConfig) {
606
+ if (newConfig) Object.assign(globalConfig, newConfig);
607
+ return globalConfig;
608
+ }
609
+ //#endregion
610
+ //#region node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/errors.js
611
+ function _getMessage() {
612
+ const internals = this._zod;
613
+ internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
614
+ return internals.message;
615
+ }
616
+ function _setMessage(value) {
617
+ this._zod.message = value;
618
+ }
619
+ const _messageDesc = {
620
+ get: _getMessage,
621
+ set: _setMessage,
622
+ enumerable: true,
623
+ configurable: true
624
+ };
625
+ const _zodDesc = {
626
+ value: void 0,
627
+ enumerable: false
628
+ };
629
+ const _issuesDesc = {
630
+ value: void 0,
631
+ enumerable: false
632
+ };
633
+ const _installedToString = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
634
+ const initializer$1 = (inst, def) => {
635
+ inst.name = "$ZodError";
636
+ _zodDesc.value = inst._zod;
637
+ Object.defineProperty(inst, "_zod", _zodDesc);
638
+ _issuesDesc.value = def;
639
+ Object.defineProperty(inst, "issues", _issuesDesc);
640
+ _zodDesc.value = void 0;
641
+ _issuesDesc.value = void 0;
642
+ Object.defineProperty(inst, "message", _messageDesc);
643
+ const proto = Object.getPrototypeOf(inst);
644
+ if (!_installedToString.has(proto)) {
645
+ _installedToString.add(proto);
646
+ Object.defineProperty(proto, "toString", {
647
+ configurable: true,
648
+ enumerable: false,
649
+ get() {
650
+ const value = () => this.message;
651
+ Object.defineProperty(this, "toString", {
652
+ value,
653
+ configurable: true,
654
+ writable: true
655
+ });
656
+ return value;
657
+ },
658
+ set(value) {
659
+ Object.defineProperty(this, "toString", {
660
+ value,
661
+ configurable: true,
662
+ writable: true
663
+ });
664
+ }
665
+ });
666
+ }
398
667
  };
399
668
  const $ZodError = $constructor("$ZodError", initializer$1);
400
- const $ZodRealError = $constructor("$ZodError", initializer$1, { Parent: Error });
669
+ const $ZodRealError = $constructor("$ZodError", initializer$1, void 0, { Parent: Error });
670
+ /** Get-or-create `obj[key]` as an own data property. A path segment naming an inherited member
671
+ * ("toString", "constructor") would otherwise read through to the prototype, and assigning
672
+ * "__proto__" would hit the setter instead of creating a key. */
673
+ function node(obj, key, make) {
674
+ if (!Object.prototype.hasOwnProperty.call(obj, key)) {
675
+ if (key === "__proto__") Object.defineProperty(obj, key, {
676
+ value: make(),
677
+ writable: true,
678
+ enumerable: true,
679
+ configurable: true
680
+ });
681
+ else obj[key] = make();
682
+ }
683
+ return obj[key];
684
+ }
401
685
  function flattenError(error, mapper = (issue) => issue.message) {
402
686
  const fieldErrors = {};
403
687
  const formErrors = [];
404
- for (const sub of error.issues) if (sub.path.length > 0) {
405
- fieldErrors[sub.path[0]] = fieldErrors[sub.path[0]] || [];
406
- fieldErrors[sub.path[0]].push(mapper(sub));
407
- } else formErrors.push(mapper(sub));
688
+ for (const sub of error.issues) if (sub.path.length > 0) node(fieldErrors, sub.path[0], () => []).push(mapper(sub));
689
+ else formErrors.push(mapper(sub));
408
690
  return {
409
691
  formErrors,
410
692
  fieldErrors
@@ -424,12 +706,21 @@ window.__ModuleLoader__.load({
424
706
  let i = 0;
425
707
  while (i < fullpath.length) {
426
708
  const el = fullpath[i];
427
- if (!(i === fullpath.length - 1)) curr[el] = curr[el] || { _errors: [] };
428
- else {
429
- curr[el] = curr[el] || { _errors: [] };
430
- curr[el]._errors.push(mapper(issue));
709
+ const terminal = i === fullpath.length - 1;
710
+ if (el === "_errors") {
711
+ if (terminal) curr._errors.push(mapper(issue));
712
+ i++;
713
+ continue;
431
714
  }
432
- curr = curr[el];
715
+ if (!Object.prototype.hasOwnProperty.call(curr, el)) Object.defineProperty(curr, el, {
716
+ value: { _errors: [] },
717
+ enumerable: true,
718
+ writable: true,
719
+ configurable: true
720
+ });
721
+ const node = curr[el];
722
+ if (terminal) node._errors.push(mapper(issue));
723
+ curr = node;
433
724
  i++;
434
725
  }
435
726
  }
@@ -439,40 +730,52 @@ window.__ModuleLoader__.load({
439
730
  return fieldErrors;
440
731
  }
441
732
  //#endregion
442
- //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/parse.js
443
- const _parse = (_Err) => (schema, value, _ctx, _params) => {
444
- const ctx = _ctx ? {
445
- ..._ctx,
446
- async: false
447
- } : { async: false };
448
- const result = schema._zod.run({
449
- value,
450
- issues: []
451
- }, ctx);
452
- if (result instanceof Promise) throw new $ZodAsyncError();
453
- if (result.issues.length) {
454
- const e = new ((_params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
455
- captureStackTrace(e, _params?.callee);
456
- throw e;
457
- }
458
- return result.value;
733
+ //#region node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/parse.js
734
+ function finalizeParams(callee, params) {
735
+ return {
736
+ callee: params?.callee ?? callee,
737
+ Err: params?.Err
738
+ };
739
+ }
740
+ const _parse = (_Err) => {
741
+ const fn = (schema, value, _ctx, _params) => {
742
+ const ctx = _ctx ? {
743
+ ..._ctx,
744
+ async: false
745
+ } : { async: false };
746
+ const result = schema._zod.run({
747
+ value,
748
+ issues: []
749
+ }, ctx);
750
+ if (result instanceof Promise) throw new $ZodAsyncError();
751
+ if (result.issues.length) {
752
+ const e = new ((_params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
753
+ captureStackTrace(e, _params?.callee ?? fn);
754
+ throw e;
755
+ }
756
+ return result.value;
757
+ };
758
+ return fn;
459
759
  };
460
- const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
461
- const ctx = _ctx ? {
462
- ..._ctx,
463
- async: true
464
- } : { async: true };
465
- let result = schema._zod.run({
466
- value,
467
- issues: []
468
- }, ctx);
469
- if (result instanceof Promise) result = await result;
470
- if (result.issues.length) {
471
- const e = new ((params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
472
- captureStackTrace(e, params?.callee);
473
- throw e;
474
- }
475
- return result.value;
760
+ const _parseAsync = (_Err) => {
761
+ const fn = async (schema, value, _ctx, params) => {
762
+ const ctx = _ctx ? {
763
+ ..._ctx,
764
+ async: true
765
+ } : { async: true };
766
+ let result = schema._zod.run({
767
+ value,
768
+ issues: []
769
+ }, ctx);
770
+ if (result instanceof Promise) result = await result;
771
+ if (result.issues.length) {
772
+ const e = new ((params?.Err) ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
773
+ captureStackTrace(e, params?.callee ?? fn);
774
+ throw e;
775
+ }
776
+ return result.value;
777
+ };
778
+ return fn;
476
779
  };
477
780
  const _safeParse = (_Err) => (schema, value, _ctx) => {
478
781
  const ctx = _ctx ? {
@@ -512,25 +815,41 @@ window.__ModuleLoader__.load({
512
815
  };
513
816
  };
514
817
  const safeParseAsync$1 = /* @__PURE__*/ _safeParseAsync($ZodRealError);
515
- const _encode = (_Err) => (schema, value, _ctx) => {
516
- const ctx = _ctx ? {
517
- ..._ctx,
518
- direction: "backward"
519
- } : { direction: "backward" };
520
- return _parse(_Err)(schema, value, ctx);
818
+ const _encode = (_Err) => {
819
+ const parse = _parse(_Err);
820
+ const fn = (schema, value, _ctx, _params) => {
821
+ const ctx = _ctx ? {
822
+ ..._ctx,
823
+ direction: "backward"
824
+ } : { direction: "backward" };
825
+ return parse(schema, value, ctx, finalizeParams(fn, _params));
826
+ };
827
+ return fn;
521
828
  };
522
- const _decode = (_Err) => (schema, value, _ctx) => {
523
- return _parse(_Err)(schema, value, _ctx);
829
+ const _decode = (_Err) => {
830
+ const parse = _parse(_Err);
831
+ const fn = (schema, value, _ctx, _params) => {
832
+ return parse(schema, value, _ctx, finalizeParams(fn, _params));
833
+ };
834
+ return fn;
524
835
  };
525
- const _encodeAsync = (_Err) => async (schema, value, _ctx) => {
526
- const ctx = _ctx ? {
527
- ..._ctx,
528
- direction: "backward"
529
- } : { direction: "backward" };
530
- return _parseAsync(_Err)(schema, value, ctx);
836
+ const _encodeAsync = (_Err) => {
837
+ const parseAsync = _parseAsync(_Err);
838
+ const fn = async (schema, value, _ctx, _params) => {
839
+ const ctx = _ctx ? {
840
+ ..._ctx,
841
+ direction: "backward"
842
+ } : { direction: "backward" };
843
+ return await parseAsync(schema, value, ctx, finalizeParams(fn, _params));
844
+ };
845
+ return fn;
531
846
  };
532
- const _decodeAsync = (_Err) => async (schema, value, _ctx) => {
533
- return _parseAsync(_Err)(schema, value, _ctx);
847
+ const _decodeAsync = (_Err) => {
848
+ const parseAsync = _parseAsync(_Err);
849
+ const fn = async (schema, value, _ctx, _params) => {
850
+ return await parseAsync(schema, value, _ctx, finalizeParams(fn, _params));
851
+ };
852
+ return fn;
534
853
  };
535
854
  const _safeEncode = (_Err) => (schema, value, _ctx) => {
536
855
  const ctx = _ctx ? {
@@ -553,7 +872,7 @@ window.__ModuleLoader__.load({
553
872
  return _safeParseAsync(_Err)(schema, value, _ctx);
554
873
  };
555
874
  //#endregion
556
- //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/regexes.js
875
+ //#region node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/regexes.js
557
876
  /**
558
877
  * @deprecated CUID v1 is deprecated by its authors due to information leakage
559
878
  * (timestamps embedded in the id). Use {@link cuid2} instead.
@@ -561,12 +880,15 @@ window.__ModuleLoader__.load({
561
880
  */
562
881
  const cuid = /^[cC][0-9a-z]{6,}$/;
563
882
  const cuid2 = /^[0-9a-z]+$/;
564
- const ulid = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/;
883
+ const ulid = /^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/;
565
884
  const xid = /^[0-9a-vA-V]{20}$/;
566
885
  const ksuid = /^[A-Za-z0-9]{27}$/;
567
886
  const nanoid = /^[a-zA-Z0-9_-]{21}$/;
887
+ function nanoidOfLength(length) {
888
+ return new RegExp(`^[a-zA-Z0-9_-]{${length}}$`);
889
+ }
568
890
  /** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */
569
- 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)?)?)$/;
891
+ const duration = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;
570
892
  /** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */
571
893
  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})$/;
572
894
  /** Returns a regex for validating an RFC 9562/4122 UUID.
@@ -578,33 +900,41 @@ window.__ModuleLoader__.load({
578
900
  };
579
901
  /** Practical email validation */
580
902
  const email = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
581
- const _emoji$1 = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
903
+ const _emoji$1 = `^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
582
904
  function emoji() {
583
905
  return new RegExp(_emoji$1, "u");
584
906
  }
585
907
  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])$/;
586
908
  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}|:))$/;
587
909
  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])$/;
588
- 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])$/;
910
+ const cidrv6 = /^(([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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
589
911
  const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
590
912
  const base64url = /^[A-Za-z0-9_-]*$/;
591
913
  const httpProtocol = /^https?$/;
592
914
  const e164 = /^\+[1-9]\d{6,14}$/;
593
915
  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])))`;
594
- const date$1 = /*@__PURE__*/ new RegExp(`^${dateSource}$`);
916
+ /** Anchors a pattern source. The interpolation lives here rather than at the call site because
917
+ * esbuild will not drop a `@__PURE__` call whose own argument interpolates a variable, but it
918
+ * will drop `anchor(dateSource)`. Keeping it inline pinned `date` into every bundle. */
919
+ function anchor(source) {
920
+ return new RegExp(`^${source}$`);
921
+ }
922
+ const date = /*@__PURE__*/ anchor(dateSource);
595
923
  function timeSource(args) {
596
924
  const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
597
- 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+)?)?`;
925
+ return typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : args.seconds ? `${hhmm}:[0-5]\\d(?:\\.\\d+)?` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
598
926
  }
599
- function time$1(args) {
927
+ function time(args) {
600
928
  return new RegExp(`^${timeSource(args)}$`);
601
929
  }
602
- function datetime$1(args) {
603
- const time = timeSource({ precision: args.precision });
930
+ function datetime(args) {
604
931
  const opts = ["Z"];
605
- if (args.local) opts.push("");
606
932
  if (args.offset) opts.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);
607
- const timeRegex = `${time}(?:${opts.join("|")})`;
933
+ const qualified = `${timeSource({
934
+ precision: args.precision,
935
+ seconds: true
936
+ })}(?:${opts.join("|")})`;
937
+ const timeRegex = args.local ? `${qualified}|${timeSource({ precision: args.precision })}` : qualified;
608
938
  return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
609
939
  }
610
940
  const string$1 = (params) => {
@@ -614,16 +944,22 @@ window.__ModuleLoader__.load({
614
944
  const integer = /^-?\d+$/;
615
945
  const number$1 = /^-?\d+(?:\.\d+)?$/;
616
946
  const boolean$1 = /^(?:true|false)$/i;
947
+ const _null$2 = /^null$/i;
617
948
  const lowercase = /^[^A-Z]*$/;
618
949
  const uppercase = /^[^a-z]*$/;
619
950
  //#endregion
620
- //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/checks.js
951
+ //#region node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/checks.js
621
952
  const $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
622
953
  var _a;
623
954
  inst._zod ?? (inst._zod = {});
624
955
  inst._zod.def = def;
625
956
  (_a = inst._zod).onattach ?? (_a.onattach = []);
626
957
  });
958
+ /** Default `when` for length-based checks: run only on non-nullish values with a `length`. */
959
+ const _whenHasLength = (payload) => {
960
+ const val = payload.value;
961
+ return !nullish(val) && val.length !== void 0;
962
+ };
627
963
  const numericOriginMap = {
628
964
  number: "number",
629
965
  bigint: "bigint",
@@ -643,7 +979,7 @@ window.__ModuleLoader__.load({
643
979
  inst._zod.check = (payload) => {
644
980
  if (def.inclusive ? payload.value <= def.value : payload.value < def.value) return;
645
981
  payload.issues.push({
646
- origin,
982
+ origin: numericOriginMap[typeof payload.value] ?? origin,
647
983
  code: "too_big",
648
984
  maximum: typeof def.value === "object" ? def.value.getTime() : def.value,
649
985
  input: payload.value,
@@ -667,7 +1003,7 @@ window.__ModuleLoader__.load({
667
1003
  inst._zod.check = (payload) => {
668
1004
  if (def.inclusive ? payload.value >= def.value : payload.value > def.value) return;
669
1005
  payload.issues.push({
670
- origin,
1006
+ origin: numericOriginMap[typeof payload.value] ?? origin,
671
1007
  code: "too_small",
672
1008
  minimum: typeof def.value === "object" ? def.value.getTime() : def.value,
673
1009
  input: payload.value,
@@ -685,7 +1021,7 @@ window.__ModuleLoader__.load({
685
1021
  });
686
1022
  inst._zod.check = (payload) => {
687
1023
  if (typeof payload.value !== typeof def.value) throw new Error("Cannot mix number and bigint in multiple_of check.");
688
- if (typeof payload.value === "bigint" ? payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0) return;
1024
+ if (typeof payload.value === "bigint" ? def.value !== BigInt(0) && payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0) return;
689
1025
  payload.issues.push({
690
1026
  origin: typeof payload.value,
691
1027
  code: "not_multiple_of",
@@ -770,17 +1106,15 @@ window.__ModuleLoader__.load({
770
1106
  const $ZodCheckMaxLength = /*@__PURE__*/ $constructor("$ZodCheckMaxLength", (inst, def) => {
771
1107
  var _a;
772
1108
  $ZodCheck.init(inst, def);
773
- (_a = inst._zod.def).when ?? (_a.when = (payload) => {
774
- const val = payload.value;
775
- return !nullish(val) && val.length !== void 0;
776
- });
1109
+ (_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
777
1110
  inst._zod.onattach.push((inst) => {
778
1111
  const curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
779
1112
  if (def.maximum < curr) inst._zod.bag.maximum = def.maximum;
780
1113
  });
781
1114
  inst._zod.check = (payload) => {
782
1115
  const input = payload.value;
783
- if (input.length <= def.maximum) return;
1116
+ const units = input.length;
1117
+ if ((typeof input === "string" && units > def.maximum ? codePointLength(input) : units) <= def.maximum) return;
784
1118
  const origin = getLengthableOrigin(input);
785
1119
  payload.issues.push({
786
1120
  origin,
@@ -796,17 +1130,15 @@ window.__ModuleLoader__.load({
796
1130
  const $ZodCheckMinLength = /*@__PURE__*/ $constructor("$ZodCheckMinLength", (inst, def) => {
797
1131
  var _a;
798
1132
  $ZodCheck.init(inst, def);
799
- (_a = inst._zod.def).when ?? (_a.when = (payload) => {
800
- const val = payload.value;
801
- return !nullish(val) && val.length !== void 0;
802
- });
1133
+ (_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
803
1134
  inst._zod.onattach.push((inst) => {
804
1135
  const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
805
1136
  if (def.minimum > curr) inst._zod.bag.minimum = def.minimum;
806
1137
  });
807
1138
  inst._zod.check = (payload) => {
808
1139
  const input = payload.value;
809
- if (input.length >= def.minimum) return;
1140
+ const units = input.length;
1141
+ if ((typeof input === "string" && units >= def.minimum && units < def.minimum * 2 ? codePointLength(input) : units) >= def.minimum) return;
810
1142
  const origin = getLengthableOrigin(input);
811
1143
  payload.issues.push({
812
1144
  origin,
@@ -822,10 +1154,7 @@ window.__ModuleLoader__.load({
822
1154
  const $ZodCheckLengthEquals = /*@__PURE__*/ $constructor("$ZodCheckLengthEquals", (inst, def) => {
823
1155
  var _a;
824
1156
  $ZodCheck.init(inst, def);
825
- (_a = inst._zod.def).when ?? (_a.when = (payload) => {
826
- const val = payload.value;
827
- return !nullish(val) && val.length !== void 0;
828
- });
1157
+ (_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
829
1158
  inst._zod.onattach.push((inst) => {
830
1159
  const bag = inst._zod.bag;
831
1160
  bag.minimum = def.length;
@@ -834,7 +1163,8 @@ window.__ModuleLoader__.load({
834
1163
  });
835
1164
  inst._zod.check = (payload) => {
836
1165
  const input = payload.value;
837
- const length = input.length;
1166
+ const units = input.length;
1167
+ const length = typeof input === "string" && units >= def.length && units <= def.length * 2 ? codePointLength(input) : units;
838
1168
  if (length === def.length) return;
839
1169
  const origin = getLengthableOrigin(input);
840
1170
  const tooBig = length > def.length;
@@ -908,7 +1238,7 @@ window.__ModuleLoader__.load({
908
1238
  const $ZodCheckIncludes = /*@__PURE__*/ $constructor("$ZodCheckIncludes", (inst, def) => {
909
1239
  $ZodCheck.init(inst, def);
910
1240
  const escapedRegex = escapeRegex(def.includes);
911
- const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position}}${escapedRegex}` : escapedRegex);
1241
+ const pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);
912
1242
  def.pattern = pattern;
913
1243
  inst._zod.onattach.push((inst) => {
914
1244
  const bag = inst._zod.bag;
@@ -979,12 +1309,13 @@ window.__ModuleLoader__.load({
979
1309
  };
980
1310
  });
981
1311
  //#endregion
982
- //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/doc.js
1312
+ //#region node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/doc.js
983
1313
  var Doc = class {
984
- constructor(args = []) {
1314
+ constructor(args = [], closed = {}) {
985
1315
  this.content = [];
986
1316
  this.indent = 0;
987
- if (this) this.args = args;
1317
+ this.args = args;
1318
+ this.closed = closed;
988
1319
  }
989
1320
  indented(fn) {
990
1321
  this.indent += 1;
@@ -1004,28 +1335,27 @@ window.__ModuleLoader__.load({
1004
1335
  }
1005
1336
  compile() {
1006
1337
  const F = Function;
1007
- const args = this?.args;
1008
- const lines = [...(this?.content ?? [``]).map((x) => ` ${x}`)];
1009
- return new F(...args, lines.join("\n"));
1338
+ const content = this?.content ?? [``];
1339
+ return new F(...Object.keys(this.closed), `return function (${this.args.join(", ")}) {\n${content.join("\n")}\n};`)(...Object.values(this.closed));
1010
1340
  }
1011
1341
  };
1012
1342
  //#endregion
1013
- //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/versions.js
1343
+ //#region node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/versions.js
1014
1344
  const version = {
1015
1345
  major: 4,
1016
- minor: 4,
1017
- patch: 3
1346
+ minor: 5,
1347
+ patch: 4
1018
1348
  };
1019
1349
  //#endregion
1020
- //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/schemas.js
1350
+ //#region node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/schemas.js
1021
1351
  const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
1022
1352
  var _a;
1023
1353
  inst ?? (inst = {});
1024
1354
  inst._zod.def = def;
1025
1355
  inst._zod.bag = inst._zod.bag || {};
1026
1356
  inst._zod.version = version;
1027
- const checks = [...inst._zod.def.checks ?? []];
1028
- if (inst._zod.traits.has("$ZodCheck")) checks.unshift(inst);
1357
+ const defChecks = inst._zod.def.checks;
1358
+ const checks = inst._zod.traits.has("$ZodCheck") ? [inst, ...defChecks ?? []] : defChecks?.length ? [...defChecks] : [];
1029
1359
  for (const ch of checks) for (const fn of ch._zod.onattach) fn(inst);
1030
1360
  if (checks.length === 0) {
1031
1361
  (_a = inst._zod).deferred ?? (_a.deferred = []);
@@ -1034,6 +1364,7 @@ window.__ModuleLoader__.load({
1034
1364
  });
1035
1365
  } else {
1036
1366
  const runChecks = (payload, checks, ctx) => {
1367
+ if (payload.memo) return payload;
1037
1368
  let isAborted = aborted(payload);
1038
1369
  let asyncResult;
1039
1370
  for (const ch of checks) {
@@ -1047,10 +1378,12 @@ window.__ModuleLoader__.load({
1047
1378
  if (asyncResult || _ instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
1048
1379
  await _;
1049
1380
  if (payload.issues.length === currLen) return;
1381
+ attachSchema(payload.issues, currLen, inst);
1050
1382
  if (!isAborted) isAborted = aborted(payload, currLen);
1051
1383
  });
1052
1384
  else {
1053
1385
  if (payload.issues.length === currLen) continue;
1386
+ attachSchema(payload.issues, currLen, inst);
1054
1387
  if (!isAborted) isAborted = aborted(payload, currLen);
1055
1388
  }
1056
1389
  }
@@ -1094,19 +1427,29 @@ window.__ModuleLoader__.load({
1094
1427
  return runChecks(result, checks, ctx);
1095
1428
  };
1096
1429
  }
1097
- defineLazy(inst, "~standard", () => ({
1430
+ }, {
1431
+ get "~standard"() {
1432
+ return hide(this, "~standard", standardProps(this));
1433
+ },
1434
+ set "~standard"(value) {
1435
+ own(this, "~standard", value);
1436
+ }
1437
+ });
1438
+ /** The Standard Schema surface for `inst`. Shared so wrappers can extend it without forcing it. */
1439
+ const toStandardResult = (r) => r.success ? { value: r.data } : { issues: r.error?.issues };
1440
+ function standardProps(inst) {
1441
+ return {
1098
1442
  validate: (value) => {
1099
1443
  try {
1100
- const r = safeParse$1(inst, value);
1101
- return r.success ? { value: r.data } : { issues: r.error?.issues };
1444
+ return toStandardResult(safeParse$1(inst, value));
1102
1445
  } catch (_) {
1103
- return safeParseAsync$1(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
1446
+ return safeParseAsync$1(inst, value).then(toStandardResult);
1104
1447
  }
1105
1448
  },
1106
1449
  vendor: "zod",
1107
1450
  version: 1
1108
- }));
1109
- });
1451
+ };
1452
+ }
1110
1453
  const $ZodString = /*@__PURE__*/ $constructor("$ZodString", (inst, def) => {
1111
1454
  $ZodType.init(inst, def);
1112
1455
  inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$1(inst._zod.bag);
@@ -1153,51 +1496,74 @@ window.__ModuleLoader__.load({
1153
1496
  def.pattern ?? (def.pattern = email);
1154
1497
  $ZodStringFormat.init(inst, def);
1155
1498
  });
1499
+ /** Parses a URL for `$ZodURL`, applying the one guard the URL constructor cannot express. Returns the parsed URL, or a code naming the stage that rejected it — the runtime needs that distinction to pick an issue note, and compiled code only needs to know it is not a URL. */
1500
+ function parseURLObject(trimmed, def) {
1501
+ if (!def.normalize && def.protocol?.source === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) return 1;
1502
+ try {
1503
+ return new URL(trimmed);
1504
+ } catch {
1505
+ return 2;
1506
+ }
1507
+ }
1508
+ const asciiTabOrNewline = /[\t\n\r]/g;
1509
+ /** The URL parser deletes every ASCII tab, LF and CR from its input before it parses, so `new URL("https://exa\nmple.com")` reports on `example.com`. Applying the same deletion to the returned value closes the half of that divergence which can move the host; the parser's other rewrite, stripping C0 controls at the edges, cannot. */
1510
+ function stripTabAndNewline(value) {
1511
+ return value.replace(asciiTabOrNewline, "");
1512
+ }
1513
+ function urlHostnameOk(url, hostname) {
1514
+ hostname.lastIndex = 0;
1515
+ return hostname.test(url.hostname);
1516
+ }
1517
+ function urlProtocolOk(url, protocol) {
1518
+ protocol.lastIndex = 0;
1519
+ return protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol);
1520
+ }
1156
1521
  const $ZodURL = /*@__PURE__*/ $constructor("$ZodURL", (inst, def) => {
1157
1522
  $ZodStringFormat.init(inst, def);
1158
1523
  inst._zod.check = (payload) => {
1159
1524
  try {
1160
1525
  const trimmed = payload.value.trim();
1161
- if (!def.normalize && def.protocol?.source === httpProtocol.source) {
1162
- if (!/^https?:\/\//i.test(trimmed)) {
1163
- payload.issues.push({
1164
- code: "invalid_format",
1165
- format: "url",
1166
- note: "Invalid URL format",
1167
- input: payload.value,
1168
- inst,
1169
- continue: !def.abort
1170
- });
1171
- return;
1172
- }
1173
- }
1174
- const url = new URL(trimmed);
1175
- if (def.hostname) {
1176
- def.hostname.lastIndex = 0;
1177
- if (!def.hostname.test(url.hostname)) payload.issues.push({
1526
+ const url = parseURLObject(trimmed, def);
1527
+ if (url === 1) {
1528
+ payload.issues.push({
1178
1529
  code: "invalid_format",
1179
1530
  format: "url",
1180
- note: "Invalid hostname",
1181
- pattern: def.hostname.source,
1531
+ note: "Invalid URL format",
1182
1532
  input: payload.value,
1183
1533
  inst,
1184
1534
  continue: !def.abort
1185
1535
  });
1536
+ return;
1186
1537
  }
1187
- if (def.protocol) {
1188
- def.protocol.lastIndex = 0;
1189
- if (!def.protocol.test(url.protocol.endsWith(":") ? url.protocol.slice(0, -1) : url.protocol)) payload.issues.push({
1538
+ if (url === 2) {
1539
+ payload.issues.push({
1190
1540
  code: "invalid_format",
1191
1541
  format: "url",
1192
- note: "Invalid protocol",
1193
- pattern: def.protocol.source,
1194
1542
  input: payload.value,
1195
1543
  inst,
1196
1544
  continue: !def.abort
1197
1545
  });
1546
+ return;
1198
1547
  }
1199
- if (def.normalize) payload.value = url.href;
1200
- else payload.value = trimmed;
1548
+ if (def.hostname && !urlHostnameOk(url, def.hostname)) payload.issues.push({
1549
+ code: "invalid_format",
1550
+ format: "url",
1551
+ note: "Invalid hostname",
1552
+ pattern: def.hostname.source,
1553
+ input: payload.value,
1554
+ inst,
1555
+ continue: !def.abort
1556
+ });
1557
+ if (def.protocol && !urlProtocolOk(url, def.protocol)) payload.issues.push({
1558
+ code: "invalid_format",
1559
+ format: "url",
1560
+ note: "Invalid protocol",
1561
+ pattern: def.protocol.source,
1562
+ input: payload.value,
1563
+ inst,
1564
+ continue: !def.abort
1565
+ });
1566
+ payload.value = def.normalize ? url.href : stripTabAndNewline(trimmed);
1201
1567
  return;
1202
1568
  } catch (_) {
1203
1569
  payload.issues.push({
@@ -1215,7 +1581,8 @@ window.__ModuleLoader__.load({
1215
1581
  $ZodStringFormat.init(inst, def);
1216
1582
  });
1217
1583
  const $ZodNanoID = /*@__PURE__*/ $constructor("$ZodNanoID", (inst, def) => {
1218
- def.pattern ?? (def.pattern = nanoid);
1584
+ if (def.length !== void 0 && (!Number.isInteger(def.length) || def.length < 1)) throw new Error(`Invalid nanoid length: ${def.length}`);
1585
+ def.pattern ?? (def.pattern = def.length === void 0 ? nanoid : nanoidOfLength(def.length));
1219
1586
  $ZodStringFormat.init(inst, def);
1220
1587
  });
1221
1588
  /**
@@ -1244,19 +1611,25 @@ window.__ModuleLoader__.load({
1244
1611
  $ZodStringFormat.init(inst, def);
1245
1612
  });
1246
1613
  const $ZodISODateTime = /*@__PURE__*/ $constructor("$ZodISODateTime", (inst, def) => {
1247
- def.pattern ?? (def.pattern = datetime$1(def));
1614
+ def.pattern ?? (def.pattern = datetime(def));
1248
1615
  $ZodStringFormat.init(inst, def);
1616
+ if (def.local || def.precision === -1) {
1617
+ inst._zod.bag.laxFormat = true;
1618
+ inst._zod.onattach.push((s) => {
1619
+ s._zod.bag.laxFormat = true;
1620
+ });
1621
+ }
1249
1622
  });
1250
1623
  const $ZodISODate = /*@__PURE__*/ $constructor("$ZodISODate", (inst, def) => {
1251
- def.pattern ?? (def.pattern = date$1);
1624
+ def.pattern ?? (def.pattern = date);
1252
1625
  $ZodStringFormat.init(inst, def);
1253
1626
  });
1254
1627
  const $ZodISOTime = /*@__PURE__*/ $constructor("$ZodISOTime", (inst, def) => {
1255
- def.pattern ?? (def.pattern = time$1(def));
1628
+ def.pattern ?? (def.pattern = time(def));
1256
1629
  $ZodStringFormat.init(inst, def);
1257
1630
  });
1258
1631
  const $ZodISODuration = /*@__PURE__*/ $constructor("$ZodISODuration", (inst, def) => {
1259
- def.pattern ?? (def.pattern = duration$1);
1632
+ def.pattern ?? (def.pattern = duration);
1260
1633
  $ZodStringFormat.init(inst, def);
1261
1634
  });
1262
1635
  const $ZodIPv4 = /*@__PURE__*/ $constructor("$ZodIPv4", (inst, def) => {
@@ -1264,50 +1637,56 @@ window.__ModuleLoader__.load({
1264
1637
  $ZodStringFormat.init(inst, def);
1265
1638
  inst._zod.bag.format = `ipv4`;
1266
1639
  });
1640
+ /** An IPv6 address is written with hex digits, colons and dots, and nothing else. The guard is what makes the check below an IPv6 check: `new URL("http://[...]")` parses an authority, not an address, so `@` and `\` re-delimit it and `"::@1\\"` validates against the host `0.0.0.1`. The URL parser also deletes ASCII tab, LF and CR rather than failing, which is how `"::1\n"` validated as `::1`. */
1641
+ const ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
1642
+ function isValidIPv6(value) {
1643
+ if (!ipv6Alphabet.test(value)) return false;
1644
+ try {
1645
+ new URL(`http://[${value}]`);
1646
+ return true;
1647
+ } catch {
1648
+ return false;
1649
+ }
1650
+ }
1267
1651
  const $ZodIPv6 = /*@__PURE__*/ $constructor("$ZodIPv6", (inst, def) => {
1268
1652
  def.pattern ?? (def.pattern = ipv6);
1269
1653
  $ZodStringFormat.init(inst, def);
1270
1654
  inst._zod.bag.format = `ipv6`;
1271
1655
  inst._zod.check = (payload) => {
1272
- try {
1273
- new URL(`http://[${payload.value}]`);
1274
- } catch {
1275
- payload.issues.push({
1276
- code: "invalid_format",
1277
- format: "ipv6",
1278
- input: payload.value,
1279
- inst,
1280
- continue: !def.abort
1281
- });
1282
- }
1656
+ if (!isValidIPv6(payload.value)) payload.issues.push({
1657
+ code: "invalid_format",
1658
+ format: "ipv6",
1659
+ input: payload.value,
1660
+ inst,
1661
+ continue: !def.abort
1662
+ });
1283
1663
  };
1284
1664
  });
1285
1665
  const $ZodCIDRv4 = /*@__PURE__*/ $constructor("$ZodCIDRv4", (inst, def) => {
1286
1666
  def.pattern ?? (def.pattern = cidrv4);
1287
1667
  $ZodStringFormat.init(inst, def);
1288
1668
  });
1669
+ function isValidCIDRv6(value) {
1670
+ const parts = value.split("/");
1671
+ if (parts.length !== 2) return false;
1672
+ const [address, prefix] = parts;
1673
+ if (!prefix) return false;
1674
+ const prefixNum = Number(prefix);
1675
+ if (`${prefixNum}` !== prefix) return false;
1676
+ if (prefixNum < 0 || prefixNum > 128) return false;
1677
+ return isValidIPv6(address);
1678
+ }
1289
1679
  const $ZodCIDRv6 = /*@__PURE__*/ $constructor("$ZodCIDRv6", (inst, def) => {
1290
1680
  def.pattern ?? (def.pattern = cidrv6);
1291
1681
  $ZodStringFormat.init(inst, def);
1292
1682
  inst._zod.check = (payload) => {
1293
- const parts = payload.value.split("/");
1294
- try {
1295
- if (parts.length !== 2) throw new Error();
1296
- const [address, prefix] = parts;
1297
- if (!prefix) throw new Error();
1298
- const prefixNum = Number(prefix);
1299
- if (`${prefixNum}` !== prefix) throw new Error();
1300
- if (prefixNum < 0 || prefixNum > 128) throw new Error();
1301
- new URL(`http://[${address}]`);
1302
- } catch {
1303
- payload.issues.push({
1304
- code: "invalid_format",
1305
- format: "cidrv6",
1306
- input: payload.value,
1307
- inst,
1308
- continue: !def.abort
1309
- });
1310
- }
1683
+ if (!isValidCIDRv6(payload.value)) payload.issues.push({
1684
+ code: "invalid_format",
1685
+ format: "cidrv6",
1686
+ input: payload.value,
1687
+ inst,
1688
+ continue: !def.abort
1689
+ });
1311
1690
  };
1312
1691
  });
1313
1692
  function isValidBase64(data) {
@@ -1397,7 +1776,7 @@ window.__ModuleLoader__.load({
1397
1776
  } catch (_) {}
1398
1777
  const input = payload.value;
1399
1778
  if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) return payload;
1400
- const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : void 0 : void 0;
1779
+ const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? String(input) : void 0 : void 0;
1401
1780
  payload.issues.push({
1402
1781
  expected: "number",
1403
1782
  code: "invalid_type",
@@ -1422,7 +1801,23 @@ window.__ModuleLoader__.load({
1422
1801
  const input = payload.value;
1423
1802
  if (typeof input === "boolean") return payload;
1424
1803
  payload.issues.push({
1425
- expected: "boolean",
1804
+ expected: "boolean",
1805
+ code: "invalid_type",
1806
+ input,
1807
+ inst
1808
+ });
1809
+ return payload;
1810
+ };
1811
+ });
1812
+ const $ZodNull = /*@__PURE__*/ $constructor("$ZodNull", (inst, def) => {
1813
+ $ZodType.init(inst, def);
1814
+ inst._zod.pattern = _null$2;
1815
+ inst._zod.values = /* @__PURE__ */ new Set([null]);
1816
+ inst._zod.parse = (payload, _ctx) => {
1817
+ const input = payload.value;
1818
+ if (input === null) return payload;
1819
+ payload.issues.push({
1820
+ expected: "null",
1426
1821
  code: "invalid_type",
1427
1822
  input,
1428
1823
  inst
@@ -1452,6 +1847,8 @@ window.__ModuleLoader__.load({
1452
1847
  }
1453
1848
  const $ZodArray = /*@__PURE__*/ $constructor("$ZodArray", (inst, def) => {
1454
1849
  $ZodType.init(inst, def);
1850
+ const memo = globalConfig.memoizer;
1851
+ memo?.attach(inst);
1455
1852
  inst._zod.parse = (payload, ctx) => {
1456
1853
  const input = payload.value;
1457
1854
  if (!Array.isArray(input)) {
@@ -1463,7 +1860,7 @@ window.__ModuleLoader__.load({
1463
1860
  });
1464
1861
  return payload;
1465
1862
  }
1466
- payload.value = Array(input.length);
1863
+ payload.value = memo ? memo.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);
1467
1864
  const proms = [];
1468
1865
  for (let i = 0; i < input.length; i++) {
1469
1866
  const item = input[i];
@@ -1478,13 +1875,15 @@ window.__ModuleLoader__.load({
1478
1875
  return payload;
1479
1876
  };
1480
1877
  });
1481
- function handlePropertyResult(result, final, key, input, isOptionalIn, isOptionalOut) {
1878
+ function handlePropertyResult(result, final, key, input, optin, optout) {
1482
1879
  const isPresent = key in input;
1880
+ const isOptionalOut = optout === "optional";
1881
+ if (!isPresent && isOptionalOut && optin === "optional") return;
1483
1882
  if (result.issues.length) {
1484
- if (isOptionalIn && isOptionalOut && !isPresent) return;
1883
+ if (optin !== void 0 && isOptionalOut && !isPresent) return;
1485
1884
  final.issues.push(...prefixIssues(key, result.issues));
1486
1885
  }
1487
- if (!isPresent && !isOptionalIn) {
1886
+ if (!isPresent && optin === void 0) {
1488
1887
  if (!result.issues.length) final.issues.push({
1489
1888
  code: "invalid_type",
1490
1889
  expected: "nonoptional",
@@ -1497,13 +1896,18 @@ window.__ModuleLoader__.load({
1497
1896
  if (isPresent) final.value[key] = void 0;
1498
1897
  } else final.value[key] = result.value;
1499
1898
  }
1899
+ const NO_SYMBOL_KEYS = [];
1500
1900
  function normalizeDef(def) {
1501
1901
  const keys = Object.keys(def.shape);
1502
- 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`);
1902
+ const ownSymbols = Object.getOwnPropertySymbols(def.shape);
1903
+ const symbolKeys = ownSymbols.length ? ownSymbols : NO_SYMBOL_KEYS;
1904
+ const allKeys = symbolKeys.length ? [...keys, ...symbolKeys] : keys;
1905
+ for (const k of allKeys) if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) throw new Error(`Invalid element at key "${String(k)}": expected a Zod schema`);
1503
1906
  const okeys = optionalKeys(def.shape);
1504
1907
  return {
1505
1908
  ...def,
1506
- keys,
1909
+ allKeys,
1910
+ symbolKeys,
1507
1911
  keySet: new Set(keys),
1508
1912
  numKeys: keys.length,
1509
1913
  optionalKeys: new Set(okeys)
@@ -1514,11 +1918,14 @@ window.__ModuleLoader__.load({
1514
1918
  const keySet = def.keySet;
1515
1919
  const _catchall = def.catchall._zod;
1516
1920
  const t = _catchall.def.type;
1517
- const isOptionalIn = _catchall.optin === "optional";
1518
- const isOptionalOut = _catchall.optout === "optional";
1921
+ const optin = _catchall.optin;
1922
+ const optout = _catchall.optout;
1519
1923
  for (const key in input) {
1520
- if (key === "__proto__") continue;
1521
1924
  if (keySet.has(key)) continue;
1925
+ if (key === "__proto__") {
1926
+ if (t === "never") unrecognized.push(key);
1927
+ continue;
1928
+ }
1522
1929
  if (t === "never") {
1523
1930
  unrecognized.push(key);
1524
1931
  continue;
@@ -1527,39 +1934,44 @@ window.__ModuleLoader__.load({
1527
1934
  value: input[key],
1528
1935
  issues: []
1529
1936
  }, ctx);
1530
- if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut)));
1531
- else handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
1937
+ if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, optin, optout)));
1938
+ else handlePropertyResult(r, payload, key, input, optin, optout);
1532
1939
  }
1533
1940
  if (unrecognized.length) payload.issues.push({
1534
1941
  code: "unrecognized_keys",
1535
1942
  keys: unrecognized,
1536
1943
  input,
1537
- inst
1944
+ inst,
1945
+ continue: true
1538
1946
  });
1539
1947
  if (!proms.length) return payload;
1540
1948
  return Promise.all(proms).then(() => {
1541
1949
  return payload;
1542
1950
  });
1543
1951
  }
1952
+ const propShapes = /* @__PURE__ */ new WeakMap();
1544
1953
  const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
1545
1954
  $ZodType.init(inst, def);
1546
1955
  if (!Object.getOwnPropertyDescriptor(def, "shape")?.get) {
1547
1956
  const sh = def.shape;
1957
+ propShapes.set(def, sh);
1548
1958
  Object.defineProperty(def, "shape", { get: () => {
1549
1959
  const newSh = { ...sh };
1550
1960
  Object.defineProperty(def, "shape", { value: newSh });
1961
+ propShapes.set(def, newSh);
1551
1962
  return newSh;
1552
1963
  } });
1553
1964
  }
1554
1965
  const _normalized = cached(() => normalizeDef(def));
1555
- defineLazy(inst._zod, "propValues", () => {
1556
- const shape = def.shape;
1966
+ defineLazyInternal(inst, "propValues", (zod) => {
1967
+ const shape = zod.def.shape;
1557
1968
  const propValues = {};
1558
1969
  for (const key in shape) {
1559
1970
  const field = shape[key]._zod;
1560
1971
  if (field.values) {
1561
- propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
1972
+ if (!Object.prototype.hasOwnProperty.call(propValues, key)) assignProp(propValues, key, /* @__PURE__ */ new Set());
1562
1973
  for (const v of field.values) propValues[key].add(v);
1974
+ if (field.optin !== void 0) propValues[key].add(void 0);
1563
1975
  }
1564
1976
  }
1565
1977
  return propValues;
@@ -1567,6 +1979,8 @@ window.__ModuleLoader__.load({
1567
1979
  const isObject$1 = isObject;
1568
1980
  const catchall = def.catchall;
1569
1981
  let value;
1982
+ const memo = globalConfig.memoizer;
1983
+ memo?.attach(inst);
1570
1984
  inst._zod.parse = (payload, ctx) => {
1571
1985
  value ?? (value = _normalized.value);
1572
1986
  const input = payload.value;
@@ -1579,19 +1993,20 @@ window.__ModuleLoader__.load({
1579
1993
  });
1580
1994
  return payload;
1581
1995
  }
1582
- payload.value = {};
1996
+ payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
1583
1997
  const proms = [];
1584
1998
  const shape = value.shape;
1585
- for (const key of value.keys) {
1999
+ for (const key of value.allKeys) {
2000
+ if (key === "__proto__") continue;
1586
2001
  const el = shape[key];
1587
- const isOptionalIn = el._zod.optin === "optional";
1588
- const isOptionalOut = el._zod.optout === "optional";
2002
+ const optin = el._zod.optin;
2003
+ const optout = el._zod.optout;
1589
2004
  const r = el._zod.run({
1590
2005
  value: input[key],
1591
2006
  issues: []
1592
2007
  }, ctx);
1593
- if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut)));
1594
- else handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
2008
+ if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, optin, optout)));
2009
+ else handlePropertyResult(r, payload, key, input, optin, optout);
1595
2010
  }
1596
2011
  if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload;
1597
2012
  return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
@@ -1601,55 +2016,55 @@ window.__ModuleLoader__.load({
1601
2016
  $ZodObject.init(inst, def);
1602
2017
  const superParse = inst._zod.parse;
1603
2018
  const _normalized = cached(() => normalizeDef(def));
2019
+ const memo = globalConfig.memoizer;
1604
2020
  const generateFastpass = (shape) => {
1605
- const doc = new Doc([
1606
- "shape",
1607
- "payload",
1608
- "ctx"
1609
- ]);
1610
2021
  const normalized = _normalized.value;
1611
- const parseStr = (key) => {
1612
- const k = esc(key);
1613
- return `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
1614
- };
2022
+ const syms = normalized.symbolKeys;
2023
+ const doc = new Doc(["payload", "ctx"], {
2024
+ shape,
2025
+ inst,
2026
+ memo,
2027
+ syms
2028
+ });
2029
+ const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
2030
+ const prefixStr = (id, k) => `
2031
+ for (let i = 0; i < ${id}.issues.length; i++) {
2032
+ const iss = ${id}.issues[i];
2033
+ iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
2034
+ payload.issues.push(iss);
2035
+ }`;
1615
2036
  doc.write(`const input = payload.value;`);
1616
2037
  const ids = Object.create(null);
1617
2038
  let counter = 0;
1618
- for (const key of normalized.keys) ids[key] = `key_${counter++}`;
1619
- doc.write(`const newResult = {};`);
1620
- for (const key of normalized.keys) {
2039
+ for (const key of normalized.allKeys) ids[key] = `key_${counter++}`;
2040
+ doc.write(memo ? `const newResult = memo.alloc(inst, payload, {}, ctx);` : `const newResult = {};`);
2041
+ for (const key of normalized.allKeys) {
2042
+ if (key === "__proto__") continue;
1621
2043
  const id = ids[key];
1622
- const k = esc(key);
2044
+ const k = typeof key === "symbol" ? `syms[${syms.indexOf(key)}]` : esc(key);
2045
+ const isPresent = `${k} in input`;
1623
2046
  const schema = shape[key];
1624
- const isOptionalIn = schema?._zod?.optin === "optional";
2047
+ const optin = schema?._zod?.optin;
2048
+ const isOptionalIn = optin !== void 0;
1625
2049
  const isOptionalOut = schema?._zod?.optout === "optional";
1626
- doc.write(`const ${id} = ${parseStr(key)};`);
1627
- if (isOptionalIn && isOptionalOut) doc.write(`
1628
- if (${id}.issues.length) {
1629
- if (${k} in input) {
1630
- payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
1631
- ...iss,
1632
- path: iss.path ? [${k}, ...iss.path] : [${k}]
1633
- })));
2050
+ doc.write(`const ${id} = ${parseStr(k)};`);
2051
+ if (isOptionalIn && isOptionalOut) {
2052
+ const assign = optin === "optional" ? `${id}_present` : `${id}.value !== undefined || ${id}_present`;
2053
+ doc.write(`
2054
+ const ${id}_present = ${isPresent};
2055
+ if (!${id}.issues.length || ${id}_present) {
2056
+ if (${id}.issues.length) {${prefixStr(id, k)}
1634
2057
  }
1635
- }
1636
-
1637
- if (${id}.value === undefined) {
1638
- if (${k} in input) {
1639
- newResult[${k}] = undefined;
2058
+
2059
+ if (${assign}) {
2060
+ newResult[${k}] = ${id}.value;
1640
2061
  }
1641
- } else {
1642
- newResult[${k}] = ${id}.value;
1643
2062
  }
1644
-
2063
+
1645
2064
  `);
1646
- else if (!isOptionalIn) doc.write(`
1647
- const ${id}_present = ${k} in input;
1648
- if (${id}.issues.length) {
1649
- payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
1650
- ...iss,
1651
- path: iss.path ? [${k}, ...iss.path] : [${k}]
1652
- })));
2065
+ } else if (!isOptionalIn) doc.write(`
2066
+ const ${id}_present = ${isPresent};
2067
+ if (${id}.issues.length) {${prefixStr(id, k)}
1653
2068
  }
1654
2069
  if (!${id}_present && !${id}.issues.length) {
1655
2070
  payload.issues.push({
@@ -1661,36 +2076,27 @@ window.__ModuleLoader__.load({
1661
2076
  }
1662
2077
 
1663
2078
  if (${id}_present) {
1664
- if (${id}.value === undefined) {
1665
- newResult[${k}] = undefined;
1666
- } else {
1667
- newResult[${k}] = ${id}.value;
1668
- }
2079
+ newResult[${k}] = ${id}.value;
1669
2080
  }
1670
2081
 
1671
2082
  `);
1672
2083
  else doc.write(`
1673
- if (${id}.issues.length) {
1674
- payload.issues = payload.issues.concat(${id}.issues.map(iss => ({
1675
- ...iss,
1676
- path: iss.path ? [${k}, ...iss.path] : [${k}]
1677
- })));
2084
+ if (${id}.issues.length) {${prefixStr(id, k)}
1678
2085
  }
1679
2086
 
1680
2087
  if (${id}.value === undefined) {
1681
- if (${k} in input) {
2088
+ if (${isPresent}) {
1682
2089
  newResult[${k}] = undefined;
1683
2090
  }
1684
2091
  } else {
1685
2092
  newResult[${k}] = ${id}.value;
1686
2093
  }
1687
-
2094
+
1688
2095
  `);
1689
2096
  }
1690
2097
  doc.write(`payload.value = newResult;`);
1691
2098
  doc.write(`return payload;`);
1692
- const fn = doc.compile();
1693
- return (payload, ctx) => fn(shape, payload, ctx);
2099
+ return doc.compile();
1694
2100
  };
1695
2101
  let fastpass;
1696
2102
  const isObject$2 = isObject;
@@ -1739,14 +2145,14 @@ window.__ModuleLoader__.load({
1739
2145
  }
1740
2146
  const $ZodUnion = /*@__PURE__*/ $constructor("$ZodUnion", (inst, def) => {
1741
2147
  $ZodType.init(inst, def);
1742
- defineLazy(inst._zod, "optin", () => def.options.some((o) => o._zod.optin === "optional") ? "optional" : void 0);
1743
- defineLazy(inst._zod, "optout", () => def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
1744
- defineLazy(inst._zod, "values", () => {
1745
- if (def.options.every((o) => o._zod.values)) return new Set(def.options.flatMap((option) => Array.from(option._zod.values)));
2148
+ defineLazyInternal(inst, "optin", (zod) => zod.def.options.some((o) => o._zod.optin === "defaulted") ? "defaulted" : zod.def.options.some((o) => o._zod.optin !== void 0) ? "optional" : void 0);
2149
+ defineLazyInternal(inst, "optout", (zod) => zod.def.options.some((o) => o._zod.optout === "optional") ? "optional" : void 0);
2150
+ defineLazyInternal(inst, "values", (zod) => {
2151
+ if (zod.def.options.every((o) => o._zod.values)) return new Set(zod.def.options.flatMap((option) => Array.from(option._zod.values)));
1746
2152
  });
1747
- defineLazy(inst._zod, "pattern", () => {
1748
- if (def.options.every((o) => o._zod.pattern)) {
1749
- const patterns = def.options.map((o) => o._zod.pattern);
2153
+ defineLazyInternal(inst, "pattern", (zod) => {
2154
+ if (zod.def.options.every((o) => o._zod.pattern)) {
2155
+ const patterns = zod.def.options.map((o) => o._zod.pattern);
1750
2156
  return new RegExp(`^(${patterns.map((p) => cleanRegex(p.source)).join("|")})$`);
1751
2157
  }
1752
2158
  });
@@ -1778,18 +2184,22 @@ window.__ModuleLoader__.load({
1778
2184
  def.inclusive = false;
1779
2185
  $ZodUnion.init(inst, def);
1780
2186
  const _super = inst._zod.parse;
1781
- defineLazy(inst._zod, "propValues", () => {
2187
+ defineLazyInternal(inst, "propValues", (zod) => {
1782
2188
  const propValues = {};
1783
- for (const option of def.options) {
2189
+ for (const option of zod.def.options) {
1784
2190
  const pv = option._zod.propValues;
1785
- if (!pv || Object.keys(pv).length === 0) throw new Error(`Invalid discriminated union option at index "${def.options.indexOf(option)}"`);
2191
+ if (!pv || Object.keys(pv).length === 0) throw new Error(`Invalid discriminated union option at index "${zod.def.options.indexOf(option)}"`);
1786
2192
  for (const [k, v] of Object.entries(pv)) {
1787
- if (!propValues[k]) propValues[k] = /* @__PURE__ */ new Set();
2193
+ if (!Object.prototype.hasOwnProperty.call(propValues, k)) assignProp(propValues, k, /* @__PURE__ */ new Set());
1788
2194
  for (const val of v) propValues[k].add(val);
1789
2195
  }
1790
2196
  }
1791
2197
  return propValues;
1792
2198
  });
2199
+ def.options.forEach((option, i) => {
2200
+ const propShape = propShapes.get(option._zod.def);
2201
+ if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) throw new Error(`Invalid discriminated union option at index "${i}"`);
2202
+ });
1793
2203
  const disc = cached(() => {
1794
2204
  const opts = def.options;
1795
2205
  const map = /* @__PURE__ */ new Map();
@@ -1864,7 +2274,9 @@ window.__ModuleLoader__.load({
1864
2274
  ...a,
1865
2275
  ...b
1866
2276
  };
2277
+ if (Object.prototype.hasOwnProperty.call(newObj, "__proto__")) delete newObj.__proto__;
1867
2278
  for (const key of sharedKeys) {
2279
+ if (key === "__proto__") continue;
1868
2280
  const sharedValue = mergeValues(a[key], b[key]);
1869
2281
  if (!sharedValue.valid) return {
1870
2282
  valid: false,
@@ -1906,35 +2318,181 @@ window.__ModuleLoader__.load({
1906
2318
  function handleIntersectionResults(result, left, right) {
1907
2319
  const unrecKeys = /* @__PURE__ */ new Map();
1908
2320
  let unrecIssue;
1909
- for (const iss of left.issues) if (iss.code === "unrecognized_keys") {
1910
- unrecIssue ?? (unrecIssue = iss);
1911
- for (const k of iss.keys) {
2321
+ const keyIssues = /* @__PURE__ */ new Map();
2322
+ const collect = (iss, side) => {
2323
+ let keys;
2324
+ if (iss.code === "unrecognized_keys" && !iss.path?.length) {
2325
+ unrecIssue ?? (unrecIssue = iss);
2326
+ keys = iss.keys;
2327
+ } else if (iss.code === "invalid_key" && iss.origin === "record" && iss.path?.length === 1) {
2328
+ const k = String(iss.path[0]);
2329
+ if (!keyIssues.has(k)) keyIssues.set(k, iss);
2330
+ keys = [k];
2331
+ } else return false;
2332
+ for (const k of keys) {
1912
2333
  if (!unrecKeys.has(k)) unrecKeys.set(k, {});
1913
- unrecKeys.get(k).l = true;
2334
+ unrecKeys.get(k)[side] = true;
1914
2335
  }
1915
- } else result.issues.push(iss);
1916
- for (const iss of right.issues) if (iss.code === "unrecognized_keys") for (const k of iss.keys) {
1917
- if (!unrecKeys.has(k)) unrecKeys.set(k, {});
1918
- unrecKeys.get(k).r = true;
1919
- }
1920
- else result.issues.push(iss);
2336
+ return true;
2337
+ };
2338
+ for (const iss of left.issues) if (!collect(iss, "l")) result.issues.push(iss);
2339
+ for (const iss of right.issues) if (!collect(iss, "r")) result.issues.push(iss);
1921
2340
  const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);
1922
- if (bothKeys.length && unrecIssue) result.issues.push({
1923
- ...unrecIssue,
1924
- keys: bothKeys
1925
- });
1926
- if (aborted(result)) return result;
2341
+ if (bothKeys.length) {
2342
+ const aggregated = unrecIssue ? bothKeys.filter((k) => unrecIssue.keys.includes(k)) : [];
2343
+ if (aggregated.length) result.issues.push({
2344
+ ...unrecIssue,
2345
+ keys: aggregated
2346
+ });
2347
+ for (const k of bothKeys) if (!aggregated.includes(k) && keyIssues.has(k)) result.issues.push(keyIssues.get(k));
2348
+ }
1927
2349
  const merged = mergeValues(left.value, right.value);
1928
- if (!merged.valid) throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
2350
+ if (!merged.valid) {
2351
+ if (aborted(result)) return result;
2352
+ throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(merged.mergeErrorPath)}`);
2353
+ }
1929
2354
  result.value = merged.data;
1930
2355
  return result;
1931
2356
  }
2357
+ const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
2358
+ $ZodType.init(inst, def);
2359
+ const memo = globalConfig.memoizer;
2360
+ memo?.attach(inst);
2361
+ inst._zod.parse = (payload, ctx) => {
2362
+ const input = payload.value;
2363
+ if (!isPlainObject(input)) {
2364
+ payload.issues.push({
2365
+ expected: "record",
2366
+ code: "invalid_type",
2367
+ input,
2368
+ inst
2369
+ });
2370
+ return payload;
2371
+ }
2372
+ const proms = [];
2373
+ const values = def.keyType._zod.values;
2374
+ if (values && !def.partial) {
2375
+ payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
2376
+ const recordKeys = /* @__PURE__ */ new Set();
2377
+ for (const key of values) if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
2378
+ recordKeys.add(typeof key === "number" ? key.toString() : key);
2379
+ if (key === "__proto__") continue;
2380
+ const keyResult = def.keyType._zod.run({
2381
+ value: key,
2382
+ issues: []
2383
+ }, ctx);
2384
+ if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
2385
+ if (keyResult.issues.length) {
2386
+ payload.issues.push({
2387
+ code: "invalid_key",
2388
+ origin: "record",
2389
+ issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
2390
+ input: key,
2391
+ path: [key],
2392
+ inst
2393
+ });
2394
+ continue;
2395
+ }
2396
+ const outKey = keyResult.value;
2397
+ if (outKey === "__proto__") continue;
2398
+ const result = def.valueType._zod.run({
2399
+ value: input[key],
2400
+ issues: []
2401
+ }, ctx);
2402
+ if (result instanceof Promise) proms.push(result.then((result) => {
2403
+ if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
2404
+ payload.value[outKey] = result.value;
2405
+ }));
2406
+ else {
2407
+ if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
2408
+ payload.value[outKey] = result.value;
2409
+ }
2410
+ }
2411
+ let unrecognized;
2412
+ for (const key in input) if (!recordKeys.has(key)) {
2413
+ if (def.mode === "loose") {
2414
+ if (key === "__proto__") continue;
2415
+ payload.value[key] = input[key];
2416
+ } else {
2417
+ unrecognized = unrecognized ?? [];
2418
+ unrecognized.push(key);
2419
+ }
2420
+ }
2421
+ if (unrecognized && unrecognized.length > 0) payload.issues.push({
2422
+ code: "unrecognized_keys",
2423
+ input,
2424
+ inst,
2425
+ keys: unrecognized,
2426
+ continue: true
2427
+ });
2428
+ } else {
2429
+ payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
2430
+ let unrecognized;
2431
+ for (const key of Reflect.ownKeys(input)) {
2432
+ if (key === "__proto__") continue;
2433
+ if (!Object.prototype.propertyIsEnumerable.call(input, key)) continue;
2434
+ let keyResult = def.keyType._zod.run({
2435
+ value: key,
2436
+ issues: []
2437
+ }, ctx);
2438
+ if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
2439
+ if (typeof key === "string" && number$1.test(key) && keyResult.issues.length) {
2440
+ const retryResult = def.keyType._zod.run({
2441
+ value: Number(key),
2442
+ issues: []
2443
+ }, ctx);
2444
+ if (retryResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
2445
+ if (retryResult.issues.length === 0) keyResult = retryResult;
2446
+ }
2447
+ if (keyResult.issues.length) {
2448
+ if (def.mode === "loose") payload.value[key] = input[key];
2449
+ else if (values) {
2450
+ unrecognized = unrecognized ?? [];
2451
+ unrecognized.push(key);
2452
+ } else payload.issues.push({
2453
+ code: "invalid_key",
2454
+ origin: "record",
2455
+ issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
2456
+ input: key,
2457
+ path: [key],
2458
+ inst
2459
+ });
2460
+ continue;
2461
+ }
2462
+ const outKey = keyResult.value;
2463
+ if (outKey === "__proto__") continue;
2464
+ const result = def.valueType._zod.run({
2465
+ value: input[key],
2466
+ issues: []
2467
+ }, ctx);
2468
+ if (result instanceof Promise) proms.push(result.then((result) => {
2469
+ if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
2470
+ payload.value[outKey] = result.value;
2471
+ }));
2472
+ else {
2473
+ if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
2474
+ payload.value[outKey] = result.value;
2475
+ }
2476
+ }
2477
+ if (unrecognized && unrecognized.length > 0) payload.issues.push({
2478
+ code: "unrecognized_keys",
2479
+ input,
2480
+ inst,
2481
+ keys: unrecognized,
2482
+ continue: true
2483
+ });
2484
+ }
2485
+ if (proms.length) return Promise.all(proms).then(() => payload);
2486
+ return payload;
2487
+ };
2488
+ });
1932
2489
  const $ZodEnum = /*@__PURE__*/ $constructor("$ZodEnum", (inst, def) => {
1933
2490
  $ZodType.init(inst, def);
1934
2491
  const values = getEnumValues(def.entries);
1935
2492
  const valuesSet = new Set(values);
1936
2493
  inst._zod.values = valuesSet;
1937
- inst._zod.pattern = new RegExp(`^(${values.filter((k) => propertyKeyTypes.has(typeof k)).map((o) => typeof o === "string" ? escapeRegex(o) : o.toString()).join("|")})$`);
2494
+ const patternValues = values.filter((k) => propertyKeyTypes.has(typeof k));
2495
+ inst._zod.pattern = new RegExp(patternValues.length ? `^(${patternValues.map((o) => escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
1938
2496
  inst._zod.parse = (payload, _ctx) => {
1939
2497
  const input = payload.value;
1940
2498
  if (valuesSet.has(input)) return payload;
@@ -1949,10 +2507,9 @@ window.__ModuleLoader__.load({
1949
2507
  });
1950
2508
  const $ZodLiteral = /*@__PURE__*/ $constructor("$ZodLiteral", (inst, def) => {
1951
2509
  $ZodType.init(inst, def);
1952
- if (def.values.length === 0) throw new Error("Cannot create literal schema with no valid values");
1953
2510
  const values = new Set(def.values);
1954
2511
  inst._zod.values = values;
1955
- inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
2512
+ inst._zod.pattern = new RegExp(def.values.length ? `^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$` : "^[^\\s\\S]$");
1956
2513
  inst._zod.parse = (payload, _ctx) => {
1957
2514
  const input = payload.value;
1958
2515
  if (values.has(input)) return payload;
@@ -1968,67 +2525,66 @@ window.__ModuleLoader__.load({
1968
2525
  const $ZodTransform = /*@__PURE__*/ $constructor("$ZodTransform", (inst, def) => {
1969
2526
  $ZodType.init(inst, def);
1970
2527
  inst._zod.optin = "optional";
2528
+ globalConfig.memoizer?.guard(inst);
1971
2529
  inst._zod.parse = (payload, ctx) => {
1972
2530
  if (ctx.direction === "backward") throw new $ZodEncodeError(inst.constructor.name);
1973
2531
  const _out = def.transform(payload.value, payload);
1974
2532
  if (ctx.async) return (_out instanceof Promise ? _out : Promise.resolve(_out)).then((output) => {
1975
2533
  payload.value = output;
1976
- payload.fallback = true;
1977
2534
  return payload;
1978
2535
  });
1979
2536
  if (_out instanceof Promise) throw new $ZodAsyncError();
1980
2537
  payload.value = _out;
1981
- payload.fallback = true;
1982
2538
  return payload;
1983
2539
  };
1984
2540
  });
1985
- function handleOptionalResult(result, input) {
1986
- if (input === void 0 && (result.issues.length || result.fallback)) return {
1987
- issues: [],
1988
- value: void 0
1989
- };
1990
- return result;
2541
+ function handleOptionalResult(payload, result) {
2542
+ payload.value = result.issues.length ? void 0 : result.value;
2543
+ return payload;
1991
2544
  }
1992
2545
  const $ZodOptional = /*@__PURE__*/ $constructor("$ZodOptional", (inst, def) => {
1993
2546
  $ZodType.init(inst, def);
1994
- inst._zod.optin = "optional";
2547
+ defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional");
1995
2548
  inst._zod.optout = "optional";
1996
- defineLazy(inst._zod, "values", () => {
1997
- return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, void 0]) : void 0;
2549
+ defineLazyInternal(inst, "values", (zod) => {
2550
+ const values = zod.def.innerType._zod.values;
2551
+ return values ? /* @__PURE__ */ new Set([...values, void 0]) : void 0;
1998
2552
  });
1999
- defineLazy(inst._zod, "pattern", () => {
2000
- const pattern = def.innerType._zod.pattern;
2553
+ defineLazyInternal(inst, "pattern", (zod) => {
2554
+ const pattern = zod.def.innerType._zod.pattern;
2001
2555
  return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0;
2002
2556
  });
2003
2557
  inst._zod.parse = (payload, ctx) => {
2004
- if (def.innerType._zod.optin === "optional") {
2005
- const input = payload.value;
2006
- const result = def.innerType._zod.run(payload, ctx);
2007
- if (result instanceof Promise) return result.then((r) => handleOptionalResult(r, input));
2008
- return handleOptionalResult(result, input);
2558
+ if (payload.value === void 0) {
2559
+ if (def.innerType._zod.optin !== "defaulted") return payload;
2560
+ const result = def.innerType._zod.run({
2561
+ value: payload.value,
2562
+ issues: []
2563
+ }, ctx);
2564
+ if (result instanceof Promise) return result.then((result) => handleOptionalResult(payload, result));
2565
+ return handleOptionalResult(payload, result);
2009
2566
  }
2010
- if (payload.value === void 0) return payload;
2011
2567
  return def.innerType._zod.run(payload, ctx);
2012
2568
  };
2013
2569
  });
2014
2570
  const $ZodExactOptional = /*@__PURE__*/ $constructor("$ZodExactOptional", (inst, def) => {
2015
2571
  $ZodOptional.init(inst, def);
2016
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2017
- defineLazy(inst._zod, "pattern", () => def.innerType._zod.pattern);
2572
+ defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
2573
+ defineLazyInternal(inst, "pattern", (zod) => zod.def.innerType._zod.pattern);
2018
2574
  inst._zod.parse = (payload, ctx) => {
2019
2575
  return def.innerType._zod.run(payload, ctx);
2020
2576
  };
2021
2577
  });
2022
2578
  const $ZodNullable = /*@__PURE__*/ $constructor("$ZodNullable", (inst, def) => {
2023
2579
  $ZodType.init(inst, def);
2024
- defineLazy(inst._zod, "optin", () => def.innerType._zod.optin);
2025
- defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
2026
- defineLazy(inst._zod, "pattern", () => {
2027
- const pattern = def.innerType._zod.pattern;
2580
+ defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin);
2581
+ defineLazyInternal(inst, "optout", (zod) => zod.def.innerType._zod.optout);
2582
+ defineLazyInternal(inst, "pattern", (zod) => {
2583
+ const pattern = zod.def.innerType._zod.pattern;
2028
2584
  return pattern ? new RegExp(`^(${cleanRegex(pattern.source)}|null)$`) : void 0;
2029
2585
  });
2030
- defineLazy(inst._zod, "values", () => {
2031
- return def.innerType._zod.values ? /* @__PURE__ */ new Set([...def.innerType._zod.values, null]) : void 0;
2586
+ defineLazyInternal(inst, "values", (zod) => {
2587
+ return zod.def.innerType._zod.values ? /* @__PURE__ */ new Set([...zod.def.innerType._zod.values, null]) : void 0;
2032
2588
  });
2033
2589
  inst._zod.parse = (payload, ctx) => {
2034
2590
  if (payload.value === null) return payload;
@@ -2037,8 +2593,8 @@ window.__ModuleLoader__.load({
2037
2593
  });
2038
2594
  const $ZodDefault = /*@__PURE__*/ $constructor("$ZodDefault", (inst, def) => {
2039
2595
  $ZodType.init(inst, def);
2040
- inst._zod.optin = "optional";
2041
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2596
+ inst._zod.optin = "defaulted";
2597
+ defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
2042
2598
  inst._zod.parse = (payload, ctx) => {
2043
2599
  if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
2044
2600
  if (payload.value === void 0) {
@@ -2059,8 +2615,8 @@ window.__ModuleLoader__.load({
2059
2615
  }
2060
2616
  const $ZodPrefault = /*@__PURE__*/ $constructor("$ZodPrefault", (inst, def) => {
2061
2617
  $ZodType.init(inst, def);
2062
- inst._zod.optin = "optional";
2063
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2618
+ inst._zod.optin = "defaulted";
2619
+ defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
2064
2620
  inst._zod.parse = (payload, ctx) => {
2065
2621
  if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
2066
2622
  if (payload.value === void 0) payload.value = def.defaultValue;
@@ -2069,8 +2625,8 @@ window.__ModuleLoader__.load({
2069
2625
  });
2070
2626
  const $ZodNonOptional = /*@__PURE__*/ $constructor("$ZodNonOptional", (inst, def) => {
2071
2627
  $ZodType.init(inst, def);
2072
- defineLazy(inst._zod, "values", () => {
2073
- const v = def.innerType._zod.values;
2628
+ defineLazyInternal(inst, "values", (zod) => {
2629
+ const v = zod.def.innerType._zod.values;
2074
2630
  return v ? new Set([...v].filter((x) => x !== void 0)) : void 0;
2075
2631
  });
2076
2632
  inst._zod.parse = (payload, ctx) => {
@@ -2088,46 +2644,41 @@ window.__ModuleLoader__.load({
2088
2644
  });
2089
2645
  return payload;
2090
2646
  }
2647
+ function handleCatchResult(payload, result, def, ctx) {
2648
+ if (!result.issues.length) {
2649
+ payload.value = result.value;
2650
+ if (result.memo) payload.memo = true;
2651
+ return payload;
2652
+ }
2653
+ payload.value = def.catchValue({
2654
+ ...result,
2655
+ value: payload.value,
2656
+ error: { issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config())) },
2657
+ input: payload.value
2658
+ });
2659
+ return payload;
2660
+ }
2091
2661
  const $ZodCatch = /*@__PURE__*/ $constructor("$ZodCatch", (inst, def) => {
2092
2662
  $ZodType.init(inst, def);
2093
- inst._zod.optin = "optional";
2094
- defineLazy(inst._zod, "optout", () => def.innerType._zod.optout);
2095
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2663
+ defineLazyInternal(inst, "optin", (zod) => zod.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional");
2664
+ defineLazyInternal(inst, "optout", (zod) => zod.def.innerType._zod.optout);
2665
+ defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
2096
2666
  inst._zod.parse = (payload, ctx) => {
2097
2667
  if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
2098
- const result = def.innerType._zod.run(payload, ctx);
2099
- if (result instanceof Promise) return result.then((result) => {
2100
- payload.value = result.value;
2101
- if (result.issues.length) {
2102
- payload.value = def.catchValue({
2103
- ...payload,
2104
- error: { issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config())) },
2105
- input: payload.value
2106
- });
2107
- payload.issues = [];
2108
- payload.fallback = true;
2109
- }
2110
- return payload;
2111
- });
2112
- payload.value = result.value;
2113
- if (result.issues.length) {
2114
- payload.value = def.catchValue({
2115
- ...payload,
2116
- error: { issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config())) },
2117
- input: payload.value
2118
- });
2119
- payload.issues = [];
2120
- payload.fallback = true;
2121
- }
2122
- return payload;
2668
+ const result = def.innerType._zod.run({
2669
+ value: payload.value,
2670
+ issues: []
2671
+ }, ctx);
2672
+ if (result instanceof Promise) return result.then((result) => handleCatchResult(payload, result, def, ctx));
2673
+ return handleCatchResult(payload, result, def, ctx);
2123
2674
  };
2124
2675
  });
2125
2676
  const $ZodPipe = /*@__PURE__*/ $constructor("$ZodPipe", (inst, def) => {
2126
2677
  $ZodType.init(inst, def);
2127
- defineLazy(inst._zod, "values", () => def.in._zod.values);
2128
- defineLazy(inst._zod, "optin", () => def.in._zod.optin);
2129
- defineLazy(inst._zod, "optout", () => def.out._zod.optout);
2130
- defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
2678
+ defineLazyInternal(inst, "values", (zod) => zod.def.in._zod.values);
2679
+ defineLazyInternal(inst, "optin", (zod) => zod.def.in._zod.optin);
2680
+ defineLazyInternal(inst, "optout", (zod) => zod.def.out._zod.optout);
2681
+ defineLazyInternal(inst, "propValues", (zod) => zod.def.in._zod.propValues);
2131
2682
  inst._zod.parse = (payload, ctx) => {
2132
2683
  if (ctx.direction === "backward") {
2133
2684
  const right = def.out._zod.run(payload, ctx);
@@ -2140,22 +2691,21 @@ window.__ModuleLoader__.load({
2140
2691
  };
2141
2692
  });
2142
2693
  function handlePipeResult(left, next, ctx) {
2143
- if (left.issues.length) {
2694
+ if (left.issues.some((iss) => iss.code !== "unrecognized_keys")) {
2144
2695
  left.aborted = true;
2145
2696
  return left;
2146
2697
  }
2147
2698
  return next._zod.run({
2148
2699
  value: left.value,
2149
- issues: left.issues,
2150
- fallback: left.fallback
2700
+ issues: left.issues
2151
2701
  }, ctx);
2152
2702
  }
2153
2703
  const $ZodReadonly = /*@__PURE__*/ $constructor("$ZodReadonly", (inst, def) => {
2154
2704
  $ZodType.init(inst, def);
2155
- defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
2156
- defineLazy(inst._zod, "values", () => def.innerType._zod.values);
2157
- defineLazy(inst._zod, "optin", () => def.innerType?._zod?.optin);
2158
- defineLazy(inst._zod, "optout", () => def.innerType?._zod?.optout);
2705
+ defineLazyInternal(inst, "propValues", (zod) => zod.def.innerType._zod.propValues);
2706
+ defineLazyInternal(inst, "values", (zod) => zod.def.innerType._zod.values);
2707
+ defineLazyInternal(inst, "optin", (zod) => zod.def.innerType?._zod?.optin);
2708
+ defineLazyInternal(inst, "optout", (zod) => zod.def.innerType?._zod?.optout);
2159
2709
  inst._zod.parse = (payload, ctx) => {
2160
2710
  if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
2161
2711
  const result = def.innerType._zod.run(payload, ctx);
@@ -2164,9 +2714,24 @@ window.__ModuleLoader__.load({
2164
2714
  };
2165
2715
  });
2166
2716
  function handleReadonlyResult(payload) {
2167
- payload.value = Object.freeze(payload.value);
2717
+ if (!payload.memo) payload.value = Object.freeze(payload.value);
2168
2718
  return payload;
2169
2719
  }
2720
+ const $ZodLazy = /*@__PURE__*/ $constructor("$ZodLazy", (inst, def) => {
2721
+ $ZodType.init(inst, def);
2722
+ defineLazy(inst._zod, "innerType", () => {
2723
+ const d = def;
2724
+ if (!d._cachedInner) d._cachedInner = def.getter();
2725
+ return d._cachedInner;
2726
+ });
2727
+ defineLazyInternal(inst, "pattern", (zod) => zod.innerType?._zod?.pattern);
2728
+ defineLazyInternal(inst, "propValues", (zod) => zod.innerType?._zod?.propValues);
2729
+ defineLazyInternal(inst, "optin", (zod) => zod.innerType?._zod?.optin ?? void 0);
2730
+ defineLazyInternal(inst, "optout", (zod) => zod.innerType?._zod?.optout ?? void 0);
2731
+ inst._zod.parse = (payload, ctx) => {
2732
+ return inst._zod.innerType._zod.run(payload, ctx);
2733
+ };
2734
+ });
2170
2735
  const $ZodCustom = /*@__PURE__*/ $constructor("$ZodCustom", (inst, def) => {
2171
2736
  $ZodCheck.init(inst, def);
2172
2737
  $ZodType.init(inst, def);
@@ -2194,7 +2759,332 @@ window.__ModuleLoader__.load({
2194
2759
  }
2195
2760
  }
2196
2761
  //#endregion
2197
- //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/registries.js
2762
+ //#region node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/memoizer.js
2763
+ var $ZodCyclicError = class extends Error {
2764
+ constructor() {
2765
+ super(`Cannot parse a reference cycle that closes through a transform`);
2766
+ this.name = "ZodCyclicError";
2767
+ }
2768
+ };
2769
+ /** Keyed off the context object every schema in one parse call already shares. */
2770
+ const STATE = "~memo";
2771
+ const NO_ISSUES = [];
2772
+ function cloneIssues(issues) {
2773
+ return issues.map((iss) => iss.path ? {
2774
+ ...iss,
2775
+ path: iss.path.slice()
2776
+ } : { ...iss });
2777
+ }
2778
+ const recursive = /*@__PURE__*/ new WeakMap();
2779
+ /** Whether this schema's subtree contains a cycle, so one parse can re-enter it. */
2780
+ function isRecursive(inst, stack) {
2781
+ const cached = recursive.get(inst);
2782
+ if (cached !== void 0) return cached;
2783
+ if (stack.has(inst)) return true;
2784
+ stack.add(inst);
2785
+ let result = false;
2786
+ const check = (child) => {
2787
+ if (!result && child?._zod && isRecursive(child, stack)) result = true;
2788
+ };
2789
+ const def = inst._zod.def;
2790
+ switch (def.type) {
2791
+ case "object":
2792
+ for (const key of Reflect.ownKeys(def.shape)) check(def.shape[key]);
2793
+ check(def.catchall);
2794
+ break;
2795
+ case "array":
2796
+ check(def.element);
2797
+ break;
2798
+ case "tuple":
2799
+ for (const el of def.items) check(el);
2800
+ check(def.rest);
2801
+ break;
2802
+ case "record":
2803
+ case "map":
2804
+ check(def.keyType);
2805
+ check(def.valueType);
2806
+ break;
2807
+ case "set":
2808
+ check(def.valueType);
2809
+ break;
2810
+ case "union":
2811
+ for (const el of def.options) check(el);
2812
+ break;
2813
+ case "intersection":
2814
+ check(def.left);
2815
+ check(def.right);
2816
+ break;
2817
+ case "optional":
2818
+ case "nullable":
2819
+ case "default":
2820
+ case "prefault":
2821
+ case "catch":
2822
+ case "readonly":
2823
+ case "nonoptional":
2824
+ case "promise":
2825
+ case "success":
2826
+ check(def.innerType);
2827
+ break;
2828
+ case "pipe":
2829
+ check(def.in);
2830
+ check(def.out);
2831
+ break;
2832
+ case "function":
2833
+ check(def.input);
2834
+ check(def.output);
2835
+ break;
2836
+ case "lazy":
2837
+ check(inst._zod.innerType);
2838
+ break;
2839
+ case "template_literal":
2840
+ case "string":
2841
+ case "number":
2842
+ case "int":
2843
+ case "boolean":
2844
+ case "bigint":
2845
+ case "symbol":
2846
+ case "undefined":
2847
+ case "null":
2848
+ case "void":
2849
+ case "never":
2850
+ case "any":
2851
+ case "unknown":
2852
+ case "date":
2853
+ case "nan":
2854
+ case "enum":
2855
+ case "literal":
2856
+ case "file":
2857
+ case "transform":
2858
+ case "custom": break;
2859
+ default: for (const key in def) {
2860
+ const desc = Object.getOwnPropertyDescriptor(def, key);
2861
+ if (!desc || desc.get) continue;
2862
+ const value = desc.value;
2863
+ if (!value || typeof value !== "object") continue;
2864
+ if (value._zod) check(value);
2865
+ else if (Array.isArray(value)) for (const el of value) check(el);
2866
+ }
2867
+ }
2868
+ stack.delete(inst);
2869
+ recursive.set(inst, result);
2870
+ return result;
2871
+ }
2872
+ function bucketFor(state, inst) {
2873
+ let bucket = state.buckets.get(inst);
2874
+ if (!bucket) {
2875
+ bucket = /* @__PURE__ */ new Map();
2876
+ state.buckets.set(inst, bucket);
2877
+ }
2878
+ return bucket;
2879
+ }
2880
+ let handoff;
2881
+ const open = [];
2882
+ const memo = {
2883
+ alloc(_inst, payload, empty) {
2884
+ const bucket = handoff;
2885
+ if (!bucket) return empty;
2886
+ handoff = void 0;
2887
+ const entry = {
2888
+ value: empty,
2889
+ issues: null
2890
+ };
2891
+ bucket.set(payload.value, entry);
2892
+ open.push(entry);
2893
+ return empty;
2894
+ },
2895
+ guard(inst) {
2896
+ var _a;
2897
+ (_a = inst._zod).deferred ?? (_a.deferred = []);
2898
+ inst._zod.deferred.push(() => {
2899
+ const base = inst._zod.parse;
2900
+ const wrapped = (payload, ctx) => {
2901
+ if (ctx.direction !== "backward" && isBackEdge(ctx, payload.value)) throw new $ZodCyclicError();
2902
+ return base(payload, ctx);
2903
+ };
2904
+ inst._zod.parse = wrapped;
2905
+ if (inst._zod.run === base) inst._zod.run = wrapped;
2906
+ });
2907
+ },
2908
+ attach(inst) {
2909
+ var _a;
2910
+ let isRecursiveInst;
2911
+ let lastCtx;
2912
+ let lastBucket;
2913
+ (_a = inst._zod).deferred ?? (_a.deferred = []);
2914
+ inst._zod.deferred.push(() => {
2915
+ const base = inst._zod.parse;
2916
+ const wrapped = (payload, ctx) => {
2917
+ if (isRecursiveInst === void 0) {
2918
+ isRecursiveInst = isRecursive(inst, /* @__PURE__ */ new Set());
2919
+ if (!isRecursiveInst) {
2920
+ inst._zod.parse = base;
2921
+ if (inst._zod.run === wrapped) inst._zod.run = base;
2922
+ return base(payload, ctx);
2923
+ }
2924
+ }
2925
+ const input = payload.value;
2926
+ if (input === null || typeof input !== "object") return base(payload, ctx);
2927
+ let state = ctx[STATE];
2928
+ if (!state) {
2929
+ state = {
2930
+ buckets: /* @__PURE__ */ new Map(),
2931
+ backEdges: void 0
2932
+ };
2933
+ ctx[STATE] = state;
2934
+ }
2935
+ let bucket;
2936
+ if (lastCtx === ctx) bucket = lastBucket;
2937
+ else {
2938
+ bucket = bucketFor(state, inst);
2939
+ lastCtx = ctx;
2940
+ lastBucket = bucket;
2941
+ }
2942
+ const hit = bucket.get(input);
2943
+ if (hit) {
2944
+ payload.value = hit.value;
2945
+ if (hit.issues) {
2946
+ if (hit.issues.length) payload.issues.push(...cloneIssues(hit.issues));
2947
+ } else {
2948
+ payload.memo = true;
2949
+ state.backEdges ?? (state.backEdges = /* @__PURE__ */ new Set());
2950
+ state.backEdges.add(hit.value);
2951
+ }
2952
+ return payload;
2953
+ }
2954
+ handoff = bucket;
2955
+ const depth = open.length;
2956
+ const result = base(payload, ctx);
2957
+ handoff = void 0;
2958
+ const entry = open.length > depth ? open.pop() : void 0;
2959
+ if (result instanceof Promise) return result.then((r) => {
2960
+ if (entry) entry.issues = r.issues.length ? cloneIssues(r.issues) : NO_ISSUES;
2961
+ return r;
2962
+ });
2963
+ if (entry) entry.issues = result.issues.length ? cloneIssues(result.issues) : NO_ISSUES;
2964
+ return result;
2965
+ };
2966
+ inst._zod.parse = wrapped;
2967
+ if (inst._zod.run === base) inst._zod.run = wrapped;
2968
+ });
2969
+ }
2970
+ };
2971
+ /** The memoizer that gives containers cycle support. `zod` installs it by default; `zod/mini` opts in with `config({ memoizer: memoizer() })`. */
2972
+ function memoizer() {
2973
+ return memo;
2974
+ }
2975
+ /** Whether this value is a node a back-edge resolved to before it finished. */
2976
+ function isBackEdge(ctx, value) {
2977
+ const backEdges = ctx[STATE]?.backEdges;
2978
+ return backEdges !== void 0 && value !== null && typeof value === "object" && backEdges.has(value);
2979
+ }
2980
+ //#endregion
2981
+ //#region node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/locales/en.js
2982
+ const error = () => {
2983
+ const Sizable = {
2984
+ string: {
2985
+ unit: "characters",
2986
+ verb: "to have"
2987
+ },
2988
+ file: {
2989
+ unit: "bytes",
2990
+ verb: "to have"
2991
+ },
2992
+ array: {
2993
+ unit: "items",
2994
+ verb: "to have"
2995
+ },
2996
+ set: {
2997
+ unit: "items",
2998
+ verb: "to have"
2999
+ },
3000
+ map: {
3001
+ unit: "entries",
3002
+ verb: "to have"
3003
+ }
3004
+ };
3005
+ function getSizing(origin) {
3006
+ return Sizable[origin] ?? null;
3007
+ }
3008
+ const FormatDictionary = {
3009
+ regex: "input",
3010
+ email: "email address",
3011
+ url: "URL",
3012
+ emoji: "emoji",
3013
+ uuid: "UUID",
3014
+ uuidv4: "UUIDv4",
3015
+ uuidv6: "UUIDv6",
3016
+ nanoid: "nanoid",
3017
+ guid: "GUID",
3018
+ cuid: "cuid",
3019
+ cuid2: "cuid2",
3020
+ ulid: "ULID",
3021
+ xid: "XID",
3022
+ ksuid: "KSUID",
3023
+ datetime: "ISO datetime",
3024
+ date: "ISO date",
3025
+ time: "ISO time",
3026
+ duration: "ISO duration",
3027
+ ipv4: "IPv4 address",
3028
+ ipv6: "IPv6 address",
3029
+ mac: "MAC address",
3030
+ cidrv4: "IPv4 range",
3031
+ cidrv6: "IPv6 range",
3032
+ base64: "base64-encoded string",
3033
+ base64url: "base64url-encoded string",
3034
+ json_string: "JSON string",
3035
+ e164: "E.164 number",
3036
+ credit_card: "credit card number",
3037
+ jwt: "JWT",
3038
+ template_literal: "input"
3039
+ };
3040
+ const TypeDictionary = { nan: "NaN" };
3041
+ function getTypeName(type, input) {
3042
+ if (type === "number" && typeof input === "number" && !Number.isFinite(input)) return String(input);
3043
+ return TypeDictionary[type] ?? type;
3044
+ }
3045
+ return (issue) => {
3046
+ switch (issue.code) {
3047
+ case "invalid_type": return `Invalid input: expected ${getTypeName(issue.expected)}, received ${getTypeName(parsedType(issue.input), issue.input)}`;
3048
+ case "invalid_value":
3049
+ if (issue.values.length === 1) return `Invalid input: expected ${stringifyPrimitive(issue.values[0])}`;
3050
+ return `Invalid option: expected one of ${joinValues(issue.values, "|")}`;
3051
+ case "too_big": {
3052
+ const adj = issue.exact ? "exactly " : issue.inclusive ? "<=" : "<";
3053
+ const sizing = getSizing(issue.origin);
3054
+ if (sizing) return `Too big: expected ${issue.origin ?? "value"} to have ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elements"}`;
3055
+ return `Too big: expected ${issue.origin ?? "value"} to be ${adj}${issue.maximum.toString()}`;
3056
+ }
3057
+ case "too_small": {
3058
+ const adj = issue.exact ? "exactly " : issue.inclusive ? ">=" : ">";
3059
+ const sizing = getSizing(issue.origin);
3060
+ if (sizing) return `Too small: expected ${issue.origin} to have ${adj}${issue.minimum.toString()} ${sizing.unit}`;
3061
+ return `Too small: expected ${issue.origin} to be ${adj}${issue.minimum.toString()}`;
3062
+ }
3063
+ case "invalid_format": {
3064
+ const _issue = issue;
3065
+ if (_issue.format === "starts_with") return `Invalid string: must start with "${_issue.prefix}"`;
3066
+ if (_issue.format === "ends_with") return `Invalid string: must end with "${_issue.suffix}"`;
3067
+ if (_issue.format === "includes") return `Invalid string: must include "${_issue.includes}"`;
3068
+ if (_issue.format === "regex") return `Invalid string: must match pattern ${_issue.pattern}`;
3069
+ return `Invalid ${FormatDictionary[_issue.format] ?? issue.format}`;
3070
+ }
3071
+ case "not_multiple_of": return `Invalid number: must be a multiple of ${issue.divisor}`;
3072
+ case "unrecognized_keys": return `Unrecognized key${issue.keys.length > 1 ? "s" : ""}: ${joinValues(issue.keys, ", ")}`;
3073
+ case "invalid_key": return `Invalid key in ${issue.origin}`;
3074
+ case "invalid_union":
3075
+ if (issue.options && Array.isArray(issue.options) && issue.options.length > 0) return `Invalid discriminator value. Expected ${issue.options.map((o) => `'${o}'`).join(" | ")}`;
3076
+ if (issue.inclusive === false) return "Invalid input: more than one option matched";
3077
+ return "Invalid input";
3078
+ case "invalid_element": return `Invalid value in ${issue.origin}`;
3079
+ default: return `Invalid input`;
3080
+ }
3081
+ };
3082
+ };
3083
+ function en_default() {
3084
+ return { localeError: error() };
3085
+ }
3086
+ //#endregion
3087
+ //#region node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/registries.js
2198
3088
  var _a;
2199
3089
  var $ZodRegistry = class {
2200
3090
  constructor() {
@@ -2241,7 +3131,7 @@ window.__ModuleLoader__.load({
2241
3131
  (_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
2242
3132
  const globalRegistry = globalThis.__zod_globalRegistry;
2243
3133
  //#endregion
2244
- //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/api.js
3134
+ //#region node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/api.js
2245
3135
  // @__NO_SIDE_EFFECTS__
2246
3136
  function _string(Class, params) {
2247
3137
  return new Class({
@@ -2543,6 +3433,13 @@ window.__ModuleLoader__.load({
2543
3433
  });
2544
3434
  }
2545
3435
  // @__NO_SIDE_EFFECTS__
3436
+ function _null$1(Class, params) {
3437
+ return new Class({
3438
+ type: "null",
3439
+ ...normalizeParams(params)
3440
+ });
3441
+ }
3442
+ // @__NO_SIDE_EFFECTS__
2546
3443
  function _unknown(Class) {
2547
3444
  return new Class({ type: "unknown" });
2548
3445
  }
@@ -2726,7 +3623,7 @@ window.__ModuleLoader__.load({
2726
3623
  const _issue = issue$2;
2727
3624
  if (_issue.fatal) _issue.continue = false;
2728
3625
  _issue.code ?? (_issue.code = "custom");
2729
- _issue.input ?? (_issue.input = payload.value);
3626
+ if (!("input" in _issue)) _issue.input = payload.value;
2730
3627
  _issue.inst ?? (_issue.inst = ch);
2731
3628
  _issue.continue ?? (_issue.continue = !ch._zod.def.abort);
2732
3629
  payload.issues.push(issue(_issue));
@@ -2746,7 +3643,11 @@ window.__ModuleLoader__.load({
2746
3643
  return ch;
2747
3644
  }
2748
3645
  //#endregion
2749
- //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.js
3646
+ //#region node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/to-json-schema.js
3647
+ function assignProps(target, ...sources) {
3648
+ for (const source of sources) for (const key of Reflect.ownKeys(source)) if (Object.prototype.propertyIsEnumerable.call(source, key)) assignProp(target, key, source[key]);
3649
+ return target;
3650
+ }
2750
3651
  function initializeContext(params) {
2751
3652
  let target = params?.target ?? "draft-2020-12";
2752
3653
  if (target === "draft-4") target = "draft-04";
@@ -2760,11 +3661,31 @@ window.__ModuleLoader__.load({
2760
3661
  io: params?.io ?? "output",
2761
3662
  counter: 0,
2762
3663
  seen: /* @__PURE__ */ new Map(),
3664
+ sharedDefsExtractedFor: void 0,
3665
+ sharedEmitDoneFor: void 0,
2763
3666
  cycles: params?.cycles ?? "ref",
2764
3667
  reused: params?.reused ?? "inline",
3668
+ intersections: [],
3669
+ deferred: [],
2765
3670
  external: params?.external ?? void 0
2766
3671
  };
2767
3672
  }
3673
+ /**
3674
+ * Applies the `unrepresentable` setting at a site that has no JSON Schema equivalent. Throws
3675
+ * `message` unless the setting (or the handler's return value) says otherwise. Returns `true` if a
3676
+ * custom JSON Schema was written into `json`, in which case the caller must not write its own.
3677
+ */
3678
+ function handleUnrepresentable(schema, ctx, json, params, message) {
3679
+ const result = typeof ctx.unrepresentable === "function" ? ctx.unrepresentable({
3680
+ zodSchema: schema,
3681
+ path: params.path,
3682
+ message
3683
+ }) : ctx.unrepresentable;
3684
+ if (result === "any") return false;
3685
+ if (result === void 0 || result === "throw") throw new Error(message);
3686
+ Object.assign(json, result);
3687
+ return true;
3688
+ }
2768
3689
  function process(schema, ctx, _params = {
2769
3690
  path: [],
2770
3691
  schemaPath: []
@@ -2784,6 +3705,8 @@ window.__ModuleLoader__.load({
2784
3705
  path: _params.path
2785
3706
  };
2786
3707
  ctx.seen.set(schema, result);
3708
+ ctx.sharedDefsExtractedFor = void 0;
3709
+ ctx.sharedEmitDoneFor = void 0;
2787
3710
  const overrideSchema = schema._zod.toJSONSchema?.();
2788
3711
  if (overrideSchema) result.schema = overrideSchema;
2789
3712
  else {
@@ -2807,7 +3730,7 @@ window.__ModuleLoader__.load({
2807
3730
  }
2808
3731
  }
2809
3732
  const meta = ctx.metadataRegistry.get(schema);
2810
- if (meta) Object.assign(result.schema, meta);
3733
+ if (meta) assignProps(result.schema, meta);
2811
3734
  if (ctx.io === "input" && isTransforming(schema)) {
2812
3735
  delete result.schema.examples;
2813
3736
  delete result.schema.default;
@@ -2816,9 +3739,13 @@ window.__ModuleLoader__.load({
2816
3739
  delete result.schema._prefault;
2817
3740
  return ctx.seen.get(schema).schema;
2818
3741
  }
3742
+ function encodeJSONPointerSegment(segment) {
3743
+ return segment.replace(/~/g, "~0").replace(/\//g, "~1");
3744
+ }
2819
3745
  function extractDefs(ctx, schema) {
2820
3746
  const root = ctx.seen.get(schema);
2821
3747
  if (!root) throw new Error("Unprocessed schema. This is a bug in Zod.");
3748
+ if (ctx.external && ctx.sharedDefsExtractedFor === ctx.external) return;
2822
3749
  const idToSchema = /* @__PURE__ */ new Map();
2823
3750
  for (const entry of ctx.seen.entries()) {
2824
3751
  const id = ctx.metadataRegistry.get(entry[0])?.id;
@@ -2838,15 +3765,16 @@ window.__ModuleLoader__.load({
2838
3765
  entry[1].defId = id;
2839
3766
  return {
2840
3767
  defId: id,
2841
- ref: `${uriGenerator("__shared")}#/${defsSegment}/${id}`
3768
+ ref: `${uriGenerator("__shared")}#/${defsSegment}/${encodeJSONPointerSegment(id)}`
2842
3769
  };
2843
3770
  }
2844
- if (entry[1] === root) return { ref: "#" };
2845
- const defUriPrefix = `#/${defsSegment}/`;
3771
+ const uriPrefix = `#`;
3772
+ const defUriPrefix = `${uriPrefix}/${defsSegment}/`;
3773
+ if (entry[1] === root && !entry[1].schema.id) return { ref: uriPrefix };
2846
3774
  const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;
2847
3775
  return {
2848
3776
  defId,
2849
- ref: defUriPrefix + defId
3777
+ ref: defUriPrefix + encodeJSONPointerSegment(defId)
2850
3778
  };
2851
3779
  };
2852
3780
  const extractToDef = (entry) => {
@@ -2893,6 +3821,111 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
2893
3821
  }
2894
3822
  }
2895
3823
  }
3824
+ if (ctx.external) ctx.sharedDefsExtractedFor = ctx.external;
3825
+ }
3826
+ /** Rewrites `anyOf: [{type: "a"}, {type: "b"}]` to `type: ["a", "b"]`, which every JSON Schema draft treats as equivalent and most consumers render far better for the nullable case. Only branches that are a bare type assertion qualify — anything carrying a constraint, `$ref`, `const` or metadata is left alone. Runs after `flattenRef`, so a branch an override decorated or `$defs` extraction turned into a `$ref` is no longer bare and correctly stays in `anyOf`. `oneOf` is excluded: `integer` and `number` overlap, so "exactly one" and "at least one" are not the same there. OpenAPI 3.0 is excluded: its `type` must be a single string. */
3827
+ function compactTypeUnion(schema) {
3828
+ const options = schema.anyOf;
3829
+ if (!Array.isArray(options) || options.length === 0 || schema.type !== void 0) return;
3830
+ const types = [];
3831
+ for (const option of options) {
3832
+ if (!option || typeof option !== "object") return;
3833
+ compactTypeUnion(option);
3834
+ const keys = Object.keys(option);
3835
+ if (keys.length !== 1 || keys[0] !== "type") return;
3836
+ const type = option.type;
3837
+ for (const member of Array.isArray(type) ? type : [type]) {
3838
+ if (typeof member !== "string") return;
3839
+ if (!types.includes(member)) types.push(member);
3840
+ }
3841
+ }
3842
+ delete schema.anyOf;
3843
+ schema.type = types.length === 1 ? types[0] : types;
3844
+ }
3845
+ /** Keywords `foldIntersection` knows how to combine. Anything else — `$ref`, `patternProperties`,
3846
+ * an annotation like `description` — makes a member unfoldable, so a constraint this does not
3847
+ * understand leaves the `allOf` alone instead of being silently dropped or misattributed. */
3848
+ const FOLDABLE_KEYS = /* @__PURE__ */ new Set([
3849
+ "type",
3850
+ "properties",
3851
+ "required",
3852
+ "additionalProperties"
3853
+ ]);
3854
+ const UNION_KEYS = ["oneOf", "anyOf"];
3855
+ /** A member's constraint on a key it does not declare itself. A `catchall` states one; `false`, an absent `additionalProperties`, and the empty schema a loose object emits state nothing. */
3856
+ function undeclaredConstraint(member) {
3857
+ const extra = member.additionalProperties;
3858
+ if (extra === void 0 || extra === false || typeof extra !== "object" || extra === null) return null;
3859
+ return Object.keys(extra).length ? extra : null;
3860
+ }
3861
+ /** Combines object members into the single object they describe together, or returns `null` if any of them carries a keyword outside {@link FOLDABLE_KEYS}. */
3862
+ function foldObjects(members) {
3863
+ const objects = [];
3864
+ for (const member of members) {
3865
+ if (typeof member !== "object" || member.type !== "object") return null;
3866
+ for (const key in member) if (!FOLDABLE_KEYS.has(key)) return null;
3867
+ objects.push(member);
3868
+ }
3869
+ const properties = {};
3870
+ const required = /* @__PURE__ */ new Set();
3871
+ for (const object of objects) {
3872
+ for (const key in object.properties) {
3873
+ if (Object.prototype.hasOwnProperty.call(properties, key)) continue;
3874
+ const parts = [];
3875
+ for (const other of objects) {
3876
+ const part = other.properties?.[key] ?? undeclaredConstraint(other);
3877
+ if (part === null || part === void 0) continue;
3878
+ if (!parts.some((seen) => JSON.stringify(seen) === JSON.stringify(part))) parts.push(part);
3879
+ }
3880
+ assignProp(properties, key, parts.length === 1 ? parts[0] : foldObjects(parts) ?? { allOf: parts });
3881
+ }
3882
+ for (const key of object.required ?? []) required.add(key);
3883
+ }
3884
+ const folded = {
3885
+ type: "object",
3886
+ properties
3887
+ };
3888
+ if (required.size) folded.required = [...required];
3889
+ if (objects.every((object) => object.additionalProperties === false)) folded.additionalProperties = false;
3890
+ else {
3891
+ const constraints = [];
3892
+ for (const object of objects) {
3893
+ const constraint = undeclaredConstraint(object);
3894
+ if (constraint && !constraints.some((seen) => JSON.stringify(seen) === JSON.stringify(constraint))) constraints.push(constraint);
3895
+ }
3896
+ if (constraints.length === 1) folded.additionalProperties = constraints[0];
3897
+ else if (constraints.length > 1) folded.additionalProperties = { allOf: constraints };
3898
+ }
3899
+ return folded;
3900
+ }
3901
+ /** `additionalProperties` in an `allOf` member sees only that member's own `properties`, so two
3902
+ * closed object members reject each other's keys and the schema validates nothing. Zod's parser
3903
+ * pools the key sets instead — `handleIntersectionResults` reports a key as unrecognized only when
3904
+ * *every* side rejects it — so the emitted schema has to pool them too, and folding the members
3905
+ * into one object is the encoding that says so on every target.
3906
+ *
3907
+ * This runs from `finalize`, after `extractDefs`, which is what keeps it clear of the `$ref`
3908
+ * machinery: a member extracted into `$defs` is already a `$ref` by now and declines to fold, so it
3909
+ * keeps its reference and its own closedness rather than being inlined as a stale copy. */
3910
+ function foldIntersection(json) {
3911
+ const allOf = json.allOf;
3912
+ if (!Array.isArray(allOf) || allOf.length < 2) return;
3913
+ for (const key of FOLDABLE_KEYS) if (key in json) return;
3914
+ const unions = allOf.filter((m) => UNION_KEYS.some((k) => Array.isArray(m[k])));
3915
+ let folded = null;
3916
+ if (!unions.length) folded = foldObjects(allOf);
3917
+ else {
3918
+ const union = unions[0];
3919
+ const keyword = UNION_KEYS.find((k) => Array.isArray(union[k]));
3920
+ if (Object.keys(union).length !== 1) return;
3921
+ const rest = allOf.filter((m) => m !== union);
3922
+ const branches = union[keyword].map((branch) => foldObjects([...rest, branch]));
3923
+ if (branches.some((b) => !b)) return;
3924
+ folded = { [keyword]: branches };
3925
+ }
3926
+ if (!folded) return;
3927
+ delete json.allOf;
3928
+ assignProps(json, folded);
2896
3929
  }
2897
3930
  function finalize(ctx, schema) {
2898
3931
  const root = ctx.seen.get(schema);
@@ -2911,8 +3944,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
2911
3944
  if (refSchema.$ref && (ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0")) {
2912
3945
  schema.allOf = schema.allOf ?? [];
2913
3946
  schema.allOf.push(refSchema);
2914
- } else Object.assign(schema, refSchema);
2915
- Object.assign(schema, _cached);
3947
+ } else assignProps(schema, refSchema);
3948
+ assignProps(schema, _cached);
2916
3949
  if (zodSchema._zod.parent === ref) for (const key in schema) {
2917
3950
  if (key === "$ref" || key === "allOf") continue;
2918
3951
  if (!(key in _cached)) delete schema[key];
@@ -2940,7 +3973,22 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
2940
3973
  path: seen.path ?? []
2941
3974
  });
2942
3975
  };
2943
- for (const entry of [...ctx.seen.entries()].reverse()) flattenRef(entry[0]);
3976
+ if (!ctx.external || ctx.sharedEmitDoneFor !== ctx.external) {
3977
+ for (const entry of [...ctx.seen.entries()].reverse()) flattenRef(entry[0]);
3978
+ if (ctx.target !== "openapi-3.0") for (const entry of ctx.seen.entries()) compactTypeUnion(entry[1].def ?? entry[1].schema);
3979
+ for (const rewrite of ctx.deferred) rewrite();
3980
+ if (ctx.intersections.length) {
3981
+ const carriers = /* @__PURE__ */ new Map();
3982
+ for (const seen of ctx.seen.values()) for (const json of [seen.schema, seen.def]) {
3983
+ const allOf = json?.allOf;
3984
+ if (!Array.isArray(allOf)) continue;
3985
+ const existing = carriers.get(allOf);
3986
+ if (existing) existing.push(json);
3987
+ else carriers.set(allOf, [json]);
3988
+ }
3989
+ for (const allOf of ctx.intersections) for (const json of carriers.get(allOf) ?? []) foldIntersection(json);
3990
+ }
3991
+ }
2944
3992
  const result = {};
2945
3993
  if (ctx.target === "draft-2020-12") result.$schema = "https://json-schema.org/draft/2020-12/schema";
2946
3994
  else if (ctx.target === "draft-07") result.$schema = "http://json-schema.org/draft-07/schema#";
@@ -2951,17 +3999,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
2951
3999
  if (!id) throw new Error("Schema is missing an `id` property");
2952
4000
  result.$id = ctx.external.uri(id);
2953
4001
  }
2954
- Object.assign(result, root.def ?? root.schema);
4002
+ assignProps(result, root.defId ? root.schema : root.def ?? root.schema);
2955
4003
  const rootMetaId = ctx.metadataRegistry.get(schema)?.id;
2956
4004
  if (rootMetaId !== void 0 && result.id === rootMetaId) delete result.id;
2957
4005
  const defs = ctx.external?.defs ?? {};
2958
- for (const entry of ctx.seen.entries()) {
4006
+ if (!ctx.external || ctx.sharedEmitDoneFor !== ctx.external) for (const entry of ctx.seen.entries()) {
2959
4007
  const seen = entry[1];
2960
4008
  if (seen.def && seen.defId) {
2961
4009
  if (seen.def.id === seen.defId) delete seen.def.id;
2962
- defs[seen.defId] = seen.def;
4010
+ assignProp(defs, seen.defId, seen.def);
2963
4011
  }
2964
4012
  }
4013
+ if (ctx.external) ctx.sharedEmitDoneFor = ctx.external;
2965
4014
  if (ctx.external) {} else if (Object.keys(defs).length > 0) {
2966
4015
  if (ctx.target === "draft-2020-12") result.$defs = defs;
2967
4016
  else result.definitions = defs;
@@ -2993,7 +4042,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
2993
4042
  if (def.type === "array") return isTransforming(def.element, ctx);
2994
4043
  if (def.type === "set") return isTransforming(def.valueType, ctx);
2995
4044
  if (def.type === "lazy") return isTransforming(def.getter(), ctx);
2996
- 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);
4045
+ if (def.type === "promise" || def.type === "optional" || def.type === "nonoptional" || def.type === "nullable" || def.type === "readonly" || def.type === "default" || def.type === "prefault" || def.type === "catch") return isTransforming(def.innerType, ctx);
2997
4046
  if (def.type === "intersection") return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);
2998
4047
  if (def.type === "record" || def.type === "map") return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);
2999
4048
  if (def.type === "pipe") {
@@ -3041,7 +4090,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3041
4090
  return finalize(ctx, schema);
3042
4091
  };
3043
4092
  //#endregion
3044
- //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/json-schema-processors.js
4093
+ //#region node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/core/json-schema-processors.js
3045
4094
  const formatMap = {
3046
4095
  guid: "uuid",
3047
4096
  url: "uri",
@@ -3052,25 +4101,25 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3052
4101
  const stringProcessor = (schema, ctx, _json, _params) => {
3053
4102
  const json = _json;
3054
4103
  json.type = "string";
3055
- const { minimum, maximum, format, patterns, contentEncoding } = schema._zod.bag;
4104
+ const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = schema._zod.bag;
3056
4105
  if (typeof minimum === "number") json.minLength = minimum;
3057
4106
  if (typeof maximum === "number") json.maxLength = maximum;
3058
4107
  if (format) {
3059
4108
  json.format = formatMap[format] ?? format;
3060
4109
  if (json.format === "") delete json.format;
3061
- if (format === "time") delete json.format;
4110
+ if (format === "time" || laxFormat) delete json.format;
3062
4111
  }
3063
4112
  if (contentEncoding) json.contentEncoding = contentEncoding;
3064
4113
  if (patterns && patterns.size > 0) {
3065
- const regexes = [...patterns];
3066
- if (regexes.length === 1) json.pattern = regexes[0].source;
3067
- else if (regexes.length > 1) json.allOf = [...regexes.map((regex) => ({
4114
+ const patternList = [...patterns];
4115
+ if (patternList.length === 1) json.pattern = patternList[0].source;
4116
+ else if (patternList.length > 1) json.allOf = [...patternList.map((regex) => ({
3068
4117
  ...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
3069
4118
  pattern: regex.source
3070
4119
  }))];
3071
4120
  }
3072
4121
  };
3073
- const numberProcessor = (schema, ctx, _json, _params) => {
4122
+ const numberProcessor = (schema, ctx, _json, params) => {
3074
4123
  const json = _json;
3075
4124
  const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;
3076
4125
  if (typeof format === "string" && format.includes("int")) json.type = "integer";
@@ -3090,29 +4139,47 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3090
4139
  json.exclusiveMaximum = true;
3091
4140
  } else json.exclusiveMaximum = exclusiveMaximum;
3092
4141
  } else if (typeof maximum === "number") json.maximum = maximum;
3093
- if (typeof multipleOf === "number") json.multipleOf = multipleOf;
4142
+ if (typeof multipleOf === "number") {
4143
+ if (Number.isFinite(multipleOf) && multipleOf !== 0) json.multipleOf = Math.abs(multipleOf);
4144
+ else handleUnrepresentable(schema, ctx, json, params, `A multipleOf divisor of ${multipleOf} cannot be represented in JSON Schema`);
4145
+ }
3094
4146
  };
3095
4147
  const booleanProcessor = (_schema, _ctx, json, _params) => {
3096
4148
  json.type = "boolean";
3097
4149
  };
4150
+ const nullProcessor = (_schema, ctx, json, _params) => {
4151
+ if (ctx.target === "openapi-3.0") {
4152
+ json.type = "string";
4153
+ json.nullable = true;
4154
+ json.enum = [null];
4155
+ } else json.type = "null";
4156
+ };
3098
4157
  const neverProcessor = (_schema, _ctx, json, _params) => {
3099
4158
  json.not = {};
3100
4159
  };
3101
4160
  const enumProcessor = (schema, _ctx, json, _params) => {
3102
4161
  const def = schema._zod.def;
3103
4162
  const values = getEnumValues(def.entries);
4163
+ if (values.length === 0) {
4164
+ json.not = {};
4165
+ return;
4166
+ }
3104
4167
  if (values.every((v) => typeof v === "number")) json.type = "number";
3105
4168
  if (values.every((v) => typeof v === "string")) json.type = "string";
3106
4169
  json.enum = values;
3107
4170
  };
3108
- const literalProcessor = (schema, ctx, json, _params) => {
4171
+ const literalProcessor = (schema, ctx, json, params) => {
3109
4172
  const def = schema._zod.def;
4173
+ if (def.values.length === 0) {
4174
+ json.not = {};
4175
+ return;
4176
+ }
3110
4177
  const vals = [];
3111
4178
  for (const val of def.values) if (val === void 0) {
3112
- if (ctx.unrepresentable === "throw") throw new Error("Literal `undefined` cannot be represented in JSON Schema");
4179
+ if (handleUnrepresentable(schema, ctx, json, params, "Literal `undefined` cannot be represented in JSON Schema")) return;
3113
4180
  } else if (typeof val === "bigint") {
3114
- if (ctx.unrepresentable === "throw") throw new Error("BigInt literals cannot be represented in JSON Schema");
3115
- else vals.push(Number(val));
4181
+ if (handleUnrepresentable(schema, ctx, json, params, "BigInt literals cannot be represented in JSON Schema")) return;
4182
+ vals.push(Number(val));
3116
4183
  } else vals.push(val);
3117
4184
  if (vals.length === 0) {} else if (vals.length === 1) {
3118
4185
  const val = vals[0];
@@ -3127,11 +4194,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3127
4194
  json.enum = vals;
3128
4195
  }
3129
4196
  };
3130
- const customProcessor = (_schema, ctx, _json, _params) => {
3131
- if (ctx.unrepresentable === "throw") throw new Error("Custom types cannot be represented in JSON Schema");
4197
+ const customProcessor = (schema, ctx, json, params) => {
4198
+ handleUnrepresentable(schema, ctx, json, params, "Custom types cannot be represented in JSON Schema");
3132
4199
  };
3133
- const transformProcessor = (_schema, ctx, _json, _params) => {
3134
- if (ctx.unrepresentable === "throw") throw new Error("Transforms cannot be represented in JSON Schema");
4200
+ const transformProcessor = (schema, ctx, json, params) => {
4201
+ handleUnrepresentable(schema, ctx, json, params, "Transforms cannot be represented in JSON Schema");
3135
4202
  };
3136
4203
  const arrayProcessor = (schema, ctx, _json, params) => {
3137
4204
  const json = _json;
@@ -3145,25 +4212,32 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3145
4212
  path: [...params.path, "items"]
3146
4213
  });
3147
4214
  };
4215
+ function inputOptin(schema) {
4216
+ const def = schema._zod.def;
4217
+ if (def.type === "pipe" && def.in._zod.traits.has("$ZodTransform")) return inputOptin(def.out);
4218
+ if (def.type === "catch") return inputOptin(def.innerType);
4219
+ return schema._zod.optin;
4220
+ }
3148
4221
  const objectProcessor = (schema, ctx, _json, params) => {
3149
4222
  const json = _json;
3150
4223
  const def = schema._zod.def;
4224
+ const shape = def.shape;
4225
+ if (Object.getOwnPropertySymbols(shape).length && handleUnrepresentable(schema, ctx, json, params, "Symbol keys cannot be represented in JSON Schema")) return;
3151
4226
  json.type = "object";
3152
4227
  json.properties = {};
3153
- const shape = def.shape;
3154
- for (const key in shape) json.properties[key] = process(shape[key], ctx, {
4228
+ for (const key in shape) assignProp(json.properties, key, process(shape[key], ctx, {
3155
4229
  ...params,
3156
4230
  path: [
3157
4231
  ...params.path,
3158
4232
  "properties",
3159
4233
  key
3160
4234
  ]
3161
- });
4235
+ }));
3162
4236
  const allKeys = new Set(Object.keys(shape));
3163
4237
  const requiredKeys = new Set([...allKeys].filter((key) => {
3164
- const v = def.shape[key]._zod;
3165
- if (ctx.io === "input") return v.optin === void 0;
3166
- else return v.optout === void 0;
4238
+ const field = def.shape[key];
4239
+ if (ctx.io === "input") return inputOptin(field) === void 0;
4240
+ else return field._zod.optout === void 0;
3167
4241
  }));
3168
4242
  if (requiredKeys.size > 0) json.required = Array.from(requiredKeys);
3169
4243
  if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
@@ -3207,7 +4281,110 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3207
4281
  ]
3208
4282
  });
3209
4283
  const isSimpleIntersection = (val) => "allOf" in val && Object.keys(val).length === 1;
3210
- json.allOf = [...isSimpleIntersection(a) ? a.allOf : [a], ...isSimpleIntersection(b) ? b.allOf : [b]];
4284
+ const allOf = [...isSimpleIntersection(a) ? a.allOf : [a], ...isSimpleIntersection(b) ? b.allOf : [b]];
4285
+ json.allOf = allOf;
4286
+ ctx.intersections.push(allOf);
4287
+ };
4288
+ /** JSON object keys are always strings, so a numeric record key schema is re-expressed over the
4289
+ * numeric-string form the record parser matches. Deferred to `finalize`, after the flatten: a key
4290
+ * behind a wrapper only carries its own `type` before then, and a union key only has its branches.
4291
+ *
4292
+ * A numeric bound cannot apply to a property name, so `minimum` and its siblings are dropped rather
4293
+ * than carried over: keeping them beside `type: "string"` reproduces the match-nothing schema this
4294
+ * exists to fix. A key that carries one therefore emits wider than the record parses — `z.record(z.number().min(5), V)`
4295
+ * accepts `"3"` — which is the deliberate trade, since throwing on it would reject an ordinary schema
4296
+ * outright. */
4297
+ function stringifyKeyNames(bySchema, json, visited) {
4298
+ if (json.$ref) {
4299
+ if (visited.has(json)) return json;
4300
+ visited.add(json);
4301
+ const def = bySchema.get(json)?.def;
4302
+ if (!def) return json;
4303
+ const inlined = stringifyKeyNames(bySchema, def, visited);
4304
+ return inlined === def ? json : inlined;
4305
+ }
4306
+ for (const keyword of ["anyOf", "oneOf"]) {
4307
+ const branches = json[keyword];
4308
+ if (!Array.isArray(branches)) continue;
4309
+ const mapped = branches.map((branch) => stringifyKeyNames(bySchema, branch, visited));
4310
+ if (mapped.some((branch, i) => branch !== branches[i])) json = {
4311
+ ...json,
4312
+ [keyword]: mapped
4313
+ };
4314
+ }
4315
+ const types = Array.isArray(json.type) ? json.type : [json.type];
4316
+ const numericType = !types.includes("string") && types.some((t) => t === "number" || t === "integer");
4317
+ const values = json.enum ?? (json.const !== void 0 ? [json.const] : void 0);
4318
+ if (!numericType && !values?.some((v) => typeof v === "number")) return json;
4319
+ const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format, id, ...rest } = json;
4320
+ if (rest.enum) rest.enum = rest.enum.map((v) => typeof v === "number" ? String(v) : v);
4321
+ else if (typeof rest.const === "number") rest.const = String(rest.const);
4322
+ if (!numericType) return rest;
4323
+ rest.type = "string";
4324
+ if (!values) rest.pattern = (types.includes("number") ? number$1 : integer).source;
4325
+ return rest;
4326
+ }
4327
+ /** Every record of one conversion, so the carriers are found in a single pass rather than once per record. */
4328
+ const pendingRecords = /* @__PURE__ */ new WeakMap();
4329
+ function rewriteKeyNames(ctx) {
4330
+ const bySchema = /* @__PURE__ */ new Map();
4331
+ for (const entry of ctx.seen.values()) if (entry.def && !bySchema.has(entry.schema)) bySchema.set(entry.schema, entry);
4332
+ const rewrites = /* @__PURE__ */ new Map();
4333
+ for (const record of pendingRecords.get(ctx) ?? []) {
4334
+ const seen = ctx.seen.get(record);
4335
+ const names = (seen?.def ?? seen?.schema)?.propertyNames;
4336
+ if (!names || names === true || rewrites.has(names)) continue;
4337
+ const rewritten = stringifyKeyNames(bySchema, names, /* @__PURE__ */ new Set());
4338
+ if (rewritten !== names) rewrites.set(names, rewritten);
4339
+ }
4340
+ if (!rewrites.size) return;
4341
+ for (const entry of ctx.seen.values()) for (const carrier of [entry.schema, entry.def]) {
4342
+ const rewritten = carrier && rewrites.get(carrier.propertyNames);
4343
+ if (rewritten) carrier.propertyNames = rewritten;
4344
+ }
4345
+ }
4346
+ const recordProcessor = (schema, ctx, _json, params) => {
4347
+ const json = _json;
4348
+ const def = schema._zod.def;
4349
+ json.type = "object";
4350
+ const keyType = def.keyType;
4351
+ const patterns = keyType._zod.bag?.patterns;
4352
+ if (def.mode === "loose" && patterns && patterns.size > 0) {
4353
+ const valueSchema = process(def.valueType, ctx, {
4354
+ ...params,
4355
+ path: [
4356
+ ...params.path,
4357
+ "patternProperties",
4358
+ "*"
4359
+ ]
4360
+ });
4361
+ json.patternProperties = {};
4362
+ for (const pattern of patterns) assignProp(json.patternProperties, pattern.source, valueSchema);
4363
+ } else {
4364
+ if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
4365
+ json.propertyNames = process(def.keyType, ctx, {
4366
+ ...params,
4367
+ path: [...params.path, "propertyNames"]
4368
+ });
4369
+ let pending = pendingRecords.get(ctx);
4370
+ if (!pending) {
4371
+ pending = [];
4372
+ pendingRecords.set(ctx, pending);
4373
+ ctx.deferred.push(() => rewriteKeyNames(ctx));
4374
+ }
4375
+ pending.push(schema);
4376
+ }
4377
+ json.additionalProperties = process(def.valueType, ctx, {
4378
+ ...params,
4379
+ path: [...params.path, "additionalProperties"]
4380
+ });
4381
+ }
4382
+ const keyValues = keyType._zod.values;
4383
+ const omittableOnInput = ctx.io === "input" && inputOptin(def.valueType) !== void 0;
4384
+ if (keyValues && !def.partial && !omittableOnInput) {
4385
+ const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
4386
+ if (validKeyValues.length > 0) json.required = validKeyValues.map(String);
4387
+ }
3211
4388
  };
3212
4389
  const nullableProcessor = (schema, ctx, json, params) => {
3213
4390
  const def = schema._zod.def;
@@ -3224,19 +4401,37 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3224
4401
  const seen = ctx.seen.get(schema);
3225
4402
  seen.ref = def.innerType;
3226
4403
  };
4404
+ /** Round-trips a default value through JSON so the emitted schema is guaranteed to be valid JSON.
4405
+ * A BigInt has no reliable encoding, so it goes through `unrepresentable` like any other
4406
+ * unrepresentable value. Returns a sentinel when the caller must not write a default of its own. */
4407
+ const UNREPRESENTABLE_DEFAULT = Symbol();
4408
+ function serializeDefaultValue(value, schema, ctx, json, params) {
4409
+ let unrepresentable = false;
4410
+ const serialized = JSON.stringify(value, (_, val) => {
4411
+ if (typeof val !== "bigint") return val;
4412
+ unrepresentable = true;
4413
+ return null;
4414
+ });
4415
+ if (!unrepresentable) return JSON.parse(serialized);
4416
+ handleUnrepresentable(schema, ctx, json, params, "BigInt defaults cannot be represented in JSON Schema");
4417
+ return UNREPRESENTABLE_DEFAULT;
4418
+ }
3227
4419
  const defaultProcessor = (schema, ctx, json, params) => {
3228
4420
  const def = schema._zod.def;
3229
4421
  process(def.innerType, ctx, params);
3230
4422
  const seen = ctx.seen.get(schema);
3231
4423
  seen.ref = def.innerType;
3232
- json.default = JSON.parse(JSON.stringify(def.defaultValue));
4424
+ const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);
4425
+ if (value !== UNREPRESENTABLE_DEFAULT) json.default = value;
3233
4426
  };
3234
4427
  const prefaultProcessor = (schema, ctx, json, params) => {
3235
4428
  const def = schema._zod.def;
3236
4429
  process(def.innerType, ctx, params);
3237
4430
  const seen = ctx.seen.get(schema);
3238
4431
  seen.ref = def.innerType;
3239
- if (ctx.io === "input") json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
4432
+ if (ctx.io !== "input") return;
4433
+ const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);
4434
+ if (value !== UNREPRESENTABLE_DEFAULT) json._prefault = value;
3240
4435
  };
3241
4436
  const catchProcessor = (schema, ctx, json, params) => {
3242
4437
  const def = schema._zod.def;
@@ -3247,7 +4442,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3247
4442
  try {
3248
4443
  catchValue = def.catchValue(void 0);
3249
4444
  } catch {
3250
- throw new Error("Dynamic catch values are not supported in JSON Schema");
4445
+ handleUnrepresentable(schema, ctx, json, params, "Dynamic catch values are not supported in JSON Schema");
4446
+ return;
3251
4447
  }
3252
4448
  json.default = catchValue;
3253
4449
  };
@@ -3264,68 +4460,72 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3264
4460
  process(def.innerType, ctx, params);
3265
4461
  const seen = ctx.seen.get(schema);
3266
4462
  seen.ref = def.innerType;
3267
- json.readOnly = true;
3268
- };
3269
- const optionalProcessor = (schema, ctx, _json, params) => {
3270
- const def = schema._zod.def;
3271
- process(def.innerType, ctx, params);
3272
- const seen = ctx.seen.get(schema);
3273
- seen.ref = def.innerType;
3274
- };
3275
- //#endregion
3276
- //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/iso.js
3277
- const ZodISODateTime = /*@__PURE__*/ $constructor("ZodISODateTime", (inst, def) => {
3278
- $ZodISODateTime.init(inst, def);
3279
- ZodStringFormat.init(inst, def);
3280
- });
3281
- function datetime(params) {
3282
- return /* @__PURE__ */ _isoDateTime(ZodISODateTime, params);
3283
- }
3284
- const ZodISODate = /*@__PURE__*/ $constructor("ZodISODate", (inst, def) => {
3285
- $ZodISODate.init(inst, def);
3286
- ZodStringFormat.init(inst, def);
3287
- });
3288
- function date(params) {
3289
- return /* @__PURE__ */ _isoDate(ZodISODate, params);
3290
- }
3291
- const ZodISOTime = /*@__PURE__*/ $constructor("ZodISOTime", (inst, def) => {
3292
- $ZodISOTime.init(inst, def);
3293
- ZodStringFormat.init(inst, def);
3294
- });
3295
- function time(params) {
3296
- return /* @__PURE__ */ _isoTime(ZodISOTime, params);
3297
- }
3298
- const ZodISODuration = /*@__PURE__*/ $constructor("ZodISODuration", (inst, def) => {
3299
- $ZodISODuration.init(inst, def);
3300
- ZodStringFormat.init(inst, def);
3301
- });
3302
- function duration(params) {
3303
- return /* @__PURE__ */ _isoDuration(ZodISODuration, params);
3304
- }
4463
+ json.readOnly = true;
4464
+ };
4465
+ const optionalProcessor = (schema, ctx, _json, params) => {
4466
+ const def = schema._zod.def;
4467
+ process(def.innerType, ctx, params);
4468
+ const seen = ctx.seen.get(schema);
4469
+ seen.ref = def.innerType;
4470
+ };
4471
+ const lazyProcessor = (schema, ctx, _json, params) => {
4472
+ const innerType = schema._zod.innerType;
4473
+ process(innerType, ctx, params);
4474
+ const seen = ctx.seen.get(schema);
4475
+ seen.ref = innerType;
4476
+ };
3305
4477
  //#endregion
3306
- //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/errors.js
4478
+ //#region node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/errors.js
4479
+ const _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
4480
+ function _lazyMethod(proto, key, make) {
4481
+ Object.defineProperty(proto, key, {
4482
+ configurable: true,
4483
+ enumerable: false,
4484
+ get() {
4485
+ const value = make(this);
4486
+ Object.defineProperty(this, key, {
4487
+ value,
4488
+ configurable: true,
4489
+ writable: true
4490
+ });
4491
+ return value;
4492
+ },
4493
+ set(value) {
4494
+ Object.defineProperty(this, key, {
4495
+ value,
4496
+ configurable: true,
4497
+ writable: true
4498
+ });
4499
+ }
4500
+ });
4501
+ }
3307
4502
  const initializer = (inst, issues) => {
3308
4503
  $ZodError.init(inst, issues);
3309
4504
  inst.name = "ZodError";
3310
- Object.defineProperties(inst, {
3311
- format: { value: (mapper) => formatError(inst, mapper) },
3312
- flatten: { value: (mapper) => flattenError(inst, mapper) },
3313
- addIssue: { value: (issue) => {
3314
- inst.issues.push(issue);
3315
- inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
3316
- } },
3317
- addIssues: { value: (issues) => {
3318
- inst.issues.push(...issues);
3319
- inst.message = JSON.stringify(inst.issues, jsonStringifyReplacer, 2);
3320
- } },
3321
- isEmpty: { get() {
3322
- return inst.issues.length === 0;
3323
- } }
4505
+ const proto = Object.getPrototypeOf(inst);
4506
+ if (_installedErrorProtos.has(proto)) return;
4507
+ _installedErrorProtos.add(proto);
4508
+ _lazyMethod(proto, "format", (self) => (mapper) => formatError(self, mapper));
4509
+ _lazyMethod(proto, "flatten", (self) => (mapper) => flattenError(self, mapper));
4510
+ _lazyMethod(proto, "addIssue", (self) => (issue) => {
4511
+ self.issues.push(issue);
4512
+ self.message = JSON.stringify(self.issues, jsonStringifyReplacer, 2);
4513
+ });
4514
+ _lazyMethod(proto, "addIssues", (self) => (issues) => {
4515
+ self.issues.push(...issues);
4516
+ self.message = JSON.stringify(self.issues, jsonStringifyReplacer, 2);
4517
+ });
4518
+ Object.defineProperty(proto, "isEmpty", {
4519
+ configurable: true,
4520
+ enumerable: false,
4521
+ get() {
4522
+ return this.issues.length === 0;
4523
+ }
3324
4524
  });
3325
4525
  };
3326
- const ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, { Parent: Error });
4526
+ const ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, void 0, { Parent: Error });
3327
4527
  //#endregion
3328
- //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/parse.js
4528
+ //#region node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/parse.js
3329
4529
  const parse = /* @__PURE__ */ _parse(ZodRealError);
3330
4530
  const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
3331
4531
  const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
@@ -3339,167 +4539,175 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3339
4539
  const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
3340
4540
  const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
3341
4541
  //#endregion
3342
- //#region node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/schemas.js
3343
- const _installedGroups = /* @__PURE__ */ new WeakMap();
3344
- function _installLazyMethods(inst, group, methods) {
3345
- const proto = Object.getPrototypeOf(inst);
3346
- let installed = _installedGroups.get(proto);
3347
- if (!installed) {
3348
- installed = /* @__PURE__ */ new Set();
3349
- _installedGroups.set(proto, installed);
3350
- }
3351
- if (installed.has(group)) return;
3352
- installed.add(group);
3353
- for (const key in methods) {
3354
- const fn = methods[key];
3355
- Object.defineProperty(proto, key, {
3356
- configurable: true,
3357
- enumerable: false,
3358
- get() {
3359
- const bound = fn.bind(this);
3360
- Object.defineProperty(this, key, {
3361
- configurable: true,
3362
- writable: true,
3363
- enumerable: true,
3364
- value: bound
3365
- });
3366
- return bound;
3367
- },
3368
- set(v) {
3369
- Object.defineProperty(this, key, {
3370
- configurable: true,
3371
- writable: true,
3372
- enumerable: true,
3373
- value: v
3374
- });
3375
- }
3376
- });
3377
- }
4542
+ //#region node_modules/.pnpm/zod@4.5.4/node_modules/zod/v4/classic/schemas.js
4543
+ function _ensureDefaultLocale() {
4544
+ if (!globalConfig.localeError) config(en_default());
4545
+ }
4546
+ function _ensureDefaultMemoizer() {
4547
+ if (!globalConfig.memoizer) config({ memoizer: memoizer() });
3378
4548
  }
3379
4549
  const ZodType = /*@__PURE__*/ $constructor("ZodType", (inst, def) => {
4550
+ _ensureDefaultLocale();
3380
4551
  $ZodType.init(inst, def);
3381
- Object.assign(inst["~standard"], { jsonSchema: {
3382
- input: createStandardJSONSchemaMethod(inst, "input"),
3383
- output: createStandardJSONSchemaMethod(inst, "output")
3384
- } });
3385
- inst.toJSONSchema = createToJSONSchemaMethod(inst, {});
3386
4552
  inst.def = def;
3387
4553
  inst.type = def.type;
3388
- Object.defineProperty(inst, "_def", { value: def });
3389
- inst.parse = (data, params) => parse(inst, data, params, { callee: inst.parse });
3390
- inst.safeParse = (data, params) => safeParse(inst, data, params);
3391
- inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync });
3392
- inst.safeParseAsync = async (data, params) => safeParseAsync(inst, data, params);
3393
- inst.spa = inst.safeParseAsync;
3394
- inst.encode = (data, params) => encode(inst, data, params);
3395
- inst.decode = (data, params) => decode(inst, data, params);
3396
- inst.encodeAsync = async (data, params) => encodeAsync(inst, data, params);
3397
- inst.decodeAsync = async (data, params) => decodeAsync(inst, data, params);
3398
- inst.safeEncode = (data, params) => safeEncode(inst, data, params);
3399
- inst.safeDecode = (data, params) => safeDecode(inst, data, params);
3400
- inst.safeEncodeAsync = async (data, params) => safeEncodeAsync(inst, data, params);
3401
- inst.safeDecodeAsync = async (data, params) => safeDecodeAsync(inst, data, params);
3402
- _installLazyMethods(inst, "ZodType", {
3403
- check(...chks) {
3404
- const def = this.def;
3405
- return this.clone(mergeDefs(def, { checks: [...def.checks ?? [], ...chks.map((ch) => typeof ch === "function" ? { _zod: {
3406
- check: ch,
3407
- def: { check: "custom" },
3408
- onattach: []
3409
- } } : ch)] }), { parent: true });
3410
- },
3411
- with(...chks) {
3412
- return this.check(...chks);
3413
- },
3414
- clone(def, params) {
3415
- return clone(this, def, params);
3416
- },
3417
- brand() {
3418
- return this;
3419
- },
3420
- register(reg, meta) {
3421
- reg.add(this, meta);
3422
- return this;
3423
- },
3424
- refine(check, params) {
3425
- return this.check(refine(check, params));
3426
- },
3427
- superRefine(refinement, params) {
3428
- return this.check(superRefine(refinement, params));
3429
- },
3430
- overwrite(fn) {
3431
- return this.check(/* @__PURE__ */ _overwrite(fn));
3432
- },
3433
- optional() {
3434
- return optional(this);
3435
- },
3436
- exactOptional() {
3437
- return exactOptional(this);
3438
- },
3439
- nullable() {
3440
- return nullable(this);
3441
- },
3442
- nullish() {
3443
- return optional(nullable(this));
3444
- },
3445
- nonoptional(params) {
3446
- return nonoptional(this, params);
3447
- },
3448
- array() {
3449
- return array(this);
3450
- },
3451
- or(arg) {
3452
- return union([this, arg]);
3453
- },
3454
- and(arg) {
3455
- return intersection(this, arg);
3456
- },
3457
- transform(tx) {
3458
- return pipe(this, transform(tx));
3459
- },
3460
- default(d) {
3461
- return _default(this, d);
3462
- },
3463
- prefault(d) {
3464
- return prefault(this, d);
3465
- },
3466
- catch(params) {
3467
- return _catch(this, params);
3468
- },
3469
- pipe(target) {
3470
- return pipe(this, target);
3471
- },
3472
- readonly() {
3473
- return readonly(this);
3474
- },
3475
- describe(description) {
3476
- const cl = this.clone();
3477
- globalRegistry.add(cl, { description });
3478
- return cl;
3479
- },
3480
- meta(...args) {
3481
- if (args.length === 0) return globalRegistry.get(this);
3482
- const cl = this.clone();
3483
- globalRegistry.add(cl, args[0]);
3484
- return cl;
3485
- },
3486
- isOptional() {
3487
- return this.safeParse(void 0).success;
3488
- },
3489
- isNullable() {
3490
- return this.safeParse(null).success;
3491
- },
3492
- apply(fn) {
3493
- return fn(this);
3494
- }
3495
- });
3496
- Object.defineProperty(inst, "description", {
3497
- get() {
3498
- return globalRegistry.get(inst)?.description;
3499
- },
3500
- configurable: true
3501
- });
3502
4554
  return inst;
4555
+ }, {
4556
+ check(...chks) {
4557
+ const def = this.def;
4558
+ return this.clone(mergeDefs(def, { checks: [...def.checks ?? [], ...chks.map((ch) => typeof ch === "function" ? { _zod: {
4559
+ check: ch,
4560
+ def: { check: "custom" },
4561
+ onattach: []
4562
+ } } : ch)] }), { parent: true });
4563
+ },
4564
+ with(...chks) {
4565
+ return this.check(...chks);
4566
+ },
4567
+ clone(def, params) {
4568
+ return clone(this, def, params);
4569
+ },
4570
+ brand() {
4571
+ return this;
4572
+ },
4573
+ register(reg, meta) {
4574
+ reg.add(this, meta);
4575
+ return this;
4576
+ },
4577
+ refine(check, params) {
4578
+ return this.check(refine(check, params));
4579
+ },
4580
+ superRefine(refinement, params) {
4581
+ return this.check(superRefine(refinement, params));
4582
+ },
4583
+ overwrite(fn) {
4584
+ return this.check(/* @__PURE__ */ _overwrite(fn));
4585
+ },
4586
+ optional() {
4587
+ return optional(this);
4588
+ },
4589
+ exactOptional() {
4590
+ return exactOptional(this);
4591
+ },
4592
+ nullable() {
4593
+ return nullable(this);
4594
+ },
4595
+ nullish() {
4596
+ return optional(nullable(this));
4597
+ },
4598
+ nonoptional(params) {
4599
+ return nonoptional(this, params);
4600
+ },
4601
+ array() {
4602
+ return array(this);
4603
+ },
4604
+ or(arg) {
4605
+ return union([this, arg]);
4606
+ },
4607
+ and(arg) {
4608
+ return intersection(this, arg);
4609
+ },
4610
+ transform(tx) {
4611
+ return pipe(this, transform(tx));
4612
+ },
4613
+ default(d) {
4614
+ return _default(this, d);
4615
+ },
4616
+ prefault(d) {
4617
+ return prefault(this, d);
4618
+ },
4619
+ catch(params) {
4620
+ return _catch(this, params);
4621
+ },
4622
+ pipe(target) {
4623
+ return pipe(this, target);
4624
+ },
4625
+ readonly() {
4626
+ return readonly(this);
4627
+ },
4628
+ describe(description) {
4629
+ const cl = this.clone();
4630
+ globalRegistry.add(cl, { description });
4631
+ return cl;
4632
+ },
4633
+ meta(...args) {
4634
+ if (args.length === 0) return globalRegistry.get(this);
4635
+ const cl = this.clone();
4636
+ globalRegistry.add(cl, args[0]);
4637
+ return cl;
4638
+ },
4639
+ isOptional() {
4640
+ return this.safeParse(void 0).success;
4641
+ },
4642
+ isNullable() {
4643
+ return this.safeParse(null).success;
4644
+ },
4645
+ apply(fn, ...args) {
4646
+ return args.length === 0 ? fn(this) : fn(this, ...args);
4647
+ },
4648
+ get "~standard"() {
4649
+ return hide(this, "~standard", {
4650
+ ...standardProps(this),
4651
+ jsonSchema: {
4652
+ input: createStandardJSONSchemaMethod(this, "input"),
4653
+ output: createStandardJSONSchemaMethod(this, "output")
4654
+ }
4655
+ });
4656
+ },
4657
+ set "~standard"(value) {
4658
+ own(this, "~standard", value);
4659
+ },
4660
+ parse: function _parse(data, params) {
4661
+ return parse(this, data, params, { callee: _parse });
4662
+ },
4663
+ parseAsync: async function _parseAsync(data, params) {
4664
+ return await parseAsync(this, data, params, { callee: _parseAsync });
4665
+ },
4666
+ safeParse(data, params) {
4667
+ return safeParse(this, data, params);
4668
+ },
4669
+ async safeParseAsync(data, params) {
4670
+ return safeParseAsync(this, data, params);
4671
+ },
4672
+ get spa() {
4673
+ return this?.safeParseAsync;
4674
+ },
4675
+ set spa(value) {
4676
+ own(this, "spa", value);
4677
+ },
4678
+ encode: function _encode(data, params) {
4679
+ return encode(this, data, params, { callee: _encode });
4680
+ },
4681
+ decode: function _decode(data, params) {
4682
+ return decode(this, data, params, { callee: _decode });
4683
+ },
4684
+ encodeAsync: async function _encodeAsync(data, params) {
4685
+ return await encodeAsync(this, data, params, { callee: _encodeAsync });
4686
+ },
4687
+ decodeAsync: async function _decodeAsync(data, params) {
4688
+ return await decodeAsync(this, data, params, { callee: _decodeAsync });
4689
+ },
4690
+ safeEncode(data, params) {
4691
+ return safeEncode(this, data, params);
4692
+ },
4693
+ safeDecode(data, params) {
4694
+ return safeDecode(this, data, params);
4695
+ },
4696
+ async safeEncodeAsync(data, params) {
4697
+ return safeEncodeAsync(this, data, params);
4698
+ },
4699
+ async safeDecodeAsync(data, params) {
4700
+ return safeDecodeAsync(this, data, params);
4701
+ },
4702
+ toJSONSchema(params) {
4703
+ return createToJSONSchemaMethod(this, {})(params);
4704
+ },
4705
+ get description() {
4706
+ return globalRegistry.get(this)?.description;
4707
+ },
4708
+ get _def() {
4709
+ return this._zod.def;
4710
+ }
3503
4711
  });
3504
4712
  /** @internal */
3505
4713
  const _ZodString = /*@__PURE__*/ $constructor("_ZodString", (inst, def) => {
@@ -3510,84 +4718,135 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3510
4718
  inst.format = bag.format ?? null;
3511
4719
  inst.minLength = bag.minimum ?? null;
3512
4720
  inst.maxLength = bag.maximum ?? null;
3513
- _installLazyMethods(inst, "_ZodString", {
3514
- regex(...args) {
3515
- return this.check(/* @__PURE__ */ _regex(...args));
3516
- },
3517
- includes(...args) {
3518
- return this.check(/* @__PURE__ */ _includes(...args));
3519
- },
3520
- startsWith(...args) {
3521
- return this.check(/* @__PURE__ */ _startsWith(...args));
3522
- },
3523
- endsWith(...args) {
3524
- return this.check(/* @__PURE__ */ _endsWith(...args));
3525
- },
3526
- min(...args) {
3527
- return this.check(/* @__PURE__ */ _minLength(...args));
3528
- },
3529
- max(...args) {
3530
- return this.check(/* @__PURE__ */ _maxLength(...args));
3531
- },
3532
- length(...args) {
3533
- return this.check(/* @__PURE__ */ _length(...args));
3534
- },
3535
- nonempty(...args) {
3536
- return this.check(/* @__PURE__ */ _minLength(1, ...args));
3537
- },
3538
- lowercase(params) {
3539
- return this.check(/* @__PURE__ */ _lowercase(params));
3540
- },
3541
- uppercase(params) {
3542
- return this.check(/* @__PURE__ */ _uppercase(params));
3543
- },
3544
- trim() {
3545
- return this.check(/* @__PURE__ */ _trim());
3546
- },
3547
- normalize(...args) {
3548
- return this.check(/* @__PURE__ */ _normalize(...args));
3549
- },
3550
- toLowerCase() {
3551
- return this.check(/* @__PURE__ */ _toLowerCase());
3552
- },
3553
- toUpperCase() {
3554
- return this.check(/* @__PURE__ */ _toUpperCase());
3555
- },
3556
- slugify() {
3557
- return this.check(/* @__PURE__ */ _slugify());
3558
- }
3559
- });
4721
+ }, {
4722
+ regex(...args) {
4723
+ return this.check(/* @__PURE__ */ _regex(...args));
4724
+ },
4725
+ includes(...args) {
4726
+ return this.check(/* @__PURE__ */ _includes(...args));
4727
+ },
4728
+ startsWith(...args) {
4729
+ return this.check(/* @__PURE__ */ _startsWith(...args));
4730
+ },
4731
+ endsWith(...args) {
4732
+ return this.check(/* @__PURE__ */ _endsWith(...args));
4733
+ },
4734
+ min(...args) {
4735
+ return this.check(/* @__PURE__ */ _minLength(...args));
4736
+ },
4737
+ max(...args) {
4738
+ return this.check(/* @__PURE__ */ _maxLength(...args));
4739
+ },
4740
+ length(...args) {
4741
+ return this.check(/* @__PURE__ */ _length(...args));
4742
+ },
4743
+ nonempty(...args) {
4744
+ return this.check(/* @__PURE__ */ _minLength(1, ...args));
4745
+ },
4746
+ lowercase(params) {
4747
+ return this.check(/* @__PURE__ */ _lowercase(params));
4748
+ },
4749
+ uppercase(params) {
4750
+ return this.check(/* @__PURE__ */ _uppercase(params));
4751
+ },
4752
+ trim() {
4753
+ return this.check(/* @__PURE__ */ _trim());
4754
+ },
4755
+ normalize(...args) {
4756
+ return this.check(/* @__PURE__ */ _normalize(...args));
4757
+ },
4758
+ toLowerCase() {
4759
+ return this.check(/* @__PURE__ */ _toLowerCase());
4760
+ },
4761
+ toUpperCase() {
4762
+ return this.check(/* @__PURE__ */ _toUpperCase());
4763
+ },
4764
+ slugify() {
4765
+ return this.check(/* @__PURE__ */ _slugify());
4766
+ }
3560
4767
  });
3561
4768
  const ZodString = /*@__PURE__*/ $constructor("ZodString", (inst, def) => {
3562
4769
  $ZodString.init(inst, def);
3563
4770
  _ZodString.init(inst, def);
3564
- inst.email = (params) => inst.check(/* @__PURE__ */ _email(ZodEmail, params));
3565
- inst.url = (params) => inst.check(/* @__PURE__ */ _url(ZodURL, params));
3566
- inst.jwt = (params) => inst.check(/* @__PURE__ */ _jwt(ZodJWT, params));
3567
- inst.emoji = (params) => inst.check(/* @__PURE__ */ _emoji(ZodEmoji, params));
3568
- inst.guid = (params) => inst.check(/* @__PURE__ */ _guid(ZodGUID, params));
3569
- inst.uuid = (params) => inst.check(/* @__PURE__ */ _uuid(ZodUUID, params));
3570
- inst.uuidv4 = (params) => inst.check(/* @__PURE__ */ _uuidv4(ZodUUID, params));
3571
- inst.uuidv6 = (params) => inst.check(/* @__PURE__ */ _uuidv6(ZodUUID, params));
3572
- inst.uuidv7 = (params) => inst.check(/* @__PURE__ */ _uuidv7(ZodUUID, params));
3573
- inst.nanoid = (params) => inst.check(/* @__PURE__ */ _nanoid(ZodNanoID, params));
3574
- inst.guid = (params) => inst.check(/* @__PURE__ */ _guid(ZodGUID, params));
3575
- inst.cuid = (params) => inst.check(/* @__PURE__ */ _cuid(ZodCUID, params));
3576
- inst.cuid2 = (params) => inst.check(/* @__PURE__ */ _cuid2(ZodCUID2, params));
3577
- inst.ulid = (params) => inst.check(/* @__PURE__ */ _ulid(ZodULID, params));
3578
- inst.base64 = (params) => inst.check(/* @__PURE__ */ _base64(ZodBase64, params));
3579
- inst.base64url = (params) => inst.check(/* @__PURE__ */ _base64url(ZodBase64URL, params));
3580
- inst.xid = (params) => inst.check(/* @__PURE__ */ _xid(ZodXID, params));
3581
- inst.ksuid = (params) => inst.check(/* @__PURE__ */ _ksuid(ZodKSUID, params));
3582
- inst.ipv4 = (params) => inst.check(/* @__PURE__ */ _ipv4(ZodIPv4, params));
3583
- inst.ipv6 = (params) => inst.check(/* @__PURE__ */ _ipv6(ZodIPv6, params));
3584
- inst.cidrv4 = (params) => inst.check(/* @__PURE__ */ _cidrv4(ZodCIDRv4, params));
3585
- inst.cidrv6 = (params) => inst.check(/* @__PURE__ */ _cidrv6(ZodCIDRv6, params));
3586
- inst.e164 = (params) => inst.check(/* @__PURE__ */ _e164(ZodE164, params));
3587
- inst.datetime = (params) => inst.check(datetime(params));
3588
- inst.date = (params) => inst.check(date(params));
3589
- inst.time = (params) => inst.check(time(params));
3590
- inst.duration = (params) => inst.check(duration(params));
4771
+ }, {
4772
+ email(params) {
4773
+ return this.check(/* @__PURE__ */ _email(ZodEmail, params));
4774
+ },
4775
+ url(params) {
4776
+ return this.check(/* @__PURE__ */ _url(ZodURL, params));
4777
+ },
4778
+ jwt(params) {
4779
+ return this.check(/* @__PURE__ */ _jwt(ZodJWT, params));
4780
+ },
4781
+ emoji(params) {
4782
+ return this.check(/* @__PURE__ */ _emoji(ZodEmoji, params));
4783
+ },
4784
+ guid(params) {
4785
+ return this.check(/* @__PURE__ */ _guid(ZodGUID, params));
4786
+ },
4787
+ uuid(params) {
4788
+ return this.check(/* @__PURE__ */ _uuid(ZodUUID, params));
4789
+ },
4790
+ uuidv4(params) {
4791
+ return this.check(/* @__PURE__ */ _uuidv4(ZodUUID, params));
4792
+ },
4793
+ uuidv6(params) {
4794
+ return this.check(/* @__PURE__ */ _uuidv6(ZodUUID, params));
4795
+ },
4796
+ uuidv7(params) {
4797
+ return this.check(/* @__PURE__ */ _uuidv7(ZodUUID, params));
4798
+ },
4799
+ nanoid(params) {
4800
+ return this.check(/* @__PURE__ */ _nanoid(ZodNanoID, params));
4801
+ },
4802
+ cuid(params) {
4803
+ return this.check(/* @__PURE__ */ _cuid(ZodCUID, params));
4804
+ },
4805
+ cuid2(params) {
4806
+ return this.check(/* @__PURE__ */ _cuid2(ZodCUID2, params));
4807
+ },
4808
+ ulid(params) {
4809
+ return this.check(/* @__PURE__ */ _ulid(ZodULID, params));
4810
+ },
4811
+ base64(params) {
4812
+ return this.check(/* @__PURE__ */ _base64(ZodBase64, params));
4813
+ },
4814
+ base64url(params) {
4815
+ return this.check(/* @__PURE__ */ _base64url(ZodBase64URL, params));
4816
+ },
4817
+ xid(params) {
4818
+ return this.check(/* @__PURE__ */ _xid(ZodXID, params));
4819
+ },
4820
+ ksuid(params) {
4821
+ return this.check(/* @__PURE__ */ _ksuid(ZodKSUID, params));
4822
+ },
4823
+ ipv4(params) {
4824
+ return this.check(/* @__PURE__ */ _ipv4(ZodIPv4, params));
4825
+ },
4826
+ ipv6(params) {
4827
+ return this.check(/* @__PURE__ */ _ipv6(ZodIPv6, params));
4828
+ },
4829
+ cidrv4(params) {
4830
+ return this.check(/* @__PURE__ */ _cidrv4(ZodCIDRv4, params));
4831
+ },
4832
+ cidrv6(params) {
4833
+ return this.check(/* @__PURE__ */ _cidrv6(ZodCIDRv6, params));
4834
+ },
4835
+ e164(params) {
4836
+ return this.check(/* @__PURE__ */ _e164(ZodE164, params));
4837
+ },
4838
+ datetime(params) {
4839
+ return this.check(/* @__PURE__ */ _isoDateTime(ZodISODateTime, params));
4840
+ },
4841
+ date(params) {
4842
+ return this.check(/* @__PURE__ */ _isoDate(ZodISODate, params));
4843
+ },
4844
+ time(params) {
4845
+ return this.check(/* @__PURE__ */ _isoTime(ZodISOTime, params));
4846
+ },
4847
+ duration(params) {
4848
+ return this.check(/* @__PURE__ */ _isoDuration(ZodISODuration, params));
4849
+ }
3591
4850
  });
3592
4851
  function string(params) {
3593
4852
  return /* @__PURE__ */ _string(ZodString, params);
@@ -3596,6 +4855,22 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3596
4855
  $ZodStringFormat.init(inst, def);
3597
4856
  _ZodString.init(inst, def);
3598
4857
  });
4858
+ const ZodISODateTime = /*@__PURE__*/ $constructor("ZodISODateTime", (inst, def) => {
4859
+ $ZodISODateTime.init(inst, def);
4860
+ ZodStringFormat.init(inst, def);
4861
+ });
4862
+ const ZodISODate = /*@__PURE__*/ $constructor("ZodISODate", (inst, def) => {
4863
+ $ZodISODate.init(inst, def);
4864
+ ZodStringFormat.init(inst, def);
4865
+ });
4866
+ const ZodISOTime = /*@__PURE__*/ $constructor("ZodISOTime", (inst, def) => {
4867
+ $ZodISOTime.init(inst, def);
4868
+ ZodStringFormat.init(inst, def);
4869
+ });
4870
+ const ZodISODuration = /*@__PURE__*/ $constructor("ZodISODuration", (inst, def) => {
4871
+ $ZodISODuration.init(inst, def);
4872
+ ZodStringFormat.init(inst, def);
4873
+ });
3599
4874
  const ZodEmail = /*@__PURE__*/ $constructor("ZodEmail", (inst, def) => {
3600
4875
  $ZodEmail.init(inst, def);
3601
4876
  ZodStringFormat.init(inst, def);
@@ -3681,59 +4956,58 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3681
4956
  $ZodNumber.init(inst, def);
3682
4957
  ZodType.init(inst, def);
3683
4958
  inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
3684
- _installLazyMethods(inst, "ZodNumber", {
3685
- gt(value, params) {
3686
- return this.check(/* @__PURE__ */ _gt(value, params));
3687
- },
3688
- gte(value, params) {
3689
- return this.check(/* @__PURE__ */ _gte(value, params));
3690
- },
3691
- min(value, params) {
3692
- return this.check(/* @__PURE__ */ _gte(value, params));
3693
- },
3694
- lt(value, params) {
3695
- return this.check(/* @__PURE__ */ _lt(value, params));
3696
- },
3697
- lte(value, params) {
3698
- return this.check(/* @__PURE__ */ _lte(value, params));
3699
- },
3700
- max(value, params) {
3701
- return this.check(/* @__PURE__ */ _lte(value, params));
3702
- },
3703
- int(params) {
3704
- return this.check(int(params));
3705
- },
3706
- safe(params) {
3707
- return this.check(int(params));
3708
- },
3709
- positive(params) {
3710
- return this.check(/* @__PURE__ */ _gt(0, params));
3711
- },
3712
- nonnegative(params) {
3713
- return this.check(/* @__PURE__ */ _gte(0, params));
3714
- },
3715
- negative(params) {
3716
- return this.check(/* @__PURE__ */ _lt(0, params));
3717
- },
3718
- nonpositive(params) {
3719
- return this.check(/* @__PURE__ */ _lte(0, params));
3720
- },
3721
- multipleOf(value, params) {
3722
- return this.check(/* @__PURE__ */ _multipleOf(value, params));
3723
- },
3724
- step(value, params) {
3725
- return this.check(/* @__PURE__ */ _multipleOf(value, params));
3726
- },
3727
- finite() {
3728
- return this;
3729
- }
3730
- });
3731
4959
  const bag = inst._zod.bag;
3732
4960
  inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
3733
4961
  inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
3734
4962
  inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? .5);
3735
4963
  inst.isFinite = true;
3736
4964
  inst.format = bag.format ?? null;
4965
+ }, {
4966
+ gt(value, params) {
4967
+ return this.check(/* @__PURE__ */ _gt(value, params));
4968
+ },
4969
+ gte(value, params) {
4970
+ return this.check(/* @__PURE__ */ _gte(value, params));
4971
+ },
4972
+ min(value, params) {
4973
+ return this.check(/* @__PURE__ */ _gte(value, params));
4974
+ },
4975
+ lt(value, params) {
4976
+ return this.check(/* @__PURE__ */ _lt(value, params));
4977
+ },
4978
+ lte(value, params) {
4979
+ return this.check(/* @__PURE__ */ _lte(value, params));
4980
+ },
4981
+ max(value, params) {
4982
+ return this.check(/* @__PURE__ */ _lte(value, params));
4983
+ },
4984
+ int(params) {
4985
+ return this.check(int(params));
4986
+ },
4987
+ safe(params) {
4988
+ return this.check(int(params));
4989
+ },
4990
+ positive(params) {
4991
+ return this.check(/* @__PURE__ */ _gt(0, params));
4992
+ },
4993
+ nonnegative(params) {
4994
+ return this.check(/* @__PURE__ */ _gte(0, params));
4995
+ },
4996
+ negative(params) {
4997
+ return this.check(/* @__PURE__ */ _lt(0, params));
4998
+ },
4999
+ nonpositive(params) {
5000
+ return this.check(/* @__PURE__ */ _lte(0, params));
5001
+ },
5002
+ multipleOf(value, params) {
5003
+ return this.check(/* @__PURE__ */ _multipleOf(value, params));
5004
+ },
5005
+ step(value, params) {
5006
+ return this.check(/* @__PURE__ */ _multipleOf(value, params));
5007
+ },
5008
+ finite() {
5009
+ return this;
5010
+ }
3737
5011
  });
3738
5012
  function number(params) {
3739
5013
  return /* @__PURE__ */ _number(ZodNumber, params);
@@ -3753,6 +5027,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3753
5027
  function boolean(params) {
3754
5028
  return /* @__PURE__ */ _boolean(ZodBoolean, params);
3755
5029
  }
5030
+ const ZodNull = /*@__PURE__*/ $constructor("ZodNull", (inst, def) => {
5031
+ $ZodNull.init(inst, def);
5032
+ ZodType.init(inst, def);
5033
+ inst._zod.processJSONSchema = (ctx, json, params) => nullProcessor(inst, ctx, json, params);
5034
+ });
5035
+ function _null(params) {
5036
+ return /* @__PURE__ */ _null$1(ZodNull, params);
5037
+ }
3756
5038
  const ZodUnknown = /*@__PURE__*/ $constructor("ZodUnknown", (inst, def) => {
3757
5039
  $ZodUnknown.init(inst, def);
3758
5040
  ZodType.init(inst, def);
@@ -3770,94 +5052,95 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3770
5052
  return /* @__PURE__ */ _never(ZodNever, params);
3771
5053
  }
3772
5054
  const ZodArray = /*@__PURE__*/ $constructor("ZodArray", (inst, def) => {
5055
+ _ensureDefaultMemoizer();
3773
5056
  $ZodArray.init(inst, def);
3774
5057
  ZodType.init(inst, def);
3775
5058
  inst._zod.processJSONSchema = (ctx, json, params) => arrayProcessor(inst, ctx, json, params);
3776
5059
  inst.element = def.element;
3777
- _installLazyMethods(inst, "ZodArray", {
3778
- min(n, params) {
3779
- return this.check(/* @__PURE__ */ _minLength(n, params));
3780
- },
3781
- nonempty(params) {
3782
- return this.check(/* @__PURE__ */ _minLength(1, params));
3783
- },
3784
- max(n, params) {
3785
- return this.check(/* @__PURE__ */ _maxLength(n, params));
3786
- },
3787
- length(n, params) {
3788
- return this.check(/* @__PURE__ */ _length(n, params));
3789
- },
3790
- unwrap() {
3791
- return this.element;
3792
- }
3793
- });
5060
+ }, {
5061
+ min(n, params) {
5062
+ return this.check(/* @__PURE__ */ _minLength(n, params));
5063
+ },
5064
+ nonempty(params) {
5065
+ return this.check(/* @__PURE__ */ _minLength(1, params));
5066
+ },
5067
+ max(n, params) {
5068
+ return this.check(/* @__PURE__ */ _maxLength(n, params));
5069
+ },
5070
+ length(n, params) {
5071
+ return this.check(/* @__PURE__ */ _length(n, params));
5072
+ },
5073
+ unwrap() {
5074
+ return this.element;
5075
+ }
3794
5076
  });
3795
5077
  function array(element, params) {
3796
5078
  return /* @__PURE__ */ _array(ZodArray, element, params);
3797
5079
  }
3798
5080
  const ZodObject = /*@__PURE__*/ $constructor("ZodObject", (inst, def) => {
5081
+ _ensureDefaultMemoizer();
3799
5082
  $ZodObjectJIT.init(inst, def);
3800
5083
  ZodType.init(inst, def);
3801
5084
  inst._zod.processJSONSchema = (ctx, json, params) => objectProcessor(inst, ctx, json, params);
3802
- defineLazy(inst, "shape", () => {
3803
- return def.shape;
3804
- });
3805
- _installLazyMethods(inst, "ZodObject", {
3806
- keyof() {
3807
- return _enum(Object.keys(this._zod.def.shape));
3808
- },
3809
- catchall(catchall) {
3810
- return this.clone({
3811
- ...this._zod.def,
3812
- catchall
3813
- });
3814
- },
3815
- passthrough() {
3816
- return this.clone({
3817
- ...this._zod.def,
3818
- catchall: unknown()
3819
- });
3820
- },
3821
- loose() {
3822
- return this.clone({
3823
- ...this._zod.def,
3824
- catchall: unknown()
3825
- });
3826
- },
3827
- strict() {
3828
- return this.clone({
3829
- ...this._zod.def,
3830
- catchall: never()
3831
- });
3832
- },
3833
- strip() {
3834
- return this.clone({
3835
- ...this._zod.def,
3836
- catchall: void 0
3837
- });
3838
- },
3839
- extend(incoming) {
3840
- return extend(this, incoming);
3841
- },
3842
- safeExtend(incoming) {
3843
- return safeExtend(this, incoming);
3844
- },
3845
- merge(other) {
3846
- return merge(this, other);
3847
- },
3848
- pick(mask) {
3849
- return pick(this, mask);
3850
- },
3851
- omit(mask) {
3852
- return omit(this, mask);
3853
- },
3854
- partial(...args) {
3855
- return partial(ZodOptional, this, args[0]);
3856
- },
3857
- required(...args) {
3858
- return required(ZodNonOptional, this, args[0]);
3859
- }
3860
- });
5085
+ installLazyProp(inst, "shape", (self) => self._zod.def.shape, false);
5086
+ }, {
5087
+ keyof() {
5088
+ return _enum(Object.keys(this._zod.def.shape));
5089
+ },
5090
+ catchall(catchall) {
5091
+ return this.clone({
5092
+ ...this._zod.def,
5093
+ catchall
5094
+ });
5095
+ },
5096
+ passthrough() {
5097
+ return this.clone({
5098
+ ...this._zod.def,
5099
+ catchall: unknown()
5100
+ });
5101
+ },
5102
+ loose() {
5103
+ return this.clone({
5104
+ ...this._zod.def,
5105
+ catchall: unknown()
5106
+ });
5107
+ },
5108
+ strict() {
5109
+ return this.clone({
5110
+ ...this._zod.def,
5111
+ catchall: never()
5112
+ });
5113
+ },
5114
+ strip() {
5115
+ return this.clone({
5116
+ ...this._zod.def,
5117
+ catchall: void 0
5118
+ });
5119
+ },
5120
+ extend(incoming) {
5121
+ return extend(this, incoming);
5122
+ },
5123
+ safeExtend(incoming) {
5124
+ return safeExtend(this, incoming);
5125
+ },
5126
+ merge(other) {
5127
+ return merge(this, other);
5128
+ },
5129
+ pick(mask) {
5130
+ return pick(this, mask);
5131
+ },
5132
+ omit(mask) {
5133
+ return omit(this, mask);
5134
+ },
5135
+ partial(...args) {
5136
+ return partial(ZodOptional, this, args[0]);
5137
+ },
5138
+ exactPartial(...args) {
5139
+ return partial(ZodExactOptional, this, args[0], "exactPartial");
5140
+ },
5141
+ required(...args) {
5142
+ return required(ZodNonOptional, this, args[0]);
5143
+ }
3861
5144
  });
3862
5145
  function object(shape, params) {
3863
5146
  const def = {
@@ -3904,6 +5187,28 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3904
5187
  right
3905
5188
  });
3906
5189
  }
5190
+ const ZodRecord = /*@__PURE__*/ $constructor("ZodRecord", (inst, def) => {
5191
+ _ensureDefaultMemoizer();
5192
+ $ZodRecord.init(inst, def);
5193
+ ZodType.init(inst, def);
5194
+ inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params);
5195
+ inst.keyType = def.keyType;
5196
+ inst.valueType = def.valueType;
5197
+ });
5198
+ function record(keyType, valueType, params) {
5199
+ if (!valueType || !valueType._zod) return new ZodRecord({
5200
+ type: "record",
5201
+ keyType: string(),
5202
+ valueType: keyType,
5203
+ ...normalizeParams(valueType)
5204
+ });
5205
+ return new ZodRecord({
5206
+ type: "record",
5207
+ keyType,
5208
+ valueType,
5209
+ ...normalizeParams(params)
5210
+ });
5211
+ }
3907
5212
  const ZodEnum = /*@__PURE__*/ $constructor("ZodEnum", (inst, def) => {
3908
5213
  $ZodEnum.init(inst, def);
3909
5214
  ZodType.init(inst, def);
@@ -3960,6 +5265,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3960
5265
  });
3961
5266
  }
3962
5267
  const ZodTransform = /*@__PURE__*/ $constructor("ZodTransform", (inst, def) => {
5268
+ _ensureDefaultMemoizer();
3963
5269
  $ZodTransform.init(inst, def);
3964
5270
  ZodType.init(inst, def);
3965
5271
  inst._zod.processJSONSchema = (ctx, json, params) => transformProcessor(inst, ctx, json, params);
@@ -3971,7 +5277,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3971
5277
  const _issue = issue$1;
3972
5278
  if (_issue.fatal) _issue.continue = false;
3973
5279
  _issue.code ?? (_issue.code = "custom");
3974
- _issue.input ?? (_issue.input = payload.value);
5280
+ if (!("input" in _issue)) _issue.input = payload.value;
3975
5281
  _issue.inst ?? (_issue.inst = inst);
3976
5282
  payload.issues.push(issue(_issue));
3977
5283
  }
@@ -3979,11 +5285,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
3979
5285
  const output = def.transform(payload.value, payload);
3980
5286
  if (output instanceof Promise) return output.then((output) => {
3981
5287
  payload.value = output;
3982
- payload.fallback = true;
3983
5288
  return payload;
3984
5289
  });
3985
5290
  payload.value = output;
3986
- payload.fallback = true;
3987
5291
  return payload;
3988
5292
  };
3989
5293
  });
@@ -4084,7 +5388,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4084
5388
  return new ZodCatch({
4085
5389
  type: "catch",
4086
5390
  innerType,
4087
- catchValue: typeof catchValue === "function" ? catchValue : () => catchValue
5391
+ catchValue: typeof catchValue === "function" ? catchValue : constantCatch(catchValue)
4088
5392
  });
4089
5393
  }
4090
5394
  const ZodPipe = /*@__PURE__*/ $constructor("ZodPipe", (inst, def) => {
@@ -4113,6 +5417,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4113
5417
  innerType
4114
5418
  });
4115
5419
  }
5420
+ const ZodLazy = /*@__PURE__*/ $constructor("ZodLazy", (inst, def) => {
5421
+ $ZodLazy.init(inst, def);
5422
+ ZodType.init(inst, def);
5423
+ inst._zod.processJSONSchema = (ctx, json, params) => lazyProcessor(inst, ctx, json, params);
5424
+ inst.unwrap = () => inst._zod.def.getter();
5425
+ });
5426
+ function lazy(getter) {
5427
+ return new ZodLazy({
5428
+ type: "lazy",
5429
+ getter
5430
+ });
5431
+ }
4116
5432
  const ZodCustom = /*@__PURE__*/ $constructor("ZodCustom", (inst, def) => {
4117
5433
  $ZodCustom.init(inst, def);
4118
5434
  ZodType.init(inst, def);
@@ -4124,37 +5440,130 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4124
5440
  function superRefine(fn, params) {
4125
5441
  return /* @__PURE__ */ _superRefine(fn, params);
4126
5442
  }
5443
+ function json(params) {
5444
+ const jsonSchema = lazy(() => {
5445
+ return union([
5446
+ string(params),
5447
+ number(),
5448
+ boolean(),
5449
+ _null(),
5450
+ array(jsonSchema),
5451
+ record(string(), jsonSchema)
5452
+ ]);
5453
+ });
5454
+ return jsonSchema;
5455
+ }
4127
5456
  //#endregion
4128
- //#region src/domain/observe/observe-summary.ts
4129
- const safeCount = number().refine((value) => Number.isSafeInteger(value) && value >= 0, "Expected a non-negative safe integer");
4130
- const ObserveSummaryV1Schema = object({
4131
- apiVersion: literal(1),
4132
- status: _enum([
4133
- "READY",
4134
- "RECOVERING",
4135
- "DEGRADED",
4136
- "INCOMPATIBLE"
4137
- ]),
4138
- capturedCount: safeCount,
4139
- blockedCaptureCount: safeCount,
4140
- learning: object({
4141
- captured: safeCount,
4142
- analyzing: safeCount,
4143
- learned: safeCount,
4144
- needsAttention: safeCount
4145
- }).strict().optional(),
4146
- unsaved: object({
4147
- completeness: _enum(["KNOWN", "UNKNOWN"]),
4148
- knownCount: safeCount
4149
- }).strict(),
4150
- recoveryLag: boolean(),
4151
- lastRecoveryProgressAt: string().datetime({ offset: true }).optional(),
4152
- lastHealthCode: string().regex(/^[A-Z][A-Z0-9_]{0,63}$/).optional()
5457
+ //#region src/adapters/dsh-remote/contract.ts
5458
+ const RUN2SKILL_QUERY_ENDPOINTS = [
5459
+ "observe-summary",
5460
+ "attention",
5461
+ "proposals/list",
5462
+ "summary",
5463
+ "proposals/get",
5464
+ "recent-activity/list",
5465
+ "learning/status",
5466
+ "learning/issues/list",
5467
+ "purge/preview",
5468
+ "purge/status"
5469
+ ];
5470
+ const RUN2SKILL_COMMAND_ENDPOINTS = [
5471
+ "proposals/approve",
5472
+ "proposals/reject",
5473
+ "proposals/retry",
5474
+ "proposals/refresh",
5475
+ "proposals/revise",
5476
+ "coverage/confirm-discard",
5477
+ "learning/request",
5478
+ "learning/issues/retry",
5479
+ "learning/issues/dismiss",
5480
+ "purge/confirm",
5481
+ "purge/retry"
5482
+ ];
5483
+ const queryEndpoints = new Set(RUN2SKILL_QUERY_ENDPOINTS);
5484
+ const commandEndpoints = new Set(RUN2SKILL_COMMAND_ENDPOINTS);
5485
+ function routeRun2skillEndpoint(endpoint) {
5486
+ if (queryEndpoints.has(endpoint)) return "query";
5487
+ if (commandEndpoints.has(endpoint)) return "command";
5488
+ throw new TypeError(`unknown run2skill endpoint: ${endpoint}`);
5489
+ }
5490
+ const jsonValue = json();
5491
+ const queryRequest = object({
5492
+ endpoint: _enum(RUN2SKILL_QUERY_ENDPOINTS),
5493
+ payload: jsonValue
4153
5494
  }).strict();
5495
+ const commandRequest = object({
5496
+ endpoint: _enum(RUN2SKILL_COMMAND_ENDPOINTS),
5497
+ payload: jsonValue
5498
+ }).strict();
5499
+ const rpcResult = discriminatedUnion("ok", [object({
5500
+ ok: literal(true),
5501
+ value: jsonValue
5502
+ }).strict(), object({
5503
+ ok: literal(false),
5504
+ error: object({
5505
+ code: string().min(1),
5506
+ message: string(),
5507
+ details: record(string(), jsonValue)
5508
+ }).strict()
5509
+ }).strict()]);
5510
+ function descriptor(method, requestSchema) {
5511
+ const value = {
5512
+ id: `dsh-run2skill#run2skill/${method}`,
5513
+ service: "run2skillRemote",
5514
+ namespace: "run2skill",
5515
+ method,
5516
+ invocation: { kind: "direct" },
5517
+ parameters: [{
5518
+ name: "request",
5519
+ wire: "request",
5520
+ source: "json",
5521
+ codec: {
5522
+ mode: "strict",
5523
+ typeSymbol: method === "query" ? "Run2skillQueryRequest" : "Run2skillCommandRequest",
5524
+ create: () => requestSchema
5525
+ }
5526
+ }],
5527
+ cancellation: { parameter: "signal" },
5528
+ result: {
5529
+ mode: "strict",
5530
+ typeSymbol: "Run2skillRpcResult",
5531
+ create: () => rpcResult
5532
+ }
5533
+ };
5534
+ return Object.freeze(value);
5535
+ }
5536
+ const RUN2SKILL_REMOTE_DESCRIPTORS = Object.freeze([descriptor("query", queryRequest), descriptor("command", commandRequest)]);
5537
+ const RUN2SKILL_REMOTE = Object.freeze({
5538
+ package: "dsh-run2skill",
5539
+ descriptors: RUN2SKILL_REMOTE_DESCRIPTORS
5540
+ });
4154
5541
  //#endregion
4155
- //#region src/adapters/dsh-connection/observe-summary-rpc.ts
4156
- const RUN2SKILL_RPC_CHANNEL = "/run2skill";
4157
- object({ apiVersion: literal(1) }).strict();
5542
+ //#region src/adapters/dsh-remote/client.ts
5543
+ function carrierFailure(error) {
5544
+ return {
5545
+ ok: false,
5546
+ error: {
5547
+ code: error.code,
5548
+ message: error.message,
5549
+ details: error.details
5550
+ }
5551
+ };
5552
+ }
5553
+ async function createRun2skillRemoteCaller(remote) {
5554
+ return {
5555
+ dispose: await remote.$mount(RUN2SKILL_REMOTE),
5556
+ async call(endpoint, payload, signal) {
5557
+ const route = routeRun2skillEndpoint(endpoint);
5558
+ const request = {
5559
+ endpoint,
5560
+ payload
5561
+ };
5562
+ const result = route === "query" ? await remote.run2skill.query(request, signal) : await remote.run2skill.command(request, signal);
5563
+ return result.ok ? result.value : carrierFailure(result.error);
5564
+ }
5565
+ };
5566
+ }
4158
5567
  //#endregion
4159
5568
  //#region src/client/dialog-focus.ts
4160
5569
  const focusableSelector = [
@@ -4219,50 +5628,50 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4219
5628
  }
4220
5629
  //#endregion
4221
5630
  //#region \0run2skill-css:run2skill-settings-page.module.css.mjs
4222
- const css = ".run2skill_page_WCb_nq{width:min(100%,1040px);color:var(--dsw-alias-label-primary);gap:24px;padding:16px 0 48px;display:grid}.run2skill_intro_WCb_nq,.run2skill_muted_WCb_nq{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px;line-height:1.5}.run2skill_section_WCb_nq{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);box-shadow:0 1px 2px var(--dsw-alias-border-l1);border-radius:16px;overflow:hidden}.run2skill_sectionHeader_WCb_nq{box-sizing:border-box;height:auto;min-height:56px;padding:14px 20px}.run2skill_sectionTitle_WCb_nq{font-size:15px}.run2skill_sectionBody_WCb_nq{gap:18px;padding:12px 24px 24px 56px;display:grid;container-type:inline-size}.run2skill_attentionGroup_WCb_nq{gap:16px;min-width:0;display:grid}.run2skill_empty_WCb_nq{min-height:56px;color:var(--dsw-alias-label-secondary);place-items:center;margin:0;font-size:13px;display:grid}.run2skill_toolbar_WCb_nq,.run2skill_actions_WCb_nq,.run2skill_modeGroup_WCb_nq{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.run2skill_learningStatusRow_WCb_nq{justify-content:space-between;align-items:center;gap:16px;min-width:0;display:flex}.run2skill_learningStatusRow_WCb_nq>:first-child{overflow-wrap:anywhere;min-width:0}@container (width<=30rem){.run2skill_learningStatusRow_WCb_nq{flex-direction:column;align-items:stretch}.run2skill_learningStatusRow_WCb_nq .run2skill_actions_WCb_nq{flex-direction:column;align-items:stretch;width:100%}.run2skill_learningStatusRow_WCb_nq .run2skill_actions_WCb_nq>*{box-sizing:border-box;white-space:normal;overflow-wrap:anywhere;flex:none;width:100%;min-width:0;max-width:100%;height:auto}}.run2skill_attentionList_WCb_nq,.run2skill_proposalList_WCb_nq,.run2skill_activityList_WCb_nq{gap:8px;margin:0;padding:0;list-style:none;display:grid}.run2skill_activityItem_WCb_nq{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);border-radius:12px;justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;display:flex}.run2skill_activitySummary_WCb_nq{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.run2skill_proposalToolbar_WCb_nq{grid-template-columns:minmax(12rem,1fr) auto;align-items:center;gap:8px;display:grid}.run2skill_proposalToolbar_WCb_nq>:first-child{width:100%}.run2skill_proposalToolbarCompact_WCb_nq{justify-content:flex-end;display:flex}.run2skill_proposalToolbarCompact_WCb_nq>:first-child{width:auto}.run2skill_proposalLayout_WCb_nq{grid-template-columns:1fr;gap:12px;display:grid}.run2skill_proposalListButton_WCb_nq{text-align:start;white-space:normal;overflow-wrap:anywhere;border-radius:10px;flex-direction:column;justify-content:flex-start;align-items:flex-start;gap:2px;width:100%;height:auto;min-height:48px;padding:8px 12px}.run2skill_proposalListButton_WCb_nq[aria-current=true]{border-color:var(--dsw-alias-brand-primary);background:var(--dsw-alias-interactive-bg-active);color:var(--dsw-alias-label-primary);box-shadow:inset 3px 0 var(--dsw-alias-brand-primary)}.run2skill_proposalName_WCb_nq{max-width:100%;font-size:14px;font-weight:600;line-height:20px}.run2skill_proposalMeta_WCb_nq{max-width:100%;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}.run2skill_detail_WCb_nq{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);border-radius:12px;min-width:0;max-height:640px;padding:18px;overflow:auto}.run2skill_detail_WCb_nq>:first-child{margin-top:0}.run2skill_detailFacts_WCb_nq{grid-template-columns:minmax(6rem,max-content) minmax(0,1fr);gap:8px 16px;margin:0 0 20px;display:grid}.run2skill_detailFacts_WCb_nq dt{color:var(--dsw-alias-label-secondary);font-size:13px}.run2skill_detailFacts_WCb_nq dd{overflow-wrap:anywhere;min-width:0;margin:0}.run2skill_detail_WCb_nq pre{white-space:pre-wrap;unicode-bidi:isolate;overflow:auto}.run2skill_technicalDetails_WCb_nq{border:1px solid var(--dsw-alias-border-l2);border-radius:8px;margin:16px 0;padding:10px 12px}.run2skill_technicalDetails_WCb_nq summary{cursor:pointer;color:var(--dsw-alias-label-secondary);font-size:13px}.run2skill_technicalDetails_WCb_nq[open] summary{margin-bottom:12px}.run2skill_status_WCb_nq{min-height:20px;margin:0;font-size:13px}.run2skill_revisionBox_WCb_nq{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);border-radius:12px;gap:8px;margin:18px 0;padding:14px;display:grid}.run2skill_revisionBox_WCb_nq label{font-size:14px;font-weight:600}.run2skill_revisionBox_WCb_nq textarea{box-sizing:border-box;resize:vertical;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);width:100%;min-height:84px;color:var(--dsw-alias-label-primary);font:inherit;border-radius:10px;padding:10px 12px;line-height:1.5}.run2skill_revisionBox_WCb_nq textarea:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px}.run2skill_revisionBox_WCb_nq textarea:disabled{cursor:not-allowed;opacity:.65}.run2skill_revisionBox_WCb_nq>:last-child{justify-self:start}.run2skill_danger_WCb_nq{color:var(--dsw-alias-state-error-primary)}.run2skill_backdrop_WCb_nq,.run2skill_rejectOverlay_WCb_nq{background:var(--dsw-alias-bg-mask-1);position:fixed;inset:0}.run2skill_backdrop_WCb_nq{z-index:999}.run2skill_rejectOverlay_WCb_nq{z-index:1001;place-items:center;padding:16px;display:grid}.run2skill_legacyDialog_WCb_nq{z-index:1000;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);box-shadow:0 16px 48px var(--dsw-alias-bg-mask-1);border-radius:16px;grid-template-columns:minmax(16rem,24rem) minmax(0,1fr);gap:16px;padding:16px;display:grid;position:fixed;inset:5vh 5vw;overflow:hidden}.run2skill_blocked_WCb_nq{pointer-events:none;display:contents}.run2skill_queue_WCb_nq,.run2skill_legacyDetail_WCb_nq{min-width:0;overflow:auto}.run2skill_legacyHeader_WCb_nq{justify-content:space-between;align-items:center;gap:8px;display:flex}.run2skill_legacyList_WCb_nq{margin:0;padding:0;list-style:none}.run2skill_rejectCard_WCb_nq{background:var(--dsw-alias-bg-layer-1);border-radius:16px;max-width:32rem;padding:16px}.run2skill_textBlock_WCb_nq{white-space:pre-wrap;overflow-wrap:anywhere;unicode-bidi:isolate;overflow:auto}.run2skill_previewFacts_WCb_nq{grid-template-columns:max-content 1fr;gap:6px 12px;display:grid}.run2skill_previewFacts_WCb_nq dt,.run2skill_previewFacts_WCb_nq dd{margin:0}@container (width>=760px){.run2skill_proposalLayout_WCb_nq{grid-template-columns:minmax(240px,.8fr) minmax(0,1.6fr);gap:20px}}@container (width<=420px){.run2skill_proposalToolbar_WCb_nq,.run2skill_detailFacts_WCb_nq{grid-template-columns:1fr}.run2skill_proposalToolbar_WCb_nq>:last-child{justify-self:start}.run2skill_detailFacts_WCb_nq dt:not(:first-child){margin-top:8px}}@media (width<=720px){.run2skill_sectionBody_WCb_nq{padding:8px 18px 20px}.run2skill_activityItem_WCb_nq{flex-direction:column;align-items:flex-start}}";
5631
+ const css = ".run2skill_page_7hKdxq{width:min(100%,1040px);color:var(--dsw-alias-label-primary);gap:24px;padding:16px 0 48px;display:grid}.run2skill_intro_7hKdxq,.run2skill_muted_7hKdxq{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px;line-height:1.5}.run2skill_section_7hKdxq{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);box-shadow:0 1px 2px var(--dsw-alias-border-l1);border-radius:16px;overflow:hidden}.run2skill_sectionHeader_7hKdxq{box-sizing:border-box;height:auto;min-height:56px;padding:14px 20px}.run2skill_sectionTitle_7hKdxq{font-size:15px}.run2skill_sectionBody_7hKdxq{gap:18px;padding:12px 24px 24px 56px;display:grid;container-type:inline-size}.run2skill_attentionGroup_7hKdxq{gap:16px;min-width:0;display:grid}.run2skill_empty_7hKdxq{min-height:56px;color:var(--dsw-alias-label-secondary);place-items:center;margin:0;font-size:13px;display:grid}.run2skill_toolbar_7hKdxq,.run2skill_actions_7hKdxq,.run2skill_modeGroup_7hKdxq{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.run2skill_learningStatusRow_7hKdxq{justify-content:space-between;align-items:center;gap:16px;min-width:0;display:flex}.run2skill_learningStatusRow_7hKdxq>:first-child{overflow-wrap:anywhere;min-width:0}@container (width<=30rem){.run2skill_learningStatusRow_7hKdxq{flex-direction:column;align-items:stretch}.run2skill_learningStatusRow_7hKdxq .run2skill_actions_7hKdxq{flex-direction:column;align-items:stretch;width:100%}.run2skill_learningStatusRow_7hKdxq .run2skill_actions_7hKdxq>*{box-sizing:border-box;white-space:normal;overflow-wrap:anywhere;flex:none;width:100%;min-width:0;max-width:100%;height:auto}}.run2skill_attentionList_7hKdxq,.run2skill_proposalList_7hKdxq,.run2skill_activityList_7hKdxq{gap:8px;margin:0;padding:0;list-style:none;display:grid}.run2skill_activityItem_7hKdxq{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);border-radius:12px;justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;display:flex}.run2skill_activitySummary_7hKdxq{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.run2skill_proposalToolbar_7hKdxq{grid-template-columns:minmax(12rem,1fr) auto;align-items:center;gap:8px;display:grid}.run2skill_proposalToolbar_7hKdxq>:first-child{width:100%}.run2skill_proposalToolbarCompact_7hKdxq{justify-content:flex-end;display:flex}.run2skill_proposalToolbarCompact_7hKdxq>:first-child{width:auto}.run2skill_proposalLayout_7hKdxq{grid-template-columns:1fr;gap:12px;display:grid}.run2skill_proposalListButton_7hKdxq{text-align:start;white-space:normal;overflow-wrap:anywhere;border-radius:10px;flex-direction:column;justify-content:flex-start;align-items:flex-start;gap:2px;width:100%;height:auto;min-height:48px;padding:8px 12px}.run2skill_proposalListButton_7hKdxq[aria-current=true]{border-color:var(--dsw-alias-brand-primary);background:var(--dsw-alias-interactive-bg-active);color:var(--dsw-alias-label-primary);box-shadow:inset 3px 0 var(--dsw-alias-brand-primary)}.run2skill_proposalName_7hKdxq{max-width:100%;font-size:14px;font-weight:600;line-height:20px}.run2skill_proposalMeta_7hKdxq{max-width:100%;color:var(--dsw-alias-label-secondary);font-size:12px;line-height:18px}.run2skill_detail_7hKdxq{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);border-radius:12px;min-width:0;max-height:640px;padding:18px;overflow:auto}.run2skill_detail_7hKdxq>:first-child{margin-top:0}.run2skill_detailFacts_7hKdxq{grid-template-columns:minmax(6rem,max-content) minmax(0,1fr);gap:8px 16px;margin:0 0 20px;display:grid}.run2skill_detailFacts_7hKdxq dt{color:var(--dsw-alias-label-secondary);font-size:13px}.run2skill_detailFacts_7hKdxq dd{overflow-wrap:anywhere;min-width:0;margin:0}.run2skill_detail_7hKdxq pre{white-space:pre-wrap;unicode-bidi:isolate;overflow:auto}.run2skill_technicalDetails_7hKdxq{border:1px solid var(--dsw-alias-border-l2);border-radius:8px;margin:16px 0;padding:10px 12px}.run2skill_technicalDetails_7hKdxq summary{cursor:pointer;color:var(--dsw-alias-label-secondary);font-size:13px}.run2skill_technicalDetails_7hKdxq[open] summary{margin-bottom:12px}.run2skill_status_7hKdxq{min-height:20px;margin:0;font-size:13px}.run2skill_revisionBox_7hKdxq{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);border-radius:12px;gap:8px;margin:18px 0;padding:14px;display:grid}.run2skill_revisionBox_7hKdxq label{font-size:14px;font-weight:600}.run2skill_revisionBox_7hKdxq textarea{box-sizing:border-box;resize:vertical;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);width:100%;min-height:84px;color:var(--dsw-alias-label-primary);font:inherit;border-radius:10px;padding:10px 12px;line-height:1.5}.run2skill_revisionBox_7hKdxq textarea:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:2px}.run2skill_revisionBox_7hKdxq textarea:disabled{cursor:not-allowed;opacity:.65}.run2skill_revisionBox_7hKdxq>:last-child{justify-self:start}.run2skill_danger_7hKdxq{color:var(--dsw-alias-state-error-primary)}.run2skill_backdrop_7hKdxq,.run2skill_rejectOverlay_7hKdxq{background:var(--dsw-alias-bg-mask-1);position:fixed;inset:0}.run2skill_backdrop_7hKdxq{z-index:999}.run2skill_rejectOverlay_7hKdxq{z-index:1001;place-items:center;padding:16px;display:grid}.run2skill_legacyDialog_7hKdxq{z-index:1000;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);box-shadow:0 16px 48px var(--dsw-alias-bg-mask-1);border-radius:16px;grid-template-columns:minmax(16rem,24rem) minmax(0,1fr);gap:16px;padding:16px;display:grid;position:fixed;inset:5vh 5vw;overflow:hidden}.run2skill_blocked_7hKdxq{pointer-events:none;display:contents}.run2skill_queue_7hKdxq,.run2skill_legacyDetail_7hKdxq{min-width:0;overflow:auto}.run2skill_legacyHeader_7hKdxq{justify-content:space-between;align-items:center;gap:8px;display:flex}.run2skill_legacyList_7hKdxq{margin:0;padding:0;list-style:none}.run2skill_rejectCard_7hKdxq{background:var(--dsw-alias-bg-layer-1);border-radius:16px;max-width:32rem;padding:16px}.run2skill_textBlock_7hKdxq{white-space:pre-wrap;overflow-wrap:anywhere;unicode-bidi:isolate;overflow:auto}.run2skill_previewFacts_7hKdxq{grid-template-columns:max-content 1fr;gap:6px 12px;display:grid}.run2skill_previewFacts_7hKdxq dt,.run2skill_previewFacts_7hKdxq dd{margin:0}@container (width>=760px){.run2skill_proposalLayout_7hKdxq{grid-template-columns:minmax(240px,.8fr) minmax(0,1.6fr);gap:20px}}@container (width<=420px){.run2skill_proposalToolbar_7hKdxq,.run2skill_detailFacts_7hKdxq{grid-template-columns:1fr}.run2skill_proposalToolbar_7hKdxq>:last-child{justify-self:start}.run2skill_detailFacts_7hKdxq dt:not(:first-child){margin-top:8px}}@media (width<=720px){.run2skill_sectionBody_7hKdxq{padding:8px 18px 20px}.run2skill_activityItem_7hKdxq{flex-direction:column;align-items:flex-start}}";
4223
5632
  if (typeof document !== "undefined") upsertRun2skillStyle(css);
4224
5633
  var _run2skill_css_run2skill_settings_page_module_css_default = {
4225
- "legacyHeader": "run2skill_legacyHeader_WCb_nq",
4226
- "proposalName": "run2skill_proposalName_WCb_nq",
4227
- "legacyDialog": "run2skill_legacyDialog_WCb_nq",
4228
- "status": "run2skill_status_WCb_nq",
4229
- "blocked": "run2skill_blocked_WCb_nq",
4230
- "attentionList": "run2skill_attentionList_WCb_nq",
4231
- "toolbar": "run2skill_toolbar_WCb_nq",
4232
- "rejectCard": "run2skill_rejectCard_WCb_nq",
4233
- "legacyDetail": "run2skill_legacyDetail_WCb_nq",
4234
- "intro": "run2skill_intro_WCb_nq",
4235
- "backdrop": "run2skill_backdrop_WCb_nq",
4236
- "sectionBody": "run2skill_sectionBody_WCb_nq",
4237
- "detail": "run2skill_detail_WCb_nq",
4238
- "activityItem": "run2skill_activityItem_WCb_nq",
4239
- "muted": "run2skill_muted_WCb_nq",
4240
- "attentionGroup": "run2skill_attentionGroup_WCb_nq",
4241
- "legacyList": "run2skill_legacyList_WCb_nq",
4242
- "detailFacts": "run2skill_detailFacts_WCb_nq",
4243
- "activitySummary": "run2skill_activitySummary_WCb_nq",
4244
- "danger": "run2skill_danger_WCb_nq",
4245
- "proposalList": "run2skill_proposalList_WCb_nq",
4246
- "section": "run2skill_section_WCb_nq",
4247
- "actions": "run2skill_actions_WCb_nq",
4248
- "sectionHeader": "run2skill_sectionHeader_WCb_nq",
4249
- "learningStatusRow": "run2skill_learningStatusRow_WCb_nq",
4250
- "revisionBox": "run2skill_revisionBox_WCb_nq",
4251
- "rejectOverlay": "run2skill_rejectOverlay_WCb_nq",
4252
- "queue": "run2skill_queue_WCb_nq",
4253
- "empty": "run2skill_empty_WCb_nq",
4254
- "activityList": "run2skill_activityList_WCb_nq",
4255
- "technicalDetails": "run2skill_technicalDetails_WCb_nq",
4256
- "sectionTitle": "run2skill_sectionTitle_WCb_nq",
4257
- "page": "run2skill_page_WCb_nq",
4258
- "proposalToolbarCompact": "run2skill_proposalToolbarCompact_WCb_nq",
4259
- "proposalToolbar": "run2skill_proposalToolbar_WCb_nq",
4260
- "proposalLayout": "run2skill_proposalLayout_WCb_nq",
4261
- "proposalListButton": "run2skill_proposalListButton_WCb_nq",
4262
- "modeGroup": "run2skill_modeGroup_WCb_nq",
4263
- "proposalMeta": "run2skill_proposalMeta_WCb_nq",
4264
- "textBlock": "run2skill_textBlock_WCb_nq",
4265
- "previewFacts": "run2skill_previewFacts_WCb_nq"
5634
+ "intro": "run2skill_intro_7hKdxq",
5635
+ "sectionTitle": "run2skill_sectionTitle_7hKdxq",
5636
+ "page": "run2skill_page_7hKdxq",
5637
+ "proposalToolbarCompact": "run2skill_proposalToolbarCompact_7hKdxq",
5638
+ "toolbar": "run2skill_toolbar_7hKdxq",
5639
+ "rejectOverlay": "run2skill_rejectOverlay_7hKdxq",
5640
+ "previewFacts": "run2skill_previewFacts_7hKdxq",
5641
+ "empty": "run2skill_empty_7hKdxq",
5642
+ "technicalDetails": "run2skill_technicalDetails_7hKdxq",
5643
+ "revisionBox": "run2skill_revisionBox_7hKdxq",
5644
+ "danger": "run2skill_danger_7hKdxq",
5645
+ "rejectCard": "run2skill_rejectCard_7hKdxq",
5646
+ "learningStatusRow": "run2skill_learningStatusRow_7hKdxq",
5647
+ "detail": "run2skill_detail_7hKdxq",
5648
+ "legacyList": "run2skill_legacyList_7hKdxq",
5649
+ "section": "run2skill_section_7hKdxq",
5650
+ "proposalList": "run2skill_proposalList_7hKdxq",
5651
+ "activitySummary": "run2skill_activitySummary_7hKdxq",
5652
+ "proposalListButton": "run2skill_proposalListButton_7hKdxq",
5653
+ "actions": "run2skill_actions_7hKdxq",
5654
+ "sectionBody": "run2skill_sectionBody_7hKdxq",
5655
+ "modeGroup": "run2skill_modeGroup_7hKdxq",
5656
+ "proposalName": "run2skill_proposalName_7hKdxq",
5657
+ "status": "run2skill_status_7hKdxq",
5658
+ "legacyDialog": "run2skill_legacyDialog_7hKdxq",
5659
+ "detailFacts": "run2skill_detailFacts_7hKdxq",
5660
+ "attentionGroup": "run2skill_attentionGroup_7hKdxq",
5661
+ "blocked": "run2skill_blocked_7hKdxq",
5662
+ "legacyHeader": "run2skill_legacyHeader_7hKdxq",
5663
+ "legacyDetail": "run2skill_legacyDetail_7hKdxq",
5664
+ "sectionHeader": "run2skill_sectionHeader_7hKdxq",
5665
+ "proposalLayout": "run2skill_proposalLayout_7hKdxq",
5666
+ "proposalMeta": "run2skill_proposalMeta_7hKdxq",
5667
+ "backdrop": "run2skill_backdrop_7hKdxq",
5668
+ "textBlock": "run2skill_textBlock_7hKdxq",
5669
+ "muted": "run2skill_muted_7hKdxq",
5670
+ "queue": "run2skill_queue_7hKdxq",
5671
+ "proposalToolbar": "run2skill_proposalToolbar_7hKdxq",
5672
+ "attentionList": "run2skill_attentionList_7hKdxq",
5673
+ "activityList": "run2skill_activityList_7hKdxq",
5674
+ "activityItem": "run2skill_activityItem_7hKdxq"
4266
5675
  };
4267
5676
  //#endregion
4268
5677
  //#region src/client/purge-settings.ts
@@ -4783,7 +6192,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4783
6192
  }
4784
6193
  }, "取消清理"), (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Button, {
4785
6194
  variant: "primary",
4786
- icon: (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.IconTrashOutline16),
6195
+ icon: (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.IconTrashOutlineMedium),
4787
6196
  disabled: props.state.mutationPending,
4788
6197
  onClick: () => {
4789
6198
  props.controller.confirm();
@@ -4826,7 +6235,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4826
6235
  const disabled = state.previewPending || state.mutationPending || active !== void 0 || activeReceipt !== void 0;
4827
6236
  return (0, react.createElement)("section", { "aria-labelledby": "run2skill-purge-heading" }, (0, react.createElement)("h3", { id: "run2skill-purge-heading" }, "缓存清理"), (0, react.createElement)("p", null, "清理 Run2Skill 自己产生的中间缓存数据"), (0, react.createElement)("div", { className: _run2skill_css_run2skill_settings_page_module_css_default.actions }, (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Button, {
4828
6237
  variant: "outline",
4829
- icon: (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.IconTrashOutline16),
6238
+ icon: (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.IconTrashOutlineMedium),
4830
6239
  disabled,
4831
6240
  onClick: (event) => {
4832
6241
  restoreRef.current = event.currentTarget;
@@ -4837,7 +6246,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4837
6246
  "aria-label": "当前数据清理状态"
4838
6247
  }, (0, react.createElement)("p", null, phaseCopy[activePhase]), (0, react.createElement)("p", null, `已删除 ${String(active?.deletedWorkItems ?? activeReceipt?.deletedWorkItems ?? 0)} 条待处理数据和 ${String(active?.deletedLineages ?? activeReceipt?.deletedLineages ?? 0)} 条 Skill 关联记录。`), active?.lastError === void 0 ? null : (0, react.createElement)(react.Fragment, null, (0, react.createElement)("p", { role: "alert" }, `清理失败:${active.lastError.code}`), (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Button, {
4839
6248
  variant: "outline",
4840
- icon: (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutline16),
6249
+ icon: (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutlineMedium),
4841
6250
  disabled: state.mutationPending,
4842
6251
  onClick: () => {
4843
6252
  props.controller.retry();
@@ -4883,9 +6292,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4883
6292
  this.#error = void 0;
4884
6293
  this.#publish();
4885
6294
  try {
4886
- await this.scope.set("automaticLearning", value);
6295
+ const accepted = await this.scope.set("automaticLearning", value);
4887
6296
  const after = this.scope.getSnapshot();
4888
- this.#error = after.status === "ready" && after.value?.automaticLearning === value ? void 0 : "SETTINGS_CHANGED";
6297
+ this.#error = accepted !== false && after.status === "ready" && after.value?.automaticLearning === value ? void 0 : "SETTINGS_CHANGED";
4889
6298
  } catch {
4890
6299
  this.#error = "SETTINGS_CHANGED";
4891
6300
  } finally {
@@ -4933,8 +6342,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4933
6342
  }), "自动学习"), (0, react.createElement)("p", null, "关闭后暂停普通自动学习;显式“保存为 Skill”仍会持久保存。已开始的分析继续使用启动时快照。"), (0, react.createElement)("p", null, "分析时沿用发起会话已经选择的模型。"), state.error === void 0 ? null : (0, react.createElement)("p", { role: "status" }, "设置已变化,请刷新后重试。"), (0, react.createElement)(PurgeSettingsSection, { controller: props.purgeController })) : null);
4934
6343
  }
4935
6344
  function applyAutomaticLearningSettingsClient(context) {
4936
- const controller = new AutomaticLearningSettingsController(context.settingsScope.bind({ namespace: "run2skill" }));
4937
- const callPurge = async (endpoint, payload, signal) => await context.connection.rpc.call(RUN2SKILL_RPC_CHANNEL, endpoint, payload, signal);
6345
+ return applyAutomaticLearningSettingsClientRemote(context);
6346
+ }
6347
+ async function applyAutomaticLearningSettingsClientRemote(context) {
6348
+ const mounted = await createRun2skillRemoteCaller(context.remote);
6349
+ const controller = new AutomaticLearningSettingsController(context.configForms.get("run2skill"));
6350
+ const callPurge = mounted.call;
4938
6351
  const purgeController = new PurgeSettingsController(callPurge, () => {
4939
6352
  return context.workspaces.list.getSnapshot().recentWorkspaceId;
4940
6353
  });
@@ -4943,14 +6356,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
4943
6356
  controller.dispose();
4944
6357
  purgeController.dispose();
4945
6358
  }, "run2skill: settings and purge");
4946
- context.slots.inject("settings.plugin.item", () => context.slots.register({
4947
- name: "settings.plugin.item",
4948
- key: "run2skill",
6359
+ context.slots.inject("plugins.item", () => context.slots.register({
6360
+ name: "plugins.item",
6361
+ id: "run2skill",
4949
6362
  inject: () => ({
4950
6363
  controller,
4951
6364
  purgeController
4952
6365
  })
4953
6366
  }, AutomaticLearningSettingsCard));
6367
+ return mounted.dispose;
4954
6368
  }
4955
6369
  //#endregion
4956
6370
  //#region src/client/proposal-inbox-wire.ts
@@ -6364,7 +7778,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6364
7778
  setState({ phase: "LOADING" });
6365
7779
  setRefreshGeneration((value) => value + 1);
6366
7780
  }
6367
- }, (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutline16)))));
7781
+ }, (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutlineMedium)))));
6368
7782
  }
6369
7783
  const recentSkillActivityResultSchema = object({
6370
7784
  ok: literal(true),
@@ -6712,7 +8126,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6712
8126
  if (toast === void 0) return null;
6713
8127
  return (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Toast, {
6714
8128
  key: toast.sequence,
6715
- icon: (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.IconWarningOutline16),
8129
+ icon: (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.IconWarningOutlineMedium),
6716
8130
  text: `Run2Skill 有 ${String(toast.count)} 项需要处理,请前往设置 → 插件 → Run2Skill`,
6717
8131
  onDone: () => {
6718
8132
  setToast(void 0);
@@ -6807,7 +8221,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6807
8221
  }) : null, (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Button, {
6808
8222
  variant: "outline",
6809
8223
  size: "sm",
6810
- icon: (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutline16),
8224
+ icon: (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutlineMedium),
6811
8225
  onClick: () => {
6812
8226
  controller.open();
6813
8227
  }
@@ -6955,7 +8369,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
6955
8369
  }, (0, react.createElement)("div", { className: _run2skill_css_run2skill_settings_page_module_css_default.toolbar }, (0, react.createElement)("strong", null, `自动沉淀未继续 · ${String(learningActions.size)} 项`), (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Button, {
6956
8370
  variant: "outline",
6957
8371
  size: "sm",
6958
- icon: (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutline16),
8372
+ icon: (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.IconRefreshOutlineMedium),
6959
8373
  disabled: !props.active || pending !== void 0,
6960
8374
  onClick: () => {
6961
8375
  setRefreshGeneration((value) => value + 1);
@@ -7219,7 +8633,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7219
8633
  ref: hostTab.ref,
7220
8634
  className: _run2skill_css_run2skill_settings_page_module_css_default.page,
7221
8635
  "data-run2skill-settings-page": true
7222
- }, (0, react.createElement)("p", { className: _run2skill_css_run2skill_settings_page_module_css_default.intro }, "Run2Skill 在后台自动沉淀经验;这里展示当前状态、需要处理的事项和持久设置。"), props.callLearningStatus === void 0 ? null : disclosure("status", "整理状态", (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.IconSparkle16), (0, react.createElement)(LearningStatusSection, {
8636
+ }, (0, react.createElement)("p", { className: _run2skill_css_run2skill_settings_page_module_css_default.intro }, "Run2Skill 在后台自动沉淀经验;这里展示当前状态、需要处理的事项和持久设置。"), props.callLearningStatus === void 0 ? null : disclosure("status", "整理状态", (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.IconSparkleMedium), (0, react.createElement)(LearningStatusSection, {
7223
8637
  key: JSON.stringify([
7224
8638
  sessionId ?? null,
7225
8639
  workspaceId ?? null,
@@ -7231,7 +8645,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7231
8645
  scopeGeneration,
7232
8646
  active: hostTab.visible && open.has("status") && !purgeDataChanging,
7233
8647
  call: props.callLearningStatus
7234
- })), disclosure("attention", "需要处理", (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.IconWarningOutline16), (0, react.createElement)("div", { className: _run2skill_css_run2skill_settings_page_module_css_default.sectionBody }, (0, react.createElement)(AttentionSettingsSummary, {
8648
+ })), disclosure("attention", "需要处理", (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.IconWarningOutlineMedium), (0, react.createElement)("div", { className: _run2skill_css_run2skill_settings_page_module_css_default.sectionBody }, (0, react.createElement)(AttentionSettingsSummary, {
7235
8649
  active: hostTab.visible && open.has("attention"),
7236
8650
  ...sessionId === void 0 ? {} : { sessionId },
7237
8651
  ...workspaceId === void 0 ? {} : { workspaceId },
@@ -7260,7 +8674,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7260
8674
  setAttentionRefresh((value) => value + 1);
7261
8675
  },
7262
8676
  scopeGeneration
7263
- }), attentionEmpty ? (0, react.createElement)("p", { className: _run2skill_css_run2skill_settings_page_module_css_default.empty }, "暂无") : null)), disclosure("activity", "最近活动", (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.IconSparkle16), (0, react.createElement)(RecentSkillActivitySection, {
8677
+ }), attentionEmpty ? (0, react.createElement)("p", { className: _run2skill_css_run2skill_settings_page_module_css_default.empty }, "暂无") : null)), disclosure("activity", "最近活动", (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.IconSparkleMedium), (0, react.createElement)(RecentSkillActivitySection, {
7264
8678
  key: JSON.stringify([
7265
8679
  workspaceId ?? null,
7266
8680
  scopeGeneration,
@@ -7272,7 +8686,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7272
8686
  active: hostTab.visible && open.has("activity") && !purgeDataChanging,
7273
8687
  scopeGeneration,
7274
8688
  hostDataEpoch: purgeState.hostDataEpoch
7275
- }), (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Pill, null, "最近 7 天")), disclosure("automatic", "自动学习", (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.IconSettingsOutline16), (0, react.createElement)(AutomaticLearningSection, { controller: props.controller })), disclosure("purge", "缓存清理", (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.IconTrashOutline16), (0, react.createElement)("div", { className: _run2skill_css_run2skill_settings_page_module_css_default.sectionBody }, (0, react.createElement)(PurgeSettingsSection, {
8689
+ }), (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.Pill, null, "最近 7 天")), disclosure("automatic", "自动学习", (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.IconSettingsOutlineMedium), (0, react.createElement)(AutomaticLearningSection, { controller: props.controller })), disclosure("purge", "缓存清理", (0, react.createElement)(_deepseek_ai_dsh_client_ui_primitives.IconTrashOutlineMedium), (0, react.createElement)("div", { className: _run2skill_css_run2skill_settings_page_module_css_default.sectionBody }, (0, react.createElement)(PurgeSettingsSection, {
7276
8690
  controller: props.purgeController,
7277
8691
  active: hostTab.visible && open.has("purge"),
7278
8692
  onCompleted: () => {
@@ -7287,13 +8701,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7287
8701
  if (sessionId === void 0) return void 0;
7288
8702
  return context.workspaces.list.getSnapshot().items.find((workspace) => workspace.sessionIds?.includes(sessionId))?.workspaceId;
7289
8703
  }
7290
- function applyRun2skillClient(context) {
7291
- const controller = new AutomaticLearningSettingsController(context.settingsScope.bind({ namespace: "run2skill" }));
7292
- const callReview = async (endpoint, payload, signal) => await context.connection.rpc.call(RUN2SKILL_RPC_CHANNEL, endpoint, payload, signal);
7293
- const callAttention = async (payload, signal) => await context.connection.rpc.call(RUN2SKILL_RPC_CHANNEL, "attention", payload, signal);
7294
- const callActivity = async (payload, signal) => await context.connection.rpc.call(RUN2SKILL_RPC_CHANNEL, "recent-activity/list", payload, signal);
7295
- const callLearningStatus = async (endpoint, payload, signal) => await context.connection.rpc.call(RUN2SKILL_RPC_CHANNEL, endpoint, payload, signal);
7296
- const callPurge = async (endpoint, payload, signal) => await context.connection.rpc.call(RUN2SKILL_RPC_CHANNEL, endpoint, payload, signal);
8704
+ async function applyRun2skillClient(context) {
8705
+ const mounted = await createRun2skillRemoteCaller(context.remote);
8706
+ const controller = new AutomaticLearningSettingsController(context.configForms.get("run2skill"));
8707
+ const callReview = mounted.call;
8708
+ const callAttention = async (payload, signal) => await mounted.call("attention", payload, signal);
8709
+ const callActivity = async (payload, signal) => await mounted.call("recent-activity/list", payload, signal);
8710
+ const callLearningStatus = mounted.call;
8711
+ const callPurge = mounted.call;
7297
8712
  const purgeController = new PurgeSettingsController(callPurge, () => workspaceFor(context, currentSessionId(context)));
7298
8713
  context.effect(() => {
7299
8714
  const disposeStyle = acquireRun2skillStyle();
@@ -7332,8 +8747,36 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7332
8747
  callAttention: props.callAttention
7333
8748
  });
7334
8749
  }));
8750
+ return mounted.dispose;
7335
8751
  }
7336
8752
  //#endregion
8753
+ //#region src/domain/observe/observe-summary.ts
8754
+ const safeCount = number().refine((value) => Number.isSafeInteger(value) && value >= 0, "Expected a non-negative safe integer");
8755
+ const ObserveSummaryV1Schema = object({
8756
+ apiVersion: literal(1),
8757
+ status: _enum([
8758
+ "READY",
8759
+ "RECOVERING",
8760
+ "DEGRADED",
8761
+ "INCOMPATIBLE"
8762
+ ]),
8763
+ capturedCount: safeCount,
8764
+ blockedCaptureCount: safeCount,
8765
+ learning: object({
8766
+ captured: safeCount,
8767
+ analyzing: safeCount,
8768
+ learned: safeCount,
8769
+ needsAttention: safeCount
8770
+ }).strict().optional(),
8771
+ unsaved: object({
8772
+ completeness: _enum(["KNOWN", "UNKNOWN"]),
8773
+ knownCount: safeCount
8774
+ }).strict(),
8775
+ recoveryLag: boolean(),
8776
+ lastRecoveryProgressAt: string().datetime({ offset: true }).optional(),
8777
+ lastHealthCode: string().regex(/^[A-Z][A-Z0-9_]{0,63}$/).optional()
8778
+ }).strict();
8779
+ //#endregion
7337
8780
  //#region src/client/observe-summary-poller.ts
7338
8781
  const OBSERVE_SUMMARY_POLL_INTERVAL_MS = 1e4;
7339
8782
  function browserEnvironment() {
@@ -7468,15 +8911,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
7468
8911
  //#region src/client/index.ts
7469
8912
  const name = "run2skill-client";
7470
8913
  const inject = [
7471
- "connection",
7472
8914
  "slots",
7473
8915
  "workspaces",
7474
8916
  "sessions",
7475
8917
  "remote",
7476
- "settingsScope"
8918
+ "configForms"
7477
8919
  ];
7478
- function apply(context) {
7479
- applyRun2skillClient(context);
8920
+ async function apply(context) {
8921
+ return await applyRun2skillClient(context);
7480
8922
  }
7481
8923
  //#endregion
7482
8924
  exports.AttentionSettingsSummary = AttentionSettingsSummary;