zudoku 0.56.0 → 0.57.1

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 (149) hide show
  1. package/dist/app/demo.js +1 -1
  2. package/dist/app/entry.client.js +1 -1
  3. package/dist/app/entry.server.js +1 -1
  4. package/dist/app/main.d.ts +1 -1
  5. package/dist/app/main.js +3 -2
  6. package/dist/app/main.js.map +1 -1
  7. package/dist/app/standalone.js +1 -1
  8. package/dist/config/validators/ProtectedRoutesSchema.d.ts +5 -4
  9. package/dist/config/validators/ProtectedRoutesSchema.js +4 -13
  10. package/dist/config/validators/ProtectedRoutesSchema.js.map +1 -1
  11. package/dist/config/validators/validate.d.ts +1 -13
  12. package/dist/lib/components/MobileTopNavigation.js +2 -2
  13. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  14. package/dist/lib/components/TopNavigation.js +2 -2
  15. package/dist/lib/components/TopNavigation.js.map +1 -1
  16. package/dist/lib/components/index.d.ts +0 -29
  17. package/dist/lib/components/index.js +0 -17
  18. package/dist/lib/components/index.js.map +1 -1
  19. package/dist/lib/components/navigation/NavigationItem.js +2 -2
  20. package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
  21. package/dist/lib/components/navigation/utils.d.ts +1 -1
  22. package/dist/lib/components/navigation/utils.js +1 -1
  23. package/dist/lib/components/navigation/utils.js.map +1 -1
  24. package/dist/lib/core/ZudokuContext.d.ts +2 -1
  25. package/dist/lib/core/ZudokuContext.js +13 -3
  26. package/dist/lib/core/ZudokuContext.js.map +1 -1
  27. package/dist/lib/core/__internal.d.ts +37 -0
  28. package/dist/lib/core/__internal.js +26 -0
  29. package/dist/lib/core/__internal.js.map +1 -0
  30. package/dist/lib/core/router.d.ts +1 -0
  31. package/dist/lib/core/router.js +2 -0
  32. package/dist/lib/core/router.js.map +1 -0
  33. package/dist/vite/mdx/remark-inject-filepath.d.ts +3 -0
  34. package/dist/vite/mdx/remark-inject-filepath.js +6 -0
  35. package/dist/vite/mdx/remark-inject-filepath.js.map +1 -0
  36. package/dist/vite/mdx/remark-link-rewrite.d.ts +2 -0
  37. package/dist/vite/mdx/remark-link-rewrite.js +20 -0
  38. package/dist/vite/mdx/remark-link-rewrite.js.map +1 -0
  39. package/dist/vite/mdx/remark-normalize-image-url.d.ts +2 -0
  40. package/dist/vite/mdx/remark-normalize-image-url.js +12 -0
  41. package/dist/vite/mdx/remark-normalize-image-url.js.map +1 -0
  42. package/dist/vite/{remarkStaticGeneration.d.ts → mdx/remark-static-generation.d.ts} +2 -2
  43. package/dist/vite/{remarkStaticGeneration.js → mdx/remark-static-generation.js} +1 -1
  44. package/dist/vite/mdx/remark-static-generation.js.map +1 -0
  45. package/dist/vite/plugin-mdx.js +6 -23
  46. package/dist/vite/plugin-mdx.js.map +1 -1
  47. package/dist/vite/plugin-navigation.js +33 -34
  48. package/dist/vite/plugin-navigation.js.map +1 -1
  49. package/lib/CategoryHeading-DCpZu3yG.js +17 -0
  50. package/lib/CategoryHeading-DCpZu3yG.js.map +1 -0
  51. package/lib/{Command-CfgGXMfJ.js → Command-CDn17s8X.js} +2 -2
  52. package/lib/{Command-CfgGXMfJ.js.map → Command-CDn17s8X.js.map} +1 -1
  53. package/lib/{Dialog-B7YnrNnG.js → Dialog-BrIjMmUK.js} +3 -3
  54. package/lib/{Dialog-B7YnrNnG.js.map → Dialog-BrIjMmUK.js.map} +1 -1
  55. package/lib/{MdxPage-D49lfheg.js → MdxPage-CsYakgbK.js} +16 -15
  56. package/lib/{MdxPage-D49lfheg.js.map → MdxPage-CsYakgbK.js.map} +1 -1
  57. package/lib/{OAuthErrorPage-COKL9zOi.js → OAuthErrorPage-CW81kc7H.js} +7 -7
  58. package/lib/{OAuthErrorPage-COKL9zOi.js.map → OAuthErrorPage-CW81kc7H.js.map} +1 -1
  59. package/lib/{OasProvider-CCv_-asV.js → OasProvider-DF34c7Tj.js} +3 -3
  60. package/lib/{OasProvider-CCv_-asV.js.map → OasProvider-DF34c7Tj.js.map} +1 -1
  61. package/lib/{OperationList-DkS0B0y1.js → OperationList-BT3T9cyh.js} +17 -16
  62. package/lib/{OperationList-DkS0B0y1.js.map → OperationList-BT3T9cyh.js.map} +1 -1
  63. package/lib/{Pagination-VfR2DCXf.js → Pagination-BvcjSQfr.js} +3 -3
  64. package/lib/{Pagination-VfR2DCXf.js.map → Pagination-BvcjSQfr.js.map} +1 -1
  65. package/lib/RouteGuard-JLH6tCY8.js +56 -0
  66. package/lib/RouteGuard-JLH6tCY8.js.map +1 -0
  67. package/lib/RouterError-DcVonMP1.js +41 -0
  68. package/lib/RouterError-DcVonMP1.js.map +1 -0
  69. package/lib/{SchemaList-B7ezc5Uy.js → SchemaList-BSTuCiI1.js} +15 -14
  70. package/lib/{SchemaList-B7ezc5Uy.js.map → SchemaList-BSTuCiI1.js.map} +1 -1
  71. package/lib/{SchemaView-BuL-ycaR.js → SchemaView-B5oMHFaS.js} +4 -4
  72. package/lib/{SchemaView-BuL-ycaR.js.map → SchemaView-B5oMHFaS.js.map} +1 -1
  73. package/lib/{Select-B9h5k2Pz.js → Select-C3efYI1n.js} +8 -8
  74. package/lib/{Select-B9h5k2Pz.js.map → Select-C3efYI1n.js.map} +1 -1
  75. package/lib/{SignUp-Cn_gZ7UN.js → SignUp-BHw9Ci8d.js} +11 -11
  76. package/lib/{SignUp-Cn_gZ7UN.js.map → SignUp-BHw9Ci8d.js.map} +1 -1
  77. package/lib/{Slot-BFCJzl5J.js → Slot-DOtTvoyj.js} +1678 -1912
  78. package/lib/{Slot-BFCJzl5J.js.map → Slot-DOtTvoyj.js.map} +1 -1
  79. package/lib/{SyntaxHighlight-CSW4eaIJ.js → SyntaxHighlight-GR0eix_L.js} +2 -2
  80. package/lib/{SyntaxHighlight-CSW4eaIJ.js.map → SyntaxHighlight-GR0eix_L.js.map} +1 -1
  81. package/lib/{Toc-B9K7a2FS.js → Toc-BlcGIkXc.js} +2 -2
  82. package/lib/{Toc-B9K7a2FS.js.map → Toc-BlcGIkXc.js.map} +1 -1
  83. package/lib/{ZudokuContext-mDDq1hft.js → ZudokuContext-BuJD7yIX.js} +28 -28
  84. package/lib/{ZudokuContext-mDDq1hft.js.map → ZudokuContext-BuJD7yIX.js.map} +1 -1
  85. package/lib/chunk-QMGIS6GS-DqecZ6nq.js +9204 -0
  86. package/lib/chunk-QMGIS6GS-DqecZ6nq.js.map +1 -0
  87. package/lib/{circular-BMUvC5RK.js → circular-DKJCbMIs.js} +2 -2
  88. package/lib/{circular-BMUvC5RK.js.map → circular-DKJCbMIs.js.map} +1 -1
  89. package/lib/{createServer-I8dX2VSu.js → createServer-DR-J5mEE.js} +4 -4
  90. package/lib/{createServer-I8dX2VSu.js.map → createServer-DR-J5mEE.js.map} +1 -1
  91. package/lib/{errors-D2Qdkul6.js → errors-C1fOoSR8.js} +2 -2
  92. package/lib/{errors-D2Qdkul6.js.map → errors-C1fOoSR8.js.map} +1 -1
  93. package/lib/{hook-CGx8MPrU.js → hook-bv3iuX7X.js} +2 -2
  94. package/lib/{hook-CGx8MPrU.js.map → hook-bv3iuX7X.js.map} +1 -1
  95. package/lib/index-DDHx4NBX.js +1061 -0
  96. package/lib/index-DDHx4NBX.js.map +1 -0
  97. package/lib/{index-DZqSbZzE.js → index-DLcG9mHm.js} +17 -17
  98. package/lib/{index-DZqSbZzE.js.map → index-DLcG9mHm.js.map} +1 -1
  99. package/lib/{index-ChOC1gfC.js → index-HarEI51d.js} +2 -2
  100. package/lib/{index-ChOC1gfC.js.map → index-HarEI51d.js.map} +1 -1
  101. package/lib/{RouteGuard-CSi9-hSR.js → index.esm-BnYHxCYC.js} +226 -281
  102. package/lib/index.esm-BnYHxCYC.js.map +1 -0
  103. package/lib/mutation-Dy_5up8v.js +196 -0
  104. package/lib/mutation-Dy_5up8v.js.map +1 -0
  105. package/lib/ui/Command.js +1 -1
  106. package/lib/ui/SyntaxHighlight.js +2 -2
  107. package/lib/{useExposedProps-DUoV7MCU.js → useExposedProps-BH9aq4MD.js} +32 -32
  108. package/lib/{useExposedProps-DUoV7MCU.js.map → useExposedProps-BH9aq4MD.js.map} +1 -1
  109. package/lib/useLatest-hmRS46UF.js +11 -0
  110. package/lib/useLatest-hmRS46UF.js.map +1 -0
  111. package/lib/zudoku.__internal.js +2965 -0
  112. package/lib/zudoku.__internal.js.map +1 -0
  113. package/lib/zudoku.auth-auth0.js +1 -1
  114. package/lib/zudoku.auth-azureb2c.js +5 -5
  115. package/lib/zudoku.auth-clerk.js +2 -2
  116. package/lib/zudoku.auth-openid.js +5 -5
  117. package/lib/zudoku.auth-supabase.js +2 -2
  118. package/lib/zudoku.components.js +20 -29
  119. package/lib/zudoku.hooks.js +4 -4
  120. package/lib/zudoku.plugin-api-catalog.js +18 -18
  121. package/lib/zudoku.plugin-api-keys.js +27 -26
  122. package/lib/zudoku.plugin-api-keys.js.map +1 -1
  123. package/lib/zudoku.plugin-custom-pages.js +1 -1
  124. package/lib/zudoku.plugin-markdown.js +1 -1
  125. package/lib/zudoku.plugin-openapi.js +4 -4
  126. package/lib/zudoku.plugin-redirect.js +3 -3
  127. package/lib/zudoku.plugin-search-pagefind.js +14 -14
  128. package/lib/zudoku.router.js +123 -0
  129. package/lib/zudoku.router.js.map +1 -0
  130. package/package.json +10 -1
  131. package/src/app/demo.tsx +1 -1
  132. package/src/app/entry.client.tsx +1 -1
  133. package/src/app/entry.server.tsx +1 -1
  134. package/src/app/main.tsx +4 -3
  135. package/src/app/standalone.tsx +1 -1
  136. package/src/lib/components/MobileTopNavigation.tsx +2 -2
  137. package/src/lib/components/TopNavigation.tsx +2 -2
  138. package/src/lib/components/index.ts +0 -20
  139. package/src/lib/components/navigation/NavigationItem.tsx +2 -2
  140. package/src/lib/components/navigation/utils.ts +1 -1
  141. package/src/lib/core/ZudokuContext.ts +22 -5
  142. package/src/lib/core/__internal.tsx +30 -0
  143. package/src/lib/core/router.ts +1 -0
  144. package/dist/vite/remarkStaticGeneration.js.map +0 -1
  145. package/lib/RouteGuard-CSi9-hSR.js.map +0 -1
  146. package/lib/chunk-QMGIS6GS-CdEm9pzB.js +0 -1839
  147. package/lib/chunk-QMGIS6GS-CdEm9pzB.js.map +0 -1
  148. package/lib/index-Cc70HIQT.js +0 -4087
  149. package/lib/index-Cc70HIQT.js.map +0 -1
@@ -0,0 +1,2965 @@
1
+ import { a as Qe, H as Me } from "./index.esm-BnYHxCYC.js";
2
+ import { j as a } from "./jsx-runtime-C5mzlN2N.js";
3
+ import { S as Le, q as Be, Q as _t, n as O, r as me, v as ge, i as A, w as yt, x as wt, y as bt, z as zt, A as ve, B as _e, D as xt, h as ye, E as we, F as $t, G as kt, g as Zt, H as We, e as jt, d as Y, o as Pt, j as Ot } from "./ZudokuContext-BuJD7yIX.js";
4
+ import { M as Et } from "./mutation-Dy_5up8v.js";
5
+ import * as C from "react";
6
+ import { StrictMode as Ke, useEffect as X, useRef as He, useState as It, Suspense as St } from "react";
7
+ import { h as Tt, m as Dt, aM as Ve, aQ as At, O as Ct } from "./chunk-QMGIS6GS-DqecZ6nq.js";
8
+ import * as Nt from "react-dom";
9
+ import { a as Rt, u as Ut, P as Ft, H as qt } from "./index-DDHx4NBX.js";
10
+ import { B as Ge, R as Qt } from "./RouteGuard-JLH6tCY8.js";
11
+ import { CircleFadingArrowUpIcon as Mt, LoaderCircleIcon as Lt, ExternalLink as Bt, PanelLeftIcon as Wt } from "lucide-react";
12
+ import { Button as Kt } from "./ui/Button.js";
13
+ import { c as E } from "./cn-dYga0KKN.js";
14
+ import { a as N, A as Ht, s as Vt, N as be, f as Gt, T as Jt, H as Yt, E as Xt } from "./Slot-DOtTvoyj.js";
15
+ import { d as I, b as en, c as tn } from "./Drawer-DJ05s2pH.js";
16
+ import { VisuallyHidden as nn } from "@radix-ui/react-visually-hidden";
17
+ import { S as rn } from "./Spinner-mNLZ6awP.js";
18
+ import { C as on } from "./CategoryHeading-DCpZu3yG.js";
19
+ import { N as sn, R as an } from "./RouterError-DcVonMP1.js";
20
+ var cn = class extends Le {
21
+ constructor(e = {}) {
22
+ super(), this.config = e, this.#e = /* @__PURE__ */ new Map();
23
+ }
24
+ #e;
25
+ build(e, t, n) {
26
+ const r = t.queryKey, o = t.queryHash ?? Be(r, t);
27
+ let s = this.get(o);
28
+ return s || (s = new _t({
29
+ client: e,
30
+ queryKey: r,
31
+ queryHash: o,
32
+ options: e.defaultQueryOptions(t),
33
+ state: n,
34
+ defaultOptions: e.getQueryDefaults(r)
35
+ }), this.add(s)), s;
36
+ }
37
+ add(e) {
38
+ this.#e.has(e.queryHash) || (this.#e.set(e.queryHash, e), this.notify({
39
+ type: "added",
40
+ query: e
41
+ }));
42
+ }
43
+ remove(e) {
44
+ const t = this.#e.get(e.queryHash);
45
+ t && (e.destroy(), t === e && this.#e.delete(e.queryHash), this.notify({ type: "removed", query: e }));
46
+ }
47
+ clear() {
48
+ O.batch(() => {
49
+ this.getAll().forEach((e) => {
50
+ this.remove(e);
51
+ });
52
+ });
53
+ }
54
+ get(e) {
55
+ return this.#e.get(e);
56
+ }
57
+ getAll() {
58
+ return [...this.#e.values()];
59
+ }
60
+ find(e) {
61
+ const t = { exact: !0, ...e };
62
+ return this.getAll().find(
63
+ (n) => me(t, n)
64
+ );
65
+ }
66
+ findAll(e = {}) {
67
+ const t = this.getAll();
68
+ return Object.keys(e).length > 0 ? t.filter((n) => me(e, n)) : t;
69
+ }
70
+ notify(e) {
71
+ O.batch(() => {
72
+ this.listeners.forEach((t) => {
73
+ t(e);
74
+ });
75
+ });
76
+ }
77
+ onFocus() {
78
+ O.batch(() => {
79
+ this.getAll().forEach((e) => {
80
+ e.onFocus();
81
+ });
82
+ });
83
+ }
84
+ onOnline() {
85
+ O.batch(() => {
86
+ this.getAll().forEach((e) => {
87
+ e.onOnline();
88
+ });
89
+ });
90
+ }
91
+ }, un = class extends Le {
92
+ constructor(e = {}) {
93
+ super(), this.config = e, this.#e = /* @__PURE__ */ new Set(), this.#t = /* @__PURE__ */ new Map(), this.#n = 0;
94
+ }
95
+ #e;
96
+ #t;
97
+ #n;
98
+ build(e, t, n) {
99
+ const r = new Et({
100
+ mutationCache: this,
101
+ mutationId: ++this.#n,
102
+ options: e.defaultMutationOptions(t),
103
+ state: n
104
+ });
105
+ return this.add(r), r;
106
+ }
107
+ add(e) {
108
+ this.#e.add(e);
109
+ const t = W(e);
110
+ if (typeof t == "string") {
111
+ const n = this.#t.get(t);
112
+ n ? n.push(e) : this.#t.set(t, [e]);
113
+ }
114
+ this.notify({ type: "added", mutation: e });
115
+ }
116
+ remove(e) {
117
+ if (this.#e.delete(e)) {
118
+ const t = W(e);
119
+ if (typeof t == "string") {
120
+ const n = this.#t.get(t);
121
+ if (n)
122
+ if (n.length > 1) {
123
+ const r = n.indexOf(e);
124
+ r !== -1 && n.splice(r, 1);
125
+ } else n[0] === e && this.#t.delete(t);
126
+ }
127
+ }
128
+ this.notify({ type: "removed", mutation: e });
129
+ }
130
+ canRun(e) {
131
+ const t = W(e);
132
+ if (typeof t == "string") {
133
+ const r = this.#t.get(t)?.find(
134
+ (o) => o.state.status === "pending"
135
+ );
136
+ return !r || r === e;
137
+ } else
138
+ return !0;
139
+ }
140
+ runNext(e) {
141
+ const t = W(e);
142
+ return typeof t == "string" ? this.#t.get(t)?.find((r) => r !== e && r.state.isPaused)?.continue() ?? Promise.resolve() : Promise.resolve();
143
+ }
144
+ clear() {
145
+ O.batch(() => {
146
+ this.#e.forEach((e) => {
147
+ this.notify({ type: "removed", mutation: e });
148
+ }), this.#e.clear(), this.#t.clear();
149
+ });
150
+ }
151
+ getAll() {
152
+ return Array.from(this.#e);
153
+ }
154
+ find(e) {
155
+ const t = { exact: !0, ...e };
156
+ return this.getAll().find(
157
+ (n) => ge(t, n)
158
+ );
159
+ }
160
+ findAll(e = {}) {
161
+ return this.getAll().filter((t) => ge(e, t));
162
+ }
163
+ notify(e) {
164
+ O.batch(() => {
165
+ this.listeners.forEach((t) => {
166
+ t(e);
167
+ });
168
+ });
169
+ }
170
+ resumePausedMutations() {
171
+ const e = this.getAll().filter((t) => t.state.isPaused);
172
+ return O.batch(
173
+ () => Promise.all(
174
+ e.map((t) => t.continue().catch(A))
175
+ )
176
+ );
177
+ }
178
+ };
179
+ function W(e) {
180
+ return e.options.scope?.id;
181
+ }
182
+ function ze(e) {
183
+ return {
184
+ onFetch: (t, n) => {
185
+ const r = t.options, o = t.fetchOptions?.meta?.fetchMore?.direction, s = t.state.data?.pages || [], i = t.state.data?.pageParams || [];
186
+ let u = { pages: [], pageParams: [] }, f = 0;
187
+ const h = async () => {
188
+ let g = !1;
189
+ const d = (v) => {
190
+ Object.defineProperty(v, "signal", {
191
+ enumerable: !0,
192
+ get: () => (t.signal.aborted ? g = !0 : t.signal.addEventListener("abort", () => {
193
+ g = !0;
194
+ }), t.signal)
195
+ });
196
+ }, p = yt(t.options, t.fetchOptions), m = async (v, x, P) => {
197
+ if (g)
198
+ return Promise.reject();
199
+ if (x == null && v.pages.length)
200
+ return Promise.resolve(v);
201
+ const $ = (() => {
202
+ const D = {
203
+ client: t.client,
204
+ queryKey: t.queryKey,
205
+ pageParam: x,
206
+ direction: P ? "backward" : "forward",
207
+ meta: t.options.meta
208
+ };
209
+ return d(D), D;
210
+ })(), _ = await p($), { maxPages: y } = t.options, T = P ? wt : bt;
211
+ return {
212
+ pages: T(v.pages, _, y),
213
+ pageParams: T(v.pageParams, x, y)
214
+ };
215
+ };
216
+ if (o && s.length) {
217
+ const v = o === "backward", x = v ? ln : xe, P = {
218
+ pages: s,
219
+ pageParams: i
220
+ }, j = x(r, P);
221
+ u = await m(P, j, v);
222
+ } else {
223
+ const v = e ?? s.length;
224
+ do {
225
+ const x = f === 0 ? i[0] ?? r.initialPageParam : xe(r, u);
226
+ if (f > 0 && x == null)
227
+ break;
228
+ u = await m(u, x), f++;
229
+ } while (f < v);
230
+ }
231
+ return u;
232
+ };
233
+ t.options.persister ? t.fetchFn = () => t.options.persister?.(
234
+ h,
235
+ {
236
+ client: t.client,
237
+ queryKey: t.queryKey,
238
+ meta: t.options.meta,
239
+ signal: t.signal
240
+ },
241
+ n
242
+ ) : t.fetchFn = h;
243
+ }
244
+ };
245
+ }
246
+ function xe(e, { pages: t, pageParams: n }) {
247
+ const r = t.length - 1;
248
+ return t.length > 0 ? e.getNextPageParam(
249
+ t[r],
250
+ t,
251
+ n[r],
252
+ n
253
+ ) : void 0;
254
+ }
255
+ function ln(e, { pages: t, pageParams: n }) {
256
+ return t.length > 0 ? e.getPreviousPageParam?.(t[0], t, n[0], n) : void 0;
257
+ }
258
+ var dn = class {
259
+ #e;
260
+ #t;
261
+ #n;
262
+ #o;
263
+ #s;
264
+ #r;
265
+ #i;
266
+ #a;
267
+ constructor(e = {}) {
268
+ this.#e = e.queryCache || new cn(), this.#t = e.mutationCache || new un(), this.#n = e.defaultOptions || {}, this.#o = /* @__PURE__ */ new Map(), this.#s = /* @__PURE__ */ new Map(), this.#r = 0;
269
+ }
270
+ mount() {
271
+ this.#r++, this.#r === 1 && (this.#i = zt.subscribe(async (e) => {
272
+ e && (await this.resumePausedMutations(), this.#e.onFocus());
273
+ }), this.#a = ve.subscribe(async (e) => {
274
+ e && (await this.resumePausedMutations(), this.#e.onOnline());
275
+ }));
276
+ }
277
+ unmount() {
278
+ this.#r--, this.#r === 0 && (this.#i?.(), this.#i = void 0, this.#a?.(), this.#a = void 0);
279
+ }
280
+ isFetching(e) {
281
+ return this.#e.findAll({ ...e, fetchStatus: "fetching" }).length;
282
+ }
283
+ isMutating(e) {
284
+ return this.#t.findAll({ ...e, status: "pending" }).length;
285
+ }
286
+ /**
287
+ * Imperative (non-reactive) way to retrieve data for a QueryKey.
288
+ * Should only be used in callbacks or functions where reading the latest data is necessary, e.g. for optimistic updates.
289
+ *
290
+ * Hint: Do not use this function inside a component, because it won't receive updates.
291
+ * Use `useQuery` to create a `QueryObserver` that subscribes to changes.
292
+ */
293
+ getQueryData(e) {
294
+ const t = this.defaultQueryOptions({ queryKey: e });
295
+ return this.#e.get(t.queryHash)?.state.data;
296
+ }
297
+ ensureQueryData(e) {
298
+ const t = this.defaultQueryOptions(e), n = this.#e.build(this, t), r = n.state.data;
299
+ return r === void 0 ? this.fetchQuery(e) : (e.revalidateIfStale && n.isStaleByTime(_e(t.staleTime, n)) && this.prefetchQuery(t), Promise.resolve(r));
300
+ }
301
+ getQueriesData(e) {
302
+ return this.#e.findAll(e).map(({ queryKey: t, state: n }) => {
303
+ const r = n.data;
304
+ return [t, r];
305
+ });
306
+ }
307
+ setQueryData(e, t, n) {
308
+ const r = this.defaultQueryOptions({ queryKey: e }), s = this.#e.get(
309
+ r.queryHash
310
+ )?.state.data, i = xt(t, s);
311
+ if (i !== void 0)
312
+ return this.#e.build(this, r).setData(i, { ...n, manual: !0 });
313
+ }
314
+ setQueriesData(e, t, n) {
315
+ return O.batch(
316
+ () => this.#e.findAll(e).map(({ queryKey: r }) => [
317
+ r,
318
+ this.setQueryData(r, t, n)
319
+ ])
320
+ );
321
+ }
322
+ getQueryState(e) {
323
+ const t = this.defaultQueryOptions({ queryKey: e });
324
+ return this.#e.get(
325
+ t.queryHash
326
+ )?.state;
327
+ }
328
+ removeQueries(e) {
329
+ const t = this.#e;
330
+ O.batch(() => {
331
+ t.findAll(e).forEach((n) => {
332
+ t.remove(n);
333
+ });
334
+ });
335
+ }
336
+ resetQueries(e, t) {
337
+ const n = this.#e;
338
+ return O.batch(() => (n.findAll(e).forEach((r) => {
339
+ r.reset();
340
+ }), this.refetchQueries(
341
+ {
342
+ type: "active",
343
+ ...e
344
+ },
345
+ t
346
+ )));
347
+ }
348
+ cancelQueries(e, t = {}) {
349
+ const n = { revert: !0, ...t }, r = O.batch(
350
+ () => this.#e.findAll(e).map((o) => o.cancel(n))
351
+ );
352
+ return Promise.all(r).then(A).catch(A);
353
+ }
354
+ invalidateQueries(e, t = {}) {
355
+ return O.batch(() => (this.#e.findAll(e).forEach((n) => {
356
+ n.invalidate();
357
+ }), e?.refetchType === "none" ? Promise.resolve() : this.refetchQueries(
358
+ {
359
+ ...e,
360
+ type: e?.refetchType ?? e?.type ?? "active"
361
+ },
362
+ t
363
+ )));
364
+ }
365
+ refetchQueries(e, t = {}) {
366
+ const n = {
367
+ ...t,
368
+ cancelRefetch: t.cancelRefetch ?? !0
369
+ }, r = O.batch(
370
+ () => this.#e.findAll(e).filter((o) => !o.isDisabled() && !o.isStatic()).map((o) => {
371
+ let s = o.fetch(void 0, n);
372
+ return n.throwOnError || (s = s.catch(A)), o.state.fetchStatus === "paused" ? Promise.resolve() : s;
373
+ })
374
+ );
375
+ return Promise.all(r).then(A);
376
+ }
377
+ fetchQuery(e) {
378
+ const t = this.defaultQueryOptions(e);
379
+ t.retry === void 0 && (t.retry = !1);
380
+ const n = this.#e.build(this, t);
381
+ return n.isStaleByTime(
382
+ _e(t.staleTime, n)
383
+ ) ? n.fetch(t) : Promise.resolve(n.state.data);
384
+ }
385
+ prefetchQuery(e) {
386
+ return this.fetchQuery(e).then(A).catch(A);
387
+ }
388
+ fetchInfiniteQuery(e) {
389
+ return e.behavior = ze(e.pages), this.fetchQuery(e);
390
+ }
391
+ prefetchInfiniteQuery(e) {
392
+ return this.fetchInfiniteQuery(e).then(A).catch(A);
393
+ }
394
+ ensureInfiniteQueryData(e) {
395
+ return e.behavior = ze(e.pages), this.ensureQueryData(e);
396
+ }
397
+ resumePausedMutations() {
398
+ return ve.isOnline() ? this.#t.resumePausedMutations() : Promise.resolve();
399
+ }
400
+ getQueryCache() {
401
+ return this.#e;
402
+ }
403
+ getMutationCache() {
404
+ return this.#t;
405
+ }
406
+ getDefaultOptions() {
407
+ return this.#n;
408
+ }
409
+ setDefaultOptions(e) {
410
+ this.#n = e;
411
+ }
412
+ setQueryDefaults(e, t) {
413
+ this.#o.set(ye(e), {
414
+ queryKey: e,
415
+ defaultOptions: t
416
+ });
417
+ }
418
+ getQueryDefaults(e) {
419
+ const t = [...this.#o.values()], n = {};
420
+ return t.forEach((r) => {
421
+ we(e, r.queryKey) && Object.assign(n, r.defaultOptions);
422
+ }), n;
423
+ }
424
+ setMutationDefaults(e, t) {
425
+ this.#s.set(ye(e), {
426
+ mutationKey: e,
427
+ defaultOptions: t
428
+ });
429
+ }
430
+ getMutationDefaults(e) {
431
+ const t = [...this.#s.values()], n = {};
432
+ return t.forEach((r) => {
433
+ we(e, r.mutationKey) && Object.assign(n, r.defaultOptions);
434
+ }), n;
435
+ }
436
+ defaultQueryOptions(e) {
437
+ if (e._defaulted)
438
+ return e;
439
+ const t = {
440
+ ...this.#n.queries,
441
+ ...this.getQueryDefaults(e.queryKey),
442
+ ...e,
443
+ _defaulted: !0
444
+ };
445
+ return t.queryHash || (t.queryHash = Be(
446
+ t.queryKey,
447
+ t
448
+ )), t.refetchOnReconnect === void 0 && (t.refetchOnReconnect = t.networkMode !== "always"), t.throwOnError === void 0 && (t.throwOnError = !!t.suspense), !t.networkMode && t.persister && (t.networkMode = "offlineFirst"), t.queryFn === $t && (t.enabled = !1), t;
449
+ }
450
+ defaultMutationOptions(e) {
451
+ return e?._defaulted ? e : {
452
+ ...this.#n.mutations,
453
+ ...e?.mutationKey && this.getMutationDefaults(e.mutationKey),
454
+ ...e,
455
+ _defaulted: !0
456
+ };
457
+ }
458
+ clear() {
459
+ this.#e.clear(), this.#t.clear();
460
+ }
461
+ };
462
+ function hn(e) {
463
+ return e;
464
+ }
465
+ function $e(e, t, n) {
466
+ if (typeof t != "object" || t === null)
467
+ return;
468
+ const r = e.getMutationCache(), o = e.getQueryCache(), s = n?.defaultOptions?.deserializeData ?? e.getDefaultOptions().hydrate?.deserializeData ?? hn, i = t.mutations || [], u = t.queries || [];
469
+ i.forEach(({ state: f, ...h }) => {
470
+ r.build(
471
+ e,
472
+ {
473
+ ...e.getDefaultOptions().hydrate?.mutations,
474
+ ...n?.defaultOptions?.mutations,
475
+ ...h
476
+ },
477
+ f
478
+ );
479
+ }), u.forEach(
480
+ ({ queryKey: f, state: h, queryHash: g, meta: d, promise: p, dehydratedAt: m }) => {
481
+ const v = p ? kt(p) : void 0, x = h.data === void 0 ? v?.data : h.data, P = x === void 0 ? x : s(x);
482
+ let j = o.get(g);
483
+ const $ = j?.state.status === "pending", _ = j?.state.fetchStatus === "fetching";
484
+ if (j) {
485
+ const y = v && // We only need this undefined check to handle older dehydration
486
+ // payloads that might not have dehydratedAt
487
+ m !== void 0 && m > j.state.dataUpdatedAt;
488
+ if (h.dataUpdatedAt > j.state.dataUpdatedAt || y) {
489
+ const { fetchStatus: T, ...D } = h;
490
+ j.setState({
491
+ ...D,
492
+ data: P
493
+ });
494
+ }
495
+ } else
496
+ j = o.build(
497
+ e,
498
+ {
499
+ ...e.getDefaultOptions().hydrate?.queries,
500
+ ...n?.defaultOptions?.queries,
501
+ queryKey: f,
502
+ queryHash: g,
503
+ meta: d
504
+ },
505
+ // Reset fetch status to idle to avoid
506
+ // query being stuck in fetching state upon hydration
507
+ {
508
+ ...h,
509
+ data: P,
510
+ fetchStatus: "idle",
511
+ status: P !== void 0 ? "success" : h.status
512
+ }
513
+ );
514
+ p && !$ && !_ && // Only hydrate if dehydration is newer than any existing data,
515
+ // this is always true for new queries
516
+ (m === void 0 || m > j.state.dataUpdatedAt) && j.fetch(void 0, {
517
+ // RSC transformed promises are not thenable
518
+ initialPromise: Promise.resolve(p).then(s)
519
+ });
520
+ }
521
+ );
522
+ }
523
+ var fn = ({
524
+ children: e,
525
+ options: t = {},
526
+ state: n,
527
+ queryClient: r
528
+ }) => {
529
+ const o = Zt(r), s = C.useRef(t);
530
+ s.current = t;
531
+ const i = C.useMemo(() => {
532
+ if (n) {
533
+ if (typeof n != "object")
534
+ return;
535
+ const u = o.getQueryCache(), f = n.queries || [], h = [], g = [];
536
+ for (const d of f) {
537
+ const p = u.get(d.queryHash);
538
+ p ? (d.state.dataUpdatedAt > p.state.dataUpdatedAt || d.promise && p.state.status !== "pending" && p.state.fetchStatus !== "fetching" && d.dehydratedAt !== void 0 && d.dehydratedAt > p.state.dataUpdatedAt) && g.push(d) : h.push(d);
539
+ }
540
+ if (h.length > 0 && $e(o, { queries: h }, s.current), g.length > 0)
541
+ return g;
542
+ }
543
+ }, [o, n]);
544
+ return C.useEffect(() => {
545
+ i && $e(o, { queries: i }, s.current);
546
+ }, [o, i]), e;
547
+ };
548
+ /**
549
+ * react-router v7.6.3
550
+ *
551
+ * Copyright (c) Remix Software Inc.
552
+ *
553
+ * This source code is licensed under the MIT license found in the
554
+ * LICENSE.md file in the root directory of this source tree.
555
+ *
556
+ * @license MIT
557
+ */
558
+ function pn(e) {
559
+ return /* @__PURE__ */ C.createElement(Tt, { flushSync: Nt.flushSync, ...e });
560
+ }
561
+ const mn = new dn({
562
+ defaultOptions: {
563
+ queries: {
564
+ staleTime: 1e3 * 60 * 5
565
+ }
566
+ }
567
+ }), gn = ({
568
+ router: e,
569
+ hydrate: t = !1
570
+ }) => /* @__PURE__ */ a.jsx(Ke, { children: /* @__PURE__ */ a.jsx(We, { client: mn, children: /* @__PURE__ */ a.jsx(fn, { state: t ? window.DATA : void 0, children: /* @__PURE__ */ a.jsx(Ge, { value: !1, children: /* @__PURE__ */ a.jsx(Qe, { children: /* @__PURE__ */ a.jsx(Rt.Provider, { value: { stagger: !t }, children: /* @__PURE__ */ a.jsx(pn, { router: e }) }) }) }) }) }) }), vn = ({
571
+ router: e,
572
+ context: t,
573
+ queryClient: n,
574
+ helmetContext: r,
575
+ bypassProtection: o = !1
576
+ }) => /* @__PURE__ */ a.jsx(Ke, { children: /* @__PURE__ */ a.jsx(We, { client: n, children: /* @__PURE__ */ a.jsx(Qe, { context: r, children: /* @__PURE__ */ a.jsx(Ge, { value: o, children: /* @__PURE__ */ a.jsx(Dt, { router: e, context: t }) }) }) }) });
577
+ function c(e, t, n) {
578
+ function r(u, f) {
579
+ var h;
580
+ Object.defineProperty(u, "_zod", {
581
+ value: u._zod ?? {},
582
+ enumerable: !1
583
+ }), (h = u._zod).traits ?? (h.traits = /* @__PURE__ */ new Set()), u._zod.traits.add(e), t(u, f);
584
+ for (const g in i.prototype)
585
+ g in u || Object.defineProperty(u, g, { value: i.prototype[g].bind(u) });
586
+ u._zod.constr = i, u._zod.def = f;
587
+ }
588
+ const o = n?.Parent ?? Object;
589
+ class s extends o {
590
+ }
591
+ Object.defineProperty(s, "name", { value: e });
592
+ function i(u) {
593
+ var f;
594
+ const h = n?.Parent ? new s() : this;
595
+ r(h, u), (f = h._zod).deferred ?? (f.deferred = []);
596
+ for (const g of h._zod.deferred)
597
+ g();
598
+ return h;
599
+ }
600
+ return Object.defineProperty(i, "init", { value: r }), Object.defineProperty(i, Symbol.hasInstance, {
601
+ value: (u) => n?.Parent && u instanceof n.Parent ? !0 : u?._zod?.traits?.has(e)
602
+ }), Object.defineProperty(i, "name", { value: e }), i;
603
+ }
604
+ class M extends Error {
605
+ constructor() {
606
+ super("Encountered Promise during synchronous parse. Use .parseAsync() instead.");
607
+ }
608
+ }
609
+ const Je = {};
610
+ function R(e) {
611
+ return Je;
612
+ }
613
+ function _n(e) {
614
+ const t = Object.values(e).filter((r) => typeof r == "number");
615
+ return Object.entries(e).filter(([r, o]) => t.indexOf(+r) === -1).map(([r, o]) => o);
616
+ }
617
+ function yn(e, t) {
618
+ return typeof t == "bigint" ? t.toString() : t;
619
+ }
620
+ function Ye(e) {
621
+ return {
622
+ get value() {
623
+ {
624
+ const t = e();
625
+ return Object.defineProperty(this, "value", { value: t }), t;
626
+ }
627
+ }
628
+ };
629
+ }
630
+ function ae(e) {
631
+ return e == null;
632
+ }
633
+ function ce(e) {
634
+ const t = e.startsWith("^") ? 1 : 0, n = e.endsWith("$") ? e.length - 1 : e.length;
635
+ return e.slice(t, n);
636
+ }
637
+ function w(e, t, n) {
638
+ Object.defineProperty(e, t, {
639
+ get() {
640
+ {
641
+ const r = n();
642
+ return e[t] = r, r;
643
+ }
644
+ },
645
+ set(r) {
646
+ Object.defineProperty(e, t, {
647
+ value: r
648
+ // configurable: true,
649
+ });
650
+ },
651
+ configurable: !0
652
+ });
653
+ }
654
+ function ue(e, t, n) {
655
+ Object.defineProperty(e, t, {
656
+ value: n,
657
+ writable: !0,
658
+ enumerable: !0,
659
+ configurable: !0
660
+ });
661
+ }
662
+ function q(e) {
663
+ return JSON.stringify(e);
664
+ }
665
+ const Xe = Error.captureStackTrace ? Error.captureStackTrace : (...e) => {
666
+ };
667
+ function re(e) {
668
+ return typeof e == "object" && e !== null && !Array.isArray(e);
669
+ }
670
+ const wn = Ye(() => {
671
+ if (typeof navigator < "u" && navigator?.userAgent?.includes("Cloudflare"))
672
+ return !1;
673
+ try {
674
+ const e = Function;
675
+ return new e(""), !0;
676
+ } catch {
677
+ return !1;
678
+ }
679
+ });
680
+ function oe(e) {
681
+ if (re(e) === !1)
682
+ return !1;
683
+ const t = e.constructor;
684
+ if (t === void 0)
685
+ return !0;
686
+ const n = t.prototype;
687
+ return !(re(n) === !1 || Object.prototype.hasOwnProperty.call(n, "isPrototypeOf") === !1);
688
+ }
689
+ const bn = /* @__PURE__ */ new Set(["string", "number", "symbol"]);
690
+ function ee(e) {
691
+ return e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
692
+ }
693
+ function F(e, t, n) {
694
+ const r = new e._zod.constr(t ?? e._zod.def);
695
+ return (!t || n?.parent) && (r._zod.parent = e), r;
696
+ }
697
+ function l(e) {
698
+ const t = e;
699
+ if (!t)
700
+ return {};
701
+ if (typeof t == "string")
702
+ return { error: () => t };
703
+ if (t?.message !== void 0) {
704
+ if (t?.error !== void 0)
705
+ throw new Error("Cannot specify both `message` and `error` params");
706
+ t.error = t.message;
707
+ }
708
+ return delete t.message, typeof t.error == "string" ? { ...t, error: () => t.error } : t;
709
+ }
710
+ function zn(e) {
711
+ return Object.keys(e).filter((t) => e[t]._zod.optin === "optional" && e[t]._zod.optout === "optional");
712
+ }
713
+ function xn(e, t) {
714
+ const n = {}, r = e._zod.def;
715
+ for (const o in t) {
716
+ if (!(o in r.shape))
717
+ throw new Error(`Unrecognized key: "${o}"`);
718
+ t[o] && (n[o] = r.shape[o]);
719
+ }
720
+ return F(e, {
721
+ ...e._zod.def,
722
+ shape: n,
723
+ checks: []
724
+ });
725
+ }
726
+ function $n(e, t) {
727
+ const n = { ...e._zod.def.shape }, r = e._zod.def;
728
+ for (const o in t) {
729
+ if (!(o in r.shape))
730
+ throw new Error(`Unrecognized key: "${o}"`);
731
+ t[o] && delete n[o];
732
+ }
733
+ return F(e, {
734
+ ...e._zod.def,
735
+ shape: n,
736
+ checks: []
737
+ });
738
+ }
739
+ function kn(e, t) {
740
+ if (!oe(t))
741
+ throw new Error("Invalid input to extend: expected a plain object");
742
+ const n = {
743
+ ...e._zod.def,
744
+ get shape() {
745
+ const r = { ...e._zod.def.shape, ...t };
746
+ return ue(this, "shape", r), r;
747
+ },
748
+ checks: []
749
+ // delete existing checks
750
+ };
751
+ return F(e, n);
752
+ }
753
+ function Zn(e, t) {
754
+ return F(e, {
755
+ ...e._zod.def,
756
+ get shape() {
757
+ const n = { ...e._zod.def.shape, ...t._zod.def.shape };
758
+ return ue(this, "shape", n), n;
759
+ },
760
+ catchall: t._zod.def.catchall,
761
+ checks: []
762
+ // delete existing checks
763
+ });
764
+ }
765
+ function jn(e, t, n) {
766
+ const r = t._zod.def.shape, o = { ...r };
767
+ if (n)
768
+ for (const s in n) {
769
+ if (!(s in r))
770
+ throw new Error(`Unrecognized key: "${s}"`);
771
+ n[s] && (o[s] = e ? new e({
772
+ type: "optional",
773
+ innerType: r[s]
774
+ }) : r[s]);
775
+ }
776
+ else
777
+ for (const s in r)
778
+ o[s] = e ? new e({
779
+ type: "optional",
780
+ innerType: r[s]
781
+ }) : r[s];
782
+ return F(t, {
783
+ ...t._zod.def,
784
+ shape: o,
785
+ checks: []
786
+ });
787
+ }
788
+ function Pn(e, t, n) {
789
+ const r = t._zod.def.shape, o = { ...r };
790
+ if (n)
791
+ for (const s in n) {
792
+ if (!(s in o))
793
+ throw new Error(`Unrecognized key: "${s}"`);
794
+ n[s] && (o[s] = new e({
795
+ type: "nonoptional",
796
+ innerType: r[s]
797
+ }));
798
+ }
799
+ else
800
+ for (const s in r)
801
+ o[s] = new e({
802
+ type: "nonoptional",
803
+ innerType: r[s]
804
+ });
805
+ return F(t, {
806
+ ...t._zod.def,
807
+ shape: o,
808
+ // optional: [],
809
+ checks: []
810
+ });
811
+ }
812
+ function Q(e, t = 0) {
813
+ for (let n = t; n < e.issues.length; n++)
814
+ if (e.issues[n]?.continue !== !0)
815
+ return !0;
816
+ return !1;
817
+ }
818
+ function le(e, t) {
819
+ return t.map((n) => {
820
+ var r;
821
+ return (r = n).path ?? (r.path = []), n.path.unshift(e), n;
822
+ });
823
+ }
824
+ function K(e) {
825
+ return typeof e == "string" ? e : e?.message;
826
+ }
827
+ function U(e, t, n) {
828
+ const r = { ...e, path: e.path ?? [] };
829
+ if (!e.message) {
830
+ const o = K(e.inst?._zod.def?.error?.(e)) ?? K(t?.error?.(e)) ?? K(n.customError?.(e)) ?? K(n.localeError?.(e)) ?? "Invalid input";
831
+ r.message = o;
832
+ }
833
+ return delete r.inst, delete r.continue, t?.reportInput || delete r.input, r;
834
+ }
835
+ function de(e) {
836
+ return Array.isArray(e) ? "array" : typeof e == "string" ? "string" : "unknown";
837
+ }
838
+ function L(...e) {
839
+ const [t, n, r] = e;
840
+ return typeof t == "string" ? {
841
+ message: t,
842
+ code: "custom",
843
+ input: n,
844
+ inst: r
845
+ } : { ...t };
846
+ }
847
+ const et = (e, t) => {
848
+ e.name = "$ZodError", Object.defineProperty(e, "_zod", {
849
+ value: e._zod,
850
+ enumerable: !1
851
+ }), Object.defineProperty(e, "issues", {
852
+ value: t,
853
+ enumerable: !1
854
+ }), Object.defineProperty(e, "message", {
855
+ get() {
856
+ return JSON.stringify(t, yn, 2);
857
+ },
858
+ enumerable: !0
859
+ // configurable: false,
860
+ });
861
+ }, tt = c("$ZodError", et), nt = c("$ZodError", et, { Parent: Error });
862
+ function On(e, t = (n) => n.message) {
863
+ const n = {}, r = [];
864
+ for (const o of e.issues)
865
+ o.path.length > 0 ? (n[o.path[0]] = n[o.path[0]] || [], n[o.path[0]].push(t(o))) : r.push(t(o));
866
+ return { formErrors: r, fieldErrors: n };
867
+ }
868
+ function En(e, t) {
869
+ const n = t || function(s) {
870
+ return s.message;
871
+ }, r = { _errors: [] }, o = (s) => {
872
+ for (const i of s.issues)
873
+ if (i.code === "invalid_union" && i.errors.length)
874
+ i.errors.map((u) => o({ issues: u }));
875
+ else if (i.code === "invalid_key")
876
+ o({ issues: i.issues });
877
+ else if (i.code === "invalid_element")
878
+ o({ issues: i.issues });
879
+ else if (i.path.length === 0)
880
+ r._errors.push(n(i));
881
+ else {
882
+ let u = r, f = 0;
883
+ for (; f < i.path.length; ) {
884
+ const h = i.path[f];
885
+ f === i.path.length - 1 ? (u[h] = u[h] || { _errors: [] }, u[h]._errors.push(n(i))) : u[h] = u[h] || { _errors: [] }, u = u[h], f++;
886
+ }
887
+ }
888
+ };
889
+ return o(e), r;
890
+ }
891
+ const In = (e) => (t, n, r, o) => {
892
+ const s = r ? Object.assign(r, { async: !1 }) : { async: !1 }, i = t._zod.run({ value: n, issues: [] }, s);
893
+ if (i instanceof Promise)
894
+ throw new M();
895
+ if (i.issues.length) {
896
+ const u = new (o?.Err ?? e)(i.issues.map((f) => U(f, s, R())));
897
+ throw Xe(u, o?.callee), u;
898
+ }
899
+ return i.value;
900
+ }, Sn = (e) => async (t, n, r, o) => {
901
+ const s = r ? Object.assign(r, { async: !0 }) : { async: !0 };
902
+ let i = t._zod.run({ value: n, issues: [] }, s);
903
+ if (i instanceof Promise && (i = await i), i.issues.length) {
904
+ const u = new (o?.Err ?? e)(i.issues.map((f) => U(f, s, R())));
905
+ throw Xe(u, o?.callee), u;
906
+ }
907
+ return i.value;
908
+ }, rt = (e) => (t, n, r) => {
909
+ const o = r ? { ...r, async: !1 } : { async: !1 }, s = t._zod.run({ value: n, issues: [] }, o);
910
+ if (s instanceof Promise)
911
+ throw new M();
912
+ return s.issues.length ? {
913
+ success: !1,
914
+ error: new (e ?? tt)(s.issues.map((i) => U(i, o, R())))
915
+ } : { success: !0, data: s.value };
916
+ }, Tn = /* @__PURE__ */ rt(nt), ot = (e) => async (t, n, r) => {
917
+ const o = r ? Object.assign(r, { async: !0 }) : { async: !0 };
918
+ let s = t._zod.run({ value: n, issues: [] }, o);
919
+ return s instanceof Promise && (s = await s), s.issues.length ? {
920
+ success: !1,
921
+ error: new e(s.issues.map((i) => U(i, o, R())))
922
+ } : { success: !0, data: s.value };
923
+ }, Dn = /* @__PURE__ */ ot(nt), An = /^[cC][^\s-]{8,}$/, Cn = /^[0-9a-z]+$/, Nn = /^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/, Rn = /^[0-9a-vA-V]{20}$/, Un = /^[A-Za-z0-9]{27}$/, Fn = /^[a-zA-Z0-9_-]{21}$/, qn = /^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/, Qn = /^([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})$/, ke = (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)$/, Mn = /^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/, Ln = "^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";
924
+ function Bn() {
925
+ return new RegExp(Ln, "u");
926
+ }
927
+ const Wn = /^(?:(?: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])$/, Kn = /^(([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})$/, Hn = /^((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])$/, Vn = /^(([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])$/, Gn = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/, st = /^[A-Za-z0-9_-]*$/, Jn = /^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/, Yn = /^\+(?:[0-9]){6,14}[0-9]$/, it = "(?:(?:\\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])))", Xn = /* @__PURE__ */ new RegExp(`^${it}$`);
928
+ function at(e) {
929
+ const t = "(?:[01]\\d|2[0-3]):[0-5]\\d";
930
+ 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+)?)?`;
931
+ }
932
+ function er(e) {
933
+ return new RegExp(`^${at(e)}$`);
934
+ }
935
+ function tr(e) {
936
+ const t = at({ precision: e.precision }), n = ["Z"];
937
+ e.local && n.push(""), e.offset && n.push("([+-]\\d{2}:\\d{2})");
938
+ const r = `${t}(?:${n.join("|")})`;
939
+ return new RegExp(`^${it}T(?:${r})$`);
940
+ }
941
+ const nr = (e) => {
942
+ const t = e ? `[\\s\\S]{${e?.minimum ?? 0},${e?.maximum ?? ""}}` : "[\\s\\S]*";
943
+ return new RegExp(`^${t}$`);
944
+ }, rr = /^[^A-Z]*$/, or = /^[^a-z]*$/, S = /* @__PURE__ */ c("$ZodCheck", (e, t) => {
945
+ var n;
946
+ e._zod ?? (e._zod = {}), e._zod.def = t, (n = e._zod).onattach ?? (n.onattach = []);
947
+ }), sr = /* @__PURE__ */ c("$ZodCheckMaxLength", (e, t) => {
948
+ S.init(e, t), e._zod.when = (n) => {
949
+ const r = n.value;
950
+ return !ae(r) && r.length !== void 0;
951
+ }, e._zod.onattach.push((n) => {
952
+ const r = n._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
953
+ t.maximum < r && (n._zod.bag.maximum = t.maximum);
954
+ }), e._zod.check = (n) => {
955
+ const r = n.value;
956
+ if (r.length <= t.maximum)
957
+ return;
958
+ const s = de(r);
959
+ n.issues.push({
960
+ origin: s,
961
+ code: "too_big",
962
+ maximum: t.maximum,
963
+ inclusive: !0,
964
+ input: r,
965
+ inst: e,
966
+ continue: !t.abort
967
+ });
968
+ };
969
+ }), ir = /* @__PURE__ */ c("$ZodCheckMinLength", (e, t) => {
970
+ S.init(e, t), e._zod.when = (n) => {
971
+ const r = n.value;
972
+ return !ae(r) && r.length !== void 0;
973
+ }, e._zod.onattach.push((n) => {
974
+ const r = n._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
975
+ t.minimum > r && (n._zod.bag.minimum = t.minimum);
976
+ }), e._zod.check = (n) => {
977
+ const r = n.value;
978
+ if (r.length >= t.minimum)
979
+ return;
980
+ const s = de(r);
981
+ n.issues.push({
982
+ origin: s,
983
+ code: "too_small",
984
+ minimum: t.minimum,
985
+ inclusive: !0,
986
+ input: r,
987
+ inst: e,
988
+ continue: !t.abort
989
+ });
990
+ };
991
+ }), ar = /* @__PURE__ */ c("$ZodCheckLengthEquals", (e, t) => {
992
+ S.init(e, t), e._zod.when = (n) => {
993
+ const r = n.value;
994
+ return !ae(r) && r.length !== void 0;
995
+ }, e._zod.onattach.push((n) => {
996
+ const r = n._zod.bag;
997
+ r.minimum = t.length, r.maximum = t.length, r.length = t.length;
998
+ }), e._zod.check = (n) => {
999
+ const r = n.value, o = r.length;
1000
+ if (o === t.length)
1001
+ return;
1002
+ const s = de(r), i = o > t.length;
1003
+ n.issues.push({
1004
+ origin: s,
1005
+ ...i ? { code: "too_big", maximum: t.length } : { code: "too_small", minimum: t.length },
1006
+ inclusive: !0,
1007
+ exact: !0,
1008
+ input: n.value,
1009
+ inst: e,
1010
+ continue: !t.abort
1011
+ });
1012
+ };
1013
+ }), te = /* @__PURE__ */ c("$ZodCheckStringFormat", (e, t) => {
1014
+ var n, r;
1015
+ S.init(e, t), e._zod.onattach.push((o) => {
1016
+ const s = o._zod.bag;
1017
+ s.format = t.format, t.pattern && (s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(t.pattern));
1018
+ }), t.pattern ? (n = e._zod).check ?? (n.check = (o) => {
1019
+ t.pattern.lastIndex = 0, !t.pattern.test(o.value) && o.issues.push({
1020
+ origin: "string",
1021
+ code: "invalid_format",
1022
+ format: t.format,
1023
+ input: o.value,
1024
+ ...t.pattern ? { pattern: t.pattern.toString() } : {},
1025
+ inst: e,
1026
+ continue: !t.abort
1027
+ });
1028
+ }) : (r = e._zod).check ?? (r.check = () => {
1029
+ });
1030
+ }), cr = /* @__PURE__ */ c("$ZodCheckRegex", (e, t) => {
1031
+ te.init(e, t), e._zod.check = (n) => {
1032
+ t.pattern.lastIndex = 0, !t.pattern.test(n.value) && n.issues.push({
1033
+ origin: "string",
1034
+ code: "invalid_format",
1035
+ format: "regex",
1036
+ input: n.value,
1037
+ pattern: t.pattern.toString(),
1038
+ inst: e,
1039
+ continue: !t.abort
1040
+ });
1041
+ };
1042
+ }), ur = /* @__PURE__ */ c("$ZodCheckLowerCase", (e, t) => {
1043
+ t.pattern ?? (t.pattern = rr), te.init(e, t);
1044
+ }), lr = /* @__PURE__ */ c("$ZodCheckUpperCase", (e, t) => {
1045
+ t.pattern ?? (t.pattern = or), te.init(e, t);
1046
+ }), dr = /* @__PURE__ */ c("$ZodCheckIncludes", (e, t) => {
1047
+ S.init(e, t);
1048
+ const n = ee(t.includes), r = new RegExp(typeof t.position == "number" ? `^.{${t.position}}${n}` : n);
1049
+ t.pattern = r, e._zod.onattach.push((o) => {
1050
+ const s = o._zod.bag;
1051
+ s.patterns ?? (s.patterns = /* @__PURE__ */ new Set()), s.patterns.add(r);
1052
+ }), e._zod.check = (o) => {
1053
+ o.value.includes(t.includes, t.position) || o.issues.push({
1054
+ origin: "string",
1055
+ code: "invalid_format",
1056
+ format: "includes",
1057
+ includes: t.includes,
1058
+ input: o.value,
1059
+ inst: e,
1060
+ continue: !t.abort
1061
+ });
1062
+ };
1063
+ }), hr = /* @__PURE__ */ c("$ZodCheckStartsWith", (e, t) => {
1064
+ S.init(e, t);
1065
+ const n = new RegExp(`^${ee(t.prefix)}.*`);
1066
+ t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
1067
+ const o = r._zod.bag;
1068
+ o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n);
1069
+ }), e._zod.check = (r) => {
1070
+ r.value.startsWith(t.prefix) || r.issues.push({
1071
+ origin: "string",
1072
+ code: "invalid_format",
1073
+ format: "starts_with",
1074
+ prefix: t.prefix,
1075
+ input: r.value,
1076
+ inst: e,
1077
+ continue: !t.abort
1078
+ });
1079
+ };
1080
+ }), fr = /* @__PURE__ */ c("$ZodCheckEndsWith", (e, t) => {
1081
+ S.init(e, t);
1082
+ const n = new RegExp(`.*${ee(t.suffix)}$`);
1083
+ t.pattern ?? (t.pattern = n), e._zod.onattach.push((r) => {
1084
+ const o = r._zod.bag;
1085
+ o.patterns ?? (o.patterns = /* @__PURE__ */ new Set()), o.patterns.add(n);
1086
+ }), e._zod.check = (r) => {
1087
+ r.value.endsWith(t.suffix) || r.issues.push({
1088
+ origin: "string",
1089
+ code: "invalid_format",
1090
+ format: "ends_with",
1091
+ suffix: t.suffix,
1092
+ input: r.value,
1093
+ inst: e,
1094
+ continue: !t.abort
1095
+ });
1096
+ };
1097
+ }), pr = /* @__PURE__ */ c("$ZodCheckOverwrite", (e, t) => {
1098
+ S.init(e, t), e._zod.check = (n) => {
1099
+ n.value = t.tx(n.value);
1100
+ };
1101
+ });
1102
+ class mr {
1103
+ constructor(t = []) {
1104
+ this.content = [], this.indent = 0, this && (this.args = t);
1105
+ }
1106
+ indented(t) {
1107
+ this.indent += 1, t(this), this.indent -= 1;
1108
+ }
1109
+ write(t) {
1110
+ if (typeof t == "function") {
1111
+ t(this, { execution: "sync" }), t(this, { execution: "async" });
1112
+ return;
1113
+ }
1114
+ const r = t.split(`
1115
+ `).filter((i) => i), o = Math.min(...r.map((i) => i.length - i.trimStart().length)), s = r.map((i) => i.slice(o)).map((i) => " ".repeat(this.indent * 2) + i);
1116
+ for (const i of s)
1117
+ this.content.push(i);
1118
+ }
1119
+ compile() {
1120
+ const t = Function, n = this?.args, o = [...(this?.content ?? [""]).map((s) => ` ${s}`)];
1121
+ return new t(...n, o.join(`
1122
+ `));
1123
+ }
1124
+ }
1125
+ const gr = {
1126
+ major: 4,
1127
+ minor: 0,
1128
+ patch: 0
1129
+ }, k = /* @__PURE__ */ c("$ZodType", (e, t) => {
1130
+ var n;
1131
+ e ?? (e = {}), e._zod.def = t, e._zod.bag = e._zod.bag || {}, e._zod.version = gr;
1132
+ const r = [...e._zod.def.checks ?? []];
1133
+ e._zod.traits.has("$ZodCheck") && r.unshift(e);
1134
+ for (const o of r)
1135
+ for (const s of o._zod.onattach)
1136
+ s(e);
1137
+ if (r.length === 0)
1138
+ (n = e._zod).deferred ?? (n.deferred = []), e._zod.deferred?.push(() => {
1139
+ e._zod.run = e._zod.parse;
1140
+ });
1141
+ else {
1142
+ const o = (s, i, u) => {
1143
+ let f = Q(s), h;
1144
+ for (const g of i) {
1145
+ if (g._zod.when) {
1146
+ if (!g._zod.when(s))
1147
+ continue;
1148
+ } else if (f)
1149
+ continue;
1150
+ const d = s.issues.length, p = g._zod.check(s);
1151
+ if (p instanceof Promise && u?.async === !1)
1152
+ throw new M();
1153
+ if (h || p instanceof Promise)
1154
+ h = (h ?? Promise.resolve()).then(async () => {
1155
+ await p, s.issues.length !== d && (f || (f = Q(s, d)));
1156
+ });
1157
+ else {
1158
+ if (s.issues.length === d)
1159
+ continue;
1160
+ f || (f = Q(s, d));
1161
+ }
1162
+ }
1163
+ return h ? h.then(() => s) : s;
1164
+ };
1165
+ e._zod.run = (s, i) => {
1166
+ const u = e._zod.parse(s, i);
1167
+ if (u instanceof Promise) {
1168
+ if (i.async === !1)
1169
+ throw new M();
1170
+ return u.then((f) => o(f, r, i));
1171
+ }
1172
+ return o(u, r, i);
1173
+ };
1174
+ }
1175
+ e["~standard"] = {
1176
+ validate: (o) => {
1177
+ try {
1178
+ const s = Tn(e, o);
1179
+ return s.success ? { value: s.data } : { issues: s.error?.issues };
1180
+ } catch {
1181
+ return Dn(e, o).then((i) => i.success ? { value: i.data } : { issues: i.error?.issues });
1182
+ }
1183
+ },
1184
+ vendor: "zod",
1185
+ version: 1
1186
+ };
1187
+ }), he = /* @__PURE__ */ c("$ZodString", (e, t) => {
1188
+ k.init(e, t), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? nr(e._zod.bag), e._zod.parse = (n, r) => {
1189
+ if (t.coerce)
1190
+ try {
1191
+ n.value = String(n.value);
1192
+ } catch {
1193
+ }
1194
+ return typeof n.value == "string" || n.issues.push({
1195
+ expected: "string",
1196
+ code: "invalid_type",
1197
+ input: n.value,
1198
+ inst: e
1199
+ }), n;
1200
+ };
1201
+ }), b = /* @__PURE__ */ c("$ZodStringFormat", (e, t) => {
1202
+ te.init(e, t), he.init(e, t);
1203
+ }), vr = /* @__PURE__ */ c("$ZodGUID", (e, t) => {
1204
+ t.pattern ?? (t.pattern = Qn), b.init(e, t);
1205
+ }), _r = /* @__PURE__ */ c("$ZodUUID", (e, t) => {
1206
+ if (t.version) {
1207
+ const r = {
1208
+ v1: 1,
1209
+ v2: 2,
1210
+ v3: 3,
1211
+ v4: 4,
1212
+ v5: 5,
1213
+ v6: 6,
1214
+ v7: 7,
1215
+ v8: 8
1216
+ }[t.version];
1217
+ if (r === void 0)
1218
+ throw new Error(`Invalid UUID version: "${t.version}"`);
1219
+ t.pattern ?? (t.pattern = ke(r));
1220
+ } else
1221
+ t.pattern ?? (t.pattern = ke());
1222
+ b.init(e, t);
1223
+ }), yr = /* @__PURE__ */ c("$ZodEmail", (e, t) => {
1224
+ t.pattern ?? (t.pattern = Mn), b.init(e, t);
1225
+ }), wr = /* @__PURE__ */ c("$ZodURL", (e, t) => {
1226
+ b.init(e, t), e._zod.check = (n) => {
1227
+ try {
1228
+ const r = n.value, o = new URL(r), s = o.href;
1229
+ t.hostname && (t.hostname.lastIndex = 0, t.hostname.test(o.hostname) || n.issues.push({
1230
+ code: "invalid_format",
1231
+ format: "url",
1232
+ note: "Invalid hostname",
1233
+ pattern: Jn.source,
1234
+ input: n.value,
1235
+ inst: e,
1236
+ continue: !t.abort
1237
+ })), t.protocol && (t.protocol.lastIndex = 0, t.protocol.test(o.protocol.endsWith(":") ? o.protocol.slice(0, -1) : o.protocol) || n.issues.push({
1238
+ code: "invalid_format",
1239
+ format: "url",
1240
+ note: "Invalid protocol",
1241
+ pattern: t.protocol.source,
1242
+ input: n.value,
1243
+ inst: e,
1244
+ continue: !t.abort
1245
+ })), !r.endsWith("/") && s.endsWith("/") ? n.value = s.slice(0, -1) : n.value = s;
1246
+ return;
1247
+ } catch {
1248
+ n.issues.push({
1249
+ code: "invalid_format",
1250
+ format: "url",
1251
+ input: n.value,
1252
+ inst: e,
1253
+ continue: !t.abort
1254
+ });
1255
+ }
1256
+ };
1257
+ }), br = /* @__PURE__ */ c("$ZodEmoji", (e, t) => {
1258
+ t.pattern ?? (t.pattern = Bn()), b.init(e, t);
1259
+ }), zr = /* @__PURE__ */ c("$ZodNanoID", (e, t) => {
1260
+ t.pattern ?? (t.pattern = Fn), b.init(e, t);
1261
+ }), xr = /* @__PURE__ */ c("$ZodCUID", (e, t) => {
1262
+ t.pattern ?? (t.pattern = An), b.init(e, t);
1263
+ }), $r = /* @__PURE__ */ c("$ZodCUID2", (e, t) => {
1264
+ t.pattern ?? (t.pattern = Cn), b.init(e, t);
1265
+ }), kr = /* @__PURE__ */ c("$ZodULID", (e, t) => {
1266
+ t.pattern ?? (t.pattern = Nn), b.init(e, t);
1267
+ }), Zr = /* @__PURE__ */ c("$ZodXID", (e, t) => {
1268
+ t.pattern ?? (t.pattern = Rn), b.init(e, t);
1269
+ }), jr = /* @__PURE__ */ c("$ZodKSUID", (e, t) => {
1270
+ t.pattern ?? (t.pattern = Un), b.init(e, t);
1271
+ }), Pr = /* @__PURE__ */ c("$ZodISODateTime", (e, t) => {
1272
+ t.pattern ?? (t.pattern = tr(t)), b.init(e, t);
1273
+ }), Or = /* @__PURE__ */ c("$ZodISODate", (e, t) => {
1274
+ t.pattern ?? (t.pattern = Xn), b.init(e, t);
1275
+ }), Er = /* @__PURE__ */ c("$ZodISOTime", (e, t) => {
1276
+ t.pattern ?? (t.pattern = er(t)), b.init(e, t);
1277
+ }), Ir = /* @__PURE__ */ c("$ZodISODuration", (e, t) => {
1278
+ t.pattern ?? (t.pattern = qn), b.init(e, t);
1279
+ }), Sr = /* @__PURE__ */ c("$ZodIPv4", (e, t) => {
1280
+ t.pattern ?? (t.pattern = Wn), b.init(e, t), e._zod.onattach.push((n) => {
1281
+ const r = n._zod.bag;
1282
+ r.format = "ipv4";
1283
+ });
1284
+ }), Tr = /* @__PURE__ */ c("$ZodIPv6", (e, t) => {
1285
+ t.pattern ?? (t.pattern = Kn), b.init(e, t), e._zod.onattach.push((n) => {
1286
+ const r = n._zod.bag;
1287
+ r.format = "ipv6";
1288
+ }), e._zod.check = (n) => {
1289
+ try {
1290
+ new URL(`http://[${n.value}]`);
1291
+ } catch {
1292
+ n.issues.push({
1293
+ code: "invalid_format",
1294
+ format: "ipv6",
1295
+ input: n.value,
1296
+ inst: e,
1297
+ continue: !t.abort
1298
+ });
1299
+ }
1300
+ };
1301
+ }), Dr = /* @__PURE__ */ c("$ZodCIDRv4", (e, t) => {
1302
+ t.pattern ?? (t.pattern = Hn), b.init(e, t);
1303
+ }), Ar = /* @__PURE__ */ c("$ZodCIDRv6", (e, t) => {
1304
+ t.pattern ?? (t.pattern = Vn), b.init(e, t), e._zod.check = (n) => {
1305
+ const [r, o] = n.value.split("/");
1306
+ try {
1307
+ if (!o)
1308
+ throw new Error();
1309
+ const s = Number(o);
1310
+ if (`${s}` !== o)
1311
+ throw new Error();
1312
+ if (s < 0 || s > 128)
1313
+ throw new Error();
1314
+ new URL(`http://[${r}]`);
1315
+ } catch {
1316
+ n.issues.push({
1317
+ code: "invalid_format",
1318
+ format: "cidrv6",
1319
+ input: n.value,
1320
+ inst: e,
1321
+ continue: !t.abort
1322
+ });
1323
+ }
1324
+ };
1325
+ });
1326
+ function ct(e) {
1327
+ if (e === "")
1328
+ return !0;
1329
+ if (e.length % 4 !== 0)
1330
+ return !1;
1331
+ try {
1332
+ return atob(e), !0;
1333
+ } catch {
1334
+ return !1;
1335
+ }
1336
+ }
1337
+ const Cr = /* @__PURE__ */ c("$ZodBase64", (e, t) => {
1338
+ t.pattern ?? (t.pattern = Gn), b.init(e, t), e._zod.onattach.push((n) => {
1339
+ n._zod.bag.contentEncoding = "base64";
1340
+ }), e._zod.check = (n) => {
1341
+ ct(n.value) || n.issues.push({
1342
+ code: "invalid_format",
1343
+ format: "base64",
1344
+ input: n.value,
1345
+ inst: e,
1346
+ continue: !t.abort
1347
+ });
1348
+ };
1349
+ });
1350
+ function Nr(e) {
1351
+ if (!st.test(e))
1352
+ return !1;
1353
+ const t = e.replace(/[-_]/g, (r) => r === "-" ? "+" : "/"), n = t.padEnd(Math.ceil(t.length / 4) * 4, "=");
1354
+ return ct(n);
1355
+ }
1356
+ const Rr = /* @__PURE__ */ c("$ZodBase64URL", (e, t) => {
1357
+ t.pattern ?? (t.pattern = st), b.init(e, t), e._zod.onattach.push((n) => {
1358
+ n._zod.bag.contentEncoding = "base64url";
1359
+ }), e._zod.check = (n) => {
1360
+ Nr(n.value) || n.issues.push({
1361
+ code: "invalid_format",
1362
+ format: "base64url",
1363
+ input: n.value,
1364
+ inst: e,
1365
+ continue: !t.abort
1366
+ });
1367
+ };
1368
+ }), Ur = /* @__PURE__ */ c("$ZodE164", (e, t) => {
1369
+ t.pattern ?? (t.pattern = Yn), b.init(e, t);
1370
+ });
1371
+ function Fr(e, t = null) {
1372
+ try {
1373
+ const n = e.split(".");
1374
+ if (n.length !== 3)
1375
+ return !1;
1376
+ const [r] = n;
1377
+ if (!r)
1378
+ return !1;
1379
+ const o = JSON.parse(atob(r));
1380
+ return !("typ" in o && o?.typ !== "JWT" || !o.alg || t && (!("alg" in o) || o.alg !== t));
1381
+ } catch {
1382
+ return !1;
1383
+ }
1384
+ }
1385
+ const qr = /* @__PURE__ */ c("$ZodJWT", (e, t) => {
1386
+ b.init(e, t), e._zod.check = (n) => {
1387
+ Fr(n.value, t.alg) || n.issues.push({
1388
+ code: "invalid_format",
1389
+ format: "jwt",
1390
+ input: n.value,
1391
+ inst: e,
1392
+ continue: !t.abort
1393
+ });
1394
+ };
1395
+ }), Qr = /* @__PURE__ */ c("$ZodUnknown", (e, t) => {
1396
+ k.init(e, t), e._zod.parse = (n) => n;
1397
+ }), Mr = /* @__PURE__ */ c("$ZodNever", (e, t) => {
1398
+ k.init(e, t), e._zod.parse = (n, r) => (n.issues.push({
1399
+ expected: "never",
1400
+ code: "invalid_type",
1401
+ input: n.value,
1402
+ inst: e
1403
+ }), n);
1404
+ });
1405
+ function Ze(e, t, n) {
1406
+ e.issues.length && t.issues.push(...le(n, e.issues)), t.value[n] = e.value;
1407
+ }
1408
+ const Lr = /* @__PURE__ */ c("$ZodArray", (e, t) => {
1409
+ k.init(e, t), e._zod.parse = (n, r) => {
1410
+ const o = n.value;
1411
+ if (!Array.isArray(o))
1412
+ return n.issues.push({
1413
+ expected: "array",
1414
+ code: "invalid_type",
1415
+ input: o,
1416
+ inst: e
1417
+ }), n;
1418
+ n.value = Array(o.length);
1419
+ const s = [];
1420
+ for (let i = 0; i < o.length; i++) {
1421
+ const u = o[i], f = t.element._zod.run({
1422
+ value: u,
1423
+ issues: []
1424
+ }, r);
1425
+ f instanceof Promise ? s.push(f.then((h) => Ze(h, n, i))) : Ze(f, n, i);
1426
+ }
1427
+ return s.length ? Promise.all(s).then(() => n) : n;
1428
+ };
1429
+ });
1430
+ function H(e, t, n) {
1431
+ e.issues.length && t.issues.push(...le(n, e.issues)), t.value[n] = e.value;
1432
+ }
1433
+ function je(e, t, n, r) {
1434
+ e.issues.length ? r[n] === void 0 ? n in r ? t.value[n] = void 0 : t.value[n] = e.value : t.issues.push(...le(n, e.issues)) : e.value === void 0 ? n in r && (t.value[n] = void 0) : t.value[n] = e.value;
1435
+ }
1436
+ const Br = /* @__PURE__ */ c("$ZodObject", (e, t) => {
1437
+ k.init(e, t);
1438
+ const n = Ye(() => {
1439
+ const d = Object.keys(t.shape);
1440
+ for (const m of d)
1441
+ if (!(t.shape[m] instanceof k))
1442
+ throw new Error(`Invalid element at key "${m}": expected a Zod schema`);
1443
+ const p = zn(t.shape);
1444
+ return {
1445
+ shape: t.shape,
1446
+ keys: d,
1447
+ keySet: new Set(d),
1448
+ numKeys: d.length,
1449
+ optionalKeys: new Set(p)
1450
+ };
1451
+ });
1452
+ w(e._zod, "propValues", () => {
1453
+ const d = t.shape, p = {};
1454
+ for (const m in d) {
1455
+ const v = d[m]._zod;
1456
+ if (v.values) {
1457
+ p[m] ?? (p[m] = /* @__PURE__ */ new Set());
1458
+ for (const x of v.values)
1459
+ p[m].add(x);
1460
+ }
1461
+ }
1462
+ return p;
1463
+ });
1464
+ const r = (d) => {
1465
+ const p = new mr(["shape", "payload", "ctx"]), m = n.value, v = ($) => {
1466
+ const _ = q($);
1467
+ return `shape[${_}]._zod.run({ value: input[${_}], issues: [] }, ctx)`;
1468
+ };
1469
+ p.write("const input = payload.value;");
1470
+ const x = /* @__PURE__ */ Object.create(null);
1471
+ let P = 0;
1472
+ for (const $ of m.keys)
1473
+ x[$] = `key_${P++}`;
1474
+ p.write("const newResult = {}");
1475
+ for (const $ of m.keys)
1476
+ if (m.optionalKeys.has($)) {
1477
+ const _ = x[$];
1478
+ p.write(`const ${_} = ${v($)};`);
1479
+ const y = q($);
1480
+ p.write(`
1481
+ if (${_}.issues.length) {
1482
+ if (input[${y}] === undefined) {
1483
+ if (${y} in input) {
1484
+ newResult[${y}] = undefined;
1485
+ }
1486
+ } else {
1487
+ payload.issues = payload.issues.concat(
1488
+ ${_}.issues.map((iss) => ({
1489
+ ...iss,
1490
+ path: iss.path ? [${y}, ...iss.path] : [${y}],
1491
+ }))
1492
+ );
1493
+ }
1494
+ } else if (${_}.value === undefined) {
1495
+ if (${y} in input) newResult[${y}] = undefined;
1496
+ } else {
1497
+ newResult[${y}] = ${_}.value;
1498
+ }
1499
+ `);
1500
+ } else {
1501
+ const _ = x[$];
1502
+ p.write(`const ${_} = ${v($)};`), p.write(`
1503
+ if (${_}.issues.length) payload.issues = payload.issues.concat(${_}.issues.map(iss => ({
1504
+ ...iss,
1505
+ path: iss.path ? [${q($)}, ...iss.path] : [${q($)}]
1506
+ })));`), p.write(`newResult[${q($)}] = ${_}.value`);
1507
+ }
1508
+ p.write("payload.value = newResult;"), p.write("return payload;");
1509
+ const j = p.compile();
1510
+ return ($, _) => j(d, $, _);
1511
+ };
1512
+ let o;
1513
+ const s = re, i = !Je.jitless, f = i && wn.value, h = t.catchall;
1514
+ let g;
1515
+ e._zod.parse = (d, p) => {
1516
+ g ?? (g = n.value);
1517
+ const m = d.value;
1518
+ if (!s(m))
1519
+ return d.issues.push({
1520
+ expected: "object",
1521
+ code: "invalid_type",
1522
+ input: m,
1523
+ inst: e
1524
+ }), d;
1525
+ const v = [];
1526
+ if (i && f && p?.async === !1 && p.jitless !== !0)
1527
+ o || (o = r(t.shape)), d = o(d, p);
1528
+ else {
1529
+ d.value = {};
1530
+ const _ = g.shape;
1531
+ for (const y of g.keys) {
1532
+ const T = _[y], D = T._zod.run({ value: m[y], issues: [] }, p), fe = T._zod.optin === "optional" && T._zod.optout === "optional";
1533
+ D instanceof Promise ? v.push(D.then((pe) => fe ? je(pe, d, y, m) : H(pe, d, y))) : fe ? je(D, d, y, m) : H(D, d, y);
1534
+ }
1535
+ }
1536
+ if (!h)
1537
+ return v.length ? Promise.all(v).then(() => d) : d;
1538
+ const x = [], P = g.keySet, j = h._zod, $ = j.def.type;
1539
+ for (const _ of Object.keys(m)) {
1540
+ if (P.has(_))
1541
+ continue;
1542
+ if ($ === "never") {
1543
+ x.push(_);
1544
+ continue;
1545
+ }
1546
+ const y = j.run({ value: m[_], issues: [] }, p);
1547
+ y instanceof Promise ? v.push(y.then((T) => H(T, d, _))) : H(y, d, _);
1548
+ }
1549
+ return x.length && d.issues.push({
1550
+ code: "unrecognized_keys",
1551
+ keys: x,
1552
+ input: m,
1553
+ inst: e
1554
+ }), v.length ? Promise.all(v).then(() => d) : d;
1555
+ };
1556
+ });
1557
+ function Pe(e, t, n, r) {
1558
+ for (const o of e)
1559
+ if (o.issues.length === 0)
1560
+ return t.value = o.value, t;
1561
+ return t.issues.push({
1562
+ code: "invalid_union",
1563
+ input: t.value,
1564
+ inst: n,
1565
+ errors: e.map((o) => o.issues.map((s) => U(s, r, R())))
1566
+ }), t;
1567
+ }
1568
+ const Wr = /* @__PURE__ */ c("$ZodUnion", (e, t) => {
1569
+ k.init(e, t), w(e._zod, "optin", () => t.options.some((n) => n._zod.optin === "optional") ? "optional" : void 0), w(e._zod, "optout", () => t.options.some((n) => n._zod.optout === "optional") ? "optional" : void 0), w(e._zod, "values", () => {
1570
+ if (t.options.every((n) => n._zod.values))
1571
+ return new Set(t.options.flatMap((n) => Array.from(n._zod.values)));
1572
+ }), w(e._zod, "pattern", () => {
1573
+ if (t.options.every((n) => n._zod.pattern)) {
1574
+ const n = t.options.map((r) => r._zod.pattern);
1575
+ return new RegExp(`^(${n.map((r) => ce(r.source)).join("|")})$`);
1576
+ }
1577
+ }), e._zod.parse = (n, r) => {
1578
+ let o = !1;
1579
+ const s = [];
1580
+ for (const i of t.options) {
1581
+ const u = i._zod.run({
1582
+ value: n.value,
1583
+ issues: []
1584
+ }, r);
1585
+ if (u instanceof Promise)
1586
+ s.push(u), o = !0;
1587
+ else {
1588
+ if (u.issues.length === 0)
1589
+ return u;
1590
+ s.push(u);
1591
+ }
1592
+ }
1593
+ return o ? Promise.all(s).then((i) => Pe(i, n, e, r)) : Pe(s, n, e, r);
1594
+ };
1595
+ }), Kr = /* @__PURE__ */ c("$ZodIntersection", (e, t) => {
1596
+ k.init(e, t), e._zod.parse = (n, r) => {
1597
+ const o = n.value, s = t.left._zod.run({ value: o, issues: [] }, r), i = t.right._zod.run({ value: o, issues: [] }, r);
1598
+ return s instanceof Promise || i instanceof Promise ? Promise.all([s, i]).then(([f, h]) => Oe(n, f, h)) : Oe(n, s, i);
1599
+ };
1600
+ });
1601
+ function se(e, t) {
1602
+ if (e === t)
1603
+ return { valid: !0, data: e };
1604
+ if (e instanceof Date && t instanceof Date && +e == +t)
1605
+ return { valid: !0, data: e };
1606
+ if (oe(e) && oe(t)) {
1607
+ const n = Object.keys(t), r = Object.keys(e).filter((s) => n.indexOf(s) !== -1), o = { ...e, ...t };
1608
+ for (const s of r) {
1609
+ const i = se(e[s], t[s]);
1610
+ if (!i.valid)
1611
+ return {
1612
+ valid: !1,
1613
+ mergeErrorPath: [s, ...i.mergeErrorPath]
1614
+ };
1615
+ o[s] = i.data;
1616
+ }
1617
+ return { valid: !0, data: o };
1618
+ }
1619
+ if (Array.isArray(e) && Array.isArray(t)) {
1620
+ if (e.length !== t.length)
1621
+ return { valid: !1, mergeErrorPath: [] };
1622
+ const n = [];
1623
+ for (let r = 0; r < e.length; r++) {
1624
+ const o = e[r], s = t[r], i = se(o, s);
1625
+ if (!i.valid)
1626
+ return {
1627
+ valid: !1,
1628
+ mergeErrorPath: [r, ...i.mergeErrorPath]
1629
+ };
1630
+ n.push(i.data);
1631
+ }
1632
+ return { valid: !0, data: n };
1633
+ }
1634
+ return { valid: !1, mergeErrorPath: [] };
1635
+ }
1636
+ function Oe(e, t, n) {
1637
+ if (t.issues.length && e.issues.push(...t.issues), n.issues.length && e.issues.push(...n.issues), Q(e))
1638
+ return e;
1639
+ const r = se(t.value, n.value);
1640
+ if (!r.valid)
1641
+ throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(r.mergeErrorPath)}`);
1642
+ return e.value = r.data, e;
1643
+ }
1644
+ const Hr = /* @__PURE__ */ c("$ZodEnum", (e, t) => {
1645
+ k.init(e, t);
1646
+ const n = _n(t.entries);
1647
+ e._zod.values = new Set(n), e._zod.pattern = new RegExp(`^(${n.filter((r) => bn.has(typeof r)).map((r) => typeof r == "string" ? ee(r) : r.toString()).join("|")})$`), e._zod.parse = (r, o) => {
1648
+ const s = r.value;
1649
+ return e._zod.values.has(s) || r.issues.push({
1650
+ code: "invalid_value",
1651
+ values: n,
1652
+ input: s,
1653
+ inst: e
1654
+ }), r;
1655
+ };
1656
+ }), Vr = /* @__PURE__ */ c("$ZodTransform", (e, t) => {
1657
+ k.init(e, t), e._zod.parse = (n, r) => {
1658
+ const o = t.transform(n.value, n);
1659
+ if (r.async)
1660
+ return (o instanceof Promise ? o : Promise.resolve(o)).then((i) => (n.value = i, n));
1661
+ if (o instanceof Promise)
1662
+ throw new M();
1663
+ return n.value = o, n;
1664
+ };
1665
+ }), Gr = /* @__PURE__ */ c("$ZodOptional", (e, t) => {
1666
+ k.init(e, t), e._zod.optin = "optional", e._zod.optout = "optional", w(e._zod, "values", () => t.innerType._zod.values ? /* @__PURE__ */ new Set([...t.innerType._zod.values, void 0]) : void 0), w(e._zod, "pattern", () => {
1667
+ const n = t.innerType._zod.pattern;
1668
+ return n ? new RegExp(`^(${ce(n.source)})?$`) : void 0;
1669
+ }), e._zod.parse = (n, r) => t.innerType._zod.optin === "optional" ? t.innerType._zod.run(n, r) : n.value === void 0 ? n : t.innerType._zod.run(n, r);
1670
+ }), Jr = /* @__PURE__ */ c("$ZodNullable", (e, t) => {
1671
+ k.init(e, t), w(e._zod, "optin", () => t.innerType._zod.optin), w(e._zod, "optout", () => t.innerType._zod.optout), w(e._zod, "pattern", () => {
1672
+ const n = t.innerType._zod.pattern;
1673
+ return n ? new RegExp(`^(${ce(n.source)}|null)$`) : void 0;
1674
+ }), w(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);
1675
+ }), Yr = /* @__PURE__ */ c("$ZodDefault", (e, t) => {
1676
+ k.init(e, t), e._zod.optin = "optional", w(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
1677
+ if (n.value === void 0)
1678
+ return n.value = t.defaultValue, n;
1679
+ const o = t.innerType._zod.run(n, r);
1680
+ return o instanceof Promise ? o.then((s) => Ee(s, t)) : Ee(o, t);
1681
+ };
1682
+ });
1683
+ function Ee(e, t) {
1684
+ return e.value === void 0 && (e.value = t.defaultValue), e;
1685
+ }
1686
+ const Xr = /* @__PURE__ */ c("$ZodPrefault", (e, t) => {
1687
+ k.init(e, t), e._zod.optin = "optional", w(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => (n.value === void 0 && (n.value = t.defaultValue), t.innerType._zod.run(n, r));
1688
+ }), eo = /* @__PURE__ */ c("$ZodNonOptional", (e, t) => {
1689
+ k.init(e, t), w(e._zod, "values", () => {
1690
+ const n = t.innerType._zod.values;
1691
+ return n ? new Set([...n].filter((r) => r !== void 0)) : void 0;
1692
+ }), e._zod.parse = (n, r) => {
1693
+ const o = t.innerType._zod.run(n, r);
1694
+ return o instanceof Promise ? o.then((s) => Ie(s, e)) : Ie(o, e);
1695
+ };
1696
+ });
1697
+ function Ie(e, t) {
1698
+ return !e.issues.length && e.value === void 0 && e.issues.push({
1699
+ code: "invalid_type",
1700
+ expected: "nonoptional",
1701
+ input: e.value,
1702
+ inst: t
1703
+ }), e;
1704
+ }
1705
+ const to = /* @__PURE__ */ c("$ZodCatch", (e, t) => {
1706
+ k.init(e, t), e._zod.optin = "optional", w(e._zod, "optout", () => t.innerType._zod.optout), w(e._zod, "values", () => t.innerType._zod.values), e._zod.parse = (n, r) => {
1707
+ const o = t.innerType._zod.run(n, r);
1708
+ return o instanceof Promise ? o.then((s) => (n.value = s.value, s.issues.length && (n.value = t.catchValue({
1709
+ ...n,
1710
+ error: {
1711
+ issues: s.issues.map((i) => U(i, r, R()))
1712
+ },
1713
+ input: n.value
1714
+ }), n.issues = []), n)) : (n.value = o.value, o.issues.length && (n.value = t.catchValue({
1715
+ ...n,
1716
+ error: {
1717
+ issues: o.issues.map((s) => U(s, r, R()))
1718
+ },
1719
+ input: n.value
1720
+ }), n.issues = []), n);
1721
+ };
1722
+ }), no = /* @__PURE__ */ c("$ZodPipe", (e, t) => {
1723
+ k.init(e, t), w(e._zod, "values", () => t.in._zod.values), w(e._zod, "optin", () => t.in._zod.optin), w(e._zod, "optout", () => t.out._zod.optout), e._zod.parse = (n, r) => {
1724
+ const o = t.in._zod.run(n, r);
1725
+ return o instanceof Promise ? o.then((s) => Se(s, t, r)) : Se(o, t, r);
1726
+ };
1727
+ });
1728
+ function Se(e, t, n) {
1729
+ return Q(e) ? e : t.out._zod.run({ value: e.value, issues: e.issues }, n);
1730
+ }
1731
+ const ro = /* @__PURE__ */ c("$ZodReadonly", (e, t) => {
1732
+ k.init(e, t), w(e._zod, "propValues", () => t.innerType._zod.propValues), w(e._zod, "values", () => t.innerType._zod.values), w(e._zod, "optin", () => t.innerType._zod.optin), w(e._zod, "optout", () => t.innerType._zod.optout), e._zod.parse = (n, r) => {
1733
+ const o = t.innerType._zod.run(n, r);
1734
+ return o instanceof Promise ? o.then(Te) : Te(o);
1735
+ };
1736
+ });
1737
+ function Te(e) {
1738
+ return e.value = Object.freeze(e.value), e;
1739
+ }
1740
+ const oo = /* @__PURE__ */ c("$ZodCustom", (e, t) => {
1741
+ S.init(e, t), k.init(e, t), e._zod.parse = (n, r) => n, e._zod.check = (n) => {
1742
+ const r = n.value, o = t.fn(r);
1743
+ if (o instanceof Promise)
1744
+ return o.then((s) => De(s, n, r, e));
1745
+ De(o, n, r, e);
1746
+ };
1747
+ });
1748
+ function De(e, t, n, r) {
1749
+ if (!e) {
1750
+ const o = {
1751
+ code: "custom",
1752
+ input: n,
1753
+ inst: r,
1754
+ // incorporates params.error into issue reporting
1755
+ path: [...r._zod.def.path ?? []],
1756
+ // incorporates params.error into issue reporting
1757
+ continue: !r._zod.def.abort
1758
+ // params: inst._zod.def.params,
1759
+ };
1760
+ r._zod.def.params && (o.params = r._zod.def.params), t.issues.push(L(o));
1761
+ }
1762
+ }
1763
+ class so {
1764
+ constructor() {
1765
+ this._map = /* @__PURE__ */ new WeakMap(), this._idmap = /* @__PURE__ */ new Map();
1766
+ }
1767
+ add(t, ...n) {
1768
+ const r = n[0];
1769
+ if (this._map.set(t, r), r && typeof r == "object" && "id" in r) {
1770
+ if (this._idmap.has(r.id))
1771
+ throw new Error(`ID ${r.id} already exists in the registry`);
1772
+ this._idmap.set(r.id, t);
1773
+ }
1774
+ return this;
1775
+ }
1776
+ remove(t) {
1777
+ return this._map.delete(t), this;
1778
+ }
1779
+ get(t) {
1780
+ const n = t._zod.parent;
1781
+ if (n) {
1782
+ const r = { ...this.get(n) ?? {} };
1783
+ return delete r.id, { ...r, ...this._map.get(t) };
1784
+ }
1785
+ return this._map.get(t);
1786
+ }
1787
+ has(t) {
1788
+ return this._map.has(t);
1789
+ }
1790
+ }
1791
+ function io() {
1792
+ return new so();
1793
+ }
1794
+ const V = /* @__PURE__ */ io();
1795
+ function ao(e, t) {
1796
+ return new e({
1797
+ type: "string",
1798
+ ...l(t)
1799
+ });
1800
+ }
1801
+ function co(e, t) {
1802
+ return new e({
1803
+ type: "string",
1804
+ format: "email",
1805
+ check: "string_format",
1806
+ abort: !1,
1807
+ ...l(t)
1808
+ });
1809
+ }
1810
+ function Ae(e, t) {
1811
+ return new e({
1812
+ type: "string",
1813
+ format: "guid",
1814
+ check: "string_format",
1815
+ abort: !1,
1816
+ ...l(t)
1817
+ });
1818
+ }
1819
+ function uo(e, t) {
1820
+ return new e({
1821
+ type: "string",
1822
+ format: "uuid",
1823
+ check: "string_format",
1824
+ abort: !1,
1825
+ ...l(t)
1826
+ });
1827
+ }
1828
+ function lo(e, t) {
1829
+ return new e({
1830
+ type: "string",
1831
+ format: "uuid",
1832
+ check: "string_format",
1833
+ abort: !1,
1834
+ version: "v4",
1835
+ ...l(t)
1836
+ });
1837
+ }
1838
+ function ho(e, t) {
1839
+ return new e({
1840
+ type: "string",
1841
+ format: "uuid",
1842
+ check: "string_format",
1843
+ abort: !1,
1844
+ version: "v6",
1845
+ ...l(t)
1846
+ });
1847
+ }
1848
+ function fo(e, t) {
1849
+ return new e({
1850
+ type: "string",
1851
+ format: "uuid",
1852
+ check: "string_format",
1853
+ abort: !1,
1854
+ version: "v7",
1855
+ ...l(t)
1856
+ });
1857
+ }
1858
+ function po(e, t) {
1859
+ return new e({
1860
+ type: "string",
1861
+ format: "url",
1862
+ check: "string_format",
1863
+ abort: !1,
1864
+ ...l(t)
1865
+ });
1866
+ }
1867
+ function mo(e, t) {
1868
+ return new e({
1869
+ type: "string",
1870
+ format: "emoji",
1871
+ check: "string_format",
1872
+ abort: !1,
1873
+ ...l(t)
1874
+ });
1875
+ }
1876
+ function go(e, t) {
1877
+ return new e({
1878
+ type: "string",
1879
+ format: "nanoid",
1880
+ check: "string_format",
1881
+ abort: !1,
1882
+ ...l(t)
1883
+ });
1884
+ }
1885
+ function vo(e, t) {
1886
+ return new e({
1887
+ type: "string",
1888
+ format: "cuid",
1889
+ check: "string_format",
1890
+ abort: !1,
1891
+ ...l(t)
1892
+ });
1893
+ }
1894
+ function _o(e, t) {
1895
+ return new e({
1896
+ type: "string",
1897
+ format: "cuid2",
1898
+ check: "string_format",
1899
+ abort: !1,
1900
+ ...l(t)
1901
+ });
1902
+ }
1903
+ function yo(e, t) {
1904
+ return new e({
1905
+ type: "string",
1906
+ format: "ulid",
1907
+ check: "string_format",
1908
+ abort: !1,
1909
+ ...l(t)
1910
+ });
1911
+ }
1912
+ function wo(e, t) {
1913
+ return new e({
1914
+ type: "string",
1915
+ format: "xid",
1916
+ check: "string_format",
1917
+ abort: !1,
1918
+ ...l(t)
1919
+ });
1920
+ }
1921
+ function bo(e, t) {
1922
+ return new e({
1923
+ type: "string",
1924
+ format: "ksuid",
1925
+ check: "string_format",
1926
+ abort: !1,
1927
+ ...l(t)
1928
+ });
1929
+ }
1930
+ function zo(e, t) {
1931
+ return new e({
1932
+ type: "string",
1933
+ format: "ipv4",
1934
+ check: "string_format",
1935
+ abort: !1,
1936
+ ...l(t)
1937
+ });
1938
+ }
1939
+ function xo(e, t) {
1940
+ return new e({
1941
+ type: "string",
1942
+ format: "ipv6",
1943
+ check: "string_format",
1944
+ abort: !1,
1945
+ ...l(t)
1946
+ });
1947
+ }
1948
+ function $o(e, t) {
1949
+ return new e({
1950
+ type: "string",
1951
+ format: "cidrv4",
1952
+ check: "string_format",
1953
+ abort: !1,
1954
+ ...l(t)
1955
+ });
1956
+ }
1957
+ function ko(e, t) {
1958
+ return new e({
1959
+ type: "string",
1960
+ format: "cidrv6",
1961
+ check: "string_format",
1962
+ abort: !1,
1963
+ ...l(t)
1964
+ });
1965
+ }
1966
+ function Zo(e, t) {
1967
+ return new e({
1968
+ type: "string",
1969
+ format: "base64",
1970
+ check: "string_format",
1971
+ abort: !1,
1972
+ ...l(t)
1973
+ });
1974
+ }
1975
+ function jo(e, t) {
1976
+ return new e({
1977
+ type: "string",
1978
+ format: "base64url",
1979
+ check: "string_format",
1980
+ abort: !1,
1981
+ ...l(t)
1982
+ });
1983
+ }
1984
+ function Po(e, t) {
1985
+ return new e({
1986
+ type: "string",
1987
+ format: "e164",
1988
+ check: "string_format",
1989
+ abort: !1,
1990
+ ...l(t)
1991
+ });
1992
+ }
1993
+ function Oo(e, t) {
1994
+ return new e({
1995
+ type: "string",
1996
+ format: "jwt",
1997
+ check: "string_format",
1998
+ abort: !1,
1999
+ ...l(t)
2000
+ });
2001
+ }
2002
+ function Eo(e, t) {
2003
+ return new e({
2004
+ type: "string",
2005
+ format: "datetime",
2006
+ check: "string_format",
2007
+ offset: !1,
2008
+ local: !1,
2009
+ precision: null,
2010
+ ...l(t)
2011
+ });
2012
+ }
2013
+ function Io(e, t) {
2014
+ return new e({
2015
+ type: "string",
2016
+ format: "date",
2017
+ check: "string_format",
2018
+ ...l(t)
2019
+ });
2020
+ }
2021
+ function So(e, t) {
2022
+ return new e({
2023
+ type: "string",
2024
+ format: "time",
2025
+ check: "string_format",
2026
+ precision: null,
2027
+ ...l(t)
2028
+ });
2029
+ }
2030
+ function To(e, t) {
2031
+ return new e({
2032
+ type: "string",
2033
+ format: "duration",
2034
+ check: "string_format",
2035
+ ...l(t)
2036
+ });
2037
+ }
2038
+ function Do(e) {
2039
+ return new e({
2040
+ type: "unknown"
2041
+ });
2042
+ }
2043
+ function Ao(e, t) {
2044
+ return new e({
2045
+ type: "never",
2046
+ ...l(t)
2047
+ });
2048
+ }
2049
+ function ut(e, t) {
2050
+ return new sr({
2051
+ check: "max_length",
2052
+ ...l(t),
2053
+ maximum: e
2054
+ });
2055
+ }
2056
+ function J(e, t) {
2057
+ return new ir({
2058
+ check: "min_length",
2059
+ ...l(t),
2060
+ minimum: e
2061
+ });
2062
+ }
2063
+ function lt(e, t) {
2064
+ return new ar({
2065
+ check: "length_equals",
2066
+ ...l(t),
2067
+ length: e
2068
+ });
2069
+ }
2070
+ function Co(e, t) {
2071
+ return new cr({
2072
+ check: "string_format",
2073
+ format: "regex",
2074
+ ...l(t),
2075
+ pattern: e
2076
+ });
2077
+ }
2078
+ function No(e) {
2079
+ return new ur({
2080
+ check: "string_format",
2081
+ format: "lowercase",
2082
+ ...l(e)
2083
+ });
2084
+ }
2085
+ function Ro(e) {
2086
+ return new lr({
2087
+ check: "string_format",
2088
+ format: "uppercase",
2089
+ ...l(e)
2090
+ });
2091
+ }
2092
+ function Uo(e, t) {
2093
+ return new dr({
2094
+ check: "string_format",
2095
+ format: "includes",
2096
+ ...l(t),
2097
+ includes: e
2098
+ });
2099
+ }
2100
+ function Fo(e, t) {
2101
+ return new hr({
2102
+ check: "string_format",
2103
+ format: "starts_with",
2104
+ ...l(t),
2105
+ prefix: e
2106
+ });
2107
+ }
2108
+ function qo(e, t) {
2109
+ return new fr({
2110
+ check: "string_format",
2111
+ format: "ends_with",
2112
+ ...l(t),
2113
+ suffix: e
2114
+ });
2115
+ }
2116
+ function B(e) {
2117
+ return new pr({
2118
+ check: "overwrite",
2119
+ tx: e
2120
+ });
2121
+ }
2122
+ function Qo(e) {
2123
+ return B((t) => t.normalize(e));
2124
+ }
2125
+ function Mo() {
2126
+ return B((e) => e.trim());
2127
+ }
2128
+ function Lo() {
2129
+ return B((e) => e.toLowerCase());
2130
+ }
2131
+ function Bo() {
2132
+ return B((e) => e.toUpperCase());
2133
+ }
2134
+ function Wo(e, t, n) {
2135
+ return new e({
2136
+ type: "array",
2137
+ element: t,
2138
+ // get element() {
2139
+ // return element;
2140
+ // },
2141
+ ...l(n)
2142
+ });
2143
+ }
2144
+ function Ko(e, t, n) {
2145
+ return new e({
2146
+ type: "custom",
2147
+ check: "custom",
2148
+ fn: t,
2149
+ ...l(n)
2150
+ });
2151
+ }
2152
+ const Ho = /* @__PURE__ */ c("ZodISODateTime", (e, t) => {
2153
+ Pr.init(e, t), z.init(e, t);
2154
+ });
2155
+ function Vo(e) {
2156
+ return Eo(Ho, e);
2157
+ }
2158
+ const Go = /* @__PURE__ */ c("ZodISODate", (e, t) => {
2159
+ Or.init(e, t), z.init(e, t);
2160
+ });
2161
+ function Jo(e) {
2162
+ return Io(Go, e);
2163
+ }
2164
+ const Yo = /* @__PURE__ */ c("ZodISOTime", (e, t) => {
2165
+ Er.init(e, t), z.init(e, t);
2166
+ });
2167
+ function Xo(e) {
2168
+ return So(Yo, e);
2169
+ }
2170
+ const es = /* @__PURE__ */ c("ZodISODuration", (e, t) => {
2171
+ Ir.init(e, t), z.init(e, t);
2172
+ });
2173
+ function ts(e) {
2174
+ return To(es, e);
2175
+ }
2176
+ const ns = (e, t) => {
2177
+ tt.init(e, t), e.name = "ZodError", Object.defineProperties(e, {
2178
+ format: {
2179
+ value: (n) => En(e, n)
2180
+ // enumerable: false,
2181
+ },
2182
+ flatten: {
2183
+ value: (n) => On(e, n)
2184
+ // enumerable: false,
2185
+ },
2186
+ addIssue: {
2187
+ value: (n) => e.issues.push(n)
2188
+ // enumerable: false,
2189
+ },
2190
+ addIssues: {
2191
+ value: (n) => e.issues.push(...n)
2192
+ // enumerable: false,
2193
+ },
2194
+ isEmpty: {
2195
+ get() {
2196
+ return e.issues.length === 0;
2197
+ }
2198
+ // enumerable: false,
2199
+ }
2200
+ });
2201
+ }, ne = c("ZodError", ns, {
2202
+ Parent: Error
2203
+ }), rs = /* @__PURE__ */ In(ne), os = /* @__PURE__ */ Sn(ne), ss = /* @__PURE__ */ rt(ne), is = /* @__PURE__ */ ot(ne), Z = /* @__PURE__ */ c("ZodType", (e, t) => (k.init(e, t), e.def = t, Object.defineProperty(e, "_def", { value: t }), e.check = (...n) => e.clone(
2204
+ {
2205
+ ...t,
2206
+ checks: [
2207
+ ...t.checks ?? [],
2208
+ ...n.map((r) => typeof r == "function" ? { _zod: { check: r, def: { check: "custom" }, onattach: [] } } : r)
2209
+ ]
2210
+ }
2211
+ // { parent: true }
2212
+ ), e.clone = (n, r) => F(e, n, r), e.brand = () => e, e.register = (n, r) => (n.add(e, r), e), e.parse = (n, r) => rs(e, n, r, { callee: e.parse }), e.safeParse = (n, r) => ss(e, n, r), e.parseAsync = async (n, r) => os(e, n, r, { callee: e.parseAsync }), e.safeParseAsync = async (n, r) => is(e, n, r), e.spa = e.safeParseAsync, e.refine = (n, r) => e.check(Js(n, r)), e.superRefine = (n) => e.check(Ys(n)), e.overwrite = (n) => e.check(B(n)), e.optional = () => Ue(e), e.nullable = () => Fe(e), e.nullish = () => Ue(Fe(e)), e.nonoptional = (n) => Ms(e, n), e.array = () => Os(e), e.or = (n) => Ts([e, n]), e.and = (n) => As(e, n), e.transform = (n) => qe(e, Ns(n)), e.default = (n) => Fs(e, n), e.prefault = (n) => Qs(e, n), e.catch = (n) => Bs(e, n), e.pipe = (n) => qe(e, n), e.readonly = () => Hs(e), e.describe = (n) => {
2213
+ const r = e.clone();
2214
+ return V.add(r, { description: n }), r;
2215
+ }, Object.defineProperty(e, "description", {
2216
+ get() {
2217
+ return V.get(e)?.description;
2218
+ },
2219
+ configurable: !0
2220
+ }), e.meta = (...n) => {
2221
+ if (n.length === 0)
2222
+ return V.get(e);
2223
+ const r = e.clone();
2224
+ return V.add(r, n[0]), r;
2225
+ }, e.isOptional = () => e.safeParse(void 0).success, e.isNullable = () => e.safeParse(null).success, e)), dt = /* @__PURE__ */ c("_ZodString", (e, t) => {
2226
+ he.init(e, t), Z.init(e, t);
2227
+ const n = e._zod.bag;
2228
+ e.format = n.format ?? null, e.minLength = n.minimum ?? null, e.maxLength = n.maximum ?? null, e.regex = (...r) => e.check(Co(...r)), e.includes = (...r) => e.check(Uo(...r)), e.startsWith = (...r) => e.check(Fo(...r)), e.endsWith = (...r) => e.check(qo(...r)), e.min = (...r) => e.check(J(...r)), e.max = (...r) => e.check(ut(...r)), e.length = (...r) => e.check(lt(...r)), e.nonempty = (...r) => e.check(J(1, ...r)), e.lowercase = (r) => e.check(No(r)), e.uppercase = (r) => e.check(Ro(r)), e.trim = () => e.check(Mo()), e.normalize = (...r) => e.check(Qo(...r)), e.toLowerCase = () => e.check(Lo()), e.toUpperCase = () => e.check(Bo());
2229
+ }), as = /* @__PURE__ */ c("ZodString", (e, t) => {
2230
+ he.init(e, t), dt.init(e, t), e.email = (n) => e.check(co(cs, n)), e.url = (n) => e.check(po(us, n)), e.jwt = (n) => e.check(Oo($s, n)), e.emoji = (n) => e.check(mo(ls, n)), e.guid = (n) => e.check(Ae(Ne, n)), e.uuid = (n) => e.check(uo(G, n)), e.uuidv4 = (n) => e.check(lo(G, n)), e.uuidv6 = (n) => e.check(ho(G, n)), e.uuidv7 = (n) => e.check(fo(G, n)), e.nanoid = (n) => e.check(go(ds, n)), e.guid = (n) => e.check(Ae(Ne, n)), e.cuid = (n) => e.check(vo(hs, n)), e.cuid2 = (n) => e.check(_o(fs, n)), e.ulid = (n) => e.check(yo(ps, n)), e.base64 = (n) => e.check(Zo(bs, n)), e.base64url = (n) => e.check(jo(zs, n)), e.xid = (n) => e.check(wo(ms, n)), e.ksuid = (n) => e.check(bo(gs, n)), e.ipv4 = (n) => e.check(zo(vs, n)), e.ipv6 = (n) => e.check(xo(_s, n)), e.cidrv4 = (n) => e.check($o(ys, n)), e.cidrv6 = (n) => e.check(ko(ws, n)), e.e164 = (n) => e.check(Po(xs, n)), e.datetime = (n) => e.check(Vo(n)), e.date = (n) => e.check(Jo(n)), e.time = (n) => e.check(Xo(n)), e.duration = (n) => e.check(ts(n));
2231
+ });
2232
+ function Ce(e) {
2233
+ return ao(as, e);
2234
+ }
2235
+ const z = /* @__PURE__ */ c("ZodStringFormat", (e, t) => {
2236
+ b.init(e, t), dt.init(e, t);
2237
+ }), cs = /* @__PURE__ */ c("ZodEmail", (e, t) => {
2238
+ yr.init(e, t), z.init(e, t);
2239
+ }), Ne = /* @__PURE__ */ c("ZodGUID", (e, t) => {
2240
+ vr.init(e, t), z.init(e, t);
2241
+ }), G = /* @__PURE__ */ c("ZodUUID", (e, t) => {
2242
+ _r.init(e, t), z.init(e, t);
2243
+ }), us = /* @__PURE__ */ c("ZodURL", (e, t) => {
2244
+ wr.init(e, t), z.init(e, t);
2245
+ }), ls = /* @__PURE__ */ c("ZodEmoji", (e, t) => {
2246
+ br.init(e, t), z.init(e, t);
2247
+ }), ds = /* @__PURE__ */ c("ZodNanoID", (e, t) => {
2248
+ zr.init(e, t), z.init(e, t);
2249
+ }), hs = /* @__PURE__ */ c("ZodCUID", (e, t) => {
2250
+ xr.init(e, t), z.init(e, t);
2251
+ }), fs = /* @__PURE__ */ c("ZodCUID2", (e, t) => {
2252
+ $r.init(e, t), z.init(e, t);
2253
+ }), ps = /* @__PURE__ */ c("ZodULID", (e, t) => {
2254
+ kr.init(e, t), z.init(e, t);
2255
+ }), ms = /* @__PURE__ */ c("ZodXID", (e, t) => {
2256
+ Zr.init(e, t), z.init(e, t);
2257
+ }), gs = /* @__PURE__ */ c("ZodKSUID", (e, t) => {
2258
+ jr.init(e, t), z.init(e, t);
2259
+ }), vs = /* @__PURE__ */ c("ZodIPv4", (e, t) => {
2260
+ Sr.init(e, t), z.init(e, t);
2261
+ }), _s = /* @__PURE__ */ c("ZodIPv6", (e, t) => {
2262
+ Tr.init(e, t), z.init(e, t);
2263
+ }), ys = /* @__PURE__ */ c("ZodCIDRv4", (e, t) => {
2264
+ Dr.init(e, t), z.init(e, t);
2265
+ }), ws = /* @__PURE__ */ c("ZodCIDRv6", (e, t) => {
2266
+ Ar.init(e, t), z.init(e, t);
2267
+ }), bs = /* @__PURE__ */ c("ZodBase64", (e, t) => {
2268
+ Cr.init(e, t), z.init(e, t);
2269
+ }), zs = /* @__PURE__ */ c("ZodBase64URL", (e, t) => {
2270
+ Rr.init(e, t), z.init(e, t);
2271
+ }), xs = /* @__PURE__ */ c("ZodE164", (e, t) => {
2272
+ Ur.init(e, t), z.init(e, t);
2273
+ }), $s = /* @__PURE__ */ c("ZodJWT", (e, t) => {
2274
+ qr.init(e, t), z.init(e, t);
2275
+ }), ks = /* @__PURE__ */ c("ZodUnknown", (e, t) => {
2276
+ Qr.init(e, t), Z.init(e, t);
2277
+ });
2278
+ function Re() {
2279
+ return Do(ks);
2280
+ }
2281
+ const Zs = /* @__PURE__ */ c("ZodNever", (e, t) => {
2282
+ Mr.init(e, t), Z.init(e, t);
2283
+ });
2284
+ function js(e) {
2285
+ return Ao(Zs, e);
2286
+ }
2287
+ const Ps = /* @__PURE__ */ c("ZodArray", (e, t) => {
2288
+ Lr.init(e, t), Z.init(e, t), e.element = t.element, e.min = (n, r) => e.check(J(n, r)), e.nonempty = (n) => e.check(J(1, n)), e.max = (n, r) => e.check(ut(n, r)), e.length = (n, r) => e.check(lt(n, r)), e.unwrap = () => e.element;
2289
+ });
2290
+ function Os(e, t) {
2291
+ return Wo(Ps, e, t);
2292
+ }
2293
+ const Es = /* @__PURE__ */ c("ZodObject", (e, t) => {
2294
+ Br.init(e, t), Z.init(e, t), w(e, "shape", () => t.shape), e.keyof = () => ht(Object.keys(e._zod.def.shape)), e.catchall = (n) => e.clone({ ...e._zod.def, catchall: n }), e.passthrough = () => e.clone({ ...e._zod.def, catchall: Re() }), e.loose = () => e.clone({ ...e._zod.def, catchall: Re() }), e.strict = () => e.clone({ ...e._zod.def, catchall: js() }), e.strip = () => e.clone({ ...e._zod.def, catchall: void 0 }), e.extend = (n) => kn(e, n), e.merge = (n) => Zn(e, n), e.pick = (n) => xn(e, n), e.omit = (n) => $n(e, n), e.partial = (...n) => jn(ft, e, n[0]), e.required = (...n) => Pn(pt, e, n[0]);
2295
+ });
2296
+ function Is(e, t) {
2297
+ const n = {
2298
+ type: "object",
2299
+ get shape() {
2300
+ return ue(this, "shape", { ...e }), this.shape;
2301
+ },
2302
+ ...l(t)
2303
+ };
2304
+ return new Es(n);
2305
+ }
2306
+ const Ss = /* @__PURE__ */ c("ZodUnion", (e, t) => {
2307
+ Wr.init(e, t), Z.init(e, t), e.options = t.options;
2308
+ });
2309
+ function Ts(e, t) {
2310
+ return new Ss({
2311
+ type: "union",
2312
+ options: e,
2313
+ ...l(t)
2314
+ });
2315
+ }
2316
+ const Ds = /* @__PURE__ */ c("ZodIntersection", (e, t) => {
2317
+ Kr.init(e, t), Z.init(e, t);
2318
+ });
2319
+ function As(e, t) {
2320
+ return new Ds({
2321
+ type: "intersection",
2322
+ left: e,
2323
+ right: t
2324
+ });
2325
+ }
2326
+ const ie = /* @__PURE__ */ c("ZodEnum", (e, t) => {
2327
+ Hr.init(e, t), Z.init(e, t), e.enum = t.entries, e.options = Object.values(t.entries);
2328
+ const n = new Set(Object.keys(t.entries));
2329
+ e.extract = (r, o) => {
2330
+ const s = {};
2331
+ for (const i of r)
2332
+ if (n.has(i))
2333
+ s[i] = t.entries[i];
2334
+ else
2335
+ throw new Error(`Key ${i} not found in enum`);
2336
+ return new ie({
2337
+ ...t,
2338
+ checks: [],
2339
+ ...l(o),
2340
+ entries: s
2341
+ });
2342
+ }, e.exclude = (r, o) => {
2343
+ const s = { ...t.entries };
2344
+ for (const i of r)
2345
+ if (n.has(i))
2346
+ delete s[i];
2347
+ else
2348
+ throw new Error(`Key ${i} not found in enum`);
2349
+ return new ie({
2350
+ ...t,
2351
+ checks: [],
2352
+ ...l(o),
2353
+ entries: s
2354
+ });
2355
+ };
2356
+ });
2357
+ function ht(e, t) {
2358
+ const n = Array.isArray(e) ? Object.fromEntries(e.map((r) => [r, r])) : e;
2359
+ return new ie({
2360
+ type: "enum",
2361
+ entries: n,
2362
+ ...l(t)
2363
+ });
2364
+ }
2365
+ const Cs = /* @__PURE__ */ c("ZodTransform", (e, t) => {
2366
+ Vr.init(e, t), Z.init(e, t), e._zod.parse = (n, r) => {
2367
+ n.addIssue = (s) => {
2368
+ if (typeof s == "string")
2369
+ n.issues.push(L(s, n.value, t));
2370
+ else {
2371
+ const i = s;
2372
+ i.fatal && (i.continue = !1), i.code ?? (i.code = "custom"), i.input ?? (i.input = n.value), i.inst ?? (i.inst = e), i.continue ?? (i.continue = !0), n.issues.push(L(i));
2373
+ }
2374
+ };
2375
+ const o = t.transform(n.value, n);
2376
+ return o instanceof Promise ? o.then((s) => (n.value = s, n)) : (n.value = o, n);
2377
+ };
2378
+ });
2379
+ function Ns(e) {
2380
+ return new Cs({
2381
+ type: "transform",
2382
+ transform: e
2383
+ });
2384
+ }
2385
+ const ft = /* @__PURE__ */ c("ZodOptional", (e, t) => {
2386
+ Gr.init(e, t), Z.init(e, t), e.unwrap = () => e._zod.def.innerType;
2387
+ });
2388
+ function Ue(e) {
2389
+ return new ft({
2390
+ type: "optional",
2391
+ innerType: e
2392
+ });
2393
+ }
2394
+ const Rs = /* @__PURE__ */ c("ZodNullable", (e, t) => {
2395
+ Jr.init(e, t), Z.init(e, t), e.unwrap = () => e._zod.def.innerType;
2396
+ });
2397
+ function Fe(e) {
2398
+ return new Rs({
2399
+ type: "nullable",
2400
+ innerType: e
2401
+ });
2402
+ }
2403
+ const Us = /* @__PURE__ */ c("ZodDefault", (e, t) => {
2404
+ Yr.init(e, t), Z.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeDefault = e.unwrap;
2405
+ });
2406
+ function Fs(e, t) {
2407
+ return new Us({
2408
+ type: "default",
2409
+ innerType: e,
2410
+ get defaultValue() {
2411
+ return typeof t == "function" ? t() : t;
2412
+ }
2413
+ });
2414
+ }
2415
+ const qs = /* @__PURE__ */ c("ZodPrefault", (e, t) => {
2416
+ Xr.init(e, t), Z.init(e, t), e.unwrap = () => e._zod.def.innerType;
2417
+ });
2418
+ function Qs(e, t) {
2419
+ return new qs({
2420
+ type: "prefault",
2421
+ innerType: e,
2422
+ get defaultValue() {
2423
+ return typeof t == "function" ? t() : t;
2424
+ }
2425
+ });
2426
+ }
2427
+ const pt = /* @__PURE__ */ c("ZodNonOptional", (e, t) => {
2428
+ eo.init(e, t), Z.init(e, t), e.unwrap = () => e._zod.def.innerType;
2429
+ });
2430
+ function Ms(e, t) {
2431
+ return new pt({
2432
+ type: "nonoptional",
2433
+ innerType: e,
2434
+ ...l(t)
2435
+ });
2436
+ }
2437
+ const Ls = /* @__PURE__ */ c("ZodCatch", (e, t) => {
2438
+ to.init(e, t), Z.init(e, t), e.unwrap = () => e._zod.def.innerType, e.removeCatch = e.unwrap;
2439
+ });
2440
+ function Bs(e, t) {
2441
+ return new Ls({
2442
+ type: "catch",
2443
+ innerType: e,
2444
+ catchValue: typeof t == "function" ? t : () => t
2445
+ });
2446
+ }
2447
+ const Ws = /* @__PURE__ */ c("ZodPipe", (e, t) => {
2448
+ no.init(e, t), Z.init(e, t), e.in = t.in, e.out = t.out;
2449
+ });
2450
+ function qe(e, t) {
2451
+ return new Ws({
2452
+ type: "pipe",
2453
+ in: e,
2454
+ out: t
2455
+ // ...util.normalizeParams(params),
2456
+ });
2457
+ }
2458
+ const Ks = /* @__PURE__ */ c("ZodReadonly", (e, t) => {
2459
+ ro.init(e, t), Z.init(e, t);
2460
+ });
2461
+ function Hs(e) {
2462
+ return new Ks({
2463
+ type: "readonly",
2464
+ innerType: e
2465
+ });
2466
+ }
2467
+ const Vs = /* @__PURE__ */ c("ZodCustom", (e, t) => {
2468
+ oo.init(e, t), Z.init(e, t);
2469
+ });
2470
+ function Gs(e, t) {
2471
+ const n = new S({
2472
+ check: "custom",
2473
+ ...l(t)
2474
+ });
2475
+ return n._zod.check = e, n;
2476
+ }
2477
+ function Js(e, t = {}) {
2478
+ return Ko(Vs, e, t);
2479
+ }
2480
+ function Ys(e, t) {
2481
+ const n = Gs((r) => (r.addIssue = (o) => {
2482
+ if (typeof o == "string")
2483
+ r.issues.push(L(o, r.value, n._zod.def));
2484
+ else {
2485
+ const s = o;
2486
+ s.fatal && (s.continue = !1), s.code ?? (s.code = "custom"), s.input ?? (s.input = r.value), s.inst ?? (s.inst = n), s.continue ?? (s.continue = !n._zod.def.abort), r.issues.push(L(s));
2487
+ }
2488
+ }, e(r.value, r)), t);
2489
+ return n;
2490
+ }
2491
+ const Xs = Is({
2492
+ buildId: Ce(),
2493
+ timestamp: Ce(),
2494
+ status: ht(["in-progress", "success", "failed"])
2495
+ }), ei = ({
2496
+ buildId: e,
2497
+ environmentType: t,
2498
+ endpoint: n = "/__zuplo/docs"
2499
+ }) => {
2500
+ const r = jt({
2501
+ queryKey: ["zuplo-build-check", e, n],
2502
+ refetchInterval: 3e3,
2503
+ enabled: e !== void 0 && t === "WORKING_COPY",
2504
+ retry: !1,
2505
+ queryFn: () => fetch(n, { signal: AbortSignal.timeout(2e3) }).then((s) => {
2506
+ if (!s.ok) throw new Error("Failed to fetch build status");
2507
+ return s.json();
2508
+ }).then((s) => Xs.parse(s))
2509
+ });
2510
+ if (X(() => {
2511
+ r.data?.status === "success" && r.data.buildId && (document.cookie = `zuplo-build=${r.data.buildId}; path=/; max-age=300; secure; SameSite=None`);
2512
+ }, [r.data]), r.isError || !r.data || r.data.buildId === e)
2513
+ return null;
2514
+ const o = r.data.status === "success";
2515
+ return /* @__PURE__ */ a.jsxs("div", { className: "fixed flex flex-col gap-3 p-4 rounded-xl w-96 border z-20 bg-background left-0 right-0 top-4 mx-auto shadow-lg", children: [
2516
+ o ? /* @__PURE__ */ a.jsxs("div", { className: "flex flex-row items-center gap-2", children: [
2517
+ /* @__PURE__ */ a.jsx(Mt, { size: 16 }),
2518
+ /* @__PURE__ */ a.jsx("span", { className: "text-sm", children: "New version available" })
2519
+ ] }) : /* @__PURE__ */ a.jsxs("div", { className: "flex flex-row items-center gap-2", children: [
2520
+ /* @__PURE__ */ a.jsx(Lt, { size: 16, className: "animate-spin" }),
2521
+ /* @__PURE__ */ a.jsx("span", { className: "text-sm", children: "Building new version..." })
2522
+ ] }),
2523
+ /* @__PURE__ */ a.jsx("span", { className: "text-xs", children: o ? "To see the new version, reload the page now." : "A new version of the developer portal will be available soon." }),
2524
+ /* @__PURE__ */ a.jsx(
2525
+ Kt,
2526
+ {
2527
+ variant: "outline",
2528
+ size: "sm",
2529
+ className: "w-full",
2530
+ onClick: () => {
2531
+ window.location.reload();
2532
+ },
2533
+ children: "Reload"
2534
+ }
2535
+ )
2536
+ ] });
2537
+ }, ti = () => {
2538
+ const e = Ve(), t = He(e.pathname);
2539
+ X(() => {
2540
+ const n = t.current !== e.pathname, r = e.hash !== "";
2541
+ n && !r && window.scrollTo(0, 0), t.current = e.pathname;
2542
+ }, [e.pathname, e.hash]);
2543
+ }, ni = ({
2544
+ icon: e
2545
+ }) => typeof e == "string" ? /* @__PURE__ */ a.jsx(
2546
+ "img",
2547
+ {
2548
+ src: `https://cdn.simpleicons.org/${e}/000000/ffffff`,
2549
+ className: "size-5",
2550
+ alt: e
2551
+ }
2552
+ ) : e, ri = (e) => /^https?:/.test(e), oi = () => {
2553
+ const { site: e } = Ut(), t = e?.footer;
2554
+ return t ? /* @__PURE__ */ a.jsx("footer", { className: "border-t bg-background", children: /* @__PURE__ */ a.jsxs("div", { className: "mx-auto max-w-screen-2xl px-4 lg:px-8 py-8 pt-20", children: [
2555
+ /* @__PURE__ */ a.jsxs(
2556
+ "div",
2557
+ {
2558
+ className: E("flex flex-row gap-8", {
2559
+ "justify-center": !t.position || t.position === "center",
2560
+ "justify-start": t.position === "start",
2561
+ "justify-end": t.position === "end"
2562
+ }),
2563
+ children: [
2564
+ /* @__PURE__ */ a.jsx(N.Target, { name: "footer-before" }),
2565
+ t.columns && /* @__PURE__ */ a.jsx(
2566
+ "div",
2567
+ {
2568
+ className: "w-full md:max-w-screen-md grid grid-cols-[1fr_1fr] gap-8 md:grid-cols-[repeat(var(--columns),minmax(0,1fr))]",
2569
+ style: { "--columns": t.columns.length },
2570
+ children: t.columns.map((n) => /* @__PURE__ */ a.jsxs(
2571
+ "div",
2572
+ {
2573
+ className: E({
2574
+ "justify-self-center": !n.position || n.position === "center",
2575
+ "justify-self-start": n.position === "start",
2576
+ "justify-self-end": n.position === "end"
2577
+ }),
2578
+ children: [
2579
+ /* @__PURE__ */ a.jsx("span", { className: "text-sm font-semibold", children: n.title }),
2580
+ /* @__PURE__ */ a.jsx("ul", { className: "mt-4 space-y-2", children: n.links.map((r) => {
2581
+ const o = "flex flex-row gap-1 items-center text-sm text-muted-foreground hover:text-accent-foreground";
2582
+ return /* @__PURE__ */ a.jsx("li", { children: ri(r.href) ? /* @__PURE__ */ a.jsxs(
2583
+ "a",
2584
+ {
2585
+ href: r.href,
2586
+ target: "_blank",
2587
+ rel: "noopener noreferrer",
2588
+ className: o,
2589
+ children: [
2590
+ /* @__PURE__ */ a.jsx("span", { children: r.label }),
2591
+ /* @__PURE__ */ a.jsx(Bt, { size: 12 })
2592
+ ]
2593
+ }
2594
+ ) : /* @__PURE__ */ a.jsx(Ht, { to: r.href, className: o, children: /* @__PURE__ */ a.jsx("span", { children: r.label }) }) }, r.href + r.label);
2595
+ }) })
2596
+ ]
2597
+ },
2598
+ n.title
2599
+ ))
2600
+ }
2601
+ ),
2602
+ /* @__PURE__ */ a.jsx(N.Target, { name: "footer-after" })
2603
+ ]
2604
+ }
2605
+ ),
2606
+ /* @__PURE__ */ a.jsxs(
2607
+ "div",
2608
+ {
2609
+ className: E(
2610
+ "flex items-center justify-between",
2611
+ t.columns && "border-t mt-8 pt-8"
2612
+ ),
2613
+ children: [
2614
+ t.logo && /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
2615
+ /* @__PURE__ */ a.jsx(
2616
+ "img",
2617
+ {
2618
+ src: t.logo.src.light,
2619
+ alt: t.logo.alt,
2620
+ className: "w-8 dark:hidden",
2621
+ style: { width: t.logo.width }
2622
+ }
2623
+ ),
2624
+ /* @__PURE__ */ a.jsx(
2625
+ "img",
2626
+ {
2627
+ src: t.logo.src.dark,
2628
+ alt: t.logo.alt,
2629
+ className: "w-8 hidden dark:block",
2630
+ style: { width: t.logo.width }
2631
+ }
2632
+ )
2633
+ ] }),
2634
+ t.copyright && /* @__PURE__ */ a.jsx("p", { className: "text-sm text-muted-foreground", children: t.copyright }),
2635
+ /* @__PURE__ */ a.jsx("div", { className: "flex items-center gap-2", children: t.social?.map((n) => /* @__PURE__ */ a.jsxs(
2636
+ "a",
2637
+ {
2638
+ href: n.href,
2639
+ target: "_blank",
2640
+ rel: "noopener noreferrer",
2641
+ className: "w-auto gap-2 flex text-muted-foreground hover:text-accent-foreground",
2642
+ children: [
2643
+ /* @__PURE__ */ a.jsx(ni, { icon: n.icon }),
2644
+ n.label
2645
+ ]
2646
+ },
2647
+ n.href
2648
+ )) })
2649
+ ]
2650
+ }
2651
+ )
2652
+ ] }) }) : null;
2653
+ }, mt = ({
2654
+ shouldScaleBackground: e = !0,
2655
+ ...t
2656
+ }) => /* @__PURE__ */ a.jsx(
2657
+ I.Root,
2658
+ {
2659
+ shouldScaleBackground: e,
2660
+ ...t
2661
+ }
2662
+ );
2663
+ mt.displayName = "Drawer";
2664
+ const si = I.Trigger, ii = I.Portal, gt = C.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ a.jsx(
2665
+ I.Overlay,
2666
+ {
2667
+ ref: n,
2668
+ className: E("fixed inset-0 z-50 bg-black/80", e),
2669
+ ...t
2670
+ }
2671
+ ));
2672
+ gt.displayName = I.Overlay.displayName;
2673
+ const ai = C.forwardRef(
2674
+ ({ className: e, children: t, hideBar: n = !0, ...r }, o) => /* @__PURE__ */ a.jsxs(ii, { children: [
2675
+ /* @__PURE__ */ a.jsx(gt, {}),
2676
+ /* @__PURE__ */ a.jsxs(
2677
+ I.Content,
2678
+ {
2679
+ ref: o,
2680
+ className: E(
2681
+ "fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",
2682
+ e
2683
+ ),
2684
+ ...r,
2685
+ children: [
2686
+ !n && /* @__PURE__ */ a.jsx("div", { className: "mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted" }),
2687
+ t
2688
+ ]
2689
+ }
2690
+ )
2691
+ ] })
2692
+ );
2693
+ ai.displayName = "DrawerContent";
2694
+ const ci = C.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ a.jsx(
2695
+ I.Title,
2696
+ {
2697
+ ref: n,
2698
+ className: E(
2699
+ "text-lg font-semibold leading-none tracking-tight",
2700
+ e
2701
+ ),
2702
+ ...t
2703
+ }
2704
+ ));
2705
+ ci.displayName = I.Title.displayName;
2706
+ const ui = C.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ a.jsx(
2707
+ I.Description,
2708
+ {
2709
+ ref: n,
2710
+ className: E("text-sm text-muted-foreground", e),
2711
+ ...t
2712
+ }
2713
+ ));
2714
+ ui.displayName = I.Description.displayName;
2715
+ const vt = ({
2716
+ children: e,
2717
+ className: t
2718
+ }) => {
2719
+ const { options: n } = Y(), r = He(null);
2720
+ return X(() => {
2721
+ const o = r.current?.querySelector('[aria-current="page"]');
2722
+ Vt(o ?? null);
2723
+ }, []), /* @__PURE__ */ a.jsxs(
2724
+ "div",
2725
+ {
2726
+ className: "grid sticky top-(--header-height) lg:h-[calc(100vh-var(--header-height))] grid-rows-[1fr_min-content] border-r",
2727
+ "data-pagefind-ignore": "all",
2728
+ children: [
2729
+ /* @__PURE__ */ a.jsx(
2730
+ "nav",
2731
+ {
2732
+ ref: r,
2733
+ className: E(
2734
+ "hidden max-w-[calc(var(--side-nav-width)+var(--padding-nav-item))] lg:flex scrollbar flex-col overflow-y-auto shrink-0 text-sm pe-3 ps-4 lg:ps-8",
2735
+ "-mx-(--padding-nav-item) pb-[8vh] pt-(--padding-content-top) scroll-pt-2 gap-1",
2736
+ // Revert the padding/margin on the first child
2737
+ "-mt-2.5",
2738
+ t
2739
+ ),
2740
+ style: {
2741
+ maskImage: "linear-gradient(180deg, transparent 1%, rgba(0, 0, 0, 1) 20px, rgba(0, 0, 0, 1) 90%, transparent 99%)"
2742
+ },
2743
+ children: e
2744
+ }
2745
+ ),
2746
+ /* @__PURE__ */ a.jsx("div", { className: "bg-background border-t p-2 mx-5 gap-2 items-center mt-2 drop-shadow-[0_-3px_1px_rgba(0,0,0,0.015)] hidden lg:[&:has(>_:nth-child(1):last-child)]:flex", children: n.site?.showPoweredBy !== !1 && /* @__PURE__ */ a.jsx(Ft, {}) })
2747
+ ]
2748
+ }
2749
+ );
2750
+ };
2751
+ vt.displayName = "NavigationWrapper";
2752
+ const li = ({
2753
+ onRequestClose: e,
2754
+ navigation: t
2755
+ }) => /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
2756
+ /* @__PURE__ */ a.jsxs(vt, { children: [
2757
+ /* @__PURE__ */ a.jsx(N.Target, { name: "navigation-before" }),
2758
+ t.map((n) => /* @__PURE__ */ a.jsx(
2759
+ be,
2760
+ {
2761
+ item: n
2762
+ },
2763
+ n.type + (n.label ?? "") + ("path" in n ? n.path : "") + ("file" in n ? n.file : "") + ("to" in n ? n.to : "")
2764
+ )),
2765
+ /* @__PURE__ */ a.jsx(N.Target, { name: "navigation-after" })
2766
+ ] }),
2767
+ /* @__PURE__ */ a.jsx(
2768
+ en,
2769
+ {
2770
+ className: "lg:hidden h-[100dvh] start-0 w-[320px] rounded-none",
2771
+ "aria-describedby": void 0,
2772
+ children: /* @__PURE__ */ a.jsxs("div", { className: "p-4 overflow-y-auto overscroll-none", children: [
2773
+ /* @__PURE__ */ a.jsx(nn, { children: /* @__PURE__ */ a.jsx(tn, { children: "Navigation" }) }),
2774
+ t.map((n) => /* @__PURE__ */ a.jsx(
2775
+ be,
2776
+ {
2777
+ item: n,
2778
+ onRequestClose: e
2779
+ },
2780
+ n.label
2781
+ ))
2782
+ ] })
2783
+ }
2784
+ )
2785
+ ] }), di = ({ children: e }) => {
2786
+ const [t, n] = It(!1), { navigation: r } = Pt(), o = r.length > 0, s = At().state === "loading", { options: i } = Y();
2787
+ return /* @__PURE__ */ a.jsxs(
2788
+ mt,
2789
+ {
2790
+ direction: i.site?.dir === "rtl" ? "right" : "left",
2791
+ open: t,
2792
+ onOpenChange: (u) => n(u),
2793
+ children: [
2794
+ o && /* @__PURE__ */ a.jsx(
2795
+ li,
2796
+ {
2797
+ onRequestClose: () => n(!1),
2798
+ navigation: r
2799
+ }
2800
+ ),
2801
+ o && /* @__PURE__ */ a.jsx("div", { className: "lg:hidden -mx-4 px-4 py-2 sticky bg-background/80 backdrop-blur-xs z-10 top-0 start-0 end-0 border-b", children: /* @__PURE__ */ a.jsxs(si, { className: "flex items-center gap-2 px-4", children: [
2802
+ /* @__PURE__ */ a.jsx(Wt, { size: 16, strokeWidth: 1.5 }),
2803
+ /* @__PURE__ */ a.jsx("span", { className: "text-sm", children: "Menu" })
2804
+ ] }) }),
2805
+ /* @__PURE__ */ a.jsxs(
2806
+ "main",
2807
+ {
2808
+ "data-pagefind-body": !0,
2809
+ className: E(
2810
+ "px-4 lg:pe-8 lg:px-8",
2811
+ !o && "col-span-full",
2812
+ s && "animate-pulse"
2813
+ ),
2814
+ children: [
2815
+ /* @__PURE__ */ a.jsx(N.Target, { name: "content-before" }),
2816
+ e,
2817
+ /* @__PURE__ */ a.jsx(N.Target, { name: "content-after" })
2818
+ ]
2819
+ }
2820
+ )
2821
+ ]
2822
+ }
2823
+ );
2824
+ }, hi = () => /* @__PURE__ */ a.jsx("main", { className: "col-span-full row-span-full grid place-items-center", children: /* @__PURE__ */ a.jsx(rn, {}) }), fi = ({ children: e }) => {
2825
+ const { authentication: t } = Y();
2826
+ return Gt(), ti(), X(() => {
2827
+ t?.onPageLoad?.();
2828
+ }, [t]), /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
2829
+ /* @__PURE__ */ a.jsx(N.Target, { name: "layout-before-head" }),
2830
+ /* @__PURE__ */ a.jsx(qt, {}),
2831
+ /* @__PURE__ */ a.jsx(N.Target, { name: "layout-after-head" }),
2832
+ /* @__PURE__ */ a.jsx(
2833
+ "div",
2834
+ {
2835
+ className: E(
2836
+ "grid max-w-screen-2xl w-full lg:mx-auto",
2837
+ "[&:has(>:only-child)]:grid-rows-1 grid-rows-[0_min-content_1fr] lg:grid-rows-[min-content_1fr]",
2838
+ "grid-cols-1 lg:grid-cols-[var(--side-nav-width)_1fr]"
2839
+ ),
2840
+ children: /* @__PURE__ */ a.jsx(St, { fallback: /* @__PURE__ */ a.jsx(hi, {}), children: /* @__PURE__ */ a.jsx(di, { children: e ?? /* @__PURE__ */ a.jsx(Ct, {}) }) })
2841
+ }
2842
+ ),
2843
+ /* @__PURE__ */ a.jsx(oi, {})
2844
+ ] });
2845
+ }, pi = ({ children: e }) => {
2846
+ const { meta: t, options: n } = Y(), r = Ve();
2847
+ return /* @__PURE__ */ a.jsxs(a.Fragment, { children: [
2848
+ /* @__PURE__ */ a.jsxs(Me, { titleTemplate: t?.title, defaultTitle: t?.defaultTitle, children: [
2849
+ n.canonicalUrlOrigin && /* @__PURE__ */ a.jsx(
2850
+ "link",
2851
+ {
2852
+ rel: "canonical",
2853
+ href: Ot(
2854
+ n.canonicalUrlOrigin,
2855
+ n.basePath,
2856
+ r.pathname
2857
+ )
2858
+ }
2859
+ ),
2860
+ t?.description && /* @__PURE__ */ a.jsx("meta", { name: "description", content: t.description }),
2861
+ t?.favicon && /* @__PURE__ */ a.jsx("link", { rel: "icon", href: t.favicon })
2862
+ ] }),
2863
+ e
2864
+ ] });
2865
+ }, mi = ({
2866
+ title: e = "An error occurred",
2867
+ message: t,
2868
+ category: n
2869
+ }) => /* @__PURE__ */ a.jsxs(Jt, { className: "h-full pt-(--padding-content-top)", children: [
2870
+ n && /* @__PURE__ */ a.jsx(on, { children: n }),
2871
+ e && /* @__PURE__ */ a.jsx(Yt, { level: 1, className: "flex gap-3.5 items-center", children: e }),
2872
+ /* @__PURE__ */ a.jsx("p", { children: t })
2873
+ ] }), gi = (e) => {
2874
+ switch (e) {
2875
+ case 400:
2876
+ return {
2877
+ title: "Bad Request",
2878
+ message: "The request could not be understood by the server due to malformed syntax."
2879
+ };
2880
+ case 403:
2881
+ return {
2882
+ title: "Forbidden",
2883
+ message: "You don't have permission to access this resource."
2884
+ };
2885
+ case 404:
2886
+ return {
2887
+ title: "Not Found",
2888
+ message: "The requested resource could not be found."
2889
+ };
2890
+ case 405:
2891
+ return {
2892
+ title: "Method Not Allowed",
2893
+ message: "The request method is not supported for the requested resource."
2894
+ };
2895
+ case 414:
2896
+ return {
2897
+ title: "Request URI Too Large",
2898
+ message: "The request URI is too large."
2899
+ };
2900
+ case 416:
2901
+ return {
2902
+ title: "Range Not Satisfiable",
2903
+ message: "The server cannot satisfy the request range."
2904
+ };
2905
+ case 500:
2906
+ return {
2907
+ title: "Internal Server Error",
2908
+ message: "An unexpected error occurred while processing your request."
2909
+ };
2910
+ case 501:
2911
+ return {
2912
+ title: "Not Implemented",
2913
+ message: "The server does not support the functionality required to fulfill the request."
2914
+ };
2915
+ case 502:
2916
+ return {
2917
+ title: "Bad Gateway",
2918
+ message: "The server received an invalid response from the upstream server."
2919
+ };
2920
+ case 503:
2921
+ return {
2922
+ title: "Service Unavailable",
2923
+ message: "The server is temporarily unable to handle the request."
2924
+ };
2925
+ case 504:
2926
+ return {
2927
+ title: "Gateway Timeout",
2928
+ message: "The server did not receive a timely response from the upstream server."
2929
+ };
2930
+ default:
2931
+ return {
2932
+ title: "An error occurred",
2933
+ message: "Something went wrong while processing your request."
2934
+ };
2935
+ }
2936
+ }, vi = ({ statusCode: e, message: t }) => {
2937
+ if (e === 404)
2938
+ return /* @__PURE__ */ a.jsx(sn, {});
2939
+ const n = gi(e);
2940
+ return /* @__PURE__ */ a.jsx(
2941
+ mi,
2942
+ {
2943
+ title: n.title,
2944
+ message: t ?? n.message,
2945
+ category: e
2946
+ }
2947
+ );
2948
+ };
2949
+ function _i({ error: e }) {
2950
+ return /* @__PURE__ */ a.jsx(Xt, { error: e });
2951
+ }
2952
+ const Ci = fi, Ni = an, Ri = _i, Ui = gn, Fi = vn, qi = Qt, Qi = Me, Mi = vi, Li = ei, Bi = pi;
2953
+ export {
2954
+ Ui as Bootstrap,
2955
+ Fi as BootstrapStatic,
2956
+ Li as BuildCheck,
2957
+ Qi as Head,
2958
+ Ci as Layout,
2959
+ Bi as Meta,
2960
+ qi as RouteGuard,
2961
+ Ni as RouterError,
2962
+ Ri as ServerError,
2963
+ Mi as StatusPage
2964
+ };
2965
+ //# sourceMappingURL=zudoku.__internal.js.map