@graph-render/react 1.0.2 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +52 -38
- package/README.md +73 -0
- package/dist/index.js +1585 -1941
- package/dist/src/hooks/useGraphModel.d.ts.map +1 -1
- package/dist/src/hooks/useGraphSearchState.d.ts.map +1 -1
- package/dist/src/hooks/useGraphViewState.d.ts.map +1 -1
- package/dist/src/utils/columns.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +6 -6
- package/src/hooks/useGraphCollapse.ts +1 -1
- package/src/hooks/useGraphModel.ts +104 -101
- package/src/hooks/useGraphSearchState.ts +15 -17
- package/src/hooks/useGraphViewState.ts +2 -6
- package/src/utils/columns.ts +4 -2
- package/tsconfig.json +5 -1
package/dist/index.js
CHANGED
|
@@ -1,1197 +1,843 @@
|
|
|
1
|
-
import { LayoutType as
|
|
2
|
-
import { EdgeType as Vn, LayoutDirection as qn, LayoutType as
|
|
3
|
-
import
|
|
4
|
-
import { groupEdgesByTarget as en, sortEdgesBySourcePosition as rn, fromTypedNxGraph as nn, layoutNodes as
|
|
5
|
-
import { buildEdgePath as
|
|
6
|
-
var
|
|
1
|
+
import { LayoutType as Jt, EdgeType as qe, LayoutDirection as xe } from "@graph-render/types";
|
|
2
|
+
import { EdgeType as Vn, LayoutDirection as qn, LayoutType as Zn, NodeSide as Jn } from "@graph-render/types";
|
|
3
|
+
import Ft, { useState as ut, useMemo as A, useCallback as G, useRef as ot, useEffect as zt, useLayoutEffect as Jr, useId as Qr, useImperativeHandle as tn } from "react";
|
|
4
|
+
import { groupEdgesByTarget as en, sortEdgesBySourcePosition as rn, fromTypedNxGraph as nn, layoutNodes as we, routeEdges as Ze, buildEdgePath as on, normalizeGraphConfig as sn, DEFAULT_THEME as Je } from "@graph-render/core";
|
|
5
|
+
import { buildEdgePath as to, fromNxGraph as eo, layoutNodes as ro, renderGraphToSvg as no, routeEdges as oo } from "@graph-render/core";
|
|
6
|
+
var be = { exports: {} }, Xt = {};
|
|
7
7
|
/**
|
|
8
8
|
* @license React
|
|
9
|
-
* react-jsx-runtime.production.
|
|
9
|
+
* react-jsx-runtime.production.js
|
|
10
10
|
*
|
|
11
|
-
* Copyright (c)
|
|
11
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
12
12
|
*
|
|
13
13
|
* This source code is licensed under the MIT license found in the
|
|
14
14
|
* LICENSE file in the root directory of this source tree.
|
|
15
15
|
*/
|
|
16
|
-
var
|
|
16
|
+
var Qe;
|
|
17
17
|
function an() {
|
|
18
|
-
if (
|
|
19
|
-
|
|
20
|
-
var
|
|
21
|
-
function
|
|
22
|
-
var
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
if (Qe) return Xt;
|
|
19
|
+
Qe = 1;
|
|
20
|
+
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
21
|
+
function s(n, o, i) {
|
|
22
|
+
var d = null;
|
|
23
|
+
if (i !== void 0 && (d = "" + i), o.key !== void 0 && (d = "" + o.key), "key" in o) {
|
|
24
|
+
i = {};
|
|
25
|
+
for (var l in o)
|
|
26
|
+
l !== "key" && (i[l] = o[l]);
|
|
27
|
+
} else i = o;
|
|
28
|
+
return o = i.ref, {
|
|
29
|
+
$$typeof: t,
|
|
30
|
+
type: n,
|
|
31
|
+
key: d,
|
|
32
|
+
ref: o !== void 0 ? o : null,
|
|
33
|
+
props: i
|
|
34
|
+
};
|
|
27
35
|
}
|
|
28
|
-
return
|
|
36
|
+
return Xt.Fragment = e, Xt.jsx = s, Xt.jsxs = s, Xt;
|
|
29
37
|
}
|
|
30
|
-
var
|
|
38
|
+
var Wt = {};
|
|
31
39
|
/**
|
|
32
40
|
* @license React
|
|
33
41
|
* react-jsx-runtime.development.js
|
|
34
42
|
*
|
|
35
|
-
* Copyright (c)
|
|
43
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
36
44
|
*
|
|
37
45
|
* This source code is licensed under the MIT license found in the
|
|
38
46
|
* LICENSE file in the root directory of this source tree.
|
|
39
47
|
*/
|
|
40
|
-
var
|
|
48
|
+
var tr;
|
|
41
49
|
function cn() {
|
|
42
|
-
return
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (
|
|
46
|
-
return null;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
var g = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
51
|
-
function _(t) {
|
|
52
|
-
{
|
|
53
|
-
for (var c = arguments.length, h = new Array(c > 1 ? c - 1 : 0), P = 1; P < c; P++)
|
|
54
|
-
h[P - 1] = arguments[P];
|
|
55
|
-
w("error", t, h);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
function w(t, c, h) {
|
|
59
|
-
{
|
|
60
|
-
var P = g.ReactDebugCurrentFrame, N = P.getStackAddendum();
|
|
61
|
-
N !== "" && (c += "%s", h = h.concat([N]));
|
|
62
|
-
var X = h.map(function(j) {
|
|
63
|
-
return String(j);
|
|
64
|
-
});
|
|
65
|
-
X.unshift("Warning: " + c), Function.prototype.apply.call(console[t], console, X);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
var v = !1, H = !1, ot = !1, ut = !1, S = !1, L;
|
|
69
|
-
L = Symbol.for("react.module.reference");
|
|
70
|
-
function et(t) {
|
|
71
|
-
return !!(typeof t == "string" || typeof t == "function" || t === i || t === a || S || t === s || t === I || t === y || ut || t === E || v || H || ot || typeof t == "object" && t !== null && (t.$$typeof === m || t.$$typeof === p || t.$$typeof === d || t.$$typeof === u || t.$$typeof === b || // This needs to include all possible module reference object
|
|
72
|
-
// types supported by any Flight configuration anywhere since
|
|
73
|
-
// we don't know which Flight build this will end up being used
|
|
74
|
-
// with.
|
|
75
|
-
t.$$typeof === L || t.getModuleId !== void 0));
|
|
76
|
-
}
|
|
77
|
-
function B(t, c, h) {
|
|
78
|
-
var P = t.displayName;
|
|
79
|
-
if (P)
|
|
80
|
-
return P;
|
|
81
|
-
var N = c.displayName || c.name || "";
|
|
82
|
-
return N !== "" ? h + "(" + N + ")" : h;
|
|
83
|
-
}
|
|
84
|
-
function C(t) {
|
|
85
|
-
return t.displayName || "Context";
|
|
86
|
-
}
|
|
87
|
-
function Y(t) {
|
|
88
|
-
if (t == null)
|
|
89
|
-
return null;
|
|
90
|
-
if (typeof t.tag == "number" && _("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof t == "function")
|
|
91
|
-
return t.displayName || t.name || null;
|
|
92
|
-
if (typeof t == "string")
|
|
93
|
-
return t;
|
|
94
|
-
switch (t) {
|
|
95
|
-
case i:
|
|
50
|
+
return tr || (tr = 1, process.env.NODE_ENV !== "production" && function() {
|
|
51
|
+
function t(a) {
|
|
52
|
+
if (a == null) return null;
|
|
53
|
+
if (typeof a == "function")
|
|
54
|
+
return a.$$typeof === D ? null : a.displayName || a.name || null;
|
|
55
|
+
if (typeof a == "string") return a;
|
|
56
|
+
switch (a) {
|
|
57
|
+
case N:
|
|
96
58
|
return "Fragment";
|
|
97
|
-
case
|
|
98
|
-
return "Portal";
|
|
99
|
-
case a:
|
|
59
|
+
case P:
|
|
100
60
|
return "Profiler";
|
|
101
|
-
case
|
|
61
|
+
case x:
|
|
102
62
|
return "StrictMode";
|
|
103
|
-
case
|
|
63
|
+
case q:
|
|
104
64
|
return "Suspense";
|
|
105
|
-
case
|
|
65
|
+
case et:
|
|
106
66
|
return "SuspenseList";
|
|
67
|
+
case C:
|
|
68
|
+
return "Activity";
|
|
107
69
|
}
|
|
108
|
-
if (typeof
|
|
109
|
-
switch (
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
return
|
|
116
|
-
case b:
|
|
117
|
-
return B(t, t.render, "ForwardRef");
|
|
70
|
+
if (typeof a == "object")
|
|
71
|
+
switch (typeof a.tag == "number" && console.error(
|
|
72
|
+
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
73
|
+
), a.$$typeof) {
|
|
74
|
+
case v:
|
|
75
|
+
return "Portal";
|
|
76
|
+
case f:
|
|
77
|
+
return a.displayName || "Context";
|
|
118
78
|
case p:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
79
|
+
return (a._context.displayName || "Context") + ".Consumer";
|
|
80
|
+
case B:
|
|
81
|
+
var S = a.render;
|
|
82
|
+
return a = a.displayName, a || (a = S.displayName || S.name || "", a = a !== "" ? "ForwardRef(" + a + ")" : "ForwardRef"), a;
|
|
83
|
+
case _:
|
|
84
|
+
return S = a.displayName || null, S !== null ? S : t(a.type) || "Memo";
|
|
85
|
+
case E:
|
|
86
|
+
S = a._payload, a = a._init;
|
|
123
87
|
try {
|
|
124
|
-
return
|
|
88
|
+
return t(a(S));
|
|
125
89
|
} catch {
|
|
126
|
-
return null;
|
|
127
90
|
}
|
|
128
|
-
}
|
|
129
91
|
}
|
|
130
92
|
return null;
|
|
131
93
|
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
Wt.__reactDisabledLog = !0;
|
|
136
|
-
function Vt() {
|
|
137
|
-
{
|
|
138
|
-
if (it === 0) {
|
|
139
|
-
A = console.log, O = console.info, F = console.warn, G = console.error, zt = console.group, Yt = console.groupCollapsed, Kt = console.groupEnd;
|
|
140
|
-
var t = {
|
|
141
|
-
configurable: !0,
|
|
142
|
-
enumerable: !0,
|
|
143
|
-
value: Wt,
|
|
144
|
-
writable: !0
|
|
145
|
-
};
|
|
146
|
-
Object.defineProperties(console, {
|
|
147
|
-
info: t,
|
|
148
|
-
log: t,
|
|
149
|
-
warn: t,
|
|
150
|
-
error: t,
|
|
151
|
-
group: t,
|
|
152
|
-
groupCollapsed: t,
|
|
153
|
-
groupEnd: t
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
it++;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
function lt() {
|
|
160
|
-
{
|
|
161
|
-
if (it--, it === 0) {
|
|
162
|
-
var t = {
|
|
163
|
-
configurable: !0,
|
|
164
|
-
enumerable: !0,
|
|
165
|
-
writable: !0
|
|
166
|
-
};
|
|
167
|
-
Object.defineProperties(console, {
|
|
168
|
-
log: U({}, t, {
|
|
169
|
-
value: A
|
|
170
|
-
}),
|
|
171
|
-
info: U({}, t, {
|
|
172
|
-
value: O
|
|
173
|
-
}),
|
|
174
|
-
warn: U({}, t, {
|
|
175
|
-
value: F
|
|
176
|
-
}),
|
|
177
|
-
error: U({}, t, {
|
|
178
|
-
value: G
|
|
179
|
-
}),
|
|
180
|
-
group: U({}, t, {
|
|
181
|
-
value: zt
|
|
182
|
-
}),
|
|
183
|
-
groupCollapsed: U({}, t, {
|
|
184
|
-
value: Yt
|
|
185
|
-
}),
|
|
186
|
-
groupEnd: U({}, t, {
|
|
187
|
-
value: Kt
|
|
188
|
-
})
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
it < 0 && _("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
var rt = g.ReactCurrentDispatcher, Ot;
|
|
195
|
-
function Tt(t, c, h) {
|
|
196
|
-
{
|
|
197
|
-
if (Ot === void 0)
|
|
198
|
-
try {
|
|
199
|
-
throw Error();
|
|
200
|
-
} catch (N) {
|
|
201
|
-
var P = N.stack.trim().match(/\n( *(at )?)/);
|
|
202
|
-
Ot = P && P[1] || "";
|
|
203
|
-
}
|
|
204
|
-
return `
|
|
205
|
-
` + Ot + t;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
var mt = !1, qt;
|
|
209
|
-
{
|
|
210
|
-
var je = typeof WeakMap == "function" ? WeakMap : Map;
|
|
211
|
-
qt = new je();
|
|
94
|
+
function e(a) {
|
|
95
|
+
return "" + a;
|
|
212
96
|
}
|
|
213
|
-
function
|
|
214
|
-
if (!t || mt)
|
|
215
|
-
return "";
|
|
216
|
-
{
|
|
217
|
-
var h = qt.get(t);
|
|
218
|
-
if (h !== void 0)
|
|
219
|
-
return h;
|
|
220
|
-
}
|
|
221
|
-
var P;
|
|
222
|
-
mt = !0;
|
|
223
|
-
var N = Error.prepareStackTrace;
|
|
224
|
-
Error.prepareStackTrace = void 0;
|
|
225
|
-
var X;
|
|
226
|
-
X = rt.current, rt.current = null, Vt();
|
|
97
|
+
function s(a) {
|
|
227
98
|
try {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
if (Object.defineProperty(j.prototype, "props", {
|
|
233
|
-
set: function() {
|
|
234
|
-
throw Error();
|
|
235
|
-
}
|
|
236
|
-
}), typeof Reflect == "object" && Reflect.construct) {
|
|
237
|
-
try {
|
|
238
|
-
Reflect.construct(j, []);
|
|
239
|
-
} catch (ct) {
|
|
240
|
-
P = ct;
|
|
241
|
-
}
|
|
242
|
-
Reflect.construct(t, [], j);
|
|
243
|
-
} else {
|
|
244
|
-
try {
|
|
245
|
-
j.call();
|
|
246
|
-
} catch (ct) {
|
|
247
|
-
P = ct;
|
|
248
|
-
}
|
|
249
|
-
t.call(j.prototype);
|
|
250
|
-
}
|
|
251
|
-
} else {
|
|
252
|
-
try {
|
|
253
|
-
throw Error();
|
|
254
|
-
} catch (ct) {
|
|
255
|
-
P = ct;
|
|
256
|
-
}
|
|
257
|
-
t();
|
|
258
|
-
}
|
|
259
|
-
} catch (ct) {
|
|
260
|
-
if (ct && P && typeof ct.stack == "string") {
|
|
261
|
-
for (var D = ct.stack.split(`
|
|
262
|
-
`), at = P.stack.split(`
|
|
263
|
-
`), q = D.length - 1, Z = at.length - 1; q >= 1 && Z >= 0 && D[q] !== at[Z]; )
|
|
264
|
-
Z--;
|
|
265
|
-
for (; q >= 1 && Z >= 0; q--, Z--)
|
|
266
|
-
if (D[q] !== at[Z]) {
|
|
267
|
-
if (q !== 1 || Z !== 1)
|
|
268
|
-
do
|
|
269
|
-
if (q--, Z--, Z < 0 || D[q] !== at[Z]) {
|
|
270
|
-
var Q = `
|
|
271
|
-
` + D[q].replace(" at new ", " at ");
|
|
272
|
-
return t.displayName && Q.includes("<anonymous>") && (Q = Q.replace("<anonymous>", t.displayName)), typeof t == "function" && qt.set(t, Q), Q;
|
|
273
|
-
}
|
|
274
|
-
while (q >= 1 && Z >= 0);
|
|
275
|
-
break;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
} finally {
|
|
279
|
-
mt = !1, rt.current = X, lt(), Error.prepareStackTrace = N;
|
|
280
|
-
}
|
|
281
|
-
var V = t ? t.displayName || t.name : "", Lt = V ? Tt(V) : "";
|
|
282
|
-
return typeof t == "function" && qt.set(t, Lt), Lt;
|
|
283
|
-
}
|
|
284
|
-
function se(t, c, h) {
|
|
285
|
-
return be(t, !1);
|
|
286
|
-
}
|
|
287
|
-
function ae(t) {
|
|
288
|
-
var c = t.prototype;
|
|
289
|
-
return !!(c && c.isReactComponent);
|
|
290
|
-
}
|
|
291
|
-
function ft(t, c, h) {
|
|
292
|
-
if (t == null)
|
|
293
|
-
return "";
|
|
294
|
-
if (typeof t == "function")
|
|
295
|
-
return be(t, ae(t));
|
|
296
|
-
if (typeof t == "string")
|
|
297
|
-
return Tt(t);
|
|
298
|
-
switch (t) {
|
|
299
|
-
case I:
|
|
300
|
-
return Tt("Suspense");
|
|
301
|
-
case y:
|
|
302
|
-
return Tt("SuspenseList");
|
|
303
|
-
}
|
|
304
|
-
if (typeof t == "object")
|
|
305
|
-
switch (t.$$typeof) {
|
|
306
|
-
case b:
|
|
307
|
-
return se(t.render);
|
|
308
|
-
case p:
|
|
309
|
-
return ft(t.type, c, h);
|
|
310
|
-
case m: {
|
|
311
|
-
var P = t, N = P._payload, X = P._init;
|
|
312
|
-
try {
|
|
313
|
-
return ft(X(N), c, h);
|
|
314
|
-
} catch {
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
return "";
|
|
319
|
-
}
|
|
320
|
-
var Pt = Object.prototype.hasOwnProperty, $t = {}, Rt = g.ReactDebugCurrentFrame;
|
|
321
|
-
function yt(t) {
|
|
322
|
-
if (t) {
|
|
323
|
-
var c = t._owner, h = ft(t.type, t._source, c ? c.type : null);
|
|
324
|
-
Rt.setExtraStackFrame(h);
|
|
325
|
-
} else
|
|
326
|
-
Rt.setExtraStackFrame(null);
|
|
327
|
-
}
|
|
328
|
-
function ze(t, c, h, P, N) {
|
|
329
|
-
{
|
|
330
|
-
var X = Function.call.bind(Pt);
|
|
331
|
-
for (var j in t)
|
|
332
|
-
if (X(t, j)) {
|
|
333
|
-
var D = void 0;
|
|
334
|
-
try {
|
|
335
|
-
if (typeof t[j] != "function") {
|
|
336
|
-
var at = Error((P || "React class") + ": " + h + " type `" + j + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof t[j] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
337
|
-
throw at.name = "Invariant Violation", at;
|
|
338
|
-
}
|
|
339
|
-
D = t[j](c, j, P, h, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
340
|
-
} catch (q) {
|
|
341
|
-
D = q;
|
|
342
|
-
}
|
|
343
|
-
D && !(D instanceof Error) && (yt(N), _("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", P || "React class", h, j, typeof D), yt(null)), D instanceof Error && !(D.message in $t) && ($t[D.message] = !0, yt(N), _("Failed %s type: %s", h, D.message), yt(null));
|
|
344
|
-
}
|
|
99
|
+
e(a);
|
|
100
|
+
var S = !1;
|
|
101
|
+
} catch {
|
|
102
|
+
S = !0;
|
|
345
103
|
}
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
return h;
|
|
104
|
+
if (S) {
|
|
105
|
+
S = console;
|
|
106
|
+
var j = S.error, F = typeof Symbol == "function" && Symbol.toStringTag && a[Symbol.toStringTag] || a.constructor.name || "Object";
|
|
107
|
+
return j.call(
|
|
108
|
+
S,
|
|
109
|
+
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
110
|
+
F
|
|
111
|
+
), e(a);
|
|
355
112
|
}
|
|
356
113
|
}
|
|
357
|
-
function
|
|
114
|
+
function n(a) {
|
|
115
|
+
if (a === N) return "<>";
|
|
116
|
+
if (typeof a == "object" && a !== null && a.$$typeof === E)
|
|
117
|
+
return "<...>";
|
|
358
118
|
try {
|
|
359
|
-
|
|
119
|
+
var S = t(a);
|
|
120
|
+
return S ? "<" + S + ">" : "<...>";
|
|
360
121
|
} catch {
|
|
361
|
-
return
|
|
122
|
+
return "<...>";
|
|
362
123
|
}
|
|
363
124
|
}
|
|
364
|
-
function
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
function St(t) {
|
|
368
|
-
if (Ee(t))
|
|
369
|
-
return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Mt(t)), Xt(t);
|
|
125
|
+
function o() {
|
|
126
|
+
var a = Y.A;
|
|
127
|
+
return a === null ? null : a.getOwner();
|
|
370
128
|
}
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
ref: !0,
|
|
374
|
-
__self: !0,
|
|
375
|
-
__source: !0
|
|
376
|
-
}, ce, gt;
|
|
377
|
-
function bt(t) {
|
|
378
|
-
if (Pt.call(t, "ref")) {
|
|
379
|
-
var c = Object.getOwnPropertyDescriptor(t, "ref").get;
|
|
380
|
-
if (c && c.isReactWarning)
|
|
381
|
-
return !1;
|
|
382
|
-
}
|
|
383
|
-
return t.ref !== void 0;
|
|
129
|
+
function i() {
|
|
130
|
+
return Error("react-stack-top-frame");
|
|
384
131
|
}
|
|
385
|
-
function
|
|
386
|
-
if (
|
|
387
|
-
var
|
|
388
|
-
if (
|
|
389
|
-
return !1;
|
|
132
|
+
function d(a) {
|
|
133
|
+
if (X.call(a, "key")) {
|
|
134
|
+
var S = Object.getOwnPropertyDescriptor(a, "key").get;
|
|
135
|
+
if (S && S.isReactWarning) return !1;
|
|
390
136
|
}
|
|
391
|
-
return
|
|
392
|
-
}
|
|
393
|
-
function Nt(t, c) {
|
|
394
|
-
typeof t.ref == "string" && Jt.current;
|
|
137
|
+
return a.key !== void 0;
|
|
395
138
|
}
|
|
396
|
-
function
|
|
397
|
-
{
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
get: h,
|
|
403
|
-
configurable: !0
|
|
404
|
-
});
|
|
139
|
+
function l(a, S) {
|
|
140
|
+
function j() {
|
|
141
|
+
R || (R = !0, console.error(
|
|
142
|
+
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
143
|
+
S
|
|
144
|
+
));
|
|
405
145
|
}
|
|
146
|
+
j.isReactWarning = !0, Object.defineProperty(a, "key", {
|
|
147
|
+
get: j,
|
|
148
|
+
configurable: !0
|
|
149
|
+
});
|
|
406
150
|
}
|
|
407
|
-
function
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
h.isReactWarning = !0, Object.defineProperty(t, "ref", {
|
|
413
|
-
get: h,
|
|
414
|
-
configurable: !0
|
|
415
|
-
});
|
|
416
|
-
}
|
|
151
|
+
function T() {
|
|
152
|
+
var a = t(this.type);
|
|
153
|
+
return k[a] || (k[a] = !0, console.error(
|
|
154
|
+
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
155
|
+
)), a = this.props.ref, a !== void 0 ? a : null;
|
|
417
156
|
}
|
|
418
|
-
|
|
419
|
-
var
|
|
420
|
-
|
|
421
|
-
$$typeof:
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
key: c,
|
|
425
|
-
ref: h,
|
|
157
|
+
function w(a, S, j, F, J, K) {
|
|
158
|
+
var $ = j.ref;
|
|
159
|
+
return a = {
|
|
160
|
+
$$typeof: c,
|
|
161
|
+
type: a,
|
|
162
|
+
key: S,
|
|
426
163
|
props: j,
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
164
|
+
_owner: F
|
|
165
|
+
}, ($ !== void 0 ? $ : null) !== null ? Object.defineProperty(a, "ref", {
|
|
166
|
+
enumerable: !1,
|
|
167
|
+
get: T
|
|
168
|
+
}) : Object.defineProperty(a, "ref", { enumerable: !1, value: null }), a._store = {}, Object.defineProperty(a._store, "validated", {
|
|
431
169
|
configurable: !1,
|
|
432
170
|
enumerable: !1,
|
|
433
171
|
writable: !0,
|
|
434
|
-
value:
|
|
435
|
-
}), Object.defineProperty(
|
|
172
|
+
value: 0
|
|
173
|
+
}), Object.defineProperty(a, "_debugInfo", {
|
|
436
174
|
configurable: !1,
|
|
437
175
|
enumerable: !1,
|
|
438
|
-
writable: !
|
|
439
|
-
value:
|
|
440
|
-
}), Object.defineProperty(
|
|
176
|
+
writable: !0,
|
|
177
|
+
value: null
|
|
178
|
+
}), Object.defineProperty(a, "_debugStack", {
|
|
441
179
|
configurable: !1,
|
|
442
180
|
enumerable: !1,
|
|
443
|
-
writable: !
|
|
444
|
-
value:
|
|
445
|
-
}), Object.
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
for (X in c)
|
|
452
|
-
Pt.call(c, X) && !_e.hasOwnProperty(X) && (j[X] = c[X]);
|
|
453
|
-
if (t && t.defaultProps) {
|
|
454
|
-
var q = t.defaultProps;
|
|
455
|
-
for (X in q)
|
|
456
|
-
j[X] === void 0 && (j[X] = q[X]);
|
|
457
|
-
}
|
|
458
|
-
if (D || at) {
|
|
459
|
-
var Z = typeof t == "function" ? t.displayName || t.name || "Unknown" : t;
|
|
460
|
-
D && Ne(j, Z), at && ue(j, Z);
|
|
461
|
-
}
|
|
462
|
-
return T(t, D, at, N, P, Jt.current, j);
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
var Zt = g.ReactCurrentOwner, Bt = g.ReactDebugCurrentFrame;
|
|
466
|
-
function Dt(t) {
|
|
467
|
-
if (t) {
|
|
468
|
-
var c = t._owner, h = ft(t.type, t._source, c ? c.type : null);
|
|
469
|
-
Bt.setExtraStackFrame(h);
|
|
470
|
-
} else
|
|
471
|
-
Bt.setExtraStackFrame(null);
|
|
472
|
-
}
|
|
473
|
-
var le;
|
|
474
|
-
le = !1;
|
|
475
|
-
function fe(t) {
|
|
476
|
-
return typeof t == "object" && t !== null && t.$$typeof === r;
|
|
477
|
-
}
|
|
478
|
-
function Te() {
|
|
479
|
-
{
|
|
480
|
-
if (Zt.current) {
|
|
481
|
-
var t = Y(Zt.current.type);
|
|
482
|
-
if (t)
|
|
483
|
-
return `
|
|
484
|
-
|
|
485
|
-
Check the render method of \`` + t + "`.";
|
|
486
|
-
}
|
|
487
|
-
return "";
|
|
488
|
-
}
|
|
489
|
-
}
|
|
490
|
-
function Fe(t) {
|
|
491
|
-
return "";
|
|
492
|
-
}
|
|
493
|
-
var Ct = {};
|
|
494
|
-
function Pe(t) {
|
|
495
|
-
{
|
|
496
|
-
var c = Te();
|
|
497
|
-
if (!c) {
|
|
498
|
-
var h = typeof t == "string" ? t : t.displayName || t.name;
|
|
499
|
-
h && (c = `
|
|
500
|
-
|
|
501
|
-
Check the top-level render call using <` + h + ">.");
|
|
502
|
-
}
|
|
503
|
-
return c;
|
|
504
|
-
}
|
|
505
|
-
}
|
|
506
|
-
function de(t, c) {
|
|
507
|
-
{
|
|
508
|
-
if (!t._store || t._store.validated || t.key != null)
|
|
509
|
-
return;
|
|
510
|
-
t._store.validated = !0;
|
|
511
|
-
var h = Pe(c);
|
|
512
|
-
if (Ct[h])
|
|
513
|
-
return;
|
|
514
|
-
Ct[h] = !0;
|
|
515
|
-
var P = "";
|
|
516
|
-
t && t._owner && t._owner !== Zt.current && (P = " It was passed a child from " + Y(t._owner.type) + "."), Dt(t), _('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', h, P), Dt(null);
|
|
517
|
-
}
|
|
518
|
-
}
|
|
519
|
-
function he(t, c) {
|
|
520
|
-
{
|
|
521
|
-
if (typeof t != "object")
|
|
522
|
-
return;
|
|
523
|
-
if (xt(t))
|
|
524
|
-
for (var h = 0; h < t.length; h++) {
|
|
525
|
-
var P = t[h];
|
|
526
|
-
fe(P) && de(P, c);
|
|
527
|
-
}
|
|
528
|
-
else if (fe(t))
|
|
529
|
-
t._store && (t._store.validated = !0);
|
|
530
|
-
else if (t) {
|
|
531
|
-
var N = W(t);
|
|
532
|
-
if (typeof N == "function" && N !== t.entries)
|
|
533
|
-
for (var X = N.call(t), j; !(j = X.next()).done; )
|
|
534
|
-
fe(j.value) && de(j.value, c);
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
}
|
|
538
|
-
function Re(t) {
|
|
539
|
-
{
|
|
540
|
-
var c = t.type;
|
|
541
|
-
if (c == null || typeof c == "string")
|
|
542
|
-
return;
|
|
543
|
-
var h;
|
|
544
|
-
if (typeof c == "function")
|
|
545
|
-
h = c.propTypes;
|
|
546
|
-
else if (typeof c == "object" && (c.$$typeof === b || // Note: Memo only checks outer props here.
|
|
547
|
-
// Inner props are checked in the reconciler.
|
|
548
|
-
c.$$typeof === p))
|
|
549
|
-
h = c.propTypes;
|
|
550
|
-
else
|
|
551
|
-
return;
|
|
552
|
-
if (h) {
|
|
553
|
-
var P = Y(c);
|
|
554
|
-
ze(h, t.props, "prop", P, t);
|
|
555
|
-
} else if (c.PropTypes !== void 0 && !le) {
|
|
556
|
-
le = !0;
|
|
557
|
-
var N = Y(c);
|
|
558
|
-
_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", N || "Unknown");
|
|
559
|
-
}
|
|
560
|
-
typeof c.getDefaultProps == "function" && !c.getDefaultProps.isReactClassApproved && _("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
function $(t) {
|
|
564
|
-
{
|
|
565
|
-
for (var c = Object.keys(t.props), h = 0; h < c.length; h++) {
|
|
566
|
-
var P = c[h];
|
|
567
|
-
if (P !== "children" && P !== "key") {
|
|
568
|
-
Dt(t), _("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", P), Dt(null);
|
|
569
|
-
break;
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
t.ref !== null && (Dt(t), _("Invalid attribute `ref` supplied to `React.Fragment`."), Dt(null));
|
|
573
|
-
}
|
|
181
|
+
writable: !0,
|
|
182
|
+
value: J
|
|
183
|
+
}), Object.defineProperty(a, "_debugTask", {
|
|
184
|
+
configurable: !1,
|
|
185
|
+
enumerable: !1,
|
|
186
|
+
writable: !0,
|
|
187
|
+
value: K
|
|
188
|
+
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
574
189
|
}
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
for (var V = 0; V < Q.length; V++)
|
|
596
|
-
he(Q[V], t);
|
|
597
|
-
Object.freeze && Object.freeze(Q);
|
|
598
|
-
} else
|
|
599
|
-
_("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
600
|
-
else
|
|
601
|
-
he(Q, t);
|
|
602
|
-
}
|
|
603
|
-
if (Pt.call(c, "key")) {
|
|
604
|
-
var Lt = Y(t), ct = Object.keys(c).filter(function(Le) {
|
|
605
|
-
return Le !== "key";
|
|
606
|
-
}), pe = ct.length > 0 ? "{key: someKey, " + ct.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
607
|
-
if (!Se[Lt + pe]) {
|
|
608
|
-
var ht = ct.length > 0 ? "{" + ct.join(": ..., ") + ": ...}" : "{}";
|
|
609
|
-
_(`A props object containing a "key" prop is being spread into JSX:
|
|
190
|
+
function b(a, S, j, F, J, K) {
|
|
191
|
+
var $ = S.children;
|
|
192
|
+
if ($ !== void 0)
|
|
193
|
+
if (F)
|
|
194
|
+
if (Z($)) {
|
|
195
|
+
for (F = 0; F < $.length; F++)
|
|
196
|
+
h($[F]);
|
|
197
|
+
Object.freeze && Object.freeze($);
|
|
198
|
+
} else
|
|
199
|
+
console.error(
|
|
200
|
+
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
201
|
+
);
|
|
202
|
+
else h($);
|
|
203
|
+
if (X.call(S, "key")) {
|
|
204
|
+
$ = t(a);
|
|
205
|
+
var st = Object.keys(S).filter(function(ee) {
|
|
206
|
+
return ee !== "key";
|
|
207
|
+
});
|
|
208
|
+
F = 0 < st.length ? "{key: someKey, " + st.join(": ..., ") + ": ...}" : "{key: someKey}", wt[$ + F] || (st = 0 < st.length ? "{" + st.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
209
|
+
`A props object containing a "key" prop is being spread into JSX:
|
|
610
210
|
let props = %s;
|
|
611
211
|
<%s {...props} />
|
|
612
212
|
React keys must be passed directly to JSX without using spread:
|
|
613
213
|
let props = %s;
|
|
614
|
-
<%s key={someKey} {...props} />`,
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
214
|
+
<%s key={someKey} {...props} />`,
|
|
215
|
+
F,
|
|
216
|
+
$,
|
|
217
|
+
st,
|
|
218
|
+
$
|
|
219
|
+
), wt[$ + F] = !0);
|
|
618
220
|
}
|
|
221
|
+
if ($ = null, j !== void 0 && (s(j), $ = "" + j), d(S) && (s(S.key), $ = "" + S.key), "key" in S) {
|
|
222
|
+
j = {};
|
|
223
|
+
for (var it in S)
|
|
224
|
+
it !== "key" && (j[it] = S[it]);
|
|
225
|
+
} else j = S;
|
|
226
|
+
return $ && l(
|
|
227
|
+
j,
|
|
228
|
+
typeof a == "function" ? a.displayName || a.name || "Unknown" : a
|
|
229
|
+
), w(
|
|
230
|
+
a,
|
|
231
|
+
$,
|
|
232
|
+
j,
|
|
233
|
+
o(),
|
|
234
|
+
J,
|
|
235
|
+
K
|
|
236
|
+
);
|
|
619
237
|
}
|
|
620
|
-
function
|
|
621
|
-
|
|
238
|
+
function h(a) {
|
|
239
|
+
m(a) ? a._store && (a._store.validated = 1) : typeof a == "object" && a !== null && a.$$typeof === E && (a._payload.status === "fulfilled" ? m(a._payload.value) && a._payload.value._store && (a._payload.value._store.validated = 1) : a._store && (a._store.validated = 1));
|
|
622
240
|
}
|
|
623
|
-
function
|
|
624
|
-
return
|
|
241
|
+
function m(a) {
|
|
242
|
+
return typeof a == "object" && a !== null && a.$$typeof === c;
|
|
625
243
|
}
|
|
626
|
-
var
|
|
627
|
-
|
|
628
|
-
|
|
244
|
+
var g = Ft, c = Symbol.for("react.transitional.element"), v = Symbol.for("react.portal"), N = Symbol.for("react.fragment"), x = Symbol.for("react.strict_mode"), P = Symbol.for("react.profiler"), p = Symbol.for("react.consumer"), f = Symbol.for("react.context"), B = Symbol.for("react.forward_ref"), q = Symbol.for("react.suspense"), et = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), E = Symbol.for("react.lazy"), C = Symbol.for("react.activity"), D = Symbol.for("react.client.reference"), Y = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, X = Object.prototype.hasOwnProperty, Z = Array.isArray, Q = console.createTask ? console.createTask : function() {
|
|
245
|
+
return null;
|
|
246
|
+
};
|
|
247
|
+
g = {
|
|
248
|
+
react_stack_bottom_frame: function(a) {
|
|
249
|
+
return a();
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
var R, k = {}, O = g.react_stack_bottom_frame.bind(
|
|
253
|
+
g,
|
|
254
|
+
i
|
|
255
|
+
)(), W = Q(n(i)), wt = {};
|
|
256
|
+
Wt.Fragment = N, Wt.jsx = function(a, S, j) {
|
|
257
|
+
var F = 1e4 > Y.recentlyCreatedOwnerStacks++;
|
|
258
|
+
return b(
|
|
259
|
+
a,
|
|
260
|
+
S,
|
|
261
|
+
j,
|
|
262
|
+
!1,
|
|
263
|
+
F ? Error("react-stack-top-frame") : O,
|
|
264
|
+
F ? Q(n(a)) : W
|
|
265
|
+
);
|
|
266
|
+
}, Wt.jsxs = function(a, S, j) {
|
|
267
|
+
var F = 1e4 > Y.recentlyCreatedOwnerStacks++;
|
|
268
|
+
return b(
|
|
269
|
+
a,
|
|
270
|
+
S,
|
|
271
|
+
j,
|
|
272
|
+
!0,
|
|
273
|
+
F ? Error("react-stack-top-frame") : O,
|
|
274
|
+
F ? Q(n(a)) : W
|
|
275
|
+
);
|
|
276
|
+
};
|
|
277
|
+
}()), Wt;
|
|
629
278
|
}
|
|
630
|
-
process.env.NODE_ENV === "production" ?
|
|
631
|
-
var
|
|
632
|
-
function
|
|
633
|
-
return
|
|
279
|
+
process.env.NODE_ENV === "production" ? be.exports = an() : be.exports = cn();
|
|
280
|
+
var M = be.exports;
|
|
281
|
+
function ue(t) {
|
|
282
|
+
return t.trim().toLowerCase();
|
|
634
283
|
}
|
|
635
|
-
function
|
|
636
|
-
const
|
|
637
|
-
return
|
|
638
|
-
const
|
|
639
|
-
if (!
|
|
284
|
+
function ln(t) {
|
|
285
|
+
const e = /* @__PURE__ */ new Map();
|
|
286
|
+
return t.forEach((s) => {
|
|
287
|
+
const n = s.meta;
|
|
288
|
+
if (!n)
|
|
640
289
|
return;
|
|
641
|
-
const
|
|
642
|
-
d.length &&
|
|
643
|
-
}),
|
|
290
|
+
const o = n.pathKeys, d = (Array.isArray(o) ? o : []).map((l) => typeof l == "string" ? l : typeof l == "object" && l !== null && "name" in l && typeof l.name == "string" ? l.name : null).filter((l) => typeof l == "string").map((l) => l.trim()).filter((l) => l.length > 0);
|
|
291
|
+
d.length && e.set(s.id, d);
|
|
292
|
+
}), e;
|
|
644
293
|
}
|
|
645
|
-
function
|
|
294
|
+
function un(t) {
|
|
646
295
|
const {
|
|
647
|
-
startNodeId:
|
|
648
|
-
sourceIndex:
|
|
649
|
-
pathKey:
|
|
650
|
-
incomingEdgesByTarget:
|
|
651
|
-
pathKeysByNode:
|
|
296
|
+
startNodeId: e,
|
|
297
|
+
sourceIndex: s,
|
|
298
|
+
pathKey: n,
|
|
299
|
+
incomingEdgesByTarget: o,
|
|
300
|
+
pathKeysByNode: i,
|
|
652
301
|
maxNodes: d = 500
|
|
653
|
-
} =
|
|
654
|
-
{ nodeId:
|
|
302
|
+
} = t, l = /* @__PURE__ */ new Set([e]), T = /* @__PURE__ */ new Set(), w = /* @__PURE__ */ new Set([`${e}|${s ?? ""}|${n ?? ""}`]), b = [
|
|
303
|
+
{ nodeId: e, sourceIndex: s ?? null, pathKey: n }
|
|
655
304
|
];
|
|
656
|
-
for (;
|
|
657
|
-
const
|
|
658
|
-
if (!
|
|
305
|
+
for (; b.length && !(l.size >= d); ) {
|
|
306
|
+
const h = b.pop();
|
|
307
|
+
if (!h)
|
|
659
308
|
continue;
|
|
660
|
-
const m =
|
|
661
|
-
let
|
|
662
|
-
|
|
663
|
-
if (
|
|
309
|
+
const m = o.get(h.nodeId) ?? [], g = h.pathKey ? ue(h.pathKey) : null;
|
|
310
|
+
let c = [];
|
|
311
|
+
g && i && (c = m.filter((v) => (i.get(v.source) ?? []).some((x) => ue(x) === g))), c.length || (h.sourceIndex == null ? c = m : m[h.sourceIndex] && (c = [m[h.sourceIndex]])), c.forEach((v) => {
|
|
312
|
+
if (T.has(v.id))
|
|
664
313
|
return;
|
|
665
|
-
|
|
666
|
-
const
|
|
667
|
-
|
|
668
|
-
nodeId:
|
|
669
|
-
sourceIndex:
|
|
670
|
-
pathKey:
|
|
314
|
+
T.add(v.id), l.add(v.source);
|
|
315
|
+
const N = (i == null ? void 0 : i.get(v.source)) ?? [], x = g ? N.findIndex((f) => ue(f) === g) : h.sourceIndex, P = typeof x == "number" && x >= 0 ? x : h.sourceIndex, p = `${v.source}|${P ?? ""}|${h.pathKey ?? ""}`;
|
|
316
|
+
w.has(p) || (w.add(p), b.push({
|
|
317
|
+
nodeId: v.source,
|
|
318
|
+
sourceIndex: P,
|
|
319
|
+
pathKey: h.pathKey
|
|
671
320
|
}));
|
|
672
321
|
});
|
|
673
322
|
}
|
|
674
|
-
return { nodes:
|
|
323
|
+
return { nodes: l, edges: T };
|
|
675
324
|
}
|
|
676
|
-
function
|
|
677
|
-
const [
|
|
678
|
-
() => new Map(
|
|
679
|
-
[r]
|
|
680
|
-
), y = M(() => {
|
|
681
|
-
const g = /* @__PURE__ */ new Map();
|
|
682
|
-
return r.forEach((_) => {
|
|
683
|
-
g.set(_.source, [...g.get(_.source) ?? [], _]), _.target !== _.source && g.set(_.target, [...g.get(_.target) ?? [], _]);
|
|
684
|
-
}), g;
|
|
685
|
-
}, [r]), p = M(() => {
|
|
686
|
-
const g = /* @__PURE__ */ new Map();
|
|
687
|
-
return e.forEach((_) => g.set(_.id, _.position)), g;
|
|
688
|
-
}, [e]), m = M(
|
|
689
|
-
() => un(e),
|
|
325
|
+
function dn(t, e, s) {
|
|
326
|
+
const [n, o] = ut(null), [i, d] = ut(null), [l, T] = ut(null), w = A(
|
|
327
|
+
() => new Map(e.map((x) => [x.id, x])),
|
|
690
328
|
[e]
|
|
691
|
-
),
|
|
692
|
-
const
|
|
693
|
-
return
|
|
694
|
-
|
|
695
|
-
}),
|
|
696
|
-
}, [
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
329
|
+
), b = A(() => {
|
|
330
|
+
const x = /* @__PURE__ */ new Map();
|
|
331
|
+
return e.forEach((P) => {
|
|
332
|
+
x.set(P.source, [...x.get(P.source) ?? [], P]), P.target !== P.source && x.set(P.target, [...x.get(P.target) ?? [], P]);
|
|
333
|
+
}), x;
|
|
334
|
+
}, [e]), h = A(() => {
|
|
335
|
+
const x = /* @__PURE__ */ new Map();
|
|
336
|
+
return t.forEach((P) => x.set(P.id, P.position)), x;
|
|
337
|
+
}, [t]), m = A(
|
|
338
|
+
() => ln(t),
|
|
339
|
+
[t]
|
|
340
|
+
), g = A(() => {
|
|
341
|
+
const x = en(e);
|
|
342
|
+
return x.forEach((P, p) => {
|
|
343
|
+
x.set(p, rn(P, h));
|
|
344
|
+
}), x;
|
|
345
|
+
}, [e, h]), c = A(() => l ? un({
|
|
346
|
+
startNodeId: l.nodeId,
|
|
347
|
+
sourceIndex: l.sourceIndex,
|
|
348
|
+
pathKey: l.pathKey,
|
|
349
|
+
incomingEdgesByTarget: g,
|
|
701
350
|
pathKeysByNode: m
|
|
702
|
-
}) : null, [
|
|
703
|
-
if (!
|
|
704
|
-
const
|
|
705
|
-
|
|
706
|
-
const
|
|
707
|
-
|
|
351
|
+
}) : null, [l, g, m]), v = A(() => {
|
|
352
|
+
if (!s && !c) return null;
|
|
353
|
+
const x = /* @__PURE__ */ new Map(), P = () => {
|
|
354
|
+
c && c.nodes.forEach((p) => {
|
|
355
|
+
const f = x.get(p) ?? { in: !1, out: !1 };
|
|
356
|
+
x.set(p, { ...f, in: !0, out: !0 });
|
|
708
357
|
});
|
|
709
358
|
};
|
|
710
|
-
if (
|
|
711
|
-
|
|
359
|
+
if (l)
|
|
360
|
+
P();
|
|
712
361
|
else {
|
|
713
|
-
if (
|
|
714
|
-
if (
|
|
715
|
-
const
|
|
716
|
-
if (
|
|
717
|
-
const
|
|
718
|
-
const
|
|
719
|
-
|
|
362
|
+
if (s) {
|
|
363
|
+
if (n) {
|
|
364
|
+
const p = w.get(n);
|
|
365
|
+
if (p) {
|
|
366
|
+
const f = (B, q) => {
|
|
367
|
+
const et = x.get(B) ?? { in: !1, out: !1 };
|
|
368
|
+
x.set(B, { ...et, [q]: !0 });
|
|
720
369
|
};
|
|
721
|
-
|
|
370
|
+
p.type === "undirected" ? (f(p.source, "in"), f(p.source, "out"), f(p.target, "in"), f(p.target, "out")) : (f(p.source, "out"), f(p.target, "in"));
|
|
722
371
|
}
|
|
723
|
-
} else if (
|
|
724
|
-
const
|
|
725
|
-
const
|
|
726
|
-
|
|
372
|
+
} else if (i) {
|
|
373
|
+
const p = (f, B) => {
|
|
374
|
+
const q = x.get(f) ?? { in: !1, out: !1 };
|
|
375
|
+
x.set(f, { ...q, [B]: !0 });
|
|
727
376
|
};
|
|
728
|
-
(
|
|
729
|
-
const
|
|
730
|
-
(
|
|
731
|
-
}),
|
|
377
|
+
(b.get(i) ?? []).forEach((f) => {
|
|
378
|
+
const B = f.type === "undirected";
|
|
379
|
+
(f.source === i || f.target === i) && (B ? (p(f.source, "in"), p(f.source, "out"), p(f.target, "in"), p(f.target, "out")) : (p(f.source, "out"), p(f.target, "in")));
|
|
380
|
+
}), p(i, "in"), p(i, "out");
|
|
732
381
|
}
|
|
733
382
|
}
|
|
734
|
-
|
|
383
|
+
P();
|
|
735
384
|
}
|
|
736
|
-
return
|
|
385
|
+
return x.size ? x : null;
|
|
737
386
|
}, [
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
387
|
+
w,
|
|
388
|
+
b,
|
|
389
|
+
s,
|
|
390
|
+
n,
|
|
741
391
|
i,
|
|
742
|
-
|
|
743
|
-
l
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
}), [...w, ..._];
|
|
392
|
+
c,
|
|
393
|
+
l
|
|
394
|
+
]), N = A(() => {
|
|
395
|
+
const x = /* @__PURE__ */ new Set();
|
|
396
|
+
if (l && c ? c.edges.forEach((f) => x.add(f)) : (s && (n ? x.add(n) : i && (b.get(i) ?? []).forEach((f) => {
|
|
397
|
+
(f.source === i || f.target === i) && x.add(f.id);
|
|
398
|
+
})), c && c.edges.forEach((f) => x.add(f))), !x.size) return e;
|
|
399
|
+
const P = [], p = [];
|
|
400
|
+
return e.forEach((f) => {
|
|
401
|
+
x.has(f.id) ? P.push(f) : p.push(f);
|
|
402
|
+
}), [...p, ...P];
|
|
754
403
|
}, [
|
|
755
|
-
|
|
756
|
-
|
|
404
|
+
b,
|
|
405
|
+
s,
|
|
406
|
+
n,
|
|
757
407
|
i,
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
l
|
|
761
|
-
u
|
|
408
|
+
e,
|
|
409
|
+
c,
|
|
410
|
+
l
|
|
762
411
|
]);
|
|
763
412
|
return {
|
|
764
|
-
hoveredEdgeId:
|
|
765
|
-
setHoveredEdgeId:
|
|
766
|
-
hoveredNodeId:
|
|
413
|
+
hoveredEdgeId: n,
|
|
414
|
+
setHoveredEdgeId: o,
|
|
415
|
+
hoveredNodeId: i,
|
|
767
416
|
setHoveredNodeId: d,
|
|
768
|
-
focusedPath:
|
|
769
|
-
setFocusedPath:
|
|
770
|
-
pathHighlight:
|
|
771
|
-
hoveredNodeStates:
|
|
772
|
-
edgesForRender:
|
|
417
|
+
focusedPath: l,
|
|
418
|
+
setFocusedPath: T,
|
|
419
|
+
pathHighlight: c,
|
|
420
|
+
hoveredNodeStates: v,
|
|
421
|
+
edgesForRender: N
|
|
773
422
|
};
|
|
774
423
|
}
|
|
775
|
-
const
|
|
776
|
-
collapsedNodeIds:
|
|
777
|
-
defaultCollapsedNodeIds:
|
|
778
|
-
onCollapsedNodeIdsChange:
|
|
424
|
+
const fn = ({
|
|
425
|
+
collapsedNodeIds: t,
|
|
426
|
+
defaultCollapsedNodeIds: e,
|
|
427
|
+
onCollapsedNodeIdsChange: s
|
|
779
428
|
}) => {
|
|
780
|
-
const [
|
|
781
|
-
|
|
782
|
-
), [
|
|
783
|
-
() => new Set(
|
|
784
|
-
[
|
|
785
|
-
),
|
|
786
|
-
(
|
|
787
|
-
const
|
|
788
|
-
|
|
429
|
+
const [n, o] = ut(
|
|
430
|
+
e ?? []
|
|
431
|
+
), [i, d] = ut([]), l = t ?? n, T = A(() => new Set(l), [l]), w = A(
|
|
432
|
+
() => new Set(i),
|
|
433
|
+
[i]
|
|
434
|
+
), b = G(
|
|
435
|
+
(h) => {
|
|
436
|
+
const g = typeof h == "function" ? h(l) : h;
|
|
437
|
+
t == null && o(g), s == null || s(g);
|
|
789
438
|
},
|
|
790
|
-
[
|
|
439
|
+
[l, t, s]
|
|
791
440
|
);
|
|
792
441
|
return {
|
|
793
|
-
collapsedIds:
|
|
794
|
-
collapsedNodeSet:
|
|
795
|
-
pendingExpansionNodeSet:
|
|
796
|
-
updateCollapsedNodeIds:
|
|
442
|
+
collapsedIds: l,
|
|
443
|
+
collapsedNodeSet: T,
|
|
444
|
+
pendingExpansionNodeSet: w,
|
|
445
|
+
updateCollapsedNodeIds: b,
|
|
797
446
|
setPendingExpansionNodeIds: d
|
|
798
447
|
};
|
|
799
448
|
}, hn = ({
|
|
800
|
-
nodes:
|
|
801
|
-
edges:
|
|
802
|
-
collapsedIds:
|
|
803
|
-
hiddenNodeIds:
|
|
804
|
-
searchQuery:
|
|
805
|
-
hideUnmatchedSearch:
|
|
449
|
+
nodes: t,
|
|
450
|
+
edges: e,
|
|
451
|
+
collapsedIds: s,
|
|
452
|
+
hiddenNodeIds: n,
|
|
453
|
+
searchQuery: o,
|
|
454
|
+
hideUnmatchedSearch: i = !1,
|
|
806
455
|
searchPredicate: d,
|
|
807
|
-
highlightedNodeIds:
|
|
808
|
-
highlightedEdgeIds:
|
|
809
|
-
highlightStrategy:
|
|
810
|
-
onSearchResultsChange:
|
|
456
|
+
highlightedNodeIds: l,
|
|
457
|
+
highlightedEdgeIds: T,
|
|
458
|
+
highlightStrategy: w,
|
|
459
|
+
onSearchResultsChange: b
|
|
811
460
|
}) => {
|
|
812
|
-
const
|
|
813
|
-
|
|
814
|
-
const m =
|
|
815
|
-
const
|
|
816
|
-
return
|
|
461
|
+
const h = ot(b);
|
|
462
|
+
h.current = b;
|
|
463
|
+
const m = A(() => {
|
|
464
|
+
const _ = o == null ? void 0 : o.trim().toLowerCase();
|
|
465
|
+
return _ ? t.filter((E) => {
|
|
817
466
|
if (d)
|
|
818
467
|
try {
|
|
819
|
-
return d(
|
|
468
|
+
return d(E, _);
|
|
820
469
|
} catch {
|
|
821
470
|
return !1;
|
|
822
471
|
}
|
|
823
|
-
const
|
|
824
|
-
return
|
|
825
|
-
}).map((
|
|
826
|
-
}, [
|
|
472
|
+
const C = typeof E.label == "string" || typeof E.label == "number" ? String(E.label) : E.id;
|
|
473
|
+
return E.id.toLowerCase().includes(_) || C.toLowerCase().includes(_);
|
|
474
|
+
}).map((E) => E.id) : [];
|
|
475
|
+
}, [t, d, o]), g = A(
|
|
827
476
|
() => new Set(m),
|
|
828
477
|
[m]
|
|
829
|
-
),
|
|
830
|
-
const
|
|
831
|
-
return
|
|
832
|
-
const
|
|
833
|
-
return
|
|
834
|
-
}).map((
|
|
835
|
-
}, [
|
|
478
|
+
), c = A(() => {
|
|
479
|
+
const _ = o == null ? void 0 : o.trim().toLowerCase();
|
|
480
|
+
return _ ? e.filter((E) => {
|
|
481
|
+
const C = E.label != null ? String(E.label).toLowerCase() : "";
|
|
482
|
+
return g.has(E.source) || g.has(E.target) || C.includes(_);
|
|
483
|
+
}).map((E) => E.id) : [];
|
|
484
|
+
}, [e, g, o]), v = A(() => o != null && o.trim() ? (() => {
|
|
836
485
|
try {
|
|
837
|
-
return (
|
|
838
|
-
nodes:
|
|
839
|
-
edges:
|
|
840
|
-
query:
|
|
486
|
+
return (w == null ? void 0 : w({
|
|
487
|
+
nodes: t,
|
|
488
|
+
edges: e,
|
|
489
|
+
query: o,
|
|
841
490
|
matchedNodeIds: m,
|
|
842
|
-
matchedEdgeIds:
|
|
491
|
+
matchedEdgeIds: c
|
|
843
492
|
})) ?? { nodeIds: [], edgeIds: [] };
|
|
844
493
|
} catch {
|
|
845
494
|
return { nodeIds: [], edgeIds: [] };
|
|
846
495
|
}
|
|
847
|
-
})() : { nodeIds: [], edgeIds: [] }, [
|
|
496
|
+
})() : { nodeIds: [], edgeIds: [] }, [e, w, t, c, m, o]), N = A(
|
|
848
497
|
() => /* @__PURE__ */ new Set([
|
|
849
498
|
...m,
|
|
850
|
-
...
|
|
851
|
-
...
|
|
499
|
+
...v.nodeIds ?? [],
|
|
500
|
+
...l ?? []
|
|
852
501
|
]),
|
|
853
|
-
[
|
|
854
|
-
),
|
|
502
|
+
[v.nodeIds, l, m]
|
|
503
|
+
), x = A(
|
|
855
504
|
() => /* @__PURE__ */ new Set([
|
|
856
|
-
...
|
|
857
|
-
...
|
|
858
|
-
...
|
|
505
|
+
...c,
|
|
506
|
+
...v.edgeIds ?? [],
|
|
507
|
+
...T ?? []
|
|
859
508
|
]),
|
|
860
|
-
[
|
|
509
|
+
[v.edgeIds, T, c]
|
|
861
510
|
);
|
|
862
|
-
|
|
863
|
-
var
|
|
864
|
-
(
|
|
511
|
+
zt(() => {
|
|
512
|
+
var _;
|
|
513
|
+
(_ = h.current) == null || _.call(h, {
|
|
865
514
|
nodeIds: m,
|
|
866
|
-
edgeIds:
|
|
515
|
+
edgeIds: c
|
|
867
516
|
});
|
|
868
|
-
}, [
|
|
869
|
-
const
|
|
870
|
-
const
|
|
871
|
-
return
|
|
872
|
-
|
|
873
|
-
}),
|
|
874
|
-
}, [
|
|
875
|
-
const
|
|
876
|
-
return
|
|
877
|
-
|
|
878
|
-
}),
|
|
879
|
-
}, [
|
|
880
|
-
const
|
|
881
|
-
return
|
|
882
|
-
const
|
|
883
|
-
for (;
|
|
884
|
-
const
|
|
885
|
-
!
|
|
517
|
+
}, [c, m]);
|
|
518
|
+
const P = A(() => {
|
|
519
|
+
const _ = new Set(n ?? []);
|
|
520
|
+
return i && (o != null && o.trim()) && t.forEach((E) => {
|
|
521
|
+
N.has(E.id) || _.add(E.id);
|
|
522
|
+
}), _;
|
|
523
|
+
}, [N, n, i, t, o]), p = A(() => {
|
|
524
|
+
const _ = /* @__PURE__ */ new Map();
|
|
525
|
+
return e.forEach((E) => {
|
|
526
|
+
_.set(E.source, [..._.get(E.source) ?? [], E.target]);
|
|
527
|
+
}), _;
|
|
528
|
+
}, [e]), f = A(() => {
|
|
529
|
+
const _ = new Set(P);
|
|
530
|
+
return s.forEach((E) => {
|
|
531
|
+
const C = [...p.get(E) ?? []];
|
|
532
|
+
for (; C.length; ) {
|
|
533
|
+
const D = C.pop();
|
|
534
|
+
!D || _.has(D) || (_.add(D), C.push(...p.get(D) ?? []));
|
|
886
535
|
}
|
|
887
|
-
}),
|
|
888
|
-
}, [
|
|
889
|
-
() =>
|
|
890
|
-
[
|
|
891
|
-
),
|
|
892
|
-
() =>
|
|
893
|
-
(
|
|
536
|
+
}), _;
|
|
537
|
+
}, [s, P, p]), B = A(
|
|
538
|
+
() => t.filter((_) => !f.has(_.id)),
|
|
539
|
+
[f, t]
|
|
540
|
+
), q = A(
|
|
541
|
+
() => e.filter(
|
|
542
|
+
(_) => !f.has(_.source) && !f.has(_.target)
|
|
894
543
|
),
|
|
895
|
-
[
|
|
544
|
+
[f, e]
|
|
896
545
|
);
|
|
897
546
|
return {
|
|
898
|
-
effectiveHighlightedNodeSet:
|
|
899
|
-
effectiveHighlightedEdgeSet:
|
|
900
|
-
visibleNodes:
|
|
901
|
-
visibleEdges:
|
|
902
|
-
childNodeIdsByParent:
|
|
547
|
+
effectiveHighlightedNodeSet: N,
|
|
548
|
+
effectiveHighlightedEdgeSet: x,
|
|
549
|
+
visibleNodes: B,
|
|
550
|
+
visibleEdges: q,
|
|
551
|
+
childNodeIdsByParent: p
|
|
903
552
|
};
|
|
904
|
-
},
|
|
905
|
-
const
|
|
906
|
-
if (
|
|
553
|
+
}, dr = (t) => !!(t && Number.isFinite(t.x) && Number.isFinite(t.y)), $t = (t, e, s) => {
|
|
554
|
+
const n = new Set(e.map((i) => i.id));
|
|
555
|
+
if (t.length !== e.length)
|
|
907
556
|
throw new Error(
|
|
908
|
-
`${
|
|
557
|
+
`${s} must return ${e.length} nodes, received ${t.length}.`
|
|
909
558
|
);
|
|
910
|
-
const
|
|
911
|
-
|
|
912
|
-
if (!
|
|
913
|
-
throw new Error(`${
|
|
914
|
-
if (
|
|
915
|
-
throw new Error(`${
|
|
916
|
-
if (!
|
|
917
|
-
throw new Error(`${
|
|
918
|
-
|
|
559
|
+
const o = /* @__PURE__ */ new Set();
|
|
560
|
+
t.forEach((i) => {
|
|
561
|
+
if (!n.has(i.id))
|
|
562
|
+
throw new Error(`${s} returned unknown node id "${i.id}".`);
|
|
563
|
+
if (o.has(i.id))
|
|
564
|
+
throw new Error(`${s} returned duplicate node id "${i.id}".`);
|
|
565
|
+
if (!dr(i.position))
|
|
566
|
+
throw new Error(`${s} returned a non-finite position for node "${i.id}".`);
|
|
567
|
+
o.add(i.id);
|
|
919
568
|
});
|
|
920
|
-
},
|
|
921
|
-
const
|
|
922
|
-
|
|
923
|
-
if (
|
|
924
|
-
throw new Error(`${
|
|
925
|
-
if (!
|
|
569
|
+
}, Bt = (t, e, s) => {
|
|
570
|
+
const n = /* @__PURE__ */ new Set();
|
|
571
|
+
t.forEach((o) => {
|
|
572
|
+
if (n.has(o.id))
|
|
573
|
+
throw new Error(`${s} returned duplicate edge id "${o.id}".`);
|
|
574
|
+
if (!e.has(o.source) || !e.has(o.target))
|
|
926
575
|
throw new Error(
|
|
927
|
-
`${
|
|
576
|
+
`${s} returned edge "${o.id}" with unknown endpoint(s): ${o.source} -> ${o.target}.`
|
|
928
577
|
);
|
|
929
|
-
if (!Array.isArray(
|
|
930
|
-
throw new Error(`${
|
|
931
|
-
|
|
932
|
-
if (!
|
|
578
|
+
if (!Array.isArray(o.points) || o.points.length < 2)
|
|
579
|
+
throw new Error(`${s} returned edge "${o.id}" without a valid point path.`);
|
|
580
|
+
o.points.forEach((i, d) => {
|
|
581
|
+
if (!dr(i))
|
|
933
582
|
throw new Error(
|
|
934
|
-
`${
|
|
583
|
+
`${s} returned a non-finite point at index ${d} for edge "${o.id}".`
|
|
935
584
|
);
|
|
936
|
-
}),
|
|
585
|
+
}), n.add(o.id);
|
|
937
586
|
});
|
|
938
|
-
},
|
|
939
|
-
...
|
|
940
|
-
layout:
|
|
941
|
-
}),
|
|
942
|
-
const
|
|
943
|
-
return
|
|
944
|
-
var
|
|
945
|
-
const
|
|
946
|
-
if (!
|
|
587
|
+
}, at = (t) => t instanceof Error ? t : new Error(String(t)), er = (t) => we({
|
|
588
|
+
...t,
|
|
589
|
+
layout: Jt.Centered
|
|
590
|
+
}), rr = (t, e) => {
|
|
591
|
+
const s = new Map(t.map((n) => [n.id, n]));
|
|
592
|
+
return e.flatMap((n) => {
|
|
593
|
+
var b, h, m, g;
|
|
594
|
+
const o = s.get(n.source), i = s.get(n.target);
|
|
595
|
+
if (!o || !i)
|
|
947
596
|
return [];
|
|
948
|
-
const d = ((
|
|
949
|
-
if (
|
|
950
|
-
const
|
|
597
|
+
const d = ((b = o.size) == null ? void 0 : b.width) ?? 0, l = ((h = o.size) == null ? void 0 : h.height) ?? 0, T = ((m = i.size) == null ? void 0 : m.width) ?? 0, w = ((g = i.size) == null ? void 0 : g.height) ?? 0;
|
|
598
|
+
if (o.id === i.id) {
|
|
599
|
+
const c = o.position.x + d, v = o.position.y;
|
|
951
600
|
return [
|
|
952
601
|
{
|
|
953
|
-
...
|
|
954
|
-
type:
|
|
602
|
+
...n,
|
|
603
|
+
type: n.type ?? qe.Directed,
|
|
955
604
|
points: [
|
|
956
|
-
{
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
605
|
+
{
|
|
606
|
+
x: c - Math.min(d * 0.25, 18),
|
|
607
|
+
y: v + Math.min(l * 0.35, 18)
|
|
608
|
+
},
|
|
609
|
+
{ x: c + 28, y: v - 20 },
|
|
610
|
+
{ x: c + 36, y: v + l / 2 },
|
|
611
|
+
{ x: c - Math.min(d * 0.25, 18), y: v + l * 0.8 }
|
|
960
612
|
]
|
|
961
613
|
}
|
|
962
614
|
];
|
|
963
615
|
}
|
|
964
616
|
return [
|
|
965
617
|
{
|
|
966
|
-
...
|
|
967
|
-
type:
|
|
618
|
+
...n,
|
|
619
|
+
type: n.type ?? qe.Directed,
|
|
968
620
|
points: [
|
|
969
621
|
{
|
|
970
|
-
x:
|
|
971
|
-
y:
|
|
622
|
+
x: o.position.x + d / 2,
|
|
623
|
+
y: o.position.y + l / 2
|
|
972
624
|
},
|
|
973
625
|
{
|
|
974
|
-
x:
|
|
975
|
-
y:
|
|
626
|
+
x: i.position.x + T / 2,
|
|
627
|
+
y: i.position.y + w / 2
|
|
976
628
|
}
|
|
977
629
|
]
|
|
978
630
|
}
|
|
979
631
|
];
|
|
980
632
|
});
|
|
981
|
-
},
|
|
982
|
-
graph:
|
|
983
|
-
config:
|
|
984
|
-
mergedTheme:
|
|
985
|
-
collapsedIds:
|
|
986
|
-
hiddenNodeIds:
|
|
987
|
-
searchQuery:
|
|
633
|
+
}, mn = ({
|
|
634
|
+
graph: t,
|
|
635
|
+
config: e,
|
|
636
|
+
mergedTheme: s,
|
|
637
|
+
collapsedIds: n,
|
|
638
|
+
hiddenNodeIds: o,
|
|
639
|
+
searchQuery: i,
|
|
988
640
|
hideUnmatchedSearch: d = !1,
|
|
989
|
-
searchPredicate:
|
|
990
|
-
highlightedNodeIds:
|
|
991
|
-
highlightedEdgeIds:
|
|
992
|
-
highlightStrategy:
|
|
993
|
-
onSearchResultsChange:
|
|
641
|
+
searchPredicate: l,
|
|
642
|
+
highlightedNodeIds: T,
|
|
643
|
+
highlightedEdgeIds: w,
|
|
644
|
+
highlightStrategy: b,
|
|
645
|
+
onSearchResultsChange: h,
|
|
994
646
|
layoutNodesOverride: m,
|
|
995
|
-
routeEdgesOverride:
|
|
996
|
-
onError:
|
|
647
|
+
routeEdgesOverride: g,
|
|
648
|
+
onError: c
|
|
997
649
|
}) => {
|
|
998
|
-
const [
|
|
999
|
-
() => nn(
|
|
1000
|
-
inputValidationMode:
|
|
650
|
+
const [v, N] = ut({}), { nodes: x, edges: P } = A(
|
|
651
|
+
() => nn(t, e.defaultEdgeType, {
|
|
652
|
+
inputValidationMode: e.inputValidationMode
|
|
1001
653
|
}),
|
|
1002
|
-
[
|
|
1003
|
-
),
|
|
1004
|
-
() =>
|
|
1005
|
-
...
|
|
1006
|
-
measuredSize: R
|
|
654
|
+
[e.defaultEdgeType, e.inputValidationMode, t]
|
|
655
|
+
), p = e.failureBehavior === "degrade", f = A(
|
|
656
|
+
() => x.map((R) => ({
|
|
657
|
+
...R,
|
|
658
|
+
measuredSize: v[R.id] ?? R.measuredSize
|
|
1007
659
|
})),
|
|
1008
|
-
[
|
|
660
|
+
[v, x]
|
|
1009
661
|
);
|
|
1010
|
-
|
|
1011
|
-
const
|
|
1012
|
-
|
|
1013
|
-
const
|
|
1014
|
-
return
|
|
662
|
+
zt(() => {
|
|
663
|
+
const R = new Set(x.map((k) => k.id));
|
|
664
|
+
N((k) => {
|
|
665
|
+
const O = Object.entries(k).filter(([W]) => R.has(W));
|
|
666
|
+
return O.length === Object.keys(k).length ? k : Object.fromEntries(O);
|
|
1015
667
|
});
|
|
1016
|
-
}, [
|
|
1017
|
-
const
|
|
1018
|
-
() =>
|
|
1019
|
-
...
|
|
1020
|
-
type:
|
|
668
|
+
}, [x]);
|
|
669
|
+
const B = A(
|
|
670
|
+
() => P.map((R) => ({
|
|
671
|
+
...R,
|
|
672
|
+
type: R.type ?? e.defaultEdgeType
|
|
1021
673
|
})),
|
|
1022
|
-
[
|
|
674
|
+
[e.defaultEdgeType, P]
|
|
1023
675
|
), {
|
|
1024
|
-
effectiveHighlightedNodeSet:
|
|
1025
|
-
effectiveHighlightedEdgeSet:
|
|
1026
|
-
visibleNodes:
|
|
1027
|
-
visibleEdges:
|
|
1028
|
-
childNodeIdsByParent:
|
|
676
|
+
effectiveHighlightedNodeSet: q,
|
|
677
|
+
effectiveHighlightedEdgeSet: et,
|
|
678
|
+
visibleNodes: _,
|
|
679
|
+
visibleEdges: E,
|
|
680
|
+
childNodeIdsByParent: C
|
|
1029
681
|
} = hn({
|
|
1030
|
-
nodes:
|
|
1031
|
-
edges:
|
|
1032
|
-
collapsedIds:
|
|
1033
|
-
hiddenNodeIds:
|
|
1034
|
-
searchQuery:
|
|
682
|
+
nodes: f,
|
|
683
|
+
edges: B,
|
|
684
|
+
collapsedIds: n,
|
|
685
|
+
hiddenNodeIds: o,
|
|
686
|
+
searchQuery: i,
|
|
1035
687
|
hideUnmatchedSearch: d,
|
|
1036
|
-
searchPredicate:
|
|
1037
|
-
highlightedNodeIds:
|
|
1038
|
-
highlightedEdgeIds:
|
|
1039
|
-
highlightStrategy:
|
|
1040
|
-
onSearchResultsChange:
|
|
1041
|
-
}),
|
|
688
|
+
searchPredicate: l,
|
|
689
|
+
highlightedNodeIds: T,
|
|
690
|
+
highlightedEdgeIds: w,
|
|
691
|
+
highlightStrategy: b,
|
|
692
|
+
onSearchResultsChange: h
|
|
693
|
+
}), D = A(
|
|
1042
694
|
() => ({
|
|
1043
|
-
nodes:
|
|
1044
|
-
edges:
|
|
1045
|
-
theme:
|
|
1046
|
-
padding:
|
|
1047
|
-
layout:
|
|
1048
|
-
width:
|
|
1049
|
-
height:
|
|
1050
|
-
layoutDirection:
|
|
1051
|
-
nodeSizing:
|
|
1052
|
-
fixedNodeSize:
|
|
1053
|
-
labelMeasurementPaddingX:
|
|
1054
|
-
labelMeasurementPaddingY:
|
|
1055
|
-
labelMeasurementCharWidth:
|
|
1056
|
-
labelMeasurementLineHeight:
|
|
695
|
+
nodes: _,
|
|
696
|
+
edges: E,
|
|
697
|
+
theme: s,
|
|
698
|
+
padding: e.padding,
|
|
699
|
+
layout: e.layout,
|
|
700
|
+
width: e.width,
|
|
701
|
+
height: e.height,
|
|
702
|
+
layoutDirection: e.layoutDirection,
|
|
703
|
+
nodeSizing: e.nodeSizing,
|
|
704
|
+
fixedNodeSize: e.fixedNodeSize,
|
|
705
|
+
labelMeasurementPaddingX: e.labelMeasurementPaddingX,
|
|
706
|
+
labelMeasurementPaddingY: e.labelMeasurementPaddingY,
|
|
707
|
+
labelMeasurementCharWidth: e.labelMeasurementCharWidth,
|
|
708
|
+
labelMeasurementLineHeight: e.labelMeasurementLineHeight
|
|
1057
709
|
}),
|
|
1058
|
-
[
|
|
1059
|
-
),
|
|
1060
|
-
(
|
|
1061
|
-
|
|
1062
|
-
const
|
|
1063
|
-
return
|
|
1064
|
-
...
|
|
1065
|
-
[
|
|
710
|
+
[e, s, E, _]
|
|
711
|
+
), Y = G(
|
|
712
|
+
(R, k) => {
|
|
713
|
+
e.nodeSizing === "measured" && N((O) => {
|
|
714
|
+
const W = O[R];
|
|
715
|
+
return W && W.width === k.width && W.height === k.height ? O : {
|
|
716
|
+
...O,
|
|
717
|
+
[R]: k
|
|
1066
718
|
};
|
|
1067
719
|
});
|
|
1068
720
|
},
|
|
1069
|
-
[
|
|
1070
|
-
),
|
|
1071
|
-
()
|
|
1072
|
-
|
|
721
|
+
[e.nodeSizing]
|
|
722
|
+
), X = A(() => {
|
|
723
|
+
if (!m)
|
|
724
|
+
try {
|
|
725
|
+
const R = we(D);
|
|
726
|
+
return $t(R, _, "layout"), R;
|
|
727
|
+
} catch (R) {
|
|
728
|
+
if (c == null || c(at(R), {
|
|
729
|
+
graph: t,
|
|
730
|
+
phase: "layout"
|
|
731
|
+
}), !p)
|
|
732
|
+
throw at(R);
|
|
1073
733
|
try {
|
|
1074
|
-
const
|
|
1075
|
-
return
|
|
1076
|
-
} catch (
|
|
1077
|
-
|
|
1078
|
-
|
|
734
|
+
const k = er(D);
|
|
735
|
+
return $t(k, _, "layout"), k;
|
|
736
|
+
} catch (k) {
|
|
737
|
+
const O = at(k);
|
|
738
|
+
throw c == null || c(O, {
|
|
739
|
+
graph: t,
|
|
1079
740
|
phase: "layout"
|
|
1080
|
-
}),
|
|
1081
|
-
throw wt(A);
|
|
1082
|
-
try {
|
|
1083
|
-
const O = yr(B);
|
|
1084
|
-
return we(O, S, "layout"), O;
|
|
1085
|
-
} catch (O) {
|
|
1086
|
-
const F = wt(O);
|
|
1087
|
-
throw l == null || l(F, {
|
|
1088
|
-
graph: e,
|
|
1089
|
-
phase: "layout"
|
|
1090
|
-
}), F;
|
|
1091
|
-
}
|
|
741
|
+
}), O;
|
|
1092
742
|
}
|
|
743
|
+
}
|
|
744
|
+
try {
|
|
745
|
+
const R = m(D);
|
|
746
|
+
return $t(R, _, "layout override"), R;
|
|
747
|
+
} catch (R) {
|
|
748
|
+
if (c == null || c(at(R), {
|
|
749
|
+
graph: t,
|
|
750
|
+
phase: "layout-override"
|
|
751
|
+
}), !p)
|
|
752
|
+
throw at(R);
|
|
1093
753
|
try {
|
|
1094
|
-
const
|
|
1095
|
-
return
|
|
1096
|
-
} catch (
|
|
1097
|
-
|
|
1098
|
-
graph: e,
|
|
1099
|
-
phase: "layout-override"
|
|
1100
|
-
}), !w)
|
|
1101
|
-
throw wt(A);
|
|
754
|
+
const k = we(D);
|
|
755
|
+
return $t(k, _, "layout"), k;
|
|
756
|
+
} catch (k) {
|
|
757
|
+
c == null || c(at(k), { graph: t, phase: "layout" });
|
|
1102
758
|
try {
|
|
1103
|
-
const O =
|
|
1104
|
-
return
|
|
759
|
+
const O = er(D);
|
|
760
|
+
return $t(O, _, "layout"), O;
|
|
1105
761
|
} catch (O) {
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
const F = yr(B);
|
|
1109
|
-
return we(F, S, "layout"), F;
|
|
1110
|
-
} catch (F) {
|
|
1111
|
-
const G = wt(F);
|
|
1112
|
-
throw l == null || l(G, { graph: e, phase: "layout" }), G;
|
|
1113
|
-
}
|
|
762
|
+
const W = at(O);
|
|
763
|
+
throw c == null || c(W, { graph: t, phase: "layout" }), W;
|
|
1114
764
|
}
|
|
1115
765
|
}
|
|
1116
|
-
}
|
|
1117
|
-
|
|
1118
|
-
), U = M(
|
|
766
|
+
}
|
|
767
|
+
}, [t, m, D, c, _]), Z = A(
|
|
1119
768
|
() => ({
|
|
1120
|
-
arrowPadding:
|
|
1121
|
-
straight: !
|
|
1122
|
-
layoutDirection:
|
|
1123
|
-
forceRightToLeft:
|
|
1124
|
-
routingStyle:
|
|
1125
|
-
edgeSeparation:
|
|
1126
|
-
selfLoopRadius:
|
|
769
|
+
arrowPadding: e.arrowPadding,
|
|
770
|
+
straight: !e.curveEdges || e.routingStyle === "orthogonal",
|
|
771
|
+
layoutDirection: e.layoutDirection,
|
|
772
|
+
forceRightToLeft: e.forceRightToLeft,
|
|
773
|
+
routingStyle: e.routingStyle,
|
|
774
|
+
edgeSeparation: e.edgeSeparation,
|
|
775
|
+
selfLoopRadius: e.selfLoopRadius
|
|
1127
776
|
}),
|
|
1128
|
-
[
|
|
1129
|
-
),
|
|
1130
|
-
() =>
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
777
|
+
[e]
|
|
778
|
+
), Q = A(() => {
|
|
779
|
+
const R = new Set(X.map((k) => k.id));
|
|
780
|
+
if (!g)
|
|
781
|
+
try {
|
|
782
|
+
const k = Ze(X, E, Z);
|
|
783
|
+
return Bt(k, R, "routing"), k;
|
|
784
|
+
} catch (k) {
|
|
785
|
+
if (c == null || c(at(k), {
|
|
786
|
+
graph: t,
|
|
787
|
+
phase: "routing"
|
|
788
|
+
}), !p)
|
|
789
|
+
throw at(k);
|
|
790
|
+
const O = rr(X, E);
|
|
791
|
+
return Bt(O, R, "routing"), O;
|
|
792
|
+
}
|
|
793
|
+
try {
|
|
794
|
+
const k = g(X, E, Z);
|
|
795
|
+
return Bt(k, R, "routing override"), k;
|
|
796
|
+
} catch (k) {
|
|
797
|
+
if (c == null || c(at(k), {
|
|
798
|
+
graph: t,
|
|
799
|
+
phase: "routing-override"
|
|
800
|
+
}), !p)
|
|
801
|
+
throw at(k);
|
|
1145
802
|
try {
|
|
1146
|
-
const O =
|
|
1147
|
-
return
|
|
803
|
+
const O = Ze(X, E, Z);
|
|
804
|
+
return Bt(O, R, "routing"), O;
|
|
1148
805
|
} catch (O) {
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
}), !w)
|
|
1153
|
-
throw wt(O);
|
|
1154
|
-
try {
|
|
1155
|
-
const F = dr(Y, L, U);
|
|
1156
|
-
return xe(F, A, "routing"), F;
|
|
1157
|
-
} catch (F) {
|
|
1158
|
-
l == null || l(wt(F), { graph: e, phase: "routing" });
|
|
1159
|
-
const G = gr(Y, L);
|
|
1160
|
-
return xe(G, A, "routing"), G;
|
|
1161
|
-
}
|
|
806
|
+
c == null || c(at(O), { graph: t, phase: "routing" });
|
|
807
|
+
const W = rr(X, E);
|
|
808
|
+
return Bt(W, R, "routing"), W;
|
|
1162
809
|
}
|
|
1163
|
-
}
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
);
|
|
810
|
+
}
|
|
811
|
+
}, [
|
|
812
|
+
Z,
|
|
813
|
+
t,
|
|
814
|
+
c,
|
|
815
|
+
p,
|
|
816
|
+
X,
|
|
817
|
+
g,
|
|
818
|
+
E
|
|
819
|
+
]);
|
|
1174
820
|
return {
|
|
1175
|
-
childNodeIdsByParent:
|
|
1176
|
-
effectiveHighlightedEdgeSet:
|
|
1177
|
-
effectiveHighlightedNodeSet:
|
|
1178
|
-
handleNodeMeasure:
|
|
1179
|
-
positionedEdges:
|
|
1180
|
-
positionedNodes:
|
|
1181
|
-
visibleEdges:
|
|
1182
|
-
visibleNodesWithMeasuredSize:
|
|
821
|
+
childNodeIdsByParent: C,
|
|
822
|
+
effectiveHighlightedEdgeSet: et,
|
|
823
|
+
effectiveHighlightedNodeSet: q,
|
|
824
|
+
handleNodeMeasure: Y,
|
|
825
|
+
positionedEdges: Q,
|
|
826
|
+
positionedNodes: X,
|
|
827
|
+
visibleEdges: E,
|
|
828
|
+
visibleNodesWithMeasuredSize: _
|
|
1183
829
|
};
|
|
1184
|
-
},
|
|
1185
|
-
(
|
|
1186
|
-
var
|
|
1187
|
-
const
|
|
830
|
+
}, fr = 180, hr = 72, Qt = (t, e, s) => Math.min(Math.max(t, e), s), pn = (t) => t.length ? t.reduce(
|
|
831
|
+
(s, n) => {
|
|
832
|
+
var b, h;
|
|
833
|
+
const o = ((b = n.size) == null ? void 0 : b.width) ?? fr, i = ((h = n.size) == null ? void 0 : h.height) ?? hr, d = Math.min(s.minX, n.position.x), l = Math.min(s.minY, n.position.y), T = Math.max(s.maxX, n.position.x + o), w = Math.max(s.maxY, n.position.y + i);
|
|
1188
834
|
return {
|
|
1189
835
|
minX: d,
|
|
1190
|
-
minY:
|
|
1191
|
-
maxX:
|
|
1192
|
-
maxY:
|
|
1193
|
-
width:
|
|
1194
|
-
height:
|
|
836
|
+
minY: l,
|
|
837
|
+
maxX: T,
|
|
838
|
+
maxY: w,
|
|
839
|
+
width: T - d,
|
|
840
|
+
height: w - l
|
|
1195
841
|
};
|
|
1196
842
|
},
|
|
1197
843
|
{
|
|
@@ -1202,432 +848,430 @@ const dn = ({
|
|
|
1202
848
|
width: 0,
|
|
1203
849
|
height: 0
|
|
1204
850
|
}
|
|
1205
|
-
) : null, yn = (
|
|
1206
|
-
if (!
|
|
851
|
+
) : null, yn = (t, e, s, n, o, i) => {
|
|
852
|
+
if (!t || e <= 0 || s <= 0)
|
|
1207
853
|
return { x: 0, y: 0, zoom: 1 };
|
|
1208
|
-
const d = Math.max(
|
|
1209
|
-
Math.min(
|
|
1210
|
-
|
|
1211
|
-
|
|
854
|
+
const d = Math.max(t.width, 1), l = Math.max(t.height, 1), T = Math.max(e - n * 2, 1), w = Math.max(s - n * 2, 1), b = Qt(
|
|
855
|
+
Math.min(T / d, w / l),
|
|
856
|
+
o,
|
|
857
|
+
i
|
|
1212
858
|
);
|
|
1213
859
|
return {
|
|
1214
|
-
x:
|
|
1215
|
-
y:
|
|
1216
|
-
zoom:
|
|
860
|
+
x: n + (T - d * b) / 2 - t.minX * b,
|
|
861
|
+
y: n + (w - l * b) / 2 - t.minY * b,
|
|
862
|
+
zoom: b
|
|
1217
863
|
};
|
|
1218
|
-
}, gn = (
|
|
1219
|
-
var
|
|
1220
|
-
const
|
|
864
|
+
}, gn = (t, e, s, n) => {
|
|
865
|
+
var T, w;
|
|
866
|
+
const o = ((T = t.size) == null ? void 0 : T.width) ?? fr, i = ((w = t.size) == null ? void 0 : w.height) ?? hr, d = t.position.x + o / 2, l = t.position.y + i / 2;
|
|
1221
867
|
return {
|
|
1222
|
-
x:
|
|
1223
|
-
y:
|
|
1224
|
-
zoom:
|
|
868
|
+
x: e / 2 - d * n,
|
|
869
|
+
y: s / 2 - l * n,
|
|
870
|
+
zoom: n
|
|
1225
871
|
};
|
|
1226
|
-
},
|
|
1227
|
-
x: Number.isFinite(
|
|
1228
|
-
y: Number.isFinite(
|
|
1229
|
-
zoom:
|
|
872
|
+
}, xn = { x: 0, y: 0, zoom: 1 }, de = (t, e, s) => ({
|
|
873
|
+
x: Number.isFinite(t.x) ? t.x : 0,
|
|
874
|
+
y: Number.isFinite(t.y) ? t.y : 0,
|
|
875
|
+
zoom: Qt(Number.isFinite(t.zoom) ? t.zoom : 1, e, s)
|
|
1230
876
|
}), wn = ({
|
|
1231
|
-
controlledViewport:
|
|
1232
|
-
defaultViewport:
|
|
1233
|
-
safeMinZoom:
|
|
1234
|
-
safeMaxZoom:
|
|
1235
|
-
onViewportChange:
|
|
1236
|
-
selectedNodeIds:
|
|
877
|
+
controlledViewport: t,
|
|
878
|
+
defaultViewport: e,
|
|
879
|
+
safeMinZoom: s,
|
|
880
|
+
safeMaxZoom: n,
|
|
881
|
+
onViewportChange: o,
|
|
882
|
+
selectedNodeIds: i,
|
|
1237
883
|
selectedEdgeIds: d,
|
|
1238
|
-
defaultSelectedNodeIds:
|
|
1239
|
-
defaultSelectedEdgeIds:
|
|
1240
|
-
onSelectionChange:
|
|
1241
|
-
controlledFocusedNodeId:
|
|
1242
|
-
defaultFocusedNodeId:
|
|
884
|
+
defaultSelectedNodeIds: l,
|
|
885
|
+
defaultSelectedEdgeIds: T,
|
|
886
|
+
onSelectionChange: w,
|
|
887
|
+
controlledFocusedNodeId: b,
|
|
888
|
+
defaultFocusedNodeId: h,
|
|
1243
889
|
onFocusedNodeChange: m
|
|
1244
890
|
}) => {
|
|
1245
|
-
const [
|
|
1246
|
-
() =>
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
v.current = w;
|
|
1261
|
-
const H = pt(s);
|
|
1262
|
-
H.current = s;
|
|
1263
|
-
const ot = M(
|
|
891
|
+
const [g, c] = ut(
|
|
892
|
+
() => de({ ...xn, ...e ?? {} }, s, n)
|
|
893
|
+
), [v, N] = ut({
|
|
894
|
+
nodeIds: l ?? [],
|
|
895
|
+
edgeIds: T ?? []
|
|
896
|
+
}), [x, P] = ut(
|
|
897
|
+
h
|
|
898
|
+
), p = A(
|
|
899
|
+
() => de(t ?? g, s, n),
|
|
900
|
+
[t, g, n, s]
|
|
901
|
+
), f = ot(p);
|
|
902
|
+
f.current = p;
|
|
903
|
+
const B = ot(o);
|
|
904
|
+
B.current = o;
|
|
905
|
+
const q = A(
|
|
1264
906
|
() => ({
|
|
1265
|
-
nodeIds:
|
|
1266
|
-
edgeIds: d ??
|
|
907
|
+
nodeIds: i ?? v.nodeIds,
|
|
908
|
+
edgeIds: d ?? v.edgeIds
|
|
1267
909
|
}),
|
|
1268
|
-
[
|
|
1269
|
-
),
|
|
1270
|
-
|
|
1271
|
-
const
|
|
1272
|
-
(
|
|
1273
|
-
var
|
|
1274
|
-
const
|
|
1275
|
-
|
|
910
|
+
[i, d, v]
|
|
911
|
+
), et = ot(q);
|
|
912
|
+
et.current = q;
|
|
913
|
+
const _ = b !== void 0 ? b : x, E = G(
|
|
914
|
+
(Y) => {
|
|
915
|
+
var R;
|
|
916
|
+
const X = f.current, Z = typeof Y == "function" ? Y(X) : Y, Q = de({ ...X, ...Z }, s, n);
|
|
917
|
+
t || c(Q), (R = B.current) == null || R.call(B, Q);
|
|
1276
918
|
},
|
|
1277
|
-
[
|
|
1278
|
-
),
|
|
1279
|
-
(
|
|
1280
|
-
const
|
|
1281
|
-
(
|
|
1282
|
-
nodeIds:
|
|
1283
|
-
edgeIds: d == null ?
|
|
1284
|
-
})),
|
|
919
|
+
[t, n, s]
|
|
920
|
+
), C = G(
|
|
921
|
+
(Y) => {
|
|
922
|
+
const X = et.current, Z = typeof Y == "function" ? Y(X) : Y;
|
|
923
|
+
(i == null || d == null) && N((Q) => ({
|
|
924
|
+
nodeIds: i == null ? Z.nodeIds : Q.nodeIds,
|
|
925
|
+
edgeIds: d == null ? Z.edgeIds : Q.edgeIds
|
|
926
|
+
})), w == null || w(Z);
|
|
1285
927
|
},
|
|
1286
|
-
[
|
|
1287
|
-
),
|
|
1288
|
-
(
|
|
1289
|
-
|
|
928
|
+
[w, d, i]
|
|
929
|
+
), D = G(
|
|
930
|
+
(Y) => {
|
|
931
|
+
b === void 0 && P(Y), m == null || m(Y);
|
|
1290
932
|
},
|
|
1291
|
-
[
|
|
933
|
+
[b, m]
|
|
1292
934
|
);
|
|
1293
935
|
return {
|
|
1294
|
-
viewport:
|
|
1295
|
-
viewportRef:
|
|
1296
|
-
selection:
|
|
1297
|
-
selectionRef:
|
|
1298
|
-
focusedNodeId:
|
|
1299
|
-
updateViewport:
|
|
1300
|
-
updateSelection:
|
|
1301
|
-
updateFocusedNode:
|
|
936
|
+
viewport: p,
|
|
937
|
+
viewportRef: f,
|
|
938
|
+
selection: q,
|
|
939
|
+
selectionRef: et,
|
|
940
|
+
focusedNodeId: _,
|
|
941
|
+
updateViewport: E,
|
|
942
|
+
updateSelection: C,
|
|
943
|
+
updateFocusedNode: D
|
|
1302
944
|
};
|
|
1303
|
-
},
|
|
1304
|
-
if (Object.is(
|
|
945
|
+
}, nr = (t) => Object.prototype.toString.call(t) === "[object Object]", Ie = (t, e, s) => {
|
|
946
|
+
if (Object.is(t, e))
|
|
1305
947
|
return !0;
|
|
1306
|
-
if (typeof
|
|
948
|
+
if (typeof t == "function" || typeof e == "function" || !t || !e || typeof t != "object" || typeof e != "object")
|
|
1307
949
|
return !1;
|
|
1308
|
-
const
|
|
1309
|
-
if (
|
|
950
|
+
const n = s.get(t);
|
|
951
|
+
if (n != null && n.has(e))
|
|
1310
952
|
return !0;
|
|
1311
|
-
if (Array.isArray(
|
|
1312
|
-
if (!Array.isArray(
|
|
953
|
+
if (Array.isArray(t) || Array.isArray(e)) {
|
|
954
|
+
if (!Array.isArray(t) || !Array.isArray(e) || t.length !== e.length)
|
|
1313
955
|
return !1;
|
|
1314
|
-
|
|
1315
|
-
for (let d = 0; d <
|
|
1316
|
-
if (!
|
|
956
|
+
n ? n.add(e) : s.set(t, new WeakSet([e]));
|
|
957
|
+
for (let d = 0; d < t.length; d += 1)
|
|
958
|
+
if (!Ie(t[d], e[d], s))
|
|
1317
959
|
return !1;
|
|
1318
960
|
return !0;
|
|
1319
961
|
}
|
|
1320
|
-
if (!
|
|
962
|
+
if (!nr(t) || !nr(e))
|
|
1321
963
|
return !1;
|
|
1322
|
-
|
|
1323
|
-
const
|
|
1324
|
-
if (
|
|
964
|
+
n ? n.add(e) : s.set(t, new WeakSet([e]));
|
|
965
|
+
const o = Object.keys(t), i = Object.keys(e);
|
|
966
|
+
if (o.length !== i.length)
|
|
1325
967
|
return !1;
|
|
1326
|
-
for (const d of
|
|
1327
|
-
if (!(d in
|
|
968
|
+
for (const d of o)
|
|
969
|
+
if (!(d in e) || !Ie(t[d], e[d], s))
|
|
1328
970
|
return !1;
|
|
1329
971
|
return !0;
|
|
1330
972
|
};
|
|
1331
|
-
function
|
|
1332
|
-
const
|
|
1333
|
-
return (
|
|
973
|
+
function bn(t) {
|
|
974
|
+
const e = ot(null);
|
|
975
|
+
return (e.current === null || !Ie(e.current, t, /* @__PURE__ */ new WeakMap())) && (e.current = t), e.current;
|
|
1334
976
|
}
|
|
1335
|
-
const
|
|
1336
|
-
var
|
|
1337
|
-
return ((
|
|
1338
|
-
},
|
|
1339
|
-
const
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
977
|
+
const In = 180, vn = 24, mr = (t) => {
|
|
978
|
+
var e;
|
|
979
|
+
return ((e = t.size) == null ? void 0 : e.width) ?? In;
|
|
980
|
+
}, fe = (t) => t.position.x + mr(t) / 2, pr = (t, e = vn) => {
|
|
981
|
+
const s = [...t].sort(
|
|
982
|
+
(o, i) => fe(o) - fe(i)
|
|
983
|
+
), n = [];
|
|
984
|
+
return s.forEach((o) => {
|
|
985
|
+
const i = fe(o), d = mr(o), l = n[n.length - 1];
|
|
986
|
+
if (!l) {
|
|
987
|
+
n.push({ centerX: i, avgWidth: d, nodes: [o] });
|
|
1344
988
|
return;
|
|
1345
989
|
}
|
|
1346
|
-
const
|
|
1347
|
-
if (Math.abs(
|
|
1348
|
-
|
|
990
|
+
const T = Math.max(e, Math.min(l.avgWidth, d) * 0.35);
|
|
991
|
+
if (Math.abs(i - l.centerX) > T) {
|
|
992
|
+
n.push({ centerX: i, avgWidth: d, nodes: [o] });
|
|
1349
993
|
return;
|
|
1350
994
|
}
|
|
1351
|
-
|
|
1352
|
-
const
|
|
1353
|
-
|
|
1354
|
-
}),
|
|
1355
|
-
centerX:
|
|
1356
|
-
nodes: [...
|
|
995
|
+
l.nodes.push(o);
|
|
996
|
+
const w = l.nodes.length;
|
|
997
|
+
l.centerX = (l.centerX * (w - 1) + i) / w, l.avgWidth = (l.avgWidth * (w - 1) + d) / w;
|
|
998
|
+
}), n.map((o) => ({
|
|
999
|
+
centerX: o.centerX,
|
|
1000
|
+
nodes: [...o.nodes].sort((i, d) => i.position.y - d.position.y)
|
|
1357
1001
|
}));
|
|
1358
|
-
}, En =
|
|
1359
|
-
edge:
|
|
1360
|
-
color:
|
|
1361
|
-
width:
|
|
1362
|
-
curveEdges:
|
|
1363
|
-
curveStrength:
|
|
1002
|
+
}, En = Ft.memo(function({
|
|
1003
|
+
edge: e,
|
|
1004
|
+
color: s,
|
|
1005
|
+
width: n,
|
|
1006
|
+
curveEdges: o,
|
|
1007
|
+
curveStrength: i,
|
|
1364
1008
|
markerEnd: d,
|
|
1365
|
-
isHovered:
|
|
1366
|
-
isSelected:
|
|
1367
|
-
hoverColor:
|
|
1368
|
-
selectionColor:
|
|
1369
|
-
labelColor:
|
|
1009
|
+
isHovered: l,
|
|
1010
|
+
isSelected: T,
|
|
1011
|
+
hoverColor: w,
|
|
1012
|
+
selectionColor: b,
|
|
1013
|
+
labelColor: h,
|
|
1370
1014
|
selectionMarker: m,
|
|
1371
|
-
hoverMarker:
|
|
1372
|
-
hoverEnabled:
|
|
1373
|
-
hoverStrokeWidth:
|
|
1374
|
-
selectedStrokeWidth:
|
|
1375
|
-
hitStrokeWidth:
|
|
1376
|
-
onHoverChange:
|
|
1377
|
-
onClick:
|
|
1015
|
+
hoverMarker: g,
|
|
1016
|
+
hoverEnabled: c,
|
|
1017
|
+
hoverStrokeWidth: v,
|
|
1018
|
+
selectedStrokeWidth: N,
|
|
1019
|
+
hitStrokeWidth: x,
|
|
1020
|
+
onHoverChange: P,
|
|
1021
|
+
onClick: p
|
|
1378
1022
|
}) {
|
|
1379
|
-
const
|
|
1380
|
-
if (!
|
|
1381
|
-
const
|
|
1382
|
-
return /* @__PURE__ */
|
|
1383
|
-
/* @__PURE__ */
|
|
1023
|
+
const f = on(e, o, i);
|
|
1024
|
+
if (!f) return null;
|
|
1025
|
+
const B = l ? w : T ? b ?? w : s, q = l ? v ?? n : T ? N ?? n + 1 : n, et = l ? g ?? m ?? d : T ? m ?? d : d, _ = e.label != null && e.labelPosition ? String(e.label) : null;
|
|
1026
|
+
return /* @__PURE__ */ M.jsxs(M.Fragment, { children: [
|
|
1027
|
+
/* @__PURE__ */ M.jsx(
|
|
1384
1028
|
"path",
|
|
1385
1029
|
{
|
|
1386
|
-
d:
|
|
1030
|
+
d: f,
|
|
1387
1031
|
stroke: "transparent",
|
|
1388
|
-
strokeWidth:
|
|
1032
|
+
strokeWidth: x ?? n + 8,
|
|
1389
1033
|
fill: "none",
|
|
1390
1034
|
pointerEvents: "stroke",
|
|
1391
1035
|
"data-graph-edge-interactive": "true",
|
|
1392
|
-
onMouseEnter: () =>
|
|
1393
|
-
onMouseLeave: () =>
|
|
1394
|
-
onClick:
|
|
1036
|
+
onMouseEnter: () => c && (P == null ? void 0 : P(!0)),
|
|
1037
|
+
onMouseLeave: () => c && (P == null ? void 0 : P(!1)),
|
|
1038
|
+
onClick: p
|
|
1395
1039
|
}
|
|
1396
1040
|
),
|
|
1397
|
-
/* @__PURE__ */
|
|
1041
|
+
/* @__PURE__ */ M.jsx(
|
|
1398
1042
|
"path",
|
|
1399
1043
|
{
|
|
1400
|
-
d:
|
|
1401
|
-
stroke:
|
|
1402
|
-
strokeWidth:
|
|
1044
|
+
d: f,
|
|
1045
|
+
stroke: B,
|
|
1046
|
+
strokeWidth: q,
|
|
1403
1047
|
fill: "none",
|
|
1404
|
-
markerEnd:
|
|
1048
|
+
markerEnd: e.type === "directed" ? et : void 0,
|
|
1405
1049
|
pointerEvents: "none"
|
|
1406
1050
|
}
|
|
1407
1051
|
),
|
|
1408
|
-
|
|
1052
|
+
_ && e.labelPosition ? /* @__PURE__ */ M.jsx(
|
|
1409
1053
|
"text",
|
|
1410
1054
|
{
|
|
1411
|
-
x:
|
|
1412
|
-
y:
|
|
1055
|
+
x: e.labelPosition.x,
|
|
1056
|
+
y: e.labelPosition.y - 6,
|
|
1413
1057
|
textAnchor: "middle",
|
|
1414
1058
|
fontSize: 12,
|
|
1415
1059
|
fontWeight: 600,
|
|
1416
|
-
fill:
|
|
1060
|
+
fill: h ?? "#334155",
|
|
1417
1061
|
pointerEvents: "none",
|
|
1418
|
-
children:
|
|
1062
|
+
children: _
|
|
1419
1063
|
}
|
|
1420
1064
|
) : null
|
|
1421
1065
|
] });
|
|
1422
|
-
}),
|
|
1423
|
-
function
|
|
1424
|
-
const
|
|
1066
|
+
}), Tn = 64, jt = 20, or = 8, _n = 12, Pn = 7, Ln = 48, kn = 12, Sn = 700;
|
|
1067
|
+
function yr(t) {
|
|
1068
|
+
const e = Math.min(Array.from(t).length, Ln);
|
|
1425
1069
|
return Math.max(
|
|
1426
|
-
|
|
1427
|
-
|
|
1070
|
+
Tn,
|
|
1071
|
+
e * Pn + _n * 2
|
|
1428
1072
|
);
|
|
1429
1073
|
}
|
|
1430
|
-
function
|
|
1431
|
-
const
|
|
1074
|
+
function gr(t, e, s, n, o = !1) {
|
|
1075
|
+
const i = pr(t), d = i.map((m) => m.centerX);
|
|
1432
1076
|
if (!d.length)
|
|
1433
1077
|
return { orderedXs: [], orderedLabels: [] };
|
|
1434
|
-
const
|
|
1435
|
-
const
|
|
1436
|
-
return
|
|
1437
|
-
}),
|
|
1438
|
-
return { orderedXs:
|
|
1078
|
+
const T = i.map((m) => m.nodes.length).map((m) => {
|
|
1079
|
+
const g = m * 2;
|
|
1080
|
+
return g <= 2 ? "Final" : `1/${g}`;
|
|
1081
|
+
}), w = n && n.length ? n : o ? T : [], b = e === Jt.Tree && s === xe.RTL ? [...d].reverse() : d, h = e === Jt.Tree && s === xe.RTL ? [...w].reverse() : w;
|
|
1082
|
+
return { orderedXs: b, orderedLabels: h };
|
|
1439
1083
|
}
|
|
1440
|
-
function
|
|
1441
|
-
positionedNodes:
|
|
1442
|
-
layout:
|
|
1443
|
-
layoutDirection:
|
|
1444
|
-
labels:
|
|
1445
|
-
autoLabels:
|
|
1446
|
-
labelOffset:
|
|
1084
|
+
function An({
|
|
1085
|
+
positionedNodes: t,
|
|
1086
|
+
layout: e,
|
|
1087
|
+
layoutDirection: s,
|
|
1088
|
+
labels: n,
|
|
1089
|
+
autoLabels: o,
|
|
1090
|
+
labelOffset: i,
|
|
1447
1091
|
pillBackground: d = "#eef1f6",
|
|
1448
|
-
pillBorderColor:
|
|
1449
|
-
pillTextColor:
|
|
1092
|
+
pillBorderColor: l = "#d7dbe3",
|
|
1093
|
+
pillTextColor: T = "#3f434b"
|
|
1450
1094
|
}) {
|
|
1451
|
-
const { orderedXs:
|
|
1095
|
+
const { orderedXs: w, orderedLabels: b } = gr(
|
|
1096
|
+
t,
|
|
1452
1097
|
e,
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
s
|
|
1098
|
+
s,
|
|
1099
|
+
n,
|
|
1100
|
+
o
|
|
1457
1101
|
);
|
|
1458
|
-
if (!
|
|
1459
|
-
const m =
|
|
1460
|
-
(
|
|
1102
|
+
if (!w.length || !b.length) return null;
|
|
1103
|
+
const m = t.reduce(
|
|
1104
|
+
(g, c) => Math.min(g, c.position.y),
|
|
1461
1105
|
Number.POSITIVE_INFINITY
|
|
1462
|
-
) -
|
|
1463
|
-
return /* @__PURE__ */
|
|
1464
|
-
const
|
|
1465
|
-
return /* @__PURE__ */
|
|
1106
|
+
) - i;
|
|
1107
|
+
return /* @__PURE__ */ M.jsx("g", { "aria-label": "labels", children: w.map((g, c) => {
|
|
1108
|
+
const v = b[c] ?? "", N = yr(v), x = g;
|
|
1109
|
+
return /* @__PURE__ */ M.jsxs(
|
|
1466
1110
|
"g",
|
|
1467
1111
|
{
|
|
1468
|
-
transform: `translate(${
|
|
1112
|
+
transform: `translate(${x - N / 2}, ${m - jt + 6})`,
|
|
1469
1113
|
children: [
|
|
1470
|
-
/* @__PURE__ */
|
|
1114
|
+
/* @__PURE__ */ M.jsx(
|
|
1471
1115
|
"rect",
|
|
1472
1116
|
{
|
|
1473
|
-
width:
|
|
1474
|
-
height:
|
|
1475
|
-
rx:
|
|
1476
|
-
ry:
|
|
1117
|
+
width: N,
|
|
1118
|
+
height: jt,
|
|
1119
|
+
rx: or,
|
|
1120
|
+
ry: or,
|
|
1477
1121
|
fill: d,
|
|
1478
|
-
stroke:
|
|
1122
|
+
stroke: l,
|
|
1479
1123
|
strokeWidth: 1
|
|
1480
1124
|
}
|
|
1481
1125
|
),
|
|
1482
|
-
/* @__PURE__ */
|
|
1126
|
+
/* @__PURE__ */ M.jsx(
|
|
1483
1127
|
"text",
|
|
1484
1128
|
{
|
|
1485
|
-
x:
|
|
1486
|
-
y:
|
|
1487
|
-
fill:
|
|
1488
|
-
fontSize:
|
|
1489
|
-
fontWeight:
|
|
1129
|
+
x: N / 2,
|
|
1130
|
+
y: jt / 2 + 4,
|
|
1131
|
+
fill: T,
|
|
1132
|
+
fontSize: kn,
|
|
1133
|
+
fontWeight: Sn,
|
|
1490
1134
|
textAnchor: "middle",
|
|
1491
|
-
children:
|
|
1135
|
+
children: v
|
|
1492
1136
|
}
|
|
1493
1137
|
)
|
|
1494
1138
|
]
|
|
1495
1139
|
},
|
|
1496
|
-
`col-${
|
|
1140
|
+
`col-${g}`
|
|
1497
1141
|
);
|
|
1498
1142
|
}) });
|
|
1499
1143
|
}
|
|
1500
|
-
const
|
|
1144
|
+
const Rn = typeof window > "u" ? zt : Jr, xr = Ft.memo(
|
|
1501
1145
|
({
|
|
1502
|
-
node:
|
|
1503
|
-
Vertex:
|
|
1504
|
-
isSelected:
|
|
1505
|
-
isFocused:
|
|
1506
|
-
selectionColor:
|
|
1507
|
-
isHighlighted:
|
|
1146
|
+
node: t,
|
|
1147
|
+
Vertex: e,
|
|
1148
|
+
isSelected: s,
|
|
1149
|
+
isFocused: n,
|
|
1150
|
+
selectionColor: o,
|
|
1151
|
+
isHighlighted: i,
|
|
1508
1152
|
activePathKey: d,
|
|
1509
|
-
activePathNodeIds:
|
|
1510
|
-
highlightColor:
|
|
1511
|
-
nodeBorderColor:
|
|
1512
|
-
nodeBorderWidth:
|
|
1513
|
-
hoverNodeBorderColor:
|
|
1153
|
+
activePathNodeIds: l,
|
|
1154
|
+
highlightColor: T,
|
|
1155
|
+
nodeBorderColor: w,
|
|
1156
|
+
nodeBorderWidth: b,
|
|
1157
|
+
hoverNodeBorderColor: h,
|
|
1514
1158
|
hoverNodeBothColor: m,
|
|
1515
|
-
hoverNodeInColor:
|
|
1516
|
-
hoverNodeOutColor:
|
|
1517
|
-
hoverNodeHighlight:
|
|
1518
|
-
hoveredNodeStates:
|
|
1519
|
-
onNodeMeasure:
|
|
1520
|
-
onNodeFocus:
|
|
1521
|
-
onNodeClick:
|
|
1522
|
-
onNodeDoubleClick:
|
|
1523
|
-
onNodeMouseEnter:
|
|
1524
|
-
onNodeMouseLeave:
|
|
1525
|
-
onPathHover:
|
|
1526
|
-
onPathLeave:
|
|
1159
|
+
hoverNodeInColor: g,
|
|
1160
|
+
hoverNodeOutColor: c,
|
|
1161
|
+
hoverNodeHighlight: v,
|
|
1162
|
+
hoveredNodeStates: N,
|
|
1163
|
+
onNodeMeasure: x,
|
|
1164
|
+
onNodeFocus: P,
|
|
1165
|
+
onNodeClick: p,
|
|
1166
|
+
onNodeDoubleClick: f,
|
|
1167
|
+
onNodeMouseEnter: B,
|
|
1168
|
+
onNodeMouseLeave: q,
|
|
1169
|
+
onPathHover: et,
|
|
1170
|
+
onPathLeave: _
|
|
1527
1171
|
}) => {
|
|
1528
|
-
var
|
|
1529
|
-
const
|
|
1530
|
-
let
|
|
1531
|
-
|
|
1532
|
-
let
|
|
1533
|
-
|
|
1534
|
-
if (!
|
|
1172
|
+
var j, F;
|
|
1173
|
+
const E = ot(null), C = ((j = t.size) == null ? void 0 : j.width) ?? 180, D = ((F = t.size) == null ? void 0 : F.height) ?? 72, Y = 8, X = N == null ? void 0 : N.get(t.id), Z = (X == null ? void 0 : X.in) ?? !1, Q = (X == null ? void 0 : X.out) ?? !1, R = Z && Q, k = Z || Q, O = !!w && b > 0 || s;
|
|
1174
|
+
let W = w;
|
|
1175
|
+
s ? W = o : i ? W = T : O ? v && (R ? W = m : Q ? W = c : Z ? W = g : k && (W = h)) : W = "none";
|
|
1176
|
+
let wt = 0;
|
|
1177
|
+
s || i ? wt = 1 : O && (wt = v && k ? 1 : 0.4), Rn(() => {
|
|
1178
|
+
if (!E.current || !x)
|
|
1535
1179
|
return;
|
|
1536
|
-
const
|
|
1537
|
-
|
|
1538
|
-
},
|
|
1539
|
-
var
|
|
1180
|
+
const J = () => {
|
|
1181
|
+
C > 0 && D > 0 && x(t.id, { width: Math.ceil(C), height: Math.ceil(D) });
|
|
1182
|
+
}, K = requestAnimationFrame(() => {
|
|
1183
|
+
var $, st;
|
|
1540
1184
|
try {
|
|
1541
|
-
if (typeof ((
|
|
1542
|
-
|
|
1185
|
+
if (typeof (($ = E.current) == null ? void 0 : $.getBBox) != "function") {
|
|
1186
|
+
J();
|
|
1543
1187
|
return;
|
|
1544
1188
|
}
|
|
1545
|
-
const
|
|
1546
|
-
if (
|
|
1547
|
-
|
|
1548
|
-
width: Math.ceil(
|
|
1549
|
-
height: Math.ceil(
|
|
1189
|
+
const it = (st = E.current) == null ? void 0 : st.getBBox();
|
|
1190
|
+
if (it && it.width > 0 && it.height > 0) {
|
|
1191
|
+
x(t.id, {
|
|
1192
|
+
width: Math.ceil(it.width),
|
|
1193
|
+
height: Math.ceil(it.height)
|
|
1550
1194
|
});
|
|
1551
1195
|
return;
|
|
1552
1196
|
}
|
|
1553
1197
|
} catch {
|
|
1554
|
-
|
|
1198
|
+
J();
|
|
1555
1199
|
}
|
|
1556
|
-
|
|
1200
|
+
J();
|
|
1557
1201
|
});
|
|
1558
|
-
return () => cancelAnimationFrame(
|
|
1559
|
-
}, [
|
|
1560
|
-
const
|
|
1561
|
-
return /* @__PURE__ */
|
|
1202
|
+
return () => cancelAnimationFrame(K);
|
|
1203
|
+
}, [t.id, t.label, t.meta, x, C, D]);
|
|
1204
|
+
const a = s || i ? Math.max(2, b) : O ? b : 0, S = n ? Math.max(2, a || 2) : 0;
|
|
1205
|
+
return /* @__PURE__ */ M.jsxs(
|
|
1562
1206
|
"g",
|
|
1563
1207
|
{
|
|
1564
|
-
ref:
|
|
1565
|
-
transform: `translate(${
|
|
1208
|
+
ref: E,
|
|
1209
|
+
transform: `translate(${t.position.x}, ${t.position.y})`,
|
|
1566
1210
|
"data-graph-node-interactive": "true",
|
|
1567
1211
|
role: "button",
|
|
1568
1212
|
tabIndex: 0,
|
|
1569
|
-
"aria-selected":
|
|
1570
|
-
onMouseDown: (
|
|
1571
|
-
|
|
1213
|
+
"aria-selected": s,
|
|
1214
|
+
onMouseDown: (J) => {
|
|
1215
|
+
J.preventDefault();
|
|
1572
1216
|
},
|
|
1573
|
-
onFocus: () =>
|
|
1574
|
-
onClick: () =>
|
|
1575
|
-
onDoubleClick: () =>
|
|
1576
|
-
onMouseEnter: () =>
|
|
1577
|
-
onMouseLeave:
|
|
1578
|
-
onKeyDown: (
|
|
1579
|
-
(
|
|
1217
|
+
onFocus: () => P == null ? void 0 : P(t.id),
|
|
1218
|
+
onClick: () => p == null ? void 0 : p(t),
|
|
1219
|
+
onDoubleClick: () => f == null ? void 0 : f(t),
|
|
1220
|
+
onMouseEnter: () => B(t.id),
|
|
1221
|
+
onMouseLeave: q,
|
|
1222
|
+
onKeyDown: (J) => {
|
|
1223
|
+
(J.key === "Enter" || J.key === " ") && (J.preventDefault(), p == null || p(t));
|
|
1580
1224
|
},
|
|
1581
1225
|
children: [
|
|
1582
|
-
/* @__PURE__ */
|
|
1226
|
+
/* @__PURE__ */ M.jsx(
|
|
1583
1227
|
"rect",
|
|
1584
1228
|
{
|
|
1585
1229
|
x: 0,
|
|
1586
1230
|
y: 0,
|
|
1587
|
-
width:
|
|
1588
|
-
height:
|
|
1589
|
-
rx:
|
|
1590
|
-
ry:
|
|
1231
|
+
width: C,
|
|
1232
|
+
height: D,
|
|
1233
|
+
rx: Y,
|
|
1234
|
+
ry: Y,
|
|
1591
1235
|
fill: "none",
|
|
1592
|
-
stroke:
|
|
1593
|
-
strokeOpacity:
|
|
1594
|
-
strokeWidth:
|
|
1236
|
+
stroke: W,
|
|
1237
|
+
strokeOpacity: wt,
|
|
1238
|
+
strokeWidth: a,
|
|
1595
1239
|
pointerEvents: "none"
|
|
1596
1240
|
}
|
|
1597
1241
|
),
|
|
1598
|
-
|
|
1242
|
+
n ? /* @__PURE__ */ M.jsx(
|
|
1599
1243
|
"rect",
|
|
1600
1244
|
{
|
|
1601
1245
|
x: -3,
|
|
1602
1246
|
y: -3,
|
|
1603
|
-
width:
|
|
1604
|
-
height:
|
|
1605
|
-
rx:
|
|
1606
|
-
ry:
|
|
1247
|
+
width: C + 6,
|
|
1248
|
+
height: D + 6,
|
|
1249
|
+
rx: Y + 2,
|
|
1250
|
+
ry: Y + 2,
|
|
1607
1251
|
fill: "none",
|
|
1608
|
-
stroke:
|
|
1252
|
+
stroke: o,
|
|
1609
1253
|
strokeOpacity: 0.7,
|
|
1610
|
-
strokeWidth:
|
|
1254
|
+
strokeWidth: S,
|
|
1611
1255
|
strokeDasharray: "4 3",
|
|
1612
1256
|
pointerEvents: "none"
|
|
1613
1257
|
}
|
|
1614
1258
|
) : null,
|
|
1615
|
-
/* @__PURE__ */
|
|
1616
|
-
|
|
1259
|
+
/* @__PURE__ */ M.jsx(
|
|
1260
|
+
e,
|
|
1617
1261
|
{
|
|
1618
|
-
node:
|
|
1619
|
-
isSelected:
|
|
1620
|
-
isHovered:
|
|
1621
|
-
isHoveredIn:
|
|
1622
|
-
isHoveredOut:
|
|
1623
|
-
isHoveredBoth:
|
|
1262
|
+
node: t,
|
|
1263
|
+
isSelected: s,
|
|
1264
|
+
isHovered: k,
|
|
1265
|
+
isHoveredIn: Z,
|
|
1266
|
+
isHoveredOut: Q,
|
|
1267
|
+
isHoveredBoth: R,
|
|
1624
1268
|
activePathKey: d,
|
|
1625
|
-
activePathNodeIds:
|
|
1626
|
-
hoverInColor:
|
|
1627
|
-
hoverOutColor:
|
|
1269
|
+
activePathNodeIds: l,
|
|
1270
|
+
hoverInColor: g,
|
|
1271
|
+
hoverOutColor: c,
|
|
1628
1272
|
hoverBothColor: m,
|
|
1629
|
-
onPathHover: (
|
|
1630
|
-
onPathLeave:
|
|
1273
|
+
onPathHover: (J, K) => J !== null && et(t.id, J, (K == null ? void 0 : K.pathKey) ?? (K == null ? void 0 : K.playerKey)),
|
|
1274
|
+
onPathLeave: _
|
|
1631
1275
|
}
|
|
1632
1276
|
)
|
|
1633
1277
|
]
|
|
@@ -1635,932 +1279,932 @@ const On = typeof window > "u" ? ne : Zr, Ar = oe.memo(
|
|
|
1635
1279
|
);
|
|
1636
1280
|
}
|
|
1637
1281
|
);
|
|
1638
|
-
|
|
1639
|
-
const
|
|
1640
|
-
const
|
|
1641
|
-
return
|
|
1642
|
-
},
|
|
1643
|
-
const
|
|
1644
|
-
switch (
|
|
1282
|
+
xr.displayName = "GraphNode";
|
|
1283
|
+
const sr = { x: 0, y: 0, zoom: 1 }, he = { nodeIds: [], edgeIds: [] }, wr = 0.25, br = 2.5, Mn = 0.12, Nn = "#f59e0b", On = "top-left", St = 26, ve = 34, Ir = 8, me = 48, pe = 20, zn = 8, jn = (t, e) => {
|
|
1284
|
+
const s = Number.isFinite(t) && t > 0 ? t : wr, n = Number.isFinite(e) && e > 0 ? e : br;
|
|
1285
|
+
return s <= n ? { minZoom: s, maxZoom: n } : { minZoom: n, maxZoom: s };
|
|
1286
|
+
}, ye = (t) => t instanceof Error ? t : new Error(String(t)), ir = (t, e, s) => s === "single" ? t.length === 1 && t[0] === e ? [] : [e] : t.includes(e) ? t.filter((n) => n !== e) : [...t, e], Dn = (t, e, s) => {
|
|
1287
|
+
const n = 2 * St + 2 * ve + Ir * 3, o = 12;
|
|
1288
|
+
switch (s) {
|
|
1645
1289
|
case "top-right":
|
|
1646
|
-
return { x:
|
|
1290
|
+
return { x: t - n - o, y: o };
|
|
1647
1291
|
case "bottom-left":
|
|
1648
|
-
return { x:
|
|
1292
|
+
return { x: o, y: e - St - o };
|
|
1649
1293
|
case "bottom-right":
|
|
1650
1294
|
return {
|
|
1651
|
-
x:
|
|
1652
|
-
y:
|
|
1295
|
+
x: t - n - o,
|
|
1296
|
+
y: e - St - o
|
|
1653
1297
|
};
|
|
1654
1298
|
case "top-left":
|
|
1655
1299
|
default:
|
|
1656
|
-
return { x:
|
|
1300
|
+
return { x: o, y: o };
|
|
1657
1301
|
}
|
|
1658
|
-
},
|
|
1659
|
-
x: (
|
|
1660
|
-
y: (
|
|
1661
|
-
}),
|
|
1662
|
-
x: Math.min(
|
|
1663
|
-
y: Math.min(
|
|
1664
|
-
width: Math.abs(
|
|
1665
|
-
height: Math.abs(
|
|
1666
|
-
}),
|
|
1667
|
-
minX:
|
|
1668
|
-
minY:
|
|
1669
|
-
maxX:
|
|
1670
|
-
maxY:
|
|
1671
|
-
width:
|
|
1672
|
-
height:
|
|
1673
|
-
}),
|
|
1674
|
-
if (!
|
|
1675
|
-
return r;
|
|
1676
|
-
if (!r)
|
|
1302
|
+
}, ar = (t, e) => Math.hypot(t.x - e.x, t.y - e.y), cr = (t, e) => ({
|
|
1303
|
+
x: (t.x + e.x) / 2,
|
|
1304
|
+
y: (t.y + e.y) / 2
|
|
1305
|
+
}), lr = (t) => ({
|
|
1306
|
+
x: Math.min(t.startX, t.endX),
|
|
1307
|
+
y: Math.min(t.startY, t.endY),
|
|
1308
|
+
width: Math.abs(t.endX - t.startX),
|
|
1309
|
+
height: Math.abs(t.endY - t.startY)
|
|
1310
|
+
}), ur = (t, e, s) => t >= s.x && t <= s.x + s.width && e >= s.y && e <= s.y + s.height, Yn = (t, e) => ({
|
|
1311
|
+
minX: t.minX - e,
|
|
1312
|
+
minY: t.minY - e,
|
|
1313
|
+
maxX: t.maxX + e,
|
|
1314
|
+
maxY: t.maxY + e,
|
|
1315
|
+
width: t.width + e * 2,
|
|
1316
|
+
height: t.height + e * 2
|
|
1317
|
+
}), te = (t, e) => {
|
|
1318
|
+
if (!t)
|
|
1677
1319
|
return e;
|
|
1678
|
-
|
|
1320
|
+
if (!e)
|
|
1321
|
+
return t;
|
|
1322
|
+
const s = Math.min(t.minX, e.minX), n = Math.min(t.minY, e.minY), o = Math.max(t.maxX, e.maxX), i = Math.max(t.maxY, e.maxY);
|
|
1679
1323
|
return {
|
|
1680
|
-
minX:
|
|
1681
|
-
minY:
|
|
1682
|
-
maxX:
|
|
1683
|
-
maxY:
|
|
1684
|
-
width:
|
|
1685
|
-
height:
|
|
1324
|
+
minX: s,
|
|
1325
|
+
minY: n,
|
|
1326
|
+
maxX: o,
|
|
1327
|
+
maxY: i,
|
|
1328
|
+
width: o - s,
|
|
1329
|
+
height: i - n
|
|
1686
1330
|
};
|
|
1687
|
-
},
|
|
1688
|
-
if (!
|
|
1331
|
+
}, Xn = (t, e, s, n, o, i) => {
|
|
1332
|
+
if (!t.length || !o && !(n && n.length))
|
|
1689
1333
|
return null;
|
|
1690
|
-
const d =
|
|
1334
|
+
const d = pr(t);
|
|
1691
1335
|
if (!d.length)
|
|
1692
1336
|
return null;
|
|
1693
|
-
const
|
|
1337
|
+
const l = e === Jt.Tree && s === xe.RTL ? [...d].reverse() : d, { orderedLabels: T } = gr(
|
|
1338
|
+
t,
|
|
1694
1339
|
e,
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
(p, m) => Math.min(p, m.position.y),
|
|
1340
|
+
s,
|
|
1341
|
+
n,
|
|
1342
|
+
o
|
|
1343
|
+
), b = t.reduce(
|
|
1344
|
+
(h, m) => Math.min(h, m.position.y),
|
|
1701
1345
|
Number.POSITIVE_INFINITY
|
|
1702
|
-
) -
|
|
1703
|
-
return
|
|
1704
|
-
const
|
|
1705
|
-
minX: m.centerX -
|
|
1706
|
-
minY:
|
|
1707
|
-
maxX: m.centerX +
|
|
1708
|
-
maxY:
|
|
1709
|
-
width:
|
|
1710
|
-
height:
|
|
1346
|
+
) - i - jt + 6;
|
|
1347
|
+
return l.reduce((h, m, g) => {
|
|
1348
|
+
const c = yr(T[g] ?? ""), v = {
|
|
1349
|
+
minX: m.centerX - c / 2,
|
|
1350
|
+
minY: b,
|
|
1351
|
+
maxX: m.centerX + c / 2,
|
|
1352
|
+
maxY: b + jt,
|
|
1353
|
+
width: c,
|
|
1354
|
+
height: jt
|
|
1711
1355
|
};
|
|
1712
|
-
return
|
|
1356
|
+
return te(h, v);
|
|
1713
1357
|
}, null);
|
|
1714
|
-
}, Wn = (
|
|
1715
|
-
if (!
|
|
1716
|
-
return
|
|
1717
|
-
const
|
|
1718
|
-
minX:
|
|
1719
|
-
minY:
|
|
1720
|
-
maxX:
|
|
1721
|
-
maxY:
|
|
1722
|
-
width:
|
|
1723
|
-
height:
|
|
1358
|
+
}, Wn = (t) => t.reduce((e, s) => {
|
|
1359
|
+
if (!s.labelPosition)
|
|
1360
|
+
return e;
|
|
1361
|
+
const n = {
|
|
1362
|
+
minX: s.labelPosition.x - me / 2,
|
|
1363
|
+
minY: s.labelPosition.y - pe / 2,
|
|
1364
|
+
maxX: s.labelPosition.x + me / 2,
|
|
1365
|
+
maxY: s.labelPosition.y + pe / 2,
|
|
1366
|
+
width: me,
|
|
1367
|
+
height: pe
|
|
1724
1368
|
};
|
|
1725
|
-
return
|
|
1726
|
-
}, null),
|
|
1727
|
-
if (!
|
|
1728
|
-
return { x:
|
|
1729
|
-
const
|
|
1369
|
+
return te(e, n);
|
|
1370
|
+
}, null), ge = (t, e, s) => {
|
|
1371
|
+
if (!t)
|
|
1372
|
+
return { x: e, y: s };
|
|
1373
|
+
const n = t.getBoundingClientRect();
|
|
1730
1374
|
return {
|
|
1731
|
-
x:
|
|
1732
|
-
y:
|
|
1375
|
+
x: e - n.left,
|
|
1376
|
+
y: s - n.top
|
|
1733
1377
|
};
|
|
1734
|
-
}, $n = (
|
|
1735
|
-
var
|
|
1736
|
-
const
|
|
1737
|
-
x:
|
|
1738
|
-
y:
|
|
1739
|
-
},
|
|
1740
|
-
var
|
|
1741
|
-
if (
|
|
1378
|
+
}, $n = (t, e, s) => {
|
|
1379
|
+
var l, T, w, b, h, m;
|
|
1380
|
+
const n = {
|
|
1381
|
+
x: t.position.x + (((l = t.size) == null ? void 0 : l.width) ?? 0) / 2,
|
|
1382
|
+
y: t.position.y + (((T = t.size) == null ? void 0 : T.height) ?? 0) / 2
|
|
1383
|
+
}, o = e.filter((g) => {
|
|
1384
|
+
var v, N;
|
|
1385
|
+
if (g.id === t.id)
|
|
1742
1386
|
return !1;
|
|
1743
|
-
const
|
|
1744
|
-
x:
|
|
1745
|
-
y:
|
|
1387
|
+
const c = {
|
|
1388
|
+
x: g.position.x + (((v = g.size) == null ? void 0 : v.width) ?? 0) / 2,
|
|
1389
|
+
y: g.position.y + (((N = g.size) == null ? void 0 : N.height) ?? 0) / 2
|
|
1746
1390
|
};
|
|
1747
|
-
return
|
|
1391
|
+
return s === "left" ? c.x < n.x : s === "right" ? c.x > n.x : s === "up" ? c.y < n.y : c.y > n.y;
|
|
1748
1392
|
});
|
|
1749
|
-
if (!
|
|
1393
|
+
if (!o.length)
|
|
1750
1394
|
return null;
|
|
1751
|
-
let
|
|
1752
|
-
|
|
1753
|
-
|
|
1395
|
+
let i = o[0], d = Math.hypot(
|
|
1396
|
+
i.position.x + (((w = i.size) == null ? void 0 : w.width) ?? 0) / 2 - n.x,
|
|
1397
|
+
i.position.y + (((b = i.size) == null ? void 0 : b.height) ?? 0) / 2 - n.y
|
|
1754
1398
|
);
|
|
1755
|
-
for (let
|
|
1756
|
-
const
|
|
1757
|
-
|
|
1758
|
-
|
|
1399
|
+
for (let g = 1; g < o.length; g++) {
|
|
1400
|
+
const c = o[g], v = Math.hypot(
|
|
1401
|
+
c.position.x + (((h = c.size) == null ? void 0 : h.width) ?? 0) / 2 - n.x,
|
|
1402
|
+
c.position.y + (((m = c.size) == null ? void 0 : m.height) ?? 0) / 2 - n.y
|
|
1759
1403
|
);
|
|
1760
|
-
|
|
1404
|
+
v < d && (i = c, d = v);
|
|
1761
1405
|
}
|
|
1762
|
-
return
|
|
1763
|
-
},
|
|
1764
|
-
graph:
|
|
1765
|
-
vertexComponent:
|
|
1766
|
-
edgeComponent:
|
|
1767
|
-
config:
|
|
1768
|
-
viewport:
|
|
1769
|
-
defaultViewport:
|
|
1406
|
+
return i;
|
|
1407
|
+
}, Bn = ({
|
|
1408
|
+
graph: t,
|
|
1409
|
+
vertexComponent: e,
|
|
1410
|
+
edgeComponent: s = En,
|
|
1411
|
+
config: n,
|
|
1412
|
+
viewport: o,
|
|
1413
|
+
defaultViewport: i,
|
|
1770
1414
|
onViewportChange: d,
|
|
1771
|
-
fitViewOnMount:
|
|
1772
|
-
fitViewPadding:
|
|
1773
|
-
minZoom:
|
|
1774
|
-
maxZoom:
|
|
1775
|
-
zoomStep:
|
|
1415
|
+
fitViewOnMount: l = !1,
|
|
1416
|
+
fitViewPadding: T = 32,
|
|
1417
|
+
minZoom: w = wr,
|
|
1418
|
+
maxZoom: b = br,
|
|
1419
|
+
zoomStep: h = Mn,
|
|
1776
1420
|
panEnabled: m = !0,
|
|
1777
|
-
zoomEnabled:
|
|
1778
|
-
pinchZoomEnabled:
|
|
1779
|
-
keyboardNavigation:
|
|
1780
|
-
showControls:
|
|
1781
|
-
controlsPosition:
|
|
1782
|
-
marqueeSelectionEnabled:
|
|
1783
|
-
focusedNodeId:
|
|
1784
|
-
defaultFocusedNodeId:
|
|
1785
|
-
onFocusedNodeChange:
|
|
1786
|
-
collapsedNodeIds:
|
|
1787
|
-
defaultCollapsedNodeIds:
|
|
1788
|
-
onCollapsedNodeIdsChange:
|
|
1789
|
-
toggleCollapseOnNodeDoubleClick:
|
|
1790
|
-
hiddenNodeIds:
|
|
1791
|
-
onNodeExpand:
|
|
1792
|
-
onNodeCollapse:
|
|
1793
|
-
searchQuery:
|
|
1794
|
-
hideUnmatchedSearch:
|
|
1795
|
-
searchPredicate:
|
|
1796
|
-
highlightedNodeIds:
|
|
1797
|
-
highlightedEdgeIds:
|
|
1798
|
-
highlightColor:
|
|
1799
|
-
highlightStrategy:
|
|
1800
|
-
onSearchResultsChange:
|
|
1801
|
-
selectedNodeIds:
|
|
1802
|
-
selectedEdgeIds:
|
|
1803
|
-
defaultSelectedNodeIds:
|
|
1804
|
-
defaultSelectedEdgeIds:
|
|
1805
|
-
onSelectionChange:
|
|
1806
|
-
selectionMode:
|
|
1807
|
-
nodeSelectionEnabled:
|
|
1808
|
-
edgeSelectionEnabled:
|
|
1809
|
-
selectionColor:
|
|
1810
|
-
edgeSelectionColor:
|
|
1811
|
-
layoutNodesOverride:
|
|
1812
|
-
routeEdgesOverride:
|
|
1813
|
-
renderBackground:
|
|
1814
|
-
renderOverlay:
|
|
1815
|
-
onError:
|
|
1816
|
-
onNodeHoverChange:
|
|
1817
|
-
onEdgeHoverChange:
|
|
1818
|
-
onNodeClick:
|
|
1819
|
-
onEdgeClick:
|
|
1820
|
-
},
|
|
1821
|
-
const
|
|
1421
|
+
zoomEnabled: g = !0,
|
|
1422
|
+
pinchZoomEnabled: c = !0,
|
|
1423
|
+
keyboardNavigation: v = !0,
|
|
1424
|
+
showControls: N = !1,
|
|
1425
|
+
controlsPosition: x = On,
|
|
1426
|
+
marqueeSelectionEnabled: P = !0,
|
|
1427
|
+
focusedNodeId: p,
|
|
1428
|
+
defaultFocusedNodeId: f = null,
|
|
1429
|
+
onFocusedNodeChange: B,
|
|
1430
|
+
collapsedNodeIds: q,
|
|
1431
|
+
defaultCollapsedNodeIds: et,
|
|
1432
|
+
onCollapsedNodeIdsChange: _,
|
|
1433
|
+
toggleCollapseOnNodeDoubleClick: E = !0,
|
|
1434
|
+
hiddenNodeIds: C,
|
|
1435
|
+
onNodeExpand: D,
|
|
1436
|
+
onNodeCollapse: Y,
|
|
1437
|
+
searchQuery: X,
|
|
1438
|
+
hideUnmatchedSearch: Z = !1,
|
|
1439
|
+
searchPredicate: Q,
|
|
1440
|
+
highlightedNodeIds: R,
|
|
1441
|
+
highlightedEdgeIds: k,
|
|
1442
|
+
highlightColor: O = "#f59e0b",
|
|
1443
|
+
highlightStrategy: W,
|
|
1444
|
+
onSearchResultsChange: wt,
|
|
1445
|
+
selectedNodeIds: a,
|
|
1446
|
+
selectedEdgeIds: S,
|
|
1447
|
+
defaultSelectedNodeIds: j,
|
|
1448
|
+
defaultSelectedEdgeIds: F,
|
|
1449
|
+
onSelectionChange: J,
|
|
1450
|
+
selectionMode: K = "single",
|
|
1451
|
+
nodeSelectionEnabled: $ = !0,
|
|
1452
|
+
edgeSelectionEnabled: st = !0,
|
|
1453
|
+
selectionColor: it = Nn,
|
|
1454
|
+
edgeSelectionColor: ee,
|
|
1455
|
+
layoutNodesOverride: Er,
|
|
1456
|
+
routeEdgesOverride: Tr,
|
|
1457
|
+
renderBackground: re,
|
|
1458
|
+
renderOverlay: ne,
|
|
1459
|
+
onError: ct,
|
|
1460
|
+
onNodeHoverChange: Gt,
|
|
1461
|
+
onEdgeHoverChange: Ht,
|
|
1462
|
+
onNodeClick: It,
|
|
1463
|
+
onEdgeClick: vt
|
|
1464
|
+
}, _r) => {
|
|
1465
|
+
const Ee = A(() => jn(w, b), [w, b]), Et = Ee.minZoom, Tt = Ee.maxZoom, Te = bn(n), Ut = Qr().replace(/:/g, "-"), [_t, oe] = ut(null), [_e, Pe] = ut(!1), ht = ot({
|
|
1822
1466
|
active: !1,
|
|
1823
1467
|
startX: 0,
|
|
1824
1468
|
startY: 0,
|
|
1825
1469
|
originX: 0,
|
|
1826
1470
|
originY: 0
|
|
1827
|
-
}),
|
|
1471
|
+
}), mt = ot(/* @__PURE__ */ new Map()), Pt = ot({
|
|
1828
1472
|
active: !1,
|
|
1829
1473
|
startDistance: 0,
|
|
1830
1474
|
startZoom: 1,
|
|
1831
1475
|
worldX: 0,
|
|
1832
1476
|
worldY: 0
|
|
1833
|
-
}),
|
|
1834
|
-
viewport:
|
|
1835
|
-
viewportRef:
|
|
1836
|
-
selection:
|
|
1837
|
-
focusedNodeId:
|
|
1838
|
-
updateViewport:
|
|
1839
|
-
updateSelection:
|
|
1840
|
-
updateFocusedNode:
|
|
1477
|
+
}), At = ot(null), Pr = ot(null), se = ot(!1), I = A(() => sn(Te), [Te]), pt = I.theme, Le = pt.edgeColor ?? Je.edgeColor, Ct = pt.edgeWidth ?? Je.edgeWidth, ke = ee ?? it, Lr = I.hoverNodeBorderColor ?? I.hoverEdgeColor, kr = I.hoverNodeBothColor ?? I.hoverEdgeColor, Sr = pt.nodeBorderColor, Ar = pt.nodeBorderWidth ?? 0, Kt = I.showArrows, Se = `${Ut}-arrow`, Ae = `${Ut}-arrow-hover`, Re = `${Ut}-arrow-hover-in`, Me = `${Ut}-arrow-selected`, {
|
|
1478
|
+
viewport: z,
|
|
1479
|
+
viewportRef: Rr,
|
|
1480
|
+
selection: rt,
|
|
1481
|
+
focusedNodeId: yt,
|
|
1482
|
+
updateViewport: H,
|
|
1483
|
+
updateSelection: nt,
|
|
1484
|
+
updateFocusedNode: dt
|
|
1841
1485
|
} = wn({
|
|
1842
|
-
controlledViewport:
|
|
1843
|
-
defaultViewport:
|
|
1844
|
-
safeMinZoom:
|
|
1845
|
-
safeMaxZoom:
|
|
1486
|
+
controlledViewport: o,
|
|
1487
|
+
defaultViewport: i,
|
|
1488
|
+
safeMinZoom: Et,
|
|
1489
|
+
safeMaxZoom: Tt,
|
|
1846
1490
|
onViewportChange: d,
|
|
1847
|
-
selectedNodeIds:
|
|
1848
|
-
selectedEdgeIds:
|
|
1849
|
-
defaultSelectedNodeIds:
|
|
1850
|
-
defaultSelectedEdgeIds:
|
|
1851
|
-
onSelectionChange:
|
|
1852
|
-
controlledFocusedNodeId:
|
|
1853
|
-
defaultFocusedNodeId:
|
|
1854
|
-
onFocusedNodeChange:
|
|
1491
|
+
selectedNodeIds: a,
|
|
1492
|
+
selectedEdgeIds: S,
|
|
1493
|
+
defaultSelectedNodeIds: j,
|
|
1494
|
+
defaultSelectedEdgeIds: F,
|
|
1495
|
+
onSelectionChange: J,
|
|
1496
|
+
controlledFocusedNodeId: p,
|
|
1497
|
+
defaultFocusedNodeId: f,
|
|
1498
|
+
onFocusedNodeChange: B
|
|
1855
1499
|
}), {
|
|
1856
|
-
collapsedIds:
|
|
1857
|
-
collapsedNodeSet:
|
|
1858
|
-
pendingExpansionNodeSet:
|
|
1859
|
-
updateCollapsedNodeIds:
|
|
1860
|
-
setPendingExpansionNodeIds:
|
|
1861
|
-
} =
|
|
1862
|
-
collapsedNodeIds:
|
|
1863
|
-
defaultCollapsedNodeIds:
|
|
1864
|
-
onCollapsedNodeIdsChange:
|
|
1865
|
-
}),
|
|
1866
|
-
childNodeIdsByParent:
|
|
1867
|
-
effectiveHighlightedEdgeSet:
|
|
1868
|
-
effectiveHighlightedNodeSet:
|
|
1869
|
-
handleNodeMeasure:
|
|
1870
|
-
positionedEdges:
|
|
1871
|
-
positionedNodes:
|
|
1872
|
-
visibleEdges:
|
|
1873
|
-
visibleNodesWithMeasuredSize:
|
|
1874
|
-
} =
|
|
1875
|
-
graph:
|
|
1876
|
-
config:
|
|
1877
|
-
mergedTheme:
|
|
1878
|
-
collapsedIds:
|
|
1879
|
-
hiddenNodeIds:
|
|
1880
|
-
searchQuery:
|
|
1881
|
-
hideUnmatchedSearch:
|
|
1882
|
-
searchPredicate:
|
|
1883
|
-
highlightedNodeIds:
|
|
1884
|
-
highlightedEdgeIds:
|
|
1885
|
-
highlightStrategy:
|
|
1886
|
-
onSearchResultsChange:
|
|
1887
|
-
layoutNodesOverride:
|
|
1888
|
-
routeEdgesOverride:
|
|
1889
|
-
onError:
|
|
1890
|
-
}),
|
|
1891
|
-
(
|
|
1892
|
-
if (!(!
|
|
1893
|
-
if (
|
|
1500
|
+
collapsedIds: Mr,
|
|
1501
|
+
collapsedNodeSet: Ne,
|
|
1502
|
+
pendingExpansionNodeSet: Oe,
|
|
1503
|
+
updateCollapsedNodeIds: Vt,
|
|
1504
|
+
setPendingExpansionNodeIds: ie
|
|
1505
|
+
} = fn({
|
|
1506
|
+
collapsedNodeIds: q,
|
|
1507
|
+
defaultCollapsedNodeIds: et,
|
|
1508
|
+
onCollapsedNodeIdsChange: _
|
|
1509
|
+
}), Nr = A(() => new Set(rt.nodeIds), [rt.nodeIds]), ze = A(() => new Set(rt.edgeIds), [rt.edgeIds]), {
|
|
1510
|
+
childNodeIdsByParent: je,
|
|
1511
|
+
effectiveHighlightedEdgeSet: Or,
|
|
1512
|
+
effectiveHighlightedNodeSet: zr,
|
|
1513
|
+
handleNodeMeasure: jr,
|
|
1514
|
+
positionedEdges: gt,
|
|
1515
|
+
positionedNodes: tt,
|
|
1516
|
+
visibleEdges: De,
|
|
1517
|
+
visibleNodesWithMeasuredSize: Ye
|
|
1518
|
+
} = mn({
|
|
1519
|
+
graph: t,
|
|
1520
|
+
config: I,
|
|
1521
|
+
mergedTheme: pt,
|
|
1522
|
+
collapsedIds: Mr,
|
|
1523
|
+
hiddenNodeIds: C,
|
|
1524
|
+
searchQuery: X,
|
|
1525
|
+
hideUnmatchedSearch: Z,
|
|
1526
|
+
searchPredicate: Q,
|
|
1527
|
+
highlightedNodeIds: R,
|
|
1528
|
+
highlightedEdgeIds: k,
|
|
1529
|
+
highlightStrategy: W,
|
|
1530
|
+
onSearchResultsChange: wt,
|
|
1531
|
+
layoutNodesOverride: Er,
|
|
1532
|
+
routeEdgesOverride: Tr,
|
|
1533
|
+
onError: ct
|
|
1534
|
+
}), Dr = G(
|
|
1535
|
+
(r) => {
|
|
1536
|
+
if (!(!E || !((je.get(r.id) ?? []).length > 0) || Oe.has(r.id)))
|
|
1537
|
+
if (Ne.has(r.id))
|
|
1894
1538
|
try {
|
|
1895
|
-
const
|
|
1896
|
-
if (
|
|
1897
|
-
|
|
1898
|
-
(
|
|
1899
|
-
), Promise.resolve(
|
|
1900
|
-
|
|
1901
|
-
}).catch((
|
|
1902
|
-
|
|
1539
|
+
const y = D == null ? void 0 : D(r.id);
|
|
1540
|
+
if (y && typeof y == "object" && "then" in y) {
|
|
1541
|
+
ie(
|
|
1542
|
+
(L) => L.includes(r.id) ? L : [...L, r.id]
|
|
1543
|
+
), Promise.resolve(y).then(() => {
|
|
1544
|
+
Vt((L) => L.filter((U) => U !== r.id));
|
|
1545
|
+
}).catch((L) => {
|
|
1546
|
+
ct == null || ct(ye(L), { graph: t, phase: "interaction" });
|
|
1903
1547
|
}).finally(() => {
|
|
1904
|
-
|
|
1905
|
-
(
|
|
1548
|
+
ie(
|
|
1549
|
+
(L) => L.filter((U) => U !== r.id)
|
|
1906
1550
|
);
|
|
1907
1551
|
});
|
|
1908
1552
|
return;
|
|
1909
1553
|
}
|
|
1910
|
-
|
|
1911
|
-
} catch (
|
|
1912
|
-
|
|
1554
|
+
Vt((L) => L.filter((U) => U !== r.id));
|
|
1555
|
+
} catch (y) {
|
|
1556
|
+
ct == null || ct(ye(y), { graph: t, phase: "interaction" });
|
|
1913
1557
|
}
|
|
1914
1558
|
else {
|
|
1915
|
-
|
|
1559
|
+
Vt((y) => [...y, r.id]);
|
|
1916
1560
|
try {
|
|
1917
|
-
|
|
1918
|
-
} catch (
|
|
1919
|
-
|
|
1561
|
+
Y == null || Y(r.id);
|
|
1562
|
+
} catch (y) {
|
|
1563
|
+
ct == null || ct(ye(y), { graph: t, phase: "interaction" });
|
|
1920
1564
|
}
|
|
1921
1565
|
}
|
|
1922
1566
|
},
|
|
1923
1567
|
[
|
|
1568
|
+
je,
|
|
1569
|
+
Ne,
|
|
1570
|
+
t,
|
|
1571
|
+
ct,
|
|
1572
|
+
Y,
|
|
1924
1573
|
D,
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
B,
|
|
1930
|
-
h,
|
|
1931
|
-
N,
|
|
1932
|
-
L,
|
|
1933
|
-
P
|
|
1574
|
+
Oe,
|
|
1575
|
+
ie,
|
|
1576
|
+
E,
|
|
1577
|
+
Vt
|
|
1934
1578
|
]
|
|
1935
1579
|
);
|
|
1936
|
-
|
|
1937
|
-
const
|
|
1938
|
-
(
|
|
1939
|
-
nodeIds:
|
|
1940
|
-
edgeIds:
|
|
1941
|
-
}),
|
|
1580
|
+
zt(() => {
|
|
1581
|
+
const r = new Set(Ye.map((y) => y.id)), u = new Set(De.map((y) => y.id));
|
|
1582
|
+
(rt.nodeIds.some((y) => !r.has(y)) || rt.edgeIds.some((y) => !u.has(y))) && nt({
|
|
1583
|
+
nodeIds: rt.nodeIds.filter((y) => r.has(y)),
|
|
1584
|
+
edgeIds: rt.edgeIds.filter((y) => u.has(y))
|
|
1585
|
+
}), yt && !r.has(yt) && dt(null);
|
|
1942
1586
|
}, [
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
vt,
|
|
1587
|
+
yt,
|
|
1588
|
+
rt,
|
|
1946
1589
|
dt,
|
|
1947
|
-
|
|
1948
|
-
|
|
1590
|
+
nt,
|
|
1591
|
+
De,
|
|
1592
|
+
Ye
|
|
1949
1593
|
]);
|
|
1950
|
-
const
|
|
1951
|
-
() => new Map(
|
|
1952
|
-
[
|
|
1953
|
-
),
|
|
1954
|
-
() => new Map(
|
|
1955
|
-
[
|
|
1956
|
-
),
|
|
1957
|
-
const
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1594
|
+
const lt = A(
|
|
1595
|
+
() => new Map(tt.map((r) => [r.id, r])),
|
|
1596
|
+
[tt]
|
|
1597
|
+
), Xe = A(
|
|
1598
|
+
() => new Map(gt.map((r) => [r.id, r])),
|
|
1599
|
+
[gt]
|
|
1600
|
+
), We = A(() => pn(tt), [tt]), $e = A(() => {
|
|
1601
|
+
const r = te(
|
|
1602
|
+
te(
|
|
1603
|
+
We,
|
|
1604
|
+
Xn(
|
|
1605
|
+
tt,
|
|
1606
|
+
I.layout,
|
|
1607
|
+
I.layoutDirection,
|
|
1608
|
+
I.labels,
|
|
1609
|
+
I.autoLabels,
|
|
1610
|
+
I.labelOffset
|
|
1967
1611
|
)
|
|
1968
1612
|
),
|
|
1969
|
-
Wn(
|
|
1613
|
+
Wn(gt)
|
|
1970
1614
|
);
|
|
1971
|
-
return
|
|
1615
|
+
return r && Yn(r, zn);
|
|
1972
1616
|
}, [
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
]),
|
|
1982
|
-
var
|
|
1983
|
-
const
|
|
1984
|
-
if (!
|
|
1985
|
-
return { width:
|
|
1986
|
-
const
|
|
1617
|
+
I.autoLabels,
|
|
1618
|
+
I.labelOffset,
|
|
1619
|
+
I.labels,
|
|
1620
|
+
I.layout,
|
|
1621
|
+
I.layoutDirection,
|
|
1622
|
+
We,
|
|
1623
|
+
gt,
|
|
1624
|
+
tt
|
|
1625
|
+
]), qt = G(() => {
|
|
1626
|
+
var L;
|
|
1627
|
+
const r = At.current;
|
|
1628
|
+
if (!r)
|
|
1629
|
+
return { width: I.width, height: I.height };
|
|
1630
|
+
const y = ((L = r.parentElement) == null ? void 0 : L.getBoundingClientRect()) ?? r.getBoundingClientRect();
|
|
1987
1631
|
return {
|
|
1988
|
-
width:
|
|
1989
|
-
height:
|
|
1632
|
+
width: y.width || I.width,
|
|
1633
|
+
height: y.height || I.height
|
|
1990
1634
|
};
|
|
1991
|
-
}, [
|
|
1992
|
-
(
|
|
1993
|
-
const { width:
|
|
1994
|
-
|
|
1995
|
-
yn(
|
|
1635
|
+
}, [I.height, I.width]), Lt = G(
|
|
1636
|
+
(r = T) => {
|
|
1637
|
+
const { width: u, height: y } = qt();
|
|
1638
|
+
H(
|
|
1639
|
+
yn($e, u, y, r, Et, Tt)
|
|
1996
1640
|
);
|
|
1997
1641
|
},
|
|
1998
|
-
[
|
|
1999
|
-
),
|
|
2000
|
-
(
|
|
2001
|
-
const
|
|
2002
|
-
if (!
|
|
1642
|
+
[$e, T, qt, Tt, Et, H]
|
|
1643
|
+
), Zt = G(
|
|
1644
|
+
(r) => {
|
|
1645
|
+
const u = lt.get(r);
|
|
1646
|
+
if (!u)
|
|
2003
1647
|
return;
|
|
2004
|
-
const { width:
|
|
2005
|
-
|
|
1648
|
+
const { width: y, height: L } = qt();
|
|
1649
|
+
H(gn(u, y, L, z.zoom));
|
|
2006
1650
|
},
|
|
2007
|
-
[
|
|
1651
|
+
[qt, lt, H, z.zoom]
|
|
2008
1652
|
);
|
|
2009
1653
|
tn(
|
|
2010
|
-
|
|
1654
|
+
_r,
|
|
2011
1655
|
() => ({
|
|
2012
|
-
fitView:
|
|
2013
|
-
centerOnNode:
|
|
2014
|
-
zoomIn: () =>
|
|
2015
|
-
zoomOut: () =>
|
|
2016
|
-
zoomTo: (
|
|
2017
|
-
resetViewport: () =>
|
|
2018
|
-
getViewport: () =>
|
|
2019
|
-
setViewport:
|
|
2020
|
-
clearSelection: () =>
|
|
1656
|
+
fitView: Lt,
|
|
1657
|
+
centerOnNode: Zt,
|
|
1658
|
+
zoomIn: () => H((r) => ({ zoom: r.zoom + h })),
|
|
1659
|
+
zoomOut: () => H((r) => ({ zoom: r.zoom - h })),
|
|
1660
|
+
zoomTo: (r) => H({ zoom: r }),
|
|
1661
|
+
resetViewport: () => H(sr),
|
|
1662
|
+
getViewport: () => z,
|
|
1663
|
+
setViewport: H,
|
|
1664
|
+
clearSelection: () => nt(he)
|
|
2021
1665
|
}),
|
|
2022
|
-
[
|
|
2023
|
-
),
|
|
2024
|
-
|
|
2025
|
-
}, [
|
|
2026
|
-
!
|
|
2027
|
-
}, [
|
|
1666
|
+
[Zt, Lt, nt, H, z, h]
|
|
1667
|
+
), zt(() => {
|
|
1668
|
+
se.current = !1;
|
|
1669
|
+
}, [t]), zt(() => {
|
|
1670
|
+
!l || se.current || tt.length === 0 || (se.current = !0, Lt());
|
|
1671
|
+
}, [Lt, l, tt.length]);
|
|
2028
1672
|
const {
|
|
2029
|
-
hoveredEdgeId:
|
|
2030
|
-
setHoveredEdgeId:
|
|
2031
|
-
hoveredNodeId:
|
|
2032
|
-
setHoveredNodeId:
|
|
2033
|
-
focusedPath:
|
|
2034
|
-
setFocusedPath:
|
|
2035
|
-
pathHighlight:
|
|
2036
|
-
hoveredNodeStates:
|
|
2037
|
-
edgesForRender:
|
|
2038
|
-
} =
|
|
2039
|
-
|
|
2040
|
-
const
|
|
1673
|
+
hoveredEdgeId: Be,
|
|
1674
|
+
setHoveredEdgeId: Fe,
|
|
1675
|
+
hoveredNodeId: kt,
|
|
1676
|
+
setHoveredNodeId: Rt,
|
|
1677
|
+
focusedPath: ae,
|
|
1678
|
+
setFocusedPath: xt,
|
|
1679
|
+
pathHighlight: Mt,
|
|
1680
|
+
hoveredNodeStates: Yr,
|
|
1681
|
+
edgesForRender: Xr
|
|
1682
|
+
} = dn(tt, gt, I.hoverHighlight), Ge = ot(kt);
|
|
1683
|
+
Ge.current = kt;
|
|
1684
|
+
const He = A(
|
|
2041
1685
|
() => ({
|
|
2042
|
-
graph:
|
|
2043
|
-
nodes:
|
|
2044
|
-
edges:
|
|
2045
|
-
config:
|
|
2046
|
-
viewport:
|
|
2047
|
-
selection:
|
|
1686
|
+
graph: t,
|
|
1687
|
+
nodes: tt,
|
|
1688
|
+
edges: gt,
|
|
1689
|
+
config: I,
|
|
1690
|
+
viewport: z,
|
|
1691
|
+
selection: rt
|
|
2048
1692
|
}),
|
|
2049
|
-
[
|
|
2050
|
-
),
|
|
2051
|
-
(
|
|
2052
|
-
|
|
2053
|
-
viewport:
|
|
2054
|
-
selection:
|
|
2055
|
-
trigger:
|
|
1693
|
+
[I, t, gt, tt, rt, z]
|
|
1694
|
+
), Nt = G(
|
|
1695
|
+
(r, u, y = "pointer") => {
|
|
1696
|
+
Gt == null || Gt(r, u, {
|
|
1697
|
+
viewport: z,
|
|
1698
|
+
selection: rt,
|
|
1699
|
+
trigger: y
|
|
2056
1700
|
});
|
|
2057
1701
|
},
|
|
2058
|
-
[
|
|
2059
|
-
),
|
|
2060
|
-
(
|
|
2061
|
-
|
|
2062
|
-
viewport:
|
|
2063
|
-
selection:
|
|
2064
|
-
trigger:
|
|
1702
|
+
[Gt, rt, z]
|
|
1703
|
+
), Ue = G(
|
|
1704
|
+
(r, u, y = "pointer") => {
|
|
1705
|
+
Ht == null || Ht(r, u, {
|
|
1706
|
+
viewport: z,
|
|
1707
|
+
selection: rt,
|
|
1708
|
+
trigger: y
|
|
2065
1709
|
});
|
|
2066
1710
|
},
|
|
2067
|
-
[
|
|
2068
|
-
),
|
|
2069
|
-
(
|
|
2070
|
-
if (
|
|
2071
|
-
|
|
1711
|
+
[Ht, rt, z]
|
|
1712
|
+
), ce = G(
|
|
1713
|
+
(r) => {
|
|
1714
|
+
if (!$) {
|
|
1715
|
+
dt(r.id), It == null || It(r);
|
|
2072
1716
|
return;
|
|
2073
1717
|
}
|
|
2074
|
-
|
|
2075
|
-
nodeIds:
|
|
2076
|
-
edgeIds:
|
|
2077
|
-
})),
|
|
1718
|
+
nt((u) => ({
|
|
1719
|
+
nodeIds: ir(u.nodeIds, r.id, K),
|
|
1720
|
+
edgeIds: K === "single" ? [] : u.edgeIds
|
|
1721
|
+
})), dt(r.id), It == null || It(r);
|
|
2078
1722
|
},
|
|
2079
|
-
[
|
|
2080
|
-
), Wr =
|
|
2081
|
-
(
|
|
2082
|
-
if (!
|
|
2083
|
-
|
|
1723
|
+
[$, It, K, dt, nt]
|
|
1724
|
+
), Wr = G(
|
|
1725
|
+
(r) => {
|
|
1726
|
+
if (!st) {
|
|
1727
|
+
vt == null || vt(r);
|
|
2084
1728
|
return;
|
|
2085
1729
|
}
|
|
2086
|
-
|
|
2087
|
-
nodeIds:
|
|
2088
|
-
edgeIds:
|
|
2089
|
-
})),
|
|
1730
|
+
nt((u) => ({
|
|
1731
|
+
nodeIds: K === "single" ? [] : u.nodeIds,
|
|
1732
|
+
edgeIds: ir(u.edgeIds, r.id, K)
|
|
1733
|
+
})), vt == null || vt(r);
|
|
2090
1734
|
},
|
|
2091
|
-
[
|
|
2092
|
-
), $r =
|
|
2093
|
-
(
|
|
2094
|
-
var
|
|
2095
|
-
const
|
|
2096
|
-
if (!
|
|
2097
|
-
|
|
2098
|
-
startX:
|
|
2099
|
-
startY:
|
|
2100
|
-
endX:
|
|
2101
|
-
endY:
|
|
2102
|
-
}),
|
|
1735
|
+
[st, vt, K, nt]
|
|
1736
|
+
), $r = G(
|
|
1737
|
+
(r) => {
|
|
1738
|
+
var U, ft;
|
|
1739
|
+
const u = r.target, y = !!u.closest('[data-graph-node-interactive="true"], [data-graph-edge-interactive="true"]'), L = ge(At.current, r.clientX, r.clientY);
|
|
1740
|
+
if (!y && K === "multiple" && P && r.shiftKey) {
|
|
1741
|
+
oe({
|
|
1742
|
+
startX: L.x,
|
|
1743
|
+
startY: L.y,
|
|
1744
|
+
endX: L.x,
|
|
1745
|
+
endY: L.y
|
|
1746
|
+
}), ht.current.active = !1;
|
|
2103
1747
|
return;
|
|
2104
1748
|
}
|
|
2105
|
-
if (
|
|
2106
|
-
const [
|
|
2107
|
-
|
|
1749
|
+
if (r.pointerType === "touch" && (mt.current.set(r.pointerId, L), c && g && mt.current.size === 2)) {
|
|
1750
|
+
const [bt, V] = Array.from(mt.current.values()), Ot = cr(bt, V);
|
|
1751
|
+
Pt.current = {
|
|
2108
1752
|
active: !0,
|
|
2109
|
-
startDistance:
|
|
2110
|
-
startZoom:
|
|
2111
|
-
worldX: (
|
|
2112
|
-
worldY: (
|
|
2113
|
-
},
|
|
1753
|
+
startDistance: ar(bt, V),
|
|
1754
|
+
startZoom: z.zoom,
|
|
1755
|
+
worldX: (Ot.x - z.x) / z.zoom,
|
|
1756
|
+
worldY: (Ot.y - z.y) / z.zoom
|
|
1757
|
+
}, ht.current.active = !1, (U = u.setPointerCapture) == null || U.call(u, r.pointerId);
|
|
2114
1758
|
return;
|
|
2115
1759
|
}
|
|
2116
|
-
!m ||
|
|
1760
|
+
!m || r.button !== 0 || y || (ht.current = {
|
|
2117
1761
|
active: !0,
|
|
2118
|
-
startX:
|
|
2119
|
-
startY:
|
|
2120
|
-
originX:
|
|
2121
|
-
originY:
|
|
2122
|
-
},
|
|
1762
|
+
startX: L.x,
|
|
1763
|
+
startY: L.y,
|
|
1764
|
+
originX: z.x,
|
|
1765
|
+
originY: z.y
|
|
1766
|
+
}, Pe(!0), (ft = u.setPointerCapture) == null || ft.call(u, r.pointerId));
|
|
2123
1767
|
},
|
|
2124
|
-
[
|
|
2125
|
-
),
|
|
2126
|
-
(
|
|
2127
|
-
const
|
|
2128
|
-
if (
|
|
2129
|
-
const [
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
1768
|
+
[P, m, c, K, z, g]
|
|
1769
|
+
), Br = G(
|
|
1770
|
+
(r) => {
|
|
1771
|
+
const u = ge(At.current, r.clientX, r.clientY);
|
|
1772
|
+
if (r.pointerType === "touch" && mt.current.has(r.pointerId) && (mt.current.set(r.pointerId, u), Pt.current.active && mt.current.size >= 2)) {
|
|
1773
|
+
const [y, L] = Array.from(mt.current.values()), U = cr(y, L), ft = ar(y, L), bt = Qt(
|
|
1774
|
+
Pt.current.startZoom * (ft / Math.max(1, Pt.current.startDistance)),
|
|
1775
|
+
Et,
|
|
1776
|
+
Tt
|
|
2133
1777
|
);
|
|
2134
|
-
|
|
2135
|
-
zoom:
|
|
2136
|
-
x:
|
|
2137
|
-
y:
|
|
1778
|
+
H({
|
|
1779
|
+
zoom: bt,
|
|
1780
|
+
x: U.x - Pt.current.worldX * bt,
|
|
1781
|
+
y: U.y - Pt.current.worldY * bt
|
|
2138
1782
|
});
|
|
2139
1783
|
return;
|
|
2140
1784
|
}
|
|
2141
|
-
if (
|
|
2142
|
-
|
|
2143
|
-
(
|
|
2144
|
-
...
|
|
2145
|
-
endX:
|
|
2146
|
-
endY:
|
|
1785
|
+
if (_t) {
|
|
1786
|
+
oe(
|
|
1787
|
+
(y) => y && {
|
|
1788
|
+
...y,
|
|
1789
|
+
endX: u.x,
|
|
1790
|
+
endY: u.y
|
|
2147
1791
|
}
|
|
2148
1792
|
);
|
|
2149
1793
|
return;
|
|
2150
1794
|
}
|
|
2151
|
-
!m || !
|
|
2152
|
-
x:
|
|
2153
|
-
y:
|
|
1795
|
+
!m || !ht.current.active || H({
|
|
1796
|
+
x: ht.current.originX + (u.x - ht.current.startX),
|
|
1797
|
+
y: ht.current.originY + (u.y - ht.current.startY)
|
|
2154
1798
|
});
|
|
2155
1799
|
},
|
|
2156
|
-
[m,
|
|
2157
|
-
),
|
|
2158
|
-
(
|
|
2159
|
-
var
|
|
2160
|
-
if (
|
|
2161
|
-
const
|
|
2162
|
-
x: (
|
|
2163
|
-
y: (
|
|
2164
|
-
width:
|
|
2165
|
-
height:
|
|
2166
|
-
},
|
|
2167
|
-
var
|
|
2168
|
-
const
|
|
2169
|
-
return !(
|
|
2170
|
-
}).map((
|
|
2171
|
-
const
|
|
2172
|
-
(
|
|
2173
|
-
),
|
|
2174
|
-
return
|
|
2175
|
-
}).map((
|
|
2176
|
-
|
|
2177
|
-
nodeIds: Array.from(/* @__PURE__ */ new Set([...
|
|
2178
|
-
edgeIds: Array.from(/* @__PURE__ */ new Set([...
|
|
2179
|
-
})),
|
|
1800
|
+
[m, Tt, Et, _t, H]
|
|
1801
|
+
), Ce = G(
|
|
1802
|
+
(r) => {
|
|
1803
|
+
var u, y;
|
|
1804
|
+
if (mt.current.delete(r.pointerId), mt.current.size < 2 && (Pt.current.active = !1), _t) {
|
|
1805
|
+
const L = lr(_t), U = {
|
|
1806
|
+
x: (L.x - z.x) / z.zoom,
|
|
1807
|
+
y: (L.y - z.y) / z.zoom,
|
|
1808
|
+
width: L.width / z.zoom,
|
|
1809
|
+
height: L.height / z.zoom
|
|
1810
|
+
}, ft = tt.filter((V) => {
|
|
1811
|
+
var Yt, Ve;
|
|
1812
|
+
const Ot = ((Yt = V.size) == null ? void 0 : Yt.width) ?? 0, le = ((Ve = V.size) == null ? void 0 : Ve.height) ?? 0;
|
|
1813
|
+
return !(V.position.x + Ot < U.x || V.position.x > U.x + U.width || V.position.y + le < U.y || V.position.y > U.y + U.height);
|
|
1814
|
+
}).map((V) => V.id), bt = gt.filter((V) => {
|
|
1815
|
+
const Ot = V.points.some(
|
|
1816
|
+
(Yt) => ur(Yt.x, Yt.y, U)
|
|
1817
|
+
), le = !!V.labelPosition && ur(V.labelPosition.x, V.labelPosition.y, U);
|
|
1818
|
+
return Ot || le;
|
|
1819
|
+
}).map((V) => V.id);
|
|
1820
|
+
nt((V) => ({
|
|
1821
|
+
nodeIds: Array.from(/* @__PURE__ */ new Set([...V.nodeIds, ...ft])),
|
|
1822
|
+
edgeIds: Array.from(/* @__PURE__ */ new Set([...V.edgeIds, ...bt]))
|
|
1823
|
+
})), oe(null);
|
|
2180
1824
|
}
|
|
2181
|
-
|
|
1825
|
+
ht.current.active = !1, Pe(!1), (y = (u = r.target).releasePointerCapture) == null || y.call(u, r.pointerId);
|
|
2182
1826
|
},
|
|
2183
|
-
[
|
|
2184
|
-
),
|
|
2185
|
-
(
|
|
2186
|
-
if (!
|
|
1827
|
+
[gt, tt, _t, nt, z]
|
|
1828
|
+
), Fr = G(
|
|
1829
|
+
(r) => {
|
|
1830
|
+
if (!g || !At.current)
|
|
2187
1831
|
return;
|
|
2188
|
-
|
|
2189
|
-
const
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
1832
|
+
r.preventDefault();
|
|
1833
|
+
const u = ge(At.current, r.clientX, r.clientY), y = Rr.current, L = (u.x - y.x) / y.zoom, U = (u.y - y.y) / y.zoom, ft = Qt(
|
|
1834
|
+
y.zoom + (r.deltaY < 0 ? h : -h),
|
|
1835
|
+
Et,
|
|
1836
|
+
Tt
|
|
2193
1837
|
);
|
|
2194
|
-
|
|
2195
|
-
zoom:
|
|
2196
|
-
x:
|
|
2197
|
-
y:
|
|
1838
|
+
H({
|
|
1839
|
+
zoom: ft,
|
|
1840
|
+
x: u.x - L * ft,
|
|
1841
|
+
y: u.y - U * ft
|
|
2198
1842
|
});
|
|
2199
1843
|
},
|
|
2200
|
-
[
|
|
2201
|
-
),
|
|
2202
|
-
(
|
|
2203
|
-
if (
|
|
2204
|
-
switch (
|
|
1844
|
+
[Tt, Et, H, g, h]
|
|
1845
|
+
), Gr = G(
|
|
1846
|
+
(r) => {
|
|
1847
|
+
if (v)
|
|
1848
|
+
switch (r.key) {
|
|
2205
1849
|
case "+":
|
|
2206
1850
|
case "=":
|
|
2207
|
-
|
|
1851
|
+
r.preventDefault(), H((u) => ({ zoom: u.zoom + h }));
|
|
2208
1852
|
break;
|
|
2209
1853
|
case "-":
|
|
2210
1854
|
case "_":
|
|
2211
|
-
|
|
1855
|
+
r.preventDefault(), H((u) => ({ zoom: u.zoom - h }));
|
|
2212
1856
|
break;
|
|
2213
1857
|
case "0":
|
|
2214
|
-
|
|
1858
|
+
r.preventDefault(), Lt();
|
|
2215
1859
|
break;
|
|
2216
1860
|
case "ArrowLeft":
|
|
2217
1861
|
case "ArrowRight":
|
|
2218
1862
|
case "ArrowUp":
|
|
2219
1863
|
case "ArrowDown": {
|
|
2220
|
-
if (
|
|
2221
|
-
const
|
|
2222
|
-
if (
|
|
2223
|
-
const
|
|
2224
|
-
|
|
1864
|
+
if (r.preventDefault(), yt) {
|
|
1865
|
+
const u = lt.get(yt);
|
|
1866
|
+
if (u) {
|
|
1867
|
+
const y = r.key === "ArrowLeft" ? "left" : r.key === "ArrowRight" ? "right" : r.key === "ArrowUp" ? "up" : "down", L = $n(u, tt, y);
|
|
1868
|
+
L && (dt(L.id), Zt(L.id));
|
|
2225
1869
|
break;
|
|
2226
1870
|
}
|
|
2227
1871
|
}
|
|
2228
|
-
|
|
1872
|
+
H((u) => r.key === "ArrowLeft" ? { x: u.x + 32 } : r.key === "ArrowRight" ? { x: u.x - 32 } : r.key === "ArrowUp" ? { y: u.y + 32 } : { y: u.y - 32 });
|
|
2229
1873
|
break;
|
|
2230
1874
|
}
|
|
2231
1875
|
case "Enter":
|
|
2232
1876
|
case " ": {
|
|
2233
|
-
if (!
|
|
1877
|
+
if (!yt)
|
|
2234
1878
|
break;
|
|
2235
|
-
|
|
2236
|
-
const
|
|
2237
|
-
|
|
1879
|
+
r.preventDefault();
|
|
1880
|
+
const u = lt.get(yt);
|
|
1881
|
+
u && ce(u);
|
|
2238
1882
|
break;
|
|
2239
1883
|
}
|
|
2240
1884
|
case "Escape":
|
|
2241
|
-
|
|
1885
|
+
r.preventDefault(), xt(null), nt(he), dt(null);
|
|
2242
1886
|
break;
|
|
2243
1887
|
}
|
|
2244
1888
|
},
|
|
2245
1889
|
[
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
vt,
|
|
1890
|
+
Zt,
|
|
1891
|
+
Lt,
|
|
1892
|
+
yt,
|
|
1893
|
+
ce,
|
|
1894
|
+
v,
|
|
1895
|
+
lt,
|
|
1896
|
+
tt,
|
|
1897
|
+
xt,
|
|
2255
1898
|
dt,
|
|
2256
|
-
|
|
2257
|
-
|
|
1899
|
+
nt,
|
|
1900
|
+
H,
|
|
1901
|
+
h
|
|
2258
1902
|
]
|
|
2259
|
-
),
|
|
2260
|
-
(
|
|
2261
|
-
|
|
2262
|
-
const
|
|
2263
|
-
|
|
1903
|
+
), Hr = G(
|
|
1904
|
+
(r) => {
|
|
1905
|
+
Rt(r);
|
|
1906
|
+
const u = lt.get(r);
|
|
1907
|
+
u && Nt(u, !0);
|
|
2264
1908
|
},
|
|
2265
|
-
[
|
|
2266
|
-
),
|
|
2267
|
-
const
|
|
2268
|
-
if (
|
|
2269
|
-
const
|
|
2270
|
-
|
|
1909
|
+
[Nt, lt, Rt]
|
|
1910
|
+
), Ur = G(() => {
|
|
1911
|
+
const r = Ge.current;
|
|
1912
|
+
if (r) {
|
|
1913
|
+
const u = lt.get(r);
|
|
1914
|
+
u && Nt(u, !1);
|
|
2271
1915
|
}
|
|
2272
|
-
|
|
2273
|
-
}, [
|
|
2274
|
-
(
|
|
2275
|
-
|
|
2276
|
-
const
|
|
2277
|
-
|
|
1916
|
+
Rt(null), xt(null);
|
|
1917
|
+
}, [Nt, lt, xt, Rt]), Cr = G(
|
|
1918
|
+
(r, u, y) => {
|
|
1919
|
+
xt({ nodeId: r, sourceIndex: u, pathKey: y });
|
|
1920
|
+
const L = lt.get(r);
|
|
1921
|
+
L && Nt(L, !0, "path");
|
|
2278
1922
|
},
|
|
2279
|
-
[
|
|
2280
|
-
), Kr =
|
|
2281
|
-
|
|
2282
|
-
}, [
|
|
2283
|
-
(
|
|
2284
|
-
const
|
|
2285
|
-
|
|
1923
|
+
[Nt, lt, xt]
|
|
1924
|
+
), Kr = G(() => {
|
|
1925
|
+
xt(null);
|
|
1926
|
+
}, [xt]), Vr = G(
|
|
1927
|
+
(r, u) => {
|
|
1928
|
+
const y = Xe.get(r);
|
|
1929
|
+
y && Ue(y, u), I.hoverHighlight && (Fe(u ? r : null), u && Rt(null));
|
|
2286
1930
|
},
|
|
2287
|
-
[
|
|
2288
|
-
), qr =
|
|
1931
|
+
[I.hoverHighlight, Ue, Xe, Fe, Rt]
|
|
1932
|
+
), qr = A(
|
|
2289
1933
|
() => ({
|
|
2290
|
-
background:
|
|
2291
|
-
fontFamily:
|
|
1934
|
+
background: pt.background,
|
|
1935
|
+
fontFamily: pt.fontFamily,
|
|
2292
1936
|
cursor: _e ? "grabbing" : m ? "grab" : "default",
|
|
2293
1937
|
outline: "none",
|
|
2294
|
-
touchAction: m ||
|
|
1938
|
+
touchAction: m || g ? "none" : "auto",
|
|
2295
1939
|
overflow: "hidden",
|
|
2296
1940
|
userSelect: "none"
|
|
2297
1941
|
}),
|
|
2298
|
-
[_e,
|
|
2299
|
-
),
|
|
2300
|
-
() =>
|
|
2301
|
-
[
|
|
2302
|
-
),
|
|
1942
|
+
[_e, pt.background, pt.fontFamily, m, g]
|
|
1943
|
+
), Ke = A(
|
|
1944
|
+
() => Dn(I.width, I.height, x),
|
|
1945
|
+
[I.height, I.width, x]
|
|
1946
|
+
), Dt = _t ? lr(_t) : null, Zr = N ? /* @__PURE__ */ M.jsx(
|
|
2303
1947
|
"g",
|
|
2304
1948
|
{
|
|
2305
1949
|
"aria-label": "viewport-controls",
|
|
2306
|
-
transform: `translate(${
|
|
1950
|
+
transform: `translate(${Ke.x}, ${Ke.y})`,
|
|
2307
1951
|
children: [
|
|
2308
1952
|
{
|
|
2309
1953
|
key: "zoom-in",
|
|
2310
1954
|
label: "+",
|
|
2311
|
-
width:
|
|
2312
|
-
onClick: () =>
|
|
1955
|
+
width: St,
|
|
1956
|
+
onClick: () => H((r) => ({ zoom: r.zoom + h }))
|
|
2313
1957
|
},
|
|
2314
1958
|
{
|
|
2315
1959
|
key: "zoom-out",
|
|
2316
1960
|
label: "−",
|
|
2317
|
-
width:
|
|
2318
|
-
onClick: () =>
|
|
1961
|
+
width: St,
|
|
1962
|
+
onClick: () => H((r) => ({ zoom: r.zoom - h }))
|
|
2319
1963
|
},
|
|
2320
1964
|
{
|
|
2321
1965
|
key: "fit-view",
|
|
2322
1966
|
label: "Fit",
|
|
2323
|
-
width:
|
|
2324
|
-
onClick: () =>
|
|
1967
|
+
width: ve,
|
|
1968
|
+
onClick: () => Lt()
|
|
2325
1969
|
},
|
|
2326
1970
|
{
|
|
2327
1971
|
key: "reset-view",
|
|
2328
1972
|
label: "1:1",
|
|
2329
|
-
width:
|
|
2330
|
-
onClick: () =>
|
|
1973
|
+
width: ve,
|
|
1974
|
+
onClick: () => H(sr)
|
|
2331
1975
|
}
|
|
2332
1976
|
].reduce(
|
|
2333
|
-
(
|
|
2334
|
-
x:
|
|
2335
|
-
controls: [...
|
|
1977
|
+
(r, u) => ({
|
|
1978
|
+
x: r.x + u.width + Ir,
|
|
1979
|
+
controls: [...r.controls, { ...u, x: r.x }]
|
|
2336
1980
|
}),
|
|
2337
1981
|
{ x: 0, controls: [] }
|
|
2338
|
-
).controls.map((
|
|
1982
|
+
).controls.map((r) => /* @__PURE__ */ M.jsxs(
|
|
2339
1983
|
"g",
|
|
2340
1984
|
{
|
|
2341
|
-
transform: `translate(${
|
|
1985
|
+
transform: `translate(${r.x}, 0)`,
|
|
2342
1986
|
role: "button",
|
|
2343
1987
|
tabIndex: 0,
|
|
2344
|
-
onClick: (
|
|
2345
|
-
|
|
1988
|
+
onClick: (u) => {
|
|
1989
|
+
u.stopPropagation(), r.onClick();
|
|
2346
1990
|
},
|
|
2347
|
-
onKeyDown: (
|
|
2348
|
-
(
|
|
1991
|
+
onKeyDown: (u) => {
|
|
1992
|
+
(u.key === "Enter" || u.key === " ") && (u.preventDefault(), u.stopPropagation(), r.onClick());
|
|
2349
1993
|
},
|
|
2350
1994
|
children: [
|
|
2351
|
-
/* @__PURE__ */
|
|
1995
|
+
/* @__PURE__ */ M.jsx(
|
|
2352
1996
|
"rect",
|
|
2353
1997
|
{
|
|
2354
|
-
width:
|
|
2355
|
-
height:
|
|
1998
|
+
width: r.width,
|
|
1999
|
+
height: St,
|
|
2356
2000
|
rx: 7,
|
|
2357
2001
|
ry: 7,
|
|
2358
2002
|
fill: "rgba(255,255,255,0.92)",
|
|
2359
2003
|
stroke: "rgba(15,23,42,0.18)"
|
|
2360
2004
|
}
|
|
2361
2005
|
),
|
|
2362
|
-
/* @__PURE__ */
|
|
2006
|
+
/* @__PURE__ */ M.jsx(
|
|
2363
2007
|
"text",
|
|
2364
2008
|
{
|
|
2365
|
-
x:
|
|
2366
|
-
y:
|
|
2009
|
+
x: r.width / 2,
|
|
2010
|
+
y: St / 2 + 4,
|
|
2367
2011
|
textAnchor: "middle",
|
|
2368
|
-
fontSize:
|
|
2012
|
+
fontSize: r.label.length > 1 ? 10 : 16,
|
|
2369
2013
|
fontWeight: 700,
|
|
2370
2014
|
fill: "#0f172a",
|
|
2371
|
-
children:
|
|
2015
|
+
children: r.label
|
|
2372
2016
|
}
|
|
2373
2017
|
)
|
|
2374
2018
|
]
|
|
2375
2019
|
},
|
|
2376
|
-
|
|
2020
|
+
r.key
|
|
2377
2021
|
))
|
|
2378
2022
|
}
|
|
2379
2023
|
) : null;
|
|
2380
|
-
return /* @__PURE__ */
|
|
2024
|
+
return /* @__PURE__ */ M.jsxs(
|
|
2381
2025
|
"svg",
|
|
2382
2026
|
{
|
|
2383
|
-
ref:
|
|
2384
|
-
width:
|
|
2385
|
-
height:
|
|
2027
|
+
ref: At,
|
|
2028
|
+
width: I.width,
|
|
2029
|
+
height: I.height,
|
|
2386
2030
|
role: "figure",
|
|
2387
2031
|
"aria-label": "Graph",
|
|
2388
2032
|
tabIndex: 0,
|
|
2389
2033
|
style: qr,
|
|
2390
|
-
onClick: (
|
|
2391
|
-
|
|
2034
|
+
onClick: (r) => {
|
|
2035
|
+
r.target === r.currentTarget && (nt(he), xt(null), dt(null));
|
|
2392
2036
|
},
|
|
2393
2037
|
onPointerDown: $r,
|
|
2394
|
-
onPointerMove:
|
|
2395
|
-
onPointerUp:
|
|
2396
|
-
onPointerLeave:
|
|
2397
|
-
onWheel:
|
|
2398
|
-
onKeyDown:
|
|
2038
|
+
onPointerMove: Br,
|
|
2039
|
+
onPointerUp: Ce,
|
|
2040
|
+
onPointerLeave: Ce,
|
|
2041
|
+
onWheel: Fr,
|
|
2042
|
+
onKeyDown: Gr,
|
|
2399
2043
|
children: [
|
|
2400
|
-
|
|
2401
|
-
/* @__PURE__ */
|
|
2044
|
+
Kt ? /* @__PURE__ */ M.jsxs("defs", { children: [
|
|
2045
|
+
/* @__PURE__ */ M.jsx(
|
|
2402
2046
|
"marker",
|
|
2403
2047
|
{
|
|
2404
|
-
id:
|
|
2048
|
+
id: Se,
|
|
2405
2049
|
viewBox: "0 0 10 10",
|
|
2406
2050
|
refX: "6",
|
|
2407
2051
|
refY: "5",
|
|
2408
2052
|
markerWidth: "6",
|
|
2409
2053
|
markerHeight: "6",
|
|
2410
2054
|
orient: "auto-start-reverse",
|
|
2411
|
-
children: /* @__PURE__ */
|
|
2055
|
+
children: /* @__PURE__ */ M.jsx("path", { d: "M 0 0 L 10 5 L 0 10 z", fill: Le })
|
|
2412
2056
|
}
|
|
2413
2057
|
),
|
|
2414
|
-
/* @__PURE__ */
|
|
2058
|
+
/* @__PURE__ */ M.jsx(
|
|
2415
2059
|
"marker",
|
|
2416
2060
|
{
|
|
2417
|
-
id:
|
|
2061
|
+
id: Ae,
|
|
2418
2062
|
viewBox: "0 0 10 10",
|
|
2419
2063
|
refX: "6",
|
|
2420
2064
|
refY: "5",
|
|
2421
2065
|
markerWidth: "6",
|
|
2422
2066
|
markerHeight: "6",
|
|
2423
2067
|
orient: "auto-start-reverse",
|
|
2424
|
-
children: /* @__PURE__ */
|
|
2068
|
+
children: /* @__PURE__ */ M.jsx("path", { d: "M 0 0 L 10 5 L 0 10 z", fill: I.hoverEdgeColor })
|
|
2425
2069
|
}
|
|
2426
2070
|
),
|
|
2427
|
-
/* @__PURE__ */
|
|
2071
|
+
/* @__PURE__ */ M.jsx(
|
|
2428
2072
|
"marker",
|
|
2429
2073
|
{
|
|
2430
|
-
id:
|
|
2074
|
+
id: Re,
|
|
2431
2075
|
viewBox: "0 0 10 10",
|
|
2432
2076
|
refX: "6",
|
|
2433
2077
|
refY: "5",
|
|
2434
2078
|
markerWidth: "6",
|
|
2435
2079
|
markerHeight: "6",
|
|
2436
2080
|
orient: "auto-start-reverse",
|
|
2437
|
-
children: /* @__PURE__ */
|
|
2081
|
+
children: /* @__PURE__ */ M.jsx("path", { d: "M 0 0 L 10 5 L 0 10 z", fill: I.hoverNodeOutColor })
|
|
2438
2082
|
}
|
|
2439
2083
|
),
|
|
2440
|
-
/* @__PURE__ */
|
|
2084
|
+
/* @__PURE__ */ M.jsx(
|
|
2441
2085
|
"marker",
|
|
2442
2086
|
{
|
|
2443
|
-
id:
|
|
2087
|
+
id: Me,
|
|
2444
2088
|
viewBox: "0 0 10 10",
|
|
2445
2089
|
refX: "6",
|
|
2446
2090
|
refY: "5",
|
|
2447
2091
|
markerWidth: "6",
|
|
2448
2092
|
markerHeight: "6",
|
|
2449
2093
|
orient: "auto-start-reverse",
|
|
2450
|
-
children: /* @__PURE__ */
|
|
2094
|
+
children: /* @__PURE__ */ M.jsx("path", { d: "M 0 0 L 10 5 L 0 10 z", fill: ke })
|
|
2451
2095
|
}
|
|
2452
2096
|
)
|
|
2453
2097
|
] }) : null,
|
|
2454
|
-
/* @__PURE__ */
|
|
2455
|
-
|
|
2456
|
-
/* @__PURE__ */
|
|
2457
|
-
|
|
2098
|
+
/* @__PURE__ */ M.jsx("g", { transform: `translate(${z.x}, ${z.y}) scale(${z.zoom})`, children: /* @__PURE__ */ M.jsxs("g", { ref: Pr, children: [
|
|
2099
|
+
re == null ? void 0 : re(He),
|
|
2100
|
+
/* @__PURE__ */ M.jsx(
|
|
2101
|
+
An,
|
|
2458
2102
|
{
|
|
2459
|
-
positionedNodes:
|
|
2460
|
-
layout:
|
|
2461
|
-
layoutDirection:
|
|
2462
|
-
labels:
|
|
2463
|
-
autoLabels:
|
|
2464
|
-
labelOffset:
|
|
2465
|
-
pillBackground:
|
|
2466
|
-
pillBorderColor:
|
|
2467
|
-
pillTextColor:
|
|
2103
|
+
positionedNodes: tt,
|
|
2104
|
+
layout: I.layout,
|
|
2105
|
+
layoutDirection: I.layoutDirection,
|
|
2106
|
+
labels: I.labels,
|
|
2107
|
+
autoLabels: I.autoLabels,
|
|
2108
|
+
labelOffset: I.labelOffset,
|
|
2109
|
+
pillBackground: I.labelPillBackground,
|
|
2110
|
+
pillBorderColor: I.labelPillBorderColor,
|
|
2111
|
+
pillTextColor: I.labelPillTextColor
|
|
2468
2112
|
}
|
|
2469
2113
|
),
|
|
2470
|
-
/* @__PURE__ */
|
|
2471
|
-
const
|
|
2472
|
-
return /* @__PURE__ */
|
|
2473
|
-
|
|
2114
|
+
/* @__PURE__ */ M.jsx("g", { "aria-label": "edges", children: Xr.map((r) => {
|
|
2115
|
+
const u = I.hoverHighlight && (Be === r.id || kt && (r.source === kt || r.target === kt)) || (Mt == null ? void 0 : Mt.edges.has(r.id)), y = kt && !Be && r.type !== "undirected" && r.target === kt;
|
|
2116
|
+
return /* @__PURE__ */ M.jsx(
|
|
2117
|
+
s,
|
|
2474
2118
|
{
|
|
2475
|
-
edge:
|
|
2476
|
-
color:
|
|
2477
|
-
width:
|
|
2478
|
-
curveEdges:
|
|
2479
|
-
curveStrength:
|
|
2480
|
-
markerEnd:
|
|
2481
|
-
isHovered:
|
|
2482
|
-
isSelected:
|
|
2483
|
-
hoverColor:
|
|
2484
|
-
selectionColor:
|
|
2485
|
-
labelColor:
|
|
2486
|
-
selectionMarker:
|
|
2487
|
-
hoverMarker:
|
|
2488
|
-
hoverEnabled:
|
|
2489
|
-
hitStrokeWidth:
|
|
2490
|
-
hoverStrokeWidth:
|
|
2491
|
-
selectedStrokeWidth:
|
|
2492
|
-
onHoverChange: (
|
|
2493
|
-
onClick: () => Wr(
|
|
2119
|
+
edge: r,
|
|
2120
|
+
color: Le,
|
|
2121
|
+
width: Ct,
|
|
2122
|
+
curveEdges: I.curveEdges && I.routingStyle !== "orthogonal",
|
|
2123
|
+
curveStrength: I.curveStrength,
|
|
2124
|
+
markerEnd: Kt ? `url(#${Se})` : void 0,
|
|
2125
|
+
isHovered: u,
|
|
2126
|
+
isSelected: ze.has(r.id) || Or.has(r.id),
|
|
2127
|
+
hoverColor: y ? I.hoverNodeOutColor : I.hoverEdgeColor,
|
|
2128
|
+
selectionColor: ze.has(r.id) ? ke : O,
|
|
2129
|
+
labelColor: I.edgeLabelColor,
|
|
2130
|
+
selectionMarker: Kt ? `url(#${Me})` : void 0,
|
|
2131
|
+
hoverMarker: Kt ? y ? `url(#${Re})` : `url(#${Ae})` : void 0,
|
|
2132
|
+
hoverEnabled: I.hoverHighlight,
|
|
2133
|
+
hitStrokeWidth: Ct + 8,
|
|
2134
|
+
hoverStrokeWidth: Ct + 1.5,
|
|
2135
|
+
selectedStrokeWidth: Ct + 1.5,
|
|
2136
|
+
onHoverChange: (L) => Vr(r.id, L),
|
|
2137
|
+
onClick: () => Wr(r)
|
|
2494
2138
|
},
|
|
2495
|
-
|
|
2139
|
+
r.id
|
|
2496
2140
|
);
|
|
2497
2141
|
}) }),
|
|
2498
|
-
/* @__PURE__ */
|
|
2499
|
-
|
|
2142
|
+
/* @__PURE__ */ M.jsx("g", { "aria-label": "nodes", children: tt.map((r) => /* @__PURE__ */ M.jsx(
|
|
2143
|
+
xr,
|
|
2500
2144
|
{
|
|
2501
|
-
node:
|
|
2502
|
-
Vertex:
|
|
2503
|
-
isSelected:
|
|
2504
|
-
isFocused:
|
|
2505
|
-
isHighlighted:
|
|
2506
|
-
activePathKey:
|
|
2507
|
-
activePathNodeIds:
|
|
2508
|
-
highlightColor:
|
|
2509
|
-
selectionColor:
|
|
2510
|
-
nodeBorderColor:
|
|
2511
|
-
nodeBorderWidth:
|
|
2512
|
-
hoverNodeBorderColor:
|
|
2513
|
-
hoverNodeBothColor:
|
|
2514
|
-
hoverNodeInColor:
|
|
2515
|
-
hoverNodeOutColor:
|
|
2516
|
-
hoverNodeHighlight:
|
|
2517
|
-
hoveredNodeStates:
|
|
2518
|
-
onNodeMeasure:
|
|
2519
|
-
onNodeFocus:
|
|
2520
|
-
onNodeClick:
|
|
2521
|
-
onNodeDoubleClick:
|
|
2522
|
-
onNodeMouseEnter:
|
|
2523
|
-
onNodeMouseLeave:
|
|
2524
|
-
onPathHover:
|
|
2145
|
+
node: r,
|
|
2146
|
+
Vertex: e,
|
|
2147
|
+
isSelected: Nr.has(r.id),
|
|
2148
|
+
isFocused: yt === r.id,
|
|
2149
|
+
isHighlighted: zr.has(r.id),
|
|
2150
|
+
activePathKey: ae == null ? void 0 : ae.pathKey,
|
|
2151
|
+
activePathNodeIds: Mt == null ? void 0 : Mt.nodes,
|
|
2152
|
+
highlightColor: O,
|
|
2153
|
+
selectionColor: it,
|
|
2154
|
+
nodeBorderColor: Sr,
|
|
2155
|
+
nodeBorderWidth: Ar,
|
|
2156
|
+
hoverNodeBorderColor: Lr,
|
|
2157
|
+
hoverNodeBothColor: kr,
|
|
2158
|
+
hoverNodeInColor: I.hoverNodeInColor,
|
|
2159
|
+
hoverNodeOutColor: I.hoverNodeOutColor,
|
|
2160
|
+
hoverNodeHighlight: I.hoverNodeHighlight,
|
|
2161
|
+
hoveredNodeStates: Yr ?? void 0,
|
|
2162
|
+
onNodeMeasure: jr,
|
|
2163
|
+
onNodeFocus: dt,
|
|
2164
|
+
onNodeClick: ce,
|
|
2165
|
+
onNodeDoubleClick: Dr,
|
|
2166
|
+
onNodeMouseEnter: Hr,
|
|
2167
|
+
onNodeMouseLeave: Ur,
|
|
2168
|
+
onPathHover: Cr,
|
|
2525
2169
|
onPathLeave: Kr
|
|
2526
2170
|
},
|
|
2527
|
-
|
|
2171
|
+
r.id
|
|
2528
2172
|
)) }),
|
|
2529
|
-
|
|
2173
|
+
ne == null ? void 0 : ne(He)
|
|
2530
2174
|
] }) }),
|
|
2531
|
-
|
|
2175
|
+
Dt ? /* @__PURE__ */ M.jsx(
|
|
2532
2176
|
"rect",
|
|
2533
2177
|
{
|
|
2534
|
-
x:
|
|
2535
|
-
y:
|
|
2536
|
-
width:
|
|
2537
|
-
height:
|
|
2178
|
+
x: Dt.x,
|
|
2179
|
+
y: Dt.y,
|
|
2180
|
+
width: Dt.width,
|
|
2181
|
+
height: Dt.height,
|
|
2538
2182
|
fill: "rgba(59, 130, 246, 0.12)",
|
|
2539
2183
|
stroke: "rgba(59, 130, 246, 0.8)",
|
|
2540
2184
|
strokeDasharray: "6 4",
|
|
2541
2185
|
pointerEvents: "none"
|
|
2542
2186
|
}
|
|
2543
2187
|
) : null,
|
|
2544
|
-
|
|
2188
|
+
Zr
|
|
2545
2189
|
]
|
|
2546
2190
|
}
|
|
2547
2191
|
);
|
|
2548
|
-
},
|
|
2549
|
-
|
|
2192
|
+
}, vr = Ft.memo(
|
|
2193
|
+
Ft.forwardRef(Bn)
|
|
2550
2194
|
);
|
|
2551
|
-
|
|
2552
|
-
const
|
|
2195
|
+
vr.displayName = "Graph";
|
|
2196
|
+
const Un = vr;
|
|
2553
2197
|
export {
|
|
2554
2198
|
En as EdgePath,
|
|
2555
2199
|
Vn as EdgeType,
|
|
2556
|
-
|
|
2200
|
+
Un as Graph,
|
|
2557
2201
|
qn as LayoutDirection,
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2202
|
+
Zn as LayoutType,
|
|
2203
|
+
Jn as NodeSide,
|
|
2204
|
+
to as buildEdgePath,
|
|
2205
|
+
eo as fromNxGraph,
|
|
2206
|
+
pr as groupPositionedNodesByColumn,
|
|
2207
|
+
ro as layoutNodes,
|
|
2208
|
+
no as renderGraphToSvg,
|
|
2209
|
+
oo as routeEdges
|
|
2566
2210
|
};
|