likec4 1.55.1 → 1.57.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 (244) hide show
  1. package/__app__/chunks/AIChat2.mjs +2 -0
  2. package/__app__/chunks/DiagramActorProvider.mjs +10 -0
  3. package/__app__/chunks/EmbedPage.mjs +1 -0
  4. package/__app__/chunks/ExportPage.mjs +2 -0
  5. package/__app__/chunks/LikeC4Diagram.mjs +19 -0
  6. package/__app__/chunks/LikeC4Styles.mjs +48 -0
  7. package/__app__/chunks/Markdown.mjs +1 -0
  8. package/__app__/chunks/NavigationPanel.mjs +1 -0
  9. package/__app__/chunks/ViewReact.mjs +1 -0
  10. package/__app__/chunks/adhoc-editor.mjs +1 -0
  11. package/__app__/chunks/aichat.mjs +1 -0
  12. package/__app__/chunks/box.mjs +1 -0
  13. package/__app__/chunks/create-style-context.mjs +1 -0
  14. package/__app__/chunks/css.mjs +1 -0
  15. package/__app__/chunks/factory.mjs +1 -0
  16. package/__app__/chunks/hooks.mjs +1 -0
  17. package/__app__/chunks/hstack.mjs +1 -0
  18. package/__app__/chunks/libs/@dagrejs/dagre.mjs +1 -0
  19. package/__app__/chunks/libs/@floating-ui/core.mjs +1 -0
  20. package/__app__/chunks/libs/@floating-ui/dom.mjs +1 -0
  21. package/__app__/chunks/libs/@floating-ui/react.mjs +1 -0
  22. package/__app__/chunks/libs/@mantine/core.mjs +41 -0
  23. package/__app__/chunks/libs/@mantine/hooks.mjs +1 -0
  24. package/__app__/chunks/libs/@nanostores/react.mjs +1 -0
  25. package/__app__/chunks/libs/@react-hookz/web.mjs +1 -0
  26. package/__app__/chunks/libs/@tabler/icons-react.mjs +358 -0
  27. package/__app__/chunks/libs/@tanstack/ai-client.mjs +2 -0
  28. package/__app__/chunks/libs/@tanstack/ai-react-ui.mjs +1 -0
  29. package/__app__/chunks/libs/@tanstack/ai-react.mjs +1 -0
  30. package/__app__/chunks/libs/@tanstack/ai.mjs +2 -0
  31. package/__app__/chunks/libs/@tanstack/history.mjs +1 -0
  32. package/__app__/chunks/libs/@tanstack/react-router.mjs +3 -0
  33. package/__app__/chunks/libs/@tanstack/router-core.mjs +1 -0
  34. package/__app__/chunks/libs/@xstate/react.mjs +1 -0
  35. package/__app__/chunks/libs/@xstate/store.mjs +1 -0
  36. package/__app__/chunks/libs/@xyflow/react.mjs +7 -0
  37. package/__app__/chunks/libs/@zag-js/anatomy.mjs +1 -0
  38. package/__app__/chunks/libs/@zag-js/collection.mjs +1 -0
  39. package/__app__/chunks/libs/@zag-js/core.mjs +1 -0
  40. package/__app__/chunks/libs/@zag-js/react.mjs +1 -0
  41. package/__app__/chunks/libs/@zag-js/tree-view.mjs +1 -0
  42. package/__app__/chunks/libs/bezier-js.mjs +1 -0
  43. package/__app__/chunks/libs/copy-anything.mjs +1 -0
  44. package/__app__/chunks/libs/d3-path.mjs +1 -0
  45. package/__app__/chunks/libs/d3-shape.mjs +1 -0
  46. package/__app__/chunks/libs/fast-equals.mjs +1 -0
  47. package/__app__/chunks/libs/framer-motion.mjs +9 -0
  48. package/__app__/chunks/libs/html-to-image.mjs +2 -0
  49. package/__app__/chunks/libs/motion-dom.mjs +1 -0
  50. package/__app__/chunks/libs/nanostores.mjs +1 -0
  51. package/__app__/chunks/libs/react-error-boundary.mjs +1 -0
  52. package/__app__/chunks/libs/react-resizable-panels.mjs +1 -0
  53. package/__app__/chunks/libs/remeda.mjs +1 -0
  54. package/__app__/chunks/libs/superjson.mjs +1 -0
  55. package/__app__/chunks/libs/zod.mjs +64 -0
  56. package/__app__/chunks/rolldown-runtime.mjs +1 -0
  57. package/__app__/chunks/styles.css.mjs +1 -0
  58. package/__app__/chunks/txt.mjs +1 -0
  59. package/__app__/chunks/useLikeC4Project.mjs +1 -0
  60. package/__app__/codegen/react.mjs +11 -0
  61. package/__app__/codegen/webcomponent.mjs +942 -0
  62. package/__app__/src/aichat/index.mjs +1 -0
  63. package/__app__/src/fonts.css +1 -1
  64. package/__app__/src/main.mjs +45 -0
  65. package/__app__/src/pages/AdHocViewEditor.mjs +1 -0
  66. package/__app__/src/pages/EmbedPage.mjs +1 -0
  67. package/__app__/src/pages/ExportPage.mjs +1 -0
  68. package/__app__/src/pages/ProjectsOverview.mjs +1 -0
  69. package/__app__/src/pages/ViewAsD2.mjs +1 -0
  70. package/__app__/src/pages/ViewAsDot.mjs +1 -0
  71. package/__app__/src/pages/ViewAsMmd.mjs +1 -0
  72. package/__app__/src/pages/ViewAsPuml.mjs +1 -0
  73. package/__app__/src/pages/ViewEditor.mjs +1 -0
  74. package/__app__/src/pages/ViewReact.mjs +1 -0
  75. package/__app__/src/style.css +1 -1
  76. package/config/schema.json +14 -41
  77. package/dist/chunks/enableServer.mjs +1 -0
  78. package/dist/chunks/filenames.mjs +17 -0
  79. package/dist/{_chunks → chunks}/index.d.mts +2 -1
  80. package/dist/{_chunks → chunks}/index2.d.mts +639 -388
  81. package/dist/chunks/libs/@chevrotain/gast.mjs +1 -0
  82. package/dist/chunks/libs/@chevrotain/regexp-to-ast.mjs +9 -0
  83. package/dist/chunks/libs/@chevrotain/utils.mjs +1 -0
  84. package/dist/chunks/libs/@hono/mcp.mjs +70 -0
  85. package/dist/chunks/libs/@hono/node-server.mjs +1 -0
  86. package/dist/{_chunks → chunks}/libs/@logtape/logtape.d.mts +2 -0
  87. package/dist/chunks/libs/@logtape/logtape.mjs +4 -0
  88. package/dist/chunks/libs/@lume/kiwi.mjs +1 -0
  89. package/dist/chunks/libs/@modelcontextprotocol/sdk.mjs +12 -0
  90. package/dist/chunks/libs/@ts-graphviz/ast.mjs +3 -0
  91. package/dist/chunks/libs/@ts-graphviz/common.d.mts +9 -0
  92. package/dist/chunks/libs/@ts-graphviz/core.mjs +1 -0
  93. package/dist/chunks/libs/ajv.mjs +1 -0
  94. package/dist/chunks/libs/ansi-align.mjs +2 -0
  95. package/dist/chunks/libs/ansi-regex.mjs +1 -0
  96. package/dist/chunks/libs/ansi-styles.mjs +1 -0
  97. package/dist/chunks/libs/atomically.mjs +1 -0
  98. package/dist/chunks/libs/birpc.mjs +1 -0
  99. package/dist/chunks/libs/boxen.mjs +22 -0
  100. package/dist/chunks/libs/chevrotain-allstar.mjs +2 -0
  101. package/dist/chunks/libs/chevrotain.mjs +58 -0
  102. package/dist/chunks/libs/conf.mjs +1 -0
  103. package/dist/chunks/libs/defu.mjs +1 -0
  104. package/dist/chunks/libs/destr.mjs +1 -0
  105. package/dist/chunks/libs/eventemitter3.mjs +1 -0
  106. package/dist/chunks/libs/find-up-simple.mjs +1 -0
  107. package/dist/chunks/libs/get-port.mjs +1 -0
  108. package/dist/chunks/libs/hono.mjs +1 -0
  109. package/dist/chunks/libs/is-docker.mjs +1 -0
  110. package/dist/chunks/libs/is-error-instance.mjs +1 -0
  111. package/dist/chunks/libs/is-inside-container.mjs +1 -0
  112. package/dist/chunks/libs/is-plain-obj.mjs +1 -0
  113. package/dist/chunks/libs/isexe.mjs +1 -0
  114. package/dist/chunks/libs/json5.mjs +14 -0
  115. package/dist/chunks/libs/khroma.mjs +1 -0
  116. package/dist/chunks/libs/ky.mjs +3 -0
  117. package/dist/{_chunks → chunks}/libs/langium.d.mts +9 -9
  118. package/dist/chunks/libs/langium.mjs +32 -0
  119. package/dist/chunks/libs/merge-error-cause.mjs +2 -0
  120. package/dist/chunks/libs/p-debounce.mjs +1 -0
  121. package/dist/chunks/libs/p-limit.mjs +1 -0
  122. package/dist/chunks/libs/p-queue.mjs +1 -0
  123. package/dist/chunks/libs/p-timeout.mjs +1 -0
  124. package/dist/chunks/libs/package-manager-detector.mjs +1 -0
  125. package/dist/chunks/libs/package-up.mjs +1 -0
  126. package/dist/chunks/libs/pako.mjs +3 -0
  127. package/dist/chunks/libs/parse-ms.mjs +1 -0
  128. package/dist/chunks/libs/pathe.mjs +1 -0
  129. package/dist/chunks/libs/picomatch.mjs +1 -0
  130. package/dist/chunks/libs/pretty-ms.mjs +1 -0
  131. package/dist/chunks/libs/remeda.mjs +1 -0
  132. package/dist/chunks/libs/safe-stringify.mjs +1 -0
  133. package/dist/chunks/libs/strip-indent.mjs +1 -0
  134. package/dist/chunks/libs/tinyrainbow.mjs +1 -0
  135. package/dist/chunks/libs/ts-graphviz.mjs +1 -0
  136. package/dist/chunks/libs/ufo.mjs +1 -0
  137. package/dist/chunks/libs/unctx.mjs +1 -0
  138. package/dist/chunks/libs/unstorage.mjs +1 -0
  139. package/dist/chunks/libs/vscode-languageserver.mjs +1 -0
  140. package/dist/chunks/libs/which.mjs +1 -0
  141. package/dist/chunks/libs/word-wrap.mjs +12 -0
  142. package/dist/{_chunks → chunks}/libs/zod.d.mts +62 -25
  143. package/dist/chunks/node.mjs +93 -0
  144. package/dist/chunks/plugin.mjs +593 -0
  145. package/dist/chunks/rolldown-runtime.mjs +1 -0
  146. package/dist/chunks/sequence-view.mjs +1 -0
  147. package/dist/cli/index.mjs +188 -59
  148. package/dist/config/index.d.mts +1 -2
  149. package/dist/config/index.mjs +1 -1
  150. package/dist/index.d.mts +2 -135
  151. package/dist/index.mjs +1 -1
  152. package/dist/model/index.d.mts +3 -2
  153. package/dist/model/index.mjs +1 -1
  154. package/dist/vite-plugin/index.d.mts +90 -9
  155. package/dist/vite-plugin/index.mjs +1 -1
  156. package/dist/vite-plugin/internal/chunks/libs/@nanostores/react.mjs +1 -0
  157. package/dist/vite-plugin/internal/chunks/libs/birpc.mjs +1 -0
  158. package/dist/vite-plugin/internal/chunks/libs/fast-equals.mjs +1 -0
  159. package/dist/vite-plugin/internal/chunks/libs/nanostores.mjs +1 -0
  160. package/dist/vite-plugin/internal/chunks/libs/remeda.mjs +1 -0
  161. package/dist/vite-plugin/internal/chunks/rolldown-runtime.mjs +1 -0
  162. package/dist/{_chunks/libs/@nanostores/react.d.mts → vite-plugin/internal/index.d.mts} +103 -45
  163. package/dist/vite-plugin/internal/index.mjs +1 -0
  164. package/package.json +74 -80
  165. package/react/index.d.mts +84 -78
  166. package/react/index.mjs +51954 -53701
  167. package/vite-plugin/internal/package.json +2 -2
  168. package/vite-plugin-modules.d.ts +18 -0
  169. package/__app__/react/likec4.tsx +0 -25
  170. package/__app__/src/ProjectsOverview.js +0 -16
  171. package/__app__/src/const.js +0 -19
  172. package/__app__/src/likec4.js +0 -21254
  173. package/__app__/src/main.js +0 -7
  174. package/__app__/src/routes/index.js +0 -324
  175. package/__app__/src/routes/projects.js +0 -193
  176. package/__app__/src/routes/single.js +0 -1983
  177. package/__app__/src/vendors.js +0 -52683
  178. package/__app__/src/webcomponent.js +0 -68
  179. package/dist/THIRD-PARTY-LICENSES.md +0 -1609
  180. package/dist/_chunks/libs/@chevrotain/cst-dts-gen.mjs +0 -30
  181. package/dist/_chunks/libs/@chevrotain/regexp-to-ast.mjs +0 -9
  182. package/dist/_chunks/libs/@chevrotain/types.d.mts +0 -1
  183. package/dist/_chunks/libs/@chevrotain/utils.mjs +0 -1
  184. package/dist/_chunks/libs/@hono/mcp.mjs +0 -45
  185. package/dist/_chunks/libs/@hono/node-server.mjs +0 -1
  186. package/dist/_chunks/libs/@logtape/logtape.mjs +0 -4
  187. package/dist/_chunks/libs/@lume/kiwi.mjs +0 -1
  188. package/dist/_chunks/libs/@modelcontextprotocol/sdk.mjs +0 -12
  189. package/dist/_chunks/libs/@nanostores/react.mjs +0 -1
  190. package/dist/_chunks/libs/ajv.mjs +0 -1
  191. package/dist/_chunks/libs/ansi-align.mjs +0 -2
  192. package/dist/_chunks/libs/ansi-regex.mjs +0 -1
  193. package/dist/_chunks/libs/ansi-styles.mjs +0 -1
  194. package/dist/_chunks/libs/atomically.mjs +0 -1
  195. package/dist/_chunks/libs/birpc.mjs +0 -1
  196. package/dist/_chunks/libs/boxen.mjs +0 -22
  197. package/dist/_chunks/libs/chevrotain-allstar.mjs +0 -2
  198. package/dist/_chunks/libs/chevrotain.mjs +0 -58
  199. package/dist/_chunks/libs/conf.mjs +0 -1
  200. package/dist/_chunks/libs/defu.mjs +0 -1
  201. package/dist/_chunks/libs/destr.mjs +0 -1
  202. package/dist/_chunks/libs/esm-env.mjs +0 -1
  203. package/dist/_chunks/libs/eventemitter3.mjs +0 -1
  204. package/dist/_chunks/libs/fast-equals.mjs +0 -1
  205. package/dist/_chunks/libs/find-up-simple.mjs +0 -1
  206. package/dist/_chunks/libs/get-port.mjs +0 -1
  207. package/dist/_chunks/libs/is-docker.mjs +0 -1
  208. package/dist/_chunks/libs/is-error-instance.mjs +0 -1
  209. package/dist/_chunks/libs/is-inside-container.mjs +0 -1
  210. package/dist/_chunks/libs/is-plain-obj.mjs +0 -1
  211. package/dist/_chunks/libs/isexe.mjs +0 -1
  212. package/dist/_chunks/libs/json5.mjs +0 -14
  213. package/dist/_chunks/libs/khroma.mjs +0 -1
  214. package/dist/_chunks/libs/ky.mjs +0 -3
  215. package/dist/_chunks/libs/langium.mjs +0 -33
  216. package/dist/_chunks/libs/merge-error-cause.mjs +0 -2
  217. package/dist/_chunks/libs/p-limit.mjs +0 -1
  218. package/dist/_chunks/libs/p-queue.mjs +0 -1
  219. package/dist/_chunks/libs/p-timeout.mjs +0 -1
  220. package/dist/_chunks/libs/package-manager-detector.mjs +0 -1
  221. package/dist/_chunks/libs/package-up.mjs +0 -1
  222. package/dist/_chunks/libs/pako.mjs +0 -1
  223. package/dist/_chunks/libs/parse-ms.mjs +0 -1
  224. package/dist/_chunks/libs/pathe.mjs +0 -1
  225. package/dist/_chunks/libs/picomatch.mjs +0 -1
  226. package/dist/_chunks/libs/pretty-ms.mjs +0 -1
  227. package/dist/_chunks/libs/remeda.mjs +0 -2
  228. package/dist/_chunks/libs/safe-stringify.mjs +0 -1
  229. package/dist/_chunks/libs/strip-indent.mjs +0 -1
  230. package/dist/_chunks/libs/tinyrainbow.mjs +0 -1
  231. package/dist/_chunks/libs/ts-graphviz.d.mts +0 -10
  232. package/dist/_chunks/libs/ts-graphviz.mjs +0 -4
  233. package/dist/_chunks/libs/ufo.mjs +0 -1
  234. package/dist/_chunks/libs/unstorage.mjs +0 -1
  235. package/dist/_chunks/libs/vscode-languageserver.mjs +0 -1
  236. package/dist/_chunks/libs/which.mjs +0 -1
  237. package/dist/_chunks/libs/word-wrap.mjs +0 -12
  238. package/dist/_chunks/node.mjs +0 -76
  239. package/dist/_chunks/rolldown-runtime.mjs +0 -1
  240. package/dist/_chunks/sequence.mjs +0 -1
  241. package/dist/_chunks/src.mjs +0 -17
  242. package/dist/_chunks/src2.mjs +0 -499
  243. package/dist/vite-plugin/internal.d.mts +0 -44
  244. package/dist/vite-plugin/internal.mjs +0 -1
@@ -0,0 +1,942 @@
1
+ import { LikeC4View as LikeC4View$1 } from "likec4:react";
2
+ import { ComponentName } from "likec4:app-config";
3
+ import { createRoot } from "react-dom/client";
4
+ import { jsx } from "react/jsx-runtime";
5
+
6
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/core.js
7
+ var _a;
8
+ function $constructor(name, initializer, params) {
9
+ function init(inst, def) {
10
+ if (!inst._zod) Object.defineProperty(inst, "_zod", {
11
+ value: {
12
+ def,
13
+ constr: _,
14
+ traits: /* @__PURE__ */ new Set()
15
+ },
16
+ enumerable: false
17
+ });
18
+ if (inst._zod.traits.has(name)) return;
19
+ inst._zod.traits.add(name);
20
+ initializer(inst, def);
21
+ const proto = _.prototype;
22
+ const keys = Object.keys(proto);
23
+ for (let i = 0; i < keys.length; i++) {
24
+ const k = keys[i];
25
+ if (!(k in inst)) inst[k] = proto[k].bind(inst);
26
+ }
27
+ }
28
+ const Parent = params?.Parent ?? Object;
29
+ class Definition extends Parent {}
30
+ Object.defineProperty(Definition, "name", { value: name });
31
+ function _(def) {
32
+ var _a;
33
+ const inst = params?.Parent ? new Definition() : this;
34
+ init(inst, def);
35
+ (_a = inst._zod).deferred ?? (_a.deferred = []);
36
+ for (const fn of inst._zod.deferred) fn();
37
+ return inst;
38
+ }
39
+ Object.defineProperty(_, "init", { value: init });
40
+ Object.defineProperty(_, Symbol.hasInstance, { value: (inst) => {
41
+ if (params?.Parent && inst instanceof params.Parent) return true;
42
+ return inst?._zod?.traits?.has(name);
43
+ } });
44
+ Object.defineProperty(_, "name", { value: name });
45
+ return _;
46
+ }
47
+ var $ZodAsyncError = class extends Error {
48
+ constructor() {
49
+ super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
50
+ }
51
+ };
52
+ (_a = globalThis).__zod_globalConfig ?? (_a.__zod_globalConfig = {});
53
+ const globalConfig = globalThis.__zod_globalConfig;
54
+ function config(newConfig) {
55
+ if (newConfig) Object.assign(globalConfig, newConfig);
56
+ return globalConfig;
57
+ }
58
+
59
+ //#endregion
60
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/util.js
61
+ function jsonStringifyReplacer(_, value) {
62
+ if (typeof value === "bigint") return value.toString();
63
+ return value;
64
+ }
65
+ function cached(getter) {
66
+ return { get value() {
67
+ {
68
+ const value = getter();
69
+ Object.defineProperty(this, "value", { value });
70
+ return value;
71
+ }
72
+ throw new Error("cached value already set");
73
+ } };
74
+ }
75
+ function cleanRegex(source) {
76
+ const start = source.startsWith("^") ? 1 : 0;
77
+ const end = source.endsWith("$") ? source.length - 1 : source.length;
78
+ return source.slice(start, end);
79
+ }
80
+ const EVALUATING = /* @__PURE__ */ Symbol("evaluating");
81
+ function defineLazy(object, key, getter) {
82
+ let value = void 0;
83
+ Object.defineProperty(object, key, {
84
+ get() {
85
+ if (value === EVALUATING) return;
86
+ if (value === void 0) {
87
+ value = EVALUATING;
88
+ value = getter();
89
+ }
90
+ return value;
91
+ },
92
+ set(v) {
93
+ Object.defineProperty(object, key, { value: v });
94
+ },
95
+ configurable: true
96
+ });
97
+ }
98
+ const captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {};
99
+ function isObject(data) {
100
+ return typeof data === "object" && data !== null && !Array.isArray(data);
101
+ }
102
+ function isPlainObject(o) {
103
+ if (isObject(o) === false) return false;
104
+ const ctor = o.constructor;
105
+ if (ctor === void 0) return true;
106
+ if (typeof ctor !== "function") return true;
107
+ const prot = ctor.prototype;
108
+ if (isObject(prot) === false) return false;
109
+ if (Object.prototype.hasOwnProperty.call(prot, "isPrototypeOf") === false) return false;
110
+ return true;
111
+ }
112
+ function shallowClone(o) {
113
+ if (isPlainObject(o)) return { ...o };
114
+ if (Array.isArray(o)) return [...o];
115
+ if (o instanceof Map) return new Map(o);
116
+ if (o instanceof Set) return new Set(o);
117
+ return o;
118
+ }
119
+ function escapeRegex(str) {
120
+ return str.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
121
+ }
122
+ function clone(inst, def, params) {
123
+ const cl = new inst._zod.constr(def ?? inst._zod.def);
124
+ if (!def || params?.parent) cl._zod.parent = inst;
125
+ return cl;
126
+ }
127
+ function normalizeParams(_params) {
128
+ const params = _params;
129
+ if (!params) return {};
130
+ if (typeof params === "string") return { error: () => params };
131
+ if (params?.message !== void 0) {
132
+ if (params?.error !== void 0) throw new Error("Cannot specify both `message` and `error` params");
133
+ params.error = params.message;
134
+ }
135
+ delete params.message;
136
+ if (typeof params.error === "string") return {
137
+ ...params,
138
+ error: () => params.error
139
+ };
140
+ return params;
141
+ }
142
+ function optionalKeys(shape) {
143
+ return Object.keys(shape).filter((k) => {
144
+ return shape[k]._zod.optin === "optional" && shape[k]._zod.optout === "optional";
145
+ });
146
+ }
147
+ const NUMBER_FORMAT_RANGES = {
148
+ safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
149
+ int32: [-2147483648, 2147483647],
150
+ uint32: [0, 4294967295],
151
+ float32: [-34028234663852886e22, 34028234663852886e22],
152
+ float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
153
+ };
154
+ function aborted(x, startIndex = 0) {
155
+ if (x.aborted === true) return true;
156
+ for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue !== true) return true;
157
+ return false;
158
+ }
159
+ function explicitlyAborted(x, startIndex = 0) {
160
+ if (x.aborted === true) return true;
161
+ for (let i = startIndex; i < x.issues.length; i++) if (x.issues[i]?.continue === false) return true;
162
+ return false;
163
+ }
164
+ function prefixIssues(path, issues) {
165
+ return issues.map((iss) => {
166
+ var _a;
167
+ (_a = iss).path ?? (_a.path = []);
168
+ iss.path.unshift(path);
169
+ return iss;
170
+ });
171
+ }
172
+ function unwrapMessage(message) {
173
+ return typeof message === "string" ? message : message?.message;
174
+ }
175
+ function finalizeIssue(iss, ctx, config) {
176
+ const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input";
177
+ const { inst: _inst, continue: _continue, input: _input, ...rest } = iss;
178
+ rest.path ?? (rest.path = []);
179
+ rest.message = message;
180
+ if (ctx?.reportInput) rest.input = _input;
181
+ return rest;
182
+ }
183
+
184
+ //#endregion
185
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/errors.js
186
+ const initializer = (inst, def) => {
187
+ inst.name = "$ZodError";
188
+ Object.defineProperty(inst, "_zod", {
189
+ value: inst._zod,
190
+ enumerable: false
191
+ });
192
+ Object.defineProperty(inst, "issues", {
193
+ value: def,
194
+ enumerable: false
195
+ });
196
+ inst.message = JSON.stringify(def, jsonStringifyReplacer, 2);
197
+ Object.defineProperty(inst, "toString", {
198
+ value: () => inst.message,
199
+ enumerable: false
200
+ });
201
+ };
202
+ const $ZodError = $constructor("$ZodError", initializer);
203
+ const $ZodRealError = $constructor("$ZodError", initializer, { Parent: Error });
204
+
205
+ //#endregion
206
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/parse.js
207
+ const _parse = (_Err) => (schema, value, _ctx, _params) => {
208
+ const ctx = _ctx ? {
209
+ ..._ctx,
210
+ async: false
211
+ } : { async: false };
212
+ const result = schema._zod.run({
213
+ value,
214
+ issues: []
215
+ }, ctx);
216
+ if (result instanceof Promise) throw new $ZodAsyncError();
217
+ if (result.issues.length) {
218
+ const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
219
+ captureStackTrace(e, _params?.callee);
220
+ throw e;
221
+ }
222
+ return result.value;
223
+ };
224
+ const parse = /* @__PURE__ */ _parse($ZodRealError);
225
+ const _parseAsync = (_Err) => async (schema, value, _ctx, params) => {
226
+ const ctx = _ctx ? {
227
+ ..._ctx,
228
+ async: true
229
+ } : { async: true };
230
+ let result = schema._zod.run({
231
+ value,
232
+ issues: []
233
+ }, ctx);
234
+ if (result instanceof Promise) result = await result;
235
+ if (result.issues.length) {
236
+ const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())));
237
+ captureStackTrace(e, params?.callee);
238
+ throw e;
239
+ }
240
+ return result.value;
241
+ };
242
+ const parseAsync = /* @__PURE__ */ _parseAsync($ZodRealError);
243
+ const _safeParse = (_Err) => (schema, value, _ctx) => {
244
+ const ctx = _ctx ? {
245
+ ..._ctx,
246
+ async: false
247
+ } : { async: false };
248
+ const result = schema._zod.run({
249
+ value,
250
+ issues: []
251
+ }, ctx);
252
+ if (result instanceof Promise) throw new $ZodAsyncError();
253
+ return result.issues.length ? {
254
+ success: false,
255
+ error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
256
+ } : {
257
+ success: true,
258
+ data: result.value
259
+ };
260
+ };
261
+ const safeParse = /* @__PURE__ */ _safeParse($ZodRealError);
262
+ const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
263
+ const ctx = _ctx ? {
264
+ ..._ctx,
265
+ async: true
266
+ } : { async: true };
267
+ let result = schema._zod.run({
268
+ value,
269
+ issues: []
270
+ }, ctx);
271
+ if (result instanceof Promise) result = await result;
272
+ return result.issues.length ? {
273
+ success: false,
274
+ error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
275
+ } : {
276
+ success: true,
277
+ data: result.value
278
+ };
279
+ };
280
+ const safeParseAsync = /* @__PURE__ */ _safeParseAsync($ZodRealError);
281
+
282
+ //#endregion
283
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/regexes.js
284
+ const dateSource = `(?:(?:\\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])))`;
285
+ const date = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
286
+ const string$1 = (params) => {
287
+ const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
288
+ return new RegExp(`^${regex}$`);
289
+ };
290
+ const boolean = /^(?:true|false)$/i;
291
+
292
+ //#endregion
293
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/versions.js
294
+ const version = {
295
+ major: 4,
296
+ minor: 4,
297
+ patch: 3
298
+ };
299
+
300
+ //#endregion
301
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/schemas.js
302
+ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
303
+ var _a;
304
+ inst ?? (inst = {});
305
+ inst._zod.def = def;
306
+ inst._zod.bag = inst._zod.bag || {};
307
+ inst._zod.version = version;
308
+ const checks = [...inst._zod.def.checks ?? []];
309
+ if (inst._zod.traits.has("$ZodCheck")) checks.unshift(inst);
310
+ for (const ch of checks) for (const fn of ch._zod.onattach) fn(inst);
311
+ if (checks.length === 0) {
312
+ (_a = inst._zod).deferred ?? (_a.deferred = []);
313
+ inst._zod.deferred?.push(() => {
314
+ inst._zod.run = inst._zod.parse;
315
+ });
316
+ } else {
317
+ const runChecks = (payload, checks, ctx) => {
318
+ let isAborted = aborted(payload);
319
+ let asyncResult;
320
+ for (const ch of checks) {
321
+ if (ch._zod.def.when) {
322
+ if (explicitlyAborted(payload)) continue;
323
+ if (!ch._zod.def.when(payload)) continue;
324
+ } else if (isAborted) continue;
325
+ const currLen = payload.issues.length;
326
+ const _ = ch._zod.check(payload);
327
+ if (_ instanceof Promise && ctx?.async === false) throw new $ZodAsyncError();
328
+ if (asyncResult || _ instanceof Promise) asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {
329
+ await _;
330
+ if (payload.issues.length === currLen) return;
331
+ if (!isAborted) isAborted = aborted(payload, currLen);
332
+ });
333
+ else {
334
+ if (payload.issues.length === currLen) continue;
335
+ if (!isAborted) isAborted = aborted(payload, currLen);
336
+ }
337
+ }
338
+ if (asyncResult) return asyncResult.then(() => {
339
+ return payload;
340
+ });
341
+ return payload;
342
+ };
343
+ const handleCanaryResult = (canary, payload, ctx) => {
344
+ if (aborted(canary)) {
345
+ canary.aborted = true;
346
+ return canary;
347
+ }
348
+ const checkResult = runChecks(payload, checks, ctx);
349
+ if (checkResult instanceof Promise) {
350
+ if (ctx.async === false) throw new $ZodAsyncError();
351
+ return checkResult.then((checkResult) => inst._zod.parse(checkResult, ctx));
352
+ }
353
+ return inst._zod.parse(checkResult, ctx);
354
+ };
355
+ inst._zod.run = (payload, ctx) => {
356
+ if (ctx.skipChecks) return inst._zod.parse(payload, ctx);
357
+ if (ctx.direction === "backward") {
358
+ const canary = inst._zod.parse({
359
+ value: payload.value,
360
+ issues: []
361
+ }, {
362
+ ...ctx,
363
+ skipChecks: true
364
+ });
365
+ if (canary instanceof Promise) return canary.then((canary) => {
366
+ return handleCanaryResult(canary, payload, ctx);
367
+ });
368
+ return handleCanaryResult(canary, payload, ctx);
369
+ }
370
+ const result = inst._zod.parse(payload, ctx);
371
+ if (result instanceof Promise) {
372
+ if (ctx.async === false) throw new $ZodAsyncError();
373
+ return result.then((result) => runChecks(result, checks, ctx));
374
+ }
375
+ return runChecks(result, checks, ctx);
376
+ };
377
+ }
378
+ defineLazy(inst, "~standard", () => ({
379
+ validate: (value) => {
380
+ try {
381
+ const r = safeParse(inst, value);
382
+ return r.success ? { value: r.data } : { issues: r.error?.issues };
383
+ } catch (_) {
384
+ return safeParseAsync(inst, value).then((r) => r.success ? { value: r.data } : { issues: r.error?.issues });
385
+ }
386
+ },
387
+ vendor: "zod",
388
+ version: 1
389
+ }));
390
+ });
391
+ const $ZodString = /* @__PURE__ */ $constructor("$ZodString", (inst, def) => {
392
+ $ZodType.init(inst, def);
393
+ inst._zod.pattern = [...inst?._zod.bag?.patterns ?? []].pop() ?? string$1(inst._zod.bag);
394
+ inst._zod.parse = (payload, _) => {
395
+ if (def.coerce) try {
396
+ payload.value = String(payload.value);
397
+ } catch (_) {}
398
+ if (typeof payload.value === "string") return payload;
399
+ payload.issues.push({
400
+ expected: "string",
401
+ code: "invalid_type",
402
+ input: payload.value,
403
+ inst
404
+ });
405
+ return payload;
406
+ };
407
+ });
408
+ const $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
409
+ $ZodType.init(inst, def);
410
+ inst._zod.pattern = boolean;
411
+ inst._zod.parse = (payload, _ctx) => {
412
+ if (def.coerce) try {
413
+ payload.value = Boolean(payload.value);
414
+ } catch (_) {}
415
+ const input = payload.value;
416
+ if (typeof input === "boolean") return payload;
417
+ payload.issues.push({
418
+ expected: "boolean",
419
+ code: "invalid_type",
420
+ input,
421
+ inst
422
+ });
423
+ return payload;
424
+ };
425
+ });
426
+ function handlePropertyResult(result, final, key, input, isOptionalIn, isOptionalOut) {
427
+ const isPresent = key in input;
428
+ if (result.issues.length) {
429
+ if (isOptionalIn && isOptionalOut && !isPresent) return;
430
+ final.issues.push(...prefixIssues(key, result.issues));
431
+ }
432
+ if (!isPresent && !isOptionalIn) {
433
+ if (!result.issues.length) final.issues.push({
434
+ code: "invalid_type",
435
+ expected: "nonoptional",
436
+ input: void 0,
437
+ path: [key]
438
+ });
439
+ return;
440
+ }
441
+ if (result.value === void 0) {
442
+ if (isPresent) final.value[key] = void 0;
443
+ } else final.value[key] = result.value;
444
+ }
445
+ function normalizeDef(def) {
446
+ const keys = Object.keys(def.shape);
447
+ for (const k of keys) if (!def.shape?.[k]?._zod?.traits?.has("$ZodType")) throw new Error(`Invalid element at key "${k}": expected a Zod schema`);
448
+ const okeys = optionalKeys(def.shape);
449
+ return {
450
+ ...def,
451
+ keys,
452
+ keySet: new Set(keys),
453
+ numKeys: keys.length,
454
+ optionalKeys: new Set(okeys)
455
+ };
456
+ }
457
+ function handleCatchall(proms, input, payload, ctx, def, inst) {
458
+ const unrecognized = [];
459
+ const keySet = def.keySet;
460
+ const _catchall = def.catchall._zod;
461
+ const t = _catchall.def.type;
462
+ const isOptionalIn = _catchall.optin === "optional";
463
+ const isOptionalOut = _catchall.optout === "optional";
464
+ for (const key in input) {
465
+ if (key === "__proto__") continue;
466
+ if (keySet.has(key)) continue;
467
+ if (t === "never") {
468
+ unrecognized.push(key);
469
+ continue;
470
+ }
471
+ const r = _catchall.run({
472
+ value: input[key],
473
+ issues: []
474
+ }, ctx);
475
+ if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut)));
476
+ else handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
477
+ }
478
+ if (unrecognized.length) payload.issues.push({
479
+ code: "unrecognized_keys",
480
+ keys: unrecognized,
481
+ input,
482
+ inst
483
+ });
484
+ if (!proms.length) return payload;
485
+ return Promise.all(proms).then(() => {
486
+ return payload;
487
+ });
488
+ }
489
+ const $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
490
+ $ZodType.init(inst, def);
491
+ if (!Object.getOwnPropertyDescriptor(def, "shape")?.get) {
492
+ const sh = def.shape;
493
+ Object.defineProperty(def, "shape", { get: () => {
494
+ const newSh = { ...sh };
495
+ Object.defineProperty(def, "shape", { value: newSh });
496
+ return newSh;
497
+ } });
498
+ }
499
+ const _normalized = cached(() => normalizeDef(def));
500
+ defineLazy(inst._zod, "propValues", () => {
501
+ const shape = def.shape;
502
+ const propValues = {};
503
+ for (const key in shape) {
504
+ const field = shape[key]._zod;
505
+ if (field.values) {
506
+ propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
507
+ for (const v of field.values) propValues[key].add(v);
508
+ }
509
+ }
510
+ return propValues;
511
+ });
512
+ const isObject$1 = isObject;
513
+ const catchall = def.catchall;
514
+ let value;
515
+ inst._zod.parse = (payload, ctx) => {
516
+ value ?? (value = _normalized.value);
517
+ const input = payload.value;
518
+ if (!isObject$1(input)) {
519
+ payload.issues.push({
520
+ expected: "object",
521
+ code: "invalid_type",
522
+ input,
523
+ inst
524
+ });
525
+ return payload;
526
+ }
527
+ payload.value = {};
528
+ const proms = [];
529
+ const shape = value.shape;
530
+ for (const key of value.keys) {
531
+ const el = shape[key];
532
+ const isOptionalIn = el._zod.optin === "optional";
533
+ const isOptionalOut = el._zod.optout === "optional";
534
+ const r = el._zod.run({
535
+ value: input[key],
536
+ issues: []
537
+ }, ctx);
538
+ if (r instanceof Promise) proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut)));
539
+ else handlePropertyResult(r, payload, key, input, isOptionalIn, isOptionalOut);
540
+ }
541
+ if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload;
542
+ return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
543
+ };
544
+ });
545
+ const $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
546
+ $ZodType.init(inst, def);
547
+ if (def.values.length === 0) throw new Error("Cannot create literal schema with no valid values");
548
+ const values = new Set(def.values);
549
+ inst._zod.values = values;
550
+ inst._zod.pattern = new RegExp(`^(${def.values.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$`);
551
+ inst._zod.parse = (payload, _ctx) => {
552
+ const input = payload.value;
553
+ if (values.has(input)) return payload;
554
+ payload.issues.push({
555
+ code: "invalid_value",
556
+ values: def.values,
557
+ input,
558
+ inst
559
+ });
560
+ return payload;
561
+ };
562
+ });
563
+ function handleOptionalResult(result, input) {
564
+ if (input === void 0 && (result.issues.length || result.fallback)) return {
565
+ issues: [],
566
+ value: void 0
567
+ };
568
+ return result;
569
+ }
570
+ const $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
571
+ $ZodType.init(inst, def);
572
+ inst._zod.optin = "optional";
573
+ inst._zod.optout = "optional";
574
+ defineLazy(inst._zod, "values", () => {
575
+ return def.innerType._zod.values ? new Set([...def.innerType._zod.values, void 0]) : void 0;
576
+ });
577
+ defineLazy(inst._zod, "pattern", () => {
578
+ const pattern = def.innerType._zod.pattern;
579
+ return pattern ? new RegExp(`^(${cleanRegex(pattern.source)})?$`) : void 0;
580
+ });
581
+ inst._zod.parse = (payload, ctx) => {
582
+ if (def.innerType._zod.optin === "optional") {
583
+ const input = payload.value;
584
+ const result = def.innerType._zod.run(payload, ctx);
585
+ if (result instanceof Promise) return result.then((r) => handleOptionalResult(r, input));
586
+ return handleOptionalResult(result, input);
587
+ }
588
+ if (payload.value === void 0) return payload;
589
+ return def.innerType._zod.run(payload, ctx);
590
+ };
591
+ });
592
+ const $ZodDefault = /* @__PURE__ */ $constructor("$ZodDefault", (inst, def) => {
593
+ $ZodType.init(inst, def);
594
+ inst._zod.optin = "optional";
595
+ defineLazy(inst._zod, "values", () => def.innerType._zod.values);
596
+ inst._zod.parse = (payload, ctx) => {
597
+ if (ctx.direction === "backward") return def.innerType._zod.run(payload, ctx);
598
+ if (payload.value === void 0) {
599
+ payload.value = def.defaultValue;
600
+ /**
601
+ * $ZodDefault returns the default value immediately in forward direction.
602
+ * It doesn't pass the default value into the validator ("prefault"). There's no reason to pass the default value through validation. The validity of the default is enforced by TypeScript statically. Otherwise, it's the responsibility of the user to ensure the default is valid. In the case of pipes with divergent in/out types, you can specify the default on the `in` schema of your ZodPipe to set a "prefault" for the pipe. */
603
+ return payload;
604
+ }
605
+ const result = def.innerType._zod.run(payload, ctx);
606
+ if (result instanceof Promise) return result.then((result) => handleDefaultResult(result, def));
607
+ return handleDefaultResult(result, def);
608
+ };
609
+ });
610
+ function handleDefaultResult(payload, def) {
611
+ if (payload.value === void 0) payload.value = def.defaultValue;
612
+ return payload;
613
+ }
614
+ const $ZodPipe = /* @__PURE__ */ $constructor("$ZodPipe", (inst, def) => {
615
+ $ZodType.init(inst, def);
616
+ defineLazy(inst._zod, "values", () => def.in._zod.values);
617
+ defineLazy(inst._zod, "optin", () => def.in._zod.optin);
618
+ defineLazy(inst._zod, "optout", () => def.out._zod.optout);
619
+ defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
620
+ inst._zod.parse = (payload, ctx) => {
621
+ if (ctx.direction === "backward") {
622
+ const right = def.out._zod.run(payload, ctx);
623
+ if (right instanceof Promise) return right.then((right) => handlePipeResult(right, def.in, ctx));
624
+ return handlePipeResult(right, def.in, ctx);
625
+ }
626
+ const left = def.in._zod.run(payload, ctx);
627
+ if (left instanceof Promise) return left.then((left) => handlePipeResult(left, def.out, ctx));
628
+ return handlePipeResult(left, def.out, ctx);
629
+ };
630
+ });
631
+ function handlePipeResult(left, next, ctx) {
632
+ if (left.issues.length) {
633
+ left.aborted = true;
634
+ return left;
635
+ }
636
+ return next._zod.run({
637
+ value: left.value,
638
+ issues: left.issues,
639
+ fallback: left.fallback
640
+ }, ctx);
641
+ }
642
+ const $ZodCodec = /* @__PURE__ */ $constructor("$ZodCodec", (inst, def) => {
643
+ $ZodType.init(inst, def);
644
+ defineLazy(inst._zod, "values", () => def.in._zod.values);
645
+ defineLazy(inst._zod, "optin", () => def.in._zod.optin);
646
+ defineLazy(inst._zod, "optout", () => def.out._zod.optout);
647
+ defineLazy(inst._zod, "propValues", () => def.in._zod.propValues);
648
+ inst._zod.parse = (payload, ctx) => {
649
+ if ((ctx.direction || "forward") === "forward") {
650
+ const left = def.in._zod.run(payload, ctx);
651
+ if (left instanceof Promise) return left.then((left) => handleCodecAResult(left, def, ctx));
652
+ return handleCodecAResult(left, def, ctx);
653
+ } else {
654
+ const right = def.out._zod.run(payload, ctx);
655
+ if (right instanceof Promise) return right.then((right) => handleCodecAResult(right, def, ctx));
656
+ return handleCodecAResult(right, def, ctx);
657
+ }
658
+ };
659
+ });
660
+ function handleCodecAResult(result, def, ctx) {
661
+ if (result.issues.length) {
662
+ result.aborted = true;
663
+ return result;
664
+ }
665
+ if ((ctx.direction || "forward") === "forward") {
666
+ const transformed = def.transform(result.value, result);
667
+ if (transformed instanceof Promise) return transformed.then((value) => handleCodecTxResult(result, value, def.out, ctx));
668
+ return handleCodecTxResult(result, transformed, def.out, ctx);
669
+ } else {
670
+ const transformed = def.reverseTransform(result.value, result);
671
+ if (transformed instanceof Promise) return transformed.then((value) => handleCodecTxResult(result, value, def.in, ctx));
672
+ return handleCodecTxResult(result, transformed, def.in, ctx);
673
+ }
674
+ }
675
+ function handleCodecTxResult(left, value, nextSchema, ctx) {
676
+ if (left.issues.length) {
677
+ left.aborted = true;
678
+ return left;
679
+ }
680
+ return nextSchema._zod.run({
681
+ value,
682
+ issues: left.issues
683
+ }, ctx);
684
+ }
685
+
686
+ //#endregion
687
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/api.js
688
+ /* @__NO_SIDE_EFFECTS__ */
689
+ function _string(Class, params) {
690
+ return new Class({
691
+ type: "string",
692
+ ...normalizeParams(params)
693
+ });
694
+ }
695
+ /* @__NO_SIDE_EFFECTS__ */
696
+ function _stringbool(Classes, _params) {
697
+ const params = normalizeParams(_params);
698
+ let truthyArray = params.truthy ?? [
699
+ "true",
700
+ "1",
701
+ "yes",
702
+ "on",
703
+ "y",
704
+ "enabled"
705
+ ];
706
+ let falsyArray = params.falsy ?? [
707
+ "false",
708
+ "0",
709
+ "no",
710
+ "off",
711
+ "n",
712
+ "disabled"
713
+ ];
714
+ if (params.case !== "sensitive") {
715
+ truthyArray = truthyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
716
+ falsyArray = falsyArray.map((v) => typeof v === "string" ? v.toLowerCase() : v);
717
+ }
718
+ const truthySet = new Set(truthyArray);
719
+ const falsySet = new Set(falsyArray);
720
+ const _Codec = Classes.Codec ?? $ZodCodec;
721
+ const _Boolean = Classes.Boolean ?? $ZodBoolean;
722
+ const codec = new _Codec({
723
+ type: "pipe",
724
+ in: new (Classes.String ?? $ZodString)({
725
+ type: "string",
726
+ error: params.error
727
+ }),
728
+ out: new _Boolean({
729
+ type: "boolean",
730
+ error: params.error
731
+ }),
732
+ transform: ((input, payload) => {
733
+ let data = input;
734
+ if (params.case !== "sensitive") data = data.toLowerCase();
735
+ if (truthySet.has(data)) return true;
736
+ else if (falsySet.has(data)) return false;
737
+ else {
738
+ payload.issues.push({
739
+ code: "invalid_value",
740
+ expected: "stringbool",
741
+ values: [...truthySet, ...falsySet],
742
+ input: payload.value,
743
+ inst: codec,
744
+ continue: false
745
+ });
746
+ return {};
747
+ }
748
+ }),
749
+ reverseTransform: ((input, _payload) => {
750
+ if (input === true) return truthyArray[0] || "true";
751
+ else return falsyArray[0] || "false";
752
+ }),
753
+ error: params.error
754
+ });
755
+ return codec;
756
+ }
757
+
758
+ //#endregion
759
+ //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/mini/schemas.js
760
+ const ZodMiniType = /* @__PURE__ */ $constructor("ZodMiniType", (inst, def) => {
761
+ if (!inst._zod) throw new Error("Uninitialized schema in ZodMiniType.");
762
+ $ZodType.init(inst, def);
763
+ inst.def = def;
764
+ inst.type = def.type;
765
+ inst.parse = (data, params) => parse(inst, data, params, { callee: inst.parse });
766
+ inst.safeParse = (data, params) => safeParse(inst, data, params);
767
+ inst.parseAsync = async (data, params) => parseAsync(inst, data, params, { callee: inst.parseAsync });
768
+ inst.safeParseAsync = async (data, params) => safeParseAsync(inst, data, params);
769
+ inst.check = (...checks) => {
770
+ return inst.clone({
771
+ ...def,
772
+ checks: [...def.checks ?? [], ...checks.map((ch) => typeof ch === "function" ? { _zod: {
773
+ check: ch,
774
+ def: { check: "custom" },
775
+ onattach: []
776
+ } } : ch)]
777
+ }, { parent: true });
778
+ };
779
+ inst.with = inst.check;
780
+ inst.clone = (_def, params) => clone(inst, _def, params);
781
+ inst.brand = () => inst;
782
+ inst.register = ((reg, meta) => {
783
+ reg.add(inst, meta);
784
+ return inst;
785
+ });
786
+ inst.apply = (fn) => fn(inst);
787
+ });
788
+ const ZodMiniString = /* @__PURE__ */ $constructor("ZodMiniString", (inst, def) => {
789
+ $ZodString.init(inst, def);
790
+ ZodMiniType.init(inst, def);
791
+ });
792
+ /* @__NO_SIDE_EFFECTS__ */
793
+ function string(params) {
794
+ return _string(ZodMiniString, params);
795
+ }
796
+ const ZodMiniBoolean = /* @__PURE__ */ $constructor("ZodMiniBoolean", (inst, def) => {
797
+ $ZodBoolean.init(inst, def);
798
+ ZodMiniType.init(inst, def);
799
+ });
800
+ const ZodMiniObject = /* @__PURE__ */ $constructor("ZodMiniObject", (inst, def) => {
801
+ $ZodObject.init(inst, def);
802
+ ZodMiniType.init(inst, def);
803
+ defineLazy(inst, "shape", () => def.shape);
804
+ });
805
+ /* @__NO_SIDE_EFFECTS__ */
806
+ function object(shape, params) {
807
+ return new ZodMiniObject({
808
+ type: "object",
809
+ shape: shape ?? {},
810
+ ...normalizeParams(params)
811
+ });
812
+ }
813
+ const ZodMiniLiteral = /* @__PURE__ */ $constructor("ZodMiniLiteral", (inst, def) => {
814
+ $ZodLiteral.init(inst, def);
815
+ ZodMiniType.init(inst, def);
816
+ });
817
+ /* @__NO_SIDE_EFFECTS__ */
818
+ function literal(value, params) {
819
+ return new ZodMiniLiteral({
820
+ type: "literal",
821
+ values: Array.isArray(value) ? value : [value],
822
+ ...normalizeParams(params)
823
+ });
824
+ }
825
+ const ZodMiniOptional = /* @__PURE__ */ $constructor("ZodMiniOptional", (inst, def) => {
826
+ $ZodOptional.init(inst, def);
827
+ ZodMiniType.init(inst, def);
828
+ });
829
+ /* @__NO_SIDE_EFFECTS__ */
830
+ function optional(innerType) {
831
+ return new ZodMiniOptional({
832
+ type: "optional",
833
+ innerType
834
+ });
835
+ }
836
+ const ZodMiniDefault = /* @__PURE__ */ $constructor("ZodMiniDefault", (inst, def) => {
837
+ $ZodDefault.init(inst, def);
838
+ ZodMiniType.init(inst, def);
839
+ });
840
+ /* @__NO_SIDE_EFFECTS__ */
841
+ function _default(innerType, defaultValue) {
842
+ return new ZodMiniDefault({
843
+ type: "default",
844
+ innerType,
845
+ get defaultValue() {
846
+ return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
847
+ }
848
+ });
849
+ }
850
+ const ZodMiniPipe = /* @__PURE__ */ $constructor("ZodMiniPipe", (inst, def) => {
851
+ $ZodPipe.init(inst, def);
852
+ ZodMiniType.init(inst, def);
853
+ });
854
+ const ZodMiniCodec = /* @__PURE__ */ $constructor("ZodMiniCodec", (inst, def) => {
855
+ ZodMiniPipe.init(inst, def);
856
+ $ZodCodec.init(inst, def);
857
+ });
858
+ const stringbool = (...args) => _stringbool({
859
+ Codec: ZodMiniCodec,
860
+ Boolean: ZodMiniBoolean,
861
+ String: ZodMiniString
862
+ }, ...args);
863
+
864
+ //#endregion
865
+ //#region codegen/webcomponent.tsx
866
+ const propsSchema = /* @__PURE__ */ object({
867
+ viewId: /* @__PURE__ */ _default(/* @__PURE__ */ string(), "index"),
868
+ browser: /* @__PURE__ */ _default(stringbool(), true),
869
+ dynamicViewVariant: /* @__PURE__ */ optional(/* @__PURE__ */ literal(["diagram", "sequence"])),
870
+ colorScheme: /* @__PURE__ */ optional(/* @__PURE__ */ literal(["light", "dark"]))
871
+ });
872
+ var LikeC4View = class extends HTMLElement {
873
+ shadow;
874
+ root;
875
+ hostCss;
876
+ lastHostCss = "";
877
+ constructor() {
878
+ super();
879
+ this.shadow = this.attachShadow({
880
+ mode: "open",
881
+ delegatesFocus: true
882
+ });
883
+ }
884
+ updateHostCss() {
885
+ const hostCss = `
886
+ :host {
887
+ display: contents;
888
+ background-color: transparent;
889
+ margin: 0;
890
+ padding: 0;
891
+ }`;
892
+ if (hostCss !== this.lastHostCss) {
893
+ this.hostCss?.replaceSync(hostCss);
894
+ this.lastHostCss = hostCss;
895
+ }
896
+ }
897
+ connectedCallback() {
898
+ this.lastHostCss = "";
899
+ this.hostCss = new CSSStyleSheet();
900
+ this.updateHostCss();
901
+ this.shadow.adoptedStyleSheets = [this.hostCss];
902
+ this.render();
903
+ }
904
+ disconnectedCallback() {
905
+ this.root?.unmount();
906
+ this.root = void 0;
907
+ this.shadow.adoptedStyleSheets.length = 0;
908
+ this.hostCss = void 0;
909
+ }
910
+ static observedAttributes = [
911
+ "view-id",
912
+ "browser",
913
+ "dynamic-variant",
914
+ "color-scheme"
915
+ ];
916
+ getProps() {
917
+ const props = propsSchema.safeParse({
918
+ viewId: this.getAttribute("view-id"),
919
+ browser: this.getAttribute("browser") ?? void 0,
920
+ dynamicViewVariant: this.getAttribute("dynamic-variant") ?? void 0,
921
+ colorScheme: this.getAttribute("color-scheme") ?? void 0
922
+ });
923
+ if (!props.success) {
924
+ console.error("Invalid props", props.error);
925
+ return { viewId: "index" };
926
+ }
927
+ return props.data;
928
+ }
929
+ render() {
930
+ const props = this.getProps();
931
+ this.updateHostCss();
932
+ this.root ??= createRoot(this.shadow);
933
+ this.root.render(/* @__PURE__ */ jsx(LikeC4View$1, { ...props }));
934
+ }
935
+ attributeChangedCallback(_name) {
936
+ if (this.root) this.render();
937
+ }
938
+ };
939
+ customElements.define(ComponentName.View, LikeC4View);
940
+
941
+ //#endregion
942
+ export { LikeC4View };