likec4 1.57.0 → 1.58.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 (168) hide show
  1. package/__app__/codegen/react.mjs +7 -8
  2. package/__app__/codegen/webcomponent.mjs +70 -881
  3. package/__app__/src/aichat/index.mjs +8 -1
  4. package/__app__/src/chunks/AIChat.mjs +959 -0
  5. package/__app__/src/chunks/DiagramActorProvider.mjs +7638 -0
  6. package/__app__/src/chunks/LikeC4Styles.mjs +1866 -0
  7. package/__app__/src/chunks/Markdown.mjs +146 -0
  8. package/__app__/src/chunks/NavigationPanel.mjs +61 -0
  9. package/__app__/src/chunks/ProjectsOverview.mjs +540 -0
  10. package/__app__/src/chunks/adhoc-editor.mjs +3386 -0
  11. package/__app__/src/chunks/es.mjs +439 -0
  12. package/__app__/src/chunks/hooks.mjs +145 -0
  13. package/__app__/src/chunks/libs/@dagrejs/dagre.mjs +1894 -0
  14. package/__app__/src/chunks/libs/@floating-ui.mjs +2218 -0
  15. package/__app__/src/chunks/libs/@mantine.mjs +12070 -0
  16. package/__app__/src/chunks/libs/@tabler/icons-react.mjs +252 -0
  17. package/__app__/src/chunks/libs/@tanstack-ai.mjs +1768 -0
  18. package/__app__/src/chunks/libs/@tanstack.mjs +2718 -0
  19. package/__app__/src/chunks/libs/@xstate/react.mjs +1982 -0
  20. package/__app__/src/chunks/libs/@xyflow/react.mjs +5256 -0
  21. package/__app__/src/chunks/libs/bezier-js.mjs +1003 -0
  22. package/__app__/src/chunks/libs/d3.mjs +2842 -0
  23. package/__app__/src/chunks/libs/fast-equals.mjs +268 -0
  24. package/__app__/src/chunks/libs/framer.mjs +5872 -0
  25. package/__app__/src/chunks/libs/remeda.mjs +642 -0
  26. package/__app__/src/chunks/libs/zod.mjs +3170 -0
  27. package/__app__/src/chunks/rolldown-runtime.mjs +23 -0
  28. package/__app__/src/chunks/styled-system.mjs +1040 -0
  29. package/__app__/src/fonts.css +1 -1
  30. package/__app__/src/main.mjs +14816 -14
  31. package/__app__/src/style.css +1 -1
  32. package/dist/chunks/enableServer.mjs +1 -1
  33. package/dist/chunks/filenames.mjs +2 -2
  34. package/dist/chunks/index2.d.mts +1877 -734
  35. package/dist/chunks/libs/@chevrotain/gast.mjs +1 -1
  36. package/dist/chunks/libs/@logtape/logtape.mjs +4 -3
  37. package/dist/chunks/libs/chevrotain-allstar.mjs +2 -2
  38. package/dist/chunks/libs/chevrotain.mjs +25 -25
  39. package/dist/chunks/libs/langium.mjs +1 -1
  40. package/dist/chunks/libs/merge-error-cause.mjs +1 -1
  41. package/dist/chunks/libs/pretty-ms.mjs +1 -1
  42. package/dist/chunks/libs/remeda.mjs +1 -1
  43. package/dist/chunks/libs/ufo.mjs +1 -1
  44. package/dist/chunks/libs/unstorage.mjs +1 -1
  45. package/dist/chunks/libs/which.mjs +1 -1
  46. package/dist/chunks/libs/zod.mjs +65 -0
  47. package/dist/chunks/node.mjs +73 -62
  48. package/dist/chunks/{plugin.mjs → vite-plugin.mjs} +41 -41
  49. package/dist/cli/index.mjs +184 -144
  50. package/dist/index.d.mts +1 -1
  51. package/dist/index.mjs +1 -1
  52. package/dist/model/index.d.mts +1 -1
  53. package/dist/vite-plugin/index.mjs +1 -1
  54. package/dist/vite-plugin/internal/index.d.mts +52 -57
  55. package/dist/vite-plugin/internal/index.mjs +946 -1
  56. package/package.json +46 -47
  57. package/react/index.d.mts +92 -23
  58. package/react/index.mjs +44551 -42605
  59. package/__app__/chunks/AIChat2.mjs +0 -2
  60. package/__app__/chunks/DiagramActorProvider.mjs +0 -10
  61. package/__app__/chunks/EmbedPage.mjs +0 -1
  62. package/__app__/chunks/ExportPage.mjs +0 -2
  63. package/__app__/chunks/LikeC4Diagram.mjs +0 -19
  64. package/__app__/chunks/LikeC4Styles.mjs +0 -48
  65. package/__app__/chunks/Markdown.mjs +0 -1
  66. package/__app__/chunks/NavigationPanel.mjs +0 -1
  67. package/__app__/chunks/ViewReact.mjs +0 -1
  68. package/__app__/chunks/adhoc-editor.mjs +0 -1
  69. package/__app__/chunks/aichat.mjs +0 -1
  70. package/__app__/chunks/box.mjs +0 -1
  71. package/__app__/chunks/create-style-context.mjs +0 -1
  72. package/__app__/chunks/css.mjs +0 -1
  73. package/__app__/chunks/factory.mjs +0 -1
  74. package/__app__/chunks/hooks.mjs +0 -1
  75. package/__app__/chunks/hstack.mjs +0 -1
  76. package/__app__/chunks/libs/@dagrejs/dagre.mjs +0 -1
  77. package/__app__/chunks/libs/@floating-ui/core.mjs +0 -1
  78. package/__app__/chunks/libs/@floating-ui/dom.mjs +0 -1
  79. package/__app__/chunks/libs/@floating-ui/react.mjs +0 -1
  80. package/__app__/chunks/libs/@mantine/core.mjs +0 -41
  81. package/__app__/chunks/libs/@mantine/hooks.mjs +0 -1
  82. package/__app__/chunks/libs/@nanostores/react.mjs +0 -1
  83. package/__app__/chunks/libs/@react-hookz/web.mjs +0 -1
  84. package/__app__/chunks/libs/@tabler/icons-react.mjs +0 -358
  85. package/__app__/chunks/libs/@tanstack/ai-client.mjs +0 -2
  86. package/__app__/chunks/libs/@tanstack/ai-react-ui.mjs +0 -1
  87. package/__app__/chunks/libs/@tanstack/ai-react.mjs +0 -1
  88. package/__app__/chunks/libs/@tanstack/ai.mjs +0 -2
  89. package/__app__/chunks/libs/@tanstack/history.mjs +0 -1
  90. package/__app__/chunks/libs/@tanstack/react-router.mjs +0 -3
  91. package/__app__/chunks/libs/@tanstack/router-core.mjs +0 -1
  92. package/__app__/chunks/libs/@xstate/react.mjs +0 -1
  93. package/__app__/chunks/libs/@xstate/store.mjs +0 -1
  94. package/__app__/chunks/libs/@xyflow/react.mjs +0 -7
  95. package/__app__/chunks/libs/@zag-js/anatomy.mjs +0 -1
  96. package/__app__/chunks/libs/@zag-js/collection.mjs +0 -1
  97. package/__app__/chunks/libs/@zag-js/core.mjs +0 -1
  98. package/__app__/chunks/libs/@zag-js/react.mjs +0 -1
  99. package/__app__/chunks/libs/@zag-js/tree-view.mjs +0 -1
  100. package/__app__/chunks/libs/bezier-js.mjs +0 -1
  101. package/__app__/chunks/libs/copy-anything.mjs +0 -1
  102. package/__app__/chunks/libs/d3-path.mjs +0 -1
  103. package/__app__/chunks/libs/d3-shape.mjs +0 -1
  104. package/__app__/chunks/libs/fast-equals.mjs +0 -1
  105. package/__app__/chunks/libs/framer-motion.mjs +0 -9
  106. package/__app__/chunks/libs/html-to-image.mjs +0 -2
  107. package/__app__/chunks/libs/motion-dom.mjs +0 -1
  108. package/__app__/chunks/libs/nanostores.mjs +0 -1
  109. package/__app__/chunks/libs/react-error-boundary.mjs +0 -1
  110. package/__app__/chunks/libs/react-resizable-panels.mjs +0 -1
  111. package/__app__/chunks/libs/remeda.mjs +0 -1
  112. package/__app__/chunks/libs/superjson.mjs +0 -1
  113. package/__app__/chunks/libs/zod.mjs +0 -64
  114. package/__app__/chunks/rolldown-runtime.mjs +0 -1
  115. package/__app__/chunks/styles.css.mjs +0 -1
  116. package/__app__/chunks/txt.mjs +0 -1
  117. package/__app__/chunks/useLikeC4Project.mjs +0 -1
  118. package/__app__/src/pages/AdHocViewEditor.mjs +0 -1
  119. package/__app__/src/pages/EmbedPage.mjs +0 -1
  120. package/__app__/src/pages/ExportPage.mjs +0 -1
  121. package/__app__/src/pages/ProjectsOverview.mjs +0 -1
  122. package/__app__/src/pages/ViewAsD2.mjs +0 -1
  123. package/__app__/src/pages/ViewAsDot.mjs +0 -1
  124. package/__app__/src/pages/ViewAsMmd.mjs +0 -1
  125. package/__app__/src/pages/ViewAsPuml.mjs +0 -1
  126. package/__app__/src/pages/ViewEditor.mjs +0 -1
  127. package/__app__/src/pages/ViewReact.mjs +0 -1
  128. package/dist/chunks/libs/@chevrotain/utils.mjs +0 -1
  129. package/dist/chunks/libs/@hono/mcp.mjs +0 -70
  130. package/dist/chunks/libs/@hono/node-server.mjs +0 -1
  131. package/dist/chunks/libs/@logtape/logtape.d.mts +0 -1023
  132. package/dist/chunks/libs/@modelcontextprotocol/sdk.mjs +0 -12
  133. package/dist/chunks/libs/ajv.mjs +0 -1
  134. package/dist/chunks/libs/ansi-align.mjs +0 -2
  135. package/dist/chunks/libs/ansi-regex.mjs +0 -1
  136. package/dist/chunks/libs/ansi-styles.mjs +0 -1
  137. package/dist/chunks/libs/atomically.mjs +0 -1
  138. package/dist/chunks/libs/boxen.mjs +0 -22
  139. package/dist/chunks/libs/conf.mjs +0 -1
  140. package/dist/chunks/libs/defu.mjs +0 -1
  141. package/dist/chunks/libs/destr.mjs +0 -1
  142. package/dist/chunks/libs/find-up-simple.mjs +0 -1
  143. package/dist/chunks/libs/get-port.mjs +0 -1
  144. package/dist/chunks/libs/hono.mjs +0 -1
  145. package/dist/chunks/libs/is-docker.mjs +0 -1
  146. package/dist/chunks/libs/is-error-instance.mjs +0 -1
  147. package/dist/chunks/libs/is-inside-container.mjs +0 -1
  148. package/dist/chunks/libs/is-plain-obj.mjs +0 -1
  149. package/dist/chunks/libs/isexe.mjs +0 -1
  150. package/dist/chunks/libs/ky.mjs +0 -3
  151. package/dist/chunks/libs/p-debounce.mjs +0 -1
  152. package/dist/chunks/libs/p-limit.mjs +0 -1
  153. package/dist/chunks/libs/p-timeout.mjs +0 -1
  154. package/dist/chunks/libs/package-up.mjs +0 -1
  155. package/dist/chunks/libs/parse-ms.mjs +0 -1
  156. package/dist/chunks/libs/safe-stringify.mjs +0 -1
  157. package/dist/chunks/libs/strip-indent.mjs +0 -1
  158. package/dist/chunks/libs/tinyrainbow.mjs +0 -1
  159. package/dist/chunks/libs/ts-graphviz.mjs +0 -1
  160. package/dist/chunks/libs/unctx.mjs +0 -1
  161. package/dist/chunks/libs/vscode-languageserver.mjs +0 -1
  162. package/dist/chunks/libs/word-wrap.mjs +0 -12
  163. package/dist/vite-plugin/internal/chunks/libs/@nanostores/react.mjs +0 -1
  164. package/dist/vite-plugin/internal/chunks/libs/birpc.mjs +0 -1
  165. package/dist/vite-plugin/internal/chunks/libs/fast-equals.mjs +0 -1
  166. package/dist/vite-plugin/internal/chunks/libs/nanostores.mjs +0 -1
  167. package/dist/vite-plugin/internal/chunks/libs/remeda.mjs +0 -1
  168. package/dist/vite-plugin/internal/chunks/rolldown-runtime.mjs +0 -1
@@ -1,911 +1,107 @@
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
1
+ import "../src/chunks/rolldown-runtime.mjs";
2
+ import { C as e, D as t, E as n, O as r, S as i, T as a, _ as o, b as s, d as c, f as l, g as u, h as d, l as f, m as p, p as m, u as h, v as g, w as _, x as v, y } from "../src/chunks/libs/zod.mjs";
3
+ import { createRoot as b } from "react-dom/client";
4
+ import { jsx as x } from "react/jsx-runtime";
5
+ import { ComponentName as S } from "likec4:app-config";
6
+ import { LikeC4View as C } from "likec4:react";
759
7
  //#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);
8
+ var w = /* @__PURE__ */ r("ZodMiniType", (t, n) => {
9
+ if (!t._zod) throw Error("Uninitialized schema in ZodMiniType.");
10
+ y.init(t, n), t.def = n, t.type = n.type, t.parse = (e, n) => s(t, e, n, { callee: t.parse }), t.safeParse = (e, n) => i(t, e, n), t.parseAsync = async (e, n) => v(t, e, n, { callee: t.parseAsync }), t.safeParseAsync = async (n, r) => e(t, n, r), t.check = (...e) => t.clone({
11
+ ...n,
12
+ checks: [...n.checks ?? [], ...e.map((e) => typeof e == "function" ? { _zod: {
13
+ check: e,
14
+ def: { check: "custom" },
15
+ onattach: []
16
+ } } : e)]
17
+ }, { parent: !0 }), t.with = t.check, t.clone = (e, n) => _(t, e, n), t.brand = () => t, t.register = ((e, n) => (e.add(t, n), t)), t.apply = (e) => e(t);
18
+ }), T = /* @__PURE__ */ r("ZodMiniString", (e, t) => {
19
+ g.init(e, t), w.init(e, t);
791
20
  });
792
21
  /* @__NO_SIDE_EFFECTS__ */
793
- function string(params) {
794
- return _string(ZodMiniString, params);
22
+ function string(e) {
23
+ return f(T, e);
795
24
  }
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);
25
+ var E = /* @__PURE__ */ r("ZodMiniBoolean", (e, t) => {
26
+ c.init(e, t), w.init(e, t);
27
+ }), D = /* @__PURE__ */ r("ZodMiniObject", (e, t) => {
28
+ d.init(e, t), w.init(e, t), a(e, "shape", () => t.shape);
804
29
  });
805
30
  /* @__NO_SIDE_EFFECTS__ */
806
- function object(shape, params) {
807
- return new ZodMiniObject({
31
+ function object(e, t) {
32
+ return new D({
808
33
  type: "object",
809
- shape: shape ?? {},
810
- ...normalizeParams(params)
34
+ shape: e ?? {},
35
+ ...n(t)
811
36
  });
812
37
  }
813
- const ZodMiniLiteral = /* @__PURE__ */ $constructor("ZodMiniLiteral", (inst, def) => {
814
- $ZodLiteral.init(inst, def);
815
- ZodMiniType.init(inst, def);
38
+ var O = /* @__PURE__ */ r("ZodMiniLiteral", (e, t) => {
39
+ p.init(e, t), w.init(e, t);
816
40
  });
817
41
  /* @__NO_SIDE_EFFECTS__ */
818
- function literal(value, params) {
819
- return new ZodMiniLiteral({
42
+ function literal(e, t) {
43
+ return new O({
820
44
  type: "literal",
821
- values: Array.isArray(value) ? value : [value],
822
- ...normalizeParams(params)
45
+ values: Array.isArray(e) ? e : [e],
46
+ ...n(t)
823
47
  });
824
48
  }
825
- const ZodMiniOptional = /* @__PURE__ */ $constructor("ZodMiniOptional", (inst, def) => {
826
- $ZodOptional.init(inst, def);
827
- ZodMiniType.init(inst, def);
49
+ var k = /* @__PURE__ */ r("ZodMiniOptional", (e, t) => {
50
+ u.init(e, t), w.init(e, t);
828
51
  });
829
52
  /* @__NO_SIDE_EFFECTS__ */
830
- function optional(innerType) {
831
- return new ZodMiniOptional({
53
+ function optional(e) {
54
+ return new k({
832
55
  type: "optional",
833
- innerType
56
+ innerType: e
834
57
  });
835
58
  }
836
- const ZodMiniDefault = /* @__PURE__ */ $constructor("ZodMiniDefault", (inst, def) => {
837
- $ZodDefault.init(inst, def);
838
- ZodMiniType.init(inst, def);
59
+ var A = /* @__PURE__ */ r("ZodMiniDefault", (e, t) => {
60
+ m.init(e, t), w.init(e, t);
839
61
  });
840
62
  /* @__NO_SIDE_EFFECTS__ */
841
- function _default(innerType, defaultValue) {
842
- return new ZodMiniDefault({
63
+ function _default(e, n) {
64
+ return new A({
843
65
  type: "default",
844
- innerType,
66
+ innerType: e,
845
67
  get defaultValue() {
846
- return typeof defaultValue === "function" ? defaultValue() : shallowClone(defaultValue);
68
+ return typeof n == "function" ? n() : t(n);
847
69
  }
848
70
  });
849
71
  }
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({
72
+ var j = /* @__PURE__ */ r("ZodMiniPipe", (e, t) => {
73
+ o.init(e, t), w.init(e, t);
74
+ }), M = /* @__PURE__ */ r("ZodMiniCodec", (e, t) => {
75
+ j.init(e, t), l.init(e, t);
76
+ }), stringbool = (...e) => h({
77
+ Codec: M,
78
+ Boolean: E,
79
+ String: T
80
+ }, ...e), N = /* @__PURE__ */ object({
867
81
  viewId: /* @__PURE__ */ _default(/* @__PURE__ */ string(), "index"),
868
- browser: /* @__PURE__ */ _default(stringbool(), true),
82
+ browser: /* @__PURE__ */ _default(stringbool(), !0),
869
83
  dynamicViewVariant: /* @__PURE__ */ optional(/* @__PURE__ */ literal(["diagram", "sequence"])),
870
84
  colorScheme: /* @__PURE__ */ optional(/* @__PURE__ */ literal(["light", "dark"]))
871
- });
872
- var LikeC4View = class extends HTMLElement {
85
+ }), LikeC4View = class extends HTMLElement {
873
86
  shadow;
874
87
  root;
875
88
  hostCss;
876
89
  lastHostCss = "";
877
90
  constructor() {
878
- super();
879
- this.shadow = this.attachShadow({
91
+ super(), this.shadow = this.attachShadow({
880
92
  mode: "open",
881
- delegatesFocus: true
93
+ delegatesFocus: !0
882
94
  });
883
95
  }
884
96
  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
- }
97
+ let e = "\n :host {\n display: contents;\n background-color: transparent;\n margin: 0;\n padding: 0;\n }";
98
+ e !== this.lastHostCss && (this.hostCss?.replaceSync(e), this.lastHostCss = e);
896
99
  }
897
100
  connectedCallback() {
898
- this.lastHostCss = "";
899
- this.hostCss = new CSSStyleSheet();
900
- this.updateHostCss();
901
- this.shadow.adoptedStyleSheets = [this.hostCss];
902
- this.render();
101
+ this.lastHostCss = "", this.hostCss = new CSSStyleSheet(), this.updateHostCss(), this.shadow.adoptedStyleSheets = [this.hostCss], this.render();
903
102
  }
904
103
  disconnectedCallback() {
905
- this.root?.unmount();
906
- this.root = void 0;
907
- this.shadow.adoptedStyleSheets.length = 0;
908
- this.hostCss = void 0;
104
+ this.root?.unmount(), this.root = void 0, this.shadow.adoptedStyleSheets.length = 0, this.hostCss = void 0;
909
105
  }
910
106
  static observedAttributes = [
911
107
  "view-id",
@@ -914,29 +110,22 @@ var LikeC4View = class extends HTMLElement {
914
110
  "color-scheme"
915
111
  ];
916
112
  getProps() {
917
- const props = propsSchema.safeParse({
113
+ let e = N.safeParse({
918
114
  viewId: this.getAttribute("view-id"),
919
115
  browser: this.getAttribute("browser") ?? void 0,
920
116
  dynamicViewVariant: this.getAttribute("dynamic-variant") ?? void 0,
921
117
  colorScheme: this.getAttribute("color-scheme") ?? void 0
922
118
  });
923
- if (!props.success) {
924
- console.error("Invalid props", props.error);
925
- return { viewId: "index" };
926
- }
927
- return props.data;
119
+ return e.success ? e.data : (console.error("Invalid props", e.error), { viewId: "index" });
928
120
  }
929
121
  render() {
930
- const props = this.getProps();
931
- this.updateHostCss();
932
- this.root ??= createRoot(this.shadow);
933
- this.root.render(/* @__PURE__ */ jsx(LikeC4View$1, { ...props }));
122
+ let e = this.getProps();
123
+ this.updateHostCss(), this.root ??= b(this.shadow), this.root.render(/* @__PURE__ */ x(C, { ...e }));
934
124
  }
935
- attributeChangedCallback(_name) {
936
- if (this.root) this.render();
125
+ attributeChangedCallback(e) {
126
+ this.root && this.render();
937
127
  }
938
128
  };
939
- customElements.define(ComponentName.View, LikeC4View);
940
-
129
+ customElements.define(S.View, LikeC4View);
941
130
  //#endregion
942
- export { LikeC4View };
131
+ export { LikeC4View };