@getmicdrop/venue-calendar 4.0.124 → 4.0.126

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 (80) hide show
  1. package/dist/CartView-B9aFeiLN.js +2509 -0
  2. package/dist/CartView-B9aFeiLN.js.map +1 -0
  3. package/dist/Checkout-48xwm6As.js +4162 -0
  4. package/dist/Checkout-48xwm6As.js.map +1 -0
  5. package/dist/Checkout-BVgVrBY9.js +1854 -0
  6. package/dist/Checkout-BVgVrBY9.js.map +1 -0
  7. package/dist/CheckoutTimer-BhCgZiZx.js +147 -0
  8. package/dist/CheckoutTimer-BhCgZiZx.js.map +1 -0
  9. package/dist/{ClockIcon-BZi4lOzl.js → ClockIcon-CbNo7ZIv.js} +2 -2
  10. package/dist/{ClockIcon-BZi4lOzl.js.map → ClockIcon-CbNo7ZIv.js.map} +1 -1
  11. package/dist/{CollectionView-CehakNqZ.js → CollectionView-C8-jKGCR.js} +73 -64
  12. package/dist/CollectionView-C8-jKGCR.js.map +1 -0
  13. package/dist/{Event-CGhar5tR.js → Event-D9bFJ0Ad.js} +1483 -1530
  14. package/dist/{Event-CGhar5tR.js.map → Event-D9bFJ0Ad.js.map} +1 -1
  15. package/dist/EventPage-Dr0IT4V9.js +987 -0
  16. package/dist/EventPage-Dr0IT4V9.js.map +1 -0
  17. package/dist/{Heading-B4wZECip.js → Heading-W0r66xC8.js} +4 -4
  18. package/dist/{Heading-B4wZECip.js.map → Heading-W0r66xC8.js.map} +1 -1
  19. package/dist/{ScarcityBadge-BCDxyanc.js → ScarcityBadge-D-FV75Zp.js} +12 -12
  20. package/dist/{ScarcityBadge-BCDxyanc.js.map → ScarcityBadge-D-FV75Zp.js.map} +1 -1
  21. package/dist/{SeriesPage-Dr3GKPTx.js → SeriesPage-BQVJzHqW.js} +9 -9
  22. package/dist/{SeriesPage-Dr3GKPTx.js.map → SeriesPage-BQVJzHqW.js.map} +1 -1
  23. package/dist/{Spinner-VwUBKkEM.js → Spinner-BCYe2kk8.js} +2 -2
  24. package/dist/{Spinner-VwUBKkEM.js.map → Spinner-BCYe2kk8.js.map} +1 -1
  25. package/dist/{Success-Das6Qwv1.js → Success-zPOifwK_.js} +130 -125
  26. package/dist/Success-zPOifwK_.js.map +1 -0
  27. package/dist/{Text-CF9KmAKz.js → Text-DZBYT4iQ.js} +13 -13
  28. package/dist/{Text-CF9KmAKz.js.map → Text-DZBYT4iQ.js.map} +1 -1
  29. package/dist/{VenueCalendar-BVBxl8VZ.js → VenueCalendar-759NANbc.js} +5017 -4437
  30. package/dist/VenueCalendar-759NANbc.js.map +1 -0
  31. package/dist/{ViewTicketsEmbed-BQ0bdbeh.js → ViewTicketsEmbed-DvT73NsI.js} +130 -130
  32. package/dist/{ViewTicketsEmbed-BQ0bdbeh.js.map → ViewTicketsEmbed-DvT73NsI.js.map} +1 -1
  33. package/dist/api/api.cjs +1 -1
  34. package/dist/api/api.cjs.map +1 -1
  35. package/dist/api/api.mjs +14 -3
  36. package/dist/api/api.mjs.map +1 -1
  37. package/dist/{labels-BxfMxVrF.js → labels-BZI8MJxH.js} +286 -234
  38. package/dist/labels-BZI8MJxH.js.map +1 -0
  39. package/dist/{modalManager.svelte-Dk5qgjvY.js → modalManager.svelte-BXQjP4sY.js} +2 -2
  40. package/dist/{modalManager.svelte-Dk5qgjvY.js.map → modalManager.svelte-BXQjP4sY.js.map} +1 -1
  41. package/dist/{promo-BsdXEOuD.js → promo-Cmms6651.js} +2 -2
  42. package/dist/{promo-BsdXEOuD.js.map → promo-Cmms6651.js.map} +1 -1
  43. package/dist/seo/seo.cjs +1 -1
  44. package/dist/seo/seo.cjs.map +1 -1
  45. package/dist/seo/seo.mjs +5 -2
  46. package/dist/seo/seo.mjs.map +1 -1
  47. package/dist/shareCopyFeedback.svelte-Cade1Zzk.js +114 -0
  48. package/dist/shareCopyFeedback.svelte-Cade1Zzk.js.map +1 -0
  49. package/dist/{showcase-state-options-D49_TfeX.js → showcase-state-options-DjWk_E2A.js} +57 -80
  50. package/dist/showcase-state-options-DjWk_E2A.js.map +1 -0
  51. package/dist/transform-KCOEf0qs.js +271 -0
  52. package/dist/transform-KCOEf0qs.js.map +1 -0
  53. package/dist/types/index.d.ts +1 -1
  54. package/dist/{utm-CyRdPd7L.js → utm-BFAXxrou.js} +2 -2
  55. package/dist/utm-BFAXxrou.js.map +1 -0
  56. package/dist/venue-calendar.css +1 -1
  57. package/dist/venue-calendar.es.js +8 -8
  58. package/dist/venue-calendar.iife.js +115 -52
  59. package/dist/venue-calendar.iife.js.map +1 -1
  60. package/dist/venue-calendar.umd.js +108 -45
  61. package/dist/venue-calendar.umd.js.map +1 -1
  62. package/package.json +195 -183
  63. package/dist/CartView-Cc5wK8-c.js +0 -2474
  64. package/dist/CartView-Cc5wK8-c.js.map +0 -1
  65. package/dist/Checkout-JvJfOpV1.js +0 -1731
  66. package/dist/Checkout-JvJfOpV1.js.map +0 -1
  67. package/dist/Checkout-OrpwbbHZ.js +0 -1062
  68. package/dist/Checkout-OrpwbbHZ.js.map +0 -1
  69. package/dist/CheckoutTimer-BtAT-lO8.js +0 -141
  70. package/dist/CheckoutTimer-BtAT-lO8.js.map +0 -1
  71. package/dist/CollectionView-CehakNqZ.js.map +0 -1
  72. package/dist/EventPage-BjPjn36_.js +0 -995
  73. package/dist/EventPage-BjPjn36_.js.map +0 -1
  74. package/dist/Success-Das6Qwv1.js.map +0 -1
  75. package/dist/VenueCalendar-BVBxl8VZ.js.map +0 -1
  76. package/dist/labels-BxfMxVrF.js.map +0 -1
  77. package/dist/showcase-state-options-D49_TfeX.js.map +0 -1
  78. package/dist/transform-DzXrLnY9.js +0 -364
  79. package/dist/transform-DzXrLnY9.js.map +0 -1
  80. package/dist/utm-CyRdPd7L.js.map +0 -1
@@ -0,0 +1,4162 @@
1
+ import "svelte/internal/disclose-version";
2
+ import * as o from "svelte/internal/client";
3
+ import { u as ct, A as we, C as ke, r as Xt, h as ot, D as He, E as Xe, F as Qe, t as Me, G as Ln, H as Jn, J as Vn, W as Gn, M as Bn, a as Wn, b as qn, c as Kn, K as Yn, e as Hn, L as Xn, N as Qn, O as er, P as tr, Q as et, R as nr, S as rr, T as wt, U as or, V as ir, X as sr } from "./VenueCalendar-759NANbc.js";
4
+ import { onMount as ar } from "svelte";
5
+ import { l as cr, g as ur } from "./utm-BFAXxrou.js";
6
+ import { r as lr } from "./promo-Cmms6651.js";
7
+ import { g as kt, C as dr, a as fr } from "./Checkout-BVgVrBY9.js";
8
+ import { f as pr } from "./transform-KCOEf0qs.js";
9
+ var hr = o.from_svg('<svg aria-hidden="true" fill="none" stroke-width="2" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" d="M8 2.25v3M16 2.25v3M3.75 9.75h16.5M5.25 4.5h13.5a1.5 1.5 0 011.5 1.5v13.5a1.5 1.5 0 01-1.5 1.5H5.25a1.5 1.5 0 01-1.5-1.5V6a1.5 1.5 0 011.5-1.5z"></path></svg>');
10
+ function mr(e, t) {
11
+ let n = o.prop(t, "size", 3, "24"), r = o.prop(t, "color", 3, "currentColor"), i = o.prop(t, "class", 3, "");
12
+ var a = hr();
13
+ o.template_effect(() => {
14
+ o.set_class(a, 0, o.clsx(i())), o.set_attribute(a, "width", n()), o.set_attribute(a, "height", n()), o.set_attribute(a, "stroke", r());
15
+ }), o.append(e, a);
16
+ }
17
+ var gr = o.from_svg('<path d="M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"></path>'), vr = o.from_svg('<polyline points="40 144 96 200 224 72" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></polyline>'), _r = o.from_svg('<svg aria-hidden="true" viewBox="0 0 256 256" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><!></svg>');
18
+ function zt(e, t) {
19
+ o.push(t, !0);
20
+ let n = o.prop(t, "size", 3, "24"), r = o.prop(t, "color", 3, "currentColor"), i = o.prop(t, "class", 3, "");
21
+ const a = ct();
22
+ let s = o.derived(() => t.weight ?? a?.weight ?? "regular");
23
+ var c = _r();
24
+ let u;
25
+ var l = o.child(c);
26
+ {
27
+ var m = (f) => {
28
+ var p = gr();
29
+ o.append(f, p);
30
+ }, g = (f) => {
31
+ var p = vr();
32
+ o.append(f, p);
33
+ };
34
+ o.if(l, (f) => {
35
+ o.get(s) === "fill" ? f(m) : f(g, -1);
36
+ });
37
+ }
38
+ o.reset(c), o.template_effect(() => {
39
+ o.set_class(c, 0, o.clsx(i())), o.set_attribute(c, "width", n()), o.set_attribute(c, "height", n()), u = o.set_style(c, "", u, { color: r() });
40
+ }), o.append(e, c), o.pop();
41
+ }
42
+ var yr = o.from_svg('<path d="M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>'), br = o.from_svg('<line x1="200" y1="56" x2="56" y2="200" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line><line x1="200" y1="200" x2="56" y2="56" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></line>', 1), wr = o.from_svg('<svg aria-hidden="true" viewBox="0 0 256 256" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><!></svg>');
43
+ function kr(e, t) {
44
+ o.push(t, !0);
45
+ let n = o.prop(t, "size", 3, "24"), r = o.prop(t, "color", 3, "currentColor"), i = o.prop(t, "class", 3, "");
46
+ const a = ct();
47
+ let s = o.derived(() => t.weight ?? a?.weight ?? "regular");
48
+ var c = wr();
49
+ let u;
50
+ var l = o.child(c);
51
+ {
52
+ var m = (f) => {
53
+ var p = yr();
54
+ o.append(f, p);
55
+ }, g = (f) => {
56
+ var p = br();
57
+ o.next(), o.append(f, p);
58
+ };
59
+ o.if(l, (f) => {
60
+ o.get(s) === "fill" ? f(m) : f(g, -1);
61
+ });
62
+ }
63
+ o.reset(c), o.template_effect(() => {
64
+ o.set_class(c, 0, o.clsx(i())), o.set_attribute(c, "width", n()), o.set_attribute(c, "height", n()), u = o.set_style(c, "", u, { color: r() });
65
+ }), o.append(e, c), o.pop();
66
+ }
67
+ var zr = o.from_svg('<path d="M243.31,136,144,36.69A15.86,15.86,0,0,0,132.69,32H40a8,8,0,0,0-8,8v92.69A15.86,15.86,0,0,0,36.69,144L136,243.31a16,16,0,0,0,22.63,0l84.68-84.68a16,16,0,0,0,0-22.63ZM84,96A12,12,0,1,1,96,84,12,12,0,0,1,84,96Z"></path>'), Sr = o.from_svg('<path d="M42.34,138.34A8,8,0,0,1,40,132.69V40h92.69a8,8,0,0,1,5.65,2.34l99.32,99.32a8,8,0,0,1,0,11.31L153,237.66a8,8,0,0,1-11.31,0Z" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"></path><circle cx="84" cy="84" r="12"></circle>', 1), Ir = o.from_svg('<svg aria-hidden="true" viewBox="0 0 256 256" fill="currentColor" xmlns="http://www.w3.org/2000/svg"><!></svg>');
68
+ function Zr(e, t) {
69
+ o.push(t, !0);
70
+ let n = o.prop(t, "size", 3, "24"), r = o.prop(t, "color", 3, "currentColor"), i = o.prop(t, "class", 3, "");
71
+ const a = ct();
72
+ let s = o.derived(() => t.weight ?? a?.weight ?? "regular");
73
+ var c = Ir();
74
+ let u;
75
+ var l = o.child(c);
76
+ {
77
+ var m = (f) => {
78
+ var p = zr();
79
+ o.append(f, p);
80
+ }, g = (f) => {
81
+ var p = Sr();
82
+ o.next(), o.append(f, p);
83
+ };
84
+ o.if(l, (f) => {
85
+ o.get(s) === "fill" ? f(m) : f(g, -1);
86
+ });
87
+ }
88
+ o.reset(c), o.template_effect(() => {
89
+ o.set_class(c, 0, o.clsx(i())), o.set_attribute(c, "width", n()), o.set_attribute(c, "height", n()), u = o.set_style(c, "", u, { color: r() });
90
+ }), o.append(e, c), o.pop();
91
+ }
92
+ var St;
93
+ function d(e, t, n) {
94
+ function r(c, u) {
95
+ if (c._zod || Object.defineProperty(c, "_zod", {
96
+ value: {
97
+ def: u,
98
+ constr: s,
99
+ traits: /* @__PURE__ */ new Set()
100
+ },
101
+ enumerable: !1
102
+ }), c._zod.traits.has(e))
103
+ return;
104
+ c._zod.traits.add(e), t(c, u);
105
+ const l = s.prototype, m = Object.keys(l);
106
+ for (let g = 0; g < m.length; g++) {
107
+ const f = m[g];
108
+ f in c || (c[f] = l[f].bind(c));
109
+ }
110
+ }
111
+ const i = n?.Parent ?? Object;
112
+ class a extends i {
113
+ }
114
+ Object.defineProperty(a, "name", { value: e });
115
+ function s(c) {
116
+ var u;
117
+ const l = n?.Parent ? new a() : this;
118
+ r(l, c), (u = l._zod).deferred ?? (u.deferred = []);
119
+ for (const m of l._zod.deferred)
120
+ m();
121
+ return l;
122
+ }
123
+ return Object.defineProperty(s, "init", { value: r }), Object.defineProperty(s, Symbol.hasInstance, {
124
+ value: (c) => n?.Parent && c instanceof n.Parent ? !0 : c?._zod?.traits?.has(e)
125
+ }), Object.defineProperty(s, "name", { value: e }), s;
126
+ }
127
+ class Ie extends Error {
128
+ constructor() {
129
+ super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
130
+ }
131
+ }
132
+ class Qt extends Error {
133
+ constructor(t) {
134
+ super(`Encountered unidirectional transform during encode: ${t}`), this.name = "ZodEncodeError";
135
+ }
136
+ }
137
+ (St = globalThis).__zod_globalConfig ?? (St.__zod_globalConfig = {});
138
+ const ut = globalThis.__zod_globalConfig;
139
+ function me(e) {
140
+ return ut;
141
+ }
142
+ function en(e) {
143
+ const t = Object.values(e).filter((r) => typeof r == "number");
144
+ return Object.entries(e).filter(([r, i]) => t.indexOf(+r) === -1).map(([r, i]) => i);
145
+ }
146
+ function it(e, t) {
147
+ return typeof t == "bigint" ? t.toString() : t;
148
+ }
149
+ function lt(e) {
150
+ return {
151
+ get value() {
152
+ {
153
+ const t = e();
154
+ return Object.defineProperty(this, "value", { value: t }), t;
155
+ }
156
+ }
157
+ };
158
+ }
159
+ function dt(e) {
160
+ return e == null;
161
+ }
162
+ function ft(e) {
163
+ const t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
164
+ return e.slice(t, n);
165
+ }
166
+ function Pr(e, t) {
167
+ const n = e / t, r = Math.round(n), i = Number.EPSILON * Math.max(Math.abs(n), 1);
168
+ return Math.abs(n - r) < i ? 0 : n - r;
169
+ }
170
+ const It = /* @__PURE__ */ Symbol("evaluating");
171
+ function P(e, t, n) {
172
+ let r;
173
+ Object.defineProperty(e, t, {
174
+ get() {
175
+ if (r !== It)
176
+ return r === void 0 && (r = It, r = n()), r;
177
+ },
178
+ set(i) {
179
+ Object.defineProperty(e, t, {
180
+ value: i
181
+ // configurable: true,
182
+ });
183
+ },
184
+ configurable: !0
185
+ });
186
+ }
187
+ function ve(e, t, n) {
188
+ Object.defineProperty(e, t, {
189
+ value: n,
190
+ writable: !0,
191
+ enumerable: !0,
192
+ configurable: !0
193
+ });
194
+ }
195
+ function pe(...e) {
196
+ const t = {};
197
+ for (const n of e) {
198
+ const r = Object.getOwnPropertyDescriptors(n);
199
+ Object.assign(t, r);
200
+ }
201
+ return Object.defineProperties({}, t);
202
+ }
203
+ function Zt(e) {
204
+ return JSON.stringify(e);
205
+ }
206
+ function Tr(e) {
207
+ return e.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
208
+ }
209
+ const tn = "captureStackTrace" in Error ? Error.captureStackTrace : (...e) => {
210
+ };
211
+ function Je(e) {
212
+ return typeof e == "object" && e !== null && !Array.isArray(e);
213
+ }
214
+ const Er = /* @__PURE__ */ lt(() => {
215
+ if (ut.jitless || typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
216
+ return !1;
217
+ try {
218
+ const e = Function;
219
+ return new e(""), !0;
220
+ } catch {
221
+ return !1;
222
+ }
223
+ });
224
+ function Ce(e) {
225
+ if (Je(e) === !1)
226
+ return !1;
227
+ const t = e.constructor;
228
+ if (t === void 0 || typeof t != "function")
229
+ return !0;
230
+ const n = t.prototype;
231
+ return !(Je(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
232
+ }
233
+ function nn(e) {
234
+ return Ce(e) ? { ...e } : Array.isArray(e) ? [...e] : e instanceof Map ? new Map(e) : e instanceof Set ? new Set(e) : e;
235
+ }
236
+ const xr = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
237
+ function We(e) {
238
+ return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
239
+ }
240
+ function he(e, t, n) {
241
+ const r = new e._zod.constr(t ?? e._zod.def);
242
+ return (!t || n?.parent) && (r._zod.parent = e), r;
243
+ }
244
+ function v(e) {
245
+ const t = e;
246
+ if (!t)
247
+ return {};
248
+ if (typeof t == "string")
249
+ return { error: () => t };
250
+ if (t?.message !== void 0) {
251
+ if (t?.error !== void 0)
252
+ throw new Error("Cannot specify both `message` and `error` params");
253
+ t.error = t.message;
254
+ }
255
+ return delete t.message, typeof t.error == "string" ? { ...t, error: () => t.error } : t;
256
+ }
257
+ function Or(e) {
258
+ return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
259
+ }
260
+ const $r = {
261
+ safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
262
+ int32: [-2147483648, 2147483647],
263
+ uint32: [0, 4294967295],
264
+ float32: [-34028234663852886e22, 34028234663852886e22],
265
+ float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
266
+ };
267
+ function Cr(e, t) {
268
+ const n = e._zod.def, r = n.checks;
269
+ if (r && r.length > 0)
270
+ throw new Error(".pick() cannot be used on object schemas containing refinements");
271
+ const a = pe(e._zod.def, {
272
+ get shape() {
273
+ const s = {};
274
+ for (const c in t) {
275
+ if (!(c in n.shape))
276
+ throw new Error(`Unrecognized key: "${c}"`);
277
+ t[c] && (s[c] = n.shape[c]);
278
+ }
279
+ return ve(this, "shape", s), s;
280
+ },
281
+ checks: []
282
+ });
283
+ return he(e, a);
284
+ }
285
+ function Nr(e, t) {
286
+ const n = e._zod.def, r = n.checks;
287
+ if (r && r.length > 0)
288
+ throw new Error(".omit() cannot be used on object schemas containing refinements");
289
+ const a = pe(e._zod.def, {
290
+ get shape() {
291
+ const s = { ...e._zod.def.shape };
292
+ for (const c in t) {
293
+ if (!(c in n.shape))
294
+ throw new Error(`Unrecognized key: "${c}"`);
295
+ t[c] && delete s[c];
296
+ }
297
+ return ve(this, "shape", s), s;
298
+ },
299
+ checks: []
300
+ });
301
+ return he(e, a);
302
+ }
303
+ function Ar(e, t) {
304
+ if (!Ce(t))
305
+ throw new Error("Invalid input to extend: expected a plain object");
306
+ const n = e._zod.def.checks;
307
+ if (n && n.length > 0) {
308
+ const a = e._zod.def.shape;
309
+ for (const s in t)
310
+ if (Object.getOwnPropertyDescriptor(a, s) !== void 0)
311
+ throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
312
+ }
313
+ const i = pe(e._zod.def, {
314
+ get shape() {
315
+ const a = { ...e._zod.def.shape, ...t };
316
+ return ve(this, "shape", a), a;
317
+ }
318
+ });
319
+ return he(e, i);
320
+ }
321
+ function jr(e, t) {
322
+ if (!Ce(t))
323
+ throw new Error("Invalid input to safeExtend: expected a plain object");
324
+ const n = pe(e._zod.def, {
325
+ get shape() {
326
+ const r = { ...e._zod.def.shape, ...t };
327
+ return ve(this, "shape", r), r;
328
+ }
329
+ });
330
+ return he(e, n);
331
+ }
332
+ function Dr(e, t) {
333
+ if (e._zod.def.checks?.length)
334
+ throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
335
+ const n = pe(e._zod.def, {
336
+ get shape() {
337
+ const r = { ...e._zod.def.shape, ...t._zod.def.shape };
338
+ return ve(this, "shape", r), r;
339
+ },
340
+ get catchall() {
341
+ return t._zod.def.catchall;
342
+ },
343
+ checks: t._zod.def.checks ?? []
344
+ });
345
+ return he(e, n);
346
+ }
347
+ function Rr(e, t, n) {
348
+ const i = t._zod.def.checks;
349
+ if (i && i.length > 0)
350
+ throw new Error(".partial() cannot be used on object schemas containing refinements");
351
+ const s = pe(t._zod.def, {
352
+ get shape() {
353
+ const c = t._zod.def.shape, u = { ...c };
354
+ if (n)
355
+ for (const l in n) {
356
+ if (!(l in c))
357
+ throw new Error(`Unrecognized key: "${l}"`);
358
+ n[l] && (u[l] = e ? new e({
359
+ type: "optional",
360
+ innerType: c[l]
361
+ }) : c[l]);
362
+ }
363
+ else
364
+ for (const l in c)
365
+ u[l] = e ? new e({
366
+ type: "optional",
367
+ innerType: c[l]
368
+ }) : c[l];
369
+ return ve(this, "shape", u), u;
370
+ },
371
+ checks: []
372
+ });
373
+ return he(t, s);
374
+ }
375
+ function Fr(e, t, n) {
376
+ const r = pe(t._zod.def, {
377
+ get shape() {
378
+ const i = t._zod.def.shape, a = { ...i };
379
+ if (n)
380
+ for (const s in n) {
381
+ if (!(s in a))
382
+ throw new Error(`Unrecognized key: "${s}"`);
383
+ n[s] && (a[s] = new e({
384
+ type: "nonoptional",
385
+ innerType: i[s]
386
+ }));
387
+ }
388
+ else
389
+ for (const s in i)
390
+ a[s] = new e({
391
+ type: "nonoptional",
392
+ innerType: i[s]
393
+ });
394
+ return ve(this, "shape", a), a;
395
+ }
396
+ });
397
+ return he(t, r);
398
+ }
399
+ function Se(e, t = 0) {
400
+ if (e.aborted === !0)
401
+ return !0;
402
+ for (let n = t; n < e.issues.length; n++)
403
+ if (e.issues[n]?.continue !== !0)
404
+ return !0;
405
+ return !1;
406
+ }
407
+ function Ur(e, t = 0) {
408
+ if (e.aborted === !0)
409
+ return !0;
410
+ for (let n = t; n < e.issues.length; n++)
411
+ if (e.issues[n]?.continue === !1)
412
+ return !0;
413
+ return !1;
414
+ }
415
+ function rn(e, t) {
416
+ return t.map((n) => {
417
+ var r;
418
+ return (r = n).path ?? (r.path = []), n.path.unshift(e), n;
419
+ });
420
+ }
421
+ function je(e) {
422
+ return typeof e == "string" ? e : e?.message;
423
+ }
424
+ function ge(e, t, n) {
425
+ const r = e.message ? e.message : je(e.inst?._zod.def?.error?.(e)) ?? je(t?.error?.(e)) ?? je(n.customError?.(e)) ?? je(n.localeError?.(e)) ?? "Invalid input", { inst: i, continue: a, input: s, ...c } = e;
426
+ return c.path ?? (c.path = []), c.message = r, t?.reportInput && (c.input = s), c;
427
+ }
428
+ function pt(e) {
429
+ return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
430
+ }
431
+ function Ne(...e) {
432
+ const [t, n, r] = e;
433
+ return typeof t == "string" ? {
434
+ message: t,
435
+ code: "custom",
436
+ input: n,
437
+ inst: r
438
+ } : { ...t };
439
+ }
440
+ const on = (e, t) => {
441
+ e.name = "$ZodError", Object.defineProperty(e, "_zod", {
442
+ value: e._zod,
443
+ enumerable: !1
444
+ }), Object.defineProperty(e, "issues", {
445
+ value: t,
446
+ enumerable: !1
447
+ }), e.message = JSON.stringify(t, it, 2), Object.defineProperty(e, "toString", {
448
+ value: () => e.message,
449
+ enumerable: !1
450
+ });
451
+ }, sn = d("$ZodError", on), an = d("$ZodError", on, { Parent: Error });
452
+ function Mr(e, t = (n) => n.message) {
453
+ const n = {}, r = [];
454
+ for (const i of e.issues)
455
+ i.path.length > 0 ? (n[i.path[0]] = n[i.path[0]] || [], n[i.path[0]].push(t(i))) : r.push(t(i));
456
+ return { formErrors: r, fieldErrors: n };
457
+ }
458
+ function Lr(e, t = (n) => n.message) {
459
+ const n = { _errors: [] }, r = (i, a = []) => {
460
+ for (const s of i.issues)
461
+ if (s.code === "invalid_union" && s.errors.length)
462
+ s.errors.map((c) => r({ issues: c }, [...a, ...s.path]));
463
+ else if (s.code === "invalid_key")
464
+ r({ issues: s.issues }, [...a, ...s.path]);
465
+ else if (s.code === "invalid_element")
466
+ r({ issues: s.issues }, [...a, ...s.path]);
467
+ else {
468
+ const c = [...a, ...s.path];
469
+ if (c.length === 0)
470
+ n._errors.push(t(s));
471
+ else {
472
+ let u = n, l = 0;
473
+ for (; l < c.length; ) {
474
+ const m = c[l];
475
+ l === c.length - 1 ? (u[m] = u[m] || { _errors: [] }, u[m]._errors.push(t(s))) : u[m] = u[m] || { _errors: [] }, u = u[m], l++;
476
+ }
477
+ }
478
+ }
479
+ };
480
+ return r(e), n;
481
+ }
482
+ const ht = (e) => (t, n, r, i) => {
483
+ const a = r ? { ...r, async: !1 } : { async: !1 }, s = t._zod.run({ value: n, issues: [] }, a);
484
+ if (s instanceof Promise)
485
+ throw new Ie();
486
+ if (s.issues.length) {
487
+ const c = new (i?.Err ?? e)(s.issues.map((u) => ge(u, a, me())));
488
+ throw tn(c, i?.callee), c;
489
+ }
490
+ return s.value;
491
+ }, mt = (e) => async (t, n, r, i) => {
492
+ const a = r ? { ...r, async: !0 } : { async: !0 };
493
+ let s = t._zod.run({ value: n, issues: [] }, a);
494
+ if (s instanceof Promise && (s = await s), s.issues.length) {
495
+ const c = new (i?.Err ?? e)(s.issues.map((u) => ge(u, a, me())));
496
+ throw tn(c, i?.callee), c;
497
+ }
498
+ return s.value;
499
+ }, qe = (e) => (t, n, r) => {
500
+ const i = r ? { ...r, async: !1 } : { async: !1 }, a = t._zod.run({ value: n, issues: [] }, i);
501
+ if (a instanceof Promise)
502
+ throw new Ie();
503
+ return a.issues.length ? {
504
+ success: !1,
505
+ error: new (e ?? sn)(a.issues.map((s) => ge(s, i, me())))
506
+ } : { success: !0, data: a.value };
507
+ }, Jr = /* @__PURE__ */ qe(an), Ke = (e) => async (t, n, r) => {
508
+ const i = r ? { ...r, async: !0 } : { async: !0 };
509
+ let a = t._zod.run({ value: n, issues: [] }, i);
510
+ return a instanceof Promise && (a = await a), a.issues.length ? {
511
+ success: !1,
512
+ error: new e(a.issues.map((s) => ge(s, i, me())))
513
+ } : { success: !0, data: a.value };
514
+ }, Vr = /* @__PURE__ */ Ke(an), Gr = (e) => (t, n, r) => {
515
+ const i = r ? { ...r, direction: "backward" } : { direction: "backward" };
516
+ return ht(e)(t, n, i);
517
+ }, Br = (e) => (t, n, r) => ht(e)(t, n, r), Wr = (e) => async (t, n, r) => {
518
+ const i = r ? { ...r, direction: "backward" } : { direction: "backward" };
519
+ return mt(e)(t, n, i);
520
+ }, qr = (e) => async (t, n, r) => mt(e)(t, n, r), Kr = (e) => (t, n, r) => {
521
+ const i = r ? { ...r, direction: "backward" } : { direction: "backward" };
522
+ return qe(e)(t, n, i);
523
+ }, Yr = (e) => (t, n, r) => qe(e)(t, n, r), Hr = (e) => async (t, n, r) => {
524
+ const i = r ? { ...r, direction: "backward" } : { direction: "backward" };
525
+ return Ke(e)(t, n, i);
526
+ }, Xr = (e) => async (t, n, r) => Ke(e)(t, n, r), Qr = /^[cC][0-9a-z]{6,}$/, eo = /^[0-9a-z]+$/, to = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, no = /^[0-9a-vA-V]{20}$/, ro = /^[A-Za-z0-9]{27}$/, oo = /^[a-zA-Z0-9_-]{21}$/, io = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, so = /^([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})$/, Pt = (e) => e ? new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`) : /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/, ao = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, co = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
527
+ function uo() {
528
+ return new RegExp(co, "u");
529
+ }
530
+ const lo = /^(?:(?: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])$/, fo = /^(([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}|:))$/, po = /^((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])$/, ho = /^(([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])$/, mo = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, cn = /^[A-Za-z0-9_-]*$/, go = /^https?$/, vo = /^\+[1-9]\d{6,14}$/, un = "(?:(?:\\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])))", _o = /* @__PURE__ */ new RegExp(`^${un}$`);
531
+ function ln(e) {
532
+ const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
533
+ 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+)?)?`;
534
+ }
535
+ function yo(e) {
536
+ return new RegExp(`^${ln(e)}$`);
537
+ }
538
+ function bo(e) {
539
+ const t = ln({ precision: e.precision }), n = ["Z"];
540
+ e.local && n.push(""), e.offset && n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");
541
+ const r = `${t}(?:${n.join("|")})`;
542
+ return new RegExp(`^${un}T(?:${r})$`);
543
+ }
544
+ const wo = (e) => {
545
+ const t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
546
+ return new RegExp(`^${t}$`);
547
+ }, ko = /^-?\d+$/, zo = /^-?\d+(?:\.\d+)?$/, So = /^[^A-Z]*$/, Io = /^[^a-z]*$/, Y = /* @__PURE__ */ d("$ZodCheck", (e, t) => {
548
+ var n;
549
+ e._zod ?? (e._zod = {}), e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
550
+ }), dn = {
551
+ number: "number",
552
+ bigint: "bigint",
553
+ object: "date"
554
+ }, fn = /* @__PURE__ */ d("$ZodCheckLessThan", (e, t) => {
555
+ Y.init(e, t);
556
+ const n = dn[typeof t.value];
557
+ e._zod.onattach.push((r) => {
558
+ const i = r._zod.bag, a = (t.inclusive ? i.maximum : i.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
559
+ t.value < a && (t.inclusive ? i.maximum = t.value : i.exclusiveMaximum = t.value);
560
+ }), e._zod.check = (r) => {
561
+ (t.inclusive ? r.value <= t.value : r.value < t.value) || r.issues.push({
562
+ origin: n,
563
+ code: "too_big",
564
+ maximum: typeof t.value == "object" ? t.value.getTime() : t.value,
565
+ input: r.value,
566
+ inclusive: t.inclusive,
567
+ inst: e,
568
+ continue: !t.abort
569
+ });
570
+ };
571
+ }), pn = /* @__PURE__ */ d("$ZodCheckGreaterThan", (e, t) => {
572
+ Y.init(e, t);
573
+ const n = dn[typeof t.value];
574
+ e._zod.onattach.push((r) => {
575
+ const i = r._zod.bag, a = (t.inclusive ? i.minimum : i.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
576
+ t.value > a && (t.inclusive ? i.minimum = t.value : i.exclusiveMinimum = t.value);
577
+ }), e._zod.check = (r) => {
578
+ (t.inclusive ? r.value >= t.value : r.value > t.value) || r.issues.push({
579
+ origin: n,
580
+ code: "too_small",
581
+ minimum: typeof t.value == "object" ? t.value.getTime() : t.value,
582
+ input: r.value,
583
+ inclusive: t.inclusive,
584
+ inst: e,
585
+ continue: !t.abort
586
+ });
587
+ };
588
+ }), Zo = /* @__PURE__ */ d("$ZodCheckMultipleOf", (e, t) => {
589
+ Y.init(e, t), e._zod.onattach.push((n) => {
590
+ var r;
591
+ (r = n._zod.bag).multipleOf ?? (r.multipleOf = t.value);
592
+ }), e._zod.check = (n) => {
593
+ if (typeof n.value != typeof t.value)
594
+ throw new Error("Cannot mix number and bigint in multiple_of check.");
595
+ (typeof n.value == "bigint" ? n.value % t.value === BigInt(0) : Pr(n.value, t.value) === 0) || n.issues.push({
596
+ origin: typeof n.value,
597
+ code: "not_multiple_of",
598
+ divisor: t.value,
599
+ input: n.value,
600
+ inst: e,
601
+ continue: !t.abort
602
+ });
603
+ };
604
+ }), Po = /* @__PURE__ */ d("$ZodCheckNumberFormat", (e, t) => {
605
+ Y.init(e, t), t.format = t.format || "float64";
606
+ const n = t.format?.includes("int"), r = n ? "int" : "number", [i, a] = $r[t.format];
607
+ e._zod.onattach.push((s) => {
608
+ const c = s._zod.bag;
609
+ c.format = t.format, c.minimum = i, c.maximum = a, n && (c.pattern = ko);
610
+ }), e._zod.check = (s) => {
611
+ const c = s.value;
612
+ if (n) {
613
+ if (!Number.isInteger(c)) {
614
+ s.issues.push({
615
+ expected: r,
616
+ format: t.format,
617
+ code: "invalid_type",
618
+ continue: !1,
619
+ input: c,
620
+ inst: e
621
+ });
622
+ return;
623
+ }
624
+ if (!Number.isSafeInteger(c)) {
625
+ c > 0 ? s.issues.push({
626
+ input: c,
627
+ code: "too_big",
628
+ maximum: Number.MAX_SAFE_INTEGER,
629
+ note: "Integers must be within the safe integer range.",
630
+ inst: e,
631
+ origin: r,
632
+ inclusive: !0,
633
+ continue: !t.abort
634
+ }) : s.issues.push({
635
+ input: c,
636
+ code: "too_small",
637
+ minimum: Number.MIN_SAFE_INTEGER,
638
+ note: "Integers must be within the safe integer range.",
639
+ inst: e,
640
+ origin: r,
641
+ inclusive: !0,
642
+ continue: !t.abort
643
+ });
644
+ return;
645
+ }
646
+ }
647
+ c < i && s.issues.push({
648
+ origin: "number",
649
+ input: c,
650
+ code: "too_small",
651
+ minimum: i,
652
+ inclusive: !0,
653
+ inst: e,
654
+ continue: !t.abort
655
+ }), c > a && s.issues.push({
656
+ origin: "number",
657
+ input: c,
658
+ code: "too_big",
659
+ maximum: a,
660
+ inclusive: !0,
661
+ inst: e,
662
+ continue: !t.abort
663
+ });
664
+ };
665
+ }), To = /* @__PURE__ */ d("$ZodCheckMaxLength", (e, t) => {
666
+ var n;
667
+ Y.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
668
+ const i = r.value;
669
+ return !dt(i) && i.length !== void 0;
670
+ }), e._zod.onattach.push((r) => {
671
+ const i = r._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
672
+ t.maximum < i && (r._zod.bag.maximum = t.maximum);
673
+ }), e._zod.check = (r) => {
674
+ const i = r.value;
675
+ if (i.length <= t.maximum)
676
+ return;
677
+ const s = pt(i);
678
+ r.issues.push({
679
+ origin: s,
680
+ code: "too_big",
681
+ maximum: t.maximum,
682
+ inclusive: !0,
683
+ input: i,
684
+ inst: e,
685
+ continue: !t.abort
686
+ });
687
+ };
688
+ }), Eo = /* @__PURE__ */ d("$ZodCheckMinLength", (e, t) => {
689
+ var n;
690
+ Y.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
691
+ const i = r.value;
692
+ return !dt(i) && i.length !== void 0;
693
+ }), e._zod.onattach.push((r) => {
694
+ const i = r._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
695
+ t.minimum > i && (r._zod.bag.minimum = t.minimum);
696
+ }), e._zod.check = (r) => {
697
+ const i = r.value;
698
+ if (i.length >= t.minimum)
699
+ return;
700
+ const s = pt(i);
701
+ r.issues.push({
702
+ origin: s,
703
+ code: "too_small",
704
+ minimum: t.minimum,
705
+ inclusive: !0,
706
+ input: i,
707
+ inst: e,
708
+ continue: !t.abort
709
+ });
710
+ };
711
+ }), xo = /* @__PURE__ */ d("$ZodCheckLengthEquals", (e, t) => {
712
+ var n;
713
+ Y.init(e, t), (n = e._zod.def).when ?? (n.when = (r) => {
714
+ const i = r.value;
715
+ return !dt(i) && i.length !== void 0;
716
+ }), e._zod.onattach.push((r) => {
717
+ const i = r._zod.bag;
718
+ i.minimum = t.length, i.maximum = t.length, i.length = t.length;
719
+ }), e._zod.check = (r) => {
720
+ const i = r.value, a = i.length;
721
+ if (a === t.length)
722
+ return;
723
+ const s = pt(i), c = a > t.length;
724
+ r.issues.push({
725
+ origin: s,
726
+ ...c ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
727
+ inclusive: !0,
728
+ exact: !0,
729
+ input: r.value,
730
+ inst: e,
731
+ continue: !t.abort
732
+ });
733
+ };
734
+ }), Ye = /* @__PURE__ */ d("$ZodCheckStringFormat", (e, t) => {
735
+ var n, r;
736
+ Y.init(e, t), e._zod.onattach.push((i) => {
737
+ const a = i._zod.bag;
738
+ a.format = t.format, t.pattern && (a.patterns ?? (a.patterns = /* @__PURE__ */ new Set()), a.patterns.add(t.pattern));
739
+ }), t.pattern ? (n = e._zod).check ?? (n.check = (i) => {
740
+ t.pattern.lastIndex = 0, !t.pattern.test(i.value) && i.issues.push({
741
+ origin: "string",
742
+ code: "invalid_format",
743
+ format: t.format,
744
+ input: i.value,
745
+ ...t.pattern ? { pattern: t.pattern.toString() } : {},
746
+ inst: e,
747
+ continue: !t.abort
748
+ });
749
+ }) : (r = e._zod).check ?? (r.check = () => {
750
+ });
751
+ }), Oo = /* @__PURE__ */ d("$ZodCheckRegex", (e, t) => {
752
+ Ye.init(e, t), e._zod.check = (n) => {
753
+ t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
754
+ origin: "string",
755
+ code: "invalid_format",
756
+ format: "regex",
757
+ input: n.value,
758
+ pattern: t.pattern.toString(),
759
+ inst: e,
760
+ continue: !t.abort
761
+ });
762
+ };
763
+ }), $o = /* @__PURE__ */ d("$ZodCheckLowerCase", (e, t) => {
764
+ t.pattern ?? (t.pattern = So), Ye.init(e, t);
765
+ }), Co = /* @__PURE__ */ d("$ZodCheckUpperCase", (e, t) => {
766
+ t.pattern ?? (t.pattern = Io), Ye.init(e, t);
767
+ }), No = /* @__PURE__ */ d("$ZodCheckIncludes", (e, t) => {
768
+ Y.init(e, t);
769
+ const n = We(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
770
+ t.pattern = r, e._zod.onattach.push((i) => {
771
+ const a = i._zod.bag;
772
+ a.patterns ?? (a.patterns = /* @__PURE__ */ new Set()), a.patterns.add(r);
773
+ }), e._zod.check = (i) => {
774
+ i.value.includes(t.includes, t.position) || i.issues.push({
775
+ origin: "string",
776
+ code: "invalid_format",
777
+ format: "includes",
778
+ includes: t.includes,
779
+ input: i.value,
780
+ inst: e,
781
+ continue: !t.abort
782
+ });
783
+ };
784
+ }), Ao = /* @__PURE__ */ d("$ZodCheckStartsWith", (e, t) => {
785
+ Y.init(e, t);
786
+ const n = new RegExp(`^${We(t.prefix)}.*`);
787
+ t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
788
+ const i = r._zod.bag;
789
+ i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(n);
790
+ }), e._zod.check = (r) => {
791
+ r.value.startsWith(t.prefix) || r.issues.push({
792
+ origin: "string",
793
+ code: "invalid_format",
794
+ format: "starts_with",
795
+ prefix: t.prefix,
796
+ input: r.value,
797
+ inst: e,
798
+ continue: !t.abort
799
+ });
800
+ };
801
+ }), jo = /* @__PURE__ */ d("$ZodCheckEndsWith", (e, t) => {
802
+ Y.init(e, t);
803
+ const n = new RegExp(`.*${We(t.suffix)}$`);
804
+ t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
805
+ const i = r._zod.bag;
806
+ i.patterns ?? (i.patterns = /* @__PURE__ */ new Set()), i.patterns.add(n);
807
+ }), e._zod.check = (r) => {
808
+ r.value.endsWith(t.suffix) || r.issues.push({
809
+ origin: "string",
810
+ code: "invalid_format",
811
+ format: "ends_with",
812
+ suffix: t.suffix,
813
+ input: r.value,
814
+ inst: e,
815
+ continue: !t.abort
816
+ });
817
+ };
818
+ }), Do = /* @__PURE__ */ d("$ZodCheckOverwrite", (e, t) => {
819
+ Y.init(e, t), e._zod.check = (n) => {
820
+ n.value = t.tx(n.value);
821
+ };
822
+ });
823
+ class Ro {
824
+ constructor(t = []) {
825
+ this.content = [], this.indent = 0, this && (this.args = t);
826
+ }
827
+ indented(t) {
828
+ this.indent += 1, t(this), this.indent -= 1;
829
+ }
830
+ write(t) {
831
+ if (typeof t == "function") {
832
+ t(this, { execution: "sync" }), t(this, { execution: "async" });
833
+ return;
834
+ }
835
+ const r = t.split(`
836
+ `).filter((s) => s), i = Math.min(...r.map((s) => s.length - s.trimStart().length)), a = r.map((s) => s.slice(i)).map((s) => " ".repeat(this.indent * 2) + s);
837
+ for (const s of a)
838
+ this.content.push(s);
839
+ }
840
+ compile() {
841
+ const t = Function, n = this?.args, i = [...(this?.content ?? [""]).map((a) => ` ${a}`)];
842
+ return new t(...n, i.join(`
843
+ `));
844
+ }
845
+ }
846
+ const Fo = {
847
+ major: 4,
848
+ minor: 4,
849
+ patch: 3
850
+ }, D = /* @__PURE__ */ d("$ZodType", (e, t) => {
851
+ var n;
852
+ e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = Fo;
853
+ const r = [...e._zod.def.checks ?? []];
854
+ e._zod.traits.has("$ZodCheck") && r.unshift(e);
855
+ for (const i of r)
856
+ for (const a of i._zod.onattach)
857
+ a(e);
858
+ if (r.length === 0)
859
+ (n = e._zod).deferred ?? (n.deferred = []), e._zod.deferred?.push(() => {
860
+ e._zod.run = e._zod.parse;
861
+ });
862
+ else {
863
+ const i = (s, c, u) => {
864
+ let l = Se(s), m;
865
+ for (const g of c) {
866
+ if (g._zod.def.when) {
867
+ if (Ur(s) || !g._zod.def.when(s))
868
+ continue;
869
+ } else if (l)
870
+ continue;
871
+ const f = s.issues.length, p = g._zod.check(s);
872
+ if (p instanceof Promise && u?.async === !1)
873
+ throw new Ie();
874
+ if (m || p instanceof Promise)
875
+ m = (m ?? Promise.resolve()).then(async () => {
876
+ await p, s.issues.length !== f && (l || (l = Se(s, f)));
877
+ });
878
+ else {
879
+ if (s.issues.length === f)
880
+ continue;
881
+ l || (l = Se(s, f));
882
+ }
883
+ }
884
+ return m ? m.then(() => s) : s;
885
+ }, a = (s, c, u) => {
886
+ if (Se(s))
887
+ return s.aborted = !0, s;
888
+ const l = i(c, r, u);
889
+ if (l instanceof Promise) {
890
+ if (u.async === !1)
891
+ throw new Ie();
892
+ return l.then((m) => e._zod.parse(m, u));
893
+ }
894
+ return e._zod.parse(l, u);
895
+ };
896
+ e._zod.run = (s, c) => {
897
+ if (c.skipChecks)
898
+ return e._zod.parse(s, c);
899
+ if (c.direction === "backward") {
900
+ const l = e._zod.parse({ value: s.value, issues: [] }, { ...c, skipChecks: !0 });
901
+ return l instanceof Promise ? l.then((m) => a(m, s, c)) : a(l, s, c);
902
+ }
903
+ const u = e._zod.parse(s, c);
904
+ if (u instanceof Promise) {
905
+ if (c.async === !1)
906
+ throw new Ie();
907
+ return u.then((l) => i(l, r, c));
908
+ }
909
+ return i(u, r, c);
910
+ };
911
+ }
912
+ P(e, "~standard", () => ({
913
+ validate: (i) => {
914
+ try {
915
+ const a = Jr(e, i);
916
+ return a.success ? { value: a.data } : { issues: a.error?.issues };
917
+ } catch {
918
+ return Vr(e, i).then((s) => s.success ? { value: s.data } : { issues: s.error?.issues });
919
+ }
920
+ },
921
+ vendor: "zod",
922
+ version: 1
923
+ }));
924
+ }), gt = /* @__PURE__ */ d("$ZodString", (e, t) => {
925
+ D.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? wo(e._zod.bag), e._zod.parse = (n, r) => {
926
+ if (t.coerce)
927
+ try {
928
+ n.value = String(n.value);
929
+ } catch {
930
+ }
931
+ return typeof n.value == "string" || n.issues.push({
932
+ expected: "string",
933
+ code: "invalid_type",
934
+ input: n.value,
935
+ inst: e
936
+ }), n;
937
+ };
938
+ }), C = /* @__PURE__ */ d("$ZodStringFormat", (e, t) => {
939
+ Ye.init(e, t), gt.init(e, t);
940
+ }), Uo = /* @__PURE__ */ d("$ZodGUID", (e, t) => {
941
+ t.pattern ?? (t.pattern = so), C.init(e, t);
942
+ }), Mo = /* @__PURE__ */ d("$ZodUUID", (e, t) => {
943
+ if (t.version) {
944
+ const r = {
945
+ v1: 1,
946
+ v2: 2,
947
+ v3: 3,
948
+ v4: 4,
949
+ v5: 5,
950
+ v6: 6,
951
+ v7: 7,
952
+ v8: 8
953
+ }[t.version];
954
+ if (r === void 0)
955
+ throw new Error(`Invalid UUID version: "${t.version}"`);
956
+ t.pattern ?? (t.pattern = Pt(r));
957
+ } else
958
+ t.pattern ?? (t.pattern = Pt());
959
+ C.init(e, t);
960
+ }), Lo = /* @__PURE__ */ d("$ZodEmail", (e, t) => {
961
+ t.pattern ?? (t.pattern = ao), C.init(e, t);
962
+ }), Jo = /* @__PURE__ */ d("$ZodURL", (e, t) => {
963
+ C.init(e, t), e._zod.check = (n) => {
964
+ try {
965
+ const r = n.value.trim();
966
+ if (!t.normalize && t.protocol?.source === go.source && !/^https?:\/\//i.test(r)) {
967
+ n.issues.push({
968
+ code: "invalid_format",
969
+ format: "url",
970
+ note: "Invalid URL format",
971
+ input: n.value,
972
+ inst: e,
973
+ continue: !t.abort
974
+ });
975
+ return;
976
+ }
977
+ const i = new URL(r);
978
+ t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(i.hostname) || n.issues.push({
979
+ code: "invalid_format",
980
+ format: "url",
981
+ note: "Invalid hostname",
982
+ pattern: t.hostname.source,
983
+ input: n.value,
984
+ inst: e,
985
+ continue: !t.abort
986
+ })), t.protocol && (t.protocol.lastIndex = 0, t.protocol.test(i.protocol.endsWith(":") ? i.protocol.slice(0, -1) : i.protocol) || n.issues.push({
987
+ code: "invalid_format",
988
+ format: "url",
989
+ note: "Invalid protocol",
990
+ pattern: t.protocol.source,
991
+ input: n.value,
992
+ inst: e,
993
+ continue: !t.abort
994
+ })), t.normalize ? n.value = i.href : n.value = r;
995
+ return;
996
+ } catch {
997
+ n.issues.push({
998
+ code: "invalid_format",
999
+ format: "url",
1000
+ input: n.value,
1001
+ inst: e,
1002
+ continue: !t.abort
1003
+ });
1004
+ }
1005
+ };
1006
+ }), Vo = /* @__PURE__ */ d("$ZodEmoji", (e, t) => {
1007
+ t.pattern ?? (t.pattern = uo()), C.init(e, t);
1008
+ }), Go = /* @__PURE__ */ d("$ZodNanoID", (e, t) => {
1009
+ t.pattern ?? (t.pattern = oo), C.init(e, t);
1010
+ }), Bo = /* @__PURE__ */ d("$ZodCUID", (e, t) => {
1011
+ t.pattern ?? (t.pattern = Qr), C.init(e, t);
1012
+ }), Wo = /* @__PURE__ */ d("$ZodCUID2", (e, t) => {
1013
+ t.pattern ?? (t.pattern = eo), C.init(e, t);
1014
+ }), qo = /* @__PURE__ */ d("$ZodULID", (e, t) => {
1015
+ t.pattern ?? (t.pattern = to), C.init(e, t);
1016
+ }), Ko = /* @__PURE__ */ d("$ZodXID", (e, t) => {
1017
+ t.pattern ?? (t.pattern = no), C.init(e, t);
1018
+ }), Yo = /* @__PURE__ */ d("$ZodKSUID", (e, t) => {
1019
+ t.pattern ?? (t.pattern = ro), C.init(e, t);
1020
+ }), Ho = /* @__PURE__ */ d("$ZodISODateTime", (e, t) => {
1021
+ t.pattern ?? (t.pattern = bo(t)), C.init(e, t);
1022
+ }), Xo = /* @__PURE__ */ d("$ZodISODate", (e, t) => {
1023
+ t.pattern ?? (t.pattern = _o), C.init(e, t);
1024
+ }), Qo = /* @__PURE__ */ d("$ZodISOTime", (e, t) => {
1025
+ t.pattern ?? (t.pattern = yo(t)), C.init(e, t);
1026
+ }), ei = /* @__PURE__ */ d("$ZodISODuration", (e, t) => {
1027
+ t.pattern ?? (t.pattern = io), C.init(e, t);
1028
+ }), ti = /* @__PURE__ */ d("$ZodIPv4", (e, t) => {
1029
+ t.pattern ?? (t.pattern = lo), C.init(e, t), e._zod.bag.format = "ipv4";
1030
+ }), ni = /* @__PURE__ */ d("$ZodIPv6", (e, t) => {
1031
+ t.pattern ?? (t.pattern = fo), C.init(e, t), e._zod.bag.format = "ipv6", e._zod.check = (n) => {
1032
+ try {
1033
+ new URL(`http://[${n.value}]`);
1034
+ } catch {
1035
+ n.issues.push({
1036
+ code: "invalid_format",
1037
+ format: "ipv6",
1038
+ input: n.value,
1039
+ inst: e,
1040
+ continue: !t.abort
1041
+ });
1042
+ }
1043
+ };
1044
+ }), ri = /* @__PURE__ */ d("$ZodCIDRv4", (e, t) => {
1045
+ t.pattern ?? (t.pattern = po), C.init(e, t);
1046
+ }), oi = /* @__PURE__ */ d("$ZodCIDRv6", (e, t) => {
1047
+ t.pattern ?? (t.pattern = ho), C.init(e, t), e._zod.check = (n) => {
1048
+ const r = n.value.split("/");
1049
+ try {
1050
+ if (r.length !== 2)
1051
+ throw new Error();
1052
+ const [i, a] = r;
1053
+ if (!a)
1054
+ throw new Error();
1055
+ const s = Number(a);
1056
+ if (`${s}` !== a)
1057
+ throw new Error();
1058
+ if (s < 0 || s > 128)
1059
+ throw new Error();
1060
+ new URL(`http://[${i}]`);
1061
+ } catch {
1062
+ n.issues.push({
1063
+ code: "invalid_format",
1064
+ format: "cidrv6",
1065
+ input: n.value,
1066
+ inst: e,
1067
+ continue: !t.abort
1068
+ });
1069
+ }
1070
+ };
1071
+ });
1072
+ function hn(e) {
1073
+ if (e === "")
1074
+ return !0;
1075
+ if (/\s/.test(e) || e.length % 4 !== 0)
1076
+ return !1;
1077
+ try {
1078
+ return atob(e), !0;
1079
+ } catch {
1080
+ return !1;
1081
+ }
1082
+ }
1083
+ const ii = /* @__PURE__ */ d("$ZodBase64", (e, t) => {
1084
+ t.pattern ?? (t.pattern = mo), C.init(e, t), e._zod.bag.contentEncoding = "base64", e._zod.check = (n) => {
1085
+ hn(n.value) || n.issues.push({
1086
+ code: "invalid_format",
1087
+ format: "base64",
1088
+ input: n.value,
1089
+ inst: e,
1090
+ continue: !t.abort
1091
+ });
1092
+ };
1093
+ });
1094
+ function si(e) {
1095
+ if (!cn.test(e))
1096
+ return !1;
1097
+ const t = e.replace(/[-_]/g, (r) => r === "-" ? "+" : "/"), n = t.padEnd(Math.ceil(t.length / 4) * 4, "=");
1098
+ return hn(n);
1099
+ }
1100
+ const ai = /* @__PURE__ */ d("$ZodBase64URL", (e, t) => {
1101
+ t.pattern ?? (t.pattern = cn), C.init(e, t), e._zod.bag.contentEncoding = "base64url", e._zod.check = (n) => {
1102
+ si(n.value) || n.issues.push({
1103
+ code: "invalid_format",
1104
+ format: "base64url",
1105
+ input: n.value,
1106
+ inst: e,
1107
+ continue: !t.abort
1108
+ });
1109
+ };
1110
+ }), ci = /* @__PURE__ */ d("$ZodE164", (e, t) => {
1111
+ t.pattern ?? (t.pattern = vo), C.init(e, t);
1112
+ });
1113
+ function ui(e, t = null) {
1114
+ try {
1115
+ const n = e.split(".");
1116
+ if (n.length !== 3)
1117
+ return !1;
1118
+ const [r] = n;
1119
+ if (!r)
1120
+ return !1;
1121
+ const i = JSON.parse(atob(r));
1122
+ return !("typ" in i && i?.typ !== "JWT" || !i.alg || t && (!("alg" in i) || i.alg !== t));
1123
+ } catch {
1124
+ return !1;
1125
+ }
1126
+ }
1127
+ const li = /* @__PURE__ */ d("$ZodJWT", (e, t) => {
1128
+ C.init(e, t), e._zod.check = (n) => {
1129
+ ui(n.value, t.alg) || n.issues.push({
1130
+ code: "invalid_format",
1131
+ format: "jwt",
1132
+ input: n.value,
1133
+ inst: e,
1134
+ continue: !t.abort
1135
+ });
1136
+ };
1137
+ }), mn = /* @__PURE__ */ d("$ZodNumber", (e, t) => {
1138
+ D.init(e, t), e._zod.pattern = e._zod.bag.pattern ?? zo, e._zod.parse = (n, r) => {
1139
+ if (t.coerce)
1140
+ try {
1141
+ n.value = Number(n.value);
1142
+ } catch {
1143
+ }
1144
+ const i = n.value;
1145
+ if (typeof i == "number" && !Number.isNaN(i) && Number.isFinite(i))
1146
+ return n;
1147
+ const a = typeof i == "number" ? Number.isNaN(i) ? "NaN" : Number.isFinite(i) ? void 0 : "Infinity" : void 0;
1148
+ return n.issues.push({
1149
+ expected: "number",
1150
+ code: "invalid_type",
1151
+ input: i,
1152
+ inst: e,
1153
+ ...a ? { received: a } : {}
1154
+ }), n;
1155
+ };
1156
+ }), di = /* @__PURE__ */ d("$ZodNumberFormat", (e, t) => {
1157
+ Po.init(e, t), mn.init(e, t);
1158
+ }), fi = /* @__PURE__ */ d("$ZodUnknown", (e, t) => {
1159
+ D.init(e, t), e._zod.parse = (n) => n;
1160
+ }), pi = /* @__PURE__ */ d("$ZodNever", (e, t) => {
1161
+ D.init(e, t), e._zod.parse = (n, r) => (n.issues.push({
1162
+ expected: "never",
1163
+ code: "invalid_type",
1164
+ input: n.value,
1165
+ inst: e
1166
+ }), n);
1167
+ });
1168
+ function Tt(e, t, n) {
1169
+ e.issues.length && t.issues.push(...rn(n, e.issues)), t.value[n] = e.value;
1170
+ }
1171
+ const hi = /* @__PURE__ */ d("$ZodArray", (e, t) => {
1172
+ D.init(e, t), e._zod.parse = (n, r) => {
1173
+ const i = n.value;
1174
+ if (!Array.isArray(i))
1175
+ return n.issues.push({
1176
+ expected: "array",
1177
+ code: "invalid_type",
1178
+ input: i,
1179
+ inst: e
1180
+ }), n;
1181
+ n.value = Array(i.length);
1182
+ const a = [];
1183
+ for (let s = 0; s < i.length; s++) {
1184
+ const c = i[s], u = t.element._zod.run({
1185
+ value: c,
1186
+ issues: []
1187
+ }, r);
1188
+ u instanceof Promise ? a.push(u.then((l) => Tt(l, n, s))) : Tt(u, n, s);
1189
+ }
1190
+ return a.length ? Promise.all(a).then(() => n) : n;
1191
+ };
1192
+ });
1193
+ function Ve(e, t, n, r, i, a) {
1194
+ const s = n in r;
1195
+ if (e.issues.length) {
1196
+ if (i && a && !s)
1197
+ return;
1198
+ t.issues.push(...rn(n, e.issues));
1199
+ }
1200
+ if (!s && !i) {
1201
+ e.issues.length || t.issues.push({
1202
+ code: "invalid_type",
1203
+ expected: "nonoptional",
1204
+ input: void 0,
1205
+ path: [n]
1206
+ });
1207
+ return;
1208
+ }
1209
+ e.value === void 0 ? s && (t.value[n] = void 0) : t.value[n] = e.value;
1210
+ }
1211
+ function gn(e) {
1212
+ const t = Object.keys(e.shape);
1213
+ for (const r of t)
1214
+ if (!e.shape?.[r]?._zod?.traits?.has("$ZodType"))
1215
+ throw new Error(`Invalid element at key "${r}": expected a Zod schema`);
1216
+ const n = Or(e.shape);
1217
+ return {
1218
+ ...e,
1219
+ keys: t,
1220
+ keySet: new Set(t),
1221
+ numKeys: t.length,
1222
+ optionalKeys: new Set(n)
1223
+ };
1224
+ }
1225
+ function vn(e, t, n, r, i, a) {
1226
+ const s = [], c = i.keySet, u = i.catchall._zod, l = u.def.type, m = u.optin === "optional", g = u.optout === "optional";
1227
+ for (const f in t) {
1228
+ if (f === "__proto__" || c.has(f))
1229
+ continue;
1230
+ if (l === "never") {
1231
+ s.push(f);
1232
+ continue;
1233
+ }
1234
+ const p = u.run({ value: t[f], issues: [] }, r);
1235
+ p instanceof Promise ? e.push(p.then((w) => Ve(w, n, f, t, m, g))) : Ve(p, n, f, t, m, g);
1236
+ }
1237
+ return s.length && n.issues.push({
1238
+ code: "unrecognized_keys",
1239
+ keys: s,
1240
+ input: t,
1241
+ inst: a
1242
+ }), e.length ? Promise.all(e).then(() => n) : n;
1243
+ }
1244
+ const mi = /* @__PURE__ */ d("$ZodObject", (e, t) => {
1245
+ if (D.init(e, t), !Object.getOwnPropertyDescriptor(t, "shape")?.get) {
1246
+ const c = t.shape;
1247
+ Object.defineProperty(t, "shape", {
1248
+ get: () => {
1249
+ const u = { ...c };
1250
+ return Object.defineProperty(t, "shape", {
1251
+ value: u
1252
+ }), u;
1253
+ }
1254
+ });
1255
+ }
1256
+ const r = lt(() => gn(t));
1257
+ P(e._zod, "propValues", () => {
1258
+ const c = t.shape, u = {};
1259
+ for (const l in c) {
1260
+ const m = c[l]._zod;
1261
+ if (m.values) {
1262
+ u[l] ?? (u[l] = /* @__PURE__ */ new Set());
1263
+ for (const g of m.values)
1264
+ u[l].add(g);
1265
+ }
1266
+ }
1267
+ return u;
1268
+ });
1269
+ const i = Je, a = t.catchall;
1270
+ let s;
1271
+ e._zod.parse = (c, u) => {
1272
+ s ?? (s = r.value);
1273
+ const l = c.value;
1274
+ if (!i(l))
1275
+ return c.issues.push({
1276
+ expected: "object",
1277
+ code: "invalid_type",
1278
+ input: l,
1279
+ inst: e
1280
+ }), c;
1281
+ c.value = {};
1282
+ const m = [], g = s.shape;
1283
+ for (const f of s.keys) {
1284
+ const p = g[f], w = p._zod.optin === "optional", H = p._zod.optout === "optional", Z = p._zod.run({ value: l[f], issues: [] }, u);
1285
+ Z instanceof Promise ? m.push(Z.then((K) => Ve(K, c, f, l, w, H))) : Ve(Z, c, f, l, w, H);
1286
+ }
1287
+ return a ? vn(m, l, c, u, r.value, e) : m.length ? Promise.all(m).then(() => c) : c;
1288
+ };
1289
+ }), gi = /* @__PURE__ */ d("$ZodObjectJIT", (e, t) => {
1290
+ mi.init(e, t);
1291
+ const n = e._zod.parse, r = lt(() => gn(t)), i = (f) => {
1292
+ const p = new Ro(["shape", "payload", "ctx"]), w = r.value, H = (T) => {
1293
+ const I = Zt(T);
1294
+ return `shape[${I}]._zod.run({ value: input[${I}], issues: [] }, ctx)`;
1295
+ };
1296
+ p.write("const input = payload.value;");
1297
+ const Z = /* @__PURE__ */ Object.create(null);
1298
+ let K = 0;
1299
+ for (const T of w.keys)
1300
+ Z[T] = `key_${K++}`;
1301
+ p.write("const newResult = {};");
1302
+ for (const T of w.keys) {
1303
+ const I = Z[T], S = Zt(T), J = f[T], B = J?._zod?.optin === "optional", U = J?._zod?.optout === "optional";
1304
+ p.write(`const ${I} = ${H(T)};`), B && U ? p.write(`
1305
+ if (${I}.issues.length) {
1306
+ if (${S} in input) {
1307
+ payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
1308
+ ...iss,
1309
+ path: iss.path ? [${S}, ...iss.path] : [${S}]
1310
+ })));
1311
+ }
1312
+ }
1313
+
1314
+ if (${I}.value === undefined) {
1315
+ if (${S} in input) {
1316
+ newResult[${S}] = undefined;
1317
+ }
1318
+ } else {
1319
+ newResult[${S}] = ${I}.value;
1320
+ }
1321
+
1322
+ `) : B ? p.write(`
1323
+ if (${I}.issues.length) {
1324
+ payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
1325
+ ...iss,
1326
+ path: iss.path ? [${S}, ...iss.path] : [${S}]
1327
+ })));
1328
+ }
1329
+
1330
+ if (${I}.value === undefined) {
1331
+ if (${S} in input) {
1332
+ newResult[${S}] = undefined;
1333
+ }
1334
+ } else {
1335
+ newResult[${S}] = ${I}.value;
1336
+ }
1337
+
1338
+ `) : p.write(`
1339
+ const ${I}_present = ${S} in input;
1340
+ if (${I}.issues.length) {
1341
+ payload.issues = payload.issues.concat(${I}.issues.map(iss => ({
1342
+ ...iss,
1343
+ path: iss.path ? [${S}, ...iss.path] : [${S}]
1344
+ })));
1345
+ }
1346
+ if (!${I}_present && !${I}.issues.length) {
1347
+ payload.issues.push({
1348
+ code: "invalid_type",
1349
+ expected: "nonoptional",
1350
+ input: undefined,
1351
+ path: [${S}]
1352
+ });
1353
+ }
1354
+
1355
+ if (${I}_present) {
1356
+ if (${I}.value === undefined) {
1357
+ newResult[${S}] = undefined;
1358
+ } else {
1359
+ newResult[${S}] = ${I}.value;
1360
+ }
1361
+ }
1362
+
1363
+ `);
1364
+ }
1365
+ p.write("payload.value = newResult;"), p.write("return payload;");
1366
+ const ue = p.compile();
1367
+ return (T, I) => ue(f, T, I);
1368
+ };
1369
+ let a;
1370
+ const s = Je, c = !ut.jitless, l = c && Er.value, m = t.catchall;
1371
+ let g;
1372
+ e._zod.parse = (f, p) => {
1373
+ g ?? (g = r.value);
1374
+ const w = f.value;
1375
+ return s(w) ? c && l && p?.async === !1 && p.jitless !== !0 ? (a || (a = i(t.shape)), f = a(f, p), m ? vn([], w, f, p, g, e) : f) : n(f, p) : (f.issues.push({
1376
+ expected: "object",
1377
+ code: "invalid_type",
1378
+ input: w,
1379
+ inst: e
1380
+ }), f);
1381
+ };
1382
+ });
1383
+ function Et(e, t, n, r) {
1384
+ for (const a of e)
1385
+ if (a.issues.length === 0)
1386
+ return t.value = a.value, t;
1387
+ const i = e.filter((a) => !Se(a));
1388
+ return i.length === 1 ? (t.value = i[0].value, i[0]) : (t.issues.push({
1389
+ code: "invalid_union",
1390
+ input: t.value,
1391
+ inst: n,
1392
+ errors: e.map((a) => a.issues.map((s) => ge(s, r, me())))
1393
+ }), t);
1394
+ }
1395
+ const vi = /* @__PURE__ */ d("$ZodUnion", (e, t) => {
1396
+ D.init(e, t), P(e._zod, "optin", () => t.options.some((r) => r._zod.optin === "optional") ? "optional" : void 0), P(e._zod, "optout", () => t.options.some((r) => r._zod.optout === "optional") ? "optional" : void 0), P(e._zod, "values", () => {
1397
+ if (t.options.every((r) => r._zod.values))
1398
+ return new Set(t.options.flatMap((r) => Array.from(r._zod.values)));
1399
+ }), P(e._zod, "pattern", () => {
1400
+ if (t.options.every((r) => r._zod.pattern)) {
1401
+ const r = t.options.map((i) => i._zod.pattern);
1402
+ return new RegExp(`^(${r.map((i) => ft(i.source)).join("|")})$`);
1403
+ }
1404
+ });
1405
+ const n = t.options.length === 1 ? t.options[0]._zod.run : null;
1406
+ e._zod.parse = (r, i) => {
1407
+ if (n)
1408
+ return n(r, i);
1409
+ let a = !1;
1410
+ const s = [];
1411
+ for (const c of t.options) {
1412
+ const u = c._zod.run({
1413
+ value: r.value,
1414
+ issues: []
1415
+ }, i);
1416
+ if (u instanceof Promise)
1417
+ s.push(u), a = !0;
1418
+ else {
1419
+ if (u.issues.length === 0)
1420
+ return u;
1421
+ s.push(u);
1422
+ }
1423
+ }
1424
+ return a ? Promise.all(s).then((c) => Et(c, r, e, i)) : Et(s, r, e, i);
1425
+ };
1426
+ }), _i = /* @__PURE__ */ d("$ZodIntersection", (e, t) => {
1427
+ D.init(e, t), e._zod.parse = (n, r) => {
1428
+ const i = n.value, a = t.left._zod.run({ value: i, issues: [] }, r), s = t.right._zod.run({ value: i, issues: [] }, r);
1429
+ return a instanceof Promise || s instanceof Promise ? Promise.all([a, s]).then(([u, l]) => xt(n, u, l)) : xt(n, a, s);
1430
+ };
1431
+ });
1432
+ function st(e, t) {
1433
+ if (e === t)
1434
+ return { valid: !0, data: e };
1435
+ if (e instanceof Date && t instanceof Date && +e == +t)
1436
+ return { valid: !0, data: e };
1437
+ if (Ce(e) && Ce(t)) {
1438
+ const n = Object.keys(t), r = Object.keys(e).filter((a) => n.indexOf(a) !== -1), i = { ...e, ...t };
1439
+ for (const a of r) {
1440
+ const s = st(e[a], t[a]);
1441
+ if (!s.valid)
1442
+ return {
1443
+ valid: !1,
1444
+ mergeErrorPath: [a, ...s.mergeErrorPath]
1445
+ };
1446
+ i[a] = s.data;
1447
+ }
1448
+ return { valid: !0, data: i };
1449
+ }
1450
+ if (Array.isArray(e) && Array.isArray(t)) {
1451
+ if (e.length !== t.length)
1452
+ return { valid: !1, mergeErrorPath: [] };
1453
+ const n = [];
1454
+ for (let r = 0; r < e.length; r++) {
1455
+ const i = e[r], a = t[r], s = st(i, a);
1456
+ if (!s.valid)
1457
+ return {
1458
+ valid: !1,
1459
+ mergeErrorPath: [r, ...s.mergeErrorPath]
1460
+ };
1461
+ n.push(s.data);
1462
+ }
1463
+ return { valid: !0, data: n };
1464
+ }
1465
+ return { valid: !1, mergeErrorPath: [] };
1466
+ }
1467
+ function xt(e, t, n) {
1468
+ const r = /* @__PURE__ */ new Map();
1469
+ let i;
1470
+ for (const c of t.issues)
1471
+ if (c.code === "unrecognized_keys") {
1472
+ i ?? (i = c);
1473
+ for (const u of c.keys)
1474
+ r.has(u) || r.set(u, {}), r.get(u).l = !0;
1475
+ } else
1476
+ e.issues.push(c);
1477
+ for (const c of n.issues)
1478
+ if (c.code === "unrecognized_keys")
1479
+ for (const u of c.keys)
1480
+ r.has(u) || r.set(u, {}), r.get(u).r = !0;
1481
+ else
1482
+ e.issues.push(c);
1483
+ const a = [...r].filter(([, c]) => c.l && c.r).map(([c]) => c);
1484
+ if (a.length && i && e.issues.push({ ...i, keys: a }), Se(e))
1485
+ return e;
1486
+ const s = st(t.value, n.value);
1487
+ if (!s.valid)
1488
+ throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);
1489
+ return e.value = s.data, e;
1490
+ }
1491
+ const yi = /* @__PURE__ */ d("$ZodEnum", (e, t) => {
1492
+ D.init(e, t);
1493
+ const n = en(t.entries), r = new Set(n);
1494
+ e._zod.values = r, e._zod.pattern = new RegExp(`^(${n.filter((i) => xr.has(typeof i)).map((i) => typeof i == "string" ? We(i) : i.toString()).join("|")})$`), e._zod.parse = (i, a) => {
1495
+ const s = i.value;
1496
+ return r.has(s) || i.issues.push({
1497
+ code: "invalid_value",
1498
+ values: n,
1499
+ input: s,
1500
+ inst: e
1501
+ }), i;
1502
+ };
1503
+ }), bi = /* @__PURE__ */ d("$ZodTransform", (e, t) => {
1504
+ D.init(e, t), e._zod.optin = "optional", e._zod.parse = (n, r) => {
1505
+ if (r.direction === "backward")
1506
+ throw new Qt(e.constructor.name);
1507
+ const i = t.transform(n.value, n);
1508
+ if (r.async)
1509
+ return (i instanceof Promise ? i : Promise.resolve(i)).then((s) => (n.value = s, n.fallback = !0, n));
1510
+ if (i instanceof Promise)
1511
+ throw new Ie();
1512
+ return n.value = i, n.fallback = !0, n;
1513
+ };
1514
+ });
1515
+ function Ot(e, t) {
1516
+ return t === void 0 && (e.issues.length || e.fallback) ? { issues: [], value: void 0 } : e;
1517
+ }
1518
+ const _n = /* @__PURE__ */ d("$ZodOptional", (e, t) => {
1519
+ D.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", P(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), P(e._zod, "pattern", () => {
1520
+ const n = t.innerType._zod.pattern;
1521
+ return n ? new RegExp(`^(${ft(n.source)})?$`) : void 0;
1522
+ }), e._zod.parse = (n, r) => {
1523
+ if (t.innerType._zod.optin === "optional") {
1524
+ const i = n.value, a = t.innerType._zod.run(n, r);
1525
+ return a instanceof Promise ? a.then((s) => Ot(s, i)) : Ot(a, i);
1526
+ }
1527
+ return n.value === void 0 ? n : t.innerType._zod.run(n, r);
1528
+ };
1529
+ }), wi = /* @__PURE__ */ d("$ZodExactOptional", (e, t) => {
1530
+ _n.init(e, t), P(e._zod, "values", () => t.innerType._zod.values), P(e._zod, "pattern", () => t.innerType._zod.pattern), e._zod.parse = (n, r) => t.innerType._zod.run(n, r);
1531
+ }), ki = /* @__PURE__ */ d("$ZodNullable", (e, t) => {
1532
+ D.init(e, t), P(e._zod, "optin", () => t.innerType._zod.optin), P(e._zod, "optout", () => t.innerType._zod.optout), P(e._zod, "pattern", () => {
1533
+ const n = t.innerType._zod.pattern;
1534
+ return n ? new RegExp(`^(${ft(n.source)}|null)$`) : void 0;
1535
+ }), P(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, null]) : void 0), e._zod.parse = (n, r) => n.value === null ? n : t.innerType._zod.run(n, r);
1536
+ }), zi = /* @__PURE__ */ d("$ZodDefault", (e, t) => {
1537
+ D.init(e, t), e._zod.optin = "optional", P(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
1538
+ if (r.direction === "backward")
1539
+ return t.innerType._zod.run(n, r);
1540
+ if (n.value === void 0)
1541
+ return n.value = t.defaultValue, n;
1542
+ const i = t.innerType._zod.run(n, r);
1543
+ return i instanceof Promise ? i.then((a) => $t(a, t)) : $t(i, t);
1544
+ };
1545
+ });
1546
+ function $t(e, t) {
1547
+ return e.value === void 0 && (e.value = t.defaultValue), e;
1548
+ }
1549
+ const Si = /* @__PURE__ */ d("$ZodPrefault", (e, t) => {
1550
+ D.init(e, t), e._zod.optin = "optional", P(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => (r.direction === "backward" || n.value === void 0 && (n.value = t.defaultValue), t.innerType._zod.run(n, r));
1551
+ }), Ii = /* @__PURE__ */ d("$ZodNonOptional", (e, t) => {
1552
+ D.init(e, t), P(e._zod, "values", () => {
1553
+ const n = t.innerType._zod.values;
1554
+ return n ? new Set([...n].filter((r) => r !== void 0)) : void 0;
1555
+ }), e._zod.parse = (n, r) => {
1556
+ const i = t.innerType._zod.run(n, r);
1557
+ return i instanceof Promise ? i.then((a) => Ct(a, e)) : Ct(i, e);
1558
+ };
1559
+ });
1560
+ function Ct(e, t) {
1561
+ return !e.issues.length && e.value === void 0 && e.issues.push({
1562
+ code: "invalid_type",
1563
+ expected: "nonoptional",
1564
+ input: e.value,
1565
+ inst: t
1566
+ }), e;
1567
+ }
1568
+ const Zi = /* @__PURE__ */ d("$ZodCatch", (e, t) => {
1569
+ D.init(e, t), e._zod.optin = "optional", P(e._zod, "optout", () => t.innerType._zod.optout), P(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
1570
+ if (r.direction === "backward")
1571
+ return t.innerType._zod.run(n, r);
1572
+ const i = t.innerType._zod.run(n, r);
1573
+ return i instanceof Promise ? i.then((a) => (n.value = a.value, a.issues.length && (n.value = t.catchValue({
1574
+ ...n,
1575
+ error: {
1576
+ issues: a.issues.map((s) => ge(s, r, me()))
1577
+ },
1578
+ input: n.value
1579
+ }), n.issues = [], n.fallback = !0), n)) : (n.value = i.value, i.issues.length && (n.value = t.catchValue({
1580
+ ...n,
1581
+ error: {
1582
+ issues: i.issues.map((a) => ge(a, r, me()))
1583
+ },
1584
+ input: n.value
1585
+ }), n.issues = [], n.fallback = !0), n);
1586
+ };
1587
+ }), Pi = /* @__PURE__ */ d("$ZodPipe", (e, t) => {
1588
+ D.init(e, t), P(e._zod, "values", () => t.in._zod.values), P(e._zod, "optin", () => t.in._zod.optin), P(e._zod, "optout", () => t.out._zod.optout), P(e._zod, "propValues", () => t.in._zod.propValues), e._zod.parse = (n, r) => {
1589
+ if (r.direction === "backward") {
1590
+ const a = t.out._zod.run(n, r);
1591
+ return a instanceof Promise ? a.then((s) => De(s, t.in, r)) : De(a, t.in, r);
1592
+ }
1593
+ const i = t.in._zod.run(n, r);
1594
+ return i instanceof Promise ? i.then((a) => De(a, t.out, r)) : De(i, t.out, r);
1595
+ };
1596
+ });
1597
+ function De(e, t, n) {
1598
+ return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ value: e.value, issues: e.issues, fallback: e.fallback }, n);
1599
+ }
1600
+ const Ti = /* @__PURE__ */ d("$ZodReadonly", (e, t) => {
1601
+ D.init(e, t), P(e._zod, "propValues", () => t.innerType._zod.propValues), P(e._zod, "values", () => t.innerType._zod.values), P(e._zod, "optin", () => t.innerType?._zod?.optin), P(e._zod, "optout", () => t.innerType?._zod?.optout), e._zod.parse = (n, r) => {
1602
+ if (r.direction === "backward")
1603
+ return t.innerType._zod.run(n, r);
1604
+ const i = t.innerType._zod.run(n, r);
1605
+ return i instanceof Promise ? i.then(Nt) : Nt(i);
1606
+ };
1607
+ });
1608
+ function Nt(e) {
1609
+ return e.value = Object.freeze(e.value), e;
1610
+ }
1611
+ const Ei = /* @__PURE__ */ d("$ZodCustom", (e, t) => {
1612
+ Y.init(e, t), D.init(e, t), e._zod.parse = (n, r) => n, e._zod.check = (n) => {
1613
+ const r = n.value, i = t.fn(r);
1614
+ if (i instanceof Promise)
1615
+ return i.then((a) => At(a, n, r, e));
1616
+ At(i, n, r, e);
1617
+ };
1618
+ });
1619
+ function At(e, t, n, r) {
1620
+ if (!e) {
1621
+ const i = {
1622
+ code: "custom",
1623
+ input: n,
1624
+ inst: r,
1625
+ // incorporates params.error into issue reporting
1626
+ path: [...r._zod.def.path ?? []],
1627
+ // incorporates params.error into issue reporting
1628
+ continue: !r._zod.def.abort
1629
+ // params: inst._zod.def.params,
1630
+ };
1631
+ r._zod.def.params && (i.params = r._zod.def.params), t.issues.push(Ne(i));
1632
+ }
1633
+ }
1634
+ var jt;
1635
+ class xi {
1636
+ constructor() {
1637
+ this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
1638
+ }
1639
+ add(t, ...n) {
1640
+ const r = n[0];
1641
+ return this._map.set(t, r), r && typeof r == "object" && "id" in r && this._idmap.set(r.id, t), this;
1642
+ }
1643
+ clear() {
1644
+ return this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map(), this;
1645
+ }
1646
+ remove(t) {
1647
+ const n = this._map.get(t);
1648
+ return n && typeof n == "object" && "id" in n && this._idmap.delete(n.id), this._map.delete(t), this;
1649
+ }
1650
+ get(t) {
1651
+ const n = t._zod.parent;
1652
+ if (n) {
1653
+ const r = { ...this.get(n) ?? {} };
1654
+ delete r.id;
1655
+ const i = { ...r, ...this._map.get(t) };
1656
+ return Object.keys(i).length ? i : void 0;
1657
+ }
1658
+ return this._map.get(t);
1659
+ }
1660
+ has(t) {
1661
+ return this._map.has(t);
1662
+ }
1663
+ }
1664
+ function Oi() {
1665
+ return new xi();
1666
+ }
1667
+ (jt = globalThis).__zod_globalRegistry ?? (jt.__zod_globalRegistry = Oi());
1668
+ const $e = globalThis.__zod_globalRegistry;
1669
+ // @__NO_SIDE_EFFECTS__
1670
+ function $i(e, t) {
1671
+ return new e({
1672
+ type: "string",
1673
+ ...v(t)
1674
+ });
1675
+ }
1676
+ // @__NO_SIDE_EFFECTS__
1677
+ function Ci(e, t) {
1678
+ return new e({
1679
+ type: "string",
1680
+ format: "email",
1681
+ check: "string_format",
1682
+ abort: !1,
1683
+ ...v(t)
1684
+ });
1685
+ }
1686
+ // @__NO_SIDE_EFFECTS__
1687
+ function Dt(e, t) {
1688
+ return new e({
1689
+ type: "string",
1690
+ format: "guid",
1691
+ check: "string_format",
1692
+ abort: !1,
1693
+ ...v(t)
1694
+ });
1695
+ }
1696
+ // @__NO_SIDE_EFFECTS__
1697
+ function Ni(e, t) {
1698
+ return new e({
1699
+ type: "string",
1700
+ format: "uuid",
1701
+ check: "string_format",
1702
+ abort: !1,
1703
+ ...v(t)
1704
+ });
1705
+ }
1706
+ // @__NO_SIDE_EFFECTS__
1707
+ function Ai(e, t) {
1708
+ return new e({
1709
+ type: "string",
1710
+ format: "uuid",
1711
+ check: "string_format",
1712
+ abort: !1,
1713
+ version: "v4",
1714
+ ...v(t)
1715
+ });
1716
+ }
1717
+ // @__NO_SIDE_EFFECTS__
1718
+ function ji(e, t) {
1719
+ return new e({
1720
+ type: "string",
1721
+ format: "uuid",
1722
+ check: "string_format",
1723
+ abort: !1,
1724
+ version: "v6",
1725
+ ...v(t)
1726
+ });
1727
+ }
1728
+ // @__NO_SIDE_EFFECTS__
1729
+ function Di(e, t) {
1730
+ return new e({
1731
+ type: "string",
1732
+ format: "uuid",
1733
+ check: "string_format",
1734
+ abort: !1,
1735
+ version: "v7",
1736
+ ...v(t)
1737
+ });
1738
+ }
1739
+ // @__NO_SIDE_EFFECTS__
1740
+ function Ri(e, t) {
1741
+ return new e({
1742
+ type: "string",
1743
+ format: "url",
1744
+ check: "string_format",
1745
+ abort: !1,
1746
+ ...v(t)
1747
+ });
1748
+ }
1749
+ // @__NO_SIDE_EFFECTS__
1750
+ function Fi(e, t) {
1751
+ return new e({
1752
+ type: "string",
1753
+ format: "emoji",
1754
+ check: "string_format",
1755
+ abort: !1,
1756
+ ...v(t)
1757
+ });
1758
+ }
1759
+ // @__NO_SIDE_EFFECTS__
1760
+ function Ui(e, t) {
1761
+ return new e({
1762
+ type: "string",
1763
+ format: "nanoid",
1764
+ check: "string_format",
1765
+ abort: !1,
1766
+ ...v(t)
1767
+ });
1768
+ }
1769
+ // @__NO_SIDE_EFFECTS__
1770
+ function Mi(e, t) {
1771
+ return new e({
1772
+ type: "string",
1773
+ format: "cuid",
1774
+ check: "string_format",
1775
+ abort: !1,
1776
+ ...v(t)
1777
+ });
1778
+ }
1779
+ // @__NO_SIDE_EFFECTS__
1780
+ function Li(e, t) {
1781
+ return new e({
1782
+ type: "string",
1783
+ format: "cuid2",
1784
+ check: "string_format",
1785
+ abort: !1,
1786
+ ...v(t)
1787
+ });
1788
+ }
1789
+ // @__NO_SIDE_EFFECTS__
1790
+ function Ji(e, t) {
1791
+ return new e({
1792
+ type: "string",
1793
+ format: "ulid",
1794
+ check: "string_format",
1795
+ abort: !1,
1796
+ ...v(t)
1797
+ });
1798
+ }
1799
+ // @__NO_SIDE_EFFECTS__
1800
+ function Vi(e, t) {
1801
+ return new e({
1802
+ type: "string",
1803
+ format: "xid",
1804
+ check: "string_format",
1805
+ abort: !1,
1806
+ ...v(t)
1807
+ });
1808
+ }
1809
+ // @__NO_SIDE_EFFECTS__
1810
+ function Gi(e, t) {
1811
+ return new e({
1812
+ type: "string",
1813
+ format: "ksuid",
1814
+ check: "string_format",
1815
+ abort: !1,
1816
+ ...v(t)
1817
+ });
1818
+ }
1819
+ // @__NO_SIDE_EFFECTS__
1820
+ function Bi(e, t) {
1821
+ return new e({
1822
+ type: "string",
1823
+ format: "ipv4",
1824
+ check: "string_format",
1825
+ abort: !1,
1826
+ ...v(t)
1827
+ });
1828
+ }
1829
+ // @__NO_SIDE_EFFECTS__
1830
+ function Wi(e, t) {
1831
+ return new e({
1832
+ type: "string",
1833
+ format: "ipv6",
1834
+ check: "string_format",
1835
+ abort: !1,
1836
+ ...v(t)
1837
+ });
1838
+ }
1839
+ // @__NO_SIDE_EFFECTS__
1840
+ function qi(e, t) {
1841
+ return new e({
1842
+ type: "string",
1843
+ format: "cidrv4",
1844
+ check: "string_format",
1845
+ abort: !1,
1846
+ ...v(t)
1847
+ });
1848
+ }
1849
+ // @__NO_SIDE_EFFECTS__
1850
+ function Ki(e, t) {
1851
+ return new e({
1852
+ type: "string",
1853
+ format: "cidrv6",
1854
+ check: "string_format",
1855
+ abort: !1,
1856
+ ...v(t)
1857
+ });
1858
+ }
1859
+ // @__NO_SIDE_EFFECTS__
1860
+ function Yi(e, t) {
1861
+ return new e({
1862
+ type: "string",
1863
+ format: "base64",
1864
+ check: "string_format",
1865
+ abort: !1,
1866
+ ...v(t)
1867
+ });
1868
+ }
1869
+ // @__NO_SIDE_EFFECTS__
1870
+ function Hi(e, t) {
1871
+ return new e({
1872
+ type: "string",
1873
+ format: "base64url",
1874
+ check: "string_format",
1875
+ abort: !1,
1876
+ ...v(t)
1877
+ });
1878
+ }
1879
+ // @__NO_SIDE_EFFECTS__
1880
+ function Xi(e, t) {
1881
+ return new e({
1882
+ type: "string",
1883
+ format: "e164",
1884
+ check: "string_format",
1885
+ abort: !1,
1886
+ ...v(t)
1887
+ });
1888
+ }
1889
+ // @__NO_SIDE_EFFECTS__
1890
+ function Qi(e, t) {
1891
+ return new e({
1892
+ type: "string",
1893
+ format: "jwt",
1894
+ check: "string_format",
1895
+ abort: !1,
1896
+ ...v(t)
1897
+ });
1898
+ }
1899
+ // @__NO_SIDE_EFFECTS__
1900
+ function es(e, t) {
1901
+ return new e({
1902
+ type: "string",
1903
+ format: "datetime",
1904
+ check: "string_format",
1905
+ offset: !1,
1906
+ local: !1,
1907
+ precision: null,
1908
+ ...v(t)
1909
+ });
1910
+ }
1911
+ // @__NO_SIDE_EFFECTS__
1912
+ function ts(e, t) {
1913
+ return new e({
1914
+ type: "string",
1915
+ format: "date",
1916
+ check: "string_format",
1917
+ ...v(t)
1918
+ });
1919
+ }
1920
+ // @__NO_SIDE_EFFECTS__
1921
+ function ns(e, t) {
1922
+ return new e({
1923
+ type: "string",
1924
+ format: "time",
1925
+ check: "string_format",
1926
+ precision: null,
1927
+ ...v(t)
1928
+ });
1929
+ }
1930
+ // @__NO_SIDE_EFFECTS__
1931
+ function rs(e, t) {
1932
+ return new e({
1933
+ type: "string",
1934
+ format: "duration",
1935
+ check: "string_format",
1936
+ ...v(t)
1937
+ });
1938
+ }
1939
+ // @__NO_SIDE_EFFECTS__
1940
+ function os(e, t) {
1941
+ return new e({
1942
+ type: "number",
1943
+ checks: [],
1944
+ ...v(t)
1945
+ });
1946
+ }
1947
+ // @__NO_SIDE_EFFECTS__
1948
+ function is(e, t) {
1949
+ return new e({
1950
+ type: "number",
1951
+ check: "number_format",
1952
+ abort: !1,
1953
+ format: "safeint",
1954
+ ...v(t)
1955
+ });
1956
+ }
1957
+ // @__NO_SIDE_EFFECTS__
1958
+ function ss(e) {
1959
+ return new e({
1960
+ type: "unknown"
1961
+ });
1962
+ }
1963
+ // @__NO_SIDE_EFFECTS__
1964
+ function as(e, t) {
1965
+ return new e({
1966
+ type: "never",
1967
+ ...v(t)
1968
+ });
1969
+ }
1970
+ // @__NO_SIDE_EFFECTS__
1971
+ function Rt(e, t) {
1972
+ return new fn({
1973
+ check: "less_than",
1974
+ ...v(t),
1975
+ value: e,
1976
+ inclusive: !1
1977
+ });
1978
+ }
1979
+ // @__NO_SIDE_EFFECTS__
1980
+ function tt(e, t) {
1981
+ return new fn({
1982
+ check: "less_than",
1983
+ ...v(t),
1984
+ value: e,
1985
+ inclusive: !0
1986
+ });
1987
+ }
1988
+ // @__NO_SIDE_EFFECTS__
1989
+ function Ft(e, t) {
1990
+ return new pn({
1991
+ check: "greater_than",
1992
+ ...v(t),
1993
+ value: e,
1994
+ inclusive: !1
1995
+ });
1996
+ }
1997
+ // @__NO_SIDE_EFFECTS__
1998
+ function nt(e, t) {
1999
+ return new pn({
2000
+ check: "greater_than",
2001
+ ...v(t),
2002
+ value: e,
2003
+ inclusive: !0
2004
+ });
2005
+ }
2006
+ // @__NO_SIDE_EFFECTS__
2007
+ function Ut(e, t) {
2008
+ return new Zo({
2009
+ check: "multiple_of",
2010
+ ...v(t),
2011
+ value: e
2012
+ });
2013
+ }
2014
+ // @__NO_SIDE_EFFECTS__
2015
+ function yn(e, t) {
2016
+ return new To({
2017
+ check: "max_length",
2018
+ ...v(t),
2019
+ maximum: e
2020
+ });
2021
+ }
2022
+ // @__NO_SIDE_EFFECTS__
2023
+ function Ge(e, t) {
2024
+ return new Eo({
2025
+ check: "min_length",
2026
+ ...v(t),
2027
+ minimum: e
2028
+ });
2029
+ }
2030
+ // @__NO_SIDE_EFFECTS__
2031
+ function bn(e, t) {
2032
+ return new xo({
2033
+ check: "length_equals",
2034
+ ...v(t),
2035
+ length: e
2036
+ });
2037
+ }
2038
+ // @__NO_SIDE_EFFECTS__
2039
+ function cs(e, t) {
2040
+ return new Oo({
2041
+ check: "string_format",
2042
+ format: "regex",
2043
+ ...v(t),
2044
+ pattern: e
2045
+ });
2046
+ }
2047
+ // @__NO_SIDE_EFFECTS__
2048
+ function us(e) {
2049
+ return new $o({
2050
+ check: "string_format",
2051
+ format: "lowercase",
2052
+ ...v(e)
2053
+ });
2054
+ }
2055
+ // @__NO_SIDE_EFFECTS__
2056
+ function ls(e) {
2057
+ return new Co({
2058
+ check: "string_format",
2059
+ format: "uppercase",
2060
+ ...v(e)
2061
+ });
2062
+ }
2063
+ // @__NO_SIDE_EFFECTS__
2064
+ function ds(e, t) {
2065
+ return new No({
2066
+ check: "string_format",
2067
+ format: "includes",
2068
+ ...v(t),
2069
+ includes: e
2070
+ });
2071
+ }
2072
+ // @__NO_SIDE_EFFECTS__
2073
+ function fs(e, t) {
2074
+ return new Ao({
2075
+ check: "string_format",
2076
+ format: "starts_with",
2077
+ ...v(t),
2078
+ prefix: e
2079
+ });
2080
+ }
2081
+ // @__NO_SIDE_EFFECTS__
2082
+ function ps(e, t) {
2083
+ return new jo({
2084
+ check: "string_format",
2085
+ format: "ends_with",
2086
+ ...v(t),
2087
+ suffix: e
2088
+ });
2089
+ }
2090
+ // @__NO_SIDE_EFFECTS__
2091
+ function Ze(e) {
2092
+ return new Do({
2093
+ check: "overwrite",
2094
+ tx: e
2095
+ });
2096
+ }
2097
+ // @__NO_SIDE_EFFECTS__
2098
+ function hs(e) {
2099
+ return /* @__PURE__ */ Ze((t) => t.normalize(e));
2100
+ }
2101
+ // @__NO_SIDE_EFFECTS__
2102
+ function ms() {
2103
+ return /* @__PURE__ */ Ze((e) => e.trim());
2104
+ }
2105
+ // @__NO_SIDE_EFFECTS__
2106
+ function gs() {
2107
+ return /* @__PURE__ */ Ze((e) => e.toLowerCase());
2108
+ }
2109
+ // @__NO_SIDE_EFFECTS__
2110
+ function vs() {
2111
+ return /* @__PURE__ */ Ze((e) => e.toUpperCase());
2112
+ }
2113
+ // @__NO_SIDE_EFFECTS__
2114
+ function _s() {
2115
+ return /* @__PURE__ */ Ze((e) => Tr(e));
2116
+ }
2117
+ // @__NO_SIDE_EFFECTS__
2118
+ function ys(e, t, n) {
2119
+ return new e({
2120
+ type: "array",
2121
+ element: t,
2122
+ // get element() {
2123
+ // return element;
2124
+ // },
2125
+ ...v(n)
2126
+ });
2127
+ }
2128
+ // @__NO_SIDE_EFFECTS__
2129
+ function bs(e, t, n) {
2130
+ return new e({
2131
+ type: "custom",
2132
+ check: "custom",
2133
+ fn: t,
2134
+ ...v(n)
2135
+ });
2136
+ }
2137
+ // @__NO_SIDE_EFFECTS__
2138
+ function ws(e, t) {
2139
+ const n = /* @__PURE__ */ ks((r) => (r.addIssue = (i) => {
2140
+ if (typeof i == "string")
2141
+ r.issues.push(Ne(i, r.value, n._zod.def));
2142
+ else {
2143
+ const a = i;
2144
+ a.fatal && (a.continue = !1), a.code ?? (a.code = "custom"), a.input ?? (a.input = r.value), a.inst ?? (a.inst = n), a.continue ?? (a.continue = !n._zod.def.abort), r.issues.push(Ne(a));
2145
+ }
2146
+ }, e(r.value, r)), t);
2147
+ return n;
2148
+ }
2149
+ // @__NO_SIDE_EFFECTS__
2150
+ function ks(e, t) {
2151
+ const n = new Y({
2152
+ check: "custom",
2153
+ ...v(t)
2154
+ });
2155
+ return n._zod.check = e, n;
2156
+ }
2157
+ function wn(e) {
2158
+ let t = e?.target ?? "draft-2020-12";
2159
+ return t === "draft-4" && (t = "draft-04"), t === "draft-7" && (t = "draft-07"), {
2160
+ processors: e.processors ?? {},
2161
+ metadataRegistry: e?.metadata ?? $e,
2162
+ target: t,
2163
+ unrepresentable: e?.unrepresentable ?? "throw",
2164
+ override: e?.override ?? (() => {
2165
+ }),
2166
+ io: e?.io ?? "output",
2167
+ counter: 0,
2168
+ seen: /* @__PURE__ */ new Map(),
2169
+ cycles: e?.cycles ?? "ref",
2170
+ reused: e?.reused ?? "inline",
2171
+ external: e?.external ?? void 0
2172
+ };
2173
+ }
2174
+ function G(e, t, n = { path: [], schemaPath: [] }) {
2175
+ var r;
2176
+ const i = e._zod.def, a = t.seen.get(e);
2177
+ if (a)
2178
+ return a.count++, n.schemaPath.includes(e) && (a.cycle = n.path), a.schema;
2179
+ const s = { schema: {}, count: 1, cycle: void 0, path: n.path };
2180
+ t.seen.set(e, s);
2181
+ const c = e._zod.toJSONSchema?.();
2182
+ if (c)
2183
+ s.schema = c;
2184
+ else {
2185
+ const m = {
2186
+ ...n,
2187
+ schemaPath: [...n.schemaPath, e],
2188
+ path: n.path
2189
+ };
2190
+ if (e._zod.processJSONSchema)
2191
+ e._zod.processJSONSchema(t, s.schema, m);
2192
+ else {
2193
+ const f = s.schema, p = t.processors[i.type];
2194
+ if (!p)
2195
+ throw new Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);
2196
+ p(e, t, f, m);
2197
+ }
2198
+ const g = e._zod.parent;
2199
+ g && (s.ref || (s.ref = g), G(g, t, m), t.seen.get(g).isParent = !0);
2200
+ }
2201
+ const u = t.metadataRegistry.get(e);
2202
+ return u && Object.assign(s.schema, u), t.io === "input" && q(e) && (delete s.schema.examples, delete s.schema.default), t.io === "input" && "_prefault" in s.schema && ((r = s.schema).default ?? (r.default = s.schema._prefault)), delete s.schema._prefault, t.seen.get(e).schema;
2203
+ }
2204
+ function kn(e, t) {
2205
+ const n = e.seen.get(t);
2206
+ if (!n)
2207
+ throw new Error("Unprocessed schema. This is a bug in Zod.");
2208
+ const r = /* @__PURE__ */ new Map();
2209
+ for (const s of e.seen.entries()) {
2210
+ const c = e.metadataRegistry.get(s[0])?.id;
2211
+ if (c) {
2212
+ const u = r.get(c);
2213
+ if (u && u !== s[0])
2214
+ throw new Error(`Duplicate schema id "${c}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);
2215
+ r.set(c, s[0]);
2216
+ }
2217
+ }
2218
+ const i = (s) => {
2219
+ const c = e.target === "draft-2020-12" ? "$defs" : "definitions";
2220
+ if (e.external) {
2221
+ const g = e.external.registry.get(s[0])?.id, f = e.external.uri ?? ((w) => w);
2222
+ if (g)
2223
+ return { ref: f(g) };
2224
+ const p = s[1].defId ?? s[1].schema.id ?? `schema${e.counter++}`;
2225
+ return s[1].defId = p, { defId: p, ref: `${f("__shared")}#/${c}/${p}` };
2226
+ }
2227
+ if (s[1] === n)
2228
+ return { ref: "#" };
2229
+ const l = `#/${c}/`, m = s[1].schema.id ?? `__schema${e.counter++}`;
2230
+ return { defId: m, ref: l + m };
2231
+ }, a = (s) => {
2232
+ if (s[1].schema.$ref)
2233
+ return;
2234
+ const c = s[1], { ref: u, defId: l } = i(s);
2235
+ c.def = { ...c.schema }, l && (c.defId = l);
2236
+ const m = c.schema;
2237
+ for (const g in m)
2238
+ delete m[g];
2239
+ m.$ref = u;
2240
+ };
2241
+ if (e.cycles === "throw")
2242
+ for (const s of e.seen.entries()) {
2243
+ const c = s[1];
2244
+ if (c.cycle)
2245
+ throw new Error(`Cycle detected: #/${c.cycle?.join("/")}/<root>
2246
+
2247
+ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`);
2248
+ }
2249
+ for (const s of e.seen.entries()) {
2250
+ const c = s[1];
2251
+ if (t === s[0]) {
2252
+ a(s);
2253
+ continue;
2254
+ }
2255
+ if (e.external) {
2256
+ const l = e.external.registry.get(s[0])?.id;
2257
+ if (t !== s[0] && l) {
2258
+ a(s);
2259
+ continue;
2260
+ }
2261
+ }
2262
+ if (e.metadataRegistry.get(s[0])?.id) {
2263
+ a(s);
2264
+ continue;
2265
+ }
2266
+ if (c.cycle) {
2267
+ a(s);
2268
+ continue;
2269
+ }
2270
+ if (c.count > 1 && e.reused === "ref") {
2271
+ a(s);
2272
+ continue;
2273
+ }
2274
+ }
2275
+ }
2276
+ function zn(e, t) {
2277
+ const n = e.seen.get(t);
2278
+ if (!n)
2279
+ throw new Error("Unprocessed schema. This is a bug in Zod.");
2280
+ const r = (c) => {
2281
+ const u = e.seen.get(c);
2282
+ if (u.ref === null)
2283
+ return;
2284
+ const l = u.def ?? u.schema, m = { ...l }, g = u.ref;
2285
+ if (u.ref = null, g) {
2286
+ r(g);
2287
+ const p = e.seen.get(g), w = p.schema;
2288
+ if (w.$ref && (e.target === "draft-07" || e.target === "draft-04" || e.target === "openapi-3.0") ? (l.allOf = l.allOf ?? [], l.allOf.push(w)) : Object.assign(l, w), Object.assign(l, m), c._zod.parent === g)
2289
+ for (const Z in l)
2290
+ Z === "$ref" || Z === "allOf" || Z in m || delete l[Z];
2291
+ if (w.$ref && p.def)
2292
+ for (const Z in l)
2293
+ Z === "$ref" || Z === "allOf" || Z in p.def && JSON.stringify(l[Z]) === JSON.stringify(p.def[Z]) && delete l[Z];
2294
+ }
2295
+ const f = c._zod.parent;
2296
+ if (f && f !== g) {
2297
+ r(f);
2298
+ const p = e.seen.get(f);
2299
+ if (p?.schema.$ref && (l.$ref = p.schema.$ref, p.def))
2300
+ for (const w in l)
2301
+ w === "$ref" || w === "allOf" || w in p.def && JSON.stringify(l[w]) === JSON.stringify(p.def[w]) && delete l[w];
2302
+ }
2303
+ e.override({
2304
+ zodSchema: c,
2305
+ jsonSchema: l,
2306
+ path: u.path ?? []
2307
+ });
2308
+ };
2309
+ for (const c of [...e.seen.entries()].reverse())
2310
+ r(c[0]);
2311
+ const i = {};
2312
+ 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) {
2313
+ const c = e.external.registry.get(t)?.id;
2314
+ if (!c)
2315
+ throw new Error("Schema is missing an `id` property");
2316
+ i.$id = e.external.uri(c);
2317
+ }
2318
+ Object.assign(i, n.def ?? n.schema);
2319
+ const a = e.metadataRegistry.get(t)?.id;
2320
+ a !== void 0 && i.id === a && delete i.id;
2321
+ const s = e.external?.defs ?? {};
2322
+ for (const c of e.seen.entries()) {
2323
+ const u = c[1];
2324
+ u.def && u.defId && (u.def.id === u.defId && delete u.def.id, s[u.defId] = u.def);
2325
+ }
2326
+ e.external || Object.keys(s).length > 0 && (e.target === "draft-2020-12" ? i.$defs = s : i.definitions = s);
2327
+ try {
2328
+ const c = JSON.parse(JSON.stringify(i));
2329
+ return Object.defineProperty(c, "~standard", {
2330
+ value: {
2331
+ ...t["~standard"],
2332
+ jsonSchema: {
2333
+ input: Be(t, "input", e.processors),
2334
+ output: Be(t, "output", e.processors)
2335
+ }
2336
+ },
2337
+ enumerable: !1,
2338
+ writable: !1
2339
+ }), c;
2340
+ } catch {
2341
+ throw new Error("Error converting schema to JSON.");
2342
+ }
2343
+ }
2344
+ function q(e, t) {
2345
+ const n = t ?? { seen: /* @__PURE__ */ new Set() };
2346
+ if (n.seen.has(e))
2347
+ return !1;
2348
+ n.seen.add(e);
2349
+ const r = e._zod.def;
2350
+ if (r.type === "transform")
2351
+ return !0;
2352
+ if (r.type === "array")
2353
+ return q(r.element, n);
2354
+ if (r.type === "set")
2355
+ return q(r.valueType, n);
2356
+ if (r.type === "lazy")
2357
+ return q(r.getter(), n);
2358
+ if (r.type === "promise" || r.type === "optional" || r.type === "nonoptional" || r.type === "nullable" || r.type === "readonly" || r.type === "default" || r.type === "prefault")
2359
+ return q(r.innerType, n);
2360
+ if (r.type === "intersection")
2361
+ return q(r.left, n) || q(r.right, n);
2362
+ if (r.type === "record" || r.type === "map")
2363
+ return q(r.keyType, n) || q(r.valueType, n);
2364
+ if (r.type === "pipe")
2365
+ return e._zod.traits.has("$ZodCodec") ? !0 : q(r.in, n) || q(r.out, n);
2366
+ if (r.type === "object") {
2367
+ for (const i in r.shape)
2368
+ if (q(r.shape[i], n))
2369
+ return !0;
2370
+ return !1;
2371
+ }
2372
+ if (r.type === "union") {
2373
+ for (const i of r.options)
2374
+ if (q(i, n))
2375
+ return !0;
2376
+ return !1;
2377
+ }
2378
+ if (r.type === "tuple") {
2379
+ for (const i of r.items)
2380
+ if (q(i, n))
2381
+ return !0;
2382
+ return !!(r.rest && q(r.rest, n));
2383
+ }
2384
+ return !1;
2385
+ }
2386
+ const zs = (e, t = {}) => (n) => {
2387
+ const r = wn({ ...n, processors: t });
2388
+ return G(e, r), kn(r, e), zn(r, e);
2389
+ }, Be = (e, t, n = {}) => (r) => {
2390
+ const { libraryOptions: i, target: a } = r ?? {}, s = wn({ ...i ?? {}, target: a, io: t, processors: n });
2391
+ return G(e, s), kn(s, e), zn(s, e);
2392
+ }, Ss = {
2393
+ guid: "uuid",
2394
+ url: "uri",
2395
+ datetime: "date-time",
2396
+ json_string: "json-string",
2397
+ regex: ""
2398
+ // do not set
2399
+ }, Is = (e, t, n, r) => {
2400
+ const i = n;
2401
+ i.type = "string";
2402
+ const { minimum: a, maximum: s, format: c, patterns: u, contentEncoding: l } = e._zod.bag;
2403
+ if (typeof a == "number" && (i.minLength = a), typeof s == "number" && (i.maxLength = s), c && (i.format = Ss[c] ?? c, i.format === "" && delete i.format, c === "time" && delete i.format), l && (i.contentEncoding = l), u && u.size > 0) {
2404
+ const m = [...u];
2405
+ m.length === 1 ? i.pattern = m[0].source : m.length > 1 && (i.allOf = [
2406
+ ...m.map((g) => ({
2407
+ ...t.target === "draft-07" || t.target === "draft-04" || t.target === "openapi-3.0" ? { type: "string" } : {},
2408
+ pattern: g.source
2409
+ }))
2410
+ ]);
2411
+ }
2412
+ }, Zs = (e, t, n, r) => {
2413
+ const i = n, { minimum: a, maximum: s, format: c, multipleOf: u, exclusiveMaximum: l, exclusiveMinimum: m } = e._zod.bag;
2414
+ typeof c == "string" && c.includes("int") ? i.type = "integer" : i.type = "number";
2415
+ const g = typeof m == "number" && m >= (a ?? Number.NEGATIVE_INFINITY), f = typeof l == "number" && l <= (s ?? Number.POSITIVE_INFINITY), p = t.target === "draft-04" || t.target === "openapi-3.0";
2416
+ g ? p ? (i.minimum = m, i.exclusiveMinimum = !0) : i.exclusiveMinimum = m : typeof a == "number" && (i.minimum = a), f ? p ? (i.maximum = l, i.exclusiveMaximum = !0) : i.exclusiveMaximum = l : typeof s == "number" && (i.maximum = s), typeof u == "number" && (i.multipleOf = u);
2417
+ }, Ps = (e, t, n, r) => {
2418
+ n.not = {};
2419
+ }, Ts = (e, t, n, r) => {
2420
+ }, Es = (e, t, n, r) => {
2421
+ const i = e._zod.def, a = en(i.entries);
2422
+ a.every((s) => typeof s == "number") && (n.type = "number"), a.every((s) => typeof s == "string") && (n.type = "string"), n.enum = a;
2423
+ }, xs = (e, t, n, r) => {
2424
+ if (t.unrepresentable === "throw")
2425
+ throw new Error("Custom types cannot be represented in JSON Schema");
2426
+ }, Os = (e, t, n, r) => {
2427
+ if (t.unrepresentable === "throw")
2428
+ throw new Error("Transforms cannot be represented in JSON Schema");
2429
+ }, $s = (e, t, n, r) => {
2430
+ const i = n, a = e._zod.def, { minimum: s, maximum: c } = e._zod.bag;
2431
+ typeof s == "number" && (i.minItems = s), typeof c == "number" && (i.maxItems = c), i.type = "array", i.items = G(a.element, t, {
2432
+ ...r,
2433
+ path: [...r.path, "items"]
2434
+ });
2435
+ }, Cs = (e, t, n, r) => {
2436
+ const i = n, a = e._zod.def;
2437
+ i.type = "object", i.properties = {};
2438
+ const s = a.shape;
2439
+ for (const l in s)
2440
+ i.properties[l] = G(s[l], t, {
2441
+ ...r,
2442
+ path: [...r.path, "properties", l]
2443
+ });
2444
+ const c = new Set(Object.keys(s)), u = new Set([...c].filter((l) => {
2445
+ const m = a.shape[l]._zod;
2446
+ return t.io === "input" ? m.optin === void 0 : m.optout === void 0;
2447
+ }));
2448
+ u.size > 0 && (i.required = Array.from(u)), a.catchall?._zod.def.type === "never" ? i.additionalProperties = !1 : a.catchall ? a.catchall && (i.additionalProperties = G(a.catchall, t, {
2449
+ ...r,
2450
+ path: [...r.path, "additionalProperties"]
2451
+ })) : t.io === "output" && (i.additionalProperties = !1);
2452
+ }, Ns = (e, t, n, r) => {
2453
+ const i = e._zod.def, a = i.inclusive === !1, s = i.options.map((c, u) => G(c, t, {
2454
+ ...r,
2455
+ path: [...r.path, a ? "oneOf" : "anyOf", u]
2456
+ }));
2457
+ a ? n.oneOf = s : n.anyOf = s;
2458
+ }, As = (e, t, n, r) => {
2459
+ const i = e._zod.def, a = G(i.left, t, {
2460
+ ...r,
2461
+ path: [...r.path, "allOf", 0]
2462
+ }), s = G(i.right, t, {
2463
+ ...r,
2464
+ path: [...r.path, "allOf", 1]
2465
+ }), c = (l) => "allOf" in l && Object.keys(l).length === 1, u = [
2466
+ ...c(a) ? a.allOf : [a],
2467
+ ...c(s) ? s.allOf : [s]
2468
+ ];
2469
+ n.allOf = u;
2470
+ }, js = (e, t, n, r) => {
2471
+ const i = e._zod.def, a = G(i.innerType, t, r), s = t.seen.get(e);
2472
+ t.target === "openapi-3.0" ? (s.ref = i.innerType, n.nullable = !0) : n.anyOf = [a, { type: "null" }];
2473
+ }, Ds = (e, t, n, r) => {
2474
+ const i = e._zod.def;
2475
+ G(i.innerType, t, r);
2476
+ const a = t.seen.get(e);
2477
+ a.ref = i.innerType;
2478
+ }, Rs = (e, t, n, r) => {
2479
+ const i = e._zod.def;
2480
+ G(i.innerType, t, r);
2481
+ const a = t.seen.get(e);
2482
+ a.ref = i.innerType, n.default = JSON.parse(JSON.stringify(i.defaultValue));
2483
+ }, Fs = (e, t, n, r) => {
2484
+ const i = e._zod.def;
2485
+ G(i.innerType, t, r);
2486
+ const a = t.seen.get(e);
2487
+ a.ref = i.innerType, t.io === "input" && (n._prefault = JSON.parse(JSON.stringify(i.defaultValue)));
2488
+ }, Us = (e, t, n, r) => {
2489
+ const i = e._zod.def;
2490
+ G(i.innerType, t, r);
2491
+ const a = t.seen.get(e);
2492
+ a.ref = i.innerType;
2493
+ let s;
2494
+ try {
2495
+ s = i.catchValue(void 0);
2496
+ } catch {
2497
+ throw new Error("Dynamic catch values are not supported in JSON Schema");
2498
+ }
2499
+ n.default = s;
2500
+ }, Ms = (e, t, n, r) => {
2501
+ const i = e._zod.def, a = i.in._zod.traits.has("$ZodTransform"), s = t.io === "input" ? a ? i.out : i.in : i.out;
2502
+ G(s, t, r);
2503
+ const c = t.seen.get(e);
2504
+ c.ref = s;
2505
+ }, Ls = (e, t, n, r) => {
2506
+ const i = e._zod.def;
2507
+ G(i.innerType, t, r);
2508
+ const a = t.seen.get(e);
2509
+ a.ref = i.innerType, n.readOnly = !0;
2510
+ }, Sn = (e, t, n, r) => {
2511
+ const i = e._zod.def;
2512
+ G(i.innerType, t, r);
2513
+ const a = t.seen.get(e);
2514
+ a.ref = i.innerType;
2515
+ }, Js = /* @__PURE__ */ d("ZodISODateTime", (e, t) => {
2516
+ Ho.init(e, t), A.init(e, t);
2517
+ });
2518
+ function Vs(e) {
2519
+ return /* @__PURE__ */ es(Js, e);
2520
+ }
2521
+ const Gs = /* @__PURE__ */ d("ZodISODate", (e, t) => {
2522
+ Xo.init(e, t), A.init(e, t);
2523
+ });
2524
+ function Bs(e) {
2525
+ return /* @__PURE__ */ ts(Gs, e);
2526
+ }
2527
+ const Ws = /* @__PURE__ */ d("ZodISOTime", (e, t) => {
2528
+ Qo.init(e, t), A.init(e, t);
2529
+ });
2530
+ function qs(e) {
2531
+ return /* @__PURE__ */ ns(Ws, e);
2532
+ }
2533
+ const Ks = /* @__PURE__ */ d("ZodISODuration", (e, t) => {
2534
+ ei.init(e, t), A.init(e, t);
2535
+ });
2536
+ function Ys(e) {
2537
+ return /* @__PURE__ */ rs(Ks, e);
2538
+ }
2539
+ const Hs = (e, t) => {
2540
+ sn.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
2541
+ format: {
2542
+ value: (n) => Lr(e, n)
2543
+ // enumerable: false,
2544
+ },
2545
+ flatten: {
2546
+ value: (n) => Mr(e, n)
2547
+ // enumerable: false,
2548
+ },
2549
+ addIssue: {
2550
+ value: (n) => {
2551
+ e.issues.push(n), e.message = JSON.stringify(e.issues, it, 2);
2552
+ }
2553
+ // enumerable: false,
2554
+ },
2555
+ addIssues: {
2556
+ value: (n) => {
2557
+ e.issues.push(...n), e.message = JSON.stringify(e.issues, it, 2);
2558
+ }
2559
+ // enumerable: false,
2560
+ },
2561
+ isEmpty: {
2562
+ get() {
2563
+ return e.issues.length === 0;
2564
+ }
2565
+ // enumerable: false,
2566
+ }
2567
+ });
2568
+ }, ne = /* @__PURE__ */ d("ZodError", Hs, {
2569
+ Parent: Error
2570
+ }), Xs = /* @__PURE__ */ ht(ne), Qs = /* @__PURE__ */ mt(ne), ea = /* @__PURE__ */ qe(ne), ta = /* @__PURE__ */ Ke(ne), na = /* @__PURE__ */ Gr(ne), ra = /* @__PURE__ */ Br(ne), oa = /* @__PURE__ */ Wr(ne), ia = /* @__PURE__ */ qr(ne), sa = /* @__PURE__ */ Kr(ne), aa = /* @__PURE__ */ Yr(ne), ca = /* @__PURE__ */ Hr(ne), ua = /* @__PURE__ */ Xr(ne), Mt = /* @__PURE__ */ new WeakMap();
2571
+ function Ae(e, t, n) {
2572
+ const r = Object.getPrototypeOf(e);
2573
+ let i = Mt.get(r);
2574
+ if (i || (i = /* @__PURE__ */ new Set(), Mt.set(r, i)), !i.has(t)) {
2575
+ i.add(t);
2576
+ for (const a in n) {
2577
+ const s = n[a];
2578
+ Object.defineProperty(r, a, {
2579
+ configurable: !0,
2580
+ enumerable: !1,
2581
+ get() {
2582
+ const c = s.bind(this);
2583
+ return Object.defineProperty(this, a, {
2584
+ configurable: !0,
2585
+ writable: !0,
2586
+ enumerable: !0,
2587
+ value: c
2588
+ }), c;
2589
+ },
2590
+ set(c) {
2591
+ Object.defineProperty(this, a, {
2592
+ configurable: !0,
2593
+ writable: !0,
2594
+ enumerable: !0,
2595
+ value: c
2596
+ });
2597
+ }
2598
+ });
2599
+ }
2600
+ }
2601
+ }
2602
+ const R = /* @__PURE__ */ d("ZodType", (e, t) => (D.init(e, t), Object.assign(e["~standard"], {
2603
+ jsonSchema: {
2604
+ input: Be(e, "input"),
2605
+ output: Be(e, "output")
2606
+ }
2607
+ }), e.toJSONSchema = zs(e, {}), e.def = t, e.type = t.type, Object.defineProperty(e, "_def", { value: t }), e.parse = (n, r) => Xs(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => ea(e, n, r), e.parseAsync = async (n, r) => Qs(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => ta(e, n, r), e.spa = e.safeParseAsync, e.encode = (n, r) => na(e, n, r), e.decode = (n, r) => ra(e, n, r), e.encodeAsync = async (n, r) => oa(e, n, r), e.decodeAsync = async (n, r) => ia(e, n, r), e.safeEncode = (n, r) => sa(e, n, r), e.safeDecode = (n, r) => aa(e, n, r), e.safeEncodeAsync = async (n, r) => ca(e, n, r), e.safeDecodeAsync = async (n, r) => ua(e, n, r), Ae(e, "ZodType", {
2608
+ check(...n) {
2609
+ const r = this.def;
2610
+ return this.clone(pe(r, {
2611
+ checks: [
2612
+ ...r.checks ?? [],
2613
+ ...n.map((i) => typeof i == "function" ? { _zod: { check: i, def: { check: "custom" }, onattach: [] } } : i)
2614
+ ]
2615
+ }), { parent: !0 });
2616
+ },
2617
+ with(...n) {
2618
+ return this.check(...n);
2619
+ },
2620
+ clone(n, r) {
2621
+ return he(this, n, r);
2622
+ },
2623
+ brand() {
2624
+ return this;
2625
+ },
2626
+ register(n, r) {
2627
+ return n.add(this, r), this;
2628
+ },
2629
+ refine(n, r) {
2630
+ return this.check(oc(n, r));
2631
+ },
2632
+ superRefine(n, r) {
2633
+ return this.check(ic(n, r));
2634
+ },
2635
+ overwrite(n) {
2636
+ return this.check(/* @__PURE__ */ Ze(n));
2637
+ },
2638
+ optional() {
2639
+ return Gt(this);
2640
+ },
2641
+ exactOptional() {
2642
+ return Ga(this);
2643
+ },
2644
+ nullable() {
2645
+ return Bt(this);
2646
+ },
2647
+ nullish() {
2648
+ return Gt(Bt(this));
2649
+ },
2650
+ nonoptional(n) {
2651
+ return Ha(this, n);
2652
+ },
2653
+ array() {
2654
+ return Na(this);
2655
+ },
2656
+ or(n) {
2657
+ return Ra([this, n]);
2658
+ },
2659
+ and(n) {
2660
+ return Ua(this, n);
2661
+ },
2662
+ transform(n) {
2663
+ return Wt(this, Ja(n));
2664
+ },
2665
+ default(n) {
2666
+ return qa(this, n);
2667
+ },
2668
+ prefault(n) {
2669
+ return Ya(this, n);
2670
+ },
2671
+ catch(n) {
2672
+ return Qa(this, n);
2673
+ },
2674
+ pipe(n) {
2675
+ return Wt(this, n);
2676
+ },
2677
+ readonly() {
2678
+ return nc(this);
2679
+ },
2680
+ describe(n) {
2681
+ const r = this.clone();
2682
+ return $e.add(r, { description: n }), r;
2683
+ },
2684
+ meta(...n) {
2685
+ if (n.length === 0)
2686
+ return $e.get(this);
2687
+ const r = this.clone();
2688
+ return $e.add(r, n[0]), r;
2689
+ },
2690
+ isOptional() {
2691
+ return this.safeParse(void 0).success;
2692
+ },
2693
+ isNullable() {
2694
+ return this.safeParse(null).success;
2695
+ },
2696
+ apply(n) {
2697
+ return n(this);
2698
+ }
2699
+ }), Object.defineProperty(e, "description", {
2700
+ get() {
2701
+ return $e.get(e)?.description;
2702
+ },
2703
+ configurable: !0
2704
+ }), e)), In = /* @__PURE__ */ d("_ZodString", (e, t) => {
2705
+ gt.init(e, t), R.init(e, t), e._zod.processJSONSchema = (r, i, a) => Is(e, r, i);
2706
+ const n = e._zod.bag;
2707
+ e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, Ae(e, "_ZodString", {
2708
+ regex(...r) {
2709
+ return this.check(/* @__PURE__ */ cs(...r));
2710
+ },
2711
+ includes(...r) {
2712
+ return this.check(/* @__PURE__ */ ds(...r));
2713
+ },
2714
+ startsWith(...r) {
2715
+ return this.check(/* @__PURE__ */ fs(...r));
2716
+ },
2717
+ endsWith(...r) {
2718
+ return this.check(/* @__PURE__ */ ps(...r));
2719
+ },
2720
+ min(...r) {
2721
+ return this.check(/* @__PURE__ */ Ge(...r));
2722
+ },
2723
+ max(...r) {
2724
+ return this.check(/* @__PURE__ */ yn(...r));
2725
+ },
2726
+ length(...r) {
2727
+ return this.check(/* @__PURE__ */ bn(...r));
2728
+ },
2729
+ nonempty(...r) {
2730
+ return this.check(/* @__PURE__ */ Ge(1, ...r));
2731
+ },
2732
+ lowercase(r) {
2733
+ return this.check(/* @__PURE__ */ us(r));
2734
+ },
2735
+ uppercase(r) {
2736
+ return this.check(/* @__PURE__ */ ls(r));
2737
+ },
2738
+ trim() {
2739
+ return this.check(/* @__PURE__ */ ms());
2740
+ },
2741
+ normalize(...r) {
2742
+ return this.check(/* @__PURE__ */ hs(...r));
2743
+ },
2744
+ toLowerCase() {
2745
+ return this.check(/* @__PURE__ */ gs());
2746
+ },
2747
+ toUpperCase() {
2748
+ return this.check(/* @__PURE__ */ vs());
2749
+ },
2750
+ slugify() {
2751
+ return this.check(/* @__PURE__ */ _s());
2752
+ }
2753
+ });
2754
+ }), la = /* @__PURE__ */ d("ZodString", (e, t) => {
2755
+ gt.init(e, t), In.init(e, t), e.email = (n) => e.check(/* @__PURE__ */ Ci(fa, n)), e.url = (n) => e.check(/* @__PURE__ */ Ri(pa, n)), e.jwt = (n) => e.check(/* @__PURE__ */ Qi(Ta, n)), e.emoji = (n) => e.check(/* @__PURE__ */ Fi(ha, n)), e.guid = (n) => e.check(/* @__PURE__ */ Dt(Lt, n)), e.uuid = (n) => e.check(/* @__PURE__ */ Ni(Re, n)), e.uuidv4 = (n) => e.check(/* @__PURE__ */ Ai(Re, n)), e.uuidv6 = (n) => e.check(/* @__PURE__ */ ji(Re, n)), e.uuidv7 = (n) => e.check(/* @__PURE__ */ Di(Re, n)), e.nanoid = (n) => e.check(/* @__PURE__ */ Ui(ma, n)), e.guid = (n) => e.check(/* @__PURE__ */ Dt(Lt, n)), e.cuid = (n) => e.check(/* @__PURE__ */ Mi(ga, n)), e.cuid2 = (n) => e.check(/* @__PURE__ */ Li(va, n)), e.ulid = (n) => e.check(/* @__PURE__ */ Ji(_a, n)), e.base64 = (n) => e.check(/* @__PURE__ */ Yi(Ia, n)), e.base64url = (n) => e.check(/* @__PURE__ */ Hi(Za, n)), e.xid = (n) => e.check(/* @__PURE__ */ Vi(ya, n)), e.ksuid = (n) => e.check(/* @__PURE__ */ Gi(ba, n)), e.ipv4 = (n) => e.check(/* @__PURE__ */ Bi(wa, n)), e.ipv6 = (n) => e.check(/* @__PURE__ */ Wi(ka, n)), e.cidrv4 = (n) => e.check(/* @__PURE__ */ qi(za, n)), e.cidrv6 = (n) => e.check(/* @__PURE__ */ Ki(Sa, n)), e.e164 = (n) => e.check(/* @__PURE__ */ Xi(Pa, n)), e.datetime = (n) => e.check(Vs(n)), e.date = (n) => e.check(Bs(n)), e.time = (n) => e.check(qs(n)), e.duration = (n) => e.check(Ys(n));
2756
+ });
2757
+ function da(e) {
2758
+ return /* @__PURE__ */ $i(la, e);
2759
+ }
2760
+ const A = /* @__PURE__ */ d("ZodStringFormat", (e, t) => {
2761
+ C.init(e, t), In.init(e, t);
2762
+ }), fa = /* @__PURE__ */ d("ZodEmail", (e, t) => {
2763
+ Lo.init(e, t), A.init(e, t);
2764
+ }), Lt = /* @__PURE__ */ d("ZodGUID", (e, t) => {
2765
+ Uo.init(e, t), A.init(e, t);
2766
+ }), Re = /* @__PURE__ */ d("ZodUUID", (e, t) => {
2767
+ Mo.init(e, t), A.init(e, t);
2768
+ }), pa = /* @__PURE__ */ d("ZodURL", (e, t) => {
2769
+ Jo.init(e, t), A.init(e, t);
2770
+ }), ha = /* @__PURE__ */ d("ZodEmoji", (e, t) => {
2771
+ Vo.init(e, t), A.init(e, t);
2772
+ }), ma = /* @__PURE__ */ d("ZodNanoID", (e, t) => {
2773
+ Go.init(e, t), A.init(e, t);
2774
+ }), ga = /* @__PURE__ */ d("ZodCUID", (e, t) => {
2775
+ Bo.init(e, t), A.init(e, t);
2776
+ }), va = /* @__PURE__ */ d("ZodCUID2", (e, t) => {
2777
+ Wo.init(e, t), A.init(e, t);
2778
+ }), _a = /* @__PURE__ */ d("ZodULID", (e, t) => {
2779
+ qo.init(e, t), A.init(e, t);
2780
+ }), ya = /* @__PURE__ */ d("ZodXID", (e, t) => {
2781
+ Ko.init(e, t), A.init(e, t);
2782
+ }), ba = /* @__PURE__ */ d("ZodKSUID", (e, t) => {
2783
+ Yo.init(e, t), A.init(e, t);
2784
+ }), wa = /* @__PURE__ */ d("ZodIPv4", (e, t) => {
2785
+ ti.init(e, t), A.init(e, t);
2786
+ }), ka = /* @__PURE__ */ d("ZodIPv6", (e, t) => {
2787
+ ni.init(e, t), A.init(e, t);
2788
+ }), za = /* @__PURE__ */ d("ZodCIDRv4", (e, t) => {
2789
+ ri.init(e, t), A.init(e, t);
2790
+ }), Sa = /* @__PURE__ */ d("ZodCIDRv6", (e, t) => {
2791
+ oi.init(e, t), A.init(e, t);
2792
+ }), Ia = /* @__PURE__ */ d("ZodBase64", (e, t) => {
2793
+ ii.init(e, t), A.init(e, t);
2794
+ }), Za = /* @__PURE__ */ d("ZodBase64URL", (e, t) => {
2795
+ ai.init(e, t), A.init(e, t);
2796
+ }), Pa = /* @__PURE__ */ d("ZodE164", (e, t) => {
2797
+ ci.init(e, t), A.init(e, t);
2798
+ }), Ta = /* @__PURE__ */ d("ZodJWT", (e, t) => {
2799
+ li.init(e, t), A.init(e, t);
2800
+ }), Zn = /* @__PURE__ */ d("ZodNumber", (e, t) => {
2801
+ mn.init(e, t), R.init(e, t), e._zod.processJSONSchema = (r, i, a) => Zs(e, r, i), Ae(e, "ZodNumber", {
2802
+ gt(r, i) {
2803
+ return this.check(/* @__PURE__ */ Ft(r, i));
2804
+ },
2805
+ gte(r, i) {
2806
+ return this.check(/* @__PURE__ */ nt(r, i));
2807
+ },
2808
+ min(r, i) {
2809
+ return this.check(/* @__PURE__ */ nt(r, i));
2810
+ },
2811
+ lt(r, i) {
2812
+ return this.check(/* @__PURE__ */ Rt(r, i));
2813
+ },
2814
+ lte(r, i) {
2815
+ return this.check(/* @__PURE__ */ tt(r, i));
2816
+ },
2817
+ max(r, i) {
2818
+ return this.check(/* @__PURE__ */ tt(r, i));
2819
+ },
2820
+ int(r) {
2821
+ return this.check(Jt(r));
2822
+ },
2823
+ safe(r) {
2824
+ return this.check(Jt(r));
2825
+ },
2826
+ positive(r) {
2827
+ return this.check(/* @__PURE__ */ Ft(0, r));
2828
+ },
2829
+ nonnegative(r) {
2830
+ return this.check(/* @__PURE__ */ nt(0, r));
2831
+ },
2832
+ negative(r) {
2833
+ return this.check(/* @__PURE__ */ Rt(0, r));
2834
+ },
2835
+ nonpositive(r) {
2836
+ return this.check(/* @__PURE__ */ tt(0, r));
2837
+ },
2838
+ multipleOf(r, i) {
2839
+ return this.check(/* @__PURE__ */ Ut(r, i));
2840
+ },
2841
+ step(r, i) {
2842
+ return this.check(/* @__PURE__ */ Ut(r, i));
2843
+ },
2844
+ finite() {
2845
+ return this;
2846
+ }
2847
+ });
2848
+ const n = e._zod.bag;
2849
+ e.minValue = Math.max(n.minimum ?? Number.NEGATIVE_INFINITY, n.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null, e.maxValue = Math.min(n.maximum ?? Number.POSITIVE_INFINITY, n.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null, e.isInt = (n.format ?? "").includes("int") || Number.isSafeInteger(n.multipleOf ?? 0.5), e.isFinite = !0, e.format = n.format ?? null;
2850
+ });
2851
+ function Pn(e) {
2852
+ return /* @__PURE__ */ os(Zn, e);
2853
+ }
2854
+ const Ea = /* @__PURE__ */ d("ZodNumberFormat", (e, t) => {
2855
+ di.init(e, t), Zn.init(e, t);
2856
+ });
2857
+ function Jt(e) {
2858
+ return /* @__PURE__ */ is(Ea, e);
2859
+ }
2860
+ const xa = /* @__PURE__ */ d("ZodUnknown", (e, t) => {
2861
+ fi.init(e, t), R.init(e, t), e._zod.processJSONSchema = (n, r, i) => Ts();
2862
+ });
2863
+ function Vt() {
2864
+ return /* @__PURE__ */ ss(xa);
2865
+ }
2866
+ const Oa = /* @__PURE__ */ d("ZodNever", (e, t) => {
2867
+ pi.init(e, t), R.init(e, t), e._zod.processJSONSchema = (n, r, i) => Ps(e, n, r);
2868
+ });
2869
+ function $a(e) {
2870
+ return /* @__PURE__ */ as(Oa, e);
2871
+ }
2872
+ const Ca = /* @__PURE__ */ d("ZodArray", (e, t) => {
2873
+ hi.init(e, t), R.init(e, t), e._zod.processJSONSchema = (n, r, i) => $s(e, n, r, i), e.element = t.element, Ae(e, "ZodArray", {
2874
+ min(n, r) {
2875
+ return this.check(/* @__PURE__ */ Ge(n, r));
2876
+ },
2877
+ nonempty(n) {
2878
+ return this.check(/* @__PURE__ */ Ge(1, n));
2879
+ },
2880
+ max(n, r) {
2881
+ return this.check(/* @__PURE__ */ yn(n, r));
2882
+ },
2883
+ length(n, r) {
2884
+ return this.check(/* @__PURE__ */ bn(n, r));
2885
+ },
2886
+ unwrap() {
2887
+ return this.element;
2888
+ }
2889
+ });
2890
+ });
2891
+ function Na(e, t) {
2892
+ return /* @__PURE__ */ ys(Ca, e, t);
2893
+ }
2894
+ const Aa = /* @__PURE__ */ d("ZodObject", (e, t) => {
2895
+ gi.init(e, t), R.init(e, t), e._zod.processJSONSchema = (n, r, i) => Cs(e, n, r, i), P(e, "shape", () => t.shape), Ae(e, "ZodObject", {
2896
+ keyof() {
2897
+ return Ma(Object.keys(this._zod.def.shape));
2898
+ },
2899
+ catchall(n) {
2900
+ return this.clone({ ...this._zod.def, catchall: n });
2901
+ },
2902
+ passthrough() {
2903
+ return this.clone({ ...this._zod.def, catchall: Vt() });
2904
+ },
2905
+ loose() {
2906
+ return this.clone({ ...this._zod.def, catchall: Vt() });
2907
+ },
2908
+ strict() {
2909
+ return this.clone({ ...this._zod.def, catchall: $a() });
2910
+ },
2911
+ strip() {
2912
+ return this.clone({ ...this._zod.def, catchall: void 0 });
2913
+ },
2914
+ extend(n) {
2915
+ return Ar(this, n);
2916
+ },
2917
+ safeExtend(n) {
2918
+ return jr(this, n);
2919
+ },
2920
+ merge(n) {
2921
+ return Dr(this, n);
2922
+ },
2923
+ pick(n) {
2924
+ return Cr(this, n);
2925
+ },
2926
+ omit(n) {
2927
+ return Nr(this, n);
2928
+ },
2929
+ partial(...n) {
2930
+ return Rr(Tn, this, n[0]);
2931
+ },
2932
+ required(...n) {
2933
+ return Fr(En, this, n[0]);
2934
+ }
2935
+ });
2936
+ });
2937
+ function ja(e, t) {
2938
+ const n = {
2939
+ type: "object",
2940
+ shape: e ?? {},
2941
+ ...v(t)
2942
+ };
2943
+ return new Aa(n);
2944
+ }
2945
+ const Da = /* @__PURE__ */ d("ZodUnion", (e, t) => {
2946
+ vi.init(e, t), R.init(e, t), e._zod.processJSONSchema = (n, r, i) => Ns(e, n, r, i), e.options = t.options;
2947
+ });
2948
+ function Ra(e, t) {
2949
+ return new Da({
2950
+ type: "union",
2951
+ options: e,
2952
+ ...v(t)
2953
+ });
2954
+ }
2955
+ const Fa = /* @__PURE__ */ d("ZodIntersection", (e, t) => {
2956
+ _i.init(e, t), R.init(e, t), e._zod.processJSONSchema = (n, r, i) => As(e, n, r, i);
2957
+ });
2958
+ function Ua(e, t) {
2959
+ return new Fa({
2960
+ type: "intersection",
2961
+ left: e,
2962
+ right: t
2963
+ });
2964
+ }
2965
+ const at = /* @__PURE__ */ d("ZodEnum", (e, t) => {
2966
+ yi.init(e, t), R.init(e, t), e._zod.processJSONSchema = (r, i, a) => Es(e, r, i), e.enum = t.entries, e.options = Object.values(t.entries);
2967
+ const n = new Set(Object.keys(t.entries));
2968
+ e.extract = (r, i) => {
2969
+ const a = {};
2970
+ for (const s of r)
2971
+ if (n.has(s))
2972
+ a[s] = t.entries[s];
2973
+ else
2974
+ throw new Error(`Key ${s} not found in enum`);
2975
+ return new at({
2976
+ ...t,
2977
+ checks: [],
2978
+ ...v(i),
2979
+ entries: a
2980
+ });
2981
+ }, e.exclude = (r, i) => {
2982
+ const a = { ...t.entries };
2983
+ for (const s of r)
2984
+ if (n.has(s))
2985
+ delete a[s];
2986
+ else
2987
+ throw new Error(`Key ${s} not found in enum`);
2988
+ return new at({
2989
+ ...t,
2990
+ checks: [],
2991
+ ...v(i),
2992
+ entries: a
2993
+ });
2994
+ };
2995
+ });
2996
+ function Ma(e, t) {
2997
+ const n = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
2998
+ return new at({
2999
+ type: "enum",
3000
+ entries: n,
3001
+ ...v(t)
3002
+ });
3003
+ }
3004
+ const La = /* @__PURE__ */ d("ZodTransform", (e, t) => {
3005
+ bi.init(e, t), R.init(e, t), e._zod.processJSONSchema = (n, r, i) => Os(e, n), e._zod.parse = (n, r) => {
3006
+ if (r.direction === "backward")
3007
+ throw new Qt(e.constructor.name);
3008
+ n.addIssue = (a) => {
3009
+ if (typeof a == "string")
3010
+ n.issues.push(Ne(a, n.value, t));
3011
+ else {
3012
+ const s = a;
3013
+ s.fatal && (s.continue = !1), s.code ?? (s.code = "custom"), s.input ?? (s.input = n.value), s.inst ?? (s.inst = e), n.issues.push(Ne(s));
3014
+ }
3015
+ };
3016
+ const i = t.transform(n.value, n);
3017
+ return i instanceof Promise ? i.then((a) => (n.value = a, n.fallback = !0, n)) : (n.value = i, n.fallback = !0, n);
3018
+ };
3019
+ });
3020
+ function Ja(e) {
3021
+ return new La({
3022
+ type: "transform",
3023
+ transform: e
3024
+ });
3025
+ }
3026
+ const Tn = /* @__PURE__ */ d("ZodOptional", (e, t) => {
3027
+ _n.init(e, t), R.init(e, t), e._zod.processJSONSchema = (n, r, i) => Sn(e, n, r, i), e.unwrap = () => e._zod.def.innerType;
3028
+ });
3029
+ function Gt(e) {
3030
+ return new Tn({
3031
+ type: "optional",
3032
+ innerType: e
3033
+ });
3034
+ }
3035
+ const Va = /* @__PURE__ */ d("ZodExactOptional", (e, t) => {
3036
+ wi.init(e, t), R.init(e, t), e._zod.processJSONSchema = (n, r, i) => Sn(e, n, r, i), e.unwrap = () => e._zod.def.innerType;
3037
+ });
3038
+ function Ga(e) {
3039
+ return new Va({
3040
+ type: "optional",
3041
+ innerType: e
3042
+ });
3043
+ }
3044
+ const Ba = /* @__PURE__ */ d("ZodNullable", (e, t) => {
3045
+ ki.init(e, t), R.init(e, t), e._zod.processJSONSchema = (n, r, i) => js(e, n, r, i), e.unwrap = () => e._zod.def.innerType;
3046
+ });
3047
+ function Bt(e) {
3048
+ return new Ba({
3049
+ type: "nullable",
3050
+ innerType: e
3051
+ });
3052
+ }
3053
+ const Wa = /* @__PURE__ */ d("ZodDefault", (e, t) => {
3054
+ zi.init(e, t), R.init(e, t), e._zod.processJSONSchema = (n, r, i) => Rs(e, n, r, i), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
3055
+ });
3056
+ function qa(e, t) {
3057
+ return new Wa({
3058
+ type: "default",
3059
+ innerType: e,
3060
+ get defaultValue() {
3061
+ return typeof t == "function" ? t() : nn(t);
3062
+ }
3063
+ });
3064
+ }
3065
+ const Ka = /* @__PURE__ */ d("ZodPrefault", (e, t) => {
3066
+ Si.init(e, t), R.init(e, t), e._zod.processJSONSchema = (n, r, i) => Fs(e, n, r, i), e.unwrap = () => e._zod.def.innerType;
3067
+ });
3068
+ function Ya(e, t) {
3069
+ return new Ka({
3070
+ type: "prefault",
3071
+ innerType: e,
3072
+ get defaultValue() {
3073
+ return typeof t == "function" ? t() : nn(t);
3074
+ }
3075
+ });
3076
+ }
3077
+ const En = /* @__PURE__ */ d("ZodNonOptional", (e, t) => {
3078
+ Ii.init(e, t), R.init(e, t), e._zod.processJSONSchema = (n, r, i) => Ds(e, n, r, i), e.unwrap = () => e._zod.def.innerType;
3079
+ });
3080
+ function Ha(e, t) {
3081
+ return new En({
3082
+ type: "nonoptional",
3083
+ innerType: e,
3084
+ ...v(t)
3085
+ });
3086
+ }
3087
+ const Xa = /* @__PURE__ */ d("ZodCatch", (e, t) => {
3088
+ Zi.init(e, t), R.init(e, t), e._zod.processJSONSchema = (n, r, i) => Us(e, n, r, i), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
3089
+ });
3090
+ function Qa(e, t) {
3091
+ return new Xa({
3092
+ type: "catch",
3093
+ innerType: e,
3094
+ catchValue: typeof t == "function" ? t : () => t
3095
+ });
3096
+ }
3097
+ const ec = /* @__PURE__ */ d("ZodPipe", (e, t) => {
3098
+ Pi.init(e, t), R.init(e, t), e._zod.processJSONSchema = (n, r, i) => Ms(e, n, r, i), e.in = t.in, e.out = t.out;
3099
+ });
3100
+ function Wt(e, t) {
3101
+ return new ec({
3102
+ type: "pipe",
3103
+ in: e,
3104
+ out: t
3105
+ // ...util.normalizeParams(params),
3106
+ });
3107
+ }
3108
+ const tc = /* @__PURE__ */ d("ZodReadonly", (e, t) => {
3109
+ Ti.init(e, t), R.init(e, t), e._zod.processJSONSchema = (n, r, i) => Ls(e, n, r, i), e.unwrap = () => e._zod.def.innerType;
3110
+ });
3111
+ function nc(e) {
3112
+ return new tc({
3113
+ type: "readonly",
3114
+ innerType: e
3115
+ });
3116
+ }
3117
+ const rc = /* @__PURE__ */ d("ZodCustom", (e, t) => {
3118
+ Ei.init(e, t), R.init(e, t), e._zod.processJSONSchema = (n, r, i) => xs(e, n);
3119
+ });
3120
+ function oc(e, t = {}) {
3121
+ return /* @__PURE__ */ bs(rc, e, t);
3122
+ }
3123
+ function ic(e, t) {
3124
+ return /* @__PURE__ */ ws(e, t);
3125
+ }
3126
+ function Le(e) {
3127
+ "@babel/helpers - typeof";
3128
+ return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Le = function(t) {
3129
+ return typeof t;
3130
+ } : Le = function(t) {
3131
+ return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
3132
+ }, Le(e);
3133
+ }
3134
+ var xn = "clover", sc = function(t) {
3135
+ return t === 3 ? "v3" : t;
3136
+ }, On = "https://js.stripe.com", ac = "".concat(On, "/").concat(xn, "/stripe.js"), cc = /^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/, uc = /^https:\/\/js\.stripe\.com\/(v3|[a-z]+)\/stripe\.js(\?.*)?$/;
3137
+ var lc = function(t) {
3138
+ return cc.test(t) || uc.test(t);
3139
+ }, dc = function() {
3140
+ for (var t = document.querySelectorAll('script[src^="'.concat(On, '"]')), n = 0; n < t.length; n++) {
3141
+ var r = t[n];
3142
+ if (lc(r.src))
3143
+ return r;
3144
+ }
3145
+ return null;
3146
+ }, qt = function(t) {
3147
+ var n = "", r = document.createElement("script");
3148
+ r.src = "".concat(ac).concat(n);
3149
+ var i = document.head || document.body;
3150
+ if (!i)
3151
+ throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");
3152
+ return i.appendChild(r), r;
3153
+ }, fc = function(t, n) {
3154
+ !t || !t._registerWrapper || t._registerWrapper({
3155
+ name: "stripe-js",
3156
+ version: "8.8.0",
3157
+ startTime: n
3158
+ });
3159
+ }, Ee = null, Fe = null, Ue = null, pc = function(t) {
3160
+ return function(n) {
3161
+ t(new Error("Failed to load Stripe.js", {
3162
+ cause: n
3163
+ }));
3164
+ };
3165
+ }, hc = function(t, n) {
3166
+ return function() {
3167
+ window.Stripe ? t(window.Stripe) : n(new Error("Stripe.js not available"));
3168
+ };
3169
+ }, mc = function(t) {
3170
+ return Ee !== null ? Ee : (Ee = new Promise(function(n, r) {
3171
+ if (typeof window > "u" || typeof document > "u") {
3172
+ n(null);
3173
+ return;
3174
+ }
3175
+ if (window.Stripe) {
3176
+ n(window.Stripe);
3177
+ return;
3178
+ }
3179
+ try {
3180
+ var i = dc();
3181
+ if (!(i && t)) {
3182
+ if (!i)
3183
+ i = qt(t);
3184
+ else if (i && Ue !== null && Fe !== null) {
3185
+ var a;
3186
+ i.removeEventListener("load", Ue), i.removeEventListener("error", Fe), (a = i.parentNode) === null || a === void 0 || a.removeChild(i), i = qt(t);
3187
+ }
3188
+ }
3189
+ Ue = hc(n, r), Fe = pc(r), i.addEventListener("load", Ue), i.addEventListener("error", Fe);
3190
+ } catch (s) {
3191
+ r(s);
3192
+ return;
3193
+ }
3194
+ }), Ee.catch(function(n) {
3195
+ return Ee = null, Promise.reject(n);
3196
+ }));
3197
+ }, gc = function(t, n, r) {
3198
+ if (t === null)
3199
+ return null;
3200
+ var i = n[0];
3201
+ if (typeof i != "string")
3202
+ throw new Error("Expected publishable key to be of type string, got type ".concat(Le(i), " instead."));
3203
+ var a = i.match(/^pk_test/), s = sc(t.version), c = xn;
3204
+ a && s !== c && console.warn("Stripe.js@".concat(s, " was loaded on the page, but @stripe/stripe-js@").concat("8.8.0", " expected Stripe.js@").concat(c, ". This may result in unexpected behavior. For more information, see https://docs.stripe.com/sdks/stripejs-versioning"));
3205
+ var u = t.apply(void 0, n);
3206
+ return fc(u, r), u;
3207
+ }, xe, $n = !1, Cn = function() {
3208
+ return xe || (xe = mc(null).catch(function(t) {
3209
+ return xe = null, Promise.reject(t);
3210
+ }), xe);
3211
+ };
3212
+ Promise.resolve().then(function() {
3213
+ return Cn();
3214
+ }).catch(function(e) {
3215
+ $n || console.warn(e);
3216
+ });
3217
+ var vc = function() {
3218
+ for (var t = arguments.length, n = new Array(t), r = 0; r < t; r++)
3219
+ n[r] = arguments[r];
3220
+ $n = !0;
3221
+ var i = Date.now();
3222
+ return Cn().then(function(a) {
3223
+ return gc(a, n, i);
3224
+ });
3225
+ };
3226
+ function ze(e) {
3227
+ const t = e?.code || e?.decline_code || "", n = e?.type || "", r = e?.message || "";
3228
+ if (t === "card_declined" || n === "card_error") {
3229
+ const i = e?.decline_code || "";
3230
+ return i === "insufficient_funds" ? {
3231
+ type: "card_declined",
3232
+ title: "Insufficient funds",
3233
+ message: "Your card has insufficient funds to complete this purchase.",
3234
+ suggestion: "Please try a different payment method or contact your bank.",
3235
+ retryable: !0
3236
+ } : i === "lost_card" || i === "stolen_card" ? {
3237
+ type: "card_declined",
3238
+ title: "Card cannot be used",
3239
+ message: "This card cannot be used for this transaction.",
3240
+ suggestion: "Please use a different payment method.",
3241
+ retryable: !0
3242
+ } : i === "expired_card" ? {
3243
+ type: "card_declined",
3244
+ title: "Card expired",
3245
+ message: "Your card has expired.",
3246
+ suggestion: "Please use a different card or update your card details.",
3247
+ retryable: !0
3248
+ } : {
3249
+ type: "card_declined",
3250
+ title: "Card declined",
3251
+ message: "Your card was declined by your bank.",
3252
+ suggestion: "Please try a different card or contact your bank for more information.",
3253
+ retryable: !0
3254
+ };
3255
+ }
3256
+ return n === "api_connection_error" || r.includes("network") || r.includes("connection") ? {
3257
+ type: "network",
3258
+ title: "Connection error",
3259
+ message: "We couldn't connect to the payment server.",
3260
+ suggestion: "Please check your internet connection and try again.",
3261
+ retryable: !0
3262
+ } : t === "rate_limit" ? {
3263
+ type: "rate_limit",
3264
+ title: "Too many attempts",
3265
+ message: "Too many payment attempts. Please wait a moment.",
3266
+ suggestion: "Wait 30 seconds before trying again.",
3267
+ retryable: !0
3268
+ } : t === "incorrect_number" || t === "invalid_number" ? {
3269
+ type: "validation",
3270
+ title: "Invalid card number",
3271
+ message: "The card number you entered is invalid.",
3272
+ suggestion: "Please check your card number and try again.",
3273
+ retryable: !0
3274
+ } : t === "incorrect_cvc" || t === "invalid_cvc" ? {
3275
+ type: "validation",
3276
+ title: "Invalid security code",
3277
+ message: "The security code (CVC) is incorrect.",
3278
+ suggestion: "Please check the 3-digit code on the back of your card.",
3279
+ retryable: !0
3280
+ } : t === "invalid_expiry_month" || t === "invalid_expiry_year" ? {
3281
+ type: "validation",
3282
+ title: "Invalid expiration date",
3283
+ message: "The expiration date is invalid.",
3284
+ suggestion: "Please check your card's expiration date.",
3285
+ retryable: !0
3286
+ } : {
3287
+ type: "general",
3288
+ title: "Payment failed",
3289
+ message: r || "Something went wrong with your payment.",
3290
+ suggestion: "Please try again or use a different payment method.",
3291
+ retryable: !0
3292
+ };
3293
+ }
3294
+ const Oe = Pn().int().nullish().transform((e) => e ?? 0), rt = Pn().int().nullish(), _c = ja({
3295
+ subtotal: Oe,
3296
+ service_fee: Oe,
3297
+ tax: Oe,
3298
+ tax_amount_exclusive: rt,
3299
+ discount: Oe,
3300
+ gift_card_amount: Oe,
3301
+ stripe_amount: rt,
3302
+ amount_total: rt,
3303
+ currency: da().nullish()
3304
+ }).refine((e) => e.stripe_amount != null || e.amount_total != null, {
3305
+ // Issue refs spelled "mf 2383" / "vc 619", never "#619" — a bare #619
3306
+ // parses as a 3-digit hex colour and reds micdrop/no-hex-color.
3307
+ message: "payment intent has no charged amount (stripe_amount / amount_total) — refusing to build $0 totals (mf 2383, vc 619)"
3308
+ });
3309
+ function yc(e) {
3310
+ const t = _c.safeParse(e);
3311
+ if (!t.success) return null;
3312
+ const n = t.data, r = n.stripe_amount ?? n.amount_total, i = we(ke(r));
3313
+ return {
3314
+ subtotal: we(ke(n.subtotal)),
3315
+ fees: we(ke(n.service_fee)),
3316
+ taxes: we(ke(n.tax_amount_exclusive ?? n.tax)),
3317
+ total: i,
3318
+ promoDiscount: we(ke(n.discount)),
3319
+ giftCardAmount: we(ke(n.gift_card_amount)),
3320
+ stripeAmount: i,
3321
+ currency: n.currency ? String(n.currency).toUpperCase() : "USD"
3322
+ };
3323
+ }
3324
+ function bc(e, t) {
3325
+ const n = t.requiresStripe ? t.stripeAmount ?? 0 : 0;
3326
+ return {
3327
+ ...e,
3328
+ giftCardAmount: t.giftCardAmount ?? 0,
3329
+ total: n
3330
+ };
3331
+ }
3332
+ const Kt = Xt("GiftCardInput");
3333
+ var wc = o.from_html('<div class="applied-card mb-2 svelte-emw0hd"><div class="flex items-center gap-3"><div class="applied-icon svelte-emw0hd"><!></div> <div class="flex flex-col flex-1"><span class="type-caption text-status-success-text"> </span> <span class="type-body font-mono text-text-primary"> </span></div> <span class="type-label text-accent-success"> </span> <!></div></div>'), kc = o.from_html("<div><!> <span> </span></div>"), zc = o.from_html('<div class="flex justify-between items-center type-body mt-1.5"><span class="text-text-secondary"> </span> <span class="type-label text-text-primary"> </span></div>'), Sc = o.from_html('<div class="applied-card mb-3 svelte-emw0hd"><div class="flex justify-between items-center type-body"><span class="text-text-secondary"> </span> <span class="type-label text-accent-success"> </span></div> <!></div>'), Ic = o.from_html('<div class="flex items-center gap-1.5 mt-2 type-body text-accent-danger"><!> <span> </span></div>'), Zc = o.from_html('<div class="input-section svelte-emw0hd"><div class="flex gap-2"><input type="text" name="giftCardCode" autocomplete="off" autocapitalize="characters"/> <!></div> <!></div>'), Pc = o.from_html('<div class="mb-4"><!> <!> <button type="button"><!> <span> </span> <span class="toggle-indicator svelte-emw0hd"> </span></button> <!></div>');
3334
+ function Tc(e, t) {
3335
+ o.push(t, !0);
3336
+ let n = o.prop(t, "onApplied", 3, () => {
3337
+ }), r = o.prop(t, "onRemoved", 3, () => {
3338
+ }), i = o.prop(t, "disabled", 3, !1), a = o.prop(t, "labels", 19, () => ({})), s = o.state(""), c = o.state(!1), u = o.state(""), l = o.state(o.proxy([])), m = o.state(!1), g = o.state(0), f = o.derived(() => o.get(l).reduce((k, b) => k + (b.giftCardAmount || 0), 0)), p = o.derived(() => Math.max(0, o.get(g) - o.get(f))), w = o.derived(() => o.get(l).length > 0 && o.get(p) <= 0);
3339
+ function H() {
3340
+ if (o.get(l).length === 0) {
3341
+ r()();
3342
+ return;
3343
+ }
3344
+ n()({
3345
+ code: o.get(l).map((k) => k.code).join(", "),
3346
+ giftCardAmount: o.get(f),
3347
+ stripeAmount: o.get(p),
3348
+ requiresStripe: o.get(p) > 0,
3349
+ paymentType: o.get(p) > 0 ? "split" : "gift_card_only",
3350
+ orderTotal: o.get(g)
3351
+ });
3352
+ }
3353
+ async function Z() {
3354
+ const k = o.get(s).trim().toUpperCase();
3355
+ if (!(!k || o.get(c) || !t.cartId)) {
3356
+ if (o.get(l).some((b) => b.code === k)) {
3357
+ o.set(u, a().giftCardAlreadyApplied || "That gift card is already applied", !0);
3358
+ return;
3359
+ }
3360
+ o.set(c, !0), o.set(u, "");
3361
+ try {
3362
+ const b = await Jn(t.cartId, k);
3363
+ b.valid ? (o.set(
3364
+ l,
3365
+ [
3366
+ ...o.get(l),
3367
+ {
3368
+ code: b.giftCardCode || k,
3369
+ giftCardAmount: b.giftCardAmount || 0
3370
+ }
3371
+ ],
3372
+ !0
3373
+ ), o.set(g, o.get(f) + (b.stripeAmount || 0)), o.set(s, ""), o.set(m, !1), H()) : o.set(u, b.error || a().invalidGiftCardCode || "Invalid gift card code", !0);
3374
+ } catch (b) {
3375
+ Kt.error("Error applying gift card:", b), o.set(u, a().failedToApplyGiftCard || "Failed to apply gift card. Please try again", !0);
3376
+ }
3377
+ o.set(c, !1);
3378
+ }
3379
+ }
3380
+ async function K(k) {
3381
+ if (!(o.get(c) || !t.cartId)) {
3382
+ o.set(c, !0), o.set(u, "");
3383
+ try {
3384
+ const b = await Ln(t.cartId, k);
3385
+ b.success !== !1 && !b.error ? (o.set(l, o.get(l).filter((M) => M.code !== k), !0), H()) : o.set(u, b.error || a().failedToRemoveGiftCard || "Failed to remove gift card. Please try again", !0);
3386
+ } catch (b) {
3387
+ Kt.error("Error removing gift card:", b), o.set(u, a().failedToRemoveGiftCard || "Failed to remove gift card. Please try again", !0);
3388
+ }
3389
+ o.set(c, !1);
3390
+ }
3391
+ }
3392
+ function ue(k) {
3393
+ k.key === "Enter" && !o.get(c) && Z();
3394
+ }
3395
+ function T() {
3396
+ o.set(m, !o.get(m)), o.get(m) || (o.set(s, ""), o.set(u, ""));
3397
+ }
3398
+ var I = Pc(), S = o.child(I);
3399
+ o.each(S, 17, () => o.get(l), (k) => k.code, (k, b) => {
3400
+ var M = wc(), F = o.child(M), W = o.child(F), re = o.child(W);
3401
+ zt(re, { size: "16" }), o.reset(W);
3402
+ var ae = o.sibling(W, 2), ce = o.child(ae), X = o.child(ce, !0);
3403
+ o.reset(ce);
3404
+ var Q = o.sibling(ce, 2), V = o.child(Q, !0);
3405
+ o.reset(Q), o.reset(ae);
3406
+ var j = o.sibling(ae, 2), te = o.child(j);
3407
+ o.reset(j);
3408
+ var fe = o.sibling(j, 2);
3409
+ {
3410
+ let se = o.derived(() => a().removeGiftCard || "Remove gift card");
3411
+ ot(fe, {
3412
+ variant: "icon",
3413
+ size: "icon-sm",
3414
+ class: "rounded-full hover:bg-status-error-bg hover:text-accent-danger",
3415
+ onclick: () => K(o.get(b).code),
3416
+ get loading() {
3417
+ return o.get(c);
3418
+ },
3419
+ get disabled() {
3420
+ return i();
3421
+ },
3422
+ get "aria-label"() {
3423
+ return o.get(se);
3424
+ },
3425
+ children: (Pe, Te) => {
3426
+ kr(Pe, { size: "16" });
3427
+ },
3428
+ $$slots: { default: !0 }
3429
+ });
3430
+ }
3431
+ o.reset(F), o.reset(M), o.template_effect(
3432
+ (se) => {
3433
+ o.set_text(X, a().giftCardApplied || "Gift card applied"), o.set_text(V, o.get(b).code), o.set_text(te, `-${se ?? ""}`);
3434
+ },
3435
+ [() => He(o.get(b).giftCardAmount)]
3436
+ ), o.transition(3, M, () => Xe, () => ({ duration: Qe.fast })), o.append(k, M);
3437
+ });
3438
+ var J = o.sibling(S, 2);
3439
+ {
3440
+ var B = (k) => {
3441
+ var b = Sc(), M = o.child(b), F = o.child(M), W = o.child(F, !0);
3442
+ o.reset(F);
3443
+ var re = o.sibling(F, 2), ae = o.child(re);
3444
+ o.reset(re), o.reset(M);
3445
+ var ce = o.sibling(M, 2);
3446
+ {
3447
+ var X = (V) => {
3448
+ var j = kc(), te = o.child(j);
3449
+ zt(te, { size: "16" });
3450
+ var fe = o.sibling(te, 2), se = o.child(fe, !0);
3451
+ o.reset(fe), o.reset(j), o.template_effect(() => {
3452
+ o.set_class(j, 1, `full-coverage-badge ${Me.caption} ${Vn.emphasis}`, "svelte-emw0hd"), o.set_text(se, a().fullyCoveredByGiftCard || "Fully covered by gift card");
3453
+ }), o.append(V, j);
3454
+ }, Q = (V) => {
3455
+ var j = zc(), te = o.child(j), fe = o.child(te, !0);
3456
+ o.reset(te);
3457
+ var se = o.sibling(te, 2), Pe = o.child(se, !0);
3458
+ o.reset(se), o.reset(j), o.template_effect(
3459
+ (Te) => {
3460
+ o.set_text(fe, a().remainingToPay || "Remaining to pay"), o.set_text(Pe, Te);
3461
+ },
3462
+ [() => He(o.get(p))]
3463
+ ), o.append(V, j);
3464
+ };
3465
+ o.if(ce, (V) => {
3466
+ o.get(w) ? V(X) : V(Q, -1);
3467
+ });
3468
+ }
3469
+ o.reset(b), o.template_effect(
3470
+ (V) => {
3471
+ o.set_text(W, a().appliedToOrder || "Applied to order"), o.set_text(ae, `-${V ?? ""}`);
3472
+ },
3473
+ [() => He(o.get(f))]
3474
+ ), o.append(k, b);
3475
+ };
3476
+ o.if(J, (k) => {
3477
+ o.get(l).length > 0 && k(B);
3478
+ });
3479
+ }
3480
+ var U = o.sibling(J, 2), x = o.child(U);
3481
+ Zr(x, { size: "20", class: "gift-icon" });
3482
+ var ee = o.sibling(x, 2), _e = o.child(ee, !0);
3483
+ o.reset(ee);
3484
+ var le = o.sibling(ee, 2), de = o.child(le, !0);
3485
+ o.reset(le), o.reset(U);
3486
+ var ie = o.sibling(U, 2);
3487
+ {
3488
+ var ye = (k) => {
3489
+ var b = Zc(), M = o.child(b), F = o.child(M);
3490
+ o.remove_input_defaults(F);
3491
+ let W;
3492
+ var re = o.sibling(F, 2);
3493
+ {
3494
+ let X = o.derived(() => !o.get(s).trim() || i());
3495
+ ot(re, {
3496
+ variant: "default",
3497
+ size: "sm",
3498
+ class: "min-w-16 shrink-0",
3499
+ onclick: Z,
3500
+ get loading() {
3501
+ return o.get(c);
3502
+ },
3503
+ get disabled() {
3504
+ return o.get(X);
3505
+ },
3506
+ children: (Q, V) => {
3507
+ o.next();
3508
+ var j = o.text();
3509
+ o.template_effect(() => o.set_text(j, a().apply || "Apply")), o.append(Q, j);
3510
+ },
3511
+ $$slots: { default: !0 }
3512
+ });
3513
+ }
3514
+ o.reset(M);
3515
+ var ae = o.sibling(M, 2);
3516
+ {
3517
+ var ce = (X) => {
3518
+ var Q = Ic(), V = o.child(Q);
3519
+ Gn(V, { size: "16" });
3520
+ var j = o.sibling(V, 2), te = o.child(j, !0);
3521
+ o.reset(j), o.reset(Q), o.template_effect(() => o.set_text(te, o.get(u))), o.transition(3, Q, () => Xe, () => ({ duration: Qe.micro })), o.append(X, Q);
3522
+ };
3523
+ o.if(ae, (X) => {
3524
+ o.get(u) && X(ce);
3525
+ });
3526
+ }
3527
+ o.reset(b), o.template_effect(() => {
3528
+ o.set_attribute(F, "aria-label", a().enterGiftCardCode || "Enter gift card code"), o.set_attribute(F, "placeholder", a().enterGiftCardCode || "Enter gift card code"), F.disabled = o.get(c) || i(), W = o.set_class(F, 1, `gift-input ${Me.body}`, "svelte-emw0hd", W, { "has-error": !!o.get(u) });
3529
+ }), o.delegated("keydown", F, ue), o.bind_value(F, () => o.get(s), (X) => o.set(s, X)), o.transition(3, b, () => Xe, () => ({ duration: Qe.fast })), o.append(k, b);
3530
+ };
3531
+ o.if(ie, (k) => {
3532
+ o.get(m) && k(ye);
3533
+ });
3534
+ }
3535
+ o.reset(I), o.template_effect(() => {
3536
+ o.set_class(U, 1, `gift-card-toggle ${Me.label}`, "svelte-emw0hd"), U.disabled = i(), o.set_attribute(U, "aria-expanded", o.get(m)), o.set_text(_e, o.get(l).length > 0 ? a().addAnotherGiftCard || "Add another gift card" : a().haveAGiftCard || "Have a gift card?"), o.set_text(de, o.get(m) ? "-" : "+");
3537
+ }), o.delegated("click", U, T), o.append(e, I), o.pop();
3538
+ }
3539
+ o.delegate(["click", "keydown"]);
3540
+ var Ec = o.from_html('<div class="flex flex-col items-center text-center pt-6 px-4 pb-4"><div aria-hidden="true"><!></div> <h3 id="event-unavailable-title"> </h3> <p id="event-unavailable-body" class="type-body tone-secondary max-w-72"> </p></div>'), Yt = o.from_html("<!> <!>", 1);
3541
+ function xc(e, t) {
3542
+ o.push(t, !0);
3543
+ let n = o.prop(t, "open", 15, !1), r = o.prop(t, "onBackToEvents", 3, () => {
3544
+ }), i = o.prop(t, "labels", 19, () => ({})), a = o.derived(() => t.reason === "canceled"), s = o.derived(() => o.get(a) ? i().eventCanceledTitle || "Event cancelled" : i().eventPostponedTitle || "Event postponed"), c = o.derived(() => o.get(a) ? i().eventCanceledBody || "This event was cancelled — you weren't charged" : i().eventPostponedBody || "Sales are paused while this show is rescheduled — you weren't charged"), u = o.derived(() => i().backToEvents || "Back to events");
3545
+ Bn(e, {
3546
+ size: "sm",
3547
+ role: "alertdialog",
3548
+ class: "micdrop",
3549
+ get open() {
3550
+ return n();
3551
+ },
3552
+ set open(l) {
3553
+ n(l);
3554
+ },
3555
+ children: (l, m) => {
3556
+ var g = Yt(), f = o.first_child(g);
3557
+ Wn(f, {});
3558
+ var p = o.sibling(f, 2);
3559
+ qn(p, {
3560
+ children: (w, H) => {
3561
+ var Z = Yt(), K = o.first_child(Z);
3562
+ Kn(K, {
3563
+ children: (T, I) => {
3564
+ var S = Ec(), J = o.child(S), B = o.child(J);
3565
+ {
3566
+ var U = (ie) => {
3567
+ Yn(ie, { size: "32" });
3568
+ }, x = (ie) => {
3569
+ mr(ie, { size: "32" });
3570
+ };
3571
+ o.if(B, (ie) => {
3572
+ o.get(a) ? ie(U) : ie(x, -1);
3573
+ });
3574
+ }
3575
+ o.reset(J);
3576
+ var ee = o.sibling(J, 2), _e = o.child(ee, !0);
3577
+ o.reset(ee);
3578
+ var le = o.sibling(ee, 2), de = o.child(le, !0);
3579
+ o.reset(le), o.reset(S), o.template_effect(() => {
3580
+ o.set_class(J, 1, `w-16 h-16 rounded-full flex items-center justify-center mb-4 ${o.get(a) ? "bg-accent-danger/10 text-accent-danger" : "bg-accent-warning/10 text-accent-warning"}`), o.set_class(ee, 1, `mb-2 ${Me.heading}`), o.set_text(_e, o.get(s)), o.set_text(de, o.get(c));
3581
+ }), o.append(T, S);
3582
+ },
3583
+ $$slots: { default: !0 }
3584
+ });
3585
+ var ue = o.sibling(K, 2);
3586
+ Hn(ue, {
3587
+ children: (T, I) => {
3588
+ ot(T, {
3589
+ size: "full",
3590
+ variant: "default",
3591
+ get onclick() {
3592
+ return r();
3593
+ },
3594
+ get "aria-label"() {
3595
+ return o.get(u);
3596
+ },
3597
+ children: (S, J) => {
3598
+ o.next();
3599
+ var B = o.text();
3600
+ o.template_effect(() => o.set_text(B, o.get(u))), o.append(S, B);
3601
+ },
3602
+ $$slots: { default: !0 }
3603
+ });
3604
+ },
3605
+ $$slots: { default: !0 }
3606
+ }), o.append(w, Z);
3607
+ },
3608
+ $$slots: { default: !0 }
3609
+ }), o.append(l, g);
3610
+ },
3611
+ $$slots: { default: !0 }
3612
+ }), o.pop();
3613
+ }
3614
+ const oe = Xt("Checkout");
3615
+ var Oc = o.from_html('<div class="max-w-6xl mx-auto px-4 md:px-6 -mt-4 mb-8"><!></div>'), Ht = o.from_html("<!> <!>", 1), $c = o.from_html('<div class="p-8 text-center"><p class="text-accent-danger"> </p></div>'), Cc = o.from_html('<div class="p-8 text-center"><p class="tone-muted"> </p></div>');
3616
+ function Mc(e, t) {
3617
+ o.push(t, !0);
3618
+ let n = o.prop(t, "availableTickets", 23, () => []);
3619
+ o.prop(t, "value", 3, "");
3620
+ let r = o.prop(t, "venueId", 3, ""), i = o.prop(t, "organizationId", 3, ""), a = o.prop(t, "onNavigateBack", 3, void 0), s = o.prop(t, "initialError", 3, void 0), c = o.prop(t, "widgetId", 3, null), u = o.prop(t, "labels", 19, () => ({})), l = o.derived(() => (t.data || {}).id);
3621
+ o.derived(() => (t.data || {}).orgSlug);
3622
+ let m = o.derived(() => (t.data || {}).slug), g = o.derived(() => (t.data || {}).event), f = o.derived(() => o.get(g) ? Xn(o.get(g)) : t.data && (t.data.id || o.get(l)) ? {
3623
+ id: t.data.id || o.get(l),
3624
+ eventID: t.data.id || o.get(l),
3625
+ venueID: t.data.venueID ?? t.data.venueId ?? null,
3626
+ venueId: t.data.venueId ?? t.data.venueID ?? null,
3627
+ eventTicketingType: 0,
3628
+ ticketType: 0,
3629
+ availableTickets: []
3630
+ } : null), p = o.state(""), w = o.state(o.proxy({})), H = o.state(o.proxy({})), Z = o.state(o.proxy([])), K = o.state(""), ue = o.state(0), T = o.state(!1), I = o.state(!1), S = o.state(!1), J = o.state(null), B = o.state(""), U = o.state(void 0), x = o.state(""), ee = o.state(""), _e = o.state(!1), le = o.state(""), de = o.state(null), ie = o.derived(() => o.get(de) !== null), ye = o.state(null), k = o.state(null), b = null, M = o.state(!1);
3631
+ function F() {
3632
+ return {
3633
+ value: b?.total ?? null,
3634
+ currency: b?.currency || "USD"
3635
+ };
3636
+ }
3637
+ ar(async () => {
3638
+ if (o.set(p, kt(fr.CHECKOUT_CARTID), !0), !o.get(p)) {
3639
+ o.set(_e, !0), o.set(le, u().noCheckoutSession || "No checkout session found. Please select tickets first", !0);
3640
+ return;
3641
+ }
3642
+ Qn(o.get(f)?.eventID || o.get(f)?.id || o.get(l), c(), r() || o.get(f)?.venueID || o.get(f)?.venueId || null);
3643
+ const h = o.get(f)?.eventID || o.get(f)?.id || o.get(l);
3644
+ try {
3645
+ const z = cr(h);
3646
+ o.set(w, z.quantities || {}, !0), o.set(H, z.donationAmounts || {}, !0), o.set(K, z.promocode || "", !0), o.set(ue, z.promoDiscountAmount || 0, !0), o.set(Z, z.tickets || [], !0);
3647
+ } catch (z) {
3648
+ oe.error("Error loading checkout state:", z), o.set(w, {}, !0), o.set(Z, [], !0);
3649
+ }
3650
+ o.get(Z).length > 0 && o.get(f) && (o.get(f).availableTickets = o.get(Z), n(o.get(Z)));
3651
+ let y = {
3652
+ serviceFeeCents: 0,
3653
+ serviceFeePercentage: 0,
3654
+ serviceFeeChargeType: "both",
3655
+ maxServiceFeeCents: 0,
3656
+ taxPercentage: 0
3657
+ };
3658
+ try {
3659
+ const z = (
3660
+ /** @type {any} */
3661
+ await ur(o.get(f)?.venueID || o.get(f)?.venueId || r())
3662
+ );
3663
+ y = {
3664
+ // Legit-zero venue fee config (mf#2234's ruled-separate class): a venue
3665
+ // with no flat service fee / cap is a real 0. Null-check keeps the 0
3666
+ // default without a `?? 0` money-field flag.
3667
+ serviceFeeCents: Number(z?.serviceFeeCents == null ? 0 : z.serviceFeeCents),
3668
+ serviceFeePercentage: Number(z?.serviceFeePercentage ?? 0),
3669
+ serviceFeeChargeType: String(z?.serviceFeeChargeType ?? "both"),
3670
+ maxServiceFeeCents: Number(z?.maxServiceFeeCents == null ? 0 : z.maxServiceFeeCents),
3671
+ taxPercentage: Number(z?.taxPercentage ?? 0)
3672
+ };
3673
+ } catch (z) {
3674
+ oe.error("Error fetching venue data:", z);
3675
+ }
3676
+ const _ = ce(o.get(w), o.get(Z), y);
3677
+ Object.keys(o.get(w)).length > 0 && await re();
3678
+ let E = 900;
3679
+ if (o.get(p)) {
3680
+ const z = typeof localStorage < "u" ? localStorage.getItem(`checkout-expiry-${o.get(
3681
+ p
3682
+ // @storage-escape: checkout-timer state (intentional raw localStorage)
3683
+ )}`) : null;
3684
+ if (z) {
3685
+ const L = Math.max(0, Math.floor((parseInt(z, 10) - Date.now()) / 1e3));
3686
+ L > 0 && (E = L);
3687
+ }
3688
+ try {
3689
+ const L = await er(o.get(p));
3690
+ if (!L.error && L.expiresAt) {
3691
+ const be = tr(L.expiresAt).getTime();
3692
+ E = Math.max(0, Math.floor((be - Date.now()) / 1e3)), localStorage.setItem(
3693
+ // @storage-escape: checkout-timer state (intentional raw localStorage)
3694
+ `checkout-expiry-${o.get(p)}`,
3695
+ String(be)
3696
+ // persist hold-expiry epoch (ms) — wall-clock timer
3697
+ );
3698
+ }
3699
+ } catch {
3700
+ }
3701
+ }
3702
+ const O = kt(
3703
+ /** @type {any} */
3704
+ `checkout-promo-discount-type-${h}`
3705
+ ) || "", $ = et(
3706
+ // A missing-price line contributes 0 to the promo base; the order is
3707
+ // unpriced and hard-blocks anyway (mf#2383 / vc#619).
3708
+ _.reduce((z, L) => z + (L.subtotal == null ? 0 : L.subtotal), 0)
3709
+ ), N = lr($, o.get(ue), O);
3710
+ if (o.set(
3711
+ k,
3712
+ {
3713
+ event: ae(o.get(f), y),
3714
+ lines: _,
3715
+ timerStart: E,
3716
+ promoApplied: !!o.get(K),
3717
+ promoDiscount: N,
3718
+ forceExpired: !1,
3719
+ ...b ? { serverTotals: b } : {}
3720
+ },
3721
+ !0
3722
+ ), s()) {
3723
+ const z = ze(typeof s() == "object" ? s() : {
3724
+ code: "card_declined",
3725
+ message: "Your card was declined. Please try a different payment method."
3726
+ });
3727
+ o.set(x, z.message, !0);
3728
+ }
3729
+ });
3730
+ let W = 0;
3731
+ async function re() {
3732
+ const h = ++W;
3733
+ if (!o.get(p)) {
3734
+ oe.error("Missing cartId!");
3735
+ return;
3736
+ }
3737
+ const y = Object.fromEntries(Object.entries(o.get(w)).filter(([_, E]) => E > 0));
3738
+ try {
3739
+ const _ = Object.fromEntries(Object.entries(o.get(H)).filter(([, z]) => parseFloat(String(z)) > 0).map(([z, L]) => [parseInt(z, 10), parseFloat(String(L))]));
3740
+ if (o.get(K)) {
3741
+ const z = await nr(o.get(p), o.get(K));
3742
+ if (h !== W) return;
3743
+ z.success ? o.set(ee, "") : (oe.error("Failed to apply promo code to cart:", z.error), o.set(ee, (u().promoCodeNotApplied || "We couldn't apply promo code {code}. It isn't included in this total — go back to re-enter it, or continue at the full price").replace("{code}", o.get(K)), !0));
3744
+ }
3745
+ const E = await rr(o.get(p), y, Object.keys(_).length > 0 ? _ : void 0);
3746
+ if (h !== W) return;
3747
+ if (!E) {
3748
+ o.set(x, u().failedToCreatePaymentIntent || "Failed to create payment intent. Please try again", !0);
3749
+ return;
3750
+ }
3751
+ o.set(M, !1), b = yc(E), o.get(k) && o.set(
3752
+ k,
3753
+ {
3754
+ ...o.get(k),
3755
+ serverTotals: b
3756
+ },
3757
+ !0
3758
+ );
3759
+ const O = (
3760
+ /** @type {any} */
3761
+ E
3762
+ );
3763
+ if (O.requires_stripe === !1 || O.payment_type === "free") {
3764
+ o.set(B, "free");
3765
+ return;
3766
+ }
3767
+ o.set(M, b === null);
3768
+ const $ = E.stripe_publishable_key;
3769
+ if (!$) {
3770
+ oe.error("No Stripe publishable key in payment intent response"), o.set(x, u().paymentConfigError || "Payment configuration error. Please try again", !0);
3771
+ return;
3772
+ }
3773
+ const N = await vc($);
3774
+ if (h !== W) return;
3775
+ o.set(J, N, !0), E.client_secret ? o.set(B, E.client_secret, !0) : o.set(x, u().failedToInitPayment || "Failed to initialize payment. Please try again", !0);
3776
+ } catch (_) {
3777
+ if (oe.error("Failed to initialize Stripe payment:", _), h !== W) return;
3778
+ o.set(x, _.message || u().failedToInitPayment || "Failed to initialize payment. Please try again", !0);
3779
+ }
3780
+ }
3781
+ function ae(h, y) {
3782
+ return h ? {
3783
+ id: h.id || h.eventID,
3784
+ title: h.name || h.title || "",
3785
+ slug: h.slug || o.get(m) || "",
3786
+ description: h.description || "",
3787
+ date: h.date || "",
3788
+ startDateTime: h.startDateTime || "",
3789
+ endDateTime: h.endDateTime || "",
3790
+ doorsOpenTime: h.doorsOpenTime || "",
3791
+ timezone: h.timeZone || h.timezone || wt(),
3792
+ imageUrl: h.imageUrl || h.image || "",
3793
+ venue: {
3794
+ id: h.venueID || h.venueId || 0,
3795
+ name: h.venueName || "",
3796
+ address: h.venueAddress || "",
3797
+ timezone: h.timeZone || h.timezone || wt(),
3798
+ serviceFeePercentage: y.serviceFeePercentage,
3799
+ serviceFeeCents: y.serviceFeeCents,
3800
+ taxPercentage: y.taxPercentage,
3801
+ serviceFeeChargeType: y.serviceFeeChargeType,
3802
+ maxServiceFeeCents: y.maxServiceFeeCents
3803
+ },
3804
+ performers: h.performers || [],
3805
+ tickets: (h.availableTickets || []).map((_) => ({
3806
+ id: _.ID || _.id,
3807
+ name: _.name || "",
3808
+ description: _.description || "",
3809
+ // ticket.price is DOLLARS here, same source buildOrderLines and CartView
3810
+ // read (CartView: Math.round(ticket.price * 100)). No /100 — that made
3811
+ // event.tickets[].price 100x too small for any consumer that reads it.
3812
+ // A missing OR malformed wire price stays null → renders an em-dash and
3813
+ // hard-blocks, never a coerced $0/"Free" or a NaN (mf#2383 / vc#619).
3814
+ price: pr(_.price),
3815
+ fee: 0,
3816
+ quantityAvailable: _.quantityAvailable || 0,
3817
+ quantityTotal: _.quantityTotal || 0,
3818
+ minPerOrder: _.minPerOrder || 1,
3819
+ maxPerOrder: _.maxPerOrder || 10,
3820
+ status: "on_sale",
3821
+ isDonation: _.type === 2,
3822
+ isHidden: !1
3823
+ })),
3824
+ faqs: h.faqs || [],
3825
+ status: "on_sale",
3826
+ isPasswordProtected: !1,
3827
+ isRegistrationEvent: h.eventTicketingType === 1 || h.ticketType === 1,
3828
+ totalTicketsRemaining: 100,
3829
+ totalTicketsCapacity: 100
3830
+ } : null;
3831
+ }
3832
+ function ce(h, y, _) {
3833
+ const E = [];
3834
+ for (const [O, $] of Object.entries(h)) {
3835
+ if ($ <= 0) continue;
3836
+ const N = y.find((bt) => String(bt.ID) === O || String(bt.id) === O);
3837
+ if (!N) continue;
3838
+ const z = N.type === 2, L = N.price;
3839
+ if (!z && (L == null || !Number.isFinite(L))) {
3840
+ E.push({
3841
+ ticketId: parseInt(O),
3842
+ ticketName: N.name || "",
3843
+ quantity: $,
3844
+ unitPrice: null,
3845
+ fee: 0,
3846
+ subtotal: null,
3847
+ isDonation: !1
3848
+ });
3849
+ continue;
3850
+ }
3851
+ const be = L ?? 0, yt = X(be, _);
3852
+ E.push({
3853
+ ticketId: parseInt(O),
3854
+ ticketName: N.name || "",
3855
+ quantity: $,
3856
+ unitPrice: be,
3857
+ fee: yt,
3858
+ subtotal: et(be * $),
3859
+ isDonation: z
3860
+ });
3861
+ }
3862
+ return E;
3863
+ }
3864
+ function X(h, y) {
3865
+ if (h === 0) return 0;
3866
+ const {
3867
+ serviceFeePercentage: _ = 0,
3868
+ serviceFeeCents: E = 0,
3869
+ serviceFeeChargeType: O = "both",
3870
+ maxServiceFeeCents: $ = 0
3871
+ } = y;
3872
+ let N = 0;
3873
+ return (O === "percentage" || O === "both") && (N += h * (_ / 100)), (O === "fixed" || O === "flat" || O === "cents" || O === "both") && (N += E / 100), $ > 0 && (N = Math.min(N, $ / 100)), et(N);
3874
+ }
3875
+ let Q = o.derived(() => Object.values(o.get(H)).some((h) => (Number(h) || 0) > 0)), V = o.derived(() => !o.get(Q) && (o.get(k) ? o.get(k).lines.every((h) => h.unitPrice === 0) : !0));
3876
+ async function j(h) {
3877
+ if (!o.get(T)) {
3878
+ o.set(T, !0), o.set(x, "");
3879
+ try {
3880
+ if (o.get(S)) {
3881
+ o.set(x, u().paymentReinitializing || "Updating your total. Please wait a moment and try again", !0);
3882
+ return;
3883
+ }
3884
+ if (o.get(ye) && !o.get(ye).requiresStripe) {
3885
+ await te(h);
3886
+ return;
3887
+ }
3888
+ if (o.get(V)) {
3889
+ await fe(h);
3890
+ return;
3891
+ }
3892
+ if (!o.get(U)) {
3893
+ o.set(x, u().paymentFormNotReady || "Payment form is not ready. Please wait a moment and try again", !0), o.set(T, !1);
3894
+ return;
3895
+ }
3896
+ if (!o.get(J)) {
3897
+ o.set(x, u().paymentSystemNotInitialized || "Payment system is not initialized. Please refresh the page", !0), o.set(T, !1);
3898
+ return;
3899
+ }
3900
+ const { error: y } = await o.get(U).submit();
3901
+ if (y) {
3902
+ const $ = ze(y);
3903
+ o.set(x, $.message, !0), o.set(T, !1);
3904
+ return;
3905
+ }
3906
+ const _ = await o.get(J).confirmPayment({ elements: o.get(U), redirect: "if_required" });
3907
+ if (_.error) {
3908
+ const $ = ze(_.error);
3909
+ o.set(x, $.message, !0), o.set(T, !1);
3910
+ return;
3911
+ }
3912
+ const E = {
3913
+ id: o.get(p),
3914
+ paymentIntentId: _.paymentIntent.id,
3915
+ tickets: o.get(w),
3916
+ firstName: h.firstName,
3917
+ lastName: h.lastName,
3918
+ email: h.email,
3919
+ paymentMethod: "credit-card",
3920
+ mailingList: h.keepMeUpdated,
3921
+ saleType: "online"
3922
+ }, O = await ir(o.get(p), E);
3923
+ if (O?.eventCanceled || O?.eventPostponed) {
3924
+ o.set(de, O.eventCanceled ? "canceled" : "postponed", !0), o.set(x, "");
3925
+ return;
3926
+ }
3927
+ if (O?.status === "Payment succeeded") {
3928
+ const $ = {
3929
+ orderId: o.get(p),
3930
+ eventId: o.get(f)?.id || o.get(f)?.eventID || null,
3931
+ event: o.get(f) || null,
3932
+ venueId: r() || o.get(f)?.venueId || null,
3933
+ organizationId: i() || o.get(f)?.organizationId || null,
3934
+ ...F()
3935
+ };
3936
+ t.onNavigateToSuccess && t.onNavigateToSuccess($);
3937
+ } else O?.status === "Payment amount does not match the total price" ? o.set(x, u().paymentAmountMismatch || "Payment amount mismatch. Please refresh and try again", !0) : o.set(x, u().paymentValidationFailed || "Payment validation failed. Please try again", !0);
3938
+ } catch (y) {
3939
+ oe.error("Payment execution error:", y);
3940
+ const _ = ze(y);
3941
+ o.set(x, _.message, !0);
3942
+ } finally {
3943
+ o.set(T, !1);
3944
+ }
3945
+ }
3946
+ }
3947
+ async function te(h) {
3948
+ try {
3949
+ const y = await sr(o.get(p), {
3950
+ firstName: h.firstName,
3951
+ lastName: h.lastName,
3952
+ email: h.email,
3953
+ phoneNumber: null,
3954
+ mailingList: h.keepMeUpdated
3955
+ });
3956
+ if (y?.success) {
3957
+ const _ = {
3958
+ orderId: y.orderId || o.get(p),
3959
+ eventId: o.get(f)?.id || o.get(f)?.eventID || null,
3960
+ event: o.get(f) || null,
3961
+ venueId: r() || o.get(f)?.venueId || null,
3962
+ organizationId: i() || o.get(f)?.organizationId || null,
3963
+ paymentType: "gift_card_only",
3964
+ ...F()
3965
+ };
3966
+ t.onNavigateToSuccess && t.onNavigateToSuccess(_);
3967
+ } else
3968
+ o.set(x, y?.error || u().failedToCompleteOrder || "Failed to complete order. Please try again", !0);
3969
+ } catch (y) {
3970
+ oe.error("Gift card payment error:", y);
3971
+ const _ = ze(y);
3972
+ o.set(x, _.message, !0);
3973
+ } finally {
3974
+ o.set(T, !1);
3975
+ }
3976
+ }
3977
+ async function fe(h) {
3978
+ try {
3979
+ if (o.get(B) !== "free" && await re(), o.get(B) !== "free") {
3980
+ o.set(x, u().failedToCompleteOrder || "Failed to complete order. Please try again", !0);
3981
+ return;
3982
+ }
3983
+ const y = {
3984
+ orderId: o.get(p),
3985
+ eventId: o.get(f)?.id || o.get(f)?.eventID || null,
3986
+ event: o.get(f) || null,
3987
+ venueId: r() || o.get(f)?.venueId || null,
3988
+ organizationId: i() || o.get(f)?.organizationId || null,
3989
+ paymentType: "free",
3990
+ ...F()
3991
+ };
3992
+ t.onNavigateToSuccess && t.onNavigateToSuccess(y);
3993
+ } catch (y) {
3994
+ oe.error("Free order completion error:", y);
3995
+ const _ = ze(y);
3996
+ o.set(x, _.message, !0);
3997
+ } finally {
3998
+ o.set(T, !1);
3999
+ }
4000
+ }
4001
+ async function se(h) {
4002
+ if (o.set(ye, h, !0), o.get(k) && b && o.set(
4003
+ k,
4004
+ {
4005
+ ...o.get(k),
4006
+ serverTotals: bc(b, h)
4007
+ },
4008
+ !0
4009
+ ), !h.requiresStripe)
4010
+ W++, o.set(U, void 0), o.set(J, null), o.set(B, "");
4011
+ else if (o.get(p) && Object.keys(o.get(w)).length > 0) {
4012
+ o.set(S, !0);
4013
+ try {
4014
+ await re();
4015
+ } finally {
4016
+ o.set(S, !1);
4017
+ }
4018
+ }
4019
+ }
4020
+ async function Pe() {
4021
+ if (o.set(ye, null), o.get(k) && b && o.set(
4022
+ k,
4023
+ {
4024
+ ...o.get(k),
4025
+ serverTotals: b
4026
+ },
4027
+ !0
4028
+ ), o.get(p) && Object.keys(o.get(w)).length > 0) {
4029
+ o.set(S, !0);
4030
+ try {
4031
+ await re();
4032
+ } finally {
4033
+ o.set(S, !1);
4034
+ }
4035
+ }
4036
+ }
4037
+ function Te() {
4038
+ a() ? a()() : window.history.back();
4039
+ }
4040
+ function Nn() {
4041
+ a() ? a()() : window.history.back();
4042
+ }
4043
+ function An() {
4044
+ o.set(de, null), Te();
4045
+ }
4046
+ async function jn() {
4047
+ if (!o.get(p)) return null;
4048
+ try {
4049
+ const h = await or(o.get(p));
4050
+ return h.success ? {
4051
+ newExpiryTime: h.newExpiryTime,
4052
+ remainingExtensions: h.remainingExtensions
4053
+ } : (oe.error("Failed to extend session:", h.error), null);
4054
+ } catch (h) {
4055
+ return oe.error("Error extending checkout session:", h), null;
4056
+ }
4057
+ }
4058
+ var vt = Ht(), _t = o.first_child(vt);
4059
+ {
4060
+ var Dn = (h) => {
4061
+ var y = Ht(), _ = o.first_child(y);
4062
+ {
4063
+ let $ = o.derived(() => o.get(x) || o.get(ee));
4064
+ dr(_, {
4065
+ get config() {
4066
+ return o.get(k);
4067
+ },
4068
+ onPlaceOrder: j,
4069
+ onBack: Te,
4070
+ onRetryExpired: Nn,
4071
+ onExtendSession: jn,
4072
+ get stripe() {
4073
+ return o.get(J);
4074
+ },
4075
+ get paymentIntent() {
4076
+ return o.get(B);
4077
+ },
4078
+ get serverTotalsUnavailable() {
4079
+ return o.get(M);
4080
+ },
4081
+ get paymentError() {
4082
+ return o.get($);
4083
+ },
4084
+ get labels() {
4085
+ return u();
4086
+ },
4087
+ get elements() {
4088
+ return o.get(U);
4089
+ },
4090
+ set elements(N) {
4091
+ o.set(U, N, !0);
4092
+ },
4093
+ get eventEnded() {
4094
+ return o.get(I);
4095
+ },
4096
+ set eventEnded(N) {
4097
+ o.set(I, N, !0);
4098
+ }
4099
+ });
4100
+ }
4101
+ var E = o.sibling(_, 2);
4102
+ {
4103
+ var O = ($) => {
4104
+ var N = Oc(), z = o.child(N);
4105
+ {
4106
+ let L = o.derived(() => o.get(T) || o.get(S));
4107
+ Tc(z, {
4108
+ get cartId() {
4109
+ return o.get(p);
4110
+ },
4111
+ onApplied: se,
4112
+ onRemoved: Pe,
4113
+ get disabled() {
4114
+ return o.get(L);
4115
+ },
4116
+ get labels() {
4117
+ return u();
4118
+ }
4119
+ });
4120
+ }
4121
+ o.reset(N), o.append($, N);
4122
+ };
4123
+ o.if(E, ($) => {
4124
+ !o.get(V) && !o.get(I) && $(O);
4125
+ });
4126
+ }
4127
+ o.append(h, y);
4128
+ }, Rn = (h) => {
4129
+ var y = $c(), _ = o.child(y), E = o.child(_, !0);
4130
+ o.reset(_), o.reset(y), o.template_effect(() => o.set_text(E, o.get(le))), o.append(h, y);
4131
+ }, Fn = (h) => {
4132
+ var y = Cc(), _ = o.child(y), E = o.child(_, !0);
4133
+ o.reset(_), o.reset(y), o.template_effect(() => o.set_text(E, u().loadingSecurePaymentForm || "Loading secure payment form...")), o.append(h, y);
4134
+ };
4135
+ o.if(_t, (h) => {
4136
+ o.get(k) ? h(Dn) : o.get(_e) ? h(Rn, 1) : h(Fn, -1);
4137
+ });
4138
+ }
4139
+ var Un = o.sibling(_t, 2);
4140
+ {
4141
+ var Mn = (h) => {
4142
+ xc(h, {
4143
+ open: !0,
4144
+ get reason() {
4145
+ return o.get(de);
4146
+ },
4147
+ onBackToEvents: An,
4148
+ get labels() {
4149
+ return u();
4150
+ }
4151
+ });
4152
+ };
4153
+ o.if(Un, (h) => {
4154
+ o.get(ie) && h(Mn);
4155
+ });
4156
+ }
4157
+ o.append(e, vt), o.pop();
4158
+ }
4159
+ export {
4160
+ Mc as default
4161
+ };
4162
+ //# sourceMappingURL=Checkout-48xwm6As.js.map