likec4 1.59.4 → 1.61.0

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