@getmicdrop/venue-calendar 4.3.50 → 4.3.52

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