@oomol-lab/open-flow 0.1.0-beta.2 → 0.1.0-beta.20

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 (93) hide show
  1. package/dist/browser/{_virtual_open-flow-twemoji-DJwKsM_w.js → _virtual_open-flow-twemoji-CpHJOEsk.js} +4028 -2
  2. package/dist/browser/carbon-Cn-DTyjG.js +54 -0
  3. package/dist/browser/createResourceDialog-DlrAMxmo.js +110 -0
  4. package/dist/browser/dist-B_T-OpQp.js +4 -0
  5. package/dist/browser/{dist-DWADUsVB.js → dist-By46o5UV.js} +47 -47
  6. package/dist/browser/{dist-CPuF50D9.js → dist-D1VYgicl.js} +426 -305
  7. package/dist/browser/dist-DSe6KRsr.js +1224 -0
  8. package/dist/browser/dist-DYjIVIZC.js +795 -0
  9. package/dist/browser/{dist-3Mj8q8Pr.js → dist-DmuE3M0R.js} +53 -54
  10. package/dist/browser/{dist-BN4ZCyOB.js → dist-DpDLsYtO.js} +14 -15
  11. package/dist/browser/{dist-CJpzJrLM.js → dist-DwvhuMxw.js} +894 -895
  12. package/dist/browser/dist-DxahK_I8.js +2688 -0
  13. package/dist/browser/{dist-C46JByB-.js → dist-Dz6Nglsd.js} +61 -61
  14. package/dist/browser/{dist-DUzA0Ukh.js → dist-TJfrvoIQ.js} +141 -142
  15. package/dist/browser/{esm-B_PbUobB.js → esm-B7A42FzW.js} +68 -59
  16. package/dist/browser/flow-authoring-module.d.ts +2 -2
  17. package/dist/browser/flow-authoring-node.d.ts +20 -6
  18. package/dist/browser/flow-authoring.d.ts +1 -1
  19. package/dist/browser/flow-authoring.js +5405 -286
  20. package/dist/browser/flow-change-schema.d.ts +6 -0
  21. package/dist/browser/flow-change.d.ts +173 -14
  22. package/dist/browser/flow-change.js +5271 -114
  23. package/dist/browser/flow-notifications.d.ts +5 -0
  24. package/dist/browser/flowChanges-jX3KYcb0.js +11020 -0
  25. package/dist/browser/{flowRunInputEditorStore-BeyUSWpO.js → flowRunInputEditorStore-BBqQIOCR.js} +1020 -4104
  26. package/dist/browser/flowWorkspace-BIYwslVl.js +148497 -0
  27. package/dist/browser/host-conformance.d.ts +7 -0
  28. package/dist/browser/host-conformance.js +33 -0
  29. package/dist/browser/{diagnostics-giPSzyMo.js → i18n-CVBh0Ni1.js} +3390 -5715
  30. package/dist/browser/inputValues-BWfRHJWC.js +43 -0
  31. package/dist/browser/{languages-DgJehE1g.js → languages-C0zQ4GSo.js} +5 -25
  32. package/dist/browser/licenses.md +149 -700
  33. package/dist/browser/main-BDnNHhkU.js +50 -0
  34. package/dist/browser/{markdownContent-DdlIRN3_.js → markdownContent-BBgH9ZIV.js} +41 -41
  35. package/dist/browser/theme.css +461 -34
  36. package/dist/browser/{typeScriptSession-mPCiA9sV.js → typeScriptSession-DnAmJCzu.js} +70 -71
  37. package/dist/browser/ui-input.d.ts +3 -0
  38. package/dist/browser/ui-label.d.ts +3 -0
  39. package/dist/browser/ui-textarea.d.ts +3 -0
  40. package/dist/browser/ui.css +2 -0
  41. package/dist/browser/ui.css.d.ts +1 -0
  42. package/dist/browser/ui.d.ts +12 -0
  43. package/dist/browser/ui.js +2598 -0
  44. package/dist/browser/useValueChanged-BY05Usw-.js +2944 -0
  45. package/dist/browser/workbench-contract.d.ts +8 -2
  46. package/dist/browser/workbench.css +1 -1
  47. package/dist/browser/workbench.d.ts +1 -0
  48. package/dist/browser/workbench.js +2043 -1327
  49. package/dist/browser/workbenchSelect-CwP6rphY.js +11666 -0
  50. package/dist/common/control-api-conformance.d.ts +7 -0
  51. package/dist/common/control-api-conformance.js +5568 -166
  52. package/dist/common/control-api-errors.d.ts +9 -0
  53. package/dist/common/control-api.d.ts +309 -38
  54. package/dist/common/control-api.js +5817 -576
  55. package/dist/common/control-requests.d.ts +68 -0
  56. package/dist/common/control-requests.js +4950 -0
  57. package/dist/common/engine-contract.d.ts +3 -1
  58. package/dist/common/flow-agent.d.ts +10 -0
  59. package/dist/common/flow-encoding.d.ts +5 -2
  60. package/dist/common/flow-encoding.js +4820 -66
  61. package/dist/common/flow-graph.d.ts +6 -0
  62. package/dist/common/flow-json.d.ts +2 -0
  63. package/dist/common/flow-modules.d.ts +20 -0
  64. package/dist/common/flow-notifications.d.ts +5 -0
  65. package/dist/common/flow-schema.d.ts +8 -0
  66. package/dist/common/flow-semantics.d.ts +10 -6
  67. package/dist/common/flow-semantics.js +9982 -1701
  68. package/dist/common/integration-trigger.d.ts +24 -1
  69. package/dist/common/integration-trigger.js +188 -52
  70. package/dist/common/mcp-conformance.d.ts +2 -0
  71. package/dist/common/mcp.d.ts +765 -0
  72. package/dist/common/mcp.js +6477 -0
  73. package/dist/common/provider-triggers.js +5996 -993
  74. package/dist/common/run-events.d.ts +2 -2
  75. package/dist/common/run-events.js +12 -17
  76. package/dist/common/run-lifecycle.d.ts +21 -2
  77. package/dist/common/run-lifecycle.js +83 -2
  78. package/dist/common/run-results.d.ts +57 -0
  79. package/dist/common/runtime-contract.d.ts +36 -3
  80. package/dist/common/runtime-contract.js +227 -19
  81. package/dist/common/scheduler.d.ts +77 -18
  82. package/dist/common/scheduler.js +8259 -248
  83. package/dist/index.d.ts +6 -5
  84. package/package.json +21 -1
  85. package/dist/browser/carbon-DMCVsjHo.js +0 -53
  86. package/dist/browser/createResourceDialog-BkZns-oZ.js +0 -504
  87. package/dist/browser/dist-BMqL-qR5.js +0 -1894
  88. package/dist/browser/dist-BpopSHwP.js +0 -1543
  89. package/dist/browser/dist-CUSrALSX.js +0 -1620
  90. package/dist/browser/flowWorkspace-DAMLVMcF.js +0 -47584
  91. package/dist/browser/getPseudoElementBounds-ESJExRFX.js +0 -7642
  92. package/dist/browser/main-DmjVyuWr.js +0 -76
  93. package/dist/browser/workbenchSelect-B2s1HV-Y.js +0 -1374
@@ -1,22 +1,4751 @@
1
+ //#region ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/util.js
2
+ function e(e) {
3
+ let t = Object.values(e).filter((e) => typeof e == "number");
4
+ return Object.entries(e).filter(([e, n]) => t.indexOf(+e) === -1).map(([e, t]) => t);
5
+ }
6
+ function t(e, t = "|") {
7
+ return e.map((e) => re(e)).join(t);
8
+ }
9
+ function n(e, t) {
10
+ return typeof t == "bigint" ? t.toString() : t;
11
+ }
12
+ function r(e) {
13
+ return { get value() {
14
+ {
15
+ let t = e();
16
+ return Object.defineProperty(this, "value", { value: t }), t;
17
+ }
18
+ } };
19
+ }
20
+ function i(e) {
21
+ return e == null;
22
+ }
23
+ function a(e) {
24
+ let t = +!!e.startsWith("^"), n = e.endsWith("$") ? e.length - 1 : e.length;
25
+ return e.slice(t, n);
26
+ }
27
+ function o(e, t) {
28
+ let n = e / t, r = Math.round(n), i = 4 * 2 ** -52 * Math.max(Math.abs(n), 1);
29
+ return Math.abs(n - r) < i ? 0 : n - r;
30
+ }
31
+ var s = /* @__PURE__*/ Symbol("evaluating");
32
+ function c(e, t, n) {
33
+ let r;
34
+ Object.defineProperty(e, t, {
35
+ get() {
36
+ if (r !== s) return r === void 0 && (r = s, r = n()), r;
37
+ },
38
+ set(n) {
39
+ Object.defineProperty(e, t, { value: n });
40
+ },
41
+ configurable: !0
42
+ });
43
+ }
44
+ function l(e, t, n) {
45
+ Object.defineProperty(e, t, {
46
+ value: n,
47
+ writable: !0,
48
+ enumerable: !0,
49
+ configurable: !0
50
+ });
51
+ }
52
+ function u(...e) {
53
+ let t = {};
54
+ for (let n of e) {
55
+ let e = Object.getOwnPropertyDescriptors(n);
56
+ Object.assign(t, e);
57
+ }
58
+ return Object.defineProperties({}, t);
59
+ }
60
+ function d(e) {
61
+ return JSON.stringify(e);
62
+ }
63
+ function f(e) {
64
+ return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
65
+ }
66
+ var p = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {};
67
+ function m(e) {
68
+ return typeof e == "object" && !!e && !Array.isArray(e);
69
+ }
70
+ var ee = /* @__PURE__*/ r(() => {
71
+ if (D.jitless || typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare")) return !1;
72
+ try {
73
+ return Function(""), !0;
74
+ } catch {
75
+ return !1;
76
+ }
77
+ });
78
+ function h(e) {
79
+ if (m(e) === !1) return !1;
80
+ let t = e.constructor;
81
+ if (t === void 0 || typeof t != "function") return !0;
82
+ let n = t.prototype;
83
+ return m(n) !== !1 && Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") !== !1;
84
+ }
85
+ function te(e) {
86
+ return h(e) ? { ...e } : Array.isArray(e) ? [...e] : e instanceof Map ? new Map(e) : e instanceof Set ? new Set(e) : e;
87
+ }
88
+ var ne = /* @__PURE__*/ new Set([
89
+ "string",
90
+ "number",
91
+ "symbol"
92
+ ]);
93
+ function g(e) {
94
+ return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
95
+ }
96
+ function _(e, t, n) {
97
+ let r = new e._zod.constr(t ?? e._zod.def);
98
+ return (!t || n?.parent) && (r._zod.parent = e), r;
99
+ }
100
+ function v(e) {
101
+ let t = e;
102
+ if (!t) return {};
103
+ if (typeof t == "string") return { error: () => t };
104
+ if (t?.message !== void 0) {
105
+ if (t?.error !== void 0) throw Error("Cannot specify both `message` and `error` params");
106
+ t.error = t.message;
107
+ }
108
+ return delete t.message, typeof t.error == "string" ? {
109
+ ...t,
110
+ error: () => t.error
111
+ } : t;
112
+ }
113
+ function re(e) {
114
+ return typeof e == "bigint" ? e.toString() + "n" : typeof e == "string" ? `"${e}"` : `${e}`;
115
+ }
116
+ function ie(e) {
117
+ return Object.keys(e).filter((t) => e[t]._zod.optin !== void 0 && e[t]._zod.optout === "optional");
118
+ }
119
+ var ae = {
120
+ safeint: [-(2 ** 53 - 1), 2 ** 53 - 1],
121
+ int32: [-2147483648, 2147483647],
122
+ uint32: [0, 4294967295],
123
+ float32: [-34028234663852886e22, 34028234663852886e22],
124
+ float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
125
+ };
126
+ function oe(e, t) {
127
+ let n = e._zod.def, r = n.checks;
128
+ if (r && r.length > 0) throw Error(".pick() cannot be used on object schemas containing refinements");
129
+ return _(e, u(e._zod.def, {
130
+ get shape() {
131
+ let e = {};
132
+ for (let r of Reflect.ownKeys(t)) {
133
+ if (!Object.prototype.hasOwnProperty.call(n.shape, r)) throw Error(`Unrecognized key: "${String(r)}"`);
134
+ t[r] && l(e, r, n.shape[r]);
135
+ }
136
+ return l(this, "shape", e), e;
137
+ },
138
+ checks: []
139
+ }));
140
+ }
141
+ function se(e, t) {
142
+ let n = e._zod.def, r = n.checks;
143
+ if (r && r.length > 0) throw Error(".omit() cannot be used on object schemas containing refinements");
144
+ return _(e, u(e._zod.def, {
145
+ get shape() {
146
+ let r = { ...e._zod.def.shape };
147
+ for (let e of Reflect.ownKeys(t)) {
148
+ if (!Object.prototype.hasOwnProperty.call(n.shape, e)) throw Error(`Unrecognized key: "${String(e)}"`);
149
+ t[e] && delete r[e];
150
+ }
151
+ return l(this, "shape", r), r;
152
+ },
153
+ checks: []
154
+ }));
155
+ }
156
+ function ce(e, t) {
157
+ if (!h(t)) throw Error("Invalid input to extend: expected a plain object");
158
+ let n = e._zod.def.checks;
159
+ if (n && n.length > 0) {
160
+ let n = e._zod.def.shape;
161
+ for (let e of Reflect.ownKeys(t)) if (Object.getOwnPropertyDescriptor(n, e) !== void 0) throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
162
+ }
163
+ return _(e, u(e._zod.def, { get shape() {
164
+ let n = {
165
+ ...e._zod.def.shape,
166
+ ...t
167
+ };
168
+ return l(this, "shape", n), n;
169
+ } }));
170
+ }
171
+ function le(e, t) {
172
+ if (!h(t)) throw Error("Invalid input to safeExtend: expected a plain object");
173
+ return _(e, u(e._zod.def, { get shape() {
174
+ let n = {
175
+ ...e._zod.def.shape,
176
+ ...t
177
+ };
178
+ return l(this, "shape", n), n;
179
+ } }));
180
+ }
181
+ function ue(e, t) {
182
+ if (!t?._zod?.def) throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");
183
+ if (e._zod.def.checks?.length) throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
184
+ return _(e, u(e._zod.def, {
185
+ get shape() {
186
+ let n = {
187
+ ...e._zod.def.shape,
188
+ ...t._zod.def.shape
189
+ };
190
+ return l(this, "shape", n), n;
191
+ },
192
+ get catchall() {
193
+ return t._zod.def.catchall;
194
+ },
195
+ checks: t._zod.def.checks ?? []
196
+ }));
197
+ }
198
+ function de(e, t, n, r = "partial") {
199
+ let i = t._zod.def.checks;
200
+ if (i && i.length > 0) throw Error(`.${r}() cannot be used on object schemas containing refinements`);
201
+ return _(t, u(t._zod.def, {
202
+ get shape() {
203
+ let r = t._zod.def.shape, i = { ...r };
204
+ if (n) for (let t of Reflect.ownKeys(n)) {
205
+ if (!Object.prototype.hasOwnProperty.call(r, t)) throw Error(`Unrecognized key: "${String(t)}"`);
206
+ n[t] && (i[t] = e ? new e({
207
+ type: "optional",
208
+ innerType: r[t]
209
+ }) : r[t]);
210
+ }
211
+ else for (let t of Reflect.ownKeys(r)) i[t] = e ? new e({
212
+ type: "optional",
213
+ innerType: r[t]
214
+ }) : r[t];
215
+ return l(this, "shape", i), i;
216
+ },
217
+ checks: []
218
+ }));
219
+ }
220
+ function fe(e, t, n) {
221
+ return _(t, u(t._zod.def, { get shape() {
222
+ let r = t._zod.def.shape, i = { ...r };
223
+ if (n) for (let t of Reflect.ownKeys(n)) {
224
+ if (!Object.prototype.hasOwnProperty.call(i, t)) throw Error(`Unrecognized key: "${String(t)}"`);
225
+ n[t] && (i[t] = new e({
226
+ type: "nonoptional",
227
+ innerType: r[t]
228
+ }));
229
+ }
230
+ else for (let t of Reflect.ownKeys(r)) i[t] = new e({
231
+ type: "nonoptional",
232
+ innerType: r[t]
233
+ });
234
+ return l(this, "shape", i), i;
235
+ } }));
236
+ }
237
+ function y(e, t = 0) {
238
+ if (e.aborted === !0) return !0;
239
+ for (let n = t; n < e.issues.length; n++) if (e.issues[n]?.continue !== !0) return !0;
240
+ return !1;
241
+ }
242
+ function pe(e, t = 0) {
243
+ if (e.aborted === !0) return !0;
244
+ for (let n = t; n < e.issues.length; n++) if (e.issues[n]?.continue === !1) return !0;
245
+ return !1;
246
+ }
247
+ function b(e, t) {
248
+ return t.map((t) => {
249
+ var n;
250
+ return (n = t).path ?? (n.path = []), t.path.unshift(e), t;
251
+ });
252
+ }
253
+ function me(e) {
254
+ return typeof e == "string" ? e : e?.message;
255
+ }
256
+ function he(e, t, n) {
257
+ var r;
258
+ for (let i = t; i < e.length; i++) (r = e[i]).schema ?? (r.schema = n);
259
+ }
260
+ function x(e, t, n) {
261
+ var r;
262
+ let i = e.inst?._zod?.traits;
263
+ i?.has("$ZodType") && (i.has("$ZodCheck") ? (r = e).schema ?? (r.schema = e.inst) : e.schema = e.inst);
264
+ let a = e.schema === e.inst ? void 0 : e.schema?._zod.def?.error, o = e.message ? e.message : me(e.inst?._zod.def?.error?.(e)) ?? me(a?.(e)) ?? me(t?.error?.(e)) ?? me(n.customError?.(e)) ?? me(n.localeError?.(e)) ?? "Invalid input", { inst: s, schema: c, continue: l, input: u, ...d } = e;
265
+ return d.path ??= [], d.message = o, t?.reportInput && (d.input = u), d;
266
+ }
267
+ var ge = /[\uD800-\uDBFF]/;
268
+ function _e(e) {
269
+ let t = e.length;
270
+ if (!ge.test(e)) return t;
271
+ let n = t;
272
+ for (let r = 0; r < t - 1; r++) (e.charCodeAt(r) & 64512) == 55296 && (e.charCodeAt(r + 1) & 64512) == 56320 && (n--, r++);
273
+ return n;
274
+ }
275
+ function ve(e) {
276
+ return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
277
+ }
278
+ function ye(e) {
279
+ let t = typeof e;
280
+ switch (t) {
281
+ case "number": return Number.isNaN(e) ? "nan" : "number";
282
+ case "object": {
283
+ if (e === null) return "null";
284
+ if (Array.isArray(e)) return "array";
285
+ let t = e;
286
+ if (t && Object.getPrototypeOf(t) !== Object.prototype && "constructor" in t && t.constructor) return t.constructor.name;
287
+ }
288
+ }
289
+ return t;
290
+ }
291
+ function be(...e) {
292
+ let [t, n, r] = e;
293
+ return typeof t == "string" ? {
294
+ message: t,
295
+ code: "custom",
296
+ input: n,
297
+ inst: r
298
+ } : { ...t };
299
+ }
300
+ function xe(e, t) {
301
+ for (let n in t) {
302
+ let r = Object.getOwnPropertyDescriptor(t, n);
303
+ r.get ? Object.defineProperty(e, n, {
304
+ ...r,
305
+ enumerable: !1
306
+ }) : Ce(e, n, r.value);
307
+ }
308
+ }
309
+ function S(e, t, n, r = !0) {
310
+ return Object.defineProperty(e, t, {
311
+ configurable: !0,
312
+ writable: !0,
313
+ enumerable: r,
314
+ value: n
315
+ }), n;
316
+ }
317
+ function Se(e, t, n) {
318
+ return S(e, t, n, !1);
319
+ }
320
+ function Ce(e, t, n) {
321
+ Object.defineProperty(e, t, {
322
+ configurable: !0,
323
+ get() {
324
+ return this == null ? n : S(this, t, n.bind(this));
325
+ },
326
+ set(e) {
327
+ S(this, t, e);
328
+ }
329
+ });
330
+ }
331
+ function we(e, t) {
332
+ let n = Object.getPrototypeOf(e);
333
+ return t in n ? void 0 : n;
334
+ }
335
+ var Te, C = !1, Ee = {
336
+ configurable: !0,
337
+ get() {
338
+ C = !0;
339
+ }
340
+ };
341
+ function w(e, t, n) {
342
+ let r = Object.getPrototypeOf(e._zod);
343
+ if (t in r && Te !== e._zod) {
344
+ Te = void 0;
345
+ return;
346
+ }
347
+ Te = e._zod, Object.defineProperty(r, t, {
348
+ configurable: !0,
349
+ get() {
350
+ Object.defineProperty(this, t, Ee);
351
+ let e = C;
352
+ C = !1;
353
+ try {
354
+ let r = n(this);
355
+ return C ? delete this[t] : Object.defineProperty(this, t, {
356
+ configurable: !0,
357
+ writable: !0,
358
+ value: r
359
+ }), C ||= e, r;
360
+ } catch (n) {
361
+ throw delete this[t], C ||= e, n;
362
+ }
363
+ },
364
+ set(e) {
365
+ Object.defineProperty(this, t, {
366
+ configurable: !0,
367
+ writable: !0,
368
+ value: e
369
+ });
370
+ }
371
+ });
372
+ }
373
+ function De(e, t, n, r) {
374
+ let i = we(e, t);
375
+ i && Object.defineProperty(i, t, {
376
+ configurable: !0,
377
+ get() {
378
+ let e = {
379
+ configurable: !0,
380
+ writable: !0,
381
+ enumerable: r,
382
+ value: void 0
383
+ };
384
+ return Object.defineProperty(this, t, e), e.value = n(this), Object.defineProperty(this, t, e), e.value;
385
+ },
386
+ set(e) {
387
+ Object.defineProperty(this, t, {
388
+ configurable: !0,
389
+ writable: !0,
390
+ enumerable: r,
391
+ value: e
392
+ });
393
+ }
394
+ });
395
+ }
396
+ var Oe = "~constantCatch";
397
+ function ke(e) {
398
+ let t = () => e;
399
+ return t[Oe] = !0, t;
400
+ }
401
+ //#endregion
402
+ //#region ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/core.js
403
+ var Ae, je = {
404
+ value: void 0,
405
+ enumerable: !1
406
+ }, Me = "captureStackTrace" in Error ? Error : null;
407
+ function Ne(e) {
408
+ let t = Me;
409
+ if (t) {
410
+ let n = t.stackTraceLimit;
411
+ if (typeof n == "number") {
412
+ try {
413
+ t.stackTraceLimit = 0;
414
+ } catch {
415
+ return Me = null, new e();
416
+ }
417
+ try {
418
+ return new e();
419
+ } finally {
420
+ t.stackTraceLimit = n;
421
+ }
422
+ }
423
+ }
424
+ return new e();
425
+ }
426
+ function T(e, t, n, r) {
427
+ let i = {};
428
+ function a(e) {
429
+ this.def = e, this.constr = d, this.traits = /* @__PURE__ */ new Set();
430
+ }
431
+ a.prototype = i;
432
+ let o = n, s = o && /* @__PURE__ */ new WeakSet();
433
+ function c(n, r) {
434
+ if (!n._zod) {
435
+ je.value = new a(r);
436
+ try {
437
+ Object.defineProperty(n, "_zod", je);
438
+ } finally {
439
+ je.value = void 0;
440
+ }
441
+ }
442
+ if (n._zod.traits.has(e)) return;
443
+ if (n._zod.traits.add(e), t(n, r), s) {
444
+ let e = Object.getPrototypeOf(n), t = n._zod.constr.prototype, r = e;
445
+ for (; r && r !== t;) r = Object.getPrototypeOf(r);
446
+ let i = r ?? e;
447
+ s.has(i) || (s.add(i), xe(i, o));
448
+ }
449
+ let i = d.prototype;
450
+ for (let e in i) Object.prototype.hasOwnProperty.call(i, e) && (e in n || (n[e] = i[e].bind(n)));
451
+ }
452
+ let l = r?.Parent ?? Object;
453
+ class u extends l {}
454
+ Object.defineProperty(u, "name", { value: e });
455
+ function d(e) {
456
+ let t = r?.Parent ? Ne(u) : this;
457
+ c(t, e);
458
+ let n = t._zod.deferred;
459
+ if (n) {
460
+ for (let e of n) e();
461
+ t._zod.deferred = void 0;
462
+ }
463
+ let i = globalThis.__zod_globalConfig?.postProcessor;
464
+ return i && i(t), t;
465
+ }
466
+ 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;
467
+ }
468
+ var E = class extends Error {
469
+ constructor() {
470
+ super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
471
+ }
472
+ }, Pe = class extends Error {
473
+ constructor(e) {
474
+ super(`Encountered unidirectional transform during encode: ${e}`), this.name = "ZodEncodeError";
475
+ }
476
+ };
477
+ (Ae = globalThis).__zod_globalConfig ?? (Ae.__zod_globalConfig = {});
478
+ var D = globalThis.__zod_globalConfig;
479
+ function O(e) {
480
+ return e && Object.assign(D, e), D;
481
+ }
482
+ //#endregion
483
+ //#region ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/errors.js
484
+ function Fe() {
485
+ let e = this._zod;
486
+ return e.message ??= JSON.stringify(e.def, n, 2), e.message;
487
+ }
488
+ function Ie(e) {
489
+ this._zod.message = e;
490
+ }
491
+ var Le = {
492
+ get: Fe,
493
+ set: Ie,
494
+ enumerable: !0,
495
+ configurable: !0
496
+ }, Re = {
497
+ value: void 0,
498
+ enumerable: !1
499
+ }, ze = {
500
+ value: void 0,
501
+ enumerable: !1
502
+ }, Be = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]), Ve = (e, t) => {
503
+ e.name = "$ZodError", Re.value = e._zod, Object.defineProperty(e, "_zod", Re), ze.value = t, Object.defineProperty(e, "issues", ze), Re.value = void 0, ze.value = void 0, Object.defineProperty(e, "message", Le);
504
+ let n = Object.getPrototypeOf(e);
505
+ Be.has(n) || (Be.add(n), Object.defineProperty(n, "toString", {
506
+ configurable: !0,
507
+ enumerable: !1,
508
+ get() {
509
+ let e = () => this.message;
510
+ return Object.defineProperty(this, "toString", {
511
+ value: e,
512
+ configurable: !0,
513
+ writable: !0
514
+ }), e;
515
+ },
516
+ set(e) {
517
+ Object.defineProperty(this, "toString", {
518
+ value: e,
519
+ configurable: !0,
520
+ writable: !0
521
+ });
522
+ }
523
+ }));
524
+ }, He = T("$ZodError", Ve), Ue = T("$ZodError", Ve, void 0, { Parent: Error });
525
+ function We(e, t, n) {
526
+ return Object.prototype.hasOwnProperty.call(e, t) || (t === "__proto__" ? Object.defineProperty(e, t, {
527
+ value: n(),
528
+ writable: !0,
529
+ enumerable: !0,
530
+ configurable: !0
531
+ }) : e[t] = n()), e[t];
532
+ }
533
+ function Ge(e, t = (e) => e.message) {
534
+ let n = {}, r = [];
535
+ for (let i of e.issues) i.path.length > 0 ? We(n, i.path[0], () => []).push(t(i)) : r.push(t(i));
536
+ return {
537
+ formErrors: r,
538
+ fieldErrors: n
539
+ };
540
+ }
541
+ function Ke(e, t = (e) => e.message) {
542
+ let n = { _errors: [] }, r = (e, i = []) => {
543
+ for (let a of e.issues) if (a.code === "invalid_union" && a.errors.length) a.errors.map((e) => r({ issues: e }, [...i, ...a.path]));
544
+ else if (a.code === "invalid_key") r({ issues: a.issues }, [...i, ...a.path]);
545
+ else if (a.code === "invalid_element") r({ issues: a.issues }, [...i, ...a.path]);
546
+ else {
547
+ let e = [...i, ...a.path];
548
+ if (e.length === 0) n._errors.push(t(a));
549
+ else {
550
+ let r = n, i = 0;
551
+ for (; i < e.length;) {
552
+ let n = e[i], o = i === e.length - 1;
553
+ if (n === "_errors") {
554
+ o && r._errors.push(t(a)), i++;
555
+ continue;
556
+ }
557
+ Object.prototype.hasOwnProperty.call(r, n) || Object.defineProperty(r, n, {
558
+ value: { _errors: [] },
559
+ enumerable: !0,
560
+ writable: !0,
561
+ configurable: !0
562
+ });
563
+ let s = r[n];
564
+ o && s._errors.push(t(a)), r = s, i++;
565
+ }
566
+ }
567
+ }
568
+ };
569
+ return r(e), n;
570
+ }
571
+ //#endregion
572
+ //#region ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/parse.js
573
+ function qe(e, t) {
574
+ return {
575
+ callee: t?.callee ?? e,
576
+ Err: t?.Err
577
+ };
578
+ }
579
+ var Je = (e) => {
580
+ let t = (n, r, i, a) => {
581
+ let o = i ? {
582
+ ...i,
583
+ async: !1
584
+ } : { async: !1 }, s = n._zod.run({
585
+ value: r,
586
+ issues: []
587
+ }, o);
588
+ if (s instanceof Promise) throw new E();
589
+ if (s.issues.length) {
590
+ let n = new ((a?.Err) ?? e)(s.issues.map((e) => x(e, o, O())));
591
+ throw p(n, a?.callee ?? t), n;
592
+ }
593
+ return s.value;
594
+ };
595
+ return t;
596
+ }, Ye = (e) => {
597
+ let t = async (n, r, i, a) => {
598
+ let o = i ? {
599
+ ...i,
600
+ async: !0
601
+ } : { async: !0 }, s = n._zod.run({
602
+ value: r,
603
+ issues: []
604
+ }, o);
605
+ if (s instanceof Promise && (s = await s), s.issues.length) {
606
+ let n = new ((a?.Err) ?? e)(s.issues.map((e) => x(e, o, O())));
607
+ throw p(n, a?.callee ?? t), n;
608
+ }
609
+ return s.value;
610
+ };
611
+ return t;
612
+ }, Xe = (e) => (t, n, r) => {
613
+ let i = r ? {
614
+ ...r,
615
+ async: !1
616
+ } : { async: !1 }, a = t._zod.run({
617
+ value: n,
618
+ issues: []
619
+ }, i);
620
+ if (a instanceof Promise) throw new E();
621
+ return a.issues.length ? {
622
+ success: !1,
623
+ error: new (e ?? He)(a.issues.map((e) => x(e, i, O())))
624
+ } : {
625
+ success: !0,
626
+ data: a.value
627
+ };
628
+ }, Ze = /* @__PURE__*/ Xe(Ue), Qe = (e) => async (t, n, r) => {
629
+ let i = r ? {
630
+ ...r,
631
+ async: !0
632
+ } : { async: !0 }, a = t._zod.run({
633
+ value: n,
634
+ issues: []
635
+ }, i);
636
+ return a instanceof Promise && (a = await a), a.issues.length ? {
637
+ success: !1,
638
+ error: new e(a.issues.map((e) => x(e, i, O())))
639
+ } : {
640
+ success: !0,
641
+ data: a.value
642
+ };
643
+ }, $e = /* @__PURE__*/ Qe(Ue), et = (e) => {
644
+ let t = Je(e), n = (e, r, i, a) => {
645
+ let o = i ? {
646
+ ...i,
647
+ direction: "backward"
648
+ } : { direction: "backward" };
649
+ return t(e, r, o, qe(n, a));
650
+ };
651
+ return n;
652
+ }, tt = (e) => {
653
+ let t = Je(e), n = (e, r, i, a) => t(e, r, i, qe(n, a));
654
+ return n;
655
+ }, nt = (e) => {
656
+ let t = Ye(e), n = async (e, r, i, a) => {
657
+ let o = i ? {
658
+ ...i,
659
+ direction: "backward"
660
+ } : { direction: "backward" };
661
+ return await t(e, r, o, qe(n, a));
662
+ };
663
+ return n;
664
+ }, rt = (e) => {
665
+ let t = Ye(e), n = async (e, r, i, a) => await t(e, r, i, qe(n, a));
666
+ return n;
667
+ }, it = (e) => (t, n, r) => {
668
+ let i = r ? {
669
+ ...r,
670
+ direction: "backward"
671
+ } : { direction: "backward" };
672
+ return Xe(e)(t, n, i);
673
+ }, at = (e) => (t, n, r) => Xe(e)(t, n, r), ot = (e) => async (t, n, r) => {
674
+ let i = r ? {
675
+ ...r,
676
+ direction: "backward"
677
+ } : { direction: "backward" };
678
+ return Qe(e)(t, n, i);
679
+ }, st = (e) => async (t, n, r) => Qe(e)(t, n, r), ct = /^[cC][0-9a-z]{6,}$/, lt = /^[0-9a-z]+$/, ut = /^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/, dt = /^[0-9a-vA-V]{20}$/, ft = /^[A-Za-z0-9]{27}$/, pt = /^[a-zA-Z0-9_-]{21}$/;
680
+ function mt(e) {
681
+ return RegExp(`^[a-zA-Z0-9_-]{${e}}$`);
682
+ }
683
+ var ht = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, gt = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/, _t = (e) => e ? RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, vt = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, yt = "^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";
684
+ function bt() {
685
+ return new RegExp(yt, "u");
686
+ }
687
+ var xt = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/, St = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/, Ct = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/, wt = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Tt = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, Et = /^[A-Za-z0-9_-]*$/, Dt = /^https?$/, Ot = /^\+[1-9]\d{6,14}$/, kt = "(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))";
688
+ function At(e) {
689
+ return RegExp(`^${e}$`);
690
+ }
691
+ var jt = /*@__PURE__*/ At(kt);
692
+ function Mt(e) {
693
+ let t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
694
+ return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : e.seconds ? `${t}:[0-5]\\d(?:\\.\\d+)?` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
695
+ }
696
+ function Nt(e) {
697
+ return RegExp(`^${Mt(e)}$`);
698
+ }
699
+ function Pt(e) {
700
+ let t = ["Z"];
701
+ e.offset && t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
702
+ let n = `${Mt({
703
+ precision: e.precision,
704
+ seconds: !0
705
+ })}(?:${t.join("|")})`, r = e.local ? `${n}|${Mt({ precision: e.precision })}` : n;
706
+ return RegExp(`^${kt}T(?:${r})$`);
707
+ }
708
+ var Ft = (e) => {
709
+ let t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
710
+ return RegExp(`^${t}$`);
711
+ }, It = /^-?\d+$/, Lt = /^-?\d+(?:\.\d+)?$/, Rt = /^(?:true|false)$/i, zt = /^null$/i, Bt = /^[^A-Z]*$/, Vt = /^[^a-z]*$/, k = /*@__PURE__*/ T("$ZodCheck", (e, t) => {
712
+ var n;
713
+ e._zod ??= {}, e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
714
+ }), Ht = (e) => {
715
+ let t = e.value;
716
+ return !i(t) && t.length !== void 0;
717
+ }, Ut = {
718
+ number: "number",
719
+ bigint: "bigint",
720
+ object: "date"
721
+ }, Wt = /*@__PURE__*/ T("$ZodCheckLessThan", (e, t) => {
722
+ k.init(e, t);
723
+ let n = Ut[typeof t.value];
724
+ e._zod.onattach.push((e) => {
725
+ let n = e._zod.bag, r = (t.inclusive ? n.maximum : n.exclusiveMaximum) ?? Infinity;
726
+ t.value < r && (t.inclusive ? n.maximum = t.value : n.exclusiveMaximum = t.value);
727
+ }), e._zod.check = (r) => {
728
+ (t.inclusive ? r.value <= t.value : r.value < t.value) || r.issues.push({
729
+ origin: Ut[typeof r.value] ?? n,
730
+ code: "too_big",
731
+ maximum: typeof t.value == "object" ? t.value.getTime() : t.value,
732
+ input: r.value,
733
+ inclusive: t.inclusive,
734
+ inst: e,
735
+ continue: !t.abort
736
+ });
737
+ };
738
+ }), Gt = /*@__PURE__*/ T("$ZodCheckGreaterThan", (e, t) => {
739
+ k.init(e, t);
740
+ let n = Ut[typeof t.value];
741
+ e._zod.onattach.push((e) => {
742
+ let n = e._zod.bag, r = (t.inclusive ? n.minimum : n.exclusiveMinimum) ?? -Infinity;
743
+ t.value > r && (t.inclusive ? n.minimum = t.value : n.exclusiveMinimum = t.value);
744
+ }), e._zod.check = (r) => {
745
+ (t.inclusive ? r.value >= t.value : r.value > t.value) || r.issues.push({
746
+ origin: Ut[typeof r.value] ?? n,
747
+ code: "too_small",
748
+ minimum: typeof t.value == "object" ? t.value.getTime() : t.value,
749
+ input: r.value,
750
+ inclusive: t.inclusive,
751
+ inst: e,
752
+ continue: !t.abort
753
+ });
754
+ };
755
+ }), Kt = /*@__PURE__*/ T("$ZodCheckMultipleOf", (e, t) => {
756
+ k.init(e, t), e._zod.onattach.push((e) => {
757
+ var n;
758
+ (n = e._zod.bag).multipleOf ?? (n.multipleOf = t.value);
759
+ }), e._zod.check = (n) => {
760
+ if (typeof n.value != typeof t.value) throw Error("Cannot mix number and bigint in multiple_of check.");
761
+ (typeof n.value == "bigint" ? t.value !== BigInt(0) && n.value % t.value === BigInt(0) : o(n.value, t.value) === 0) || n.issues.push({
762
+ origin: typeof n.value,
763
+ code: "not_multiple_of",
764
+ divisor: t.value,
765
+ input: n.value,
766
+ inst: e,
767
+ continue: !t.abort
768
+ });
769
+ };
770
+ }), qt = /*@__PURE__*/ T("$ZodCheckNumberFormat", (e, t) => {
771
+ k.init(e, t), t.format = t.format || "float64";
772
+ let n = t.format?.includes("int"), r = n ? "int" : "number", [i, a] = ae[t.format];
773
+ e._zod.onattach.push((e) => {
774
+ let r = e._zod.bag;
775
+ r.format = t.format, r.minimum = i, r.maximum = a, n && (r.pattern = It);
776
+ }), e._zod.check = (o) => {
777
+ let s = o.value;
778
+ if (n) {
779
+ if (!Number.isInteger(s)) {
780
+ o.issues.push({
781
+ expected: r,
782
+ format: t.format,
783
+ code: "invalid_type",
784
+ continue: !1,
785
+ input: s,
786
+ inst: e
787
+ });
788
+ return;
789
+ }
790
+ if (!Number.isSafeInteger(s)) {
791
+ s > 0 ? o.issues.push({
792
+ input: s,
793
+ code: "too_big",
794
+ maximum: 2 ** 53 - 1,
795
+ note: "Integers must be within the safe integer range.",
796
+ inst: e,
797
+ origin: r,
798
+ inclusive: !0,
799
+ continue: !t.abort
800
+ }) : o.issues.push({
801
+ input: s,
802
+ code: "too_small",
803
+ minimum: -(2 ** 53 - 1),
804
+ note: "Integers must be within the safe integer range.",
805
+ inst: e,
806
+ origin: r,
807
+ inclusive: !0,
808
+ continue: !t.abort
809
+ });
810
+ return;
811
+ }
812
+ }
813
+ s < i && o.issues.push({
814
+ origin: "number",
815
+ input: s,
816
+ code: "too_small",
817
+ minimum: i,
818
+ inclusive: !0,
819
+ inst: e,
820
+ continue: !t.abort
821
+ }), s > a && o.issues.push({
822
+ origin: "number",
823
+ input: s,
824
+ code: "too_big",
825
+ maximum: a,
826
+ inclusive: !0,
827
+ inst: e,
828
+ continue: !t.abort
829
+ });
830
+ };
831
+ }), Jt = /*@__PURE__*/ T("$ZodCheckMaxLength", (e, t) => {
832
+ var n;
833
+ k.init(e, t), (n = e._zod.def).when ?? (n.when = Ht), e._zod.onattach.push((e) => {
834
+ let n = e._zod.bag.maximum ?? Infinity;
835
+ t.maximum < n && (e._zod.bag.maximum = t.maximum);
836
+ }), e._zod.check = (n) => {
837
+ let r = n.value, i = r.length;
838
+ if ((typeof r == "string" && i > t.maximum ? _e(r) : i) <= t.maximum) return;
839
+ let a = ve(r);
840
+ n.issues.push({
841
+ origin: a,
842
+ code: "too_big",
843
+ maximum: t.maximum,
844
+ inclusive: !0,
845
+ input: r,
846
+ inst: e,
847
+ continue: !t.abort
848
+ });
849
+ };
850
+ }), Yt = /*@__PURE__*/ T("$ZodCheckMinLength", (e, t) => {
851
+ var n;
852
+ k.init(e, t), (n = e._zod.def).when ?? (n.when = Ht), e._zod.onattach.push((e) => {
853
+ let n = e._zod.bag.minimum ?? -Infinity;
854
+ t.minimum > n && (e._zod.bag.minimum = t.minimum);
855
+ }), e._zod.check = (n) => {
856
+ let r = n.value, i = r.length;
857
+ if ((typeof r == "string" && i >= t.minimum && i < t.minimum * 2 ? _e(r) : i) >= t.minimum) return;
858
+ let a = ve(r);
859
+ n.issues.push({
860
+ origin: a,
861
+ code: "too_small",
862
+ minimum: t.minimum,
863
+ inclusive: !0,
864
+ input: r,
865
+ inst: e,
866
+ continue: !t.abort
867
+ });
868
+ };
869
+ }), Xt = /*@__PURE__*/ T("$ZodCheckLengthEquals", (e, t) => {
870
+ var n;
871
+ k.init(e, t), (n = e._zod.def).when ?? (n.when = Ht), e._zod.onattach.push((e) => {
872
+ let n = e._zod.bag;
873
+ n.minimum = t.length, n.maximum = t.length, n.length = t.length;
874
+ }), e._zod.check = (n) => {
875
+ let r = n.value, i = r.length, a = typeof r == "string" && i >= t.length && i <= t.length * 2 ? _e(r) : i;
876
+ if (a === t.length) return;
877
+ let o = ve(r), s = a > t.length;
878
+ n.issues.push({
879
+ origin: o,
880
+ ...s ? {
881
+ code: "too_big",
882
+ maximum: t.length
883
+ } : {
884
+ code: "too_small",
885
+ minimum: t.length
886
+ },
887
+ inclusive: !0,
888
+ exact: !0,
889
+ input: n.value,
890
+ inst: e,
891
+ continue: !t.abort
892
+ });
893
+ };
894
+ }), Zt = /*@__PURE__*/ T("$ZodCheckStringFormat", (e, t) => {
895
+ var n, r;
896
+ k.init(e, t), e._zod.onattach.push((e) => {
897
+ let n = e._zod.bag;
898
+ n.format = t.format, t.pattern && (n.patterns ??= /* @__PURE__ */ new Set(), n.patterns.add(t.pattern));
899
+ }), t.pattern ? (n = e._zod).check ?? (n.check = (n) => {
900
+ t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
901
+ origin: "string",
902
+ code: "invalid_format",
903
+ format: t.format,
904
+ input: n.value,
905
+ ...t.pattern ? { pattern: t.pattern.toString() } : {},
906
+ inst: e,
907
+ continue: !t.abort
908
+ });
909
+ }) : (r = e._zod).check ?? (r.check = () => {});
910
+ }), Qt = /*@__PURE__*/ T("$ZodCheckRegex", (e, t) => {
911
+ Zt.init(e, t), e._zod.check = (n) => {
912
+ t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
913
+ origin: "string",
914
+ code: "invalid_format",
915
+ format: "regex",
916
+ input: n.value,
917
+ pattern: t.pattern.toString(),
918
+ inst: e,
919
+ continue: !t.abort
920
+ });
921
+ };
922
+ }), $t = /*@__PURE__*/ T("$ZodCheckLowerCase", (e, t) => {
923
+ t.pattern ??= Bt, Zt.init(e, t);
924
+ }), en = /*@__PURE__*/ T("$ZodCheckUpperCase", (e, t) => {
925
+ t.pattern ??= Vt, Zt.init(e, t);
926
+ }), tn = /*@__PURE__*/ T("$ZodCheckIncludes", (e, t) => {
927
+ k.init(e, t);
928
+ let n = g(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position},}${n}` : n);
929
+ t.pattern = r, e._zod.onattach.push((e) => {
930
+ let t = e._zod.bag;
931
+ t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(r);
932
+ }), e._zod.check = (n) => {
933
+ n.value.includes(t.includes, t.position) || n.issues.push({
934
+ origin: "string",
935
+ code: "invalid_format",
936
+ format: "includes",
937
+ includes: t.includes,
938
+ input: n.value,
939
+ inst: e,
940
+ continue: !t.abort
941
+ });
942
+ };
943
+ }), nn = /*@__PURE__*/ T("$ZodCheckStartsWith", (e, t) => {
944
+ k.init(e, t);
945
+ let n = RegExp(`^${g(t.prefix)}.*`);
946
+ t.pattern ??= n, e._zod.onattach.push((e) => {
947
+ let t = e._zod.bag;
948
+ t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n);
949
+ }), e._zod.check = (n) => {
950
+ n.value.startsWith(t.prefix) || n.issues.push({
951
+ origin: "string",
952
+ code: "invalid_format",
953
+ format: "starts_with",
954
+ prefix: t.prefix,
955
+ input: n.value,
956
+ inst: e,
957
+ continue: !t.abort
958
+ });
959
+ };
960
+ }), rn = /*@__PURE__*/ T("$ZodCheckEndsWith", (e, t) => {
961
+ k.init(e, t);
962
+ let n = RegExp(`.*${g(t.suffix)}$`);
963
+ t.pattern ??= n, e._zod.onattach.push((e) => {
964
+ let t = e._zod.bag;
965
+ t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n);
966
+ }), e._zod.check = (n) => {
967
+ n.value.endsWith(t.suffix) || n.issues.push({
968
+ origin: "string",
969
+ code: "invalid_format",
970
+ format: "ends_with",
971
+ suffix: t.suffix,
972
+ input: n.value,
973
+ inst: e,
974
+ continue: !t.abort
975
+ });
976
+ };
977
+ }), an = /*@__PURE__*/ T("$ZodCheckOverwrite", (e, t) => {
978
+ k.init(e, t), e._zod.check = (e) => {
979
+ e.value = t.tx(e.value);
980
+ };
981
+ }), on = class {
982
+ constructor(e = [], t = {}) {
983
+ this.content = [], this.indent = 0, this.args = e, this.closed = t;
984
+ }
985
+ indented(e) {
986
+ this.indent += 1, e(this), --this.indent;
987
+ }
988
+ write(e) {
989
+ if (typeof e == "function") {
990
+ e(this, { execution: "sync" }), e(this, { execution: "async" });
991
+ return;
992
+ }
993
+ let t = e.split("\n").filter((e) => e), n = Math.min(...t.map((e) => e.length - e.trimStart().length)), r = t.map((e) => e.slice(n)).map((e) => " ".repeat(this.indent * 2) + e);
994
+ for (let e of r) this.content.push(e);
995
+ }
996
+ compile() {
997
+ let e = Function, t = this?.content ?? [""];
998
+ return new e(...Object.keys(this.closed), `return function (${this.args.join(", ")}) {\n${t.join("\n")}\n};`)(...Object.values(this.closed));
999
+ }
1000
+ }, sn = {
1001
+ major: 4,
1002
+ minor: 5,
1003
+ patch: 4
1004
+ }, A = /*@__PURE__*/ T("$ZodType", (e, t) => {
1005
+ var n;
1006
+ e ??= {}, e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = sn;
1007
+ let r = e._zod.def.checks, i = e._zod.traits.has("$ZodCheck") ? [e, ...r ?? []] : r?.length ? [...r] : [];
1008
+ for (let t of i) for (let n of t._zod.onattach) n(e);
1009
+ if (i.length === 0) (n = e._zod).deferred ?? (n.deferred = []), e._zod.deferred?.push(() => {
1010
+ e._zod.run = e._zod.parse;
1011
+ });
1012
+ else {
1013
+ let t = (t, n, r) => {
1014
+ if (t.memo) return t;
1015
+ let i = y(t), a;
1016
+ for (let o of n) {
1017
+ if (o._zod.def.when) {
1018
+ if (pe(t) || !o._zod.def.when(t)) continue;
1019
+ } else if (i) continue;
1020
+ let n = t.issues.length, s = o._zod.check(t);
1021
+ if (s instanceof Promise && r?.async === !1) throw new E();
1022
+ if (a || s instanceof Promise) a = (a ?? Promise.resolve()).then(async () => {
1023
+ await s, t.issues.length !== n && (he(t.issues, n, e), i ||= y(t, n));
1024
+ });
1025
+ else {
1026
+ if (t.issues.length === n) continue;
1027
+ he(t.issues, n, e), i ||= y(t, n);
1028
+ }
1029
+ }
1030
+ return a ? a.then(() => t) : t;
1031
+ }, n = (n, r, a) => {
1032
+ if (y(n)) return n.aborted = !0, n;
1033
+ let o = t(r, i, a);
1034
+ if (o instanceof Promise) {
1035
+ if (a.async === !1) throw new E();
1036
+ return o.then((t) => e._zod.parse(t, a));
1037
+ }
1038
+ return e._zod.parse(o, a);
1039
+ };
1040
+ e._zod.run = (r, a) => {
1041
+ if (a.skipChecks) return e._zod.parse(r, a);
1042
+ if (a.direction === "backward") {
1043
+ let t = e._zod.parse({
1044
+ value: r.value,
1045
+ issues: []
1046
+ }, {
1047
+ ...a,
1048
+ skipChecks: !0
1049
+ });
1050
+ return t instanceof Promise ? t.then((e) => n(e, r, a)) : n(t, r, a);
1051
+ }
1052
+ let o = e._zod.parse(r, a);
1053
+ if (o instanceof Promise) {
1054
+ if (a.async === !1) throw new E();
1055
+ return o.then((e) => t(e, i, a));
1056
+ }
1057
+ return t(o, i, a);
1058
+ };
1059
+ }
1060
+ }, {
1061
+ get "~standard"() {
1062
+ return Se(this, "~standard", ln(this));
1063
+ },
1064
+ set "~standard"(e) {
1065
+ S(this, "~standard", e);
1066
+ }
1067
+ }), cn = (e) => e.success ? { value: e.data } : { issues: e.error?.issues };
1068
+ function ln(e) {
1069
+ return {
1070
+ validate: (t) => {
1071
+ try {
1072
+ return cn(Ze(e, t));
1073
+ } catch {
1074
+ return $e(e, t).then(cn);
1075
+ }
1076
+ },
1077
+ vendor: "zod",
1078
+ version: 1
1079
+ };
1080
+ }
1081
+ var un = /*@__PURE__*/ T("$ZodString", (e, t) => {
1082
+ A.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? Ft(e._zod.bag), e._zod.parse = (n, r) => {
1083
+ if (t.coerce) try {
1084
+ n.value = String(n.value);
1085
+ } catch {}
1086
+ return typeof n.value == "string" || n.issues.push({
1087
+ expected: "string",
1088
+ code: "invalid_type",
1089
+ input: n.value,
1090
+ inst: e
1091
+ }), n;
1092
+ };
1093
+ }), j = /*@__PURE__*/ T("$ZodStringFormat", (e, t) => {
1094
+ Zt.init(e, t), un.init(e, t);
1095
+ }), dn = /*@__PURE__*/ T("$ZodGUID", (e, t) => {
1096
+ t.pattern ??= gt, j.init(e, t);
1097
+ }), fn = /*@__PURE__*/ T("$ZodUUID", (e, t) => {
1098
+ if (t.version) {
1099
+ let e = {
1100
+ v1: 1,
1101
+ v2: 2,
1102
+ v3: 3,
1103
+ v4: 4,
1104
+ v5: 5,
1105
+ v6: 6,
1106
+ v7: 7,
1107
+ v8: 8
1108
+ }[t.version];
1109
+ if (e === void 0) throw Error(`Invalid UUID version: "${t.version}"`);
1110
+ t.pattern ??= _t(e);
1111
+ } else t.pattern ??= _t();
1112
+ j.init(e, t);
1113
+ }), pn = /*@__PURE__*/ T("$ZodEmail", (e, t) => {
1114
+ t.pattern ??= vt, j.init(e, t);
1115
+ });
1116
+ function mn(e, t) {
1117
+ if (!t.normalize && t.protocol?.source === Dt.source && !/^https?:\/\//i.test(e)) return 1;
1118
+ try {
1119
+ return new URL(e);
1120
+ } catch {
1121
+ return 2;
1122
+ }
1123
+ }
1124
+ var hn = /[\t\n\r]/g;
1125
+ function gn(e) {
1126
+ return e.replace(hn, "");
1127
+ }
1128
+ function _n(e, t) {
1129
+ return t.lastIndex = 0, t.test(e.hostname);
1130
+ }
1131
+ function vn(e, t) {
1132
+ return t.lastIndex = 0, t.test(e.protocol.endsWith(":") ? e.protocol.slice(0, -1) : e.protocol);
1133
+ }
1134
+ var yn = /*@__PURE__*/ T("$ZodURL", (e, t) => {
1135
+ j.init(e, t), e._zod.check = (n) => {
1136
+ try {
1137
+ let r = n.value.trim(), i = mn(r, t);
1138
+ if (i === 1) {
1139
+ n.issues.push({
1140
+ code: "invalid_format",
1141
+ format: "url",
1142
+ note: "Invalid URL format",
1143
+ input: n.value,
1144
+ inst: e,
1145
+ continue: !t.abort
1146
+ });
1147
+ return;
1148
+ }
1149
+ if (i === 2) {
1150
+ n.issues.push({
1151
+ code: "invalid_format",
1152
+ format: "url",
1153
+ input: n.value,
1154
+ inst: e,
1155
+ continue: !t.abort
1156
+ });
1157
+ return;
1158
+ }
1159
+ t.hostname && !_n(i, t.hostname) && n.issues.push({
1160
+ code: "invalid_format",
1161
+ format: "url",
1162
+ note: "Invalid hostname",
1163
+ pattern: t.hostname.source,
1164
+ input: n.value,
1165
+ inst: e,
1166
+ continue: !t.abort
1167
+ }), t.protocol && !vn(i, t.protocol) && n.issues.push({
1168
+ code: "invalid_format",
1169
+ format: "url",
1170
+ note: "Invalid protocol",
1171
+ pattern: t.protocol.source,
1172
+ input: n.value,
1173
+ inst: e,
1174
+ continue: !t.abort
1175
+ }), n.value = t.normalize ? i.href : gn(r);
1176
+ return;
1177
+ } catch {
1178
+ n.issues.push({
1179
+ code: "invalid_format",
1180
+ format: "url",
1181
+ input: n.value,
1182
+ inst: e,
1183
+ continue: !t.abort
1184
+ });
1185
+ }
1186
+ };
1187
+ }), bn = /*@__PURE__*/ T("$ZodEmoji", (e, t) => {
1188
+ t.pattern ??= bt(), j.init(e, t);
1189
+ }), xn = /*@__PURE__*/ T("$ZodNanoID", (e, t) => {
1190
+ if (t.length !== void 0 && (!Number.isInteger(t.length) || t.length < 1)) throw Error(`Invalid nanoid length: ${t.length}`);
1191
+ t.pattern ??= t.length === void 0 ? pt : mt(t.length), j.init(e, t);
1192
+ }), Sn = /*@__PURE__*/ T("$ZodCUID", (e, t) => {
1193
+ t.pattern ??= ct, j.init(e, t);
1194
+ }), Cn = /*@__PURE__*/ T("$ZodCUID2", (e, t) => {
1195
+ t.pattern ??= lt, j.init(e, t);
1196
+ }), wn = /*@__PURE__*/ T("$ZodULID", (e, t) => {
1197
+ t.pattern ??= ut, j.init(e, t);
1198
+ }), Tn = /*@__PURE__*/ T("$ZodXID", (e, t) => {
1199
+ t.pattern ??= dt, j.init(e, t);
1200
+ }), En = /*@__PURE__*/ T("$ZodKSUID", (e, t) => {
1201
+ t.pattern ??= ft, j.init(e, t);
1202
+ }), Dn = /*@__PURE__*/ T("$ZodISODateTime", (e, t) => {
1203
+ t.pattern ??= Pt(t), j.init(e, t), (t.local || t.precision === -1) && (e._zod.bag.laxFormat = !0, e._zod.onattach.push((e) => {
1204
+ e._zod.bag.laxFormat = !0;
1205
+ }));
1206
+ }), On = /*@__PURE__*/ T("$ZodISODate", (e, t) => {
1207
+ t.pattern ??= jt, j.init(e, t);
1208
+ }), kn = /*@__PURE__*/ T("$ZodISOTime", (e, t) => {
1209
+ t.pattern ??= Nt(t), j.init(e, t);
1210
+ }), An = /*@__PURE__*/ T("$ZodISODuration", (e, t) => {
1211
+ t.pattern ??= ht, j.init(e, t);
1212
+ }), jn = /*@__PURE__*/ T("$ZodIPv4", (e, t) => {
1213
+ t.pattern ??= xt, j.init(e, t), e._zod.bag.format = "ipv4";
1214
+ }), Mn = /^[0-9a-fA-F:.]+$/;
1215
+ function Nn(e) {
1216
+ if (!Mn.test(e)) return !1;
1217
+ try {
1218
+ return new URL(`http://[${e}]`), !0;
1219
+ } catch {
1220
+ return !1;
1221
+ }
1222
+ }
1223
+ var Pn = /*@__PURE__*/ T("$ZodIPv6", (e, t) => {
1224
+ t.pattern ??= St, j.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (n) => {
1225
+ Nn(n.value) || n.issues.push({
1226
+ code: "invalid_format",
1227
+ format: "ipv6",
1228
+ input: n.value,
1229
+ inst: e,
1230
+ continue: !t.abort
1231
+ });
1232
+ };
1233
+ }), Fn = /*@__PURE__*/ T("$ZodCIDRv4", (e, t) => {
1234
+ t.pattern ??= Ct, j.init(e, t);
1235
+ });
1236
+ function In(e) {
1237
+ let t = e.split("/");
1238
+ if (t.length !== 2) return !1;
1239
+ let [n, r] = t;
1240
+ if (!r) return !1;
1241
+ let i = Number(r);
1242
+ return `${i}` !== r || i < 0 || i > 128 ? !1 : Nn(n);
1243
+ }
1244
+ var Ln = /*@__PURE__*/ T("$ZodCIDRv6", (e, t) => {
1245
+ t.pattern ??= wt, j.init(e, t), e._zod.check = (n) => {
1246
+ In(n.value) || n.issues.push({
1247
+ code: "invalid_format",
1248
+ format: "cidrv6",
1249
+ input: n.value,
1250
+ inst: e,
1251
+ continue: !t.abort
1252
+ });
1253
+ };
1254
+ });
1255
+ function Rn(e) {
1256
+ if (e === "") return !0;
1257
+ if (/\s/.test(e) || e.length % 4 != 0) return !1;
1258
+ try {
1259
+ return atob(e), !0;
1260
+ } catch {
1261
+ return !1;
1262
+ }
1263
+ }
1264
+ var zn = /*@__PURE__*/ T("$ZodBase64", (e, t) => {
1265
+ t.pattern ??= Tt, j.init(e, t), e._zod.bag.contentEncoding = "base64", e._zod.check = (n) => {
1266
+ Rn(n.value) || n.issues.push({
1267
+ code: "invalid_format",
1268
+ format: "base64",
1269
+ input: n.value,
1270
+ inst: e,
1271
+ continue: !t.abort
1272
+ });
1273
+ };
1274
+ });
1275
+ function Bn(e) {
1276
+ if (!Et.test(e)) return !1;
1277
+ let t = e.replace(/[-_]/g, (e) => e === "-" ? "+" : "/");
1278
+ return Rn(t.padEnd(Math.ceil(t.length / 4) * 4, "="));
1279
+ }
1280
+ var Vn = /*@__PURE__*/ T("$ZodBase64URL", (e, t) => {
1281
+ t.pattern ??= Et, j.init(e, t), e._zod.bag.contentEncoding = "base64url", e._zod.check = (n) => {
1282
+ Bn(n.value) || n.issues.push({
1283
+ code: "invalid_format",
1284
+ format: "base64url",
1285
+ input: n.value,
1286
+ inst: e,
1287
+ continue: !t.abort
1288
+ });
1289
+ };
1290
+ }), Hn = /*@__PURE__*/ T("$ZodE164", (e, t) => {
1291
+ t.pattern ??= Ot, j.init(e, t);
1292
+ });
1293
+ function Un(e, t = null) {
1294
+ try {
1295
+ let n = e.split(".");
1296
+ if (n.length !== 3) return !1;
1297
+ let [r] = n;
1298
+ if (!r) return !1;
1299
+ let i = JSON.parse(atob(r));
1300
+ return !("typ" in i && i?.typ !== "JWT" || !i.alg || t && (!("alg" in i) || i.alg !== t));
1301
+ } catch {
1302
+ return !1;
1303
+ }
1304
+ }
1305
+ var Wn = /*@__PURE__*/ T("$ZodJWT", (e, t) => {
1306
+ j.init(e, t), e._zod.check = (n) => {
1307
+ Un(n.value, t.alg) || n.issues.push({
1308
+ code: "invalid_format",
1309
+ format: "jwt",
1310
+ input: n.value,
1311
+ inst: e,
1312
+ continue: !t.abort
1313
+ });
1314
+ };
1315
+ }), Gn = /*@__PURE__*/ T("$ZodNumber", (e, t) => {
1316
+ A.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? Lt, e._zod.parse = (n, r) => {
1317
+ if (t.coerce) try {
1318
+ n.value = Number(n.value);
1319
+ } catch {}
1320
+ let i = n.value;
1321
+ if (typeof i == "number" && !Number.isNaN(i) && Number.isFinite(i)) return n;
1322
+ let a = typeof i == "number" ? Number.isNaN(i) ? "NaN" : Number.isFinite(i) ? void 0 : String(i) : void 0;
1323
+ return n.issues.push({
1324
+ expected: "number",
1325
+ code: "invalid_type",
1326
+ input: i,
1327
+ inst: e,
1328
+ ...a ? { received: a } : {}
1329
+ }), n;
1330
+ };
1331
+ }), Kn = /*@__PURE__*/ T("$ZodNumberFormat", (e, t) => {
1332
+ qt.init(e, t), Gn.init(e, t);
1333
+ }), qn = /*@__PURE__*/ T("$ZodBoolean", (e, t) => {
1334
+ A.init(e, t), e._zod.pattern = Rt, e._zod.parse = (n, r) => {
1335
+ if (t.coerce) try {
1336
+ n.value = !!n.value;
1337
+ } catch {}
1338
+ let i = n.value;
1339
+ return typeof i == "boolean" || n.issues.push({
1340
+ expected: "boolean",
1341
+ code: "invalid_type",
1342
+ input: i,
1343
+ inst: e
1344
+ }), n;
1345
+ };
1346
+ }), Jn = /*@__PURE__*/ T("$ZodNull", (e, t) => {
1347
+ A.init(e, t), e._zod.pattern = zt, e._zod.values = /* @__PURE__ */ new Set([null]), e._zod.parse = (t, n) => {
1348
+ let r = t.value;
1349
+ return r === null || t.issues.push({
1350
+ expected: "null",
1351
+ code: "invalid_type",
1352
+ input: r,
1353
+ inst: e
1354
+ }), t;
1355
+ };
1356
+ }), Yn = /*@__PURE__*/ T("$ZodUnknown", (e, t) => {
1357
+ A.init(e, t), e._zod.parse = (e) => e;
1358
+ }), Xn = /*@__PURE__*/ T("$ZodNever", (e, t) => {
1359
+ A.init(e, t), e._zod.parse = (t, n) => (t.issues.push({
1360
+ expected: "never",
1361
+ code: "invalid_type",
1362
+ input: t.value,
1363
+ inst: e
1364
+ }), t);
1365
+ });
1366
+ function Zn(e, t, n) {
1367
+ e.issues.length && t.issues.push(...b(n, e.issues)), t.value[n] = e.value;
1368
+ }
1369
+ var Qn = /*@__PURE__*/ T("$ZodArray", (e, t) => {
1370
+ A.init(e, t);
1371
+ let n = D.memoizer;
1372
+ n?.attach(e), e._zod.parse = (r, i) => {
1373
+ let a = r.value;
1374
+ if (!Array.isArray(a)) return r.issues.push({
1375
+ expected: "array",
1376
+ code: "invalid_type",
1377
+ input: a,
1378
+ inst: e
1379
+ }), r;
1380
+ r.value = n ? n.alloc(e, r, Array(a.length), i) : Array(a.length);
1381
+ let o = [];
1382
+ for (let e = 0; e < a.length; e++) {
1383
+ let n = a[e], s = t.element._zod.run({
1384
+ value: n,
1385
+ issues: []
1386
+ }, i);
1387
+ s instanceof Promise ? o.push(s.then((t) => Zn(t, r, e))) : Zn(s, r, e);
1388
+ }
1389
+ return o.length ? Promise.all(o).then(() => r) : r;
1390
+ };
1391
+ });
1392
+ function $n(e, t, n, r, i, a) {
1393
+ let o = n in r, s = a === "optional";
1394
+ if (!(!o && s && i === "optional")) {
1395
+ if (e.issues.length) {
1396
+ if (i !== void 0 && s && !o) return;
1397
+ t.issues.push(...b(n, e.issues));
1398
+ }
1399
+ if (!o && i === void 0) {
1400
+ e.issues.length || t.issues.push({
1401
+ code: "invalid_type",
1402
+ expected: "nonoptional",
1403
+ input: void 0,
1404
+ path: [n]
1405
+ });
1406
+ return;
1407
+ }
1408
+ e.value === void 0 ? o && (t.value[n] = void 0) : t.value[n] = e.value;
1409
+ }
1410
+ }
1411
+ var er = [];
1412
+ function tr(e) {
1413
+ let t = Object.keys(e.shape), n = Object.getOwnPropertySymbols(e.shape), r = n.length ? n : er, i = r.length ? [...t, ...r] : t;
1414
+ for (let t of i) if (!e.shape?.[t]?._zod?.traits?.has("$ZodType")) throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);
1415
+ let a = ie(e.shape);
1416
+ return {
1417
+ ...e,
1418
+ allKeys: i,
1419
+ symbolKeys: r,
1420
+ keySet: new Set(t),
1421
+ numKeys: t.length,
1422
+ optionalKeys: new Set(a)
1423
+ };
1424
+ }
1425
+ function nr(e, t, n, r, i, a) {
1426
+ let o = [], s = i.keySet, c = i.catchall._zod, l = c.def.type, u = c.optin, d = c.optout;
1427
+ for (let i in t) {
1428
+ if (s.has(i)) continue;
1429
+ if (i === "__proto__") {
1430
+ l === "never" && o.push(i);
1431
+ continue;
1432
+ }
1433
+ if (l === "never") {
1434
+ o.push(i);
1435
+ continue;
1436
+ }
1437
+ let a = c.run({
1438
+ value: t[i],
1439
+ issues: []
1440
+ }, r);
1441
+ a instanceof Promise ? e.push(a.then((e) => $n(e, n, i, t, u, d))) : $n(a, n, i, t, u, d);
1442
+ }
1443
+ return o.length && n.issues.push({
1444
+ code: "unrecognized_keys",
1445
+ keys: o,
1446
+ input: t,
1447
+ inst: a,
1448
+ continue: !0
1449
+ }), e.length ? Promise.all(e).then(() => n) : n;
1450
+ }
1451
+ var rr = /* @__PURE__ */ new WeakMap(), ir = /*@__PURE__*/ T("$ZodObject", (e, t) => {
1452
+ if (A.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
1453
+ let e = t.shape;
1454
+ rr.set(t, e), Object.defineProperty(t, "shape", { get: () => {
1455
+ let n = { ...e };
1456
+ return Object.defineProperty(t, "shape", { value: n }), rr.set(t, n), n;
1457
+ } });
1458
+ }
1459
+ let n = r(() => tr(t));
1460
+ w(e, "propValues", (e) => {
1461
+ let t = e.def.shape, n = {};
1462
+ for (let e in t) {
1463
+ let r = t[e]._zod;
1464
+ if (r.values) {
1465
+ Object.prototype.hasOwnProperty.call(n, e) || l(n, e, /* @__PURE__ */ new Set());
1466
+ for (let t of r.values) n[e].add(t);
1467
+ r.optin !== void 0 && n[e].add(void 0);
1468
+ }
1469
+ }
1470
+ return n;
1471
+ });
1472
+ let i = m, a = t.catchall, o, s = D.memoizer;
1473
+ s?.attach(e), e._zod.parse = (t, r) => {
1474
+ o ??= n.value;
1475
+ let c = t.value;
1476
+ if (!i(c)) return t.issues.push({
1477
+ expected: "object",
1478
+ code: "invalid_type",
1479
+ input: c,
1480
+ inst: e
1481
+ }), t;
1482
+ t.value = s ? s.alloc(e, t, {}, r) : {};
1483
+ let l = [], u = o.shape;
1484
+ for (let e of o.allKeys) {
1485
+ if (e === "__proto__") continue;
1486
+ let n = u[e], i = n._zod.optin, a = n._zod.optout, o = n._zod.run({
1487
+ value: c[e],
1488
+ issues: []
1489
+ }, r);
1490
+ o instanceof Promise ? l.push(o.then((n) => $n(n, t, e, c, i, a))) : $n(o, t, e, c, i, a);
1491
+ }
1492
+ return a ? nr(l, c, t, r, n.value, e) : l.length ? Promise.all(l).then(() => t) : t;
1493
+ };
1494
+ }), ar = /*@__PURE__*/ T("$ZodObjectJIT", (e, t) => {
1495
+ ir.init(e, t);
1496
+ let n = e._zod.parse, i = r(() => tr(t)), a = D.memoizer, o = (t) => {
1497
+ let n = i.value, r = n.symbolKeys, o = new on(["payload", "ctx"], {
1498
+ shape: t,
1499
+ inst: e,
1500
+ memo: a,
1501
+ syms: r
1502
+ }), s = (e) => `shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`, c = (e, t) => `
1503
+ for (let i = 0; i < ${e}.issues.length; i++) {
1504
+ const iss = ${e}.issues[i];
1505
+ iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
1506
+ payload.issues.push(iss);
1507
+ }`;
1508
+ o.write("const input = payload.value;");
1509
+ let l = Object.create(null), u = 0;
1510
+ for (let e of n.allKeys) l[e] = `key_${u++}`;
1511
+ o.write(a ? "const newResult = memo.alloc(inst, payload, {}, ctx);" : "const newResult = {};");
1512
+ for (let e of n.allKeys) {
1513
+ if (e === "__proto__") continue;
1514
+ let n = l[e], i = typeof e == "symbol" ? `syms[${r.indexOf(e)}]` : d(e), a = `${i} in input`, u = t[e], f = u?._zod?.optin, p = f !== void 0, m = u?._zod?.optout === "optional";
1515
+ if (o.write(`const ${n} = ${s(i)};`), p && m) {
1516
+ let e = f === "optional" ? `${n}_present` : `${n}.value !== undefined || ${n}_present`;
1517
+ o.write(`
1518
+ const ${n}_present = ${a};
1519
+ if (!${n}.issues.length || ${n}_present) {
1520
+ if (${n}.issues.length) {${c(n, i)}
1521
+ }
1522
+
1523
+ if (${e}) {
1524
+ newResult[${i}] = ${n}.value;
1525
+ }
1526
+ }
1527
+
1528
+ `);
1529
+ } else p ? o.write(`
1530
+ if (${n}.issues.length) {${c(n, i)}
1531
+ }
1532
+
1533
+ if (${n}.value === undefined) {
1534
+ if (${a}) {
1535
+ newResult[${i}] = undefined;
1536
+ }
1537
+ } else {
1538
+ newResult[${i}] = ${n}.value;
1539
+ }
1540
+
1541
+ `) : o.write(`
1542
+ const ${n}_present = ${a};
1543
+ if (${n}.issues.length) {${c(n, i)}
1544
+ }
1545
+ if (!${n}_present && !${n}.issues.length) {
1546
+ payload.issues.push({
1547
+ code: "invalid_type",
1548
+ expected: "nonoptional",
1549
+ input: undefined,
1550
+ path: [${i}]
1551
+ });
1552
+ }
1553
+
1554
+ if (${n}_present) {
1555
+ newResult[${i}] = ${n}.value;
1556
+ }
1557
+
1558
+ `);
1559
+ }
1560
+ return o.write("payload.value = newResult;"), o.write("return payload;"), o.compile();
1561
+ }, s, c = m, l = !D.jitless, u = l && ee.value, f = t.catchall, p;
1562
+ e._zod.parse = (r, a) => {
1563
+ p ??= i.value;
1564
+ let d = r.value;
1565
+ return c(d) ? l && u && a?.async === !1 && a.jitless !== !0 ? (s ||= o(t.shape), r = s(r, a), f ? nr([], d, r, a, p, e) : r) : n(r, a) : (r.issues.push({
1566
+ expected: "object",
1567
+ code: "invalid_type",
1568
+ input: d,
1569
+ inst: e
1570
+ }), r);
1571
+ };
1572
+ });
1573
+ function or(e, t, n, r) {
1574
+ for (let n of e) if (n.issues.length === 0) return t.value = n.value, t;
1575
+ let i = e.filter((e) => !y(e));
1576
+ return i.length === 1 ? (t.value = i[0].value, i[0]) : (t.issues.push({
1577
+ code: "invalid_union",
1578
+ input: t.value,
1579
+ inst: n,
1580
+ errors: e.map((e) => e.issues.map((e) => x(e, r, O())))
1581
+ }), t);
1582
+ }
1583
+ var sr = /*@__PURE__*/ T("$ZodUnion", (e, t) => {
1584
+ A.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) => {
1585
+ if (e.def.options.every((e) => e._zod.values)) return new Set(e.def.options.flatMap((e) => Array.from(e._zod.values)));
1586
+ }), w(e, "pattern", (e) => {
1587
+ if (e.def.options.every((e) => e._zod.pattern)) {
1588
+ let t = e.def.options.map((e) => e._zod.pattern);
1589
+ return RegExp(`^(${t.map((e) => a(e.source)).join("|")})$`);
1590
+ }
1591
+ });
1592
+ let n = t.options.length === 1 ? t.options[0]._zod.run : null;
1593
+ e._zod.parse = (r, i) => {
1594
+ if (n) return n(r, i);
1595
+ let a = !1, o = [];
1596
+ for (let e of t.options) {
1597
+ let t = e._zod.run({
1598
+ value: r.value,
1599
+ issues: []
1600
+ }, i);
1601
+ if (t instanceof Promise) o.push(t), a = !0;
1602
+ else {
1603
+ if (t.issues.length === 0) return t;
1604
+ o.push(t);
1605
+ }
1606
+ }
1607
+ return a ? Promise.all(o).then((t) => or(t, r, e, i)) : or(o, r, e, i);
1608
+ };
1609
+ }), cr = /*@__PURE__*/ T("$ZodIntersection", (e, t) => {
1610
+ A.init(e, t), e._zod.parse = (e, n) => {
1611
+ let r = e.value, i = t.left._zod.run({
1612
+ value: r,
1613
+ issues: []
1614
+ }, n), a = t.right._zod.run({
1615
+ value: r,
1616
+ issues: []
1617
+ }, n);
1618
+ return i instanceof Promise || a instanceof Promise ? Promise.all([i, a]).then(([t, n]) => ur(e, t, n)) : ur(e, i, a);
1619
+ };
1620
+ });
1621
+ function lr(e, t) {
1622
+ if (e === t || e instanceof Date && t instanceof Date && +e == +t) return {
1623
+ valid: !0,
1624
+ data: e
1625
+ };
1626
+ if (h(e) && h(t)) {
1627
+ let n = Object.keys(t), r = Object.keys(e).filter((e) => n.indexOf(e) !== -1), i = {
1628
+ ...e,
1629
+ ...t
1630
+ };
1631
+ Object.prototype.hasOwnProperty.call(i, "__proto__") && delete i.__proto__;
1632
+ for (let n of r) {
1633
+ if (n === "__proto__") continue;
1634
+ let r = lr(e[n], t[n]);
1635
+ if (!r.valid) return {
1636
+ valid: !1,
1637
+ mergeErrorPath: [n, ...r.mergeErrorPath]
1638
+ };
1639
+ i[n] = r.data;
1640
+ }
1641
+ return {
1642
+ valid: !0,
1643
+ data: i
1644
+ };
1645
+ }
1646
+ if (Array.isArray(e) && Array.isArray(t)) {
1647
+ if (e.length !== t.length) return {
1648
+ valid: !1,
1649
+ mergeErrorPath: []
1650
+ };
1651
+ let n = [];
1652
+ for (let r = 0; r < e.length; r++) {
1653
+ let i = e[r], a = t[r], o = lr(i, a);
1654
+ if (!o.valid) return {
1655
+ valid: !1,
1656
+ mergeErrorPath: [r, ...o.mergeErrorPath]
1657
+ };
1658
+ n.push(o.data);
1659
+ }
1660
+ return {
1661
+ valid: !0,
1662
+ data: n
1663
+ };
1664
+ }
1665
+ return {
1666
+ valid: !1,
1667
+ mergeErrorPath: []
1668
+ };
1669
+ }
1670
+ function ur(e, t, n) {
1671
+ let r = /* @__PURE__ */ new Map(), i, a = /* @__PURE__ */ new Map(), o = (e, t) => {
1672
+ let n;
1673
+ if (e.code === "unrecognized_keys" && !e.path?.length) i ??= e, n = e.keys;
1674
+ else if (e.code === "invalid_key" && e.origin === "record" && e.path?.length === 1) {
1675
+ let t = String(e.path[0]);
1676
+ a.has(t) || a.set(t, e), n = [t];
1677
+ } else return !1;
1678
+ for (let e of n) r.has(e) || r.set(e, {}), r.get(e)[t] = !0;
1679
+ return !0;
1680
+ };
1681
+ for (let n of t.issues) o(n, "l") || e.issues.push(n);
1682
+ for (let t of n.issues) o(t, "r") || e.issues.push(t);
1683
+ let s = [...r].filter(([, e]) => e.l && e.r).map(([e]) => e);
1684
+ if (s.length) {
1685
+ let t = i ? s.filter((e) => i.keys.includes(e)) : [];
1686
+ t.length && e.issues.push({
1687
+ ...i,
1688
+ keys: t
1689
+ });
1690
+ for (let n of s) !t.includes(n) && a.has(n) && e.issues.push(a.get(n));
1691
+ }
1692
+ let c = lr(t.value, n.value);
1693
+ if (!c.valid) {
1694
+ if (y(e)) return e;
1695
+ throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`);
1696
+ }
1697
+ return e.value = c.data, e;
1698
+ }
1699
+ var dr = /*@__PURE__*/ T("$ZodTuple", (e, t) => {
1700
+ A.init(e, t);
1701
+ let n = t.items, r = D.memoizer;
1702
+ r?.attach(e), e._zod.parse = (i, a) => {
1703
+ let o = i.value;
1704
+ if (!Array.isArray(o)) return i.issues.push({
1705
+ input: o,
1706
+ inst: e,
1707
+ expected: "tuple",
1708
+ code: "invalid_type"
1709
+ }), i;
1710
+ i.value = r ? r.alloc(e, i, [], a) : [];
1711
+ let s = [], c = fr(n, "optin"), l = fr(n, "optout");
1712
+ if (!t.rest) {
1713
+ if (o.length < c) return i.issues.push({
1714
+ code: "too_small",
1715
+ minimum: c,
1716
+ inclusive: !0,
1717
+ input: o,
1718
+ inst: e,
1719
+ origin: "array"
1720
+ }), i;
1721
+ o.length > n.length && i.issues.push({
1722
+ code: "too_big",
1723
+ maximum: n.length,
1724
+ inclusive: !0,
1725
+ input: o,
1726
+ inst: e,
1727
+ origin: "array"
1728
+ });
1729
+ }
1730
+ let u = Array(n.length);
1731
+ for (let e = 0; e < n.length; e++) {
1732
+ let t = n[e]._zod.run({
1733
+ value: o[e],
1734
+ issues: []
1735
+ }, a);
1736
+ t instanceof Promise ? s.push(t.then((t) => {
1737
+ u[e] = t;
1738
+ })) : u[e] = t;
1739
+ }
1740
+ if (t.rest) {
1741
+ let e = n.length - 1, r = o.slice(n.length);
1742
+ for (let n of r) {
1743
+ e++;
1744
+ let r = t.rest._zod.run({
1745
+ value: n,
1746
+ issues: []
1747
+ }, a);
1748
+ r instanceof Promise ? s.push(r.then((t) => pr(t, i, e))) : pr(r, i, e);
1749
+ }
1750
+ }
1751
+ return s.length ? Promise.all(s).then(() => mr(u, i, n, o, l)) : mr(u, i, n, o, l);
1752
+ };
1753
+ });
1754
+ function fr(e, t) {
1755
+ for (let n = e.length - 1; n >= 0; n--) if (!(t === "optin" ? e[n]._zod.optin !== void 0 : e[n]._zod.optout === "optional")) return n + 1;
1756
+ return 0;
1757
+ }
1758
+ function pr(e, t, n) {
1759
+ e.issues.length && t.issues.push(...b(n, e.issues)), t.value[n] = e.value;
1760
+ }
1761
+ function mr(e, t, n, r, i) {
1762
+ for (let a = 0; a < n.length; a++) {
1763
+ let o = e[a], s = a < r.length;
1764
+ if (!s && a >= i && n[a]._zod.optin === "optional") {
1765
+ t.value.length = a;
1766
+ break;
1767
+ }
1768
+ if (o.issues.length) {
1769
+ if (!s && a >= i) {
1770
+ t.value.length = a;
1771
+ break;
1772
+ }
1773
+ t.issues.push(...b(a, o.issues));
1774
+ }
1775
+ t.value[a] = o.value;
1776
+ }
1777
+ 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;
1778
+ return t;
1779
+ }
1780
+ var hr = /*@__PURE__*/ T("$ZodRecord", (e, t) => {
1781
+ A.init(e, t);
1782
+ let n = D.memoizer;
1783
+ n?.attach(e), e._zod.parse = (r, i) => {
1784
+ let a = r.value;
1785
+ if (!h(a)) return r.issues.push({
1786
+ expected: "record",
1787
+ code: "invalid_type",
1788
+ input: a,
1789
+ inst: e
1790
+ }), r;
1791
+ let o = [], s = t.keyType._zod.values;
1792
+ if (s && !t.partial) {
1793
+ r.value = n ? n.alloc(e, r, {}, i) : {};
1794
+ let c = /* @__PURE__ */ new Set();
1795
+ for (let n of s) if (typeof n == "string" || typeof n == "number" || typeof n == "symbol") {
1796
+ if (c.add(typeof n == "number" ? n.toString() : n), n === "__proto__") continue;
1797
+ let s = t.keyType._zod.run({
1798
+ value: n,
1799
+ issues: []
1800
+ }, i);
1801
+ if (s instanceof Promise) throw Error("Async schemas not supported in object keys currently");
1802
+ if (s.issues.length) {
1803
+ r.issues.push({
1804
+ code: "invalid_key",
1805
+ origin: "record",
1806
+ issues: s.issues.map((e) => x(e, i, O())),
1807
+ input: n,
1808
+ path: [n],
1809
+ inst: e
1810
+ });
1811
+ continue;
1812
+ }
1813
+ let l = s.value;
1814
+ if (l === "__proto__") continue;
1815
+ let u = t.valueType._zod.run({
1816
+ value: a[n],
1817
+ issues: []
1818
+ }, i);
1819
+ u instanceof Promise ? o.push(u.then((e) => {
1820
+ e.issues.length && r.issues.push(...b(n, e.issues)), r.value[l] = e.value;
1821
+ })) : (u.issues.length && r.issues.push(...b(n, u.issues)), r.value[l] = u.value);
1822
+ }
1823
+ let l;
1824
+ for (let e in a) if (!c.has(e)) {
1825
+ if (t.mode === "loose") {
1826
+ if (e === "__proto__") continue;
1827
+ r.value[e] = a[e];
1828
+ } else l ??= [], l.push(e);
1829
+ }
1830
+ l && l.length > 0 && r.issues.push({
1831
+ code: "unrecognized_keys",
1832
+ input: a,
1833
+ inst: e,
1834
+ keys: l,
1835
+ continue: !0
1836
+ });
1837
+ } else {
1838
+ r.value = n ? n.alloc(e, r, {}, i) : {};
1839
+ let c;
1840
+ for (let n of Reflect.ownKeys(a)) {
1841
+ if (n === "__proto__" || !Object.prototype.propertyIsEnumerable.call(a, n)) continue;
1842
+ let l = t.keyType._zod.run({
1843
+ value: n,
1844
+ issues: []
1845
+ }, i);
1846
+ if (l instanceof Promise) throw Error("Async schemas not supported in object keys currently");
1847
+ if (typeof n == "string" && Lt.test(n) && l.issues.length) {
1848
+ let e = t.keyType._zod.run({
1849
+ value: Number(n),
1850
+ issues: []
1851
+ }, i);
1852
+ if (e instanceof Promise) throw Error("Async schemas not supported in object keys currently");
1853
+ e.issues.length === 0 && (l = e);
1854
+ }
1855
+ if (l.issues.length) {
1856
+ t.mode === "loose" ? r.value[n] = a[n] : s ? (c ??= [], c.push(n)) : r.issues.push({
1857
+ code: "invalid_key",
1858
+ origin: "record",
1859
+ issues: l.issues.map((e) => x(e, i, O())),
1860
+ input: n,
1861
+ path: [n],
1862
+ inst: e
1863
+ });
1864
+ continue;
1865
+ }
1866
+ let u = l.value;
1867
+ if (u === "__proto__") continue;
1868
+ let d = t.valueType._zod.run({
1869
+ value: a[n],
1870
+ issues: []
1871
+ }, i);
1872
+ d instanceof Promise ? o.push(d.then((e) => {
1873
+ e.issues.length && r.issues.push(...b(n, e.issues)), r.value[u] = e.value;
1874
+ })) : (d.issues.length && r.issues.push(...b(n, d.issues)), r.value[u] = d.value);
1875
+ }
1876
+ c && c.length > 0 && r.issues.push({
1877
+ code: "unrecognized_keys",
1878
+ input: a,
1879
+ inst: e,
1880
+ keys: c,
1881
+ continue: !0
1882
+ });
1883
+ }
1884
+ return o.length ? Promise.all(o).then(() => r) : r;
1885
+ };
1886
+ }), gr = /*@__PURE__*/ T("$ZodEnum", (t, n) => {
1887
+ A.init(t, n);
1888
+ let r = e(n.entries), i = new Set(r);
1889
+ t._zod.values = i;
1890
+ let a = r.filter((e) => ne.has(typeof e));
1891
+ t._zod.pattern = RegExp(a.length ? `^(${a.map((e) => g(e.toString())).join("|")})$` : "^[^\\s\\S]$"), t._zod.parse = (e, n) => {
1892
+ let a = e.value;
1893
+ return i.has(a) || e.issues.push({
1894
+ code: "invalid_value",
1895
+ values: r,
1896
+ input: a,
1897
+ inst: t
1898
+ }), e;
1899
+ };
1900
+ }), _r = /*@__PURE__*/ T("$ZodLiteral", (e, t) => {
1901
+ A.init(e, t);
1902
+ let n = new Set(t.values);
1903
+ 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) => {
1904
+ let a = r.value;
1905
+ return n.has(a) || r.issues.push({
1906
+ code: "invalid_value",
1907
+ values: t.values,
1908
+ input: a,
1909
+ inst: e
1910
+ }), r;
1911
+ };
1912
+ }), vr = /*@__PURE__*/ T("$ZodTransform", (e, t) => {
1913
+ A.init(e, t), e._zod.optin = "optional", D.memoizer?.guard(e), e._zod.parse = (n, r) => {
1914
+ if (r.direction === "backward") throw new Pe(e.constructor.name);
1915
+ let i = t.transform(n.value, n);
1916
+ if (r.async) return (i instanceof Promise ? i : Promise.resolve(i)).then((e) => (n.value = e, n));
1917
+ if (i instanceof Promise) throw new E();
1918
+ return n.value = i, n;
1919
+ };
1920
+ });
1921
+ function yr(e, t) {
1922
+ return e.value = t.issues.length ? void 0 : t.value, e;
1923
+ }
1924
+ var br = /*@__PURE__*/ T("$ZodOptional", (e, t) => {
1925
+ A.init(e, t), w(e, "optin", (e) => e.def.innerType._zod.optin === "defaulted" ? "defaulted" : "optional"), e._zod.optout = "optional", w(e, "values", (e) => {
1926
+ let t = e.def.innerType._zod.values;
1927
+ return t ? /* @__PURE__ */ new Set([...t, void 0]) : void 0;
1928
+ }), w(e, "pattern", (e) => {
1929
+ let t = e.def.innerType._zod.pattern;
1930
+ return t ? RegExp(`^(${a(t.source)})?$`) : void 0;
1931
+ }), e._zod.parse = (e, n) => {
1932
+ if (e.value === void 0) {
1933
+ if (t.innerType._zod.optin !== "defaulted") return e;
1934
+ let r = t.innerType._zod.run({
1935
+ value: e.value,
1936
+ issues: []
1937
+ }, n);
1938
+ return r instanceof Promise ? r.then((t) => yr(e, t)) : yr(e, r);
1939
+ }
1940
+ return t.innerType._zod.run(e, n);
1941
+ };
1942
+ }), xr = /*@__PURE__*/ T("$ZodExactOptional", (e, t) => {
1943
+ br.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);
1944
+ }), Sr = /*@__PURE__*/ T("$ZodNullable", (e, t) => {
1945
+ A.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) => {
1946
+ let t = e.def.innerType._zod.pattern;
1947
+ return t ? RegExp(`^(${a(t.source)}|null)$`) : void 0;
1948
+ }), 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);
1949
+ }), Cr = /*@__PURE__*/ T("$ZodDefault", (e, t) => {
1950
+ A.init(e, t), e._zod.optin = "defaulted", w(e, "values", (e) => e.def.innerType._zod.values), e._zod.parse = (e, n) => {
1951
+ if (n.direction === "backward") return t.innerType._zod.run(e, n);
1952
+ if (e.value === void 0) return e.value = t.defaultValue, e;
1953
+ let r = t.innerType._zod.run(e, n);
1954
+ return r instanceof Promise ? r.then((e) => wr(e, t)) : wr(r, t);
1955
+ };
1956
+ });
1957
+ function wr(e, t) {
1958
+ return e.value === void 0 && (e.value = t.defaultValue), e;
1959
+ }
1960
+ var Tr = /*@__PURE__*/ T("$ZodPrefault", (e, t) => {
1961
+ A.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));
1962
+ }), Er = /*@__PURE__*/ T("$ZodNonOptional", (e, t) => {
1963
+ A.init(e, t), w(e, "values", (e) => {
1964
+ let t = e.def.innerType._zod.values;
1965
+ return t ? new Set([...t].filter((e) => e !== void 0)) : void 0;
1966
+ }), e._zod.parse = (n, r) => {
1967
+ let i = t.innerType._zod.run(n, r);
1968
+ return i instanceof Promise ? i.then((t) => Dr(t, e)) : Dr(i, e);
1969
+ };
1970
+ });
1971
+ function Dr(e, t) {
1972
+ return !e.issues.length && e.value === void 0 && e.issues.push({
1973
+ code: "invalid_type",
1974
+ expected: "nonoptional",
1975
+ input: e.value,
1976
+ inst: t
1977
+ }), e;
1978
+ }
1979
+ function Or(e, t, n, r) {
1980
+ return t.issues.length ? (e.value = n.catchValue({
1981
+ ...t,
1982
+ value: e.value,
1983
+ error: { issues: t.issues.map((e) => x(e, r, O())) },
1984
+ input: e.value
1985
+ }), e) : (e.value = t.value, t.memo && (e.memo = !0), e);
1986
+ }
1987
+ var kr = /*@__PURE__*/ T("$ZodCatch", (e, t) => {
1988
+ A.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) => {
1989
+ if (n.direction === "backward") return t.innerType._zod.run(e, n);
1990
+ let r = t.innerType._zod.run({
1991
+ value: e.value,
1992
+ issues: []
1993
+ }, n);
1994
+ return r instanceof Promise ? r.then((r) => Or(e, r, t, n)) : Or(e, r, t, n);
1995
+ };
1996
+ }), Ar = /*@__PURE__*/ T("$ZodPipe", (e, t) => {
1997
+ A.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) => {
1998
+ if (n.direction === "backward") {
1999
+ let r = t.out._zod.run(e, n);
2000
+ return r instanceof Promise ? r.then((e) => jr(e, t.in, n)) : jr(r, t.in, n);
2001
+ }
2002
+ let r = t.in._zod.run(e, n);
2003
+ return r instanceof Promise ? r.then((e) => jr(e, t.out, n)) : jr(r, t.out, n);
2004
+ };
2005
+ });
2006
+ function jr(e, t, n) {
2007
+ return e.issues.some((e) => e.code !== "unrecognized_keys") ? (e.aborted = !0, e) : t._zod.run({
2008
+ value: e.value,
2009
+ issues: e.issues
2010
+ }, n);
2011
+ }
2012
+ var Mr = /*@__PURE__*/ T("$ZodReadonly", (e, t) => {
2013
+ A.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) => {
2014
+ if (n.direction === "backward") return t.innerType._zod.run(e, n);
2015
+ let r = t.innerType._zod.run(e, n);
2016
+ return r instanceof Promise ? r.then(Nr) : Nr(r);
2017
+ };
2018
+ });
2019
+ function Nr(e) {
2020
+ return e.memo || (e.value = Object.freeze(e.value)), e;
2021
+ }
2022
+ var Pr = /*@__PURE__*/ T("$ZodLazy", (e, t) => {
2023
+ A.init(e, t), c(e._zod, "innerType", () => {
2024
+ let e = t;
2025
+ return e._cachedInner ||= t.getter(), e._cachedInner;
2026
+ }), 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);
2027
+ }), Fr = /*@__PURE__*/ T("$ZodCustom", (e, t) => {
2028
+ k.init(e, t), A.init(e, t), e._zod.parse = (e, t) => e, e._zod.check = (n) => {
2029
+ let r = n.value, i = t.fn(r);
2030
+ if (i instanceof Promise) return i.then((t) => Ir(t, n, r, e));
2031
+ Ir(i, n, r, e);
2032
+ };
2033
+ });
2034
+ function Ir(e, t, n, r) {
2035
+ if (!e) {
2036
+ let e = {
2037
+ code: "custom",
2038
+ input: n,
2039
+ inst: r,
2040
+ path: [...r._zod.def.path ?? []],
2041
+ continue: !r._zod.def.abort
2042
+ };
2043
+ r._zod.def.params && (e.params = r._zod.def.params), t.issues.push(be(e));
2044
+ }
2045
+ }
2046
+ //#endregion
2047
+ //#region ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/memoizer.js
2048
+ var Lr = class extends Error {
2049
+ constructor() {
2050
+ super("Cannot parse a reference cycle that closes through a transform"), this.name = "ZodCyclicError";
2051
+ }
2052
+ }, Rr = "~memo", zr = [];
2053
+ function Br(e) {
2054
+ return e.map((e) => e.path ? {
2055
+ ...e,
2056
+ path: e.path.slice()
2057
+ } : { ...e });
2058
+ }
2059
+ var Vr = /*@__PURE__*/ new WeakMap();
2060
+ function Hr(e, t) {
2061
+ let n = Vr.get(e);
2062
+ if (n !== void 0) return n;
2063
+ if (t.has(e)) return !0;
2064
+ t.add(e);
2065
+ let r = !1, i = (e) => {
2066
+ !r && e?._zod && Hr(e, t) && (r = !0);
2067
+ }, a = e._zod.def;
2068
+ switch (a.type) {
2069
+ case "object":
2070
+ for (let e of Reflect.ownKeys(a.shape)) i(a.shape[e]);
2071
+ i(a.catchall);
2072
+ break;
2073
+ case "array":
2074
+ i(a.element);
2075
+ break;
2076
+ case "tuple":
2077
+ for (let e of a.items) i(e);
2078
+ i(a.rest);
2079
+ break;
2080
+ case "record":
2081
+ case "map":
2082
+ i(a.keyType), i(a.valueType);
2083
+ break;
2084
+ case "set":
2085
+ i(a.valueType);
2086
+ break;
2087
+ case "union":
2088
+ for (let e of a.options) i(e);
2089
+ break;
2090
+ case "intersection":
2091
+ i(a.left), i(a.right);
2092
+ break;
2093
+ case "optional":
2094
+ case "nullable":
2095
+ case "default":
2096
+ case "prefault":
2097
+ case "catch":
2098
+ case "readonly":
2099
+ case "nonoptional":
2100
+ case "promise":
2101
+ case "success":
2102
+ i(a.innerType);
2103
+ break;
2104
+ case "pipe":
2105
+ i(a.in), i(a.out);
2106
+ break;
2107
+ case "function":
2108
+ i(a.input), i(a.output);
2109
+ break;
2110
+ case "lazy":
2111
+ i(e._zod.innerType);
2112
+ break;
2113
+ case "template_literal":
2114
+ case "string":
2115
+ case "number":
2116
+ case "int":
2117
+ case "boolean":
2118
+ case "bigint":
2119
+ case "symbol":
2120
+ case "undefined":
2121
+ case "null":
2122
+ case "void":
2123
+ case "never":
2124
+ case "any":
2125
+ case "unknown":
2126
+ case "date":
2127
+ case "nan":
2128
+ case "enum":
2129
+ case "literal":
2130
+ case "file":
2131
+ case "transform":
2132
+ case "custom": break;
2133
+ default: for (let e in a) {
2134
+ let t = Object.getOwnPropertyDescriptor(a, e);
2135
+ if (!t || t.get) continue;
2136
+ let n = t.value;
2137
+ if (!(!n || typeof n != "object")) {
2138
+ if (n._zod) i(n);
2139
+ else if (Array.isArray(n)) for (let e of n) i(e);
2140
+ }
2141
+ }
2142
+ }
2143
+ return t.delete(e), Vr.set(e, r), r;
2144
+ }
2145
+ function Ur(e, t) {
2146
+ let n = e.buckets.get(t);
2147
+ return n || (n = /* @__PURE__ */ new Map(), e.buckets.set(t, n)), n;
2148
+ }
2149
+ var Wr, Gr = [], Kr = {
2150
+ alloc(e, t, n) {
2151
+ let r = Wr;
2152
+ if (!r) return n;
2153
+ Wr = void 0;
2154
+ let i = {
2155
+ value: n,
2156
+ issues: null
2157
+ };
2158
+ return r.set(t.value, i), Gr.push(i), n;
2159
+ },
2160
+ guard(e) {
2161
+ var t;
2162
+ (t = e._zod).deferred ?? (t.deferred = []), e._zod.deferred.push(() => {
2163
+ let t = e._zod.parse, n = (e, n) => {
2164
+ if (n.direction !== "backward" && Jr(n, e.value)) throw new Lr();
2165
+ return t(e, n);
2166
+ };
2167
+ e._zod.parse = n, e._zod.run === t && (e._zod.run = n);
2168
+ });
2169
+ },
2170
+ attach(e) {
2171
+ var t;
2172
+ let n, r, i;
2173
+ (t = e._zod).deferred ?? (t.deferred = []), e._zod.deferred.push(() => {
2174
+ let t = e._zod.parse, a = (o, s) => {
2175
+ if (n === void 0 && (n = Hr(e, /* @__PURE__ */ new Set()), !n)) return e._zod.parse = t, e._zod.run === a && (e._zod.run = t), t(o, s);
2176
+ let c = o.value;
2177
+ if (typeof c != "object" || !c) return t(o, s);
2178
+ let l = s[Rr];
2179
+ l || (l = {
2180
+ buckets: /* @__PURE__ */ new Map(),
2181
+ backEdges: void 0
2182
+ }, s[Rr] = l);
2183
+ let u;
2184
+ r === s ? u = i : (u = Ur(l, e), r = s, i = u);
2185
+ let d = u.get(c);
2186
+ if (d) return o.value = d.value, d.issues ? d.issues.length && o.issues.push(...Br(d.issues)) : (o.memo = !0, l.backEdges ?? (l.backEdges = /* @__PURE__ */ new Set()), l.backEdges.add(d.value)), o;
2187
+ Wr = u;
2188
+ let f = Gr.length, p = t(o, s);
2189
+ Wr = void 0;
2190
+ let m = Gr.length > f ? Gr.pop() : void 0;
2191
+ return p instanceof Promise ? p.then((e) => (m && (m.issues = e.issues.length ? Br(e.issues) : zr), e)) : (m && (m.issues = p.issues.length ? Br(p.issues) : zr), p);
2192
+ };
2193
+ e._zod.parse = a, e._zod.run === t && (e._zod.run = a);
2194
+ });
2195
+ }
2196
+ };
2197
+ function qr() {
2198
+ return Kr;
2199
+ }
2200
+ function Jr(e, t) {
2201
+ let n = e[Rr]?.backEdges;
2202
+ return n !== void 0 && typeof t == "object" && !!t && n.has(t);
2203
+ }
2204
+ //#endregion
2205
+ //#region ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/locales/en.js
2206
+ var Yr = () => {
2207
+ let e = {
2208
+ string: {
2209
+ unit: "characters",
2210
+ verb: "to have"
2211
+ },
2212
+ file: {
2213
+ unit: "bytes",
2214
+ verb: "to have"
2215
+ },
2216
+ array: {
2217
+ unit: "items",
2218
+ verb: "to have"
2219
+ },
2220
+ set: {
2221
+ unit: "items",
2222
+ verb: "to have"
2223
+ },
2224
+ map: {
2225
+ unit: "entries",
2226
+ verb: "to have"
2227
+ }
2228
+ };
2229
+ function n(t) {
2230
+ return e[t] ?? null;
2231
+ }
2232
+ let r = {
2233
+ regex: "input",
2234
+ email: "email address",
2235
+ url: "URL",
2236
+ emoji: "emoji",
2237
+ uuid: "UUID",
2238
+ uuidv4: "UUIDv4",
2239
+ uuidv6: "UUIDv6",
2240
+ nanoid: "nanoid",
2241
+ guid: "GUID",
2242
+ cuid: "cuid",
2243
+ cuid2: "cuid2",
2244
+ ulid: "ULID",
2245
+ xid: "XID",
2246
+ ksuid: "KSUID",
2247
+ datetime: "ISO datetime",
2248
+ date: "ISO date",
2249
+ time: "ISO time",
2250
+ duration: "ISO duration",
2251
+ ipv4: "IPv4 address",
2252
+ ipv6: "IPv6 address",
2253
+ mac: "MAC address",
2254
+ cidrv4: "IPv4 range",
2255
+ cidrv6: "IPv6 range",
2256
+ base64: "base64-encoded string",
2257
+ base64url: "base64url-encoded string",
2258
+ json_string: "JSON string",
2259
+ e164: "E.164 number",
2260
+ credit_card: "credit card number",
2261
+ jwt: "JWT",
2262
+ template_literal: "input"
2263
+ }, i = { nan: "NaN" };
2264
+ function a(e, t) {
2265
+ return e === "number" && typeof t == "number" && !Number.isFinite(t) ? String(t) : i[e] ?? e;
2266
+ }
2267
+ return (e) => {
2268
+ switch (e.code) {
2269
+ case "invalid_type": return `Invalid input: expected ${a(e.expected)}, received ${a(ye(e.input), e.input)}`;
2270
+ case "invalid_value": return e.values.length === 1 ? `Invalid input: expected ${re(e.values[0])}` : `Invalid option: expected one of ${t(e.values, "|")}`;
2271
+ case "too_big": {
2272
+ let t = e.exact ? "exactly " : e.inclusive ? "<=" : "<", r = n(e.origin);
2273
+ return r ? `Too big: expected ${e.origin ?? "value"} to have ${t}${e.maximum.toString()} ${r.unit ?? "elements"}` : `Too big: expected ${e.origin ?? "value"} to be ${t}${e.maximum.toString()}`;
2274
+ }
2275
+ case "too_small": {
2276
+ let t = e.exact ? "exactly " : e.inclusive ? ">=" : ">", r = n(e.origin);
2277
+ return r ? `Too small: expected ${e.origin} to have ${t}${e.minimum.toString()} ${r.unit}` : `Too small: expected ${e.origin} to be ${t}${e.minimum.toString()}`;
2278
+ }
2279
+ case "invalid_format": {
2280
+ let t = e;
2281
+ return t.format === "starts_with" ? `Invalid string: must start with "${t.prefix}"` : t.format === "ends_with" ? `Invalid string: must end with "${t.suffix}"` : t.format === "includes" ? `Invalid string: must include "${t.includes}"` : t.format === "regex" ? `Invalid string: must match pattern ${t.pattern}` : `Invalid ${r[t.format] ?? e.format}`;
2282
+ }
2283
+ case "not_multiple_of": return `Invalid number: must be a multiple of ${e.divisor}`;
2284
+ case "unrecognized_keys": return `Unrecognized key${e.keys.length > 1 ? "s" : ""}: ${t(e.keys, ", ")}`;
2285
+ case "invalid_key": return `Invalid key in ${e.origin}`;
2286
+ case "invalid_union": return e.options && Array.isArray(e.options) && e.options.length > 0 ? `Invalid discriminator value. Expected ${e.options.map((e) => `'${e}'`).join(" | ")}` : e.inclusive === !1 ? "Invalid input: more than one option matched" : "Invalid input";
2287
+ case "invalid_element": return `Invalid value in ${e.origin}`;
2288
+ default: return "Invalid input";
2289
+ }
2290
+ };
2291
+ };
2292
+ function Xr() {
2293
+ return { localeError: Yr() };
2294
+ }
2295
+ //#endregion
2296
+ //#region ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/registries.js
2297
+ var Zr, Qr = class {
2298
+ constructor() {
2299
+ this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
2300
+ }
2301
+ add(e, ...t) {
2302
+ let n = t[0];
2303
+ return this._map.set(e, n), n && typeof n == "object" && "id" in n && this._idmap.set(n.id, e), this;
2304
+ }
2305
+ clear() {
2306
+ return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this;
2307
+ }
2308
+ remove(e) {
2309
+ let t = this._map.get(e);
2310
+ return t && typeof t == "object" && "id" in t && this._idmap.delete(t.id), this._map.delete(e), this;
2311
+ }
2312
+ get(e) {
2313
+ let t = e._zod.parent;
2314
+ if (t) {
2315
+ let n = { ...this.get(t) ?? {} };
2316
+ delete n.id;
2317
+ let r = {
2318
+ ...n,
2319
+ ...this._map.get(e)
2320
+ };
2321
+ return Object.keys(r).length ? r : void 0;
2322
+ }
2323
+ return this._map.get(e);
2324
+ }
2325
+ has(e) {
2326
+ return this._map.has(e);
2327
+ }
2328
+ };
2329
+ function $r() {
2330
+ return new Qr();
2331
+ }
2332
+ (Zr = globalThis).__zod_globalRegistry ?? (Zr.__zod_globalRegistry = $r());
2333
+ var ei = globalThis.__zod_globalRegistry;
2334
+ //#endregion
2335
+ //#region ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/api.js
2336
+ // @__NO_SIDE_EFFECTS__
2337
+ function ti(e, t) {
2338
+ return new e({
2339
+ type: "string",
2340
+ ...v(t)
2341
+ });
2342
+ }
2343
+ // @__NO_SIDE_EFFECTS__
2344
+ function ni(e, t) {
2345
+ return new e({
2346
+ type: "string",
2347
+ format: "email",
2348
+ check: "string_format",
2349
+ abort: !1,
2350
+ ...v(t)
2351
+ });
2352
+ }
2353
+ // @__NO_SIDE_EFFECTS__
2354
+ function ri(e, t) {
2355
+ return new e({
2356
+ type: "string",
2357
+ format: "guid",
2358
+ check: "string_format",
2359
+ abort: !1,
2360
+ ...v(t)
2361
+ });
2362
+ }
2363
+ // @__NO_SIDE_EFFECTS__
2364
+ function ii(e, t) {
2365
+ return new e({
2366
+ type: "string",
2367
+ format: "uuid",
2368
+ check: "string_format",
2369
+ abort: !1,
2370
+ ...v(t)
2371
+ });
2372
+ }
2373
+ // @__NO_SIDE_EFFECTS__
2374
+ function ai(e, t) {
2375
+ return new e({
2376
+ type: "string",
2377
+ format: "uuid",
2378
+ check: "string_format",
2379
+ abort: !1,
2380
+ version: "v4",
2381
+ ...v(t)
2382
+ });
2383
+ }
2384
+ // @__NO_SIDE_EFFECTS__
2385
+ function oi(e, t) {
2386
+ return new e({
2387
+ type: "string",
2388
+ format: "uuid",
2389
+ check: "string_format",
2390
+ abort: !1,
2391
+ version: "v6",
2392
+ ...v(t)
2393
+ });
2394
+ }
2395
+ // @__NO_SIDE_EFFECTS__
2396
+ function si(e, t) {
2397
+ return new e({
2398
+ type: "string",
2399
+ format: "uuid",
2400
+ check: "string_format",
2401
+ abort: !1,
2402
+ version: "v7",
2403
+ ...v(t)
2404
+ });
2405
+ }
2406
+ // @__NO_SIDE_EFFECTS__
2407
+ function ci(e, t) {
2408
+ return new e({
2409
+ type: "string",
2410
+ format: "url",
2411
+ check: "string_format",
2412
+ abort: !1,
2413
+ ...v(t)
2414
+ });
2415
+ }
2416
+ // @__NO_SIDE_EFFECTS__
2417
+ function li(e, t) {
2418
+ return new e({
2419
+ type: "string",
2420
+ format: "emoji",
2421
+ check: "string_format",
2422
+ abort: !1,
2423
+ ...v(t)
2424
+ });
2425
+ }
2426
+ // @__NO_SIDE_EFFECTS__
2427
+ function ui(e, t) {
2428
+ return new e({
2429
+ type: "string",
2430
+ format: "nanoid",
2431
+ check: "string_format",
2432
+ abort: !1,
2433
+ ...v(t)
2434
+ });
2435
+ }
2436
+ // @__NO_SIDE_EFFECTS__
2437
+ function di(e, t) {
2438
+ return new e({
2439
+ type: "string",
2440
+ format: "cuid",
2441
+ check: "string_format",
2442
+ abort: !1,
2443
+ ...v(t)
2444
+ });
2445
+ }
2446
+ // @__NO_SIDE_EFFECTS__
2447
+ function fi(e, t) {
2448
+ return new e({
2449
+ type: "string",
2450
+ format: "cuid2",
2451
+ check: "string_format",
2452
+ abort: !1,
2453
+ ...v(t)
2454
+ });
2455
+ }
2456
+ // @__NO_SIDE_EFFECTS__
2457
+ function pi(e, t) {
2458
+ return new e({
2459
+ type: "string",
2460
+ format: "ulid",
2461
+ check: "string_format",
2462
+ abort: !1,
2463
+ ...v(t)
2464
+ });
2465
+ }
2466
+ // @__NO_SIDE_EFFECTS__
2467
+ function mi(e, t) {
2468
+ return new e({
2469
+ type: "string",
2470
+ format: "xid",
2471
+ check: "string_format",
2472
+ abort: !1,
2473
+ ...v(t)
2474
+ });
2475
+ }
2476
+ // @__NO_SIDE_EFFECTS__
2477
+ function hi(e, t) {
2478
+ return new e({
2479
+ type: "string",
2480
+ format: "ksuid",
2481
+ check: "string_format",
2482
+ abort: !1,
2483
+ ...v(t)
2484
+ });
2485
+ }
2486
+ // @__NO_SIDE_EFFECTS__
2487
+ function gi(e, t) {
2488
+ return new e({
2489
+ type: "string",
2490
+ format: "ipv4",
2491
+ check: "string_format",
2492
+ abort: !1,
2493
+ ...v(t)
2494
+ });
2495
+ }
2496
+ // @__NO_SIDE_EFFECTS__
2497
+ function _i(e, t) {
2498
+ return new e({
2499
+ type: "string",
2500
+ format: "ipv6",
2501
+ check: "string_format",
2502
+ abort: !1,
2503
+ ...v(t)
2504
+ });
2505
+ }
2506
+ // @__NO_SIDE_EFFECTS__
2507
+ function vi(e, t) {
2508
+ return new e({
2509
+ type: "string",
2510
+ format: "cidrv4",
2511
+ check: "string_format",
2512
+ abort: !1,
2513
+ ...v(t)
2514
+ });
2515
+ }
2516
+ // @__NO_SIDE_EFFECTS__
2517
+ function yi(e, t) {
2518
+ return new e({
2519
+ type: "string",
2520
+ format: "cidrv6",
2521
+ check: "string_format",
2522
+ abort: !1,
2523
+ ...v(t)
2524
+ });
2525
+ }
2526
+ // @__NO_SIDE_EFFECTS__
2527
+ function bi(e, t) {
2528
+ return new e({
2529
+ type: "string",
2530
+ format: "base64",
2531
+ check: "string_format",
2532
+ abort: !1,
2533
+ ...v(t)
2534
+ });
2535
+ }
2536
+ // @__NO_SIDE_EFFECTS__
2537
+ function xi(e, t) {
2538
+ return new e({
2539
+ type: "string",
2540
+ format: "base64url",
2541
+ check: "string_format",
2542
+ abort: !1,
2543
+ ...v(t)
2544
+ });
2545
+ }
2546
+ // @__NO_SIDE_EFFECTS__
2547
+ function Si(e, t) {
2548
+ return new e({
2549
+ type: "string",
2550
+ format: "e164",
2551
+ check: "string_format",
2552
+ abort: !1,
2553
+ ...v(t)
2554
+ });
2555
+ }
2556
+ // @__NO_SIDE_EFFECTS__
2557
+ function Ci(e, t) {
2558
+ return new e({
2559
+ type: "string",
2560
+ format: "jwt",
2561
+ check: "string_format",
2562
+ abort: !1,
2563
+ ...v(t)
2564
+ });
2565
+ }
2566
+ // @__NO_SIDE_EFFECTS__
2567
+ function wi(e, t) {
2568
+ return new e({
2569
+ type: "string",
2570
+ format: "datetime",
2571
+ check: "string_format",
2572
+ offset: !1,
2573
+ local: !1,
2574
+ precision: null,
2575
+ ...v(t)
2576
+ });
2577
+ }
2578
+ // @__NO_SIDE_EFFECTS__
2579
+ function Ti(e, t) {
2580
+ return new e({
2581
+ type: "string",
2582
+ format: "date",
2583
+ check: "string_format",
2584
+ ...v(t)
2585
+ });
2586
+ }
2587
+ // @__NO_SIDE_EFFECTS__
2588
+ function Ei(e, t) {
2589
+ return new e({
2590
+ type: "string",
2591
+ format: "time",
2592
+ check: "string_format",
2593
+ precision: null,
2594
+ ...v(t)
2595
+ });
2596
+ }
2597
+ // @__NO_SIDE_EFFECTS__
2598
+ function Di(e, t) {
2599
+ return new e({
2600
+ type: "string",
2601
+ format: "duration",
2602
+ check: "string_format",
2603
+ ...v(t)
2604
+ });
2605
+ }
2606
+ // @__NO_SIDE_EFFECTS__
2607
+ function Oi(e, t) {
2608
+ return new e({
2609
+ type: "number",
2610
+ checks: [],
2611
+ ...v(t)
2612
+ });
2613
+ }
2614
+ // @__NO_SIDE_EFFECTS__
2615
+ function ki(e, t) {
2616
+ return new e({
2617
+ type: "number",
2618
+ check: "number_format",
2619
+ abort: !1,
2620
+ format: "safeint",
2621
+ ...v(t)
2622
+ });
2623
+ }
2624
+ // @__NO_SIDE_EFFECTS__
2625
+ function Ai(e, t) {
2626
+ return new e({
2627
+ type: "boolean",
2628
+ ...v(t)
2629
+ });
2630
+ }
2631
+ // @__NO_SIDE_EFFECTS__
2632
+ function ji(e, t) {
2633
+ return new e({
2634
+ type: "null",
2635
+ ...v(t)
2636
+ });
2637
+ }
2638
+ // @__NO_SIDE_EFFECTS__
2639
+ function Mi(e) {
2640
+ return new e({ type: "unknown" });
2641
+ }
2642
+ // @__NO_SIDE_EFFECTS__
2643
+ function Ni(e, t) {
2644
+ return new e({
2645
+ type: "never",
2646
+ ...v(t)
2647
+ });
2648
+ }
2649
+ // @__NO_SIDE_EFFECTS__
2650
+ function Pi(e, t) {
2651
+ return new Wt({
2652
+ check: "less_than",
2653
+ ...v(t),
2654
+ value: e,
2655
+ inclusive: !1
2656
+ });
2657
+ }
2658
+ // @__NO_SIDE_EFFECTS__
2659
+ function Fi(e, t) {
2660
+ return new Wt({
2661
+ check: "less_than",
2662
+ ...v(t),
2663
+ value: e,
2664
+ inclusive: !0
2665
+ });
2666
+ }
2667
+ // @__NO_SIDE_EFFECTS__
2668
+ function Ii(e, t) {
2669
+ return new Gt({
2670
+ check: "greater_than",
2671
+ ...v(t),
2672
+ value: e,
2673
+ inclusive: !1
2674
+ });
2675
+ }
2676
+ // @__NO_SIDE_EFFECTS__
2677
+ function Li(e, t) {
2678
+ return new Gt({
2679
+ check: "greater_than",
2680
+ ...v(t),
2681
+ value: e,
2682
+ inclusive: !0
2683
+ });
2684
+ }
2685
+ // @__NO_SIDE_EFFECTS__
2686
+ function Ri(e, t) {
2687
+ return new Kt({
2688
+ check: "multiple_of",
2689
+ ...v(t),
2690
+ value: e
2691
+ });
2692
+ }
2693
+ // @__NO_SIDE_EFFECTS__
2694
+ function zi(e, t) {
2695
+ return new Jt({
2696
+ check: "max_length",
2697
+ ...v(t),
2698
+ maximum: e
2699
+ });
2700
+ }
2701
+ // @__NO_SIDE_EFFECTS__
2702
+ function Bi(e, t) {
2703
+ return new Yt({
2704
+ check: "min_length",
2705
+ ...v(t),
2706
+ minimum: e
2707
+ });
2708
+ }
2709
+ // @__NO_SIDE_EFFECTS__
2710
+ function Vi(e, t) {
2711
+ return new Xt({
2712
+ check: "length_equals",
2713
+ ...v(t),
2714
+ length: e
2715
+ });
2716
+ }
2717
+ // @__NO_SIDE_EFFECTS__
2718
+ function Hi(e, t) {
2719
+ return new Qt({
2720
+ check: "string_format",
2721
+ format: "regex",
2722
+ ...v(t),
2723
+ pattern: e
2724
+ });
2725
+ }
2726
+ // @__NO_SIDE_EFFECTS__
2727
+ function Ui(e) {
2728
+ return new $t({
2729
+ check: "string_format",
2730
+ format: "lowercase",
2731
+ ...v(e)
2732
+ });
2733
+ }
2734
+ // @__NO_SIDE_EFFECTS__
2735
+ function Wi(e) {
2736
+ return new en({
2737
+ check: "string_format",
2738
+ format: "uppercase",
2739
+ ...v(e)
2740
+ });
2741
+ }
2742
+ // @__NO_SIDE_EFFECTS__
2743
+ function Gi(e, t) {
2744
+ return new tn({
2745
+ check: "string_format",
2746
+ format: "includes",
2747
+ ...v(t),
2748
+ includes: e
2749
+ });
2750
+ }
2751
+ // @__NO_SIDE_EFFECTS__
2752
+ function Ki(e, t) {
2753
+ return new nn({
2754
+ check: "string_format",
2755
+ format: "starts_with",
2756
+ ...v(t),
2757
+ prefix: e
2758
+ });
2759
+ }
2760
+ // @__NO_SIDE_EFFECTS__
2761
+ function qi(e, t) {
2762
+ return new rn({
2763
+ check: "string_format",
2764
+ format: "ends_with",
2765
+ ...v(t),
2766
+ suffix: e
2767
+ });
2768
+ }
2769
+ // @__NO_SIDE_EFFECTS__
2770
+ function M(e) {
2771
+ return new an({
2772
+ check: "overwrite",
2773
+ tx: e
2774
+ });
2775
+ }
2776
+ // @__NO_SIDE_EFFECTS__
2777
+ function Ji(e) {
2778
+ return /* @__PURE__ */ M((t) => t.normalize(e));
2779
+ }
2780
+ // @__NO_SIDE_EFFECTS__
2781
+ function Yi() {
2782
+ return /* @__PURE__ */ M((e) => e.trim());
2783
+ }
2784
+ // @__NO_SIDE_EFFECTS__
2785
+ function Xi() {
2786
+ return /* @__PURE__ */ M((e) => e.toLowerCase());
2787
+ }
2788
+ // @__NO_SIDE_EFFECTS__
2789
+ function Zi() {
2790
+ return /* @__PURE__ */ M((e) => e.toUpperCase());
2791
+ }
2792
+ // @__NO_SIDE_EFFECTS__
2793
+ function Qi() {
2794
+ return /* @__PURE__ */ M((e) => f(e));
2795
+ }
2796
+ // @__NO_SIDE_EFFECTS__
2797
+ function $i(e, t, n) {
2798
+ return new e({
2799
+ type: "array",
2800
+ element: t,
2801
+ ...v(n)
2802
+ });
2803
+ }
2804
+ // @__NO_SIDE_EFFECTS__
2805
+ function ea(e, t, n) {
2806
+ return new e({
2807
+ type: "custom",
2808
+ check: "custom",
2809
+ fn: t,
2810
+ ...v(n)
2811
+ });
2812
+ }
2813
+ // @__NO_SIDE_EFFECTS__
2814
+ function ta(e, t) {
2815
+ let n = /* @__PURE__ */ na((t) => (t.addIssue = (e) => {
2816
+ if (typeof e == "string") t.issues.push(be(e, t.value, n._zod.def));
2817
+ else {
2818
+ let r = e;
2819
+ 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(be(r));
2820
+ }
2821
+ }, e(t.value, t)), t);
2822
+ return n;
2823
+ }
2824
+ // @__NO_SIDE_EFFECTS__
2825
+ function na(e, t) {
2826
+ let n = new k({
2827
+ check: "custom",
2828
+ ...v(t)
2829
+ });
2830
+ return n._zod.check = e, n;
2831
+ }
2832
+ //#endregion
2833
+ //#region ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/core/to-json-schema.js
2834
+ function ra(e, ...t) {
2835
+ for (let n of t) for (let t of Reflect.ownKeys(n)) Object.prototype.propertyIsEnumerable.call(n, t) && l(e, t, n[t]);
2836
+ return e;
2837
+ }
2838
+ function ia(e) {
2839
+ let t = e?.target ?? "draft-2020-12";
2840
+ return t === "draft-4" && (t = "draft-04"), t === "draft-7" && (t = "draft-07"), {
2841
+ processors: e.processors ?? {},
2842
+ metadataRegistry: e?.metadata ?? ei,
2843
+ target: t,
2844
+ unrepresentable: e?.unrepresentable ?? "throw",
2845
+ override: e?.override ?? (() => {}),
2846
+ io: e?.io ?? "output",
2847
+ counter: 0,
2848
+ seen: /* @__PURE__ */ new Map(),
2849
+ sharedDefsExtractedFor: void 0,
2850
+ sharedEmitDoneFor: void 0,
2851
+ cycles: e?.cycles ?? "ref",
2852
+ reused: e?.reused ?? "inline",
2853
+ intersections: [],
2854
+ deferred: [],
2855
+ external: e?.external ?? void 0
2856
+ };
2857
+ }
2858
+ function N(e, t, n, r, i) {
2859
+ let a = typeof t.unrepresentable == "function" ? t.unrepresentable({
2860
+ zodSchema: e,
2861
+ path: r.path,
2862
+ message: i
2863
+ }) : t.unrepresentable;
2864
+ if (a === "any") return !1;
2865
+ if (a === void 0 || a === "throw") throw Error(i);
2866
+ return Object.assign(n, a), !0;
2867
+ }
2868
+ function P(e, t, n = {
2869
+ path: [],
2870
+ schemaPath: []
2871
+ }) {
2872
+ var r;
2873
+ let i = e._zod.def, a = t.seen.get(e);
2874
+ if (a) return a.count++, n.schemaPath.includes(e) && (a.cycle = n.path), a.schema;
2875
+ let o = {
2876
+ schema: {},
2877
+ count: 1,
2878
+ cycle: void 0,
2879
+ path: n.path
2880
+ };
2881
+ t.seen.set(e, o), t.sharedDefsExtractedFor = void 0, t.sharedEmitDoneFor = void 0;
2882
+ let s = e._zod.toJSONSchema?.();
2883
+ if (s) o.schema = s;
2884
+ else {
2885
+ let r = {
2886
+ ...n,
2887
+ schemaPath: [...n.schemaPath, e],
2888
+ path: n.path
2889
+ };
2890
+ if (e._zod.processJSONSchema) e._zod.processJSONSchema(t, o.schema, r);
2891
+ else {
2892
+ let n = o.schema, a = t.processors[i.type];
2893
+ if (!a) throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);
2894
+ a(e, t, n, r);
2895
+ }
2896
+ let a = e._zod.parent;
2897
+ a && (o.ref ||= a, P(a, t, r), t.seen.get(a).isParent = !0);
2898
+ }
2899
+ let c = t.metadataRegistry.get(e);
2900
+ return c && ra(o.schema, c), t.io === "input" && F(e) && (delete o.schema.examples, delete o.schema.default), t.io === "input" && "_prefault" in o.schema && ((r = o.schema).default ?? (r.default = o.schema._prefault)), delete o.schema._prefault, t.seen.get(e).schema;
2901
+ }
2902
+ function aa(e) {
2903
+ return e.replace(/~/g, "~0").replace(/\//g, "~1");
2904
+ }
2905
+ function oa(e, t) {
2906
+ let n = e.seen.get(t);
2907
+ if (!n) throw Error("Unprocessed schema. This is a bug in Zod.");
2908
+ if (e.external && e.sharedDefsExtractedFor === e.external) return;
2909
+ let r = /* @__PURE__ */ new Map();
2910
+ for (let t of e.seen.entries()) {
2911
+ let n = e.metadataRegistry.get(t[0])?.id;
2912
+ if (n) {
2913
+ let e = r.get(n);
2914
+ if (e && e !== t[0]) throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
2915
+ r.set(n, t[0]);
2916
+ }
2917
+ }
2918
+ let i = (t) => {
2919
+ let r = e.target === "draft-2020-12" ? "$defs" : "definitions";
2920
+ if (e.external) {
2921
+ let n = e.external.registry.get(t[0])?.id, i = e.external.uri ?? ((e) => e);
2922
+ if (n) return { ref: i(n) };
2923
+ let a = t[1].defId ?? t[1].schema.id ?? `schema${e.counter++}`;
2924
+ return t[1].defId = a, {
2925
+ defId: a,
2926
+ ref: `${i("__shared")}#/${r}/${aa(a)}`
2927
+ };
2928
+ }
2929
+ let i = `#/${r}/`;
2930
+ if (t[1] === n && !t[1].schema.id) return { ref: "#" };
2931
+ let a = t[1].schema.id ?? `__schema${e.counter++}`;
2932
+ return {
2933
+ defId: a,
2934
+ ref: i + aa(a)
2935
+ };
2936
+ }, a = (e) => {
2937
+ if (e[1].schema.$ref) return;
2938
+ let t = e[1], { ref: n, defId: r } = i(e);
2939
+ t.def = { ...t.schema }, r && (t.defId = r);
2940
+ let a = t.schema;
2941
+ for (let e in a) delete a[e];
2942
+ a.$ref = n;
2943
+ };
2944
+ if (e.cycles === "throw") for (let t of e.seen.entries()) {
2945
+ let e = t[1];
2946
+ if (e.cycle) throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
2947
+
2948
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
2949
+ }
2950
+ for (let n of e.seen.entries()) {
2951
+ let r = n[1];
2952
+ if (t === n[0]) {
2953
+ a(n);
2954
+ continue;
2955
+ }
2956
+ if (e.external) {
2957
+ let r = e.external.registry.get(n[0])?.id;
2958
+ if (t !== n[0] && r) {
2959
+ a(n);
2960
+ continue;
2961
+ }
2962
+ }
2963
+ if (e.metadataRegistry.get(n[0])?.id) {
2964
+ a(n);
2965
+ continue;
2966
+ }
2967
+ if (r.cycle) {
2968
+ a(n);
2969
+ continue;
2970
+ }
2971
+ if (r.count > 1 && e.reused === "ref") {
2972
+ a(n);
2973
+ continue;
2974
+ }
2975
+ }
2976
+ e.external && (e.sharedDefsExtractedFor = e.external);
2977
+ }
2978
+ function sa(e) {
2979
+ let t = e.anyOf;
2980
+ if (!Array.isArray(t) || t.length === 0 || e.type !== void 0) return;
2981
+ let n = [];
2982
+ for (let e of t) {
2983
+ if (!e || typeof e != "object") return;
2984
+ sa(e);
2985
+ let t = Object.keys(e);
2986
+ if (t.length !== 1 || t[0] !== "type") return;
2987
+ let r = e.type;
2988
+ for (let e of Array.isArray(r) ? r : [r]) {
2989
+ if (typeof e != "string") return;
2990
+ n.includes(e) || n.push(e);
2991
+ }
2992
+ }
2993
+ delete e.anyOf, e.type = n.length === 1 ? n[0] : n;
2994
+ }
2995
+ var ca = /* @__PURE__ */ new Set([
2996
+ "type",
2997
+ "properties",
2998
+ "required",
2999
+ "additionalProperties"
3000
+ ]), la = ["oneOf", "anyOf"];
3001
+ function ua(e) {
3002
+ let t = e.additionalProperties;
3003
+ return t === void 0 || t === !1 || typeof t != "object" || !t ? null : Object.keys(t).length ? t : null;
3004
+ }
3005
+ function da(e) {
3006
+ let t = [];
3007
+ for (let n of e) {
3008
+ if (typeof n != "object" || n.type !== "object") return null;
3009
+ for (let e in n) if (!ca.has(e)) return null;
3010
+ t.push(n);
3011
+ }
3012
+ let n = {}, r = /* @__PURE__ */ new Set();
3013
+ for (let e of t) {
3014
+ for (let r in e.properties) {
3015
+ if (Object.prototype.hasOwnProperty.call(n, r)) continue;
3016
+ let e = [];
3017
+ for (let n of t) {
3018
+ let t = n.properties?.[r] ?? ua(n);
3019
+ t != null && (e.some((e) => JSON.stringify(e) === JSON.stringify(t)) || e.push(t));
3020
+ }
3021
+ l(n, r, e.length === 1 ? e[0] : da(e) ?? { allOf: e });
3022
+ }
3023
+ for (let t of e.required ?? []) r.add(t);
3024
+ }
3025
+ let i = {
3026
+ type: "object",
3027
+ properties: n
3028
+ };
3029
+ if (r.size && (i.required = [...r]), t.every((e) => e.additionalProperties === !1)) i.additionalProperties = !1;
3030
+ else {
3031
+ let e = [];
3032
+ for (let n of t) {
3033
+ let t = ua(n);
3034
+ t && !e.some((e) => JSON.stringify(e) === JSON.stringify(t)) && e.push(t);
3035
+ }
3036
+ e.length === 1 ? i.additionalProperties = e[0] : e.length > 1 && (i.additionalProperties = { allOf: e });
3037
+ }
3038
+ return i;
3039
+ }
3040
+ function fa(e) {
3041
+ let t = e.allOf;
3042
+ if (!Array.isArray(t) || t.length < 2) return;
3043
+ for (let t of ca) if (t in e) return;
3044
+ let n = t.filter((e) => la.some((t) => Array.isArray(e[t]))), r = null;
3045
+ if (!n.length) r = da(t);
3046
+ else {
3047
+ let e = n[0], i = la.find((t) => Array.isArray(e[t]));
3048
+ if (Object.keys(e).length !== 1) return;
3049
+ let a = t.filter((t) => t !== e), o = e[i].map((e) => da([...a, e]));
3050
+ if (o.some((e) => !e)) return;
3051
+ r = { [i]: o };
3052
+ }
3053
+ r && (delete e.allOf, ra(e, r));
3054
+ }
3055
+ function pa(e, t) {
3056
+ let n = e.seen.get(t);
3057
+ if (!n) throw Error("Unprocessed schema. This is a bug in Zod.");
3058
+ let r = (t) => {
3059
+ let n = e.seen.get(t);
3060
+ if (n.ref === null) return;
3061
+ let i = n.def ?? n.schema, a = { ...i }, o = n.ref;
3062
+ if (n.ref = null, o) {
3063
+ r(o);
3064
+ let n = e.seen.get(o), s = n.schema;
3065
+ if (s.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (i.allOf = i.allOf ?? [], i.allOf.push(s)) : ra(i, s), ra(i, a), t._zod.parent === o) for (let e in i) e !== "$ref" && e !== "allOf" && (e in a || delete i[e]);
3066
+ if (s.$ref && n.def) for (let e in i) e !== "$ref" && e !== "allOf" && e in n.def && JSON.stringify(i[e]) === JSON.stringify(n.def[e]) && delete i[e];
3067
+ }
3068
+ let s = t._zod.parent;
3069
+ if (s && s !== o) {
3070
+ r(s);
3071
+ let t = e.seen.get(s);
3072
+ if (t?.schema.$ref && (i.$ref = t.schema.$ref, t.def)) for (let e in i) e !== "$ref" && e !== "allOf" && e in t.def && JSON.stringify(i[e]) === JSON.stringify(t.def[e]) && delete i[e];
3073
+ }
3074
+ e.override({
3075
+ zodSchema: t,
3076
+ jsonSchema: i,
3077
+ path: n.path ?? []
3078
+ });
3079
+ };
3080
+ if (!e.external || e.sharedEmitDoneFor !== e.external) {
3081
+ for (let t of [...e.seen.entries()].reverse()) r(t[0]);
3082
+ if (e.target !== "openapi-3.0") for (let t of e.seen.entries()) sa(t[1].def ?? t[1].schema);
3083
+ for (let t of e.deferred) t();
3084
+ if (e.intersections.length) {
3085
+ let t = /* @__PURE__ */ new Map();
3086
+ for (let n of e.seen.values()) for (let e of [n.schema, n.def]) {
3087
+ let n = e?.allOf;
3088
+ if (!Array.isArray(n)) continue;
3089
+ let r = t.get(n);
3090
+ r ? r.push(e) : t.set(n, [e]);
3091
+ }
3092
+ for (let n of e.intersections) for (let e of t.get(n) ?? []) fa(e);
3093
+ }
3094
+ }
3095
+ let i = {};
3096
+ if (e.target === "draft-2020-12" ? i.$schema = "https://json-schema.org/draft/2020-12/schema" : e.target === "draft-07" ? i.$schema = "http://json-schema.org/draft-07/schema#" : e.target === "draft-04" ? i.$schema = "http://json-schema.org/draft-04/schema#" : e.target, e.external?.uri) {
3097
+ let n = e.external.registry.get(t)?.id;
3098
+ if (!n) throw Error("Schema is missing an `id` property");
3099
+ i.$id = e.external.uri(n);
3100
+ }
3101
+ ra(i, n.defId ? n.schema : n.def ?? n.schema);
3102
+ let a = e.metadataRegistry.get(t)?.id;
3103
+ a !== void 0 && i.id === a && delete i.id;
3104
+ let o = e.external?.defs ?? {};
3105
+ if (!e.external || e.sharedEmitDoneFor !== e.external) for (let t of e.seen.entries()) {
3106
+ let e = t[1];
3107
+ e.def && e.defId && (e.def.id === e.defId && delete e.def.id, l(o, e.defId, e.def));
3108
+ }
3109
+ e.external && (e.sharedEmitDoneFor = e.external), e.external || Object.keys(o).length > 0 && (e.target === "draft-2020-12" ? i.$defs = o : i.definitions = o);
3110
+ try {
3111
+ let n = JSON.parse(JSON.stringify(i));
3112
+ return Object.defineProperty(n, "~standard", {
3113
+ value: {
3114
+ ...t["~standard"],
3115
+ jsonSchema: {
3116
+ input: ha(t, "input", e.processors),
3117
+ output: ha(t, "output", e.processors)
3118
+ }
3119
+ },
3120
+ enumerable: !1,
3121
+ writable: !1
3122
+ }), n;
3123
+ } catch {
3124
+ throw Error("Error converting schema to JSON.");
3125
+ }
3126
+ }
3127
+ function F(e, t) {
3128
+ let n = t ?? { seen: /* @__PURE__ */ new Set() };
3129
+ if (n.seen.has(e)) return !1;
3130
+ n.seen.add(e);
3131
+ let r = e._zod.def;
3132
+ if (r.type === "transform") return !0;
3133
+ if (r.type === "array") return F(r.element, n);
3134
+ if (r.type === "set") return F(r.valueType, n);
3135
+ if (r.type === "lazy") return F(r.getter(), n);
3136
+ if (r.type === "promise" || r.type === "optional" || r.type === "nonoptional" || r.type === "nullable" || r.type === "readonly" || r.type === "default" || r.type === "prefault" || r.type === "catch") return F(r.innerType, n);
3137
+ if (r.type === "intersection") return F(r.left, n) || F(r.right, n);
3138
+ if (r.type === "record" || r.type === "map") return F(r.keyType, n) || F(r.valueType, n);
3139
+ if (r.type === "pipe") return e._zod.traits.has("$ZodCodec") ? !0 : F(r.in, n) || F(r.out, n);
3140
+ if (r.type === "object") {
3141
+ for (let e in r.shape) if (F(r.shape[e], n)) return !0;
3142
+ return !1;
3143
+ }
3144
+ if (r.type === "union") {
3145
+ for (let e of r.options) if (F(e, n)) return !0;
3146
+ return !1;
3147
+ }
3148
+ if (r.type === "tuple") {
3149
+ for (let e of r.items) if (F(e, n)) return !0;
3150
+ return !!(r.rest && F(r.rest, n));
3151
+ }
3152
+ return !1;
3153
+ }
3154
+ var ma = (e, t = {}) => (n) => {
3155
+ let r = ia({
3156
+ ...n,
3157
+ processors: t
3158
+ });
3159
+ return P(e, r), oa(r, e), pa(r, e);
3160
+ }, ha = (e, t, n = {}) => (r) => {
3161
+ let { libraryOptions: i, target: a } = r ?? {}, o = ia({
3162
+ ...i ?? {},
3163
+ target: a,
3164
+ io: t,
3165
+ processors: n
3166
+ });
3167
+ return P(e, o), oa(o, e), pa(o, e);
3168
+ }, ga = {
3169
+ guid: "uuid",
3170
+ url: "uri",
3171
+ datetime: "date-time",
3172
+ json_string: "json-string",
3173
+ regex: ""
3174
+ }, _a = (e, t, n, r) => {
3175
+ let i = n;
3176
+ i.type = "string";
3177
+ let { minimum: a, maximum: o, format: s, patterns: c, contentEncoding: l, laxFormat: u } = e._zod.bag;
3178
+ if (typeof a == "number" && (i.minLength = a), typeof o == "number" && (i.maxLength = o), s && (i.format = ga[s] ?? s, i.format === "" && delete i.format, (s === "time" || u) && delete i.format), l && (i.contentEncoding = l), c && c.size > 0) {
3179
+ let e = [...c];
3180
+ e.length === 1 ? i.pattern = e[0].source : e.length > 1 && (i.allOf = [...e.map((e) => ({
3181
+ ...t.target === "draft-07" || t.target === "draft-04" || t.target === "openapi-3.0" ? { type: "string" } : {},
3182
+ pattern: e.source
3183
+ }))]);
3184
+ }
3185
+ }, va = (e, t, n, r) => {
3186
+ let i = n, { minimum: a, maximum: o, format: s, multipleOf: c, exclusiveMaximum: l, exclusiveMinimum: u } = e._zod.bag;
3187
+ i.type = typeof s == "string" && s.includes("int") ? "integer" : "number";
3188
+ let d = typeof u == "number" && u >= (a ?? -Infinity), f = typeof l == "number" && l <= (o ?? Infinity), p = t.target === "draft-04" || t.target === "openapi-3.0";
3189
+ d ? p ? (i.minimum = u, i.exclusiveMinimum = !0) : i.exclusiveMinimum = u : typeof a == "number" && (i.minimum = a), f ? p ? (i.maximum = l, i.exclusiveMaximum = !0) : i.exclusiveMaximum = l : typeof o == "number" && (i.maximum = o), typeof c == "number" && (Number.isFinite(c) && c !== 0 ? i.multipleOf = Math.abs(c) : N(e, t, i, r, `A multipleOf divisor of ${c} cannot be represented in JSON Schema`));
3190
+ }, ya = (e, t, n, r) => {
3191
+ n.type = "boolean";
3192
+ }, ba = (e, t, n, r) => {
3193
+ t.target === "openapi-3.0" ? (n.type = "string", n.nullable = !0, n.enum = [null]) : n.type = "null";
3194
+ }, xa = (e, t, n, r) => {
3195
+ n.not = {};
3196
+ }, Sa = (t, n, r, i) => {
3197
+ let a = t._zod.def, o = e(a.entries);
3198
+ if (o.length === 0) {
3199
+ r.not = {};
3200
+ return;
3201
+ }
3202
+ o.every((e) => typeof e == "number") && (r.type = "number"), o.every((e) => typeof e == "string") && (r.type = "string"), r.enum = o;
3203
+ }, Ca = (e, t, n, r) => {
3204
+ let i = e._zod.def;
3205
+ if (i.values.length === 0) {
3206
+ n.not = {};
3207
+ return;
3208
+ }
3209
+ let a = [];
3210
+ for (let o of i.values) if (o === void 0) {
3211
+ if (N(e, t, n, r, "Literal `undefined` cannot be represented in JSON Schema")) return;
3212
+ } else if (typeof o == "bigint") {
3213
+ if (N(e, t, n, r, "BigInt literals cannot be represented in JSON Schema")) return;
3214
+ a.push(Number(o));
3215
+ } else a.push(o);
3216
+ if (a.length !== 0) {
3217
+ if (a.length === 1) {
3218
+ let e = a[0];
3219
+ n.type = e === null ? "null" : typeof e, t.target === "draft-04" || t.target === "openapi-3.0" ? n.enum = [e] : n.const = e;
3220
+ } else a.every((e) => typeof e == "number") && (n.type = "number"), a.every((e) => typeof e == "string") && (n.type = "string"), a.every((e) => typeof e == "boolean") && (n.type = "boolean"), a.every((e) => e === null) && (n.type = "null"), n.enum = a;
3221
+ }
3222
+ }, wa = (e, t, n, r) => {
3223
+ N(e, t, n, r, "Custom types cannot be represented in JSON Schema");
3224
+ }, Ta = (e, t, n, r) => {
3225
+ N(e, t, n, r, "Transforms cannot be represented in JSON Schema");
3226
+ }, Ea = (e, t, n, r) => {
3227
+ let i = n, a = e._zod.def, { minimum: o, maximum: s } = e._zod.bag;
3228
+ typeof o == "number" && (i.minItems = o), typeof s == "number" && (i.maxItems = s), i.type = "array", i.items = P(a.element, t, {
3229
+ ...r,
3230
+ path: [...r.path, "items"]
3231
+ });
3232
+ };
3233
+ function Da(e) {
3234
+ let t = e._zod.def;
3235
+ return t.type === "pipe" && t.in._zod.traits.has("$ZodTransform") ? Da(t.out) : t.type === "catch" ? Da(t.innerType) : e._zod.optin;
3236
+ }
3237
+ var Oa = (e, t, n, r) => {
3238
+ let i = n, a = e._zod.def, o = a.shape;
3239
+ if (Object.getOwnPropertySymbols(o).length && N(e, t, i, r, "Symbol keys cannot be represented in JSON Schema")) return;
3240
+ i.type = "object", i.properties = {};
3241
+ for (let e in o) l(i.properties, e, P(o[e], t, {
3242
+ ...r,
3243
+ path: [
3244
+ ...r.path,
3245
+ "properties",
3246
+ e
3247
+ ]
3248
+ }));
3249
+ let s = new Set(Object.keys(o)), c = new Set([...s].filter((e) => {
3250
+ let n = a.shape[e];
3251
+ return t.io === "input" ? Da(n) === void 0 : n._zod.optout === void 0;
3252
+ }));
3253
+ c.size > 0 && (i.required = Array.from(c)), a.catchall?._zod.def.type === "never" ? i.additionalProperties = !1 : a.catchall ? a.catchall && (i.additionalProperties = P(a.catchall, t, {
3254
+ ...r,
3255
+ path: [...r.path, "additionalProperties"]
3256
+ })) : t.io === "output" && (i.additionalProperties = !1);
3257
+ }, ka = (e, t, n, r) => {
3258
+ let i = e._zod.def, a = i.inclusive === !1, o = i.options.map((e, n) => P(e, t, {
3259
+ ...r,
3260
+ path: [
3261
+ ...r.path,
3262
+ a ? "oneOf" : "anyOf",
3263
+ n
3264
+ ]
3265
+ }));
3266
+ a ? n.oneOf = o : n.anyOf = o;
3267
+ }, Aa = (e, t, n, r) => {
3268
+ let i = e._zod.def, a = P(i.left, t, {
3269
+ ...r,
3270
+ path: [
3271
+ ...r.path,
3272
+ "allOf",
3273
+ 0
3274
+ ]
3275
+ }), o = P(i.right, t, {
3276
+ ...r,
3277
+ path: [
3278
+ ...r.path,
3279
+ "allOf",
3280
+ 1
3281
+ ]
3282
+ }), s = (e) => "allOf" in e && Object.keys(e).length === 1, c = [...s(a) ? a.allOf : [a], ...s(o) ? o.allOf : [o]];
3283
+ n.allOf = c, t.intersections.push(c);
3284
+ }, ja = (e, t, n, r) => {
3285
+ let i = n, a = e._zod.def;
3286
+ i.type = "array";
3287
+ let o = t.target === "draft-2020-12" ? "prefixItems" : "items", s = t.target === "draft-2020-12" || t.target === "openapi-3.0" ? "items" : "additionalItems", c = a.items.map((e, n) => P(e, t, {
3288
+ ...r,
3289
+ path: [
3290
+ ...r.path,
3291
+ o,
3292
+ n
3293
+ ]
3294
+ })), l = a.rest ? P(a.rest, t, {
3295
+ ...r,
3296
+ path: [
3297
+ ...r.path,
3298
+ s,
3299
+ ...t.target === "openapi-3.0" ? [a.items.length] : []
3300
+ ]
3301
+ }) : null, u = a.items.length;
3302
+ for (; u > 0;) {
3303
+ let e = a.items[u - 1];
3304
+ if (!(t.io === "input" ? Da(e) !== void 0 : e._zod.optout === "optional")) break;
3305
+ u--;
3306
+ }
3307
+ let d = a.items.length, f = !a.rest;
3308
+ t.target === "draft-2020-12" ? (i.prefixItems = c, f ? i.items = !1 : l && (i.items = l), u > 0 && (i.minItems = u), f && (i.maxItems = d)) : t.target === "openapi-3.0" ? (i.items = { anyOf: c }, l && i.items.anyOf.push(l), u > 0 && (i.minItems = u), f && (i.maxItems = d)) : (i.items = c, f ? i.additionalItems = !1 : l && (i.additionalItems = l), u > 0 && (i.minItems = u), f && (i.maxItems = d));
3309
+ let { minimum: p, maximum: m } = e._zod.bag;
3310
+ typeof p == "number" && (i.minItems = p), typeof m == "number" && (i.maxItems = m);
3311
+ };
3312
+ function Ma(e, t, n) {
3313
+ if (t.$ref) {
3314
+ if (n.has(t)) return t;
3315
+ n.add(t);
3316
+ let r = e.get(t)?.def;
3317
+ if (!r) return t;
3318
+ let i = Ma(e, r, n);
3319
+ return i === r ? t : i;
3320
+ }
3321
+ for (let r of ["anyOf", "oneOf"]) {
3322
+ let i = t[r];
3323
+ if (!Array.isArray(i)) continue;
3324
+ let a = i.map((t) => Ma(e, t, n));
3325
+ a.some((e, t) => e !== i[t]) && (t = {
3326
+ ...t,
3327
+ [r]: a
3328
+ });
3329
+ }
3330
+ let r = Array.isArray(t.type) ? t.type : [t.type], i = !r.includes("string") && r.some((e) => e === "number" || e === "integer"), a = t.enum ?? (t.const === void 0 ? void 0 : [t.const]);
3331
+ if (!i && !a?.some((e) => typeof e == "number")) return t;
3332
+ let { minimum: o, maximum: s, exclusiveMinimum: c, exclusiveMaximum: l, multipleOf: u, format: d, id: f, ...p } = t;
3333
+ return p.enum ? p.enum = p.enum.map((e) => typeof e == "number" ? String(e) : e) : typeof p.const == "number" && (p.const = String(p.const)), i ? (p.type = "string", a || (p.pattern = (r.includes("number") ? Lt : It).source), p) : p;
3334
+ }
3335
+ var Na = /* @__PURE__ */ new WeakMap();
3336
+ function Pa(e) {
3337
+ let t = /* @__PURE__ */ new Map();
3338
+ for (let n of e.seen.values()) n.def && !t.has(n.schema) && t.set(n.schema, n);
3339
+ let n = /* @__PURE__ */ new Map();
3340
+ for (let r of Na.get(e) ?? []) {
3341
+ let i = e.seen.get(r), a = (i?.def ?? i?.schema)?.propertyNames;
3342
+ if (!a || a === !0 || n.has(a)) continue;
3343
+ let o = Ma(t, a, /* @__PURE__ */ new Set());
3344
+ o !== a && n.set(a, o);
3345
+ }
3346
+ if (n.size) for (let t of e.seen.values()) for (let e of [t.schema, t.def]) {
3347
+ let t = e && n.get(e.propertyNames);
3348
+ t && (e.propertyNames = t);
3349
+ }
3350
+ }
3351
+ var Fa = (e, t, n, r) => {
3352
+ let i = n, a = e._zod.def;
3353
+ i.type = "object";
3354
+ let o = a.keyType, s = o._zod.bag?.patterns;
3355
+ if (a.mode === "loose" && s && s.size > 0) {
3356
+ let e = P(a.valueType, t, {
3357
+ ...r,
3358
+ path: [
3359
+ ...r.path,
3360
+ "patternProperties",
3361
+ "*"
3362
+ ]
3363
+ });
3364
+ i.patternProperties = {};
3365
+ for (let t of s) l(i.patternProperties, t.source, e);
3366
+ } else {
3367
+ if (t.target === "draft-07" || t.target === "draft-2020-12") {
3368
+ i.propertyNames = P(a.keyType, t, {
3369
+ ...r,
3370
+ path: [...r.path, "propertyNames"]
3371
+ });
3372
+ let n = Na.get(t);
3373
+ n || (n = [], Na.set(t, n), t.deferred.push(() => Pa(t))), n.push(e);
3374
+ }
3375
+ i.additionalProperties = P(a.valueType, t, {
3376
+ ...r,
3377
+ path: [...r.path, "additionalProperties"]
3378
+ });
3379
+ }
3380
+ let c = o._zod.values, u = t.io === "input" && Da(a.valueType) !== void 0;
3381
+ if (c && !a.partial && !u) {
3382
+ let e = [...c].filter((e) => typeof e == "string" || typeof e == "number");
3383
+ e.length > 0 && (i.required = e.map(String));
3384
+ }
3385
+ }, Ia = (e, t, n, r) => {
3386
+ let i = e._zod.def, a = P(i.innerType, t, r), o = t.seen.get(e);
3387
+ t.target === "openapi-3.0" ? (o.ref = i.innerType, n.nullable = !0) : n.anyOf = [a, { type: "null" }];
3388
+ }, La = (e, t, n, r) => {
3389
+ let i = e._zod.def;
3390
+ P(i.innerType, t, r);
3391
+ let a = t.seen.get(e);
3392
+ a.ref = i.innerType;
3393
+ }, Ra = Symbol();
3394
+ function za(e, t, n, r, i) {
3395
+ let a = !1, o = JSON.stringify(e, (e, t) => typeof t == "bigint" ? (a = !0, null) : t);
3396
+ return a ? (N(t, n, r, i, "BigInt defaults cannot be represented in JSON Schema"), Ra) : JSON.parse(o);
3397
+ }
3398
+ var Ba = (e, t, n, r) => {
3399
+ let i = e._zod.def;
3400
+ P(i.innerType, t, r);
3401
+ let a = t.seen.get(e);
3402
+ a.ref = i.innerType;
3403
+ let o = za(i.defaultValue, e, t, n, r);
3404
+ o !== Ra && (n.default = o);
3405
+ }, Va = (e, t, n, r) => {
3406
+ let i = e._zod.def;
3407
+ P(i.innerType, t, r);
3408
+ let a = t.seen.get(e);
3409
+ if (a.ref = i.innerType, t.io !== "input") return;
3410
+ let o = za(i.defaultValue, e, t, n, r);
3411
+ o !== Ra && (n._prefault = o);
3412
+ }, Ha = (e, t, n, r) => {
3413
+ let i = e._zod.def;
3414
+ P(i.innerType, t, r);
3415
+ let a = t.seen.get(e);
3416
+ a.ref = i.innerType;
3417
+ let o;
3418
+ try {
3419
+ o = i.catchValue(void 0);
3420
+ } catch {
3421
+ N(e, t, n, r, "Dynamic catch values are not supported in JSON Schema");
3422
+ return;
3423
+ }
3424
+ n.default = o;
3425
+ }, Ua = (e, t, n, r) => {
3426
+ let i = e._zod.def, a = i.in._zod.traits.has("$ZodTransform"), o = t.io === "input" ? a ? i.out : i.in : i.out;
3427
+ P(o, t, r);
3428
+ let s = t.seen.get(e);
3429
+ s.ref = o;
3430
+ }, Wa = (e, t, n, r) => {
3431
+ let i = e._zod.def;
3432
+ P(i.innerType, t, r);
3433
+ let a = t.seen.get(e);
3434
+ a.ref = i.innerType, n.readOnly = !0;
3435
+ }, Ga = (e, t, n, r) => {
3436
+ let i = e._zod.def;
3437
+ P(i.innerType, t, r);
3438
+ let a = t.seen.get(e);
3439
+ a.ref = i.innerType;
3440
+ }, Ka = (e, t, n, r) => {
3441
+ let i = e._zod.innerType;
3442
+ P(i, t, r);
3443
+ let a = t.seen.get(e);
3444
+ a.ref = i;
3445
+ }, qa = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
3446
+ function Ja(e, t, n) {
3447
+ Object.defineProperty(e, t, {
3448
+ configurable: !0,
3449
+ enumerable: !1,
3450
+ get() {
3451
+ let e = n(this);
3452
+ return Object.defineProperty(this, t, {
3453
+ value: e,
3454
+ configurable: !0,
3455
+ writable: !0
3456
+ }), e;
3457
+ },
3458
+ set(e) {
3459
+ Object.defineProperty(this, t, {
3460
+ value: e,
3461
+ configurable: !0,
3462
+ writable: !0
3463
+ });
3464
+ }
3465
+ });
3466
+ }
3467
+ var I = /*@__PURE__*/ T("ZodError", (e, t) => {
3468
+ He.init(e, t), e.name = "ZodError";
3469
+ let r = Object.getPrototypeOf(e);
3470
+ qa.has(r) || (qa.add(r), Ja(r, "format", (e) => (t) => Ke(e, t)), Ja(r, "flatten", (e) => (t) => Ge(e, t)), Ja(r, "addIssue", (e) => (t) => {
3471
+ e.issues.push(t), e.message = JSON.stringify(e.issues, n, 2);
3472
+ }), Ja(r, "addIssues", (e) => (t) => {
3473
+ e.issues.push(...t), e.message = JSON.stringify(e.issues, n, 2);
3474
+ }), Object.defineProperty(r, "isEmpty", {
3475
+ configurable: !0,
3476
+ enumerable: !1,
3477
+ get() {
3478
+ return this.issues.length === 0;
3479
+ }
3480
+ }));
3481
+ }, void 0, { Parent: Error }), Ya = /* @__PURE__ */ Je(I), Xa = /* @__PURE__ */ Ye(I), Za = /* @__PURE__ */ Xe(I), Qa = /* @__PURE__ */ Qe(I), $a = /* @__PURE__ */ et(I), eo = /* @__PURE__ */ tt(I), to = /* @__PURE__ */ nt(I), no = /* @__PURE__ */ rt(I), ro = /* @__PURE__ */ it(I), io = /* @__PURE__ */ at(I), ao = /* @__PURE__ */ ot(I), oo = /* @__PURE__ */ st(I);
3482
+ //#endregion
3483
+ //#region ../../node_modules/.bun/zod@4.5.4/node_modules/zod/v4/classic/schemas.js
3484
+ function so() {
3485
+ D.localeError || O(Xr());
3486
+ }
3487
+ function co() {
3488
+ D.memoizer || O({ memoizer: qr() });
3489
+ }
3490
+ var L = /*@__PURE__*/ T("ZodType", (e, t) => (so(), A.init(e, t), e.def = t, e.type = t.type, e), {
3491
+ check(...e) {
3492
+ let t = this.def;
3493
+ return this.clone(u(t, { checks: [...t.checks ?? [], ...e.map((e) => typeof e == "function" ? { _zod: {
3494
+ check: e,
3495
+ def: { check: "custom" },
3496
+ onattach: []
3497
+ } } : e)] }), { parent: !0 });
3498
+ },
3499
+ with(...e) {
3500
+ return this.check(...e);
3501
+ },
3502
+ clone(e, t) {
3503
+ return _(this, e, t);
3504
+ },
3505
+ brand() {
3506
+ return this;
3507
+ },
3508
+ register(e, t) {
3509
+ return e.add(this, t), this;
3510
+ },
3511
+ refine(e, t) {
3512
+ return this.check(Ts(e, t));
3513
+ },
3514
+ superRefine(e, t) {
3515
+ return this.check(Es(e, t));
3516
+ },
3517
+ overwrite(e) {
3518
+ return this.check(/* @__PURE__ */ M(e));
3519
+ },
3520
+ optional() {
3521
+ return as(this);
3522
+ },
3523
+ exactOptional() {
3524
+ return ss(this);
3525
+ },
3526
+ nullable() {
3527
+ return ls(this);
3528
+ },
3529
+ nullish() {
3530
+ return as(ls(this));
3531
+ },
3532
+ nonoptional(e) {
3533
+ return hs(this, e);
3534
+ },
3535
+ array() {
3536
+ return V(this);
3537
+ },
3538
+ or(e) {
3539
+ return U([this, e]);
3540
+ },
3541
+ and(e) {
3542
+ return Xo(this, e);
3543
+ },
3544
+ transform(e) {
3545
+ return ys(this, rs(e));
3546
+ },
3547
+ default(e) {
3548
+ return ds(this, e);
3549
+ },
3550
+ prefault(e) {
3551
+ return ps(this, e);
3552
+ },
3553
+ catch(e) {
3554
+ return _s(this, e);
3555
+ },
3556
+ pipe(e) {
3557
+ return ys(this, e);
3558
+ },
3559
+ readonly() {
3560
+ return xs(this);
3561
+ },
3562
+ describe(e) {
3563
+ let t = this.clone();
3564
+ return ei.add(t, { description: e }), t;
3565
+ },
3566
+ meta(...e) {
3567
+ if (e.length === 0) return ei.get(this);
3568
+ let t = this.clone();
3569
+ return ei.add(t, e[0]), t;
3570
+ },
3571
+ isOptional() {
3572
+ return this.safeParse(void 0).success;
3573
+ },
3574
+ isNullable() {
3575
+ return this.safeParse(null).success;
3576
+ },
3577
+ apply(e, ...t) {
3578
+ return t.length === 0 ? e(this) : e(this, ...t);
3579
+ },
3580
+ get "~standard"() {
3581
+ return Se(this, "~standard", {
3582
+ ...ln(this),
3583
+ jsonSchema: {
3584
+ input: ha(this, "input"),
3585
+ output: ha(this, "output")
3586
+ }
3587
+ });
3588
+ },
3589
+ set "~standard"(e) {
3590
+ S(this, "~standard", e);
3591
+ },
3592
+ parse: function e(t, n) {
3593
+ return Ya(this, t, n, { callee: e });
3594
+ },
3595
+ parseAsync: async function e(t, n) {
3596
+ return await Xa(this, t, n, { callee: e });
3597
+ },
3598
+ safeParse(e, t) {
3599
+ return Za(this, e, t);
3600
+ },
3601
+ async safeParseAsync(e, t) {
3602
+ return Qa(this, e, t);
3603
+ },
3604
+ get spa() {
3605
+ return this?.safeParseAsync;
3606
+ },
3607
+ set spa(e) {
3608
+ S(this, "spa", e);
3609
+ },
3610
+ encode: function e(t, n) {
3611
+ return $a(this, t, n, { callee: e });
3612
+ },
3613
+ decode: function e(t, n) {
3614
+ return eo(this, t, n, { callee: e });
3615
+ },
3616
+ encodeAsync: async function e(t, n) {
3617
+ return await to(this, t, n, { callee: e });
3618
+ },
3619
+ decodeAsync: async function e(t, n) {
3620
+ return await no(this, t, n, { callee: e });
3621
+ },
3622
+ safeEncode(e, t) {
3623
+ return ro(this, e, t);
3624
+ },
3625
+ safeDecode(e, t) {
3626
+ return io(this, e, t);
3627
+ },
3628
+ async safeEncodeAsync(e, t) {
3629
+ return ao(this, e, t);
3630
+ },
3631
+ async safeDecodeAsync(e, t) {
3632
+ return oo(this, e, t);
3633
+ },
3634
+ toJSONSchema(e) {
3635
+ return ma(this, {})(e);
3636
+ },
3637
+ get description() {
3638
+ return ei.get(this)?.description;
3639
+ },
3640
+ get _def() {
3641
+ return this._zod.def;
3642
+ }
3643
+ }), lo = /*@__PURE__*/ T("_ZodString", (e, t) => {
3644
+ un.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => _a(e, t, n, r);
3645
+ let n = e._zod.bag;
3646
+ e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null;
3647
+ }, {
3648
+ regex(...e) {
3649
+ return this.check(/* @__PURE__ */ Hi(...e));
3650
+ },
3651
+ includes(...e) {
3652
+ return this.check(/* @__PURE__ */ Gi(...e));
3653
+ },
3654
+ startsWith(...e) {
3655
+ return this.check(/* @__PURE__ */ Ki(...e));
3656
+ },
3657
+ endsWith(...e) {
3658
+ return this.check(/* @__PURE__ */ qi(...e));
3659
+ },
3660
+ min(...e) {
3661
+ return this.check(/* @__PURE__ */ Bi(...e));
3662
+ },
3663
+ max(...e) {
3664
+ return this.check(/* @__PURE__ */ zi(...e));
3665
+ },
3666
+ length(...e) {
3667
+ return this.check(/* @__PURE__ */ Vi(...e));
3668
+ },
3669
+ nonempty(...e) {
3670
+ return this.check(/* @__PURE__ */ Bi(1, ...e));
3671
+ },
3672
+ lowercase(e) {
3673
+ return this.check(/* @__PURE__ */ Ui(e));
3674
+ },
3675
+ uppercase(e) {
3676
+ return this.check(/* @__PURE__ */ Wi(e));
3677
+ },
3678
+ trim() {
3679
+ return this.check(/* @__PURE__ */ Yi());
3680
+ },
3681
+ normalize(...e) {
3682
+ return this.check(/* @__PURE__ */ Ji(...e));
3683
+ },
3684
+ toLowerCase() {
3685
+ return this.check(/* @__PURE__ */ Xi());
3686
+ },
3687
+ toUpperCase() {
3688
+ return this.check(/* @__PURE__ */ Zi());
3689
+ },
3690
+ slugify() {
3691
+ return this.check(/* @__PURE__ */ Qi());
3692
+ }
3693
+ }), uo = /*@__PURE__*/ T("ZodString", (e, t) => {
3694
+ un.init(e, t), lo.init(e, t);
3695
+ }, {
3696
+ email(e) {
3697
+ return this.check(/* @__PURE__ */ ni(_o, e));
3698
+ },
3699
+ url(e) {
3700
+ return this.check(/* @__PURE__ */ ci(bo, e));
3701
+ },
3702
+ jwt(e) {
3703
+ return this.check(/* @__PURE__ */ Ci(Fo, e));
3704
+ },
3705
+ emoji(e) {
3706
+ return this.check(/* @__PURE__ */ li(xo, e));
3707
+ },
3708
+ guid(e) {
3709
+ return this.check(/* @__PURE__ */ ri(vo, e));
3710
+ },
3711
+ uuid(e) {
3712
+ return this.check(/* @__PURE__ */ ii(yo, e));
3713
+ },
3714
+ uuidv4(e) {
3715
+ return this.check(/* @__PURE__ */ ai(yo, e));
3716
+ },
3717
+ uuidv6(e) {
3718
+ return this.check(/* @__PURE__ */ oi(yo, e));
3719
+ },
3720
+ uuidv7(e) {
3721
+ return this.check(/* @__PURE__ */ si(yo, e));
3722
+ },
3723
+ nanoid(e) {
3724
+ return this.check(/* @__PURE__ */ ui(So, e));
3725
+ },
3726
+ cuid(e) {
3727
+ return this.check(/* @__PURE__ */ di(Co, e));
3728
+ },
3729
+ cuid2(e) {
3730
+ return this.check(/* @__PURE__ */ fi(wo, e));
3731
+ },
3732
+ ulid(e) {
3733
+ return this.check(/* @__PURE__ */ pi(To, e));
3734
+ },
3735
+ base64(e) {
3736
+ return this.check(/* @__PURE__ */ bi(Mo, e));
3737
+ },
3738
+ base64url(e) {
3739
+ return this.check(/* @__PURE__ */ xi(No, e));
3740
+ },
3741
+ xid(e) {
3742
+ return this.check(/* @__PURE__ */ mi(Eo, e));
3743
+ },
3744
+ ksuid(e) {
3745
+ return this.check(/* @__PURE__ */ hi(Do, e));
3746
+ },
3747
+ ipv4(e) {
3748
+ return this.check(/* @__PURE__ */ gi(Oo, e));
3749
+ },
3750
+ ipv6(e) {
3751
+ return this.check(/* @__PURE__ */ _i(ko, e));
3752
+ },
3753
+ cidrv4(e) {
3754
+ return this.check(/* @__PURE__ */ vi(Ao, e));
3755
+ },
3756
+ cidrv6(e) {
3757
+ return this.check(/* @__PURE__ */ yi(jo, e));
3758
+ },
3759
+ e164(e) {
3760
+ return this.check(/* @__PURE__ */ Si(Po, e));
3761
+ },
3762
+ datetime(e) {
3763
+ return this.check(/* @__PURE__ */ wi(po, e));
3764
+ },
3765
+ date(e) {
3766
+ return this.check(/* @__PURE__ */ Ti(mo, e));
3767
+ },
3768
+ time(e) {
3769
+ return this.check(/* @__PURE__ */ Ei(ho, e));
3770
+ },
3771
+ duration(e) {
3772
+ return this.check(/* @__PURE__ */ Di(go, e));
3773
+ }
3774
+ });
3775
+ function fo(e) {
3776
+ return /* @__PURE__ */ ti(uo, e);
3777
+ }
3778
+ var R = /*@__PURE__*/ T("ZodStringFormat", (e, t) => {
3779
+ j.init(e, t), lo.init(e, t);
3780
+ }), po = /*@__PURE__*/ T("ZodISODateTime", (e, t) => {
3781
+ Dn.init(e, t), R.init(e, t);
3782
+ }), mo = /*@__PURE__*/ T("ZodISODate", (e, t) => {
3783
+ On.init(e, t), R.init(e, t);
3784
+ }), ho = /*@__PURE__*/ T("ZodISOTime", (e, t) => {
3785
+ kn.init(e, t), R.init(e, t);
3786
+ }), go = /*@__PURE__*/ T("ZodISODuration", (e, t) => {
3787
+ An.init(e, t), R.init(e, t);
3788
+ }), _o = /*@__PURE__*/ T("ZodEmail", (e, t) => {
3789
+ pn.init(e, t), R.init(e, t);
3790
+ }), vo = /*@__PURE__*/ T("ZodGUID", (e, t) => {
3791
+ dn.init(e, t), R.init(e, t);
3792
+ }), yo = /*@__PURE__*/ T("ZodUUID", (e, t) => {
3793
+ fn.init(e, t), R.init(e, t);
3794
+ }), bo = /*@__PURE__*/ T("ZodURL", (e, t) => {
3795
+ yn.init(e, t), R.init(e, t);
3796
+ }), xo = /*@__PURE__*/ T("ZodEmoji", (e, t) => {
3797
+ bn.init(e, t), R.init(e, t);
3798
+ }), So = /*@__PURE__*/ T("ZodNanoID", (e, t) => {
3799
+ xn.init(e, t), R.init(e, t);
3800
+ }), Co = /*@__PURE__*/ T("ZodCUID", (e, t) => {
3801
+ Sn.init(e, t), R.init(e, t);
3802
+ }), wo = /*@__PURE__*/ T("ZodCUID2", (e, t) => {
3803
+ Cn.init(e, t), R.init(e, t);
3804
+ }), To = /*@__PURE__*/ T("ZodULID", (e, t) => {
3805
+ wn.init(e, t), R.init(e, t);
3806
+ }), Eo = /*@__PURE__*/ T("ZodXID", (e, t) => {
3807
+ Tn.init(e, t), R.init(e, t);
3808
+ }), Do = /*@__PURE__*/ T("ZodKSUID", (e, t) => {
3809
+ En.init(e, t), R.init(e, t);
3810
+ }), Oo = /*@__PURE__*/ T("ZodIPv4", (e, t) => {
3811
+ jn.init(e, t), R.init(e, t);
3812
+ }), ko = /*@__PURE__*/ T("ZodIPv6", (e, t) => {
3813
+ Pn.init(e, t), R.init(e, t);
3814
+ }), Ao = /*@__PURE__*/ T("ZodCIDRv4", (e, t) => {
3815
+ Fn.init(e, t), R.init(e, t);
3816
+ }), jo = /*@__PURE__*/ T("ZodCIDRv6", (e, t) => {
3817
+ Ln.init(e, t), R.init(e, t);
3818
+ }), Mo = /*@__PURE__*/ T("ZodBase64", (e, t) => {
3819
+ zn.init(e, t), R.init(e, t);
3820
+ }), No = /*@__PURE__*/ T("ZodBase64URL", (e, t) => {
3821
+ Vn.init(e, t), R.init(e, t);
3822
+ }), Po = /*@__PURE__*/ T("ZodE164", (e, t) => {
3823
+ Hn.init(e, t), R.init(e, t);
3824
+ }), Fo = /*@__PURE__*/ T("ZodJWT", (e, t) => {
3825
+ Wn.init(e, t), R.init(e, t);
3826
+ }), Io = /*@__PURE__*/ T("ZodNumber", (e, t) => {
3827
+ Gn.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => va(e, t, n, r);
3828
+ let n = e._zod.bag;
3829
+ 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;
3830
+ }, {
3831
+ gt(e, t) {
3832
+ return this.check(/* @__PURE__ */ Ii(e, t));
3833
+ },
3834
+ gte(e, t) {
3835
+ return this.check(/* @__PURE__ */ Li(e, t));
3836
+ },
3837
+ min(e, t) {
3838
+ return this.check(/* @__PURE__ */ Li(e, t));
3839
+ },
3840
+ lt(e, t) {
3841
+ return this.check(/* @__PURE__ */ Pi(e, t));
3842
+ },
3843
+ lte(e, t) {
3844
+ return this.check(/* @__PURE__ */ Fi(e, t));
3845
+ },
3846
+ max(e, t) {
3847
+ return this.check(/* @__PURE__ */ Fi(e, t));
3848
+ },
3849
+ int(e) {
3850
+ return this.check(Ro(e));
3851
+ },
3852
+ safe(e) {
3853
+ return this.check(Ro(e));
3854
+ },
3855
+ positive(e) {
3856
+ return this.check(/* @__PURE__ */ Ii(0, e));
3857
+ },
3858
+ nonnegative(e) {
3859
+ return this.check(/* @__PURE__ */ Li(0, e));
3860
+ },
3861
+ negative(e) {
3862
+ return this.check(/* @__PURE__ */ Pi(0, e));
3863
+ },
3864
+ nonpositive(e) {
3865
+ return this.check(/* @__PURE__ */ Fi(0, e));
3866
+ },
3867
+ multipleOf(e, t) {
3868
+ return this.check(/* @__PURE__ */ Ri(e, t));
3869
+ },
3870
+ step(e, t) {
3871
+ return this.check(/* @__PURE__ */ Ri(e, t));
3872
+ },
3873
+ finite() {
3874
+ return this;
3875
+ }
3876
+ });
3877
+ function z(e) {
3878
+ return /* @__PURE__ */ Oi(Io, e);
3879
+ }
3880
+ var Lo = /*@__PURE__*/ T("ZodNumberFormat", (e, t) => {
3881
+ Kn.init(e, t), Io.init(e, t);
3882
+ });
3883
+ function Ro(e) {
3884
+ return /* @__PURE__ */ ki(Lo, e);
3885
+ }
3886
+ var zo = /*@__PURE__*/ T("ZodBoolean", (e, t) => {
3887
+ qn.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => ya(e, t, n, r);
3888
+ });
3889
+ function B(e) {
3890
+ return /* @__PURE__ */ Ai(zo, e);
3891
+ }
3892
+ var Bo = /*@__PURE__*/ T("ZodNull", (e, t) => {
3893
+ Jn.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => ba(e, t, n, r);
3894
+ });
3895
+ function Vo(e) {
3896
+ return /* @__PURE__ */ ji(Bo, e);
3897
+ }
3898
+ var Ho = /*@__PURE__*/ T("ZodUnknown", (e, t) => {
3899
+ Yn.init(e, t), L.init(e, t), e._zod.processJSONSchema = (e, t, n) => void 0;
3900
+ });
3901
+ function Uo() {
3902
+ return /* @__PURE__ */ Mi(Ho);
3903
+ }
3904
+ var Wo = /*@__PURE__*/ T("ZodNever", (e, t) => {
3905
+ Xn.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => xa(e, t, n, r);
3906
+ });
3907
+ function Go(e) {
3908
+ return /* @__PURE__ */ Ni(Wo, e);
3909
+ }
3910
+ var Ko = /*@__PURE__*/ T("ZodArray", (e, t) => {
3911
+ co(), Qn.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ea(e, t, n, r), e.element = t.element;
3912
+ }, {
3913
+ min(e, t) {
3914
+ return this.check(/* @__PURE__ */ Bi(e, t));
3915
+ },
3916
+ nonempty(e) {
3917
+ return this.check(/* @__PURE__ */ Bi(1, e));
3918
+ },
3919
+ max(e, t) {
3920
+ return this.check(/* @__PURE__ */ zi(e, t));
3921
+ },
3922
+ length(e, t) {
3923
+ return this.check(/* @__PURE__ */ Vi(e, t));
3924
+ },
3925
+ unwrap() {
3926
+ return this.element;
3927
+ }
3928
+ });
3929
+ function V(e, t) {
3930
+ return /* @__PURE__ */ $i(Ko, e, t);
3931
+ }
3932
+ var qo = /*@__PURE__*/ T("ZodObject", (e, t) => {
3933
+ co(), ar.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => Oa(e, t, n, r), De(e, "shape", (e) => e._zod.def.shape, !1);
3934
+ }, {
3935
+ keyof() {
3936
+ return G(Object.keys(this._zod.def.shape));
3937
+ },
3938
+ catchall(e) {
3939
+ return this.clone({
3940
+ ...this._zod.def,
3941
+ catchall: e
3942
+ });
3943
+ },
3944
+ passthrough() {
3945
+ return this.clone({
3946
+ ...this._zod.def,
3947
+ catchall: Uo()
3948
+ });
3949
+ },
3950
+ loose() {
3951
+ return this.clone({
3952
+ ...this._zod.def,
3953
+ catchall: Uo()
3954
+ });
3955
+ },
3956
+ strict() {
3957
+ return this.clone({
3958
+ ...this._zod.def,
3959
+ catchall: Go()
3960
+ });
3961
+ },
3962
+ strip() {
3963
+ return this.clone({
3964
+ ...this._zod.def,
3965
+ catchall: void 0
3966
+ });
3967
+ },
3968
+ extend(e) {
3969
+ return ce(this, e);
3970
+ },
3971
+ safeExtend(e) {
3972
+ return le(this, e);
3973
+ },
3974
+ merge(e) {
3975
+ return ue(this, e);
3976
+ },
3977
+ pick(e) {
3978
+ return oe(this, e);
3979
+ },
3980
+ omit(e) {
3981
+ return se(this, e);
3982
+ },
3983
+ partial(...e) {
3984
+ return de(is, this, e[0]);
3985
+ },
3986
+ exactPartial(...e) {
3987
+ return de(os, this, e[0], "exactPartial");
3988
+ },
3989
+ required(...e) {
3990
+ return fe(ms, this, e[0]);
3991
+ }
3992
+ });
3993
+ function H(e, t) {
3994
+ return new qo({
3995
+ type: "object",
3996
+ shape: e ?? {},
3997
+ ...v(t)
3998
+ });
3999
+ }
4000
+ var Jo = /*@__PURE__*/ T("ZodUnion", (e, t) => {
4001
+ sr.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => ka(e, t, n, r), e.options = t.options;
4002
+ });
4003
+ function U(e, t) {
4004
+ return new Jo({
4005
+ type: "union",
4006
+ options: e,
4007
+ ...v(t)
4008
+ });
4009
+ }
4010
+ var Yo = /*@__PURE__*/ T("ZodIntersection", (e, t) => {
4011
+ cr.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => Aa(e, t, n, r);
4012
+ });
4013
+ function Xo(e, t) {
4014
+ return new Yo({
4015
+ type: "intersection",
4016
+ left: e,
4017
+ right: t
4018
+ });
4019
+ }
4020
+ var Zo = /*@__PURE__*/ T("ZodTuple", (e, t) => {
4021
+ co(), dr.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => ja(e, t, n, r);
4022
+ }, {
4023
+ rest(e) {
4024
+ return this.clone({
4025
+ ...this._zod.def,
4026
+ rest: e
4027
+ });
4028
+ },
4029
+ partial() {
4030
+ let e = this._zod.def;
4031
+ if (e.checks?.length) throw Error(".partial() cannot be used on tuple schemas containing refinements");
4032
+ return this.clone({
4033
+ ...e,
4034
+ items: e.items.map((e) => new is({
4035
+ type: "optional",
4036
+ innerType: e
4037
+ }))
4038
+ });
4039
+ }
4040
+ });
4041
+ function Qo(e, t, n) {
4042
+ let r = t instanceof A;
4043
+ return new Zo({
4044
+ type: "tuple",
4045
+ items: e,
4046
+ rest: r ? t : null,
4047
+ ...v(r ? n : t)
4048
+ });
4049
+ }
4050
+ var $o = /*@__PURE__*/ T("ZodRecord", (e, t) => {
4051
+ co(), hr.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => Fa(e, t, n, r), e.keyType = t.keyType, e.valueType = t.valueType;
4052
+ });
4053
+ function W(e, t, n) {
4054
+ return !t || !t._zod ? new $o({
4055
+ type: "record",
4056
+ keyType: fo(),
4057
+ valueType: e,
4058
+ ...v(t)
4059
+ }) : new $o({
4060
+ type: "record",
4061
+ keyType: e,
4062
+ valueType: t,
4063
+ ...v(n)
4064
+ });
4065
+ }
4066
+ var es = /*@__PURE__*/ T("ZodEnum", (e, t) => {
4067
+ gr.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => Sa(e, t, n, r), e.enum = t.entries, e.options = Object.values(t.entries);
4068
+ let n = new Set(Object.keys(t.entries));
4069
+ e.extract = (e, r) => {
4070
+ let i = {};
4071
+ for (let r of e) if (n.has(r)) i[r] = t.entries[r];
4072
+ else throw Error(`Key ${r} not found in enum`);
4073
+ return new es({
4074
+ ...t,
4075
+ checks: [],
4076
+ ...v(r),
4077
+ entries: i
4078
+ });
4079
+ }, e.exclude = (e, r) => {
4080
+ let i = { ...t.entries };
4081
+ for (let t of e) if (n.has(t)) delete i[t];
4082
+ else throw Error(`Key ${t} not found in enum`);
4083
+ return new es({
4084
+ ...t,
4085
+ checks: [],
4086
+ ...v(r),
4087
+ entries: i
4088
+ });
4089
+ };
4090
+ });
4091
+ function G(e, t) {
4092
+ return new es({
4093
+ type: "enum",
4094
+ entries: Array.isArray(e) ? Object.fromEntries(e.map((e) => [e, e])) : e,
4095
+ ...v(t)
4096
+ });
4097
+ }
4098
+ var ts = /*@__PURE__*/ T("ZodLiteral", (e, t) => {
4099
+ _r.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ca(e, t, n, r), e.values = new Set(t.values), Object.defineProperty(e, "value", { get() {
4100
+ if (t.values.length > 1) throw Error("This schema contains multiple valid literal values. Use `.values` instead.");
4101
+ return t.values[0];
4102
+ } });
4103
+ });
4104
+ function K(e, t) {
4105
+ return new ts({
4106
+ type: "literal",
4107
+ values: Array.isArray(e) ? e : [e],
4108
+ ...v(t)
4109
+ });
4110
+ }
4111
+ var ns = /*@__PURE__*/ T("ZodTransform", (e, t) => {
4112
+ co(), vr.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ta(e, t, n, r), e._zod.parse = (n, r) => {
4113
+ if (r.direction === "backward") throw new Pe(e.constructor.name);
4114
+ n.addIssue = (r) => {
4115
+ if (typeof r == "string") n.issues.push(be(r, n.value, t));
4116
+ else {
4117
+ let t = r;
4118
+ t.fatal && (t.continue = !1), t.code ??= "custom", "input" in t || (t.input = n.value), t.inst ??= e, n.issues.push(be(t));
4119
+ }
4120
+ };
4121
+ let i = t.transform(n.value, n);
4122
+ return i instanceof Promise ? i.then((e) => (n.value = e, n)) : (n.value = i, n);
4123
+ };
4124
+ });
4125
+ function rs(e) {
4126
+ return new ns({
4127
+ type: "transform",
4128
+ transform: e
4129
+ });
4130
+ }
4131
+ var is = /*@__PURE__*/ T("ZodOptional", (e, t) => {
4132
+ br.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ga(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
4133
+ });
4134
+ function as(e) {
4135
+ return new is({
4136
+ type: "optional",
4137
+ innerType: e
4138
+ });
4139
+ }
4140
+ var os = /*@__PURE__*/ T("ZodExactOptional", (e, t) => {
4141
+ xr.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ga(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
4142
+ });
4143
+ function ss(e) {
4144
+ return new os({
4145
+ type: "optional",
4146
+ innerType: e
4147
+ });
4148
+ }
4149
+ var cs = /*@__PURE__*/ T("ZodNullable", (e, t) => {
4150
+ Sr.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ia(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
4151
+ });
4152
+ function ls(e) {
4153
+ return new cs({
4154
+ type: "nullable",
4155
+ innerType: e
4156
+ });
4157
+ }
4158
+ var us = /*@__PURE__*/ T("ZodDefault", (e, t) => {
4159
+ Cr.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ba(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
4160
+ });
4161
+ function ds(e, t) {
4162
+ return new us({
4163
+ type: "default",
4164
+ innerType: e,
4165
+ get defaultValue() {
4166
+ return typeof t == "function" ? t() : te(t);
4167
+ }
4168
+ });
4169
+ }
4170
+ var fs = /*@__PURE__*/ T("ZodPrefault", (e, t) => {
4171
+ Tr.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => Va(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
4172
+ });
4173
+ function ps(e, t) {
4174
+ return new fs({
4175
+ type: "prefault",
4176
+ innerType: e,
4177
+ get defaultValue() {
4178
+ return typeof t == "function" ? t() : te(t);
4179
+ }
4180
+ });
4181
+ }
4182
+ var ms = /*@__PURE__*/ T("ZodNonOptional", (e, t) => {
4183
+ Er.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => La(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
4184
+ });
4185
+ function hs(e, t) {
4186
+ return new ms({
4187
+ type: "nonoptional",
4188
+ innerType: e,
4189
+ ...v(t)
4190
+ });
4191
+ }
4192
+ var gs = /*@__PURE__*/ T("ZodCatch", (e, t) => {
4193
+ kr.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ha(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
4194
+ });
4195
+ function _s(e, t) {
4196
+ return new gs({
4197
+ type: "catch",
4198
+ innerType: e,
4199
+ catchValue: typeof t == "function" ? t : ke(t)
4200
+ });
4201
+ }
4202
+ var vs = /*@__PURE__*/ T("ZodPipe", (e, t) => {
4203
+ Ar.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ua(e, t, n, r), e.in = t.in, e.out = t.out;
4204
+ });
4205
+ function ys(e, t) {
4206
+ return new vs({
4207
+ type: "pipe",
4208
+ in: e,
4209
+ out: t
4210
+ });
4211
+ }
4212
+ var bs = /*@__PURE__*/ T("ZodReadonly", (e, t) => {
4213
+ Mr.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => Wa(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
4214
+ });
4215
+ function xs(e) {
4216
+ return new bs({
4217
+ type: "readonly",
4218
+ innerType: e
4219
+ });
4220
+ }
4221
+ var Ss = /*@__PURE__*/ T("ZodLazy", (e, t) => {
4222
+ Pr.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ka(e, t, n, r), e.unwrap = () => e._zod.def.getter();
4223
+ });
4224
+ function Cs(e) {
4225
+ return new Ss({
4226
+ type: "lazy",
4227
+ getter: e
4228
+ });
4229
+ }
4230
+ var ws = /*@__PURE__*/ T("ZodCustom", (e, t) => {
4231
+ Fr.init(e, t), L.init(e, t), e._zod.processJSONSchema = (t, n, r) => wa(e, t, n, r);
4232
+ });
4233
+ function Ts(e, t = {}) {
4234
+ return /* @__PURE__ */ ea(ws, e, t);
4235
+ }
4236
+ function Es(e, t) {
4237
+ return /* @__PURE__ */ ta(e, t);
4238
+ }
4239
+ function Ds(e) {
4240
+ let t = Cs(() => U([
4241
+ fo(e),
4242
+ z(),
4243
+ B(),
4244
+ Vo(),
4245
+ V(t),
4246
+ W(fo(), t)
4247
+ ]));
4248
+ return t;
4249
+ }
4250
+ //#endregion
4251
+ //#region src/flow/common/json.ts
4252
+ var Os = 64;
4253
+ function ks(e, t = 0) {
4254
+ if (t > 64) throw TypeError("Value exceeds the maximum JSON depth.");
4255
+ if (typeof e == "object" && e) for (let n of Object.values(e)) ks(n, t + 1);
4256
+ }
4257
+ //#endregion
4258
+ //#region src/flow/common/changeSchema.ts
4259
+ var q = fo(), J = Ds(), As = V(q), js = H({
4260
+ description: q.optional(),
4261
+ jsonSchema: J,
4262
+ nullable: B(),
4263
+ handle: q
4264
+ }), Y = js.extend({ value: J.optional() }), Ms = H({
4265
+ collapsed: B().optional(),
4266
+ group: q
4267
+ }), Ns = H({
4268
+ kind: K("node"),
4269
+ nodeId: q,
4270
+ output: q
4271
+ }), Ps = H({
4272
+ kind: K("flow"),
4273
+ input: q
4274
+ }), Fs = U([
4275
+ Ns,
4276
+ Ps,
4277
+ H({
4278
+ kind: K("binding"),
4279
+ bindingId: q
4280
+ })
4281
+ ]), Is = U([H({
4282
+ kind: K("value"),
4283
+ value: J
4284
+ }), H({
4285
+ kind: K("sources"),
4286
+ sources: V(Fs)
4287
+ })]), Ls = W(q, Is), Rs = {
4288
+ inputs: V(U([Y, Ms])),
4289
+ outputs: V(U([js, Ms]))
4290
+ }, zs = H({
4291
+ kind: K("connector"),
4292
+ action: q,
4293
+ connectionId: q.optional(),
4294
+ connections: V(H({
4295
+ connectionId: q,
4296
+ alias: q.optional()
4297
+ }))
4298
+ }), Bs = H({
4299
+ ...Rs,
4300
+ name: q,
4301
+ moduleId: q,
4302
+ capabilities: V(zs).optional()
4303
+ }), Vs = U([H({
4304
+ kind: K("value"),
4305
+ value: J
4306
+ }), H({
4307
+ kind: K("input"),
4308
+ input: q
4309
+ })]), Hs = U([Vs, H({ kind: K("model") })]), Us = H({
4310
+ ...Rs,
4311
+ name: q,
4312
+ executor: U([
4313
+ H({
4314
+ kind: K("connector"),
4315
+ action: q,
4316
+ connectionId: q.optional()
4317
+ }),
4318
+ H({
4319
+ kind: K("llm"),
4320
+ mode: G(["chat", "json"])
4321
+ }),
4322
+ H({
4323
+ kind: K("agent"),
4324
+ code: B().optional(),
4325
+ model: q,
4326
+ prompt: Vs,
4327
+ system: q,
4328
+ maxRounds: z(),
4329
+ tools: V(H({
4330
+ id: q,
4331
+ name: q,
4332
+ description: q,
4333
+ action: q,
4334
+ connectionId: q.optional(),
4335
+ approval: B(),
4336
+ inputs: V(Y.extend({ source: Hs }))
4337
+ })),
4338
+ notification: H({
4339
+ taskId: q,
4340
+ messageHandle: q,
4341
+ inputs: W(q, Vs)
4342
+ }).optional()
4343
+ })
4344
+ ])
4345
+ }), Ws = {
4346
+ input: Y,
4347
+ cases: V(H({
4348
+ output: q,
4349
+ relation: G(["all", "any"]),
4350
+ expressions: V(H({
4351
+ input: q,
4352
+ operator: G([
4353
+ "!=",
4354
+ "<",
4355
+ "<=",
4356
+ "==",
4357
+ ">",
4358
+ ">=",
4359
+ "contains",
4360
+ "endsWith",
4361
+ "hasKey",
4362
+ "hasValue",
4363
+ "isEmpty",
4364
+ "isFalse",
4365
+ "isNotEmpty",
4366
+ "isNotNull",
4367
+ "isNull",
4368
+ "isTrue",
4369
+ "notContains",
4370
+ "notHasKey",
4371
+ "notHasValue",
4372
+ "startsWith"
4373
+ ]),
4374
+ value: J.optional()
4375
+ }))
4376
+ })),
4377
+ defaultOutput: q.optional()
4378
+ }, Gs = {
4379
+ actions: U([Qo([K("continue")]), Qo([K("approve"), K("reject")])]),
4380
+ prompt: q,
4381
+ notification: H({
4382
+ inputs: Ls,
4383
+ messageHandle: q,
4384
+ taskId: q
4385
+ }).optional()
4386
+ }, Ks = {
4387
+ inputsDef: V(Y),
4388
+ options: H({
4389
+ allowedMethods: As.optional(),
4390
+ allowedOrigins: As.optional(),
4391
+ noResponseBody: B().optional(),
4392
+ responseData: q.optional(),
4393
+ responseHeaders: W(q, q).optional(),
4394
+ responseStatusCode: z().optional()
4395
+ }).optional()
4396
+ }, qs = V(U([H({
4397
+ type: K("cron"),
4398
+ expression: q,
4399
+ timezone: q
4400
+ }), H({
4401
+ type: K("every"),
4402
+ unit: G([
4403
+ "day",
4404
+ "hour",
4405
+ "minute",
4406
+ "month",
4407
+ "week"
4408
+ ]),
4409
+ value: z()
4410
+ })])), Js = {
4411
+ configSchema: J,
4412
+ definitionVersion: z(),
4413
+ description: q,
4414
+ displayName: q,
4415
+ key: q,
4416
+ name: q,
4417
+ payloadSchema: J,
4418
+ provider: q
4419
+ }, Ys = H({
4420
+ body: H({
4421
+ allowArray: B(),
4422
+ allowEmpty: B(),
4423
+ formats: V(G([
4424
+ "form",
4425
+ "json",
4426
+ "multipart",
4427
+ "text"
4428
+ ]))
4429
+ }),
4430
+ methods: V(G([
4431
+ "DELETE",
4432
+ "GET",
4433
+ "HEAD",
4434
+ "PATCH",
4435
+ "POST",
4436
+ "PUT"
4437
+ ])),
4438
+ successStatus: z()
4439
+ }), Xs = {
4440
+ name: q,
4441
+ description: q.optional(),
4442
+ icon: q.optional()
4443
+ }, X = {
4444
+ inputs: Ls,
4445
+ name: q.optional(),
4446
+ description: q.optional(),
4447
+ icon: q.optional(),
4448
+ timeoutMs: z().optional()
4449
+ }, Zs = U([
4450
+ H({
4451
+ ...X,
4452
+ kind: K("condition"),
4453
+ ...Ws
4454
+ }),
4455
+ H({
4456
+ ...X,
4457
+ inputs: Uo().transform(() => ({})).default({}),
4458
+ kind: K("value"),
4459
+ values: V(Y)
4460
+ }),
4461
+ H({
4462
+ ...X,
4463
+ kind: K("subflow"),
4464
+ subflowId: q
4465
+ }),
4466
+ H({
4467
+ ...X,
4468
+ kind: K("task"),
4469
+ task: Bs,
4470
+ additionalInputs: V(Y).optional()
4471
+ }),
4472
+ H({
4473
+ ...X,
4474
+ kind: K("task"),
4475
+ taskId: q,
4476
+ additionalInputs: V(Y).optional()
4477
+ }),
4478
+ H({
4479
+ ...X,
4480
+ kind: K("wait"),
4481
+ input: Y,
4482
+ ...Gs
4483
+ }).omit({ timeoutMs: !0 }),
4484
+ H({
4485
+ ...Xs,
4486
+ kind: K("manual")
4487
+ }),
4488
+ H({
4489
+ ...Xs,
4490
+ kind: K("webhook"),
4491
+ ...Ks
4492
+ }),
4493
+ H({
4494
+ ...Xs,
4495
+ kind: K("cron"),
4496
+ cronTimes: qs
4497
+ }),
4498
+ H({
4499
+ ...Xs,
4500
+ kind: K("poll"),
4501
+ bindingId: q,
4502
+ config: W(q, J),
4503
+ definition: H({
4504
+ ...Js,
4505
+ type: K("poll")
4506
+ }),
4507
+ pollTimes: qs
4508
+ }),
4509
+ H({
4510
+ ...Xs,
4511
+ kind: K("integration"),
4512
+ bindingId: q,
4513
+ config: W(q, J),
4514
+ definition: H({
4515
+ ...Js,
4516
+ type: K("integration"),
4517
+ endpoint: Ys
4518
+ })
4519
+ })
4520
+ ]), Qs = U([H({ kind: K("flow") }), H({
4521
+ kind: K("subflow"),
4522
+ id: q
4523
+ })]), $s = H({
4524
+ source: q,
4525
+ target: q,
4526
+ sourceHandle: q.optional()
4527
+ }), Z = {
4528
+ nodeId: q,
4529
+ target: Qs
4530
+ }, ec = H({
4531
+ name: q,
4532
+ inputs: V(Y),
4533
+ outputs: V(js.extend({ sources: V(U([Ns, Ps])) }))
4534
+ }), tc = H({
4535
+ nodes: W(q, Zs),
4536
+ edges: V($s).default([])
4537
+ }), nc = H({
4538
+ kind: G(["connection", "variable"]),
4539
+ target: q
4540
+ }), rc = H({
4541
+ name: q,
4542
+ imports: As,
4543
+ source: q
4544
+ }), ic = H({
4545
+ bindings: W(q, nc),
4546
+ graph: tc,
4547
+ subflows: W(q, ec.extend({ graph: tc })),
4548
+ tasks: W(q, Us)
4549
+ }), ac = H({
4550
+ modelVersion: K(1),
4551
+ document: ic,
4552
+ modules: W(q, rc)
4553
+ }), oc = ac.extend({
4554
+ kind: K("open-flow-flow-revision"),
4555
+ version: K(1)
4556
+ });
4557
+ function sc(e) {
4558
+ return ks(e), ic.parse(e);
4559
+ }
4560
+ function cc(e) {
4561
+ return ks(e), ac.parse(e);
4562
+ }
4563
+ function lc(e) {
4564
+ ks(e);
4565
+ let t = oc.parse(e);
4566
+ return {
4567
+ modelVersion: t.modelVersion,
4568
+ document: t.document,
4569
+ modules: t.modules
4570
+ };
4571
+ }
4572
+ var uc = {
4573
+ "binding.create": {
4574
+ bindingId: q,
4575
+ binding: nc
4576
+ },
4577
+ "binding.delete": { bindingId: q },
4578
+ "binding.target.set": {
4579
+ bindingId: q,
4580
+ before: q,
4581
+ value: q
4582
+ },
4583
+ "graph.edge.connect": {
4584
+ target: Qs,
4585
+ edge: $s
4586
+ },
4587
+ "graph.edge.disconnect": {
4588
+ target: Qs,
4589
+ edge: $s
4590
+ },
4591
+ "graph.node.create": {
4592
+ ...Z,
4593
+ node: Zs
4594
+ },
4595
+ "graph.node.delete": Z,
4596
+ "graph.node.field.set": U([H({
4597
+ ...Z,
4598
+ kind: K("graph.node.field.set"),
4599
+ field: G([
4600
+ "description",
4601
+ "icon",
4602
+ "name"
4603
+ ]),
4604
+ before: q.optional(),
4605
+ value: q.optional()
4606
+ }), H({
4607
+ ...Z,
4608
+ kind: K("graph.node.field.set"),
4609
+ field: K("timeoutMs"),
4610
+ before: z().optional(),
4611
+ value: z().optional()
4612
+ })]),
4613
+ "graph.node.input.set": {
4614
+ ...Z,
4615
+ handle: q,
4616
+ before: Is.optional(),
4617
+ value: Is.optional()
4618
+ },
4619
+ "graph.node.additional-inputs.set": {
4620
+ ...Z,
4621
+ before: V(Y).optional(),
4622
+ value: V(Y).optional()
4623
+ },
4624
+ "graph.node.condition.set": {
4625
+ ...Z,
4626
+ before: H(Ws),
4627
+ value: H(Ws)
4628
+ },
4629
+ "graph.node.values.set": {
4630
+ ...Z,
4631
+ before: V(Y),
4632
+ value: V(Y)
4633
+ },
4634
+ "graph.node.wait.set": {
4635
+ ...Z,
4636
+ target: H({ kind: K("flow") }),
4637
+ before: H(Gs),
4638
+ value: H(Gs)
4639
+ },
4640
+ "graph.node.webhook.set": {
4641
+ ...Z,
4642
+ target: H({ kind: K("flow") }),
4643
+ before: H(Ks),
4644
+ value: H(Ks)
4645
+ },
4646
+ "graph.node.task.ports.set": {
4647
+ ...Z,
4648
+ before: H(Rs),
4649
+ value: H(Rs)
4650
+ },
4651
+ "graph.node.task.name.set": {
4652
+ ...Z,
4653
+ before: q,
4654
+ value: q
4655
+ },
4656
+ "graph.node.task.capabilities.set": {
4657
+ ...Z,
4658
+ before: V(zs).optional(),
4659
+ value: V(zs).optional()
4660
+ },
4661
+ "graph.trigger.config.set": {
4662
+ nodeId: q,
4663
+ name: q,
4664
+ before: J.optional(),
4665
+ value: J.optional()
4666
+ },
4667
+ "graph.trigger.schedule.set": {
4668
+ nodeId: q,
4669
+ before: qs,
4670
+ value: qs
4671
+ },
4672
+ "module.create": {
4673
+ moduleId: q,
4674
+ module: rc
4675
+ },
4676
+ "module.delete": { moduleId: q },
4677
+ "module.rename": {
4678
+ moduleId: q,
4679
+ before: q,
4680
+ name: q
4681
+ },
4682
+ "module.source.replace": {
4683
+ moduleId: q,
4684
+ beforeImports: As,
4685
+ beforeSource: q,
4686
+ imports: As,
4687
+ source: q
4688
+ },
4689
+ "subflow.create": {
4690
+ subflowId: q,
4691
+ subflow: ec.extend({ graph: tc })
4692
+ },
4693
+ "subflow.definition.set": {
4694
+ subflowId: q,
4695
+ before: ec,
4696
+ definition: ec
4697
+ },
4698
+ "subflow.delete": { subflowId: q },
4699
+ "task.create": {
4700
+ taskId: q,
4701
+ task: Us
4702
+ },
4703
+ "task.delete": { taskId: q },
4704
+ "task.connector.connection.set": {
4705
+ taskId: q,
4706
+ before: q.optional(),
4707
+ value: q.optional()
4708
+ },
4709
+ "task.agent.set": {
4710
+ taskId: q,
4711
+ before: Us,
4712
+ value: Us
4713
+ },
4714
+ "task.llm.mode.set": {
4715
+ taskId: q,
4716
+ before: G(["chat", "json"]),
4717
+ value: G(["chat", "json"])
4718
+ },
4719
+ "task.name.set": {
4720
+ taskId: q,
4721
+ before: q,
4722
+ value: q
4723
+ }
4724
+ };
4725
+ V(U([...new Map(Object.entries(uc).map(([e, t]) => [e, t instanceof L ? t : H({
4726
+ kind: K(e),
4727
+ ...t
4728
+ })])).values()])).min(1);
4729
+ //#endregion
1
4730
  //#region src/flow/common/encoding.ts
2
- var e = new TextEncoder(), t = 64;
3
- function n(e) {
4731
+ var dc = new TextEncoder();
4732
+ function Q(e) {
4
4733
  if (e == null || typeof e == "boolean" || typeof e == "string" || typeof e == "number") return JSON.stringify(e);
5
- if (Array.isArray(e)) return `[${e.map(n).join(",")}]`;
4734
+ if (Array.isArray(e)) return `[${e.map(Q).join(",")}]`;
6
4735
  let t = e;
7
- return `{${Object.keys(t).toSorted().map((e) => `${JSON.stringify(e)}:${n(t[e])}`).join(",")}}`;
4736
+ return `{${Object.keys(t).toSorted().map((e) => `${JSON.stringify(e)}:${Q(t[e])}`).join(",")}}`;
8
4737
  }
9
- function r(t) {
10
- return e.encode(n(t));
4738
+ function fc(e) {
4739
+ return dc.encode(Q(e));
11
4740
  }
12
- async function i(e) {
4741
+ async function pc(e) {
13
4742
  let t = new Uint8Array(e.byteLength);
14
4743
  return t.set(e), `sha256:${[...new Uint8Array(await crypto.subtle.digest("SHA-256", t))].map((e) => e.toString(16).padStart(2, "0")).join("")}`;
15
4744
  }
16
- function a(e) {
4745
+ function mc(e) {
17
4746
  return Object.keys(e).toSorted().map((t) => [t, e[t]]);
18
4747
  }
19
- function o(e) {
4748
+ function hc(e) {
20
4749
  return "handle" in e ? {
21
4750
  ...e.description == null ? {} : { description: e.description },
22
4751
  handle: e.handle,
@@ -28,10 +4757,10 @@ function o(e) {
28
4757
  group: e.group
29
4758
  };
30
4759
  }
31
- function s(e) {
32
- return e.map(o);
4760
+ function $(e) {
4761
+ return e.map(hc);
33
4762
  }
34
- function c(e) {
4763
+ function gc(e) {
35
4764
  switch (e.kind) {
36
4765
  case "sources": return {
37
4766
  kind: e.kind,
@@ -43,10 +4772,10 @@ function c(e) {
43
4772
  };
44
4773
  }
45
4774
  }
46
- function l(e) {
47
- return Object.fromEntries(a(e).map(([e, t]) => [e, c(t)]));
4775
+ function _c(e) {
4776
+ return Object.fromEntries(mc(e).map(([e, t]) => [e, gc(t)]));
48
4777
  }
49
- function u(e) {
4778
+ function vc(e) {
50
4779
  return e.map((e) => ({
51
4780
  ...e.description == null ? {} : { description: e.description },
52
4781
  handle: e.handle,
@@ -55,13 +4784,12 @@ function u(e) {
55
4784
  sources: e.sources.map((e) => ({ ...e }))
56
4785
  }));
57
4786
  }
58
- function d(e) {
59
- if (!("inputs" in e)) return v(e);
4787
+ function yc(e) {
4788
+ if (!("inputs" in e)) return Ec(e);
60
4789
  let t = {
61
- concurrency: e.concurrency,
62
4790
  ...e.description == null ? {} : { description: e.description },
63
4791
  ...e.icon == null ? {} : { icon: e.icon },
64
- inputs: l(e.inputs),
4792
+ inputs: _c(e.inputs),
65
4793
  ...e.name == null ? {} : { name: e.name },
66
4794
  ...e.timeoutMs == null ? {} : { timeoutMs: e.timeoutMs }
67
4795
  };
@@ -80,7 +4808,7 @@ function d(e) {
80
4808
  ...e.defaultOutput == null ? {} : { defaultOutput: e.defaultOutput },
81
4809
  input: {
82
4810
  handle: e.input.handle,
83
- ...o(e.input)
4811
+ ...hc(e.input)
84
4812
  },
85
4813
  kind: e.kind
86
4814
  };
@@ -89,47 +4817,65 @@ function d(e) {
89
4817
  kind: e.kind,
90
4818
  subflowId: e.subflowId
91
4819
  };
92
- case "task": return e.task == null ? {
93
- ...t,
94
- kind: e.kind,
95
- taskId: e.taskId
96
- } : {
4820
+ case "task": {
4821
+ let n = e.task == null ? Object.assign({}, t, {
4822
+ kind: e.kind,
4823
+ taskId: e.taskId
4824
+ }) : Object.assign({}, t, {
4825
+ kind: e.kind,
4826
+ task: Sc(e.task)
4827
+ });
4828
+ return e.additionalInputs != null && (n.additionalInputs = $(e.additionalInputs)), n;
4829
+ }
4830
+ case "value": return {
97
4831
  ...t,
98
4832
  kind: e.kind,
99
- task: m(e.task)
4833
+ values: $(e.values)
100
4834
  };
101
- case "value": return {
4835
+ case "wait": return {
102
4836
  ...t,
4837
+ actions: e.actions,
4838
+ input: {
4839
+ handle: e.input.handle,
4840
+ ...hc(e.input)
4841
+ },
103
4842
  kind: e.kind,
104
- values: s(e.values)
4843
+ ...e.notification == null ? {} : { notification: {
4844
+ inputs: _c(e.notification.inputs),
4845
+ messageHandle: e.notification.messageHandle,
4846
+ taskId: e.notification.taskId
4847
+ } },
4848
+ prompt: e.prompt
105
4849
  };
106
4850
  }
107
4851
  }
108
- function f(e) {
109
- return { nodes: Object.fromEntries(a(e.nodes).map(([e, t]) => [e, d(t)])) };
4852
+ function bc(e) {
4853
+ return {
4854
+ edges: e.edges.map((e) => ({ ...e })).toSorted((e, t) => {
4855
+ let n = Q(e), r = Q(t);
4856
+ return n < r ? -1 : +(n > r);
4857
+ }),
4858
+ nodes: Object.fromEntries(mc(e.nodes).map(([e, t]) => [e, yc(t)]))
4859
+ };
110
4860
  }
111
- function p(e) {
4861
+ function xc(e) {
112
4862
  return {
113
4863
  executor: e.executor,
114
- inputs: s(e.inputs),
4864
+ inputs: $(e.inputs),
115
4865
  name: e.name,
116
- outputs: s(e.outputs)
4866
+ outputs: $(e.outputs)
117
4867
  };
118
4868
  }
119
- function m(e) {
4869
+ function Sc(e) {
120
4870
  return {
121
- ...e.capabilities == null ? {} : { capabilities: e.capabilities.map(({ action: e, connectionId: t, kind: n }) => ({
122
- action: e,
123
- connectionId: t,
124
- kind: n
125
- })) },
126
- inputs: s(e.inputs),
4871
+ ...e.capabilities == null ? {} : { capabilities: e.capabilities },
4872
+ inputs: $(e.inputs),
127
4873
  moduleId: e.moduleId,
128
4874
  name: e.name,
129
- outputs: s(e.outputs)
4875
+ outputs: $(e.outputs)
130
4876
  };
131
4877
  }
132
- function h(e) {
4878
+ function Cc(e) {
133
4879
  return {
134
4880
  configSchema: e.configSchema,
135
4881
  definitionVersion: e.definitionVersion,
@@ -151,7 +4897,7 @@ function h(e) {
151
4897
  type: e.type
152
4898
  };
153
4899
  }
154
- function g(e) {
4900
+ function wc(e) {
155
4901
  return {
156
4902
  ...e.allowedMethods == null ? {} : { allowedMethods: e.allowedMethods },
157
4903
  ...e.allowedOrigins == null ? {} : { allowedOrigins: e.allowedOrigins },
@@ -161,7 +4907,7 @@ function g(e) {
161
4907
  ...e.responseStatusCode == null ? {} : { responseStatusCode: e.responseStatusCode }
162
4908
  };
163
4909
  }
164
- function _(e) {
4910
+ function Tc(e) {
165
4911
  switch (e.type) {
166
4912
  case "cron": return {
167
4913
  expression: e.expression,
@@ -175,7 +4921,7 @@ function _(e) {
175
4921
  };
176
4922
  }
177
4923
  }
178
- function v(e) {
4924
+ function Ec(e) {
179
4925
  let t = (t) => ({
180
4926
  ...e.description == null ? {} : { description: e.description },
181
4927
  ...e.icon == null ? {} : { icon: e.icon },
@@ -183,64 +4929,72 @@ function v(e) {
183
4929
  name: e.name
184
4930
  });
185
4931
  switch (e.kind) {
4932
+ case "manual": return t(e.kind);
186
4933
  case "webhook": return {
187
4934
  ...t(e.kind),
188
4935
  inputsDef: e.inputsDef.map((e) => ({
189
4936
  handle: e.handle,
190
- ...o(e)
4937
+ ...hc(e)
191
4938
  })),
192
- ...e.options == null ? {} : { options: g(e.options) }
4939
+ ...e.options == null ? {} : { options: wc(e.options) }
193
4940
  };
194
4941
  case "cron": return {
195
4942
  ...t(e.kind),
196
- cronTimes: e.cronTimes.map(_)
4943
+ cronTimes: e.cronTimes.map(Tc)
197
4944
  };
198
4945
  case "poll": return {
199
4946
  ...t(e.kind),
200
4947
  bindingId: e.bindingId,
201
4948
  config: e.config,
202
- definition: h(e.definition),
203
- pollTimes: e.pollTimes.map(_)
4949
+ definition: Cc(e.definition),
4950
+ pollTimes: e.pollTimes.map(Tc)
204
4951
  };
205
4952
  case "integration": return {
206
4953
  ...t(e.kind),
207
4954
  bindingId: e.bindingId,
208
4955
  config: e.config,
209
- definition: h(e.definition)
4956
+ definition: Cc(e.definition)
210
4957
  };
211
4958
  }
212
4959
  }
213
- function y(e) {
4960
+ function Dc(e) {
4961
+ let { name: t, description: n, icon: r, ...i } = e;
4962
+ return Q(i);
4963
+ }
4964
+ function Oc(e) {
214
4965
  return {
215
- bindings: Object.fromEntries(a(e.bindings)),
216
- graph: f(e.graph),
217
- subflows: Object.fromEntries(a(e.subflows).map(([e, t]) => [e, {
218
- graph: f(t.graph),
219
- inputs: s(t.inputs),
4966
+ bindings: Object.fromEntries(mc(e.bindings)),
4967
+ graph: bc(e.graph),
4968
+ subflows: Object.fromEntries(mc(e.subflows).map(([e, t]) => [e, {
4969
+ graph: bc(t.graph),
4970
+ inputs: $(t.inputs),
220
4971
  name: t.name,
221
- outputs: u(t.outputs)
4972
+ outputs: vc(t.outputs)
222
4973
  }])),
223
- tasks: Object.fromEntries(a(e.tasks).map(([e, t]) => [e, p(t)]))
4974
+ tasks: Object.fromEntries(mc(e.tasks).map(([e, t]) => [e, xc(t)]))
224
4975
  };
225
4976
  }
226
- function b(e) {
4977
+ function kc(e) {
227
4978
  return {
228
4979
  imports: e.imports.toSorted(),
229
4980
  name: e.name,
230
4981
  source: e.source
231
4982
  };
232
4983
  }
233
- function x(e) {
4984
+ function Ac(e) {
234
4985
  return {
235
- document: y(e.document),
4986
+ document: Oc(e.document),
236
4987
  kind: "open-flow-flow-revision",
237
4988
  modelVersion: e.modelVersion,
238
- modules: Object.fromEntries(a(e.modules).map(([e, t]) => [e, b(t)])),
4989
+ modules: Object.fromEntries(mc(e.modules).map(([e, t]) => [e, kc(t)])),
239
4990
  version: 1
240
4991
  };
241
4992
  }
242
- function S(e) {
243
- return r(x(e));
4993
+ function jc(e) {
4994
+ return fc(Ac(e));
4995
+ }
4996
+ function Mc(e) {
4997
+ return lc(JSON.parse(new TextDecoder("utf-8", { fatal: !0 }).decode(e)));
244
4998
  }
245
4999
  //#endregion
246
- export { y as canonicalDocument, f as canonicalGraph, r as canonicalJsonBytes, b as canonicalModule, u as canonicalOutputs, s as canonicalPorts, p as canonicalTask, i as digestBytes, S as encodeRevision, t as maxJsonDepth };
5000
+ export { Oc as canonicalDocument, bc as canonicalGraph, fc as canonicalJsonBytes, kc as canonicalModule, vc as canonicalOutputs, $ as canonicalPorts, xc as canonicalTask, sc as decodeFlowDocument, Mc as decodeRevision, cc as decodeRevisionContent, pc as digestBytes, jc as encodeRevision, Os as maxJsonDepth, Dc as triggerRuntimeJson };