@opencloud-eu/web-client 7.0.1 → 7.2.0

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,3046 @@
1
+ import { t as e } from "./urlJoin-_pUL1TUx.js";
2
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
3
+ var t;
4
+ function n(e, t, n) {
5
+ function r(n, r) {
6
+ if (n._zod || Object.defineProperty(n, "_zod", {
7
+ value: {
8
+ def: r,
9
+ constr: o,
10
+ traits: /* @__PURE__ */ new Set()
11
+ },
12
+ enumerable: !1
13
+ }), n._zod.traits.has(e)) return;
14
+ n._zod.traits.add(e), t(n, r);
15
+ let i = o.prototype, a = Object.keys(i);
16
+ for (let e = 0; e < a.length; e++) {
17
+ let t = a[e];
18
+ t in n || (n[t] = i[t].bind(n));
19
+ }
20
+ }
21
+ let i = n?.Parent ?? Object;
22
+ class a extends i {}
23
+ Object.defineProperty(a, "name", { value: e });
24
+ function o(e) {
25
+ var t;
26
+ let i = n?.Parent ? new a() : this;
27
+ r(i, e), (t = i._zod).deferred ?? (t.deferred = []);
28
+ for (let e of i._zod.deferred) e();
29
+ return i;
30
+ }
31
+ return Object.defineProperty(o, "init", { value: r }), Object.defineProperty(o, Symbol.hasInstance, { value: (t) => n?.Parent && t instanceof n.Parent ? !0 : t?._zod?.traits?.has(e) }), Object.defineProperty(o, "name", { value: e }), o;
32
+ }
33
+ var r = class extends Error {
34
+ constructor() {
35
+ super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
36
+ }
37
+ }, i = class extends Error {
38
+ constructor(e) {
39
+ super(`Encountered unidirectional transform during encode: ${e}`), this.name = "ZodEncodeError";
40
+ }
41
+ };
42
+ (t = globalThis).__zod_globalConfig ?? (t.__zod_globalConfig = {});
43
+ var a = globalThis.__zod_globalConfig;
44
+ function o(e) {
45
+ return e && Object.assign(a, e), a;
46
+ }
47
+ //#endregion
48
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js
49
+ function s(e) {
50
+ let t = Object.values(e).filter((e) => typeof e == "number");
51
+ return Object.entries(e).filter(([e, n]) => t.indexOf(+e) === -1).map(([e, t]) => t);
52
+ }
53
+ function c(e, t) {
54
+ return typeof t == "bigint" ? t.toString() : t;
55
+ }
56
+ function l(e) {
57
+ return { get value() {
58
+ {
59
+ let t = e();
60
+ return Object.defineProperty(this, "value", { value: t }), t;
61
+ }
62
+ throw Error("cached value already set");
63
+ } };
64
+ }
65
+ function u(e) {
66
+ return e == null;
67
+ }
68
+ function d(e) {
69
+ let t = +!!e.startsWith("^"), n = e.endsWith("$") ? e.length - 1 : e.length;
70
+ return e.slice(t, n);
71
+ }
72
+ function f(e, t) {
73
+ let n = e / t, r = Math.round(n), i = 2 ** -52 * Math.max(Math.abs(n), 1);
74
+ return Math.abs(n - r) < i ? 0 : n - r;
75
+ }
76
+ var p = /* @__PURE__*/ Symbol("evaluating");
77
+ function m(e, t, n) {
78
+ let r;
79
+ Object.defineProperty(e, t, {
80
+ get() {
81
+ if (r !== p) return r === void 0 && (r = p, r = n()), r;
82
+ },
83
+ set(n) {
84
+ Object.defineProperty(e, t, { value: n });
85
+ },
86
+ configurable: !0
87
+ });
88
+ }
89
+ function h(e, t, n) {
90
+ Object.defineProperty(e, t, {
91
+ value: n,
92
+ writable: !0,
93
+ enumerable: !0,
94
+ configurable: !0
95
+ });
96
+ }
97
+ function g(...e) {
98
+ let t = {};
99
+ for (let n of e) {
100
+ let e = Object.getOwnPropertyDescriptors(n);
101
+ Object.assign(t, e);
102
+ }
103
+ return Object.defineProperties({}, t);
104
+ }
105
+ function ee(e) {
106
+ return JSON.stringify(e);
107
+ }
108
+ function te(e) {
109
+ return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
110
+ }
111
+ var ne = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {};
112
+ function _(e) {
113
+ return typeof e == "object" && !!e && !Array.isArray(e);
114
+ }
115
+ var re = /* @__PURE__*/ l(() => {
116
+ if (a.jitless || typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare")) return !1;
117
+ try {
118
+ return Function(""), !0;
119
+ } catch {
120
+ return !1;
121
+ }
122
+ });
123
+ function v(e) {
124
+ if (_(e) === !1) return !1;
125
+ let t = e.constructor;
126
+ if (t === void 0 || typeof t != "function") return !0;
127
+ let n = t.prototype;
128
+ return !(_(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
129
+ }
130
+ function ie(e) {
131
+ return v(e) ? { ...e } : Array.isArray(e) ? [...e] : e instanceof Map ? new Map(e) : e instanceof Set ? new Set(e) : e;
132
+ }
133
+ var ae = /* @__PURE__*/ new Set([
134
+ "string",
135
+ "number",
136
+ "symbol"
137
+ ]);
138
+ function y(e) {
139
+ return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
140
+ }
141
+ function b(e, t, n) {
142
+ let r = new e._zod.constr(t ?? e._zod.def);
143
+ return (!t || n?.parent) && (r._zod.parent = e), r;
144
+ }
145
+ function x(e) {
146
+ let t = e;
147
+ if (!t) return {};
148
+ if (typeof t == "string") return { error: () => t };
149
+ if (t?.message !== void 0) {
150
+ if (t?.error !== void 0) throw Error("Cannot specify both `message` and `error` params");
151
+ t.error = t.message;
152
+ }
153
+ return delete t.message, typeof t.error == "string" ? {
154
+ ...t,
155
+ error: () => t.error
156
+ } : t;
157
+ }
158
+ function oe(e) {
159
+ return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
160
+ }
161
+ var se = {
162
+ safeint: [-(2 ** 53 - 1), 2 ** 53 - 1],
163
+ int32: [-2147483648, 2147483647],
164
+ uint32: [0, 4294967295],
165
+ float32: [-34028234663852886e22, 34028234663852886e22],
166
+ float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
167
+ };
168
+ function ce(e, t) {
169
+ let n = e._zod.def, r = n.checks;
170
+ if (r && r.length > 0) throw Error(".pick() cannot be used on object schemas containing refinements");
171
+ return b(e, g(e._zod.def, {
172
+ get shape() {
173
+ let e = {};
174
+ for (let r in t) {
175
+ if (!(r in n.shape)) throw Error(`Unrecognized key: "${r}"`);
176
+ t[r] && (e[r] = n.shape[r]);
177
+ }
178
+ return h(this, "shape", e), e;
179
+ },
180
+ checks: []
181
+ }));
182
+ }
183
+ function le(e, t) {
184
+ let n = e._zod.def, r = n.checks;
185
+ if (r && r.length > 0) throw Error(".omit() cannot be used on object schemas containing refinements");
186
+ return b(e, g(e._zod.def, {
187
+ get shape() {
188
+ let r = { ...e._zod.def.shape };
189
+ for (let e in t) {
190
+ if (!(e in n.shape)) throw Error(`Unrecognized key: "${e}"`);
191
+ t[e] && delete r[e];
192
+ }
193
+ return h(this, "shape", r), r;
194
+ },
195
+ checks: []
196
+ }));
197
+ }
198
+ function ue(e, t) {
199
+ if (!v(t)) throw Error("Invalid input to extend: expected a plain object");
200
+ let n = e._zod.def.checks;
201
+ if (n && n.length > 0) {
202
+ let n = e._zod.def.shape;
203
+ for (let e in t) if (Object.getOwnPropertyDescriptor(n, e) !== void 0) throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
204
+ }
205
+ return b(e, g(e._zod.def, { get shape() {
206
+ let n = {
207
+ ...e._zod.def.shape,
208
+ ...t
209
+ };
210
+ return h(this, "shape", n), n;
211
+ } }));
212
+ }
213
+ function de(e, t) {
214
+ if (!v(t)) throw Error("Invalid input to safeExtend: expected a plain object");
215
+ return b(e, g(e._zod.def, { get shape() {
216
+ let n = {
217
+ ...e._zod.def.shape,
218
+ ...t
219
+ };
220
+ return h(this, "shape", n), n;
221
+ } }));
222
+ }
223
+ function fe(e, t) {
224
+ if (e._zod.def.checks?.length) throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
225
+ return b(e, g(e._zod.def, {
226
+ get shape() {
227
+ let n = {
228
+ ...e._zod.def.shape,
229
+ ...t._zod.def.shape
230
+ };
231
+ return h(this, "shape", n), n;
232
+ },
233
+ get catchall() {
234
+ return t._zod.def.catchall;
235
+ },
236
+ checks: t._zod.def.checks ?? []
237
+ }));
238
+ }
239
+ function pe(e, t, n) {
240
+ let r = t._zod.def.checks;
241
+ if (r && r.length > 0) throw Error(".partial() cannot be used on object schemas containing refinements");
242
+ return b(t, g(t._zod.def, {
243
+ get shape() {
244
+ let r = t._zod.def.shape, i = { ...r };
245
+ if (n) for (let t in n) {
246
+ if (!(t in r)) throw Error(`Unrecognized key: "${t}"`);
247
+ n[t] && (i[t] = e ? new e({
248
+ type: "optional",
249
+ innerType: r[t]
250
+ }) : r[t]);
251
+ }
252
+ else for (let t in r) i[t] = e ? new e({
253
+ type: "optional",
254
+ innerType: r[t]
255
+ }) : r[t];
256
+ return h(this, "shape", i), i;
257
+ },
258
+ checks: []
259
+ }));
260
+ }
261
+ function me(e, t, n) {
262
+ return b(t, g(t._zod.def, { get shape() {
263
+ let r = t._zod.def.shape, i = { ...r };
264
+ if (n) for (let t in n) {
265
+ if (!(t in i)) throw Error(`Unrecognized key: "${t}"`);
266
+ n[t] && (i[t] = new e({
267
+ type: "nonoptional",
268
+ innerType: r[t]
269
+ }));
270
+ }
271
+ else for (let t in r) i[t] = new e({
272
+ type: "nonoptional",
273
+ innerType: r[t]
274
+ });
275
+ return h(this, "shape", i), i;
276
+ } }));
277
+ }
278
+ function S(e, t = 0) {
279
+ if (e.aborted === !0) return !0;
280
+ for (let n = t; n < e.issues.length; n++) if (e.issues[n]?.continue !== !0) return !0;
281
+ return !1;
282
+ }
283
+ function he(e, t = 0) {
284
+ if (e.aborted === !0) return !0;
285
+ for (let n = t; n < e.issues.length; n++) if (e.issues[n]?.continue === !1) return !0;
286
+ return !1;
287
+ }
288
+ function ge(e, t) {
289
+ return t.map((t) => {
290
+ var n;
291
+ return (n = t).path ?? (n.path = []), t.path.unshift(e), t;
292
+ });
293
+ }
294
+ function C(e) {
295
+ return typeof e == "string" ? e : e?.message;
296
+ }
297
+ function w(e, t, n) {
298
+ let r = e.message ? e.message : C(e.inst?._zod.def?.error?.(e)) ?? C(t?.error?.(e)) ?? C(n.customError?.(e)) ?? C(n.localeError?.(e)) ?? "Invalid input", { inst: i, continue: a, input: o, ...s } = e;
299
+ return s.path ??= [], s.message = r, t?.reportInput && (s.input = o), s;
300
+ }
301
+ function _e(e) {
302
+ return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
303
+ }
304
+ function T(...e) {
305
+ let [t, n, r] = e;
306
+ return typeof t == "string" ? {
307
+ message: t,
308
+ code: "custom",
309
+ input: n,
310
+ inst: r
311
+ } : { ...t };
312
+ }
313
+ //#endregion
314
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.js
315
+ var ve = (e, t) => {
316
+ e.name = "$ZodError", Object.defineProperty(e, "_zod", {
317
+ value: e._zod,
318
+ enumerable: !1
319
+ }), Object.defineProperty(e, "issues", {
320
+ value: t,
321
+ enumerable: !1
322
+ }), e.message = JSON.stringify(t, c, 2), Object.defineProperty(e, "toString", {
323
+ value: () => e.message,
324
+ enumerable: !1
325
+ });
326
+ }, ye = n("$ZodError", ve), be = n("$ZodError", ve, { Parent: Error });
327
+ function xe(e, t = (e) => e.message) {
328
+ let n = {}, r = [];
329
+ for (let i of e.issues) i.path.length > 0 ? (n[i.path[0]] = n[i.path[0]] || [], n[i.path[0]].push(t(i))) : r.push(t(i));
330
+ return {
331
+ formErrors: r,
332
+ fieldErrors: n
333
+ };
334
+ }
335
+ function Se(e, t = (e) => e.message) {
336
+ let n = { _errors: [] }, r = (e, i = []) => {
337
+ for (let a of e.issues) if (a.code === "invalid_union" && a.errors.length) a.errors.map((e) => r({ issues: e }, [...i, ...a.path]));
338
+ else if (a.code === "invalid_key") r({ issues: a.issues }, [...i, ...a.path]);
339
+ else if (a.code === "invalid_element") r({ issues: a.issues }, [...i, ...a.path]);
340
+ else {
341
+ let e = [...i, ...a.path];
342
+ if (e.length === 0) n._errors.push(t(a));
343
+ else {
344
+ let r = n, i = 0;
345
+ for (; i < e.length;) {
346
+ let n = e[i];
347
+ i === e.length - 1 ? (r[n] = r[n] || { _errors: [] }, r[n]._errors.push(t(a))) : r[n] = r[n] || { _errors: [] }, r = r[n], i++;
348
+ }
349
+ }
350
+ }
351
+ };
352
+ return r(e), n;
353
+ }
354
+ //#endregion
355
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/parse.js
356
+ var E = (e) => (t, n, i, a) => {
357
+ let s = i ? {
358
+ ...i,
359
+ async: !1
360
+ } : { async: !1 }, c = t._zod.run({
361
+ value: n,
362
+ issues: []
363
+ }, s);
364
+ if (c instanceof Promise) throw new r();
365
+ if (c.issues.length) {
366
+ let t = new ((a?.Err) ?? e)(c.issues.map((e) => w(e, s, o())));
367
+ throw ne(t, a?.callee), t;
368
+ }
369
+ return c.value;
370
+ }, D = (e) => async (t, n, r, i) => {
371
+ let a = r ? {
372
+ ...r,
373
+ async: !0
374
+ } : { async: !0 }, s = t._zod.run({
375
+ value: n,
376
+ issues: []
377
+ }, a);
378
+ if (s instanceof Promise && (s = await s), s.issues.length) {
379
+ let t = new ((i?.Err) ?? e)(s.issues.map((e) => w(e, a, o())));
380
+ throw ne(t, i?.callee), t;
381
+ }
382
+ return s.value;
383
+ }, O = (e) => (t, n, i) => {
384
+ let a = i ? {
385
+ ...i,
386
+ async: !1
387
+ } : { async: !1 }, s = t._zod.run({
388
+ value: n,
389
+ issues: []
390
+ }, a);
391
+ if (s instanceof Promise) throw new r();
392
+ return s.issues.length ? {
393
+ success: !1,
394
+ error: new (e ?? ye)(s.issues.map((e) => w(e, a, o())))
395
+ } : {
396
+ success: !0,
397
+ data: s.value
398
+ };
399
+ }, Ce = /* @__PURE__*/ O(be), k = (e) => async (t, n, r) => {
400
+ let i = r ? {
401
+ ...r,
402
+ async: !0
403
+ } : { async: !0 }, a = t._zod.run({
404
+ value: n,
405
+ issues: []
406
+ }, i);
407
+ return a instanceof Promise && (a = await a), a.issues.length ? {
408
+ success: !1,
409
+ error: new e(a.issues.map((e) => w(e, i, o())))
410
+ } : {
411
+ success: !0,
412
+ data: a.value
413
+ };
414
+ }, we = /* @__PURE__*/ k(be), Te = (e) => (t, n, r) => {
415
+ let i = r ? {
416
+ ...r,
417
+ direction: "backward"
418
+ } : { direction: "backward" };
419
+ return E(e)(t, n, i);
420
+ }, Ee = (e) => (t, n, r) => E(e)(t, n, r), De = (e) => async (t, n, r) => {
421
+ let i = r ? {
422
+ ...r,
423
+ direction: "backward"
424
+ } : { direction: "backward" };
425
+ return D(e)(t, n, i);
426
+ }, Oe = (e) => async (t, n, r) => D(e)(t, n, r), ke = (e) => (t, n, r) => {
427
+ let i = r ? {
428
+ ...r,
429
+ direction: "backward"
430
+ } : { direction: "backward" };
431
+ return O(e)(t, n, i);
432
+ }, Ae = (e) => (t, n, r) => O(e)(t, n, r), je = (e) => async (t, n, r) => {
433
+ let i = r ? {
434
+ ...r,
435
+ direction: "backward"
436
+ } : { direction: "backward" };
437
+ return k(e)(t, n, i);
438
+ }, Me = (e) => async (t, n, r) => k(e)(t, n, r), Ne = /^[cC][0-9a-z]{6,}$/, Pe = /^[0-9a-z]+$/, Fe = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, Ie = /^[0-9a-vA-V]{20}$/, Le = /^[A-Za-z0-9]{27}$/, Re = /^[a-zA-Z0-9_-]{21}$/, ze = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Be = /^([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})$/, Ve = (e) => e ? RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, He = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Ue = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
439
+ function We() {
440
+ return new RegExp(Ue, "u");
441
+ }
442
+ var Ge = /^(?:(?: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])$/, Ke = /^(([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}|:))$/, qe = /^((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])$/, Je = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/, Ye = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, Xe = /^[A-Za-z0-9_-]*$/, Ze = /^https?$/, Qe = /^\+[1-9]\d{6,14}$/, $e = "(?:(?:\\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])))", et = /*@__PURE__*/ RegExp(`^${$e}$`);
443
+ function tt(e) {
444
+ let t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
445
+ return typeof e.precision == "number" ? e.precision === -1 ? `${t}` : e.precision === 0 ? `${t}:[0-5]\\d` : `${t}:[0-5]\\d\\.\\d{${e.precision}}` : `${t}(?::[0-5]\\d(?:\\.\\d+)?)?`;
446
+ }
447
+ function nt(e) {
448
+ return RegExp(`^${tt(e)}$`);
449
+ }
450
+ function rt(e) {
451
+ let t = tt({ precision: e.precision }), n = ["Z"];
452
+ e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
453
+ let r = `${t}(?:${n.join("|")})`;
454
+ return RegExp(`^${$e}T(?:${r})$`);
455
+ }
456
+ var it = (e) => {
457
+ let t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
458
+ return RegExp(`^${t}$`);
459
+ }, at = /^-?\d+$/, ot = /^-?\d+(?:\.\d+)?$/, st = /^null$/i, ct = /^[^A-Z]*$/, lt = /^[^a-z]*$/, A = /*@__PURE__*/ n("$ZodCheck", (e, t) => {
460
+ var n;
461
+ e._zod ??= {}, e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
462
+ }), ut = {
463
+ number: "number",
464
+ bigint: "bigint",
465
+ object: "date"
466
+ }, dt = /*@__PURE__*/ n("$ZodCheckLessThan", (e, t) => {
467
+ A.init(e, t);
468
+ let n = ut[typeof t.value];
469
+ e._zod.onattach.push((e) => {
470
+ let n = e._zod.bag, r = (t.inclusive ? n.maximum : n.exclusiveMaximum) ?? Infinity;
471
+ t.value < r && (t.inclusive ? n.maximum = t.value : n.exclusiveMaximum = t.value);
472
+ }), e._zod.check = (r) => {
473
+ (t.inclusive ? r.value <= t.value : r.value < t.value) || r.issues.push({
474
+ origin: n,
475
+ code: "too_big",
476
+ maximum: typeof t.value == "object" ? t.value.getTime() : t.value,
477
+ input: r.value,
478
+ inclusive: t.inclusive,
479
+ inst: e,
480
+ continue: !t.abort
481
+ });
482
+ };
483
+ }), ft = /*@__PURE__*/ n("$ZodCheckGreaterThan", (e, t) => {
484
+ A.init(e, t);
485
+ let n = ut[typeof t.value];
486
+ e._zod.onattach.push((e) => {
487
+ let n = e._zod.bag, r = (t.inclusive ? n.minimum : n.exclusiveMinimum) ?? -Infinity;
488
+ t.value > r && (t.inclusive ? n.minimum = t.value : n.exclusiveMinimum = t.value);
489
+ }), e._zod.check = (r) => {
490
+ (t.inclusive ? r.value >= t.value : r.value > t.value) || r.issues.push({
491
+ origin: n,
492
+ code: "too_small",
493
+ minimum: typeof t.value == "object" ? t.value.getTime() : t.value,
494
+ input: r.value,
495
+ inclusive: t.inclusive,
496
+ inst: e,
497
+ continue: !t.abort
498
+ });
499
+ };
500
+ }), pt = /*@__PURE__*/ n("$ZodCheckMultipleOf", (e, t) => {
501
+ A.init(e, t), e._zod.onattach.push((e) => {
502
+ var n;
503
+ (n = e._zod.bag).multipleOf ?? (n.multipleOf = t.value);
504
+ }), e._zod.check = (n) => {
505
+ if (typeof n.value != typeof t.value) throw Error("Cannot mix number and bigint in multiple_of check.");
506
+ (typeof n.value == "bigint" ? n.value % t.value === BigInt(0) : f(n.value, t.value) === 0) || n.issues.push({
507
+ origin: typeof n.value,
508
+ code: "not_multiple_of",
509
+ divisor: t.value,
510
+ input: n.value,
511
+ inst: e,
512
+ continue: !t.abort
513
+ });
514
+ };
515
+ }), mt = /*@__PURE__*/ n("$ZodCheckNumberFormat", (e, t) => {
516
+ A.init(e, t), t.format = t.format || "float64";
517
+ let n = t.format?.includes("int"), r = n ? "int" : "number", [i, a] = se[t.format];
518
+ e._zod.onattach.push((e) => {
519
+ let r = e._zod.bag;
520
+ r.format = t.format, r.minimum = i, r.maximum = a, n && (r.pattern = at);
521
+ }), e._zod.check = (o) => {
522
+ let s = o.value;
523
+ if (n) {
524
+ if (!Number.isInteger(s)) {
525
+ o.issues.push({
526
+ expected: r,
527
+ format: t.format,
528
+ code: "invalid_type",
529
+ continue: !1,
530
+ input: s,
531
+ inst: e
532
+ });
533
+ return;
534
+ }
535
+ if (!Number.isSafeInteger(s)) {
536
+ s > 0 ? o.issues.push({
537
+ input: s,
538
+ code: "too_big",
539
+ maximum: 2 ** 53 - 1,
540
+ note: "Integers must be within the safe integer range.",
541
+ inst: e,
542
+ origin: r,
543
+ inclusive: !0,
544
+ continue: !t.abort
545
+ }) : o.issues.push({
546
+ input: s,
547
+ code: "too_small",
548
+ minimum: -(2 ** 53 - 1),
549
+ note: "Integers must be within the safe integer range.",
550
+ inst: e,
551
+ origin: r,
552
+ inclusive: !0,
553
+ continue: !t.abort
554
+ });
555
+ return;
556
+ }
557
+ }
558
+ s < i && o.issues.push({
559
+ origin: "number",
560
+ input: s,
561
+ code: "too_small",
562
+ minimum: i,
563
+ inclusive: !0,
564
+ inst: e,
565
+ continue: !t.abort
566
+ }), s > a && o.issues.push({
567
+ origin: "number",
568
+ input: s,
569
+ code: "too_big",
570
+ maximum: a,
571
+ inclusive: !0,
572
+ inst: e,
573
+ continue: !t.abort
574
+ });
575
+ };
576
+ }), ht = /*@__PURE__*/ n("$ZodCheckMaxLength", (e, t) => {
577
+ var n;
578
+ A.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
579
+ let t = e.value;
580
+ return !u(t) && t.length !== void 0;
581
+ }), e._zod.onattach.push((e) => {
582
+ let n = e._zod.bag.maximum ?? Infinity;
583
+ t.maximum < n && (e._zod.bag.maximum = t.maximum);
584
+ }), e._zod.check = (n) => {
585
+ let r = n.value;
586
+ if (r.length <= t.maximum) return;
587
+ let i = _e(r);
588
+ n.issues.push({
589
+ origin: i,
590
+ code: "too_big",
591
+ maximum: t.maximum,
592
+ inclusive: !0,
593
+ input: r,
594
+ inst: e,
595
+ continue: !t.abort
596
+ });
597
+ };
598
+ }), gt = /*@__PURE__*/ n("$ZodCheckMinLength", (e, t) => {
599
+ var n;
600
+ A.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
601
+ let t = e.value;
602
+ return !u(t) && t.length !== void 0;
603
+ }), e._zod.onattach.push((e) => {
604
+ let n = e._zod.bag.minimum ?? -Infinity;
605
+ t.minimum > n && (e._zod.bag.minimum = t.minimum);
606
+ }), e._zod.check = (n) => {
607
+ let r = n.value;
608
+ if (r.length >= t.minimum) return;
609
+ let i = _e(r);
610
+ n.issues.push({
611
+ origin: i,
612
+ code: "too_small",
613
+ minimum: t.minimum,
614
+ inclusive: !0,
615
+ input: r,
616
+ inst: e,
617
+ continue: !t.abort
618
+ });
619
+ };
620
+ }), _t = /*@__PURE__*/ n("$ZodCheckLengthEquals", (e, t) => {
621
+ var n;
622
+ A.init(e, t), (n = e._zod.def).when ?? (n.when = (e) => {
623
+ let t = e.value;
624
+ return !u(t) && t.length !== void 0;
625
+ }), e._zod.onattach.push((e) => {
626
+ let n = e._zod.bag;
627
+ n.minimum = t.length, n.maximum = t.length, n.length = t.length;
628
+ }), e._zod.check = (n) => {
629
+ let r = n.value, i = r.length;
630
+ if (i === t.length) return;
631
+ let a = _e(r), o = i > t.length;
632
+ n.issues.push({
633
+ origin: a,
634
+ ...o ? {
635
+ code: "too_big",
636
+ maximum: t.length
637
+ } : {
638
+ code: "too_small",
639
+ minimum: t.length
640
+ },
641
+ inclusive: !0,
642
+ exact: !0,
643
+ input: n.value,
644
+ inst: e,
645
+ continue: !t.abort
646
+ });
647
+ };
648
+ }), j = /*@__PURE__*/ n("$ZodCheckStringFormat", (e, t) => {
649
+ var n, r;
650
+ A.init(e, t), e._zod.onattach.push((e) => {
651
+ let n = e._zod.bag;
652
+ n.format = t.format, t.pattern && (n.patterns ??= /* @__PURE__ */ new Set(), n.patterns.add(t.pattern));
653
+ }), t.pattern ? (n = e._zod).check ?? (n.check = (n) => {
654
+ t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
655
+ origin: "string",
656
+ code: "invalid_format",
657
+ format: t.format,
658
+ input: n.value,
659
+ ...t.pattern ? { pattern: t.pattern.toString() } : {},
660
+ inst: e,
661
+ continue: !t.abort
662
+ });
663
+ }) : (r = e._zod).check ?? (r.check = () => {});
664
+ }), vt = /*@__PURE__*/ n("$ZodCheckRegex", (e, t) => {
665
+ j.init(e, t), e._zod.check = (n) => {
666
+ t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
667
+ origin: "string",
668
+ code: "invalid_format",
669
+ format: "regex",
670
+ input: n.value,
671
+ pattern: t.pattern.toString(),
672
+ inst: e,
673
+ continue: !t.abort
674
+ });
675
+ };
676
+ }), yt = /*@__PURE__*/ n("$ZodCheckLowerCase", (e, t) => {
677
+ t.pattern ??= ct, j.init(e, t);
678
+ }), bt = /*@__PURE__*/ n("$ZodCheckUpperCase", (e, t) => {
679
+ t.pattern ??= lt, j.init(e, t);
680
+ }), xt = /*@__PURE__*/ n("$ZodCheckIncludes", (e, t) => {
681
+ A.init(e, t);
682
+ let n = y(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
683
+ t.pattern = r, e._zod.onattach.push((e) => {
684
+ let t = e._zod.bag;
685
+ t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(r);
686
+ }), e._zod.check = (n) => {
687
+ n.value.includes(t.includes, t.position) || n.issues.push({
688
+ origin: "string",
689
+ code: "invalid_format",
690
+ format: "includes",
691
+ includes: t.includes,
692
+ input: n.value,
693
+ inst: e,
694
+ continue: !t.abort
695
+ });
696
+ };
697
+ }), St = /*@__PURE__*/ n("$ZodCheckStartsWith", (e, t) => {
698
+ A.init(e, t);
699
+ let n = RegExp(`^${y(t.prefix)}.*`);
700
+ t.pattern ??= n, e._zod.onattach.push((e) => {
701
+ let t = e._zod.bag;
702
+ t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n);
703
+ }), e._zod.check = (n) => {
704
+ n.value.startsWith(t.prefix) || n.issues.push({
705
+ origin: "string",
706
+ code: "invalid_format",
707
+ format: "starts_with",
708
+ prefix: t.prefix,
709
+ input: n.value,
710
+ inst: e,
711
+ continue: !t.abort
712
+ });
713
+ };
714
+ }), Ct = /*@__PURE__*/ n("$ZodCheckEndsWith", (e, t) => {
715
+ A.init(e, t);
716
+ let n = RegExp(`.*${y(t.suffix)}$`);
717
+ t.pattern ??= n, e._zod.onattach.push((e) => {
718
+ let t = e._zod.bag;
719
+ t.patterns ??= /* @__PURE__ */ new Set(), t.patterns.add(n);
720
+ }), e._zod.check = (n) => {
721
+ n.value.endsWith(t.suffix) || n.issues.push({
722
+ origin: "string",
723
+ code: "invalid_format",
724
+ format: "ends_with",
725
+ suffix: t.suffix,
726
+ input: n.value,
727
+ inst: e,
728
+ continue: !t.abort
729
+ });
730
+ };
731
+ }), wt = /*@__PURE__*/ n("$ZodCheckOverwrite", (e, t) => {
732
+ A.init(e, t), e._zod.check = (e) => {
733
+ e.value = t.tx(e.value);
734
+ };
735
+ }), Tt = class {
736
+ constructor(e = []) {
737
+ this.content = [], this.indent = 0, this && (this.args = e);
738
+ }
739
+ indented(e) {
740
+ this.indent += 1, e(this), --this.indent;
741
+ }
742
+ write(e) {
743
+ if (typeof e == "function") {
744
+ e(this, { execution: "sync" }), e(this, { execution: "async" });
745
+ return;
746
+ }
747
+ let t = e.split("\n").filter((e) => e), n = Math.min(...t.map((e) => e.length - e.trimStart().length)), r = t.map((e) => e.slice(n)).map((e) => " ".repeat(this.indent * 2) + e);
748
+ for (let e of r) this.content.push(e);
749
+ }
750
+ compile() {
751
+ let e = Function, t = this?.args, n = [...(this?.content ?? [""]).map((e) => ` ${e}`)];
752
+ return new e(...t, n.join("\n"));
753
+ }
754
+ }, Et = {
755
+ major: 4,
756
+ minor: 4,
757
+ patch: 3
758
+ }, M = /*@__PURE__*/ n("$ZodType", (e, t) => {
759
+ var n;
760
+ e ??= {}, e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = Et;
761
+ let i = [...e._zod.def.checks ?? []];
762
+ e._zod.traits.has("$ZodCheck") && i.unshift(e);
763
+ for (let t of i) for (let n of t._zod.onattach) n(e);
764
+ if (i.length === 0) (n = e._zod).deferred ?? (n.deferred = []), e._zod.deferred?.push(() => {
765
+ e._zod.run = e._zod.parse;
766
+ });
767
+ else {
768
+ let t = (e, t, n) => {
769
+ let i = S(e), a;
770
+ for (let o of t) {
771
+ if (o._zod.def.when) {
772
+ if (he(e) || !o._zod.def.when(e)) continue;
773
+ } else if (i) continue;
774
+ let t = e.issues.length, s = o._zod.check(e);
775
+ if (s instanceof Promise && n?.async === !1) throw new r();
776
+ if (a || s instanceof Promise) a = (a ?? Promise.resolve()).then(async () => {
777
+ await s, e.issues.length !== t && (i ||= S(e, t));
778
+ });
779
+ else {
780
+ if (e.issues.length === t) continue;
781
+ i ||= S(e, t);
782
+ }
783
+ }
784
+ return a ? a.then(() => e) : e;
785
+ }, n = (n, a, o) => {
786
+ if (S(n)) return n.aborted = !0, n;
787
+ let s = t(a, i, o);
788
+ if (s instanceof Promise) {
789
+ if (o.async === !1) throw new r();
790
+ return s.then((t) => e._zod.parse(t, o));
791
+ }
792
+ return e._zod.parse(s, o);
793
+ };
794
+ e._zod.run = (a, o) => {
795
+ if (o.skipChecks) return e._zod.parse(a, o);
796
+ if (o.direction === "backward") {
797
+ let t = e._zod.parse({
798
+ value: a.value,
799
+ issues: []
800
+ }, {
801
+ ...o,
802
+ skipChecks: !0
803
+ });
804
+ return t instanceof Promise ? t.then((e) => n(e, a, o)) : n(t, a, o);
805
+ }
806
+ let s = e._zod.parse(a, o);
807
+ if (s instanceof Promise) {
808
+ if (o.async === !1) throw new r();
809
+ return s.then((e) => t(e, i, o));
810
+ }
811
+ return t(s, i, o);
812
+ };
813
+ }
814
+ m(e, "~standard", () => ({
815
+ validate: (t) => {
816
+ try {
817
+ let n = Ce(e, t);
818
+ return n.success ? { value: n.data } : { issues: n.error?.issues };
819
+ } catch {
820
+ return we(e, t).then((e) => e.success ? { value: e.data } : { issues: e.error?.issues });
821
+ }
822
+ },
823
+ vendor: "zod",
824
+ version: 1
825
+ }));
826
+ }), Dt = /*@__PURE__*/ n("$ZodString", (e, t) => {
827
+ M.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? it(e._zod.bag), e._zod.parse = (n, r) => {
828
+ if (t.coerce) try {
829
+ n.value = String(n.value);
830
+ } catch {}
831
+ return typeof n.value == "string" || n.issues.push({
832
+ expected: "string",
833
+ code: "invalid_type",
834
+ input: n.value,
835
+ inst: e
836
+ }), n;
837
+ };
838
+ }), N = /*@__PURE__*/ n("$ZodStringFormat", (e, t) => {
839
+ j.init(e, t), Dt.init(e, t);
840
+ }), Ot = /*@__PURE__*/ n("$ZodGUID", (e, t) => {
841
+ t.pattern ??= Be, N.init(e, t);
842
+ }), kt = /*@__PURE__*/ n("$ZodUUID", (e, t) => {
843
+ if (t.version) {
844
+ let e = {
845
+ v1: 1,
846
+ v2: 2,
847
+ v3: 3,
848
+ v4: 4,
849
+ v5: 5,
850
+ v6: 6,
851
+ v7: 7,
852
+ v8: 8
853
+ }[t.version];
854
+ if (e === void 0) throw Error(`Invalid UUID version: "${t.version}"`);
855
+ t.pattern ??= Ve(e);
856
+ } else t.pattern ??= Ve();
857
+ N.init(e, t);
858
+ }), At = /*@__PURE__*/ n("$ZodEmail", (e, t) => {
859
+ t.pattern ??= He, N.init(e, t);
860
+ }), jt = /*@__PURE__*/ n("$ZodURL", (e, t) => {
861
+ N.init(e, t), e._zod.check = (n) => {
862
+ try {
863
+ let r = n.value.trim();
864
+ if (!t.normalize && t.protocol?.source === Ze.source && !/^https?:\/\//i.test(r)) {
865
+ n.issues.push({
866
+ code: "invalid_format",
867
+ format: "url",
868
+ note: "Invalid URL format",
869
+ input: n.value,
870
+ inst: e,
871
+ continue: !t.abort
872
+ });
873
+ return;
874
+ }
875
+ let i = new URL(r);
876
+ t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(i.hostname) || n.issues.push({
877
+ code: "invalid_format",
878
+ format: "url",
879
+ note: "Invalid hostname",
880
+ pattern: t.hostname.source,
881
+ input: n.value,
882
+ inst: e,
883
+ continue: !t.abort
884
+ })), t.protocol && (t.protocol.lastIndex = 0, t.protocol.test(i.protocol.endsWith(":") ? i.protocol.slice(0, -1) : i.protocol) || n.issues.push({
885
+ code: "invalid_format",
886
+ format: "url",
887
+ note: "Invalid protocol",
888
+ pattern: t.protocol.source,
889
+ input: n.value,
890
+ inst: e,
891
+ continue: !t.abort
892
+ })), t.normalize ? n.value = i.href : n.value = r;
893
+ return;
894
+ } catch {
895
+ n.issues.push({
896
+ code: "invalid_format",
897
+ format: "url",
898
+ input: n.value,
899
+ inst: e,
900
+ continue: !t.abort
901
+ });
902
+ }
903
+ };
904
+ }), Mt = /*@__PURE__*/ n("$ZodEmoji", (e, t) => {
905
+ t.pattern ??= We(), N.init(e, t);
906
+ }), Nt = /*@__PURE__*/ n("$ZodNanoID", (e, t) => {
907
+ t.pattern ??= Re, N.init(e, t);
908
+ }), Pt = /*@__PURE__*/ n("$ZodCUID", (e, t) => {
909
+ t.pattern ??= Ne, N.init(e, t);
910
+ }), Ft = /*@__PURE__*/ n("$ZodCUID2", (e, t) => {
911
+ t.pattern ??= Pe, N.init(e, t);
912
+ }), It = /*@__PURE__*/ n("$ZodULID", (e, t) => {
913
+ t.pattern ??= Fe, N.init(e, t);
914
+ }), Lt = /*@__PURE__*/ n("$ZodXID", (e, t) => {
915
+ t.pattern ??= Ie, N.init(e, t);
916
+ }), Rt = /*@__PURE__*/ n("$ZodKSUID", (e, t) => {
917
+ t.pattern ??= Le, N.init(e, t);
918
+ }), zt = /*@__PURE__*/ n("$ZodISODateTime", (e, t) => {
919
+ t.pattern ??= rt(t), N.init(e, t);
920
+ }), Bt = /*@__PURE__*/ n("$ZodISODate", (e, t) => {
921
+ t.pattern ??= et, N.init(e, t);
922
+ }), Vt = /*@__PURE__*/ n("$ZodISOTime", (e, t) => {
923
+ t.pattern ??= nt(t), N.init(e, t);
924
+ }), Ht = /*@__PURE__*/ n("$ZodISODuration", (e, t) => {
925
+ t.pattern ??= ze, N.init(e, t);
926
+ }), Ut = /*@__PURE__*/ n("$ZodIPv4", (e, t) => {
927
+ t.pattern ??= Ge, N.init(e, t), e._zod.bag.format = "ipv4";
928
+ }), Wt = /*@__PURE__*/ n("$ZodIPv6", (e, t) => {
929
+ t.pattern ??= Ke, N.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (n) => {
930
+ try {
931
+ new URL(`http://[${n.value}]`);
932
+ } catch {
933
+ n.issues.push({
934
+ code: "invalid_format",
935
+ format: "ipv6",
936
+ input: n.value,
937
+ inst: e,
938
+ continue: !t.abort
939
+ });
940
+ }
941
+ };
942
+ }), Gt = /*@__PURE__*/ n("$ZodCIDRv4", (e, t) => {
943
+ t.pattern ??= qe, N.init(e, t);
944
+ }), Kt = /*@__PURE__*/ n("$ZodCIDRv6", (e, t) => {
945
+ t.pattern ??= Je, N.init(e, t), e._zod.check = (n) => {
946
+ let r = n.value.split("/");
947
+ try {
948
+ if (r.length !== 2) throw Error();
949
+ let [e, t] = r;
950
+ if (!t) throw Error();
951
+ let n = Number(t);
952
+ if (`${n}` !== t || n < 0 || n > 128) throw Error();
953
+ new URL(`http://[${e}]`);
954
+ } catch {
955
+ n.issues.push({
956
+ code: "invalid_format",
957
+ format: "cidrv6",
958
+ input: n.value,
959
+ inst: e,
960
+ continue: !t.abort
961
+ });
962
+ }
963
+ };
964
+ });
965
+ function qt(e) {
966
+ if (e === "") return !0;
967
+ if (/\s/.test(e) || e.length % 4 != 0) return !1;
968
+ try {
969
+ return atob(e), !0;
970
+ } catch {
971
+ return !1;
972
+ }
973
+ }
974
+ var Jt = /*@__PURE__*/ n("$ZodBase64", (e, t) => {
975
+ t.pattern ??= Ye, N.init(e, t), e._zod.bag.contentEncoding = "base64", e._zod.check = (n) => {
976
+ qt(n.value) || n.issues.push({
977
+ code: "invalid_format",
978
+ format: "base64",
979
+ input: n.value,
980
+ inst: e,
981
+ continue: !t.abort
982
+ });
983
+ };
984
+ });
985
+ function Yt(e) {
986
+ if (!Xe.test(e)) return !1;
987
+ let t = e.replace(/[-_]/g, (e) => e === "-" ? "+" : "/");
988
+ return qt(t.padEnd(Math.ceil(t.length / 4) * 4, "="));
989
+ }
990
+ var Xt = /*@__PURE__*/ n("$ZodBase64URL", (e, t) => {
991
+ t.pattern ??= Xe, N.init(e, t), e._zod.bag.contentEncoding = "base64url", e._zod.check = (n) => {
992
+ Yt(n.value) || n.issues.push({
993
+ code: "invalid_format",
994
+ format: "base64url",
995
+ input: n.value,
996
+ inst: e,
997
+ continue: !t.abort
998
+ });
999
+ };
1000
+ }), Zt = /*@__PURE__*/ n("$ZodE164", (e, t) => {
1001
+ t.pattern ??= Qe, N.init(e, t);
1002
+ });
1003
+ function Qt(e, t = null) {
1004
+ try {
1005
+ let n = e.split(".");
1006
+ if (n.length !== 3) return !1;
1007
+ let [r] = n;
1008
+ if (!r) return !1;
1009
+ let i = JSON.parse(atob(r));
1010
+ return !("typ" in i && i?.typ !== "JWT" || !i.alg || t && (!("alg" in i) || i.alg !== t));
1011
+ } catch {
1012
+ return !1;
1013
+ }
1014
+ }
1015
+ var $t = /*@__PURE__*/ n("$ZodJWT", (e, t) => {
1016
+ N.init(e, t), e._zod.check = (n) => {
1017
+ Qt(n.value, t.alg) || n.issues.push({
1018
+ code: "invalid_format",
1019
+ format: "jwt",
1020
+ input: n.value,
1021
+ inst: e,
1022
+ continue: !t.abort
1023
+ });
1024
+ };
1025
+ }), en = /*@__PURE__*/ n("$ZodNumber", (e, t) => {
1026
+ M.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? ot, e._zod.parse = (n, r) => {
1027
+ if (t.coerce) try {
1028
+ n.value = Number(n.value);
1029
+ } catch {}
1030
+ let i = n.value;
1031
+ if (typeof i == "number" && !Number.isNaN(i) && Number.isFinite(i)) return n;
1032
+ let a = typeof i == "number" ? Number.isNaN(i) ? "NaN" : Number.isFinite(i) ? void 0 : "Infinity" : void 0;
1033
+ return n.issues.push({
1034
+ expected: "number",
1035
+ code: "invalid_type",
1036
+ input: i,
1037
+ inst: e,
1038
+ ...a ? { received: a } : {}
1039
+ }), n;
1040
+ };
1041
+ }), tn = /*@__PURE__*/ n("$ZodNumberFormat", (e, t) => {
1042
+ mt.init(e, t), en.init(e, t);
1043
+ }), nn = /*@__PURE__*/ n("$ZodNull", (e, t) => {
1044
+ M.init(e, t), e._zod.pattern = st, e._zod.values = /* @__PURE__ */ new Set([null]), e._zod.parse = (t, n) => {
1045
+ let r = t.value;
1046
+ return r === null || t.issues.push({
1047
+ expected: "null",
1048
+ code: "invalid_type",
1049
+ input: r,
1050
+ inst: e
1051
+ }), t;
1052
+ };
1053
+ }), rn = /*@__PURE__*/ n("$ZodUnknown", (e, t) => {
1054
+ M.init(e, t), e._zod.parse = (e) => e;
1055
+ }), an = /*@__PURE__*/ n("$ZodNever", (e, t) => {
1056
+ M.init(e, t), e._zod.parse = (t, n) => (t.issues.push({
1057
+ expected: "never",
1058
+ code: "invalid_type",
1059
+ input: t.value,
1060
+ inst: e
1061
+ }), t);
1062
+ });
1063
+ function on(e, t, n) {
1064
+ e.issues.length && t.issues.push(...ge(n, e.issues)), t.value[n] = e.value;
1065
+ }
1066
+ var sn = /*@__PURE__*/ n("$ZodArray", (e, t) => {
1067
+ M.init(e, t), e._zod.parse = (n, r) => {
1068
+ let i = n.value;
1069
+ if (!Array.isArray(i)) return n.issues.push({
1070
+ expected: "array",
1071
+ code: "invalid_type",
1072
+ input: i,
1073
+ inst: e
1074
+ }), n;
1075
+ n.value = Array(i.length);
1076
+ let a = [];
1077
+ for (let e = 0; e < i.length; e++) {
1078
+ let o = i[e], s = t.element._zod.run({
1079
+ value: o,
1080
+ issues: []
1081
+ }, r);
1082
+ s instanceof Promise ? a.push(s.then((t) => on(t, n, e))) : on(s, n, e);
1083
+ }
1084
+ return a.length ? Promise.all(a).then(() => n) : n;
1085
+ };
1086
+ });
1087
+ function P(e, t, n, r, i, a) {
1088
+ let o = n in r;
1089
+ if (e.issues.length) {
1090
+ if (i && a && !o) return;
1091
+ t.issues.push(...ge(n, e.issues));
1092
+ }
1093
+ if (!o && !i) {
1094
+ e.issues.length || t.issues.push({
1095
+ code: "invalid_type",
1096
+ expected: "nonoptional",
1097
+ input: void 0,
1098
+ path: [n]
1099
+ });
1100
+ return;
1101
+ }
1102
+ e.value === void 0 ? o && (t.value[n] = void 0) : t.value[n] = e.value;
1103
+ }
1104
+ function cn(e) {
1105
+ let t = Object.keys(e.shape);
1106
+ for (let n of t) if (!e.shape?.[n]?._zod?.traits?.has("$ZodType")) throw Error(`Invalid element at key "${n}": expected a Zod schema`);
1107
+ let n = oe(e.shape);
1108
+ return {
1109
+ ...e,
1110
+ keys: t,
1111
+ keySet: new Set(t),
1112
+ numKeys: t.length,
1113
+ optionalKeys: new Set(n)
1114
+ };
1115
+ }
1116
+ function ln(e, t, n, r, i, a) {
1117
+ let o = [], s = i.keySet, c = i.catchall._zod, l = c.def.type, u = c.optin === "optional", d = c.optout === "optional";
1118
+ for (let i in t) {
1119
+ if (i === "__proto__" || s.has(i)) continue;
1120
+ if (l === "never") {
1121
+ o.push(i);
1122
+ continue;
1123
+ }
1124
+ let a = c.run({
1125
+ value: t[i],
1126
+ issues: []
1127
+ }, r);
1128
+ a instanceof Promise ? e.push(a.then((e) => P(e, n, i, t, u, d))) : P(a, n, i, t, u, d);
1129
+ }
1130
+ return o.length && n.issues.push({
1131
+ code: "unrecognized_keys",
1132
+ keys: o,
1133
+ input: t,
1134
+ inst: a
1135
+ }), e.length ? Promise.all(e).then(() => n) : n;
1136
+ }
1137
+ var un = /*@__PURE__*/ n("$ZodObject", (e, t) => {
1138
+ if (M.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
1139
+ let e = t.shape;
1140
+ Object.defineProperty(t, "shape", { get: () => {
1141
+ let n = { ...e };
1142
+ return Object.defineProperty(t, "shape", { value: n }), n;
1143
+ } });
1144
+ }
1145
+ let n = l(() => cn(t));
1146
+ m(e._zod, "propValues", () => {
1147
+ let e = t.shape, n = {};
1148
+ for (let t in e) {
1149
+ let r = e[t]._zod;
1150
+ if (r.values) {
1151
+ n[t] ?? (n[t] = /* @__PURE__ */ new Set());
1152
+ for (let e of r.values) n[t].add(e);
1153
+ }
1154
+ }
1155
+ return n;
1156
+ });
1157
+ let r = _, i = t.catchall, a;
1158
+ e._zod.parse = (t, o) => {
1159
+ a ??= n.value;
1160
+ let s = t.value;
1161
+ if (!r(s)) return t.issues.push({
1162
+ expected: "object",
1163
+ code: "invalid_type",
1164
+ input: s,
1165
+ inst: e
1166
+ }), t;
1167
+ t.value = {};
1168
+ let c = [], l = a.shape;
1169
+ for (let e of a.keys) {
1170
+ let n = l[e], r = n._zod.optin === "optional", i = n._zod.optout === "optional", a = n._zod.run({
1171
+ value: s[e],
1172
+ issues: []
1173
+ }, o);
1174
+ a instanceof Promise ? c.push(a.then((n) => P(n, t, e, s, r, i))) : P(a, t, e, s, r, i);
1175
+ }
1176
+ return i ? ln(c, s, t, o, n.value, e) : c.length ? Promise.all(c).then(() => t) : t;
1177
+ };
1178
+ }), dn = /*@__PURE__*/ n("$ZodObjectJIT", (e, t) => {
1179
+ un.init(e, t);
1180
+ let n = e._zod.parse, r = l(() => cn(t)), i = (e) => {
1181
+ let t = new Tt([
1182
+ "shape",
1183
+ "payload",
1184
+ "ctx"
1185
+ ]), n = r.value, i = (e) => {
1186
+ let t = ee(e);
1187
+ return `shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`;
1188
+ };
1189
+ t.write("const input = payload.value;");
1190
+ let a = Object.create(null), o = 0;
1191
+ for (let e of n.keys) a[e] = `key_${o++}`;
1192
+ t.write("const newResult = {};");
1193
+ for (let r of n.keys) {
1194
+ let n = a[r], o = ee(r), s = e[r], c = s?._zod?.optin === "optional", l = s?._zod?.optout === "optional";
1195
+ t.write(`const ${n} = ${i(r)};`), c && l ? t.write(`
1196
+ if (${n}.issues.length) {
1197
+ if (${o} in input) {
1198
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
1199
+ ...iss,
1200
+ path: iss.path ? [${o}, ...iss.path] : [${o}]
1201
+ })));
1202
+ }
1203
+ }
1204
+
1205
+ if (${n}.value === undefined) {
1206
+ if (${o} in input) {
1207
+ newResult[${o}] = undefined;
1208
+ }
1209
+ } else {
1210
+ newResult[${o}] = ${n}.value;
1211
+ }
1212
+
1213
+ `) : c ? t.write(`
1214
+ if (${n}.issues.length) {
1215
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
1216
+ ...iss,
1217
+ path: iss.path ? [${o}, ...iss.path] : [${o}]
1218
+ })));
1219
+ }
1220
+
1221
+ if (${n}.value === undefined) {
1222
+ if (${o} in input) {
1223
+ newResult[${o}] = undefined;
1224
+ }
1225
+ } else {
1226
+ newResult[${o}] = ${n}.value;
1227
+ }
1228
+
1229
+ `) : t.write(`
1230
+ const ${n}_present = ${o} in input;
1231
+ if (${n}.issues.length) {
1232
+ payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
1233
+ ...iss,
1234
+ path: iss.path ? [${o}, ...iss.path] : [${o}]
1235
+ })));
1236
+ }
1237
+ if (!${n}_present && !${n}.issues.length) {
1238
+ payload.issues.push({
1239
+ code: "invalid_type",
1240
+ expected: "nonoptional",
1241
+ input: undefined,
1242
+ path: [${o}]
1243
+ });
1244
+ }
1245
+
1246
+ if (${n}_present) {
1247
+ if (${n}.value === undefined) {
1248
+ newResult[${o}] = undefined;
1249
+ } else {
1250
+ newResult[${o}] = ${n}.value;
1251
+ }
1252
+ }
1253
+
1254
+ `);
1255
+ }
1256
+ t.write("payload.value = newResult;"), t.write("return payload;");
1257
+ let s = t.compile();
1258
+ return (t, n) => s(e, t, n);
1259
+ }, o, s = _, c = !a.jitless, u = c && re.value, d = t.catchall, f;
1260
+ e._zod.parse = (a, l) => {
1261
+ f ??= r.value;
1262
+ let p = a.value;
1263
+ return s(p) ? c && u && l?.async === !1 && l.jitless !== !0 ? (o ||= i(t.shape), a = o(a, l), d ? ln([], p, a, l, f, e) : a) : n(a, l) : (a.issues.push({
1264
+ expected: "object",
1265
+ code: "invalid_type",
1266
+ input: p,
1267
+ inst: e
1268
+ }), a);
1269
+ };
1270
+ });
1271
+ function fn(e, t, n, r) {
1272
+ for (let n of e) if (n.issues.length === 0) return t.value = n.value, t;
1273
+ let i = e.filter((e) => !S(e));
1274
+ return i.length === 1 ? (t.value = i[0].value, i[0]) : (t.issues.push({
1275
+ code: "invalid_union",
1276
+ input: t.value,
1277
+ inst: n,
1278
+ errors: e.map((e) => e.issues.map((e) => w(e, r, o())))
1279
+ }), t);
1280
+ }
1281
+ var pn = /*@__PURE__*/ n("$ZodUnion", (e, t) => {
1282
+ M.init(e, t), m(e._zod, "optin", () => t.options.some((e) => e._zod.optin === "optional") ? "optional" : void 0), m(e._zod, "optout", () => t.options.some((e) => e._zod.optout === "optional") ? "optional" : void 0), m(e._zod, "values", () => {
1283
+ if (t.options.every((e) => e._zod.values)) return new Set(t.options.flatMap((e) => Array.from(e._zod.values)));
1284
+ }), m(e._zod, "pattern", () => {
1285
+ if (t.options.every((e) => e._zod.pattern)) {
1286
+ let e = t.options.map((e) => e._zod.pattern);
1287
+ return RegExp(`^(${e.map((e) => d(e.source)).join("|")})$`);
1288
+ }
1289
+ });
1290
+ let n = t.options.length === 1 ? t.options[0]._zod.run : null;
1291
+ e._zod.parse = (r, i) => {
1292
+ if (n) return n(r, i);
1293
+ let a = !1, o = [];
1294
+ for (let e of t.options) {
1295
+ let t = e._zod.run({
1296
+ value: r.value,
1297
+ issues: []
1298
+ }, i);
1299
+ if (t instanceof Promise) o.push(t), a = !0;
1300
+ else {
1301
+ if (t.issues.length === 0) return t;
1302
+ o.push(t);
1303
+ }
1304
+ }
1305
+ return a ? Promise.all(o).then((t) => fn(t, r, e, i)) : fn(o, r, e, i);
1306
+ };
1307
+ }), mn = /*@__PURE__*/ n("$ZodIntersection", (e, t) => {
1308
+ M.init(e, t), e._zod.parse = (e, n) => {
1309
+ let r = e.value, i = t.left._zod.run({
1310
+ value: r,
1311
+ issues: []
1312
+ }, n), a = t.right._zod.run({
1313
+ value: r,
1314
+ issues: []
1315
+ }, n);
1316
+ return i instanceof Promise || a instanceof Promise ? Promise.all([i, a]).then(([t, n]) => hn(e, t, n)) : hn(e, i, a);
1317
+ };
1318
+ });
1319
+ function F(e, t) {
1320
+ if (e === t || e instanceof Date && t instanceof Date && +e == +t) return {
1321
+ valid: !0,
1322
+ data: e
1323
+ };
1324
+ if (v(e) && v(t)) {
1325
+ let n = Object.keys(t), r = Object.keys(e).filter((e) => n.indexOf(e) !== -1), i = {
1326
+ ...e,
1327
+ ...t
1328
+ };
1329
+ for (let n of r) {
1330
+ let r = F(e[n], t[n]);
1331
+ if (!r.valid) return {
1332
+ valid: !1,
1333
+ mergeErrorPath: [n, ...r.mergeErrorPath]
1334
+ };
1335
+ i[n] = r.data;
1336
+ }
1337
+ return {
1338
+ valid: !0,
1339
+ data: i
1340
+ };
1341
+ }
1342
+ if (Array.isArray(e) && Array.isArray(t)) {
1343
+ if (e.length !== t.length) return {
1344
+ valid: !1,
1345
+ mergeErrorPath: []
1346
+ };
1347
+ let n = [];
1348
+ for (let r = 0; r < e.length; r++) {
1349
+ let i = e[r], a = t[r], o = F(i, a);
1350
+ if (!o.valid) return {
1351
+ valid: !1,
1352
+ mergeErrorPath: [r, ...o.mergeErrorPath]
1353
+ };
1354
+ n.push(o.data);
1355
+ }
1356
+ return {
1357
+ valid: !0,
1358
+ data: n
1359
+ };
1360
+ }
1361
+ return {
1362
+ valid: !1,
1363
+ mergeErrorPath: []
1364
+ };
1365
+ }
1366
+ function hn(e, t, n) {
1367
+ let r = /* @__PURE__ */ new Map(), i;
1368
+ for (let n of t.issues) if (n.code === "unrecognized_keys") {
1369
+ i ??= n;
1370
+ for (let e of n.keys) r.has(e) || r.set(e, {}), r.get(e).l = !0;
1371
+ } else e.issues.push(n);
1372
+ for (let t of n.issues) if (t.code === "unrecognized_keys") for (let e of t.keys) r.has(e) || r.set(e, {}), r.get(e).r = !0;
1373
+ else e.issues.push(t);
1374
+ let a = [...r].filter(([, e]) => e.l && e.r).map(([e]) => e);
1375
+ if (a.length && i && e.issues.push({
1376
+ ...i,
1377
+ keys: a
1378
+ }), S(e)) return e;
1379
+ let o = F(t.value, n.value);
1380
+ if (!o.valid) throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);
1381
+ return e.value = o.data, e;
1382
+ }
1383
+ var gn = /*@__PURE__*/ n("$ZodEnum", (e, t) => {
1384
+ M.init(e, t);
1385
+ let n = s(t.entries), r = new Set(n);
1386
+ e._zod.values = r, e._zod.pattern = RegExp(`^(${n.filter((e) => ae.has(typeof e)).map((e) => typeof e == "string" ? y(e) : e.toString()).join("|")})$`), e._zod.parse = (t, i) => {
1387
+ let a = t.value;
1388
+ return r.has(a) || t.issues.push({
1389
+ code: "invalid_value",
1390
+ values: n,
1391
+ input: a,
1392
+ inst: e
1393
+ }), t;
1394
+ };
1395
+ }), _n = /*@__PURE__*/ n("$ZodTransform", (e, t) => {
1396
+ M.init(e, t), e._zod.optin = "optional", e._zod.parse = (n, a) => {
1397
+ if (a.direction === "backward") throw new i(e.constructor.name);
1398
+ let o = t.transform(n.value, n);
1399
+ if (a.async) return (o instanceof Promise ? o : Promise.resolve(o)).then((e) => (n.value = e, n.fallback = !0, n));
1400
+ if (o instanceof Promise) throw new r();
1401
+ return n.value = o, n.fallback = !0, n;
1402
+ };
1403
+ });
1404
+ function vn(e, t) {
1405
+ return t === void 0 && (e.issues.length || e.fallback) ? {
1406
+ issues: [],
1407
+ value: void 0
1408
+ } : e;
1409
+ }
1410
+ var yn = /*@__PURE__*/ n("$ZodOptional", (e, t) => {
1411
+ M.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", m(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), m(e._zod, "pattern", () => {
1412
+ let e = t.innerType._zod.pattern;
1413
+ return e ? RegExp(`^(${d(e.source)})?$`) : void 0;
1414
+ }), e._zod.parse = (e, n) => {
1415
+ if (t.innerType._zod.optin === "optional") {
1416
+ let r = e.value, i = t.innerType._zod.run(e, n);
1417
+ return i instanceof Promise ? i.then((e) => vn(e, r)) : vn(i, r);
1418
+ }
1419
+ return e.value === void 0 ? e : t.innerType._zod.run(e, n);
1420
+ };
1421
+ }), bn = /*@__PURE__*/ n("$ZodExactOptional", (e, t) => {
1422
+ yn.init(e, t), m(e._zod, "values", () => t.innerType._zod.values), m(e._zod, "pattern", () => t.innerType._zod.pattern), e._zod.parse = (e, n) => t.innerType._zod.run(e, n);
1423
+ }), xn = /*@__PURE__*/ n("$ZodNullable", (e, t) => {
1424
+ M.init(e, t), m(e._zod, "optin", () => t.innerType._zod.optin), m(e._zod, "optout", () => t.innerType._zod.optout), m(e._zod, "pattern", () => {
1425
+ let e = t.innerType._zod.pattern;
1426
+ return e ? RegExp(`^(${d(e.source)}|null)$`) : void 0;
1427
+ }), m(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (e, n) => e.value === null ? e : t.innerType._zod.run(e, n);
1428
+ }), Sn = /*@__PURE__*/ n("$ZodDefault", (e, t) => {
1429
+ M.init(e, t), e._zod.optin = "optional", m(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (e, n) => {
1430
+ if (n.direction === "backward") return t.innerType._zod.run(e, n);
1431
+ if (e.value === void 0) return e.value = t.defaultValue, e;
1432
+ let r = t.innerType._zod.run(e, n);
1433
+ return r instanceof Promise ? r.then((e) => Cn(e, t)) : Cn(r, t);
1434
+ };
1435
+ });
1436
+ function Cn(e, t) {
1437
+ return e.value === void 0 && (e.value = t.defaultValue), e;
1438
+ }
1439
+ var wn = /*@__PURE__*/ n("$ZodPrefault", (e, t) => {
1440
+ M.init(e, t), e._zod.optin = "optional", m(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (e, n) => (n.direction === "backward" || e.value === void 0 && (e.value = t.defaultValue), t.innerType._zod.run(e, n));
1441
+ }), Tn = /*@__PURE__*/ n("$ZodNonOptional", (e, t) => {
1442
+ M.init(e, t), m(e._zod, "values", () => {
1443
+ let e = t.innerType._zod.values;
1444
+ return e ? new Set([...e].filter((e) => e !== void 0)) : void 0;
1445
+ }), e._zod.parse = (n, r) => {
1446
+ let i = t.innerType._zod.run(n, r);
1447
+ return i instanceof Promise ? i.then((t) => En(t, e)) : En(i, e);
1448
+ };
1449
+ });
1450
+ function En(e, t) {
1451
+ return !e.issues.length && e.value === void 0 && e.issues.push({
1452
+ code: "invalid_type",
1453
+ expected: "nonoptional",
1454
+ input: e.value,
1455
+ inst: t
1456
+ }), e;
1457
+ }
1458
+ var Dn = /*@__PURE__*/ n("$ZodCatch", (e, t) => {
1459
+ M.init(e, t), e._zod.optin = "optional", m(e._zod, "optout", () => t.innerType._zod.optout), m(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (e, n) => {
1460
+ if (n.direction === "backward") return t.innerType._zod.run(e, n);
1461
+ let r = t.innerType._zod.run(e, n);
1462
+ return r instanceof Promise ? r.then((r) => (e.value = r.value, r.issues.length && (e.value = t.catchValue({
1463
+ ...e,
1464
+ error: { issues: r.issues.map((e) => w(e, n, o())) },
1465
+ input: e.value
1466
+ }), e.issues = [], e.fallback = !0), e)) : (e.value = r.value, r.issues.length && (e.value = t.catchValue({
1467
+ ...e,
1468
+ error: { issues: r.issues.map((e) => w(e, n, o())) },
1469
+ input: e.value
1470
+ }), e.issues = [], e.fallback = !0), e);
1471
+ };
1472
+ }), On = /*@__PURE__*/ n("$ZodPipe", (e, t) => {
1473
+ M.init(e, t), m(e._zod, "values", () => t.in._zod.values), m(e._zod, "optin", () => t.in._zod.optin), m(e._zod, "optout", () => t.out._zod.optout), m(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (e, n) => {
1474
+ if (n.direction === "backward") {
1475
+ let r = t.out._zod.run(e, n);
1476
+ return r instanceof Promise ? r.then((e) => I(e, t.in, n)) : I(r, t.in, n);
1477
+ }
1478
+ let r = t.in._zod.run(e, n);
1479
+ return r instanceof Promise ? r.then((e) => I(e, t.out, n)) : I(r, t.out, n);
1480
+ };
1481
+ });
1482
+ function I(e, t, n) {
1483
+ return e.issues.length ? (e.aborted = !0, e) : t._zod.run({
1484
+ value: e.value,
1485
+ issues: e.issues,
1486
+ fallback: e.fallback
1487
+ }, n);
1488
+ }
1489
+ var kn = /*@__PURE__*/ n("$ZodReadonly", (e, t) => {
1490
+ M.init(e, t), m(e._zod, "propValues", () => t.innerType._zod.propValues), m(e._zod, "values", () => t.innerType._zod.values), m(e._zod, "optin", () => t.innerType?._zod?.optin), m(e._zod, "optout", () => t.innerType?._zod?.optout), e._zod.parse = (e, n) => {
1491
+ if (n.direction === "backward") return t.innerType._zod.run(e, n);
1492
+ let r = t.innerType._zod.run(e, n);
1493
+ return r instanceof Promise ? r.then(An) : An(r);
1494
+ };
1495
+ });
1496
+ function An(e) {
1497
+ return e.value = Object.freeze(e.value), e;
1498
+ }
1499
+ var jn = /*@__PURE__*/ n("$ZodCustom", (e, t) => {
1500
+ A.init(e, t), M.init(e, t), e._zod.parse = (e, t) => e, e._zod.check = (n) => {
1501
+ let r = n.value, i = t.fn(r);
1502
+ if (i instanceof Promise) return i.then((t) => Mn(t, n, r, e));
1503
+ Mn(i, n, r, e);
1504
+ };
1505
+ });
1506
+ function Mn(e, t, n, r) {
1507
+ if (!e) {
1508
+ let e = {
1509
+ code: "custom",
1510
+ input: n,
1511
+ inst: r,
1512
+ path: [...r._zod.def.path ?? []],
1513
+ continue: !r._zod.def.abort
1514
+ };
1515
+ r._zod.def.params && (e.params = r._zod.def.params), t.issues.push(T(e));
1516
+ }
1517
+ }
1518
+ //#endregion
1519
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/registries.js
1520
+ var Nn, Pn = class {
1521
+ constructor() {
1522
+ this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
1523
+ }
1524
+ add(e, ...t) {
1525
+ let n = t[0];
1526
+ return this._map.set(e, n), n && typeof n == "object" && "id" in n && this._idmap.set(n.id, e), this;
1527
+ }
1528
+ clear() {
1529
+ return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this;
1530
+ }
1531
+ remove(e) {
1532
+ let t = this._map.get(e);
1533
+ return t && typeof t == "object" && "id" in t && this._idmap.delete(t.id), this._map.delete(e), this;
1534
+ }
1535
+ get(e) {
1536
+ let t = e._zod.parent;
1537
+ if (t) {
1538
+ let n = { ...this.get(t) ?? {} };
1539
+ delete n.id;
1540
+ let r = {
1541
+ ...n,
1542
+ ...this._map.get(e)
1543
+ };
1544
+ return Object.keys(r).length ? r : void 0;
1545
+ }
1546
+ return this._map.get(e);
1547
+ }
1548
+ has(e) {
1549
+ return this._map.has(e);
1550
+ }
1551
+ };
1552
+ function Fn() {
1553
+ return new Pn();
1554
+ }
1555
+ (Nn = globalThis).__zod_globalRegistry ?? (Nn.__zod_globalRegistry = Fn());
1556
+ var L = globalThis.__zod_globalRegistry;
1557
+ //#endregion
1558
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/api.js
1559
+ // @__NO_SIDE_EFFECTS__
1560
+ function In(e, t) {
1561
+ return new e({
1562
+ type: "string",
1563
+ ...x(t)
1564
+ });
1565
+ }
1566
+ // @__NO_SIDE_EFFECTS__
1567
+ function Ln(e, t) {
1568
+ return new e({
1569
+ type: "string",
1570
+ format: "email",
1571
+ check: "string_format",
1572
+ abort: !1,
1573
+ ...x(t)
1574
+ });
1575
+ }
1576
+ // @__NO_SIDE_EFFECTS__
1577
+ function Rn(e, t) {
1578
+ return new e({
1579
+ type: "string",
1580
+ format: "guid",
1581
+ check: "string_format",
1582
+ abort: !1,
1583
+ ...x(t)
1584
+ });
1585
+ }
1586
+ // @__NO_SIDE_EFFECTS__
1587
+ function zn(e, t) {
1588
+ return new e({
1589
+ type: "string",
1590
+ format: "uuid",
1591
+ check: "string_format",
1592
+ abort: !1,
1593
+ ...x(t)
1594
+ });
1595
+ }
1596
+ // @__NO_SIDE_EFFECTS__
1597
+ function Bn(e, t) {
1598
+ return new e({
1599
+ type: "string",
1600
+ format: "uuid",
1601
+ check: "string_format",
1602
+ abort: !1,
1603
+ version: "v4",
1604
+ ...x(t)
1605
+ });
1606
+ }
1607
+ // @__NO_SIDE_EFFECTS__
1608
+ function Vn(e, t) {
1609
+ return new e({
1610
+ type: "string",
1611
+ format: "uuid",
1612
+ check: "string_format",
1613
+ abort: !1,
1614
+ version: "v6",
1615
+ ...x(t)
1616
+ });
1617
+ }
1618
+ // @__NO_SIDE_EFFECTS__
1619
+ function Hn(e, t) {
1620
+ return new e({
1621
+ type: "string",
1622
+ format: "uuid",
1623
+ check: "string_format",
1624
+ abort: !1,
1625
+ version: "v7",
1626
+ ...x(t)
1627
+ });
1628
+ }
1629
+ // @__NO_SIDE_EFFECTS__
1630
+ function Un(e, t) {
1631
+ return new e({
1632
+ type: "string",
1633
+ format: "url",
1634
+ check: "string_format",
1635
+ abort: !1,
1636
+ ...x(t)
1637
+ });
1638
+ }
1639
+ // @__NO_SIDE_EFFECTS__
1640
+ function Wn(e, t) {
1641
+ return new e({
1642
+ type: "string",
1643
+ format: "emoji",
1644
+ check: "string_format",
1645
+ abort: !1,
1646
+ ...x(t)
1647
+ });
1648
+ }
1649
+ // @__NO_SIDE_EFFECTS__
1650
+ function Gn(e, t) {
1651
+ return new e({
1652
+ type: "string",
1653
+ format: "nanoid",
1654
+ check: "string_format",
1655
+ abort: !1,
1656
+ ...x(t)
1657
+ });
1658
+ }
1659
+ // @__NO_SIDE_EFFECTS__
1660
+ function Kn(e, t) {
1661
+ return new e({
1662
+ type: "string",
1663
+ format: "cuid",
1664
+ check: "string_format",
1665
+ abort: !1,
1666
+ ...x(t)
1667
+ });
1668
+ }
1669
+ // @__NO_SIDE_EFFECTS__
1670
+ function qn(e, t) {
1671
+ return new e({
1672
+ type: "string",
1673
+ format: "cuid2",
1674
+ check: "string_format",
1675
+ abort: !1,
1676
+ ...x(t)
1677
+ });
1678
+ }
1679
+ // @__NO_SIDE_EFFECTS__
1680
+ function Jn(e, t) {
1681
+ return new e({
1682
+ type: "string",
1683
+ format: "ulid",
1684
+ check: "string_format",
1685
+ abort: !1,
1686
+ ...x(t)
1687
+ });
1688
+ }
1689
+ // @__NO_SIDE_EFFECTS__
1690
+ function Yn(e, t) {
1691
+ return new e({
1692
+ type: "string",
1693
+ format: "xid",
1694
+ check: "string_format",
1695
+ abort: !1,
1696
+ ...x(t)
1697
+ });
1698
+ }
1699
+ // @__NO_SIDE_EFFECTS__
1700
+ function Xn(e, t) {
1701
+ return new e({
1702
+ type: "string",
1703
+ format: "ksuid",
1704
+ check: "string_format",
1705
+ abort: !1,
1706
+ ...x(t)
1707
+ });
1708
+ }
1709
+ // @__NO_SIDE_EFFECTS__
1710
+ function Zn(e, t) {
1711
+ return new e({
1712
+ type: "string",
1713
+ format: "ipv4",
1714
+ check: "string_format",
1715
+ abort: !1,
1716
+ ...x(t)
1717
+ });
1718
+ }
1719
+ // @__NO_SIDE_EFFECTS__
1720
+ function Qn(e, t) {
1721
+ return new e({
1722
+ type: "string",
1723
+ format: "ipv6",
1724
+ check: "string_format",
1725
+ abort: !1,
1726
+ ...x(t)
1727
+ });
1728
+ }
1729
+ // @__NO_SIDE_EFFECTS__
1730
+ function $n(e, t) {
1731
+ return new e({
1732
+ type: "string",
1733
+ format: "cidrv4",
1734
+ check: "string_format",
1735
+ abort: !1,
1736
+ ...x(t)
1737
+ });
1738
+ }
1739
+ // @__NO_SIDE_EFFECTS__
1740
+ function er(e, t) {
1741
+ return new e({
1742
+ type: "string",
1743
+ format: "cidrv6",
1744
+ check: "string_format",
1745
+ abort: !1,
1746
+ ...x(t)
1747
+ });
1748
+ }
1749
+ // @__NO_SIDE_EFFECTS__
1750
+ function tr(e, t) {
1751
+ return new e({
1752
+ type: "string",
1753
+ format: "base64",
1754
+ check: "string_format",
1755
+ abort: !1,
1756
+ ...x(t)
1757
+ });
1758
+ }
1759
+ // @__NO_SIDE_EFFECTS__
1760
+ function nr(e, t) {
1761
+ return new e({
1762
+ type: "string",
1763
+ format: "base64url",
1764
+ check: "string_format",
1765
+ abort: !1,
1766
+ ...x(t)
1767
+ });
1768
+ }
1769
+ // @__NO_SIDE_EFFECTS__
1770
+ function rr(e, t) {
1771
+ return new e({
1772
+ type: "string",
1773
+ format: "e164",
1774
+ check: "string_format",
1775
+ abort: !1,
1776
+ ...x(t)
1777
+ });
1778
+ }
1779
+ // @__NO_SIDE_EFFECTS__
1780
+ function ir(e, t) {
1781
+ return new e({
1782
+ type: "string",
1783
+ format: "jwt",
1784
+ check: "string_format",
1785
+ abort: !1,
1786
+ ...x(t)
1787
+ });
1788
+ }
1789
+ // @__NO_SIDE_EFFECTS__
1790
+ function ar(e, t) {
1791
+ return new e({
1792
+ type: "string",
1793
+ format: "datetime",
1794
+ check: "string_format",
1795
+ offset: !1,
1796
+ local: !1,
1797
+ precision: null,
1798
+ ...x(t)
1799
+ });
1800
+ }
1801
+ // @__NO_SIDE_EFFECTS__
1802
+ function or(e, t) {
1803
+ return new e({
1804
+ type: "string",
1805
+ format: "date",
1806
+ check: "string_format",
1807
+ ...x(t)
1808
+ });
1809
+ }
1810
+ // @__NO_SIDE_EFFECTS__
1811
+ function sr(e, t) {
1812
+ return new e({
1813
+ type: "string",
1814
+ format: "time",
1815
+ check: "string_format",
1816
+ precision: null,
1817
+ ...x(t)
1818
+ });
1819
+ }
1820
+ // @__NO_SIDE_EFFECTS__
1821
+ function cr(e, t) {
1822
+ return new e({
1823
+ type: "string",
1824
+ format: "duration",
1825
+ check: "string_format",
1826
+ ...x(t)
1827
+ });
1828
+ }
1829
+ // @__NO_SIDE_EFFECTS__
1830
+ function lr(e, t) {
1831
+ return new e({
1832
+ type: "number",
1833
+ checks: [],
1834
+ ...x(t)
1835
+ });
1836
+ }
1837
+ // @__NO_SIDE_EFFECTS__
1838
+ function ur(e, t) {
1839
+ return new e({
1840
+ type: "number",
1841
+ check: "number_format",
1842
+ abort: !1,
1843
+ format: "safeint",
1844
+ ...x(t)
1845
+ });
1846
+ }
1847
+ // @__NO_SIDE_EFFECTS__
1848
+ function dr(e, t) {
1849
+ return new e({
1850
+ type: "null",
1851
+ ...x(t)
1852
+ });
1853
+ }
1854
+ // @__NO_SIDE_EFFECTS__
1855
+ function fr(e) {
1856
+ return new e({ type: "unknown" });
1857
+ }
1858
+ // @__NO_SIDE_EFFECTS__
1859
+ function pr(e, t) {
1860
+ return new e({
1861
+ type: "never",
1862
+ ...x(t)
1863
+ });
1864
+ }
1865
+ // @__NO_SIDE_EFFECTS__
1866
+ function mr(e, t) {
1867
+ return new dt({
1868
+ check: "less_than",
1869
+ ...x(t),
1870
+ value: e,
1871
+ inclusive: !1
1872
+ });
1873
+ }
1874
+ // @__NO_SIDE_EFFECTS__
1875
+ function R(e, t) {
1876
+ return new dt({
1877
+ check: "less_than",
1878
+ ...x(t),
1879
+ value: e,
1880
+ inclusive: !0
1881
+ });
1882
+ }
1883
+ // @__NO_SIDE_EFFECTS__
1884
+ function hr(e, t) {
1885
+ return new ft({
1886
+ check: "greater_than",
1887
+ ...x(t),
1888
+ value: e,
1889
+ inclusive: !1
1890
+ });
1891
+ }
1892
+ // @__NO_SIDE_EFFECTS__
1893
+ function z(e, t) {
1894
+ return new ft({
1895
+ check: "greater_than",
1896
+ ...x(t),
1897
+ value: e,
1898
+ inclusive: !0
1899
+ });
1900
+ }
1901
+ // @__NO_SIDE_EFFECTS__
1902
+ function gr(e, t) {
1903
+ return new pt({
1904
+ check: "multiple_of",
1905
+ ...x(t),
1906
+ value: e
1907
+ });
1908
+ }
1909
+ // @__NO_SIDE_EFFECTS__
1910
+ function _r(e, t) {
1911
+ return new ht({
1912
+ check: "max_length",
1913
+ ...x(t),
1914
+ maximum: e
1915
+ });
1916
+ }
1917
+ // @__NO_SIDE_EFFECTS__
1918
+ function B(e, t) {
1919
+ return new gt({
1920
+ check: "min_length",
1921
+ ...x(t),
1922
+ minimum: e
1923
+ });
1924
+ }
1925
+ // @__NO_SIDE_EFFECTS__
1926
+ function vr(e, t) {
1927
+ return new _t({
1928
+ check: "length_equals",
1929
+ ...x(t),
1930
+ length: e
1931
+ });
1932
+ }
1933
+ // @__NO_SIDE_EFFECTS__
1934
+ function yr(e, t) {
1935
+ return new vt({
1936
+ check: "string_format",
1937
+ format: "regex",
1938
+ ...x(t),
1939
+ pattern: e
1940
+ });
1941
+ }
1942
+ // @__NO_SIDE_EFFECTS__
1943
+ function br(e) {
1944
+ return new yt({
1945
+ check: "string_format",
1946
+ format: "lowercase",
1947
+ ...x(e)
1948
+ });
1949
+ }
1950
+ // @__NO_SIDE_EFFECTS__
1951
+ function xr(e) {
1952
+ return new bt({
1953
+ check: "string_format",
1954
+ format: "uppercase",
1955
+ ...x(e)
1956
+ });
1957
+ }
1958
+ // @__NO_SIDE_EFFECTS__
1959
+ function Sr(e, t) {
1960
+ return new xt({
1961
+ check: "string_format",
1962
+ format: "includes",
1963
+ ...x(t),
1964
+ includes: e
1965
+ });
1966
+ }
1967
+ // @__NO_SIDE_EFFECTS__
1968
+ function Cr(e, t) {
1969
+ return new St({
1970
+ check: "string_format",
1971
+ format: "starts_with",
1972
+ ...x(t),
1973
+ prefix: e
1974
+ });
1975
+ }
1976
+ // @__NO_SIDE_EFFECTS__
1977
+ function wr(e, t) {
1978
+ return new Ct({
1979
+ check: "string_format",
1980
+ format: "ends_with",
1981
+ ...x(t),
1982
+ suffix: e
1983
+ });
1984
+ }
1985
+ // @__NO_SIDE_EFFECTS__
1986
+ function V(e) {
1987
+ return new wt({
1988
+ check: "overwrite",
1989
+ tx: e
1990
+ });
1991
+ }
1992
+ // @__NO_SIDE_EFFECTS__
1993
+ function Tr(e) {
1994
+ return /* @__PURE__ */ V((t) => t.normalize(e));
1995
+ }
1996
+ // @__NO_SIDE_EFFECTS__
1997
+ function Er() {
1998
+ return /* @__PURE__ */ V((e) => e.trim());
1999
+ }
2000
+ // @__NO_SIDE_EFFECTS__
2001
+ function Dr() {
2002
+ return /* @__PURE__ */ V((e) => e.toLowerCase());
2003
+ }
2004
+ // @__NO_SIDE_EFFECTS__
2005
+ function Or() {
2006
+ return /* @__PURE__ */ V((e) => e.toUpperCase());
2007
+ }
2008
+ // @__NO_SIDE_EFFECTS__
2009
+ function kr() {
2010
+ return /* @__PURE__ */ V((e) => te(e));
2011
+ }
2012
+ // @__NO_SIDE_EFFECTS__
2013
+ function Ar(e, t, n) {
2014
+ return new e({
2015
+ type: "array",
2016
+ element: t,
2017
+ ...x(n)
2018
+ });
2019
+ }
2020
+ // @__NO_SIDE_EFFECTS__
2021
+ function jr(e, t, n) {
2022
+ return new e({
2023
+ type: "custom",
2024
+ check: "custom",
2025
+ fn: t,
2026
+ ...x(n)
2027
+ });
2028
+ }
2029
+ // @__NO_SIDE_EFFECTS__
2030
+ function Mr(e, t) {
2031
+ let n = /* @__PURE__ */ Nr((t) => (t.addIssue = (e) => {
2032
+ if (typeof e == "string") t.issues.push(T(e, t.value, n._zod.def));
2033
+ else {
2034
+ let r = e;
2035
+ r.fatal && (r.continue = !1), r.code ??= "custom", r.input ??= t.value, r.inst ??= n, r.continue ??= !n._zod.def.abort, t.issues.push(T(r));
2036
+ }
2037
+ }, e(t.value, t)), t);
2038
+ return n;
2039
+ }
2040
+ // @__NO_SIDE_EFFECTS__
2041
+ function Nr(e, t) {
2042
+ let n = new A({
2043
+ check: "custom",
2044
+ ...x(t)
2045
+ });
2046
+ return n._zod.check = e, n;
2047
+ }
2048
+ //#endregion
2049
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/to-json-schema.js
2050
+ function Pr(e) {
2051
+ let t = e?.target ?? "draft-2020-12";
2052
+ return t === "draft-4" && (t = "draft-04"), t === "draft-7" && (t = "draft-07"), {
2053
+ processors: e.processors ?? {},
2054
+ metadataRegistry: e?.metadata ?? L,
2055
+ target: t,
2056
+ unrepresentable: e?.unrepresentable ?? "throw",
2057
+ override: e?.override ?? (() => {}),
2058
+ io: e?.io ?? "output",
2059
+ counter: 0,
2060
+ seen: /* @__PURE__ */ new Map(),
2061
+ cycles: e?.cycles ?? "ref",
2062
+ reused: e?.reused ?? "inline",
2063
+ external: e?.external ?? void 0
2064
+ };
2065
+ }
2066
+ function H(e, t, n = {
2067
+ path: [],
2068
+ schemaPath: []
2069
+ }) {
2070
+ var r;
2071
+ let i = e._zod.def, a = t.seen.get(e);
2072
+ if (a) return a.count++, n.schemaPath.includes(e) && (a.cycle = n.path), a.schema;
2073
+ let o = {
2074
+ schema: {},
2075
+ count: 1,
2076
+ cycle: void 0,
2077
+ path: n.path
2078
+ };
2079
+ t.seen.set(e, o);
2080
+ let s = e._zod.toJSONSchema?.();
2081
+ if (s) o.schema = s;
2082
+ else {
2083
+ let r = {
2084
+ ...n,
2085
+ schemaPath: [...n.schemaPath, e],
2086
+ path: n.path
2087
+ };
2088
+ if (e._zod.processJSONSchema) e._zod.processJSONSchema(t, o.schema, r);
2089
+ else {
2090
+ let n = o.schema, a = t.processors[i.type];
2091
+ if (!a) throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);
2092
+ a(e, t, n, r);
2093
+ }
2094
+ let a = e._zod.parent;
2095
+ a && (o.ref ||= a, H(a, t, r), t.seen.get(a).isParent = !0);
2096
+ }
2097
+ let c = t.metadataRegistry.get(e);
2098
+ return c && Object.assign(o.schema, c), t.io === "input" && U(e) && (delete o.schema.examples, delete o.schema.default), t.io === "input" && "_prefault" in o.schema && ((r = o.schema).default ?? (r.default = o.schema._prefault)), delete o.schema._prefault, t.seen.get(e).schema;
2099
+ }
2100
+ function Fr(e, t) {
2101
+ let n = e.seen.get(t);
2102
+ if (!n) throw Error("Unprocessed schema. This is a bug in Zod.");
2103
+ let r = /* @__PURE__ */ new Map();
2104
+ for (let t of e.seen.entries()) {
2105
+ let n = e.metadataRegistry.get(t[0])?.id;
2106
+ if (n) {
2107
+ let e = r.get(n);
2108
+ if (e && e !== t[0]) throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
2109
+ r.set(n, t[0]);
2110
+ }
2111
+ }
2112
+ let i = (t) => {
2113
+ let r = e.target === "draft-2020-12" ? "$defs" : "definitions";
2114
+ if (e.external) {
2115
+ let n = e.external.registry.get(t[0])?.id, i = e.external.uri ?? ((e) => e);
2116
+ if (n) return { ref: i(n) };
2117
+ let a = t[1].defId ?? t[1].schema.id ?? `schema${e.counter++}`;
2118
+ return t[1].defId = a, {
2119
+ defId: a,
2120
+ ref: `${i("__shared")}#/${r}/${a}`
2121
+ };
2122
+ }
2123
+ if (t[1] === n) return { ref: "#" };
2124
+ let i = `#/${r}/`, a = t[1].schema.id ?? `__schema${e.counter++}`;
2125
+ return {
2126
+ defId: a,
2127
+ ref: i + a
2128
+ };
2129
+ }, a = (e) => {
2130
+ if (e[1].schema.$ref) return;
2131
+ let t = e[1], { ref: n, defId: r } = i(e);
2132
+ t.def = { ...t.schema }, r && (t.defId = r);
2133
+ let a = t.schema;
2134
+ for (let e in a) delete a[e];
2135
+ a.$ref = n;
2136
+ };
2137
+ if (e.cycles === "throw") for (let t of e.seen.entries()) {
2138
+ let e = t[1];
2139
+ if (e.cycle) throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root>
2140
+
2141
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
2142
+ }
2143
+ for (let n of e.seen.entries()) {
2144
+ let r = n[1];
2145
+ if (t === n[0]) {
2146
+ a(n);
2147
+ continue;
2148
+ }
2149
+ if (e.external) {
2150
+ let r = e.external.registry.get(n[0])?.id;
2151
+ if (t !== n[0] && r) {
2152
+ a(n);
2153
+ continue;
2154
+ }
2155
+ }
2156
+ if (e.metadataRegistry.get(n[0])?.id) {
2157
+ a(n);
2158
+ continue;
2159
+ }
2160
+ if (r.cycle) {
2161
+ a(n);
2162
+ continue;
2163
+ }
2164
+ if (r.count > 1 && e.reused === "ref") {
2165
+ a(n);
2166
+ continue;
2167
+ }
2168
+ }
2169
+ }
2170
+ function Ir(e, t) {
2171
+ let n = e.seen.get(t);
2172
+ if (!n) throw Error("Unprocessed schema. This is a bug in Zod.");
2173
+ let r = (t) => {
2174
+ let n = e.seen.get(t);
2175
+ if (n.ref === null) return;
2176
+ let i = n.def ?? n.schema, a = { ...i }, o = n.ref;
2177
+ if (n.ref = null, o) {
2178
+ r(o);
2179
+ let n = e.seen.get(o), s = n.schema;
2180
+ if (s.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (i.allOf = i.allOf ?? [], i.allOf.push(s)) : Object.assign(i, s), Object.assign(i, a), t._zod.parent === o) for (let e in i) e === "$ref" || e === "allOf" || e in a || delete i[e];
2181
+ if (s.$ref && n.def) for (let e in i) e === "$ref" || e === "allOf" || e in n.def && JSON.stringify(i[e]) === JSON.stringify(n.def[e]) && delete i[e];
2182
+ }
2183
+ let s = t._zod.parent;
2184
+ if (s && s !== o) {
2185
+ r(s);
2186
+ let t = e.seen.get(s);
2187
+ if (t?.schema.$ref && (i.$ref = t.schema.$ref, t.def)) for (let e in i) e === "$ref" || e === "allOf" || e in t.def && JSON.stringify(i[e]) === JSON.stringify(t.def[e]) && delete i[e];
2188
+ }
2189
+ e.override({
2190
+ zodSchema: t,
2191
+ jsonSchema: i,
2192
+ path: n.path ?? []
2193
+ });
2194
+ };
2195
+ for (let t of [...e.seen.entries()].reverse()) r(t[0]);
2196
+ let i = {};
2197
+ if (e.target === "draft-2020-12" ? i.$schema = "https://json-schema.org/draft/2020-12/schema" : e.target === "draft-07" ? i.$schema = "http://json-schema.org/draft-07/schema#" : e.target === "draft-04" ? i.$schema = "http://json-schema.org/draft-04/schema#" : e.target, e.external?.uri) {
2198
+ let n = e.external.registry.get(t)?.id;
2199
+ if (!n) throw Error("Schema is missing an `id` property");
2200
+ i.$id = e.external.uri(n);
2201
+ }
2202
+ Object.assign(i, n.def ?? n.schema);
2203
+ let a = e.metadataRegistry.get(t)?.id;
2204
+ a !== void 0 && i.id === a && delete i.id;
2205
+ let o = e.external?.defs ?? {};
2206
+ for (let t of e.seen.entries()) {
2207
+ let e = t[1];
2208
+ e.def && e.defId && (e.def.id === e.defId && delete e.def.id, o[e.defId] = e.def);
2209
+ }
2210
+ e.external || Object.keys(o).length > 0 && (e.target === "draft-2020-12" ? i.$defs = o : i.definitions = o);
2211
+ try {
2212
+ let n = JSON.parse(JSON.stringify(i));
2213
+ return Object.defineProperty(n, "~standard", {
2214
+ value: {
2215
+ ...t["~standard"],
2216
+ jsonSchema: {
2217
+ input: W(t, "input", e.processors),
2218
+ output: W(t, "output", e.processors)
2219
+ }
2220
+ },
2221
+ enumerable: !1,
2222
+ writable: !1
2223
+ }), n;
2224
+ } catch {
2225
+ throw Error("Error converting schema to JSON.");
2226
+ }
2227
+ }
2228
+ function U(e, t) {
2229
+ let n = t ?? { seen: /* @__PURE__ */ new Set() };
2230
+ if (n.seen.has(e)) return !1;
2231
+ n.seen.add(e);
2232
+ let r = e._zod.def;
2233
+ if (r.type === "transform") return !0;
2234
+ if (r.type === "array") return U(r.element, n);
2235
+ if (r.type === "set") return U(r.valueType, n);
2236
+ if (r.type === "lazy") return U(r.getter(), n);
2237
+ if (r.type === "promise" || r.type === "optional" || r.type === "nonoptional" || r.type === "nullable" || r.type === "readonly" || r.type === "default" || r.type === "prefault") return U(r.innerType, n);
2238
+ if (r.type === "intersection") return U(r.left, n) || U(r.right, n);
2239
+ if (r.type === "record" || r.type === "map") return U(r.keyType, n) || U(r.valueType, n);
2240
+ if (r.type === "pipe") return e._zod.traits.has("$ZodCodec") ? !0 : U(r.in, n) || U(r.out, n);
2241
+ if (r.type === "object") {
2242
+ for (let e in r.shape) if (U(r.shape[e], n)) return !0;
2243
+ return !1;
2244
+ }
2245
+ if (r.type === "union") {
2246
+ for (let e of r.options) if (U(e, n)) return !0;
2247
+ return !1;
2248
+ }
2249
+ if (r.type === "tuple") {
2250
+ for (let e of r.items) if (U(e, n)) return !0;
2251
+ return !!(r.rest && U(r.rest, n));
2252
+ }
2253
+ return !1;
2254
+ }
2255
+ var Lr = (e, t = {}) => (n) => {
2256
+ let r = Pr({
2257
+ ...n,
2258
+ processors: t
2259
+ });
2260
+ return H(e, r), Fr(r, e), Ir(r, e);
2261
+ }, W = (e, t, n = {}) => (r) => {
2262
+ let { libraryOptions: i, target: a } = r ?? {}, o = Pr({
2263
+ ...i ?? {},
2264
+ target: a,
2265
+ io: t,
2266
+ processors: n
2267
+ });
2268
+ return H(e, o), Fr(o, e), Ir(o, e);
2269
+ }, Rr = {
2270
+ guid: "uuid",
2271
+ url: "uri",
2272
+ datetime: "date-time",
2273
+ json_string: "json-string",
2274
+ regex: ""
2275
+ }, zr = (e, t, n, r) => {
2276
+ let i = n;
2277
+ i.type = "string";
2278
+ let { minimum: a, maximum: o, format: s, patterns: c, contentEncoding: l } = e._zod.bag;
2279
+ if (typeof a == "number" && (i.minLength = a), typeof o == "number" && (i.maxLength = o), s && (i.format = Rr[s] ?? s, i.format === "" && delete i.format, s === "time" && delete i.format), l && (i.contentEncoding = l), c && c.size > 0) {
2280
+ let e = [...c];
2281
+ e.length === 1 ? i.pattern = e[0].source : e.length > 1 && (i.allOf = [...e.map((e) => ({
2282
+ ...t.target === "draft-07" || t.target === "draft-04" || t.target === "openapi-3.0" ? { type: "string" } : {},
2283
+ pattern: e.source
2284
+ }))]);
2285
+ }
2286
+ }, Br = (e, t, n, r) => {
2287
+ let i = n, { minimum: a, maximum: o, format: s, multipleOf: c, exclusiveMaximum: l, exclusiveMinimum: u } = e._zod.bag;
2288
+ typeof s == "string" && s.includes("int") ? i.type = "integer" : i.type = "number";
2289
+ let d = typeof u == "number" && u >= (a ?? -Infinity), f = typeof l == "number" && l <= (o ?? Infinity), p = t.target === "draft-04" || t.target === "openapi-3.0";
2290
+ d ? p ? (i.minimum = u, i.exclusiveMinimum = !0) : i.exclusiveMinimum = u : typeof a == "number" && (i.minimum = a), f ? p ? (i.maximum = l, i.exclusiveMaximum = !0) : i.exclusiveMaximum = l : typeof o == "number" && (i.maximum = o), typeof c == "number" && (i.multipleOf = c);
2291
+ }, Vr = (e, t, n, r) => {
2292
+ t.target === "openapi-3.0" ? (n.type = "string", n.nullable = !0, n.enum = [null]) : n.type = "null";
2293
+ }, Hr = (e, t, n, r) => {
2294
+ n.not = {};
2295
+ }, Ur = (e, t, n, r) => {
2296
+ let i = e._zod.def, a = s(i.entries);
2297
+ a.every((e) => typeof e == "number") && (n.type = "number"), a.every((e) => typeof e == "string") && (n.type = "string"), n.enum = a;
2298
+ }, Wr = (e, t, n, r) => {
2299
+ if (t.unrepresentable === "throw") throw Error("Custom types cannot be represented in JSON Schema");
2300
+ }, Gr = (e, t, n, r) => {
2301
+ if (t.unrepresentable === "throw") throw Error("Transforms cannot be represented in JSON Schema");
2302
+ }, Kr = (e, t, n, r) => {
2303
+ let i = n, a = e._zod.def, { minimum: o, maximum: s } = e._zod.bag;
2304
+ typeof o == "number" && (i.minItems = o), typeof s == "number" && (i.maxItems = s), i.type = "array", i.items = H(a.element, t, {
2305
+ ...r,
2306
+ path: [...r.path, "items"]
2307
+ });
2308
+ }, qr = (e, t, n, r) => {
2309
+ let i = n, a = e._zod.def;
2310
+ i.type = "object", i.properties = {};
2311
+ let o = a.shape;
2312
+ for (let e in o) i.properties[e] = H(o[e], t, {
2313
+ ...r,
2314
+ path: [
2315
+ ...r.path,
2316
+ "properties",
2317
+ e
2318
+ ]
2319
+ });
2320
+ let s = new Set(Object.keys(o)), c = new Set([...s].filter((e) => {
2321
+ let n = a.shape[e]._zod;
2322
+ return t.io === "input" ? n.optin === void 0 : n.optout === void 0;
2323
+ }));
2324
+ c.size > 0 && (i.required = Array.from(c)), a.catchall?._zod.def.type === "never" ? i.additionalProperties = !1 : a.catchall ? a.catchall && (i.additionalProperties = H(a.catchall, t, {
2325
+ ...r,
2326
+ path: [...r.path, "additionalProperties"]
2327
+ })) : t.io === "output" && (i.additionalProperties = !1);
2328
+ }, Jr = (e, t, n, r) => {
2329
+ let i = e._zod.def, a = i.inclusive === !1, o = i.options.map((e, n) => H(e, t, {
2330
+ ...r,
2331
+ path: [
2332
+ ...r.path,
2333
+ a ? "oneOf" : "anyOf",
2334
+ n
2335
+ ]
2336
+ }));
2337
+ a ? n.oneOf = o : n.anyOf = o;
2338
+ }, Yr = (e, t, n, r) => {
2339
+ let i = e._zod.def, a = H(i.left, t, {
2340
+ ...r,
2341
+ path: [
2342
+ ...r.path,
2343
+ "allOf",
2344
+ 0
2345
+ ]
2346
+ }), o = H(i.right, t, {
2347
+ ...r,
2348
+ path: [
2349
+ ...r.path,
2350
+ "allOf",
2351
+ 1
2352
+ ]
2353
+ }), s = (e) => "allOf" in e && Object.keys(e).length === 1;
2354
+ n.allOf = [...s(a) ? a.allOf : [a], ...s(o) ? o.allOf : [o]];
2355
+ }, Xr = (e, t, n, r) => {
2356
+ let i = e._zod.def, a = H(i.innerType, t, r), o = t.seen.get(e);
2357
+ t.target === "openapi-3.0" ? (o.ref = i.innerType, n.nullable = !0) : n.anyOf = [a, { type: "null" }];
2358
+ }, Zr = (e, t, n, r) => {
2359
+ let i = e._zod.def;
2360
+ H(i.innerType, t, r);
2361
+ let a = t.seen.get(e);
2362
+ a.ref = i.innerType;
2363
+ }, Qr = (e, t, n, r) => {
2364
+ let i = e._zod.def;
2365
+ H(i.innerType, t, r);
2366
+ let a = t.seen.get(e);
2367
+ a.ref = i.innerType, n.default = JSON.parse(JSON.stringify(i.defaultValue));
2368
+ }, $r = (e, t, n, r) => {
2369
+ let i = e._zod.def;
2370
+ H(i.innerType, t, r);
2371
+ let a = t.seen.get(e);
2372
+ a.ref = i.innerType, t.io === "input" && (n._prefault = JSON.parse(JSON.stringify(i.defaultValue)));
2373
+ }, ei = (e, t, n, r) => {
2374
+ let i = e._zod.def;
2375
+ H(i.innerType, t, r);
2376
+ let a = t.seen.get(e);
2377
+ a.ref = i.innerType;
2378
+ let o;
2379
+ try {
2380
+ o = i.catchValue(void 0);
2381
+ } catch {
2382
+ throw Error("Dynamic catch values are not supported in JSON Schema");
2383
+ }
2384
+ n.default = o;
2385
+ }, ti = (e, t, n, r) => {
2386
+ let i = e._zod.def, a = i.in._zod.traits.has("$ZodTransform"), o = t.io === "input" ? a ? i.out : i.in : i.out;
2387
+ H(o, t, r);
2388
+ let s = t.seen.get(e);
2389
+ s.ref = o;
2390
+ }, ni = (e, t, n, r) => {
2391
+ let i = e._zod.def;
2392
+ H(i.innerType, t, r);
2393
+ let a = t.seen.get(e);
2394
+ a.ref = i.innerType, n.readOnly = !0;
2395
+ }, ri = (e, t, n, r) => {
2396
+ let i = e._zod.def;
2397
+ H(i.innerType, t, r);
2398
+ let a = t.seen.get(e);
2399
+ a.ref = i.innerType;
2400
+ }, ii = /*@__PURE__*/ n("ZodISODateTime", (e, t) => {
2401
+ zt.init(e, t), Y.init(e, t);
2402
+ });
2403
+ function ai(e) {
2404
+ return /* @__PURE__ */ ar(ii, e);
2405
+ }
2406
+ var oi = /*@__PURE__*/ n("ZodISODate", (e, t) => {
2407
+ Bt.init(e, t), Y.init(e, t);
2408
+ });
2409
+ function si(e) {
2410
+ return /* @__PURE__ */ or(oi, e);
2411
+ }
2412
+ var ci = /*@__PURE__*/ n("ZodISOTime", (e, t) => {
2413
+ Vt.init(e, t), Y.init(e, t);
2414
+ });
2415
+ function li(e) {
2416
+ return /* @__PURE__ */ sr(ci, e);
2417
+ }
2418
+ var ui = /*@__PURE__*/ n("ZodISODuration", (e, t) => {
2419
+ Ht.init(e, t), Y.init(e, t);
2420
+ });
2421
+ function di(e) {
2422
+ return /* @__PURE__ */ cr(ui, e);
2423
+ }
2424
+ var G = /*@__PURE__*/ n("ZodError", (e, t) => {
2425
+ ye.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
2426
+ format: { value: (t) => Se(e, t) },
2427
+ flatten: { value: (t) => xe(e, t) },
2428
+ addIssue: { value: (t) => {
2429
+ e.issues.push(t), e.message = JSON.stringify(e.issues, c, 2);
2430
+ } },
2431
+ addIssues: { value: (t) => {
2432
+ e.issues.push(...t), e.message = JSON.stringify(e.issues, c, 2);
2433
+ } },
2434
+ isEmpty: { get() {
2435
+ return e.issues.length === 0;
2436
+ } }
2437
+ });
2438
+ }, { Parent: Error }), fi = /* @__PURE__ */ E(G), pi = /* @__PURE__ */ D(G), mi = /* @__PURE__ */ O(G), hi = /* @__PURE__ */ k(G), gi = /* @__PURE__ */ Te(G), _i = /* @__PURE__ */ Ee(G), vi = /* @__PURE__ */ De(G), yi = /* @__PURE__ */ Oe(G), bi = /* @__PURE__ */ ke(G), xi = /* @__PURE__ */ Ae(G), Si = /* @__PURE__ */ je(G), Ci = /* @__PURE__ */ Me(G), wi = /* @__PURE__ */ new WeakMap();
2439
+ function K(e, t, n) {
2440
+ let r = Object.getPrototypeOf(e), i = wi.get(r);
2441
+ if (i || (i = /* @__PURE__ */ new Set(), wi.set(r, i)), !i.has(t)) {
2442
+ i.add(t);
2443
+ for (let e in n) {
2444
+ let t = n[e];
2445
+ Object.defineProperty(r, e, {
2446
+ configurable: !0,
2447
+ enumerable: !1,
2448
+ get() {
2449
+ let n = t.bind(this);
2450
+ return Object.defineProperty(this, e, {
2451
+ configurable: !0,
2452
+ writable: !0,
2453
+ enumerable: !0,
2454
+ value: n
2455
+ }), n;
2456
+ },
2457
+ set(t) {
2458
+ Object.defineProperty(this, e, {
2459
+ configurable: !0,
2460
+ writable: !0,
2461
+ enumerable: !0,
2462
+ value: t
2463
+ });
2464
+ }
2465
+ });
2466
+ }
2467
+ }
2468
+ }
2469
+ var q = /*@__PURE__*/ n("ZodType", (e, t) => (M.init(e, t), Object.assign(e["~standard"], { jsonSchema: {
2470
+ input: W(e, "input"),
2471
+ output: W(e, "output")
2472
+ } }), e.toJSONSchema = Lr(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.parse = (t, n) => fi(e, t, n, { callee: e.parse }), e.safeParse = (t, n) => mi(e, t, n), e.parseAsync = async (t, n) => pi(e, t, n, { callee: e.parseAsync }), e.safeParseAsync = async (t, n) => hi(e, t, n), e.spa = e.safeParseAsync, e.encode = (t, n) => gi(e, t, n), e.decode = (t, n) => _i(e, t, n), e.encodeAsync = async (t, n) => vi(e, t, n), e.decodeAsync = async (t, n) => yi(e, t, n), e.safeEncode = (t, n) => bi(e, t, n), e.safeDecode = (t, n) => xi(e, t, n), e.safeEncodeAsync = async (t, n) => Si(e, t, n), e.safeDecodeAsync = async (t, n) => Ci(e, t, n), K(e, "ZodType", {
2473
+ check(...e) {
2474
+ let t = this.def;
2475
+ return this.clone(g(t, { checks: [...t.checks ?? [], ...e.map((e) => typeof e == "function" ? { _zod: {
2476
+ check: e,
2477
+ def: { check: "custom" },
2478
+ onattach: []
2479
+ } } : e)] }), { parent: !0 });
2480
+ },
2481
+ with(...e) {
2482
+ return this.check(...e);
2483
+ },
2484
+ clone(e, t) {
2485
+ return b(this, e, t);
2486
+ },
2487
+ brand() {
2488
+ return this;
2489
+ },
2490
+ register(e, t) {
2491
+ return e.add(this, t), this;
2492
+ },
2493
+ refine(e, t) {
2494
+ return this.check(ka(e, t));
2495
+ },
2496
+ superRefine(e, t) {
2497
+ return this.check(Aa(e, t));
2498
+ },
2499
+ overwrite(e) {
2500
+ return this.check(/* @__PURE__ */ V(e));
2501
+ },
2502
+ optional() {
2503
+ return da(this);
2504
+ },
2505
+ exactOptional() {
2506
+ return pa(this);
2507
+ },
2508
+ nullable() {
2509
+ return ha(this);
2510
+ },
2511
+ nullish() {
2512
+ return da(ha(this));
2513
+ },
2514
+ nonoptional(e) {
2515
+ return xa(this, e);
2516
+ },
2517
+ array() {
2518
+ return Z(this);
2519
+ },
2520
+ or(e) {
2521
+ return ia([this, e]);
2522
+ },
2523
+ and(e) {
2524
+ return oa(this, e);
2525
+ },
2526
+ transform(e) {
2527
+ return Ta(this, la(e));
2528
+ },
2529
+ default(e) {
2530
+ return _a(this, e);
2531
+ },
2532
+ prefault(e) {
2533
+ return ya(this, e);
2534
+ },
2535
+ catch(e) {
2536
+ return Ca(this, e);
2537
+ },
2538
+ pipe(e) {
2539
+ return Ta(this, e);
2540
+ },
2541
+ readonly() {
2542
+ return Da(this);
2543
+ },
2544
+ describe(e) {
2545
+ let t = this.clone();
2546
+ return L.add(t, { description: e }), t;
2547
+ },
2548
+ meta(...e) {
2549
+ if (e.length === 0) return L.get(this);
2550
+ let t = this.clone();
2551
+ return L.add(t, e[0]), t;
2552
+ },
2553
+ isOptional() {
2554
+ return this.safeParse(void 0).success;
2555
+ },
2556
+ isNullable() {
2557
+ return this.safeParse(null).success;
2558
+ },
2559
+ apply(e) {
2560
+ return e(this);
2561
+ }
2562
+ }), Object.defineProperty(e, "description", {
2563
+ get() {
2564
+ return L.get(e)?.description;
2565
+ },
2566
+ configurable: !0
2567
+ }), e)), Ti = /*@__PURE__*/ n("_ZodString", (e, t) => {
2568
+ Dt.init(e, t), q.init(e, t), e._zod.processJSONSchema = (t, n, r) => zr(e, t, n, r);
2569
+ let n = e._zod.bag;
2570
+ e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, K(e, "_ZodString", {
2571
+ regex(...e) {
2572
+ return this.check(/* @__PURE__ */ yr(...e));
2573
+ },
2574
+ includes(...e) {
2575
+ return this.check(/* @__PURE__ */ Sr(...e));
2576
+ },
2577
+ startsWith(...e) {
2578
+ return this.check(/* @__PURE__ */ Cr(...e));
2579
+ },
2580
+ endsWith(...e) {
2581
+ return this.check(/* @__PURE__ */ wr(...e));
2582
+ },
2583
+ min(...e) {
2584
+ return this.check(/* @__PURE__ */ B(...e));
2585
+ },
2586
+ max(...e) {
2587
+ return this.check(/* @__PURE__ */ _r(...e));
2588
+ },
2589
+ length(...e) {
2590
+ return this.check(/* @__PURE__ */ vr(...e));
2591
+ },
2592
+ nonempty(...e) {
2593
+ return this.check(/* @__PURE__ */ B(1, ...e));
2594
+ },
2595
+ lowercase(e) {
2596
+ return this.check(/* @__PURE__ */ br(e));
2597
+ },
2598
+ uppercase(e) {
2599
+ return this.check(/* @__PURE__ */ xr(e));
2600
+ },
2601
+ trim() {
2602
+ return this.check(/* @__PURE__ */ Er());
2603
+ },
2604
+ normalize(...e) {
2605
+ return this.check(/* @__PURE__ */ Tr(...e));
2606
+ },
2607
+ toLowerCase() {
2608
+ return this.check(/* @__PURE__ */ Dr());
2609
+ },
2610
+ toUpperCase() {
2611
+ return this.check(/* @__PURE__ */ Or());
2612
+ },
2613
+ slugify() {
2614
+ return this.check(/* @__PURE__ */ kr());
2615
+ }
2616
+ });
2617
+ }), Ei = /*@__PURE__*/ n("ZodString", (e, t) => {
2618
+ Dt.init(e, t), Ti.init(e, t), e.email = (t) => e.check(/* @__PURE__ */ Ln(Di, t)), e.url = (t) => e.check(/* @__PURE__ */ Un(ki, t)), e.jwt = (t) => e.check(/* @__PURE__ */ ir(Wi, t)), e.emoji = (t) => e.check(/* @__PURE__ */ Wn(Ai, t)), e.guid = (t) => e.check(/* @__PURE__ */ Rn(Oi, t)), e.uuid = (t) => e.check(/* @__PURE__ */ zn(X, t)), e.uuidv4 = (t) => e.check(/* @__PURE__ */ Bn(X, t)), e.uuidv6 = (t) => e.check(/* @__PURE__ */ Vn(X, t)), e.uuidv7 = (t) => e.check(/* @__PURE__ */ Hn(X, t)), e.nanoid = (t) => e.check(/* @__PURE__ */ Gn(ji, t)), e.guid = (t) => e.check(/* @__PURE__ */ Rn(Oi, t)), e.cuid = (t) => e.check(/* @__PURE__ */ Kn(Mi, t)), e.cuid2 = (t) => e.check(/* @__PURE__ */ qn(Ni, t)), e.ulid = (t) => e.check(/* @__PURE__ */ Jn(Pi, t)), e.base64 = (t) => e.check(/* @__PURE__ */ tr(Vi, t)), e.base64url = (t) => e.check(/* @__PURE__ */ nr(Hi, t)), e.xid = (t) => e.check(/* @__PURE__ */ Yn(Fi, t)), e.ksuid = (t) => e.check(/* @__PURE__ */ Xn(Ii, t)), e.ipv4 = (t) => e.check(/* @__PURE__ */ Zn(Li, t)), e.ipv6 = (t) => e.check(/* @__PURE__ */ Qn(Ri, t)), e.cidrv4 = (t) => e.check(/* @__PURE__ */ $n(zi, t)), e.cidrv6 = (t) => e.check(/* @__PURE__ */ er(Bi, t)), e.e164 = (t) => e.check(/* @__PURE__ */ rr(Ui, t)), e.datetime = (t) => e.check(ai(t)), e.date = (t) => e.check(si(t)), e.time = (t) => e.check(li(t)), e.duration = (t) => e.check(di(t));
2619
+ });
2620
+ function J(e) {
2621
+ return /* @__PURE__ */ In(Ei, e);
2622
+ }
2623
+ var Y = /*@__PURE__*/ n("ZodStringFormat", (e, t) => {
2624
+ N.init(e, t), Ti.init(e, t);
2625
+ }), Di = /*@__PURE__*/ n("ZodEmail", (e, t) => {
2626
+ At.init(e, t), Y.init(e, t);
2627
+ }), Oi = /*@__PURE__*/ n("ZodGUID", (e, t) => {
2628
+ Ot.init(e, t), Y.init(e, t);
2629
+ }), X = /*@__PURE__*/ n("ZodUUID", (e, t) => {
2630
+ kt.init(e, t), Y.init(e, t);
2631
+ }), ki = /*@__PURE__*/ n("ZodURL", (e, t) => {
2632
+ jt.init(e, t), Y.init(e, t);
2633
+ }), Ai = /*@__PURE__*/ n("ZodEmoji", (e, t) => {
2634
+ Mt.init(e, t), Y.init(e, t);
2635
+ }), ji = /*@__PURE__*/ n("ZodNanoID", (e, t) => {
2636
+ Nt.init(e, t), Y.init(e, t);
2637
+ }), Mi = /*@__PURE__*/ n("ZodCUID", (e, t) => {
2638
+ Pt.init(e, t), Y.init(e, t);
2639
+ }), Ni = /*@__PURE__*/ n("ZodCUID2", (e, t) => {
2640
+ Ft.init(e, t), Y.init(e, t);
2641
+ }), Pi = /*@__PURE__*/ n("ZodULID", (e, t) => {
2642
+ It.init(e, t), Y.init(e, t);
2643
+ }), Fi = /*@__PURE__*/ n("ZodXID", (e, t) => {
2644
+ Lt.init(e, t), Y.init(e, t);
2645
+ }), Ii = /*@__PURE__*/ n("ZodKSUID", (e, t) => {
2646
+ Rt.init(e, t), Y.init(e, t);
2647
+ }), Li = /*@__PURE__*/ n("ZodIPv4", (e, t) => {
2648
+ Ut.init(e, t), Y.init(e, t);
2649
+ }), Ri = /*@__PURE__*/ n("ZodIPv6", (e, t) => {
2650
+ Wt.init(e, t), Y.init(e, t);
2651
+ }), zi = /*@__PURE__*/ n("ZodCIDRv4", (e, t) => {
2652
+ Gt.init(e, t), Y.init(e, t);
2653
+ }), Bi = /*@__PURE__*/ n("ZodCIDRv6", (e, t) => {
2654
+ Kt.init(e, t), Y.init(e, t);
2655
+ }), Vi = /*@__PURE__*/ n("ZodBase64", (e, t) => {
2656
+ Jt.init(e, t), Y.init(e, t);
2657
+ }), Hi = /*@__PURE__*/ n("ZodBase64URL", (e, t) => {
2658
+ Xt.init(e, t), Y.init(e, t);
2659
+ }), Ui = /*@__PURE__*/ n("ZodE164", (e, t) => {
2660
+ Zt.init(e, t), Y.init(e, t);
2661
+ }), Wi = /*@__PURE__*/ n("ZodJWT", (e, t) => {
2662
+ $t.init(e, t), Y.init(e, t);
2663
+ }), Gi = /*@__PURE__*/ n("ZodNumber", (e, t) => {
2664
+ en.init(e, t), q.init(e, t), e._zod.processJSONSchema = (t, n, r) => Br(e, t, n, r), K(e, "ZodNumber", {
2665
+ gt(e, t) {
2666
+ return this.check(/* @__PURE__ */ hr(e, t));
2667
+ },
2668
+ gte(e, t) {
2669
+ return this.check(/* @__PURE__ */ z(e, t));
2670
+ },
2671
+ min(e, t) {
2672
+ return this.check(/* @__PURE__ */ z(e, t));
2673
+ },
2674
+ lt(e, t) {
2675
+ return this.check(/* @__PURE__ */ mr(e, t));
2676
+ },
2677
+ lte(e, t) {
2678
+ return this.check(/* @__PURE__ */ R(e, t));
2679
+ },
2680
+ max(e, t) {
2681
+ return this.check(/* @__PURE__ */ R(e, t));
2682
+ },
2683
+ int(e) {
2684
+ return this.check(Ji(e));
2685
+ },
2686
+ safe(e) {
2687
+ return this.check(Ji(e));
2688
+ },
2689
+ positive(e) {
2690
+ return this.check(/* @__PURE__ */ hr(0, e));
2691
+ },
2692
+ nonnegative(e) {
2693
+ return this.check(/* @__PURE__ */ z(0, e));
2694
+ },
2695
+ negative(e) {
2696
+ return this.check(/* @__PURE__ */ mr(0, e));
2697
+ },
2698
+ nonpositive(e) {
2699
+ return this.check(/* @__PURE__ */ R(0, e));
2700
+ },
2701
+ multipleOf(e, t) {
2702
+ return this.check(/* @__PURE__ */ gr(e, t));
2703
+ },
2704
+ step(e, t) {
2705
+ return this.check(/* @__PURE__ */ gr(e, t));
2706
+ },
2707
+ finite() {
2708
+ return this;
2709
+ }
2710
+ });
2711
+ let n = e._zod.bag;
2712
+ e.minValue = Math.max(n.minimum ?? -Infinity, n.exclusiveMinimum ?? -Infinity) ?? null, e.maxValue = Math.min(n.maximum ?? Infinity, n.exclusiveMaximum ?? Infinity) ?? null, e.isInt = (n.format ?? "").includes("int") || Number.isSafeInteger(n.multipleOf ?? .5), e.isFinite = !0, e.format = n.format ?? null;
2713
+ });
2714
+ function Ki(e) {
2715
+ return /* @__PURE__ */ lr(Gi, e);
2716
+ }
2717
+ var qi = /*@__PURE__*/ n("ZodNumberFormat", (e, t) => {
2718
+ tn.init(e, t), Gi.init(e, t);
2719
+ });
2720
+ function Ji(e) {
2721
+ return /* @__PURE__ */ ur(qi, e);
2722
+ }
2723
+ var Yi = /*@__PURE__*/ n("ZodNull", (e, t) => {
2724
+ nn.init(e, t), q.init(e, t), e._zod.processJSONSchema = (t, n, r) => Vr(e, t, n, r);
2725
+ });
2726
+ function Xi(e) {
2727
+ return /* @__PURE__ */ dr(Yi, e);
2728
+ }
2729
+ var Zi = /*@__PURE__*/ n("ZodUnknown", (e, t) => {
2730
+ rn.init(e, t), q.init(e, t), e._zod.processJSONSchema = (e, t, n) => void 0;
2731
+ });
2732
+ function Qi() {
2733
+ return /* @__PURE__ */ fr(Zi);
2734
+ }
2735
+ var $i = /*@__PURE__*/ n("ZodNever", (e, t) => {
2736
+ an.init(e, t), q.init(e, t), e._zod.processJSONSchema = (t, n, r) => Hr(e, t, n, r);
2737
+ });
2738
+ function ea(e) {
2739
+ return /* @__PURE__ */ pr($i, e);
2740
+ }
2741
+ var ta = /*@__PURE__*/ n("ZodArray", (e, t) => {
2742
+ sn.init(e, t), q.init(e, t), e._zod.processJSONSchema = (t, n, r) => Kr(e, t, n, r), e.element = t.element, K(e, "ZodArray", {
2743
+ min(e, t) {
2744
+ return this.check(/* @__PURE__ */ B(e, t));
2745
+ },
2746
+ nonempty(e) {
2747
+ return this.check(/* @__PURE__ */ B(1, e));
2748
+ },
2749
+ max(e, t) {
2750
+ return this.check(/* @__PURE__ */ _r(e, t));
2751
+ },
2752
+ length(e, t) {
2753
+ return this.check(/* @__PURE__ */ vr(e, t));
2754
+ },
2755
+ unwrap() {
2756
+ return this.element;
2757
+ }
2758
+ });
2759
+ });
2760
+ function Z(e, t) {
2761
+ return /* @__PURE__ */ Ar(ta, e, t);
2762
+ }
2763
+ var na = /*@__PURE__*/ n("ZodObject", (e, t) => {
2764
+ dn.init(e, t), q.init(e, t), e._zod.processJSONSchema = (t, n, r) => qr(e, t, n, r), m(e, "shape", () => t.shape), K(e, "ZodObject", {
2765
+ keyof() {
2766
+ return sa(Object.keys(this._zod.def.shape));
2767
+ },
2768
+ catchall(e) {
2769
+ return this.clone({
2770
+ ...this._zod.def,
2771
+ catchall: e
2772
+ });
2773
+ },
2774
+ passthrough() {
2775
+ return this.clone({
2776
+ ...this._zod.def,
2777
+ catchall: Qi()
2778
+ });
2779
+ },
2780
+ loose() {
2781
+ return this.clone({
2782
+ ...this._zod.def,
2783
+ catchall: Qi()
2784
+ });
2785
+ },
2786
+ strict() {
2787
+ return this.clone({
2788
+ ...this._zod.def,
2789
+ catchall: ea()
2790
+ });
2791
+ },
2792
+ strip() {
2793
+ return this.clone({
2794
+ ...this._zod.def,
2795
+ catchall: void 0
2796
+ });
2797
+ },
2798
+ extend(e) {
2799
+ return ue(this, e);
2800
+ },
2801
+ safeExtend(e) {
2802
+ return de(this, e);
2803
+ },
2804
+ merge(e) {
2805
+ return fe(this, e);
2806
+ },
2807
+ pick(e) {
2808
+ return ce(this, e);
2809
+ },
2810
+ omit(e) {
2811
+ return le(this, e);
2812
+ },
2813
+ partial(...e) {
2814
+ return pe(ua, this, e[0]);
2815
+ },
2816
+ required(...e) {
2817
+ return me(ba, this, e[0]);
2818
+ }
2819
+ });
2820
+ });
2821
+ function Q(e, t) {
2822
+ return new na({
2823
+ type: "object",
2824
+ shape: e ?? {},
2825
+ ...x(t)
2826
+ });
2827
+ }
2828
+ var ra = /*@__PURE__*/ n("ZodUnion", (e, t) => {
2829
+ pn.init(e, t), q.init(e, t), e._zod.processJSONSchema = (t, n, r) => Jr(e, t, n, r), e.options = t.options;
2830
+ });
2831
+ function ia(e, t) {
2832
+ return new ra({
2833
+ type: "union",
2834
+ options: e,
2835
+ ...x(t)
2836
+ });
2837
+ }
2838
+ var aa = /*@__PURE__*/ n("ZodIntersection", (e, t) => {
2839
+ mn.init(e, t), q.init(e, t), e._zod.processJSONSchema = (t, n, r) => Yr(e, t, n, r);
2840
+ });
2841
+ function oa(e, t) {
2842
+ return new aa({
2843
+ type: "intersection",
2844
+ left: e,
2845
+ right: t
2846
+ });
2847
+ }
2848
+ var $ = /*@__PURE__*/ n("ZodEnum", (e, t) => {
2849
+ gn.init(e, t), q.init(e, t), e._zod.processJSONSchema = (t, n, r) => Ur(e, t, n, r), e.enum = t.entries, e.options = Object.values(t.entries);
2850
+ let n = new Set(Object.keys(t.entries));
2851
+ e.extract = (e, r) => {
2852
+ let i = {};
2853
+ for (let r of e) if (n.has(r)) i[r] = t.entries[r];
2854
+ else throw Error(`Key ${r} not found in enum`);
2855
+ return new $({
2856
+ ...t,
2857
+ checks: [],
2858
+ ...x(r),
2859
+ entries: i
2860
+ });
2861
+ }, e.exclude = (e, r) => {
2862
+ let i = { ...t.entries };
2863
+ for (let t of e) if (n.has(t)) delete i[t];
2864
+ else throw Error(`Key ${t} not found in enum`);
2865
+ return new $({
2866
+ ...t,
2867
+ checks: [],
2868
+ ...x(r),
2869
+ entries: i
2870
+ });
2871
+ };
2872
+ });
2873
+ function sa(e, t) {
2874
+ return new $({
2875
+ type: "enum",
2876
+ entries: Array.isArray(e) ? Object.fromEntries(e.map((e) => [e, e])) : e,
2877
+ ...x(t)
2878
+ });
2879
+ }
2880
+ var ca = /*@__PURE__*/ n("ZodTransform", (e, t) => {
2881
+ _n.init(e, t), q.init(e, t), e._zod.processJSONSchema = (t, n, r) => Gr(e, t, n, r), e._zod.parse = (n, r) => {
2882
+ if (r.direction === "backward") throw new i(e.constructor.name);
2883
+ n.addIssue = (r) => {
2884
+ if (typeof r == "string") n.issues.push(T(r, n.value, t));
2885
+ else {
2886
+ let t = r;
2887
+ t.fatal && (t.continue = !1), t.code ??= "custom", t.input ??= n.value, t.inst ??= e, n.issues.push(T(t));
2888
+ }
2889
+ };
2890
+ let a = t.transform(n.value, n);
2891
+ return a instanceof Promise ? a.then((e) => (n.value = e, n.fallback = !0, n)) : (n.value = a, n.fallback = !0, n);
2892
+ };
2893
+ });
2894
+ function la(e) {
2895
+ return new ca({
2896
+ type: "transform",
2897
+ transform: e
2898
+ });
2899
+ }
2900
+ var ua = /*@__PURE__*/ n("ZodOptional", (e, t) => {
2901
+ yn.init(e, t), q.init(e, t), e._zod.processJSONSchema = (t, n, r) => ri(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
2902
+ });
2903
+ function da(e) {
2904
+ return new ua({
2905
+ type: "optional",
2906
+ innerType: e
2907
+ });
2908
+ }
2909
+ var fa = /*@__PURE__*/ n("ZodExactOptional", (e, t) => {
2910
+ bn.init(e, t), q.init(e, t), e._zod.processJSONSchema = (t, n, r) => ri(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
2911
+ });
2912
+ function pa(e) {
2913
+ return new fa({
2914
+ type: "optional",
2915
+ innerType: e
2916
+ });
2917
+ }
2918
+ var ma = /*@__PURE__*/ n("ZodNullable", (e, t) => {
2919
+ xn.init(e, t), q.init(e, t), e._zod.processJSONSchema = (t, n, r) => Xr(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
2920
+ });
2921
+ function ha(e) {
2922
+ return new ma({
2923
+ type: "nullable",
2924
+ innerType: e
2925
+ });
2926
+ }
2927
+ var ga = /*@__PURE__*/ n("ZodDefault", (e, t) => {
2928
+ Sn.init(e, t), q.init(e, t), e._zod.processJSONSchema = (t, n, r) => Qr(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
2929
+ });
2930
+ function _a(e, t) {
2931
+ return new ga({
2932
+ type: "default",
2933
+ innerType: e,
2934
+ get defaultValue() {
2935
+ return typeof t == "function" ? t() : ie(t);
2936
+ }
2937
+ });
2938
+ }
2939
+ var va = /*@__PURE__*/ n("ZodPrefault", (e, t) => {
2940
+ wn.init(e, t), q.init(e, t), e._zod.processJSONSchema = (t, n, r) => $r(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
2941
+ });
2942
+ function ya(e, t) {
2943
+ return new va({
2944
+ type: "prefault",
2945
+ innerType: e,
2946
+ get defaultValue() {
2947
+ return typeof t == "function" ? t() : ie(t);
2948
+ }
2949
+ });
2950
+ }
2951
+ var ba = /*@__PURE__*/ n("ZodNonOptional", (e, t) => {
2952
+ Tn.init(e, t), q.init(e, t), e._zod.processJSONSchema = (t, n, r) => Zr(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
2953
+ });
2954
+ function xa(e, t) {
2955
+ return new ba({
2956
+ type: "nonoptional",
2957
+ innerType: e,
2958
+ ...x(t)
2959
+ });
2960
+ }
2961
+ var Sa = /*@__PURE__*/ n("ZodCatch", (e, t) => {
2962
+ Dn.init(e, t), q.init(e, t), e._zod.processJSONSchema = (t, n, r) => ei(e, t, n, r), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
2963
+ });
2964
+ function Ca(e, t) {
2965
+ return new Sa({
2966
+ type: "catch",
2967
+ innerType: e,
2968
+ catchValue: typeof t == "function" ? t : () => t
2969
+ });
2970
+ }
2971
+ var wa = /*@__PURE__*/ n("ZodPipe", (e, t) => {
2972
+ On.init(e, t), q.init(e, t), e._zod.processJSONSchema = (t, n, r) => ti(e, t, n, r), e.in = t.in, e.out = t.out;
2973
+ });
2974
+ function Ta(e, t) {
2975
+ return new wa({
2976
+ type: "pipe",
2977
+ in: e,
2978
+ out: t
2979
+ });
2980
+ }
2981
+ var Ea = /*@__PURE__*/ n("ZodReadonly", (e, t) => {
2982
+ kn.init(e, t), q.init(e, t), e._zod.processJSONSchema = (t, n, r) => ni(e, t, n, r), e.unwrap = () => e._zod.def.innerType;
2983
+ });
2984
+ function Da(e) {
2985
+ return new Ea({
2986
+ type: "readonly",
2987
+ innerType: e
2988
+ });
2989
+ }
2990
+ var Oa = /*@__PURE__*/ n("ZodCustom", (e, t) => {
2991
+ jn.init(e, t), q.init(e, t), e._zod.processJSONSchema = (t, n, r) => Wr(e, t, n, r);
2992
+ });
2993
+ function ka(e, t = {}) {
2994
+ return /* @__PURE__ */ jr(Oa, e, t);
2995
+ }
2996
+ function Aa(e, t) {
2997
+ return /* @__PURE__ */ Mr(e, t);
2998
+ }
2999
+ //#endregion
3000
+ //#region src/ox/types.ts
3001
+ var ja = Q({
3002
+ id: J(),
3003
+ displayName: J(),
3004
+ email: J()
3005
+ }), Ma = Q({ data: Z(Z(ia([
3006
+ J(),
3007
+ Ki(),
3008
+ Xi()
3009
+ ]))) }), Na = Q({ data: Q({ id: J() }) }), Pa = "1,500,555,556,557", Fa = (t, n) => ({
3010
+ async autocompleteContacts({ query: r, signal: i }) {
3011
+ let a = n();
3012
+ if (!a) return [];
3013
+ let { data: o } = await t.get(e(a, "addressbooks"), {
3014
+ params: {
3015
+ action: "autocomplete",
3016
+ query: r,
3017
+ columns: Pa,
3018
+ email: !0
3019
+ },
3020
+ signal: i
3021
+ }), { data: s } = Ma.parse(o), c = s.map(([e, t, n, r, i]) => ({
3022
+ id: String(e ?? ""),
3023
+ displayName: String(t ?? ""),
3024
+ email: String(n || r || i || "")
3025
+ })).filter((e) => !!e.email);
3026
+ return Z(ja).parse(c);
3027
+ },
3028
+ async sendMail({ from: r, to: i, subject: a, htmlContent: o, signal: s }) {
3029
+ let c = n();
3030
+ if (!c) throw Error("Open-Xchange API url is not configured");
3031
+ let { data: l } = await t.post(e(c, "mail", "compose"), [], {
3032
+ params: { type: "new" },
3033
+ signal: s
3034
+ }), { data: u } = Na.parse(l), d = [r.name ?? "", r.email], f = new FormData();
3035
+ f.append("JSON", JSON.stringify({
3036
+ from: d,
3037
+ sender: d,
3038
+ to: [[i.name ?? "", i.email]],
3039
+ subject: a,
3040
+ content: o,
3041
+ contentType: "text/html"
3042
+ })), await t.post(e(c, "mail", "compose", u.id, "send"), f, { signal: s });
3043
+ }
3044
+ });
3045
+ //#endregion
3046
+ export { Na as i, ja as n, Ma as r, Fa as t };