@snowcone-app/canvas 0.39.1 → 0.39.3

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