@oomol-lab/open-flow 0.1.0-beta.11 → 0.1.0-beta.13

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.
Files changed (52) hide show
  1. package/dist/browser/{DesignerIcon-ckcKnxxJ.js → DesignerIcon-Bzpx8BtG.js} +7 -2
  2. package/dist/browser/{_virtual_open-flow-twemoji-DJwKsM_w.js → _virtual_open-flow-twemoji-CpHJOEsk.js} +4028 -2
  3. package/dist/browser/carbon-Cn-DTyjG.js +54 -0
  4. package/dist/browser/{createResourceDialog-DhIU-HYW.js → createResourceDialog-Cdixb0WC.js} +16 -16
  5. package/dist/browser/{dist-BZ5PTFAs.js → dist-D1VYgicl.js} +426 -305
  6. package/dist/browser/{dist-Bmb2mZvW.js → dist-DYjIVIZC.js} +22 -22
  7. package/dist/browser/{dist-Ce71Szg7.js → dist-DwvhuMxw.js} +15 -15
  8. package/dist/browser/{dist-DY4qlXTK.js → dist-TJfrvoIQ.js} +21 -21
  9. package/dist/browser/{esm-C64_h7HF.js → esm-nAA6DHox.js} +1 -1
  10. package/dist/browser/flow-authoring-node.d.ts +4 -0
  11. package/dist/browser/flow-authoring.d.ts +1 -1
  12. package/dist/browser/flow-authoring.js +1528 -1443
  13. package/dist/browser/flow-change-schema.d.ts +4 -1
  14. package/dist/browser/flow-change.d.ts +42 -0
  15. package/dist/browser/flow-change.js +457 -403
  16. package/dist/browser/{flowChanges-BINNGoug.js → flowChanges-CX0dLRzD.js} +2817 -1613
  17. package/dist/browser/{flowWorkspace-Dp_b8KXF.js → flowWorkspace-BhpxeXhY.js} +51950 -50685
  18. package/dist/browser/host-conformance.d.ts +7 -0
  19. package/dist/browser/host-conformance.js +33 -0
  20. package/dist/browser/inputValues-CFlfnXlS.js +30 -0
  21. package/dist/browser/licenses.md +3 -1
  22. package/dist/browser/{select-CbQHq-GM.js → select-DCGY8Lom.js} +2580 -2003
  23. package/dist/browser/{typeScriptSession-BoV-FDl3.js → typeScriptSession-DnAmJCzu.js} +6 -6
  24. package/dist/browser/workbench.css +1 -1
  25. package/dist/browser/workbench.js +847 -780
  26. package/dist/browser/workbenchSelect-DdXtOYD1.js +30 -0
  27. package/dist/common/control-api-conformance.d.ts +6 -0
  28. package/dist/common/control-api-conformance.js +5379 -192
  29. package/dist/common/control-api.d.ts +244 -11
  30. package/dist/common/control-api.js +5535 -460
  31. package/dist/common/control-requests.d.ts +68 -0
  32. package/dist/common/control-requests.js +4949 -0
  33. package/dist/common/flow-agent.d.ts +10 -0
  34. package/dist/common/flow-encoding.d.ts +3 -1
  35. package/dist/common/flow-encoding.js +4790 -59
  36. package/dist/common/flow-json.d.ts +2 -0
  37. package/dist/common/flow-semantics.d.ts +4 -2
  38. package/dist/common/flow-semantics.js +4517 -3456
  39. package/dist/common/mcp-conformance.d.ts +2 -0
  40. package/dist/common/mcp.d.ts +545 -0
  41. package/dist/common/mcp.js +5007 -0
  42. package/dist/common/run-events.js +2 -1
  43. package/dist/common/run-lifecycle.d.ts +4 -0
  44. package/dist/common/run-lifecycle.js +30 -0
  45. package/dist/common/run-results.d.ts +56 -0
  46. package/dist/common/runtime-contract.d.ts +24 -0
  47. package/dist/common/scheduler.d.ts +29 -9
  48. package/dist/common/scheduler.js +3249 -2312
  49. package/package.json +13 -1
  50. package/dist/browser/carbon-DMCVsjHo.js +0 -53
  51. package/dist/browser/waitNotificationInputs-fzyKN6mk.js +0 -29
  52. package/dist/browser/workbenchSelect-BjbJjlNd.js +0 -435
@@ -254,48 +254,48 @@ function me(e, t, n) {
254
254
  return d(this, "shape", i), i;
255
255
  } }));
256
256
  }
257
- function y(e, t = 0) {
257
+ function he(e, t = 0) {
258
258
  if (e.aborted === !0) return !0;
259
259
  for (let n = t; n < e.issues.length; n++) if (e.issues[n]?.continue !== !0) return !0;
260
260
  return !1;
261
261
  }
262
- function he(e, t = 0) {
262
+ function ge(e, t = 0) {
263
263
  if (e.aborted === !0) return !0;
264
264
  for (let n = t; n < e.issues.length; n++) if (e.issues[n]?.continue === !1) return !0;
265
265
  return !1;
266
266
  }
267
- function b(e, t) {
267
+ function y(e, t) {
268
268
  return t.map((t) => {
269
269
  var n;
270
270
  return (n = t).path ?? (n.path = []), t.path.unshift(e), t;
271
271
  });
272
272
  }
273
- function ge(e) {
273
+ function _e(e) {
274
274
  return typeof e == "string" ? e : e?.message;
275
275
  }
276
- function _e(e, t, n) {
276
+ function ve(e, t, n) {
277
277
  var r;
278
278
  for (let i = t; i < e.length; i++) (r = e[i]).schema ?? (r.schema = n);
279
279
  }
280
- function x(e, t, n) {
280
+ function b(e, t, n) {
281
281
  var r;
282
282
  let i = e.inst?._zod?.traits;
283
283
  i?.has("$ZodType") && (i.has("$ZodCheck") ? (r = e).schema ?? (r.schema = e.inst) : e.schema = e.inst);
284
- let a = e.schema === e.inst ? void 0 : e.schema?._zod.def?.error, o = e.message ? e.message : ge(e.inst?._zod.def?.error?.(e)) ?? ge(a?.(e)) ?? ge(t?.error?.(e)) ?? ge(n.customError?.(e)) ?? ge(n.localeError?.(e)) ?? "Invalid input", { inst: s, schema: c, continue: l, input: u, ...d } = e;
284
+ let a = e.schema === e.inst ? void 0 : e.schema?._zod.def?.error, o = e.message ? e.message : _e(e.inst?._zod.def?.error?.(e)) ?? _e(a?.(e)) ?? _e(t?.error?.(e)) ?? _e(n.customError?.(e)) ?? _e(n.localeError?.(e)) ?? "Invalid input", { inst: s, schema: c, continue: l, input: u, ...d } = e;
285
285
  return d.path ??= [], d.message = o, t?.reportInput && (d.input = u), d;
286
286
  }
287
- var ve = /[\uD800-\uDBFF]/;
288
- function ye(e) {
287
+ var ye = /[\uD800-\uDBFF]/;
288
+ function be(e) {
289
289
  let t = e.length;
290
- if (!ve.test(e)) return t;
290
+ if (!ye.test(e)) return t;
291
291
  let n = t;
292
292
  for (let r = 0; r < t - 1; r++) (e.charCodeAt(r) & 64512) == 55296 && (e.charCodeAt(r + 1) & 64512) == 56320 && (n--, r++);
293
293
  return n;
294
294
  }
295
- function be(e) {
295
+ function xe(e) {
296
296
  return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
297
297
  }
298
- function xe(e) {
298
+ function Se(e) {
299
299
  let t = typeof e;
300
300
  switch (t) {
301
301
  case "number": return Number.isNaN(e) ? "nan" : "number";
@@ -308,7 +308,7 @@ function xe(e) {
308
308
  }
309
309
  return t;
310
310
  }
311
- function Se(...e) {
311
+ function Ce(...e) {
312
312
  let [t, n, r] = e;
313
313
  return typeof t == "string" ? {
314
314
  message: t,
@@ -317,16 +317,16 @@ function Se(...e) {
317
317
  inst: r
318
318
  } : { ...t };
319
319
  }
320
- function Ce(e, t) {
320
+ function we(e, t) {
321
321
  for (let n in t) {
322
322
  let r = Object.getOwnPropertyDescriptor(t, n);
323
323
  r.get ? Object.defineProperty(e, n, {
324
324
  ...r,
325
325
  enumerable: !1
326
- }) : Te(e, n, r.value);
326
+ }) : Ee(e, n, r.value);
327
327
  }
328
328
  }
329
- function S(e, t, n, r = !0) {
329
+ function x(e, t, n, r = !0) {
330
330
  return Object.defineProperty(e, t, {
331
331
  configurable: !0,
332
332
  writable: !0,
@@ -334,51 +334,51 @@ function S(e, t, n, r = !0) {
334
334
  value: n
335
335
  }), n;
336
336
  }
337
- function we(e, t, n) {
338
- return S(e, t, n, !1);
339
- }
340
337
  function Te(e, t, n) {
338
+ return x(e, t, n, !1);
339
+ }
340
+ function Ee(e, t, n) {
341
341
  Object.defineProperty(e, t, {
342
342
  configurable: !0,
343
343
  get() {
344
- return this == null ? n : S(this, t, n.bind(this));
344
+ return this == null ? n : x(this, t, n.bind(this));
345
345
  },
346
346
  set(e) {
347
- S(this, t, e);
347
+ x(this, t, e);
348
348
  }
349
349
  });
350
350
  }
351
- function Ee(e, t) {
351
+ function De(e, t) {
352
352
  let n = Object.getPrototypeOf(e);
353
353
  return t in n ? void 0 : n;
354
354
  }
355
- var De, C = !1, Oe = {
355
+ var Oe, S = !1, ke = {
356
356
  configurable: !0,
357
357
  get() {
358
- C = !0;
358
+ S = !0;
359
359
  }
360
360
  };
361
- function w(e, t, n) {
361
+ function C(e, t, n) {
362
362
  let r = Object.getPrototypeOf(e._zod);
363
- if (t in r && De !== e._zod) {
364
- De = void 0;
363
+ if (t in r && Oe !== e._zod) {
364
+ Oe = void 0;
365
365
  return;
366
366
  }
367
- De = e._zod, Object.defineProperty(r, t, {
367
+ Oe = e._zod, Object.defineProperty(r, t, {
368
368
  configurable: !0,
369
369
  get() {
370
- Object.defineProperty(this, t, Oe);
371
- let e = C;
372
- C = !1;
370
+ Object.defineProperty(this, t, ke);
371
+ let e = S;
372
+ S = !1;
373
373
  try {
374
374
  let r = n(this);
375
- return C ? delete this[t] : Object.defineProperty(this, t, {
375
+ return S ? delete this[t] : Object.defineProperty(this, t, {
376
376
  configurable: !0,
377
377
  writable: !0,
378
378
  value: r
379
- }), C ||= e, r;
379
+ }), S ||= e, r;
380
380
  } catch (n) {
381
- throw delete this[t], C ||= e, n;
381
+ throw delete this[t], S ||= e, n;
382
382
  }
383
383
  },
384
384
  set(e) {
@@ -390,8 +390,8 @@ function w(e, t, n) {
390
390
  }
391
391
  });
392
392
  }
393
- function ke(e, t, n, r) {
394
- let i = Ee(e, t);
393
+ function Ae(e, t, n, r) {
394
+ let i = De(e, t);
395
395
  i && Object.defineProperty(i, t, {
396
396
  configurable: !0,
397
397
  get() {
@@ -413,26 +413,26 @@ function ke(e, t, n, r) {
413
413
  }
414
414
  });
415
415
  }
416
- var Ae = "~constantCatch";
417
- function je(e) {
416
+ var je = "~constantCatch";
417
+ function Me(e) {
418
418
  let t = () => e;
419
- return t[Ae] = !0, t;
419
+ return t[je] = !0, t;
420
420
  }
421
421
  //#endregion
422
422
  //#region ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/core.js
423
- var Me, Ne = {
423
+ var Ne, Pe = {
424
424
  value: void 0,
425
425
  enumerable: !1
426
- }, Pe = "captureStackTrace" in Error ? Error : null;
427
- function Fe(e) {
428
- let t = Pe;
426
+ }, Fe = "captureStackTrace" in Error ? Error : null;
427
+ function Ie(e) {
428
+ let t = Fe;
429
429
  if (t) {
430
430
  let n = t.stackTraceLimit;
431
431
  if (typeof n == "number") {
432
432
  try {
433
433
  t.stackTraceLimit = 0;
434
434
  } catch {
435
- return Pe = null, new e();
435
+ return Fe = null, new e();
436
436
  }
437
437
  try {
438
438
  return new e();
@@ -443,7 +443,7 @@ function Fe(e) {
443
443
  }
444
444
  return new e();
445
445
  }
446
- function T(e, t, n, r) {
446
+ function w(e, t, n, r) {
447
447
  let i = {};
448
448
  function a(e) {
449
449
  this.def = e, this.constr = d, this.traits = /* @__PURE__ */ new Set();
@@ -452,11 +452,11 @@ function T(e, t, n, r) {
452
452
  let o = n, s = o && /* @__PURE__ */ new WeakSet();
453
453
  function c(n, r) {
454
454
  if (!n._zod) {
455
- Ne.value = new a(r);
455
+ Pe.value = new a(r);
456
456
  try {
457
- Object.defineProperty(n, "_zod", Ne);
457
+ Object.defineProperty(n, "_zod", Pe);
458
458
  } finally {
459
- Ne.value = void 0;
459
+ Pe.value = void 0;
460
460
  }
461
461
  }
462
462
  if (n._zod.traits.has(e)) return;
@@ -464,7 +464,7 @@ function T(e, t, n, r) {
464
464
  let e = Object.getPrototypeOf(n), t = n._zod.constr.prototype, r = e;
465
465
  for (; r && r !== t;) r = Object.getPrototypeOf(r);
466
466
  let i = r ?? e;
467
- s.has(i) || (s.add(i), Ce(i, o));
467
+ s.has(i) || (s.add(i), we(i, o));
468
468
  }
469
469
  let i = d.prototype;
470
470
  for (let e in i) Object.prototype.hasOwnProperty.call(i, e) && (e in n || (n[e] = i[e].bind(n)));
@@ -473,7 +473,7 @@ function T(e, t, n, r) {
473
473
  class u extends l {}
474
474
  Object.defineProperty(u, "name", { value: e });
475
475
  function d(e) {
476
- let t = r?.Parent ? Fe(u) : this;
476
+ let t = r?.Parent ? Ie(u) : this;
477
477
  c(t, e);
478
478
  let n = t._zod.deferred;
479
479
  if (n) {
@@ -485,7 +485,7 @@ function T(e, t, n, r) {
485
485
  }
486
486
  return Object.defineProperty(d, "init", { value: c }), Object.defineProperty(d, Symbol.hasInstance, { value: (t) => r?.Parent && t instanceof r.Parent ? !0 : t?._zod?.traits?.has(e) }), Object.defineProperty(d, "name", { value: e }), d;
487
487
  }
488
- var Ie = class extends Error {
488
+ var T = class extends Error {
489
489
  constructor() {
490
490
  super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
491
491
  }
@@ -494,7 +494,7 @@ var Ie = class extends Error {
494
494
  super(`Encountered unidirectional transform during encode: ${e}`), this.name = "ZodEncodeError";
495
495
  }
496
496
  };
497
- (Me = globalThis).__zod_globalConfig ?? (Me.__zod_globalConfig = {});
497
+ (Ne = globalThis).__zod_globalConfig ?? (Ne.__zod_globalConfig = {});
498
498
  var E = globalThis.__zod_globalConfig;
499
499
  function D(e) {
500
500
  return e && Object.assign(E, e), E;
@@ -541,7 +541,7 @@ var Be = {
541
541
  });
542
542
  }
543
543
  }));
544
- }, Ge = T("$ZodError", We), Ke = T("$ZodError", We, void 0, { Parent: Error });
544
+ }, Ge = w("$ZodError", We), Ke = w("$ZodError", We, void 0, { Parent: Error });
545
545
  function qe(e, t, n) {
546
546
  return Object.prototype.hasOwnProperty.call(e, t) || (t === "__proto__" ? Object.defineProperty(e, t, {
547
547
  value: n(),
@@ -605,9 +605,9 @@ var Ze = (e) => {
605
605
  value: r,
606
606
  issues: []
607
607
  }, o);
608
- if (s instanceof Promise) throw new Ie();
608
+ if (s instanceof Promise) throw new T();
609
609
  if (s.issues.length) {
610
- let n = new ((a?.Err) ?? e)(s.issues.map((e) => x(e, o, D())));
610
+ let n = new ((a?.Err) ?? e)(s.issues.map((e) => b(e, o, D())));
611
611
  throw ee(n, a?.callee ?? t), n;
612
612
  }
613
613
  return s.value;
@@ -623,7 +623,7 @@ var Ze = (e) => {
623
623
  issues: []
624
624
  }, o);
625
625
  if (s instanceof Promise && (s = await s), s.issues.length) {
626
- let n = new ((a?.Err) ?? e)(s.issues.map((e) => x(e, o, D())));
626
+ let n = new ((a?.Err) ?? e)(s.issues.map((e) => b(e, o, D())));
627
627
  throw ee(n, a?.callee ?? t), n;
628
628
  }
629
629
  return s.value;
@@ -637,10 +637,10 @@ var Ze = (e) => {
637
637
  value: n,
638
638
  issues: []
639
639
  }, i);
640
- if (a instanceof Promise) throw new Ie();
640
+ if (a instanceof Promise) throw new T();
641
641
  return a.issues.length ? {
642
642
  success: !1,
643
- error: new (e ?? Ge)(a.issues.map((e) => x(e, i, D())))
643
+ error: new (e ?? Ge)(a.issues.map((e) => b(e, i, D())))
644
644
  } : {
645
645
  success: !0,
646
646
  data: a.value
@@ -655,7 +655,7 @@ var Ze = (e) => {
655
655
  }, i);
656
656
  return a instanceof Promise && (a = await a), a.issues.length ? {
657
657
  success: !1,
658
- error: new e(a.issues.map((e) => x(e, i, D())))
658
+ error: new e(a.issues.map((e) => b(e, i, D())))
659
659
  } : {
660
660
  success: !0,
661
661
  data: a.value
@@ -728,7 +728,7 @@ function Lt(e) {
728
728
  var Rt = (e) => {
729
729
  let t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
730
730
  return RegExp(`^${t}$`);
731
- }, zt = /^-?\d+$/, Bt = /^-?\d+(?:\.\d+)?$/, Vt = /^(?:true|false)$/i, Ht = /^null$/i, Ut = /^[^A-Z]*$/, Wt = /^[^a-z]*$/, O = /*@__PURE__*/ T("$ZodCheck", (e, t) => {
731
+ }, zt = /^-?\d+$/, Bt = /^-?\d+(?:\.\d+)?$/, Vt = /^(?:true|false)$/i, Ht = /^null$/i, Ut = /^[^A-Z]*$/, Wt = /^[^a-z]*$/, O = /*@__PURE__*/ w("$ZodCheck", (e, t) => {
732
732
  var n;
733
733
  e._zod ??= {}, e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
734
734
  }), Gt = (e) => {
@@ -738,7 +738,7 @@ var Rt = (e) => {
738
738
  number: "number",
739
739
  bigint: "bigint",
740
740
  object: "date"
741
- }, qt = /*@__PURE__*/ T("$ZodCheckLessThan", (e, t) => {
741
+ }, qt = /*@__PURE__*/ w("$ZodCheckLessThan", (e, t) => {
742
742
  O.init(e, t);
743
743
  let n = Kt[typeof t.value];
744
744
  e._zod.onattach.push((e) => {
@@ -755,7 +755,7 @@ var Rt = (e) => {
755
755
  continue: !t.abort
756
756
  });
757
757
  };
758
- }), Jt = /*@__PURE__*/ T("$ZodCheckGreaterThan", (e, t) => {
758
+ }), Jt = /*@__PURE__*/ w("$ZodCheckGreaterThan", (e, t) => {
759
759
  O.init(e, t);
760
760
  let n = Kt[typeof t.value];
761
761
  e._zod.onattach.push((e) => {
@@ -772,7 +772,7 @@ var Rt = (e) => {
772
772
  continue: !t.abort
773
773
  });
774
774
  };
775
- }), Yt = /*@__PURE__*/ T("$ZodCheckMultipleOf", (e, t) => {
775
+ }), Yt = /*@__PURE__*/ w("$ZodCheckMultipleOf", (e, t) => {
776
776
  O.init(e, t), e._zod.onattach.push((e) => {
777
777
  var n;
778
778
  (n = e._zod.bag).multipleOf ?? (n.multipleOf = t.value);
@@ -787,7 +787,7 @@ var Rt = (e) => {
787
787
  continue: !t.abort
788
788
  });
789
789
  };
790
- }), Xt = /*@__PURE__*/ T("$ZodCheckNumberFormat", (e, t) => {
790
+ }), Xt = /*@__PURE__*/ w("$ZodCheckNumberFormat", (e, t) => {
791
791
  O.init(e, t), t.format = t.format || "float64";
792
792
  let n = t.format?.includes("int"), r = n ? "int" : "number", [i, a] = se[t.format];
793
793
  e._zod.onattach.push((e) => {
@@ -848,15 +848,15 @@ var Rt = (e) => {
848
848
  continue: !t.abort
849
849
  });
850
850
  };
851
- }), Zt = /*@__PURE__*/ T("$ZodCheckMaxLength", (e, t) => {
851
+ }), Zt = /*@__PURE__*/ w("$ZodCheckMaxLength", (e, t) => {
852
852
  var n;
853
853
  O.init(e, t), (n = e._zod.def).when ?? (n.when = Gt), e._zod.onattach.push((e) => {
854
854
  let n = e._zod.bag.maximum ?? Infinity;
855
855
  t.maximum < n && (e._zod.bag.maximum = t.maximum);
856
856
  }), e._zod.check = (n) => {
857
857
  let r = n.value, i = r.length;
858
- if ((typeof r == "string" && i > t.maximum ? ye(r) : i) <= t.maximum) return;
859
- let a = be(r);
858
+ if ((typeof r == "string" && i > t.maximum ? be(r) : i) <= t.maximum) return;
859
+ let a = xe(r);
860
860
  n.issues.push({
861
861
  origin: a,
862
862
  code: "too_big",
@@ -867,15 +867,15 @@ var Rt = (e) => {
867
867
  continue: !t.abort
868
868
  });
869
869
  };
870
- }), Qt = /*@__PURE__*/ T("$ZodCheckMinLength", (e, t) => {
870
+ }), Qt = /*@__PURE__*/ w("$ZodCheckMinLength", (e, t) => {
871
871
  var n;
872
872
  O.init(e, t), (n = e._zod.def).when ?? (n.when = Gt), e._zod.onattach.push((e) => {
873
873
  let n = e._zod.bag.minimum ?? -Infinity;
874
874
  t.minimum > n && (e._zod.bag.minimum = t.minimum);
875
875
  }), e._zod.check = (n) => {
876
876
  let r = n.value, i = r.length;
877
- if ((typeof r == "string" && i >= t.minimum && i < t.minimum * 2 ? ye(r) : i) >= t.minimum) return;
878
- let a = be(r);
877
+ if ((typeof r == "string" && i >= t.minimum && i < t.minimum * 2 ? be(r) : i) >= t.minimum) return;
878
+ let a = xe(r);
879
879
  n.issues.push({
880
880
  origin: a,
881
881
  code: "too_small",
@@ -886,15 +886,15 @@ var Rt = (e) => {
886
886
  continue: !t.abort
887
887
  });
888
888
  };
889
- }), $t = /*@__PURE__*/ T("$ZodCheckLengthEquals", (e, t) => {
889
+ }), $t = /*@__PURE__*/ w("$ZodCheckLengthEquals", (e, t) => {
890
890
  var n;
891
891
  O.init(e, t), (n = e._zod.def).when ?? (n.when = Gt), e._zod.onattach.push((e) => {
892
892
  let n = e._zod.bag;
893
893
  n.minimum = t.length, n.maximum = t.length, n.length = t.length;
894
894
  }), e._zod.check = (n) => {
895
- let r = n.value, i = r.length, a = typeof r == "string" && i >= t.length && i <= t.length * 2 ? ye(r) : i;
895
+ let r = n.value, i = r.length, a = typeof r == "string" && i >= t.length && i <= t.length * 2 ? be(r) : i;
896
896
  if (a === t.length) return;
897
- let o = be(r), s = a > t.length;
897
+ let o = xe(r), s = a > t.length;
898
898
  n.issues.push({
899
899
  origin: o,
900
900
  ...s ? {
@@ -911,7 +911,7 @@ var Rt = (e) => {
911
911
  continue: !t.abort
912
912
  });
913
913
  };
914
- }), en = /*@__PURE__*/ T("$ZodCheckStringFormat", (e, t) => {
914
+ }), en = /*@__PURE__*/ w("$ZodCheckStringFormat", (e, t) => {
915
915
  var n, r;
916
916
  O.init(e, t), e._zod.onattach.push((e) => {
917
917
  let n = e._zod.bag;
@@ -927,7 +927,7 @@ var Rt = (e) => {
927
927
  continue: !t.abort
928
928
  });
929
929
  }) : (r = e._zod).check ?? (r.check = () => {});
930
- }), tn = /*@__PURE__*/ T("$ZodCheckRegex", (e, t) => {
930
+ }), tn = /*@__PURE__*/ w("$ZodCheckRegex", (e, t) => {
931
931
  en.init(e, t), e._zod.check = (n) => {
932
932
  t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
933
933
  origin: "string",
@@ -939,11 +939,11 @@ var Rt = (e) => {
939
939
  continue: !t.abort
940
940
  });
941
941
  };
942
- }), nn = /*@__PURE__*/ T("$ZodCheckLowerCase", (e, t) => {
942
+ }), nn = /*@__PURE__*/ w("$ZodCheckLowerCase", (e, t) => {
943
943
  t.pattern ??= Ut, en.init(e, t);
944
- }), rn = /*@__PURE__*/ T("$ZodCheckUpperCase", (e, t) => {
944
+ }), rn = /*@__PURE__*/ w("$ZodCheckUpperCase", (e, t) => {
945
945
  t.pattern ??= Wt, en.init(e, t);
946
- }), an = /*@__PURE__*/ T("$ZodCheckIncludes", (e, t) => {
946
+ }), an = /*@__PURE__*/ w("$ZodCheckIncludes", (e, t) => {
947
947
  O.init(e, t);
948
948
  let n = g(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position},}${n}` : n);
949
949
  t.pattern = r, e._zod.onattach.push((e) => {
@@ -960,7 +960,7 @@ var Rt = (e) => {
960
960
  continue: !t.abort
961
961
  });
962
962
  };
963
- }), on = /*@__PURE__*/ T("$ZodCheckStartsWith", (e, t) => {
963
+ }), on = /*@__PURE__*/ w("$ZodCheckStartsWith", (e, t) => {
964
964
  O.init(e, t);
965
965
  let n = RegExp(`^${g(t.prefix)}.*`);
966
966
  t.pattern ??= n, e._zod.onattach.push((e) => {
@@ -977,7 +977,7 @@ var Rt = (e) => {
977
977
  continue: !t.abort
978
978
  });
979
979
  };
980
- }), sn = /*@__PURE__*/ T("$ZodCheckEndsWith", (e, t) => {
980
+ }), sn = /*@__PURE__*/ w("$ZodCheckEndsWith", (e, t) => {
981
981
  O.init(e, t);
982
982
  let n = RegExp(`.*${g(t.suffix)}$`);
983
983
  t.pattern ??= n, e._zod.onattach.push((e) => {
@@ -994,7 +994,7 @@ var Rt = (e) => {
994
994
  continue: !t.abort
995
995
  });
996
996
  };
997
- }), cn = /*@__PURE__*/ T("$ZodCheckOverwrite", (e, t) => {
997
+ }), cn = /*@__PURE__*/ w("$ZodCheckOverwrite", (e, t) => {
998
998
  O.init(e, t), e._zod.check = (e) => {
999
999
  e.value = t.tx(e.value);
1000
1000
  };
@@ -1021,7 +1021,7 @@ var Rt = (e) => {
1021
1021
  major: 4,
1022
1022
  minor: 5,
1023
1023
  patch: 4
1024
- }, k = /*@__PURE__*/ T("$ZodType", (e, t) => {
1024
+ }, k = /*@__PURE__*/ w("$ZodType", (e, t) => {
1025
1025
  var n;
1026
1026
  e ??= {}, e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = un;
1027
1027
  let r = e._zod.def.checks, i = e._zod.traits.has("$ZodCheck") ? [e, ...r ?? []] : r?.length ? [...r] : [];
@@ -1032,27 +1032,27 @@ var Rt = (e) => {
1032
1032
  else {
1033
1033
  let t = (t, n, r) => {
1034
1034
  if (t.memo) return t;
1035
- let i = y(t), a;
1035
+ let i = he(t), a;
1036
1036
  for (let o of n) {
1037
1037
  if (o._zod.def.when) {
1038
- if (he(t) || !o._zod.def.when(t)) continue;
1038
+ if (ge(t) || !o._zod.def.when(t)) continue;
1039
1039
  } else if (i) continue;
1040
1040
  let n = t.issues.length, s = o._zod.check(t);
1041
- if (s instanceof Promise && r?.async === !1) throw new Ie();
1041
+ if (s instanceof Promise && r?.async === !1) throw new T();
1042
1042
  if (a || s instanceof Promise) a = (a ?? Promise.resolve()).then(async () => {
1043
- await s, t.issues.length !== n && (_e(t.issues, n, e), i ||= y(t, n));
1043
+ await s, t.issues.length !== n && (ve(t.issues, n, e), i ||= he(t, n));
1044
1044
  });
1045
1045
  else {
1046
1046
  if (t.issues.length === n) continue;
1047
- _e(t.issues, n, e), i ||= y(t, n);
1047
+ ve(t.issues, n, e), i ||= he(t, n);
1048
1048
  }
1049
1049
  }
1050
1050
  return a ? a.then(() => t) : t;
1051
1051
  }, n = (n, r, a) => {
1052
- if (y(n)) return n.aborted = !0, n;
1052
+ if (he(n)) return n.aborted = !0, n;
1053
1053
  let o = t(r, i, a);
1054
1054
  if (o instanceof Promise) {
1055
- if (a.async === !1) throw new Ie();
1055
+ if (a.async === !1) throw new T();
1056
1056
  return o.then((t) => e._zod.parse(t, a));
1057
1057
  }
1058
1058
  return e._zod.parse(o, a);
@@ -1071,7 +1071,7 @@ var Rt = (e) => {
1071
1071
  }
1072
1072
  let o = e._zod.parse(r, a);
1073
1073
  if (o instanceof Promise) {
1074
- if (a.async === !1) throw new Ie();
1074
+ if (a.async === !1) throw new T();
1075
1075
  return o.then((e) => t(e, i, a));
1076
1076
  }
1077
1077
  return t(o, i, a);
@@ -1079,10 +1079,10 @@ var Rt = (e) => {
1079
1079
  }
1080
1080
  }, {
1081
1081
  get "~standard"() {
1082
- return we(this, "~standard", fn(this));
1082
+ return Te(this, "~standard", fn(this));
1083
1083
  },
1084
1084
  set "~standard"(e) {
1085
- S(this, "~standard", e);
1085
+ x(this, "~standard", e);
1086
1086
  }
1087
1087
  }), dn = (e) => e.success ? { value: e.data } : { issues: e.error?.issues };
1088
1088
  function fn(e) {
@@ -1098,7 +1098,7 @@ function fn(e) {
1098
1098
  version: 1
1099
1099
  };
1100
1100
  }
1101
- var pn = /*@__PURE__*/ T("$ZodString", (e, t) => {
1101
+ var pn = /*@__PURE__*/ w("$ZodString", (e, t) => {
1102
1102
  k.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? Rt(e._zod.bag), e._zod.parse = (n, r) => {
1103
1103
  if (t.coerce) try {
1104
1104
  n.value = String(n.value);
@@ -1110,11 +1110,11 @@ var pn = /*@__PURE__*/ T("$ZodString", (e, t) => {
1110
1110
  inst: e
1111
1111
  }), n;
1112
1112
  };
1113
- }), A = /*@__PURE__*/ T("$ZodStringFormat", (e, t) => {
1113
+ }), A = /*@__PURE__*/ w("$ZodStringFormat", (e, t) => {
1114
1114
  en.init(e, t), pn.init(e, t);
1115
- }), mn = /*@__PURE__*/ T("$ZodGUID", (e, t) => {
1115
+ }), mn = /*@__PURE__*/ w("$ZodGUID", (e, t) => {
1116
1116
  t.pattern ??= yt, A.init(e, t);
1117
- }), hn = /*@__PURE__*/ T("$ZodUUID", (e, t) => {
1117
+ }), hn = /*@__PURE__*/ w("$ZodUUID", (e, t) => {
1118
1118
  if (t.version) {
1119
1119
  let e = {
1120
1120
  v1: 1,
@@ -1130,7 +1130,7 @@ var pn = /*@__PURE__*/ T("$ZodString", (e, t) => {
1130
1130
  t.pattern ??= bt(e);
1131
1131
  } else t.pattern ??= bt();
1132
1132
  A.init(e, t);
1133
- }), gn = /*@__PURE__*/ T("$ZodEmail", (e, t) => {
1133
+ }), gn = /*@__PURE__*/ w("$ZodEmail", (e, t) => {
1134
1134
  t.pattern ??= xt, A.init(e, t);
1135
1135
  });
1136
1136
  function _n(e, t) {
@@ -1151,7 +1151,7 @@ function bn(e, t) {
1151
1151
  function xn(e, t) {
1152
1152
  return t.lastIndex = 0, t.test(e.protocol.endsWith(":") ? e.protocol.slice(0, -1) : e.protocol);
1153
1153
  }
1154
- var Sn = /*@__PURE__*/ T("$ZodURL", (e, t) => {
1154
+ var Sn = /*@__PURE__*/ w("$ZodURL", (e, t) => {
1155
1155
  A.init(e, t), e._zod.check = (n) => {
1156
1156
  try {
1157
1157
  let r = n.value.trim(), i = _n(r, t);
@@ -1204,32 +1204,32 @@ var Sn = /*@__PURE__*/ T("$ZodURL", (e, t) => {
1204
1204
  });
1205
1205
  }
1206
1206
  };
1207
- }), Cn = /*@__PURE__*/ T("$ZodEmoji", (e, t) => {
1207
+ }), Cn = /*@__PURE__*/ w("$ZodEmoji", (e, t) => {
1208
1208
  t.pattern ??= Ct(), A.init(e, t);
1209
- }), wn = /*@__PURE__*/ T("$ZodNanoID", (e, t) => {
1209
+ }), wn = /*@__PURE__*/ w("$ZodNanoID", (e, t) => {
1210
1210
  if (t.length !== void 0 && (!Number.isInteger(t.length) || t.length < 1)) throw Error(`Invalid nanoid length: ${t.length}`);
1211
1211
  t.pattern ??= t.length === void 0 ? gt : _t(t.length), A.init(e, t);
1212
- }), Tn = /*@__PURE__*/ T("$ZodCUID", (e, t) => {
1212
+ }), Tn = /*@__PURE__*/ w("$ZodCUID", (e, t) => {
1213
1213
  t.pattern ??= dt, A.init(e, t);
1214
- }), En = /*@__PURE__*/ T("$ZodCUID2", (e, t) => {
1214
+ }), En = /*@__PURE__*/ w("$ZodCUID2", (e, t) => {
1215
1215
  t.pattern ??= ft, A.init(e, t);
1216
- }), Dn = /*@__PURE__*/ T("$ZodULID", (e, t) => {
1216
+ }), Dn = /*@__PURE__*/ w("$ZodULID", (e, t) => {
1217
1217
  t.pattern ??= pt, A.init(e, t);
1218
- }), On = /*@__PURE__*/ T("$ZodXID", (e, t) => {
1218
+ }), On = /*@__PURE__*/ w("$ZodXID", (e, t) => {
1219
1219
  t.pattern ??= mt, A.init(e, t);
1220
- }), kn = /*@__PURE__*/ T("$ZodKSUID", (e, t) => {
1220
+ }), kn = /*@__PURE__*/ w("$ZodKSUID", (e, t) => {
1221
1221
  t.pattern ??= ht, A.init(e, t);
1222
- }), An = /*@__PURE__*/ T("$ZodISODateTime", (e, t) => {
1222
+ }), An = /*@__PURE__*/ w("$ZodISODateTime", (e, t) => {
1223
1223
  t.pattern ??= Lt(t), A.init(e, t), (t.local || t.precision === -1) && (e._zod.bag.laxFormat = !0, e._zod.onattach.push((e) => {
1224
1224
  e._zod.bag.laxFormat = !0;
1225
1225
  }));
1226
- }), jn = /*@__PURE__*/ T("$ZodISODate", (e, t) => {
1226
+ }), jn = /*@__PURE__*/ w("$ZodISODate", (e, t) => {
1227
1227
  t.pattern ??= Pt, A.init(e, t);
1228
- }), Mn = /*@__PURE__*/ T("$ZodISOTime", (e, t) => {
1228
+ }), Mn = /*@__PURE__*/ w("$ZodISOTime", (e, t) => {
1229
1229
  t.pattern ??= It(t), A.init(e, t);
1230
- }), Nn = /*@__PURE__*/ T("$ZodISODuration", (e, t) => {
1230
+ }), Nn = /*@__PURE__*/ w("$ZodISODuration", (e, t) => {
1231
1231
  t.pattern ??= vt, A.init(e, t);
1232
- }), Pn = /*@__PURE__*/ T("$ZodIPv4", (e, t) => {
1232
+ }), Pn = /*@__PURE__*/ w("$ZodIPv4", (e, t) => {
1233
1233
  t.pattern ??= wt, A.init(e, t), e._zod.bag.format = "ipv4";
1234
1234
  }), Fn = /^[0-9a-fA-F:.]+$/;
1235
1235
  function In(e) {
@@ -1240,7 +1240,7 @@ function In(e) {
1240
1240
  return !1;
1241
1241
  }
1242
1242
  }
1243
- var Ln = /*@__PURE__*/ T("$ZodIPv6", (e, t) => {
1243
+ var Ln = /*@__PURE__*/ w("$ZodIPv6", (e, t) => {
1244
1244
  t.pattern ??= Tt, A.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (n) => {
1245
1245
  In(n.value) || n.issues.push({
1246
1246
  code: "invalid_format",
@@ -1250,7 +1250,7 @@ var Ln = /*@__PURE__*/ T("$ZodIPv6", (e, t) => {
1250
1250
  continue: !t.abort
1251
1251
  });
1252
1252
  };
1253
- }), Rn = /*@__PURE__*/ T("$ZodCIDRv4", (e, t) => {
1253
+ }), Rn = /*@__PURE__*/ w("$ZodCIDRv4", (e, t) => {
1254
1254
  t.pattern ??= Et, A.init(e, t);
1255
1255
  });
1256
1256
  function zn(e) {
@@ -1261,7 +1261,7 @@ function zn(e) {
1261
1261
  let i = Number(r);
1262
1262
  return `${i}` !== r || i < 0 || i > 128 ? !1 : In(n);
1263
1263
  }
1264
- var Bn = /*@__PURE__*/ T("$ZodCIDRv6", (e, t) => {
1264
+ var Bn = /*@__PURE__*/ w("$ZodCIDRv6", (e, t) => {
1265
1265
  t.pattern ??= Dt, A.init(e, t), e._zod.check = (n) => {
1266
1266
  zn(n.value) || n.issues.push({
1267
1267
  code: "invalid_format",
@@ -1281,7 +1281,7 @@ function Vn(e) {
1281
1281
  return !1;
1282
1282
  }
1283
1283
  }
1284
- var Hn = /*@__PURE__*/ T("$ZodBase64", (e, t) => {
1284
+ var Hn = /*@__PURE__*/ w("$ZodBase64", (e, t) => {
1285
1285
  t.pattern ??= Ot, A.init(e, t), e._zod.bag.contentEncoding = "base64", e._zod.check = (n) => {
1286
1286
  Vn(n.value) || n.issues.push({
1287
1287
  code: "invalid_format",
@@ -1297,7 +1297,7 @@ function Un(e) {
1297
1297
  let t = e.replace(/[-_]/g, (e) => e === "-" ? "+" : "/");
1298
1298
  return Vn(t.padEnd(Math.ceil(t.length / 4) * 4, "="));
1299
1299
  }
1300
- var Wn = /*@__PURE__*/ T("$ZodBase64URL", (e, t) => {
1300
+ var Wn = /*@__PURE__*/ w("$ZodBase64URL", (e, t) => {
1301
1301
  t.pattern ??= kt, A.init(e, t), e._zod.bag.contentEncoding = "base64url", e._zod.check = (n) => {
1302
1302
  Un(n.value) || n.issues.push({
1303
1303
  code: "invalid_format",
@@ -1307,7 +1307,7 @@ var Wn = /*@__PURE__*/ T("$ZodBase64URL", (e, t) => {
1307
1307
  continue: !t.abort
1308
1308
  });
1309
1309
  };
1310
- }), Gn = /*@__PURE__*/ T("$ZodE164", (e, t) => {
1310
+ }), Gn = /*@__PURE__*/ w("$ZodE164", (e, t) => {
1311
1311
  t.pattern ??= jt, A.init(e, t);
1312
1312
  });
1313
1313
  function Kn(e, t = null) {
@@ -1322,7 +1322,7 @@ function Kn(e, t = null) {
1322
1322
  return !1;
1323
1323
  }
1324
1324
  }
1325
- var qn = /*@__PURE__*/ T("$ZodJWT", (e, t) => {
1325
+ var qn = /*@__PURE__*/ w("$ZodJWT", (e, t) => {
1326
1326
  A.init(e, t), e._zod.check = (n) => {
1327
1327
  Kn(n.value, t.alg) || n.issues.push({
1328
1328
  code: "invalid_format",
@@ -1332,7 +1332,7 @@ var qn = /*@__PURE__*/ T("$ZodJWT", (e, t) => {
1332
1332
  continue: !t.abort
1333
1333
  });
1334
1334
  };
1335
- }), Jn = /*@__PURE__*/ T("$ZodNumber", (e, t) => {
1335
+ }), Jn = /*@__PURE__*/ w("$ZodNumber", (e, t) => {
1336
1336
  k.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? Bt, e._zod.parse = (n, r) => {
1337
1337
  if (t.coerce) try {
1338
1338
  n.value = Number(n.value);
@@ -1348,9 +1348,9 @@ var qn = /*@__PURE__*/ T("$ZodJWT", (e, t) => {
1348
1348
  ...a ? { received: a } : {}
1349
1349
  }), n;
1350
1350
  };
1351
- }), Yn = /*@__PURE__*/ T("$ZodNumberFormat", (e, t) => {
1351
+ }), Yn = /*@__PURE__*/ w("$ZodNumberFormat", (e, t) => {
1352
1352
  Xt.init(e, t), Jn.init(e, t);
1353
- }), Xn = /*@__PURE__*/ T("$ZodBoolean", (e, t) => {
1353
+ }), Xn = /*@__PURE__*/ w("$ZodBoolean", (e, t) => {
1354
1354
  k.init(e, t), e._zod.pattern = Vt, e._zod.parse = (n, r) => {
1355
1355
  if (t.coerce) try {
1356
1356
  n.value = !!n.value;
@@ -1363,7 +1363,7 @@ var qn = /*@__PURE__*/ T("$ZodJWT", (e, t) => {
1363
1363
  inst: e
1364
1364
  }), n;
1365
1365
  };
1366
- }), Zn = /*@__PURE__*/ T("$ZodNull", (e, t) => {
1366
+ }), Zn = /*@__PURE__*/ w("$ZodNull", (e, t) => {
1367
1367
  k.init(e, t), e._zod.pattern = Ht, e._zod.values = /* @__PURE__ */ new Set([null]), e._zod.parse = (t, n) => {
1368
1368
  let r = t.value;
1369
1369
  return r === null || t.issues.push({
@@ -1373,9 +1373,9 @@ var qn = /*@__PURE__*/ T("$ZodJWT", (e, t) => {
1373
1373
  inst: e
1374
1374
  }), t;
1375
1375
  };
1376
- }), Qn = /*@__PURE__*/ T("$ZodUnknown", (e, t) => {
1376
+ }), Qn = /*@__PURE__*/ w("$ZodUnknown", (e, t) => {
1377
1377
  k.init(e, t), e._zod.parse = (e) => e;
1378
- }), $n = /*@__PURE__*/ T("$ZodNever", (e, t) => {
1378
+ }), $n = /*@__PURE__*/ w("$ZodNever", (e, t) => {
1379
1379
  k.init(e, t), e._zod.parse = (t, n) => (t.issues.push({
1380
1380
  expected: "never",
1381
1381
  code: "invalid_type",
@@ -1384,9 +1384,9 @@ var qn = /*@__PURE__*/ T("$ZodJWT", (e, t) => {
1384
1384
  }), t);
1385
1385
  });
1386
1386
  function er(e, t, n) {
1387
- e.issues.length && t.issues.push(...b(n, e.issues)), t.value[n] = e.value;
1387
+ e.issues.length && t.issues.push(...y(n, e.issues)), t.value[n] = e.value;
1388
1388
  }
1389
- var tr = /*@__PURE__*/ T("$ZodArray", (e, t) => {
1389
+ var tr = /*@__PURE__*/ w("$ZodArray", (e, t) => {
1390
1390
  k.init(e, t);
1391
1391
  let n = E.memoizer;
1392
1392
  n?.attach(e), e._zod.parse = (r, i) => {
@@ -1414,7 +1414,7 @@ function nr(e, t, n, r, i, a) {
1414
1414
  if (!(!o && s && i === "optional")) {
1415
1415
  if (e.issues.length) {
1416
1416
  if (i !== void 0 && s && !o) return;
1417
- t.issues.push(...b(n, e.issues));
1417
+ t.issues.push(...y(n, e.issues));
1418
1418
  }
1419
1419
  if (!o && i === void 0) {
1420
1420
  e.issues.length || t.issues.push({
@@ -1468,7 +1468,7 @@ function ar(e, t, n, r, i, a) {
1468
1468
  continue: !0
1469
1469
  }), e.length ? Promise.all(e).then(() => n) : n;
1470
1470
  }
1471
- var or = /* @__PURE__ */ new WeakMap(), sr = /*@__PURE__*/ T("$ZodObject", (e, t) => {
1471
+ var or = /* @__PURE__ */ new WeakMap(), sr = /*@__PURE__*/ w("$ZodObject", (e, t) => {
1472
1472
  if (k.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
1473
1473
  let e = t.shape;
1474
1474
  or.set(t, e), Object.defineProperty(t, "shape", { get: () => {
@@ -1477,7 +1477,7 @@ var or = /* @__PURE__ */ new WeakMap(), sr = /*@__PURE__*/ T("$ZodObject", (e, t
1477
1477
  } });
1478
1478
  }
1479
1479
  let n = a(() => ir(t));
1480
- w(e, "propValues", (e) => {
1480
+ C(e, "propValues", (e) => {
1481
1481
  let t = e.def.shape, n = {};
1482
1482
  for (let e in t) {
1483
1483
  let r = t[e]._zod;
@@ -1511,7 +1511,7 @@ var or = /* @__PURE__ */ new WeakMap(), sr = /*@__PURE__*/ T("$ZodObject", (e, t
1511
1511
  }
1512
1512
  return i ? ar(l, c, t, a, n.value, e) : l.length ? Promise.all(l).then(() => t) : t;
1513
1513
  };
1514
- }), cr = /*@__PURE__*/ T("$ZodObjectJIT", (e, t) => {
1514
+ }), cr = /*@__PURE__*/ w("$ZodObjectJIT", (e, t) => {
1515
1515
  sr.init(e, t);
1516
1516
  let n = e._zod.parse, r = a(() => ir(t)), i = E.memoizer, o = (t) => {
1517
1517
  let n = r.value, a = n.symbolKeys, o = new ln(["payload", "ctx"], {
@@ -1592,18 +1592,18 @@ var or = /* @__PURE__ */ new WeakMap(), sr = /*@__PURE__*/ T("$ZodObject", (e, t
1592
1592
  });
1593
1593
  function lr(e, t, n, r) {
1594
1594
  for (let n of e) if (n.issues.length === 0) return t.value = n.value, t;
1595
- let i = e.filter((e) => !y(e));
1595
+ let i = e.filter((e) => !he(e));
1596
1596
  return i.length === 1 ? (t.value = i[0].value, i[0]) : (t.issues.push({
1597
1597
  code: "invalid_union",
1598
1598
  input: t.value,
1599
1599
  inst: n,
1600
- errors: e.map((e) => e.issues.map((e) => x(e, r, D())))
1600
+ errors: e.map((e) => e.issues.map((e) => b(e, r, D())))
1601
1601
  }), t);
1602
1602
  }
1603
- var ur = /*@__PURE__*/ T("$ZodUnion", (e, t) => {
1604
- k.init(e, t), w(e, "optin", (e) => e.def.options.some((e) => e._zod.optin === "defaulted") ? "defaulted" : e.def.options.some((e) => e._zod.optin !== void 0) ? "optional" : void 0), w(e, "optout", (e) => e.def.options.some((e) => e._zod.optout === "optional") ? "optional" : void 0), w(e, "values", (e) => {
1603
+ var ur = /*@__PURE__*/ w("$ZodUnion", (e, t) => {
1604
+ k.init(e, t), C(e, "optin", (e) => e.def.options.some((e) => e._zod.optin === "defaulted") ? "defaulted" : e.def.options.some((e) => e._zod.optin !== void 0) ? "optional" : void 0), C(e, "optout", (e) => e.def.options.some((e) => e._zod.optout === "optional") ? "optional" : void 0), C(e, "values", (e) => {
1605
1605
  if (e.def.options.every((e) => e._zod.values)) return new Set(e.def.options.flatMap((e) => Array.from(e._zod.values)));
1606
- }), w(e, "pattern", (e) => {
1606
+ }), C(e, "pattern", (e) => {
1607
1607
  if (e.def.options.every((e) => e._zod.pattern)) {
1608
1608
  let t = e.def.options.map((e) => e._zod.pattern);
1609
1609
  return RegExp(`^(${t.map((e) => s(e.source)).join("|")})$`);
@@ -1626,7 +1626,7 @@ var ur = /*@__PURE__*/ T("$ZodUnion", (e, t) => {
1626
1626
  }
1627
1627
  return a ? Promise.all(o).then((t) => lr(t, r, e, i)) : lr(o, r, e, i);
1628
1628
  };
1629
- }), dr = /*@__PURE__*/ T("$ZodIntersection", (e, t) => {
1629
+ }), dr = /*@__PURE__*/ w("$ZodIntersection", (e, t) => {
1630
1630
  k.init(e, t), e._zod.parse = (e, n) => {
1631
1631
  let r = e.value, i = t.left._zod.run({
1632
1632
  value: r,
@@ -1711,12 +1711,12 @@ function pr(e, t, n) {
1711
1711
  }
1712
1712
  let c = fr(t.value, n.value);
1713
1713
  if (!c.valid) {
1714
- if (y(e)) return e;
1714
+ if (he(e)) return e;
1715
1715
  throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`);
1716
1716
  }
1717
1717
  return e.value = c.data, e;
1718
1718
  }
1719
- var mr = /*@__PURE__*/ T("$ZodTuple", (e, t) => {
1719
+ var mr = /*@__PURE__*/ w("$ZodTuple", (e, t) => {
1720
1720
  k.init(e, t);
1721
1721
  let n = t.items, r = E.memoizer;
1722
1722
  r?.attach(e), e._zod.parse = (i, a) => {
@@ -1776,7 +1776,7 @@ function hr(e, t) {
1776
1776
  return 0;
1777
1777
  }
1778
1778
  function gr(e, t, n) {
1779
- e.issues.length && t.issues.push(...b(n, e.issues)), t.value[n] = e.value;
1779
+ e.issues.length && t.issues.push(...y(n, e.issues)), t.value[n] = e.value;
1780
1780
  }
1781
1781
  function _r(e, t, n, r, i) {
1782
1782
  for (let a = 0; a < n.length; a++) {
@@ -1790,14 +1790,14 @@ function _r(e, t, n, r, i) {
1790
1790
  t.value.length = a;
1791
1791
  break;
1792
1792
  }
1793
- t.issues.push(...b(a, o.issues));
1793
+ t.issues.push(...y(a, o.issues));
1794
1794
  }
1795
1795
  t.value[a] = o.value;
1796
1796
  }
1797
1797
  for (let e = t.value.length - 1; e >= r.length && n[e]._zod.optout === "optional" && t.value[e] === void 0; e--) t.value.length = e;
1798
1798
  return t;
1799
1799
  }
1800
- var vr = /*@__PURE__*/ T("$ZodRecord", (e, t) => {
1800
+ var vr = /*@__PURE__*/ w("$ZodRecord", (e, t) => {
1801
1801
  k.init(e, t);
1802
1802
  let n = E.memoizer;
1803
1803
  n?.attach(e), e._zod.parse = (r, i) => {
@@ -1823,7 +1823,7 @@ var vr = /*@__PURE__*/ T("$ZodRecord", (e, t) => {
1823
1823
  r.issues.push({
1824
1824
  code: "invalid_key",
1825
1825
  origin: "record",
1826
- issues: s.issues.map((e) => x(e, i, D())),
1826
+ issues: s.issues.map((e) => b(e, i, D())),
1827
1827
  input: n,
1828
1828
  path: [n],
1829
1829
  inst: e
@@ -1837,8 +1837,8 @@ var vr = /*@__PURE__*/ T("$ZodRecord", (e, t) => {
1837
1837
  issues: []
1838
1838
  }, i);
1839
1839
  u instanceof Promise ? o.push(u.then((e) => {
1840
- e.issues.length && r.issues.push(...b(n, e.issues)), r.value[l] = e.value;
1841
- })) : (u.issues.length && r.issues.push(...b(n, u.issues)), r.value[l] = u.value);
1840
+ e.issues.length && r.issues.push(...y(n, e.issues)), r.value[l] = e.value;
1841
+ })) : (u.issues.length && r.issues.push(...y(n, u.issues)), r.value[l] = u.value);
1842
1842
  }
1843
1843
  let l;
1844
1844
  for (let e in a) if (!c.has(e)) {
@@ -1876,7 +1876,7 @@ var vr = /*@__PURE__*/ T("$ZodRecord", (e, t) => {
1876
1876
  t.mode === "loose" ? r.value[n] = a[n] : s ? (c ??= [], c.push(n)) : r.issues.push({
1877
1877
  code: "invalid_key",
1878
1878
  origin: "record",
1879
- issues: l.issues.map((e) => x(e, i, D())),
1879
+ issues: l.issues.map((e) => b(e, i, D())),
1880
1880
  input: n,
1881
1881
  path: [n],
1882
1882
  inst: e
@@ -1890,8 +1890,8 @@ var vr = /*@__PURE__*/ T("$ZodRecord", (e, t) => {
1890
1890
  issues: []
1891
1891
  }, i);
1892
1892
  d instanceof Promise ? o.push(d.then((e) => {
1893
- e.issues.length && r.issues.push(...b(n, e.issues)), r.value[u] = e.value;
1894
- })) : (d.issues.length && r.issues.push(...b(n, d.issues)), r.value[u] = d.value);
1893
+ e.issues.length && r.issues.push(...y(n, e.issues)), r.value[u] = e.value;
1894
+ })) : (d.issues.length && r.issues.push(...y(n, d.issues)), r.value[u] = d.value);
1895
1895
  }
1896
1896
  c && c.length > 0 && r.issues.push({
1897
1897
  code: "unrecognized_keys",
@@ -1903,7 +1903,7 @@ var vr = /*@__PURE__*/ T("$ZodRecord", (e, t) => {
1903
1903
  }
1904
1904
  return o.length ? Promise.all(o).then(() => r) : r;
1905
1905
  };
1906
- }), yr = /*@__PURE__*/ T("$ZodEnum", (e, t) => {
1906
+ }), yr = /*@__PURE__*/ w("$ZodEnum", (e, t) => {
1907
1907
  k.init(e, t);
1908
1908
  let r = n(t.entries), i = new Set(r);
1909
1909
  e._zod.values = i;
@@ -1917,7 +1917,7 @@ var vr = /*@__PURE__*/ T("$ZodRecord", (e, t) => {
1917
1917
  inst: e
1918
1918
  }), t;
1919
1919
  };
1920
- }), br = /*@__PURE__*/ T("$ZodLiteral", (e, t) => {
1920
+ }), br = /*@__PURE__*/ w("$ZodLiteral", (e, t) => {
1921
1921
  k.init(e, t);
1922
1922
  let n = new Set(t.values);
1923
1923
  e._zod.values = n, e._zod.pattern = RegExp(t.values.length ? `^(${t.values.map((e) => typeof e == "string" ? g(e) : e ? g(e.toString()) : String(e)).join("|")})$` : "^[^\\s\\S]$"), e._zod.parse = (r, i) => {
@@ -1929,23 +1929,23 @@ var vr = /*@__PURE__*/ T("$ZodRecord", (e, t) => {
1929
1929
  inst: e
1930
1930
  }), r;
1931
1931
  };
1932
- }), xr = /*@__PURE__*/ T("$ZodTransform", (e, t) => {
1932
+ }), xr = /*@__PURE__*/ w("$ZodTransform", (e, t) => {
1933
1933
  k.init(e, t), e._zod.optin = "optional", E.memoizer?.guard(e), e._zod.parse = (n, r) => {
1934
1934
  if (r.direction === "backward") throw new Le(e.constructor.name);
1935
1935
  let i = t.transform(n.value, n);
1936
1936
  if (r.async) return (i instanceof Promise ? i : Promise.resolve(i)).then((e) => (n.value = e, n));
1937
- if (i instanceof Promise) throw new Ie();
1937
+ if (i instanceof Promise) throw new T();
1938
1938
  return n.value = i, n;
1939
1939
  };
1940
1940
  });
1941
1941
  function Sr(e, t) {
1942
1942
  return e.value = t.issues.length ? void 0 : t.value, e;
1943
1943
  }
1944
- var Cr = /*@__PURE__*/ T("$ZodOptional", (e, t) => {
1945
- k.init(e, t), w(e, "optin", (e) => e.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional"), e._zod.optout = "optional", w(e, "values", (e) => {
1944
+ var Cr = /*@__PURE__*/ w("$ZodOptional", (e, t) => {
1945
+ k.init(e, t), C(e, "optin", (e) => e.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional"), e._zod.optout = "optional", C(e, "values", (e) => {
1946
1946
  let t = e.def.innerType._zod.values;
1947
1947
  return t ? /* @__PURE__ */ new Set([...t, void 0]) : void 0;
1948
- }), w(e, "pattern", (e) => {
1948
+ }), C(e, "pattern", (e) => {
1949
1949
  let t = e.def.innerType._zod.pattern;
1950
1950
  return t ? RegExp(`^(${s(t.source)})?$`) : void 0;
1951
1951
  }), e._zod.parse = (e, n) => {
@@ -1959,15 +1959,15 @@ var Cr = /*@__PURE__*/ T("$ZodOptional", (e, t) => {
1959
1959
  }
1960
1960
  return t.innerType._zod.run(e, n);
1961
1961
  };
1962
- }), wr = /*@__PURE__*/ T("$ZodExactOptional", (e, t) => {
1963
- Cr.init(e, t), w(e, "values", (e) => e.def.innerType._zod.values), w(e, "pattern", (e) => e.def.innerType._zod.pattern), e._zod.parse = (e, n) => t.innerType._zod.run(e, n);
1964
- }), Tr = /*@__PURE__*/ T("$ZodNullable", (e, t) => {
1965
- k.init(e, t), w(e, "optin", (e) => e.def.innerType._zod.optin), w(e, "optout", (e) => e.def.innerType._zod.optout), w(e, "pattern", (e) => {
1962
+ }), wr = /*@__PURE__*/ w("$ZodExactOptional", (e, t) => {
1963
+ Cr.init(e, t), C(e, "values", (e) => e.def.innerType._zod.values), C(e, "pattern", (e) => e.def.innerType._zod.pattern), e._zod.parse = (e, n) => t.innerType._zod.run(e, n);
1964
+ }), Tr = /*@__PURE__*/ w("$ZodNullable", (e, t) => {
1965
+ k.init(e, t), C(e, "optin", (e) => e.def.innerType._zod.optin), C(e, "optout", (e) => e.def.innerType._zod.optout), C(e, "pattern", (e) => {
1966
1966
  let t = e.def.innerType._zod.pattern;
1967
1967
  return t ? RegExp(`^(${s(t.source)}|null)$`) : void 0;
1968
- }), w(e, "values", (e) => e.def.innerType._zod.values ? /* @__PURE__ */ new Set([...e.def.innerType._zod.values, null]) : void 0), e._zod.parse = (e, n) => e.value === null ? e : t.innerType._zod.run(e, n);
1969
- }), Er = /*@__PURE__*/ T("$ZodDefault", (e, t) => {
1970
- k.init(e, t), e._zod.optin = "defaulted", w(e, "values", (e) => e.def.innerType._zod.values), e._zod.parse = (e, n) => {
1968
+ }), C(e, "values", (e) => e.def.innerType._zod.values ? /* @__PURE__ */ new Set([...e.def.innerType._zod.values, null]) : void 0), e._zod.parse = (e, n) => e.value === null ? e : t.innerType._zod.run(e, n);
1969
+ }), Er = /*@__PURE__*/ w("$ZodDefault", (e, t) => {
1970
+ k.init(e, t), e._zod.optin = "defaulted", C(e, "values", (e) => e.def.innerType._zod.values), e._zod.parse = (e, n) => {
1971
1971
  if (n.direction === "backward") return t.innerType._zod.run(e, n);
1972
1972
  if (e.value === void 0) return e.value = t.defaultValue, e;
1973
1973
  let r = t.innerType._zod.run(e, n);
@@ -1977,10 +1977,10 @@ var Cr = /*@__PURE__*/ T("$ZodOptional", (e, t) => {
1977
1977
  function Dr(e, t) {
1978
1978
  return e.value === void 0 && (e.value = t.defaultValue), e;
1979
1979
  }
1980
- var Or = /*@__PURE__*/ T("$ZodPrefault", (e, t) => {
1981
- k.init(e, t), e._zod.optin = "defaulted", w(e, "values", (e) => e.def.innerType._zod.values), e._zod.parse = (e, n) => (n.direction === "backward" || e.value === void 0 && (e.value = t.defaultValue), t.innerType._zod.run(e, n));
1982
- }), kr = /*@__PURE__*/ T("$ZodNonOptional", (e, t) => {
1983
- k.init(e, t), w(e, "values", (e) => {
1980
+ var Or = /*@__PURE__*/ w("$ZodPrefault", (e, t) => {
1981
+ k.init(e, t), e._zod.optin = "defaulted", C(e, "values", (e) => e.def.innerType._zod.values), e._zod.parse = (e, n) => (n.direction === "backward" || e.value === void 0 && (e.value = t.defaultValue), t.innerType._zod.run(e, n));
1982
+ }), kr = /*@__PURE__*/ w("$ZodNonOptional", (e, t) => {
1983
+ k.init(e, t), C(e, "values", (e) => {
1984
1984
  let t = e.def.innerType._zod.values;
1985
1985
  return t ? new Set([...t].filter((e) => e !== void 0)) : void 0;
1986
1986
  }), e._zod.parse = (n, r) => {
@@ -2000,12 +2000,12 @@ function jr(e, t, n, r) {
2000
2000
  return t.issues.length ? (e.value = n.catchValue({
2001
2001
  ...t,
2002
2002
  value: e.value,
2003
- error: { issues: t.issues.map((e) => x(e, r, D())) },
2003
+ error: { issues: t.issues.map((e) => b(e, r, D())) },
2004
2004
  input: e.value
2005
2005
  }), e) : (e.value = t.value, t.memo && (e.memo = !0), e);
2006
2006
  }
2007
- var Mr = /*@__PURE__*/ T("$ZodCatch", (e, t) => {
2008
- k.init(e, t), w(e, "optin", (e) => e.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional"), w(e, "optout", (e) => e.def.innerType._zod.optout), w(e, "values", (e) => e.def.innerType._zod.values), e._zod.parse = (e, n) => {
2007
+ var Mr = /*@__PURE__*/ w("$ZodCatch", (e, t) => {
2008
+ k.init(e, t), C(e, "optin", (e) => e.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional"), C(e, "optout", (e) => e.def.innerType._zod.optout), C(e, "values", (e) => e.def.innerType._zod.values), e._zod.parse = (e, n) => {
2009
2009
  if (n.direction === "backward") return t.innerType._zod.run(e, n);
2010
2010
  let r = t.innerType._zod.run({
2011
2011
  value: e.value,
@@ -2013,8 +2013,8 @@ var Mr = /*@__PURE__*/ T("$ZodCatch", (e, t) => {
2013
2013
  }, n);
2014
2014
  return r instanceof Promise ? r.then((r) => jr(e, r, t, n)) : jr(e, r, t, n);
2015
2015
  };
2016
- }), Nr = /*@__PURE__*/ T("$ZodPipe", (e, t) => {
2017
- k.init(e, t), w(e, "values", (e) => e.def.in._zod.values), w(e, "optin", (e) => e.def.in._zod.optin), w(e, "optout", (e) => e.def.out._zod.optout), w(e, "propValues", (e) => e.def.in._zod.propValues), e._zod.parse = (e, n) => {
2016
+ }), Nr = /*@__PURE__*/ w("$ZodPipe", (e, t) => {
2017
+ k.init(e, t), C(e, "values", (e) => e.def.in._zod.values), C(e, "optin", (e) => e.def.in._zod.optin), C(e, "optout", (e) => e.def.out._zod.optout), C(e, "propValues", (e) => e.def.in._zod.propValues), e._zod.parse = (e, n) => {
2018
2018
  if (n.direction === "backward") {
2019
2019
  let r = t.out._zod.run(e, n);
2020
2020
  return r instanceof Promise ? r.then((e) => Pr(e, t.in, n)) : Pr(r, t.in, n);
@@ -2029,8 +2029,8 @@ function Pr(e, t, n) {
2029
2029
  issues: e.issues
2030
2030
  }, n);
2031
2031
  }
2032
- var Fr = /*@__PURE__*/ T("$ZodReadonly", (e, t) => {
2033
- k.init(e, t), w(e, "propValues", (e) => e.def.innerType._zod.propValues), w(e, "values", (e) => e.def.innerType._zod.values), w(e, "optin", (e) => e.def.innerType?._zod?.optin), w(e, "optout", (e) => e.def.innerType?._zod?.optout), e._zod.parse = (e, n) => {
2032
+ var Fr = /*@__PURE__*/ w("$ZodReadonly", (e, t) => {
2033
+ k.init(e, t), C(e, "propValues", (e) => e.def.innerType._zod.propValues), C(e, "values", (e) => e.def.innerType._zod.values), C(e, "optin", (e) => e.def.innerType?._zod?.optin), C(e, "optout", (e) => e.def.innerType?._zod?.optout), e._zod.parse = (e, n) => {
2034
2034
  if (n.direction === "backward") return t.innerType._zod.run(e, n);
2035
2035
  let r = t.innerType._zod.run(e, n);
2036
2036
  return r instanceof Promise ? r.then(Ir) : Ir(r);
@@ -2039,12 +2039,12 @@ var Fr = /*@__PURE__*/ T("$ZodReadonly", (e, t) => {
2039
2039
  function Ir(e) {
2040
2040
  return e.memo || (e.value = Object.freeze(e.value)), e;
2041
2041
  }
2042
- var Lr = /*@__PURE__*/ T("$ZodLazy", (e, t) => {
2042
+ var Lr = /*@__PURE__*/ w("$ZodLazy", (e, t) => {
2043
2043
  k.init(e, t), u(e._zod, "innerType", () => {
2044
2044
  let e = t;
2045
2045
  return e._cachedInner ||= t.getter(), e._cachedInner;
2046
- }), w(e, "pattern", (e) => e.innerType?._zod?.pattern), w(e, "propValues", (e) => e.innerType?._zod?.propValues), w(e, "optin", (e) => e.innerType?._zod?.optin ?? void 0), w(e, "optout", (e) => e.innerType?._zod?.optout ?? void 0), e._zod.parse = (t, n) => e._zod.innerType._zod.run(t, n);
2047
- }), Rr = /*@__PURE__*/ T("$ZodCustom", (e, t) => {
2046
+ }), C(e, "pattern", (e) => e.innerType?._zod?.pattern), C(e, "propValues", (e) => e.innerType?._zod?.propValues), C(e, "optin", (e) => e.innerType?._zod?.optin ?? void 0), C(e, "optout", (e) => e.innerType?._zod?.optout ?? void 0), e._zod.parse = (t, n) => e._zod.innerType._zod.run(t, n);
2047
+ }), Rr = /*@__PURE__*/ w("$ZodCustom", (e, t) => {
2048
2048
  O.init(e, t), k.init(e, t), e._zod.parse = (e, t) => e, e._zod.check = (n) => {
2049
2049
  let r = n.value, i = t.fn(r);
2050
2050
  if (i instanceof Promise) return i.then((t) => zr(t, n, r, e));
@@ -2060,7 +2060,7 @@ function zr(e, t, n, r) {
2060
2060
  path: [...r._zod.def.path ?? []],
2061
2061
  continue: !r._zod.def.abort
2062
2062
  };
2063
- r._zod.def.params && (e.params = r._zod.def.params), t.issues.push(Se(e));
2063
+ r._zod.def.params && (e.params = r._zod.def.params), t.issues.push(Ce(e));
2064
2064
  }
2065
2065
  }
2066
2066
  //#endregion
@@ -2286,7 +2286,7 @@ var Qr = () => {
2286
2286
  }
2287
2287
  return (e) => {
2288
2288
  switch (e.code) {
2289
- case "invalid_type": return `Invalid input: expected ${a(e.expected)}, received ${a(xe(e.input), e.input)}`;
2289
+ case "invalid_type": return `Invalid input: expected ${a(e.expected)}, received ${a(Se(e.input), e.input)}`;
2290
2290
  case "invalid_value": return e.values.length === 1 ? `Invalid input: expected ${ae(e.values[0])}` : `Invalid option: expected one of ${r(e.values, "|")}`;
2291
2291
  case "too_big": {
2292
2292
  let n = e.exact ? "exactly " : e.inclusive ? "<=" : "<", r = t(e.origin);
@@ -2833,10 +2833,10 @@ function ra(e, t, n) {
2833
2833
  // @__NO_SIDE_EFFECTS__
2834
2834
  function ia(e, t) {
2835
2835
  let n = /* @__PURE__ */ aa((t) => (t.addIssue = (e) => {
2836
- if (typeof e == "string") t.issues.push(Se(e, t.value, n._zod.def));
2836
+ if (typeof e == "string") t.issues.push(Ce(e, t.value, n._zod.def));
2837
2837
  else {
2838
2838
  let r = e;
2839
- r.fatal && (r.continue = !1), r.code ??= "custom", "input" in r || (r.input = t.value), r.inst ??= n, r.continue ??= !n._zod.def.abort, t.issues.push(Se(r));
2839
+ r.fatal && (r.continue = !1), r.code ??= "custom", "input" in r || (r.input = t.value), r.inst ??= n, r.continue ??= !n._zod.def.abort, t.issues.push(Ce(r));
2840
2840
  }
2841
2841
  }, e(t.value, t)), t);
2842
2842
  return n;
@@ -3591,7 +3591,7 @@ function ho(e, t, n) {
3591
3591
  }
3592
3592
  });
3593
3593
  }
3594
- var F = /*@__PURE__*/ T("ZodError", (e, t) => {
3594
+ var F = /*@__PURE__*/ w("ZodError", (e, t) => {
3595
3595
  Ge.init(e, t), e.name = "ZodError";
3596
3596
  let n = Object.getPrototypeOf(e);
3597
3597
  mo.has(n) || (mo.add(n), ho(n, "format", (e) => (t) => Ye(e, t)), ho(n, "flatten", (e) => (t) => Je(e, t)), ho(n, "addIssue", (e) => (t) => {
@@ -3614,7 +3614,7 @@ function Oo() {
3614
3614
  function ko() {
3615
3615
  E.memoizer || D({ memoizer: Xr() });
3616
3616
  }
3617
- var I = /*@__PURE__*/ T("ZodType", (e, t) => (Oo(), k.init(e, t), e.def = t, e.type = t.type, e), {
3617
+ var I = /*@__PURE__*/ w("ZodType", (e, t) => (Oo(), k.init(e, t), e.def = t, e.type = t.type, e), {
3618
3618
  check(...e) {
3619
3619
  let t = this.def;
3620
3620
  return this.clone(f(t, { checks: [...t.checks ?? [], ...e.map((e) => typeof e == "function" ? { _zod: {
@@ -3636,28 +3636,28 @@ var I = /*@__PURE__*/ T("ZodType", (e, t) => (Oo(), k.init(e, t), e.def = t, e.t
3636
3636
  return e.add(this, t), this;
3637
3637
  },
3638
3638
  refine(e, t) {
3639
- return this.check(Ks(e, t));
3639
+ return this.check(Gs(e, t));
3640
3640
  },
3641
3641
  superRefine(e, t) {
3642
- return this.check(qs(e, t));
3642
+ return this.check(Ks(e, t));
3643
3643
  },
3644
3644
  overwrite(e) {
3645
3645
  return this.check(/* @__PURE__ */ j(e));
3646
3646
  },
3647
3647
  optional() {
3648
- return Es(this);
3648
+ return Ts(this);
3649
3649
  },
3650
3650
  exactOptional() {
3651
- return Os(this);
3651
+ return Ds(this);
3652
3652
  },
3653
3653
  nullable() {
3654
- return As(this);
3654
+ return ks(this);
3655
3655
  },
3656
3656
  nullish() {
3657
- return Es(As(this));
3657
+ return Ts(ks(this));
3658
3658
  },
3659
3659
  nonoptional(e) {
3660
- return Is(this, e);
3660
+ return Fs(this, e);
3661
3661
  },
3662
3662
  array() {
3663
3663
  return B(this);
@@ -3666,25 +3666,25 @@ var I = /*@__PURE__*/ T("ZodType", (e, t) => (Oo(), k.init(e, t), e.def = t, e.t
3666
3666
  return H([this, e]);
3667
3667
  },
3668
3668
  and(e) {
3669
- return _s(this, e);
3669
+ return gs(this, e);
3670
3670
  },
3671
3671
  transform(e) {
3672
- return Bs(this, ws(e));
3672
+ return zs(this, Cs(e));
3673
3673
  },
3674
3674
  default(e) {
3675
- return Ms(this, e);
3675
+ return js(this, e);
3676
3676
  },
3677
3677
  prefault(e) {
3678
- return Ps(this, e);
3678
+ return Ns(this, e);
3679
3679
  },
3680
3680
  catch(e) {
3681
- return Rs(this, e);
3681
+ return Ls(this, e);
3682
3682
  },
3683
3683
  pipe(e) {
3684
- return Bs(this, e);
3684
+ return zs(this, e);
3685
3685
  },
3686
3686
  readonly() {
3687
- return Hs(this);
3687
+ return Vs(this);
3688
3688
  },
3689
3689
  describe(e) {
3690
3690
  let t = this.clone();
@@ -3705,7 +3705,7 @@ var I = /*@__PURE__*/ T("ZodType", (e, t) => (Oo(), k.init(e, t), e.def = t, e.t
3705
3705
  return t.length === 0 ? e(this) : e(this, ...t);
3706
3706
  },
3707
3707
  get "~standard"() {
3708
- return we(this, "~standard", {
3708
+ return Te(this, "~standard", {
3709
3709
  ...fn(this),
3710
3710
  jsonSchema: {
3711
3711
  input: va(this, "input"),
@@ -3714,7 +3714,7 @@ var I = /*@__PURE__*/ T("ZodType", (e, t) => (Oo(), k.init(e, t), e.def = t, e.t
3714
3714
  });
3715
3715
  },
3716
3716
  set "~standard"(e) {
3717
- S(this, "~standard", e);
3717
+ x(this, "~standard", e);
3718
3718
  },
3719
3719
  parse: function e(t, n) {
3720
3720
  return go(this, t, n, { callee: e });
@@ -3732,7 +3732,7 @@ var I = /*@__PURE__*/ T("ZodType", (e, t) => (Oo(), k.init(e, t), e.def = t, e.t
3732
3732
  return this?.safeParseAsync;
3733
3733
  },
3734
3734
  set spa(e) {
3735
- S(this, "spa", e);
3735
+ x(this, "spa", e);
3736
3736
  },
3737
3737
  encode: function e(t, n) {
3738
3738
  return bo(this, t, n, { callee: e });
@@ -3767,7 +3767,7 @@ var I = /*@__PURE__*/ T("ZodType", (e, t) => (Oo(), k.init(e, t), e.def = t, e.t
3767
3767
  get _def() {
3768
3768
  return this._zod.def;
3769
3769
  }
3770
- }), Ao = /*@__PURE__*/ T("_ZodString", (e, t) => {
3770
+ }), Ao = /*@__PURE__*/ w("_ZodString", (e, t) => {
3771
3771
  pn.init(e, t), I.init(e, t), e._zod.processJSONSchema = (t, n, r) => ba(e, t, n, r);
3772
3772
  let n = e._zod.bag;
3773
3773
  e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null;
@@ -3817,7 +3817,7 @@ var I = /*@__PURE__*/ T("ZodType", (e, t) => (Oo(), k.init(e, t), e.def = t, e.t
3817
3817
  slugify() {
3818
3818
  return this.check(/* @__PURE__ */ ta());
3819
3819
  }
3820
- }), jo = /*@__PURE__*/ T("ZodString", (e, t) => {
3820
+ }), jo = /*@__PURE__*/ w("ZodString", (e, t) => {
3821
3821
  pn.init(e, t), Ao.init(e, t);
3822
3822
  }, {
3823
3823
  email(e) {
@@ -3902,55 +3902,55 @@ var I = /*@__PURE__*/ T("ZodType", (e, t) => (Oo(), k.init(e, t), e.def = t, e.t
3902
3902
  function Mo(e) {
3903
3903
  return /* @__PURE__ */ ii(jo, e);
3904
3904
  }
3905
- var L = /*@__PURE__*/ T("ZodStringFormat", (e, t) => {
3905
+ var L = /*@__PURE__*/ w("ZodStringFormat", (e, t) => {
3906
3906
  A.init(e, t), Ao.init(e, t);
3907
- }), No = /*@__PURE__*/ T("ZodISODateTime", (e, t) => {
3907
+ }), No = /*@__PURE__*/ w("ZodISODateTime", (e, t) => {
3908
3908
  An.init(e, t), L.init(e, t);
3909
- }), Po = /*@__PURE__*/ T("ZodISODate", (e, t) => {
3909
+ }), Po = /*@__PURE__*/ w("ZodISODate", (e, t) => {
3910
3910
  jn.init(e, t), L.init(e, t);
3911
- }), Fo = /*@__PURE__*/ T("ZodISOTime", (e, t) => {
3911
+ }), Fo = /*@__PURE__*/ w("ZodISOTime", (e, t) => {
3912
3912
  Mn.init(e, t), L.init(e, t);
3913
- }), Io = /*@__PURE__*/ T("ZodISODuration", (e, t) => {
3913
+ }), Io = /*@__PURE__*/ w("ZodISODuration", (e, t) => {
3914
3914
  Nn.init(e, t), L.init(e, t);
3915
- }), Lo = /*@__PURE__*/ T("ZodEmail", (e, t) => {
3915
+ }), Lo = /*@__PURE__*/ w("ZodEmail", (e, t) => {
3916
3916
  gn.init(e, t), L.init(e, t);
3917
- }), Ro = /*@__PURE__*/ T("ZodGUID", (e, t) => {
3917
+ }), Ro = /*@__PURE__*/ w("ZodGUID", (e, t) => {
3918
3918
  mn.init(e, t), L.init(e, t);
3919
- }), zo = /*@__PURE__*/ T("ZodUUID", (e, t) => {
3919
+ }), zo = /*@__PURE__*/ w("ZodUUID", (e, t) => {
3920
3920
  hn.init(e, t), L.init(e, t);
3921
- }), Bo = /*@__PURE__*/ T("ZodURL", (e, t) => {
3921
+ }), Bo = /*@__PURE__*/ w("ZodURL", (e, t) => {
3922
3922
  Sn.init(e, t), L.init(e, t);
3923
- }), Vo = /*@__PURE__*/ T("ZodEmoji", (e, t) => {
3923
+ }), Vo = /*@__PURE__*/ w("ZodEmoji", (e, t) => {
3924
3924
  Cn.init(e, t), L.init(e, t);
3925
- }), Ho = /*@__PURE__*/ T("ZodNanoID", (e, t) => {
3925
+ }), Ho = /*@__PURE__*/ w("ZodNanoID", (e, t) => {
3926
3926
  wn.init(e, t), L.init(e, t);
3927
- }), Uo = /*@__PURE__*/ T("ZodCUID", (e, t) => {
3927
+ }), Uo = /*@__PURE__*/ w("ZodCUID", (e, t) => {
3928
3928
  Tn.init(e, t), L.init(e, t);
3929
- }), Wo = /*@__PURE__*/ T("ZodCUID2", (e, t) => {
3929
+ }), Wo = /*@__PURE__*/ w("ZodCUID2", (e, t) => {
3930
3930
  En.init(e, t), L.init(e, t);
3931
- }), Go = /*@__PURE__*/ T("ZodULID", (e, t) => {
3931
+ }), Go = /*@__PURE__*/ w("ZodULID", (e, t) => {
3932
3932
  Dn.init(e, t), L.init(e, t);
3933
- }), Ko = /*@__PURE__*/ T("ZodXID", (e, t) => {
3933
+ }), Ko = /*@__PURE__*/ w("ZodXID", (e, t) => {
3934
3934
  On.init(e, t), L.init(e, t);
3935
- }), qo = /*@__PURE__*/ T("ZodKSUID", (e, t) => {
3935
+ }), qo = /*@__PURE__*/ w("ZodKSUID", (e, t) => {
3936
3936
  kn.init(e, t), L.init(e, t);
3937
- }), Jo = /*@__PURE__*/ T("ZodIPv4", (e, t) => {
3937
+ }), Jo = /*@__PURE__*/ w("ZodIPv4", (e, t) => {
3938
3938
  Pn.init(e, t), L.init(e, t);
3939
- }), Yo = /*@__PURE__*/ T("ZodIPv6", (e, t) => {
3939
+ }), Yo = /*@__PURE__*/ w("ZodIPv6", (e, t) => {
3940
3940
  Ln.init(e, t), L.init(e, t);
3941
- }), Xo = /*@__PURE__*/ T("ZodCIDRv4", (e, t) => {
3941
+ }), Xo = /*@__PURE__*/ w("ZodCIDRv4", (e, t) => {
3942
3942
  Rn.init(e, t), L.init(e, t);
3943
- }), Zo = /*@__PURE__*/ T("ZodCIDRv6", (e, t) => {
3943
+ }), Zo = /*@__PURE__*/ w("ZodCIDRv6", (e, t) => {
3944
3944
  Bn.init(e, t), L.init(e, t);
3945
- }), Qo = /*@__PURE__*/ T("ZodBase64", (e, t) => {
3945
+ }), Qo = /*@__PURE__*/ w("ZodBase64", (e, t) => {
3946
3946
  Hn.init(e, t), L.init(e, t);
3947
- }), $o = /*@__PURE__*/ T("ZodBase64URL", (e, t) => {
3947
+ }), $o = /*@__PURE__*/ w("ZodBase64URL", (e, t) => {
3948
3948
  Wn.init(e, t), L.init(e, t);
3949
- }), es = /*@__PURE__*/ T("ZodE164", (e, t) => {
3949
+ }), es = /*@__PURE__*/ w("ZodE164", (e, t) => {
3950
3950
  Gn.init(e, t), L.init(e, t);
3951
- }), ts = /*@__PURE__*/ T("ZodJWT", (e, t) => {
3951
+ }), ts = /*@__PURE__*/ w("ZodJWT", (e, t) => {
3952
3952
  qn.init(e, t), L.init(e, t);
3953
- }), ns = /*@__PURE__*/ T("ZodNumber", (e, t) => {
3953
+ }), ns = /*@__PURE__*/ w("ZodNumber", (e, t) => {
3954
3954
  Jn.init(e, t), I.init(e, t), e._zod.processJSONSchema = (t, n, r) => xa(e, t, n, r);
3955
3955
  let n = e._zod.bag;
3956
3956
  e.minValue = Math.max(n.minimum ?? -Infinity, n.exclusiveMinimum ?? -Infinity) ?? null, e.maxValue = Math.min(n.maximum ?? Infinity, n.exclusiveMaximum ?? Infinity) ?? null, e.isInt = (n.format ?? "").includes("int") || Number.isSafeInteger(n.multipleOf ?? .5), e.isFinite = !0, e.format = n.format ?? null;
@@ -4004,37 +4004,37 @@ var L = /*@__PURE__*/ T("ZodStringFormat", (e, t) => {
4004
4004
  function R(e) {
4005
4005
  return /* @__PURE__ */ ji(ns, e);
4006
4006
  }
4007
- var rs = /*@__PURE__*/ T("ZodNumberFormat", (e, t) => {
4007
+ var rs = /*@__PURE__*/ w("ZodNumberFormat", (e, t) => {
4008
4008
  Yn.init(e, t), ns.init(e, t);
4009
4009
  });
4010
4010
  function is(e) {
4011
4011
  return /* @__PURE__ */ Mi(rs, e);
4012
4012
  }
4013
- var as = /*@__PURE__*/ T("ZodBoolean", (e, t) => {
4013
+ var as = /*@__PURE__*/ w("ZodBoolean", (e, t) => {
4014
4014
  Xn.init(e, t), I.init(e, t), e._zod.processJSONSchema = (t, n, r) => Sa(e, t, n, r);
4015
4015
  });
4016
4016
  function z(e) {
4017
4017
  return /* @__PURE__ */ Ni(as, e);
4018
4018
  }
4019
- var os = /*@__PURE__*/ T("ZodNull", (e, t) => {
4019
+ var os = /*@__PURE__*/ w("ZodNull", (e, t) => {
4020
4020
  Zn.init(e, t), I.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ta(e, t, n, r);
4021
4021
  });
4022
4022
  function ss(e) {
4023
4023
  return /* @__PURE__ */ Pi(os, e);
4024
4024
  }
4025
- var cs = /*@__PURE__*/ T("ZodUnknown", (e, t) => {
4025
+ var cs = /*@__PURE__*/ w("ZodUnknown", (e, t) => {
4026
4026
  Qn.init(e, t), I.init(e, t), e._zod.processJSONSchema = (e, t, n) => void 0;
4027
4027
  });
4028
4028
  function ls() {
4029
4029
  return /* @__PURE__ */ Fi(cs);
4030
4030
  }
4031
- var us = /*@__PURE__*/ T("ZodNever", (e, t) => {
4031
+ var us = /*@__PURE__*/ w("ZodNever", (e, t) => {
4032
4032
  $n.init(e, t), I.init(e, t), e._zod.processJSONSchema = (t, n, r) => Oa(e, t, n, r);
4033
4033
  });
4034
4034
  function ds(e) {
4035
4035
  return /* @__PURE__ */ Ii(us, e);
4036
4036
  }
4037
- var fs = /*@__PURE__*/ T("ZodArray", (e, t) => {
4037
+ var fs = /*@__PURE__*/ w("ZodArray", (e, t) => {
4038
4038
  ko(), tr.init(e, t), I.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ua(e, t, n, r), e.element = t.element;
4039
4039
  }, {
4040
4040
  min(e, t) {
@@ -4056,8 +4056,8 @@ var fs = /*@__PURE__*/ T("ZodArray", (e, t) => {
4056
4056
  function B(e, t) {
4057
4057
  return /* @__PURE__ */ na(fs, e, t);
4058
4058
  }
4059
- var ps = /*@__PURE__*/ T("ZodObject", (e, t) => {
4060
- ko(), cr.init(e, t), I.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ga(e, t, n, r), ke(e, "shape", (e) => e._zod.def.shape, !1);
4059
+ var ps = /*@__PURE__*/ w("ZodObject", (e, t) => {
4060
+ ko(), cr.init(e, t), I.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ga(e, t, n, r), Ae(e, "shape", (e) => e._zod.def.shape, !1);
4061
4061
  }, {
4062
4062
  keyof() {
4063
4063
  return W(Object.keys(this._zod.def.shape));
@@ -4108,51 +4108,43 @@ var ps = /*@__PURE__*/ T("ZodObject", (e, t) => {
4108
4108
  return le(this, e);
4109
4109
  },
4110
4110
  partial(...e) {
4111
- return pe(Ts, this, e[0]);
4111
+ return pe(ws, this, e[0]);
4112
4112
  },
4113
4113
  exactPartial(...e) {
4114
- return pe(Ds, this, e[0], "exactPartial");
4114
+ return pe(Es, this, e[0], "exactPartial");
4115
4115
  },
4116
4116
  required(...e) {
4117
- return me(Fs, this, e[0]);
4117
+ return me(Ps, this, e[0]);
4118
4118
  }
4119
4119
  });
4120
- function ms(e, t) {
4121
- return new ps({
4122
- type: "object",
4123
- shape: e ?? {},
4124
- ...v(t)
4125
- });
4126
- }
4127
4120
  function V(e, t) {
4128
4121
  return new ps({
4129
4122
  type: "object",
4130
- shape: e,
4131
- catchall: ds(),
4123
+ shape: e ?? {},
4132
4124
  ...v(t)
4133
4125
  });
4134
4126
  }
4135
- var hs = /*@__PURE__*/ T("ZodUnion", (e, t) => {
4127
+ var ms = /*@__PURE__*/ w("ZodUnion", (e, t) => {
4136
4128
  ur.init(e, t), I.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ka(e, t, n, r), e.options = t.options;
4137
4129
  });
4138
4130
  function H(e, t) {
4139
- return new hs({
4131
+ return new ms({
4140
4132
  type: "union",
4141
4133
  options: e,
4142
4134
  ...v(t)
4143
4135
  });
4144
4136
  }
4145
- var gs = /*@__PURE__*/ T("ZodIntersection", (e, t) => {
4137
+ var hs = /*@__PURE__*/ w("ZodIntersection", (e, t) => {
4146
4138
  dr.init(e, t), I.init(e, t), e._zod.processJSONSchema = (t, n, r) => qa(e, t, n, r);
4147
4139
  });
4148
- function _s(e, t) {
4149
- return new gs({
4140
+ function gs(e, t) {
4141
+ return new hs({
4150
4142
  type: "intersection",
4151
4143
  left: e,
4152
4144
  right: t
4153
4145
  });
4154
4146
  }
4155
- var vs = /*@__PURE__*/ T("ZodTuple", (e, t) => {
4147
+ var _s = /*@__PURE__*/ w("ZodTuple", (e, t) => {
4156
4148
  ko(), mr.init(e, t), I.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ja(e, t, n, r);
4157
4149
  }, {
4158
4150
  rest(e) {
@@ -4166,46 +4158,46 @@ var vs = /*@__PURE__*/ T("ZodTuple", (e, t) => {
4166
4158
  if (e.checks?.length) throw Error(".partial() cannot be used on tuple schemas containing refinements");
4167
4159
  return this.clone({
4168
4160
  ...e,
4169
- items: e.items.map((e) => new Ts({
4161
+ items: e.items.map((e) => new ws({
4170
4162
  type: "optional",
4171
4163
  innerType: e
4172
4164
  }))
4173
4165
  });
4174
4166
  }
4175
4167
  });
4176
- function ys(e, t, n) {
4168
+ function vs(e, t, n) {
4177
4169
  let r = t instanceof k;
4178
- return new vs({
4170
+ return new _s({
4179
4171
  type: "tuple",
4180
4172
  items: e,
4181
4173
  rest: r ? t : null,
4182
4174
  ...v(r ? n : t)
4183
4175
  });
4184
4176
  }
4185
- var bs = /*@__PURE__*/ T("ZodRecord", (e, t) => {
4177
+ var ys = /*@__PURE__*/ w("ZodRecord", (e, t) => {
4186
4178
  ko(), vr.init(e, t), I.init(e, t), e._zod.processJSONSchema = (t, n, r) => Qa(e, t, n, r), e.keyType = t.keyType, e.valueType = t.valueType;
4187
4179
  });
4188
4180
  function U(e, t, n) {
4189
- return !t || !t._zod ? new bs({
4181
+ return !t || !t._zod ? new ys({
4190
4182
  type: "record",
4191
4183
  keyType: Mo(),
4192
4184
  valueType: e,
4193
4185
  ...v(t)
4194
- }) : new bs({
4186
+ }) : new ys({
4195
4187
  type: "record",
4196
4188
  keyType: e,
4197
4189
  valueType: t,
4198
4190
  ...v(n)
4199
4191
  });
4200
4192
  }
4201
- var xs = /*@__PURE__*/ T("ZodEnum", (e, t) => {
4193
+ var bs = /*@__PURE__*/ w("ZodEnum", (e, t) => {
4202
4194
  yr.init(e, t), I.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ma(e, t, n, r), e.enum = t.entries, e.options = Object.values(t.entries);
4203
4195
  let n = new Set(Object.keys(t.entries));
4204
4196
  e.extract = (e, r) => {
4205
4197
  let i = {};
4206
4198
  for (let r of e) if (n.has(r)) i[r] = t.entries[r];
4207
4199
  else throw Error(`Key ${r} not found in enum`);
4208
- return new xs({
4200
+ return new bs({
4209
4201
  ...t,
4210
4202
  checks: [],
4211
4203
  ...v(r),
@@ -4215,7 +4207,7 @@ var xs = /*@__PURE__*/ T("ZodEnum", (e, t) => {
4215
4207
  let i = { ...t.entries };
4216
4208
  for (let t of e) if (n.has(t)) delete i[t];
4217
4209
  else throw Error(`Key ${t} not found in enum`);
4218
- return new xs({
4210
+ return new bs({
4219
4211
  ...t,
4220
4212
  checks: [],
4221
4213
  ...v(r),
@@ -4224,77 +4216,77 @@ var xs = /*@__PURE__*/ T("ZodEnum", (e, t) => {
4224
4216
  };
4225
4217
  });
4226
4218
  function W(e, t) {
4227
- return new xs({
4219
+ return new bs({
4228
4220
  type: "enum",
4229
4221
  entries: Array.isArray(e) ? Object.fromEntries(e.map((e) => [e, e])) : e,
4230
4222
  ...v(t)
4231
4223
  });
4232
4224
  }
4233
- var Ss = /*@__PURE__*/ T("ZodLiteral", (e, t) => {
4225
+ var xs = /*@__PURE__*/ w("ZodLiteral", (e, t) => {
4234
4226
  br.init(e, t), I.init(e, t), e._zod.processJSONSchema = (t, n, r) => Na(e, t, n, r), e.values = new Set(t.values), Object.defineProperty(e, "value", { get() {
4235
4227
  if (t.values.length > 1) throw Error("This schema contains multiple valid literal values. Use `.values` instead.");
4236
4228
  return t.values[0];
4237
4229
  } });
4238
4230
  });
4239
4231
  function G(e, t) {
4240
- return new Ss({
4232
+ return new xs({
4241
4233
  type: "literal",
4242
4234
  values: Array.isArray(e) ? e : [e],
4243
4235
  ...v(t)
4244
4236
  });
4245
4237
  }
4246
- var Cs = /*@__PURE__*/ T("ZodTransform", (e, t) => {
4238
+ var Ss = /*@__PURE__*/ w("ZodTransform", (e, t) => {
4247
4239
  ko(), xr.init(e, t), I.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ba(e, t, n, r), e._zod.parse = (n, r) => {
4248
4240
  if (r.direction === "backward") throw new Le(e.constructor.name);
4249
4241
  n.addIssue = (r) => {
4250
- if (typeof r == "string") n.issues.push(Se(r, n.value, t));
4242
+ if (typeof r == "string") n.issues.push(Ce(r, n.value, t));
4251
4243
  else {
4252
4244
  let t = r;
4253
- t.fatal && (t.continue = !1), t.code ??= "custom", "input" in t || (t.input = n.value), t.inst ??= e, n.issues.push(Se(t));
4245
+ t.fatal && (t.continue = !1), t.code ??= "custom", "input" in t || (t.input = n.value), t.inst ??= e, n.issues.push(Ce(t));
4254
4246
  }
4255
4247
  };
4256
4248
  let i = t.transform(n.value, n);
4257
4249
  return i instanceof Promise ? i.then((e) => (n.value = e, n)) : (n.value = i, n);
4258
4250
  };
4259
4251
  });
4260
- function ws(e) {
4261
- return new Cs({
4252
+ function Cs(e) {
4253
+ return new Ss({
4262
4254
  type: "transform",
4263
4255
  transform: e
4264
4256
  });
4265
4257
  }
4266
- var Ts = /*@__PURE__*/ T("ZodOptional", (e, t) => {
4258
+ var ws = /*@__PURE__*/ w("ZodOptional", (e, t) => {
4267
4259
  Cr.init(e, t), I.init(e, t), e._zod.processJSONSchema = (t, n, r) => lo(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
4268
4260
  });
4269
- function Es(e) {
4270
- return new Ts({
4261
+ function Ts(e) {
4262
+ return new ws({
4271
4263
  type: "optional",
4272
4264
  innerType: e
4273
4265
  });
4274
4266
  }
4275
- var Ds = /*@__PURE__*/ T("ZodExactOptional", (e, t) => {
4267
+ var Es = /*@__PURE__*/ w("ZodExactOptional", (e, t) => {
4276
4268
  wr.init(e, t), I.init(e, t), e._zod.processJSONSchema = (t, n, r) => lo(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
4277
4269
  });
4278
- function Os(e) {
4279
- return new Ds({
4270
+ function Ds(e) {
4271
+ return new Es({
4280
4272
  type: "optional",
4281
4273
  innerType: e
4282
4274
  });
4283
4275
  }
4284
- var ks = /*@__PURE__*/ T("ZodNullable", (e, t) => {
4276
+ var Os = /*@__PURE__*/ w("ZodNullable", (e, t) => {
4285
4277
  Tr.init(e, t), I.init(e, t), e._zod.processJSONSchema = (t, n, r) => $a(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
4286
4278
  });
4287
- function As(e) {
4288
- return new ks({
4279
+ function ks(e) {
4280
+ return new Os({
4289
4281
  type: "nullable",
4290
4282
  innerType: e
4291
4283
  });
4292
4284
  }
4293
- var js = /*@__PURE__*/ T("ZodDefault", (e, t) => {
4285
+ var As = /*@__PURE__*/ w("ZodDefault", (e, t) => {
4294
4286
  Er.init(e, t), I.init(e, t), e._zod.processJSONSchema = (t, n, r) => ro(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
4295
4287
  });
4296
- function Ms(e, t) {
4297
- return new js({
4288
+ function js(e, t) {
4289
+ return new As({
4298
4290
  type: "default",
4299
4291
  innerType: e,
4300
4292
  get defaultValue() {
@@ -4302,11 +4294,11 @@ function Ms(e, t) {
4302
4294
  }
4303
4295
  });
4304
4296
  }
4305
- var Ns = /*@__PURE__*/ T("ZodPrefault", (e, t) => {
4297
+ var Ms = /*@__PURE__*/ w("ZodPrefault", (e, t) => {
4306
4298
  Or.init(e, t), I.init(e, t), e._zod.processJSONSchema = (t, n, r) => io(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
4307
4299
  });
4308
- function Ps(e, t) {
4309
- return new Ns({
4300
+ function Ns(e, t) {
4301
+ return new Ms({
4310
4302
  type: "prefault",
4311
4303
  innerType: e,
4312
4304
  get defaultValue() {
@@ -4314,65 +4306,65 @@ function Ps(e, t) {
4314
4306
  }
4315
4307
  });
4316
4308
  }
4317
- var Fs = /*@__PURE__*/ T("ZodNonOptional", (e, t) => {
4309
+ var Ps = /*@__PURE__*/ w("ZodNonOptional", (e, t) => {
4318
4310
  kr.init(e, t), I.init(e, t), e._zod.processJSONSchema = (t, n, r) => eo(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
4319
4311
  });
4320
- function Is(e, t) {
4321
- return new Fs({
4312
+ function Fs(e, t) {
4313
+ return new Ps({
4322
4314
  type: "nonoptional",
4323
4315
  innerType: e,
4324
4316
  ...v(t)
4325
4317
  });
4326
4318
  }
4327
- var Ls = /*@__PURE__*/ T("ZodCatch", (e, t) => {
4319
+ var Is = /*@__PURE__*/ w("ZodCatch", (e, t) => {
4328
4320
  Mr.init(e, t), I.init(e, t), e._zod.processJSONSchema = (t, n, r) => ao(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
4329
4321
  });
4330
- function Rs(e, t) {
4331
- return new Ls({
4322
+ function Ls(e, t) {
4323
+ return new Is({
4332
4324
  type: "catch",
4333
4325
  innerType: e,
4334
- catchValue: typeof t == "function" ? t : je(t)
4326
+ catchValue: typeof t == "function" ? t : Me(t)
4335
4327
  });
4336
4328
  }
4337
- var zs = /*@__PURE__*/ T("ZodPipe", (e, t) => {
4329
+ var Rs = /*@__PURE__*/ w("ZodPipe", (e, t) => {
4338
4330
  Nr.init(e, t), I.init(e, t), e._zod.processJSONSchema = (t, n, r) => oo(e, t, n, r), e.in = t.in, e.out = t.out;
4339
4331
  });
4340
- function Bs(e, t) {
4341
- return new zs({
4332
+ function zs(e, t) {
4333
+ return new Rs({
4342
4334
  type: "pipe",
4343
4335
  in: e,
4344
4336
  out: t
4345
4337
  });
4346
4338
  }
4347
- var Vs = /*@__PURE__*/ T("ZodReadonly", (e, t) => {
4339
+ var Bs = /*@__PURE__*/ w("ZodReadonly", (e, t) => {
4348
4340
  Fr.init(e, t), I.init(e, t), e._zod.processJSONSchema = (t, n, r) => so(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
4349
4341
  });
4350
- function Hs(e) {
4351
- return new Vs({
4342
+ function Vs(e) {
4343
+ return new Bs({
4352
4344
  type: "readonly",
4353
4345
  innerType: e
4354
4346
  });
4355
4347
  }
4356
- var Us = /*@__PURE__*/ T("ZodLazy", (e, t) => {
4348
+ var Hs = /*@__PURE__*/ w("ZodLazy", (e, t) => {
4357
4349
  Lr.init(e, t), I.init(e, t), e._zod.processJSONSchema = (t, n, r) => uo(e, t, n, r), e.unwrap = () => e._zod.def.getter();
4358
4350
  });
4359
- function Ws(e) {
4360
- return new Us({
4351
+ function Us(e) {
4352
+ return new Hs({
4361
4353
  type: "lazy",
4362
4354
  getter: e
4363
4355
  });
4364
4356
  }
4365
- var Gs = /*@__PURE__*/ T("ZodCustom", (e, t) => {
4357
+ var Ws = /*@__PURE__*/ w("ZodCustom", (e, t) => {
4366
4358
  Rr.init(e, t), I.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ra(e, t, n, r);
4367
4359
  });
4368
- function Ks(e, t = {}) {
4369
- return /* @__PURE__ */ ra(Gs, e, t);
4360
+ function Gs(e, t = {}) {
4361
+ return /* @__PURE__ */ ra(Ws, e, t);
4370
4362
  }
4371
- function qs(e, t) {
4363
+ function Ks(e, t) {
4372
4364
  return /* @__PURE__ */ ia(e, t);
4373
4365
  }
4374
- function Js(e) {
4375
- let t = Ws(() => H([
4366
+ function qs(e) {
4367
+ let t = Us(() => H([
4376
4368
  Mo(e),
4377
4369
  R(),
4378
4370
  z(),
@@ -4382,9 +4374,13 @@ function Js(e) {
4382
4374
  ]));
4383
4375
  return t;
4384
4376
  }
4377
+ function Js(e, t = 0) {
4378
+ if (t > 64) throw TypeError("Value exceeds the maximum JSON depth.");
4379
+ if (typeof e == "object" && e) for (let n of Object.values(e)) Js(n, t + 1);
4380
+ }
4385
4381
  //#endregion
4386
4382
  //#region src/flow/common/changeSchema.ts
4387
- var K = Mo(), q = Js(), Ys = B(K), Xs = V({
4383
+ var K = Mo(), q = qs(), Ys = B(K), Xs = V({
4388
4384
  description: K.optional(),
4389
4385
  jsonSchema: q,
4390
4386
  nullable: z(),
@@ -4428,18 +4424,49 @@ var K = Mo(), q = Js(), Ys = B(K), Xs = V({
4428
4424
  name: K,
4429
4425
  moduleId: K,
4430
4426
  capabilities: B(ic).optional()
4431
- }), oc = V({
4427
+ }), oc = H([V({
4428
+ kind: G("value"),
4429
+ value: q
4430
+ }), V({
4431
+ kind: G("input"),
4432
+ input: K
4433
+ })]), sc = H([oc, V({ kind: G("model") })]), cc = V({
4432
4434
  ...rc,
4433
4435
  name: K,
4434
- executor: H([V({
4435
- kind: G("connector"),
4436
- action: K,
4437
- connectionId: K.optional()
4438
- }), V({
4439
- kind: G("llm"),
4440
- mode: W(["chat", "json"])
4441
- })])
4442
- }), sc = {
4436
+ executor: H([
4437
+ V({
4438
+ kind: G("connector"),
4439
+ action: K,
4440
+ connectionId: K.optional()
4441
+ }),
4442
+ V({
4443
+ kind: G("llm"),
4444
+ mode: W(["chat", "json"])
4445
+ }),
4446
+ V({
4447
+ kind: G("agent"),
4448
+ code: z().optional(),
4449
+ model: K,
4450
+ prompt: oc,
4451
+ system: K,
4452
+ maxRounds: R(),
4453
+ tools: B(V({
4454
+ id: K,
4455
+ name: K,
4456
+ description: K,
4457
+ action: K,
4458
+ connectionId: K.optional(),
4459
+ approval: z(),
4460
+ inputs: B(J.extend({ source: sc }))
4461
+ })),
4462
+ notification: V({
4463
+ taskId: K,
4464
+ messageHandle: K,
4465
+ inputs: U(K, oc)
4466
+ }).optional()
4467
+ })
4468
+ ])
4469
+ }), lc = {
4443
4470
  input: J,
4444
4471
  cases: B(V({
4445
4472
  output: K,
@@ -4472,15 +4499,15 @@ var K = Mo(), q = Js(), Ys = B(K), Xs = V({
4472
4499
  }))
4473
4500
  })),
4474
4501
  defaultOutput: K.optional()
4475
- }, cc = {
4476
- actions: H([ys([G("continue")]), ys([G("approve"), G("reject")])]),
4502
+ }, uc = {
4503
+ actions: H([vs([G("continue")]), vs([G("approve"), G("reject")])]),
4477
4504
  prompt: K,
4478
4505
  notification: V({
4479
4506
  inputs: nc,
4480
4507
  messageHandle: K,
4481
4508
  taskId: K
4482
4509
  }).optional()
4483
- }, lc = {
4510
+ }, dc = {
4484
4511
  inputsDef: B(J),
4485
4512
  options: V({
4486
4513
  allowedMethods: Ys.optional(),
@@ -4490,7 +4517,7 @@ var K = Mo(), q = Js(), Ys = B(K), Xs = V({
4490
4517
  responseHeaders: U(K, K).optional(),
4491
4518
  responseStatusCode: R().optional()
4492
4519
  }).optional()
4493
- }, uc = B(H([V({
4520
+ }, fc = B(H([V({
4494
4521
  type: G("cron"),
4495
4522
  expression: K,
4496
4523
  timezone: K
@@ -4504,7 +4531,7 @@ var K = Mo(), q = Js(), Ys = B(K), Xs = V({
4504
4531
  "week"
4505
4532
  ]),
4506
4533
  value: R()
4507
- })])), dc = {
4534
+ })])), pc = {
4508
4535
  configSchema: q,
4509
4536
  definitionVersion: R(),
4510
4537
  description: K,
@@ -4513,7 +4540,7 @@ var K = Mo(), q = Js(), Ys = B(K), Xs = V({
4513
4540
  name: K,
4514
4541
  payloadSchema: q,
4515
4542
  provider: K
4516
- }, fc = V({
4543
+ }, mc = V({
4517
4544
  body: V({
4518
4545
  allowArray: z(),
4519
4546
  allowEmpty: z(),
@@ -4533,107 +4560,128 @@ var K = Mo(), q = Js(), Ys = B(K), Xs = V({
4533
4560
  "PUT"
4534
4561
  ])),
4535
4562
  successStatus: R()
4536
- }), pc = {
4563
+ }), hc = {
4537
4564
  name: K,
4538
4565
  description: K.optional(),
4539
4566
  icon: K.optional()
4540
- }, mc = {
4567
+ }, gc = {
4541
4568
  inputs: nc,
4542
4569
  name: K.optional(),
4543
4570
  description: K.optional(),
4544
4571
  icon: K.optional(),
4545
4572
  timeoutMs: R().optional()
4546
- }, hc = H([
4573
+ }, _c = H([
4547
4574
  V({
4548
- ...mc,
4575
+ ...gc,
4549
4576
  kind: G("condition"),
4550
- ...sc
4577
+ ...lc
4551
4578
  }),
4552
4579
  V({
4553
- ...mc,
4580
+ ...gc,
4554
4581
  kind: G("value"),
4555
4582
  values: B(J)
4556
4583
  }),
4557
4584
  V({
4558
- ...mc,
4585
+ ...gc,
4559
4586
  kind: G("subflow"),
4560
4587
  subflowId: K
4561
4588
  }),
4562
4589
  V({
4563
- ...mc,
4590
+ ...gc,
4564
4591
  kind: G("task"),
4565
4592
  task: ac,
4566
4593
  additionalInputs: B(J).optional()
4567
4594
  }),
4568
4595
  V({
4569
- ...mc,
4596
+ ...gc,
4570
4597
  kind: G("task"),
4571
4598
  taskId: K,
4572
4599
  additionalInputs: B(J).optional()
4573
4600
  }),
4574
4601
  V({
4575
- ...mc,
4602
+ ...gc,
4576
4603
  kind: G("wait"),
4577
4604
  input: J,
4578
- ...cc
4605
+ ...uc
4579
4606
  }).omit({ timeoutMs: !0 }),
4580
4607
  V({
4581
- ...pc,
4608
+ ...hc,
4582
4609
  kind: G("manual")
4583
4610
  }),
4584
4611
  V({
4585
- ...pc,
4612
+ ...hc,
4586
4613
  kind: G("webhook"),
4587
- ...lc
4614
+ ...dc
4588
4615
  }),
4589
4616
  V({
4590
- ...pc,
4617
+ ...hc,
4591
4618
  kind: G("cron"),
4592
- cronTimes: uc
4619
+ cronTimes: fc
4593
4620
  }),
4594
4621
  V({
4595
- ...pc,
4622
+ ...hc,
4596
4623
  kind: G("poll"),
4597
4624
  bindingId: K,
4598
4625
  config: U(K, q),
4599
4626
  definition: V({
4600
- ...dc,
4627
+ ...pc,
4601
4628
  type: G("poll")
4602
4629
  }),
4603
- pollTimes: uc
4630
+ pollTimes: fc
4604
4631
  }),
4605
4632
  V({
4606
- ...pc,
4633
+ ...hc,
4607
4634
  kind: G("integration"),
4608
4635
  bindingId: K,
4609
4636
  config: U(K, q),
4610
4637
  definition: V({
4611
- ...dc,
4638
+ ...pc,
4612
4639
  type: G("integration"),
4613
- endpoint: fc
4640
+ endpoint: mc
4614
4641
  })
4615
4642
  })
4616
- ]), gc = H([V({ kind: G("flow") }), V({
4643
+ ]), vc = H([V({ kind: G("flow") }), V({
4617
4644
  kind: G("subflow"),
4618
4645
  id: K
4619
- })]), _c = V({
4646
+ })]), yc = V({
4620
4647
  source: K,
4621
4648
  target: K,
4622
4649
  sourceHandle: K.optional()
4623
4650
  }), Y = {
4624
4651
  nodeId: K,
4625
- target: gc
4626
- }, vc = V({
4652
+ target: vc
4653
+ }, bc = V({
4627
4654
  name: K,
4628
4655
  inputs: B(J),
4629
4656
  outputs: B(Xs.extend({ sources: B(H([Qs, $s])) }))
4630
- }), yc = {
4657
+ }), xc = V({
4658
+ nodes: U(K, _c),
4659
+ edges: B(yc)
4660
+ }), Sc = V({
4661
+ kind: W(["connection", "variable"]),
4662
+ target: K
4663
+ }), Cc = V({
4664
+ name: K,
4665
+ imports: Ys,
4666
+ source: K
4667
+ }), wc = V({
4668
+ bindings: U(K, Sc),
4669
+ graph: xc,
4670
+ subflows: U(K, bc.extend({ graph: xc })),
4671
+ tasks: U(K, cc)
4672
+ });
4673
+ V({
4674
+ modelVersion: G(1),
4675
+ document: wc,
4676
+ modules: U(K, Cc)
4677
+ }).extend({
4678
+ kind: G("open-flow-flow-revision"),
4679
+ version: G(1)
4680
+ });
4681
+ var Tc = {
4631
4682
  "binding.create": {
4632
4683
  bindingId: K,
4633
- binding: V({
4634
- kind: W(["connection", "variable"]),
4635
- target: K
4636
- })
4684
+ binding: Sc
4637
4685
  },
4638
4686
  "binding.delete": { bindingId: K },
4639
4687
  "binding.target.set": {
@@ -4642,16 +4690,16 @@ var K = Mo(), q = Js(), Ys = B(K), Xs = V({
4642
4690
  value: K
4643
4691
  },
4644
4692
  "graph.edge.connect": {
4645
- target: gc,
4646
- edge: _c
4693
+ target: vc,
4694
+ edge: yc
4647
4695
  },
4648
4696
  "graph.edge.disconnect": {
4649
- target: gc,
4650
- edge: _c
4697
+ target: vc,
4698
+ edge: yc
4651
4699
  },
4652
4700
  "graph.node.create": {
4653
4701
  ...Y,
4654
- node: hc
4702
+ node: _c
4655
4703
  },
4656
4704
  "graph.node.delete": Y,
4657
4705
  "graph.node.field.set": H([V({
@@ -4684,8 +4732,8 @@ var K = Mo(), q = Js(), Ys = B(K), Xs = V({
4684
4732
  },
4685
4733
  "graph.node.condition.set": {
4686
4734
  ...Y,
4687
- before: V(sc),
4688
- value: V(sc)
4735
+ before: V(lc),
4736
+ value: V(lc)
4689
4737
  },
4690
4738
  "graph.node.values.set": {
4691
4739
  ...Y,
@@ -4695,14 +4743,14 @@ var K = Mo(), q = Js(), Ys = B(K), Xs = V({
4695
4743
  "graph.node.wait.set": {
4696
4744
  ...Y,
4697
4745
  target: V({ kind: G("flow") }),
4698
- before: V(cc),
4699
- value: V(cc)
4746
+ before: V(uc),
4747
+ value: V(uc)
4700
4748
  },
4701
4749
  "graph.node.webhook.set": {
4702
4750
  ...Y,
4703
4751
  target: V({ kind: G("flow") }),
4704
- before: V(lc),
4705
- value: V(lc)
4752
+ before: V(dc),
4753
+ value: V(dc)
4706
4754
  },
4707
4755
  "graph.node.task.ports.set": {
4708
4756
  ...Y,
@@ -4727,16 +4775,12 @@ var K = Mo(), q = Js(), Ys = B(K), Xs = V({
4727
4775
  },
4728
4776
  "graph.trigger.schedule.set": {
4729
4777
  nodeId: K,
4730
- before: uc,
4731
- value: uc
4778
+ before: fc,
4779
+ value: fc
4732
4780
  },
4733
4781
  "module.create": {
4734
4782
  moduleId: K,
4735
- module: V({
4736
- name: K,
4737
- imports: Ys,
4738
- source: K
4739
- })
4783
+ module: Cc
4740
4784
  },
4741
4785
  "module.delete": { moduleId: K },
4742
4786
  "module.rename": {
@@ -4753,20 +4797,17 @@ var K = Mo(), q = Js(), Ys = B(K), Xs = V({
4753
4797
  },
4754
4798
  "subflow.create": {
4755
4799
  subflowId: K,
4756
- subflow: vc.extend({ graph: V({
4757
- nodes: U(K, hc),
4758
- edges: B(_c)
4759
- }) })
4800
+ subflow: bc.extend({ graph: xc })
4760
4801
  },
4761
4802
  "subflow.definition.set": {
4762
4803
  subflowId: K,
4763
- before: vc,
4764
- definition: vc
4804
+ before: bc,
4805
+ definition: bc
4765
4806
  },
4766
4807
  "subflow.delete": { subflowId: K },
4767
4808
  "task.create": {
4768
4809
  taskId: K,
4769
- task: oc
4810
+ task: cc
4770
4811
  },
4771
4812
  "task.delete": { taskId: K },
4772
4813
  "task.connector.connection.set": {
@@ -4774,6 +4815,11 @@ var K = Mo(), q = Js(), Ys = B(K), Xs = V({
4774
4815
  before: K.optional(),
4775
4816
  value: K.optional()
4776
4817
  },
4818
+ "task.agent.set": {
4819
+ taskId: K,
4820
+ before: cc,
4821
+ value: cc
4822
+ },
4777
4823
  "task.llm.mode.set": {
4778
4824
  taskId: K,
4779
4825
  before: W(["chat", "json"]),
@@ -4784,28 +4830,28 @@ var K = Mo(), q = Js(), Ys = B(K), Xs = V({
4784
4830
  before: K,
4785
4831
  value: K
4786
4832
  }
4787
- }, bc = new Map(Object.entries(yc).map(([e, t]) => [e, t instanceof I ? t : V({
4833
+ }, Ec = new Map(Object.entries(Tc).map(([e, t]) => [e, t instanceof I ? t : V({
4788
4834
  kind: G(e),
4789
4835
  ...t
4790
- })])), xc = B(H([...bc.values()])).min(1);
4791
- function Sc(e) {
4792
- return B(ls()).min(1).parse(e).map((e, t) => {
4793
- let { kind: n } = ms({ kind: K }).parse(e), r = bc.get(n);
4836
+ })])), Dc = B(H([...Ec.values()])).min(1);
4837
+ function Oc(e) {
4838
+ return Js(e), B(ls()).min(1).parse(e).map((e, t) => {
4839
+ let { kind: n } = V({ kind: K }).parse(e), r = Ec.get(n);
4794
4840
  if (r == null) throw TypeError(`operations[${t}]: Unknown operation ${JSON.stringify(n)}.`);
4795
4841
  let i = r.safeParse(e);
4796
4842
  if (!i.success) throw TypeError(`operations[${t}]: ${i.error.issues.map((e) => `${e.path.join(".")}: ${e.message}`).join("; ")}`);
4797
4843
  return i.data;
4798
4844
  });
4799
4845
  }
4800
- function Cc(e) {
4801
- let t = e == null ? xc : bc.get(e);
4846
+ function kc(e) {
4847
+ let t = e == null ? Dc : Ec.get(e);
4802
4848
  if (t == null) throw TypeError(`Unknown operation ${JSON.stringify(e)}.`);
4803
- return po(t);
4849
+ return po(t, { io: "input" });
4804
4850
  }
4805
4851
  //#endregion
4806
4852
  //#region src/flow/common/change.ts
4807
- var wc = 80;
4808
- function Tc(e) {
4853
+ var Ac = 80;
4854
+ function jc(e) {
4809
4855
  let t = e.trim();
4810
4856
  if (t.length == 0) return "empty";
4811
4857
  if (t.length > 80) return "tooLong";
@@ -4815,13 +4861,13 @@ function Tc(e) {
4815
4861
  }
4816
4862
  if (!/^[\p{L}\p{N}](?:[\p{L}\p{N} _-]*[\p{L}\p{N}])?$/u.test(t)) return "specialCharacter";
4817
4863
  }
4818
- function Ec(e) {
4864
+ function Mc(e) {
4819
4865
  return e.length <= 256 && /^[A-Za-z_][A-Za-z0-9_]*$/.test(e) && e.slice(0, 3).toUpperCase() != "OO_";
4820
4866
  }
4821
- function Dc(e) {
4867
+ function Nc(e) {
4822
4868
  return Object.fromEntries(e.flatMap((e) => "handle" in e ? [[e.handle, e]] : []));
4823
4869
  }
4824
- function Oc(e) {
4870
+ function Pc(e) {
4825
4871
  if (!Array.isArray(e)) throw TypeError("Connector capabilities must be an array.");
4826
4872
  let t = /* @__PURE__ */ new Set();
4827
4873
  return e.map((e) => {
@@ -4860,24 +4906,24 @@ function Oc(e) {
4860
4906
  function X(e) {
4861
4907
  return e.trim().normalize("NFC");
4862
4908
  }
4863
- function kc(e, t) {
4909
+ function Fc(e, t) {
4864
4910
  let n = X(e), r = new Set([...t].map(X));
4865
4911
  if (!r.has(n)) return n;
4866
4912
  let i = /^(.*) \((\d+)\)$/.exec(n), a = i?.[2], o = a != null && Number(a) >= 2 ? Number(a) : void 0, s = o == null ? n : i?.[1] ?? n, c = o == null ? 2 : o + 1;
4867
4913
  for (; r.has(`${s} (${c})`);) c += 1;
4868
4914
  return `${s} (${c})`;
4869
4915
  }
4870
- function Ac(e, t, n) {
4916
+ function Ic(e, t, n) {
4871
4917
  let r = X(n);
4872
4918
  return r.length == 0 ? "empty" : Object.entries(e.nodes).some(([e, n]) => e != t && n.name != null && X(n.name) == r) ? "duplicate" : void 0;
4873
4919
  }
4874
- var jc = class extends Error {
4920
+ var Lc = class extends Error {
4875
4921
  constructor(e) {
4876
4922
  super(e), this.name = "FlowChangeError";
4877
4923
  }
4878
4924
  };
4879
4925
  function Z(e) {
4880
- throw new jc(e);
4926
+ throw new Lc(e);
4881
4927
  }
4882
4928
  function Q(e, t) {
4883
4929
  if (t.kind == "flow") return e.graph;
@@ -4901,7 +4947,7 @@ function $(e, t, n) {
4901
4947
  }
4902
4948
  };
4903
4949
  }
4904
- function Mc(e, t) {
4950
+ function Rc(e, t) {
4905
4951
  if (!("inputs" in e)) return e;
4906
4952
  let n = { ...e.inputs };
4907
4953
  for (let [e, r] of Object.entries(n)) {
@@ -4917,7 +4963,7 @@ function Mc(e, t) {
4917
4963
  inputs: n
4918
4964
  };
4919
4965
  }
4920
- function Nc(e, n) {
4966
+ function zc(e, n) {
4921
4967
  let r = { ...e.document }, i = { ...e.modules };
4922
4968
  for (let e of n) switch (e.kind) {
4923
4969
  case "binding.create":
@@ -4998,8 +5044,8 @@ function Nc(e, n) {
4998
5044
  }
4999
5045
  case "graph.node.create": {
5000
5046
  let t = Q(r, e.target);
5001
- t.nodes[e.nodeId] != null && Z("A Node with this ID already exists in the target graph."), e.target.kind == "subflow" && !("inputs" in e.node) && Z("Trigger Nodes cannot be created inside a Subflow."), e.node.kind == "manual" && Object.values(t.nodes).some((e) => e.kind == "manual") && Z("A graph can contain only one manual Trigger."), e.node.kind == "task" && e.node.task?.capabilities !== void 0 && Oc(e.node.task.capabilities), e.node.name ?? Z("A Node name cannot be empty.");
5002
- let n = X(e.node.name), i = Ac(t, e.nodeId, n);
5047
+ t.nodes[e.nodeId] != null && Z("A Node with this ID already exists in the target graph."), e.target.kind == "subflow" && !("inputs" in e.node) && Z("Trigger Nodes cannot be created inside a Subflow."), e.node.kind == "manual" && Object.values(t.nodes).some((e) => e.kind == "manual") && Z("A graph can contain only one manual Trigger."), e.node.kind == "task" && e.node.task?.capabilities !== void 0 && Pc(e.node.task.capabilities), e.node.name ?? Z("A Node name cannot be empty.");
5048
+ let n = X(e.node.name), i = Ic(t, e.nodeId, n);
5003
5049
  i == "empty" && Z("A Node name cannot be empty."), i == "duplicate" && Z("A Node with this name already exists in the target graph.");
5004
5050
  let a = n == e.node.name ? e.node : {
5005
5051
  ...e.node,
@@ -5017,7 +5063,7 @@ function Nc(e, n) {
5017
5063
  case "graph.node.delete": {
5018
5064
  let t = Q(r, e.target);
5019
5065
  t.nodes[e.nodeId] ?? Z("The Node does not exist in the target graph.");
5020
- let n = /* @__PURE__ */ new Set([e.nodeId]), i = Object.fromEntries(Object.entries(t.nodes).flatMap(([e, t]) => n.has(e) ? [] : [[e, Mc(t, n)]]));
5066
+ let n = /* @__PURE__ */ new Set([e.nodeId]), i = Object.fromEntries(Object.entries(t.nodes).flatMap(([e, t]) => n.has(e) ? [] : [[e, Rc(t, n)]]));
5021
5067
  if (Object.assign(r, $(r, e.target, {
5022
5068
  ...t,
5023
5069
  edges: t.edges.filter((e) => !n.has(e.source) && !n.has(e.target)),
@@ -5043,7 +5089,7 @@ function Nc(e, n) {
5043
5089
  let a = { ...i };
5044
5090
  if (e.field == "name") {
5045
5091
  typeof e.value != "string" && Z("A Node name cannot be empty.");
5046
- let t = X(e.value), r = Ac(n, e.nodeId, t);
5092
+ let t = X(e.value), r = Ic(n, e.nodeId, t);
5047
5093
  r == "empty" && Z("A Node name cannot be empty."), r == "duplicate" && Z("A Node with this name already exists in the target graph."), Object.assign(a, { name: t });
5048
5094
  } else e.value == null ? Reflect.deleteProperty(a, e.field) : Object.assign(a, { [e.field]: e.value });
5049
5095
  Object.assign(r, $(r, e.target, {
@@ -5075,7 +5121,7 @@ function Nc(e, n) {
5075
5121
  let n = Q(r, e.target), i = n.nodes[e.nodeId];
5076
5122
  (i?.kind != "task" || i.task == null) && Z("The inline Task Node does not exist."), t(i.task.capabilities, e.before) || Z("The inline Task capabilities changed before this operation was applied.");
5077
5123
  let a = { ...i.task };
5078
- e.value === void 0 ? delete a.capabilities : a.capabilities = Oc(e.value), Object.assign(r, $(r, e.target, {
5124
+ e.value === void 0 ? delete a.capabilities : a.capabilities = Pc(e.value), Object.assign(r, $(r, e.target, {
5079
5125
  ...n,
5080
5126
  nodes: {
5081
5127
  ...n.nodes,
@@ -5245,7 +5291,7 @@ function Nc(e, n) {
5245
5291
  }
5246
5292
  case "subflow.create":
5247
5293
  r.subflows[e.subflowId] != null && Z("A Subflow with this ID already exists.");
5248
- for (let t of Object.values(e.subflow.graph.nodes)) t.kind == "task" && t.task?.capabilities !== void 0 && Oc(t.task.capabilities);
5294
+ for (let t of Object.values(e.subflow.graph.nodes)) t.kind == "task" && t.task?.capabilities !== void 0 && Pc(t.task.capabilities);
5249
5295
  r.subflows = {
5250
5296
  ...r.subflows,
5251
5297
  [e.subflowId]: e.subflow
@@ -5300,6 +5346,14 @@ function Nc(e, n) {
5300
5346
  delete t[e.taskId], r.tasks = t;
5301
5347
  break;
5302
5348
  }
5349
+ case "task.agent.set": {
5350
+ let n = r.tasks[e.taskId];
5351
+ (n?.executor.kind != "agent" || e.value.executor.kind != "agent") && Z("The Agent Task does not exist."), t(n, e.before) || Z("The Agent Task changed before this operation was applied."), r.tasks = {
5352
+ ...r.tasks,
5353
+ [e.taskId]: e.value
5354
+ };
5355
+ break;
5356
+ }
5303
5357
  case "task.llm.mode.set": {
5304
5358
  let t = r.tasks[e.taskId];
5305
5359
  (t == null || !("executor" in t) || t.executor.kind != "llm") && Z("The LLM Task does not exist."), t.executor.mode != e.before && Z("The LLM Task mode changed before this operation was applied."), r.tasks = {
@@ -5333,4 +5387,4 @@ function Nc(e, n) {
5333
5387
  };
5334
5388
  }
5335
5389
  //#endregion
5336
- export { jc as FlowChangeError, Nc as applyFlowChanges, Cc as changeOperationsSchema, Sc as decodeChangeOperations, Oc as decodeConnectorCapabilities, kc as nextNodeName, Ac as nodeNameIssue, X as normalizeNodeName, Dc as portsByHandle, Tc as resourceNameIssue, wc as resourceNameMaxLength, Ec as validVariableName };
5390
+ export { Lc as FlowChangeError, zc as applyFlowChanges, kc as changeOperationsSchema, Oc as decodeChangeOperations, Pc as decodeConnectorCapabilities, Fc as nextNodeName, Ic as nodeNameIssue, X as normalizeNodeName, Nc as portsByHandle, jc as resourceNameIssue, Ac as resourceNameMaxLength, Mc as validVariableName };