likec4 1.7.3 → 1.8.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.
@@ -2,17 +2,19 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import { createContext as createContext$1, useLayoutEffect as useLayoutEffect$1, useEffect as useEffect$1, useContext as useContext$1, useRef as useRef$1, useInsertionEffect, useCallback as useCallback$1, useMemo as useMemo$1, forwardRef as forwardRef$1, Fragment as Fragment$1, createElement as createElement$1, useId as useId$1, Children, isValidElement, useState as useState$1, memo as memo$1, Component, StrictMode } from "react";
4
4
  import { createRoot } from "react-dom/client";
5
- import { L as Link, c as createRootRouteWithContext, S as ScrollRestoration, O as Outlet, a as createFileRoute, u as useRouter, b as useParams, d as useRouterState, i as isNotFound, n as notFound, R as RouterProvider, e as createRouter$1, f as createHashHistory, g as createBrowserHistory } from "./chunks/tanstack-router-C3bHLsEH.js";
6
- import { C as Container, T as Title, a as Text$1, G as Group, B as Button, c as createTheme, M as MantineProvider, b as MantineContext, u as useHotkeys, d as clsx, e as Box, A as ActionIcon$2, H as HoverCard, f as HoverCardTarget, U as UnstyledButton, g as HoverCardDropdown, S as Stack, h as Anchor, i as CopyButton$1, j as useLocalStorage, k as Card, l as CardSection, m as Spoiler, n as ButtonGroup, r as rem, D as Divider, o as Space, p as TooltipGroup, F as Flex, q as Tooltip$2, s as ColorSwatch, t as CheckIcon, v as Select, w as Slider, x as SegmentedControl, P as Popover, y as PopoverTarget, z as PopoverDropdown, E as FloatingIndicator, N as Notification, I as Code, J as SimpleGrid, K as useMantineColorScheme, L as useTree, O as useComputedColorScheme, Q as Tree, R as ThemeIcon, V as Drawer, W as ScrollArea, X as Alert, Y as ModalRoot, Z as ModalOverlay, _ as ModalContent, $ as ModalBody, a0 as Tabs, a1 as TabsList, a2 as TabsTab, a3 as TabsPanel, a4 as useMantineTheme, a5 as useMediaQuery, a6 as useDisclosure, a7 as Paper, a8 as Menu, a9 as MenuTarget, aa as MenuDropdown, ab as MenuItem, ac as MenuLabel, ad as LoadingOverlay, ae as useCallbackRef, af as Burger, ag as Loader } from "./chunks/mantine-B6zTvdIg.js";
7
- import { ComponentName, basepath, useHashHistory } from "./const.js";
8
- import { u as useReactFlow, a as useStoreApi, b as useNodesData, c as useStore, d as createWithEqualityFn, e as applyNodeChanges, f as applyEdgeChanges, g as getViewportForBounds, h as getNodeDimensions, i as getBoundsOfRects, s as shallow$1, j as boxToRect, k as useStoreWithEqualityFn, E as EdgeLabelRenderer, H as Handle, P as Position, l as useOnViewportChange, m as index, n as useOnSelectionChange, B as Background, o as BackgroundVariant, C as Controls, R as ReactFlowProvider } from "./chunks/likec4-DA506XqP.js";
5
+ import { L as Link, c as createRootRouteWithContext, S as ScrollRestoration, O as Outlet, u as useRouter, a as createFileRoute, b as useParams, d as useRouterState, i as isNotFound, n as notFound, R as RouterProvider, e as createRouter$1, f as createHashHistory, g as createBrowserHistory } from "./chunks/tanstack-router-ma6rQsdz.js";
6
+ import { C as Container, T as Title, a as Text$1, G as Group, B as Button, c as createTheme, M as MantineProvider, b as MantineContext, u as useHotkeys, d as clsx, e as Box, A as ActionIcon$2, H as HoverCard, f as HoverCardTarget, U as UnstyledButton, g as HoverCardDropdown, S as Stack, h as Anchor, i as CopyButton$1, j as useLocalStorage, k as Card, l as CardSection, m as Spoiler, n as ButtonGroup, o as Tooltip$2, p as ThemeIcon, P as Paper, q as Tabs, r as TabsList, s as TabsTab, t as TabsPanel, v as ScrollAreaAutosize, w as Badge, x as rem, D as Divider, y as Space, z as TooltipGroup, F as Flex, E as ColorSwatch, I as CheckIcon, J as Select, K as Slider, L as SegmentedControl, N as Popover, O as PopoverTarget, Q as PopoverDropdown, R as FloatingIndicator, V as Notification, W as Code, X as Center, Y as Image, Z as useMantineColorScheme, _ as SimpleGrid, $ as useTree, a0 as useComputedColorScheme, a1 as Tree, a2 as Drawer, a3 as ScrollArea, a4 as Alert, a5 as ModalRoot, a6 as ModalOverlay, a7 as ModalContent, a8 as ModalBody, a9 as useMantineTheme, aa as useMediaQuery, ab as useDisclosure, ac as Menu, ad as MenuTarget, ae as MenuDropdown, af as MenuLabel, ag as MenuItem, ah as LoadingOverlay, ai as useCallbackRef, aj as Burger, ak as Loader } from "./chunks/mantine-BYr8JSNL.js";
7
+ import { withOverviewGraph, ComponentName, basepath, useHashHistory } from "./const.js";
8
+ import { useOverviewGraph } from "virtual:likec4/overview-graph";
9
+ import { u as useReactFlow, a as useStoreApi, b as useNodesData, c as useStore, d as createWithEqualityFn, e as applyNodeChanges, f as applyEdgeChanges, g as getViewportForBounds, h as getNodeDimensions, i as getBoundsOfRects, s as shallow$1, j as boxToRect, k as useStoreWithEqualityFn, E as EdgeLabelRenderer, H as Handle, P as Position, l as useOnViewportChange, m as index, n as useOnSelectionChange, B as Background, o as BackgroundVariant, C as Controls, R as ReactFlowProvider, p as BaseEdge, q as useNodesState, r as useEdgesState } from "./chunks/likec4-Blyd4UZO.js";
10
+ import { usePreviewUrl } from "virtual:likec4/previews";
9
11
  import { useLikeC4Views, useLikeC4View } from "virtual:likec4/store";
10
12
  import { RenderIcon } from "./icons.js";
11
13
  import { useStore as useStore$1 } from "@nanostores/react";
12
14
  import { atom, onMount } from "nanostores";
13
- var content = "_1u4wf800", image = "_1u4wf801", inner = "_1u4wf802", root = "_1u4wf803", description$2 = "_1u4wf804", title$3 = "_1u4wf805";
15
+ var content = "_1u4wf800", image = "_1u4wf801", inner = "_1u4wf802", root$1 = "_1u4wf803", description$2 = "_1u4wf804", title$3 = "_1u4wf805";
14
16
  function NotFound() {
15
- return /* @__PURE__ */ jsx(Container, { className: root, children: /* @__PURE__ */ jsxs("div", { className: inner, children: [
17
+ return /* @__PURE__ */ jsx(Container, { className: root$1, children: /* @__PURE__ */ jsxs("div", { className: inner, children: [
16
18
  /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 362 145", className: image, children: /* @__PURE__ */ jsx(
17
19
  "path",
18
20
  {
@@ -78,83 +80,473 @@ function RootComponent() {
78
80
  )
79
81
  ] });
80
82
  }
81
- var getOwnPropertyNames = Object.getOwnPropertyNames, getOwnPropertySymbols = Object.getOwnPropertySymbols, hasOwnProperty = Object.prototype.hasOwnProperty;
82
- function combineComparators(comparatorA, comparatorB) {
83
- return function(a2, b2, state) {
84
- return comparatorA(a2, b2, state) && comparatorB(a2, b2, state);
85
- };
83
+ const blue$1 = {
84
+ fill: "#3b82f6",
85
+ stroke: "#2563eb",
86
+ hiContrast: "#eff6ff",
87
+ loContrast: "#bfdbfe"
88
+ }, sky$1 = {
89
+ fill: "#0284c7",
90
+ stroke: "#0369a1",
91
+ hiContrast: "#f0f9ff",
92
+ loContrast: "#B6ECF7"
93
+ }, slate$1 = {
94
+ fill: "#64748b",
95
+ stroke: "#475569",
96
+ hiContrast: "#f8fafc",
97
+ loContrast: "#cbd5e1"
98
+ }, ElementColors = {
99
+ primary: blue$1,
100
+ blue: blue$1,
101
+ secondary: sky$1,
102
+ sky: sky$1,
103
+ muted: slate$1,
104
+ slate: slate$1,
105
+ gray: {
106
+ // fill: colors.neutral[500],
107
+ // stroke: colors.neutral[600],
108
+ // hiContrast: colors.neutral[50],
109
+ // loContrast: colors.neutral[200],
110
+ fill: "#737373",
111
+ stroke: "#525252",
112
+ hiContrast: "#fafafa",
113
+ loContrast: "#d4d4d4"
114
+ },
115
+ red: {
116
+ // fill: colors.red[500],
117
+ // stroke: colors.red[600],
118
+ // hiContrast: colors.red[50],
119
+ // loContrast: colors.red[200],
120
+ fill: "#AC4D39",
121
+ // fill: '#b54548',
122
+ stroke: "#853A2D",
123
+ // hiContrast: '#fef2f2',
124
+ // loContrast: '#fecaca',
125
+ // hiContrast: '#191111', // colors.gray[900],
126
+ // loContrast: '#3b1219' // colors.gray[800],
127
+ hiContrast: "#FBD3CB",
128
+ // hiContrast: '#f8fafc',
129
+ // loContrast: '#fdd8d8' // radix black red 12
130
+ loContrast: "#f5b2a3"
131
+ },
132
+ green: {
133
+ fill: "#428a4f",
134
+ stroke: "#2d5d39",
135
+ hiContrast: "#f8fafc",
136
+ loContrast: "#c2f0c2"
137
+ },
138
+ amber: {
139
+ fill: "#A35829",
140
+ stroke: "#7E451D",
141
+ hiContrast: "#FFE0C2",
142
+ loContrast: "#f9b27c"
143
+ },
144
+ indigo: {
145
+ // fill: colors.indigo[500],
146
+ // stroke: colors.indigo[600],
147
+ // hiContrast: colors.indigo[50],
148
+ // loContrast: colors.indigo[200],
149
+ fill: "#6366f1",
150
+ stroke: "#4f46e5",
151
+ hiContrast: "#eef2ff",
152
+ loContrast: "#c7d2fe"
153
+ }
154
+ }, gray = {
155
+ lineColor: "#6E6E6E",
156
+ labelBgColor: "#18191b",
157
+ labelColor: "#C6C6C6"
158
+ }, slate = {
159
+ lineColor: "#64748b",
160
+ // 500
161
+ labelBgColor: "#0f172a",
162
+ // 900
163
+ labelColor: "#cbd5e1"
164
+ // 300
165
+ }, blue = {
166
+ lineColor: "#3b82f6",
167
+ // 500
168
+ labelBgColor: "#172554",
169
+ // 950
170
+ labelColor: "#60a5fa"
171
+ // 400
172
+ }, sky = {
173
+ lineColor: "#0ea5e9",
174
+ // 500
175
+ labelBgColor: "#082f49",
176
+ // 950
177
+ labelColor: "#38bdf8"
178
+ // 400
179
+ }, RelationshipColors = {
180
+ amber: {
181
+ lineColor: "#b45309",
182
+ labelBgColor: "#78350f",
183
+ labelColor: "#FFE0C2"
184
+ },
185
+ blue,
186
+ gray,
187
+ green: {
188
+ lineColor: "#15803d",
189
+ // 700
190
+ labelBgColor: "#052e16",
191
+ // 950
192
+ labelColor: "#22c55e"
193
+ // 500
194
+ },
195
+ indigo: {
196
+ lineColor: "#6366f1",
197
+ // 500
198
+ labelBgColor: "#1e1b4b",
199
+ // 950
200
+ labelColor: "#818cf8"
201
+ // 400
202
+ },
203
+ muted: slate,
204
+ primary: blue,
205
+ red: {
206
+ lineColor: "#AC4D39",
207
+ labelBgColor: "#b91c1c",
208
+ labelColor: "#f5b2a3"
209
+ },
210
+ secondary: sky,
211
+ sky,
212
+ slate
213
+ }, defaultTheme = {
214
+ elements: ElementColors,
215
+ relationships: RelationshipColors,
216
+ font: "Arial",
217
+ shadow: "#0a0a0a"
218
+ };
219
+ function fixProto(target, prototype) {
220
+ var setPrototypeOf = Object.setPrototypeOf;
221
+ setPrototypeOf ? setPrototypeOf(target, prototype) : target.__proto__ = prototype;
86
222
  }
87
- function createIsCircular(areItemsEqual) {
88
- return function(a2, b2, state) {
89
- if (!a2 || !b2 || typeof a2 != "object" || typeof b2 != "object")
90
- return areItemsEqual(a2, b2, state);
91
- var cache = state.cache, cachedA = cache.get(a2), cachedB = cache.get(b2);
92
- if (cachedA && cachedB)
93
- return cachedA === b2 && cachedB === a2;
94
- cache.set(a2, b2), cache.set(b2, a2);
95
- var result = areItemsEqual(a2, b2, state);
96
- return cache.delete(a2), cache.delete(b2), result;
223
+ function fixStack(target, fn) {
224
+ fn === void 0 && (fn = target.constructor);
225
+ var captureStackTrace = Error.captureStackTrace;
226
+ captureStackTrace && captureStackTrace(target, fn);
227
+ }
228
+ var __extends = /* @__PURE__ */ function() {
229
+ var _extendStatics = function(d2, b2) {
230
+ return _extendStatics = Object.setPrototypeOf || {
231
+ __proto__: []
232
+ } instanceof Array && function(d3, b3) {
233
+ d3.__proto__ = b3;
234
+ } || function(d3, b3) {
235
+ for (var p2 in b3)
236
+ Object.prototype.hasOwnProperty.call(b3, p2) && (d3[p2] = b3[p2]);
237
+ }, _extendStatics(d2, b2);
238
+ };
239
+ return function(d2, b2) {
240
+ if (typeof b2 != "function" && b2 !== null) throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null");
241
+ _extendStatics(d2, b2);
242
+ function __() {
243
+ this.constructor = d2;
244
+ }
245
+ d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
97
246
  };
247
+ }(), CustomError = function(_super) {
248
+ __extends(CustomError2, _super);
249
+ function CustomError2(message, options) {
250
+ var _newTarget = this.constructor, _this = _super.call(this, message, options) || this;
251
+ return Object.defineProperty(_this, "name", {
252
+ value: _newTarget.name,
253
+ enumerable: !1,
254
+ configurable: !0
255
+ }), fixProto(_this, _newTarget.prototype), fixStack(_this), _this;
256
+ }
257
+ return CustomError2;
258
+ }(Error), s = { done: !1, hasNext: !1 };
259
+ function u$6(t2, n2, a2) {
260
+ let o2 = (r2) => t2(r2, ...n2);
261
+ return a2 === void 0 ? o2 : Object.assign(o2, { lazy: a2, lazyArgs: n2 });
98
262
  }
99
- function getStrictProperties(object) {
100
- return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
263
+ function u$5(r2, n2, a2) {
264
+ let o2 = r2.length - n2.length;
265
+ if (o2 === 0) return r2(...n2);
266
+ if (o2 === 1) return u$6(r2, n2, a2);
267
+ throw new Error("Wrong number of arguments");
101
268
  }
102
- var hasOwn = Object.hasOwn || function(object, property) {
103
- return hasOwnProperty.call(object, property);
104
- };
105
- function sameValueZeroEqual(a2, b2) {
106
- return a2 || b2 ? a2 === b2 : a2 === b2 || a2 !== a2 && b2 !== b2;
269
+ function r$3(...t2) {
270
+ return u$5(Object.values, t2);
107
271
  }
108
- var OWNER = "_owner", getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor, keys = Object.keys;
109
- function areArraysEqual(a2, b2, state) {
110
- var index2 = a2.length;
111
- if (b2.length !== index2)
112
- return !1;
113
- for (; index2-- > 0; )
114
- if (!state.equals(a2[index2], b2[index2], index2, index2, a2, b2, state))
115
- return !1;
116
- return !0;
272
+ function i$3(...e2) {
273
+ return u$5(r$2, e2);
117
274
  }
118
- function areDatesEqual(a2, b2) {
119
- return sameValueZeroEqual(a2.getTime(), b2.getTime());
275
+ var r$2 = (e2, t2) => e2.length >= t2;
276
+ function u$4(...e2) {
277
+ return u$5(i$2, e2);
120
278
  }
121
- function areMapsEqual(a2, b2, state) {
122
- if (a2.size !== b2.size)
123
- return !1;
124
- for (var matchedIndices = {}, aIterable = a2.entries(), index2 = 0, aResult, bResult; (aResult = aIterable.next()) && !aResult.done; ) {
125
- for (var bIterable = b2.entries(), hasMatch = !1, matchIndex = 0; (bResult = bIterable.next()) && !bResult.done; ) {
126
- var _a = aResult.value, aKey = _a[0], aValue = _a[1], _b = bResult.value, bKey = _b[0], bValue = _b[1];
127
- !hasMatch && !matchedIndices[matchIndex] && (hasMatch = state.equals(aKey, bKey, index2, matchIndex, a2, b2, state) && state.equals(aValue, bValue, aKey, bKey, a2, b2, state)) && (matchedIndices[matchIndex] = !0), matchIndex++;
128
- }
129
- if (!hasMatch)
130
- return !1;
131
- index2++;
279
+ function i$2(e2, a2) {
280
+ let n2 = [];
281
+ for (let [o2, r2] of e2.entries()) {
282
+ if (!a2(r2, o2, e2)) break;
283
+ n2.push(r2);
132
284
  }
133
- return !0;
285
+ return n2;
134
286
  }
135
- function areObjectsEqual(a2, b2, state) {
136
- var properties = keys(a2), index2 = properties.length;
137
- if (keys(b2).length !== index2)
138
- return !1;
139
- for (var property; index2-- > 0; )
140
- if (property = properties[index2], property === OWNER && (a2.$$typeof || b2.$$typeof) && a2.$$typeof !== b2.$$typeof || !hasOwn(b2, property) || !state.equals(a2[property], b2[property], property, property, a2, b2, state))
141
- return !1;
142
- return !0;
287
+ function l$1(...e2) {
288
+ return u$5(u$3, e2);
143
289
  }
144
- function areObjectsEqualStrict(a2, b2, state) {
145
- var properties = getStrictProperties(a2), index2 = properties.length;
146
- if (getStrictProperties(b2).length !== index2)
147
- return !1;
148
- for (var property, descriptorA, descriptorB; index2-- > 0; )
149
- if (property = properties[index2], property === OWNER && (a2.$$typeof || b2.$$typeof) && a2.$$typeof !== b2.$$typeof || !hasOwn(b2, property) || !state.equals(a2[property], b2[property], property, property, a2, b2, state) || (descriptorA = getOwnPropertyDescriptor(a2, property), descriptorB = getOwnPropertyDescriptor(b2, property), (descriptorA || descriptorB) && (!descriptorA || !descriptorB || descriptorA.configurable !== descriptorB.configurable || descriptorA.enumerable !== descriptorB.enumerable || descriptorA.writable !== descriptorB.writable)))
150
- return !1;
151
- return !0;
290
+ var u$3 = (e2, a2, n2) => e2.reduce(a2, n2);
291
+ function b(t2) {
292
+ return (e2, r2) => {
293
+ if (r2 === 0) return t2(e2);
294
+ if (!Number.isInteger(r2)) throw new TypeError(`precision must be an integer: ${r2}`);
295
+ if (r2 > 15 || r2 < -15) throw new RangeError("precision must be between -15 and 15");
296
+ if (Number.isNaN(e2) || !Number.isFinite(e2)) return t2(e2);
297
+ let n2 = 10 ** r2;
298
+ return t2(e2 * n2) / n2;
299
+ };
152
300
  }
153
- function arePrimitiveWrappersEqual(a2, b2) {
154
- return sameValueZeroEqual(a2.valueOf(), b2.valueOf());
301
+ function p$1(...o2) {
302
+ return u$5(t$4, o2);
155
303
  }
156
- function areRegExpsEqual(a2, b2) {
157
- return a2.source === b2.source && a2.flags === b2.flags;
304
+ var t$4 = (o2, e2) => o2[e2];
305
+ function a$2(...n2) {
306
+ return u$5(c, n2);
307
+ }
308
+ function c(n2, r2) {
309
+ let o2 = {};
310
+ for (let e2 of r2) e2 in n2 && (o2[e2] = n2[e2]);
311
+ return o2;
312
+ }
313
+ function t$3(...n2) {
314
+ return u$5(Object.keys, n2);
315
+ }
316
+ function a$1(...e2) {
317
+ return u$5(n$2, e2);
318
+ }
319
+ var n$2 = (e2) => e2.at(-1);
320
+ function m$1(...a2) {
321
+ return u$5(o$2, a2, p);
322
+ }
323
+ var o$2 = (a2, e2) => a2.map(e2), p = (a2) => (e2, r2, t2) => ({ done: !1, hasNext: !0, next: a2(e2, r2, t2) });
324
+ function n$1(e2) {
325
+ return !!e2;
326
+ }
327
+ function l(n2) {
328
+ return n2 != null;
329
+ }
330
+ function o$1(a2) {
331
+ return (t2) => !a2(t2);
332
+ }
333
+ function e$3(n2) {
334
+ return n2 == null;
335
+ }
336
+ function e$2(r2) {
337
+ return typeof r2 == "number" && !Number.isNaN(r2);
338
+ }
339
+ function n(r2) {
340
+ return Array.isArray(r2);
341
+ }
342
+ var e$1 = (n2) => Object.assign(n2, { single: !0 });
343
+ function f(...e2) {
344
+ return u$5(i$1, e2, e$1(u$2));
345
+ }
346
+ var i$1 = (e2, n2) => e2.find(n2), u$2 = (e2) => (n2, t2, o2) => e2(n2, t2, o2) ? { done: !0, hasNext: !0, next: n2 } : s;
347
+ function d(...e2) {
348
+ return u$5(r$1, e2, e$1(o));
349
+ }
350
+ var r$1 = ([e2]) => e2, o = () => a, a = (e2) => ({ hasNext: !0, next: e2, done: !0 });
351
+ function t$2(...r2) {
352
+ return u$5(Object.entries, r2);
353
+ }
354
+ function t$1(...a2) {
355
+ return u$5(e, a2);
356
+ }
357
+ var e = (a2, o2) => o2.every((l2) => l2(a2));
358
+ function y$1(...a2) {
359
+ return u$5(r, a2);
360
+ }
361
+ var r = (a2, o2) => o2.some((e2) => e2(a2));
362
+ function u$1(...e2) {
363
+ return u$5(b(Math.ceil), e2);
364
+ }
365
+ function u(...n2) {
366
+ return u$5(i, n2);
367
+ }
368
+ var i = (n2, { min: e2, max: r2 }) => e2 !== void 0 && n2 < e2 ? e2 : r2 !== void 0 && n2 > r2 ? r2 : n2;
369
+ function isString$1(value) {
370
+ return value != null && typeof value == "string";
371
+ }
372
+ class BaseError extends CustomError {
373
+ constructor(message, options) {
374
+ super(message, options), Object.defineProperty(this, "name", { value: "BaseError" });
375
+ }
376
+ }
377
+ class NullableError extends BaseError {
378
+ constructor(message, options) {
379
+ super(message, options), Object.defineProperty(this, "name", { value: "NullableError" });
380
+ }
381
+ }
382
+ class InvariantError extends BaseError {
383
+ constructor(message, options) {
384
+ super(message, options), Object.defineProperty(this, "name", { value: "InvariantError" });
385
+ }
386
+ }
387
+ function nonNullable(value, message) {
388
+ if (typeof value > "u" || value == null)
389
+ throw new NullableError(message ?? `Expected defined value, but received ${value}`);
390
+ return value;
391
+ }
392
+ function invariant$1(condition, message) {
393
+ if (!condition)
394
+ throw new InvariantError(message ?? "Invariant failed");
395
+ }
396
+ class NonExhaustiveError extends BaseError {
397
+ constructor(message, options) {
398
+ super(message, options), Object.defineProperty(this, "name", { value: "NonExhaustiveError" });
399
+ }
400
+ }
401
+ function nonexhaustive(value) {
402
+ throw new NonExhaustiveError(`NonExhaustive value: ${value}`);
403
+ }
404
+ const ElementShapes = [
405
+ "rectangle",
406
+ "person",
407
+ "browser",
408
+ "mobile",
409
+ "cylinder",
410
+ "storage",
411
+ "queue"
412
+ ], isTagEqual = (operator) => "tag" in operator, isKindEqual = (operator) => "kind" in operator, isNotOperator = (operator) => "not" in operator, isAndOperator = (operator) => "and" in operator, isOrOperator = (operator) => "or" in operator;
413
+ function whereOperatorAsPredicate(operator) {
414
+ switch (!0) {
415
+ case isTagEqual(operator): {
416
+ if ("eq" in operator.tag) {
417
+ const tag2 = operator.tag.eq;
418
+ return (value) => Array.isArray(value.tags) && value.tags.includes(tag2);
419
+ }
420
+ const tag = operator.tag.neq;
421
+ return (value) => !Array.isArray(value.tags) || !value.tags.includes(tag);
422
+ }
423
+ case isKindEqual(operator): {
424
+ if ("eq" in operator.kind) {
425
+ const kind2 = operator.kind.eq;
426
+ return (value) => value.kind === kind2;
427
+ }
428
+ const kind = operator.kind.neq;
429
+ return (value) => e$3(value.kind) || value.kind !== kind;
430
+ }
431
+ case isNotOperator(operator): {
432
+ const predicate = whereOperatorAsPredicate(operator.not);
433
+ return o$1(predicate);
434
+ }
435
+ case isAndOperator(operator): {
436
+ const predicates = operator.and.map(whereOperatorAsPredicate);
437
+ return t$1(predicates);
438
+ }
439
+ case isOrOperator(operator): {
440
+ const predicates = operator.or.map(whereOperatorAsPredicate);
441
+ return y$1(predicates);
442
+ }
443
+ default:
444
+ nonexhaustive(operator);
445
+ }
446
+ }
447
+ function StepEdgeId(step) {
448
+ return `step-${String(step).padStart(3, "0")}`;
449
+ }
450
+ function isStepEdgeId(id2) {
451
+ return id2.startsWith("step-");
452
+ }
453
+ function extractStep(id2) {
454
+ if (!isStepEdgeId(id2))
455
+ throw new Error(`Invalid step edge id: ${id2}`);
456
+ return Number(id2.slice(5));
457
+ }
458
+ function getBBoxCenter({
459
+ x: x2,
460
+ y: y2,
461
+ width,
462
+ height
463
+ }) {
464
+ return {
465
+ x: x2 + width / 2,
466
+ y: y2 + height / 2
467
+ };
468
+ }
469
+ function isAncestor(...args) {
470
+ const ancestor = isString$1(args[0]) ? args[0] : args[0].id;
471
+ return (isString$1(args[1]) ? args[1] : args[1].id).startsWith(ancestor + ".");
472
+ }
473
+ var getOwnPropertyNames = Object.getOwnPropertyNames, getOwnPropertySymbols = Object.getOwnPropertySymbols, hasOwnProperty = Object.prototype.hasOwnProperty;
474
+ function combineComparators(comparatorA, comparatorB) {
475
+ return function(a2, b2, state) {
476
+ return comparatorA(a2, b2, state) && comparatorB(a2, b2, state);
477
+ };
478
+ }
479
+ function createIsCircular(areItemsEqual) {
480
+ return function(a2, b2, state) {
481
+ if (!a2 || !b2 || typeof a2 != "object" || typeof b2 != "object")
482
+ return areItemsEqual(a2, b2, state);
483
+ var cache = state.cache, cachedA = cache.get(a2), cachedB = cache.get(b2);
484
+ if (cachedA && cachedB)
485
+ return cachedA === b2 && cachedB === a2;
486
+ cache.set(a2, b2), cache.set(b2, a2);
487
+ var result = areItemsEqual(a2, b2, state);
488
+ return cache.delete(a2), cache.delete(b2), result;
489
+ };
490
+ }
491
+ function getStrictProperties(object) {
492
+ return getOwnPropertyNames(object).concat(getOwnPropertySymbols(object));
493
+ }
494
+ var hasOwn = Object.hasOwn || function(object, property) {
495
+ return hasOwnProperty.call(object, property);
496
+ };
497
+ function sameValueZeroEqual(a2, b2) {
498
+ return a2 || b2 ? a2 === b2 : a2 === b2 || a2 !== a2 && b2 !== b2;
499
+ }
500
+ var OWNER = "_owner", getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor, keys = Object.keys;
501
+ function areArraysEqual(a2, b2, state) {
502
+ var index2 = a2.length;
503
+ if (b2.length !== index2)
504
+ return !1;
505
+ for (; index2-- > 0; )
506
+ if (!state.equals(a2[index2], b2[index2], index2, index2, a2, b2, state))
507
+ return !1;
508
+ return !0;
509
+ }
510
+ function areDatesEqual(a2, b2) {
511
+ return sameValueZeroEqual(a2.getTime(), b2.getTime());
512
+ }
513
+ function areMapsEqual(a2, b2, state) {
514
+ if (a2.size !== b2.size)
515
+ return !1;
516
+ for (var matchedIndices = {}, aIterable = a2.entries(), index2 = 0, aResult, bResult; (aResult = aIterable.next()) && !aResult.done; ) {
517
+ for (var bIterable = b2.entries(), hasMatch = !1, matchIndex = 0; (bResult = bIterable.next()) && !bResult.done; ) {
518
+ var _a = aResult.value, aKey = _a[0], aValue = _a[1], _b = bResult.value, bKey = _b[0], bValue = _b[1];
519
+ !hasMatch && !matchedIndices[matchIndex] && (hasMatch = state.equals(aKey, bKey, index2, matchIndex, a2, b2, state) && state.equals(aValue, bValue, aKey, bKey, a2, b2, state)) && (matchedIndices[matchIndex] = !0), matchIndex++;
520
+ }
521
+ if (!hasMatch)
522
+ return !1;
523
+ index2++;
524
+ }
525
+ return !0;
526
+ }
527
+ function areObjectsEqual(a2, b2, state) {
528
+ var properties = keys(a2), index2 = properties.length;
529
+ if (keys(b2).length !== index2)
530
+ return !1;
531
+ for (var property; index2-- > 0; )
532
+ if (property = properties[index2], property === OWNER && (a2.$$typeof || b2.$$typeof) && a2.$$typeof !== b2.$$typeof || !hasOwn(b2, property) || !state.equals(a2[property], b2[property], property, property, a2, b2, state))
533
+ return !1;
534
+ return !0;
535
+ }
536
+ function areObjectsEqualStrict(a2, b2, state) {
537
+ var properties = getStrictProperties(a2), index2 = properties.length;
538
+ if (getStrictProperties(b2).length !== index2)
539
+ return !1;
540
+ for (var property, descriptorA, descriptorB; index2-- > 0; )
541
+ if (property = properties[index2], property === OWNER && (a2.$$typeof || b2.$$typeof) && a2.$$typeof !== b2.$$typeof || !hasOwn(b2, property) || !state.equals(a2[property], b2[property], property, property, a2, b2, state) || (descriptorA = getOwnPropertyDescriptor(a2, property), descriptorB = getOwnPropertyDescriptor(b2, property), (descriptorA || descriptorB) && (!descriptorA || !descriptorB || descriptorA.configurable !== descriptorB.configurable || descriptorA.enumerable !== descriptorB.enumerable || descriptorA.writable !== descriptorB.writable)))
542
+ return !1;
543
+ return !0;
544
+ }
545
+ function arePrimitiveWrappersEqual(a2, b2) {
546
+ return sameValueZeroEqual(a2.valueOf(), b2.valueOf());
547
+ }
548
+ function areRegExpsEqual(a2, b2) {
549
+ return a2.source === b2.source && a2.flags === b2.flags;
158
550
  }
159
551
  function areSetsEqual(a2, b2, state) {
160
552
  if (a2.size !== b2.size)
@@ -300,7 +692,7 @@ function createCustomEqual(options) {
300
692
  return createIsEqual({ circular, comparator, createState: createState2, equals, strict });
301
693
  }
302
694
  const MotionConfigContext = createContext$1({
303
- transformPagePoint: (p) => p,
695
+ transformPagePoint: (p2) => p2,
304
696
  isStatic: !1,
305
697
  reducedMotion: "never"
306
698
  }), MotionContext = createContext$1({}), PresenceContext = createContext$1(null), isBrowser$1 = typeof window < "u", useIsomorphicLayoutEffect$2 = isBrowser$1 ? useLayoutEffect$1 : useEffect$1, LazyContext = createContext$1({ strict: !1 }), camelToDash = (str) => str.replace(/([a-z])([A-Z])/gu, "$1-$2").toLowerCase(), optimizedAppearDataId = "framerAppearId", optimizedAppearDataAttribute = "data-" + camelToDash(optimizedAppearDataId), MotionGlobalConfig = {
@@ -517,7 +909,7 @@ function loadFeatures(features) {
517
909
  };
518
910
  }
519
911
  const LayoutGroupContext = createContext$1({}), motionComponentSymbol = Symbol.for("motionComponentSymbol"), noop$1 = (any) => any;
520
- let invariant$1 = noop$1;
912
+ let invariant = noop$1;
521
913
  function createMotionComponent({ preloadedFeatures, createVisualElement, useRender, useVisualState, Component: Component2 }) {
522
914
  preloadedFeatures && loadFeatures(preloadedFeatures);
523
915
  function MotionComponent(props2, externalRef) {
@@ -650,14 +1042,14 @@ const isMotionValue = (value) => !!(value && value.getVelocity), getValueAsType
650
1042
  ...number,
651
1043
  default: 1
652
1044
  }, sanitize = (v) => Math.round(v * 1e5) / 1e5, floatRegex = /-?(?:\d+(?:\.\d+)?|\.\d+)/gu, colorRegex = /(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu, singleColorRegex = /^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;
653
- function isString$1(v) {
1045
+ function isString(v) {
654
1046
  return typeof v == "string";
655
1047
  }
656
1048
  function isNullish(v) {
657
1049
  return v == null;
658
1050
  }
659
1051
  const createUnitType = (unit) => ({
660
- test: (v) => isString$1(v) && v.endsWith(unit) && v.split(" ").length === 1,
1052
+ test: (v) => isString(v) && v.endsWith(unit) && v.split(" ").length === 1,
661
1053
  parse: parseFloat,
662
1054
  transform: (v) => `${v}${unit}`
663
1055
  }), degrees = createUnitType("deg"), percent = createUnitType("%"), px = createUnitType("px"), vh = createUnitType("vh"), vw = createUnitType("vw"), progressPercentage = {
@@ -761,7 +1153,7 @@ function buildTransform(latestValues, transform, transformTemplate) {
761
1153
  }
762
1154
  const checkStringStartsWith = (token) => (key) => typeof key == "string" && key.startsWith(token), isCSSVariableName = checkStringStartsWith("--"), startsAsVariableToken = checkStringStartsWith("var(--"), isCSSVariableToken = (value) => startsAsVariableToken(value) ? singleCssVariableRegex.test(value.split("/*")[0].trim()) : !1, singleCssVariableRegex = /var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;
763
1155
  function buildHTMLStyles(state, latestValues, transformTemplate) {
764
- const { style, vars, transformOrigin } = state;
1156
+ const { style, vars: vars2, transformOrigin } = state;
765
1157
  let hasTransform = !1, hasTransformOrigin = !1;
766
1158
  for (const key in latestValues) {
767
1159
  const value = latestValues[key];
@@ -769,7 +1161,7 @@ function buildHTMLStyles(state, latestValues, transformTemplate) {
769
1161
  hasTransform = !0;
770
1162
  continue;
771
1163
  } else if (isCSSVariableName(key)) {
772
- vars[key] = value;
1164
+ vars2[key] = value;
773
1165
  continue;
774
1166
  } else {
775
1167
  const valueAsType = getValueAsType(value, numberValueTypes[key]);
@@ -920,10 +1312,10 @@ function createUseRender(forwardMotionProps = !1) {
920
1312
  });
921
1313
  };
922
1314
  }
923
- function renderHTML(element, { style, vars }, styleProp, projection) {
1315
+ function renderHTML(element, { style, vars: vars2 }, styleProp, projection) {
924
1316
  Object.assign(element.style, style, projection && projection.getProjectionStyles(styleProp));
925
- for (const key in vars)
926
- element.style.setProperty(key, vars[key]);
1317
+ for (const key in vars2)
1318
+ element.style.setProperty(key, vars2[key]);
927
1319
  }
928
1320
  const camelCaseAttributes = /* @__PURE__ */ new Set([
929
1321
  "baseFrequency",
@@ -1380,16 +1772,7 @@ function getFinalKeyframe(keyframes2, { repeat, repeatType = "loop" }, finalKeyf
1380
1772
  const resolvedKeyframes = keyframes2.filter(isNotNull), index2 = repeat && repeatType !== "loop" && repeat % 2 === 1 ? 0 : resolvedKeyframes.length - 1;
1381
1773
  return !index2 || finalKeyframe === void 0 ? resolvedKeyframes[index2] : finalKeyframe;
1382
1774
  }
1383
- let now;
1384
- function clearTime() {
1385
- now = void 0;
1386
- }
1387
- const time = {
1388
- now: () => (now === void 0 && time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming ? frameData.timestamp : performance.now()), now),
1389
- set: (newTime) => {
1390
- now = newTime, queueMicrotask(clearTime);
1391
- }
1392
- }, isZeroValueString = (v) => /^0[^.\s]+$/u.test(v);
1775
+ const isZeroValueString = (v) => /^0[^.\s]+$/u.test(v);
1393
1776
  function isNone(value) {
1394
1777
  return typeof value == "number" ? value === 0 : value !== null ? value === "none" || value === "0" || isZeroValueString(value) : !0;
1395
1778
  }
@@ -1531,14 +1914,14 @@ class KeyframeResolver {
1531
1914
  this.isComplete || this.scheduleResolve();
1532
1915
  }
1533
1916
  }
1534
- const isColorString = (type, testProp) => (v) => !!(isString$1(v) && singleColorRegex.test(v) && v.startsWith(type) || testProp && !isNullish(v) && Object.prototype.hasOwnProperty.call(v, testProp)), splitColor = (aName, bName, cName) => (v) => {
1535
- if (!isString$1(v))
1917
+ const isColorString = (type, testProp) => (v) => !!(isString(v) && singleColorRegex.test(v) && v.startsWith(type) || testProp && !isNullish(v) && Object.prototype.hasOwnProperty.call(v, testProp)), splitColor = (aName, bName, cName) => (v) => {
1918
+ if (!isString(v))
1536
1919
  return v;
1537
- const [a2, b2, c, alpha2] = v.match(floatRegex);
1920
+ const [a2, b2, c2, alpha2] = v.match(floatRegex);
1538
1921
  return {
1539
1922
  [aName]: parseFloat(a2),
1540
1923
  [bName]: parseFloat(b2),
1541
- [cName]: parseFloat(c),
1924
+ [cName]: parseFloat(c2),
1542
1925
  alpha: alpha2 !== void 0 ? parseFloat(alpha2) : 1
1543
1926
  };
1544
1927
  }, clampRgbUnit = (v) => clamp(0, 255, v), rgbUnit = {
@@ -1569,11 +1952,11 @@ const hex = {
1569
1952
  }, color = {
1570
1953
  test: (v) => rgba.test(v) || hex.test(v) || hsla.test(v),
1571
1954
  parse: (v) => rgba.test(v) ? rgba.parse(v) : hsla.test(v) ? hsla.parse(v) : hex.parse(v),
1572
- transform: (v) => isString$1(v) ? v : v.hasOwnProperty("red") ? rgba.transform(v) : hsla.transform(v)
1955
+ transform: (v) => isString(v) ? v : v.hasOwnProperty("red") ? rgba.transform(v) : hsla.transform(v)
1573
1956
  };
1574
1957
  function test(v) {
1575
1958
  var _a, _b;
1576
- return isNaN(v) && isString$1(v) && (((_a = v.match(floatRegex)) === null || _a === void 0 ? void 0 : _a.length) || 0) + (((_b = v.match(colorRegex)) === null || _b === void 0 ? void 0 : _b.length) || 0) > 0;
1959
+ return isNaN(v) && isString(v) && (((_a = v.match(floatRegex)) === null || _a === void 0 ? void 0 : _a.length) || 0) + (((_b = v.match(colorRegex)) === null || _b === void 0 ? void 0 : _b.length) || 0) > 0;
1577
1960
  }
1578
1961
  const NUMBER_TOKEN = "number", COLOR_TOKEN = "color", VAR_TOKEN = "var", VAR_FUNCTION_TOKEN = "var(", SPLIT_TOKEN = "${}", complexRegex = /var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;
1579
1962
  function analyseComplexValue(value) {
@@ -1662,12 +2045,12 @@ function makeNoneKeyframesAnimatable(unresolvedKeyframes, noneKeyframeIndexes, n
1662
2045
  unresolvedKeyframes[noneIndex] = getAnimatableNone(name, animatableTemplate);
1663
2046
  }
1664
2047
  class DOMKeyframesResolver extends KeyframeResolver {
1665
- constructor(unresolvedKeyframes, onComplete, name, motionValue2) {
1666
- super(unresolvedKeyframes, onComplete, name, motionValue2, motionValue2?.owner, !0);
2048
+ constructor(unresolvedKeyframes, onComplete, name, motionValue2, element) {
2049
+ super(unresolvedKeyframes, onComplete, name, motionValue2, element, !0);
1667
2050
  }
1668
2051
  readKeyframes() {
1669
2052
  const { unresolvedKeyframes, element, name } = this;
1670
- if (!element.current)
2053
+ if (!element || !element.current)
1671
2054
  return;
1672
2055
  super.readKeyframes();
1673
2056
  for (let i2 = 0; i2 < unresolvedKeyframes.length; i2++) {
@@ -1697,7 +2080,7 @@ class DOMKeyframesResolver extends KeyframeResolver {
1697
2080
  }
1698
2081
  measureInitialState() {
1699
2082
  const { element, unresolvedKeyframes, name } = this;
1700
- if (!element.current)
2083
+ if (!element || !element.current)
1701
2084
  return;
1702
2085
  name === "height" && (this.suspendedScrollY = window.pageYOffset), this.measuredOrigin = positionalValues[name](element.measureViewportBox(), window.getComputedStyle(element.current)), unresolvedKeyframes[0] = this.measuredOrigin;
1703
2086
  const measureKeyframe = unresolvedKeyframes[unresolvedKeyframes.length - 1];
@@ -1706,7 +2089,7 @@ class DOMKeyframesResolver extends KeyframeResolver {
1706
2089
  measureEndState() {
1707
2090
  var _a;
1708
2091
  const { element, name, unresolvedKeyframes } = this;
1709
- if (!element.current)
2092
+ if (!element || !element.current)
1710
2093
  return;
1711
2094
  const value = element.getValue(name);
1712
2095
  value && value.jump(this.measuredOrigin, !1);
@@ -1720,7 +2103,16 @@ function memo(callback) {
1720
2103
  let result;
1721
2104
  return () => (result === void 0 && (result = callback()), result);
1722
2105
  }
1723
- const isAnimatable = (value, name) => name === "zIndex" ? !1 : !!(typeof value == "number" || Array.isArray(value) || typeof value == "string" && // It's animatable if we have a string
2106
+ let now;
2107
+ function clearTime() {
2108
+ now = void 0;
2109
+ }
2110
+ const time = {
2111
+ now: () => (now === void 0 && time.set(frameData.isProcessing || MotionGlobalConfig.useManualTiming ? frameData.timestamp : performance.now()), now),
2112
+ set: (newTime) => {
2113
+ now = newTime, queueMicrotask(clearTime);
2114
+ }
2115
+ }, isAnimatable = (value, name) => name === "zIndex" ? !1 : !!(typeof value == "number" || Array.isArray(value) || typeof value == "string" && // It's animatable if we have a string
1724
2116
  (complex.test(value) || value === "0") && // And it contains numbers and/or colors
1725
2117
  !value.startsWith("url("));
1726
2118
  function hasKeyframesChanged(keyframes2) {
@@ -1740,9 +2132,10 @@ function canAnimate(keyframes2, name, type, velocity) {
1740
2132
  const targetKeyframe = keyframes2[keyframes2.length - 1], isOriginAnimatable = isAnimatable(originKeyframe, name), isTargetAnimatable = isAnimatable(targetKeyframe, name);
1741
2133
  return !isOriginAnimatable || !isTargetAnimatable ? !1 : hasKeyframesChanged(keyframes2) || type === "spring" && velocity;
1742
2134
  }
2135
+ const MAX_RESOLVE_DELAY = 40;
1743
2136
  class BaseAnimation {
1744
2137
  constructor({ autoplay = !0, delay = 0, type = "keyframes", repeat = 0, repeatDelay = 0, repeatType = "loop", ...options }) {
1745
- this.isStopped = !1, this.hasAttemptedResolve = !1, this.options = {
2138
+ this.isStopped = !1, this.hasAttemptedResolve = !1, this.createdAt = time.now(), this.options = {
1746
2139
  autoplay,
1747
2140
  delay,
1748
2141
  type,
@@ -1752,6 +2145,19 @@ class BaseAnimation {
1752
2145
  ...options
1753
2146
  }, this.updateFinishedPromise();
1754
2147
  }
2148
+ /**
2149
+ * This method uses the createdAt and resolvedAt to calculate the
2150
+ * animation startTime. *Ideally*, we would use the createdAt time as t=0
2151
+ * as the following frame would then be the first frame of the animation in
2152
+ * progress, which would feel snappier.
2153
+ *
2154
+ * However, if there's a delay (main thread work) between the creation of
2155
+ * the animation and the first commited frame, we prefer to use resolvedAt
2156
+ * to avoid a sudden jump into the animation.
2157
+ */
2158
+ calcStartTime() {
2159
+ return this.resolvedAt ? this.resolvedAt - this.createdAt > MAX_RESOLVE_DELAY ? this.resolvedAt : this.createdAt : this.createdAt;
2160
+ }
1755
2161
  /**
1756
2162
  * A getter for resolved data. If keyframes are not yet resolved, accessing
1757
2163
  * this.resolved will synchronously flush all pending keyframe resolvers.
@@ -1766,7 +2172,7 @@ class BaseAnimation {
1766
2172
  * Otherwise, it will call initPlayback on the implementing class.
1767
2173
  */
1768
2174
  onKeyframesResolved(keyframes2, finalKeyframe) {
1769
- this.hasAttemptedResolve = !0;
2175
+ this.resolvedAt = time.now(), this.hasAttemptedResolve = !0;
1770
2176
  const { name, type, velocity, delay, onComplete, onUpdate, isGenerator } = this.options;
1771
2177
  if (!isGenerator && !canAnimate(keyframes2, name, type, velocity))
1772
2178
  if (delay)
@@ -1810,8 +2216,8 @@ const safeMin = 1e-3, minDuration = 0.01, maxDuration$1 = 10, minDamping = 0.05,
1810
2216
  function findSpring({ duration = 800, bounce = 0.25, velocity = 0, mass = 1 }) {
1811
2217
  let envelope, derivative, dampingRatio = 1 - bounce;
1812
2218
  dampingRatio = clamp(minDamping, maxDamping, dampingRatio), duration = clamp(minDuration, maxDuration$1, millisecondsToSeconds(duration)), dampingRatio < 1 ? (envelope = (undampedFreq2) => {
1813
- const exponentialDecay = undampedFreq2 * dampingRatio, delta = exponentialDecay * duration, a2 = exponentialDecay - velocity, b2 = calcAngularFreq(undampedFreq2, dampingRatio), c = Math.exp(-delta);
1814
- return safeMin - a2 / b2 * c;
2219
+ const exponentialDecay = undampedFreq2 * dampingRatio, delta = exponentialDecay * duration, a2 = exponentialDecay - velocity, b2 = calcAngularFreq(undampedFreq2, dampingRatio), c2 = Math.exp(-delta);
2220
+ return safeMin - a2 / b2 * c2;
1815
2221
  }, derivative = (undampedFreq2) => {
1816
2222
  const delta = undampedFreq2 * dampingRatio * duration, d2 = delta * velocity + velocity, e2 = Math.pow(dampingRatio, 2) * Math.pow(undampedFreq2, 2) * duration, f2 = Math.exp(-delta), g = calcAngularFreq(Math.pow(undampedFreq2, 2), dampingRatio);
1817
2223
  return (-envelope(undampedFreq2) + safeMin > 0 ? -1 : 1) * ((d2 - e2) * f2) / g;
@@ -1955,7 +2361,7 @@ function cubicBezier(mX1, mY1, mX2, mY2) {
1955
2361
  const getTForX = (aX) => binarySubdivide(aX, 0, 1, mX1, mX2);
1956
2362
  return (t2) => t2 === 0 || t2 === 1 ? t2 : calcBezier(getTForX(t2), mY1, mY2);
1957
2363
  }
1958
- const easeIn = cubicBezier(0.42, 0, 1, 1), easeOut = cubicBezier(0, 0, 0.58, 1), easeInOut = cubicBezier(0.42, 0, 0.58, 1), isEasingArray = (ease2) => Array.isArray(ease2) && typeof ease2[0] != "number", mirrorEasing = (easing) => (p) => p <= 0.5 ? easing(2 * p) / 2 : (2 - easing(2 * (1 - p))) / 2, reverseEasing = (easing) => (p) => 1 - easing(1 - p), circIn = (p) => 1 - Math.sin(Math.acos(p)), circOut = reverseEasing(circIn), circInOut = mirrorEasing(circIn), backOut = cubicBezier(0.33, 1.53, 0.69, 0.99), backIn = reverseEasing(backOut), backInOut = mirrorEasing(backIn), anticipate = (p) => (p *= 2) < 1 ? 0.5 * backIn(p) : 0.5 * (2 - Math.pow(2, -10 * (p - 1))), easingLookup = {
2364
+ const easeIn = cubicBezier(0.42, 0, 1, 1), easeOut = cubicBezier(0, 0, 0.58, 1), easeInOut = cubicBezier(0.42, 0, 0.58, 1), isEasingArray = (ease2) => Array.isArray(ease2) && typeof ease2[0] != "number", mirrorEasing = (easing) => (p2) => p2 <= 0.5 ? easing(2 * p2) / 2 : (2 - easing(2 * (1 - p2))) / 2, reverseEasing = (easing) => (p2) => 1 - easing(1 - p2), circIn = (p2) => 1 - Math.sin(Math.acos(p2)), circOut = reverseEasing(circIn), circInOut = mirrorEasing(circIn), backOut = cubicBezier(0.33, 1.53, 0.69, 0.99), backIn = reverseEasing(backOut), backInOut = mirrorEasing(backIn), anticipate = (p2) => (p2 *= 2) < 1 ? 0.5 * backIn(p2) : 0.5 * (2 - Math.pow(2, -10 * (p2 - 1))), easingLookup = {
1959
2365
  linear: noop$1,
1960
2366
  easeIn,
1961
2367
  easeInOut,
@@ -1969,18 +2375,18 @@ const easeIn = cubicBezier(0.42, 0, 1, 1), easeOut = cubicBezier(0, 0, 0.58, 1),
1969
2375
  anticipate
1970
2376
  }, easingDefinitionToFunction = (definition) => {
1971
2377
  if (Array.isArray(definition)) {
1972
- invariant$1(definition.length === 4);
2378
+ invariant(definition.length === 4);
1973
2379
  const [x1, y1, x2, y2] = definition;
1974
2380
  return cubicBezier(x1, y1, x2, y2);
1975
2381
  } else if (typeof definition == "string")
1976
- return invariant$1(easingLookup[definition] !== void 0), easingLookup[definition];
2382
+ return invariant(easingLookup[definition] !== void 0), easingLookup[definition];
1977
2383
  return definition;
1978
2384
  }, progress = (from, to, value) => {
1979
2385
  const toFromDifference = to - from;
1980
2386
  return toFromDifference === 0 ? 1 : (value - from) / toFromDifference;
1981
2387
  }, mixNumber$1 = (from, to, progress2) => from + (to - from) * progress2;
1982
- function hueToRgb(p, q, t2) {
1983
- return t2 < 0 && (t2 += 1), t2 > 1 && (t2 -= 1), t2 < 1 / 6 ? p + (q - p) * 6 * t2 : t2 < 1 / 2 ? q : t2 < 2 / 3 ? p + (q - p) * (2 / 3 - t2) * 6 : p;
2388
+ function hueToRgb(p2, q, t2) {
2389
+ return t2 < 0 && (t2 += 1), t2 > 1 && (t2 -= 1), t2 < 1 / 6 ? p2 + (q - p2) * 6 * t2 : t2 < 1 / 2 ? q : t2 < 2 / 3 ? p2 + (q - p2) * (2 / 3 - t2) * 6 : p2;
1984
2390
  }
1985
2391
  function hslaToRgba({ hue, saturation, lightness, alpha: alpha2 }) {
1986
2392
  hue /= 360, saturation /= 100, lightness /= 100;
@@ -1988,8 +2394,8 @@ function hslaToRgba({ hue, saturation, lightness, alpha: alpha2 }) {
1988
2394
  if (!saturation)
1989
2395
  red = green = blue2 = lightness;
1990
2396
  else {
1991
- const q = lightness < 0.5 ? lightness * (1 + saturation) : lightness + saturation - lightness * saturation, p = 2 * lightness - q;
1992
- red = hueToRgb(p, q, hue + 1 / 3), green = hueToRgb(p, q, hue), blue2 = hueToRgb(p, q, hue - 1 / 3);
2397
+ const q = lightness < 0.5 ? lightness * (1 + saturation) : lightness + saturation - lightness * saturation, p2 = 2 * lightness - q;
2398
+ red = hueToRgb(p2, q, hue + 1 / 3), green = hueToRgb(p2, q, hue), blue2 = hueToRgb(p2, q, hue - 1 / 3);
1993
2399
  }
1994
2400
  return {
1995
2401
  red: Math.round(red * 255),
@@ -1999,7 +2405,7 @@ function hslaToRgba({ hue, saturation, lightness, alpha: alpha2 }) {
1999
2405
  };
2000
2406
  }
2001
2407
  function mixImmediate(a2, b2) {
2002
- return (p) => p > 0 ? b2 : a2;
2408
+ return (p2) => p2 > 0 ? b2 : a2;
2003
2409
  }
2004
2410
  const mixLinearColor = (from, to, v) => {
2005
2411
  const fromExpo = from * from, expo = v * (to * to - fromExpo) + fromExpo;
@@ -2020,19 +2426,19 @@ const mixColor = (from, to) => {
2020
2426
  return (v) => (blended.red = mixLinearColor(fromRGBA.red, toRGBA.red, v), blended.green = mixLinearColor(fromRGBA.green, toRGBA.green, v), blended.blue = mixLinearColor(fromRGBA.blue, toRGBA.blue, v), blended.alpha = mixNumber$1(fromRGBA.alpha, toRGBA.alpha, v), rgba.transform(blended));
2021
2427
  }, invisibleValues = /* @__PURE__ */ new Set(["none", "hidden"]);
2022
2428
  function mixVisibility(origin, target) {
2023
- return invisibleValues.has(origin) ? (p) => p <= 0 ? origin : target : (p) => p >= 1 ? target : origin;
2429
+ return invisibleValues.has(origin) ? (p2) => p2 <= 0 ? origin : target : (p2) => p2 >= 1 ? target : origin;
2024
2430
  }
2025
2431
  function mixNumber(a2, b2) {
2026
- return (p) => mixNumber$1(a2, b2, p);
2432
+ return (p2) => mixNumber$1(a2, b2, p2);
2027
2433
  }
2028
2434
  function getMixer(a2) {
2029
2435
  return typeof a2 == "number" ? mixNumber : typeof a2 == "string" ? isCSSVariableToken(a2) ? mixImmediate : color.test(a2) ? mixColor : mixComplex : Array.isArray(a2) ? mixArray : typeof a2 == "object" ? color.test(a2) ? mixColor : mixObject : mixImmediate;
2030
2436
  }
2031
2437
  function mixArray(a2, b2) {
2032
2438
  const output = [...a2], numValues = output.length, blendValue = a2.map((v, i2) => getMixer(v)(v, b2[i2]));
2033
- return (p) => {
2439
+ return (p2) => {
2034
2440
  for (let i2 = 0; i2 < numValues; i2++)
2035
- output[i2] = blendValue[i2](p);
2441
+ output[i2] = blendValue[i2](p2);
2036
2442
  return output;
2037
2443
  };
2038
2444
  }
@@ -2059,8 +2465,8 @@ const mixComplex = (origin, target) => {
2059
2465
  const template = complex.createTransformer(target), originStats = analyseComplexValue(origin), targetStats = analyseComplexValue(target);
2060
2466
  return originStats.indexes.var.length === targetStats.indexes.var.length && originStats.indexes.color.length === targetStats.indexes.color.length && originStats.indexes.number.length >= targetStats.indexes.number.length ? invisibleValues.has(origin) && !targetStats.values.length || invisibleValues.has(target) && !originStats.values.length ? mixVisibility(origin, target) : pipe(mixArray(matchOrder(originStats, targetStats), targetStats.values), template) : mixImmediate(origin, target);
2061
2467
  };
2062
- function mix(from, to, p) {
2063
- return typeof from == "number" && typeof to == "number" && typeof p == "number" ? mixNumber$1(from, to, p) : getMixer(from)(from, to);
2468
+ function mix(from, to, p2) {
2469
+ return typeof from == "number" && typeof to == "number" && typeof p2 == "number" ? mixNumber$1(from, to, p2) : getMixer(from)(from, to);
2064
2470
  }
2065
2471
  function createMixers(output, ease2, customMixer) {
2066
2472
  const mixers = [], mixerFactory = customMixer || mix, numMixers = output.length - 1;
@@ -2076,7 +2482,7 @@ function createMixers(output, ease2, customMixer) {
2076
2482
  }
2077
2483
  function interpolate(input, output, { clamp: isClamp = !0, ease: ease2, mixer } = {}) {
2078
2484
  const inputLength = input.length;
2079
- if (invariant$1(inputLength === output.length), inputLength === 1)
2485
+ if (invariant(inputLength === output.length), inputLength === 1)
2080
2486
  return () => output[0];
2081
2487
  if (inputLength === 2 && input[0] === input[1])
2082
2488
  return () => output[1];
@@ -2153,16 +2559,16 @@ const frameloopDriver = (update) => {
2153
2559
  spring
2154
2560
  }, percentToProgress = (percent2) => percent2 / 100;
2155
2561
  class MainThreadAnimation extends BaseAnimation {
2156
- constructor({ KeyframeResolver: KeyframeResolver$1 = KeyframeResolver, ...options }) {
2157
- super(options), this.holdTime = null, this.startTime = null, this.cancelTime = null, this.currentTime = 0, this.playbackSpeed = 1, this.pendingPlayState = "running", this.state = "idle", this.stop = () => {
2562
+ constructor(options) {
2563
+ super(options), this.holdTime = null, this.cancelTime = null, this.currentTime = 0, this.playbackSpeed = 1, this.pendingPlayState = "running", this.startTime = null, this.state = "idle", this.stop = () => {
2158
2564
  if (this.resolver.cancel(), this.isStopped = !0, this.state === "idle")
2159
2565
  return;
2160
2566
  this.teardown();
2161
2567
  const { onStop } = this.options;
2162
2568
  onStop && onStop();
2163
2569
  };
2164
- const { name, motionValue: motionValue2, keyframes: keyframes2 } = this.options, onResolved = (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe);
2165
- name && motionValue2 && motionValue2.owner ? this.resolver = motionValue2.owner.resolveKeyframes(keyframes2, onResolved, name, motionValue2) : this.resolver = new KeyframeResolver$1(keyframes2, onResolved, name, motionValue2), this.resolver.scheduleResolve();
2570
+ const { name, motionValue: motionValue2, element, keyframes: keyframes2 } = this.options, KeyframeResolver$1 = element?.KeyframeResolver || KeyframeResolver, onResolved = (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe);
2571
+ this.resolver = new KeyframeResolver$1(keyframes2, onResolved, name, motionValue2, element), this.resolver.scheduleResolve();
2166
2572
  }
2167
2573
  initPlayback(keyframes$1) {
2168
2574
  const { type = "keyframes", repeat = 0, repeatDelay = 0, repeatType, velocity = 0 } = this.options, generatorFactory = generators[type] || keyframes;
@@ -2238,10 +2644,10 @@ class MainThreadAnimation extends BaseAnimation {
2238
2644
  }
2239
2645
  if (this.isStopped)
2240
2646
  return;
2241
- const { driver = frameloopDriver, onPlay } = this.options;
2647
+ const { driver = frameloopDriver, onPlay, startTime } = this.options;
2242
2648
  this.driver || (this.driver = driver((timestamp) => this.tick(timestamp))), onPlay && onPlay();
2243
2649
  const now2 = this.driver.now();
2244
- this.holdTime !== null ? this.startTime = now2 - this.holdTime : (!this.startTime || this.state === "finished") && (this.startTime = now2), this.state === "finished" && this.updateFinishedPromise(), this.cancelTime = this.startTime, this.holdTime = null, this.state = "running", this.driver.start();
2650
+ this.holdTime !== null ? this.startTime = now2 - this.holdTime : this.startTime ? this.state === "finished" && (this.startTime = now2) : this.startTime = startTime ?? this.calcStartTime(), this.state === "finished" && this.updateFinishedPromise(), this.cancelTime = this.startTime, this.holdTime = null, this.state = "running", this.driver.start();
2245
2651
  }
2246
2652
  pause() {
2247
2653
  var _a;
@@ -2276,7 +2682,7 @@ const isBezierDefinition = (easing) => Array.isArray(easing) && typeof easing[0]
2276
2682
  function isWaapiSupportedEasing(easing) {
2277
2683
  return !!(!easing || typeof easing == "string" && easing in supportedWaapiEasing || isBezierDefinition(easing) || Array.isArray(easing) && easing.every(isWaapiSupportedEasing));
2278
2684
  }
2279
- const cubicBezierAsString = ([a2, b2, c, d2]) => `cubic-bezier(${a2}, ${b2}, ${c}, ${d2})`, supportedWaapiEasing = {
2685
+ const cubicBezierAsString = ([a2, b2, c2, d2]) => `cubic-bezier(${a2}, ${b2}, ${c2}, ${d2})`, supportedWaapiEasing = {
2280
2686
  linear: "linear",
2281
2687
  ease: "ease",
2282
2688
  easeIn: "ease-in",
@@ -2334,20 +2740,20 @@ function pregenerateKeyframes(keyframes2, options) {
2334
2740
  class AcceleratedAnimation extends BaseAnimation {
2335
2741
  constructor(options) {
2336
2742
  super(options);
2337
- const { name, motionValue: motionValue2, keyframes: keyframes2 } = this.options;
2338
- this.resolver = new DOMKeyframesResolver(keyframes2, (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe), name, motionValue2), this.resolver.scheduleResolve();
2743
+ const { name, motionValue: motionValue2, element, keyframes: keyframes2 } = this.options;
2744
+ this.resolver = new DOMKeyframesResolver(keyframes2, (resolvedKeyframes, finalKeyframe) => this.onKeyframesResolved(resolvedKeyframes, finalKeyframe), name, motionValue2, element), this.resolver.scheduleResolve();
2339
2745
  }
2340
2746
  initPlayback(keyframes2, finalKeyframe) {
2341
2747
  var _a;
2342
- let { duration = 300, times, ease: ease2, type, motionValue: motionValue2, name } = this.options;
2748
+ let { duration = 300, times, ease: ease2, type, motionValue: motionValue2, name, startTime } = this.options;
2343
2749
  if (!(!((_a = motionValue2.owner) === null || _a === void 0) && _a.current))
2344
2750
  return !1;
2345
2751
  if (requiresPregeneratedKeyframes(this.options)) {
2346
- const { onComplete, onUpdate, motionValue: motionValue3, ...options } = this.options, pregeneratedAnimation = pregenerateKeyframes(keyframes2, options);
2752
+ const { onComplete, onUpdate, motionValue: motionValue3, element, ...options } = this.options, pregeneratedAnimation = pregenerateKeyframes(keyframes2, options);
2347
2753
  keyframes2 = pregeneratedAnimation.keyframes, keyframes2.length === 1 && (keyframes2[1] = keyframes2[0]), duration = pregeneratedAnimation.duration, times = pregeneratedAnimation.times, ease2 = pregeneratedAnimation.ease, type = "keyframes";
2348
2754
  }
2349
2755
  const animation = animateStyle(motionValue2.owner.current, name, keyframes2, { ...this.options, duration, times, ease: ease2 });
2350
- return animation.startTime = time.now(), this.pendingTimeline ? (animation.timeline = this.pendingTimeline, this.pendingTimeline = void 0) : animation.onfinish = () => {
2756
+ return animation.startTime = startTime ?? this.calcStartTime(), this.pendingTimeline ? (animation.timeline = this.pendingTimeline, this.pendingTimeline = void 0) : animation.onfinish = () => {
2351
2757
  const { onComplete } = this.options;
2352
2758
  motionValue2.set(getFinalKeyframe(keyframes2, this.options, finalKeyframe)), onComplete && onComplete(), this.cancel(), this.resolveFinishedPromise();
2353
2759
  }, {
@@ -2401,6 +2807,13 @@ class AcceleratedAnimation extends BaseAnimation {
2401
2807
  const { animation } = resolved;
2402
2808
  return animation.playState;
2403
2809
  }
2810
+ get startTime() {
2811
+ const { resolved } = this;
2812
+ if (!resolved)
2813
+ return null;
2814
+ const { animation } = resolved;
2815
+ return animation.startTime;
2816
+ }
2404
2817
  /**
2405
2818
  * Replace the default DocumentTimeline with another AnimationTimeline.
2406
2819
  * Currently used for scroll animations.
@@ -2444,7 +2857,7 @@ class AcceleratedAnimation extends BaseAnimation {
2444
2857
  if (animation.playState === "idle" || animation.playState === "finished")
2445
2858
  return;
2446
2859
  if (this.time) {
2447
- const { motionValue: motionValue2, onUpdate, onComplete, ...options } = this.options, sampleAnimation = new MainThreadAnimation({
2860
+ const { motionValue: motionValue2, onUpdate, onComplete, element, ...options } = this.options, sampleAnimation = new MainThreadAnimation({
2448
2861
  ...options,
2449
2862
  keyframes: keyframes2,
2450
2863
  duration,
@@ -2528,6 +2941,9 @@ class GroupPlaybackControls {
2528
2941
  set speed(speed) {
2529
2942
  this.setAll("speed", speed);
2530
2943
  }
2944
+ get startTime() {
2945
+ return this.getAll("startTime");
2946
+ }
2531
2947
  get duration() {
2532
2948
  let max2 = 0;
2533
2949
  for (let i2 = 0; i2 < this.animations.length; i2++)
@@ -2592,15 +3008,15 @@ class SubscriptionManager {
2592
3008
  add(handler) {
2593
3009
  return addUniqueItem(this.subscriptions, handler), () => removeItem(this.subscriptions, handler);
2594
3010
  }
2595
- notify(a2, b2, c) {
3011
+ notify(a2, b2, c2) {
2596
3012
  const numSubscriptions = this.subscriptions.length;
2597
3013
  if (numSubscriptions)
2598
3014
  if (numSubscriptions === 1)
2599
- this.subscriptions[0](a2, b2, c);
3015
+ this.subscriptions[0](a2, b2, c2);
2600
3016
  else
2601
3017
  for (let i2 = 0; i2 < numSubscriptions; i2++) {
2602
3018
  const handler = this.subscriptions[i2];
2603
- handler && handler(a2, b2, c);
3019
+ handler && handler(a2, b2, c2);
2604
3020
  }
2605
3021
  }
2606
3022
  getSize() {
@@ -2621,7 +3037,7 @@ class MotionValue {
2621
3037
  * @internal
2622
3038
  */
2623
3039
  constructor(init, options = {}) {
2624
- this.version = "11.3.24", this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (v, render = !0) => {
3040
+ this.version = "11.3.29", this.canTrackVelocity = null, this.events = {}, this.updateAndNotify = (v, render = !0) => {
2625
3041
  const currentTime = time.now();
2626
3042
  this.updatedAt !== currentTime && this.setPrevFrameValue(), this.prev = this.current, this.setCurrent(v), this.current !== this.prev && this.events.change && this.events.change.notify(this.current), render && this.events.renderRequest && this.events.renderRequest.notify(this.current);
2627
3043
  }, this.hasAnimated = !1, this.setCurrent(init), this.owner = options.owner;
@@ -2872,15 +3288,14 @@ function animateTarget(visualElement, targetAndTransition, { delay = 0, transiti
2872
3288
  continue;
2873
3289
  const valueTransition = {
2874
3290
  delay,
2875
- elapsed: 0,
2876
3291
  ...getValueTransition(transition || {}, key)
2877
3292
  };
2878
3293
  let isHandoff = !1;
2879
3294
  if (window.MotionHandoffAnimation) {
2880
3295
  const appearId = getOptimisedAppearId(visualElement);
2881
3296
  if (appearId) {
2882
- const elapsed = window.MotionHandoffAnimation(appearId, key, frame);
2883
- elapsed !== null && (valueTransition.elapsed = elapsed, isHandoff = !0);
3297
+ const startTime = window.MotionHandoffAnimation(appearId, key, frame);
3298
+ startTime !== null && (valueTransition.startTime = startTime, isHandoff = !0);
2884
3299
  }
2885
3300
  }
2886
3301
  value.start(animateMotionValue(key, value, valueTarget, visualElement.shouldReduceMotion && transformProps.has(key) ? { type: !1 } : valueTransition, visualElement, isHandoff, addValueToWillChange(visualElement, key)));
@@ -3177,7 +3592,7 @@ class VisualElement {
3177
3592
  return {};
3178
3593
  }
3179
3594
  constructor({ parent, props: props2, presenceContext, reducedMotionConfig, blockInitialAnimation, visualState }, options = {}) {
3180
- this.applyWillChange = !1, this.resolveKeyframes = (keyframes2, onComplete, name, value) => new this.KeyframeResolver(keyframes2, onComplete, name, value, this), this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = KeyframeResolver, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
3595
+ this.applyWillChange = !1, this.current = null, this.children = /* @__PURE__ */ new Set(), this.isVariantNode = !1, this.isControllingVariants = !1, this.shouldReduceMotion = null, this.values = /* @__PURE__ */ new Map(), this.KeyframeResolver = KeyframeResolver, this.features = {}, this.valueSubscriptions = /* @__PURE__ */ new Map(), this.prevMotionValues = {}, this.events = {}, this.propEventSubscriptions = {}, this.notifyUpdate = () => this.notify("Update", this.latestValues), this.render = () => {
3181
3596
  this.isRenderScheduled = !1, this.current && (this.triggerBuild(), this.renderInstance(this.current, this.renderState, this.props.style, this.projection));
3182
3597
  }, this.isRenderScheduled = !1, this.scheduleRender = () => {
3183
3598
  this.isRenderScheduled || (this.isRenderScheduled = !0, frame.render(this.render, !1, !0));
@@ -3379,8 +3794,8 @@ class DOMVisualElement extends VisualElement {
3379
3794
  getBaseTargetFromProps(props2, key) {
3380
3795
  return props2.style ? props2.style[key] : void 0;
3381
3796
  }
3382
- removeValueFromRenderState(key, { vars, style }) {
3383
- delete vars[key], delete style[key];
3797
+ removeValueFromRenderState(key, { vars: vars2, style }) {
3798
+ delete vars2[key], delete style[key];
3384
3799
  }
3385
3800
  }
3386
3801
  function getComputedStyle$1(element) {
@@ -3434,539 +3849,156 @@ class SVGVisualElement extends DOMVisualElement {
3434
3849
  return scrapeMotionValuesFromProps(props2, prevProps, visualElement);
3435
3850
  }
3436
3851
  build(renderState, latestValues, props2) {
3437
- buildSVGAttrs(renderState, latestValues, this.isSVGTag, props2.transformTemplate);
3438
- }
3439
- renderInstance(instance, renderState, styleProp, projection) {
3440
- renderSVG(instance, renderState, styleProp, projection);
3441
- }
3442
- mount(instance) {
3443
- this.isSVGTag = isSVGTag(instance.tagName), super.mount(instance);
3444
- }
3445
- }
3446
- const createDomVisualElement = (Component2, options) => isSVGComponent(Component2) ? new SVGVisualElement(options) : new HTMLVisualElement(options, {
3447
- allowProjection: Component2 !== Fragment$1
3448
- }), m = createMotionProxy(createDomMotionConfig);
3449
- class PopChildMeasure extends React.Component {
3450
- getSnapshotBeforeUpdate(prevProps) {
3451
- const element = this.props.childRef.current;
3452
- if (element && prevProps.isPresent && !this.props.isPresent) {
3453
- const size = this.props.sizeRef.current;
3454
- size.height = element.offsetHeight || 0, size.width = element.offsetWidth || 0, size.top = element.offsetTop, size.left = element.offsetLeft;
3455
- }
3456
- return null;
3457
- }
3458
- /**
3459
- * Required with getSnapshotBeforeUpdate to stop React complaining.
3460
- */
3461
- componentDidUpdate() {
3462
- }
3463
- render() {
3464
- return this.props.children;
3465
- }
3466
- }
3467
- function PopChild({ children, isPresent }) {
3468
- const id2 = useId$1(), ref = useRef$1(null), size = useRef$1({
3469
- width: 0,
3470
- height: 0,
3471
- top: 0,
3472
- left: 0
3473
- }), { nonce } = useContext$1(MotionConfigContext);
3474
- return useInsertionEffect(() => {
3475
- const { width, height, top, left } = size.current;
3476
- if (isPresent || !ref.current || !width || !height)
3477
- return;
3478
- ref.current.dataset.motionPopId = id2;
3479
- const style = document.createElement("style");
3480
- return nonce && (style.nonce = nonce), document.head.appendChild(style), style.sheet && style.sheet.insertRule(`
3481
- [data-motion-pop-id="${id2}"] {
3482
- position: absolute !important;
3483
- width: ${width}px !important;
3484
- height: ${height}px !important;
3485
- top: ${top}px !important;
3486
- left: ${left}px !important;
3487
- }
3488
- `), () => {
3489
- document.head.removeChild(style);
3490
- };
3491
- }, [isPresent]), jsx(PopChildMeasure, { isPresent, childRef: ref, sizeRef: size, children: React.cloneElement(children, { ref }) });
3492
- }
3493
- const PresenceChild = ({ children, initial, isPresent, onExitComplete, custom: custom5, presenceAffectsLayout, mode }) => {
3494
- const presenceChildren = useConstant(newChildrenMap), id2 = useId$1(), context = useMemo$1(
3495
- () => ({
3496
- id: id2,
3497
- initial,
3498
- isPresent,
3499
- custom: custom5,
3500
- onExitComplete: (childId) => {
3501
- presenceChildren.set(childId, !0);
3502
- for (const isComplete of presenceChildren.values())
3503
- if (!isComplete)
3504
- return;
3505
- onExitComplete && onExitComplete();
3506
- },
3507
- register: (childId) => (presenceChildren.set(childId, !1), () => presenceChildren.delete(childId))
3508
- }),
3509
- /**
3510
- * If the presence of a child affects the layout of the components around it,
3511
- * we want to make a new context value to ensure they get re-rendered
3512
- * so they can detect that layout change.
3513
- */
3514
- presenceAffectsLayout ? [Math.random()] : [isPresent]
3515
- );
3516
- return useMemo$1(() => {
3517
- presenceChildren.forEach((_, key) => presenceChildren.set(key, !1));
3518
- }, [isPresent]), React.useEffect(() => {
3519
- !isPresent && !presenceChildren.size && onExitComplete && onExitComplete();
3520
- }, [isPresent]), mode === "popLayout" && (children = jsx(PopChild, { isPresent, children })), jsx(PresenceContext.Provider, { value: context, children });
3521
- };
3522
- function newChildrenMap() {
3523
- return /* @__PURE__ */ new Map();
3524
- }
3525
- const getChildKey = (child) => child.key || "";
3526
- function onlyElements(children) {
3527
- const filtered = [];
3528
- return Children.forEach(children, (child) => {
3529
- isValidElement(child) && filtered.push(child);
3530
- }), filtered;
3531
- }
3532
- const AnimatePresence = ({ children, exitBeforeEnter, custom: custom5, initial = !0, onExitComplete, presenceAffectsLayout = !0, mode = "sync" }) => {
3533
- const presentChildren = useMemo$1(() => onlyElements(children), [children]), presentKeys = presentChildren.map(getChildKey), isInitialRender = useRef$1(!0), pendingPresentChildren = useRef$1(presentChildren), exitComplete = useConstant(() => /* @__PURE__ */ new Map()), [diffedChildren, setDiffedChildren] = useState$1(presentChildren), [renderedChildren, setRenderedChildren] = useState$1(presentChildren);
3534
- useIsomorphicLayoutEffect$2(() => {
3535
- isInitialRender.current = !1, pendingPresentChildren.current = presentChildren;
3536
- for (let i2 = 0; i2 < renderedChildren.length; i2++) {
3537
- const key = getChildKey(renderedChildren[i2]);
3538
- presentKeys.includes(key) ? exitComplete.delete(key) : exitComplete.get(key) !== !0 && exitComplete.set(key, !1);
3539
- }
3540
- }, [renderedChildren, presentKeys.length, presentKeys.join("-")]);
3541
- const exitingChildren = [];
3542
- if (presentChildren !== diffedChildren) {
3543
- let nextChildren = [...presentChildren];
3544
- for (let i2 = 0; i2 < renderedChildren.length; i2++) {
3545
- const child = renderedChildren[i2], key = getChildKey(child);
3546
- presentKeys.includes(key) || (nextChildren.splice(i2, 0, child), exitingChildren.push(child));
3547
- }
3548
- mode === "wait" && exitingChildren.length && (nextChildren = exitingChildren), setRenderedChildren(onlyElements(nextChildren)), setDiffedChildren(presentChildren);
3549
- return;
3550
- }
3551
- const { forceRender } = useContext$1(LayoutGroupContext);
3552
- return jsx(Fragment, { children: renderedChildren.map((child) => {
3553
- const key = getChildKey(child), isPresent = presentChildren === renderedChildren || presentKeys.includes(key), onExit = () => {
3554
- if (exitComplete.has(key))
3555
- exitComplete.set(key, !0);
3556
- else
3557
- return;
3558
- let isEveryExitComplete = !0;
3559
- exitComplete.forEach((isExitComplete) => {
3560
- isExitComplete || (isEveryExitComplete = !1);
3561
- }), isEveryExitComplete && (forceRender?.(), setRenderedChildren(pendingPresentChildren.current), onExitComplete && onExitComplete());
3562
- };
3563
- return jsx(PresenceChild, { isPresent, initial: !isInitialRender.current || initial ? void 0 : !1, custom: isPresent ? void 0 : custom5, presenceAffectsLayout, mode, onExitComplete: isPresent ? void 0 : onExit, children: child }, key);
3564
- }) });
3565
- };
3566
- function LazyMotion({ children, features, strict = !1 }) {
3567
- const [, setIsLoaded] = useState$1(!isLazyBundle(features)), loadedRenderer = useRef$1(void 0);
3568
- if (!isLazyBundle(features)) {
3569
- const { renderer, ...loadedFeatures } = features;
3570
- loadedRenderer.current = renderer, loadFeatures(loadedFeatures);
3571
- }
3572
- return useEffect$1(() => {
3573
- isLazyBundle(features) && features().then(({ renderer, ...loadedFeatures }) => {
3574
- loadFeatures(loadedFeatures), loadedRenderer.current = renderer, setIsLoaded(!0);
3575
- });
3576
- }, []), jsx(LazyContext.Provider, { value: { renderer: loadedRenderer.current, strict }, children });
3577
- }
3578
- function isLazyBundle(features) {
3579
- return typeof features == "function";
3580
- }
3581
- const domAnimation = {
3582
- renderer: createDomVisualElement,
3583
- ...animations,
3584
- ...gestureAnimations
3585
- };
3586
- var rootClassName = "likec4-diagram-root";
3587
- const blue$1 = {
3588
- fill: "#3b82f6",
3589
- stroke: "#2563eb",
3590
- hiContrast: "#eff6ff",
3591
- loContrast: "#bfdbfe"
3592
- }, sky$1 = {
3593
- fill: "#0284c7",
3594
- stroke: "#0369a1",
3595
- hiContrast: "#f0f9ff",
3596
- loContrast: "#B6ECF7"
3597
- }, slate$1 = {
3598
- fill: "#64748b",
3599
- stroke: "#475569",
3600
- hiContrast: "#f8fafc",
3601
- loContrast: "#cbd5e1"
3602
- }, ElementColors = {
3603
- primary: blue$1,
3604
- blue: blue$1,
3605
- secondary: sky$1,
3606
- sky: sky$1,
3607
- muted: slate$1,
3608
- slate: slate$1,
3609
- gray: {
3610
- // fill: colors.neutral[500],
3611
- // stroke: colors.neutral[600],
3612
- // hiContrast: colors.neutral[50],
3613
- // loContrast: colors.neutral[200],
3614
- fill: "#737373",
3615
- stroke: "#525252",
3616
- hiContrast: "#fafafa",
3617
- loContrast: "#d4d4d4"
3618
- },
3619
- red: {
3620
- // fill: colors.red[500],
3621
- // stroke: colors.red[600],
3622
- // hiContrast: colors.red[50],
3623
- // loContrast: colors.red[200],
3624
- fill: "#AC4D39",
3625
- // fill: '#b54548',
3626
- stroke: "#853A2D",
3627
- // hiContrast: '#fef2f2',
3628
- // loContrast: '#fecaca',
3629
- // hiContrast: '#191111', // colors.gray[900],
3630
- // loContrast: '#3b1219' // colors.gray[800],
3631
- hiContrast: "#FBD3CB",
3632
- // hiContrast: '#f8fafc',
3633
- // loContrast: '#fdd8d8' // radix black red 12
3634
- loContrast: "#f5b2a3"
3635
- },
3636
- green: {
3637
- fill: "#428a4f",
3638
- stroke: "#2d5d39",
3639
- hiContrast: "#f8fafc",
3640
- loContrast: "#c2f0c2"
3641
- },
3642
- amber: {
3643
- fill: "#A35829",
3644
- stroke: "#7E451D",
3645
- hiContrast: "#FFE0C2",
3646
- loContrast: "#f9b27c"
3647
- },
3648
- indigo: {
3649
- // fill: colors.indigo[500],
3650
- // stroke: colors.indigo[600],
3651
- // hiContrast: colors.indigo[50],
3652
- // loContrast: colors.indigo[200],
3653
- fill: "#6366f1",
3654
- stroke: "#4f46e5",
3655
- hiContrast: "#eef2ff",
3656
- loContrast: "#c7d2fe"
3657
- }
3658
- }, gray = {
3659
- lineColor: "#6E6E6E",
3660
- labelBgColor: "#18191b",
3661
- labelColor: "#C6C6C6"
3662
- }, slate = {
3663
- lineColor: "#64748b",
3664
- // 500
3665
- labelBgColor: "#0f172a",
3666
- // 900
3667
- labelColor: "#cbd5e1"
3668
- // 300
3669
- }, blue = {
3670
- lineColor: "#3b82f6",
3671
- // 500
3672
- labelBgColor: "#172554",
3673
- // 950
3674
- labelColor: "#60a5fa"
3675
- // 400
3676
- }, sky = {
3677
- lineColor: "#0ea5e9",
3678
- // 500
3679
- labelBgColor: "#082f49",
3680
- // 950
3681
- labelColor: "#38bdf8"
3682
- // 400
3683
- }, RelationshipColors = {
3684
- amber: {
3685
- lineColor: "#b45309",
3686
- labelBgColor: "#78350f",
3687
- labelColor: "#FFE0C2"
3688
- },
3689
- blue,
3690
- gray,
3691
- green: {
3692
- lineColor: "#15803d",
3693
- // 700
3694
- labelBgColor: "#052e16",
3695
- // 950
3696
- labelColor: "#22c55e"
3697
- // 500
3698
- },
3699
- indigo: {
3700
- lineColor: "#6366f1",
3701
- // 500
3702
- labelBgColor: "#1e1b4b",
3703
- // 950
3704
- labelColor: "#818cf8"
3705
- // 400
3706
- },
3707
- muted: slate,
3708
- primary: blue,
3709
- red: {
3710
- lineColor: "#AC4D39",
3711
- labelBgColor: "#b91c1c",
3712
- labelColor: "#f5b2a3"
3713
- },
3714
- secondary: sky,
3715
- sky,
3716
- slate
3717
- }, defaultTheme = {
3718
- elements: ElementColors,
3719
- relationships: RelationshipColors,
3720
- font: "Arial",
3721
- shadow: "#0a0a0a"
3722
- };
3723
- function fixProto(target, prototype) {
3724
- var setPrototypeOf = Object.setPrototypeOf;
3725
- setPrototypeOf ? setPrototypeOf(target, prototype) : target.__proto__ = prototype;
3726
- }
3727
- function fixStack(target, fn) {
3728
- fn === void 0 && (fn = target.constructor);
3729
- var captureStackTrace = Error.captureStackTrace;
3730
- captureStackTrace && captureStackTrace(target, fn);
3731
- }
3732
- var __extends = /* @__PURE__ */ function() {
3733
- var _extendStatics = function(d2, b2) {
3734
- return _extendStatics = Object.setPrototypeOf || {
3735
- __proto__: []
3736
- } instanceof Array && function(d3, b3) {
3737
- d3.__proto__ = b3;
3738
- } || function(d3, b3) {
3739
- for (var p in b3)
3740
- Object.prototype.hasOwnProperty.call(b3, p) && (d3[p] = b3[p]);
3741
- }, _extendStatics(d2, b2);
3742
- };
3743
- return function(d2, b2) {
3744
- if (typeof b2 != "function" && b2 !== null) throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null");
3745
- _extendStatics(d2, b2);
3746
- function __() {
3747
- this.constructor = d2;
3748
- }
3749
- d2.prototype = b2 === null ? Object.create(b2) : (__.prototype = b2.prototype, new __());
3750
- };
3751
- }(), CustomError = function(_super) {
3752
- __extends(CustomError2, _super);
3753
- function CustomError2(message, options) {
3754
- var _newTarget = this.constructor, _this = _super.call(this, message, options) || this;
3755
- return Object.defineProperty(_this, "name", {
3756
- value: _newTarget.name,
3757
- enumerable: !1,
3758
- configurable: !0
3759
- }), fixProto(_this, _newTarget.prototype), fixStack(_this), _this;
3760
- }
3761
- return CustomError2;
3762
- }(Error), s = { done: !1, hasNext: !1 };
3763
- function u$5(t2, n2, a2) {
3764
- let o2 = (r2) => t2(r2, ...n2);
3765
- return a2 === void 0 ? o2 : Object.assign(o2, { lazy: a2, lazyArgs: n2 });
3766
- }
3767
- function u$4(r2, n2, a2) {
3768
- let o2 = r2.length - n2.length;
3769
- if (o2 === 0) return r2(...n2);
3770
- if (o2 === 1) return u$5(r2, n2, a2);
3771
- throw new Error("Wrong number of arguments");
3772
- }
3773
- function r$3(...t2) {
3774
- return u$4(Object.values, t2);
3775
- }
3776
- function i$3(...e2) {
3777
- return u$4(r$2, e2);
3778
- }
3779
- var r$2 = (e2, t2) => e2.length >= t2;
3780
- function d$1(...e2) {
3781
- return u$4(i$2, e2);
3782
- }
3783
- function i$2(e2, o2) {
3784
- let r2 = [];
3785
- for (let [t2, n2] of e2.entries()) {
3786
- if (!o2(n2, t2, e2)) break;
3787
- r2.push(n2);
3788
- }
3789
- return r2;
3790
- }
3791
- function b(t2) {
3792
- return (e2, r2) => {
3793
- if (r2 === 0) return t2(e2);
3794
- if (!Number.isInteger(r2)) throw new TypeError(`precision must be an integer: ${r2}`);
3795
- if (r2 > 15 || r2 < -15) throw new RangeError("precision must be between -15 and 15");
3796
- if (Number.isNaN(e2) || !Number.isFinite(e2)) return t2(e2);
3797
- let n2 = 10 ** r2;
3798
- return t2(e2 * n2) / n2;
3799
- };
3800
- }
3801
- function l$1(...e2) {
3802
- return u$4(u$3, e2);
3803
- }
3804
- var u$3 = (e2, a2, n2) => e2.reduce(a2, n2);
3805
- function n$2(e2) {
3806
- return !!e2;
3807
- }
3808
- function t$4(...n2) {
3809
- return u$4(Object.keys, n2);
3810
- }
3811
- function a$1(...e2) {
3812
- return u$4(n$1, e2);
3813
- }
3814
- var n$1 = (e2) => e2.at(-1);
3815
- function l(n2) {
3816
- return n2 != null;
3817
- }
3818
- function o$2(a2) {
3819
- return (t2) => !a2(t2);
3820
- }
3821
- function e$3(n2) {
3822
- return n2 == null;
3823
- }
3824
- function e$2(r2) {
3825
- return typeof r2 == "number" && !Number.isNaN(r2);
3826
- }
3827
- function n(r2) {
3828
- return Array.isArray(r2);
3829
- }
3830
- var e$1 = (n2) => Object.assign(n2, { single: !0 });
3831
- function f(...e2) {
3832
- return u$4(i$1, e2, e$1(u$2));
3833
- }
3834
- var i$1 = (e2, n2) => e2.find(n2), u$2 = (e2) => (n2, t2, o2) => e2(n2, t2, o2) ? { done: !0, hasNext: !0, next: n2 } : s;
3835
- function o$1(...e2) {
3836
- return u$4(t$3, e2);
3837
- }
3838
- var t$3 = (e2, r2) => {
3839
- for (let n2 = e2.length - 1; n2 >= 0; n2--) {
3840
- let a2 = e2[n2];
3841
- if (r2(a2, n2, e2)) return a2;
3842
- }
3843
- };
3844
- function d(...e2) {
3845
- return u$4(r$1, e2, e$1(o));
3846
- }
3847
- var r$1 = ([e2]) => e2, o = () => a, a = (e2) => ({ hasNext: !0, next: e2, done: !0 });
3848
- function t$2(...r2) {
3849
- return u$4(Object.entries, r2);
3850
- }
3851
- function t$1(...a2) {
3852
- return u$4(e, a2);
3853
- }
3854
- var e = (a2, o2) => o2.every((l2) => l2(a2));
3855
- function y$1(...a2) {
3856
- return u$4(r, a2);
3857
- }
3858
- var r = (a2, o2) => o2.some((e2) => e2(a2));
3859
- function u$1(...e2) {
3860
- return u$4(b(Math.ceil), e2);
3861
- }
3862
- function u(...n2) {
3863
- return u$4(i, n2);
3864
- }
3865
- var i = (n2, { min: e2, max: r2 }) => e2 !== void 0 && n2 < e2 ? e2 : r2 !== void 0 && n2 > r2 ? r2 : n2;
3866
- function isString(value) {
3867
- return value != null && typeof value == "string";
3868
- }
3869
- class BaseError extends CustomError {
3870
- constructor(message, options) {
3871
- super(message, options), Object.defineProperty(this, "name", { value: "BaseError" });
3852
+ buildSVGAttrs(renderState, latestValues, this.isSVGTag, props2.transformTemplate);
3872
3853
  }
3873
- }
3874
- class NullableError extends BaseError {
3875
- constructor(message, options) {
3876
- super(message, options), Object.defineProperty(this, "name", { value: "NullableError" });
3854
+ renderInstance(instance, renderState, styleProp, projection) {
3855
+ renderSVG(instance, renderState, styleProp, projection);
3877
3856
  }
3878
- }
3879
- class InvariantError extends BaseError {
3880
- constructor(message, options) {
3881
- super(message, options), Object.defineProperty(this, "name", { value: "InvariantError" });
3857
+ mount(instance) {
3858
+ this.isSVGTag = isSVGTag(instance.tagName), super.mount(instance);
3882
3859
  }
3883
3860
  }
3884
- function nonNullable(value, message) {
3885
- if (typeof value > "u" || value == null)
3886
- throw new NullableError(message ?? `Expected defined value, but received ${value}`);
3887
- return value;
3861
+ const createDomVisualElement = (Component2, options) => isSVGComponent(Component2) ? new SVGVisualElement(options) : new HTMLVisualElement(options, {
3862
+ allowProjection: Component2 !== Fragment$1
3863
+ }), m = createMotionProxy(createDomMotionConfig);
3864
+ class PopChildMeasure extends React.Component {
3865
+ getSnapshotBeforeUpdate(prevProps) {
3866
+ const element = this.props.childRef.current;
3867
+ if (element && prevProps.isPresent && !this.props.isPresent) {
3868
+ const size = this.props.sizeRef.current;
3869
+ size.height = element.offsetHeight || 0, size.width = element.offsetWidth || 0, size.top = element.offsetTop, size.left = element.offsetLeft;
3870
+ }
3871
+ return null;
3872
+ }
3873
+ /**
3874
+ * Required with getSnapshotBeforeUpdate to stop React complaining.
3875
+ */
3876
+ componentDidUpdate() {
3877
+ }
3878
+ render() {
3879
+ return this.props.children;
3880
+ }
3888
3881
  }
3889
- function invariant(condition, message) {
3890
- if (!condition)
3891
- throw new InvariantError(message ?? "Invariant failed");
3882
+ function PopChild({ children, isPresent }) {
3883
+ const id2 = useId$1(), ref = useRef$1(null), size = useRef$1({
3884
+ width: 0,
3885
+ height: 0,
3886
+ top: 0,
3887
+ left: 0
3888
+ }), { nonce } = useContext$1(MotionConfigContext);
3889
+ return useInsertionEffect(() => {
3890
+ const { width, height, top, left } = size.current;
3891
+ if (isPresent || !ref.current || !width || !height)
3892
+ return;
3893
+ ref.current.dataset.motionPopId = id2;
3894
+ const style = document.createElement("style");
3895
+ return nonce && (style.nonce = nonce), document.head.appendChild(style), style.sheet && style.sheet.insertRule(`
3896
+ [data-motion-pop-id="${id2}"] {
3897
+ position: absolute !important;
3898
+ width: ${width}px !important;
3899
+ height: ${height}px !important;
3900
+ top: ${top}px !important;
3901
+ left: ${left}px !important;
3902
+ }
3903
+ `), () => {
3904
+ document.head.removeChild(style);
3905
+ };
3906
+ }, [isPresent]), jsx(PopChildMeasure, { isPresent, childRef: ref, sizeRef: size, children: React.cloneElement(children, { ref }) });
3892
3907
  }
3893
- class NonExhaustiveError extends BaseError {
3894
- constructor(message, options) {
3895
- super(message, options), Object.defineProperty(this, "name", { value: "NonExhaustiveError" });
3896
- }
3908
+ const PresenceChild = ({ children, initial, isPresent, onExitComplete, custom: custom5, presenceAffectsLayout, mode }) => {
3909
+ const presenceChildren = useConstant(newChildrenMap), id2 = useId$1(), context = useMemo$1(
3910
+ () => ({
3911
+ id: id2,
3912
+ initial,
3913
+ isPresent,
3914
+ custom: custom5,
3915
+ onExitComplete: (childId) => {
3916
+ presenceChildren.set(childId, !0);
3917
+ for (const isComplete of presenceChildren.values())
3918
+ if (!isComplete)
3919
+ return;
3920
+ onExitComplete && onExitComplete();
3921
+ },
3922
+ register: (childId) => (presenceChildren.set(childId, !1), () => presenceChildren.delete(childId))
3923
+ }),
3924
+ /**
3925
+ * If the presence of a child affects the layout of the components around it,
3926
+ * we want to make a new context value to ensure they get re-rendered
3927
+ * so they can detect that layout change.
3928
+ */
3929
+ presenceAffectsLayout ? [Math.random()] : [isPresent]
3930
+ );
3931
+ return useMemo$1(() => {
3932
+ presenceChildren.forEach((_, key) => presenceChildren.set(key, !1));
3933
+ }, [isPresent]), React.useEffect(() => {
3934
+ !isPresent && !presenceChildren.size && onExitComplete && onExitComplete();
3935
+ }, [isPresent]), mode === "popLayout" && (children = jsx(PopChild, { isPresent, children })), jsx(PresenceContext.Provider, { value: context, children });
3936
+ };
3937
+ function newChildrenMap() {
3938
+ return /* @__PURE__ */ new Map();
3897
3939
  }
3898
- function nonexhaustive(value) {
3899
- throw new NonExhaustiveError(`NonExhaustive value: ${value}`);
3940
+ const getChildKey = (child) => child.key || "";
3941
+ function onlyElements(children) {
3942
+ const filtered = [];
3943
+ return Children.forEach(children, (child) => {
3944
+ isValidElement(child) && filtered.push(child);
3945
+ }), filtered;
3900
3946
  }
3901
- const ElementShapes = [
3902
- "rectangle",
3903
- "person",
3904
- "browser",
3905
- "mobile",
3906
- "cylinder",
3907
- "storage",
3908
- "queue"
3909
- ], isTagEqual = (operator) => "tag" in operator, isKindEqual = (operator) => "kind" in operator, isNotOperator = (operator) => "not" in operator, isAndOperator = (operator) => "and" in operator, isOrOperator = (operator) => "or" in operator;
3910
- function whereOperatorAsPredicate(operator) {
3911
- switch (!0) {
3912
- case isTagEqual(operator): {
3913
- if ("eq" in operator.tag) {
3914
- const tag2 = operator.tag.eq;
3915
- return (value) => Array.isArray(value.tags) && value.tags.includes(tag2);
3916
- }
3917
- const tag = operator.tag.neq;
3918
- return (value) => !Array.isArray(value.tags) || !value.tags.includes(tag);
3919
- }
3920
- case isKindEqual(operator): {
3921
- if ("eq" in operator.kind) {
3922
- const kind2 = operator.kind.eq;
3923
- return (value) => value.kind === kind2;
3924
- }
3925
- const kind = operator.kind.neq;
3926
- return (value) => e$3(value.kind) || value.kind !== kind;
3927
- }
3928
- case isNotOperator(operator): {
3929
- const predicate = whereOperatorAsPredicate(operator.not);
3930
- return o$2(predicate);
3931
- }
3932
- case isAndOperator(operator): {
3933
- const predicates = operator.and.map(whereOperatorAsPredicate);
3934
- return t$1(predicates);
3947
+ const AnimatePresence = ({ children, exitBeforeEnter, custom: custom5, initial = !0, onExitComplete, presenceAffectsLayout = !0, mode = "sync" }) => {
3948
+ const presentChildren = useMemo$1(() => onlyElements(children), [children]), presentKeys = presentChildren.map(getChildKey), isInitialRender = useRef$1(!0), pendingPresentChildren = useRef$1(presentChildren), exitComplete = useConstant(() => /* @__PURE__ */ new Map()), [diffedChildren, setDiffedChildren] = useState$1(presentChildren), [renderedChildren, setRenderedChildren] = useState$1(presentChildren);
3949
+ useIsomorphicLayoutEffect$2(() => {
3950
+ isInitialRender.current = !1, pendingPresentChildren.current = presentChildren;
3951
+ for (let i2 = 0; i2 < renderedChildren.length; i2++) {
3952
+ const key = getChildKey(renderedChildren[i2]);
3953
+ presentKeys.includes(key) ? exitComplete.delete(key) : exitComplete.get(key) !== !0 && exitComplete.set(key, !1);
3935
3954
  }
3936
- case isOrOperator(operator): {
3937
- const predicates = operator.or.map(whereOperatorAsPredicate);
3938
- return y$1(predicates);
3955
+ }, [renderedChildren, presentKeys.length, presentKeys.join("-")]);
3956
+ const exitingChildren = [];
3957
+ if (presentChildren !== diffedChildren) {
3958
+ let nextChildren = [...presentChildren];
3959
+ for (let i2 = 0; i2 < renderedChildren.length; i2++) {
3960
+ const child = renderedChildren[i2], key = getChildKey(child);
3961
+ presentKeys.includes(key) || (nextChildren.splice(i2, 0, child), exitingChildren.push(child));
3939
3962
  }
3940
- default:
3941
- nonexhaustive(operator);
3963
+ mode === "wait" && exitingChildren.length && (nextChildren = exitingChildren), setRenderedChildren(onlyElements(nextChildren)), setDiffedChildren(presentChildren);
3964
+ return;
3942
3965
  }
3966
+ const { forceRender } = useContext$1(LayoutGroupContext);
3967
+ return jsx(Fragment, { children: renderedChildren.map((child) => {
3968
+ const key = getChildKey(child), isPresent = presentChildren === renderedChildren || presentKeys.includes(key), onExit = () => {
3969
+ if (exitComplete.has(key))
3970
+ exitComplete.set(key, !0);
3971
+ else
3972
+ return;
3973
+ let isEveryExitComplete = !0;
3974
+ exitComplete.forEach((isExitComplete) => {
3975
+ isExitComplete || (isEveryExitComplete = !1);
3976
+ }), isEveryExitComplete && (forceRender?.(), setRenderedChildren(pendingPresentChildren.current), onExitComplete && onExitComplete());
3977
+ };
3978
+ return jsx(PresenceChild, { isPresent, initial: !isInitialRender.current || initial ? void 0 : !1, custom: isPresent ? void 0 : custom5, presenceAffectsLayout, mode, onExitComplete: isPresent ? void 0 : onExit, children: child }, key);
3979
+ }) });
3980
+ };
3981
+ function LazyMotion({ children, features, strict = !1 }) {
3982
+ const [, setIsLoaded] = useState$1(!isLazyBundle(features)), loadedRenderer = useRef$1(void 0);
3983
+ if (!isLazyBundle(features)) {
3984
+ const { renderer, ...loadedFeatures } = features;
3985
+ loadedRenderer.current = renderer, loadFeatures(loadedFeatures);
3986
+ }
3987
+ return useEffect$1(() => {
3988
+ isLazyBundle(features) && features().then(({ renderer, ...loadedFeatures }) => {
3989
+ loadFeatures(loadedFeatures), loadedRenderer.current = renderer, setIsLoaded(!0);
3990
+ });
3991
+ }, []), jsx(LazyContext.Provider, { value: { renderer: loadedRenderer.current, strict }, children });
3943
3992
  }
3944
- function StepEdgeId(step) {
3945
- return `step-${String(step).padStart(3, "0")}`;
3946
- }
3947
- function isStepEdgeId(id2) {
3948
- return id2.startsWith("step-");
3949
- }
3950
- function extractStep(id2) {
3951
- if (!isStepEdgeId(id2))
3952
- throw new Error(`Invalid step edge id: ${id2}`);
3953
- return Number(id2.slice(5));
3954
- }
3955
- function getBBoxCenter({
3956
- x: x2,
3957
- y: y2,
3958
- width,
3959
- height
3960
- }) {
3961
- return {
3962
- x: x2 + width / 2,
3963
- y: y2 + height / 2
3964
- };
3965
- }
3966
- function isAncestor(...args) {
3967
- const ancestor = isString(args[0]) ? args[0] : args[0].id;
3968
- return (isString(args[1]) ? args[1] : args[1].id).startsWith(ancestor + ".");
3993
+ function isLazyBundle(features) {
3994
+ return typeof features == "function";
3969
3995
  }
3996
+ const domAnimation = {
3997
+ renderer: createDomVisualElement,
3998
+ ...animations,
3999
+ ...gestureAnimations
4000
+ };
4001
+ var rootClassName = "likec4-diagram-root";
3970
4002
  function useSyncedRef(value) {
3971
4003
  const ref = useRef$1(value);
3972
4004
  return ref.current = value, useMemo$1(() => Object.freeze({
@@ -4266,7 +4298,7 @@ const trackedConnections = /* @__PURE__ */ new Map(), getTrackedConnectionState
4266
4298
  Compound: 2,
4267
4299
  Edge: 4,
4268
4300
  Element: 6
4269
- }, MinZoom = 0.1, { abs: abs$1, cos: cos$1, sin: sin$1, acos: acos$1, atan2, sqrt: sqrt$1, pow } = Math;
4301
+ }, MinZoom = 0.1, MaxZoom = 2, { abs: abs$1, cos: cos$1, sin: sin$1, acos: acos$1, atan2, sqrt: sqrt$1, pow } = Math;
4270
4302
  function crt(v) {
4271
4303
  return v < 0 ? -pow(-v, 1 / 3) : pow(v, 1 / 3);
4272
4304
  }
@@ -4337,26 +4369,26 @@ const pi$2 = Math.PI, tau$1 = 2 * pi$2, quart = pi$2 / 2, epsilon$2 = 1e-6, nMax
4337
4369
  if (t2 === 1)
4338
4370
  return points[order].t = 1, points[order];
4339
4371
  const mt = 1 - t2;
4340
- let p = points;
4372
+ let p2 = points;
4341
4373
  if (order === 0)
4342
4374
  return points[0].t = t2, points[0];
4343
4375
  if (order === 1) {
4344
4376
  const ret = {
4345
- x: mt * p[0].x + t2 * p[1].x,
4346
- y: mt * p[0].y + t2 * p[1].y,
4377
+ x: mt * p2[0].x + t2 * p2[1].x,
4378
+ y: mt * p2[0].y + t2 * p2[1].y,
4347
4379
  t: t2
4348
4380
  };
4349
- return _3d && (ret.z = mt * p[0].z + t2 * p[1].z), ret;
4381
+ return _3d && (ret.z = mt * p2[0].z + t2 * p2[1].z), ret;
4350
4382
  }
4351
4383
  if (order < 4) {
4352
- let mt2 = mt * mt, t22 = t2 * t2, a2, b2, c, d2 = 0;
4353
- order === 2 ? (p = [p[0], p[1], p[2], ZERO], a2 = mt2, b2 = mt * t2 * 2, c = t22) : order === 3 && (a2 = mt2 * mt, b2 = mt2 * t2 * 3, c = mt * t22 * 3, d2 = t2 * t22);
4384
+ let mt2 = mt * mt, t22 = t2 * t2, a2, b2, c2, d2 = 0;
4385
+ order === 2 ? (p2 = [p2[0], p2[1], p2[2], ZERO], a2 = mt2, b2 = mt * t2 * 2, c2 = t22) : order === 3 && (a2 = mt2 * mt, b2 = mt2 * t2 * 3, c2 = mt * t22 * 3, d2 = t2 * t22);
4354
4386
  const ret = {
4355
- x: a2 * p[0].x + b2 * p[1].x + c * p[2].x + d2 * p[3].x,
4356
- y: a2 * p[0].y + b2 * p[1].y + c * p[2].y + d2 * p[3].y,
4387
+ x: a2 * p2[0].x + b2 * p2[1].x + c2 * p2[2].x + d2 * p2[3].x,
4388
+ y: a2 * p2[0].y + b2 * p2[1].y + c2 * p2[2].y + d2 * p2[3].y,
4357
4389
  t: t2
4358
4390
  };
4359
- return _3d && (ret.z = a2 * p[0].z + b2 * p[1].z + c * p[2].z + d2 * p[3].z), ret;
4391
+ return _3d && (ret.z = a2 * p2[0].z + b2 * p2[1].z + c2 * p2[2].z + d2 * p2[3].z), ret;
4360
4392
  }
4361
4393
  const dCpts = JSON.parse(JSON.stringify(points));
4362
4394
  for (; dCpts.length > 1; ) {
@@ -4370,40 +4402,40 @@ const pi$2 = Math.PI, tau$1 = 2 * pi$2, quart = pi$2 / 2, epsilon$2 = 1e-6, nMax
4370
4402
  return dCpts[0].t = t2, dCpts[0];
4371
4403
  },
4372
4404
  computeWithRatios: function(t2, points, ratios, _3d) {
4373
- const mt = 1 - t2, r2 = ratios, p = points;
4405
+ const mt = 1 - t2, r2 = ratios, p2 = points;
4374
4406
  let f1 = r2[0], f2 = r2[1], f3 = r2[2], f4 = r2[3], d2;
4375
- if (f1 *= mt, f2 *= t2, p.length === 2)
4407
+ if (f1 *= mt, f2 *= t2, p2.length === 2)
4376
4408
  return d2 = f1 + f2, {
4377
- x: (f1 * p[0].x + f2 * p[1].x) / d2,
4378
- y: (f1 * p[0].y + f2 * p[1].y) / d2,
4379
- z: _3d ? (f1 * p[0].z + f2 * p[1].z) / d2 : !1,
4409
+ x: (f1 * p2[0].x + f2 * p2[1].x) / d2,
4410
+ y: (f1 * p2[0].y + f2 * p2[1].y) / d2,
4411
+ z: _3d ? (f1 * p2[0].z + f2 * p2[1].z) / d2 : !1,
4380
4412
  t: t2
4381
4413
  };
4382
- if (f1 *= mt, f2 *= 2 * mt, f3 *= t2 * t2, p.length === 3)
4414
+ if (f1 *= mt, f2 *= 2 * mt, f3 *= t2 * t2, p2.length === 3)
4383
4415
  return d2 = f1 + f2 + f3, {
4384
- x: (f1 * p[0].x + f2 * p[1].x + f3 * p[2].x) / d2,
4385
- y: (f1 * p[0].y + f2 * p[1].y + f3 * p[2].y) / d2,
4386
- z: _3d ? (f1 * p[0].z + f2 * p[1].z + f3 * p[2].z) / d2 : !1,
4416
+ x: (f1 * p2[0].x + f2 * p2[1].x + f3 * p2[2].x) / d2,
4417
+ y: (f1 * p2[0].y + f2 * p2[1].y + f3 * p2[2].y) / d2,
4418
+ z: _3d ? (f1 * p2[0].z + f2 * p2[1].z + f3 * p2[2].z) / d2 : !1,
4387
4419
  t: t2
4388
4420
  };
4389
- if (f1 *= mt, f2 *= 1.5 * mt, f3 *= 3 * mt, f4 *= t2 * t2 * t2, p.length === 4)
4421
+ if (f1 *= mt, f2 *= 1.5 * mt, f3 *= 3 * mt, f4 *= t2 * t2 * t2, p2.length === 4)
4390
4422
  return d2 = f1 + f2 + f3 + f4, {
4391
- x: (f1 * p[0].x + f2 * p[1].x + f3 * p[2].x + f4 * p[3].x) / d2,
4392
- y: (f1 * p[0].y + f2 * p[1].y + f3 * p[2].y + f4 * p[3].y) / d2,
4393
- z: _3d ? (f1 * p[0].z + f2 * p[1].z + f3 * p[2].z + f4 * p[3].z) / d2 : !1,
4423
+ x: (f1 * p2[0].x + f2 * p2[1].x + f3 * p2[2].x + f4 * p2[3].x) / d2,
4424
+ y: (f1 * p2[0].y + f2 * p2[1].y + f3 * p2[2].y + f4 * p2[3].y) / d2,
4425
+ z: _3d ? (f1 * p2[0].z + f2 * p2[1].z + f3 * p2[2].z + f4 * p2[3].z) / d2 : !1,
4394
4426
  t: t2
4395
4427
  };
4396
4428
  },
4397
4429
  derive: function(points, _3d) {
4398
4430
  const dpoints = [];
4399
- for (let p = points, d2 = p.length, c = d2 - 1; d2 > 1; d2--, c--) {
4431
+ for (let p2 = points, d2 = p2.length, c2 = d2 - 1; d2 > 1; d2--, c2--) {
4400
4432
  const list = [];
4401
- for (let j = 0, dpt; j < c; j++)
4433
+ for (let j = 0, dpt; j < c2; j++)
4402
4434
  dpt = {
4403
- x: c * (p[j + 1].x - p[j].x),
4404
- y: c * (p[j + 1].y - p[j].y)
4405
- }, _3d && (dpt.z = c * (p[j + 1].z - p[j].z)), list.push(dpt);
4406
- dpoints.push(list), p = list;
4435
+ x: c2 * (p2[j + 1].x - p2[j].x),
4436
+ y: c2 * (p2[j + 1].y - p2[j].y)
4437
+ }, _3d && (dpt.z = c2 * (p2[j + 1].z - p2[j].z)), list.push(dpt);
4438
+ dpoints.push(list), p2 = list;
4407
4439
  }
4408
4440
  return dpoints;
4409
4441
  },
@@ -4431,9 +4463,9 @@ const pi$2 = Math.PI, tau$1 = 2 * pi$2, quart = pi$2 / 2, epsilon$2 = 1e-6, nMax
4431
4463
  };
4432
4464
  return v1.z !== void 0 && v2.z !== void 0 && (ret.z = v1.z + r2 * (v2.z - v1.z)), ret;
4433
4465
  },
4434
- pointToString: function(p) {
4435
- let s2 = p.x + "/" + p.y;
4436
- return typeof p.z < "u" && (s2 += "/" + p.z), s2;
4466
+ pointToString: function(p2) {
4467
+ let s2 = p2.x + "/" + p2.y;
4468
+ return typeof p2.z < "u" && (s2 += "/" + p2.z), s2;
4437
4469
  },
4438
4470
  pointsToString: function(points) {
4439
4471
  return "[" + points.map(utils.pointToString).join(", ") + "]";
@@ -4456,8 +4488,8 @@ const pi$2 = Math.PI, tau$1 = 2 * pi$2, quart = pi$2 / 2, epsilon$2 = 1e-6, nMax
4456
4488
  },
4457
4489
  closest: function(LUT, point2) {
4458
4490
  let mdist = pow(2, 63), mpos, d2;
4459
- return LUT.forEach(function(p, idx) {
4460
- d2 = utils.dist(point2, p), d2 < mdist && (mdist = d2, mpos = idx);
4491
+ return LUT.forEach(function(p2, idx) {
4492
+ d2 = utils.dist(point2, p2), d2 < mdist && (mdist = d2, mpos = idx);
4461
4493
  }), { mdist, mpos };
4462
4494
  },
4463
4495
  abcratio: function(t2, n2) {
@@ -4542,10 +4574,10 @@ const pi$2 = Math.PI, tau$1 = 2 * pi$2, quart = pi$2 / 2, epsilon$2 = 1e-6, nMax
4542
4574
  },
4543
4575
  getminmax: function(curve2, d2, list) {
4544
4576
  if (!list) return { min: 0, max: 0 };
4545
- let min2 = nMax, max2 = nMin, t2, c;
4577
+ let min2 = nMax, max2 = nMin, t2, c2;
4546
4578
  list.indexOf(0) === -1 && (list = [0].concat(list)), list.indexOf(1) === -1 && list.push(1);
4547
4579
  for (let i2 = 0, len = list.length; i2 < len; i2++)
4548
- t2 = list[i2], c = curve2.get(t2), c[d2] < min2 && (min2 = c[d2]), c[d2] > max2 && (max2 = c[d2]);
4580
+ t2 = list[i2], c2 = curve2.get(t2), c2[d2] < min2 && (min2 = c2[d2]), c2[d2] > max2 && (max2 = c2[d2]);
4549
4581
  return { min: min2, mid: (min2 + max2) / 2, max: max2, size: max2 - min2 };
4550
4582
  },
4551
4583
  align: function(points, line) {
@@ -4563,27 +4595,27 @@ const pi$2 = Math.PI, tau$1 = 2 * pi$2, quart = pi$2 / 2, epsilon$2 = 1e-6, nMax
4563
4595
  return 0 <= t2 && t2 <= 1;
4564
4596
  };
4565
4597
  if (order === 2) {
4566
- const a3 = aligned[0].y, b3 = aligned[1].y, c2 = aligned[2].y, d3 = a3 - 2 * b3 + c2;
4598
+ const a3 = aligned[0].y, b3 = aligned[1].y, c3 = aligned[2].y, d3 = a3 - 2 * b3 + c3;
4567
4599
  if (d3 !== 0) {
4568
- const m1 = -sqrt$1(b3 * b3 - a3 * c2), m2 = -a3 + b3, v12 = -(m1 + m2) / d3, v2 = -(-m1 + m2) / d3;
4600
+ const m1 = -sqrt$1(b3 * b3 - a3 * c3), m2 = -a3 + b3, v12 = -(m1 + m2) / d3, v2 = -(-m1 + m2) / d3;
4569
4601
  return [v12, v2].filter(reduce);
4570
- } else if (b3 !== c2 && d3 === 0)
4571
- return [(2 * b3 - c2) / (2 * b3 - 2 * c2)].filter(reduce);
4602
+ } else if (b3 !== c3 && d3 === 0)
4603
+ return [(2 * b3 - c3) / (2 * b3 - 2 * c3)].filter(reduce);
4572
4604
  return [];
4573
4605
  }
4574
4606
  const pa = aligned[0].y, pb = aligned[1].y, pc = aligned[2].y, pd = aligned[3].y;
4575
- let d2 = -pa + 3 * pb - 3 * pc + pd, a2 = 3 * pa - 6 * pb + 3 * pc, b2 = -3 * pa + 3 * pb, c = pa;
4607
+ let d2 = -pa + 3 * pb - 3 * pc + pd, a2 = 3 * pa - 6 * pb + 3 * pc, b2 = -3 * pa + 3 * pb, c2 = pa;
4576
4608
  if (utils.approximately(d2, 0)) {
4577
4609
  if (utils.approximately(a2, 0))
4578
- return utils.approximately(b2, 0) ? [] : [-c / b2].filter(reduce);
4579
- const q3 = sqrt$1(b2 * b2 - 4 * a2 * c), a22 = 2 * a2;
4610
+ return utils.approximately(b2, 0) ? [] : [-c2 / b2].filter(reduce);
4611
+ const q3 = sqrt$1(b2 * b2 - 4 * a2 * c2), a22 = 2 * a2;
4580
4612
  return [(q3 - b2) / a22, (-b2 - q3) / a22].filter(reduce);
4581
4613
  }
4582
- a2 /= d2, b2 /= d2, c /= d2;
4583
- const p = (3 * b2 - a2 * a2) / 3, p3 = p / 3, q = (2 * a2 * a2 * a2 - 9 * a2 * b2 + 27 * c) / 27, q2 = q / 2, discriminant = q2 * q2 + p3 * p3 * p3;
4614
+ a2 /= d2, b2 /= d2, c2 /= d2;
4615
+ const p2 = (3 * b2 - a2 * a2) / 3, p3 = p2 / 3, q = (2 * a2 * a2 * a2 - 9 * a2 * b2 + 27 * c2) / 27, q2 = q / 2, discriminant = q2 * q2 + p3 * p3 * p3;
4584
4616
  let u1, v1, x1, x2, x3;
4585
4617
  if (discriminant < 0) {
4586
- const mp3 = -p / 3, mp33 = mp3 * mp3 * mp3, r2 = sqrt$1(mp33), t2 = -q / (2 * r2), cosphi = t2 < -1 ? -1 : t2 > 1 ? 1 : t2, phi = acos$1(cosphi), crtr = crt(r2), t1 = 2 * crtr;
4618
+ const mp3 = -p2 / 3, mp33 = mp3 * mp3 * mp3, r2 = sqrt$1(mp33), t2 = -q / (2 * r2), cosphi = t2 < -1 ? -1 : t2 > 1 ? 1 : t2, phi = acos$1(cosphi), crtr = crt(r2), t1 = 2 * crtr;
4587
4619
  return x1 = t1 * cos$1(phi / 3) - a2 / 3, x2 = t1 * cos$1((phi + tau$1) / 3) - a2 / 3, x3 = t1 * cos$1((phi + 2 * tau$1) / 3) - a2 / 3, [x1, x2, x3].filter(reduce);
4588
4620
  } else {
4589
4621
  if (discriminant === 0)
@@ -4594,18 +4626,18 @@ const pi$2 = Math.PI, tau$1 = 2 * pi$2, quart = pi$2 / 2, epsilon$2 = 1e-6, nMax
4594
4626
  }
4595
4627
  }
4596
4628
  },
4597
- droots: function(p) {
4598
- if (p.length === 3) {
4599
- const a2 = p[0], b2 = p[1], c = p[2], d2 = a2 - 2 * b2 + c;
4629
+ droots: function(p2) {
4630
+ if (p2.length === 3) {
4631
+ const a2 = p2[0], b2 = p2[1], c2 = p2[2], d2 = a2 - 2 * b2 + c2;
4600
4632
  if (d2 !== 0) {
4601
- const m1 = -sqrt$1(b2 * b2 - a2 * c), m2 = -a2 + b2, v1 = -(m1 + m2) / d2, v2 = -(-m1 + m2) / d2;
4633
+ const m1 = -sqrt$1(b2 * b2 - a2 * c2), m2 = -a2 + b2, v1 = -(m1 + m2) / d2, v2 = -(-m1 + m2) / d2;
4602
4634
  return [v1, v2];
4603
- } else if (b2 !== c && d2 === 0)
4604
- return [(2 * b2 - c) / (2 * (b2 - c))];
4635
+ } else if (b2 !== c2 && d2 === 0)
4636
+ return [(2 * b2 - c2) / (2 * (b2 - c2))];
4605
4637
  return [];
4606
4638
  }
4607
- if (p.length === 2) {
4608
- const a2 = p[0], b2 = p[1];
4639
+ if (p2.length === 2) {
4640
+ const a2 = p2[0], b2 = p2[1];
4609
4641
  return a2 !== b2 ? [a2 / (a2 - b2)] : [];
4610
4642
  }
4611
4643
  return [];
@@ -4625,7 +4657,7 @@ const pi$2 = Math.PI, tau$1 = 2 * pi$2, quart = pi$2 / 2, epsilon$2 = 1e-6, nMax
4625
4657
  },
4626
4658
  inflections: function(points) {
4627
4659
  if (points.length < 4) return [];
4628
- const p = utils.align(points, { p1: points[0], p2: points.slice(-1)[0] }), a2 = p[2].x * p[1].y, b2 = p[3].x * p[1].y, c = p[1].x * p[2].y, d2 = p[3].x * p[2].y, v1 = 18 * (-3 * a2 + 2 * b2 + 3 * c - d2), v2 = 18 * (3 * a2 - b2 - 3 * c), v3 = 18 * (c - a2);
4660
+ const p2 = utils.align(points, { p1: points[0], p2: points.slice(-1)[0] }), a2 = p2[2].x * p2[1].y, b2 = p2[3].x * p2[1].y, c2 = p2[1].x * p2[2].y, d2 = p2[3].x * p2[2].y, v1 = 18 * (-3 * a2 + 2 * b2 + 3 * c2 - d2), v2 = 18 * (3 * a2 - b2 - 3 * c2), v3 = 18 * (c2 - a2);
4629
4661
  if (utils.approximately(v1, 0)) {
4630
4662
  if (!utils.approximately(v2, 0)) {
4631
4663
  let t2 = -v3 / v2;
@@ -4710,9 +4742,9 @@ class PolyBezier {
4710
4742
  return this.curves[idx];
4711
4743
  }
4712
4744
  bbox() {
4713
- const c = this.curves;
4714
- for (var bbox = c[0].bbox(), i2 = 1; i2 < c.length; i2++)
4715
- utils.expandbox(bbox, c[i2].bbox());
4745
+ const c2 = this.curves;
4746
+ for (var bbox = c2[0].bbox(), i2 = 1; i2 < c2.length; i2++)
4747
+ utils.expandbox(bbox, c2[i2].bbox());
4716
4748
  return bbox;
4717
4749
  }
4718
4750
  offset(d2) {
@@ -4760,7 +4792,7 @@ class Bezier {
4760
4792
  const order = this.order = points.length - 1, dims = this.dims = ["x", "y"];
4761
4793
  _3d && dims.push("z"), this.dimlen = dims.length;
4762
4794
  const aligned = utils.align(points, { p1: points[0], p2: points[order] }), baselength = utils.dist(points[0], points[order]);
4763
- this._linear = aligned.reduce((t2, p) => t2 + abs(p.y), 0) < baselength / 50, this._lut = [], this._t1 = 0, this._t2 = 1, this.update();
4795
+ this._linear = aligned.reduce((t2, p2) => t2 + abs(p2.y), 0) < baselength / 50, this._lut = [], this._t1 = 0, this._t2 = 1, this.update();
4764
4796
  }
4765
4797
  static quadraticFromPoints(p1, p2, p3, t2) {
4766
4798
  if (typeof t2 > "u" && (t2 = 0.5), t2 === 0)
@@ -4797,9 +4829,9 @@ class Bezier {
4797
4829
  }
4798
4830
  toSVG() {
4799
4831
  if (this._3d) return !1;
4800
- const p = this.points, x2 = p[0].x, y2 = p[0].y, s2 = ["M", x2, y2, this.order === 2 ? "Q" : "C"];
4801
- for (let i2 = 1, last = p.length; i2 < last; i2++)
4802
- s2.push(p[i2].x), s2.push(p[i2].y);
4832
+ const p2 = this.points, x2 = p2[0].x, y2 = p2[0].y, s2 = ["M", x2, y2, this.order === 2 ? "Q" : "C"];
4833
+ for (let i2 = 1, last = p2.length; i2 < last; i2++)
4834
+ s2.push(p2[i2].x), s2.push(p2[i2].y);
4803
4835
  return s2.join(" ");
4804
4836
  }
4805
4837
  setRatios(ratios) {
@@ -4812,8 +4844,8 @@ class Bezier {
4812
4844
  print !== this._print && (this._print = print, this.update());
4813
4845
  }
4814
4846
  coordDigest() {
4815
- return this.points.map(function(c, pos) {
4816
- return "" + pos + c.x + c.y + (c.z ? c.z : 0);
4847
+ return this.points.map(function(c2, pos) {
4848
+ return "" + pos + c2.x + c2.y + (c2.z ? c2.z : 0);
4817
4849
  }).join("");
4818
4850
  }
4819
4851
  update() {
@@ -4845,24 +4877,24 @@ class Bezier {
4845
4877
  if (this.verify(), steps2 = steps2 || 100, this._lut.length === steps2 + 1)
4846
4878
  return this._lut;
4847
4879
  this._lut = [], steps2++, this._lut = [];
4848
- for (let i2 = 0, p, t2; i2 < steps2; i2++)
4849
- t2 = i2 / (steps2 - 1), p = this.compute(t2), p.t = t2, this._lut.push(p);
4880
+ for (let i2 = 0, p2, t2; i2 < steps2; i2++)
4881
+ t2 = i2 / (steps2 - 1), p2 = this.compute(t2), p2.t = t2, this._lut.push(p2);
4850
4882
  return this._lut;
4851
4883
  }
4852
4884
  on(point2, error) {
4853
4885
  error = error || 5;
4854
4886
  const lut = this.getLUT(), hits = [];
4855
- for (let i2 = 0, c, t2 = 0; i2 < lut.length; i2++)
4856
- c = lut[i2], utils.dist(c, point2) < error && (hits.push(c), t2 += i2 / lut.length);
4887
+ for (let i2 = 0, c2, t2 = 0; i2 < lut.length; i2++)
4888
+ c2 = lut[i2], utils.dist(c2, point2) < error && (hits.push(c2), t2 += i2 / lut.length);
4857
4889
  return hits.length ? t /= hits.length : !1;
4858
4890
  }
4859
4891
  project(point2) {
4860
4892
  const LUT = this.getLUT(), l2 = LUT.length - 1, closest = utils.closest(LUT, point2), mpos = closest.mpos, t1 = (mpos - 1) / l2, t2 = (mpos + 1) / l2, step = 0.1 / l2;
4861
- let mdist = closest.mdist, t3 = t1, ft = t3, p;
4893
+ let mdist = closest.mdist, t3 = t1, ft = t3, p2;
4862
4894
  mdist += 1;
4863
4895
  for (let d2; t3 < t2 + step; t3 += step)
4864
- p = this.compute(t3), d2 = utils.dist(point2, p), d2 < mdist && (mdist = d2, ft = t3);
4865
- return ft = ft < 0 ? 0 : ft > 1 ? 1 : ft, p = this.compute(ft), p.t = ft, p.d = mdist, p;
4896
+ p2 = this.compute(t3), d2 = utils.dist(point2, p2), d2 < mdist && (mdist = d2, ft = t3);
4897
+ return ft = ft < 0 ? 0 : ft > 1 ? 1 : ft, p2 = this.compute(ft), p2.t = ft, p2.d = mdist, p2;
4866
4898
  }
4867
4899
  get(t2) {
4868
4900
  return this.compute(t2);
@@ -4874,13 +4906,13 @@ class Bezier {
4874
4906
  return this.ratios ? utils.computeWithRatios(t2, this.points, this.ratios, this._3d) : utils.compute(t2, this.points, this._3d, this.ratios);
4875
4907
  }
4876
4908
  raise() {
4877
- const p = this.points, np = [p[0]], k = p.length;
4909
+ const p2 = this.points, np = [p2[0]], k = p2.length;
4878
4910
  for (let i2 = 1, pi2, pim; i2 < k; i2++)
4879
- pi2 = p[i2], pim = p[i2 - 1], np[i2] = {
4911
+ pi2 = p2[i2], pim = p2[i2 - 1], np[i2] = {
4880
4912
  x: (k - i2) / k * pi2.x + i2 / k * pim.x,
4881
4913
  y: (k - i2) / k * pi2.y + i2 / k * pim.y
4882
4914
  };
4883
- return np[k] = p[k - 1], new Bezier(np);
4915
+ return np[k] = p2[k - 1], new Bezier(np);
4884
4916
  }
4885
4917
  derivative(t2) {
4886
4918
  return utils.compute(t2, this.dpoints[0], this._3d);
@@ -4889,8 +4921,8 @@ class Bezier {
4889
4921
  return utils.compute(t2, this.dpoints[1], this._3d);
4890
4922
  }
4891
4923
  align() {
4892
- let p = this.points;
4893
- return new Bezier(utils.align(p, { p1: p[0], p2: p[p.length - 1] }));
4924
+ let p2 = this.points;
4925
+ return new Bezier(utils.align(p2, { p1: p2[0], p2: p2[p2.length - 1] }));
4894
4926
  }
4895
4927
  curvature(t2) {
4896
4928
  return utils.curvature(t2, this.dpoints[0], this.dpoints[1], this._3d);
@@ -4908,22 +4940,22 @@ class Bezier {
4908
4940
  __normal3(t2) {
4909
4941
  const r1 = this.derivative(t2), r2 = this.derivative(t2 + 0.01), q1 = sqrt(r1.x * r1.x + r1.y * r1.y + r1.z * r1.z), q2 = sqrt(r2.x * r2.x + r2.y * r2.y + r2.z * r2.z);
4910
4942
  r1.x /= q1, r1.y /= q1, r1.z /= q1, r2.x /= q2, r2.y /= q2, r2.z /= q2;
4911
- const c = {
4943
+ const c2 = {
4912
4944
  x: r2.y * r1.z - r2.z * r1.y,
4913
4945
  y: r2.z * r1.x - r2.x * r1.z,
4914
4946
  z: r2.x * r1.y - r2.y * r1.x
4915
- }, m2 = sqrt(c.x * c.x + c.y * c.y + c.z * c.z);
4916
- c.x /= m2, c.y /= m2, c.z /= m2;
4947
+ }, m2 = sqrt(c2.x * c2.x + c2.y * c2.y + c2.z * c2.z);
4948
+ c2.x /= m2, c2.y /= m2, c2.z /= m2;
4917
4949
  const R = [
4918
- c.x * c.x,
4919
- c.x * c.y - c.z,
4920
- c.x * c.z + c.y,
4921
- c.x * c.y + c.z,
4922
- c.y * c.y,
4923
- c.y * c.z - c.x,
4924
- c.x * c.z - c.y,
4925
- c.y * c.z + c.x,
4926
- c.z * c.z
4950
+ c2.x * c2.x,
4951
+ c2.x * c2.y - c2.z,
4952
+ c2.x * c2.z + c2.y,
4953
+ c2.x * c2.y + c2.z,
4954
+ c2.y * c2.y,
4955
+ c2.y * c2.z - c2.x,
4956
+ c2.x * c2.z - c2.y,
4957
+ c2.y * c2.z + c2.x,
4958
+ c2.z * c2.z
4927
4959
  ];
4928
4960
  return {
4929
4961
  t: t2,
@@ -4933,12 +4965,12 @@ class Bezier {
4933
4965
  };
4934
4966
  }
4935
4967
  hull(t2) {
4936
- let p = this.points, _p = [], q = [], idx = 0;
4937
- for (q[idx++] = p[0], q[idx++] = p[1], q[idx++] = p[2], this.order === 3 && (q[idx++] = p[3]); p.length > 1; ) {
4968
+ let p2 = this.points, _p = [], q = [], idx = 0;
4969
+ for (q[idx++] = p2[0], q[idx++] = p2[1], q[idx++] = p2[2], this.order === 3 && (q[idx++] = p2[3]); p2.length > 1; ) {
4938
4970
  _p = [];
4939
- for (let i2 = 0, pt, l2 = p.length - 1; i2 < l2; i2++)
4940
- pt = utils.lerp(t2, p[i2], p[i2 + 1]), q[idx++] = pt, _p.push(pt);
4941
- p = _p;
4971
+ for (let i2 = 0, pt, l2 = p2.length - 1; i2 < l2; i2++)
4972
+ pt = utils.lerp(t2, p2[i2], p2[i2 + 1]), q[idx++] = pt, _p.push(pt);
4973
+ p2 = _p;
4942
4974
  }
4943
4975
  return q;
4944
4976
  }
@@ -4961,8 +4993,8 @@ class Bezier {
4961
4993
  function(dim) {
4962
4994
  let mfn = function(v) {
4963
4995
  return v[dim];
4964
- }, p = this.dpoints[0].map(mfn);
4965
- result[dim] = utils.droots(p), this.order === 3 && (p = this.dpoints[1].map(mfn), result[dim] = result[dim].concat(utils.droots(p))), result[dim] = result[dim].filter(function(t2) {
4996
+ }, p2 = this.dpoints[0].map(mfn);
4997
+ result[dim] = utils.droots(p2), this.order === 3 && (p2 = this.dpoints[1].map(mfn), result[dim] = result[dim].concat(utils.droots(p2))), result[dim] = result[dim].filter(function(t2) {
4966
4998
  return t2 >= 0 && t2 <= 1;
4967
4999
  }), roots = roots.concat(result[dim].sort(utils.numberSort));
4968
5000
  }.bind(this)
@@ -4984,21 +5016,21 @@ class Bezier {
4984
5016
  }
4985
5017
  offset(t2, d2) {
4986
5018
  if (typeof d2 < "u") {
4987
- const c = this.get(t2), n2 = this.normal(t2), ret = {
4988
- c,
5019
+ const c2 = this.get(t2), n2 = this.normal(t2), ret = {
5020
+ c: c2,
4989
5021
  n: n2,
4990
- x: c.x + n2.x * d2,
4991
- y: c.y + n2.y * d2
5022
+ x: c2.x + n2.x * d2,
5023
+ y: c2.y + n2.y * d2
4992
5024
  };
4993
- return this._3d && (ret.z = c.z + n2.z * d2), ret;
5025
+ return this._3d && (ret.z = c2.z + n2.z * d2), ret;
4994
5026
  }
4995
5027
  if (this._linear) {
4996
- const nv = this.normal(0), coords = this.points.map(function(p) {
5028
+ const nv = this.normal(0), coords = this.points.map(function(p2) {
4997
5029
  const ret = {
4998
- x: p.x + t2 * nv.x,
4999
- y: p.y + t2 * nv.y
5030
+ x: p2.x + t2 * nv.x,
5031
+ y: p2.y + t2 * nv.y
5000
5032
  };
5001
- return p.z && nv.z && (ret.z = p.z + t2 * nv.z), ret;
5033
+ return p2.z && nv.z && (ret.z = p2.z + t2 * nv.z), ret;
5002
5034
  });
5003
5035
  return [new Bezier(coords)];
5004
5036
  }
@@ -5036,9 +5068,9 @@ class Bezier {
5036
5068
  const o2 = this.order;
5037
5069
  let d3 = this.points.map((_, i2) => (1 - i2 / o2) * d1 + i2 / o2 * d2);
5038
5070
  return new Bezier(
5039
- this.points.map((p, i2) => ({
5040
- x: p.x + v.x * d3[i2],
5041
- y: p.y + v.y * d3[i2]
5071
+ this.points.map((p2, i2) => ({
5072
+ x: p2.x + v.x * d3[i2],
5073
+ y: p2.y + v.y * d3[i2]
5042
5074
  }))
5043
5075
  );
5044
5076
  }
@@ -5058,25 +5090,25 @@ class Bezier {
5058
5090
  if (!o2)
5059
5091
  throw new Error("cannot scale this curve. Try reducing it first.");
5060
5092
  return [0, 1].forEach(function(t2) {
5061
- const p = np[t2 * order] = utils.copy(points[t2 * order]);
5062
- p.x += (t2 ? r2 : r1) * v[t2].n.x, p.y += (t2 ? r2 : r1) * v[t2].n.y;
5093
+ const p2 = np[t2 * order] = utils.copy(points[t2 * order]);
5094
+ p2.x += (t2 ? r2 : r1) * v[t2].n.x, p2.y += (t2 ? r2 : r1) * v[t2].n.y;
5063
5095
  }), distanceFn ? ([0, 1].forEach(function(t2) {
5064
5096
  if (!(order === 2 && t2)) {
5065
- var p = points[t2 + 1], ov = {
5066
- x: p.x - o2.x,
5067
- y: p.y - o2.y
5097
+ var p2 = points[t2 + 1], ov = {
5098
+ x: p2.x - o2.x,
5099
+ y: p2.y - o2.y
5068
5100
  }, rc = distanceFn ? distanceFn((t2 + 1) / order) : d2;
5069
5101
  distanceFn && !clockwise && (rc = -rc);
5070
5102
  var m2 = sqrt(ov.x * ov.x + ov.y * ov.y);
5071
5103
  ov.x /= m2, ov.y /= m2, np[t2 + 1] = {
5072
- x: p.x + rc * ov.x,
5073
- y: p.y + rc * ov.y
5104
+ x: p2.x + rc * ov.x,
5105
+ y: p2.y + rc * ov.y
5074
5106
  };
5075
5107
  }
5076
5108
  }), new Bezier(np)) : ([0, 1].forEach((t2) => {
5077
5109
  if (order === 2 && t2) return;
5078
- const p = np[t2 * order], d3 = this.derivative(t2), p2 = { x: p.x + d3.x, y: p.y + d3.y };
5079
- np[t2 + 1] = utils.lli4(p, p2, o2, points[t2 + 1]);
5110
+ const p2 = np[t2 * order], d3 = this.derivative(t2), p22 = { x: p2.x + d3.x, y: p2.y + d3.y };
5111
+ np[t2 + 1] = utils.lli4(p2, p22, o2, points[t2 + 1]);
5080
5112
  }), new Bezier(np));
5081
5113
  }
5082
5114
  outline(d1, d2, d3, d4) {
@@ -5090,7 +5122,7 @@ class Bezier {
5090
5122
  return new PolyBezier(segments2);
5091
5123
  }
5092
5124
  const reduced = this.reduce(), len = reduced.length, fcurves = [];
5093
- let bcurves = [], p, alen = 0, tlen = this.length();
5125
+ let bcurves = [], p2, alen = 0, tlen = this.length();
5094
5126
  const graduated = typeof d3 < "u" && typeof d4 < "u";
5095
5127
  function linearDistanceFunction(s2, e2, tlen2, alen2, slen) {
5096
5128
  return function(v) {
@@ -5106,7 +5138,7 @@ class Bezier {
5106
5138
  segment.scale(linearDistanceFunction(-d2, -d4, tlen, alen, slen))
5107
5139
  )) : (fcurves.push(segment.scale(d1)), bcurves.push(segment.scale(-d2))), alen += slen;
5108
5140
  }), bcurves = bcurves.map(function(s2) {
5109
- return p = s2.points, p[3] ? s2.points = [p[3], p[2], p[1], p[0]] : s2.points = [p[2], p[1], p[0]], s2;
5141
+ return p2 = s2.points, p2[3] ? s2.points = [p2[3], p2[2], p2[1], p2[0]] : s2.points = [p2[2], p2[1], p2[0]], s2;
5110
5142
  }).reverse();
5111
5143
  const fs = fcurves[0].points[0], fe = fcurves[len - 1].points[fcurves[len - 1].points.length - 1], bs = bcurves[len - 1].points[bcurves[len - 1].points.length - 1], be = bcurves[0].points[0], ls = utils.makeline(bs, fs), le = utils.makeline(fe, be), segments = [ls].concat(fcurves).concat([le]).concat(bcurves);
5112
5144
  return new PolyBezier(segments);
@@ -5134,8 +5166,8 @@ class Bezier {
5134
5166
  lineIntersects(line) {
5135
5167
  const mx = min(line.p1.x, line.p2.x), my = min(line.p1.y, line.p2.y), MX = max(line.p1.x, line.p2.x), MY = max(line.p1.y, line.p2.y);
5136
5168
  return utils.roots(this.points, line).filter((t2) => {
5137
- var p = this.get(t2);
5138
- return utils.between(p.x, mx, MX) && utils.between(p.y, my, MY);
5169
+ var p2 = this.get(t2);
5170
+ return utils.between(p2.x, mx, MX) && utils.between(p2.y, my, MY);
5139
5171
  });
5140
5172
  }
5141
5173
  selfintersects(curveIntersectionThreshold) {
@@ -5210,7 +5242,7 @@ const nodeToRect = (nd) => ({
5210
5242
  }), isInside = (test2, target) => test2.x >= target.x && test2.y >= target.y && test2.x + test2.width <= target.x + target.width && test2.y + test2.height <= target.y + target.height;
5211
5243
  function bezierControlPoints(diagramEdge) {
5212
5244
  let [start, ...bezierPoints] = diagramEdge.points;
5213
- invariant(start, "start should be defined");
5245
+ invariant$1(start, "start should be defined");
5214
5246
  const handles = [
5215
5247
  // start
5216
5248
  ];
@@ -5224,7 +5256,7 @@ function bezierControlPoints(diagramEdge) {
5224
5256
  });
5225
5257
  }), bezierPoints = rest, start = end;
5226
5258
  }
5227
- return invariant(bezierPoints.length === 0, "all points should be consumed"), handles;
5259
+ return invariant$1(bezierPoints.length === 0, "all points should be consumed"), handles;
5228
5260
  }
5229
5261
  const isClose = (a2, b2) => Math.abs(a2 - b2) < 3.1;
5230
5262
  function isSamePoint$1(a2, b2) {
@@ -5246,9 +5278,9 @@ function diagramViewToXYFlowData(view, opts) {
5246
5278
  const ns = "", nodeById = (id2) => nonNullable(nodeLookup.get(id2), `Node not found: ${id2}`);
5247
5279
  let next;
5248
5280
  for (; next = traverse.shift(); ) {
5249
- const { node, parent } = next;
5250
- node.children.length > 0 && traverse.push(...node.children.map((child) => ({ node: nodeById(child), parent: node })));
5251
- const isCompound = i$3(node.children, 1), position = {
5281
+ const { node, parent } = next, isCompound = i$3(node.children, 1);
5282
+ isCompound && traverse.push(...node.children.map((child) => ({ node: nodeById(child), parent: node })));
5283
+ const position = {
5252
5284
  x: node.position[0],
5253
5285
  y: node.position[1]
5254
5286
  };
@@ -5263,6 +5295,7 @@ function diagramViewToXYFlowData(view, opts) {
5263
5295
  },
5264
5296
  draggable,
5265
5297
  selectable: opts.selectable,
5298
+ focusable: opts.selectable && !isCompound,
5266
5299
  deletable: !1,
5267
5300
  position,
5268
5301
  zIndex: isCompound ? ZIndexes.Compound : ZIndexes.Element,
@@ -5280,7 +5313,11 @@ function diagramViewToXYFlowData(view, opts) {
5280
5313
  }
5281
5314
  for (const edge of view.edges) {
5282
5315
  const source = edge.source, target = edge.target, id2 = ns + edge.id;
5283
- invariant(i$3(edge.points, 2), "edge should have at least 2 points"), xyedges.push({
5316
+ if (!i$3(edge.points, 2)) {
5317
+ console.error("edge should have at least 2 points", edge);
5318
+ continue;
5319
+ }
5320
+ xyedges.push({
5284
5321
  id: id2,
5285
5322
  type: "relationship",
5286
5323
  source: ns + source,
@@ -5471,7 +5508,7 @@ function createDiagramStore(props2) {
5471
5508
  },
5472
5509
  focusOnNode: (nodeId) => {
5473
5510
  const { focusedNodeId, view, enableFocusMode } = get();
5474
- if (invariant(enableFocusMode, "focus mode is not enabled"), nodeId !== focusedNodeId) {
5511
+ if (invariant$1(enableFocusMode, "focus mode is not enabled"), nodeId !== focusedNodeId) {
5475
5512
  const notDimmed = new StringSet([nodeId]), dimmed2 = new StringSet();
5476
5513
  for (const edge of view.edges)
5477
5514
  edge.source === nodeId || edge.target === nodeId ? (notDimmed.add(edge.source), notDimmed.add(edge.target)) : dimmed2.add(edge.id);
@@ -5607,12 +5644,12 @@ function createDiagramStore(props2) {
5607
5644
  };
5608
5645
  data.label?.bbox && (_updated.labelBBox = data.label?.bbox), data.edge.labelBBox && (_updated.labelBBox ??= data.edge.labelBBox), controlPoints && i$3(controlPoints, 1) && (_updated.controlPoints = controlPoints), !sourceOrTargetMoved && data.edge.dotpos && (_updated.dotpos = data.edge.dotpos);
5609
5646
  const allX = [
5610
- ...data.edge.points.map((p) => p[0]),
5611
- ...(controlPoints ?? []).map((p) => p.x),
5647
+ ...data.edge.points.map((p2) => p2[0]),
5648
+ ...(controlPoints ?? []).map((p2) => p2.x),
5612
5649
  ..._updated.labelBBox ? [_updated.labelBBox.x, _updated.labelBBox.x + _updated.labelBBox.width] : []
5613
5650
  ], allY = [
5614
- ...data.edge.points.map((p) => p[1]),
5615
- ...(controlPoints ?? []).map((p) => p.y),
5651
+ ...data.edge.points.map((p2) => p2[1]),
5652
+ ...(controlPoints ?? []).map((p2) => p2.y),
5616
5653
  ..._updated.labelBBox ? [_updated.labelBBox.y, _updated.labelBBox.y + _updated.labelBBox.height] : []
5617
5654
  ], rect = boxToRect({
5618
5655
  x: Math.floor(Math.min(...allX)),
@@ -5660,9 +5697,9 @@ function createDiagramStore(props2) {
5660
5697
  if (!onNavigateTo)
5661
5698
  return;
5662
5699
  const xynode = xynodes2.find(({ id: id2 }) => id2 === xynodeId);
5663
- invariant(xynode, `xynode not found: ${xynodeId}`);
5700
+ invariant$1(xynode, `xynode not found: ${xynodeId}`);
5664
5701
  const element = view.nodes.find(({ id: id2 }) => id2 === xynodeId);
5665
- invariant(element?.navigateTo, `node is not navigable: ${xynodeId}`), cancelSaveManualLayout(), set(
5702
+ invariant$1(element?.navigateTo, `node is not navigable: ${xynodeId}`), cancelSaveManualLayout(), set(
5666
5703
  {
5667
5704
  lastClickedNodeId: xynodeId,
5668
5705
  lastOnNavigate: {
@@ -5732,7 +5769,7 @@ function createDiagramStore(props2) {
5732
5769
  },
5733
5770
  activateDynamicStep: (nextStep) => {
5734
5771
  const { isDynamicView, xyflow, xystore, fitViewPadding } = get();
5735
- invariant(isDynamicView, "view is not dynamic");
5772
+ invariant$1(isDynamicView, "view is not dynamic");
5736
5773
  const edgeId = StepEdgeId(nextStep), dimmed2 = new StringSet();
5737
5774
  let edge = null;
5738
5775
  for (const e2 of xyflow.getEdges()) {
@@ -5742,7 +5779,7 @@ function createDiagramStore(props2) {
5742
5779
  }
5743
5780
  dimmed2.add(e2.id);
5744
5781
  }
5745
- invariant(!!edge, `edge not found: ${edgeId}`);
5782
+ invariant$1(!!edge, `edge not found: ${edgeId}`);
5746
5783
  const selected = [];
5747
5784
  for (const n2 of xyflow.getNodes()) {
5748
5785
  if (n2.id === edge.source || n2.id === edge.target) {
@@ -5790,6 +5827,13 @@ function createDiagramStore(props2) {
5790
5827
  noReplace,
5791
5828
  "onInit"
5792
5829
  );
5830
+ },
5831
+ highlightByElementNotation: (notation, onlyOfKind) => {
5832
+ const { xynodes: xynodes2, xyedges: xyedges2 } = get(), dimmed2 = new StringSet(m$1(xyedges2, p$1("id")));
5833
+ xynodes2.forEach(({ id: id2, data }) => {
5834
+ const node = data.element;
5835
+ (node.shape !== notation.shape || node.color !== notation.color || !notation.kinds.includes(node.kind) || onlyOfKind && node.kind !== onlyOfKind) && dimmed2.add(id2);
5836
+ }), set({ dimmed: dimmed2 }, noReplace, "highlightByElementNotation");
5793
5837
  }
5794
5838
  }),
5795
5839
  {
@@ -5827,7 +5871,7 @@ function DiagramContextProvider({
5827
5871
  ), useUpdateEffect(
5828
5872
  () => {
5829
5873
  const current = store.current;
5830
- invariant(current, "DiagramContext.store.current is not defined"), deepEqual(whereFilter, current.getState().whereFilter) || current.setState({ whereFilter: structuredClone(whereFilter) }, !1, "update where filter"), current.getState().updateView(view);
5874
+ invariant$1(current, "DiagramContext.store.current is not defined"), deepEqual(whereFilter, current.getState().whereFilter) || current.setState({ whereFilter: structuredClone(whereFilter) }, !1, "update where filter"), current.getState().updateView(view);
5831
5875
  },
5832
5876
  [view, whereFilter],
5833
5877
  (a2, b2) => shallowEqual(a2[0], b2[0]) && deepEqual(a2[1], b2[1])
@@ -5888,7 +5932,7 @@ function FitViewOnViewportResize({ diagramApi }) {
5888
5932
  1e3
5889
5933
  ), null;
5890
5934
  }
5891
- function selector$3({ view, viewportChanged, fitViewPadding }) {
5935
+ function selector$4({ view, viewportChanged, fitViewPadding }) {
5892
5936
  return {
5893
5937
  layoutId: view.id + "_" + view.autoLayout + "_" + fitViewPadding,
5894
5938
  viewportNotMoved: !viewportChanged
@@ -5898,7 +5942,7 @@ function FitViewOnDiagramChange() {
5898
5942
  const {
5899
5943
  layoutId,
5900
5944
  viewportNotMoved
5901
- } = useDiagramState(selector$3, shallowEqual), diagramApi = useDiagramStoreApi(), [currentLayoutId, setCurrent] = useState$1(layoutId), requiresFit = layoutId !== currentLayoutId;
5945
+ } = useDiagramState(selector$4, shallowEqual), diagramApi = useDiagramStoreApi(), [currentLayoutId, setCurrent] = useState$1(layoutId), requiresFit = layoutId !== currentLayoutId;
5902
5946
  return useDebouncedEffect(
5903
5947
  () => {
5904
5948
  layoutId !== currentLayoutId && (setCurrent(layoutId), diagramApi.getState().fitDiagram(450));
@@ -6109,11 +6153,11 @@ Linear.prototype = {
6109
6153
  function curveLinear(context) {
6110
6154
  return new Linear(context);
6111
6155
  }
6112
- function x(p) {
6113
- return p[0];
6156
+ function x(p2) {
6157
+ return p2[0];
6114
6158
  }
6115
- function y(p) {
6116
- return p[1];
6159
+ function y(p2) {
6160
+ return p2[1];
6117
6161
  }
6118
6162
  function d3line(x$1, y$12) {
6119
6163
  var defined = constant(!0), context = null, curve2 = curveLinear, output = null, path = withPath(line);
@@ -6510,7 +6554,7 @@ const curveCatmullRomOpen = function custom4(alpha2) {
6510
6554
  Dot,
6511
6555
  ODot
6512
6556
  };
6513
- var container$4 = "yi2p6v1", dimmed$2 = "yi2p6v2", edgePathBg = "yi2p6v3", markerContext = "yi2p6v4", controlPoint = "yi2p6v5", controlDragging = "yi2p6v6", cssEdgePath = "yi2p6v8", stepEdgeNumber = "yi2p6v9", varLabelX = "var(--yi2p6va)", varLabelY = "var(--yi2p6vb)", edgeLabel = "yi2p6vd", edgeLabelText = "yi2p6ve";
6557
+ var container$5 = "yi2p6v1", dimmed$3 = "yi2p6v2", edgePathBg = "yi2p6v3", markerContext = "yi2p6v4", controlPoint = "yi2p6v5", controlDragging = "yi2p6v6", cssEdgePath = "yi2p6v8", stepEdgeNumber = "yi2p6v9", varLabelX = "var(--yi2p6va)", varLabelY = "var(--yi2p6vb)", edgeLabel = "yi2p6vd", edgeLabelText = "yi2p6ve";
6514
6558
  function getNodeIntersectionFromCenterToPoint(intersectionNode, { x: x1, y: y1 }) {
6515
6559
  const {
6516
6560
  width: intersectionNodeWidth,
@@ -6543,13 +6587,13 @@ const toMarker = (arrowType) => {
6543
6587
  };
6544
6588
  function bezierPath(bezierSpline) {
6545
6589
  let [start, ...points] = bezierSpline;
6546
- invariant(start, "start should be defined");
6590
+ invariant$1(start, "start should be defined");
6547
6591
  let path = `M ${start[0]},${start[1]}`;
6548
6592
  for (; i$3(points, 3); ) {
6549
6593
  const [cp1, cp2, end, ...rest] = points;
6550
6594
  path = path + ` C ${cp1[0]},${cp1[1]} ${cp2[0]},${cp2[1]} ${end[0]},${end[1]}`, points = rest;
6551
6595
  }
6552
- return invariant(points.length === 0, "all points should be consumed"), path;
6596
+ return invariant$1(points.length === 0, "all points should be consumed"), path;
6553
6597
  }
6554
6598
  const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
6555
6599
  const [ax, ay] = n(a2) ? a2 : [a2.x, a2.y], [bx, by] = n(b2) ? b2 : [b2.x, b2.y];
@@ -6573,7 +6617,7 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
6573
6617
  isHovered: s2.hoveredEdgeId === id2,
6574
6618
  isDimmed: s2.dimmed.has(id2),
6575
6619
  hasOpenSourceRelation: !!s2.onOpenSourceRelation
6576
- })), { nodeLookup, edgeLookup } = xyflowStore.getState(), sourceNode = nonNullable(nodeLookup.get(source), `source node ${source} not found`), targetNode = nonNullable(nodeLookup.get(target), `target node ${target} not found`), isModified = n$2(data.controlPoints) || !isSamePoint(sourceNode.internals.positionAbsolute, sourceNode.data.element.position) || !isSamePoint(targetNode.internals.positionAbsolute, targetNode.data.element.position), {
6620
+ })), { nodeLookup, edgeLookup } = xyflowStore.getState(), sourceNode = nonNullable(nodeLookup.get(source), `source node ${source} not found`), targetNode = nonNullable(nodeLookup.get(target), `target node ${target} not found`), isModified = n$1(data.controlPoints) || !isSamePoint(sourceNode.internals.positionAbsolute, sourceNode.data.element.position) || !isSamePoint(targetNode.internals.positionAbsolute, targetNode.data.element.position), {
6577
6621
  label,
6578
6622
  edge: {
6579
6623
  points: diagramEdgePoints,
@@ -6592,7 +6636,7 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
6592
6636
  x: label?.bbox.x ?? labelX,
6593
6637
  y: label?.bbox.y ?? labelY
6594
6638
  });
6595
- let edgePath;
6639
+ let edgePath2;
6596
6640
  if (isModified) {
6597
6641
  const sourceCenterPos = { x: sourceX, y: sourceY }, targetCenterPos = { x: targetX, y: targetY }, points = diagramEdge.dir === "back" ? [
6598
6642
  targetCenterPos,
@@ -6607,9 +6651,9 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
6607
6651
  getNodeIntersectionFromCenterToPoint(targetNode, a$1(controlPoints) ?? sourceCenterPos),
6608
6652
  targetCenterPos
6609
6653
  ];
6610
- edgePath = nonNullable(curve(points));
6654
+ edgePath2 = nonNullable(curve(points));
6611
6655
  } else
6612
- edgePath = bezierPath(diagramEdgePoints);
6656
+ edgePath2 = bezierPath(diagramEdgePoints);
6613
6657
  const svgPathRef = useRef$1(null);
6614
6658
  useEffect$1(() => {
6615
6659
  const path = svgPathRef.current;
@@ -6619,7 +6663,7 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
6619
6663
  y: Math.round(dompoint.y)
6620
6664
  };
6621
6665
  setLabelPosition((current) => isSamePoint(current, point2) ? current : point2);
6622
- }, [edgePath]), useDebouncedEffect(
6666
+ }, [edgePath2]), useDebouncedEffect(
6623
6667
  () => {
6624
6668
  !label || label.bbox.x === labelPos.x && label.bbox.y === labelPos.y || diagramStore.getState().xyflow.updateEdgeData(id2, {
6625
6669
  label: {
@@ -6686,8 +6730,8 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
6686
6730
  "g",
6687
6731
  {
6688
6732
  className: clsx(
6689
- container$4,
6690
- isDimmed && dimmed$2,
6733
+ container$5,
6734
+ isDimmed && dimmed$3,
6691
6735
  isControlPointDragging && controlDragging
6692
6736
  ),
6693
6737
  "data-likec4-color": color2,
@@ -6699,7 +6743,7 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
6699
6743
  "path",
6700
6744
  {
6701
6745
  className: clsx("react-flow__edge-interaction"),
6702
- d: edgePath,
6746
+ d: edgePath2,
6703
6747
  fill: "none",
6704
6748
  stroke: "transparent",
6705
6749
  strokeWidth: interactionWidth ?? 10
@@ -6714,7 +6758,7 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
6714
6758
  "path",
6715
6759
  {
6716
6760
  className: clsx("react-flow__edge-path", edgePathBg),
6717
- d: edgePath,
6761
+ d: edgePath2,
6718
6762
  style,
6719
6763
  strokeLinecap: "round"
6720
6764
  }
@@ -6724,7 +6768,7 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
6724
6768
  {
6725
6769
  ref: svgPathRef,
6726
6770
  className: clsx("react-flow__edge-path", cssEdgePath),
6727
- d: edgePath,
6771
+ d: edgePath2,
6728
6772
  style,
6729
6773
  strokeLinecap: "round",
6730
6774
  strokeDasharray,
@@ -6739,13 +6783,13 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
6739
6783
  onContextMenu: (e2) => {
6740
6784
  e2.preventDefault(), e2.stopPropagation();
6741
6785
  },
6742
- children: controlPoints.map((p, i2) => /* @__PURE__ */ jsx(
6786
+ children: controlPoints.map((p2, i2) => /* @__PURE__ */ jsx(
6743
6787
  "circle",
6744
6788
  {
6745
6789
  onPointerDown: (e2) => onControlPointerDown(i2, e2),
6746
6790
  className: controlPoint,
6747
- cx: p.x,
6748
- cy: p.y,
6791
+ cx: p2.x,
6792
+ cy: p2.y,
6749
6793
  r: 3
6750
6794
  },
6751
6795
  i2
@@ -6795,9 +6839,9 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
6795
6839
  {
6796
6840
  className: clsx([
6797
6841
  "nodrag nopan",
6798
- container$4,
6842
+ container$5,
6799
6843
  edgeLabel,
6800
- isDimmed && dimmed$2
6844
+ isDimmed && dimmed$3
6801
6845
  ]),
6802
6846
  style: {
6803
6847
  ...assignInlineVars({
@@ -6820,12 +6864,12 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
6820
6864
  onClick: onClick || void 0,
6821
6865
  children: [
6822
6866
  stepNum !== null && /* @__PURE__ */ jsx(Box, { className: stepEdgeNumber, children: stepNum }),
6823
- n$2(label?.text) && /* @__PURE__ */ jsx(Box, { className: edgeLabelText, children: label.text })
6867
+ n$1(label?.text) && /* @__PURE__ */ jsx(Box, { className: edgeLabelText, children: label.text })
6824
6868
  ]
6825
6869
  }
6826
6870
  ) });
6827
6871
  /**
6828
- * @license @tabler/icons-react v3.11.0 - MIT
6872
+ * @license @tabler/icons-react v3.12.0 - MIT
6829
6873
  *
6830
6874
  * This source code is licensed under the MIT license.
6831
6875
  * See the LICENSE file in the root directory of this source tree.
@@ -6852,7 +6896,7 @@ var defaultAttributes = {
6852
6896
  }
6853
6897
  };
6854
6898
  /**
6855
- * @license @tabler/icons-react v3.11.0 - MIT
6899
+ * @license @tabler/icons-react v3.12.0 - MIT
6856
6900
  *
6857
6901
  * This source code is licensed under the MIT license.
6858
6902
  * See the LICENSE file in the root directory of this source tree.
@@ -6885,196 +6929,210 @@ const createReactComponent = (type, iconName, iconNamePascal, iconNode) => {
6885
6929
  return Component2.displayName = `${iconNamePascal}`, Component2;
6886
6930
  };
6887
6931
  /**
6888
- * @license @tabler/icons-react v3.11.0 - MIT
6932
+ * @license @tabler/icons-react v3.12.0 - MIT
6889
6933
  *
6890
6934
  * This source code is licensed under the MIT license.
6891
6935
  * See the LICENSE file in the root directory of this source tree.
6892
6936
  */
6893
6937
  var IconAlertTriangle = createReactComponent("outline", "alert-triangle", "IconAlertTriangle", [["path", { d: "M12 9v4", key: "svg-0" }], ["path", { d: "M10.363 3.591l-8.106 13.534a1.914 1.914 0 0 0 1.636 2.871h16.214a1.914 1.914 0 0 0 1.636 -2.87l-8.106 -13.536a1.914 1.914 0 0 0 -3.274 0z", key: "svg-1" }], ["path", { d: "M12 16h.01", key: "svg-2" }]]);
6894
6938
  /**
6895
- * @license @tabler/icons-react v3.11.0 - MIT
6939
+ * @license @tabler/icons-react v3.12.0 - MIT
6896
6940
  *
6897
6941
  * This source code is licensed under the MIT license.
6898
6942
  * See the LICENSE file in the root directory of this source tree.
6899
6943
  */
6900
6944
  var IconArrowBigDownLines = createReactComponent("outline", "arrow-big-down-lines", "IconArrowBigDownLines", [["path", { d: "M15 12h3.586a1 1 0 0 1 .707 1.707l-6.586 6.586a1 1 0 0 1 -1.414 0l-6.586 -6.586a1 1 0 0 1 .707 -1.707h3.586v-3h6v3z", key: "svg-0" }], ["path", { d: "M15 3h-6", key: "svg-1" }], ["path", { d: "M15 6h-6", key: "svg-2" }]]);
6901
6945
  /**
6902
- * @license @tabler/icons-react v3.11.0 - MIT
6946
+ * @license @tabler/icons-react v3.12.0 - MIT
6903
6947
  *
6904
6948
  * This source code is licensed under the MIT license.
6905
6949
  * See the LICENSE file in the root directory of this source tree.
6906
6950
  */
6907
- var IconArrowLeft = createReactComponent("outline", "arrow-left", "IconArrowLeft", [["path", { d: "M5 12l14 0", key: "svg-0" }], ["path", { d: "M5 12l6 6", key: "svg-1" }], ["path", { d: "M5 12l6 -6", key: "svg-2" }]]);
6951
+ var IconArrowDownRight = createReactComponent("outline", "arrow-down-right", "IconArrowDownRight", [["path", { d: "M7 7l10 10", key: "svg-0" }], ["path", { d: "M17 8l0 9l-9 0", key: "svg-1" }]]);
6908
6952
  /**
6909
- * @license @tabler/icons-react v3.11.0 - MIT
6953
+ * @license @tabler/icons-react v3.12.0 - MIT
6910
6954
  *
6911
6955
  * This source code is licensed under the MIT license.
6912
6956
  * See the LICENSE file in the root directory of this source tree.
6913
6957
  */
6914
- var IconBrandReact = createReactComponent("outline", "brand-react", "IconBrandReact", [["path", { d: "M6.306 8.711c-2.602 .723 -4.306 1.926 -4.306 3.289c0 2.21 4.477 4 10 4c.773 0 1.526 -.035 2.248 -.102", key: "svg-0" }], ["path", { d: "M17.692 15.289c2.603 -.722 4.308 -1.926 4.308 -3.289c0 -2.21 -4.477 -4 -10 -4c-.773 0 -1.526 .035 -2.25 .102", key: "svg-1" }], ["path", { d: "M6.305 15.287c-.676 2.615 -.485 4.693 .695 5.373c1.913 1.105 5.703 -1.877 8.464 -6.66c.387 -.67 .733 -1.339 1.036 -2", key: "svg-2" }], ["path", { d: "M17.694 8.716c.677 -2.616 .487 -4.696 -.694 -5.376c-1.913 -1.105 -5.703 1.877 -8.464 6.66c-.387 .67 -.733 1.34 -1.037 2", key: "svg-3" }], ["path", { d: "M12 5.424c-1.925 -1.892 -3.82 -2.766 -5 -2.084c-1.913 1.104 -1.226 5.877 1.536 10.66c.386 .67 .793 1.304 1.212 1.896", key: "svg-4" }], ["path", { d: "M12 18.574c1.926 1.893 3.821 2.768 5 2.086c1.913 -1.104 1.226 -5.877 -1.536 -10.66c-.375 -.65 -.78 -1.283 -1.212 -1.897", key: "svg-5" }], ["path", { d: "M11.5 12.866a1 1 0 1 0 1 -1.732a1 1 0 0 0 -1 1.732z", key: "svg-6" }]]);
6958
+ var IconArrowLeft = createReactComponent("outline", "arrow-left", "IconArrowLeft", [["path", { d: "M5 12l14 0", key: "svg-0" }], ["path", { d: "M5 12l6 6", key: "svg-1" }], ["path", { d: "M5 12l6 -6", key: "svg-2" }]]);
6915
6959
  /**
6916
- * @license @tabler/icons-react v3.11.0 - MIT
6960
+ * @license @tabler/icons-react v3.12.0 - MIT
6917
6961
  *
6918
6962
  * This source code is licensed under the MIT license.
6919
6963
  * See the LICENSE file in the root directory of this source tree.
6920
6964
  */
6921
6965
  var IconCheck = createReactComponent("outline", "check", "IconCheck", [["path", { d: "M5 12l5 5l10 -10", key: "svg-0" }]]);
6922
6966
  /**
6923
- * @license @tabler/icons-react v3.11.0 - MIT
6967
+ * @license @tabler/icons-react v3.12.0 - MIT
6924
6968
  *
6925
6969
  * This source code is licensed under the MIT license.
6926
6970
  * See the LICENSE file in the root directory of this source tree.
6927
6971
  */
6928
6972
  var IconChevronDown = createReactComponent("outline", "chevron-down", "IconChevronDown", [["path", { d: "M6 9l6 6l6 -6", key: "svg-0" }]]);
6929
6973
  /**
6930
- * @license @tabler/icons-react v3.11.0 - MIT
6974
+ * @license @tabler/icons-react v3.12.0 - MIT
6931
6975
  *
6932
6976
  * This source code is licensed under the MIT license.
6933
6977
  * See the LICENSE file in the root directory of this source tree.
6934
6978
  */
6935
6979
  var IconChevronLeft = createReactComponent("outline", "chevron-left", "IconChevronLeft", [["path", { d: "M15 6l-6 6l6 6", key: "svg-0" }]]);
6936
6980
  /**
6937
- * @license @tabler/icons-react v3.11.0 - MIT
6981
+ * @license @tabler/icons-react v3.12.0 - MIT
6938
6982
  *
6939
6983
  * This source code is licensed under the MIT license.
6940
6984
  * See the LICENSE file in the root directory of this source tree.
6941
6985
  */
6942
6986
  var IconChevronRight = createReactComponent("outline", "chevron-right", "IconChevronRight", [["path", { d: "M9 6l6 6l-6 6", key: "svg-0" }]]);
6943
6987
  /**
6944
- * @license @tabler/icons-react v3.11.0 - MIT
6988
+ * @license @tabler/icons-react v3.12.0 - MIT
6945
6989
  *
6946
6990
  * This source code is licensed under the MIT license.
6947
6991
  * See the LICENSE file in the root directory of this source tree.
6948
6992
  */
6949
6993
  var IconCopy = createReactComponent("outline", "copy", "IconCopy", [["path", { d: "M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z", key: "svg-0" }], ["path", { d: "M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1", key: "svg-1" }]]);
6950
6994
  /**
6951
- * @license @tabler/icons-react v3.11.0 - MIT
6995
+ * @license @tabler/icons-react v3.12.0 - MIT
6952
6996
  *
6953
6997
  * This source code is licensed under the MIT license.
6954
6998
  * See the LICENSE file in the root directory of this source tree.
6955
6999
  */
6956
7000
  var IconExternalLink = createReactComponent("outline", "external-link", "IconExternalLink", [["path", { d: "M12 6h-6a2 2 0 0 0 -2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-6", key: "svg-0" }], ["path", { d: "M11 13l9 -9", key: "svg-1" }], ["path", { d: "M15 4h5v5", key: "svg-2" }]]);
6957
7001
  /**
6958
- * @license @tabler/icons-react v3.11.0 - MIT
7002
+ * @license @tabler/icons-react v3.12.0 - MIT
6959
7003
  *
6960
7004
  * This source code is licensed under the MIT license.
6961
7005
  * See the LICENSE file in the root directory of this source tree.
6962
7006
  */
6963
7007
  var IconFileCode = createReactComponent("outline", "file-code", "IconFileCode", [["path", { d: "M14 3v4a1 1 0 0 0 1 1h4", key: "svg-0" }], ["path", { d: "M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z", key: "svg-1" }], ["path", { d: "M10 13l-1 2l1 2", key: "svg-2" }], ["path", { d: "M14 13l1 2l-1 2", key: "svg-3" }]]);
6964
7008
  /**
6965
- * @license @tabler/icons-react v3.11.0 - MIT
7009
+ * @license @tabler/icons-react v3.12.0 - MIT
6966
7010
  *
6967
7011
  * This source code is licensed under the MIT license.
6968
7012
  * See the LICENSE file in the root directory of this source tree.
6969
7013
  */
6970
7014
  var IconFileSymlink = createReactComponent("outline", "file-symlink", "IconFileSymlink", [["path", { d: "M4 21v-4a3 3 0 0 1 3 -3h5", key: "svg-0" }], ["path", { d: "M9 17l3 -3l-3 -3", key: "svg-1" }], ["path", { d: "M14 3v4a1 1 0 0 0 1 1h4", key: "svg-2" }], ["path", { d: "M5 11v-6a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-9.5", key: "svg-3" }]]);
6971
7015
  /**
6972
- * @license @tabler/icons-react v3.11.0 - MIT
7016
+ * @license @tabler/icons-react v3.12.0 - MIT
6973
7017
  *
6974
7018
  * This source code is licensed under the MIT license.
6975
7019
  * See the LICENSE file in the root directory of this source tree.
6976
7020
  */
6977
- var IconFile = createReactComponent("outline", "file", "IconFile", [["path", { d: "M14 3v4a1 1 0 0 0 1 1h4", key: "svg-0" }], ["path", { d: "M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z", key: "svg-1" }]]);
7021
+ var IconFocusCentered = createReactComponent("outline", "focus-centered", "IconFocusCentered", [["path", { d: "M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", key: "svg-0" }], ["path", { d: "M4 8v-2a2 2 0 0 1 2 -2h2", key: "svg-1" }], ["path", { d: "M4 16v2a2 2 0 0 0 2 2h2", key: "svg-2" }], ["path", { d: "M16 4h2a2 2 0 0 1 2 2v2", key: "svg-3" }], ["path", { d: "M16 20h2a2 2 0 0 0 2 -2v-2", key: "svg-4" }]]);
6978
7022
  /**
6979
- * @license @tabler/icons-react v3.11.0 - MIT
7023
+ * @license @tabler/icons-react v3.12.0 - MIT
6980
7024
  *
6981
7025
  * This source code is licensed under the MIT license.
6982
7026
  * See the LICENSE file in the root directory of this source tree.
6983
7027
  */
6984
- var IconFocusCentered = createReactComponent("outline", "focus-centered", "IconFocusCentered", [["path", { d: "M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0", key: "svg-0" }], ["path", { d: "M4 8v-2a2 2 0 0 1 2 -2h2", key: "svg-1" }], ["path", { d: "M4 16v2a2 2 0 0 0 2 2h2", key: "svg-2" }], ["path", { d: "M16 4h2a2 2 0 0 1 2 2v2", key: "svg-3" }], ["path", { d: "M16 20h2a2 2 0 0 0 2 -2v-2", key: "svg-4" }]]);
7028
+ var IconFolderOpen = createReactComponent("outline", "folder-open", "IconFolderOpen", [["path", { d: "M5 19l2.757 -7.351a1 1 0 0 1 .936 -.649h12.307a1 1 0 0 1 .986 1.164l-.996 5.211a2 2 0 0 1 -1.964 1.625h-14.026a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2h4l3 3h7a2 2 0 0 1 2 2v2", key: "svg-0" }]]);
6985
7029
  /**
6986
- * @license @tabler/icons-react v3.11.0 - MIT
7030
+ * @license @tabler/icons-react v3.12.0 - MIT
6987
7031
  *
6988
7032
  * This source code is licensed under the MIT license.
6989
7033
  * See the LICENSE file in the root directory of this source tree.
6990
7034
  */
6991
- var IconFolderOpen = createReactComponent("outline", "folder-open", "IconFolderOpen", [["path", { d: "M5 19l2.757 -7.351a1 1 0 0 1 .936 -.649h12.307a1 1 0 0 1 .986 1.164l-.996 5.211a2 2 0 0 1 -1.964 1.625h-14.026a2 2 0 0 1 -2 -2v-11a2 2 0 0 1 2 -2h4l3 3h7a2 2 0 0 1 2 2v2", key: "svg-0" }]]);
7035
+ var IconHelpCircle = createReactComponent("outline", "help-circle", "IconHelpCircle", [["path", { d: "M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0", key: "svg-0" }], ["path", { d: "M12 16v.01", key: "svg-1" }], ["path", { d: "M12 13a2 2 0 0 0 .914 -3.782a1.98 1.98 0 0 0 -2.414 .483", key: "svg-2" }]]);
6992
7036
  /**
6993
- * @license @tabler/icons-react v3.11.0 - MIT
7037
+ * @license @tabler/icons-react v3.12.0 - MIT
6994
7038
  *
6995
7039
  * This source code is licensed under the MIT license.
6996
7040
  * See the LICENSE file in the root directory of this source tree.
6997
7041
  */
6998
7042
  var IconLayoutDashboard = createReactComponent("outline", "layout-dashboard", "IconLayoutDashboard", [["path", { d: "M5 4h4a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-6a1 1 0 0 1 1 -1", key: "svg-0" }], ["path", { d: "M5 16h4a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-2a1 1 0 0 1 1 -1", key: "svg-1" }], ["path", { d: "M15 12h4a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-6a1 1 0 0 1 1 -1", key: "svg-2" }], ["path", { d: "M15 4h4a1 1 0 0 1 1 1v2a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-2a1 1 0 0 1 1 -1", key: "svg-3" }]]);
6999
7043
  /**
7000
- * @license @tabler/icons-react v3.11.0 - MIT
7044
+ * @license @tabler/icons-react v3.12.0 - MIT
7001
7045
  *
7002
7046
  * This source code is licensed under the MIT license.
7003
7047
  * See the LICENSE file in the root directory of this source tree.
7004
7048
  */
7005
7049
  var IconLink = createReactComponent("outline", "link", "IconLink", [["path", { d: "M9 15l6 -6", key: "svg-0" }], ["path", { d: "M11 6l.463 -.536a5 5 0 0 1 7.071 7.072l-.534 .464", key: "svg-1" }], ["path", { d: "M13 18l-.397 .534a5.068 5.068 0 0 1 -7.127 0a4.972 4.972 0 0 1 0 -7.071l.524 -.463", key: "svg-2" }]]);
7006
7050
  /**
7007
- * @license @tabler/icons-react v3.11.0 - MIT
7051
+ * @license @tabler/icons-react v3.12.0 - MIT
7052
+ *
7053
+ * This source code is licensed under the MIT license.
7054
+ * See the LICENSE file in the root directory of this source tree.
7055
+ */
7056
+ var IconLoader = createReactComponent("outline", "loader", "IconLoader", [["path", { d: "M12 6l0 -3", key: "svg-0" }], ["path", { d: "M16.25 7.75l2.15 -2.15", key: "svg-1" }], ["path", { d: "M18 12l3 0", key: "svg-2" }], ["path", { d: "M16.25 16.25l2.15 2.15", key: "svg-3" }], ["path", { d: "M12 18l0 3", key: "svg-4" }], ["path", { d: "M7.75 16.25l-2.15 2.15", key: "svg-5" }], ["path", { d: "M6 12l-3 0", key: "svg-6" }], ["path", { d: "M7.75 7.75l-2.15 -2.15", key: "svg-7" }]]);
7057
+ /**
7058
+ * @license @tabler/icons-react v3.12.0 - MIT
7008
7059
  *
7009
7060
  * This source code is licensed under the MIT license.
7010
7061
  * See the LICENSE file in the root directory of this source tree.
7011
7062
  */
7012
7063
  var IconMenu2 = createReactComponent("outline", "menu-2", "IconMenu2", [["path", { d: "M4 6l16 0", key: "svg-0" }], ["path", { d: "M4 12l16 0", key: "svg-1" }], ["path", { d: "M4 18l16 0", key: "svg-2" }]]);
7013
7064
  /**
7014
- * @license @tabler/icons-react v3.11.0 - MIT
7065
+ * @license @tabler/icons-react v3.12.0 - MIT
7015
7066
  *
7016
7067
  * This source code is licensed under the MIT license.
7017
7068
  * See the LICENSE file in the root directory of this source tree.
7018
7069
  */
7019
7070
  var IconMenu = createReactComponent("outline", "menu", "IconMenu", [["path", { d: "M4 8l16 0", key: "svg-0" }], ["path", { d: "M4 16l16 0", key: "svg-1" }]]);
7020
7071
  /**
7021
- * @license @tabler/icons-react v3.11.0 - MIT
7072
+ * @license @tabler/icons-react v3.12.0 - MIT
7022
7073
  *
7023
7074
  * This source code is licensed under the MIT license.
7024
7075
  * See the LICENSE file in the root directory of this source tree.
7025
7076
  */
7026
7077
  var IconMoonStars = createReactComponent("outline", "moon-stars", "IconMoonStars", [["path", { d: "M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z", key: "svg-0" }], ["path", { d: "M17 4a2 2 0 0 0 2 2a2 2 0 0 0 -2 2a2 2 0 0 0 -2 -2a2 2 0 0 0 2 -2", key: "svg-1" }], ["path", { d: "M19 11h2m-1 -1v2", key: "svg-2" }]]);
7027
7078
  /**
7028
- * @license @tabler/icons-react v3.11.0 - MIT
7079
+ * @license @tabler/icons-react v3.12.0 - MIT
7029
7080
  *
7030
7081
  * This source code is licensed under the MIT license.
7031
7082
  * See the LICENSE file in the root directory of this source tree.
7032
7083
  */
7033
7084
  var IconShare = createReactComponent("outline", "share", "IconShare", [["path", { d: "M6 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0", key: "svg-0" }], ["path", { d: "M18 6m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0", key: "svg-1" }], ["path", { d: "M18 18m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0", key: "svg-2" }], ["path", { d: "M8.7 10.7l6.6 -3.4", key: "svg-3" }], ["path", { d: "M8.7 13.3l6.6 3.4", key: "svg-4" }]]);
7034
7085
  /**
7035
- * @license @tabler/icons-react v3.11.0 - MIT
7086
+ * @license @tabler/icons-react v3.12.0 - MIT
7036
7087
  *
7037
7088
  * This source code is licensed under the MIT license.
7038
7089
  * See the LICENSE file in the root directory of this source tree.
7039
7090
  */
7040
7091
  var IconSun = createReactComponent("outline", "sun", "IconSun", [["path", { d: "M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0", key: "svg-0" }], ["path", { d: "M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7", key: "svg-1" }]]);
7041
7092
  /**
7042
- * @license @tabler/icons-react v3.11.0 - MIT
7093
+ * @license @tabler/icons-react v3.12.0 - MIT
7043
7094
  *
7044
7095
  * This source code is licensed under the MIT license.
7045
7096
  * See the LICENSE file in the root directory of this source tree.
7046
7097
  */
7047
7098
  var IconZoomScan = createReactComponent("outline", "zoom-scan", "IconZoomScan", [["path", { d: "M4 8v-2a2 2 0 0 1 2 -2h2", key: "svg-0" }], ["path", { d: "M4 16v2a2 2 0 0 0 2 2h2", key: "svg-1" }], ["path", { d: "M16 4h2a2 2 0 0 1 2 2v2", key: "svg-2" }], ["path", { d: "M16 20h2a2 2 0 0 0 2 -2v-2", key: "svg-3" }], ["path", { d: "M8 11a3 3 0 1 0 6 0a3 3 0 0 0 -6 0", key: "svg-4" }], ["path", { d: "M16 16l-2.5 -2.5", key: "svg-5" }]]);
7048
7099
  /**
7049
- * @license @tabler/icons-react v3.11.0 - MIT
7100
+ * @license @tabler/icons-react v3.12.0 - MIT
7101
+ *
7102
+ * This source code is licensed under the MIT license.
7103
+ * See the LICENSE file in the root directory of this source tree.
7104
+ */
7105
+ var IconFileFilled = createReactComponent("filled", "file-filled", "IconFileFilled", [["path", { d: "M12 2l.117 .007a1 1 0 0 1 .876 .876l.007 .117v4l.005 .15a2 2 0 0 0 1.838 1.844l.157 .006h4l.117 .007a1 1 0 0 1 .876 .876l.007 .117v9a3 3 0 0 1 -2.824 2.995l-.176 .005h-10a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-14a3 3 0 0 1 2.824 -2.995l.176 -.005h5z", key: "svg-0" }], ["path", { d: "M19 7h-4l-.001 -4.001z", key: "svg-1" }]]);
7106
+ /**
7107
+ * @license @tabler/icons-react v3.12.0 - MIT
7050
7108
  *
7051
7109
  * This source code is licensed under the MIT license.
7052
7110
  * See the LICENSE file in the root directory of this source tree.
7053
7111
  */
7054
7112
  var IconFolderFilled = createReactComponent("filled", "folder-filled", "IconFolderFilled", [["path", { d: "M9 3a1 1 0 0 1 .608 .206l.1 .087l2.706 2.707h6.586a3 3 0 0 1 2.995 2.824l.005 .176v8a3 3 0 0 1 -2.824 2.995l-.176 .005h-14a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-11a3 3 0 0 1 2.824 -2.995l.176 -.005h4z", key: "svg-0" }]]);
7055
7113
  /**
7056
- * @license @tabler/icons-react v3.11.0 - MIT
7114
+ * @license @tabler/icons-react v3.12.0 - MIT
7057
7115
  *
7058
7116
  * This source code is licensed under the MIT license.
7059
7117
  * See the LICENSE file in the root directory of this source tree.
7060
7118
  */
7061
7119
  var IconPlayerPlayFilled = createReactComponent("filled", "player-play-filled", "IconPlayerPlayFilled", [["path", { d: "M6 4v16a1 1 0 0 0 1.524 .852l13 -8a1 1 0 0 0 0 -1.704l-13 -8a1 1 0 0 0 -1.524 .852z", key: "svg-0" }]]);
7062
7120
  /**
7063
- * @license @tabler/icons-react v3.11.0 - MIT
7121
+ * @license @tabler/icons-react v3.12.0 - MIT
7064
7122
  *
7065
7123
  * This source code is licensed under the MIT license.
7066
7124
  * See the LICENSE file in the root directory of this source tree.
7067
7125
  */
7068
7126
  var IconPlayerSkipBackFilled = createReactComponent("filled", "player-skip-back-filled", "IconPlayerSkipBackFilled", [["path", { d: "M19.496 4.136l-12 7a1 1 0 0 0 0 1.728l12 7a1 1 0 0 0 1.504 -.864v-14a1 1 0 0 0 -1.504 -.864z", key: "svg-0" }], ["path", { d: "M4 4a1 1 0 0 1 .993 .883l.007 .117v14a1 1 0 0 1 -1.993 .117l-.007 -.117v-14a1 1 0 0 1 1 -1z", key: "svg-1" }]]);
7069
7127
  /**
7070
- * @license @tabler/icons-react v3.11.0 - MIT
7128
+ * @license @tabler/icons-react v3.12.0 - MIT
7071
7129
  *
7072
7130
  * This source code is licensed under the MIT license.
7073
7131
  * See the LICENSE file in the root directory of this source tree.
7074
7132
  */
7075
7133
  var IconPlayerSkipForwardFilled = createReactComponent("filled", "player-skip-forward-filled", "IconPlayerSkipForwardFilled", [["path", { d: "M3 5v14a1 1 0 0 0 1.504 .864l12 -7a1 1 0 0 0 0 -1.728l-12 -7a1 1 0 0 0 -1.504 .864z", key: "svg-0" }], ["path", { d: "M20 4a1 1 0 0 1 .993 .883l.007 .117v14a1 1 0 0 1 -1.993 .117l-.007 -.117v-14a1 1 0 0 1 1 -1z", key: "svg-1" }]]);
7076
7134
  /**
7077
- * @license @tabler/icons-react v3.11.0 - MIT
7135
+ * @license @tabler/icons-react v3.12.0 - MIT
7078
7136
  *
7079
7137
  * This source code is licensed under the MIT license.
7080
7138
  * See the LICENSE file in the root directory of this source tree.
@@ -7091,6 +7149,7 @@ function NavigateToBtn({ xynodeId, className }) {
7091
7149
  onClick: (event) => {
7092
7150
  event.stopPropagation(), diagramApi.getState().triggerOnNavigateTo(xynodeId, event);
7093
7151
  },
7152
+ role: "button",
7094
7153
  onDoubleClick: (event) => event.stopPropagation(),
7095
7154
  children: /* @__PURE__ */ jsx(
7096
7155
  IconZoomScan,
@@ -7104,7 +7163,7 @@ function NavigateToBtn({ xynodeId, className }) {
7104
7163
  }
7105
7164
  );
7106
7165
  }
7107
- var container$3 = "c3cfh00", nodeHandlerInCenter = "c3cfh01", dimmed$1 = "c3cfh02", varOpacity = "var(--c3cfh03)", varBorderTransparency = "var(--c3cfh04)", compoundBody = "c3cfh05", transparent = "c3cfh07", title$2 = "c3cfh08", titleWithNavigation = "c3cfh09", indicator$1 = "c3cfh0d", navigateBtn = "c3cfh0f";
7166
+ var container$4 = "c3cfh00", nodeHandlerInCenter = "c3cfh01", dimmed$2 = "c3cfh02", varOpacity = "var(--c3cfh03)", varBorderTransparency = "var(--c3cfh04)", compoundBody = "c3cfh05", transparent = "c3cfh07", title$2 = "c3cfh08", titleWithNavigation = "c3cfh09", indicator$1 = "c3cfh0d", navigateBtn = "c3cfh0f";
7108
7167
  const isEqualProps$1 = (prev, next) => prev.id === next.id && deepEqual(prev.data.element, next.data.element), CompoundNodeMemo = /* @__PURE__ */ memo$1(function({
7109
7168
  id: id2,
7110
7169
  data: {
@@ -7135,10 +7194,10 @@ const isEqualProps$1 = (prev, next) => prev.id === next.id && deepEqual(prev.dat
7135
7194
  Box,
7136
7195
  {
7137
7196
  className: clsx(
7138
- container$3,
7197
+ container$4,
7139
7198
  "likec4-compound-node",
7140
7199
  opacity < 1 && "likec4-compound-transparent",
7141
- isDimmed && dimmed$1
7200
+ isDimmed && dimmed$2
7142
7201
  ),
7143
7202
  mod: {
7144
7203
  "compound-depth": depth,
@@ -7199,16 +7258,16 @@ const isEqualProps$1 = (prev, next) => prev.id === next.id && deepEqual(prev.dat
7199
7258
  )
7200
7259
  ] });
7201
7260
  }, isEqualProps$1);
7202
- var container$2 = "_14ylloj1", handleCenter = "_14ylloj2", containerAnimated = "_14ylloj3", dimmed = "_14ylloj4", indicator = "_14ylloj7", fillElementFill = "_14ylloj8", fillMixStroke = "_14ylloja", hasIcon = "_14yllojb", title$1 = "_14ylloje", description$1 = "_14yllojf", technology = "_14yllojg", elementDataContainer = "_14yllojh", elementTextData = "_14ylloji", elementIcon = "_14yllojj", cssShapeSvg = "_14yllojm", cssNavigateBtn = "_14yllojn", elementLink = "_1s87wm0", trigger = "_1s87wm1";
7203
- const selector$2 = (s2) => {
7261
+ var container$3 = "_14ylloj1", handleCenter$1 = "_14ylloj2", containerAnimated = "_14ylloj3", dimmed$1 = "_14ylloj4", indicator = "_14ylloj7", fillElementFill = "_14ylloj8", fillMixStroke = "_14ylloja", hasIcon = "_14yllojb", title$1 = "_14ylloje", description$1 = "_14yllojf", technology = "_14yllojg", elementDataContainer = "_14yllojh", elementTextData = "_14ylloji", elementIcon = "_14yllojj", cssShapeSvg = "_14yllojm", cssNavigateBtn = "_14yllojn", elementLink = "_1s87wm0", trigger = "_1s87wm1";
7262
+ const selector$3 = (s2) => {
7204
7263
  const target = s2.getContainer();
7205
7264
  return target ? { target } : null;
7206
7265
  };
7207
7266
  function ElementLink({
7208
7267
  element
7209
7268
  }) {
7210
- invariant(element.links, "ElementLink: links are required");
7211
- const id2 = useId$1(), portalProps = useDiagramState(selector$2);
7269
+ invariant$1(element.links, "ElementLink: links are required");
7270
+ const id2 = useId$1(), portalProps = useDiagramState(selector$3);
7212
7271
  return /* @__PURE__ */ jsx("div", { className: elementLink, "data-likec4-linkid": id2, children: /* @__PURE__ */ jsxs(
7213
7272
  HoverCard,
7214
7273
  {
@@ -7248,8 +7307,8 @@ function ElementLink({
7248
7307
  onClick: (e2) => e2.stopPropagation(),
7249
7308
  p: "xs",
7250
7309
  children: /* @__PURE__ */ jsx(Stack, { gap: "xs", children: element.links.map((link) => /* @__PURE__ */ jsxs(Group, { wrap: "nowrap", gap: "sm", children: [
7251
- /* @__PURE__ */ jsx(Box, { flex: "1", style: { overflow: "clip", maxWidth: u(element.width, { min: 200, max: 400 }) }, children: /* @__PURE__ */ jsx(Anchor, { href: link, target: "_blank", fz: "13", truncate: "end", children: link }) }),
7252
- /* @__PURE__ */ jsx(CopyButton$1, { value: link, children: ({ copied, copy }) => /* @__PURE__ */ jsx(
7310
+ /* @__PURE__ */ jsx(Box, { flex: "1", style: { overflow: "clip", maxWidth: u(element.width, { min: 200, max: 400 }) }, children: /* @__PURE__ */ jsx(Anchor, { href: link.url, target: "_blank", fz: "13", truncate: "end", children: link.title || link.url }) }),
7311
+ /* @__PURE__ */ jsx(CopyButton$1, { value: link.url, children: ({ copied, copy }) => /* @__PURE__ */ jsx(
7253
7312
  Button,
7254
7313
  {
7255
7314
  size: "compact-xs",
@@ -7260,7 +7319,7 @@ function ElementLink({
7260
7319
  children: copied ? "copied" : "copy"
7261
7320
  }
7262
7321
  ) })
7263
- ] }, link)) })
7322
+ ] }, link.url)) })
7264
7323
  }
7265
7324
  )
7266
7325
  ]
@@ -7503,7 +7562,7 @@ const Text = Text$1.withProps({
7503
7562
  {
7504
7563
  type: "target",
7505
7564
  position: Position.Top,
7506
- className: handleCenter
7565
+ className: handleCenter$1
7507
7566
  }
7508
7567
  ),
7509
7568
  /* @__PURE__ */ jsxs(
@@ -7511,8 +7570,8 @@ const Text = Text$1.withProps({
7511
7570
  {
7512
7571
  id: id2,
7513
7572
  className: clsx([
7514
- container$2,
7515
- isDimmed && dimmed,
7573
+ container$3,
7574
+ isDimmed && dimmed$1,
7516
7575
  animate !== "idle" && containerAnimated,
7517
7576
  "likec4-element-node"
7518
7577
  ]),
@@ -7560,7 +7619,7 @@ const Text = Text$1.withProps({
7560
7619
  {
7561
7620
  className: clsx(
7562
7621
  elementDataContainer,
7563
- n$2(elementIcon2) && hasIcon,
7622
+ n$1(elementIcon2) && hasIcon,
7564
7623
  "likec4-element"
7565
7624
  ),
7566
7625
  children: [
@@ -7601,7 +7660,7 @@ const Text = Text$1.withProps({
7601
7660
  {
7602
7661
  type: "source",
7603
7662
  position: Position.Top,
7604
- className: handleCenter
7663
+ className: handleCenter$1
7605
7664
  }
7606
7665
  )
7607
7666
  ] });
@@ -7974,9 +8033,9 @@ class Strength {
7974
8033
  * @param [w] weight
7975
8034
  * @return strength
7976
8035
  */
7977
- static create(a2, b2, c, w = 1) {
8036
+ static create(a2, b2, c2, w = 1) {
7978
8037
  let result = 0;
7979
- return result += Math.max(0, Math.min(1e3, a2 * w)) * 1e6, result += Math.max(0, Math.min(1e3, b2 * w)) * 1e3, result += Math.max(0, Math.min(1e3, c * w)), result;
8038
+ return result += Math.max(0, Math.min(1e3, a2 * w)) * 1e6, result += Math.max(0, Math.min(1e3, b2 * w)) * 1e3, result += Math.max(0, Math.min(1e3, c2 * w)), result;
7980
8039
  }
7981
8040
  /**
7982
8041
  * The 'required' symbolic strength.
@@ -8198,9 +8257,9 @@ class Solver {
8198
8257
  * Update the values of the variables.
8199
8258
  */
8200
8259
  updateVariables() {
8201
- let vars = this._varMap, rows = this._rowMap;
8202
- for (let i2 = 0, n2 = vars.size(); i2 < n2; ++i2) {
8203
- let pair = vars.itemAt(i2), rowPair = rows.find(pair.second);
8260
+ let vars2 = this._varMap, rows = this._rowMap;
8261
+ for (let i2 = 0, n2 = vars2.size(); i2 < n2; ++i2) {
8262
+ let pair = vars2.itemAt(i2), rowPair = rows.find(pair.second);
8204
8263
  rowPair !== void 0 ? pair.first.setValue(rowPair.second.constant()) : pair.first.setValue(0);
8205
8264
  }
8206
8265
  }
@@ -8411,9 +8470,9 @@ class Solver {
8411
8470
  _getDualEnteringSymbol(row) {
8412
8471
  let ratio = Number.MAX_VALUE, entering = INVALID_SYMBOL, cells = row.cells();
8413
8472
  for (let i2 = 0, n2 = cells.size(); i2 < n2; ++i2) {
8414
- let pair = cells.itemAt(i2), symbol = pair.first, c = pair.second;
8415
- if (c > 0 && symbol.type() !== SymbolType.Dummy) {
8416
- let r2 = this._objective.coefficientFor(symbol) / c;
8473
+ let pair = cells.itemAt(i2), symbol = pair.first, c2 = pair.second;
8474
+ if (c2 > 0 && symbol.type() !== SymbolType.Dummy) {
8475
+ let r2 = this._objective.coefficientFor(symbol) / c2;
8417
8476
  r2 < ratio && (ratio = r2, entering = symbol);
8418
8477
  }
8419
8478
  }
@@ -8467,17 +8526,17 @@ class Solver {
8467
8526
  _getMarkerLeavingSymbol(marker) {
8468
8527
  let dmax = Number.MAX_VALUE, r1 = dmax, r2 = dmax, invalid = INVALID_SYMBOL, first = invalid, second = invalid, third = invalid, rows = this._rowMap;
8469
8528
  for (let i2 = 0, n2 = rows.size(); i2 < n2; ++i2) {
8470
- let pair = rows.itemAt(i2), row = pair.second, c = row.coefficientFor(marker);
8471
- if (c === 0)
8529
+ let pair = rows.itemAt(i2), row = pair.second, c2 = row.coefficientFor(marker);
8530
+ if (c2 === 0)
8472
8531
  continue;
8473
8532
  let symbol = pair.first;
8474
8533
  if (symbol.type() === SymbolType.External)
8475
8534
  third = symbol;
8476
- else if (c < 0) {
8477
- let r3 = -row.constant() / c;
8535
+ else if (c2 < 0) {
8536
+ let r3 = -row.constant() / c2;
8478
8537
  r3 < r1 && (r1 = r3, first = symbol);
8479
8538
  } else {
8480
- let r3 = row.constant() / c;
8539
+ let r3 = row.constant() / c2;
8481
8540
  r3 < r2 && (r2 = r3, second = symbol);
8482
8541
  }
8483
8542
  }
@@ -8862,7 +8921,7 @@ function useLayoutConstraints() {
8862
8921
  cancelSaveManualLayout(), solverRef.current = createLayoutConstraints(xystore, xynode.id);
8863
8922
  },
8864
8923
  onNodeDrag: (_event, xynode) => {
8865
- invariant(solverRef.current, "solverRef.current should be defined"), solverRef.current?.onNodeDrag(xynode);
8924
+ invariant$1(solverRef.current, "solverRef.current should be defined"), solverRef.current?.onNodeDrag(xynode);
8866
8925
  },
8867
8926
  onNodeDragStop: (_event, _xynode) => {
8868
8927
  diagramApi.getState().scheduleSaveManualLayout(), solverRef.current = void 0;
@@ -8879,10 +8938,13 @@ function useXYFlowEvents() {
8879
8938
  onDoubleClick: (event) => {
8880
8939
  const {
8881
8940
  onCanvasDblClick,
8941
+ zoomable,
8882
8942
  xystore,
8943
+ viewportChanged,
8944
+ fitDiagram,
8883
8945
  resetLastClicked
8884
8946
  } = diagramApi.getState();
8885
- resetLastClicked(), xystore.getState().resetSelectedElements(), onCanvasDblClick || event.stopPropagation(), onCanvasDblClick?.(event);
8947
+ resetLastClicked(), xystore.getState().resetSelectedElements(), onCanvasDblClick || event.stopPropagation(), zoomable && viewportChanged && fitDiagram(), onCanvasDblClick?.(event);
8886
8948
  },
8887
8949
  onPaneClick: (event) => {
8888
8950
  if (dbclickLock())
@@ -8981,7 +9043,7 @@ function useXYFlowEvents() {
8981
9043
  setLastClickedEdge
8982
9044
  } = diagramApi.getState();
8983
9045
  lastClickedEdgeId !== xyedge.id && setLastClickedEdge(xyedge.id);
8984
- const isNotAFirstClick = lastClickedEdgeId === xyedge.id, isEdgeOfFocusedNode = n$2(focusedNodeId) && (focusedNodeId === xyedge.source || focusedNodeId === xyedge.target);
9046
+ const isNotAFirstClick = lastClickedEdgeId === xyedge.id, isEdgeOfFocusedNode = n$1(focusedNodeId) && (focusedNodeId === xyedge.source || focusedNodeId === xyedge.target);
8985
9047
  if (isDynamicView && enableDynamicViewWalkthrough && (isEdgeOfFocusedNode || isNotAFirstClick || l(activeDynamicViewStep))) {
8986
9048
  const nextStep = extractStep(xyedge.data.edge.id);
8987
9049
  if (activeDynamicViewStep !== nextStep) {
@@ -9040,12 +9102,12 @@ function useXYFlowEvents() {
9040
9102
  };
9041
9103
  }, [diagramApi]);
9042
9104
  }
9043
- const nodeTypes = {
9105
+ const nodeTypes$1 = {
9044
9106
  element: ElementNodeMemo,
9045
9107
  compound: CompoundNodeMemo
9046
- }, edgeTypes = {
9108
+ }, edgeTypes$1 = {
9047
9109
  relationship: RelationshipEdge
9048
- }, selector$1 = (s2) => ({
9110
+ }, selector$2 = (s2) => ({
9049
9111
  nodes: s2.xynodes,
9050
9112
  edges: s2.xyedges,
9051
9113
  onInit: s2.onInit,
@@ -9093,11 +9155,11 @@ function XYFlow({
9093
9155
  hasOnEdgeContextMenu,
9094
9156
  translateX,
9095
9157
  translateY
9096
- } = useDiagramState(selector$1, shallowEqual), layoutConstraints = useLayoutConstraints(), handlers = useXYFlowEvents();
9158
+ } = useDiagramState(selector$2, shallowEqual), [zoomOnDoubleClick, setZoomOnDoubleClick] = useState$1(zoomable), layoutConstraints = useLayoutConstraints(), handlers = useXYFlowEvents();
9097
9159
  return useOnViewportChange({
9098
9160
  onEnd: ({ x: x2, y: y2, zoom }) => {
9099
9161
  const roundedX = Math.round(x2), roundedY = Math.round(y2);
9100
- (x2 !== roundedX || y2 !== roundedY) && xyflowApi.setState({ transform: [roundedX, roundedY, zoom] });
9162
+ (x2 !== roundedX || y2 !== roundedY) && xyflowApi.setState({ transform: [roundedX, roundedY, zoom] }), setZoomOnDoubleClick(zoomable && zoom < 1.1);
9101
9163
  }
9102
9164
  }), /* @__PURE__ */ jsx(
9103
9165
  index,
@@ -9107,14 +9169,14 @@ function XYFlow({
9107
9169
  ...colorMode && { colorMode },
9108
9170
  nodes,
9109
9171
  edges,
9110
- nodeTypes,
9111
- edgeTypes,
9172
+ nodeTypes: nodeTypes$1,
9173
+ edgeTypes: edgeTypes$1,
9112
9174
  zoomOnPinch: zoomable,
9113
9175
  zoomOnScroll: !pannable && zoomable,
9114
9176
  ...!zoomable && {
9115
9177
  zoomActivationKeyCode: null
9116
9178
  },
9117
- maxZoom: zoomable ? 1.9 : 1,
9179
+ maxZoom: zoomable ? MaxZoom : 1,
9118
9180
  minZoom: zoomable ? MinZoom : 1,
9119
9181
  fitView,
9120
9182
  fitViewOptions: useMemo$1(() => ({
@@ -9149,7 +9211,7 @@ function XYFlow({
9149
9211
  onNodeDragStop: layoutConstraints.onNodeDragStop
9150
9212
  },
9151
9213
  nodeDragThreshold: 3,
9152
- zoomOnDoubleClick: zoomable,
9214
+ zoomOnDoubleClick,
9153
9215
  elevateNodesOnSelect: !1,
9154
9216
  selectNodesOnDrag: !1,
9155
9217
  onNodesChange,
@@ -9179,15 +9241,15 @@ function XYFlow({
9179
9241
  }
9180
9242
  );
9181
9243
  }
9182
- var container$1 = "_19ci0hj0", card = "_19ci0hj1", title = "_19ci0hj2", description = "_19ci0hj3";
9183
- const selector = (s2) => ({
9244
+ var container$2 = "_19ci0hj0", card$1 = "_19ci0hj1", title = "_19ci0hj2", description = "_19ci0hj3";
9245
+ const selector$1 = (s2) => ({
9184
9246
  id: s2.view.id,
9185
9247
  title: s2.view.title ?? "untitled",
9186
9248
  description: s2.view.description,
9187
9249
  links: s2.view.links
9188
9250
  });
9189
9251
  function DiagramTitlePanel() {
9190
- const { id: id2, title: title$12, description: description$12, links } = useDiagramState(selector), [isCollapsed, setCollapsed] = useLocalStorage({
9252
+ const { id: id2, title: title$12, description: description$12, links } = useDiagramState(selector$1), [isCollapsed, setCollapsed] = useLocalStorage({
9191
9253
  key: "diagram-title-panel-collapsed",
9192
9254
  defaultValue: !1
9193
9255
  }), toggle = () => setCollapsed((v) => !v);
@@ -9200,7 +9262,7 @@ function DiagramTitlePanel() {
9200
9262
  opacity: 0.05,
9201
9263
  scale: 0.6
9202
9264
  },
9203
- className: clsx("react-flow__panel", container$1),
9265
+ className: clsx("react-flow__panel", container$2),
9204
9266
  style: {
9205
9267
  transformOrigin: "left center"
9206
9268
  },
@@ -9208,64 +9270,78 @@ function DiagramTitlePanel() {
9208
9270
  Card,
9209
9271
  {
9210
9272
  radius: "sm",
9211
- className: card,
9212
- withBorder: !0,
9213
- p: "md",
9214
- pb: isCollapsed ? "sm" : "md",
9273
+ className: card$1,
9274
+ withBorder: !isCollapsed,
9275
+ p: isCollapsed ? "sm" : "md",
9215
9276
  onDoubleClick: (e2) => e2.stopPropagation(),
9216
9277
  children: [
9217
- /* @__PURE__ */ jsx(CardSection, { mb: isCollapsed ? 10 : "sm", children: /* @__PURE__ */ jsx(
9278
+ isCollapsed && /* @__PURE__ */ jsx(CardSection, { children: /* @__PURE__ */ jsx(
9218
9279
  Button,
9219
9280
  {
9220
9281
  fullWidth: !0,
9221
- size: "xs",
9222
- h: "sm",
9223
- py: 2,
9282
+ justify: "stretch",
9283
+ size: "md",
9224
9284
  radius: "0",
9225
- variant: isCollapsed ? "light" : "subtle",
9285
+ variant: "subtle",
9226
9286
  color: "gray",
9227
9287
  onClick: toggle,
9228
- children: /* @__PURE__ */ jsx(IconMenu, { size: 11, opacity: 0.7 })
9288
+ fw: 500,
9289
+ fz: "sm",
9290
+ children: title$12
9229
9291
  }
9230
9292
  ) }),
9231
- /* @__PURE__ */ jsxs(Group, { justify: "stretch", wrap: "nowrap", mb: isCollapsed ? 0 : "sm", children: [
9232
- /* @__PURE__ */ jsx(
9233
- Text$1,
9234
- {
9235
- component: "div",
9236
- flex: "1",
9237
- size: isCollapsed ? "sm" : "lg",
9238
- fw: 500,
9239
- lh: 1.1,
9240
- className: title,
9241
- children: title$12
9242
- }
9243
- ),
9244
- /* @__PURE__ */ jsxs(
9245
- Text$1,
9293
+ !isCollapsed && /* @__PURE__ */ jsxs(Fragment, { children: [
9294
+ /* @__PURE__ */ jsx(CardSection, { mb: "xs", children: /* @__PURE__ */ jsx(
9295
+ Button,
9246
9296
  {
9247
- hidden: isCollapsed,
9248
- component: "div",
9249
- flex: "0 0 auto",
9250
- inline: !0,
9297
+ fullWidth: !0,
9251
9298
  size: "xs",
9252
- fz: 9,
9253
- fw: 500,
9254
- c: "dimmed",
9255
- style: {
9256
- userSelect: "all"
9257
- },
9258
- children: [
9259
- /* @__PURE__ */ jsxs("span", { style: { userSelect: "none" }, children: [
9260
- "id:",
9261
- " "
9262
- ] }),
9263
- id2
9264
- ]
9299
+ h: "sm",
9300
+ py: 2,
9301
+ radius: "0",
9302
+ variant: "subtle",
9303
+ color: "gray",
9304
+ onClick: toggle,
9305
+ children: /* @__PURE__ */ jsx(IconMenu, { size: 11, opacity: 0.7 })
9265
9306
  }
9266
- )
9267
- ] }),
9268
- !isCollapsed && /* @__PURE__ */ jsxs(Fragment, { children: [
9307
+ ) }),
9308
+ /* @__PURE__ */ jsxs(Group, { justify: "stretch", wrap: "nowrap", mb: "sm", children: [
9309
+ /* @__PURE__ */ jsx(
9310
+ Text$1,
9311
+ {
9312
+ component: "div",
9313
+ flex: "1",
9314
+ size: "md",
9315
+ fw: 500,
9316
+ lh: 1.1,
9317
+ className: title,
9318
+ children: title$12
9319
+ }
9320
+ ),
9321
+ /* @__PURE__ */ jsxs(
9322
+ Text$1,
9323
+ {
9324
+ hidden: isCollapsed,
9325
+ component: "div",
9326
+ flex: "0 0 auto",
9327
+ inline: !0,
9328
+ size: "xs",
9329
+ fz: 9,
9330
+ fw: 500,
9331
+ c: "dimmed",
9332
+ style: {
9333
+ userSelect: "all"
9334
+ },
9335
+ children: [
9336
+ /* @__PURE__ */ jsxs("span", { style: { userSelect: "none" }, children: [
9337
+ "id:",
9338
+ " "
9339
+ ] }),
9340
+ id2
9341
+ ]
9342
+ }
9343
+ )
9344
+ ] }),
9269
9345
  description$12 && /* @__PURE__ */ jsx(
9270
9346
  Spoiler,
9271
9347
  {
@@ -9302,16 +9378,16 @@ function DiagramTitlePanel() {
9302
9378
  /* @__PURE__ */ jsx(Box, { flex: "1", style: { overflow: "hidden" }, children: /* @__PURE__ */ jsx(
9303
9379
  Anchor,
9304
9380
  {
9305
- href: link,
9381
+ href: link.url,
9306
9382
  target: "_blank",
9307
9383
  fz: "xs",
9308
9384
  truncate: "end",
9309
9385
  display: "inline-block",
9310
9386
  w: "100%",
9311
- children: link
9387
+ children: link.title || link.url
9312
9388
  }
9313
9389
  ) }),
9314
- /* @__PURE__ */ jsx(CopyButton$1, { value: link, children: ({ copied, copy }) => /* @__PURE__ */ jsx(
9390
+ /* @__PURE__ */ jsx(CopyButton$1, { value: link.url, children: ({ copied, copy }) => /* @__PURE__ */ jsx(
9315
9391
  Button,
9316
9392
  {
9317
9393
  size: "compact-xs",
@@ -9322,7 +9398,7 @@ function DiagramTitlePanel() {
9322
9398
  children: copied ? "copied" : "copy"
9323
9399
  }
9324
9400
  ) })
9325
- ] }, link))
9401
+ ] }, link.url))
9326
9402
  }
9327
9403
  )
9328
9404
  ] })
@@ -9333,7 +9409,7 @@ function DiagramTitlePanel() {
9333
9409
  id2
9334
9410
  ) });
9335
9411
  }
9336
- var container = "h3ljtj0", buttons = "h3ljtj1", btn = "h3ljtj3";
9412
+ var container$1 = "h3ljtj0", buttons = "h3ljtj1", btn = "h3ljtj3";
9337
9413
  function DynamicViewWalkthrough() {
9338
9414
  const isMobile = useXYStore((s2) => s2.width <= 750), {
9339
9415
  nextDynamicStep,
@@ -9368,7 +9444,7 @@ function DynamicViewWalkthrough() {
9368
9444
  return /* @__PURE__ */ jsxs(
9369
9445
  Box,
9370
9446
  {
9371
- className: clsx("react-flow__panel", container),
9447
+ className: clsx("react-flow__panel", container$1),
9372
9448
  onClick: (e2) => e2.stopPropagation(),
9373
9449
  onDoubleClick: (e2) => e2.stopPropagation(),
9374
9450
  children: [
@@ -9422,6 +9498,227 @@ function DynamicViewWalkthrough() {
9422
9498
  }
9423
9499
  );
9424
9500
  }
9501
+ var vars = { safariAnimationHook: "var(--likec4-safari-animation-hook)", default: { font: "var(--likec4-default-font-family)" }, likec4: { font: "var(--likec4-font-family)", background: { color: "var(--likec4-background-color)", pattern: { color: "var(--likec4-background-pattern-color)" } } }, compound: { font: "var(--likec4-compound-font-family)", titleColor: "var(--likec4-compound-title-color)" }, element: { font: "var(--likec4-element-font-family)", fill: "var(--likec4-element-fill)", stroke: "var(--likec4-element-stroke)", hiContrast: "var(--likec4-element-hiContrast)", loContrast: "var(--likec4-element-loContrast)" }, relation: { lineColor: "var(--likec4-relation-lineColor)", labelColor: "var(--likec4-relation-labelColor)", labelBgColor: "var(--likec4-relation-labelBg)" }, optionsPanel: { top: "var(--likec4-options-panel-top)", right: "var(--likec4-options-panel-right)" }, navigationPanel: { top: "var(--likec4-navigation-panel-top)", left: "var(--likec4-navigation-panel-left)" } }, container = "eaj0yq0", card = "eaj0yq1", tabPanel = "eaj0yq2", elementNotation = "eaj0yq3", shapeSvg = "eaj0yq4", shapeBadge = "eaj0yq5";
9502
+ const ElementNotation = ({ value }) => {
9503
+ const {
9504
+ title: title2,
9505
+ color: color2 = "primary",
9506
+ shape = "rectangle"
9507
+ } = value, [onlyKind, setOnlyKind] = useState$1(null), diagramStore = useDiagramStoreApi(), w = 300, h = 200;
9508
+ return /* @__PURE__ */ jsx(
9509
+ Card,
9510
+ {
9511
+ shadow: "none",
9512
+ px: "xs",
9513
+ py: "sm",
9514
+ className: elementNotation,
9515
+ mod: {
9516
+ "data-likec4-color": color2
9517
+ },
9518
+ onMouseEnter: () => {
9519
+ setOnlyKind(null), diagramStore.getState().highlightByElementNotation(value);
9520
+ },
9521
+ onMouseLeave: () => {
9522
+ setOnlyKind(null), diagramStore.setState({ dimmed: /* @__PURE__ */ new Set() });
9523
+ },
9524
+ children: /* @__PURE__ */ jsxs(
9525
+ Group,
9526
+ {
9527
+ gap: "sm",
9528
+ align: "stretch",
9529
+ wrap: "nowrap",
9530
+ children: [
9531
+ /* @__PURE__ */ jsx(
9532
+ Box,
9533
+ {
9534
+ flex: "0 0 70px",
9535
+ style: {
9536
+ width: 70,
9537
+ height: u$1(70 * (h / w), 0)
9538
+ },
9539
+ children: /* @__PURE__ */ jsx(
9540
+ "svg",
9541
+ {
9542
+ className: clsx(
9543
+ shapeSvg
9544
+ ),
9545
+ viewBox: `0 0 ${w} ${h}`,
9546
+ children: /* @__PURE__ */ jsx(
9547
+ ElementShapeSvg,
9548
+ {
9549
+ shape,
9550
+ w,
9551
+ h
9552
+ }
9553
+ )
9554
+ }
9555
+ )
9556
+ }
9557
+ ),
9558
+ /* @__PURE__ */ jsxs(Stack, { gap: 4, flex: 1, children: [
9559
+ /* @__PURE__ */ jsx(Group, { gap: 4, flex: "0 0 auto", children: value.kinds.map((kind) => /* @__PURE__ */ jsx(
9560
+ Badge,
9561
+ {
9562
+ className: shapeBadge,
9563
+ onMouseEnter: () => {
9564
+ setOnlyKind(kind), diagramStore.getState().highlightByElementNotation(value, kind);
9565
+ },
9566
+ onMouseLeave: () => {
9567
+ setOnlyKind(null), diagramStore.getState().highlightByElementNotation(value);
9568
+ },
9569
+ opacity: l(onlyKind) && onlyKind !== kind ? 0.25 : 1,
9570
+ color: l(onlyKind) && onlyKind !== kind ? "gray" : vars.element.fill,
9571
+ children: kind
9572
+ },
9573
+ kind
9574
+ )) }),
9575
+ /* @__PURE__ */ jsx(
9576
+ Text$1,
9577
+ {
9578
+ component: "div",
9579
+ fz: "sm",
9580
+ fw: 500,
9581
+ lh: "1.25",
9582
+ style: {
9583
+ textWrap: "pretty"
9584
+ },
9585
+ children: title2
9586
+ }
9587
+ )
9588
+ ] })
9589
+ ]
9590
+ }
9591
+ )
9592
+ }
9593
+ );
9594
+ }, selector = (s2) => ({
9595
+ id: s2.view.id,
9596
+ notations: s2.view.notation?.elements ?? [],
9597
+ height: s2.xystore.getState().height,
9598
+ isVisible: e$3(s2.focusedNodeId ?? s2.activeDynamicViewStep),
9599
+ target: s2.getContainer()
9600
+ });
9601
+ function NotationPanel() {
9602
+ const {
9603
+ id: id2,
9604
+ notations,
9605
+ isVisible,
9606
+ height,
9607
+ target
9608
+ } = useDiagramState(selector), [isCollapsed, setCollapsed] = useLocalStorage({
9609
+ key: "notation-panel-collapsed",
9610
+ defaultValue: !0
9611
+ }), hasNotations = notations.length > 0, portalProps = target ? { portalProps: { target } } : { withinPortal: !1 };
9612
+ return /* @__PURE__ */ jsxs(AnimatePresence, { children: [
9613
+ !hasNotations && /* @__PURE__ */ jsx(
9614
+ m.div,
9615
+ {
9616
+ initial: { opacity: 0.75, translateX: "50%" },
9617
+ animate: { opacity: 1, translateX: 0 },
9618
+ exit: {
9619
+ translateX: "100%",
9620
+ opacity: 0.6
9621
+ },
9622
+ className: clsx("react-flow__panel", container),
9623
+ children: /* @__PURE__ */ jsx(Tooltip$2, { label: "Diagram has no notations", color: "orange", ...portalProps, children: /* @__PURE__ */ jsx(
9624
+ ThemeIcon,
9625
+ {
9626
+ size: "xl",
9627
+ variant: "light",
9628
+ color: "orange",
9629
+ radius: "md",
9630
+ children: /* @__PURE__ */ jsx(IconAlertTriangle, {})
9631
+ }
9632
+ ) })
9633
+ },
9634
+ "empty"
9635
+ ),
9636
+ hasNotations && isVisible && isCollapsed && /* @__PURE__ */ jsx(
9637
+ m.div,
9638
+ {
9639
+ initial: { opacity: 0.75, translateX: "50%" },
9640
+ animate: { opacity: 1, translateX: 0 },
9641
+ exit: {
9642
+ translateX: "100%",
9643
+ opacity: 0.6
9644
+ },
9645
+ className: clsx("react-flow__panel", container),
9646
+ children: /* @__PURE__ */ jsx(Tooltip$2, { label: "Show notation", color: "dark", fz: "xs", ...portalProps, children: /* @__PURE__ */ jsx(
9647
+ ActionIcon$2,
9648
+ {
9649
+ size: "xl",
9650
+ variant: "light",
9651
+ color: "gray",
9652
+ radius: "md",
9653
+ onClick: () => setCollapsed(!1),
9654
+ children: /* @__PURE__ */ jsx(IconHelpCircle, { stroke: 1.5 })
9655
+ }
9656
+ ) })
9657
+ },
9658
+ "collapsed"
9659
+ ),
9660
+ hasNotations && isVisible && !isCollapsed && /* @__PURE__ */ jsx(
9661
+ m.div,
9662
+ {
9663
+ initial: {
9664
+ opacity: 0.75,
9665
+ // translateX: '50%',
9666
+ scale: 0.2
9667
+ },
9668
+ animate: { opacity: 1, scale: 1 },
9669
+ exit: {
9670
+ opacity: 0,
9671
+ scale: 0.25
9672
+ },
9673
+ className: clsx("react-flow__panel", container),
9674
+ style: {
9675
+ transformOrigin: "bottom right"
9676
+ },
9677
+ children: /* @__PURE__ */ jsx(
9678
+ Paper,
9679
+ {
9680
+ radius: "sm",
9681
+ withBorder: !0,
9682
+ shadow: "lg",
9683
+ className: card,
9684
+ children: /* @__PURE__ */ jsxs(Tabs, { defaultValue: "first", radius: "xs", children: [
9685
+ /* @__PURE__ */ jsxs(TabsList, { children: [
9686
+ /* @__PURE__ */ jsx(
9687
+ ActionIcon$2,
9688
+ {
9689
+ size: "md",
9690
+ variant: "subtle",
9691
+ color: "gray",
9692
+ ml: 2,
9693
+ style: {
9694
+ alignSelf: "center"
9695
+ },
9696
+ onClick: () => setCollapsed(!0),
9697
+ children: /* @__PURE__ */ jsx(IconArrowDownRight, { stroke: 2 })
9698
+ }
9699
+ ),
9700
+ /* @__PURE__ */ jsx(TabsTab, { value: "first", fz: "xs", children: "Elements" }),
9701
+ /* @__PURE__ */ jsx(TabsTab, { value: "second", fz: "xs", disabled: !0, children: "Relationships" })
9702
+ ] }),
9703
+ /* @__PURE__ */ jsx(TabsPanel, { value: "first", className: tabPanel, hidden: isCollapsed, children: /* @__PURE__ */ jsx(
9704
+ ScrollAreaAutosize,
9705
+ {
9706
+ viewportProps: {
9707
+ style: {
9708
+ maxHeight: height > 50 ? `min(40vh, ${height - 20}px)` : "40vh"
9709
+ }
9710
+ },
9711
+ children: /* @__PURE__ */ jsx(Stack, { gap: 0, children: notations.map((n2, i2) => /* @__PURE__ */ jsx(ElementNotation, { value: n2 }, i2)) })
9712
+ }
9713
+ ) })
9714
+ ] })
9715
+ }
9716
+ )
9717
+ },
9718
+ id2
9719
+ )
9720
+ ] });
9721
+ }
9425
9722
  const {
9426
9723
  primary,
9427
9724
  secondary,
@@ -9431,7 +9728,7 @@ const {
9431
9728
  { key: "primary", value: primary.fill },
9432
9729
  { key: "secondary", value: secondary.fill },
9433
9730
  { key: "muted", value: muted.fill }
9434
- ], colors = t$4(otherColors).map((key) => ({
9731
+ ], colors = t$3(otherColors).map((key) => ({
9435
9732
  key,
9436
9733
  value: defaultTheme.elements[key].fill
9437
9734
  })), NodeOptions = memo$1(({ selectedNodeIds }) => {
@@ -9442,7 +9739,7 @@ const {
9442
9739
  throw new Error("NodeOptions: nodes and props.nodes should have the same length");
9443
9740
  const showShapeOption = nodes.some((node) => node.type === "element"), [firstNode, ...rest] = nodes, showGoToSource = rest.length === 0 && diagramApi.getState().onOpenSourceElement, showOpacityOption = firstNode.type === "compound" && (rest.length === 0 || rest.every((node) => node.type === "compound")), triggerChange = (style) => {
9444
9741
  const targets = nodes.map((node) => node.data.element.id);
9445
- invariant(i$3(targets, 1), "At least one target is required"), diagramApi.getState().triggerChangeElementStyle({
9742
+ invariant$1(i$3(targets, 1), "At least one target is required"), diagramApi.getState().triggerChangeElementStyle({
9446
9743
  op: "change-element-style",
9447
9744
  style,
9448
9745
  targets
@@ -9528,7 +9825,7 @@ function Colors({
9528
9825
  onColorChange
9529
9826
  }) {
9530
9827
  let selectedColor = firstNode.data.element.color;
9531
- d$1(nodes, (node) => node.data.element.color !== selectedColor ? (selectedColor = null, !1) : !0);
9828
+ u$4(nodes, (node) => node.data.element.color !== selectedColor ? (selectedColor = null, !1) : !0);
9532
9829
  const changeColor = (color2) => () => {
9533
9830
  selectedColor !== color2 && onColorChange(color2);
9534
9831
  };
@@ -9584,7 +9881,7 @@ function ShapeOption({
9584
9881
  onShapeChange
9585
9882
  }) {
9586
9883
  let selectedShape = firstNode.data.element.shape;
9587
- return d$1(nodes, (node) => node.data.element.shape !== selectedShape ? (selectedShape = null, !1) : !0), /* @__PURE__ */ jsxs("div", { children: [
9884
+ return u$4(nodes, (node) => node.data.element.shape !== selectedShape ? (selectedShape = null, !1) : !0), /* @__PURE__ */ jsxs("div", { children: [
9588
9885
  /* @__PURE__ */ jsx(Divider, { label: "shape", labelPosition: "left" }),
9589
9886
  /* @__PURE__ */ jsx(
9590
9887
  Select,
@@ -9949,19 +10246,19 @@ const ActionIcon = ActionIcon$2.withProps({
9949
10246
  showFitDiagram,
9950
10247
  showLayoutDriftWarning,
9951
10248
  showChangeAutoLayout,
9952
- portalProps: _portalProps,
10249
+ target,
9953
10250
  showGoToSource
9954
10251
  } = useDiagramState((s2) => {
9955
- const isNotActive = s2.activeDynamicViewStep === null && s2.focusedNodeId === null, target = s2.getContainer();
10252
+ const isNotActive = s2.activeDynamicViewStep === null && s2.focusedNodeId === null;
9956
10253
  return {
9957
10254
  showNavigationButtons: !!s2.onBurgerMenuClick || s2.showNavigationButtons && !!s2.onNavigateTo,
9958
10255
  showFitDiagram: s2.fitViewEnabled && s2.zoomable && s2.viewportChanged,
9959
10256
  showLayoutDriftWarning: s2.readonly !== !0 && s2.view.hasLayoutDrift === !0 && isNotActive,
9960
10257
  showChangeAutoLayout: s2.readonly !== !0 && !!s2.onChange && isNotActive,
9961
10258
  showGoToSource: !!s2.onOpenSourceView,
9962
- portalProps: target ? { target } : void 0
10259
+ target: s2.getContainer()
9963
10260
  };
9964
- }), portalProps = _portalProps ? { portalProps: _portalProps } : void 0;
10261
+ }), portalProps = target ? { portalProps: { target } } : void 0;
9965
10262
  return /* @__PURE__ */ jsxs(
9966
10263
  Stack,
9967
10264
  {
@@ -10041,7 +10338,7 @@ function literalToEnum(value) {
10041
10338
  }
10042
10339
  function XYFlowBackground({ background }) {
10043
10340
  if (typeof background == "string")
10044
- return /* @__PURE__ */ jsx(Background, { variant: literalToEnum(background) });
10341
+ return /* @__PURE__ */ jsx(Background, { variant: literalToEnum(background), size: 2, gap: 20 });
10045
10342
  const { variant, ...rest } = background;
10046
10343
  return /* @__PURE__ */ jsx(Background, { variant: literalToEnum(variant), ...rest });
10047
10344
  }
@@ -10052,11 +10349,13 @@ const XYFlowInner = memo$1(function({
10052
10349
  showDiagramTitle
10053
10350
  }) {
10054
10351
  const {
10352
+ showNotations,
10055
10353
  isDynamicView,
10056
10354
  isDynamicViewActive,
10057
10355
  readonly,
10058
10356
  enableDynamicViewWalkthrough
10059
10357
  } = useDiagramState((s2) => ({
10358
+ showNotations: s2.showNotations,
10060
10359
  isDynamicView: s2.isDynamicView,
10061
10360
  readonly: s2.readonly,
10062
10361
  enableDynamicViewWalkthrough: s2.enableDynamicViewWalkthrough,
@@ -10069,6 +10368,7 @@ const XYFlowInner = memo$1(function({
10069
10368
  readonly !== !0 && /* @__PURE__ */ jsx(OptionsPanel, {}),
10070
10369
  showDiagramTitle === !0 && !isDynamicViewActive && /* @__PURE__ */ jsx(DiagramTitlePanel, {}),
10071
10370
  isDynamicView && enableDynamicViewWalkthrough && /* @__PURE__ */ jsx(DynamicViewWalkthrough, {}),
10371
+ showNotations && /* @__PURE__ */ jsx(NotationPanel, {}),
10072
10372
  children
10073
10373
  ] });
10074
10374
  }, shallowEqual);
@@ -10087,6 +10387,7 @@ function LikeC4Diagram({
10087
10387
  controls = !1,
10088
10388
  showElementLinks = !0,
10089
10389
  showDiagramTitle = !0,
10390
+ showNotations = !0,
10090
10391
  enableDynamicViewWalkthrough = !1,
10091
10392
  enableFocusMode = !1,
10092
10393
  initialWidth,
@@ -10134,6 +10435,7 @@ function LikeC4Diagram({
10134
10435
  fitViewPadding,
10135
10436
  showElementLinks,
10136
10437
  showNavigationButtons,
10438
+ showNotations,
10137
10439
  nodesDraggable,
10138
10440
  nodesSelectable,
10139
10441
  experimentalEdgeEditing,
@@ -10231,6 +10533,7 @@ function StaticLikeC4Diagram({
10231
10533
  background,
10232
10534
  showElementLinks: !0,
10233
10535
  showDiagramTitle: !1,
10536
+ showNotations: !1,
10234
10537
  enableDynamicViewWalkthrough: !1,
10235
10538
  enableFocusMode: !1,
10236
10539
  nodesSelectable: !1,
@@ -10239,12 +10542,294 @@ function StaticLikeC4Diagram({
10239
10542
  }
10240
10543
  );
10241
10544
  }
10242
- var previewBg = "_15b5f732";
10243
- const Route$9 = createFileRoute("/")({
10244
- component: IndexPage
10545
+ var root = "mxt2a80";
10546
+ function edgePath(points) {
10547
+ return points.reduce((acc, [x2, y2], i2) => acc + `${i2 === 0 ? "M" : " L"} ${x2},${y2}`, "");
10548
+ }
10549
+ function LinkEdge({
10550
+ id: id2,
10551
+ data,
10552
+ ...props2
10553
+ }) {
10554
+ if (!data)
10555
+ return null;
10556
+ const path = edgePath(data.points);
10557
+ return /* @__PURE__ */ jsx(
10558
+ BaseEdge,
10559
+ {
10560
+ id: id2,
10561
+ path,
10562
+ ...props2
10563
+ }
10564
+ );
10565
+ }
10566
+ var handleCenter = "_1n8mzjc0", toplevelNode = "_1n8mzjc1", nestedNode = "_1n8mzjc2", dimmed = "_1n8mzjc3", folderNode = "_1n8mzjc4", fileNode = "_1n8mzjc5", viewNode = "_1n8mzjc6", viewNodeImageSection = "_1n8mzjc7", viewTitle = "_1n8mzjc8";
10567
+ const FolderNode = /* @__PURE__ */ memo$1(function({
10568
+ data,
10569
+ parentId,
10570
+ id: id2
10571
+ }) {
10572
+ const isTopLevel = e$3(parentId);
10573
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
10574
+ /* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Top, className: handleCenter }),
10575
+ /* @__PURE__ */ jsx(
10576
+ Paper,
10577
+ {
10578
+ p: "sm",
10579
+ pt: "xs",
10580
+ radius: "md",
10581
+ withBorder: !0,
10582
+ shadow: isTopLevel ? "lg" : "xs",
10583
+ className: clsx(
10584
+ folderNode,
10585
+ isTopLevel ? toplevelNode : nestedNode,
10586
+ data.dimmed && dimmed
10587
+ ),
10588
+ children: /* @__PURE__ */ jsxs(Group, { gap: 8, children: [
10589
+ /* @__PURE__ */ jsx(ThemeIcon, { size: 24, variant: "transparent", color: "dark.4", children: /* @__PURE__ */ jsx(IconFolderFilled, { size: "100%" }) }),
10590
+ /* @__PURE__ */ jsx(Text$1, { size: "lg", fw: 500, children: data.label })
10591
+ ] })
10592
+ }
10593
+ ),
10594
+ /* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Bottom, className: handleCenter })
10595
+ ] });
10596
+ }), FileNode = /* @__PURE__ */ memo$1(function({
10597
+ data,
10598
+ parentId,
10599
+ id: id2
10600
+ }) {
10601
+ const isTopLevel = e$3(parentId);
10602
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
10603
+ /* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Top, className: handleCenter }),
10604
+ /* @__PURE__ */ jsx(
10605
+ Paper,
10606
+ {
10607
+ p: "sm",
10608
+ pt: "xs",
10609
+ radius: "md",
10610
+ withBorder: !0,
10611
+ shadow: isTopLevel ? "lg" : "xs",
10612
+ className: clsx(
10613
+ fileNode,
10614
+ isTopLevel ? toplevelNode : nestedNode,
10615
+ data.dimmed && dimmed
10616
+ ),
10617
+ children: /* @__PURE__ */ jsxs(Group, { gap: 8, children: [
10618
+ /* @__PURE__ */ jsx(ThemeIcon, { size: 24, variant: "transparent", color: "dark.3", children: /* @__PURE__ */ jsx(IconFileFilled, { size: "100%" }) }),
10619
+ /* @__PURE__ */ jsx(Text$1, { size: "lg", fw: 500, children: data.label })
10620
+ ] })
10621
+ }
10622
+ ),
10623
+ /* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Bottom, className: handleCenter })
10624
+ ] });
10625
+ }), ViewNode = /* @__PURE__ */ memo$1(function({
10626
+ data,
10627
+ height = 320
10628
+ }) {
10629
+ const imageUrl = usePreviewUrl(data.viewId);
10630
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
10631
+ /* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Top, className: handleCenter }),
10632
+ /* @__PURE__ */ jsxs(
10633
+ Card,
10634
+ {
10635
+ className: clsx(
10636
+ viewNode,
10637
+ data.dimmed && dimmed
10638
+ ),
10639
+ withBorder: !0,
10640
+ shadow: "xs",
10641
+ padding: 0,
10642
+ children: [
10643
+ /* @__PURE__ */ jsx(CardSection, { className: viewNodeImageSection, children: imageUrl ? /* @__PURE__ */ jsx(
10644
+ Image,
10645
+ {
10646
+ src: imageUrl,
10647
+ fit: "contain",
10648
+ h: height - 60
10649
+ }
10650
+ ) : /* @__PURE__ */ jsx(Center, { h: height - 60, children: /* @__PURE__ */ jsxs(Group, { children: [
10651
+ /* @__PURE__ */ jsx(ThemeIcon, { size: 60, variant: "transparent", color: "dark", children: /* @__PURE__ */ jsx(IconLoader, { stroke: 1.5, size: "100%" }) }),
10652
+ /* @__PURE__ */ jsx(Text$1, { size: "xl", fw: 500, c: "dimmed", children: "Preview not available" })
10653
+ ] }) }) }),
10654
+ /* @__PURE__ */ jsx(Box, { className: viewTitle, h: 60, p: "sm", pl: "md", children: /* @__PURE__ */ jsx(Text$1, { component: "div", size: "lg", fw: 500, children: data.label }) })
10655
+ ]
10656
+ }
10657
+ ),
10658
+ /* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Bottom, className: handleCenter })
10659
+ ] });
10660
+ }), nodeTypes = {
10661
+ folder: FolderNode,
10662
+ file: FileNode,
10663
+ view: ViewNode
10664
+ }, edgeTypes = {
10665
+ link: LinkEdge
10666
+ }, overviewGraphToXYFlowData = (graph) => ({
10667
+ nodes: graph.nodes.map(({ id: id2, parentId, position, width, height, ...node }) => {
10668
+ const parent = parentId ? graph.nodes.find((n2) => n2.id === parentId) : null, rect = {
10669
+ ...position,
10670
+ width,
10671
+ height
10672
+ };
10673
+ parent && (position = {
10674
+ x: position.x - parent.position.x,
10675
+ y: position.y - parent.position.y
10676
+ });
10677
+ const xyparent = parent ? { parentId: parent.id } : {};
10678
+ switch (node.type) {
10679
+ case "file":
10680
+ case "folder":
10681
+ return {
10682
+ id: id2,
10683
+ type: node.type,
10684
+ data: {
10685
+ dimmed: !1,
10686
+ label: node.label,
10687
+ path: node.path,
10688
+ rect
10689
+ },
10690
+ deletable: !1,
10691
+ position,
10692
+ width,
10693
+ height,
10694
+ zIndex: 1,
10695
+ ...xyparent
10696
+ };
10697
+ case "view":
10698
+ return {
10699
+ id: id2,
10700
+ type: "view",
10701
+ data: {
10702
+ dimmed: !1,
10703
+ label: node.label,
10704
+ viewId: node.viewId,
10705
+ rect
10706
+ },
10707
+ selectable: !1,
10708
+ deletable: !1,
10709
+ position,
10710
+ width,
10711
+ height,
10712
+ zIndex: 3,
10713
+ ...xyparent
10714
+ };
10715
+ default:
10716
+ nonexhaustive(node);
10717
+ }
10718
+ }),
10719
+ edges: graph.edges.map((edge) => ({
10720
+ id: edge.id,
10721
+ source: edge.source,
10722
+ target: edge.target,
10723
+ type: "link",
10724
+ zIndex: 2,
10725
+ hidden: !0,
10726
+ data: {
10727
+ points: edge.points
10728
+ }
10729
+ }))
10245
10730
  });
10731
+ function OverviewDiagrams({
10732
+ graph,
10733
+ fitViewPadding = 0.1,
10734
+ zoomable = !0,
10735
+ pannable = !0
10736
+ }) {
10737
+ const router = useRouter(), xyflowRef = useRef$1(), { colorScheme } = useMantineColorScheme(), xyflowdata = useMemo$1(() => overviewGraphToXYFlowData(graph), [graph]), [nodes, setNodes, onNodesChange] = useNodesState(xyflowdata.nodes), [edges, setEdges, onEdgeChanges] = useEdgesState(xyflowdata.edges);
10738
+ useUpdateEffect(() => {
10739
+ setNodes(
10740
+ (nodes2) => xyflowdata.nodes.map((n2) => {
10741
+ const current = nodes2.find((node) => node.id === n2.id);
10742
+ return current ? { ...a$2(current, ["selected", "hidden"]), ...n2 } : n2;
10743
+ })
10744
+ ), setEdges(xyflowdata.edges);
10745
+ }, [xyflowdata.nodes, xyflowdata.edges]);
10746
+ const focusedNode = nodes.find((node) => node.selected);
10747
+ return useUpdateEffect(() => {
10748
+ const xyflow = xyflowRef.current;
10749
+ xyflow && (focusedNode ? xyflow.fitView({
10750
+ maxZoom: 1,
10751
+ padding: fitViewPadding,
10752
+ nodes: [focusedNode],
10753
+ duration: 450
10754
+ }) : xyflow.fitView({
10755
+ maxZoom: 1,
10756
+ padding: fitViewPadding,
10757
+ duration: 800
10758
+ }));
10759
+ }, [focusedNode?.id ?? null]), /* @__PURE__ */ jsx(
10760
+ index,
10761
+ {
10762
+ colorMode: colorScheme === "auto" ? "system" : colorScheme,
10763
+ className: root,
10764
+ nodeTypes,
10765
+ edgeTypes,
10766
+ nodes,
10767
+ onNodesChange,
10768
+ edges,
10769
+ onEdgesChange: onEdgeChanges,
10770
+ fitView: !0,
10771
+ fitViewOptions: useMemo$1(() => ({
10772
+ minZoom: 0.05,
10773
+ maxZoom: 1,
10774
+ padding: fitViewPadding,
10775
+ includeHiddenNodes: !0
10776
+ }), [fitViewPadding]),
10777
+ nodesDraggable: !1,
10778
+ nodesConnectable: !1,
10779
+ nodesFocusable: !0,
10780
+ edgesReconnectable: !1,
10781
+ edgesFocusable: !1,
10782
+ multiSelectionKeyCode: null,
10783
+ zoomOnPinch: zoomable,
10784
+ zoomOnScroll: !pannable && zoomable,
10785
+ zoomOnDoubleClick: !1,
10786
+ ...!zoomable && {
10787
+ zoomActivationKeyCode: null
10788
+ },
10789
+ maxZoom: zoomable ? 2 : 1,
10790
+ minZoom: zoomable ? 0.01 : 1,
10791
+ preventScrolling: zoomable || pannable,
10792
+ noDragClassName: "nodrag",
10793
+ noPanClassName: "nopan",
10794
+ panOnScroll: pannable,
10795
+ panOnDrag: pannable,
10796
+ ...!pannable && {
10797
+ selectionKeyCode: null
10798
+ },
10799
+ onInit: (instance) => xyflowRef.current = instance,
10800
+ onNodeClick: (event, node) => {
10801
+ if (node.type === "view") {
10802
+ event.stopPropagation(), setNodes((nodes2) => nodes2.map(({ data, ...n2 }) => ({ ...n2, data: { ...data, dimmed: n2.id !== node.id } }))), xyflowRef.current?.fitView({
10803
+ maxZoom: 10,
10804
+ padding: 0,
10805
+ nodes: [node],
10806
+ duration: 1200
10807
+ }), setTimeout(() => {
10808
+ xyflowRef.current?.updateNodeData(node.id, { dimmed: !0 });
10809
+ }, 400), setTimeout(() => {
10810
+ router.navigate({
10811
+ to: "/view/$viewId/",
10812
+ params: {
10813
+ viewId: node.data.viewId
10814
+ },
10815
+ search: !0
10816
+ });
10817
+ }, 800);
10818
+ return;
10819
+ }
10820
+ node.selected && (event.stopPropagation(), setNodes((nodes2) => nodes2.map((n2) => n2.id === node.id ? { ...n2, selected: !1 } : n2)));
10821
+ },
10822
+ children: /* @__PURE__ */ jsx(Background, { variant: BackgroundVariant.Dots, size: 4, gap: 50 })
10823
+ }
10824
+ );
10825
+ }
10826
+ function OverviewPage() {
10827
+ const graph = useOverviewGraph();
10828
+ return /* @__PURE__ */ jsx(Box, { pos: "fixed", inset: 0, children: /* @__PURE__ */ jsx(OverviewDiagrams, { graph }) });
10829
+ }
10830
+ var previewBg = "_15b5f732";
10246
10831
  function IndexPage() {
10247
- const views = t$4(useLikeC4Views());
10832
+ const views = t$3(useLikeC4Views());
10248
10833
  return /* @__PURE__ */ jsx(
10249
10834
  SimpleGrid,
10250
10835
  {
@@ -10256,7 +10841,7 @@ function IndexPage() {
10256
10841
  }
10257
10842
  );
10258
10843
  }
10259
- const ViewCard = memo$1(({ viewId }) => {
10844
+ function ViewCard({ viewId }) {
10260
10845
  const diagram = useLikeC4View(viewId);
10261
10846
  if (!diagram)
10262
10847
  return null;
@@ -10279,7 +10864,7 @@ const ViewCard = memo$1(({ viewId }) => {
10279
10864
  ]
10280
10865
  }
10281
10866
  );
10282
- }, (prev, next) => prev.viewId === next.viewId);
10867
+ }
10283
10868
  function DiagramPreview(props2) {
10284
10869
  const [diagram, setDiagram] = useState$1(null);
10285
10870
  return useDebouncedEffect(
@@ -10302,6 +10887,9 @@ function DiagramPreview(props2) {
10302
10887
  }
10303
10888
  ) });
10304
10889
  }
10890
+ const Route$9 = createFileRoute("/")({
10891
+ component: withOverviewGraph ? OverviewPage : IndexPage
10892
+ });
10305
10893
  var svgContainer = "_1dn84dq1", cssViewOutlet = "_1dn84dq3", cssExportView = "_1dn84dq4", cssWebcomponentView = "_1dn84dq5", cssWebcomponentIframeContainer = "_1dn84dq6";
10306
10894
  const Route$8 = createFileRoute("/webcomponent/$")({
10307
10895
  component: WebcomponentPage
@@ -10468,7 +11056,7 @@ function buildDiagramTreeData(views) {
10468
11056
  label: view.title ?? view.id,
10469
11057
  type: "diagram",
10470
11058
  children: []
10471
- }), parent !== root2 && (parent.children.sort(compareTreeNodes), n$2(view.relativePath) && parent.type !== "file" && (parent.type = "file"));
11059
+ }), parent !== root2 && (parent.children.sort(compareTreeNodes), n$1(view.relativePath) && parent.type !== "file" && (parent.type = "file"));
10472
11060
  }
10473
11061
  return root2.children.sort(compareTreeNodes);
10474
11062
  }
@@ -10480,7 +11068,7 @@ const isFile = (node) => isTreeNodeData(node) && node.type === "file", FolderIco
10480
11068
  const data = useDiagramsTreeData(), { viewId } = useParams({
10481
11069
  from: "/view/$viewId"
10482
11070
  }), diagram = useLikeC4View(viewId), initialExpandedState = {};
10483
- if (diagram && n$2(diagram.relativePath)) {
11071
+ if (diagram && n$1(diagram.relativePath)) {
10484
11072
  const segments = diagram.relativePath.split("/");
10485
11073
  let path = "@fs";
10486
11074
  for (const segment of segments)
@@ -10750,7 +11338,9 @@ function ShareModal({
10750
11338
  );
10751
11339
  }
10752
11340
  function Header({ diagram }) {
10753
- const { breakpoints } = useMantineTheme(), isTablet = useMediaQuery(`(min-width: ${breakpoints.md})`) ?? !1, [opened, { open, close }] = useDisclosure(!1);
11341
+ const isReactDiagramRoute = useRouterState().matches.some(
11342
+ ({ routeId }) => routeId === "/view/$viewId/" || routeId === "/view/$viewId/editor"
11343
+ ), { breakpoints } = useMantineTheme(), isTablet = useMediaQuery(`(min-width: ${breakpoints.md})`) ?? !1, [opened, { open, close }] = useDisclosure(!1);
10754
11344
  return /* @__PURE__ */ jsxs(
10755
11345
  Paper,
10756
11346
  {
@@ -10758,17 +11348,28 @@ function Header({ diagram }) {
10758
11348
  pos: "fixed",
10759
11349
  top: "0.5rem",
10760
11350
  right: "0.5rem",
10761
- py: 5,
10762
- px: "xs",
11351
+ p: 4,
10763
11352
  radius: "sm",
10764
- shadow: "xl",
11353
+ shadow: "lg",
10765
11354
  children: [
10766
11355
  /* @__PURE__ */ jsxs(Group, { gap: isTablet ? 6 : 4, wrap: "nowrap", children: [
10767
- /* @__PURE__ */ jsx(ViewPageButton, { isTablet }),
11356
+ isReactDiagramRoute ? /* @__PURE__ */ jsxs(Fragment, { children: [
11357
+ /* @__PURE__ */ jsx(Button, { size: isTablet ? "sm" : "xs", leftSection: /* @__PURE__ */ jsx(IconShare, { size: 14 }), onClick: open, children: "Share" }),
11358
+ /* @__PURE__ */ jsx(ExportButton, {})
11359
+ ] }) : /* @__PURE__ */ jsx(
11360
+ Button,
11361
+ {
11362
+ component: Link,
11363
+ to: "/view/$viewId/",
11364
+ size: isTablet ? "sm" : "xs",
11365
+ variant: "subtle",
11366
+ color: "gray",
11367
+ children: "Back to diagram"
11368
+ }
11369
+ ),
11370
+ /* @__PURE__ */ jsx(Divider, { orientation: "vertical", visibleFrom: "md" }),
10768
11371
  /* @__PURE__ */ jsx(ColorSchemeToggle, {}),
10769
- /* @__PURE__ */ jsx(Divider, { orientation: "vertical", mr: isTablet ? 4 : "xs" }),
10770
- /* @__PURE__ */ jsx(Button, { size: isTablet ? "sm" : "xs", leftSection: /* @__PURE__ */ jsx(IconShare, { size: 14 }), onClick: open, children: "Share" }),
10771
- /* @__PURE__ */ jsx(ExportButton, { diagram })
11372
+ /* @__PURE__ */ jsx(Space, {})
10772
11373
  ] }),
10773
11374
  /* @__PURE__ */ jsx(
10774
11375
  ShareModal,
@@ -10782,77 +11383,10 @@ function Header({ diagram }) {
10782
11383
  }
10783
11384
  );
10784
11385
  }
10785
- const viewPages = [
10786
- {
10787
- route: "/view/$viewId",
10788
- icon: /* @__PURE__ */ jsx(IconBrandReact, { opacity: 0.7, size: 16 }),
10789
- title: /* @__PURE__ */ jsx(Fragment, { children: "React" })
10790
- },
10791
- {
10792
- route: "/view/$viewId/editor",
10793
- icon: /* @__PURE__ */ jsx(IconBrandReact, { opacity: 0.7, size: 16 }),
10794
- title: /* @__PURE__ */ jsx(Text$1, { size: "sm", fw: "500", variant: "gradient", gradient: { from: "pink", to: "violet", deg: 90 }, children: "Editor" })
10795
- },
10796
- {
10797
- route: "/view/$viewId/dot",
10798
- icon: /* @__PURE__ */ jsx(IconFile, { opacity: 0.7, size: 16 }),
10799
- title: /* @__PURE__ */ jsxs(Fragment, { children: [
10800
- "Graphviz ",
10801
- /* @__PURE__ */ jsx(Text$1, { component: "span", size: "xs", c: "dimmed", ml: 4, children: ".dot" })
10802
- ] })
10803
- },
10804
- {
10805
- route: "/view/$viewId/d2",
10806
- icon: /* @__PURE__ */ jsx(IconFile, { opacity: 0.7, size: 16 }),
10807
- title: /* @__PURE__ */ jsx(Fragment, { children: "D2" })
10808
- },
10809
- {
10810
- route: "/view/$viewId/mmd",
10811
- icon: /* @__PURE__ */ jsx(IconFile, { opacity: 0.7, size: 16 }),
10812
- title: /* @__PURE__ */ jsx(Fragment, { children: "Mermaid" })
10813
- }
10814
- ], routeIds = viewPages.map(({ route }) => route);
10815
- function ViewPageButton({
10816
- isTablet
10817
- }) {
10818
- const { viewId } = useParams({
10819
- from: "/view/$viewId"
10820
- }), routerState = useRouterState(), matchedRoute = o$1(routerState.matches, ({ routeId }) => routeIds.includes(routeId)), matched = (matchedRoute && viewPages.find(({ route }) => route === matchedRoute.routeId)) ?? viewPages[0];
10821
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(Menu, { shadow: "md", width: 200, trigger: "click-hover", openDelay: 100, children: [
10822
- /* @__PURE__ */ jsx(MenuTarget, { children: /* @__PURE__ */ jsx(
10823
- Button,
10824
- {
10825
- leftSection: matched.icon,
10826
- variant: "subtle",
10827
- size: isTablet ? "sm" : "xs",
10828
- color: "gray",
10829
- px: "xs",
10830
- rightSection: /* @__PURE__ */ jsx(IconChevronDown, { opacity: 0.5, size: 14 }),
10831
- children: matched.title
10832
- }
10833
- ) }),
10834
- /* @__PURE__ */ jsx(MenuDropdown, { children: viewPages.map(({ route, icon, title: title2 }) => /* @__PURE__ */ jsx(
10835
- MenuItem,
10836
- {
10837
- component: Link,
10838
- to: route,
10839
- search: !0,
10840
- params: { viewId },
10841
- leftSection: icon,
10842
- ...route === matched.route ? { bg: "gray" } : {},
10843
- style: {
10844
- whiteSpace: "nowrap"
10845
- },
10846
- children: title2
10847
- },
10848
- route
10849
- )) })
10850
- ] }) });
10851
- }
10852
- function ExportButton({ diagram }) {
11386
+ function ExportButton() {
10853
11387
  const params = useParams({
10854
11388
  from: "/view/$viewId"
10855
- });
11389
+ }), previewUrl = usePreviewUrl(params.viewId);
10856
11390
  return /* @__PURE__ */ jsxs(Menu, { shadow: "md", width: 200, trigger: "click-hover", openDelay: 200, children: [
10857
11391
  /* @__PURE__ */ jsx(MenuTarget, { children: /* @__PURE__ */ jsx(
10858
11392
  Button,
@@ -10868,7 +11402,16 @@ function ExportButton({ diagram }) {
10868
11402
  ) }),
10869
11403
  /* @__PURE__ */ jsxs(MenuDropdown, { children: [
10870
11404
  /* @__PURE__ */ jsx(MenuLabel, { children: "Current view" }),
10871
- /* @__PURE__ */ jsx(
11405
+ previewUrl ? /* @__PURE__ */ jsx(
11406
+ MenuItem,
11407
+ {
11408
+ component: "a",
11409
+ href: previewUrl,
11410
+ download: `${params.viewId}.png`,
11411
+ target: "_blank",
11412
+ children: "Export as .png"
11413
+ }
11414
+ ) : /* @__PURE__ */ jsx(
10872
11415
  MenuItem,
10873
11416
  {
10874
11417
  component: Link,
@@ -10927,10 +11470,10 @@ function Fallback({ error, resetErrorBoundary }) {
10927
11470
  ] }) });
10928
11471
  }
10929
11472
  function ViewLayout() {
10930
- return useDisclosure(!1), /* @__PURE__ */ jsxs(Fragment, { children: [
11473
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
10931
11474
  /* @__PURE__ */ jsx(Box, { className: cssViewOutlet, children: /* @__PURE__ */ jsx(ErrorBoundary, { FallbackComponent: Fallback, children: /* @__PURE__ */ jsx(Outlet, {}) }) }),
10932
11475
  /* @__PURE__ */ jsx(ViewHeader, {}),
10933
- /* @__PURE__ */ jsx(SidebarDrawer, {})
11476
+ !withOverviewGraph && /* @__PURE__ */ jsx(SidebarDrawer, {})
10934
11477
  ] });
10935
11478
  }
10936
11479
  function ViewHeader() {
@@ -10971,17 +11514,22 @@ async function downloadAsPng({
10971
11514
  console.error(err), window.alert("Failed to export to PNG, check the console for more details.");
10972
11515
  }
10973
11516
  }
10974
- const Route$6 = createFileRoute("/export/$viewId")({
11517
+ const asBoolean = (v) => {
11518
+ if (typeof v == "boolean")
11519
+ return v;
11520
+ if (typeof v == "string")
11521
+ return v === "true";
11522
+ }, Route$6 = createFileRoute("/export/$viewId")({
10975
11523
  component: ExportPage,
10976
11524
  validateSearch: (search) => ({
10977
- download: "download" in search
11525
+ download: asBoolean(search.download)
10978
11526
  })
10979
11527
  });
10980
11528
  function ExportPage() {
10981
11529
  const {
10982
11530
  padding = 20,
10983
- download
10984
- } = Route$6.useSearch(), { viewId } = Route$6.useParams(), diagram = useLikeC4View(viewId), viewportRef = useRef$1(null), loadingOverlayRef = useRef$1(null);
11531
+ download = !1
11532
+ } = Route$6.useSearch(), { viewId } = Route$6.useParams(), diagram = useLikeC4View(viewId), viewportRef = useRef$1(null), loadingOverlayRef = useRef$1(null), downloadedRef = useRef$1(!1);
10985
11533
  if (useTransparentBackground(), useEffect$1(() => {
10986
11534
  document.querySelectorAll(".react-flow__viewport").forEach((el) => {
10987
11535
  el.style.transform = "";
@@ -10989,7 +11537,10 @@ function ExportPage() {
10989
11537
  }), useDebouncedEffect(
10990
11538
  () => {
10991
11539
  const viewport = viewportRef.current;
10992
- !download || !viewport || !diagram || (loadingOverlayRef.current.style.display = "none", downloadAsPng({
11540
+ if (!download || !viewport || !diagram)
11541
+ return;
11542
+ const loadingOverlay = loadingOverlayRef.current;
11543
+ loadingOverlay && (loadingOverlay.style.display = "none"), !downloadedRef.current && (downloadedRef.current = !0, downloadAsPng({
10993
11544
  pngFilename: viewId,
10994
11545
  viewport
10995
11546
  }));
@@ -11027,6 +11578,7 @@ function ExportPage() {
11027
11578
  enableDynamicViewWalkthrough: !1,
11028
11579
  showElementLinks: !1,
11029
11580
  showDiagramTitle: !1,
11581
+ showNotations: !1,
11030
11582
  nodesSelectable: !1,
11031
11583
  nodesDraggable: !1,
11032
11584
  enableFocusMode: !1,
@@ -11076,6 +11628,7 @@ function EmbedPage() {
11076
11628
  enableDynamicViewWalkthrough: !1,
11077
11629
  showElementLinks: !1,
11078
11630
  showDiagramTitle: !1,
11631
+ showNotations: !1,
11079
11632
  nodesSelectable: !1,
11080
11633
  nodesDraggable: !1,
11081
11634
  enableFocusMode: !1,
@@ -11119,7 +11672,12 @@ function ViewReact() {
11119
11672
  nodesSelectable: !1,
11120
11673
  renderIcon: RenderIcon,
11121
11674
  onNavigateTo,
11122
- onBurgerMenuClick: SidebarDrawerOps.open
11675
+ onBurgerMenuClick: withOverviewGraph ? () => {
11676
+ router.navigate({
11677
+ to: "/",
11678
+ search: !0
11679
+ });
11680
+ } : SidebarDrawerOps.open
11123
11681
  }
11124
11682
  );
11125
11683
  }
@@ -11419,7 +11977,7 @@ function handlePointerMove(event) {
11419
11977
  x: x2,
11420
11978
  y: y2
11421
11979
  } = getResizeEventCoordinates(event);
11422
- if (event.buttons === 0 && (isPointerDown = !1, updateResizeHandlerStates("up", event)), !isPointerDown) {
11980
+ if (isPointerDown && event.buttons === 0 && (isPointerDown = !1, updateResizeHandlerStates("up", event)), !isPointerDown) {
11423
11981
  const {
11424
11982
  target
11425
11983
  } = event;
@@ -12306,7 +12864,7 @@ function PanelGroupWithForwardedRef({
12306
12864
  prevLayout,
12307
12865
  trigger: isKeyDown(event) ? "keyboard" : "mouse-or-touch"
12308
12866
  }), layoutChanged = !compareLayouts(prevLayout, nextLayout);
12309
- (isPointerEvent(event) || isMouseEvent(event)) && prevDeltaRef.current != delta && (prevDeltaRef.current = delta, layoutChanged ? reportConstraintsViolation(dragHandleId, 0) : isHorizontal ? reportConstraintsViolation(dragHandleId, delta < 0 ? EXCEEDED_HORIZONTAL_MIN : EXCEEDED_HORIZONTAL_MAX) : reportConstraintsViolation(dragHandleId, delta < 0 ? EXCEEDED_VERTICAL_MIN : EXCEEDED_VERTICAL_MAX)), layoutChanged && (setLayout(nextLayout), eagerValuesRef.current.layout = nextLayout, onLayout2 && onLayout2(nextLayout), callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current));
12867
+ (isPointerEvent(event) || isMouseEvent(event)) && prevDeltaRef.current != delta && (prevDeltaRef.current = delta, !layoutChanged && delta !== 0 ? isHorizontal ? reportConstraintsViolation(dragHandleId, delta < 0 ? EXCEEDED_HORIZONTAL_MIN : EXCEEDED_HORIZONTAL_MAX) : reportConstraintsViolation(dragHandleId, delta < 0 ? EXCEEDED_VERTICAL_MIN : EXCEEDED_VERTICAL_MAX) : reportConstraintsViolation(dragHandleId, 0)), layoutChanged && (setLayout(nextLayout), eagerValuesRef.current.layout = nextLayout, onLayout2 && onLayout2(nextLayout), callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current));
12310
12868
  }, []), resizePanel2 = useCallback((panelData, unsafePanelSize) => {
12311
12869
  const {
12312
12870
  onLayout: onLayout2
@@ -12677,9 +13235,7 @@ function ViewEditor() {
12677
13235
  search: !0
12678
13236
  });
12679
13237
  });
12680
- if (useCallbackRef((event) => {
12681
- console.log("onChange", event);
12682
- }), !view)
13238
+ if (!view)
12683
13239
  throw notFound();
12684
13240
  return /* @__PURE__ */ jsx(
12685
13241
  LikeC4Diagram,
@@ -12698,7 +13254,12 @@ function ViewEditor() {
12698
13254
  enableFocusMode: !1,
12699
13255
  onNavigateTo,
12700
13256
  renderIcon: RenderIcon,
12701
- onBurgerMenuClick: SidebarDrawerOps.open
13257
+ onBurgerMenuClick: withOverviewGraph ? () => {
13258
+ router.navigate({
13259
+ to: "/",
13260
+ search: !0
13261
+ });
13262
+ } : SidebarDrawerOps.open
12702
13263
  }
12703
13264
  );
12704
13265
  }