vue3-network-graph 0.2.4 → 0.2.5

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/dist/index.mjs CHANGED
@@ -1,32 +1,32 @@
1
- import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createStaticVNode as a, getCurrentInstance as o, normalizeClass as s, normalizeStyle as c, onBeforeUnmount as l, onMounted as u, openBlock as d, ref as f, renderList as p, renderSlot as ee, toDisplayString as m, unref as te, watch as ne, watchEffect as re, withModifiers as h } from "vue";
1
+ import { Fragment as e, computed as t, createCommentVNode as n, createElementBlock as r, createElementVNode as i, createStaticVNode as a, getCurrentInstance as o, normalizeClass as s, normalizeStyle as c, onBeforeUnmount as l, onMounted as u, openBlock as d, ref as f, renderList as p, renderSlot as ee, toDisplayString as m, unref as te, watch as h, watchEffect as ne, withModifiers as g } from "vue";
2
2
  // node_modules/uuid/dist/stringify.js
3
- var g = [];
4
- for (let e = 0; e < 256; ++e) g.push((e + 256).toString(16).slice(1));
5
- function ie(e, t = 0) {
6
- return (g[e[t + 0]] + g[e[t + 1]] + g[e[t + 2]] + g[e[t + 3]] + "-" + g[e[t + 4]] + g[e[t + 5]] + "-" + g[e[t + 6]] + g[e[t + 7]] + "-" + g[e[t + 8]] + g[e[t + 9]] + "-" + g[e[t + 10]] + g[e[t + 11]] + g[e[t + 12]] + g[e[t + 13]] + g[e[t + 14]] + g[e[t + 15]]).toLowerCase();
3
+ var _ = [];
4
+ for (let e = 0; e < 256; ++e) _.push((e + 256).toString(16).slice(1));
5
+ function re(e, t = 0) {
6
+ return (_[e[t + 0]] + _[e[t + 1]] + _[e[t + 2]] + _[e[t + 3]] + "-" + _[e[t + 4]] + _[e[t + 5]] + "-" + _[e[t + 6]] + _[e[t + 7]] + "-" + _[e[t + 8]] + _[e[t + 9]] + "-" + _[e[t + 10]] + _[e[t + 11]] + _[e[t + 12]] + _[e[t + 13]] + _[e[t + 14]] + _[e[t + 15]]).toLowerCase();
7
7
  }
8
8
  // node_modules/uuid/dist/rng.js
9
- var ae = /* @__PURE__ */ new Uint8Array(16);
10
- function _() {
11
- return crypto.getRandomValues(ae);
9
+ var ie = /* @__PURE__ */ new Uint8Array(16);
10
+ function v() {
11
+ return crypto.getRandomValues(ie);
12
12
  }
13
13
  // node_modules/uuid/dist/v4.js
14
- function oe(e, t, n) {
15
- return !t && !e && crypto.randomUUID ? crypto.randomUUID() : v(e, t, n);
14
+ function ae(e, t, n) {
15
+ return !t && !e && crypto.randomUUID ? crypto.randomUUID() : y(e, t, n);
16
16
  }
17
- function v(e, t, n) {
17
+ function y(e, t, n) {
18
18
  e ||= {};
19
- let r = e.random ?? e.rng?.() ?? _();
19
+ let r = e.random ?? e.rng?.() ?? v();
20
20
  if (r.length < 16) throw Error("Random bytes length must be >= 16");
21
21
  if (r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, t) {
22
22
  if (n ||= 0, n < 0 || n + 16 > t.length) throw RangeError(`UUID byte range ${n}:${n + 15} is out of buffer bounds`);
23
23
  for (let e = 0; e < 16; ++e) t[n + e] = r[e];
24
24
  return t;
25
25
  }
26
- return ie(r);
26
+ return re(r);
27
27
  }
28
28
  // src/components/topology-data.js
29
- var y = {
29
+ var b = {
30
30
  normal: {
31
31
  color: "#4ade80",
32
32
  label: "Running"
@@ -67,7 +67,7 @@ var y = {
67
67
  color: "#64748b",
68
68
  label: "Idle"
69
69
  }
70
- }, se = {
70
+ }, oe = {
71
71
  core: "#00f0ff",
72
72
  firewall: "#ff6b35",
73
73
  loadbalancer: "#a855f7",
@@ -77,44 +77,48 @@ var y = {
77
77
  cache: "#f43f5e",
78
78
  queue: "#fb923c",
79
79
  text: "#94a3b8"
80
- }, ce = ["viewBox"], le = [
80
+ }, se = ["viewBox"], ce = [
81
81
  "cx",
82
82
  "cy",
83
83
  "r"
84
- ], ue = [
84
+ ], le = [
85
85
  "offset",
86
86
  "stop-color",
87
87
  "stop-opacity"
88
- ], de = ["id"], fe = ["stop-color"], pe = ["stop-color"], me = ["stop-color"], he = ["id"], ge = [
88
+ ], ue = ["id"], de = ["stop-color"], fe = ["stop-color"], pe = ["stop-color"], me = ["id"], he = [
89
89
  "offset",
90
90
  "stop-color",
91
91
  "stop-opacity"
92
- ], _e = ["id"], ve = ["fill"], ye = ["id"], be = ["fill"], xe = [
92
+ ], ge = ["id"], _e = ["fill"], ve = ["id"], ye = ["fill"], be = [
93
93
  "width",
94
94
  "height",
95
95
  "x",
96
96
  "y"
97
- ], Se = ["width", "height"], Ce = ["d", "stroke"], we = [
97
+ ], xe = ["width", "height"], Se = ["d", "stroke"], Ce = [
98
98
  "width",
99
99
  "height",
100
100
  "x",
101
101
  "y",
102
102
  "opacity"
103
- ], Te = {
103
+ ], we = {
104
104
  key: 1,
105
105
  class: "center-crosshair"
106
- }, Ee = [
106
+ }, Te = [
107
107
  "x",
108
108
  "y",
109
109
  "width",
110
110
  "height",
111
111
  "fill"
112
- ], De = [
112
+ ], Ee = [
113
113
  "x",
114
114
  "y",
115
115
  "width",
116
116
  "height",
117
117
  "stroke"
118
+ ], De = [
119
+ "cx",
120
+ "cy",
121
+ "fill"
118
122
  ], Oe = [
119
123
  "cx",
120
124
  "cy",
@@ -128,22 +132,18 @@ var y = {
128
132
  "cy",
129
133
  "fill"
130
134
  ], je = [
131
- "cx",
132
- "cy",
133
- "fill"
134
- ], Me = [
135
135
  "x",
136
136
  "y",
137
137
  "transform",
138
138
  "fill"
139
- ], Ne = ["transform"], Pe = [
139
+ ], Me = ["transform"], Ne = [
140
140
  "x",
141
141
  "y",
142
142
  "width",
143
143
  "height",
144
144
  "rx",
145
145
  "fill"
146
- ], Fe = [
146
+ ], Pe = [
147
147
  "x",
148
148
  "y",
149
149
  "width",
@@ -152,18 +152,18 @@ var y = {
152
152
  "stroke",
153
153
  "stroke-width",
154
154
  "stroke-dasharray"
155
- ], Ie = {
155
+ ], Fe = {
156
156
  key: 2,
157
157
  class: "node-base-layer",
158
158
  "pointer-events": "none"
159
- }, Le = ["transform"], Re = [
159
+ }, Ie = ["transform"], Le = [
160
160
  "x",
161
161
  "y",
162
162
  "width",
163
163
  "height",
164
164
  "rx",
165
165
  "fill"
166
- ], ze = [
166
+ ], Re = [
167
167
  "x",
168
168
  "y",
169
169
  "width",
@@ -172,22 +172,43 @@ var y = {
172
172
  "stroke",
173
173
  "stroke-width",
174
174
  "stroke-dasharray"
175
- ], Be = [
175
+ ], ze = [
176
176
  "d",
177
177
  "stroke",
178
178
  "opacity",
179
+ "stroke-width",
179
180
  "marker-end"
180
- ], Ve = ["d", "stroke"], He = ["d", "stroke"], Ue = { key: 0 }, We = ["d", "stroke"], Ge = ["dur"], Ke = ["d", "stroke"], qe = ["dur"], Je = ["d", "stroke"], Ye = ["dur"], Xe = [
181
+ ], Be = [
182
+ "d",
183
+ "stroke",
184
+ "stroke-width"
185
+ ], Ve = [
186
+ "d",
187
+ "stroke",
188
+ "stroke-width"
189
+ ], He = { key: 0 }, Ue = [
190
+ "d",
191
+ "stroke",
192
+ "stroke-width"
193
+ ], We = ["dur"], Ge = [
194
+ "d",
195
+ "stroke",
196
+ "stroke-width"
197
+ ], Ke = ["dur"], qe = [
198
+ "d",
199
+ "stroke",
200
+ "stroke-width"
201
+ ], Je = ["dur"], Ye = [
181
202
  "d",
182
203
  "stroke",
183
204
  "stroke-width",
184
205
  "stroke-dasharray",
185
206
  "marker-end"
186
- ], Ze = ["to", "dur"], Qe = { key: 0 }, $e = ["fill"], et = ["path", "dur"], tt = ["fill"], nt = ["path", "dur"], rt = ["transform"], it = [
207
+ ], Xe = ["to", "dur"], Ze = { key: 0 }, Qe = ["fill"], $e = ["path", "dur"], et = ["fill"], tt = ["path", "dur"], nt = ["transform"], rt = [
187
208
  "y",
188
209
  "height",
189
210
  "stroke"
190
- ], at = ["font-size", "fill"], ot = { key: 1 }, st = ["transform"], ct = [
211
+ ], it = ["font-size", "fill"], at = { key: 1 }, ot = ["transform"], st = [
191
212
  "x",
192
213
  "y",
193
214
  "width",
@@ -197,7 +218,7 @@ var y = {
197
218
  "stroke",
198
219
  "stroke-opacity",
199
220
  "stroke-dasharray"
200
- ], lt = ["font-size", "fill"], ut = ["transform"], dt = [
221
+ ], ct = ["font-size", "fill"], lt = ["transform"], ut = [
201
222
  "x",
202
223
  "y",
203
224
  "width",
@@ -207,7 +228,7 @@ var y = {
207
228
  "stroke",
208
229
  "stroke-opacity",
209
230
  "stroke-dasharray"
210
- ], ft = ["font-size", "fill"], pt = ["transform"], mt = [
231
+ ], dt = ["font-size", "fill"], ft = ["transform"], pt = [
211
232
  "x",
212
233
  "y",
213
234
  "width",
@@ -217,69 +238,69 @@ var y = {
217
238
  "stroke",
218
239
  "stroke-opacity",
219
240
  "stroke-dasharray"
220
- ], ht = ["font-size", "fill"], gt = { key: 3 }, _t = [
241
+ ], mt = ["font-size", "fill"], ht = { key: 3 }, gt = [
221
242
  "x1",
222
243
  "y1",
223
244
  "x2",
224
245
  "y2",
225
246
  "stroke"
226
- ], vt = [
247
+ ], _t = [
227
248
  "cx",
228
249
  "cy",
229
250
  "fill"
230
- ], yt = [
251
+ ], vt = [
231
252
  "x",
232
253
  "y",
233
254
  "width",
234
255
  "height",
235
256
  "stroke"
236
- ], bt = { class: "region-hit-layer" }, xt = [
257
+ ], yt = { class: "region-hit-layer" }, bt = [
237
258
  "transform",
238
259
  "onMousedown",
239
260
  "onClick"
240
- ], St = [
261
+ ], xt = [
241
262
  "x",
242
263
  "y",
243
264
  "width",
244
265
  "height",
245
266
  "rx"
246
- ], Ct = [
267
+ ], St = [
247
268
  "x",
248
269
  "y",
249
270
  "width",
250
271
  "height",
251
272
  "rx"
252
- ], wt = [
273
+ ], Ct = [
253
274
  "x",
254
275
  "y",
255
276
  "width",
256
277
  "height",
257
278
  "rx",
258
279
  "stroke"
259
- ], Tt = ["d", "onClick"], Et = [
280
+ ], wt = ["d", "onClick"], Tt = [
260
281
  "transform",
261
282
  "onMousedown",
262
283
  "onClick"
263
- ], Dt = [
284
+ ], Et = [
264
285
  "x",
265
286
  "y",
266
287
  "width",
267
288
  "height",
268
289
  "rx",
269
290
  "stroke-width"
270
- ], Ot = [
291
+ ], Dt = [
271
292
  "x",
272
293
  "y",
273
294
  "width",
274
295
  "height"
275
- ], kt = [
296
+ ], Ot = [
276
297
  "x",
277
298
  "y",
278
299
  "width",
279
300
  "height",
280
301
  "rx",
281
302
  "fill"
282
- ], At = [
303
+ ], kt = [
283
304
  "x",
284
305
  "y",
285
306
  "width",
@@ -288,79 +309,82 @@ var y = {
288
309
  "stroke",
289
310
  "stroke-width",
290
311
  "stroke-dasharray"
291
- ], jt = [
312
+ ], At = [
292
313
  "x",
293
314
  "y",
294
315
  "width",
295
316
  "height",
296
317
  "rx",
297
318
  "stroke"
298
- ], Mt = [
319
+ ], jt = [
299
320
  "transform",
300
321
  "fill",
301
322
  "font-size"
302
- ], Nt = ["dy"], Pt = [
323
+ ], Mt = ["dy"], Nt = [
303
324
  "r",
304
325
  "fill",
305
326
  "stroke",
306
327
  "stroke-width",
307
328
  "opacity"
308
- ], Ft = [
329
+ ], Pt = [
309
330
  "values",
310
331
  "dur",
311
332
  "begin"
312
- ], It = [
333
+ ], Ft = [
313
334
  "values",
314
335
  "keyTimes",
315
336
  "dur",
316
337
  "begin"
317
- ], Lt = [
338
+ ], It = [
339
+ "viewBox",
318
340
  "x",
319
341
  "y",
320
342
  "width",
321
343
  "height",
322
- "viewBox",
323
344
  "preserveAspectRatio"
324
- ], Rt = [
345
+ ], Lt = [
325
346
  "href",
326
347
  "x",
327
348
  "y",
328
349
  "width",
329
350
  "height"
330
- ], zt = ["transform"], Bt = ["fill"], Vt = ["transform"], Ht = ["fill"], Ut = [
351
+ ], Rt = {
352
+ key: 1,
353
+ class: "node-icon"
354
+ }, zt = ["fill"], Bt = ["transform"], Vt = ["fill"], Ht = [
331
355
  "y",
332
356
  "transform",
333
357
  "fill",
334
358
  "font-size",
335
359
  "font-weight"
336
- ], Wt = ["dy"], Gt = {
360
+ ], Ut = ["dy"], Wt = {
337
361
  key: 9,
338
362
  class: "node-handles"
339
- }, Kt = [
363
+ }, Gt = [
340
364
  "cx",
341
365
  "cy",
342
366
  "stroke",
343
367
  "onPointerdown"
344
- ], qt = {
368
+ ], Kt = {
345
369
  key: 4,
346
370
  class: "node-resize-layer"
347
- }, Jt = [
371
+ }, qt = [
348
372
  "x",
349
373
  "y",
350
374
  "onMousedown"
351
- ], Yt = {
375
+ ], Jt = {
352
376
  key: 0,
353
377
  "pointer-events": "none"
354
- }, Xt = [
378
+ }, Yt = [
355
379
  "d",
356
380
  "stroke",
357
381
  "marker-end"
358
- ], Zt = [
382
+ ], Xt = [
359
383
  "x",
360
384
  "y",
361
385
  "width",
362
386
  "height"
363
- ], Qt = 6, $t = 14, en = 3, tn = .2, nn = 5, rn = 160, an = 140, on = 12, sn = 4e3, cn = 12, ln = 4e3, un = 45, dn = 32, fn = {
387
+ ], Zt = 6, Qt = 14, $t = 3, en = .2, tn = 5, nn = 160, rn = 140, an = 12, on = 4e3, sn = 12, cn = 4e3, ln = 45, un = 32, dn = {
364
388
  __name: "Topology",
365
389
  props: {
366
390
  nodes: {
@@ -416,12 +440,13 @@ var y = {
416
440
  "node-drag-end",
417
441
  "node-resize-start",
418
442
  "node-resize-end",
419
- "delete-request"
443
+ "delete-request",
444
+ "zoom-change"
420
445
  ],
421
- setup(g, { expose: ie, emit: ae }) {
422
- let _ = g, v = ae, fn = 0, pn = () => {
423
- fn++;
424
- }, b = (e) => e && typeof e == "object" ? {
446
+ setup(_, { expose: re, emit: ie }) {
447
+ let v = _, y = ie, dn = 0, fn = () => {
448
+ dn++;
449
+ }, pn = (e) => e && typeof e == "object" ? {
425
450
  text: e.text,
426
451
  rotation: e.rotation || 0,
427
452
  fontSize: e.fontSize,
@@ -431,10 +456,10 @@ var y = {
431
456
  rotation: 0,
432
457
  fontSize: void 0,
433
458
  color: void 0
434
- }, mn = (e, t = 11) => e.fontSize || t, hn = (e) => e.fontColor || "#000000", gn = (e, t = 500) => e.fontWeight || t, _n = (e, t) => e.fontSize || b(t).fontSize || 8, vn = (e, t) => e.fontColor || b(t).color || t != null && t === e.centerText && ra.value || "#000000", x = f(_.nodes.map((e) => ({ ...e }))), yn = null, S = () => {
435
- yn = x.value, v("update:nodes", x.value);
459
+ }, mn = (e, t = 11) => e.fontSize || t, hn = (e) => e.fontColor || "#000000", gn = (e, t = 500) => e.fontWeight || t, _n = (e, t) => e.fontSize || pn(t).fontSize || 8, vn = (e, t) => e.fontColor || pn(t).color || t != null && t === e.centerText && ca.value || "#000000", x = f(v.nodes.map((e) => ({ ...e }))), yn = null, S = () => {
460
+ yn = x.value, y("update:nodes", x.value);
436
461
  };
437
- ne(() => _.nodes, (e) => {
462
+ h(() => v.nodes, (e) => {
438
463
  let t = Array.isArray(e) ? e : [];
439
464
  if (t === yn) return;
440
465
  let n = null, r = null;
@@ -443,22 +468,22 @@ var y = {
443
468
  } catch {
444
469
  n = null;
445
470
  }
446
- (n === null || n !== r) && (pn(), x.value = t.map((e) => ({ ...e })));
471
+ (n === null || n !== r) && (fn(), x.value = t.map((e) => ({ ...e })));
447
472
  }, { deep: !0 });
448
- let bn = f(_.lineMode);
449
- ne(() => _.lineMode, (e) => {
473
+ let bn = f(v.lineMode);
474
+ h(() => v.lineMode, (e) => {
450
475
  bn.value = e;
451
476
  });
452
477
  let xn = t({
453
478
  get: () => bn.value,
454
479
  set: (e) => {
455
- bn.value = e, v("update:lineMode", e);
480
+ bn.value = e, y("update:lineMode", e);
456
481
  }
457
482
  }), C = f(null), w = f(null), Sn = f({
458
483
  x: 0,
459
484
  y: 0
460
485
  }), Cn = f(null), wn = null, Tn = !1, En = !1, T = f([]), E = f(/* @__PURE__ */ new Map()), D = f(/* @__PURE__ */ new Set()), O = t(() => {
461
- let e = _.edges, t = [];
486
+ let e = v.edges, t = [];
462
487
  if (T.value.length) {
463
488
  let n = new Set(e.map((e) => e.id));
464
489
  t = T.value.filter((e) => !n.has(e.id));
@@ -470,7 +495,7 @@ var y = {
470
495
  } : e));
471
496
  let i = new Set(x.value.map((e) => e.id)), a = D.value;
472
497
  return n.filter((e) => !a.has(e.id) && i.has(e.from) && i.has(e.to));
473
- }), Dn = t(() => _.config.watchDataChanges === !0), On = f({
498
+ }), Dn = t(() => v.config.watchDataChanges === !0), On = f({
474
499
  nodes: [],
475
500
  edges: []
476
501
  }), kn = "", k = null, An = () => JSON.parse(JSON.stringify({
@@ -491,7 +516,7 @@ var y = {
491
516
  let e = An(), t = JSON.stringify(e);
492
517
  if (t === kn) return;
493
518
  let n = Mn(e), r = n.nodes.added.length + n.nodes.removed.length + n.nodes.updated.length + n.edges.added.length + n.edges.removed.length + n.edges.updated.length;
494
- kn = t, r && v("data-change", {
519
+ kn = t, r && y("data-change", {
495
520
  nodes: e.nodes,
496
521
  edges: e.edges,
497
522
  summary: n
@@ -501,18 +526,18 @@ var y = {
501
526
  }, Fn = () => {
502
527
  k &&= (clearTimeout(k), null), On.value = An(), kn = "";
503
528
  };
504
- ne([
529
+ h([
505
530
  x,
506
531
  T,
507
532
  D,
508
533
  E
509
- ], () => Pn(), { deep: !0 }), ne(Dn, (e) => {
534
+ ], () => Pn(), { deep: !0 }), h(Dn, (e) => {
510
535
  e ? Fn() : k &&= (clearTimeout(k), null);
511
536
  }), u(() => {
512
537
  Dn.value && Fn();
513
538
  });
514
539
  let In = () => An(), Ln = () => {
515
- let e = new Set(R.value), t = new Set(z.value);
540
+ let e = new Set(L.value), t = new Set(R.value);
516
541
  return {
517
542
  nodeIds: e,
518
543
  nodes: x.value.filter((t) => e.has(t.id)),
@@ -523,7 +548,7 @@ var y = {
523
548
  return !t.length && !n.length ? {
524
549
  nodes: [],
525
550
  edges: []
526
- } : (t.length && (x.value = x.value.filter((t) => !e.has(t.id)), S()), n.length && (D.value = /* @__PURE__ */ new Set([...D.value, ...n.map((e) => e.id)]), T.value = T.value.filter((e) => !D.value.has(e.id)), v("edge-remove", n.map((e) => JSON.parse(JSON.stringify(e))))), R.value = [], z.value = [], v("node-select", null), v("edge-select", null), B(), JSON.parse(JSON.stringify({
551
+ } : (t.length && (x.value = x.value.filter((t) => !e.has(t.id)), S()), n.length && (D.value = /* @__PURE__ */ new Set([...D.value, ...n.map((e) => e.id)]), T.value = T.value.filter((e) => !D.value.has(e.id)), y("edge-remove", n.map((e) => JSON.parse(JSON.stringify(e))))), L.value = [], R.value = [], y("node-select", null), y("edge-select", null), z(), JSON.parse(JSON.stringify({
527
552
  nodes: t,
528
553
  edges: n
529
554
  })));
@@ -537,19 +562,19 @@ var y = {
537
562
  return !!e && "onDeleteRequest" in e;
538
563
  }, Hn = () => {
539
564
  let { nodes: e, edges: t } = Ln();
540
- v("delete-request", JSON.parse(JSON.stringify({
565
+ y("delete-request", JSON.parse(JSON.stringify({
541
566
  nodes: e,
542
567
  edges: t
543
568
  })));
544
569
  }, Un = (e) => {
545
- e.key !== "Delete" && e.key !== "Backspace" || e.isComposing || e.ctrlKey || e.metaKey || e.altKey || _.config?.enableDeleteKey !== !1 && _.editable && (zn(e) || (R.value.length || z.value.length) && (C.value || Y.value || X.value || (e.preventDefault(), Vn() ? Hn() : Rn())));
570
+ e.key !== "Delete" && e.key !== "Backspace" || e.isComposing || e.ctrlKey || e.metaKey || e.altKey || v.config?.enableDeleteKey !== !1 && v.editable && (zn(e) || (L.value.length || R.value.length) && (C.value || Y.value || X.value || (e.preventDefault(), Vn() ? Hn() : Rn())));
546
571
  };
547
572
  u(() => window.addEventListener("keydown", Un)), l(() => window.removeEventListener("keydown", Un));
548
573
  let Wn = (e) => {
549
574
  let t = (Array.isArray(e) ? e : [e]).filter((e) => e && typeof e == "object"), n = new Set(x.value.map((e) => e.id)), r = [];
550
575
  for (let e of t) {
551
576
  let t = JSON.parse(JSON.stringify(e));
552
- if (t.id == null) t.id = oe();
577
+ if (t.id == null) t.id = ae();
553
578
  else if (n.has(t.id)) continue;
554
579
  n.add(t.id), r.push(t);
555
580
  }
@@ -559,7 +584,7 @@ var y = {
559
584
  for (let e of t) {
560
585
  let t = JSON.parse(JSON.stringify(e));
561
586
  if (t.from != null && t.to != null) {
562
- if (t.id == null) t.id = oe();
587
+ if (t.id == null) t.id = ae();
563
588
  else if (n.has(t.id)) continue;
564
589
  n.add(t.id), r.push(t);
565
590
  }
@@ -570,7 +595,7 @@ var y = {
570
595
  let e = new Set(i.map((e) => e.id));
571
596
  D.value = new Set([...D.value].filter((t) => !e.has(t)));
572
597
  }
573
- return T.value = [...T.value, ...r], r.forEach((e) => v("edge-create", JSON.parse(JSON.stringify(e)))), JSON.parse(JSON.stringify(r));
598
+ return T.value = [...T.value, ...r], r.forEach((e) => y("edge-create", JSON.parse(JSON.stringify(e)))), JSON.parse(JSON.stringify(r));
574
599
  }, Kn = (e) => {
575
600
  let t = (Array.isArray(e) ? e : [e]).filter((e) => e && e.id != null);
576
601
  if (!t.length) return [];
@@ -613,13 +638,13 @@ var y = {
613
638
  ...s
614
639
  });
615
640
  }
616
- return i.length ? (E.value = r, v("edge-update", JSON.parse(JSON.stringify(i))), JSON.parse(JSON.stringify(i))) : [];
641
+ return i.length ? (E.value = r, y("edge-update", JSON.parse(JSON.stringify(i))), JSON.parse(JSON.stringify(i))) : [];
617
642
  }, Jn = (e) => {
618
643
  let t = e && typeof e == "object" ? e : null;
619
- return T.value = [], D.value = /* @__PURE__ */ new Set(), E.value = /* @__PURE__ */ new Map(), t && Array.isArray(t.nodes) ? (x.value = JSON.parse(JSON.stringify(t.nodes)), S()) : (x.value = (Array.isArray(_.nodes) ? _.nodes : []).map((e) => ({ ...e })), yn = x.value), R.value = [], z.value = [], v("node-select", null), v("edge-select", null), B(), Fn(), An();
644
+ return T.value = [], D.value = /* @__PURE__ */ new Set(), E.value = /* @__PURE__ */ new Map(), t && Array.isArray(t.nodes) ? (x.value = JSON.parse(JSON.stringify(t.nodes)), S()) : (x.value = (Array.isArray(v.nodes) ? v.nodes : []).map((e) => ({ ...e })), yn = x.value), L.value = [], R.value = [], y("node-select", null), y("edge-select", null), z(), Fn(), An();
620
645
  };
621
- ne(() => _.edges, (e) => {
622
- pn();
646
+ h(() => v.edges, (e) => {
647
+ fn();
623
648
  let t = Array.isArray(e) ? e : [], n = new Set(t.map((e) => e.id));
624
649
  if (T.value.length) {
625
650
  let e = T.value.filter((e) => !n.has(e.id));
@@ -634,7 +659,7 @@ var y = {
634
659
  r && (E.value = e);
635
660
  }
636
661
  }, { deep: !0 });
637
- let A = t(() => {
662
+ let Yn = t(() => {
638
663
  let e = {};
639
664
  O.value.forEach((t) => {
640
665
  let n = [t.from, t.to].sort().join("__");
@@ -643,7 +668,7 @@ var y = {
643
668
  let t = {};
644
669
  return Object.entries(e).forEach(([e, n]) => {
645
670
  let r = n.length;
646
- r > Qt ? n.forEach((n, i) => {
671
+ r > Zt ? n.forEach((n, i) => {
647
672
  t[n.id] = i === 0 ? {
648
673
  key: e,
649
674
  index: 0,
@@ -672,78 +697,74 @@ var y = {
672
697
  };
673
698
  });
674
699
  }), t;
675
- }), Yn = t(() => {
700
+ }), Xn = t(() => {
676
701
  let e = /* @__PURE__ */ new Map();
677
702
  for (let t of x.value) e.set(t.id, t);
678
703
  return e;
679
- }), j = (e) => Yn.value.get(e), M = (e) => e.state != "none" && y[e.state] && y[e.state].color || "#00f0ff", Xn = (e) => y[e.state] || y.normal, Zn = (e) => e.nodeType === "text", Qn = (e) => e.nodeType === "border-only", N = (e) => e.nodeType === "region", $n = (e) => e.background || "#f60f60", er = (e) => e.borderStyle !== "none", tr = (e) => {
704
+ }), A = (e) => Xn.value.get(e), j = (e) => e.state != "none" && b[e.state] && b[e.state].color || "#00f0ff", Zn = (e) => b[e.state] || b.normal, Qn = (e) => e.nodeType === "text", $n = (e) => e.nodeType === "border-only", M = (e) => e.nodeType === "region", er = (e) => e.background || "#f60f60", tr = (e) => e.borderStyle !== "none", nr = (e) => {
680
705
  let t = Number(e.borderWidth);
681
706
  return Number.isFinite(t) && t > 0 ? t : 1.5;
682
- }, nr = (e, t) => {
707
+ }, rr = (e, t) => {
683
708
  let n = Number(e);
684
709
  return Number.isFinite(n) && n > 0 ? n : t;
685
- }, rr = t(() => nr(_.config?.baseIconWidth, 60)), ir = t(() => nr(_.config?.baseIconHeight, 60)), ar = [
710
+ }, ir = t(() => rr(v.config?.baseIconWidth, 60)), ar = t(() => rr(v.config?.baseIconHeight, 60)), or = [
686
711
  "image",
687
712
  "img",
688
713
  "picture"
689
- ], or = (e) => {
714
+ ], sr = (e) => {
690
715
  if (!e) return "";
691
716
  let t = e.image ?? e.src ?? e.img ?? e.imageUrl;
692
717
  return typeof t == "string" && t.trim() ? t.trim() : "";
693
- }, sr = (e) => e ? ar.includes(String(e.nodeType ?? "").toLowerCase()) ? !0 : (_.config?.imageNodeBySource || !e.nodeType) && !!or(e) : !1, cr = t(() => _.config?.imageFit === "cover" ? "cover" : "contain"), lr = t(() => cr.value === "contain" ? "xMidYMid meet" : "xMidYMid slice"), ur = t(() => `${-rr.value / 2} ${-ir.value / 2} ${rr.value} ${ir.value}`), dr = /* @__PURE__ */ new Map(), fr = f(0), pr = (e) => {
694
- if (!e || dr.has(e) || typeof Image > "u") return;
695
- dr.set(e, null);
718
+ }, cr = (e) => e ? or.includes(String(e.nodeType ?? "").toLowerCase()) ? !0 : (v.config?.imageNodeBySource || !e.nodeType) && !!sr(e) : !1, lr = t(() => v.config?.imageFit === "cover" ? "cover" : "contain"), ur = t(() => lr.value === "contain" ? "xMidYMid meet" : "xMidYMid slice"), dr = t(() => `${-ir.value / 2} ${-ar.value / 2} ${ir.value} ${ar.value}`), fr = /* @__PURE__ */ new Map(), pr = f(0), mr = (e) => {
719
+ if (!e || fr.has(e) || typeof Image > "u") return;
720
+ fr.set(e, null);
696
721
  let t = new Image();
697
722
  t.onload = () => {
698
- dr.set(e, {
723
+ fr.set(e, {
699
724
  w: t.naturalWidth || 1,
700
725
  h: t.naturalHeight || 1
701
- }), fr.value++;
726
+ }), pr.value++;
702
727
  }, t.onerror = () => {
703
- dr.set(e, {
728
+ fr.set(e, {
704
729
  w: 1,
705
730
  h: 1
706
- }), fr.value++;
731
+ }), pr.value++;
707
732
  }, t.src = e;
708
- }, mr = (e) => {
709
- fr.value;
710
- let t = or(e), n = t ? dr.get(t) : null, { w: r, h: i } = F(e);
733
+ }, hr = (e) => {
734
+ pr.value;
735
+ let t = sr(e), n = t ? fr.get(t) : null, { w: r, h: i } = P(e);
711
736
  if (!n) return {
712
737
  w: r,
713
738
  h: i
714
739
  };
715
- let a = n.w, o = n.h, s, c = rr.value, l = ir.value;
716
- if (cr.value === "contain") s = Math.min(c / a, l / o);
740
+ let a = n.w, o = n.h, s, c = ir.value, l = ar.value;
741
+ if (lr.value === "contain") s = Math.min(c / a, l / o);
717
742
  else {
718
743
  let e = Math.max(r / c, i / l);
719
- s = Math.max(r / e / a, i / e / o);
744
+ s = Math.min(r / e / a, i / e / o);
720
745
  }
721
746
  return {
722
747
  w: a * s,
723
748
  h: o * s
724
749
  };
725
750
  };
726
- re(() => {
727
- for (let e of x.value) sr(e) && pr(or(e));
751
+ ne(() => {
752
+ for (let e of x.value) cr(e) && mr(sr(e));
728
753
  });
729
- let hr = (e, t) => {
754
+ let gr = (e, t) => {
730
755
  let n = Number(e);
731
756
  return Number.isFinite(n) && n > 0 ? n : t;
732
- }, gr = (e) => {
733
- let t = hr(e.width, rr.value), n = hr(e.height, ir.value);
734
- return {
735
- sx: t / rr.value,
736
- sy: n / ir.value
737
- };
738
757
  }, _r = (e) => {
739
- let { w: t, h: n } = F(e), r = Math.min(t, n) / 2;
758
+ let { w: t, h: n } = P(e), r = Math.min(t, n) / 2;
740
759
  return Number.isFinite(r) && r > 0 ? r : 30;
741
760
  }, vr = [
742
- "warning",
743
- "error",
744
- "master"
761
+ "master",
762
+ "expert",
763
+ "advanced",
764
+ "awakened",
765
+ "dormant"
745
766
  ], yr = t(() => {
746
- let e = _.config.alertStates;
767
+ let e = v.config.alertStates;
747
768
  return Array.isArray(e) && e.length ? e.map((e) => String(e)) : vr;
748
769
  }), br = (e) => !!e && e.state != null && yr.value.includes(String(e.state)), xr = {
749
770
  warning: {
@@ -778,7 +799,7 @@ var y = {
778
799
  "fill",
779
800
  "ripple",
780
801
  "blink"
781
- ], Tr = t(() => wr.includes(_.config.alertStyle) ? _.config.alertStyle : "ring"), Er = (e) => wr.includes(e?.alertStyle) ? e.alertStyle : Tr.value, P = (e) => Number(Number(e).toFixed(2)), Dr = (e, t = .1) => `${P(e)};${P(e * t)};${P(e)}`, Or = [
802
+ ], Tr = t(() => wr.includes(v.config.alertStyle) ? v.config.alertStyle : "ring"), Er = (e) => wr.includes(e?.alertStyle) ? e.alertStyle : Tr.value, N = (e) => Number(Number(e).toFixed(2)), Dr = (e, t = .1) => `${N(e)};${N(e * t)};${N(e)}`, Or = [
782
803
  {
783
804
  offset: "0%",
784
805
  opacity: 1
@@ -818,7 +839,7 @@ var y = {
818
839
  }
819
840
  ], Ar = (e) => String(e).replace(/[^a-zA-Z0-9]/g, ""), jr = t(() => {
820
841
  let e = /* @__PURE__ */ new Map();
821
- for (let t of Object.values(y)) {
842
+ for (let t of Object.values(b)) {
822
843
  let n = Ar(t.color);
823
844
  n && !e.has(n) && e.set(n, t.color);
824
845
  }
@@ -833,37 +854,40 @@ var y = {
833
854
  stops: kr
834
855
  });
835
856
  return t;
836
- }), Mr = t(() => _.config.alertGlow !== !1), Nr = (e) => {
837
- if (!la.value || !br(e)) return [];
838
- let t = Sr(e), n = Xn(e).color, r = P(_r(e)), i = t.dur, a = P(Cr(e)), o = Er(e);
857
+ }), Mr = t(() => v.config.alertGlow !== !1), Nr = t(() => {
858
+ let e = Number(v.config?.alertFillScale);
859
+ return Number.isFinite(e) && e > 0 ? e : 1.15;
860
+ }), Pr = (e) => {
861
+ if (!ma.value || !br(e)) return [];
862
+ let t = Sr(e), n = Zn(e).color, r = N(_r(e)), i = t.dur, a = N(Cr(e)), o = Er(e);
839
863
  if (o === "fill") {
840
- let o = Ar(n), s = P(t.opacity * .55), c = r * (1 + (t.scale - 1) * .55), l = {
864
+ let o = Ar(n), s = N(t.opacity * .55), c = N(r * Nr.value), l = c * (1 + (t.scale - 1) * .55), u = {
841
865
  key: "fill",
842
- r,
866
+ r: c,
843
867
  fill: Mr.value ? `url(#alert-fill-${o})` : n,
844
868
  stroke: "none",
845
869
  strokeWidth: 0,
846
870
  opacity: s,
847
- rValues: `${r};${P(c)};${r}`,
871
+ rValues: `${c};${N(l)};${c}`,
848
872
  opacityValues: Dr(s),
849
873
  keyTimes: null,
850
- dur: `${P(i)}s`,
874
+ dur: `${N(i)}s`,
851
875
  begin: `${a}s`
852
876
  };
853
- if (!Mr.value) return [l];
854
- let u = P(r * 1.04), d = P(c * 1.14), f = P(Math.min(.95, t.opacity * 1.6));
855
- return [l, {
877
+ if (!Mr.value) return [u];
878
+ let d = N(c * 1.04), f = N(l * 1.14), p = N(Math.min(.95, t.opacity * 1.6));
879
+ return [u, {
856
880
  key: "fill-glow",
857
- r: u,
881
+ r: d,
858
882
  fill: `url(#alert-glow-${o})`,
859
883
  stroke: "none",
860
884
  strokeWidth: 0,
861
- opacity: f,
862
- rValues: `${u};${d};${u}`,
863
- opacityValues: Dr(f),
885
+ opacity: p,
886
+ rValues: `${d};${f};${d}`,
887
+ opacityValues: Dr(p),
864
888
  keyTimes: null,
865
- dur: `${P(i * 1.15)}s`,
866
- begin: `${P(Cr(e, 1.15))}s`
889
+ dur: `${N(i * 1.15)}s`,
890
+ begin: `${N(Cr(e, 1.15))}s`
867
891
  }];
868
892
  }
869
893
  if (o === "ripple") {
@@ -873,7 +897,7 @@ var y = {
873
897
  1,
874
898
  2
875
899
  ].map((i) => {
876
- let o = P(r * (.92 + i * .02)), s = P(t.opacity * (1 - i * .15));
900
+ let o = N(r * (.92 + i * .02)), s = N(t.opacity * (1 - i * .15));
877
901
  return {
878
902
  key: `ripple-${i}`,
879
903
  r: o,
@@ -881,19 +905,19 @@ var y = {
881
905
  stroke: n,
882
906
  strokeWidth: 1.8,
883
907
  opacity: s,
884
- rValues: `${o};${P(r * t.scale)};${o}`,
908
+ rValues: `${o};${N(r * t.scale)};${o}`,
885
909
  opacityValues: `${s};0;${s}`,
886
910
  keyTimes: null,
887
- dur: `${P(e)}s`,
888
- begin: `${P(a - e * i / 3)}s`
911
+ dur: `${N(e)}s`,
912
+ begin: `${N(a - e * i / 3)}s`
889
913
  };
890
914
  });
891
915
  }
892
916
  if (o === "blink") {
893
- let e = P(Math.min(.9, t.opacity * 1.7)), o = Math.max(.8, i * .8);
917
+ let e = N(Math.min(.9, t.opacity * 1.7)), o = Math.max(.8, i * .8);
894
918
  return [{
895
919
  key: "blink",
896
- r: P(r * 1.06),
920
+ r: N(r * 1.06),
897
921
  fill: "none",
898
922
  stroke: n,
899
923
  strokeWidth: 3,
@@ -901,7 +925,7 @@ var y = {
901
925
  rValues: null,
902
926
  opacityValues: `${e};${e};0.04;${e};${e};0.04;${e}`,
903
927
  keyTimes: "0;0.18;0.22;0.4;0.58;0.62;1",
904
- dur: `${P(o)}s`,
928
+ dur: `${N(o)}s`,
905
929
  begin: `${a}s`
906
930
  }];
907
931
  }
@@ -911,15 +935,15 @@ var y = {
911
935
  fill: "none",
912
936
  stroke: n,
913
937
  strokeWidth: 2.5,
914
- opacity: P(t.opacity),
915
- rValues: `${r};${P(r * t.scale)};${r}`,
938
+ opacity: N(t.opacity),
939
+ rValues: `${r};${N(r * t.scale)};${r}`,
916
940
  opacityValues: Dr(t.opacity),
917
941
  keyTimes: null,
918
- dur: `${P(i)}s`,
942
+ dur: `${N(i)}s`,
919
943
  begin: `${a}s`
920
944
  }];
921
945
  if (t.ripple) {
922
- let a = P(r * 1.12), o = P(t.opacity * .45);
946
+ let a = N(r * 1.12), o = N(t.opacity * .45);
923
947
  s.push({
924
948
  key: "ring-ripple",
925
949
  r: a,
@@ -927,22 +951,19 @@ var y = {
927
951
  stroke: n,
928
952
  strokeWidth: 1.5,
929
953
  opacity: o,
930
- rValues: `${a};${P(r * (t.scale - .12))};${a}`,
954
+ rValues: `${a};${N(r * (t.scale - .12))};${a}`,
931
955
  opacityValues: Dr(o),
932
956
  keyTimes: null,
933
- dur: `${P(i * 1.25)}s`,
934
- begin: `${P(Cr(e, 1.25))}s`
957
+ dur: `${N(i * 1.25)}s`,
958
+ begin: `${N(Cr(e, 1.25))}s`
935
959
  });
936
960
  }
937
961
  return s;
938
- }, Pr = t(() => x.value.filter((e) => br(e)).length), Fr = (e) => {
939
- let { sx: t, sy: n } = gr(e);
940
- return t === 1 && n === 1 ? "" : `scale(${t}, ${n})`;
941
- }, Ir = (e) => {
942
- let { w: t, h: n } = F(e), r = Math.min(10, t * .3), i = Math.min(10, n * .3);
962
+ }, Fr = t(() => x.value.filter((e) => br(e)).length), Ir = (e) => {
963
+ let { w: t, h: n } = P(e), r = Math.min(10, t * .3), i = Math.min(10, n * .3);
943
964
  return `translate(${t / 2 - r}, ${-(n / 2 - i)})`;
944
965
  }, Lr = t(() => {
945
- let e = Number(_.config.labelGap);
966
+ let e = Number(v.config.labelGap);
946
967
  return Number.isFinite(e) && e >= 0 ? e : 18;
947
968
  }), Rr = [
948
969
  "top",
@@ -951,15 +972,15 @@ var y = {
951
972
  ], zr = (e) => {
952
973
  let t = e?.labelPosition;
953
974
  if (Rr.includes(t)) return t;
954
- let n = _.config.nodeLabelPosition;
975
+ let n = v.config.nodeLabelPosition;
955
976
  return Rr.includes(n) ? n : "bottom";
956
977
  }, Br = (e) => {
957
- if (Zn(e)) return 4;
958
- let { h: t } = F(e), n = zr(e);
978
+ if (Qn(e)) return 4;
979
+ let { h: t } = P(e), n = zr(e);
959
980
  return n === "top" ? -(t / 2 + Lr.value) : n === "center" ? 0 : t / 2 + Lr.value;
960
981
  }, Vr = (e) => {
961
- let t = I(e);
962
- if (Zn(e) || !e.label) return t;
982
+ let t = F(e);
983
+ if (Qn(e) || !e.label) return t;
963
984
  let n = mn(e), r = Br(e), i = zr(e);
964
985
  if (i === "top") {
965
986
  let e = r - n - 4;
@@ -969,65 +990,65 @@ var y = {
969
990
  i > t.y + t.height && (t.height = i - t.y);
970
991
  }
971
992
  return t;
972
- }, Hr = (e) => e.borderStyle !== "none" && (e.borderColor !== void 0 || e.borderWidth !== void 0 || e.borderStyle !== void 0), F = (e) => {
973
- let t = Zn(e), n = Qn(e), r = N(e);
993
+ }, Hr = (e) => e.borderStyle !== "none" && (e.borderColor !== void 0 || e.borderWidth !== void 0 || e.borderStyle !== void 0), P = (e) => {
994
+ let t = Qn(e), n = $n(e), r = M(e);
974
995
  return {
975
- w: hr(e.width, t ? Math.max(60, String(e.label).length * 7 + 16) : r ? 240 : n ? Math.max(80, String(e.label).length * 8 + 24) : rr.value),
976
- h: hr(e.height, t ? 26 : r ? 160 : n ? 40 : ir.value)
996
+ w: gr(e.width, t ? Math.max(60, String(e.label).length * 7 + 16) : r ? 240 : n ? Math.max(80, String(e.label).length * 8 + 24) : ir.value),
997
+ h: gr(e.height, t ? 26 : r ? 160 : n ? 40 : ar.value)
977
998
  };
978
- }, I = (e) => {
979
- let { w: t, h: n } = F(e);
999
+ }, F = (e) => {
1000
+ let { w: t, h: n } = P(e);
980
1001
  return {
981
1002
  x: -t / 2,
982
1003
  y: -n / 2,
983
1004
  width: t,
984
1005
  height: n
985
1006
  };
986
- }, L = (e) => N(e) ? null : Hr(e) ? I(e) : null, Ur = (e) => !N(e) && e.background && e.background !== "none" ? e.background : null, R = f([]), z = f([]);
987
- t(() => R.value.length === 1 ? R.value[0] : null), t(() => z.value.length === 1 ? z.value[0] : null);
988
- let Wr = (e) => R.value.includes(e.id), Gr = (e) => z.value.includes(e.id), B = () => {
989
- v("selection-change", {
990
- nodes: x.value.filter((e) => R.value.includes(e.id)),
991
- edges: O.value.filter((e) => z.value.includes(e.id))
1007
+ }, I = (e) => M(e) ? null : Hr(e) ? F(e) : null, Ur = (e) => !M(e) && e.background && e.background !== "none" ? e.background : null, L = f([]), R = f([]);
1008
+ t(() => L.value.length === 1 ? L.value[0] : null), t(() => R.value.length === 1 ? R.value[0] : null);
1009
+ let Wr = (e) => L.value.includes(e.id), Gr = (e) => R.value.includes(e.id), z = () => {
1010
+ y("selection-change", {
1011
+ nodes: x.value.filter((e) => L.value.includes(e.id)),
1012
+ edges: O.value.filter((e) => R.value.includes(e.id))
992
1013
  });
993
- }, Kr = (e) => typeof e == "number" ? Number.isFinite(e) && e >= 0 ? Math.floor(e) : Infinity : typeof e == "string" && /^\d+$/.test(e.trim()) ? parseInt(e.trim(), 10) : Infinity, qr = t(() => Kr(_.config.maxSelectNodes)), Jr = t(() => Kr(_.config.maxSelectEdges)), V = (e, t, n) => {
1014
+ }, Kr = (e) => typeof e == "number" ? Number.isFinite(e) && e >= 0 ? Math.floor(e) : Infinity : typeof e == "string" && /^\d+$/.test(e.trim()) ? parseInt(e.trim(), 10) : Infinity, qr = t(() => Kr(v.config.maxSelectNodes)), Jr = t(() => Kr(v.config.maxSelectEdges)), B = (e, t, n) => {
994
1015
  let r = new Set(e), i = [];
995
1016
  for (let e of t) r.has(e) || (r.add(e), i.push(e));
996
1017
  if (n === Infinity) return [...e, ...i];
997
1018
  let a = Math.max(0, n - e.length);
998
1019
  return [...e, ...i.slice(0, a)];
999
1020
  };
1000
- ne([qr, Jr], ([e, t]) => {
1021
+ h([qr, Jr], ([e, t]) => {
1001
1022
  let n = !1;
1002
- R.value.length > e && (R.value = R.value.slice(0, e), n = !0), z.value.length > t && (z.value = z.value.slice(0, t), n = !0), n && B();
1023
+ L.value.length > e && (L.value = L.value.slice(0, e), n = !0), R.value.length > t && (R.value = R.value.slice(0, t), n = !0), n && z();
1003
1024
  });
1004
- let Yr = t(() => _.config.selectedBorderColor || "#fbbf24"), Xr = t(() => _.config?.edgeLayer !== "below"), Zr = t(() => _.config?.highlightEdgeOnTop !== !1), Qr = (e, t) => {
1025
+ let Yr = t(() => v.config.selectedBorderColor || "#fbbf24"), Xr = t(() => v.config?.edgeLayer !== "below"), Zr = t(() => v.config?.highlightEdgeOnTop !== !1), Qr = (e, t) => {
1005
1026
  if (!ci()) {
1006
1027
  if (t && (t.ctrlKey || t.metaKey)) {
1007
- let t = R.value.indexOf(e.id);
1008
- t >= 0 ? R.value.splice(t, 1) : R.value = V(R.value, [e.id], qr.value);
1028
+ let t = L.value.indexOf(e.id);
1029
+ t >= 0 ? L.value.splice(t, 1) : L.value = B(L.value, [e.id], qr.value);
1009
1030
  } else {
1010
- let t = R.value.length === 1 && R.value[0] === e.id;
1011
- R.value = t ? [] : V([], [e.id], qr.value), z.value = [];
1031
+ let t = L.value.length === 1 && L.value[0] === e.id;
1032
+ L.value = t ? [] : B([], [e.id], qr.value), R.value = [];
1012
1033
  }
1013
- v("node-click", e), v("node-select", Wr(e) ? e : null), B();
1034
+ y("node-click", e), y("node-select", Wr(e) ? e : null), z();
1014
1035
  }
1015
1036
  }, $r = (e) => {
1016
1037
  let t = x.value.find((t) => t.id === e);
1017
- if (!t || _.config.enableZOrder === !1) return !1;
1038
+ if (!t || v.config.enableZOrder === !1) return !1;
1018
1039
  let n = t.zIndex ?? 0, r = x.value.filter((e) => (e.zIndex ?? 0) > n);
1019
1040
  return r.length !== 0 && (t.zIndex = Math.min(...r.map((e) => e.zIndex ?? 0)), !0);
1020
1041
  }, ei = (e) => {
1021
1042
  let t = x.value.find((t) => t.id === e);
1022
- if (!t || _.config.enableZOrder === !1) return !1;
1043
+ if (!t || v.config.enableZOrder === !1) return !1;
1023
1044
  let n = t.zIndex ?? 0, r = x.value.filter((e) => (e.zIndex ?? 0) < n);
1024
1045
  return r.length !== 0 && (t.zIndex = Math.max(...r.map((e) => e.zIndex ?? 0)), !0);
1025
1046
  }, ti = (e) => {
1026
1047
  let t = x.value.find((t) => t.id === e);
1027
- return !t || _.config.enableZOrder === !1 ? !1 : (t.zIndex = Math.max(...x.value.map((e) => e.zIndex ?? 0), 0) + 1, !0);
1048
+ return !t || v.config.enableZOrder === !1 ? !1 : (t.zIndex = Math.max(...x.value.map((e) => e.zIndex ?? 0), 0) + 1, !0);
1028
1049
  }, ni = (e) => {
1029
1050
  let t = x.value.find((t) => t.id === e);
1030
- return !t || _.config.enableZOrder === !1 ? !1 : (t.zIndex = Math.min(...x.value.map((e) => e.zIndex ?? 0), 0) - 1, !0);
1051
+ return !t || v.config.enableZOrder === !1 ? !1 : (t.zIndex = Math.min(...x.value.map((e) => e.zIndex ?? 0), 0) - 1, !0);
1031
1052
  }, ri = () => {
1032
1053
  if (!w.value) return;
1033
1054
  let e = w.value.cloneNode(!0);
@@ -1036,25 +1057,25 @@ var y = {
1036
1057
  t = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + t;
1037
1058
  let n = new Blob([t], { type: "image/svg+xml;charset=utf-8" }), r = URL.createObjectURL(n), i = document.createElement("a");
1038
1059
  i.href = r, i.download = `topology-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 10)}.svg`, document.body.appendChild(i), i.click(), document.body.removeChild(i), URL.revokeObjectURL(r);
1039
- }, ii = t(() => _.config.selectedLineColor || "#fbbf24"), ai = (e, t) => {
1060
+ }, ii = t(() => v.config.selectedLineColor || "#fbbf24"), ai = (e, t) => {
1040
1061
  if (ci()) return;
1041
- let n = A.value[e.id], r = !!(n && n.merged && n.representative), i = r ? O.value.filter((e) => {
1042
- let t = A.value[e.id];
1062
+ let n = Yn.value[e.id], r = !!(n && n.merged && n.representative), i = r ? O.value.filter((e) => {
1063
+ let t = Yn.value[e.id];
1043
1064
  return t && t.key === n.key;
1044
1065
  }) : null, a = r ? i.map((e) => e.id) : [e.id], o = r ? {
1045
1066
  ...e,
1046
1067
  bundleEdges: i
1047
1068
  } : e;
1048
- if (t && (t.ctrlKey || t.metaKey)) a.every((e) => z.value.includes(e)) ? z.value = z.value.filter((e) => !a.includes(e)) : z.value = V(z.value, a, Jr.value);
1069
+ if (t && (t.ctrlKey || t.metaKey)) a.every((e) => R.value.includes(e)) ? R.value = R.value.filter((e) => !a.includes(e)) : R.value = B(R.value, a, Jr.value);
1049
1070
  else {
1050
- let e = a.length === z.value.length && a.every((e) => z.value.includes(e));
1051
- z.value = e ? [] : V([], a, Jr.value), R.value = [];
1071
+ let e = a.length === R.value.length && a.every((e) => R.value.includes(e));
1072
+ R.value = e ? [] : B([], a, Jr.value), L.value = [];
1052
1073
  }
1053
- v("edge-select", Gr(e) ? o : null), B();
1074
+ y("edge-select", Gr(e) ? o : null), z();
1054
1075
  }, oi = 0, si = (e = 200) => {
1055
1076
  oi = performance.now() + e;
1056
1077
  }, ci = () => performance.now() < oi, li = () => {
1057
- R.value = [], z.value = [], v("node-select", null), v("edge-select", null), B();
1078
+ L.value = [], R.value = [], y("node-select", null), y("edge-select", null), z();
1058
1079
  }, ui = (e) => {
1059
1080
  if (ci()) return;
1060
1081
  let t = e.target;
@@ -1062,7 +1083,32 @@ var y = {
1062
1083
  }, di = f({
1063
1084
  width: 1e3,
1064
1085
  height: 650
1065
- }), fi = f(1), pi = f(0), mi = f(0), hi = t(() => -_i.value / 2 + pi.value), gi = t(() => -vi.value / 2 + mi.value), _i = t(() => _.width ?? di.value.width), vi = t(() => _.height ?? di.value.height), yi = null;
1086
+ }), V = f(1), fi = f(0), pi = f(0), mi = (e) => Math.min(tn, Math.max(en, e));
1087
+ h(() => v.config.zoom, (e) => {
1088
+ typeof e != "number" || !Number.isFinite(e) || e <= 0 || (V.value = mi(e), y("zoom-change", V.value));
1089
+ }, { immediate: !0 });
1090
+ let hi = (e) => {
1091
+ typeof e != "number" || !Number.isFinite(e) || e <= 0 || (V.value = mi(e), y("zoom-change", V.value));
1092
+ }, gi = () => {
1093
+ let e = x.value.filter((e) => !M(e));
1094
+ if (!e.length) return {
1095
+ x: 0,
1096
+ y: 0
1097
+ };
1098
+ let t = Infinity, n = Infinity, r = -Infinity, i = -Infinity;
1099
+ for (let a of e) {
1100
+ let { w: e, h: o } = P(a);
1101
+ t = Math.min(t, a.x - e / 2), r = Math.max(r, a.x + e / 2), n = Math.min(n, a.y - o / 2), i = Math.max(i, a.y + o / 2);
1102
+ }
1103
+ return {
1104
+ x: (t + r) / 2,
1105
+ y: (n + i) / 2
1106
+ };
1107
+ }, _i = () => {
1108
+ V.value = 1;
1109
+ let e = gi();
1110
+ fi.value = e.x, pi.value = e.y, y("zoom-change", V.value);
1111
+ }, vi = t(() => -bi.value / 2 + fi.value), yi = t(() => -xi.value / 2 + pi.value), bi = t(() => v.width ?? di.value.width), xi = t(() => v.height ?? di.value.height), Si = null;
1066
1112
  u(() => {
1067
1113
  let e = w.value;
1068
1114
  if (e) {
@@ -1072,42 +1118,42 @@ var y = {
1072
1118
  height: t.height
1073
1119
  });
1074
1120
  }
1075
- e && typeof ResizeObserver < "u" && (yi = new ResizeObserver(() => {
1121
+ e && typeof ResizeObserver < "u" && (Si = new ResizeObserver(() => {
1076
1122
  let t = e.getBoundingClientRect();
1077
1123
  t.width > 0 && t.height > 0 && (di.value = {
1078
1124
  width: t.width,
1079
1125
  height: t.height
1080
1126
  });
1081
- }), yi.observe(e));
1127
+ }), Si.observe(e));
1082
1128
  }), l(() => {
1083
- yi &&= (yi.disconnect(), null), ha &&= (cancelAnimationFrame(ha), 0), Fi &&= (cancelAnimationFrame(Fi), 0), za &&= (cancelAnimationFrame(za), 0), Ka(), Vi();
1129
+ Si &&= (Si.disconnect(), null), ba &&= (cancelAnimationFrame(ba), 0), Ri &&= (cancelAnimationFrame(Ri), 0), Wa &&= (cancelAnimationFrame(Wa), 0), Za(), Wi();
1084
1130
  });
1085
- let H = t(() => _i.value / fi.value), U = t(() => vi.value / fi.value), bi = t(() => ({
1086
- x0: hi.value - rn,
1087
- y0: gi.value - rn,
1088
- x1: hi.value + H.value + rn,
1089
- y1: gi.value + U.value + rn
1090
- })), xi = t(() => {
1091
- let e = bi.value, t = x.value.filter((t) => {
1092
- let { w: n, h: r } = F(t);
1131
+ let H = t(() => bi.value / V.value), U = t(() => xi.value / V.value), Ci = t(() => ({
1132
+ x0: vi.value - nn,
1133
+ y0: yi.value - nn,
1134
+ x1: vi.value + H.value + nn,
1135
+ y1: yi.value + U.value + nn
1136
+ })), wi = t(() => {
1137
+ let e = Ci.value, t = x.value.filter((t) => {
1138
+ let { w: n, h: r } = P(t);
1093
1139
  return t.x + n / 2 >= e.x0 && t.x - n / 2 <= e.x1 && t.y + r / 2 >= e.y0 && t.y - r / 2 <= e.y1;
1094
1140
  });
1095
- return _.config.enableZOrder !== !1 && t.sort((e, t) => (e.zIndex ?? 0) - (t.zIndex ?? 0)), t;
1096
- }), Si = t(() => xi.value.filter((e) => N(e))), Ci = t(() => xi.value.filter((e) => !N(e))), W = t(() => {
1097
- let e = bi.value;
1141
+ return v.config.enableZOrder !== !1 && t.sort((e, t) => (e.zIndex ?? 0) - (t.zIndex ?? 0)), t;
1142
+ }), Ti = t(() => wi.value.filter((e) => M(e))), Ei = t(() => wi.value.filter((e) => !M(e))), W = t(() => {
1143
+ let e = Ci.value;
1098
1144
  return O.value.filter((t) => {
1099
- if (!co(t)) return !1;
1100
- let n = j(t.from), r = j(t.to);
1145
+ if (!mo(t)) return !1;
1146
+ let n = A(t.from), r = A(t.to);
1101
1147
  if (!n || !r) return !1;
1102
- let i = F(n).w / 2, a = F(n).h / 2, o = F(r).w / 2, s = F(r).h / 2;
1103
- return Math.min(n.x - i, r.x - o) - an <= e.x1 && Math.max(n.x + i, r.x + o) + an >= e.x0 && Math.min(n.y - a, r.y - s) - an <= e.y1 && Math.max(n.y + a, r.y + s) + an >= e.y0;
1148
+ let i = P(n).w / 2, a = P(n).h / 2, o = P(r).w / 2, s = P(r).h / 2;
1149
+ return Math.min(n.x - i, r.x - o) - rn <= e.x1 && Math.max(n.x + i, r.x + o) + rn >= e.x0 && Math.min(n.y - a, r.y - s) - rn <= e.y1 && Math.max(n.y + a, r.y + s) + rn >= e.y0;
1104
1150
  });
1105
- }), wi = (e) => {
1106
- if (_.config.enableZoom === !1) return;
1151
+ }), Di = (e) => {
1152
+ if (v.config.enableZoom === !1) return;
1107
1153
  e.preventDefault();
1108
- let t = w.value.getBoundingClientRect(), n = e.clientX - t.left, r = e.clientY - t.top, i = n / t.width, a = r / t.height, o = H.value, s = U.value, c = e.deltaY > 0 ? .9 : 1.1, l = Math.min(nn, Math.max(tn, fi.value * c)), u = _i.value / l, d = vi.value / l;
1109
- pi.value += (o - u) * i, mi.value += (s - d) * a, fi.value = l;
1110
- }, G = f(null), K = f(null), Ti = (e) => {
1154
+ let t = w.value.getBoundingClientRect(), n = e.clientX - t.left, r = e.clientY - t.top, i = n / t.width, a = r / t.height, o = H.value, s = U.value, c = e.deltaY > 0 ? .9 : 1.1, l = Math.min(tn, Math.max(en, V.value * c)), u = bi.value / l, d = xi.value / l;
1155
+ fi.value += (o - u) * i, pi.value += (s - d) * a, V.value = l, y("zoom-change", l);
1156
+ }, G = f(null), K = f(null), Oi = (e) => {
1111
1157
  let t = w.value, n = t ? t.getBoundingClientRect() : null;
1112
1158
  G.value = {
1113
1159
  startX: e.clientX,
@@ -1117,8 +1163,8 @@ var y = {
1117
1163
  moved: !1,
1118
1164
  rectWidth: n && n.width ? n.width : 0,
1119
1165
  rectHeight: n && n.height ? n.height : 0
1120
- }, Bi();
1121
- }, Ei = (e) => {
1166
+ }, Ui();
1167
+ }, ki = (e) => {
1122
1168
  let t = G.value, n = w.value;
1123
1169
  if (!t || !n) return;
1124
1170
  let r = t.rectWidth, i = t.rectHeight;
@@ -1129,11 +1175,11 @@ var y = {
1129
1175
  return;
1130
1176
  }
1131
1177
  let a = e.clientX - t.lastX, o = e.clientY - t.lastY;
1132
- t.lastX = e.clientX, t.lastY = e.clientY, pi.value -= a * (H.value / r), mi.value -= o * (U.value / i);
1133
- }, Di = () => {
1178
+ t.lastX = e.clientX, t.lastY = e.clientY, fi.value -= a * (H.value / r), pi.value -= o * (U.value / i);
1179
+ }, Ai = () => {
1134
1180
  let e = G.value;
1135
- G.value = null, e && e.moved && si(), Hi();
1136
- }, Oi = (e) => {
1181
+ G.value = null, e && e.moved && si(), Gi();
1182
+ }, ji = (e) => {
1137
1183
  let t = Z(e);
1138
1184
  K.value = {
1139
1185
  start: {
@@ -1147,8 +1193,8 @@ var y = {
1147
1193
  startClientX: e.clientX,
1148
1194
  startClientY: e.clientY,
1149
1195
  moved: !1
1150
- }, Bi();
1151
- }, ki = (e) => {
1196
+ }, Ui();
1197
+ }, Mi = (e) => {
1152
1198
  let t = K.value;
1153
1199
  if (!t) return;
1154
1200
  let n = Z(e);
@@ -1156,7 +1202,7 @@ var y = {
1156
1202
  x: n.x,
1157
1203
  y: n.y
1158
1204
  }, !t.moved && Math.hypot(e.clientX - t.startClientX, e.clientY - t.startClientY) > 3 && (t.moved = !0);
1159
- }, Ai = t(() => {
1205
+ }, Ni = t(() => {
1160
1206
  let e = K.value;
1161
1207
  return e ? {
1162
1208
  x: Math.min(e.start.x, e.current.x),
@@ -1169,7 +1215,7 @@ var y = {
1169
1215
  width: 0,
1170
1216
  height: 0
1171
1217
  };
1172
- }), ji = () => {
1218
+ }), Pi = () => {
1173
1219
  let e = K.value;
1174
1220
  if (K.value = null, e && e.moved) {
1175
1221
  let t = {
@@ -1178,50 +1224,50 @@ var y = {
1178
1224
  w: Math.abs(e.current.x - e.start.x),
1179
1225
  h: Math.abs(e.current.y - e.start.y)
1180
1226
  }, n = x.value.filter((e) => {
1181
- let n = I(e), r = e.x + n.x, i = e.y + n.y;
1182
- return r + n.width < t.x || r > t.x + t.w || i + n.height < t.y || i > t.y + t.h ? !1 : !N(e) || r >= t.x && i >= t.y && r + n.width <= t.x + t.w && i + n.height <= t.y + t.h;
1227
+ let n = F(e), r = e.x + n.x, i = e.y + n.y;
1228
+ return r + n.width < t.x || r > t.x + t.w || i + n.height < t.y || i > t.y + t.h ? !1 : !M(e) || r >= t.x && i >= t.y && r + n.width <= t.x + t.w && i + n.height <= t.y + t.h;
1183
1229
  });
1184
- n.length && (R.value = V(R.value, n.map((e) => e.id), qr.value), B()), si();
1230
+ n.length && (L.value = B(L.value, n.map((e) => e.id), qr.value), z()), si();
1185
1231
  }
1186
- Hi();
1187
- }, Mi = (e) => !e || typeof e.closest != "function" ? !1 : !!(e.closest(".topology-node") || e.closest(".node-handles") || e.closest(".node-resize-layer")), Ni = (e) => {
1232
+ Gi();
1233
+ }, Fi = (e) => !e || typeof e.closest != "function" ? !1 : !!(e.closest(".topology-node") || e.closest(".node-handles") || e.closest(".node-resize-layer")), Ii = (e) => {
1188
1234
  if (w.value) {
1189
1235
  if (e.button === 1) {
1190
- if (_.config.enablePan === !1) return;
1191
- e.preventDefault(), Ti(e);
1192
- } else if (e.button === 0 && !Mi(e.target)) {
1236
+ if (v.config.enablePan === !1) return;
1237
+ e.preventDefault(), Oi(e);
1238
+ } else if (e.button === 0 && !Fi(e.target)) {
1193
1239
  if (e.ctrlKey || e.metaKey) {
1194
- if (_.config.enableMarquee === !1) return;
1195
- e.preventDefault(), Oi(e);
1196
- } else _.config.enablePan !== !1 && (e.preventDefault(), Ti(e));
1240
+ if (v.config.enableMarquee === !1) return;
1241
+ e.preventDefault(), ji(e);
1242
+ } else v.config.enablePan !== !1 && (e.preventDefault(), Oi(e));
1197
1243
  }
1198
1244
  }
1199
- }, Pi = !1, Fi = 0, Ii = null, Li = () => {
1200
- Fi = 0;
1201
- let e = Ii;
1202
- Ii = null, e && (G.value ? Ei(e) : K.value && ki(e));
1203
- }, Ri = (e) => {
1204
- Ii = e, Fi ||= requestAnimationFrame(Li);
1205
- }, zi = () => {
1206
- Fi && (cancelAnimationFrame(Fi), Li()), G.value && Di(), K.value && ji();
1207
- }, Bi = () => {
1208
- Pi || (Pi = !0, window.addEventListener("mousemove", Ri, !0), window.addEventListener("mouseup", zi, !0));
1209
- }, Vi = () => {
1210
- Pi && (Pi = !1, window.removeEventListener("mousemove", Ri, !0), window.removeEventListener("mouseup", zi, !0));
1245
+ }, Li = !1, Ri = 0, zi = null, Bi = () => {
1246
+ Ri = 0;
1247
+ let e = zi;
1248
+ zi = null, e && (G.value ? ki(e) : K.value && Mi(e));
1249
+ }, Vi = (e) => {
1250
+ zi = e, Ri ||= requestAnimationFrame(Bi);
1211
1251
  }, Hi = () => {
1212
- !G.value && !K.value && Vi();
1213
- }, Ui = t(() => {
1214
- if (Y.value && Y.value.side) return { cursor: ka(Y.value.side) };
1252
+ Ri && (cancelAnimationFrame(Ri), Bi()), G.value && Ai(), K.value && Pi();
1253
+ }, Ui = () => {
1254
+ Li || (Li = !0, window.addEventListener("mousemove", Vi, !0), window.addEventListener("mouseup", Hi, !0));
1255
+ }, Wi = () => {
1256
+ Li && (Li = !1, window.removeEventListener("mousemove", Vi, !0), window.removeEventListener("mouseup", Hi, !0));
1257
+ }, Gi = () => {
1258
+ !G.value && !K.value && Wi();
1259
+ }, Ki = t(() => {
1260
+ if (Y.value && Y.value.side) return { cursor: Pa(Y.value.side) };
1215
1261
  if (K.value) return { cursor: "crosshair" };
1216
1262
  if (G.value && G.value.moved) return { cursor: "grabbing" };
1217
- }), Wi = t(() => _.config.showGrid !== !1), Gi = t(() => _.config.gridColor || "#1a2240"), Ki = t(() => {
1218
- let e = Number(_.config.gridStep);
1219
- return (Number.isFinite(e) && e > 0 ? e : 40) / fi.value;
1220
- }), qi = t(() => {
1221
- let e = Number(_.config.gridOpacity);
1263
+ }), qi = t(() => v.config.showGrid !== !1), Ji = t(() => v.config.gridColor || "#1a2240"), Yi = t(() => {
1264
+ let e = Number(v.config.gridStep);
1265
+ return (Number.isFinite(e) && e > 0 ? e : 40) / V.value;
1266
+ }), Xi = t(() => {
1267
+ let e = Number(v.config.gridOpacity);
1222
1268
  return Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : .5;
1223
- }), Ji = t(() => {
1224
- let e = _.config.radialGradient && typeof _.config.radialGradient == "object" ? _.config.radialGradient : {}, t = Array.isArray(e.stops) && e.stops.length ? e.stops.filter((e) => e && e.color).map((e, t) => ({
1269
+ }), Zi = t(() => {
1270
+ let e = v.config.radialGradient && typeof v.config.radialGradient == "object" ? v.config.radialGradient : {}, t = Array.isArray(e.stops) && e.stops.length ? e.stops.filter((e) => e && e.color).map((e, t) => ({
1225
1271
  offset: e.offset == null ? t === 0 ? "0%" : "100%" : e.offset,
1226
1272
  color: e.color,
1227
1273
  opacity: e.opacity
@@ -1240,59 +1286,62 @@ var y = {
1240
1286
  r: e.r || "60%",
1241
1287
  stops: n
1242
1288
  };
1243
- }), Yi = t(() => _.config.showCenterPoint === !0), Xi = t(() => _.config.showEdgeTextBg === !0), Zi = t(() => _.config.edgeTextBgColor || "#0a0e1a"), Qi = t(() => {
1244
- let e = Number(_.config.edgeTextBgOpacity);
1289
+ }), Qi = t(() => v.config.showCenterPoint === !0), $i = t(() => v.config.showEdgeTextBg === !0), ea = t(() => v.config.edgeTextBgColor || "#0a0e1a"), ta = t(() => {
1290
+ let e = Number(v.config.edgeTextBgOpacity);
1245
1291
  return Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : .92;
1246
- }), $i = t(() => _.config.edgeColor || _.config.defaultEdgeColor || null), ea = t(() => _.config.edgeBaseColor || null), ta = (e) => e.baseColor ? e.baseColor : ea.value ? ea.value : e.color || $i.value ? Q(e) : "#1a2744", na = (e) => {
1247
- let t = e.baseDimOpacity ?? _.config.edgeBaseDimOpacity;
1292
+ }), na = t(() => v.config.edgeColor || v.config.defaultEdgeColor || null), ra = t(() => v.config.edgeBaseColor || null), ia = (e) => {
1293
+ let t = Number(e.width ?? v.config.edgeWidth);
1294
+ return Number.isFinite(t) && t > 0 ? t : 2;
1295
+ }, aa = (e) => ia(e) / 2, oa = (e) => e.baseColor ? e.baseColor : ra.value ? ra.value : e.color || na.value ? Q(e) : "#1a2744", sa = (e) => {
1296
+ let t = e.baseDimOpacity ?? v.config.edgeBaseDimOpacity;
1248
1297
  if (t != null) {
1249
1298
  let e = Number(t);
1250
1299
  return Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : 1;
1251
1300
  }
1252
- return sa.value === "none" || ua(e) === "none" ? 1 : .45;
1253
- }, ra = t(() => _.config.edgeCenterTextColor || null), ia = t(() => _.config.showNodeHandles === !0), aa = t(() => _.config.showStatusDot !== !1), oa = (e, t) => {
1301
+ return fa.value === "none" || ha(e) === "none" ? 1 : .45;
1302
+ }, ca = t(() => v.config.edgeCenterTextColor || null), la = t(() => v.config.showNodeHandles === !0), ua = t(() => v.config.showStatusDot !== !1), da = (e, t) => {
1254
1303
  let n = Number(e);
1255
1304
  return Number.isFinite(n) && n >= 0 ? n : t;
1256
- }, sa = t(() => {
1257
- let e = _.config.motionFx ?? _.config.fx;
1305
+ }, fa = t(() => {
1306
+ let e = v.config.motionFx ?? v.config.fx;
1258
1307
  return typeof e == "boolean" ? e ? "all" : "none" : [
1259
1308
  "none",
1260
1309
  "flow",
1261
1310
  "particle",
1262
1311
  "all"
1263
- ].includes(e) ? e : O.value.length <= oa(_.config.fxMotionMaxEdges, 200) ? "all" : "none";
1264
- }), ca = t(() => {
1265
- let e = _.config.glowFx ?? _.config.fx;
1266
- return typeof e == "boolean" ? e : O.value.length <= oa(_.config.fxGlowMaxEdges, 500);
1267
- }), la = t(() => {
1268
- let e = _.config.breatheFx ?? _.config.fx;
1269
- return typeof e == "boolean" ? e : Pr.value <= oa(_.config.fxAlertMaxNodes, 300);
1270
- }), ua = (e) => {
1312
+ ].includes(e) ? e : O.value.length <= da(v.config.fxMotionMaxEdges, 200) ? "all" : "none";
1313
+ }), pa = t(() => {
1314
+ let e = v.config.glowFx ?? v.config.fx;
1315
+ return typeof e == "boolean" ? e : O.value.length <= da(v.config.fxGlowMaxEdges, 500);
1316
+ }), ma = t(() => {
1317
+ let e = v.config.breatheFx ?? v.config.fx;
1318
+ return typeof e == "boolean" ? e : Fr.value <= da(v.config.fxAlertMaxNodes, 300);
1319
+ }), ha = (e) => {
1271
1320
  if (e.animatedMode !== void 0) {
1272
1321
  let t = e.animatedMode;
1273
- return !t || t === "all" ? sa.value : t === "none" ? "none" : t;
1322
+ return !t || t === "all" ? fa.value : t === "none" ? "none" : t;
1274
1323
  }
1275
- return e.animated === void 0 || e.animated ? sa.value : "none";
1276
- }, da = (e) => e.borderColor || M(e) || "#94a3b8", fa = (e) => e.borderWidth || 0, pa = (e) => e.borderStyle === "dashed" ? "8 5" : void 0, q = (e) => {
1324
+ return e.animated === void 0 || e.animated ? fa.value : "none";
1325
+ }, ga = (e) => e.borderColor || j(e) || "#94a3b8", _a = (e) => e.borderWidth || 0, va = (e) => e.borderStyle === "dashed" ? "8 5" : void 0, q = (e) => {
1277
1326
  let t = e.borderRadius;
1278
- if (t == null || t === "") return N(e) ? 16 : 6;
1327
+ if (t == null || t === "") return M(e) ? 16 : 6;
1279
1328
  let n = Number(t);
1280
- return !Number.isFinite(n) || n < 0 ? N(e) ? 16 : 6 : n;
1281
- }, ma = (e, t) => {
1282
- if (e.button !== 0 || !_.editable || _.config.nodeDraggable === !1) return;
1329
+ return !Number.isFinite(n) || n < 0 ? M(e) ? 16 : 6 : n;
1330
+ }, ya = (e, t) => {
1331
+ if (e.button !== 0 || !v.editable || v.config.nodeDraggable === !1) return;
1283
1332
  e.stopPropagation();
1284
- let n = j(t), r = Z(e);
1333
+ let n = A(t), r = Z(e);
1285
1334
  if (Sn.value = {
1286
1335
  x: r.x - n.x,
1287
1336
  y: r.y - n.y
1288
1337
  }, wn = {
1289
1338
  x: e.clientX,
1290
1339
  y: e.clientY
1291
- }, Tn = !1, En = !!(e.ctrlKey || e.metaKey), R.value.length > 1 && R.value.includes(t)) {
1340
+ }, Tn = !1, En = !!(e.ctrlKey || e.metaKey), L.value.length > 1 && L.value.includes(t)) {
1292
1341
  let e = {};
1293
- R.value.forEach((t) => {
1294
- let n = j(t);
1295
- n && !N(n) && (e[t] = {
1342
+ L.value.forEach((t) => {
1343
+ let n = A(t);
1344
+ n && !M(n) && (e[t] = {
1296
1345
  x: n.x,
1297
1346
  y: n.y
1298
1347
  });
@@ -1304,28 +1353,28 @@ var y = {
1304
1353
  }
1305
1354
  };
1306
1355
  } else Cn.value = null;
1307
- C.value = t, v("node-drag-start", n);
1308
- }, ha = 0, ga = null, _a = () => {
1309
- ha = 0;
1310
- let e = ga;
1311
- ga = null, e && ya(e);
1312
- }, va = (e) => {
1313
- (Y.value || C.value || J.value) && (ga = {
1356
+ C.value = t, y("node-drag-start", n);
1357
+ }, ba = 0, xa = null, Sa = () => {
1358
+ ba = 0;
1359
+ let e = xa;
1360
+ xa = null, e && wa(e);
1361
+ }, Ca = (e) => {
1362
+ (Y.value || C.value || J.value) && (xa = {
1314
1363
  clientX: e.clientX,
1315
1364
  clientY: e.clientY
1316
- }, ha ||= requestAnimationFrame(_a));
1317
- }, ya = (e) => {
1365
+ }, ba ||= requestAnimationFrame(Sa));
1366
+ }, wa = (e) => {
1318
1367
  if (J.value) {
1319
- wa(e);
1368
+ ka(e);
1320
1369
  return;
1321
1370
  }
1322
1371
  if (Y.value) {
1323
- ja(e);
1372
+ Ia(e);
1324
1373
  return;
1325
1374
  }
1326
1375
  if (!C.value) return;
1327
1376
  let t = Z(e);
1328
- !Tn && wn && Math.hypot(e.clientX - wn.x, e.clientY - wn.y) > en && (Tn = !0, !En && !R.value.includes(C.value) && (R.value = V([], [C.value], qr.value), z.value = [], v("node-select", R.value.includes(C.value) ? j(C.value) : null), B()));
1377
+ !Tn && wn && Math.hypot(e.clientX - wn.x, e.clientY - wn.y) > $t && (Tn = !0, !En && !L.value.includes(C.value) && (L.value = B([], [C.value], qr.value), R.value = [], y("node-select", L.value.includes(C.value) ? A(C.value) : null), z()));
1329
1378
  let n = Cn.value;
1330
1379
  if (n) {
1331
1380
  let e = t.x - n.start.x, r = t.y - n.start.y;
@@ -1340,10 +1389,10 @@ var y = {
1340
1389
  y: t.y - Sn.value.y
1341
1390
  } : e);
1342
1391
  S();
1343
- }, ba = () => {
1344
- ha && (cancelAnimationFrame(ha), _a()), J.value ? Ta() : Y.value ? Ma() : C.value && (Tn && si(), C.value = null, Cn.value = null, wn = null, Tn = !1, v("node-drag-end"));
1345
- }, J = f(null), xa = t(() => _.editable && _.config.regionDraggable !== !1), Sa = t(() => _.config.regionHitArea === "border" ? "border" : "box"), Ca = (e, t) => {
1346
- if (e.button !== 0 || e.ctrlKey || e.metaKey || !xa.value) return;
1392
+ }, Ta = () => {
1393
+ ba && (cancelAnimationFrame(ba), Sa()), J.value ? Aa() : Y.value ? La() : C.value && (Tn && si(), C.value = null, Cn.value = null, wn = null, Tn = !1, y("node-drag-end"));
1394
+ }, J = f(null), Ea = t(() => v.editable && v.config.regionDraggable !== !1), Da = t(() => v.config.regionHitArea === "border" ? "border" : "box"), Oa = (e, t) => {
1395
+ if (e.button !== 0 || e.ctrlKey || e.metaKey || !Ea.value) return;
1347
1396
  e.stopPropagation(), e.preventDefault();
1348
1397
  let n = Z(e);
1349
1398
  J.value = {
@@ -1357,13 +1406,13 @@ var y = {
1357
1406
  y: e.clientY
1358
1407
  },
1359
1408
  moved: !1
1360
- }, v("node-drag-start", t);
1361
- }, wa = (e) => {
1409
+ }, y("node-drag-start", t);
1410
+ }, ka = (e) => {
1362
1411
  let t = J.value;
1363
1412
  if (!t) return;
1364
1413
  if (!t.moved) {
1365
- if (Math.hypot(e.clientX - t.startClient.x, e.clientY - t.startClient.y) <= en) return;
1366
- t.moved = !0, R.value.includes(t.id) || (R.value = V([], [t.id], qr.value), z.value = [], v("node-select", j(t.id) || null), B());
1414
+ if (Math.hypot(e.clientX - t.startClient.x, e.clientY - t.startClient.y) <= $t) return;
1415
+ t.moved = !0, L.value.includes(t.id) || (L.value = B([], [t.id], qr.value), R.value = [], y("node-select", A(t.id) || null), z());
1367
1416
  }
1368
1417
  let n = Z(e);
1369
1418
  x.value = x.value.map((e) => e.id === t.id ? {
@@ -1371,13 +1420,13 @@ var y = {
1371
1420
  x: n.x - t.offset.x,
1372
1421
  y: n.y - t.offset.y
1373
1422
  } : e), S();
1374
- }, Ta = () => {
1423
+ }, Aa = () => {
1375
1424
  let e = J.value;
1376
- J.value = null, e && (e.moved && si(), v("node-drag-end", j(e.id) || null));
1377
- }, Ea = (e, t) => {
1425
+ J.value = null, e && (e.moved && si(), y("node-drag-end", A(e.id) || null));
1426
+ }, ja = (e, t) => {
1378
1427
  ci() || Qr(e, t);
1379
- }, Y = f(null), Da = (e, t, n) => Math.min(n, Math.max(t, e)), Oa = (e) => {
1380
- let t = I(e), n = t.x, r = t.y, i = t.x + t.width, a = t.y + t.height;
1428
+ }, Y = f(null), Ma = (e, t, n) => Math.min(n, Math.max(t, e)), Na = (e) => {
1429
+ let t = F(e), n = t.x, r = t.y, i = t.x + t.width, a = t.y + t.height;
1381
1430
  return [
1382
1431
  {
1383
1432
  side: "nw",
@@ -1420,9 +1469,9 @@ var y = {
1420
1469
  y: 0
1421
1470
  }
1422
1471
  ];
1423
- }, ka = (e) => e === "nw" || e === "se" ? "nwse-resize" : e === "ne" || e === "sw" ? "nesw-resize" : e === "n" || e === "s" ? "ns-resize" : "ew-resize", Aa = (e, t, n) => {
1424
- if (!_.editable || _.config.nodeResizable === !1 || !t) return;
1425
- let { w: r, h: i } = F(t);
1472
+ }, Pa = (e) => e === "nw" || e === "se" ? "nwse-resize" : e === "ne" || e === "sw" ? "nesw-resize" : e === "n" || e === "s" ? "ns-resize" : "ew-resize", Fa = (e, t, n) => {
1473
+ if (!v.editable || v.config.nodeResizable === !1 || !t) return;
1474
+ let { w: r, h: i } = P(t);
1426
1475
  Y.value = {
1427
1476
  id: t.id,
1428
1477
  side: n,
@@ -1430,20 +1479,20 @@ var y = {
1430
1479
  anchorY: n.includes("s") ? t.y - i / 2 : n.includes("n") ? t.y + i / 2 : null,
1431
1480
  startW: r,
1432
1481
  startH: i
1433
- }, v("node-resize-start", t);
1434
- }, ja = (e) => {
1482
+ }, y("node-resize-start", t);
1483
+ }, Ia = (e) => {
1435
1484
  let t = Y.value;
1436
1485
  if (!t) return;
1437
- let n = j(t.id);
1486
+ let n = A(t.id);
1438
1487
  if (!n) return;
1439
1488
  let r = Z(e), i = t.startW, a = t.startH, o = n.x, s = n.y;
1440
1489
  if (t.anchorX !== null) {
1441
1490
  let e = t.side.includes("e");
1442
- i = Da(e ? r.x - t.anchorX : t.anchorX - r.x, on, sn), o = e ? t.anchorX + i / 2 : t.anchorX - i / 2;
1491
+ i = Ma(e ? r.x - t.anchorX : t.anchorX - r.x, an, on), o = e ? t.anchorX + i / 2 : t.anchorX - i / 2;
1443
1492
  }
1444
1493
  if (t.anchorY !== null) {
1445
1494
  let e = t.side.includes("s");
1446
- a = Da(e ? r.y - t.anchorY : t.anchorY - r.y, cn, ln), s = e ? t.anchorY + a / 2 : t.anchorY - a / 2;
1495
+ a = Ma(e ? r.y - t.anchorY : t.anchorY - r.y, sn, cn), s = e ? t.anchorY + a / 2 : t.anchorY - a / 2;
1447
1496
  }
1448
1497
  x.value = x.value.map((e) => e.id === t.id ? {
1449
1498
  ...e,
@@ -1452,15 +1501,15 @@ var y = {
1452
1501
  width: i,
1453
1502
  height: a
1454
1503
  } : e), S();
1455
- }, Ma = () => {
1504
+ }, La = () => {
1456
1505
  let e = Y.value;
1457
- Y.value = null, e && (si(), v("node-resize-end", j(e.id) || null));
1458
- }, Na = t(() => _.editable && _.config.nodeResizable !== !1), Pa = t(() => {
1459
- if (!Na.value) return null;
1460
- let e = R.value;
1461
- return e.length === 1 && j(e[0]) || null;
1462
- }), X = f(null), Fa = (e) => {
1463
- let t = I(e);
1506
+ Y.value = null, e && (si(), y("node-resize-end", A(e.id) || null));
1507
+ }, Ra = t(() => v.editable && v.config.nodeResizable !== !1), za = t(() => {
1508
+ if (!Ra.value) return null;
1509
+ let e = L.value;
1510
+ return e.length === 1 && A(e[0]) || null;
1511
+ }), X = f(null), Ba = (e) => {
1512
+ let t = F(e);
1464
1513
  return [
1465
1514
  {
1466
1515
  side: "top",
@@ -1483,7 +1532,7 @@ var y = {
1483
1532
  y: 0
1484
1533
  }
1485
1534
  ];
1486
- }, Ia = (e, t) => {
1535
+ }, Va = (e, t) => {
1487
1536
  let n = w.value;
1488
1537
  if (!n) return null;
1489
1538
  let r = e, i = t;
@@ -1497,7 +1546,7 @@ var y = {
1497
1546
  x: s.x,
1498
1547
  y: s.y
1499
1548
  };
1500
- }, La = (e, t) => {
1549
+ }, Ha = (e, t) => {
1501
1550
  let n = w.value;
1502
1551
  if (!n) return null;
1503
1552
  let r = n.createSVGPoint();
@@ -1509,11 +1558,11 @@ var y = {
1509
1558
  x: a.x,
1510
1559
  y: a.y
1511
1560
  };
1512
- }, Z = (e) => Ia(e) ?? {
1561
+ }, Z = (e) => Va(e) ?? {
1513
1562
  x: 0,
1514
1563
  y: 0
1515
- }, Ra = (e, t, n) => {
1516
- let r = j(t);
1564
+ }, Ua = (e, t, n) => {
1565
+ let r = A(t);
1517
1566
  if (!r || !w.value) return;
1518
1567
  let i = Z(e);
1519
1568
  X.value = {
@@ -1528,53 +1577,53 @@ var y = {
1528
1577
  try {
1529
1578
  e.target.setPointerCapture?.(e.pointerId);
1530
1579
  } catch {}
1531
- Ga();
1532
- }, za = 0, Ba = null, Va = () => {
1533
- za = 0;
1534
- let e = Ba;
1535
- Ba = null, e && X.value && Ja(e);
1536
- }, Ha = (e) => {
1537
- X.value && (Ba = {
1580
+ Xa();
1581
+ }, Wa = 0, Ga = null, Ka = () => {
1582
+ Wa = 0;
1583
+ let e = Ga;
1584
+ Ga = null, e && X.value && $a(e);
1585
+ }, qa = (e) => {
1586
+ X.value && (Ga = {
1538
1587
  clientX: e.clientX,
1539
1588
  clientY: e.clientY
1540
- }, za ||= requestAnimationFrame(Va));
1541
- }, Ua = () => {
1542
- za && (cancelAnimationFrame(za), Va()), X.value && Ya();
1543
- }, Wa = !1, Ga = () => {
1544
- Wa || (Wa = !0, window.addEventListener("mousemove", Ha, !0), window.addEventListener("mouseup", Ua, !0));
1545
- }, Ka = () => {
1546
- Wa && (Wa = !1, window.removeEventListener("mousemove", Ha, !0), window.removeEventListener("mouseup", Ua, !0));
1547
- }, qa = (e, t, n) => {
1589
+ }, Wa ||= requestAnimationFrame(Ka));
1590
+ }, Ja = () => {
1591
+ Wa && (cancelAnimationFrame(Wa), Ka()), X.value && eo();
1592
+ }, Ya = !1, Xa = () => {
1593
+ Ya || (Ya = !0, window.addEventListener("mousemove", qa, !0), window.addEventListener("mouseup", Ja, !0));
1594
+ }, Za = () => {
1595
+ Ya && (Ya = !1, window.removeEventListener("mousemove", qa, !0), window.removeEventListener("mouseup", Ja, !0));
1596
+ }, Qa = (e, t, n) => {
1548
1597
  let r = x.value;
1549
1598
  for (let i = r.length - 1; i >= 0; i--) {
1550
1599
  let a = r[i];
1551
1600
  if (a.id === n) continue;
1552
- let o = I(a);
1601
+ let o = F(a);
1553
1602
  if (e >= a.x + o.x - 2 && e <= a.x + o.x + o.width + 2 && t >= a.y + o.y - 2 && t <= a.y + o.y + o.height + 2) return a;
1554
1603
  }
1555
1604
  return null;
1556
- }, Ja = (e) => {
1605
+ }, $a = (e) => {
1557
1606
  let t = X.value;
1558
1607
  if (!t) return;
1559
1608
  let n = Z(e);
1560
1609
  t.px = n.x, t.py = n.y;
1561
- let r = qa(n.x, n.y, t.fromId);
1610
+ let r = Qa(n.x, n.y, t.fromId);
1562
1611
  t.overId = r ? r.id : null;
1563
- }, Ya = () => {
1564
- Ka();
1612
+ }, eo = () => {
1613
+ Za();
1565
1614
  let e = X.value;
1566
1615
  if (X.value = null, !e || !e.overId || e.overId === e.fromId) return;
1567
1616
  let t = {
1568
- id: `${oe()}`,
1617
+ id: `${ae()}`,
1569
1618
  from: e.fromId,
1570
1619
  to: e.overId,
1571
1620
  speed: 1,
1572
1621
  fromAnchor: "edge",
1573
1622
  toAnchor: "edge"
1574
1623
  };
1575
- T.value.push(t), v("edge-create", t);
1576
- }, Xa = (e, t, n) => {
1577
- let r = e.x, i = e.y, a = t.x - r, o = t.y - i, { w: s, h: c } = F(e);
1624
+ T.value.push(t), y("edge-create", t);
1625
+ }, to = (e, t, n) => {
1626
+ let r = e.x, i = e.y, a = t.x - r, o = t.y - i, { w: s, h: c } = P(e);
1578
1627
  if (!n || n === "center" || a === 0 && o === 0) return {
1579
1628
  x: r,
1580
1629
  y: i
@@ -1584,23 +1633,23 @@ var y = {
1584
1633
  x: r + a * p,
1585
1634
  y: i + o * p
1586
1635
  };
1587
- }, Za = t(() => {
1636
+ }, no = t(() => {
1588
1637
  let e = /* @__PURE__ */ new Map();
1589
1638
  O.value.forEach((t) => {
1590
- let n = A.value[t.id];
1639
+ let n = Yn.value[t.id];
1591
1640
  n && !n.hidden && (e.has(n.key) || e.set(n.key, []), e.get(n.key).push(t));
1592
1641
  });
1593
1642
  let t = {};
1594
1643
  return e.forEach((e, n) => {
1595
- let [r, i] = n.split("__"), a = j(r), o = j(i);
1644
+ let [r, i] = n.split("__"), a = A(r), o = A(i);
1596
1645
  if (!a || !o) return;
1597
- let s = o.x - a.x, c = o.y - a.y, l = Math.sqrt(s * s + c * c) || 1, u = s / l, d = c / l, f = -d, p = u, ee = e.length, m = $t;
1646
+ let s = o.x - a.x, c = o.y - a.y, l = Math.sqrt(s * s + c * c) || 1, u = s / l, d = c / l, f = -d, p = u, ee = e.length, m = Qt;
1598
1647
  if (ee > 1) {
1599
- let e = (ee - 1) / 2 * $t, t = (e) => {
1600
- let { w: t, h: n } = F(e);
1648
+ let e = (ee - 1) / 2 * Qt, t = (e) => {
1649
+ let { w: t, h: n } = P(e);
1601
1650
  return Math.max(4, (Math.abs(f) * t + Math.abs(p) * n) / 2 - 6);
1602
1651
  }, n = Math.min(1, t(a) / e, t(o) / e);
1603
- m = $t * Math.max(.35, n);
1652
+ m = Qt * Math.max(.35, n);
1604
1653
  }
1605
1654
  let te = {};
1606
1655
  e.forEach((e, t) => {
@@ -1616,12 +1665,12 @@ var y = {
1616
1665
  bulge: Math.min(l * .15, 50)
1617
1666
  };
1618
1667
  }), t;
1619
- }), Qa = (e) => {
1620
- let t = A.value[e.id], n = t && Za.value[t.key];
1668
+ }), ro = (e) => {
1669
+ let t = Yn.value[e.id], n = t && no.value[t.key];
1621
1670
  if (!n) return null;
1622
- let r = j(e.from), i = j(e.to);
1671
+ let r = A(e.from), i = A(e.to);
1623
1672
  if (!r || !i) return null;
1624
- let a = n.slots[e.id] || 0, o = a * n.gap, s = Xa(r, i, e.fromAnchor), c = Xa(i, r, e.toAnchor);
1673
+ let a = n.slots[e.id] || 0, o = a * n.gap, s = to(r, i, e.fromAnchor), c = to(i, r, e.toAnchor);
1625
1674
  return {
1626
1675
  frame: n,
1627
1676
  slot: a,
@@ -1634,8 +1683,8 @@ var y = {
1634
1683
  y: c.y + n.ny * o
1635
1684
  }
1636
1685
  };
1637
- }, $a = (e) => {
1638
- let t = Qa(e);
1686
+ }, io = (e) => {
1687
+ let t = ro(e);
1639
1688
  if (!t) return "";
1640
1689
  let { from: n, to: r, frame: i, slot: a } = t, o = a * i.gap;
1641
1690
  if (xn.value === "straight") return `M ${n.x} ${n.y} L ${r.x} ${r.y}`;
@@ -1649,8 +1698,8 @@ var y = {
1649
1698
  }
1650
1699
  let s = (n.x + r.x) / 2 + i.nx * i.bulge, c = (n.y + r.y) / 2 + i.ny * i.bulge;
1651
1700
  return `M ${n.x} ${n.y} Q ${s} ${c} ${r.x} ${r.y}`;
1652
- }, eo = (e, t) => {
1653
- let n = Qa(e);
1701
+ }, ao = (e, t) => {
1702
+ let n = ro(e);
1654
1703
  if (!n) return {
1655
1704
  x: 0,
1656
1705
  y: 0
@@ -1691,29 +1740,29 @@ var y = {
1691
1740
  x: (1 - t) * (1 - t) * r.x + 2 * (1 - t) * t * c + t * t * i.x,
1692
1741
  y: (1 - t) * (1 - t) * r.y + 2 * (1 - t) * t * l + t * t * i.y
1693
1742
  };
1694
- }, to = t(() => X.value ? j(X.value.fromId) : null), no = t(() => X.value && X.value.overId ? j(X.value.overId) : null), ro = t(() => to.value ? M(to.value) : "#00f0ff"), io = t(() => {
1743
+ }, oo = t(() => X.value ? A(X.value.fromId) : null), so = t(() => X.value && X.value.overId ? A(X.value.overId) : null), co = t(() => oo.value ? j(oo.value) : "#00f0ff"), lo = t(() => {
1695
1744
  let e = X.value;
1696
1745
  if (!e) return {
1697
1746
  x: 0,
1698
1747
  y: 0
1699
1748
  };
1700
- let t = no.value;
1701
- return t && to.value ? Xa(t, to.value, "edge") : {
1749
+ let t = so.value;
1750
+ return t && oo.value ? to(t, oo.value, "edge") : {
1702
1751
  x: e.px,
1703
1752
  y: e.py
1704
1753
  };
1705
- }), ao = t(() => {
1706
- let e = no.value;
1754
+ }), uo = t(() => {
1755
+ let e = so.value;
1707
1756
  if (!e) return null;
1708
- let t = I(e);
1757
+ let t = F(e);
1709
1758
  return {
1710
1759
  x: e.x + t.x - 4,
1711
1760
  y: e.y + t.y - 4,
1712
1761
  w: t.width + 8,
1713
1762
  h: t.height + 8
1714
1763
  };
1715
- }), oo = (e) => {
1716
- let t = e.nodeIds.map((e) => j(e)).filter(Boolean);
1764
+ }), fo = (e) => {
1765
+ let t = e.nodeIds.map((e) => A(e)).filter(Boolean);
1717
1766
  if (t.length === 0) return null;
1718
1767
  let n = e.padding, r = Math.min(...t.map((e) => e.x)) - n, i = Math.min(...t.map((e) => e.y)) - n, a = Math.max(...t.map((e) => e.x)) + n, o = Math.max(...t.map((e) => e.y)) + n;
1719
1768
  return {
@@ -1722,62 +1771,62 @@ var y = {
1722
1771
  width: a - r,
1723
1772
  height: o - i
1724
1773
  };
1725
- }, so = t(() => _.groups.map((e) => ({
1774
+ }, po = t(() => v.groups.map((e) => ({
1726
1775
  ...e,
1727
- rect: oo(e)
1728
- })).filter((e) => e.rect)), Q = (e) => Gr(e) ? ii.value : e.color ? e.color : $i.value ? $i.value : e.centerText && e.centerText.color || "#00f0ff", co = (e) => {
1729
- let t = A.value[e.id];
1776
+ rect: fo(e)
1777
+ })).filter((e) => e.rect)), Q = (e) => Gr(e) ? ii.value : e.color ? e.color : na.value ? na.value : e.centerText && e.centerText.color || "#00f0ff", mo = (e) => {
1778
+ let t = Yn.value[e.id];
1730
1779
  return !!t && !t.hidden;
1731
- }, lo = t(() => [...new Set(O.value.map(Q))].map((e) => ({
1780
+ }, ho = t(() => [...new Set(O.value.map(Q))].map((e) => ({
1732
1781
  key: String(e).replace("#", ""),
1733
1782
  color: e
1734
- }))), uo = (e) => {
1783
+ }))), go = (e) => {
1735
1784
  let t = e.endMarker;
1736
1785
  if (!t || t === "none") return "";
1737
1786
  let n = Q(e) || "#00f0ff", r = String(n).replace("#", "");
1738
1787
  return `url(#${t === "dot" ? "edge-dot" : "edge-arrow"}-${r})`;
1739
- }, fo = /* @__PURE__ */ new Map(), po = {
1788
+ }, _o = /* @__PURE__ */ new Map(), vo = {
1740
1789
  nodes: null,
1741
1790
  edges: null,
1742
1791
  mode: null,
1743
1792
  epoch: -1
1744
- }, mo = () => {
1745
- let e = po;
1746
- (e.nodes !== x.value || e.edges !== O.value || e.mode !== xn.value || e.epoch !== fn) && (po = {
1793
+ }, yo = () => {
1794
+ let e = vo;
1795
+ (e.nodes !== x.value || e.edges !== O.value || e.mode !== xn.value || e.epoch !== dn) && (vo = {
1747
1796
  nodes: x.value,
1748
1797
  edges: O.value,
1749
1798
  mode: xn.value,
1750
- epoch: fn
1751
- }, fo = /* @__PURE__ */ new Map());
1799
+ epoch: dn
1800
+ }, _o = /* @__PURE__ */ new Map());
1752
1801
  }, $ = (e) => {
1753
- mo();
1754
- let t = fo.get(e.id);
1755
- return t === void 0 && (t = $a(e), fo.set(e.id, t)), t;
1756
- }, ho = (e, t = 1) => `${2 / e.speed * t}s`, go = (e) => `${3 / e.speed}s`, _o = t(() => _.config.edgeDashFlow === !0), vo = t(() => {
1757
- let e = _.config.edgeDashPattern, t = null;
1802
+ yo();
1803
+ let t = _o.get(e.id);
1804
+ return t === void 0 && (t = io(e), _o.set(e.id, t)), t;
1805
+ }, bo = (e, t = 1) => `${2 / e.speed * t}s`, xo = (e) => `${3 / e.speed}s`, So = t(() => v.config.edgeDashFlow === !0), Co = t(() => {
1806
+ let e = v.config.edgeDashPattern, t = null;
1758
1807
  return typeof e == "string" && e.trim() ? t = e.trim().split(/\s+/).map(Number).filter((e) => Number.isFinite(e) && e > 0) : Array.isArray(e) && (t = e.map(Number).filter((e) => Number.isFinite(e) && e > 0)), t && t.length ? t : [10, 8];
1759
- }), yo = t(() => vo.value.join(" ")), bo = t(() => vo.value.reduce((e, t) => e + t, 0)), xo = (e) => {
1760
- let t = Number(e.dashFlowWidth ?? _.config.edgeDashFlowWidth);
1808
+ }), wo = t(() => Co.value.join(" ")), To = t(() => Co.value.reduce((e, t) => e + t, 0)), Eo = (e) => {
1809
+ let t = Number(e.dashFlowWidth ?? v.config.edgeDashFlowWidth ?? v.config.edgeWidth);
1761
1810
  return Number.isFinite(t) && t > 0 ? t : 2;
1762
- }, So = (e) => {
1811
+ }, Do = (e) => {
1763
1812
  let t = Number(e.speed);
1764
1813
  return `${1.2 / (Number.isFinite(t) && t > 0 ? t : 1)}s`;
1765
- }, Co = (e) => e.animated === !1 ? !1 : e.dashFlow === !0 || e.dashFlow !== !1 && _o.value, wo = (e) => {
1766
- let t = ua(e);
1814
+ }, Oo = (e) => e.animated === !1 ? !1 : e.dashFlow === !0 || e.dashFlow !== !1 && So.value, ko = (e) => {
1815
+ let t = ha(e);
1767
1816
  return t === "flow" || t === "all";
1768
- }, To = (e) => {
1769
- let t = ua(e);
1817
+ }, Ao = (e) => {
1818
+ let t = ha(e);
1770
1819
  return t === "particle" || t === "all";
1771
- }, Eo = (e) => b(e).text, Do = (e) => !!e && String(b(e).text ?? "").trim() !== "", Oo = (e, t) => {
1820
+ }, jo = (e) => pn(e).text, Mo = (e) => !!e && String(pn(e).text ?? "").trim() !== "", No = (e, t) => {
1772
1821
  if (!e) return null;
1773
- let n = b(e), r = Number(t.fontSize) || Number(n.fontSize) || 8, i = String(n.text ?? ""), a = 0;
1822
+ let n = pn(e), r = Number(t.fontSize) || Number(n.fontSize) || 8, i = String(n.text ?? ""), a = 0;
1774
1823
  for (let e of i) a += e.charCodeAt(0) > 11904 ? 1 : .62;
1775
1824
  return {
1776
1825
  w: Math.max(14, a * r + 8),
1777
1826
  h: Math.max(12, r + 6)
1778
1827
  };
1779
- }, ko = (e, t) => {
1780
- let n = t && typeof t == "object" ? t : {}, r = n.showBg === void 0 ? Xi.value : !!n.showBg, i = n.bgColor || Zi.value, a = Qi.value;
1828
+ }, Po = (e, t) => {
1829
+ let n = t && typeof t == "object" ? t : {}, r = n.showBg === void 0 ? $i.value : !!n.showBg, i = n.bgColor || ea.value, a = ta.value;
1781
1830
  if (n.bgOpacity !== void 0 && n.bgOpacity !== null) {
1782
1831
  let e = Number(n.bgOpacity);
1783
1832
  Number.isFinite(e) && (a = Math.min(1, Math.max(0, e)));
@@ -1795,40 +1844,40 @@ var y = {
1795
1844
  borderColor: s,
1796
1845
  borderOpacity: c
1797
1846
  };
1798
- }, Ao = (e, t) => {
1799
- let n = eo(e, Math.max(0, t - .005)), r = eo(e, Math.min(1, t + .005));
1847
+ }, Fo = (e, t) => {
1848
+ let n = ao(e, Math.max(0, t - .005)), r = ao(e, Math.min(1, t + .005));
1800
1849
  return Math.atan2(r.y - n.y, r.x - n.x) * 180 / Math.PI;
1801
- }, jo = (e) => {
1850
+ }, Io = (e) => {
1802
1851
  let t = e % 180;
1803
1852
  return t > 90 && (t -= 180), t < -90 && (t += 180), t;
1804
- }, Mo = [
1853
+ }, Lo = [
1805
1854
  "above",
1806
1855
  "center",
1807
1856
  "below"
1808
- ], No = (e, t) => {
1857
+ ], Ro = (e, t) => {
1809
1858
  let n = e && typeof e == "object" ? e.position : void 0;
1810
- if (Mo.includes(n)) return n;
1811
- let r = _.config?.[`edge${t}TextPosition`];
1812
- if (Mo.includes(r)) return r;
1813
- let i = _.config?.edgeTextPosition;
1814
- return Mo.includes(i) ? i : "center";
1815
- }, Po = t(() => {
1816
- let e = Number(_.config?.edgeTextGap);
1859
+ if (Lo.includes(n)) return n;
1860
+ let r = v.config?.[`edge${t}TextPosition`];
1861
+ if (Lo.includes(r)) return r;
1862
+ let i = v.config?.edgeTextPosition;
1863
+ return Lo.includes(i) ? i : "center";
1864
+ }, zo = t(() => {
1865
+ let e = Number(v.config?.edgeTextGap);
1817
1866
  return Number.isFinite(e) && e >= 0 ? e : 2;
1818
- }), Fo = (e, t, n) => {
1819
- let r = No(e, t);
1867
+ }), Bo = (e, t, n) => {
1868
+ let r = Ro(e, t);
1820
1869
  if (r === "center") return 0;
1821
- let i = (n && n.h ? n.h : 14) / 2 + Po.value;
1822
- return P(r === "above" ? -i : i);
1823
- }, Io = (e, t, n, r = 0) => {
1824
- let i = (b(e).rotation || 0) + (n || 0), a = `translate(${t.x}, ${t.y}) rotate(${i})`;
1870
+ let i = (n && n.h ? n.h : 14) / 2 + zo.value;
1871
+ return N(r === "above" ? -i : i);
1872
+ }, Vo = (e, t, n, r = 0) => {
1873
+ let i = (pn(e).rotation || 0) + (n || 0), a = `translate(${t.x}, ${t.y}) rotate(${i})`;
1825
1874
  return r ? `${a} translate(0, ${r})` : a;
1826
- }, Lo = t(() => _.config?.edgeCenterTextFollowLine !== !1), Ro = (e, t) => Lo.value ? Math.abs(e) <= un || _.config?.edgeCenterTextFollowLine ? e : t > 0 ? Math.abs(e) : -Math.abs(e) : 0, zo = (e, t = 120) => {
1875
+ }, Ho = t(() => v.config?.edgeCenterTextFollowLine !== !1), Uo = (e, t) => Ho.value ? Math.abs(e) <= ln || v.config?.edgeCenterTextFollowLine ? e : t > 0 ? Math.abs(e) : -Math.abs(e) : 0, Wo = (e, t = 120) => {
1827
1876
  let n = [];
1828
- for (let r = 0; r <= t; r++) n.push(eo(e, r / t));
1877
+ for (let r = 0; r <= t; r++) n.push(ao(e, r / t));
1829
1878
  return n;
1830
- }, Bo = (e, t, n = !1) => {
1831
- let r = zo(e), i = [], a = 0;
1879
+ }, Go = (e, t, n = !1) => {
1880
+ let r = Wo(e), i = [], a = 0;
1832
1881
  for (let e = 1; e < r.length; e++) {
1833
1882
  let t = Math.hypot(r[e].x - r[e - 1].x, r[e].y - r[e - 1].y);
1834
1883
  i.push(t), a += t;
@@ -1842,43 +1891,43 @@ var y = {
1842
1891
  c += i[e];
1843
1892
  }
1844
1893
  return +!!n;
1845
- }, Vo = t(() => {
1894
+ }, Ko = t(() => {
1846
1895
  let e = [];
1847
1896
  for (let t of W.value) {
1848
- let n = A.value[t.id];
1897
+ let n = Yn.value[t.id];
1849
1898
  if (!n) continue;
1850
1899
  let r = n.merged && n.representative, i = !n.merged && (t.fromText || t.centerText || t.toText);
1851
1900
  if (!r && !i) continue;
1852
- let a = j(t.from), o = j(t.to);
1901
+ let a = A(t.from), o = A(t.to);
1853
1902
  if (!a || !o) continue;
1854
- let s = Bo(t, dn), c = Bo(t, dn, !0), l = Oo(t.fromText, t), u = Oo(t.centerText, t), d = Oo(t.toText, t);
1903
+ let s = Go(t, un), c = Go(t, un, !0), l = No(t.fromText, t), u = No(t.centerText, t), d = No(t.toText, t);
1855
1904
  e.push({
1856
1905
  id: t.id,
1857
1906
  edge: t,
1858
1907
  info: n,
1859
- color: a && se[a.nodeType] || "#00f0ff",
1860
- start: eo(t, s),
1861
- center: eo(t, .5),
1862
- end: eo(t, c),
1863
- startAngle: jo(Ao(t, s)),
1864
- centerRaw: Ao(t, .5),
1865
- centerAngle: jo(Ao(t, .5)),
1866
- endAngle: jo(Ao(t, c)),
1908
+ color: a && oe[a.nodeType] || "#00f0ff",
1909
+ start: ao(t, s),
1910
+ center: ao(t, .5),
1911
+ end: ao(t, c),
1912
+ startAngle: Io(Fo(t, s)),
1913
+ centerRaw: Fo(t, .5),
1914
+ centerAngle: Io(Fo(t, .5)),
1915
+ endAngle: Io(Fo(t, c)),
1867
1916
  fromBox: l,
1868
1917
  centerBox: u,
1869
1918
  toBox: d,
1870
- fromShift: Fo(t.fromText, "From", l),
1871
- centerShift: Fo(t.centerText, "Center", u),
1872
- toShift: Fo(t.toText, "To", d),
1873
- mergedShift: Fo(null, "Center", { h: Number(t.fontSize) || 8 }),
1874
- fromPlate: ko(t, t.fromText),
1875
- centerPlate: ko(t, t.centerText),
1876
- toPlate: ko(t, t.toText)
1919
+ fromShift: Bo(t.fromText, "From", l),
1920
+ centerShift: Bo(t.centerText, "Center", u),
1921
+ toShift: Bo(t.toText, "To", d),
1922
+ mergedShift: Bo(null, "Center", { h: Number(t.fontSize) || 8 }),
1923
+ fromPlate: Po(t, t.fromText),
1924
+ centerPlate: Po(t, t.centerText),
1925
+ toPlate: Po(t, t.toText)
1877
1926
  });
1878
1927
  }
1879
1928
  return e;
1880
1929
  });
1881
- return ie({
1930
+ return re({
1882
1931
  resetDataBaseline: Fn,
1883
1932
  getData: In,
1884
1933
  setData: Jn,
@@ -1887,40 +1936,42 @@ var y = {
1887
1936
  addEdges: Gn,
1888
1937
  updateNodes: Kn,
1889
1938
  updateEdges: qn,
1890
- clientToSvg: Ia,
1891
- svgToClient: La,
1939
+ clientToSvg: Va,
1940
+ svgToClient: Ha,
1892
1941
  moveLayerUp: $r,
1893
1942
  moveLayerDown: ei,
1894
1943
  moveToFront: ti,
1895
1944
  moveToBack: ni,
1896
- downloadSVG: ri
1945
+ downloadSVG: ri,
1946
+ setZoom: hi,
1947
+ resetZoom: _i
1897
1948
  }), (t, o) => (d(), r("svg", {
1898
1949
  ref_key: "svgRef",
1899
1950
  ref: w,
1900
1951
  class: "topology-svg",
1901
- style: c(Ui.value),
1902
- viewBox: `${hi.value} ${gi.value} ${H.value} ${U.value}`,
1903
- onMousedown: Ni,
1904
- onMousemove: va,
1905
- onMouseup: ba,
1906
- onMouseleave: ba,
1952
+ style: c(Ki.value),
1953
+ viewBox: `${vi.value} ${yi.value} ${H.value} ${U.value}`,
1954
+ onMousedown: Ii,
1955
+ onMousemove: Ca,
1956
+ onMouseup: Ta,
1957
+ onMouseleave: Ta,
1907
1958
  onClick: ui,
1908
- onWheel: h(wi, ["prevent"])
1959
+ onWheel: g(Di, ["prevent"])
1909
1960
  }, [
1910
1961
  i("defs", null, [
1911
1962
  o[3] ||= a("<linearGradient id=\"glassHighlight\" x1=\"0%\" y1=\"0%\" x2=\"60%\" y2=\"100%\"><stop offset=\"0%\" stop-color=\"rgba(255,255,255,0.9)\"></stop><stop offset=\"30%\" stop-color=\"rgba(255,255,255,0.25)\"></stop><stop offset=\"100%\" stop-color=\"rgba(255,255,255,0)\"></stop></linearGradient><filter id=\"glow-core\" x=\"-50%\" y=\"-50%\" width=\"200%\" height=\"200%\"><feGaussianBlur in=\"SourceGraphic\" stdDeviation=\"3\" result=\"blur\"></feGaussianBlur><feMerge><feMergeNode in=\"blur\"></feMergeNode><feMergeNode in=\"SourceGraphic\"></feMergeNode></feMerge></filter><filter id=\"glow-strong\" x=\"-50%\" y=\"-50%\" width=\"200%\" height=\"200%\"><feGaussianBlur in=\"SourceGraphic\" stdDeviation=\"6\" result=\"blur\"></feGaussianBlur><feMerge><feMergeNode in=\"blur\"></feMergeNode><feMergeNode in=\"blur\"></feMergeNode><feMergeNode in=\"SourceGraphic\"></feMergeNode></feMerge></filter>", 3),
1912
1963
  i("radialGradient", {
1913
1964
  id: "bg-grid",
1914
- cx: Ji.value.cx,
1915
- cy: Ji.value.cy,
1916
- r: Ji.value.r
1917
- }, [(d(!0), r(e, null, p(Ji.value.stops, (e, t) => (d(), r("stop", {
1965
+ cx: Zi.value.cx,
1966
+ cy: Zi.value.cy,
1967
+ r: Zi.value.r
1968
+ }, [(d(!0), r(e, null, p(Zi.value.stops, (e, t) => (d(), r("stop", {
1918
1969
  key: `bg-stop-${t}`,
1919
1970
  offset: e.offset,
1920
1971
  "stop-color": e.color,
1921
1972
  "stop-opacity": e.opacity
1922
- }, null, 8, ue))), 128))], 8, le),
1923
- (d(!0), r(e, null, p(te(y), (e, t) => (d(), r("radialGradient", {
1973
+ }, null, 8, le))), 128))], 8, ce),
1974
+ (d(!0), r(e, null, p(te(b), (e, t) => (d(), r("radialGradient", {
1924
1975
  key: `breath-${t}`,
1925
1976
  id: `breath-grad-${t}`
1926
1977
  }, [
@@ -1928,18 +1979,18 @@ var y = {
1928
1979
  offset: "0%",
1929
1980
  "stop-color": e.color,
1930
1981
  "stop-opacity": "1"
1931
- }, null, 8, fe),
1982
+ }, null, 8, de),
1932
1983
  i("stop", {
1933
1984
  offset: "40%",
1934
1985
  "stop-color": e.color,
1935
1986
  "stop-opacity": "0.5"
1936
- }, null, 8, pe),
1987
+ }, null, 8, fe),
1937
1988
  i("stop", {
1938
1989
  offset: "100%",
1939
1990
  "stop-color": e.color,
1940
1991
  "stop-opacity": "0"
1941
- }, null, 8, me)
1942
- ], 8, de))), 128)),
1992
+ }, null, 8, pe)
1993
+ ], 8, ue))), 128)),
1943
1994
  (d(!0), r(e, null, p(jr.value, (t) => (d(), r("radialGradient", {
1944
1995
  key: t.id,
1945
1996
  id: t.id
@@ -1948,9 +1999,9 @@ var y = {
1948
1999
  offset: e.offset,
1949
2000
  "stop-color": t.color,
1950
2001
  "stop-opacity": e.opacity
1951
- }, null, 8, ge))), 128))], 8, he))), 128)),
2002
+ }, null, 8, he))), 128))], 8, me))), 128)),
1952
2003
  o[4] ||= a("<linearGradient id=\"flow-grad-1\" gradientUnits=\"userSpaceOnUse\"><stop offset=\"0%\" stop-color=\"#00f0ff\" stop-opacity=\"0\"></stop><stop offset=\"40%\" stop-color=\"#00f0ff\" stop-opacity=\"1\"></stop><stop offset=\"60%\" stop-color=\"#00f0ff\" stop-opacity=\"1\"></stop><stop offset=\"100%\" stop-color=\"#00f0ff\" stop-opacity=\"0\"></stop></linearGradient>", 1),
1953
- (d(!0), r(e, null, p(lo.value, (e) => (d(), r("marker", {
2004
+ (d(!0), r(e, null, p(ho.value, (e) => (d(), r("marker", {
1954
2005
  key: `m-arrow-${e.key}`,
1955
2006
  id: `edge-arrow-${e.key}`,
1956
2007
  viewBox: "0 0 10 10",
@@ -1963,8 +2014,8 @@ var y = {
1963
2014
  }, [i("path", {
1964
2015
  d: "M1,2.5 L9,5 L1,7.5 Z",
1965
2016
  fill: e.color
1966
- }, null, 8, ve)], 8, _e))), 128)),
1967
- (d(!0), r(e, null, p(lo.value, (e) => (d(), r("marker", {
2017
+ }, null, 8, _e)], 8, ge))), 128)),
2018
+ (d(!0), r(e, null, p(ho.value, (e) => (d(), r("marker", {
1968
2019
  key: `m-dot-${e.key}`,
1969
2020
  id: `edge-dot-${e.key}`,
1970
2021
  viewBox: "0 0 10 10",
@@ -1979,34 +2030,34 @@ var y = {
1979
2030
  cy: "5",
1980
2031
  r: "4",
1981
2032
  fill: e.color
1982
- }, null, 8, be)], 8, ye))), 128))
2033
+ }, null, 8, ye)], 8, ve))), 128))
1983
2034
  ]),
1984
2035
  i("rect", {
1985
2036
  width: H.value,
1986
2037
  height: U.value,
1987
- x: hi.value,
1988
- y: gi.value,
2038
+ x: vi.value,
2039
+ y: yi.value,
1989
2040
  fill: "url(#bg-grid)"
1990
- }, null, 8, xe),
1991
- Wi.value ? (d(), r(e, { key: 0 }, [i("pattern", {
2041
+ }, null, 8, be),
2042
+ qi.value ? (d(), r(e, { key: 0 }, [i("pattern", {
1992
2043
  id: "grid",
1993
- width: Ki.value,
1994
- height: Ki.value,
2044
+ width: Yi.value,
2045
+ height: Yi.value,
1995
2046
  patternUnits: "userSpaceOnUse"
1996
2047
  }, [i("path", {
1997
- d: `M ${Ki.value} 0 L 0 0 0 ${Ki.value}`,
2048
+ d: `M ${Yi.value} 0 L 0 0 0 ${Yi.value}`,
1998
2049
  fill: "none",
1999
- stroke: Gi.value,
2050
+ stroke: Ji.value,
2000
2051
  "stroke-width": "0.5"
2001
- }, null, 8, Ce)], 8, Se), i("rect", {
2052
+ }, null, 8, Se)], 8, xe), i("rect", {
2002
2053
  width: H.value,
2003
2054
  height: U.value,
2004
- x: hi.value,
2005
- y: gi.value,
2055
+ x: vi.value,
2056
+ y: yi.value,
2006
2057
  fill: "url(#grid)",
2007
- opacity: qi.value
2008
- }, null, 8, we)], 64)) : n("", !0),
2009
- Yi.value ? (d(), r("g", Te, [...o[5] ||= [
2058
+ opacity: Xi.value
2059
+ }, null, 8, Ce)], 64)) : n("", !0),
2060
+ Qi.value ? (d(), r("g", we, [...o[5] ||= [
2010
2061
  i("line", {
2011
2062
  x1: "-22",
2012
2063
  y1: "0",
@@ -2038,7 +2089,7 @@ var y = {
2038
2089
  opacity: "0.8"
2039
2090
  }, null, -1)
2040
2091
  ]])) : n("", !0),
2041
- (d(!0), r(e, null, p(so.value, (e) => (d(), r("g", { key: e.id }, [
2092
+ (d(!0), r(e, null, p(po.value, (e) => (d(), r("g", { key: e.id }, [
2042
2093
  i("rect", {
2043
2094
  x: e.rect.x,
2044
2095
  y: e.rect.y,
@@ -2047,7 +2098,7 @@ var y = {
2047
2098
  rx: "16",
2048
2099
  fill: e.color,
2049
2100
  opacity: "0.03"
2050
- }, null, 8, Ee),
2101
+ }, null, 8, Te),
2051
2102
  i("rect", {
2052
2103
  x: e.rect.x,
2053
2104
  y: e.rect.y,
@@ -2059,35 +2110,35 @@ var y = {
2059
2110
  "stroke-width": "1.5",
2060
2111
  "stroke-dasharray": "8 5",
2061
2112
  opacity: "0.35"
2062
- }, null, 8, De),
2113
+ }, null, 8, Ee),
2063
2114
  i("circle", {
2064
2115
  cx: e.rect.x + 4,
2065
2116
  cy: e.rect.y + 4,
2066
2117
  r: "3",
2067
2118
  fill: e.color,
2068
2119
  opacity: "0.5"
2069
- }, null, 8, Oe),
2120
+ }, null, 8, De),
2070
2121
  i("circle", {
2071
2122
  cx: e.rect.x + e.rect.width - 4,
2072
2123
  cy: e.rect.y + 4,
2073
2124
  r: "3",
2074
2125
  fill: e.color,
2075
2126
  opacity: "0.5"
2076
- }, null, 8, ke),
2127
+ }, null, 8, Oe),
2077
2128
  i("circle", {
2078
2129
  cx: e.rect.x + 4,
2079
2130
  cy: e.rect.y + e.rect.height - 4,
2080
2131
  r: "3",
2081
2132
  fill: e.color,
2082
2133
  opacity: "0.5"
2083
- }, null, 8, Ae),
2134
+ }, null, 8, ke),
2084
2135
  i("circle", {
2085
2136
  cx: e.rect.x + e.rect.width - 4,
2086
2137
  cy: e.rect.y + e.rect.height - 4,
2087
2138
  r: "3",
2088
2139
  fill: e.color,
2089
2140
  opacity: "0.5"
2090
- }, null, 8, je),
2141
+ }, null, 8, Ae),
2091
2142
  i("text", {
2092
2143
  x: e.rect.x + 14,
2093
2144
  y: e.rect.y + 20,
@@ -2096,93 +2147,93 @@ var y = {
2096
2147
  "font-size": "12",
2097
2148
  opacity: "0.7",
2098
2149
  "letter-spacing": "0.5"
2099
- }, m(e.label), 9, Me)
2150
+ }, m(e.label), 9, je)
2100
2151
  ]))), 128)),
2101
- (d(!0), r(e, null, p(Si.value, (e) => (d(), r("g", {
2152
+ (d(!0), r(e, null, p(Ti.value, (e) => (d(), r("g", {
2102
2153
  key: `region-${e.id}`,
2103
2154
  transform: `translate(${e.x}, ${e.y})`,
2104
2155
  "pointer-events": "none"
2105
2156
  }, [i("rect", {
2106
- x: I(e).x,
2107
- y: I(e).y,
2108
- width: I(e).width,
2109
- height: I(e).height,
2157
+ x: F(e).x,
2158
+ y: F(e).y,
2159
+ width: F(e).width,
2160
+ height: F(e).height,
2110
2161
  rx: q(e),
2111
- fill: $n(e),
2112
- opacity: "0.03"
2113
- }, null, 8, Pe), er(e) ? (d(), r("rect", {
2162
+ fill: er(e),
2163
+ opacity: "0.9"
2164
+ }, null, 8, Ne), tr(e) ? (d(), r("rect", {
2114
2165
  key: 0,
2115
- x: I(e).x,
2116
- y: I(e).y,
2117
- width: I(e).width,
2118
- height: I(e).height,
2166
+ x: F(e).x,
2167
+ y: F(e).y,
2168
+ width: F(e).width,
2169
+ height: F(e).height,
2119
2170
  rx: q(e),
2120
2171
  fill: "none",
2121
- stroke: da(e),
2122
- "stroke-width": tr(e),
2123
- "stroke-dasharray": pa(e),
2172
+ stroke: ga(e),
2173
+ "stroke-width": nr(e),
2174
+ "stroke-dasharray": va(e),
2124
2175
  opacity: "0.35"
2125
- }, null, 8, Fe)) : n("", !0)], 8, Ne))), 128)),
2126
- Xr.value ? (d(), r("g", Ie, [(d(!0), r(e, null, p(Ci.value, (e) => (d(), r("g", {
2176
+ }, null, 8, Pe)) : n("", !0)], 8, Me))), 128)),
2177
+ Xr.value ? (d(), r("g", Fe, [(d(!0), r(e, null, p(Ei.value, (e) => (d(), r("g", {
2127
2178
  key: `node-base-${e.id}`,
2128
2179
  transform: `translate(${e.x}, ${e.y})`
2129
- }, [Ur(e) && g.viewMode !== "3d" ? (d(), r("rect", {
2180
+ }, [Ur(e) && _.viewMode !== "3d" ? (d(), r("rect", {
2130
2181
  key: 0,
2131
- x: I(e).x,
2132
- y: I(e).y,
2133
- width: I(e).width,
2134
- height: I(e).height,
2182
+ x: F(e).x,
2183
+ y: F(e).y,
2184
+ width: F(e).width,
2185
+ height: F(e).height,
2135
2186
  rx: q(e),
2136
2187
  fill: Ur(e),
2137
2188
  opacity: "0.15"
2138
- }, null, 8, Re)) : n("", !0), L(e) && g.viewMode !== "3d" ? (d(), r("rect", {
2189
+ }, null, 8, Le)) : n("", !0), I(e) && _.viewMode !== "3d" ? (d(), r("rect", {
2139
2190
  key: 1,
2140
- x: L(e).x,
2141
- y: L(e).y,
2142
- width: L(e).width,
2143
- height: L(e).height,
2191
+ x: I(e).x,
2192
+ y: I(e).y,
2193
+ width: I(e).width,
2194
+ height: I(e).height,
2144
2195
  rx: q(e),
2145
2196
  fill: "none",
2146
- stroke: da(e),
2147
- "stroke-width": fa(e),
2148
- "stroke-dasharray": pa(e),
2197
+ stroke: ga(e),
2198
+ "stroke-width": _a(e),
2199
+ "stroke-dasharray": va(e),
2149
2200
  opacity: "0.8"
2150
- }, null, 8, ze)) : n("", !0)], 8, Le))), 128))])) : n("", !0),
2151
- (d(!0), r(e, null, p(W.value, (t) => (d(), r(e, { key: `base-${t.id}` }, [Co(t) ? n("", !0) : (d(), r("path", {
2201
+ }, null, 8, Re)) : n("", !0)], 8, Ie))), 128))])) : n("", !0),
2202
+ (d(!0), r(e, null, p(W.value, (t) => (d(), r(e, { key: `base-${t.id}` }, [Oo(t) ? n("", !0) : (d(), r("path", {
2152
2203
  key: 0,
2153
2204
  d: $(t),
2154
2205
  fill: "none",
2155
- stroke: ta(t),
2156
- opacity: na(t),
2157
- "stroke-width": "2",
2206
+ stroke: oa(t),
2207
+ opacity: sa(t),
2208
+ "stroke-width": ia(t),
2158
2209
  "stroke-linecap": "round",
2159
- "marker-end": uo(t)
2160
- }, null, 8, Be))], 64))), 128)),
2161
- (d(!0), r(e, null, p(W.value, (t) => (d(), r(e, { key: `glow-${t.id}` }, [ca.value ? (d(), r("path", {
2210
+ "marker-end": go(t)
2211
+ }, null, 8, ze))], 64))), 128)),
2212
+ (d(!0), r(e, null, p(W.value, (t) => (d(), r(e, { key: `glow-${t.id}` }, [pa.value ? (d(), r("path", {
2162
2213
  key: 0,
2163
2214
  d: $(t),
2164
2215
  fill: "none",
2165
2216
  stroke: Q(t),
2166
- "stroke-width": "2",
2217
+ "stroke-width": ia(t),
2167
2218
  "stroke-linecap": "round",
2168
2219
  opacity: "0.15",
2169
2220
  filter: "url(#glow-strong)"
2170
- }, null, 8, Ve)) : n("", !0)], 64))), 128)),
2221
+ }, null, 8, Be)) : n("", !0)], 64))), 128)),
2171
2222
  (d(!0), r(e, null, p(W.value, (t) => (d(), r(e, { key: `sel-${t.id}` }, [Gr(t) ? (d(), r("path", {
2172
2223
  key: 0,
2173
2224
  d: $(t),
2174
2225
  fill: "none",
2175
2226
  stroke: ii.value,
2176
- "stroke-width": "4",
2227
+ "stroke-width": 4 * aa(t),
2177
2228
  opacity: "0.35",
2178
2229
  filter: "url(#glow-strong)"
2179
- }, null, 8, He)) : n("", !0)], 64))), 128)),
2180
- (d(!0), r(e, null, p(W.value, (t) => (d(), r(e, { key: `flow-${t.id}` }, [wo(t) ? (d(), r("g", Ue, [
2230
+ }, null, 8, Ve)) : n("", !0)], 64))), 128)),
2231
+ (d(!0), r(e, null, p(W.value, (t) => (d(), r(e, { key: `flow-${t.id}` }, [ko(t) ? (d(), r("g", He, [
2181
2232
  i("path", {
2182
2233
  d: $(t),
2183
2234
  fill: "none",
2184
2235
  stroke: Q(t),
2185
- "stroke-width": "2.5",
2236
+ "stroke-width": 2.5 * aa(t),
2186
2237
  "stroke-linecap": "round",
2187
2238
  "stroke-dasharray": "12 40",
2188
2239
  opacity: "0.9"
@@ -2190,14 +2241,14 @@ var y = {
2190
2241
  attributeName: "stroke-dashoffset",
2191
2242
  from: "0",
2192
2243
  to: "-52",
2193
- dur: ho(t),
2244
+ dur: bo(t),
2194
2245
  repeatCount: "indefinite"
2195
- }, null, 8, Ge)], 8, We),
2246
+ }, null, 8, We)], 8, Ue),
2196
2247
  i("path", {
2197
2248
  d: $(t),
2198
2249
  fill: "none",
2199
2250
  stroke: Q(t),
2200
- "stroke-width": "1.5",
2251
+ "stroke-width": 1.5 * aa(t),
2201
2252
  "stroke-linecap": "round",
2202
2253
  "stroke-dasharray": "6 60",
2203
2254
  opacity: "0.5"
@@ -2205,14 +2256,14 @@ var y = {
2205
2256
  attributeName: "stroke-dashoffset",
2206
2257
  from: "-30",
2207
2258
  to: "-82",
2208
- dur: ho(t, 1.3),
2259
+ dur: bo(t, 1.3),
2209
2260
  repeatCount: "indefinite"
2210
- }, null, 8, qe)], 8, Ke),
2261
+ }, null, 8, Ke)], 8, Ge),
2211
2262
  i("path", {
2212
2263
  d: $(t),
2213
2264
  fill: "none",
2214
2265
  stroke: Q(t),
2215
- "stroke-width": "6",
2266
+ "stroke-width": 6 * aa(t),
2216
2267
  "stroke-linecap": "round",
2217
2268
  "stroke-dasharray": "4 80",
2218
2269
  opacity: "0.3",
@@ -2221,47 +2272,47 @@ var y = {
2221
2272
  attributeName: "stroke-dashoffset",
2222
2273
  from: "0",
2223
2274
  to: "-84",
2224
- dur: ho(t, .8),
2275
+ dur: bo(t, .8),
2225
2276
  repeatCount: "indefinite"
2226
- }, null, 8, Ye)], 8, Je)
2277
+ }, null, 8, Je)], 8, qe)
2227
2278
  ])) : n("", !0)], 64))), 128)),
2228
- (d(!0), r(e, null, p(W.value, (t) => (d(), r(e, { key: `dash-${t.id}` }, [Co(t) ? (d(), r("path", {
2279
+ (d(!0), r(e, null, p(W.value, (t) => (d(), r(e, { key: `dash-${t.id}` }, [Oo(t) ? (d(), r("path", {
2229
2280
  key: 0,
2230
2281
  d: $(t),
2231
2282
  fill: "none",
2232
2283
  stroke: Q(t),
2233
- "stroke-width": xo(t),
2284
+ "stroke-width": Eo(t),
2234
2285
  "stroke-linecap": "round",
2235
- "stroke-dasharray": yo.value,
2236
- "marker-end": uo(t),
2286
+ "stroke-dasharray": wo.value,
2287
+ "marker-end": go(t),
2237
2288
  opacity: "0.9"
2238
2289
  }, [i("animate", {
2239
2290
  attributeName: "stroke-dashoffset",
2240
2291
  from: "0",
2241
- to: `${-bo.value}`,
2242
- dur: So(t),
2292
+ to: `${-To.value}`,
2293
+ dur: Do(t),
2243
2294
  repeatCount: "indefinite"
2244
- }, null, 8, Ze)], 8, Xe)) : n("", !0)], 64))), 128)),
2245
- (d(!0), r(e, null, p(W.value, (t) => (d(), r(e, { key: `particle-${t.id}` }, [To(t) ? (d(), r("g", Qe, [i("circle", {
2295
+ }, null, 8, Xe)], 8, Ye)) : n("", !0)], 64))), 128)),
2296
+ (d(!0), r(e, null, p(W.value, (t) => (d(), r(e, { key: `particle-${t.id}` }, [Ao(t) ? (d(), r("g", Ze, [i("circle", {
2246
2297
  r: "3",
2247
2298
  fill: Q(t),
2248
2299
  opacity: "0.9",
2249
2300
  filter: "url(#glow-core)"
2250
2301
  }, [i("animateMotion", {
2251
2302
  path: $(t),
2252
- dur: go(t),
2303
+ dur: xo(t),
2253
2304
  repeatCount: "indefinite"
2254
- }, null, 8, et)], 8, $e), i("circle", {
2305
+ }, null, 8, $e)], 8, Qe), i("circle", {
2255
2306
  r: "8",
2256
2307
  fill: Q(t),
2257
2308
  opacity: "0.2",
2258
2309
  filter: "url(#glow-strong)"
2259
2310
  }, [i("animateMotion", {
2260
2311
  path: $(t),
2261
- dur: go(t),
2312
+ dur: xo(t),
2262
2313
  repeatCount: "indefinite"
2263
- }, null, 8, nt)], 8, tt)])) : n("", !0)], 64))), 128)),
2264
- (d(!0), r(e, null, p(Vo.value, (t) => (d(), r(e, { key: `text-${t.id}` }, [t.info.merged && t.info.representative ? (d(), r("g", {
2314
+ }, null, 8, tt)], 8, et)])) : n("", !0)], 64))), 128)),
2315
+ (d(!0), r(e, null, p(Ko.value, (t) => (d(), r(e, { key: `text-${t.id}` }, [t.info.merged && t.info.representative ? (d(), r("g", {
2265
2316
  key: 0,
2266
2317
  transform: `translate(${t.center.x}, ${t.center.y}) rotate(${t.centerAngle})${t.mergedShift ? ` translate(0, ${t.mergedShift})` : ""}`
2267
2318
  }, [i("rect", {
@@ -2274,17 +2325,17 @@ var y = {
2274
2325
  opacity: "0.9",
2275
2326
  stroke: t.color,
2276
2327
  "stroke-width": "0.6"
2277
- }, null, 8, it), i("text", {
2328
+ }, null, 8, rt), i("text", {
2278
2329
  y: "0",
2279
2330
  "dominant-baseline": "central",
2280
2331
  "text-anchor": "middle",
2281
2332
  "font-size": _n(t.edge, null),
2282
2333
  fill: vn(t.edge, null),
2283
2334
  opacity: "1"
2284
- }, m(t.info.count), 9, at)], 8, rt)) : t.info.merged ? n("", !0) : (d(), r("g", ot, [
2285
- Do(t.edge.fromText) ? (d(), r("g", {
2335
+ }, m(t.info.count), 9, it)], 8, nt)) : t.info.merged ? n("", !0) : (d(), r("g", at, [
2336
+ Mo(t.edge.fromText) ? (d(), r("g", {
2286
2337
  key: 0,
2287
- transform: Io(t.edge.fromText, t.start, t.startAngle, t.fromShift)
2338
+ transform: Vo(t.edge.fromText, t.start, t.startAngle, t.fromShift)
2288
2339
  }, [t.fromPlate.show ? (d(), r("rect", {
2289
2340
  key: 0,
2290
2341
  x: -t.fromBox.w / 2,
@@ -2298,17 +2349,17 @@ var y = {
2298
2349
  "stroke-width": "0.6",
2299
2350
  "stroke-opacity": t.fromPlate.borderOpacity,
2300
2351
  "stroke-dasharray": t.fromPlate.borderStyle === "dashed" ? "3 2" : void 0
2301
- }, null, 8, ct)) : n("", !0), i("text", {
2352
+ }, null, 8, st)) : n("", !0), i("text", {
2302
2353
  y: "0",
2303
2354
  "dominant-baseline": "central",
2304
2355
  "text-anchor": "middle",
2305
2356
  "font-size": _n(t.edge, t.edge.fromText),
2306
2357
  fill: vn(t.edge, t.edge.fromText),
2307
2358
  opacity: "0.9"
2308
- }, m(Eo(t.edge.fromText)), 9, lt)], 8, st)) : n("", !0),
2309
- Do(t.edge.centerText) ? (d(), r("g", {
2359
+ }, m(jo(t.edge.fromText)), 9, ct)], 8, ot)) : n("", !0),
2360
+ Mo(t.edge.centerText) ? (d(), r("g", {
2310
2361
  key: 1,
2311
- transform: Io(t.edge.centerText, t.center, Ro(t.centerAngle, t.centerRaw), t.centerShift)
2362
+ transform: Vo(t.edge.centerText, t.center, Uo(t.centerAngle, t.centerRaw), t.centerShift)
2312
2363
  }, [t.centerPlate.show ? (d(), r("rect", {
2313
2364
  key: 0,
2314
2365
  x: -t.centerBox.w / 2,
@@ -2322,17 +2373,17 @@ var y = {
2322
2373
  "stroke-width": "0.6",
2323
2374
  "stroke-opacity": t.centerPlate.borderOpacity,
2324
2375
  "stroke-dasharray": t.centerPlate.borderStyle === "dashed" ? "3 2" : void 0
2325
- }, null, 8, dt)) : n("", !0), i("text", {
2376
+ }, null, 8, ut)) : n("", !0), i("text", {
2326
2377
  y: "0",
2327
2378
  "dominant-baseline": "central",
2328
2379
  "text-anchor": "middle",
2329
2380
  "font-size": _n(t.edge, t.edge.centerText),
2330
2381
  fill: vn(t.edge, t.edge.centerText),
2331
2382
  opacity: "1"
2332
- }, m(Eo(t.edge.centerText)), 9, ft)], 8, ut)) : n("", !0),
2333
- Do(t.edge.toText) ? (d(), r("g", {
2383
+ }, m(jo(t.edge.centerText)), 9, dt)], 8, lt)) : n("", !0),
2384
+ Mo(t.edge.toText) ? (d(), r("g", {
2334
2385
  key: 2,
2335
- transform: Io(t.edge.toText, t.end, t.endAngle, t.toShift)
2386
+ transform: Vo(t.edge.toText, t.end, t.endAngle, t.toShift)
2336
2387
  }, [t.toPlate.show ? (d(), r("rect", {
2337
2388
  key: 0,
2338
2389
  x: -t.toBox.w / 2,
@@ -2346,88 +2397,88 @@ var y = {
2346
2397
  "stroke-width": "0.6",
2347
2398
  "stroke-opacity": t.toPlate.borderOpacity,
2348
2399
  "stroke-dasharray": t.toPlate.borderStyle === "dashed" ? "3 2" : void 0
2349
- }, null, 8, mt)) : n("", !0), i("text", {
2400
+ }, null, 8, pt)) : n("", !0), i("text", {
2350
2401
  y: "0",
2351
2402
  "dominant-baseline": "central",
2352
2403
  "text-anchor": "middle",
2353
2404
  "font-size": _n(t.edge, t.edge.toText),
2354
2405
  fill: vn(t.edge, t.edge.toText),
2355
2406
  opacity: "0.9"
2356
- }, m(Eo(t.edge.toText)), 9, ht)], 8, pt)) : n("", !0)
2407
+ }, m(jo(t.edge.toText)), 9, mt)], 8, ft)) : n("", !0)
2357
2408
  ]))], 64))), 128)),
2358
- X.value ? (d(), r("g", gt, [
2409
+ X.value ? (d(), r("g", ht, [
2359
2410
  i("line", {
2360
2411
  x1: X.value.ax,
2361
2412
  y1: X.value.ay,
2362
- x2: io.value.x,
2363
- y2: io.value.y,
2364
- stroke: ro.value,
2413
+ x2: lo.value.x,
2414
+ y2: lo.value.y,
2415
+ stroke: co.value,
2365
2416
  "stroke-width": "2",
2366
2417
  "stroke-dasharray": "6 6",
2367
2418
  "stroke-linecap": "round",
2368
2419
  opacity: "0.9"
2369
- }, null, 8, _t),
2420
+ }, null, 8, gt),
2370
2421
  i("circle", {
2371
2422
  cx: X.value.px,
2372
2423
  cy: X.value.py,
2373
2424
  r: "3.5",
2374
- fill: ro.value,
2425
+ fill: co.value,
2375
2426
  opacity: "0.9"
2376
- }, null, 8, vt),
2377
- X.value.overId && ao.value ? (d(), r("rect", {
2427
+ }, null, 8, _t),
2428
+ X.value.overId && uo.value ? (d(), r("rect", {
2378
2429
  key: 0,
2379
- x: ao.value.x,
2380
- y: ao.value.y,
2381
- width: ao.value.w,
2382
- height: ao.value.h,
2430
+ x: uo.value.x,
2431
+ y: uo.value.y,
2432
+ width: uo.value.w,
2433
+ height: uo.value.h,
2383
2434
  rx: "6",
2384
2435
  fill: "none",
2385
- stroke: ro.value,
2436
+ stroke: co.value,
2386
2437
  "stroke-width": "1.5",
2387
2438
  "stroke-dasharray": "6 4",
2388
2439
  opacity: "0.9"
2389
- }, null, 8, yt)) : n("", !0)
2440
+ }, null, 8, vt)) : n("", !0)
2390
2441
  ])) : n("", !0),
2391
- i("g", bt, [(d(!0), r(e, null, p(Si.value, (e) => (d(), r("g", {
2442
+ i("g", yt, [(d(!0), r(e, null, p(Ti.value, (e) => (d(), r("g", {
2392
2443
  key: `region-hit-${e.id}`,
2393
2444
  transform: `translate(${e.x}, ${e.y})`,
2394
- style: c({ cursor: xa.value ? "move" : "default" }),
2395
- onMousedown: (t) => Ca(t, e),
2396
- onClick: h((t) => Ea(e, t), ["stop"])
2397
- }, [Sa.value === "box" ? (d(), r("rect", {
2445
+ style: c({ cursor: Ea.value ? "move" : "default" }),
2446
+ onMousedown: (t) => Oa(t, e),
2447
+ onClick: g((t) => ja(e, t), ["stop"])
2448
+ }, [Da.value === "box" ? (d(), r("rect", {
2398
2449
  key: 0,
2399
2450
  class: "region-hit-area",
2400
- x: I(e).x,
2401
- y: I(e).y,
2402
- width: I(e).width,
2403
- height: I(e).height,
2451
+ x: F(e).x,
2452
+ y: F(e).y,
2453
+ width: F(e).width,
2454
+ height: F(e).height,
2404
2455
  rx: q(e),
2405
2456
  fill: "transparent",
2406
2457
  "pointer-events": "all"
2407
- }, null, 8, St)) : (d(), r("rect", {
2458
+ }, null, 8, xt)) : (d(), r("rect", {
2408
2459
  key: 1,
2409
2460
  class: "region-hit-area region-hit-frame",
2410
- x: I(e).x,
2411
- y: I(e).y,
2412
- width: I(e).width,
2413
- height: I(e).height,
2461
+ x: F(e).x,
2462
+ y: F(e).y,
2463
+ width: F(e).width,
2464
+ height: F(e).height,
2414
2465
  rx: q(e),
2415
2466
  fill: "none",
2416
2467
  stroke: "transparent",
2417
2468
  "stroke-width": "14",
2418
2469
  "pointer-events": "stroke"
2419
- }, null, 8, Ct)), Wr(e) && g.viewMode !== "3d" ? (d(), r("rect", {
2470
+ }, null, 8, St)), Wr(e) && _.viewMode !== "3d" ? (d(), r("rect", {
2420
2471
  key: 2,
2421
- x: I(e).x,
2422
- y: I(e).y,
2423
- width: I(e).width,
2424
- height: I(e).height,
2472
+ x: F(e).x,
2473
+ y: F(e).y,
2474
+ width: F(e).width,
2475
+ height: F(e).height,
2425
2476
  rx: q(e),
2426
2477
  fill: "none",
2427
2478
  stroke: Yr.value,
2428
2479
  "stroke-width": "2.5",
2429
2480
  "pointer-events": "none"
2430
- }, null, 8, wt)) : n("", !0)], 44, xt))), 128))]),
2481
+ }, null, 8, Ct)) : n("", !0)], 44, bt))), 128))]),
2431
2482
  (d(!0), r(e, null, p(W.value, (e) => (d(), r("path", {
2432
2483
  key: `hit-${e.id}`,
2433
2484
  d: $(e),
@@ -2438,32 +2489,32 @@ var y = {
2438
2489
  "pointer-events": "stroke",
2439
2490
  cursor: "pointer"
2440
2491
  },
2441
- onClick: h((t) => ai(e, t), ["stop"])
2442
- }, null, 8, Tt))), 128)),
2443
- (d(!0), r(e, null, p(Ci.value, (a) => (d(), r("g", {
2492
+ onClick: g((t) => ai(e, t), ["stop"])
2493
+ }, null, 8, wt))), 128)),
2494
+ (d(!0), r(e, null, p(Ei.value, (a) => (d(), r("g", {
2444
2495
  key: a.id,
2445
2496
  transform: `translate(${a.x}, ${a.y})`,
2446
2497
  class: s(["topology-node", C.value === a.id ? "dragging" : ""]),
2447
- onMousedown: (e) => ma(e, a.id),
2498
+ onMousedown: (e) => ya(e, a.id),
2448
2499
  onClick: (e) => Qr(a, e),
2449
2500
  style: c({
2450
- cursor: _.editable && _.config.nodeDraggable !== !1 ? "grab" : "default",
2451
- color: M(a)
2501
+ cursor: v.editable && v.config.nodeDraggable !== !1 ? "grab" : "default",
2502
+ color: j(a)
2452
2503
  })
2453
2504
  }, [
2454
- Qn(a) ? (d(), r("rect", {
2505
+ $n(a) ? (d(), r("rect", {
2455
2506
  key: 0,
2456
2507
  class: "node-hit-area node-hit-frame",
2457
- x: I(a).x,
2458
- y: I(a).y,
2459
- width: I(a).width,
2460
- height: I(a).height,
2508
+ x: F(a).x,
2509
+ y: F(a).y,
2510
+ width: F(a).width,
2511
+ height: F(a).height,
2461
2512
  rx: q(a),
2462
2513
  fill: "none",
2463
2514
  stroke: "transparent",
2464
- "stroke-width": Math.max(fa(a), 12),
2515
+ "stroke-width": Math.max(_a(a), 12),
2465
2516
  "pointer-events": "stroke"
2466
- }, null, 8, Dt)) : (d(), r("rect", {
2517
+ }, null, 8, Et)) : (d(), r("rect", {
2467
2518
  key: 1,
2468
2519
  class: "node-hit-area",
2469
2520
  x: Vr(a).x,
@@ -2472,56 +2523,56 @@ var y = {
2472
2523
  height: Vr(a).height,
2473
2524
  fill: "transparent",
2474
2525
  "pointer-events": "all"
2475
- }, null, 8, Ot)),
2476
- !Xr.value && Ur(a) && g.viewMode !== "3d" ? (d(), r("rect", {
2526
+ }, null, 8, Dt)),
2527
+ !Xr.value && Ur(a) && _.viewMode !== "3d" ? (d(), r("rect", {
2477
2528
  key: 2,
2478
- x: I(a).x,
2479
- y: I(a).y,
2480
- width: I(a).width,
2481
- height: I(a).height,
2529
+ x: F(a).x,
2530
+ y: F(a).y,
2531
+ width: F(a).width,
2532
+ height: F(a).height,
2482
2533
  rx: q(a),
2483
2534
  fill: Ur(a),
2484
2535
  opacity: "0.15"
2485
- }, null, 8, kt)) : n("", !0),
2486
- !Xr.value && L(a) && g.viewMode !== "3d" ? (d(), r("rect", {
2536
+ }, null, 8, Ot)) : n("", !0),
2537
+ !Xr.value && I(a) && _.viewMode !== "3d" ? (d(), r("rect", {
2487
2538
  key: 3,
2488
- x: L(a).x,
2489
- y: L(a).y,
2490
- width: L(a).width,
2491
- height: L(a).height,
2492
- rx: q(a),
2493
- fill: "none",
2494
- stroke: da(a),
2495
- "stroke-width": fa(a),
2496
- "stroke-dasharray": pa(a),
2497
- opacity: "0.8"
2498
- }, null, 8, At)) : n("", !0),
2499
- Wr(a) && g.viewMode !== "3d" ? (d(), r("rect", {
2500
- key: 4,
2501
2539
  x: I(a).x,
2502
2540
  y: I(a).y,
2503
2541
  width: I(a).width,
2504
2542
  height: I(a).height,
2505
2543
  rx: q(a),
2506
2544
  fill: "none",
2545
+ stroke: ga(a),
2546
+ "stroke-width": _a(a),
2547
+ "stroke-dasharray": va(a),
2548
+ opacity: "0.8"
2549
+ }, null, 8, kt)) : n("", !0),
2550
+ Wr(a) && _.viewMode !== "3d" ? (d(), r("rect", {
2551
+ key: 4,
2552
+ x: F(a).x,
2553
+ y: F(a).y,
2554
+ width: F(a).width,
2555
+ height: F(a).height,
2556
+ rx: q(a),
2557
+ fill: "none",
2507
2558
  stroke: Yr.value,
2508
2559
  "stroke-width": "2.5",
2509
- transform: "scale(1.1)",
2560
+ transform: "scale(1)",
2510
2561
  style: { "pointer-events": "none" }
2511
- }, null, 8, jt)) : n("", !0),
2512
- Zn(a) ? (d(), r("text", {
2562
+ }, null, 8, At)) : n("", !0),
2563
+ Qn(a) ? (d(), r("text", {
2513
2564
  key: 5,
2514
2565
  y: "4",
2515
2566
  transform: `rotate(${a.rotation || 0} 0 4)`,
2516
2567
  "text-anchor": "middle",
2517
- fill: hn(a) || M(a) || Xn(a).color,
2568
+ fill: hn(a) || j(a) || Zn(a).color,
2518
2569
  "font-size": mn(a, 12)
2519
2570
  }, [(d(!0), r(e, null, p(String(a.label ?? "").split("\n"), (e, t) => (d(), r("tspan", {
2520
2571
  key: t,
2521
2572
  x: "0",
2522
2573
  dy: t === 0 ? 0 : "1.2em"
2523
- }, m(e), 9, Nt))), 128))], 8, Mt)) : Qn(a) ? (d(), r(e, { key: 6 }, [], 64)) : N(a) ? (d(), r(e, { key: 7 }, [], 64)) : (d(), r(e, { key: 8 }, [
2524
- (d(!0), r(e, null, p(Nr(a), (e) => (d(), r("circle", {
2574
+ }, m(e), 9, Mt))), 128))], 8, jt)) : $n(a) ? (d(), r(e, { key: 6 }, [], 64)) : M(a) ? (d(), r(e, { key: 7 }, [], 64)) : (d(), r(e, { key: 8 }, [
2575
+ (d(!0), r(e, null, p(Pr(a), (e) => (d(), r("circle", {
2525
2576
  key: `alert-${a.id}-${e.key}`,
2526
2577
  r: e.r,
2527
2578
  fill: e.fill,
@@ -2535,71 +2586,67 @@ var y = {
2535
2586
  dur: e.dur,
2536
2587
  begin: e.begin,
2537
2588
  repeatCount: "indefinite"
2538
- }, null, 8, Ft)) : n("", !0), i("animate", {
2589
+ }, null, 8, Pt)) : n("", !0), i("animate", {
2539
2590
  attributeName: "opacity",
2540
2591
  values: e.opacityValues,
2541
2592
  keyTimes: e.keyTimes || void 0,
2542
2593
  dur: e.dur,
2543
2594
  begin: e.begin,
2544
2595
  repeatCount: "indefinite"
2545
- }, null, 8, It)], 8, Pt))), 128)),
2546
- sr(a) ? (d(), r("svg", {
2596
+ }, null, 8, Ft)], 8, Nt))), 128)),
2597
+ cr(a) ? (d(), r("svg", {
2547
2598
  key: 0,
2548
2599
  class: "node-icon",
2549
- x: I(a).x,
2550
- y: I(a).y,
2551
- width: I(a).width,
2552
- height: I(a).height,
2553
- viewBox: ur.value,
2554
- preserveAspectRatio: lr.value
2600
+ viewBox: dr.value,
2601
+ x: F(a).x,
2602
+ y: F(a).y,
2603
+ width: F(a).width,
2604
+ height: F(a).height,
2605
+ preserveAspectRatio: ur.value
2555
2606
  }, [ee(t.$slots, "node-icon", {
2556
2607
  node: a,
2557
- color: M(a),
2558
- viewMode: g.viewMode,
2608
+ color: j(a),
2609
+ viewMode: _.viewMode,
2559
2610
  isImage: !0,
2560
- image: or(a),
2561
- fit: cr.value,
2562
- imageWidth: mr(a).w,
2563
- imageHeight: mr(a).h,
2564
- width: I(a).width,
2565
- height: I(a).height
2611
+ image: sr(a),
2612
+ fit: lr.value,
2613
+ imageWidth: hr(a).w,
2614
+ imageHeight: hr(a).h,
2615
+ width: F(a).width,
2616
+ height: F(a).height
2566
2617
  }, () => [i("image", {
2567
- href: or(a),
2568
- x: -mr(a).w / 2,
2569
- y: -mr(a).h / 2,
2570
- width: mr(a).w,
2571
- height: mr(a).h
2572
- }, null, 8, Rt)])], 8, Lt)) : (d(), r("g", {
2573
- key: 1,
2574
- class: "node-icon",
2575
- transform: Fr(a)
2576
- }, [ee(t.$slots, "node-icon", {
2618
+ href: sr(a),
2619
+ x: -hr(a).w / 2,
2620
+ y: -hr(a).h / 2,
2621
+ width: hr(a).w,
2622
+ height: hr(a).h
2623
+ }, null, 8, Lt)])], 8, It)) : (d(), r("g", Rt, [ee(t.$slots, "node-icon", {
2577
2624
  node: a,
2578
- color: M(a),
2579
- viewMode: g.viewMode,
2625
+ color: j(a),
2626
+ viewMode: _.viewMode,
2580
2627
  isImage: !1,
2581
- image: or(a),
2582
- fit: cr.value,
2583
- width: I(a).width,
2584
- height: I(a).height
2628
+ image: sr(a),
2629
+ fit: lr.value,
2630
+ width: F(a).width,
2631
+ height: F(a).height
2585
2632
  }, () => [i("rect", {
2586
2633
  x: "-18",
2587
2634
  y: "-18",
2588
2635
  width: "36",
2589
2636
  height: "36",
2590
2637
  rx: "6",
2591
- fill: M(a),
2638
+ fill: j(a),
2592
2639
  opacity: "0.9"
2593
- }, null, 8, Bt)])], 8, zt)),
2594
- aa.value ? (d(), r("g", {
2640
+ }, null, 8, zt)])])),
2641
+ ua.value ? (d(), r("g", {
2595
2642
  key: 2,
2596
2643
  transform: Ir(a)
2597
2644
  }, [i("circle", {
2598
2645
  r: "4",
2599
- fill: Xn(a).color,
2646
+ fill: Zn(a).color,
2600
2647
  stroke: "#0a0e1a",
2601
2648
  "stroke-width": "2"
2602
- }, null, 8, Ht)], 8, Vt)) : n("", !0),
2649
+ }, null, 8, Vt)], 8, Bt)) : n("", !0),
2603
2650
  i("text", {
2604
2651
  y: Br(a),
2605
2652
  transform: `rotate(${a.rotation || 0} 0 ${Br(a)})`,
@@ -2612,58 +2659,58 @@ var y = {
2612
2659
  key: t,
2613
2660
  x: "0",
2614
2661
  dy: t === 0 ? 0 : "1.2em"
2615
- }, m(e), 9, Wt))), 128))], 8, Ut)
2662
+ }, m(e), 9, Ut))), 128))], 8, Ht)
2616
2663
  ], 64)),
2617
- ia.value && !N(a) ? (d(), r("g", Gt, [(d(!0), r(e, null, p(Fa(a), (e) => (d(), r("circle", {
2664
+ la.value && !M(a) ? (d(), r("g", Wt, [(d(!0), r(e, null, p(Ba(a), (e) => (d(), r("circle", {
2618
2665
  key: e.side,
2619
2666
  cx: e.x,
2620
2667
  cy: e.y,
2621
2668
  r: "4.5",
2622
2669
  class: "node-handle",
2623
2670
  fill: "#0a0e1a",
2624
- stroke: M(a),
2671
+ stroke: j(a),
2625
2672
  "stroke-width": "1.5",
2626
- onPointerdown: h((t) => Ra(t, a.id, e), ["stop", "prevent"]),
2627
- onPointermove: h(Ja, ["stop"]),
2628
- onPointerup: h(Ya, ["stop"]),
2629
- onPointercancel: h(Ya, ["stop"]),
2630
- onLostpointercapture: Ya,
2631
- onMousedown: o[0] ||= h(() => {}, ["stop", "prevent"]),
2632
- onClick: o[1] ||= h(() => {}, ["stop"])
2633
- }, null, 40, Kt))), 128))])) : n("", !0)
2634
- ], 46, Et))), 128)),
2635
- Pa.value ? (d(), r("g", qt, [(d(!0), r(e, null, p(Oa(Pa.value), (e) => (d(), r("rect", {
2673
+ onPointerdown: g((t) => Ua(t, a.id, e), ["stop", "prevent"]),
2674
+ onPointermove: g($a, ["stop"]),
2675
+ onPointerup: g(eo, ["stop"]),
2676
+ onPointercancel: g(eo, ["stop"]),
2677
+ onLostpointercapture: eo,
2678
+ onMousedown: o[0] ||= g(() => {}, ["stop", "prevent"]),
2679
+ onClick: o[1] ||= g(() => {}, ["stop"])
2680
+ }, null, 40, Gt))), 128))])) : n("", !0)
2681
+ ], 46, Tt))), 128)),
2682
+ za.value ? (d(), r("g", Kt, [(d(!0), r(e, null, p(Na(za.value), (e) => (d(), r("rect", {
2636
2683
  key: e.side,
2637
- x: Pa.value.x + e.x - 4.5,
2638
- y: Pa.value.y + e.y - 4.5,
2684
+ x: za.value.x + e.x - 4.5,
2685
+ y: za.value.y + e.y - 4.5,
2639
2686
  width: "9",
2640
2687
  height: "9",
2641
2688
  rx: "2",
2642
2689
  class: s(["node-resize-handle", `rt-${e.side}`]),
2643
- onMousedown: h((t) => Aa(t, Pa.value, e.side), ["stop", "prevent"]),
2644
- onClick: o[2] ||= h(() => {}, ["stop"])
2645
- }, null, 42, Jt))), 128))])) : n("", !0),
2646
- Zr.value ? (d(!0), r(e, { key: 5 }, p(W.value, (t) => (d(), r(e, { key: `front-${t.id}` }, [Gr(t) ? (d(), r("g", Yt, [i("path", {
2690
+ onMousedown: g((t) => Fa(t, za.value, e.side), ["stop", "prevent"]),
2691
+ onClick: o[2] ||= g(() => {}, ["stop"])
2692
+ }, null, 42, qt))), 128))])) : n("", !0),
2693
+ Zr.value ? (d(!0), r(e, { key: 5 }, p(W.value, (t) => (d(), r(e, { key: `front-${t.id}` }, [Gr(t) ? (d(), r("g", Jt, [i("path", {
2647
2694
  d: $(t),
2648
2695
  fill: "none",
2649
2696
  stroke: Q(t),
2650
2697
  "stroke-width": "2.5",
2651
2698
  "stroke-linecap": "round",
2652
- "marker-end": uo(t)
2653
- }, null, 8, Xt)])) : n("", !0)], 64))), 128)) : n("", !0),
2699
+ "marker-end": go(t)
2700
+ }, null, 8, Yt)])) : n("", !0)], 64))), 128)) : n("", !0),
2654
2701
  K.value ? (d(), r("rect", {
2655
2702
  key: 6,
2656
2703
  class: "marquee-box",
2657
- x: Ai.value.x,
2658
- y: Ai.value.y,
2659
- width: Ai.value.width,
2660
- height: Ai.value.height,
2704
+ x: Ni.value.x,
2705
+ y: Ni.value.y,
2706
+ width: Ni.value.width,
2707
+ height: Ni.value.height,
2661
2708
  rx: "2",
2662
2709
  "vector-effect": "non-scaling-stroke"
2663
- }, null, 8, Zt)) : n("", !0)
2664
- ], 44, ce));
2710
+ }, null, 8, Xt)) : n("", !0)
2711
+ ], 44, se));
2665
2712
  }
2666
- }, pn = { install(e) {
2667
- e.component("Topology", fn);
2713
+ }, fn = { install(e) {
2714
+ e.component("Topology", dn);
2668
2715
  } };
2669
- export { fn as Topology, pn as default, se as nodeColors, y as nodeStates };
2716
+ export { dn as Topology, fn as default, oe as nodeColors, b as nodeStates };