likec4 1.7.4 → 1.8.1

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 MenuLabel, ac as MenuItem, ad as LoadingOverlay, ae as useCallbackRef, af as Burger, ag as Loader } from "./chunks/mantine-CIkjlE3R.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.31", 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;
@@ -2821,7 +3237,7 @@ function setTarget(visualElement, definition) {
2821
3237
  }
2822
3238
  }
2823
3239
  function getOptimisedAppearId(visualElement) {
2824
- return visualElement.getProps()[optimizedAppearDataAttribute];
3240
+ return visualElement.props[optimizedAppearDataAttribute];
2825
3241
  }
2826
3242
  class WillChangeMotionValue extends MotionValue {
2827
3243
  constructor() {
@@ -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));
@@ -3194,7 +3609,7 @@ class VisualElement {
3194
3609
  this.current = instance, visualElementStore.set(instance, this), this.projection && !this.projection.instance && this.projection.mount(instance), this.parent && this.isVariantNode && !this.isControllingVariants && (this.removeFromVariantTree = this.parent.addVariantChild(this)), this.values.forEach((value, key) => this.bindToMotionValue(key, value)), hasReducedMotionListener.current || initPrefersReducedMotion(), this.shouldReduceMotion = this.reducedMotionConfig === "never" ? !1 : this.reducedMotionConfig === "always" ? !0 : prefersReducedMotion.current, this.parent && this.parent.children.add(this), this.update(this.props, this.presenceContext);
3195
3610
  }
3196
3611
  unmount() {
3197
- visualElementStore.delete(this.current), this.projection && this.projection.unmount(), cancelFrame(this.notifyUpdate), cancelFrame(this.render), this.valueSubscriptions.forEach((remove) => remove()), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent && this.parent.children.delete(this);
3612
+ visualElementStore.delete(this.current), this.projection && this.projection.unmount(), cancelFrame(this.notifyUpdate), cancelFrame(this.render), this.valueSubscriptions.forEach((remove) => remove()), this.valueSubscriptions.clear(), this.removeFromVariantTree && this.removeFromVariantTree(), this.parent && this.parent.children.delete(this);
3198
3613
  for (const key in this.events)
3199
3614
  this.events[key].clear();
3200
3615
  for (const key in this.features) {
@@ -3204,11 +3619,13 @@ class VisualElement {
3204
3619
  this.current = null;
3205
3620
  }
3206
3621
  bindToMotionValue(key, value) {
3622
+ this.valueSubscriptions.has(key) && this.valueSubscriptions.get(key)();
3207
3623
  const valueIsTransform = transformProps.has(key), removeOnChange = value.on("change", (latestValue) => {
3208
3624
  this.latestValues[key] = latestValue, this.props.onUpdate && frame.preRender(this.notifyUpdate), valueIsTransform && this.projection && (this.projection.isTransformDirty = !0);
3209
3625
  }), removeOnRenderRequest = value.on("renderRequest", this.scheduleRender);
3210
- this.valueSubscriptions.set(key, () => {
3211
- removeOnChange(), removeOnRenderRequest(), value.owner && value.stop();
3626
+ let removeSyncCheck;
3627
+ window.MotionCheckAppearSync && (removeSyncCheck = window.MotionCheckAppearSync(this, key, value)), this.valueSubscriptions.set(key, () => {
3628
+ removeOnChange(), removeOnRenderRequest(), removeSyncCheck && removeSyncCheck(), value.owner && value.stop();
3212
3629
  });
3213
3630
  }
3214
3631
  sortNodePosition(other) {
@@ -3369,595 +3786,221 @@ class VisualElement {
3369
3786
  this.events[eventName] && this.events[eventName].notify(...args);
3370
3787
  }
3371
3788
  }
3372
- class DOMVisualElement extends VisualElement {
3373
- constructor() {
3374
- super(...arguments), this.KeyframeResolver = DOMKeyframesResolver;
3375
- }
3376
- sortInstanceNodePosition(a2, b2) {
3377
- return a2.compareDocumentPosition(b2) & 2 ? 1 : -1;
3378
- }
3379
- getBaseTargetFromProps(props2, key) {
3380
- return props2.style ? props2.style[key] : void 0;
3381
- }
3382
- removeValueFromRenderState(key, { vars, style }) {
3383
- delete vars[key], delete style[key];
3384
- }
3385
- }
3386
- function getComputedStyle$1(element) {
3387
- return window.getComputedStyle(element);
3388
- }
3389
- class HTMLVisualElement extends DOMVisualElement {
3390
- constructor() {
3391
- super(...arguments), this.type = "html", this.applyWillChange = !0, this.renderInstance = renderHTML;
3392
- }
3393
- readValueFromInstance(instance, key) {
3394
- if (transformProps.has(key)) {
3395
- const defaultType = getDefaultValueType(key);
3396
- return defaultType && defaultType.default || 0;
3397
- } else {
3398
- const computedStyle = getComputedStyle$1(instance), value = (isCSSVariableName(key) ? computedStyle.getPropertyValue(key) : computedStyle[key]) || 0;
3399
- return typeof value == "string" ? value.trim() : value;
3400
- }
3401
- }
3402
- measureInstanceViewportBox(instance, { transformPagePoint }) {
3403
- return measureViewportBox(instance, transformPagePoint);
3404
- }
3405
- build(renderState, latestValues, props2) {
3406
- buildHTMLStyles(renderState, latestValues, props2.transformTemplate);
3407
- }
3408
- scrapeMotionValuesFromProps(props2, prevProps, visualElement) {
3409
- return scrapeMotionValuesFromProps$1(props2, prevProps, visualElement);
3410
- }
3411
- handleChildMotionValue() {
3412
- this.childSubscription && (this.childSubscription(), delete this.childSubscription);
3413
- const { children } = this.props;
3414
- isMotionValue(children) && (this.childSubscription = children.on("change", (latest) => {
3415
- this.current && (this.current.textContent = `${latest}`);
3416
- }));
3417
- }
3418
- }
3419
- class SVGVisualElement extends DOMVisualElement {
3420
- constructor() {
3421
- super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox = createBox;
3422
- }
3423
- getBaseTargetFromProps(props2, key) {
3424
- return props2[key];
3425
- }
3426
- readValueFromInstance(instance, key) {
3427
- if (transformProps.has(key)) {
3428
- const defaultType = getDefaultValueType(key);
3429
- return defaultType && defaultType.default || 0;
3430
- }
3431
- return key = camelCaseAttributes.has(key) ? key : camelToDash(key), instance.getAttribute(key);
3432
- }
3433
- scrapeMotionValuesFromProps(props2, prevProps, visualElement) {
3434
- return scrapeMotionValuesFromProps(props2, prevProps, visualElement);
3435
- }
3436
- 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$3(...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$1(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 d(...e2) {
3836
- return u$4(r$1, e2, e$1(o));
3837
- }
3838
- var r$1 = ([e2]) => e2, o = () => a, a = (e2) => ({ hasNext: !0, next: e2, done: !0 });
3839
- function t$2(...r2) {
3840
- return u$4(Object.entries, r2);
3841
- }
3842
- function t$1(...a2) {
3843
- return u$4(e, a2);
3844
- }
3845
- var e = (a2, o2) => o2.every((l2) => l2(a2));
3846
- function y$1(...a2) {
3847
- return u$4(r, a2);
3848
- }
3849
- var r = (a2, o2) => o2.some((e2) => e2(a2));
3850
- function u$1(...e2) {
3851
- return u$4(b(Math.ceil), e2);
3852
- }
3853
- function u(...n2) {
3854
- return u$4(i, n2);
3855
- }
3856
- var i = (n2, { min: e2, max: r2 }) => e2 !== void 0 && n2 < e2 ? e2 : r2 !== void 0 && n2 > r2 ? r2 : n2;
3857
- function isString(value) {
3858
- return value != null && typeof value == "string";
3859
- }
3860
- class BaseError extends CustomError {
3861
- constructor(message, options) {
3862
- super(message, options), Object.defineProperty(this, "name", { value: "BaseError" });
3863
- }
3864
- }
3865
- class NullableError extends BaseError {
3866
- constructor(message, options) {
3867
- super(message, options), Object.defineProperty(this, "name", { value: "NullableError" });
3868
- }
3869
- }
3870
- class InvariantError extends BaseError {
3871
- constructor(message, options) {
3872
- super(message, options), Object.defineProperty(this, "name", { value: "InvariantError" });
3789
+ class DOMVisualElement extends VisualElement {
3790
+ constructor() {
3791
+ super(...arguments), this.KeyframeResolver = DOMKeyframesResolver;
3873
3792
  }
3874
- }
3875
- function nonNullable(value, message) {
3876
- if (typeof value > "u" || value == null)
3877
- throw new NullableError(message ?? `Expected defined value, but received ${value}`);
3878
- return value;
3879
- }
3880
- function invariant(condition, message) {
3881
- if (!condition)
3882
- throw new InvariantError(message ?? "Invariant failed");
3883
- }
3884
- class NonExhaustiveError extends BaseError {
3885
- constructor(message, options) {
3886
- super(message, options), Object.defineProperty(this, "name", { value: "NonExhaustiveError" });
3793
+ sortInstanceNodePosition(a2, b2) {
3794
+ return a2.compareDocumentPosition(b2) & 2 ? 1 : -1;
3795
+ }
3796
+ getBaseTargetFromProps(props2, key) {
3797
+ return props2.style ? props2.style[key] : void 0;
3798
+ }
3799
+ removeValueFromRenderState(key, { vars: vars2, style }) {
3800
+ delete vars2[key], delete style[key];
3887
3801
  }
3888
3802
  }
3889
- function nonexhaustive(value) {
3890
- throw new NonExhaustiveError(`NonExhaustive value: ${value}`);
3803
+ function getComputedStyle$1(element) {
3804
+ return window.getComputedStyle(element);
3891
3805
  }
3892
- const ElementShapes = [
3893
- "rectangle",
3894
- "person",
3895
- "browser",
3896
- "mobile",
3897
- "cylinder",
3898
- "storage",
3899
- "queue"
3900
- ], 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;
3901
- function whereOperatorAsPredicate(operator) {
3902
- switch (!0) {
3903
- case isTagEqual(operator): {
3904
- if ("eq" in operator.tag) {
3905
- const tag2 = operator.tag.eq;
3906
- return (value) => Array.isArray(value.tags) && value.tags.includes(tag2);
3907
- }
3908
- const tag = operator.tag.neq;
3909
- return (value) => !Array.isArray(value.tags) || !value.tags.includes(tag);
3910
- }
3911
- case isKindEqual(operator): {
3912
- if ("eq" in operator.kind) {
3913
- const kind2 = operator.kind.eq;
3914
- return (value) => value.kind === kind2;
3915
- }
3916
- const kind = operator.kind.neq;
3917
- return (value) => e$3(value.kind) || value.kind !== kind;
3918
- }
3919
- case isNotOperator(operator): {
3920
- const predicate = whereOperatorAsPredicate(operator.not);
3921
- return o$1(predicate);
3806
+ class HTMLVisualElement extends DOMVisualElement {
3807
+ constructor() {
3808
+ super(...arguments), this.type = "html", this.applyWillChange = !0, this.renderInstance = renderHTML;
3809
+ }
3810
+ readValueFromInstance(instance, key) {
3811
+ if (transformProps.has(key)) {
3812
+ const defaultType = getDefaultValueType(key);
3813
+ return defaultType && defaultType.default || 0;
3814
+ } else {
3815
+ const computedStyle = getComputedStyle$1(instance), value = (isCSSVariableName(key) ? computedStyle.getPropertyValue(key) : computedStyle[key]) || 0;
3816
+ return typeof value == "string" ? value.trim() : value;
3922
3817
  }
3923
- case isAndOperator(operator): {
3924
- const predicates = operator.and.map(whereOperatorAsPredicate);
3925
- return t$1(predicates);
3818
+ }
3819
+ measureInstanceViewportBox(instance, { transformPagePoint }) {
3820
+ return measureViewportBox(instance, transformPagePoint);
3821
+ }
3822
+ build(renderState, latestValues, props2) {
3823
+ buildHTMLStyles(renderState, latestValues, props2.transformTemplate);
3824
+ }
3825
+ scrapeMotionValuesFromProps(props2, prevProps, visualElement) {
3826
+ return scrapeMotionValuesFromProps$1(props2, prevProps, visualElement);
3827
+ }
3828
+ handleChildMotionValue() {
3829
+ this.childSubscription && (this.childSubscription(), delete this.childSubscription);
3830
+ const { children } = this.props;
3831
+ isMotionValue(children) && (this.childSubscription = children.on("change", (latest) => {
3832
+ this.current && (this.current.textContent = `${latest}`);
3833
+ }));
3834
+ }
3835
+ }
3836
+ class SVGVisualElement extends DOMVisualElement {
3837
+ constructor() {
3838
+ super(...arguments), this.type = "svg", this.isSVGTag = !1, this.measureInstanceViewportBox = createBox;
3839
+ }
3840
+ getBaseTargetFromProps(props2, key) {
3841
+ return props2[key];
3842
+ }
3843
+ readValueFromInstance(instance, key) {
3844
+ if (transformProps.has(key)) {
3845
+ const defaultType = getDefaultValueType(key);
3846
+ return defaultType && defaultType.default || 0;
3926
3847
  }
3927
- case isOrOperator(operator): {
3928
- const predicates = operator.or.map(whereOperatorAsPredicate);
3929
- return y$1(predicates);
3848
+ return key = camelCaseAttributes.has(key) ? key : camelToDash(key), instance.getAttribute(key);
3849
+ }
3850
+ scrapeMotionValuesFromProps(props2, prevProps, visualElement) {
3851
+ return scrapeMotionValuesFromProps(props2, prevProps, visualElement);
3852
+ }
3853
+ build(renderState, latestValues, props2) {
3854
+ buildSVGAttrs(renderState, latestValues, this.isSVGTag, props2.transformTemplate);
3855
+ }
3856
+ renderInstance(instance, renderState, styleProp, projection) {
3857
+ renderSVG(instance, renderState, styleProp, projection);
3858
+ }
3859
+ mount(instance) {
3860
+ this.isSVGTag = isSVGTag(instance.tagName), super.mount(instance);
3861
+ }
3862
+ }
3863
+ const createDomVisualElement = (Component2, options) => isSVGComponent(Component2) ? new SVGVisualElement(options) : new HTMLVisualElement(options, {
3864
+ allowProjection: Component2 !== Fragment$1
3865
+ }), m = createMotionProxy(createDomMotionConfig);
3866
+ class PopChildMeasure extends React.Component {
3867
+ getSnapshotBeforeUpdate(prevProps) {
3868
+ const element = this.props.childRef.current;
3869
+ if (element && prevProps.isPresent && !this.props.isPresent) {
3870
+ const size = this.props.sizeRef.current;
3871
+ size.height = element.offsetHeight || 0, size.width = element.offsetWidth || 0, size.top = element.offsetTop, size.left = element.offsetLeft;
3930
3872
  }
3931
- default:
3932
- nonexhaustive(operator);
3873
+ return null;
3874
+ }
3875
+ /**
3876
+ * Required with getSnapshotBeforeUpdate to stop React complaining.
3877
+ */
3878
+ componentDidUpdate() {
3879
+ }
3880
+ render() {
3881
+ return this.props.children;
3933
3882
  }
3934
3883
  }
3935
- function StepEdgeId(step) {
3936
- return `step-${String(step).padStart(3, "0")}`;
3884
+ function PopChild({ children, isPresent }) {
3885
+ const id2 = useId$1(), ref = useRef$1(null), size = useRef$1({
3886
+ width: 0,
3887
+ height: 0,
3888
+ top: 0,
3889
+ left: 0
3890
+ }), { nonce } = useContext$1(MotionConfigContext);
3891
+ return useInsertionEffect(() => {
3892
+ const { width, height, top, left } = size.current;
3893
+ if (isPresent || !ref.current || !width || !height)
3894
+ return;
3895
+ ref.current.dataset.motionPopId = id2;
3896
+ const style = document.createElement("style");
3897
+ return nonce && (style.nonce = nonce), document.head.appendChild(style), style.sheet && style.sheet.insertRule(`
3898
+ [data-motion-pop-id="${id2}"] {
3899
+ position: absolute !important;
3900
+ width: ${width}px !important;
3901
+ height: ${height}px !important;
3902
+ top: ${top}px !important;
3903
+ left: ${left}px !important;
3904
+ }
3905
+ `), () => {
3906
+ document.head.removeChild(style);
3907
+ };
3908
+ }, [isPresent]), jsx(PopChildMeasure, { isPresent, childRef: ref, sizeRef: size, children: React.cloneElement(children, { ref }) });
3937
3909
  }
3938
- function isStepEdgeId(id2) {
3939
- return id2.startsWith("step-");
3910
+ const PresenceChild = ({ children, initial, isPresent, onExitComplete, custom: custom5, presenceAffectsLayout, mode }) => {
3911
+ const presenceChildren = useConstant(newChildrenMap), id2 = useId$1(), context = useMemo$1(
3912
+ () => ({
3913
+ id: id2,
3914
+ initial,
3915
+ isPresent,
3916
+ custom: custom5,
3917
+ onExitComplete: (childId) => {
3918
+ presenceChildren.set(childId, !0);
3919
+ for (const isComplete of presenceChildren.values())
3920
+ if (!isComplete)
3921
+ return;
3922
+ onExitComplete && onExitComplete();
3923
+ },
3924
+ register: (childId) => (presenceChildren.set(childId, !1), () => presenceChildren.delete(childId))
3925
+ }),
3926
+ /**
3927
+ * If the presence of a child affects the layout of the components around it,
3928
+ * we want to make a new context value to ensure they get re-rendered
3929
+ * so they can detect that layout change.
3930
+ */
3931
+ presenceAffectsLayout ? [Math.random()] : [isPresent]
3932
+ );
3933
+ return useMemo$1(() => {
3934
+ presenceChildren.forEach((_, key) => presenceChildren.set(key, !1));
3935
+ }, [isPresent]), React.useEffect(() => {
3936
+ !isPresent && !presenceChildren.size && onExitComplete && onExitComplete();
3937
+ }, [isPresent]), mode === "popLayout" && (children = jsx(PopChild, { isPresent, children })), jsx(PresenceContext.Provider, { value: context, children });
3938
+ };
3939
+ function newChildrenMap() {
3940
+ return /* @__PURE__ */ new Map();
3940
3941
  }
3941
- function extractStep(id2) {
3942
- if (!isStepEdgeId(id2))
3943
- throw new Error(`Invalid step edge id: ${id2}`);
3944
- return Number(id2.slice(5));
3942
+ const getChildKey = (child) => child.key || "";
3943
+ function onlyElements(children) {
3944
+ const filtered = [];
3945
+ return Children.forEach(children, (child) => {
3946
+ isValidElement(child) && filtered.push(child);
3947
+ }), filtered;
3945
3948
  }
3946
- function getBBoxCenter({
3947
- x: x2,
3948
- y: y2,
3949
- width,
3950
- height
3951
- }) {
3952
- return {
3953
- x: x2 + width / 2,
3954
- y: y2 + height / 2
3955
- };
3949
+ const AnimatePresence = ({ children, exitBeforeEnter, custom: custom5, initial = !0, onExitComplete, presenceAffectsLayout = !0, mode = "sync" }) => {
3950
+ 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);
3951
+ useIsomorphicLayoutEffect$2(() => {
3952
+ isInitialRender.current = !1, pendingPresentChildren.current = presentChildren;
3953
+ for (let i2 = 0; i2 < renderedChildren.length; i2++) {
3954
+ const key = getChildKey(renderedChildren[i2]);
3955
+ presentKeys.includes(key) ? exitComplete.delete(key) : exitComplete.get(key) !== !0 && exitComplete.set(key, !1);
3956
+ }
3957
+ }, [renderedChildren, presentKeys.length, presentKeys.join("-")]);
3958
+ const exitingChildren = [];
3959
+ if (presentChildren !== diffedChildren) {
3960
+ let nextChildren = [...presentChildren];
3961
+ for (let i2 = 0; i2 < renderedChildren.length; i2++) {
3962
+ const child = renderedChildren[i2], key = getChildKey(child);
3963
+ presentKeys.includes(key) || (nextChildren.splice(i2, 0, child), exitingChildren.push(child));
3964
+ }
3965
+ mode === "wait" && exitingChildren.length && (nextChildren = exitingChildren), setRenderedChildren(onlyElements(nextChildren)), setDiffedChildren(presentChildren);
3966
+ return;
3967
+ }
3968
+ const { forceRender } = useContext$1(LayoutGroupContext);
3969
+ return jsx(Fragment, { children: renderedChildren.map((child) => {
3970
+ const key = getChildKey(child), isPresent = presentChildren === renderedChildren || presentKeys.includes(key), onExit = () => {
3971
+ if (exitComplete.has(key))
3972
+ exitComplete.set(key, !0);
3973
+ else
3974
+ return;
3975
+ let isEveryExitComplete = !0;
3976
+ exitComplete.forEach((isExitComplete) => {
3977
+ isExitComplete || (isEveryExitComplete = !1);
3978
+ }), isEveryExitComplete && (forceRender?.(), setRenderedChildren(pendingPresentChildren.current), onExitComplete && onExitComplete());
3979
+ };
3980
+ 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);
3981
+ }) });
3982
+ };
3983
+ function LazyMotion({ children, features, strict = !1 }) {
3984
+ const [, setIsLoaded] = useState$1(!isLazyBundle(features)), loadedRenderer = useRef$1(void 0);
3985
+ if (!isLazyBundle(features)) {
3986
+ const { renderer, ...loadedFeatures } = features;
3987
+ loadedRenderer.current = renderer, loadFeatures(loadedFeatures);
3988
+ }
3989
+ return useEffect$1(() => {
3990
+ isLazyBundle(features) && features().then(({ renderer, ...loadedFeatures }) => {
3991
+ loadFeatures(loadedFeatures), loadedRenderer.current = renderer, setIsLoaded(!0);
3992
+ });
3993
+ }, []), jsx(LazyContext.Provider, { value: { renderer: loadedRenderer.current, strict }, children });
3956
3994
  }
3957
- function isAncestor(...args) {
3958
- const ancestor = isString(args[0]) ? args[0] : args[0].id;
3959
- return (isString(args[1]) ? args[1] : args[1].id).startsWith(ancestor + ".");
3995
+ function isLazyBundle(features) {
3996
+ return typeof features == "function";
3960
3997
  }
3998
+ const domAnimation = {
3999
+ renderer: createDomVisualElement,
4000
+ ...animations,
4001
+ ...gestureAnimations
4002
+ };
4003
+ var rootClassName = "likec4-diagram-root";
3961
4004
  function useSyncedRef(value) {
3962
4005
  const ref = useRef$1(value);
3963
4006
  return ref.current = value, useMemo$1(() => Object.freeze({
@@ -4328,26 +4371,26 @@ const pi$2 = Math.PI, tau$1 = 2 * pi$2, quart = pi$2 / 2, epsilon$2 = 1e-6, nMax
4328
4371
  if (t2 === 1)
4329
4372
  return points[order].t = 1, points[order];
4330
4373
  const mt = 1 - t2;
4331
- let p = points;
4374
+ let p2 = points;
4332
4375
  if (order === 0)
4333
4376
  return points[0].t = t2, points[0];
4334
4377
  if (order === 1) {
4335
4378
  const ret = {
4336
- x: mt * p[0].x + t2 * p[1].x,
4337
- y: mt * p[0].y + t2 * p[1].y,
4379
+ x: mt * p2[0].x + t2 * p2[1].x,
4380
+ y: mt * p2[0].y + t2 * p2[1].y,
4338
4381
  t: t2
4339
4382
  };
4340
- return _3d && (ret.z = mt * p[0].z + t2 * p[1].z), ret;
4383
+ return _3d && (ret.z = mt * p2[0].z + t2 * p2[1].z), ret;
4341
4384
  }
4342
4385
  if (order < 4) {
4343
- let mt2 = mt * mt, t22 = t2 * t2, a2, b2, c, d2 = 0;
4344
- 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);
4386
+ let mt2 = mt * mt, t22 = t2 * t2, a2, b2, c2, d2 = 0;
4387
+ 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);
4345
4388
  const ret = {
4346
- x: a2 * p[0].x + b2 * p[1].x + c * p[2].x + d2 * p[3].x,
4347
- y: a2 * p[0].y + b2 * p[1].y + c * p[2].y + d2 * p[3].y,
4389
+ x: a2 * p2[0].x + b2 * p2[1].x + c2 * p2[2].x + d2 * p2[3].x,
4390
+ y: a2 * p2[0].y + b2 * p2[1].y + c2 * p2[2].y + d2 * p2[3].y,
4348
4391
  t: t2
4349
4392
  };
4350
- return _3d && (ret.z = a2 * p[0].z + b2 * p[1].z + c * p[2].z + d2 * p[3].z), ret;
4393
+ return _3d && (ret.z = a2 * p2[0].z + b2 * p2[1].z + c2 * p2[2].z + d2 * p2[3].z), ret;
4351
4394
  }
4352
4395
  const dCpts = JSON.parse(JSON.stringify(points));
4353
4396
  for (; dCpts.length > 1; ) {
@@ -4361,40 +4404,40 @@ const pi$2 = Math.PI, tau$1 = 2 * pi$2, quart = pi$2 / 2, epsilon$2 = 1e-6, nMax
4361
4404
  return dCpts[0].t = t2, dCpts[0];
4362
4405
  },
4363
4406
  computeWithRatios: function(t2, points, ratios, _3d) {
4364
- const mt = 1 - t2, r2 = ratios, p = points;
4407
+ const mt = 1 - t2, r2 = ratios, p2 = points;
4365
4408
  let f1 = r2[0], f2 = r2[1], f3 = r2[2], f4 = r2[3], d2;
4366
- if (f1 *= mt, f2 *= t2, p.length === 2)
4409
+ if (f1 *= mt, f2 *= t2, p2.length === 2)
4367
4410
  return d2 = f1 + f2, {
4368
- x: (f1 * p[0].x + f2 * p[1].x) / d2,
4369
- y: (f1 * p[0].y + f2 * p[1].y) / d2,
4370
- z: _3d ? (f1 * p[0].z + f2 * p[1].z) / d2 : !1,
4411
+ x: (f1 * p2[0].x + f2 * p2[1].x) / d2,
4412
+ y: (f1 * p2[0].y + f2 * p2[1].y) / d2,
4413
+ z: _3d ? (f1 * p2[0].z + f2 * p2[1].z) / d2 : !1,
4371
4414
  t: t2
4372
4415
  };
4373
- if (f1 *= mt, f2 *= 2 * mt, f3 *= t2 * t2, p.length === 3)
4416
+ if (f1 *= mt, f2 *= 2 * mt, f3 *= t2 * t2, p2.length === 3)
4374
4417
  return d2 = f1 + f2 + f3, {
4375
- x: (f1 * p[0].x + f2 * p[1].x + f3 * p[2].x) / d2,
4376
- y: (f1 * p[0].y + f2 * p[1].y + f3 * p[2].y) / d2,
4377
- z: _3d ? (f1 * p[0].z + f2 * p[1].z + f3 * p[2].z) / d2 : !1,
4418
+ x: (f1 * p2[0].x + f2 * p2[1].x + f3 * p2[2].x) / d2,
4419
+ y: (f1 * p2[0].y + f2 * p2[1].y + f3 * p2[2].y) / d2,
4420
+ z: _3d ? (f1 * p2[0].z + f2 * p2[1].z + f3 * p2[2].z) / d2 : !1,
4378
4421
  t: t2
4379
4422
  };
4380
- if (f1 *= mt, f2 *= 1.5 * mt, f3 *= 3 * mt, f4 *= t2 * t2 * t2, p.length === 4)
4423
+ if (f1 *= mt, f2 *= 1.5 * mt, f3 *= 3 * mt, f4 *= t2 * t2 * t2, p2.length === 4)
4381
4424
  return d2 = f1 + f2 + f3 + f4, {
4382
- x: (f1 * p[0].x + f2 * p[1].x + f3 * p[2].x + f4 * p[3].x) / d2,
4383
- y: (f1 * p[0].y + f2 * p[1].y + f3 * p[2].y + f4 * p[3].y) / d2,
4384
- z: _3d ? (f1 * p[0].z + f2 * p[1].z + f3 * p[2].z + f4 * p[3].z) / d2 : !1,
4425
+ x: (f1 * p2[0].x + f2 * p2[1].x + f3 * p2[2].x + f4 * p2[3].x) / d2,
4426
+ y: (f1 * p2[0].y + f2 * p2[1].y + f3 * p2[2].y + f4 * p2[3].y) / d2,
4427
+ z: _3d ? (f1 * p2[0].z + f2 * p2[1].z + f3 * p2[2].z + f4 * p2[3].z) / d2 : !1,
4385
4428
  t: t2
4386
4429
  };
4387
4430
  },
4388
4431
  derive: function(points, _3d) {
4389
4432
  const dpoints = [];
4390
- for (let p = points, d2 = p.length, c = d2 - 1; d2 > 1; d2--, c--) {
4433
+ for (let p2 = points, d2 = p2.length, c2 = d2 - 1; d2 > 1; d2--, c2--) {
4391
4434
  const list = [];
4392
- for (let j = 0, dpt; j < c; j++)
4435
+ for (let j = 0, dpt; j < c2; j++)
4393
4436
  dpt = {
4394
- x: c * (p[j + 1].x - p[j].x),
4395
- y: c * (p[j + 1].y - p[j].y)
4396
- }, _3d && (dpt.z = c * (p[j + 1].z - p[j].z)), list.push(dpt);
4397
- dpoints.push(list), p = list;
4437
+ x: c2 * (p2[j + 1].x - p2[j].x),
4438
+ y: c2 * (p2[j + 1].y - p2[j].y)
4439
+ }, _3d && (dpt.z = c2 * (p2[j + 1].z - p2[j].z)), list.push(dpt);
4440
+ dpoints.push(list), p2 = list;
4398
4441
  }
4399
4442
  return dpoints;
4400
4443
  },
@@ -4422,9 +4465,9 @@ const pi$2 = Math.PI, tau$1 = 2 * pi$2, quart = pi$2 / 2, epsilon$2 = 1e-6, nMax
4422
4465
  };
4423
4466
  return v1.z !== void 0 && v2.z !== void 0 && (ret.z = v1.z + r2 * (v2.z - v1.z)), ret;
4424
4467
  },
4425
- pointToString: function(p) {
4426
- let s2 = p.x + "/" + p.y;
4427
- return typeof p.z < "u" && (s2 += "/" + p.z), s2;
4468
+ pointToString: function(p2) {
4469
+ let s2 = p2.x + "/" + p2.y;
4470
+ return typeof p2.z < "u" && (s2 += "/" + p2.z), s2;
4428
4471
  },
4429
4472
  pointsToString: function(points) {
4430
4473
  return "[" + points.map(utils.pointToString).join(", ") + "]";
@@ -4447,8 +4490,8 @@ const pi$2 = Math.PI, tau$1 = 2 * pi$2, quart = pi$2 / 2, epsilon$2 = 1e-6, nMax
4447
4490
  },
4448
4491
  closest: function(LUT, point2) {
4449
4492
  let mdist = pow(2, 63), mpos, d2;
4450
- return LUT.forEach(function(p, idx) {
4451
- d2 = utils.dist(point2, p), d2 < mdist && (mdist = d2, mpos = idx);
4493
+ return LUT.forEach(function(p2, idx) {
4494
+ d2 = utils.dist(point2, p2), d2 < mdist && (mdist = d2, mpos = idx);
4452
4495
  }), { mdist, mpos };
4453
4496
  },
4454
4497
  abcratio: function(t2, n2) {
@@ -4533,10 +4576,10 @@ const pi$2 = Math.PI, tau$1 = 2 * pi$2, quart = pi$2 / 2, epsilon$2 = 1e-6, nMax
4533
4576
  },
4534
4577
  getminmax: function(curve2, d2, list) {
4535
4578
  if (!list) return { min: 0, max: 0 };
4536
- let min2 = nMax, max2 = nMin, t2, c;
4579
+ let min2 = nMax, max2 = nMin, t2, c2;
4537
4580
  list.indexOf(0) === -1 && (list = [0].concat(list)), list.indexOf(1) === -1 && list.push(1);
4538
4581
  for (let i2 = 0, len = list.length; i2 < len; i2++)
4539
- t2 = list[i2], c = curve2.get(t2), c[d2] < min2 && (min2 = c[d2]), c[d2] > max2 && (max2 = c[d2]);
4582
+ t2 = list[i2], c2 = curve2.get(t2), c2[d2] < min2 && (min2 = c2[d2]), c2[d2] > max2 && (max2 = c2[d2]);
4540
4583
  return { min: min2, mid: (min2 + max2) / 2, max: max2, size: max2 - min2 };
4541
4584
  },
4542
4585
  align: function(points, line) {
@@ -4554,27 +4597,27 @@ const pi$2 = Math.PI, tau$1 = 2 * pi$2, quart = pi$2 / 2, epsilon$2 = 1e-6, nMax
4554
4597
  return 0 <= t2 && t2 <= 1;
4555
4598
  };
4556
4599
  if (order === 2) {
4557
- const a3 = aligned[0].y, b3 = aligned[1].y, c2 = aligned[2].y, d3 = a3 - 2 * b3 + c2;
4600
+ const a3 = aligned[0].y, b3 = aligned[1].y, c3 = aligned[2].y, d3 = a3 - 2 * b3 + c3;
4558
4601
  if (d3 !== 0) {
4559
- const m1 = -sqrt$1(b3 * b3 - a3 * c2), m2 = -a3 + b3, v12 = -(m1 + m2) / d3, v2 = -(-m1 + m2) / d3;
4602
+ const m1 = -sqrt$1(b3 * b3 - a3 * c3), m2 = -a3 + b3, v12 = -(m1 + m2) / d3, v2 = -(-m1 + m2) / d3;
4560
4603
  return [v12, v2].filter(reduce);
4561
- } else if (b3 !== c2 && d3 === 0)
4562
- return [(2 * b3 - c2) / (2 * b3 - 2 * c2)].filter(reduce);
4604
+ } else if (b3 !== c3 && d3 === 0)
4605
+ return [(2 * b3 - c3) / (2 * b3 - 2 * c3)].filter(reduce);
4563
4606
  return [];
4564
4607
  }
4565
4608
  const pa = aligned[0].y, pb = aligned[1].y, pc = aligned[2].y, pd = aligned[3].y;
4566
- let d2 = -pa + 3 * pb - 3 * pc + pd, a2 = 3 * pa - 6 * pb + 3 * pc, b2 = -3 * pa + 3 * pb, c = pa;
4609
+ let d2 = -pa + 3 * pb - 3 * pc + pd, a2 = 3 * pa - 6 * pb + 3 * pc, b2 = -3 * pa + 3 * pb, c2 = pa;
4567
4610
  if (utils.approximately(d2, 0)) {
4568
4611
  if (utils.approximately(a2, 0))
4569
- return utils.approximately(b2, 0) ? [] : [-c / b2].filter(reduce);
4570
- const q3 = sqrt$1(b2 * b2 - 4 * a2 * c), a22 = 2 * a2;
4612
+ return utils.approximately(b2, 0) ? [] : [-c2 / b2].filter(reduce);
4613
+ const q3 = sqrt$1(b2 * b2 - 4 * a2 * c2), a22 = 2 * a2;
4571
4614
  return [(q3 - b2) / a22, (-b2 - q3) / a22].filter(reduce);
4572
4615
  }
4573
- a2 /= d2, b2 /= d2, c /= d2;
4574
- 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;
4616
+ a2 /= d2, b2 /= d2, c2 /= d2;
4617
+ 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;
4575
4618
  let u1, v1, x1, x2, x3;
4576
4619
  if (discriminant < 0) {
4577
- 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;
4620
+ 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;
4578
4621
  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);
4579
4622
  } else {
4580
4623
  if (discriminant === 0)
@@ -4585,18 +4628,18 @@ const pi$2 = Math.PI, tau$1 = 2 * pi$2, quart = pi$2 / 2, epsilon$2 = 1e-6, nMax
4585
4628
  }
4586
4629
  }
4587
4630
  },
4588
- droots: function(p) {
4589
- if (p.length === 3) {
4590
- const a2 = p[0], b2 = p[1], c = p[2], d2 = a2 - 2 * b2 + c;
4631
+ droots: function(p2) {
4632
+ if (p2.length === 3) {
4633
+ const a2 = p2[0], b2 = p2[1], c2 = p2[2], d2 = a2 - 2 * b2 + c2;
4591
4634
  if (d2 !== 0) {
4592
- const m1 = -sqrt$1(b2 * b2 - a2 * c), m2 = -a2 + b2, v1 = -(m1 + m2) / d2, v2 = -(-m1 + m2) / d2;
4635
+ const m1 = -sqrt$1(b2 * b2 - a2 * c2), m2 = -a2 + b2, v1 = -(m1 + m2) / d2, v2 = -(-m1 + m2) / d2;
4593
4636
  return [v1, v2];
4594
- } else if (b2 !== c && d2 === 0)
4595
- return [(2 * b2 - c) / (2 * (b2 - c))];
4637
+ } else if (b2 !== c2 && d2 === 0)
4638
+ return [(2 * b2 - c2) / (2 * (b2 - c2))];
4596
4639
  return [];
4597
4640
  }
4598
- if (p.length === 2) {
4599
- const a2 = p[0], b2 = p[1];
4641
+ if (p2.length === 2) {
4642
+ const a2 = p2[0], b2 = p2[1];
4600
4643
  return a2 !== b2 ? [a2 / (a2 - b2)] : [];
4601
4644
  }
4602
4645
  return [];
@@ -4616,7 +4659,7 @@ const pi$2 = Math.PI, tau$1 = 2 * pi$2, quart = pi$2 / 2, epsilon$2 = 1e-6, nMax
4616
4659
  },
4617
4660
  inflections: function(points) {
4618
4661
  if (points.length < 4) return [];
4619
- 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);
4662
+ 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);
4620
4663
  if (utils.approximately(v1, 0)) {
4621
4664
  if (!utils.approximately(v2, 0)) {
4622
4665
  let t2 = -v3 / v2;
@@ -4701,9 +4744,9 @@ class PolyBezier {
4701
4744
  return this.curves[idx];
4702
4745
  }
4703
4746
  bbox() {
4704
- const c = this.curves;
4705
- for (var bbox = c[0].bbox(), i2 = 1; i2 < c.length; i2++)
4706
- utils.expandbox(bbox, c[i2].bbox());
4747
+ const c2 = this.curves;
4748
+ for (var bbox = c2[0].bbox(), i2 = 1; i2 < c2.length; i2++)
4749
+ utils.expandbox(bbox, c2[i2].bbox());
4707
4750
  return bbox;
4708
4751
  }
4709
4752
  offset(d2) {
@@ -4751,7 +4794,7 @@ class Bezier {
4751
4794
  const order = this.order = points.length - 1, dims = this.dims = ["x", "y"];
4752
4795
  _3d && dims.push("z"), this.dimlen = dims.length;
4753
4796
  const aligned = utils.align(points, { p1: points[0], p2: points[order] }), baselength = utils.dist(points[0], points[order]);
4754
- this._linear = aligned.reduce((t2, p) => t2 + abs(p.y), 0) < baselength / 50, this._lut = [], this._t1 = 0, this._t2 = 1, this.update();
4797
+ this._linear = aligned.reduce((t2, p2) => t2 + abs(p2.y), 0) < baselength / 50, this._lut = [], this._t1 = 0, this._t2 = 1, this.update();
4755
4798
  }
4756
4799
  static quadraticFromPoints(p1, p2, p3, t2) {
4757
4800
  if (typeof t2 > "u" && (t2 = 0.5), t2 === 0)
@@ -4788,9 +4831,9 @@ class Bezier {
4788
4831
  }
4789
4832
  toSVG() {
4790
4833
  if (this._3d) return !1;
4791
- const p = this.points, x2 = p[0].x, y2 = p[0].y, s2 = ["M", x2, y2, this.order === 2 ? "Q" : "C"];
4792
- for (let i2 = 1, last = p.length; i2 < last; i2++)
4793
- s2.push(p[i2].x), s2.push(p[i2].y);
4834
+ const p2 = this.points, x2 = p2[0].x, y2 = p2[0].y, s2 = ["M", x2, y2, this.order === 2 ? "Q" : "C"];
4835
+ for (let i2 = 1, last = p2.length; i2 < last; i2++)
4836
+ s2.push(p2[i2].x), s2.push(p2[i2].y);
4794
4837
  return s2.join(" ");
4795
4838
  }
4796
4839
  setRatios(ratios) {
@@ -4803,8 +4846,8 @@ class Bezier {
4803
4846
  print !== this._print && (this._print = print, this.update());
4804
4847
  }
4805
4848
  coordDigest() {
4806
- return this.points.map(function(c, pos) {
4807
- return "" + pos + c.x + c.y + (c.z ? c.z : 0);
4849
+ return this.points.map(function(c2, pos) {
4850
+ return "" + pos + c2.x + c2.y + (c2.z ? c2.z : 0);
4808
4851
  }).join("");
4809
4852
  }
4810
4853
  update() {
@@ -4836,24 +4879,24 @@ class Bezier {
4836
4879
  if (this.verify(), steps2 = steps2 || 100, this._lut.length === steps2 + 1)
4837
4880
  return this._lut;
4838
4881
  this._lut = [], steps2++, this._lut = [];
4839
- for (let i2 = 0, p, t2; i2 < steps2; i2++)
4840
- t2 = i2 / (steps2 - 1), p = this.compute(t2), p.t = t2, this._lut.push(p);
4882
+ for (let i2 = 0, p2, t2; i2 < steps2; i2++)
4883
+ t2 = i2 / (steps2 - 1), p2 = this.compute(t2), p2.t = t2, this._lut.push(p2);
4841
4884
  return this._lut;
4842
4885
  }
4843
4886
  on(point2, error) {
4844
4887
  error = error || 5;
4845
4888
  const lut = this.getLUT(), hits = [];
4846
- for (let i2 = 0, c, t2 = 0; i2 < lut.length; i2++)
4847
- c = lut[i2], utils.dist(c, point2) < error && (hits.push(c), t2 += i2 / lut.length);
4889
+ for (let i2 = 0, c2, t2 = 0; i2 < lut.length; i2++)
4890
+ c2 = lut[i2], utils.dist(c2, point2) < error && (hits.push(c2), t2 += i2 / lut.length);
4848
4891
  return hits.length ? t /= hits.length : !1;
4849
4892
  }
4850
4893
  project(point2) {
4851
4894
  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;
4852
- let mdist = closest.mdist, t3 = t1, ft = t3, p;
4895
+ let mdist = closest.mdist, t3 = t1, ft = t3, p2;
4853
4896
  mdist += 1;
4854
4897
  for (let d2; t3 < t2 + step; t3 += step)
4855
- p = this.compute(t3), d2 = utils.dist(point2, p), d2 < mdist && (mdist = d2, ft = t3);
4856
- return ft = ft < 0 ? 0 : ft > 1 ? 1 : ft, p = this.compute(ft), p.t = ft, p.d = mdist, p;
4898
+ p2 = this.compute(t3), d2 = utils.dist(point2, p2), d2 < mdist && (mdist = d2, ft = t3);
4899
+ return ft = ft < 0 ? 0 : ft > 1 ? 1 : ft, p2 = this.compute(ft), p2.t = ft, p2.d = mdist, p2;
4857
4900
  }
4858
4901
  get(t2) {
4859
4902
  return this.compute(t2);
@@ -4865,13 +4908,13 @@ class Bezier {
4865
4908
  return this.ratios ? utils.computeWithRatios(t2, this.points, this.ratios, this._3d) : utils.compute(t2, this.points, this._3d, this.ratios);
4866
4909
  }
4867
4910
  raise() {
4868
- const p = this.points, np = [p[0]], k = p.length;
4911
+ const p2 = this.points, np = [p2[0]], k = p2.length;
4869
4912
  for (let i2 = 1, pi2, pim; i2 < k; i2++)
4870
- pi2 = p[i2], pim = p[i2 - 1], np[i2] = {
4913
+ pi2 = p2[i2], pim = p2[i2 - 1], np[i2] = {
4871
4914
  x: (k - i2) / k * pi2.x + i2 / k * pim.x,
4872
4915
  y: (k - i2) / k * pi2.y + i2 / k * pim.y
4873
4916
  };
4874
- return np[k] = p[k - 1], new Bezier(np);
4917
+ return np[k] = p2[k - 1], new Bezier(np);
4875
4918
  }
4876
4919
  derivative(t2) {
4877
4920
  return utils.compute(t2, this.dpoints[0], this._3d);
@@ -4880,8 +4923,8 @@ class Bezier {
4880
4923
  return utils.compute(t2, this.dpoints[1], this._3d);
4881
4924
  }
4882
4925
  align() {
4883
- let p = this.points;
4884
- return new Bezier(utils.align(p, { p1: p[0], p2: p[p.length - 1] }));
4926
+ let p2 = this.points;
4927
+ return new Bezier(utils.align(p2, { p1: p2[0], p2: p2[p2.length - 1] }));
4885
4928
  }
4886
4929
  curvature(t2) {
4887
4930
  return utils.curvature(t2, this.dpoints[0], this.dpoints[1], this._3d);
@@ -4899,22 +4942,22 @@ class Bezier {
4899
4942
  __normal3(t2) {
4900
4943
  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);
4901
4944
  r1.x /= q1, r1.y /= q1, r1.z /= q1, r2.x /= q2, r2.y /= q2, r2.z /= q2;
4902
- const c = {
4945
+ const c2 = {
4903
4946
  x: r2.y * r1.z - r2.z * r1.y,
4904
4947
  y: r2.z * r1.x - r2.x * r1.z,
4905
4948
  z: r2.x * r1.y - r2.y * r1.x
4906
- }, m2 = sqrt(c.x * c.x + c.y * c.y + c.z * c.z);
4907
- c.x /= m2, c.y /= m2, c.z /= m2;
4949
+ }, m2 = sqrt(c2.x * c2.x + c2.y * c2.y + c2.z * c2.z);
4950
+ c2.x /= m2, c2.y /= m2, c2.z /= m2;
4908
4951
  const R = [
4909
- c.x * c.x,
4910
- c.x * c.y - c.z,
4911
- c.x * c.z + c.y,
4912
- c.x * c.y + c.z,
4913
- c.y * c.y,
4914
- c.y * c.z - c.x,
4915
- c.x * c.z - c.y,
4916
- c.y * c.z + c.x,
4917
- c.z * c.z
4952
+ c2.x * c2.x,
4953
+ c2.x * c2.y - c2.z,
4954
+ c2.x * c2.z + c2.y,
4955
+ c2.x * c2.y + c2.z,
4956
+ c2.y * c2.y,
4957
+ c2.y * c2.z - c2.x,
4958
+ c2.x * c2.z - c2.y,
4959
+ c2.y * c2.z + c2.x,
4960
+ c2.z * c2.z
4918
4961
  ];
4919
4962
  return {
4920
4963
  t: t2,
@@ -4924,12 +4967,12 @@ class Bezier {
4924
4967
  };
4925
4968
  }
4926
4969
  hull(t2) {
4927
- let p = this.points, _p = [], q = [], idx = 0;
4928
- for (q[idx++] = p[0], q[idx++] = p[1], q[idx++] = p[2], this.order === 3 && (q[idx++] = p[3]); p.length > 1; ) {
4970
+ let p2 = this.points, _p = [], q = [], idx = 0;
4971
+ for (q[idx++] = p2[0], q[idx++] = p2[1], q[idx++] = p2[2], this.order === 3 && (q[idx++] = p2[3]); p2.length > 1; ) {
4929
4972
  _p = [];
4930
- for (let i2 = 0, pt, l2 = p.length - 1; i2 < l2; i2++)
4931
- pt = utils.lerp(t2, p[i2], p[i2 + 1]), q[idx++] = pt, _p.push(pt);
4932
- p = _p;
4973
+ for (let i2 = 0, pt, l2 = p2.length - 1; i2 < l2; i2++)
4974
+ pt = utils.lerp(t2, p2[i2], p2[i2 + 1]), q[idx++] = pt, _p.push(pt);
4975
+ p2 = _p;
4933
4976
  }
4934
4977
  return q;
4935
4978
  }
@@ -4952,8 +4995,8 @@ class Bezier {
4952
4995
  function(dim) {
4953
4996
  let mfn = function(v) {
4954
4997
  return v[dim];
4955
- }, p = this.dpoints[0].map(mfn);
4956
- 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) {
4998
+ }, p2 = this.dpoints[0].map(mfn);
4999
+ 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) {
4957
5000
  return t2 >= 0 && t2 <= 1;
4958
5001
  }), roots = roots.concat(result[dim].sort(utils.numberSort));
4959
5002
  }.bind(this)
@@ -4975,21 +5018,21 @@ class Bezier {
4975
5018
  }
4976
5019
  offset(t2, d2) {
4977
5020
  if (typeof d2 < "u") {
4978
- const c = this.get(t2), n2 = this.normal(t2), ret = {
4979
- c,
5021
+ const c2 = this.get(t2), n2 = this.normal(t2), ret = {
5022
+ c: c2,
4980
5023
  n: n2,
4981
- x: c.x + n2.x * d2,
4982
- y: c.y + n2.y * d2
5024
+ x: c2.x + n2.x * d2,
5025
+ y: c2.y + n2.y * d2
4983
5026
  };
4984
- return this._3d && (ret.z = c.z + n2.z * d2), ret;
5027
+ return this._3d && (ret.z = c2.z + n2.z * d2), ret;
4985
5028
  }
4986
5029
  if (this._linear) {
4987
- const nv = this.normal(0), coords = this.points.map(function(p) {
5030
+ const nv = this.normal(0), coords = this.points.map(function(p2) {
4988
5031
  const ret = {
4989
- x: p.x + t2 * nv.x,
4990
- y: p.y + t2 * nv.y
5032
+ x: p2.x + t2 * nv.x,
5033
+ y: p2.y + t2 * nv.y
4991
5034
  };
4992
- return p.z && nv.z && (ret.z = p.z + t2 * nv.z), ret;
5035
+ return p2.z && nv.z && (ret.z = p2.z + t2 * nv.z), ret;
4993
5036
  });
4994
5037
  return [new Bezier(coords)];
4995
5038
  }
@@ -5027,9 +5070,9 @@ class Bezier {
5027
5070
  const o2 = this.order;
5028
5071
  let d3 = this.points.map((_, i2) => (1 - i2 / o2) * d1 + i2 / o2 * d2);
5029
5072
  return new Bezier(
5030
- this.points.map((p, i2) => ({
5031
- x: p.x + v.x * d3[i2],
5032
- y: p.y + v.y * d3[i2]
5073
+ this.points.map((p2, i2) => ({
5074
+ x: p2.x + v.x * d3[i2],
5075
+ y: p2.y + v.y * d3[i2]
5033
5076
  }))
5034
5077
  );
5035
5078
  }
@@ -5049,25 +5092,25 @@ class Bezier {
5049
5092
  if (!o2)
5050
5093
  throw new Error("cannot scale this curve. Try reducing it first.");
5051
5094
  return [0, 1].forEach(function(t2) {
5052
- const p = np[t2 * order] = utils.copy(points[t2 * order]);
5053
- p.x += (t2 ? r2 : r1) * v[t2].n.x, p.y += (t2 ? r2 : r1) * v[t2].n.y;
5095
+ const p2 = np[t2 * order] = utils.copy(points[t2 * order]);
5096
+ p2.x += (t2 ? r2 : r1) * v[t2].n.x, p2.y += (t2 ? r2 : r1) * v[t2].n.y;
5054
5097
  }), distanceFn ? ([0, 1].forEach(function(t2) {
5055
5098
  if (!(order === 2 && t2)) {
5056
- var p = points[t2 + 1], ov = {
5057
- x: p.x - o2.x,
5058
- y: p.y - o2.y
5099
+ var p2 = points[t2 + 1], ov = {
5100
+ x: p2.x - o2.x,
5101
+ y: p2.y - o2.y
5059
5102
  }, rc = distanceFn ? distanceFn((t2 + 1) / order) : d2;
5060
5103
  distanceFn && !clockwise && (rc = -rc);
5061
5104
  var m2 = sqrt(ov.x * ov.x + ov.y * ov.y);
5062
5105
  ov.x /= m2, ov.y /= m2, np[t2 + 1] = {
5063
- x: p.x + rc * ov.x,
5064
- y: p.y + rc * ov.y
5106
+ x: p2.x + rc * ov.x,
5107
+ y: p2.y + rc * ov.y
5065
5108
  };
5066
5109
  }
5067
5110
  }), new Bezier(np)) : ([0, 1].forEach((t2) => {
5068
5111
  if (order === 2 && t2) return;
5069
- const p = np[t2 * order], d3 = this.derivative(t2), p2 = { x: p.x + d3.x, y: p.y + d3.y };
5070
- np[t2 + 1] = utils.lli4(p, p2, o2, points[t2 + 1]);
5112
+ const p2 = np[t2 * order], d3 = this.derivative(t2), p22 = { x: p2.x + d3.x, y: p2.y + d3.y };
5113
+ np[t2 + 1] = utils.lli4(p2, p22, o2, points[t2 + 1]);
5071
5114
  }), new Bezier(np));
5072
5115
  }
5073
5116
  outline(d1, d2, d3, d4) {
@@ -5081,7 +5124,7 @@ class Bezier {
5081
5124
  return new PolyBezier(segments2);
5082
5125
  }
5083
5126
  const reduced = this.reduce(), len = reduced.length, fcurves = [];
5084
- let bcurves = [], p, alen = 0, tlen = this.length();
5127
+ let bcurves = [], p2, alen = 0, tlen = this.length();
5085
5128
  const graduated = typeof d3 < "u" && typeof d4 < "u";
5086
5129
  function linearDistanceFunction(s2, e2, tlen2, alen2, slen) {
5087
5130
  return function(v) {
@@ -5097,7 +5140,7 @@ class Bezier {
5097
5140
  segment.scale(linearDistanceFunction(-d2, -d4, tlen, alen, slen))
5098
5141
  )) : (fcurves.push(segment.scale(d1)), bcurves.push(segment.scale(-d2))), alen += slen;
5099
5142
  }), bcurves = bcurves.map(function(s2) {
5100
- 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;
5143
+ 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;
5101
5144
  }).reverse();
5102
5145
  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);
5103
5146
  return new PolyBezier(segments);
@@ -5125,8 +5168,8 @@ class Bezier {
5125
5168
  lineIntersects(line) {
5126
5169
  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);
5127
5170
  return utils.roots(this.points, line).filter((t2) => {
5128
- var p = this.get(t2);
5129
- return utils.between(p.x, mx, MX) && utils.between(p.y, my, MY);
5171
+ var p2 = this.get(t2);
5172
+ return utils.between(p2.x, mx, MX) && utils.between(p2.y, my, MY);
5130
5173
  });
5131
5174
  }
5132
5175
  selfintersects(curveIntersectionThreshold) {
@@ -5201,7 +5244,7 @@ const nodeToRect = (nd) => ({
5201
5244
  }), 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;
5202
5245
  function bezierControlPoints(diagramEdge) {
5203
5246
  let [start, ...bezierPoints] = diagramEdge.points;
5204
- invariant(start, "start should be defined");
5247
+ invariant$1(start, "start should be defined");
5205
5248
  const handles = [
5206
5249
  // start
5207
5250
  ];
@@ -5215,7 +5258,7 @@ function bezierControlPoints(diagramEdge) {
5215
5258
  });
5216
5259
  }), bezierPoints = rest, start = end;
5217
5260
  }
5218
- return invariant(bezierPoints.length === 0, "all points should be consumed"), handles;
5261
+ return invariant$1(bezierPoints.length === 0, "all points should be consumed"), handles;
5219
5262
  }
5220
5263
  const isClose = (a2, b2) => Math.abs(a2 - b2) < 3.1;
5221
5264
  function isSamePoint$1(a2, b2) {
@@ -5237,9 +5280,9 @@ function diagramViewToXYFlowData(view, opts) {
5237
5280
  const ns = "", nodeById = (id2) => nonNullable(nodeLookup.get(id2), `Node not found: ${id2}`);
5238
5281
  let next;
5239
5282
  for (; next = traverse.shift(); ) {
5240
- const { node, parent } = next;
5241
- node.children.length > 0 && traverse.push(...node.children.map((child) => ({ node: nodeById(child), parent: node })));
5242
- const isCompound = i$3(node.children, 1), position = {
5283
+ const { node, parent } = next, isCompound = i$3(node.children, 1);
5284
+ isCompound && traverse.push(...node.children.map((child) => ({ node: nodeById(child), parent: node })));
5285
+ const position = {
5243
5286
  x: node.position[0],
5244
5287
  y: node.position[1]
5245
5288
  };
@@ -5254,6 +5297,7 @@ function diagramViewToXYFlowData(view, opts) {
5254
5297
  },
5255
5298
  draggable,
5256
5299
  selectable: opts.selectable,
5300
+ focusable: opts.selectable && !isCompound,
5257
5301
  deletable: !1,
5258
5302
  position,
5259
5303
  zIndex: isCompound ? ZIndexes.Compound : ZIndexes.Element,
@@ -5271,7 +5315,11 @@ function diagramViewToXYFlowData(view, opts) {
5271
5315
  }
5272
5316
  for (const edge of view.edges) {
5273
5317
  const source = edge.source, target = edge.target, id2 = ns + edge.id;
5274
- invariant(i$3(edge.points, 2), "edge should have at least 2 points"), xyedges.push({
5318
+ if (!i$3(edge.points, 2)) {
5319
+ console.error("edge should have at least 2 points", edge);
5320
+ continue;
5321
+ }
5322
+ xyedges.push({
5275
5323
  id: id2,
5276
5324
  type: "relationship",
5277
5325
  source: ns + source,
@@ -5462,7 +5510,7 @@ function createDiagramStore(props2) {
5462
5510
  },
5463
5511
  focusOnNode: (nodeId) => {
5464
5512
  const { focusedNodeId, view, enableFocusMode } = get();
5465
- if (invariant(enableFocusMode, "focus mode is not enabled"), nodeId !== focusedNodeId) {
5513
+ if (invariant$1(enableFocusMode, "focus mode is not enabled"), nodeId !== focusedNodeId) {
5466
5514
  const notDimmed = new StringSet([nodeId]), dimmed2 = new StringSet();
5467
5515
  for (const edge of view.edges)
5468
5516
  edge.source === nodeId || edge.target === nodeId ? (notDimmed.add(edge.source), notDimmed.add(edge.target)) : dimmed2.add(edge.id);
@@ -5598,12 +5646,12 @@ function createDiagramStore(props2) {
5598
5646
  };
5599
5647
  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);
5600
5648
  const allX = [
5601
- ...data.edge.points.map((p) => p[0]),
5602
- ...(controlPoints ?? []).map((p) => p.x),
5649
+ ...data.edge.points.map((p2) => p2[0]),
5650
+ ...(controlPoints ?? []).map((p2) => p2.x),
5603
5651
  ..._updated.labelBBox ? [_updated.labelBBox.x, _updated.labelBBox.x + _updated.labelBBox.width] : []
5604
5652
  ], allY = [
5605
- ...data.edge.points.map((p) => p[1]),
5606
- ...(controlPoints ?? []).map((p) => p.y),
5653
+ ...data.edge.points.map((p2) => p2[1]),
5654
+ ...(controlPoints ?? []).map((p2) => p2.y),
5607
5655
  ..._updated.labelBBox ? [_updated.labelBBox.y, _updated.labelBBox.y + _updated.labelBBox.height] : []
5608
5656
  ], rect = boxToRect({
5609
5657
  x: Math.floor(Math.min(...allX)),
@@ -5651,9 +5699,9 @@ function createDiagramStore(props2) {
5651
5699
  if (!onNavigateTo)
5652
5700
  return;
5653
5701
  const xynode = xynodes2.find(({ id: id2 }) => id2 === xynodeId);
5654
- invariant(xynode, `xynode not found: ${xynodeId}`);
5702
+ invariant$1(xynode, `xynode not found: ${xynodeId}`);
5655
5703
  const element = view.nodes.find(({ id: id2 }) => id2 === xynodeId);
5656
- invariant(element?.navigateTo, `node is not navigable: ${xynodeId}`), cancelSaveManualLayout(), set(
5704
+ invariant$1(element?.navigateTo, `node is not navigable: ${xynodeId}`), cancelSaveManualLayout(), set(
5657
5705
  {
5658
5706
  lastClickedNodeId: xynodeId,
5659
5707
  lastOnNavigate: {
@@ -5723,7 +5771,7 @@ function createDiagramStore(props2) {
5723
5771
  },
5724
5772
  activateDynamicStep: (nextStep) => {
5725
5773
  const { isDynamicView, xyflow, xystore, fitViewPadding } = get();
5726
- invariant(isDynamicView, "view is not dynamic");
5774
+ invariant$1(isDynamicView, "view is not dynamic");
5727
5775
  const edgeId = StepEdgeId(nextStep), dimmed2 = new StringSet();
5728
5776
  let edge = null;
5729
5777
  for (const e2 of xyflow.getEdges()) {
@@ -5733,7 +5781,7 @@ function createDiagramStore(props2) {
5733
5781
  }
5734
5782
  dimmed2.add(e2.id);
5735
5783
  }
5736
- invariant(!!edge, `edge not found: ${edgeId}`);
5784
+ invariant$1(!!edge, `edge not found: ${edgeId}`);
5737
5785
  const selected = [];
5738
5786
  for (const n2 of xyflow.getNodes()) {
5739
5787
  if (n2.id === edge.source || n2.id === edge.target) {
@@ -5781,6 +5829,13 @@ function createDiagramStore(props2) {
5781
5829
  noReplace,
5782
5830
  "onInit"
5783
5831
  );
5832
+ },
5833
+ highlightByElementNotation: (notation, onlyOfKind) => {
5834
+ const { xynodes: xynodes2, xyedges: xyedges2 } = get(), dimmed2 = new StringSet(m$1(xyedges2, p$1("id")));
5835
+ xynodes2.forEach(({ id: id2, data }) => {
5836
+ const node = data.element;
5837
+ (node.shape !== notation.shape || node.color !== notation.color || !notation.kinds.includes(node.kind) || onlyOfKind && node.kind !== onlyOfKind) && dimmed2.add(id2);
5838
+ }), set({ dimmed: dimmed2 }, noReplace, "highlightByElementNotation");
5784
5839
  }
5785
5840
  }),
5786
5841
  {
@@ -5818,7 +5873,7 @@ function DiagramContextProvider({
5818
5873
  ), useUpdateEffect(
5819
5874
  () => {
5820
5875
  const current = store.current;
5821
- 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);
5876
+ 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);
5822
5877
  },
5823
5878
  [view, whereFilter],
5824
5879
  (a2, b2) => shallowEqual(a2[0], b2[0]) && deepEqual(a2[1], b2[1])
@@ -5879,7 +5934,7 @@ function FitViewOnViewportResize({ diagramApi }) {
5879
5934
  1e3
5880
5935
  ), null;
5881
5936
  }
5882
- function selector$3({ view, viewportChanged, fitViewPadding }) {
5937
+ function selector$4({ view, viewportChanged, fitViewPadding }) {
5883
5938
  return {
5884
5939
  layoutId: view.id + "_" + view.autoLayout + "_" + fitViewPadding,
5885
5940
  viewportNotMoved: !viewportChanged
@@ -5889,7 +5944,7 @@ function FitViewOnDiagramChange() {
5889
5944
  const {
5890
5945
  layoutId,
5891
5946
  viewportNotMoved
5892
- } = useDiagramState(selector$3, shallowEqual), diagramApi = useDiagramStoreApi(), [currentLayoutId, setCurrent] = useState$1(layoutId), requiresFit = layoutId !== currentLayoutId;
5947
+ } = useDiagramState(selector$4, shallowEqual), diagramApi = useDiagramStoreApi(), [currentLayoutId, setCurrent] = useState$1(layoutId), requiresFit = layoutId !== currentLayoutId;
5893
5948
  return useDebouncedEffect(
5894
5949
  () => {
5895
5950
  layoutId !== currentLayoutId && (setCurrent(layoutId), diagramApi.getState().fitDiagram(450));
@@ -6100,11 +6155,11 @@ Linear.prototype = {
6100
6155
  function curveLinear(context) {
6101
6156
  return new Linear(context);
6102
6157
  }
6103
- function x(p) {
6104
- return p[0];
6158
+ function x(p2) {
6159
+ return p2[0];
6105
6160
  }
6106
- function y(p) {
6107
- return p[1];
6161
+ function y(p2) {
6162
+ return p2[1];
6108
6163
  }
6109
6164
  function d3line(x$1, y$12) {
6110
6165
  var defined = constant(!0), context = null, curve2 = curveLinear, output = null, path = withPath(line);
@@ -6501,7 +6556,7 @@ const curveCatmullRomOpen = function custom4(alpha2) {
6501
6556
  Dot,
6502
6557
  ODot
6503
6558
  };
6504
- 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";
6559
+ 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";
6505
6560
  function getNodeIntersectionFromCenterToPoint(intersectionNode, { x: x1, y: y1 }) {
6506
6561
  const {
6507
6562
  width: intersectionNodeWidth,
@@ -6534,13 +6589,13 @@ const toMarker = (arrowType) => {
6534
6589
  };
6535
6590
  function bezierPath(bezierSpline) {
6536
6591
  let [start, ...points] = bezierSpline;
6537
- invariant(start, "start should be defined");
6592
+ invariant$1(start, "start should be defined");
6538
6593
  let path = `M ${start[0]},${start[1]}`;
6539
6594
  for (; i$3(points, 3); ) {
6540
6595
  const [cp1, cp2, end, ...rest] = points;
6541
6596
  path = path + ` C ${cp1[0]},${cp1[1]} ${cp2[0]},${cp2[1]} ${end[0]},${end[1]}`, points = rest;
6542
6597
  }
6543
- return invariant(points.length === 0, "all points should be consumed"), path;
6598
+ return invariant$1(points.length === 0, "all points should be consumed"), path;
6544
6599
  }
6545
6600
  const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
6546
6601
  const [ax, ay] = n(a2) ? a2 : [a2.x, a2.y], [bx, by] = n(b2) ? b2 : [b2.x, b2.y];
@@ -6564,7 +6619,7 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
6564
6619
  isHovered: s2.hoveredEdgeId === id2,
6565
6620
  isDimmed: s2.dimmed.has(id2),
6566
6621
  hasOpenSourceRelation: !!s2.onOpenSourceRelation
6567
- })), { 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), {
6622
+ })), { 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), {
6568
6623
  label,
6569
6624
  edge: {
6570
6625
  points: diagramEdgePoints,
@@ -6583,7 +6638,7 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
6583
6638
  x: label?.bbox.x ?? labelX,
6584
6639
  y: label?.bbox.y ?? labelY
6585
6640
  });
6586
- let edgePath;
6641
+ let edgePath2;
6587
6642
  if (isModified) {
6588
6643
  const sourceCenterPos = { x: sourceX, y: sourceY }, targetCenterPos = { x: targetX, y: targetY }, points = diagramEdge.dir === "back" ? [
6589
6644
  targetCenterPos,
@@ -6598,9 +6653,9 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
6598
6653
  getNodeIntersectionFromCenterToPoint(targetNode, a$1(controlPoints) ?? sourceCenterPos),
6599
6654
  targetCenterPos
6600
6655
  ];
6601
- edgePath = nonNullable(curve(points));
6656
+ edgePath2 = nonNullable(curve(points));
6602
6657
  } else
6603
- edgePath = bezierPath(diagramEdgePoints);
6658
+ edgePath2 = bezierPath(diagramEdgePoints);
6604
6659
  const svgPathRef = useRef$1(null);
6605
6660
  useEffect$1(() => {
6606
6661
  const path = svgPathRef.current;
@@ -6610,7 +6665,7 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
6610
6665
  y: Math.round(dompoint.y)
6611
6666
  };
6612
6667
  setLabelPosition((current) => isSamePoint(current, point2) ? current : point2);
6613
- }, [edgePath]), useDebouncedEffect(
6668
+ }, [edgePath2]), useDebouncedEffect(
6614
6669
  () => {
6615
6670
  !label || label.bbox.x === labelPos.x && label.bbox.y === labelPos.y || diagramStore.getState().xyflow.updateEdgeData(id2, {
6616
6671
  label: {
@@ -6677,8 +6732,8 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
6677
6732
  "g",
6678
6733
  {
6679
6734
  className: clsx(
6680
- container$4,
6681
- isDimmed && dimmed$2,
6735
+ container$5,
6736
+ isDimmed && dimmed$3,
6682
6737
  isControlPointDragging && controlDragging
6683
6738
  ),
6684
6739
  "data-likec4-color": color2,
@@ -6690,7 +6745,7 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
6690
6745
  "path",
6691
6746
  {
6692
6747
  className: clsx("react-flow__edge-interaction"),
6693
- d: edgePath,
6748
+ d: edgePath2,
6694
6749
  fill: "none",
6695
6750
  stroke: "transparent",
6696
6751
  strokeWidth: interactionWidth ?? 10
@@ -6705,7 +6760,7 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
6705
6760
  "path",
6706
6761
  {
6707
6762
  className: clsx("react-flow__edge-path", edgePathBg),
6708
- d: edgePath,
6763
+ d: edgePath2,
6709
6764
  style,
6710
6765
  strokeLinecap: "round"
6711
6766
  }
@@ -6715,7 +6770,7 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
6715
6770
  {
6716
6771
  ref: svgPathRef,
6717
6772
  className: clsx("react-flow__edge-path", cssEdgePath),
6718
- d: edgePath,
6773
+ d: edgePath2,
6719
6774
  style,
6720
6775
  strokeLinecap: "round",
6721
6776
  strokeDasharray,
@@ -6730,13 +6785,13 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
6730
6785
  onContextMenu: (e2) => {
6731
6786
  e2.preventDefault(), e2.stopPropagation();
6732
6787
  },
6733
- children: controlPoints.map((p, i2) => /* @__PURE__ */ jsx(
6788
+ children: controlPoints.map((p2, i2) => /* @__PURE__ */ jsx(
6734
6789
  "circle",
6735
6790
  {
6736
6791
  onPointerDown: (e2) => onControlPointerDown(i2, e2),
6737
6792
  className: controlPoint,
6738
- cx: p.x,
6739
- cy: p.y,
6793
+ cx: p2.x,
6794
+ cy: p2.y,
6740
6795
  r: 3
6741
6796
  },
6742
6797
  i2
@@ -6786,9 +6841,9 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
6786
6841
  {
6787
6842
  className: clsx([
6788
6843
  "nodrag nopan",
6789
- container$4,
6844
+ container$5,
6790
6845
  edgeLabel,
6791
- isDimmed && dimmed$2
6846
+ isDimmed && dimmed$3
6792
6847
  ]),
6793
6848
  style: {
6794
6849
  ...assignInlineVars({
@@ -6811,12 +6866,12 @@ const isSame = (a2, b2) => Math.abs(a2 - b2) < 2.5, isSamePoint = (a2, b2) => {
6811
6866
  onClick: onClick || void 0,
6812
6867
  children: [
6813
6868
  stepNum !== null && /* @__PURE__ */ jsx(Box, { className: stepEdgeNumber, children: stepNum }),
6814
- n$2(label?.text) && /* @__PURE__ */ jsx(Box, { className: edgeLabelText, children: label.text })
6869
+ n$1(label?.text) && /* @__PURE__ */ jsx(Box, { className: edgeLabelText, children: label.text })
6815
6870
  ]
6816
6871
  }
6817
6872
  ) });
6818
6873
  /**
6819
- * @license @tabler/icons-react v3.11.0 - MIT
6874
+ * @license @tabler/icons-react v3.14.0 - MIT
6820
6875
  *
6821
6876
  * This source code is licensed under the MIT license.
6822
6877
  * See the LICENSE file in the root directory of this source tree.
@@ -6843,7 +6898,7 @@ var defaultAttributes = {
6843
6898
  }
6844
6899
  };
6845
6900
  /**
6846
- * @license @tabler/icons-react v3.11.0 - MIT
6901
+ * @license @tabler/icons-react v3.14.0 - MIT
6847
6902
  *
6848
6903
  * This source code is licensed under the MIT license.
6849
6904
  * See the LICENSE file in the root directory of this source tree.
@@ -6876,182 +6931,210 @@ const createReactComponent = (type, iconName, iconNamePascal, iconNode) => {
6876
6931
  return Component2.displayName = `${iconNamePascal}`, Component2;
6877
6932
  };
6878
6933
  /**
6879
- * @license @tabler/icons-react v3.11.0 - MIT
6934
+ * @license @tabler/icons-react v3.14.0 - MIT
6880
6935
  *
6881
6936
  * This source code is licensed under the MIT license.
6882
6937
  * See the LICENSE file in the root directory of this source tree.
6883
6938
  */
6884
6939
  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" }]]);
6885
6940
  /**
6886
- * @license @tabler/icons-react v3.11.0 - MIT
6941
+ * @license @tabler/icons-react v3.14.0 - MIT
6887
6942
  *
6888
6943
  * This source code is licensed under the MIT license.
6889
6944
  * See the LICENSE file in the root directory of this source tree.
6890
6945
  */
6891
6946
  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" }]]);
6892
6947
  /**
6893
- * @license @tabler/icons-react v3.11.0 - MIT
6948
+ * @license @tabler/icons-react v3.14.0 - MIT
6949
+ *
6950
+ * This source code is licensed under the MIT license.
6951
+ * See the LICENSE file in the root directory of this source tree.
6952
+ */
6953
+ 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" }]]);
6954
+ /**
6955
+ * @license @tabler/icons-react v3.14.0 - MIT
6894
6956
  *
6895
6957
  * This source code is licensed under the MIT license.
6896
6958
  * See the LICENSE file in the root directory of this source tree.
6897
6959
  */
6898
6960
  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" }]]);
6899
6961
  /**
6900
- * @license @tabler/icons-react v3.11.0 - MIT
6962
+ * @license @tabler/icons-react v3.14.0 - MIT
6901
6963
  *
6902
6964
  * This source code is licensed under the MIT license.
6903
6965
  * See the LICENSE file in the root directory of this source tree.
6904
6966
  */
6905
6967
  var IconCheck = createReactComponent("outline", "check", "IconCheck", [["path", { d: "M5 12l5 5l10 -10", key: "svg-0" }]]);
6906
6968
  /**
6907
- * @license @tabler/icons-react v3.11.0 - MIT
6969
+ * @license @tabler/icons-react v3.14.0 - MIT
6908
6970
  *
6909
6971
  * This source code is licensed under the MIT license.
6910
6972
  * See the LICENSE file in the root directory of this source tree.
6911
6973
  */
6912
6974
  var IconChevronDown = createReactComponent("outline", "chevron-down", "IconChevronDown", [["path", { d: "M6 9l6 6l6 -6", key: "svg-0" }]]);
6913
6975
  /**
6914
- * @license @tabler/icons-react v3.11.0 - MIT
6976
+ * @license @tabler/icons-react v3.14.0 - MIT
6915
6977
  *
6916
6978
  * This source code is licensed under the MIT license.
6917
6979
  * See the LICENSE file in the root directory of this source tree.
6918
6980
  */
6919
6981
  var IconChevronLeft = createReactComponent("outline", "chevron-left", "IconChevronLeft", [["path", { d: "M15 6l-6 6l6 6", key: "svg-0" }]]);
6920
6982
  /**
6921
- * @license @tabler/icons-react v3.11.0 - MIT
6983
+ * @license @tabler/icons-react v3.14.0 - MIT
6922
6984
  *
6923
6985
  * This source code is licensed under the MIT license.
6924
6986
  * See the LICENSE file in the root directory of this source tree.
6925
6987
  */
6926
6988
  var IconChevronRight = createReactComponent("outline", "chevron-right", "IconChevronRight", [["path", { d: "M9 6l6 6l-6 6", key: "svg-0" }]]);
6927
6989
  /**
6928
- * @license @tabler/icons-react v3.11.0 - MIT
6990
+ * @license @tabler/icons-react v3.14.0 - MIT
6929
6991
  *
6930
6992
  * This source code is licensed under the MIT license.
6931
6993
  * See the LICENSE file in the root directory of this source tree.
6932
6994
  */
6933
6995
  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" }]]);
6934
6996
  /**
6935
- * @license @tabler/icons-react v3.11.0 - MIT
6997
+ * @license @tabler/icons-react v3.14.0 - MIT
6936
6998
  *
6937
6999
  * This source code is licensed under the MIT license.
6938
7000
  * See the LICENSE file in the root directory of this source tree.
6939
7001
  */
6940
7002
  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" }]]);
6941
7003
  /**
6942
- * @license @tabler/icons-react v3.11.0 - MIT
7004
+ * @license @tabler/icons-react v3.14.0 - MIT
6943
7005
  *
6944
7006
  * This source code is licensed under the MIT license.
6945
7007
  * See the LICENSE file in the root directory of this source tree.
6946
7008
  */
6947
7009
  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" }]]);
6948
7010
  /**
6949
- * @license @tabler/icons-react v3.11.0 - MIT
7011
+ * @license @tabler/icons-react v3.14.0 - MIT
6950
7012
  *
6951
7013
  * This source code is licensed under the MIT license.
6952
7014
  * See the LICENSE file in the root directory of this source tree.
6953
7015
  */
6954
7016
  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" }]]);
6955
7017
  /**
6956
- * @license @tabler/icons-react v3.11.0 - MIT
7018
+ * @license @tabler/icons-react v3.14.0 - MIT
6957
7019
  *
6958
7020
  * This source code is licensed under the MIT license.
6959
7021
  * See the LICENSE file in the root directory of this source tree.
6960
7022
  */
6961
7023
  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" }]]);
6962
7024
  /**
6963
- * @license @tabler/icons-react v3.11.0 - MIT
7025
+ * @license @tabler/icons-react v3.14.0 - MIT
6964
7026
  *
6965
7027
  * This source code is licensed under the MIT license.
6966
7028
  * See the LICENSE file in the root directory of this source tree.
6967
7029
  */
6968
7030
  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" }]]);
6969
7031
  /**
6970
- * @license @tabler/icons-react v3.11.0 - MIT
7032
+ * @license @tabler/icons-react v3.14.0 - MIT
7033
+ *
7034
+ * This source code is licensed under the MIT license.
7035
+ * See the LICENSE file in the root directory of this source tree.
7036
+ */
7037
+ 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" }]]);
7038
+ /**
7039
+ * @license @tabler/icons-react v3.14.0 - MIT
6971
7040
  *
6972
7041
  * This source code is licensed under the MIT license.
6973
7042
  * See the LICENSE file in the root directory of this source tree.
6974
7043
  */
6975
7044
  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" }]]);
6976
7045
  /**
6977
- * @license @tabler/icons-react v3.11.0 - MIT
7046
+ * @license @tabler/icons-react v3.14.0 - MIT
6978
7047
  *
6979
7048
  * This source code is licensed under the MIT license.
6980
7049
  * See the LICENSE file in the root directory of this source tree.
6981
7050
  */
6982
7051
  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" }]]);
6983
7052
  /**
6984
- * @license @tabler/icons-react v3.11.0 - MIT
7053
+ * @license @tabler/icons-react v3.14.0 - MIT
7054
+ *
7055
+ * This source code is licensed under the MIT license.
7056
+ * See the LICENSE file in the root directory of this source tree.
7057
+ */
7058
+ 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" }]]);
7059
+ /**
7060
+ * @license @tabler/icons-react v3.14.0 - MIT
6985
7061
  *
6986
7062
  * This source code is licensed under the MIT license.
6987
7063
  * See the LICENSE file in the root directory of this source tree.
6988
7064
  */
6989
7065
  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" }]]);
6990
7066
  /**
6991
- * @license @tabler/icons-react v3.11.0 - MIT
7067
+ * @license @tabler/icons-react v3.14.0 - MIT
6992
7068
  *
6993
7069
  * This source code is licensed under the MIT license.
6994
7070
  * See the LICENSE file in the root directory of this source tree.
6995
7071
  */
6996
7072
  var IconMenu = createReactComponent("outline", "menu", "IconMenu", [["path", { d: "M4 8l16 0", key: "svg-0" }], ["path", { d: "M4 16l16 0", key: "svg-1" }]]);
6997
7073
  /**
6998
- * @license @tabler/icons-react v3.11.0 - MIT
7074
+ * @license @tabler/icons-react v3.14.0 - MIT
6999
7075
  *
7000
7076
  * This source code is licensed under the MIT license.
7001
7077
  * See the LICENSE file in the root directory of this source tree.
7002
7078
  */
7003
7079
  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" }]]);
7004
7080
  /**
7005
- * @license @tabler/icons-react v3.11.0 - MIT
7081
+ * @license @tabler/icons-react v3.14.0 - MIT
7006
7082
  *
7007
7083
  * This source code is licensed under the MIT license.
7008
7084
  * See the LICENSE file in the root directory of this source tree.
7009
7085
  */
7010
7086
  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" }]]);
7011
7087
  /**
7012
- * @license @tabler/icons-react v3.11.0 - MIT
7088
+ * @license @tabler/icons-react v3.14.0 - MIT
7013
7089
  *
7014
7090
  * This source code is licensed under the MIT license.
7015
7091
  * See the LICENSE file in the root directory of this source tree.
7016
7092
  */
7017
7093
  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" }]]);
7018
7094
  /**
7019
- * @license @tabler/icons-react v3.11.0 - MIT
7095
+ * @license @tabler/icons-react v3.14.0 - MIT
7020
7096
  *
7021
7097
  * This source code is licensed under the MIT license.
7022
7098
  * See the LICENSE file in the root directory of this source tree.
7023
7099
  */
7024
7100
  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" }]]);
7025
7101
  /**
7026
- * @license @tabler/icons-react v3.11.0 - MIT
7102
+ * @license @tabler/icons-react v3.14.0 - MIT
7103
+ *
7104
+ * This source code is licensed under the MIT license.
7105
+ * See the LICENSE file in the root directory of this source tree.
7106
+ */
7107
+ 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" }]]);
7108
+ /**
7109
+ * @license @tabler/icons-react v3.14.0 - MIT
7027
7110
  *
7028
7111
  * This source code is licensed under the MIT license.
7029
7112
  * See the LICENSE file in the root directory of this source tree.
7030
7113
  */
7031
7114
  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" }]]);
7032
7115
  /**
7033
- * @license @tabler/icons-react v3.11.0 - MIT
7116
+ * @license @tabler/icons-react v3.14.0 - MIT
7034
7117
  *
7035
7118
  * This source code is licensed under the MIT license.
7036
7119
  * See the LICENSE file in the root directory of this source tree.
7037
7120
  */
7038
7121
  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" }]]);
7039
7122
  /**
7040
- * @license @tabler/icons-react v3.11.0 - MIT
7123
+ * @license @tabler/icons-react v3.14.0 - MIT
7041
7124
  *
7042
7125
  * This source code is licensed under the MIT license.
7043
7126
  * See the LICENSE file in the root directory of this source tree.
7044
7127
  */
7045
7128
  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" }]]);
7046
7129
  /**
7047
- * @license @tabler/icons-react v3.11.0 - MIT
7130
+ * @license @tabler/icons-react v3.14.0 - MIT
7048
7131
  *
7049
7132
  * This source code is licensed under the MIT license.
7050
7133
  * See the LICENSE file in the root directory of this source tree.
7051
7134
  */
7052
7135
  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" }]]);
7053
7136
  /**
7054
- * @license @tabler/icons-react v3.11.0 - MIT
7137
+ * @license @tabler/icons-react v3.14.0 - MIT
7055
7138
  *
7056
7139
  * This source code is licensed under the MIT license.
7057
7140
  * See the LICENSE file in the root directory of this source tree.
@@ -7068,6 +7151,7 @@ function NavigateToBtn({ xynodeId, className }) {
7068
7151
  onClick: (event) => {
7069
7152
  event.stopPropagation(), diagramApi.getState().triggerOnNavigateTo(xynodeId, event);
7070
7153
  },
7154
+ role: "button",
7071
7155
  onDoubleClick: (event) => event.stopPropagation(),
7072
7156
  children: /* @__PURE__ */ jsx(
7073
7157
  IconZoomScan,
@@ -7081,7 +7165,7 @@ function NavigateToBtn({ xynodeId, className }) {
7081
7165
  }
7082
7166
  );
7083
7167
  }
7084
- 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";
7168
+ 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";
7085
7169
  const isEqualProps$1 = (prev, next) => prev.id === next.id && deepEqual(prev.data.element, next.data.element), CompoundNodeMemo = /* @__PURE__ */ memo$1(function({
7086
7170
  id: id2,
7087
7171
  data: {
@@ -7112,10 +7196,10 @@ const isEqualProps$1 = (prev, next) => prev.id === next.id && deepEqual(prev.dat
7112
7196
  Box,
7113
7197
  {
7114
7198
  className: clsx(
7115
- container$3,
7199
+ container$4,
7116
7200
  "likec4-compound-node",
7117
7201
  opacity < 1 && "likec4-compound-transparent",
7118
- isDimmed && dimmed$1
7202
+ isDimmed && dimmed$2
7119
7203
  ),
7120
7204
  mod: {
7121
7205
  "compound-depth": depth,
@@ -7176,16 +7260,16 @@ const isEqualProps$1 = (prev, next) => prev.id === next.id && deepEqual(prev.dat
7176
7260
  )
7177
7261
  ] });
7178
7262
  }, isEqualProps$1);
7179
- 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";
7180
- const selector$2 = (s2) => {
7263
+ 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";
7264
+ const selector$3 = (s2) => {
7181
7265
  const target = s2.getContainer();
7182
7266
  return target ? { target } : null;
7183
7267
  };
7184
7268
  function ElementLink({
7185
7269
  element
7186
7270
  }) {
7187
- invariant(element.links, "ElementLink: links are required");
7188
- const id2 = useId$1(), portalProps = useDiagramState(selector$2);
7271
+ invariant$1(element.links, "ElementLink: links are required");
7272
+ const id2 = useId$1(), portalProps = useDiagramState(selector$3);
7189
7273
  return /* @__PURE__ */ jsx("div", { className: elementLink, "data-likec4-linkid": id2, children: /* @__PURE__ */ jsxs(
7190
7274
  HoverCard,
7191
7275
  {
@@ -7225,8 +7309,8 @@ function ElementLink({
7225
7309
  onClick: (e2) => e2.stopPropagation(),
7226
7310
  p: "xs",
7227
7311
  children: /* @__PURE__ */ jsx(Stack, { gap: "xs", children: element.links.map((link) => /* @__PURE__ */ jsxs(Group, { wrap: "nowrap", gap: "sm", children: [
7228
- /* @__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 }) }),
7229
- /* @__PURE__ */ jsx(CopyButton$1, { value: link, children: ({ copied, copy }) => /* @__PURE__ */ jsx(
7312
+ /* @__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 }) }),
7313
+ /* @__PURE__ */ jsx(CopyButton$1, { value: link.url, children: ({ copied, copy }) => /* @__PURE__ */ jsx(
7230
7314
  Button,
7231
7315
  {
7232
7316
  size: "compact-xs",
@@ -7237,7 +7321,7 @@ function ElementLink({
7237
7321
  children: copied ? "copied" : "copy"
7238
7322
  }
7239
7323
  ) })
7240
- ] }, link)) })
7324
+ ] }, link.url)) })
7241
7325
  }
7242
7326
  )
7243
7327
  ]
@@ -7480,7 +7564,7 @@ const Text = Text$1.withProps({
7480
7564
  {
7481
7565
  type: "target",
7482
7566
  position: Position.Top,
7483
- className: handleCenter
7567
+ className: handleCenter$1
7484
7568
  }
7485
7569
  ),
7486
7570
  /* @__PURE__ */ jsxs(
@@ -7488,8 +7572,8 @@ const Text = Text$1.withProps({
7488
7572
  {
7489
7573
  id: id2,
7490
7574
  className: clsx([
7491
- container$2,
7492
- isDimmed && dimmed,
7575
+ container$3,
7576
+ isDimmed && dimmed$1,
7493
7577
  animate !== "idle" && containerAnimated,
7494
7578
  "likec4-element-node"
7495
7579
  ]),
@@ -7537,7 +7621,7 @@ const Text = Text$1.withProps({
7537
7621
  {
7538
7622
  className: clsx(
7539
7623
  elementDataContainer,
7540
- n$2(elementIcon2) && hasIcon,
7624
+ n$1(elementIcon2) && hasIcon,
7541
7625
  "likec4-element"
7542
7626
  ),
7543
7627
  children: [
@@ -7578,7 +7662,7 @@ const Text = Text$1.withProps({
7578
7662
  {
7579
7663
  type: "source",
7580
7664
  position: Position.Top,
7581
- className: handleCenter
7665
+ className: handleCenter$1
7582
7666
  }
7583
7667
  )
7584
7668
  ] });
@@ -7951,9 +8035,9 @@ class Strength {
7951
8035
  * @param [w] weight
7952
8036
  * @return strength
7953
8037
  */
7954
- static create(a2, b2, c, w = 1) {
8038
+ static create(a2, b2, c2, w = 1) {
7955
8039
  let result = 0;
7956
- 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;
8040
+ 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;
7957
8041
  }
7958
8042
  /**
7959
8043
  * The 'required' symbolic strength.
@@ -8175,9 +8259,9 @@ class Solver {
8175
8259
  * Update the values of the variables.
8176
8260
  */
8177
8261
  updateVariables() {
8178
- let vars = this._varMap, rows = this._rowMap;
8179
- for (let i2 = 0, n2 = vars.size(); i2 < n2; ++i2) {
8180
- let pair = vars.itemAt(i2), rowPair = rows.find(pair.second);
8262
+ let vars2 = this._varMap, rows = this._rowMap;
8263
+ for (let i2 = 0, n2 = vars2.size(); i2 < n2; ++i2) {
8264
+ let pair = vars2.itemAt(i2), rowPair = rows.find(pair.second);
8181
8265
  rowPair !== void 0 ? pair.first.setValue(rowPair.second.constant()) : pair.first.setValue(0);
8182
8266
  }
8183
8267
  }
@@ -8388,9 +8472,9 @@ class Solver {
8388
8472
  _getDualEnteringSymbol(row) {
8389
8473
  let ratio = Number.MAX_VALUE, entering = INVALID_SYMBOL, cells = row.cells();
8390
8474
  for (let i2 = 0, n2 = cells.size(); i2 < n2; ++i2) {
8391
- let pair = cells.itemAt(i2), symbol = pair.first, c = pair.second;
8392
- if (c > 0 && symbol.type() !== SymbolType.Dummy) {
8393
- let r2 = this._objective.coefficientFor(symbol) / c;
8475
+ let pair = cells.itemAt(i2), symbol = pair.first, c2 = pair.second;
8476
+ if (c2 > 0 && symbol.type() !== SymbolType.Dummy) {
8477
+ let r2 = this._objective.coefficientFor(symbol) / c2;
8394
8478
  r2 < ratio && (ratio = r2, entering = symbol);
8395
8479
  }
8396
8480
  }
@@ -8444,17 +8528,17 @@ class Solver {
8444
8528
  _getMarkerLeavingSymbol(marker) {
8445
8529
  let dmax = Number.MAX_VALUE, r1 = dmax, r2 = dmax, invalid = INVALID_SYMBOL, first = invalid, second = invalid, third = invalid, rows = this._rowMap;
8446
8530
  for (let i2 = 0, n2 = rows.size(); i2 < n2; ++i2) {
8447
- let pair = rows.itemAt(i2), row = pair.second, c = row.coefficientFor(marker);
8448
- if (c === 0)
8531
+ let pair = rows.itemAt(i2), row = pair.second, c2 = row.coefficientFor(marker);
8532
+ if (c2 === 0)
8449
8533
  continue;
8450
8534
  let symbol = pair.first;
8451
8535
  if (symbol.type() === SymbolType.External)
8452
8536
  third = symbol;
8453
- else if (c < 0) {
8454
- let r3 = -row.constant() / c;
8537
+ else if (c2 < 0) {
8538
+ let r3 = -row.constant() / c2;
8455
8539
  r3 < r1 && (r1 = r3, first = symbol);
8456
8540
  } else {
8457
- let r3 = row.constant() / c;
8541
+ let r3 = row.constant() / c2;
8458
8542
  r3 < r2 && (r2 = r3, second = symbol);
8459
8543
  }
8460
8544
  }
@@ -8839,7 +8923,7 @@ function useLayoutConstraints() {
8839
8923
  cancelSaveManualLayout(), solverRef.current = createLayoutConstraints(xystore, xynode.id);
8840
8924
  },
8841
8925
  onNodeDrag: (_event, xynode) => {
8842
- invariant(solverRef.current, "solverRef.current should be defined"), solverRef.current?.onNodeDrag(xynode);
8926
+ invariant$1(solverRef.current, "solverRef.current should be defined"), solverRef.current?.onNodeDrag(xynode);
8843
8927
  },
8844
8928
  onNodeDragStop: (_event, _xynode) => {
8845
8929
  diagramApi.getState().scheduleSaveManualLayout(), solverRef.current = void 0;
@@ -8961,7 +9045,7 @@ function useXYFlowEvents() {
8961
9045
  setLastClickedEdge
8962
9046
  } = diagramApi.getState();
8963
9047
  lastClickedEdgeId !== xyedge.id && setLastClickedEdge(xyedge.id);
8964
- const isNotAFirstClick = lastClickedEdgeId === xyedge.id, isEdgeOfFocusedNode = n$2(focusedNodeId) && (focusedNodeId === xyedge.source || focusedNodeId === xyedge.target);
9048
+ const isNotAFirstClick = lastClickedEdgeId === xyedge.id, isEdgeOfFocusedNode = n$1(focusedNodeId) && (focusedNodeId === xyedge.source || focusedNodeId === xyedge.target);
8965
9049
  if (isDynamicView && enableDynamicViewWalkthrough && (isEdgeOfFocusedNode || isNotAFirstClick || l(activeDynamicViewStep))) {
8966
9050
  const nextStep = extractStep(xyedge.data.edge.id);
8967
9051
  if (activeDynamicViewStep !== nextStep) {
@@ -9020,12 +9104,12 @@ function useXYFlowEvents() {
9020
9104
  };
9021
9105
  }, [diagramApi]);
9022
9106
  }
9023
- const nodeTypes = {
9107
+ const nodeTypes$1 = {
9024
9108
  element: ElementNodeMemo,
9025
9109
  compound: CompoundNodeMemo
9026
- }, edgeTypes = {
9110
+ }, edgeTypes$1 = {
9027
9111
  relationship: RelationshipEdge
9028
- }, selector$1 = (s2) => ({
9112
+ }, selector$2 = (s2) => ({
9029
9113
  nodes: s2.xynodes,
9030
9114
  edges: s2.xyedges,
9031
9115
  onInit: s2.onInit,
@@ -9073,7 +9157,7 @@ function XYFlow({
9073
9157
  hasOnEdgeContextMenu,
9074
9158
  translateX,
9075
9159
  translateY
9076
- } = useDiagramState(selector$1, shallowEqual), [zoomOnDoubleClick, setZoomOnDoubleClick] = useState$1(zoomable), layoutConstraints = useLayoutConstraints(), handlers = useXYFlowEvents();
9160
+ } = useDiagramState(selector$2, shallowEqual), [zoomOnDoubleClick, setZoomOnDoubleClick] = useState$1(zoomable), layoutConstraints = useLayoutConstraints(), handlers = useXYFlowEvents();
9077
9161
  return useOnViewportChange({
9078
9162
  onEnd: ({ x: x2, y: y2, zoom }) => {
9079
9163
  const roundedX = Math.round(x2), roundedY = Math.round(y2);
@@ -9087,8 +9171,8 @@ function XYFlow({
9087
9171
  ...colorMode && { colorMode },
9088
9172
  nodes,
9089
9173
  edges,
9090
- nodeTypes,
9091
- edgeTypes,
9174
+ nodeTypes: nodeTypes$1,
9175
+ edgeTypes: edgeTypes$1,
9092
9176
  zoomOnPinch: zoomable,
9093
9177
  zoomOnScroll: !pannable && zoomable,
9094
9178
  ...!zoomable && {
@@ -9159,15 +9243,15 @@ function XYFlow({
9159
9243
  }
9160
9244
  );
9161
9245
  }
9162
- var container$1 = "_19ci0hj0", card = "_19ci0hj1", title = "_19ci0hj2", description = "_19ci0hj3";
9163
- const selector = (s2) => ({
9246
+ var container$2 = "_19ci0hj0", card$1 = "_19ci0hj1", title = "_19ci0hj2", description = "_19ci0hj3";
9247
+ const selector$1 = (s2) => ({
9164
9248
  id: s2.view.id,
9165
9249
  title: s2.view.title ?? "untitled",
9166
9250
  description: s2.view.description,
9167
9251
  links: s2.view.links
9168
9252
  });
9169
9253
  function DiagramTitlePanel() {
9170
- const { id: id2, title: title$12, description: description$12, links } = useDiagramState(selector), [isCollapsed, setCollapsed] = useLocalStorage({
9254
+ const { id: id2, title: title$12, description: description$12, links } = useDiagramState(selector$1), [isCollapsed, setCollapsed] = useLocalStorage({
9171
9255
  key: "diagram-title-panel-collapsed",
9172
9256
  defaultValue: !1
9173
9257
  }), toggle = () => setCollapsed((v) => !v);
@@ -9180,7 +9264,7 @@ function DiagramTitlePanel() {
9180
9264
  opacity: 0.05,
9181
9265
  scale: 0.6
9182
9266
  },
9183
- className: clsx("react-flow__panel", container$1),
9267
+ className: clsx("react-flow__panel", container$2),
9184
9268
  style: {
9185
9269
  transformOrigin: "left center"
9186
9270
  },
@@ -9188,8 +9272,8 @@ function DiagramTitlePanel() {
9188
9272
  Card,
9189
9273
  {
9190
9274
  radius: "sm",
9191
- className: card,
9192
- withBorder: !0,
9275
+ className: card$1,
9276
+ withBorder: !isCollapsed,
9193
9277
  p: isCollapsed ? "sm" : "md",
9194
9278
  onDoubleClick: (e2) => e2.stopPropagation(),
9195
9279
  children: [
@@ -9198,17 +9282,18 @@ function DiagramTitlePanel() {
9198
9282
  {
9199
9283
  fullWidth: !0,
9200
9284
  justify: "stretch",
9201
- size: "sm",
9202
- py: 2,
9285
+ size: "md",
9203
9286
  radius: "0",
9204
9287
  variant: "subtle",
9205
- color: "dark",
9288
+ color: "gray",
9206
9289
  onClick: toggle,
9207
- children: /* @__PURE__ */ jsx(Text$1, { inline: !0, fw: 500, fz: "xs", c: "gray", children: title$12 })
9290
+ fw: 500,
9291
+ fz: "sm",
9292
+ children: title$12
9208
9293
  }
9209
9294
  ) }),
9210
9295
  !isCollapsed && /* @__PURE__ */ jsxs(Fragment, { children: [
9211
- /* @__PURE__ */ jsx(CardSection, { mb: "sm", children: /* @__PURE__ */ jsx(
9296
+ /* @__PURE__ */ jsx(CardSection, { mb: "xs", children: /* @__PURE__ */ jsx(
9212
9297
  Button,
9213
9298
  {
9214
9299
  fullWidth: !0,
@@ -9295,16 +9380,16 @@ function DiagramTitlePanel() {
9295
9380
  /* @__PURE__ */ jsx(Box, { flex: "1", style: { overflow: "hidden" }, children: /* @__PURE__ */ jsx(
9296
9381
  Anchor,
9297
9382
  {
9298
- href: link,
9383
+ href: link.url,
9299
9384
  target: "_blank",
9300
9385
  fz: "xs",
9301
9386
  truncate: "end",
9302
9387
  display: "inline-block",
9303
9388
  w: "100%",
9304
- children: link
9389
+ children: link.title || link.url
9305
9390
  }
9306
9391
  ) }),
9307
- /* @__PURE__ */ jsx(CopyButton$1, { value: link, children: ({ copied, copy }) => /* @__PURE__ */ jsx(
9392
+ /* @__PURE__ */ jsx(CopyButton$1, { value: link.url, children: ({ copied, copy }) => /* @__PURE__ */ jsx(
9308
9393
  Button,
9309
9394
  {
9310
9395
  size: "compact-xs",
@@ -9315,7 +9400,7 @@ function DiagramTitlePanel() {
9315
9400
  children: copied ? "copied" : "copy"
9316
9401
  }
9317
9402
  ) })
9318
- ] }, link))
9403
+ ] }, link.url))
9319
9404
  }
9320
9405
  )
9321
9406
  ] })
@@ -9326,7 +9411,7 @@ function DiagramTitlePanel() {
9326
9411
  id2
9327
9412
  ) });
9328
9413
  }
9329
- var container = "h3ljtj0", buttons = "h3ljtj1", btn = "h3ljtj3";
9414
+ var container$1 = "h3ljtj0", buttons = "h3ljtj1", btn = "h3ljtj3";
9330
9415
  function DynamicViewWalkthrough() {
9331
9416
  const isMobile = useXYStore((s2) => s2.width <= 750), {
9332
9417
  nextDynamicStep,
@@ -9361,7 +9446,7 @@ function DynamicViewWalkthrough() {
9361
9446
  return /* @__PURE__ */ jsxs(
9362
9447
  Box,
9363
9448
  {
9364
- className: clsx("react-flow__panel", container),
9449
+ className: clsx("react-flow__panel", container$1),
9365
9450
  onClick: (e2) => e2.stopPropagation(),
9366
9451
  onDoubleClick: (e2) => e2.stopPropagation(),
9367
9452
  children: [
@@ -9415,6 +9500,227 @@ function DynamicViewWalkthrough() {
9415
9500
  }
9416
9501
  );
9417
9502
  }
9503
+ 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";
9504
+ const ElementNotation = ({ value }) => {
9505
+ const {
9506
+ title: title2,
9507
+ color: color2 = "primary",
9508
+ shape = "rectangle"
9509
+ } = value, [onlyKind, setOnlyKind] = useState$1(null), diagramStore = useDiagramStoreApi(), w = 300, h = 200;
9510
+ return /* @__PURE__ */ jsx(
9511
+ Card,
9512
+ {
9513
+ shadow: "none",
9514
+ px: "xs",
9515
+ py: "sm",
9516
+ className: elementNotation,
9517
+ mod: {
9518
+ "data-likec4-color": color2
9519
+ },
9520
+ onMouseEnter: () => {
9521
+ setOnlyKind(null), diagramStore.getState().highlightByElementNotation(value);
9522
+ },
9523
+ onMouseLeave: () => {
9524
+ setOnlyKind(null), diagramStore.setState({ dimmed: /* @__PURE__ */ new Set() });
9525
+ },
9526
+ children: /* @__PURE__ */ jsxs(
9527
+ Group,
9528
+ {
9529
+ gap: "sm",
9530
+ align: "stretch",
9531
+ wrap: "nowrap",
9532
+ children: [
9533
+ /* @__PURE__ */ jsx(
9534
+ Box,
9535
+ {
9536
+ flex: "0 0 70px",
9537
+ style: {
9538
+ width: 70,
9539
+ height: u$1(70 * (h / w), 0)
9540
+ },
9541
+ children: /* @__PURE__ */ jsx(
9542
+ "svg",
9543
+ {
9544
+ className: clsx(
9545
+ shapeSvg
9546
+ ),
9547
+ viewBox: `0 0 ${w} ${h}`,
9548
+ children: /* @__PURE__ */ jsx(
9549
+ ElementShapeSvg,
9550
+ {
9551
+ shape,
9552
+ w,
9553
+ h
9554
+ }
9555
+ )
9556
+ }
9557
+ )
9558
+ }
9559
+ ),
9560
+ /* @__PURE__ */ jsxs(Stack, { gap: 4, flex: 1, children: [
9561
+ /* @__PURE__ */ jsx(Group, { gap: 4, flex: "0 0 auto", children: value.kinds.map((kind) => /* @__PURE__ */ jsx(
9562
+ Badge,
9563
+ {
9564
+ className: shapeBadge,
9565
+ onMouseEnter: () => {
9566
+ setOnlyKind(kind), diagramStore.getState().highlightByElementNotation(value, kind);
9567
+ },
9568
+ onMouseLeave: () => {
9569
+ setOnlyKind(null), diagramStore.getState().highlightByElementNotation(value);
9570
+ },
9571
+ opacity: l(onlyKind) && onlyKind !== kind ? 0.25 : 1,
9572
+ color: l(onlyKind) && onlyKind !== kind ? "gray" : vars.element.fill,
9573
+ children: kind
9574
+ },
9575
+ kind
9576
+ )) }),
9577
+ /* @__PURE__ */ jsx(
9578
+ Text$1,
9579
+ {
9580
+ component: "div",
9581
+ fz: "sm",
9582
+ fw: 500,
9583
+ lh: "1.25",
9584
+ style: {
9585
+ textWrap: "pretty"
9586
+ },
9587
+ children: title2
9588
+ }
9589
+ )
9590
+ ] })
9591
+ ]
9592
+ }
9593
+ )
9594
+ }
9595
+ );
9596
+ }, selector = (s2) => ({
9597
+ id: s2.view.id,
9598
+ notations: s2.view.notation?.elements ?? [],
9599
+ height: s2.xystore.getState().height,
9600
+ isVisible: e$3(s2.focusedNodeId ?? s2.activeDynamicViewStep),
9601
+ target: s2.getContainer()
9602
+ });
9603
+ function NotationPanel() {
9604
+ const {
9605
+ id: id2,
9606
+ notations,
9607
+ isVisible,
9608
+ height,
9609
+ target
9610
+ } = useDiagramState(selector), [isCollapsed, setCollapsed] = useLocalStorage({
9611
+ key: "notation-panel-collapsed",
9612
+ defaultValue: !0
9613
+ }), hasNotations = notations.length > 0, portalProps = target ? { portalProps: { target } } : { withinPortal: !1 };
9614
+ return /* @__PURE__ */ jsxs(AnimatePresence, { children: [
9615
+ !hasNotations && /* @__PURE__ */ jsx(
9616
+ m.div,
9617
+ {
9618
+ initial: { opacity: 0.75, translateX: "50%" },
9619
+ animate: { opacity: 1, translateX: 0 },
9620
+ exit: {
9621
+ translateX: "100%",
9622
+ opacity: 0.6
9623
+ },
9624
+ className: clsx("react-flow__panel", container),
9625
+ children: /* @__PURE__ */ jsx(Tooltip$2, { label: "Diagram has no notations", color: "orange", ...portalProps, children: /* @__PURE__ */ jsx(
9626
+ ThemeIcon,
9627
+ {
9628
+ size: "xl",
9629
+ variant: "light",
9630
+ color: "orange",
9631
+ radius: "md",
9632
+ children: /* @__PURE__ */ jsx(IconAlertTriangle, {})
9633
+ }
9634
+ ) })
9635
+ },
9636
+ "empty"
9637
+ ),
9638
+ hasNotations && isVisible && isCollapsed && /* @__PURE__ */ jsx(
9639
+ m.div,
9640
+ {
9641
+ initial: { opacity: 0.75, translateX: "50%" },
9642
+ animate: { opacity: 1, translateX: 0 },
9643
+ exit: {
9644
+ translateX: "100%",
9645
+ opacity: 0.6
9646
+ },
9647
+ className: clsx("react-flow__panel", container),
9648
+ children: /* @__PURE__ */ jsx(Tooltip$2, { label: "Show notation", color: "dark", fz: "xs", ...portalProps, children: /* @__PURE__ */ jsx(
9649
+ ActionIcon$2,
9650
+ {
9651
+ size: "xl",
9652
+ variant: "light",
9653
+ color: "gray",
9654
+ radius: "md",
9655
+ onClick: () => setCollapsed(!1),
9656
+ children: /* @__PURE__ */ jsx(IconHelpCircle, { stroke: 1.5 })
9657
+ }
9658
+ ) })
9659
+ },
9660
+ "collapsed"
9661
+ ),
9662
+ hasNotations && isVisible && !isCollapsed && /* @__PURE__ */ jsx(
9663
+ m.div,
9664
+ {
9665
+ initial: {
9666
+ opacity: 0.75,
9667
+ // translateX: '50%',
9668
+ scale: 0.2
9669
+ },
9670
+ animate: { opacity: 1, scale: 1 },
9671
+ exit: {
9672
+ opacity: 0,
9673
+ scale: 0.25
9674
+ },
9675
+ className: clsx("react-flow__panel", container),
9676
+ style: {
9677
+ transformOrigin: "bottom right"
9678
+ },
9679
+ children: /* @__PURE__ */ jsx(
9680
+ Paper,
9681
+ {
9682
+ radius: "sm",
9683
+ withBorder: !0,
9684
+ shadow: "lg",
9685
+ className: card,
9686
+ children: /* @__PURE__ */ jsxs(Tabs, { defaultValue: "first", radius: "xs", children: [
9687
+ /* @__PURE__ */ jsxs(TabsList, { children: [
9688
+ /* @__PURE__ */ jsx(
9689
+ ActionIcon$2,
9690
+ {
9691
+ size: "md",
9692
+ variant: "subtle",
9693
+ color: "gray",
9694
+ ml: 2,
9695
+ style: {
9696
+ alignSelf: "center"
9697
+ },
9698
+ onClick: () => setCollapsed(!0),
9699
+ children: /* @__PURE__ */ jsx(IconArrowDownRight, { stroke: 2 })
9700
+ }
9701
+ ),
9702
+ /* @__PURE__ */ jsx(TabsTab, { value: "first", fz: "xs", children: "Elements" }),
9703
+ /* @__PURE__ */ jsx(TabsTab, { value: "second", fz: "xs", disabled: !0, children: "Relationships" })
9704
+ ] }),
9705
+ /* @__PURE__ */ jsx(TabsPanel, { value: "first", className: tabPanel, hidden: isCollapsed, children: /* @__PURE__ */ jsx(
9706
+ ScrollAreaAutosize,
9707
+ {
9708
+ viewportProps: {
9709
+ style: {
9710
+ maxHeight: height > 50 ? `min(40vh, ${height - 20}px)` : "40vh"
9711
+ }
9712
+ },
9713
+ children: /* @__PURE__ */ jsx(Stack, { gap: 0, children: notations.map((n2, i2) => /* @__PURE__ */ jsx(ElementNotation, { value: n2 }, i2)) })
9714
+ }
9715
+ ) })
9716
+ ] })
9717
+ }
9718
+ )
9719
+ },
9720
+ id2
9721
+ )
9722
+ ] });
9723
+ }
9418
9724
  const {
9419
9725
  primary,
9420
9726
  secondary,
@@ -9435,7 +9741,7 @@ const {
9435
9741
  throw new Error("NodeOptions: nodes and props.nodes should have the same length");
9436
9742
  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) => {
9437
9743
  const targets = nodes.map((node) => node.data.element.id);
9438
- invariant(i$3(targets, 1), "At least one target is required"), diagramApi.getState().triggerChangeElementStyle({
9744
+ invariant$1(i$3(targets, 1), "At least one target is required"), diagramApi.getState().triggerChangeElementStyle({
9439
9745
  op: "change-element-style",
9440
9746
  style,
9441
9747
  targets
@@ -9521,7 +9827,7 @@ function Colors({
9521
9827
  onColorChange
9522
9828
  }) {
9523
9829
  let selectedColor = firstNode.data.element.color;
9524
- d$1(nodes, (node) => node.data.element.color !== selectedColor ? (selectedColor = null, !1) : !0);
9830
+ u$4(nodes, (node) => node.data.element.color !== selectedColor ? (selectedColor = null, !1) : !0);
9525
9831
  const changeColor = (color2) => () => {
9526
9832
  selectedColor !== color2 && onColorChange(color2);
9527
9833
  };
@@ -9577,7 +9883,7 @@ function ShapeOption({
9577
9883
  onShapeChange
9578
9884
  }) {
9579
9885
  let selectedShape = firstNode.data.element.shape;
9580
- return d$1(nodes, (node) => node.data.element.shape !== selectedShape ? (selectedShape = null, !1) : !0), /* @__PURE__ */ jsxs("div", { children: [
9886
+ return u$4(nodes, (node) => node.data.element.shape !== selectedShape ? (selectedShape = null, !1) : !0), /* @__PURE__ */ jsxs("div", { children: [
9581
9887
  /* @__PURE__ */ jsx(Divider, { label: "shape", labelPosition: "left" }),
9582
9888
  /* @__PURE__ */ jsx(
9583
9889
  Select,
@@ -9942,19 +10248,19 @@ const ActionIcon = ActionIcon$2.withProps({
9942
10248
  showFitDiagram,
9943
10249
  showLayoutDriftWarning,
9944
10250
  showChangeAutoLayout,
9945
- portalProps: _portalProps,
10251
+ target,
9946
10252
  showGoToSource
9947
10253
  } = useDiagramState((s2) => {
9948
- const isNotActive = s2.activeDynamicViewStep === null && s2.focusedNodeId === null, target = s2.getContainer();
10254
+ const isNotActive = s2.activeDynamicViewStep === null && s2.focusedNodeId === null;
9949
10255
  return {
9950
10256
  showNavigationButtons: !!s2.onBurgerMenuClick || s2.showNavigationButtons && !!s2.onNavigateTo,
9951
10257
  showFitDiagram: s2.fitViewEnabled && s2.zoomable && s2.viewportChanged,
9952
10258
  showLayoutDriftWarning: s2.readonly !== !0 && s2.view.hasLayoutDrift === !0 && isNotActive,
9953
10259
  showChangeAutoLayout: s2.readonly !== !0 && !!s2.onChange && isNotActive,
9954
10260
  showGoToSource: !!s2.onOpenSourceView,
9955
- portalProps: target ? { target } : void 0
10261
+ target: s2.getContainer()
9956
10262
  };
9957
- }), portalProps = _portalProps ? { portalProps: _portalProps } : void 0;
10263
+ }), portalProps = target ? { portalProps: { target } } : void 0;
9958
10264
  return /* @__PURE__ */ jsxs(
9959
10265
  Stack,
9960
10266
  {
@@ -10034,7 +10340,7 @@ function literalToEnum(value) {
10034
10340
  }
10035
10341
  function XYFlowBackground({ background }) {
10036
10342
  if (typeof background == "string")
10037
- return /* @__PURE__ */ jsx(Background, { variant: literalToEnum(background) });
10343
+ return /* @__PURE__ */ jsx(Background, { variant: literalToEnum(background), size: 2, gap: 20 });
10038
10344
  const { variant, ...rest } = background;
10039
10345
  return /* @__PURE__ */ jsx(Background, { variant: literalToEnum(variant), ...rest });
10040
10346
  }
@@ -10045,11 +10351,13 @@ const XYFlowInner = memo$1(function({
10045
10351
  showDiagramTitle
10046
10352
  }) {
10047
10353
  const {
10354
+ showNotations,
10048
10355
  isDynamicView,
10049
10356
  isDynamicViewActive,
10050
10357
  readonly,
10051
10358
  enableDynamicViewWalkthrough
10052
10359
  } = useDiagramState((s2) => ({
10360
+ showNotations: s2.showNotations,
10053
10361
  isDynamicView: s2.isDynamicView,
10054
10362
  readonly: s2.readonly,
10055
10363
  enableDynamicViewWalkthrough: s2.enableDynamicViewWalkthrough,
@@ -10062,6 +10370,7 @@ const XYFlowInner = memo$1(function({
10062
10370
  readonly !== !0 && /* @__PURE__ */ jsx(OptionsPanel, {}),
10063
10371
  showDiagramTitle === !0 && !isDynamicViewActive && /* @__PURE__ */ jsx(DiagramTitlePanel, {}),
10064
10372
  isDynamicView && enableDynamicViewWalkthrough && /* @__PURE__ */ jsx(DynamicViewWalkthrough, {}),
10373
+ showNotations && /* @__PURE__ */ jsx(NotationPanel, {}),
10065
10374
  children
10066
10375
  ] });
10067
10376
  }, shallowEqual);
@@ -10080,6 +10389,7 @@ function LikeC4Diagram({
10080
10389
  controls = !1,
10081
10390
  showElementLinks = !0,
10082
10391
  showDiagramTitle = !0,
10392
+ showNotations = !0,
10083
10393
  enableDynamicViewWalkthrough = !1,
10084
10394
  enableFocusMode = !1,
10085
10395
  initialWidth,
@@ -10127,6 +10437,7 @@ function LikeC4Diagram({
10127
10437
  fitViewPadding,
10128
10438
  showElementLinks,
10129
10439
  showNavigationButtons,
10440
+ showNotations,
10130
10441
  nodesDraggable,
10131
10442
  nodesSelectable,
10132
10443
  experimentalEdgeEditing,
@@ -10224,6 +10535,7 @@ function StaticLikeC4Diagram({
10224
10535
  background,
10225
10536
  showElementLinks: !0,
10226
10537
  showDiagramTitle: !1,
10538
+ showNotations: !1,
10227
10539
  enableDynamicViewWalkthrough: !1,
10228
10540
  enableFocusMode: !1,
10229
10541
  nodesSelectable: !1,
@@ -10232,10 +10544,292 @@ function StaticLikeC4Diagram({
10232
10544
  }
10233
10545
  );
10234
10546
  }
10235
- var previewBg = "_15b5f732";
10236
- const Route$9 = createFileRoute("/")({
10237
- component: IndexPage
10547
+ var root = "mxt2a80";
10548
+ function edgePath(points) {
10549
+ return points.reduce((acc, [x2, y2], i2) => acc + `${i2 === 0 ? "M" : " L"} ${x2},${y2}`, "");
10550
+ }
10551
+ function LinkEdge({
10552
+ id: id2,
10553
+ data,
10554
+ ...props2
10555
+ }) {
10556
+ if (!data)
10557
+ return null;
10558
+ const path = edgePath(data.points);
10559
+ return /* @__PURE__ */ jsx(
10560
+ BaseEdge,
10561
+ {
10562
+ id: id2,
10563
+ path,
10564
+ ...props2
10565
+ }
10566
+ );
10567
+ }
10568
+ var handleCenter = "_1n8mzjc0", toplevelNode = "_1n8mzjc1", nestedNode = "_1n8mzjc2", dimmed = "_1n8mzjc3", folderNode = "_1n8mzjc4", fileNode = "_1n8mzjc5", viewNode = "_1n8mzjc6", viewNodeImageSection = "_1n8mzjc7", viewTitle = "_1n8mzjc8";
10569
+ const FolderNode = /* @__PURE__ */ memo$1(function({
10570
+ data,
10571
+ parentId,
10572
+ id: id2
10573
+ }) {
10574
+ const isTopLevel = e$3(parentId);
10575
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
10576
+ /* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Top, className: handleCenter }),
10577
+ /* @__PURE__ */ jsx(
10578
+ Paper,
10579
+ {
10580
+ p: "sm",
10581
+ pt: "xs",
10582
+ radius: "md",
10583
+ withBorder: !0,
10584
+ shadow: isTopLevel ? "lg" : "xs",
10585
+ className: clsx(
10586
+ folderNode,
10587
+ isTopLevel ? toplevelNode : nestedNode,
10588
+ data.dimmed && dimmed
10589
+ ),
10590
+ children: /* @__PURE__ */ jsxs(Group, { gap: 8, children: [
10591
+ /* @__PURE__ */ jsx(ThemeIcon, { size: 24, variant: "transparent", color: "dark.4", children: /* @__PURE__ */ jsx(IconFolderFilled, { size: "100%" }) }),
10592
+ /* @__PURE__ */ jsx(Text$1, { size: "lg", fw: 500, children: data.label })
10593
+ ] })
10594
+ }
10595
+ ),
10596
+ /* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Bottom, className: handleCenter })
10597
+ ] });
10598
+ }), FileNode = /* @__PURE__ */ memo$1(function({
10599
+ data,
10600
+ parentId,
10601
+ id: id2
10602
+ }) {
10603
+ const isTopLevel = e$3(parentId);
10604
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
10605
+ /* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Top, className: handleCenter }),
10606
+ /* @__PURE__ */ jsx(
10607
+ Paper,
10608
+ {
10609
+ p: "sm",
10610
+ pt: "xs",
10611
+ radius: "md",
10612
+ withBorder: !0,
10613
+ shadow: isTopLevel ? "lg" : "xs",
10614
+ className: clsx(
10615
+ fileNode,
10616
+ isTopLevel ? toplevelNode : nestedNode,
10617
+ data.dimmed && dimmed
10618
+ ),
10619
+ children: /* @__PURE__ */ jsxs(Group, { gap: 8, children: [
10620
+ /* @__PURE__ */ jsx(ThemeIcon, { size: 24, variant: "transparent", color: "dark.3", children: /* @__PURE__ */ jsx(IconFileFilled, { size: "100%" }) }),
10621
+ /* @__PURE__ */ jsx(Text$1, { size: "lg", fw: 500, children: data.label })
10622
+ ] })
10623
+ }
10624
+ ),
10625
+ /* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Bottom, className: handleCenter })
10626
+ ] });
10627
+ }), ViewNode = /* @__PURE__ */ memo$1(function({
10628
+ data,
10629
+ height = 320
10630
+ }) {
10631
+ const imageUrl = usePreviewUrl(data.viewId);
10632
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
10633
+ /* @__PURE__ */ jsx(Handle, { type: "target", position: Position.Top, className: handleCenter }),
10634
+ /* @__PURE__ */ jsxs(
10635
+ Card,
10636
+ {
10637
+ className: clsx(
10638
+ viewNode,
10639
+ data.dimmed && dimmed
10640
+ ),
10641
+ withBorder: !0,
10642
+ shadow: "xs",
10643
+ padding: 0,
10644
+ children: [
10645
+ /* @__PURE__ */ jsx(CardSection, { className: viewNodeImageSection, children: imageUrl ? /* @__PURE__ */ jsx(
10646
+ Image,
10647
+ {
10648
+ src: imageUrl,
10649
+ fit: "contain",
10650
+ h: height - 60
10651
+ }
10652
+ ) : /* @__PURE__ */ jsx(Center, { h: height - 60, children: /* @__PURE__ */ jsxs(Group, { children: [
10653
+ /* @__PURE__ */ jsx(ThemeIcon, { size: 60, variant: "transparent", color: "dark", children: /* @__PURE__ */ jsx(IconLoader, { stroke: 1.5, size: "100%" }) }),
10654
+ /* @__PURE__ */ jsx(Text$1, { size: "xl", fw: 500, c: "dimmed", children: "Preview not available" })
10655
+ ] }) }) }),
10656
+ /* @__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 }) })
10657
+ ]
10658
+ }
10659
+ ),
10660
+ /* @__PURE__ */ jsx(Handle, { type: "source", position: Position.Bottom, className: handleCenter })
10661
+ ] });
10662
+ }), nodeTypes = {
10663
+ folder: FolderNode,
10664
+ file: FileNode,
10665
+ view: ViewNode
10666
+ }, edgeTypes = {
10667
+ link: LinkEdge
10668
+ }, overviewGraphToXYFlowData = (graph) => ({
10669
+ nodes: graph.nodes.map(({ id: id2, parentId, position, width, height, ...node }) => {
10670
+ const parent = parentId ? graph.nodes.find((n2) => n2.id === parentId) : null, rect = {
10671
+ ...position,
10672
+ width,
10673
+ height
10674
+ };
10675
+ parent && (position = {
10676
+ x: position.x - parent.position.x,
10677
+ y: position.y - parent.position.y
10678
+ });
10679
+ const xyparent = parent ? { parentId: parent.id } : {};
10680
+ switch (node.type) {
10681
+ case "file":
10682
+ case "folder":
10683
+ return {
10684
+ id: id2,
10685
+ type: node.type,
10686
+ data: {
10687
+ dimmed: !1,
10688
+ label: node.label,
10689
+ path: node.path,
10690
+ rect
10691
+ },
10692
+ deletable: !1,
10693
+ position,
10694
+ width,
10695
+ height,
10696
+ zIndex: 1,
10697
+ ...xyparent
10698
+ };
10699
+ case "view":
10700
+ return {
10701
+ id: id2,
10702
+ type: "view",
10703
+ data: {
10704
+ dimmed: !1,
10705
+ label: node.label,
10706
+ viewId: node.viewId,
10707
+ rect
10708
+ },
10709
+ selectable: !1,
10710
+ deletable: !1,
10711
+ position,
10712
+ width,
10713
+ height,
10714
+ zIndex: 3,
10715
+ ...xyparent
10716
+ };
10717
+ default:
10718
+ nonexhaustive(node);
10719
+ }
10720
+ }),
10721
+ edges: graph.edges.map((edge) => ({
10722
+ id: edge.id,
10723
+ source: edge.source,
10724
+ target: edge.target,
10725
+ type: "link",
10726
+ zIndex: 2,
10727
+ hidden: !0,
10728
+ data: {
10729
+ points: edge.points
10730
+ }
10731
+ }))
10238
10732
  });
10733
+ function OverviewDiagrams({
10734
+ graph,
10735
+ fitViewPadding = 0.1,
10736
+ zoomable = !0,
10737
+ pannable = !0
10738
+ }) {
10739
+ 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);
10740
+ useUpdateEffect(() => {
10741
+ setNodes(
10742
+ (nodes2) => xyflowdata.nodes.map((n2) => {
10743
+ const current = nodes2.find((node) => node.id === n2.id);
10744
+ return current ? { ...a$2(current, ["selected", "hidden"]), ...n2 } : n2;
10745
+ })
10746
+ ), setEdges(xyflowdata.edges);
10747
+ }, [xyflowdata.nodes, xyflowdata.edges]);
10748
+ const focusedNode = nodes.find((node) => node.selected);
10749
+ return useUpdateEffect(() => {
10750
+ const xyflow = xyflowRef.current;
10751
+ xyflow && (focusedNode ? xyflow.fitView({
10752
+ maxZoom: 1,
10753
+ padding: fitViewPadding,
10754
+ nodes: [focusedNode],
10755
+ duration: 450
10756
+ }) : xyflow.fitView({
10757
+ maxZoom: 1,
10758
+ padding: fitViewPadding,
10759
+ duration: 800
10760
+ }));
10761
+ }, [focusedNode?.id ?? null]), /* @__PURE__ */ jsx(
10762
+ index,
10763
+ {
10764
+ colorMode: colorScheme === "auto" ? "system" : colorScheme,
10765
+ className: root,
10766
+ nodeTypes,
10767
+ edgeTypes,
10768
+ nodes,
10769
+ onNodesChange,
10770
+ edges,
10771
+ onEdgesChange: onEdgeChanges,
10772
+ fitView: !0,
10773
+ fitViewOptions: useMemo$1(() => ({
10774
+ minZoom: 0.05,
10775
+ maxZoom: 1,
10776
+ padding: fitViewPadding,
10777
+ includeHiddenNodes: !0
10778
+ }), [fitViewPadding]),
10779
+ nodesDraggable: !1,
10780
+ nodesConnectable: !1,
10781
+ nodesFocusable: !0,
10782
+ edgesReconnectable: !1,
10783
+ edgesFocusable: !1,
10784
+ multiSelectionKeyCode: null,
10785
+ zoomOnPinch: zoomable,
10786
+ zoomOnScroll: !pannable && zoomable,
10787
+ zoomOnDoubleClick: !1,
10788
+ ...!zoomable && {
10789
+ zoomActivationKeyCode: null
10790
+ },
10791
+ maxZoom: zoomable ? 2 : 1,
10792
+ minZoom: zoomable ? 0.01 : 1,
10793
+ preventScrolling: zoomable || pannable,
10794
+ noDragClassName: "nodrag",
10795
+ noPanClassName: "nopan",
10796
+ panOnScroll: pannable,
10797
+ panOnDrag: pannable,
10798
+ ...!pannable && {
10799
+ selectionKeyCode: null
10800
+ },
10801
+ onInit: (instance) => xyflowRef.current = instance,
10802
+ onNodeClick: (event, node) => {
10803
+ if (node.type === "view") {
10804
+ event.stopPropagation(), setNodes((nodes2) => nodes2.map(({ data, ...n2 }) => ({ ...n2, data: { ...data, dimmed: n2.id !== node.id } }))), xyflowRef.current?.fitView({
10805
+ maxZoom: 10,
10806
+ padding: 0,
10807
+ nodes: [node],
10808
+ duration: 1200
10809
+ }), setTimeout(() => {
10810
+ xyflowRef.current?.updateNodeData(node.id, { dimmed: !0 });
10811
+ }, 400), setTimeout(() => {
10812
+ router.navigate({
10813
+ to: "/view/$viewId/",
10814
+ params: {
10815
+ viewId: node.data.viewId
10816
+ },
10817
+ search: !0
10818
+ });
10819
+ }, 800);
10820
+ return;
10821
+ }
10822
+ node.selected && (event.stopPropagation(), setNodes((nodes2) => nodes2.map((n2) => n2.id === node.id ? { ...n2, selected: !1 } : n2)));
10823
+ },
10824
+ children: /* @__PURE__ */ jsx(Background, { variant: BackgroundVariant.Dots, size: 4, gap: 50 })
10825
+ }
10826
+ );
10827
+ }
10828
+ function OverviewPage() {
10829
+ const graph = useOverviewGraph();
10830
+ return /* @__PURE__ */ jsx(Box, { pos: "fixed", inset: 0, children: /* @__PURE__ */ jsx(OverviewDiagrams, { graph }) });
10831
+ }
10832
+ var previewBg = "_15b5f732";
10239
10833
  function IndexPage() {
10240
10834
  const views = t$3(useLikeC4Views());
10241
10835
  return /* @__PURE__ */ jsx(
@@ -10249,7 +10843,7 @@ function IndexPage() {
10249
10843
  }
10250
10844
  );
10251
10845
  }
10252
- const ViewCard = memo$1(({ viewId }) => {
10846
+ function ViewCard({ viewId }) {
10253
10847
  const diagram = useLikeC4View(viewId);
10254
10848
  if (!diagram)
10255
10849
  return null;
@@ -10272,7 +10866,7 @@ const ViewCard = memo$1(({ viewId }) => {
10272
10866
  ]
10273
10867
  }
10274
10868
  );
10275
- }, (prev, next) => prev.viewId === next.viewId);
10869
+ }
10276
10870
  function DiagramPreview(props2) {
10277
10871
  const [diagram, setDiagram] = useState$1(null);
10278
10872
  return useDebouncedEffect(
@@ -10295,6 +10889,9 @@ function DiagramPreview(props2) {
10295
10889
  }
10296
10890
  ) });
10297
10891
  }
10892
+ const Route$9 = createFileRoute("/")({
10893
+ component: withOverviewGraph ? OverviewPage : IndexPage
10894
+ });
10298
10895
  var svgContainer = "_1dn84dq1", cssViewOutlet = "_1dn84dq3", cssExportView = "_1dn84dq4", cssWebcomponentView = "_1dn84dq5", cssWebcomponentIframeContainer = "_1dn84dq6";
10299
10896
  const Route$8 = createFileRoute("/webcomponent/$")({
10300
10897
  component: WebcomponentPage
@@ -10461,7 +11058,7 @@ function buildDiagramTreeData(views) {
10461
11058
  label: view.title ?? view.id,
10462
11059
  type: "diagram",
10463
11060
  children: []
10464
- }), parent !== root2 && (parent.children.sort(compareTreeNodes), n$2(view.relativePath) && parent.type !== "file" && (parent.type = "file"));
11061
+ }), parent !== root2 && (parent.children.sort(compareTreeNodes), n$1(view.relativePath) && parent.type !== "file" && (parent.type = "file"));
10465
11062
  }
10466
11063
  return root2.children.sort(compareTreeNodes);
10467
11064
  }
@@ -10473,7 +11070,7 @@ const isFile = (node) => isTreeNodeData(node) && node.type === "file", FolderIco
10473
11070
  const data = useDiagramsTreeData(), { viewId } = useParams({
10474
11071
  from: "/view/$viewId"
10475
11072
  }), diagram = useLikeC4View(viewId), initialExpandedState = {};
10476
- if (diagram && n$2(diagram.relativePath)) {
11073
+ if (diagram && n$1(diagram.relativePath)) {
10477
11074
  const segments = diagram.relativePath.split("/");
10478
11075
  let path = "@fs";
10479
11076
  for (const segment of segments)
@@ -10755,7 +11352,7 @@ function Header({ diagram }) {
10755
11352
  right: "0.5rem",
10756
11353
  p: 4,
10757
11354
  radius: "sm",
10758
- shadow: "xl",
11355
+ shadow: "lg",
10759
11356
  children: [
10760
11357
  /* @__PURE__ */ jsxs(Group, { gap: isTablet ? 6 : 4, wrap: "nowrap", children: [
10761
11358
  isReactDiagramRoute ? /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -10772,7 +11369,7 @@ function Header({ diagram }) {
10772
11369
  children: "Back to diagram"
10773
11370
  }
10774
11371
  ),
10775
- /* @__PURE__ */ jsx(Divider, { orientation: "vertical", mr: isTablet ? 4 : "xs" }),
11372
+ /* @__PURE__ */ jsx(Divider, { orientation: "vertical", visibleFrom: "md" }),
10776
11373
  /* @__PURE__ */ jsx(ColorSchemeToggle, {}),
10777
11374
  /* @__PURE__ */ jsx(Space, {})
10778
11375
  ] }),
@@ -10791,7 +11388,7 @@ function Header({ diagram }) {
10791
11388
  function ExportButton() {
10792
11389
  const params = useParams({
10793
11390
  from: "/view/$viewId"
10794
- });
11391
+ }), previewUrl = usePreviewUrl(params.viewId);
10795
11392
  return /* @__PURE__ */ jsxs(Menu, { shadow: "md", width: 200, trigger: "click-hover", openDelay: 200, children: [
10796
11393
  /* @__PURE__ */ jsx(MenuTarget, { children: /* @__PURE__ */ jsx(
10797
11394
  Button,
@@ -10807,7 +11404,16 @@ function ExportButton() {
10807
11404
  ) }),
10808
11405
  /* @__PURE__ */ jsxs(MenuDropdown, { children: [
10809
11406
  /* @__PURE__ */ jsx(MenuLabel, { children: "Current view" }),
10810
- /* @__PURE__ */ jsx(
11407
+ previewUrl ? /* @__PURE__ */ jsx(
11408
+ MenuItem,
11409
+ {
11410
+ component: "a",
11411
+ href: previewUrl,
11412
+ download: `${params.viewId}.png`,
11413
+ target: "_blank",
11414
+ children: "Export as .png"
11415
+ }
11416
+ ) : /* @__PURE__ */ jsx(
10811
11417
  MenuItem,
10812
11418
  {
10813
11419
  component: Link,
@@ -10866,10 +11472,10 @@ function Fallback({ error, resetErrorBoundary }) {
10866
11472
  ] }) });
10867
11473
  }
10868
11474
  function ViewLayout() {
10869
- return useDisclosure(!1), /* @__PURE__ */ jsxs(Fragment, { children: [
11475
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
10870
11476
  /* @__PURE__ */ jsx(Box, { className: cssViewOutlet, children: /* @__PURE__ */ jsx(ErrorBoundary, { FallbackComponent: Fallback, children: /* @__PURE__ */ jsx(Outlet, {}) }) }),
10871
11477
  /* @__PURE__ */ jsx(ViewHeader, {}),
10872
- /* @__PURE__ */ jsx(SidebarDrawer, {})
11478
+ !withOverviewGraph && /* @__PURE__ */ jsx(SidebarDrawer, {})
10873
11479
  ] });
10874
11480
  }
10875
11481
  function ViewHeader() {
@@ -10974,6 +11580,7 @@ function ExportPage() {
10974
11580
  enableDynamicViewWalkthrough: !1,
10975
11581
  showElementLinks: !1,
10976
11582
  showDiagramTitle: !1,
11583
+ showNotations: !1,
10977
11584
  nodesSelectable: !1,
10978
11585
  nodesDraggable: !1,
10979
11586
  enableFocusMode: !1,
@@ -11023,6 +11630,7 @@ function EmbedPage() {
11023
11630
  enableDynamicViewWalkthrough: !1,
11024
11631
  showElementLinks: !1,
11025
11632
  showDiagramTitle: !1,
11633
+ showNotations: !1,
11026
11634
  nodesSelectable: !1,
11027
11635
  nodesDraggable: !1,
11028
11636
  enableFocusMode: !1,
@@ -11066,7 +11674,12 @@ function ViewReact() {
11066
11674
  nodesSelectable: !1,
11067
11675
  renderIcon: RenderIcon,
11068
11676
  onNavigateTo,
11069
- onBurgerMenuClick: SidebarDrawerOps.open
11677
+ onBurgerMenuClick: withOverviewGraph ? () => {
11678
+ router.navigate({
11679
+ to: "/",
11680
+ search: !0
11681
+ });
11682
+ } : SidebarDrawerOps.open
11070
11683
  }
11071
11684
  );
11072
11685
  }
@@ -11366,7 +11979,7 @@ function handlePointerMove(event) {
11366
11979
  x: x2,
11367
11980
  y: y2
11368
11981
  } = getResizeEventCoordinates(event);
11369
- if (event.buttons === 0 && (isPointerDown = !1, updateResizeHandlerStates("up", event)), !isPointerDown) {
11982
+ if (isPointerDown && event.buttons === 0 && (isPointerDown = !1, updateResizeHandlerStates("up", event)), !isPointerDown) {
11370
11983
  const {
11371
11984
  target
11372
11985
  } = event;
@@ -11981,7 +12594,7 @@ function validatePanelGroupLayout({
11981
12594
  const nextLayout = [...prevLayout], nextLayoutTotalSize = nextLayout.reduce((accumulated, current) => accumulated + current, 0);
11982
12595
  if (nextLayout.length !== panelConstraints.length)
11983
12596
  throw Error(`Invalid ${panelConstraints.length} panel layout: ${nextLayout.map((size) => `${size}%`).join(", ")}`);
11984
- if (!fuzzyNumbersEqual(nextLayoutTotalSize, 100))
12597
+ if (!fuzzyNumbersEqual(nextLayoutTotalSize, 100) && nextLayout.length > 0)
11985
12598
  for (let index2 = 0; index2 < panelConstraints.length; index2++) {
11986
12599
  const unsafeSize = nextLayout[index2];
11987
12600
  assert(unsafeSize != null, `No layout data found for index ${index2}`);
@@ -12253,7 +12866,7 @@ function PanelGroupWithForwardedRef({
12253
12866
  prevLayout,
12254
12867
  trigger: isKeyDown(event) ? "keyboard" : "mouse-or-touch"
12255
12868
  }), layoutChanged = !compareLayouts(prevLayout, nextLayout);
12256
- (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));
12869
+ (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));
12257
12870
  }, []), resizePanel2 = useCallback((panelData, unsafePanelSize) => {
12258
12871
  const {
12259
12872
  onLayout: onLayout2
@@ -12624,9 +13237,7 @@ function ViewEditor() {
12624
13237
  search: !0
12625
13238
  });
12626
13239
  });
12627
- if (useCallbackRef((event) => {
12628
- console.log("onChange", event);
12629
- }), !view)
13240
+ if (!view)
12630
13241
  throw notFound();
12631
13242
  return /* @__PURE__ */ jsx(
12632
13243
  LikeC4Diagram,
@@ -12645,7 +13256,12 @@ function ViewEditor() {
12645
13256
  enableFocusMode: !1,
12646
13257
  onNavigateTo,
12647
13258
  renderIcon: RenderIcon,
12648
- onBurgerMenuClick: SidebarDrawerOps.open
13259
+ onBurgerMenuClick: withOverviewGraph ? () => {
13260
+ router.navigate({
13261
+ to: "/",
13262
+ search: !0
13263
+ });
13264
+ } : SidebarDrawerOps.open
12649
13265
  }
12650
13266
  );
12651
13267
  }