likec4 1.57.0 → 1.59.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 (178) hide show
  1. package/__app__/codegen/react.mjs +7 -8
  2. package/__app__/codegen/webcomponent.mjs +78 -889
  3. package/__app__/src/aichat/index.mjs +8 -1
  4. package/__app__/src/chunks/AIChat.mjs +956 -0
  5. package/__app__/src/chunks/LikeC4Styles.mjs +2164 -0
  6. package/__app__/src/chunks/ProjectsOverview.mjs +537 -0
  7. package/__app__/src/chunks/es.mjs +439 -0
  8. package/__app__/src/chunks/hooks.mjs +458 -0
  9. package/__app__/src/chunks/libs/@floating-ui.mjs +2218 -0
  10. package/__app__/src/chunks/libs/@mantine.mjs +12974 -0
  11. package/__app__/src/chunks/libs/@tanstack-ai.mjs +1768 -0
  12. package/__app__/src/chunks/libs/@tanstack.mjs +2693 -0
  13. package/__app__/src/chunks/libs/@xstate/react.mjs +1996 -0
  14. package/__app__/src/chunks/libs/@xyflow/react.mjs +5280 -0
  15. package/__app__/src/chunks/libs/bezier-js.mjs +1006 -0
  16. package/__app__/src/chunks/libs/d3.mjs +2842 -0
  17. package/__app__/src/chunks/libs/fast-equals.mjs +268 -0
  18. package/__app__/src/chunks/libs/framer.mjs +5905 -0
  19. package/__app__/src/chunks/libs/zod.mjs +3173 -0
  20. package/__app__/src/chunks/rolldown-runtime.mjs +30 -0
  21. package/__app__/src/chunks/styled-system.mjs +1047 -0
  22. package/__app__/src/fonts.css +1 -1
  23. package/__app__/src/main.mjs +27659 -14
  24. package/__app__/src/style.css +1 -1
  25. package/dist/chunks/dist.mjs +10 -0
  26. package/dist/chunks/enableServer.mjs +1 -1
  27. package/dist/chunks/filenames.mjs +2 -2
  28. package/dist/chunks/index.d.mts +9 -9
  29. package/dist/chunks/index2.d.mts +2167 -867
  30. package/dist/chunks/libs/@chevrotain/gast.mjs +1 -1
  31. package/dist/chunks/libs/@chevrotain/regexp-to-ast.mjs +1 -1
  32. package/dist/chunks/libs/@logtape/logtape.mjs +4 -3
  33. package/dist/chunks/libs/@ts-graphviz/common.d.mts +1 -2
  34. package/dist/chunks/libs/@ts-graphviz/core.mjs +1 -1
  35. package/dist/chunks/libs/chevrotain-allstar.mjs +2 -2
  36. package/dist/chunks/libs/chevrotain.mjs +25 -25
  37. package/dist/chunks/libs/json5.mjs +1 -1
  38. package/dist/chunks/libs/langium.d.mts +2940 -2914
  39. package/dist/chunks/libs/langium.mjs +9 -9
  40. package/dist/chunks/libs/merge-error-cause.mjs +1 -1
  41. package/dist/chunks/libs/p-queue.mjs +1 -1
  42. package/dist/chunks/libs/package-manager-detector.mjs +1 -1
  43. package/dist/chunks/libs/pako.mjs +1 -1
  44. package/dist/chunks/libs/picomatch.mjs +1 -1
  45. package/dist/chunks/libs/pretty-ms.mjs +1 -1
  46. package/dist/chunks/libs/remeda.mjs +1 -1
  47. package/dist/chunks/libs/ufo.mjs +1 -1
  48. package/dist/chunks/libs/unstorage.d.mts +1 -0
  49. package/dist/chunks/libs/unstorage.mjs +1 -1
  50. package/dist/chunks/libs/which.mjs +1 -1
  51. package/dist/chunks/libs/zod.d.mts +48 -36
  52. package/dist/chunks/libs/zod.mjs +65 -0
  53. package/dist/chunks/logger.mjs +1 -0
  54. package/dist/chunks/node.mjs +65 -63
  55. package/dist/chunks/rolldown-runtime.mjs +1 -1
  56. package/dist/chunks/sequence-view.mjs +1 -1
  57. package/dist/chunks/{plugin.mjs → vite-plugin.mjs} +41 -41
  58. package/dist/cli/index.mjs +186 -144
  59. package/dist/index.d.mts +3 -4
  60. package/dist/index.mjs +1 -1
  61. package/dist/model/index.d.mts +6 -5
  62. package/dist/vite-plugin/index.d.mts +6 -9
  63. package/dist/vite-plugin/index.mjs +1 -1
  64. package/dist/vite-plugin/internal/index.d.mts +64 -64
  65. package/dist/vite-plugin/internal/index.mjs +946 -1
  66. package/package.json +51 -52
  67. package/react/index.d.mts +853 -134
  68. package/react/index.mjs +49718 -44030
  69. package/__app__/chunks/AIChat2.mjs +0 -2
  70. package/__app__/chunks/DiagramActorProvider.mjs +0 -10
  71. package/__app__/chunks/EmbedPage.mjs +0 -1
  72. package/__app__/chunks/ExportPage.mjs +0 -2
  73. package/__app__/chunks/LikeC4Diagram.mjs +0 -19
  74. package/__app__/chunks/LikeC4Styles.mjs +0 -48
  75. package/__app__/chunks/Markdown.mjs +0 -1
  76. package/__app__/chunks/NavigationPanel.mjs +0 -1
  77. package/__app__/chunks/ViewReact.mjs +0 -1
  78. package/__app__/chunks/adhoc-editor.mjs +0 -1
  79. package/__app__/chunks/aichat.mjs +0 -1
  80. package/__app__/chunks/box.mjs +0 -1
  81. package/__app__/chunks/create-style-context.mjs +0 -1
  82. package/__app__/chunks/css.mjs +0 -1
  83. package/__app__/chunks/factory.mjs +0 -1
  84. package/__app__/chunks/hooks.mjs +0 -1
  85. package/__app__/chunks/hstack.mjs +0 -1
  86. package/__app__/chunks/libs/@dagrejs/dagre.mjs +0 -1
  87. package/__app__/chunks/libs/@floating-ui/core.mjs +0 -1
  88. package/__app__/chunks/libs/@floating-ui/dom.mjs +0 -1
  89. package/__app__/chunks/libs/@floating-ui/react.mjs +0 -1
  90. package/__app__/chunks/libs/@mantine/core.mjs +0 -41
  91. package/__app__/chunks/libs/@mantine/hooks.mjs +0 -1
  92. package/__app__/chunks/libs/@nanostores/react.mjs +0 -1
  93. package/__app__/chunks/libs/@react-hookz/web.mjs +0 -1
  94. package/__app__/chunks/libs/@tabler/icons-react.mjs +0 -358
  95. package/__app__/chunks/libs/@tanstack/ai-client.mjs +0 -2
  96. package/__app__/chunks/libs/@tanstack/ai-react-ui.mjs +0 -1
  97. package/__app__/chunks/libs/@tanstack/ai-react.mjs +0 -1
  98. package/__app__/chunks/libs/@tanstack/ai.mjs +0 -2
  99. package/__app__/chunks/libs/@tanstack/history.mjs +0 -1
  100. package/__app__/chunks/libs/@tanstack/react-router.mjs +0 -3
  101. package/__app__/chunks/libs/@tanstack/router-core.mjs +0 -1
  102. package/__app__/chunks/libs/@xstate/react.mjs +0 -1
  103. package/__app__/chunks/libs/@xstate/store.mjs +0 -1
  104. package/__app__/chunks/libs/@xyflow/react.mjs +0 -7
  105. package/__app__/chunks/libs/@zag-js/anatomy.mjs +0 -1
  106. package/__app__/chunks/libs/@zag-js/collection.mjs +0 -1
  107. package/__app__/chunks/libs/@zag-js/core.mjs +0 -1
  108. package/__app__/chunks/libs/@zag-js/react.mjs +0 -1
  109. package/__app__/chunks/libs/@zag-js/tree-view.mjs +0 -1
  110. package/__app__/chunks/libs/bezier-js.mjs +0 -1
  111. package/__app__/chunks/libs/copy-anything.mjs +0 -1
  112. package/__app__/chunks/libs/d3-path.mjs +0 -1
  113. package/__app__/chunks/libs/d3-shape.mjs +0 -1
  114. package/__app__/chunks/libs/fast-equals.mjs +0 -1
  115. package/__app__/chunks/libs/framer-motion.mjs +0 -9
  116. package/__app__/chunks/libs/html-to-image.mjs +0 -2
  117. package/__app__/chunks/libs/motion-dom.mjs +0 -1
  118. package/__app__/chunks/libs/nanostores.mjs +0 -1
  119. package/__app__/chunks/libs/react-error-boundary.mjs +0 -1
  120. package/__app__/chunks/libs/react-resizable-panels.mjs +0 -1
  121. package/__app__/chunks/libs/remeda.mjs +0 -1
  122. package/__app__/chunks/libs/superjson.mjs +0 -1
  123. package/__app__/chunks/libs/zod.mjs +0 -64
  124. package/__app__/chunks/rolldown-runtime.mjs +0 -1
  125. package/__app__/chunks/styles.css.mjs +0 -1
  126. package/__app__/chunks/txt.mjs +0 -1
  127. package/__app__/chunks/useLikeC4Project.mjs +0 -1
  128. package/__app__/src/pages/AdHocViewEditor.mjs +0 -1
  129. package/__app__/src/pages/EmbedPage.mjs +0 -1
  130. package/__app__/src/pages/ExportPage.mjs +0 -1
  131. package/__app__/src/pages/ProjectsOverview.mjs +0 -1
  132. package/__app__/src/pages/ViewAsD2.mjs +0 -1
  133. package/__app__/src/pages/ViewAsDot.mjs +0 -1
  134. package/__app__/src/pages/ViewAsMmd.mjs +0 -1
  135. package/__app__/src/pages/ViewAsPuml.mjs +0 -1
  136. package/__app__/src/pages/ViewEditor.mjs +0 -1
  137. package/__app__/src/pages/ViewReact.mjs +0 -1
  138. package/dist/chunks/libs/@chevrotain/utils.mjs +0 -1
  139. package/dist/chunks/libs/@hono/mcp.mjs +0 -70
  140. package/dist/chunks/libs/@hono/node-server.mjs +0 -1
  141. package/dist/chunks/libs/@logtape/logtape.d.mts +0 -1023
  142. package/dist/chunks/libs/@modelcontextprotocol/sdk.mjs +0 -12
  143. package/dist/chunks/libs/ajv.mjs +0 -1
  144. package/dist/chunks/libs/ansi-align.mjs +0 -2
  145. package/dist/chunks/libs/ansi-regex.mjs +0 -1
  146. package/dist/chunks/libs/ansi-styles.mjs +0 -1
  147. package/dist/chunks/libs/atomically.mjs +0 -1
  148. package/dist/chunks/libs/boxen.mjs +0 -22
  149. package/dist/chunks/libs/conf.mjs +0 -1
  150. package/dist/chunks/libs/defu.mjs +0 -1
  151. package/dist/chunks/libs/destr.mjs +0 -1
  152. package/dist/chunks/libs/find-up-simple.mjs +0 -1
  153. package/dist/chunks/libs/get-port.mjs +0 -1
  154. package/dist/chunks/libs/hono.mjs +0 -1
  155. package/dist/chunks/libs/is-docker.mjs +0 -1
  156. package/dist/chunks/libs/is-error-instance.mjs +0 -1
  157. package/dist/chunks/libs/is-inside-container.mjs +0 -1
  158. package/dist/chunks/libs/is-plain-obj.mjs +0 -1
  159. package/dist/chunks/libs/isexe.mjs +0 -1
  160. package/dist/chunks/libs/ky.mjs +0 -3
  161. package/dist/chunks/libs/p-debounce.mjs +0 -1
  162. package/dist/chunks/libs/p-limit.mjs +0 -1
  163. package/dist/chunks/libs/p-timeout.mjs +0 -1
  164. package/dist/chunks/libs/package-up.mjs +0 -1
  165. package/dist/chunks/libs/parse-ms.mjs +0 -1
  166. package/dist/chunks/libs/safe-stringify.mjs +0 -1
  167. package/dist/chunks/libs/strip-indent.mjs +0 -1
  168. package/dist/chunks/libs/tinyrainbow.mjs +0 -1
  169. package/dist/chunks/libs/ts-graphviz.mjs +0 -1
  170. package/dist/chunks/libs/unctx.mjs +0 -1
  171. package/dist/chunks/libs/vscode-languageserver.mjs +0 -1
  172. package/dist/chunks/libs/word-wrap.mjs +0 -12
  173. package/dist/vite-plugin/internal/chunks/libs/@nanostores/react.mjs +0 -1
  174. package/dist/vite-plugin/internal/chunks/libs/birpc.mjs +0 -1
  175. package/dist/vite-plugin/internal/chunks/libs/fast-equals.mjs +0 -1
  176. package/dist/vite-plugin/internal/chunks/libs/nanostores.mjs +0 -1
  177. package/dist/vite-plugin/internal/chunks/libs/remeda.mjs +0 -1
  178. package/dist/vite-plugin/internal/chunks/rolldown-runtime.mjs +0 -1
@@ -0,0 +1,537 @@
1
+ import "./rolldown-runtime.mjs";
2
+ import { D as e, j as t } from "./hooks.mjs";
3
+ import { B as n, D as r, F as i, H as a, M as o, N as s, U as c, W as l, a as u, c as d, d as f, f as p, l as m, m as h, n as g, o as _, ot as v, p as y, q as b, s as x, t as S, u as C, ut as w, vt as T, x as E } from "./LikeC4Styles.mjs";
4
+ import { on as ee } from "./libs/@mantine.mjs";
5
+ import { M as te } from "./styled-system.mjs";
6
+ import { C as ne, c as re, d as ie, g as ae, u as oe } from "./libs/@xyflow/react.mjs";
7
+ import { n as D } from "./libs/fast-equals.mjs";
8
+ import { _ as O, g as k, o as A, p as j, v as M, y as N } from "./libs/framer.mjs";
9
+ import { a as P, i as F, l as I, n as L, r as R, t as z } from "./libs/@xstate/react.mjs";
10
+ import { createContext as B, memo as V, useContext as H, useEffect as U, useRef as W } from "react";
11
+ import { c as G } from "react/compiler-runtime";
12
+ import { jsx as K, jsxs as q } from "react/jsx-runtime";
13
+ import { invariant as se, nonNullable as J, nonexhaustive as ce } from "@likec4/core";
14
+ import { useLikeC4ProjectsOverview as le } from "likec4:projects-overview";
15
+ //#region ../diagram/src/projects-overview/layouted-to-xyflow.ts
16
+ function layoutedProjectsViewToXYFlow(e) {
17
+ return {
18
+ xynodes: t(e.nodes, projectNodeToXY),
19
+ xyedges: t(e.edges, projectEdgeToXY)
20
+ };
21
+ }
22
+ function projectNodeToXY({ id: e, x: t, y: n, width: r, height: i, ...a }) {
23
+ return {
24
+ id: e,
25
+ position: {
26
+ x: t,
27
+ y: n
28
+ },
29
+ type: "project",
30
+ initialWidth: r,
31
+ initialHeight: i,
32
+ draggable: !1,
33
+ deletable: !1,
34
+ zIndex: c.Element,
35
+ style: {
36
+ width: r,
37
+ height: i
38
+ },
39
+ data: {
40
+ id: e,
41
+ width: r,
42
+ height: i,
43
+ ...a
44
+ }
45
+ };
46
+ }
47
+ function projectEdgeToXY({ id: e, source: t, target: n, ...r }) {
48
+ return {
49
+ id: e,
50
+ source: t,
51
+ target: n,
52
+ type: "relationship",
53
+ zIndex: c.Edge,
54
+ deletable: !1,
55
+ data: {
56
+ id: e,
57
+ technology: null,
58
+ labelBBox: null,
59
+ ...r
60
+ }
61
+ };
62
+ }
63
+ //#endregion
64
+ //#region ../diagram/src/projects-overview/persistence.ts
65
+ var Y = "likec4:projects-overview:lastViewport", X = {
66
+ read() {
67
+ try {
68
+ let e = sessionStorage.getItem(Y);
69
+ return e ? JSON.parse(e) : null;
70
+ } catch (e) {
71
+ return console.error(`Error reading fromStorage ${Y}:`, e), null;
72
+ }
73
+ },
74
+ write(e) {
75
+ if (!e) {
76
+ sessionStorage.removeItem(Y);
77
+ return;
78
+ }
79
+ sessionStorage.setItem(Y, JSON.stringify(e));
80
+ }
81
+ }, Z = F({
82
+ types: {
83
+ context: {},
84
+ tags: "",
85
+ input: {},
86
+ events: {},
87
+ emitted: {}
88
+ },
89
+ guards: {
90
+ isReady: ({ context: e }) => e.initialized.xydata && e.initialized.xyflow && !!e.xystore && !!e.xyflow,
91
+ "click: selected node": ({ event: e }) => e.type === "xyflow.click.node" && e.node.selected === !0
92
+ }
93
+ }), updateView = () => Z.assign(({ event: e }) => {
94
+ R(e, "update.view");
95
+ let { xynodes: t, xyedges: n } = layoutedProjectsViewToXYFlow(e.view);
96
+ return {
97
+ view: e.view,
98
+ xynodes: t,
99
+ xyedges: n
100
+ };
101
+ }), xyflowApplyNodeChanges = () => Z.assign(({ context: e, event: t }) => (R(t, "xyflow.applyNodeChanges"), { xynodes: ie(t.changes, e.xynodes) })), xyflowApplyEdgeChanges = () => Z.assign(({ context: e, event: t }) => (R(t, "xyflow.applyEdgeChanges"), { xyedges: oe(t.changes, e.xyedges) })), onMouseEnterOrLeave = () => Z.assign(({ context: e, event: t }) => {
102
+ R(t, [
103
+ "xyflow.mouse.enter.edge",
104
+ "xyflow.mouse.leave.edge",
105
+ "xyflow.mouse.enter.node",
106
+ "xyflow.mouse.leave.node"
107
+ ]);
108
+ let n = t.type.startsWith("xyflow.mouse.enter");
109
+ switch (t.type) {
110
+ case "xyflow.mouse.enter.edge":
111
+ case "xyflow.mouse.leave.edge": {
112
+ let r = t.edge.id;
113
+ return { xyedges: e.xyedges.map((e) => e.id === r ? l.setHovered(e, n) : e) };
114
+ }
115
+ case "xyflow.mouse.enter.node":
116
+ case "xyflow.mouse.leave.node": {
117
+ let r = t.node.id;
118
+ return { xynodes: e.xynodes.map((e) => e.id === r ? l.setHovered(e, n) : e) };
119
+ }
120
+ default: ce(t);
121
+ }
122
+ }), saveViewport = () => Z.createAction(({ context: e }) => {
123
+ let t = e.xyflow;
124
+ t && X.write(t.getViewport());
125
+ }), handleClick = () => Z.enqueueActions(({ event: e, enqueue: t }) => {
126
+ if (e.type === "xyflow.click.double") {
127
+ t(fitDiagram());
128
+ return;
129
+ }
130
+ }), fitDiagram = (e) => Z.enqueueActions(({ context: t, event: n }) => {
131
+ let r = t.view.bounds, i;
132
+ e ? (r = e.bounds ?? t.view.bounds, i = e.duration) : n.type === "xyflow.fitDiagram" && (r = n.bounds ?? t.view.bounds, i = n.duration), i ??= 450;
133
+ let { width: o, height: s, panZoom: c, transform: l } = J(t.xystore).getState(), u = Math.max(1, l[2]), d = ne(r, o, s, a, u, t.fitViewPadding);
134
+ d.x = Math.round(d.x), d.y = Math.round(d.y);
135
+ let f = i > 0 ? {
136
+ duration: i,
137
+ interpolate: "smooth"
138
+ } : void 0;
139
+ c?.setViewport(d, f).catch((e) => {
140
+ console.error("Error during fitDiagram panZoom setViewport", { err: e });
141
+ }), X.write(null);
142
+ }), restoreViewport = () => Z.enqueueActions(({ context: e, enqueue: t }) => {
143
+ let n = X.read();
144
+ if (n) {
145
+ J(e.xyflow).setViewport(n, { duration: 0 });
146
+ return;
147
+ }
148
+ t(fitDiagram({ duration: 0 }));
149
+ }), dispose = () => Z.assign({
150
+ xyflow: null,
151
+ xystore: null,
152
+ initialized: {
153
+ xyflow: !1,
154
+ xydata: !1
155
+ },
156
+ xyedges: [],
157
+ xynodes: []
158
+ }), assignNavigateTo = () => Z.assign(({ event: e, context: t }) => {
159
+ let n;
160
+ switch (e.type) {
161
+ case "xyflow.click.node":
162
+ n = e.node;
163
+ break;
164
+ case "navigate.to":
165
+ n = J(t.xynodes.find((t) => t.id === e.fromNode), `Node ${e.fromNode} not found`);
166
+ break;
167
+ default: return console.warn(`Unexpected event ${e.type} in assignNavigateTo`), {};
168
+ }
169
+ return { navigateTo: n };
170
+ }), ue = Z.createMachine({
171
+ id: "projects-overview",
172
+ context: ({ input: e }) => ({
173
+ ...e,
174
+ initialized: {
175
+ xydata: !1,
176
+ xyflow: !1
177
+ },
178
+ xyflow: null,
179
+ xystore: null,
180
+ xynodes: [],
181
+ xyedges: []
182
+ }),
183
+ initial: "init",
184
+ on: { close: { target: ".closed" } },
185
+ states: {
186
+ init: { on: {
187
+ "update.view": {
188
+ actions: [updateView(), I(({ context: e }) => ({ initialized: {
189
+ ...e.initialized,
190
+ xydata: !0
191
+ } }))],
192
+ target: "isReady"
193
+ },
194
+ "xyflow.init": {
195
+ actions: [I(({ context: e, event: t }) => ({
196
+ initialized: {
197
+ ...e.initialized,
198
+ xyflow: !0
199
+ },
200
+ xyflow: t.xyflow,
201
+ xystore: t.xystore
202
+ }))],
203
+ target: "isReady"
204
+ }
205
+ } },
206
+ isReady: { always: [{
207
+ guard: "isReady",
208
+ target: "active"
209
+ }, { target: "init" }] },
210
+ active: {
211
+ tags: "active",
212
+ entry: [restoreViewport()],
213
+ on: {
214
+ "navigate.to": {
215
+ actions: assignNavigateTo(),
216
+ target: "navigate"
217
+ },
218
+ "xyflow.applyNodeChanges": { actions: xyflowApplyNodeChanges() },
219
+ "xyflow.applyEdgeChanges": { actions: xyflowApplyEdgeChanges() },
220
+ "xyflow.mouse.*": { actions: onMouseEnterOrLeave() },
221
+ "xyflow.click.*": [{
222
+ guard: "click: selected node",
223
+ actions: assignNavigateTo(),
224
+ target: "navigate"
225
+ }, { actions: handleClick() }],
226
+ "xyflow.fitDiagram": { actions: fitDiagram() },
227
+ "update.view": { actions: updateView() }
228
+ }
229
+ },
230
+ navigate: {
231
+ tags: "active",
232
+ entry: [
233
+ saveViewport(),
234
+ I({ xyedges: [] }),
235
+ ({ context: { navigateTo: e, xyflow: t, xystore: n }, self: r }) => {
236
+ se(t && e, "Invalid state, xyflow is undefined");
237
+ let { width: i, domNode: o } = J(n).getState(), s = T(Math.min(i * 7 / 9 / e.data.width), {
238
+ min: a,
239
+ max: 2.5
240
+ }), c = {
241
+ x: Math.round(-s * e.position.x + (i - s * e.data.width) / 2),
242
+ y: Math.round(-s * e.position.y) + 50
243
+ }, l = t.getViewport(), u = o.querySelectorAll(`.react-flow__node-project:not([data-id="${e.id}"]) > *`), d = A(u, {
244
+ opacity: 0,
245
+ scale: .9
246
+ }, {
247
+ visualDuration: .25,
248
+ delay: O(.08, { from: "center" })
249
+ }), f = N(1), p = k(f, [1, 0], [`translate(${l.x}px, ${l.y}px) scale(${l.zoom})`, `translate(${c.x}px, ${c.y}px) scale(${s})`]), m = M(o.querySelector(".xyflow__viewport"), { transform: p }), h = M(o.querySelector(`.react-flow__node-project:is([data-id="${e.id}"]) > *`), { opacity: f }), g = A(f, 0, {
250
+ delay: u.length > 3 ? .25 : 0,
251
+ type: "spring",
252
+ stiffness: 350,
253
+ damping: 40,
254
+ mass: 1.5,
255
+ visualDuration: .55
256
+ });
257
+ Promise.race([g.finished, sleep(750)]).then(() => {
258
+ m(), h(), g.stop(), d.stop(), r.send({
259
+ type: "emit.navigate.to",
260
+ projectId: e.data.projectId
261
+ });
262
+ });
263
+ }
264
+ ],
265
+ on: { "emit.navigate.to": { actions: P(({ event: e }) => ({
266
+ ...e,
267
+ type: "navigate.to"
268
+ })) } }
269
+ },
270
+ closed: {
271
+ id: "closed",
272
+ type: "final",
273
+ entry: dispose()
274
+ }
275
+ }
276
+ });
277
+ function sleep(e) {
278
+ return new Promise((t) => setTimeout(t, e));
279
+ }
280
+ //#endregion
281
+ //#region ../diagram/src/projects-overview/context.ts
282
+ var Q = B(null), de = Q.Provider;
283
+ function useProjectsOverviewActor() {
284
+ let e = G(2), t = H(Q), n;
285
+ return e[0] === t ? n = e[1] : (n = J(t, "No ProjectsOverviewActorContext"), e[0] = t, e[1] = n), n;
286
+ }
287
+ //#endregion
288
+ //#region ../diagram/src/projects-overview/panel/ProjectsOverviewPanel.tsx
289
+ var ProjectsOverviewPanel = () => {
290
+ let e = G(1), t;
291
+ return e[0] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ K(g.Root, { children: /* @__PURE__ */ q(g.Body, { children: [/* @__PURE__ */ K(g.Logo, {}), /* @__PURE__ */ K(g.Label, { children: "Projects Overview" })] }) }), e[0] = t) : t = e[0], t;
292
+ }, fe = _((e) => {
293
+ let t = b(e.data.points);
294
+ return /* @__PURE__ */ q(h, {
295
+ ...e,
296
+ children: [/* @__PURE__ */ K(f, {
297
+ edgeProps: e,
298
+ svgPath: t
299
+ }), /* @__PURE__ */ K(p, {
300
+ edgeProps: e,
301
+ children: /* @__PURE__ */ K(y, { edgeProps: e })
302
+ })]
303
+ });
304
+ });
305
+ //#endregion
306
+ //#region ../diagram/src/projects-overview/custom/nodeTypes.tsx
307
+ function ProjectNode(e) {
308
+ let t = G(19), n = useProjectsOverviewActor(), t0;
309
+ t[0] !== n || t[1] !== e.data.id || t[2] !== e.data.projectId ? (t0 = (t) => {
310
+ t.stopPropagation(), n.send({
311
+ type: "navigate.to",
312
+ fromNode: e.data.id,
313
+ projectId: e.data.projectId
314
+ });
315
+ }, t[0] = n, t[1] = e.data.id, t[2] = e.data.projectId, t[3] = t0) : t0 = t[3];
316
+ let r = ee(t0), i, a;
317
+ t[4] === e ? (i = t[5], a = t[6]) : (i = /* @__PURE__ */ K(x, { ...e }), a = /* @__PURE__ */ K(m, { ...e }), t[4] = e, t[5] = i, t[6] = a);
318
+ let o;
319
+ t[7] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ K(w, {}), t[7] = o) : o = t[7];
320
+ let s;
321
+ t[8] === r ? s = t[9] : (s = [{
322
+ key: "navigate",
323
+ icon: o,
324
+ onClick: r
325
+ }], t[8] = r, t[9] = s);
326
+ let c;
327
+ t[10] !== e || t[11] !== s ? (c = /* @__PURE__ */ K(C, {
328
+ ...e,
329
+ buttons: s
330
+ }), t[10] = e, t[11] = s, t[12] = c) : c = t[12];
331
+ let l;
332
+ t[13] === Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ K(u, {}), t[13] = l) : l = t[13];
333
+ let f;
334
+ return t[14] !== e || t[15] !== i || t[16] !== a || t[17] !== c ? (f = /* @__PURE__ */ q(d, {
335
+ layout: !0,
336
+ nodeProps: e,
337
+ children: [
338
+ i,
339
+ a,
340
+ c,
341
+ l
342
+ ]
343
+ }, e.id), t[14] = e, t[15] = i, t[16] = a, t[17] = c, t[18] = f) : f = t[18], f;
344
+ }
345
+ //#endregion
346
+ //#region ../diagram/src/projects-overview/hooks.ts
347
+ function useProjectsOverviewState(e, t) {
348
+ let n = t === void 0 ? D : t;
349
+ return L(useProjectsOverviewActor(), e, n);
350
+ }
351
+ function useProjectsOverviewXYStoreApi() {
352
+ return ae();
353
+ }
354
+ //#endregion
355
+ //#region ../diagram/src/projects-overview/ProjectsOverviewXY.tsx
356
+ var pe = { project: ProjectNode }, me = { relationship: fe }, selector = (e) => ({
357
+ isActive: e.hasTag("active"),
358
+ nodes: e.context.xynodes,
359
+ edges: e.context.xyedges
360
+ }), selectorEq = (e, t) => e.isActive === t.isActive && D(e.nodes, t.nodes) && D(e.edges, t.edges), $ = V((e) => {
361
+ let t = G(45), r, i;
362
+ t[0] === e ? (r = t[1], i = t[2]) : ({background: i, ...r} = e, t[0] = e, t[1] = r, t[2] = i);
363
+ let a = i === void 0 ? "dots" : i, o = useProjectsOverviewActor(), { isActive: s, nodes: c, edges: l } = useProjectsOverviewState(selector, selectorEq), u = useProjectsOverviewXYStoreApi(), d = s ? "initialized" : "not-initialized", f;
364
+ t[3] === d ? f = t[4] : (f = te(d, "projects-overview"), t[3] = d, t[4] = f);
365
+ let t4;
366
+ t[5] === o ? t4 = t[6] : (t4 = (e, t) => {
367
+ e.stopPropagation(), o.send({
368
+ type: "xyflow.click.node",
369
+ node: t
370
+ });
371
+ }, t[5] = o, t[6] = t4);
372
+ let p = v(t4), t6;
373
+ t[7] === o ? t6 = t[8] : (t6 = (e, t) => {
374
+ e.stopPropagation(), o.send({
375
+ type: "xyflow.click.edge",
376
+ edge: t
377
+ });
378
+ }, t[7] = o, t[8] = t6);
379
+ let m = v(t6), t8;
380
+ t[9] === o ? t8 = t[10] : (t8 = (e) => {
381
+ e.stopPropagation(), o.send({ type: "xyflow.click.pane" });
382
+ }, t[9] = o, t[10] = t8);
383
+ let h = v(t8), t10;
384
+ t[11] === o ? t10 = t[12] : (t10 = (e) => {
385
+ e.stopPropagation(), o.send({ type: "xyflow.click.double" });
386
+ }, t[11] = o, t[12] = t10);
387
+ let g = v(t10), t12;
388
+ t[13] === o ? t12 = t[14] : (t12 = (e) => {
389
+ o.send({
390
+ type: "xyflow.applyNodeChanges",
391
+ changes: e
392
+ });
393
+ }, t[13] = o, t[14] = t12);
394
+ let _ = v(t12), t14;
395
+ t[15] === o ? t14 = t[16] : (t14 = (e) => {
396
+ o.send({
397
+ type: "xyflow.applyEdgeChanges",
398
+ changes: e
399
+ });
400
+ }, t[15] = o, t[16] = t14);
401
+ let y = v(t14), t16;
402
+ t[17] === o ? t16 = t[18] : (t16 = (e, t) => {
403
+ o.send({
404
+ type: "xyflow.mouse.enter.edge",
405
+ edge: t,
406
+ event: e
407
+ });
408
+ }, t[17] = o, t[18] = t16);
409
+ let b = v(t16), t18;
410
+ t[19] === o ? t18 = t[20] : (t18 = (e, t) => {
411
+ o.send({
412
+ type: "xyflow.mouse.leave.edge",
413
+ edge: t,
414
+ event: e
415
+ });
416
+ }, t[19] = o, t[20] = t18);
417
+ let x = v(t18), t20;
418
+ t[21] === o ? t20 = t[22] : (t20 = (e, t) => {
419
+ o.send({
420
+ type: "xyflow.mouse.enter.node",
421
+ node: t
422
+ });
423
+ }, t[21] = o, t[22] = t20);
424
+ let S = v(t20), t22;
425
+ t[23] === o ? t22 = t[24] : (t22 = (e, t) => {
426
+ o.send({
427
+ type: "xyflow.mouse.leave.node",
428
+ node: t
429
+ });
430
+ }, t[23] = o, t[24] = t22);
431
+ let C = v(t22), t24;
432
+ t[25] !== o || t[26] !== u ? (t24 = (e) => {
433
+ o.send({
434
+ type: "xyflow.init",
435
+ xyflow: e,
436
+ xystore: u
437
+ });
438
+ }, t[25] = o, t[26] = u, t[27] = t24) : t24 = t[27];
439
+ let w = v(t24), T;
440
+ return t[28] !== a || t[29] !== l || t[30] !== c || t[31] !== r || t[32] !== g || t[33] !== _ || t[34] !== y || t[35] !== b || t[36] !== x || t[37] !== S || t[38] !== C || t[39] !== w || t[40] !== f || t[41] !== p || t[42] !== m || t[43] !== h ? (T = /* @__PURE__ */ K(n, {
441
+ nodes: c,
442
+ edges: l,
443
+ className: f,
444
+ nodeTypes: pe,
445
+ edgeTypes: me,
446
+ fitView: !1,
447
+ onNodeClick: p,
448
+ onEdgeClick: m,
449
+ onPaneClick: h,
450
+ onDoubleClick: g,
451
+ onNodesChange: _,
452
+ onEdgesChange: y,
453
+ onEdgeMouseEnter: b,
454
+ onEdgeMouseLeave: x,
455
+ onNodeMouseEnter: S,
456
+ onNodeMouseLeave: C,
457
+ onInit: w,
458
+ nodesDraggable: !1,
459
+ nodesSelectable: !0,
460
+ pannable: !0,
461
+ zoomable: !0,
462
+ background: a,
463
+ ...r
464
+ }), t[28] = a, t[29] = l, t[30] = c, t[31] = r, t[32] = g, t[33] = _, t[34] = y, t[35] = b, t[36] = x, t[37] = S, t[38] = C, t[39] = w, t[40] = f, t[41] = p, t[42] = m, t[43] = h, t[44] = T) : T = t[44], T;
465
+ });
466
+ $.displayName = "ProjectsOverviewXY";
467
+ //#endregion
468
+ //#region ../diagram/src/projects-overview/ProjectsOverview.tsx
469
+ function ProjectsOverview({ view: t, onNavigateToProject: n, fitViewPadding: r = {
470
+ top: "50px",
471
+ bottom: "32px",
472
+ left: "32px",
473
+ right: "32px"
474
+ }, ...i }) {
475
+ let a = z(ue, { input: {
476
+ view: t,
477
+ fitViewPadding: r
478
+ } });
479
+ U(() => {
480
+ a.send({
481
+ type: "update.view",
482
+ view: t
483
+ });
484
+ }, [a, t]);
485
+ let o = e(n);
486
+ U(() => {
487
+ let e = [a.on("navigate.to", ({ projectId: e }) => {
488
+ o.current?.(e);
489
+ })];
490
+ return () => {
491
+ e.forEach((e) => e.unsubscribe());
492
+ };
493
+ }, [a]);
494
+ let s = t.bounds;
495
+ return /* @__PURE__ */ K(de, {
496
+ value: a,
497
+ children: /* @__PURE__ */ q(re, {
498
+ ...W({
499
+ initialNodes: [],
500
+ initialEdges: [],
501
+ initialWidth: s.width,
502
+ initialHeight: s.height,
503
+ fitView: !1
504
+ }).current,
505
+ children: [/* @__PURE__ */ K(j, {
506
+ id: a.sessionId,
507
+ inherit: !1,
508
+ children: /* @__PURE__ */ K($, { ...i })
509
+ }), /* @__PURE__ */ K(ProjectsOverviewPanel, {})]
510
+ })
511
+ });
512
+ }
513
+ //#endregion
514
+ //#region ../diagram/src/LikeC4ProjectsOverview.tsx
515
+ function LikeC4ProjectsOverview({ view: e, className: t, onNavigateToProject: n, ...a }) {
516
+ let c = E(), l = r();
517
+ return n ??= c, /* @__PURE__ */ K(s, { children: /* @__PURE__ */ q(o, { children: [/* @__PURE__ */ K(S, { id: l }), /* @__PURE__ */ K(i, {
518
+ id: l,
519
+ className: t,
520
+ children: /* @__PURE__ */ K(ProjectsOverview, {
521
+ view: e,
522
+ onNavigateToProject: n,
523
+ ...a
524
+ })
525
+ })] }) });
526
+ }
527
+ //#endregion
528
+ //#region src/pages/ProjectsOverview.tsx
529
+ function ProjectsOverviewPage() {
530
+ let e = G(3), t = E(), n = le(), r;
531
+ return e[0] !== t || e[1] !== n ? (r = /* @__PURE__ */ K(LikeC4ProjectsOverview, {
532
+ view: n,
533
+ onNavigateToProject: t
534
+ }), e[0] = t, e[1] = n, e[2] = r) : r = e[2], r;
535
+ }
536
+ //#endregion
537
+ export { ProjectsOverviewPage };