vue3-network-graph 0.1.1 → 0.1.3

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
@@ -190,12 +190,14 @@ var b = {
190
190
  "y",
191
191
  "width",
192
192
  "height",
193
+ "rx",
193
194
  "fill"
194
195
  ], ut = [
195
196
  "x",
196
197
  "y",
197
198
  "width",
198
199
  "height",
200
+ "rx",
199
201
  "stroke",
200
202
  "stroke-width",
201
203
  "stroke-dasharray"
@@ -204,6 +206,7 @@ var b = {
204
206
  "y",
205
207
  "width",
206
208
  "height",
209
+ "rx",
207
210
  "stroke"
208
211
  ], ft = ["fill"], pt = [
209
212
  "transform",
@@ -305,7 +308,7 @@ var b = {
305
308
  rotation: 0,
306
309
  fontSize: void 0,
307
310
  color: void 0
308
- }, Bt = (e, t = 11) => e.fontSize || t, Vt = (e) => e.fontColor || "#000000", Ht = (e, t = 500) => e.fontWeight || t, C = (e, t) => e.fontSize || S(t).fontSize || 8, w = (e, t) => e.fontColor || S(t).color || "#000000", T = d(v.nodes.map((e) => ({ ...e }))), Ut = null, Wt = () => {
311
+ }, Bt = (e, t = 11) => e.fontSize || t, Vt = (e) => e.fontColor || "#000000", Ht = (e, t = 500) => e.fontWeight || t, C = (e, t) => e.fontSize || S(t).fontSize || 8, w = (e, t) => e.fontColor || S(t).color || "#000000", T = d(v.nodes.map((e) => ({ ...e }))), Ut = null, E = () => {
309
312
  Ut = T.value, y("update:nodes", T.value);
310
313
  };
311
314
  h(() => v.nodes, (e) => {
@@ -319,14 +322,14 @@ var b = {
319
322
  }
320
323
  (n === null || n !== r) && (zt(), T.value = t.map((e) => ({ ...e })));
321
324
  }, { deep: !0 });
322
- let Gt = d(v.lineMode);
325
+ let Wt = d(v.lineMode);
323
326
  h(() => v.lineMode, (e) => {
324
- Gt.value = e;
327
+ Wt.value = e;
325
328
  });
326
- let E = t({
327
- get: () => Gt.value,
329
+ let Gt = t({
330
+ get: () => Wt.value,
328
331
  set: (e) => {
329
- Gt.value = e, y("update:lineMode", e);
332
+ Wt.value = e, y("update:lineMode", e);
330
333
  }
331
334
  }), D = d(null), O = d(null), Kt = d({
332
335
  x: 0,
@@ -386,11 +389,11 @@ var b = {
386
389
  Zt.value && on();
387
390
  });
388
391
  let sn = () => en(), cn = () => {
389
- let e = new Set(R.value), t = new Set(z.value), n = T.value.filter((t) => e.has(t.id)), r = M.value.filter((n) => t.has(n.id) || e.has(n.from) || e.has(n.to));
392
+ let e = new Set(z.value), t = new Set(B.value), n = T.value.filter((t) => e.has(t.id)), r = M.value.filter((n) => t.has(n.id) || e.has(n.from) || e.has(n.to));
390
393
  return !n.length && !r.length ? {
391
394
  nodes: [],
392
395
  edges: []
393
- } : (n.length && (T.value = T.value.filter((t) => !e.has(t.id)), Wt()), r.length && (j.value = /* @__PURE__ */ new Set([...j.value, ...r.map((e) => e.id)]), k.value = k.value.filter((e) => !j.value.has(e.id)), y("edge-remove", r.map((e) => JSON.parse(JSON.stringify(e))))), R.value = [], z.value = [], y("node-select", null), y("edge-select", null), B(), JSON.parse(JSON.stringify({
396
+ } : (n.length && (T.value = T.value.filter((t) => !e.has(t.id)), E()), r.length && (j.value = /* @__PURE__ */ new Set([...j.value, ...r.map((e) => e.id)]), k.value = k.value.filter((e) => !j.value.has(e.id)), y("edge-remove", r.map((e) => JSON.parse(JSON.stringify(e))))), z.value = [], B.value = [], y("node-select", null), y("edge-select", null), V(), JSON.parse(JSON.stringify({
394
397
  nodes: n,
395
398
  edges: r
396
399
  })));
@@ -402,7 +405,7 @@ var b = {
402
405
  else if (n.has(t.id)) continue;
403
406
  n.add(t.id), r.push(t);
404
407
  }
405
- return r.length ? (T.value = [...T.value, ...r], Wt(), JSON.parse(JSON.stringify(r))) : [];
408
+ return r.length ? (T.value = [...T.value, ...r], E(), JSON.parse(JSON.stringify(r))) : [];
406
409
  }, un = (e) => {
407
410
  let t = (Array.isArray(e) ? e : [e]).filter((e) => e && typeof e == "object"), n = new Set(M.value.map((e) => e.id)), r = [];
408
411
  for (let e of t) {
@@ -441,7 +444,7 @@ var b = {
441
444
  ...t
442
445
  };
443
446
  return r.push(i), i;
444
- }), r.length ? (Wt(), JSON.parse(JSON.stringify(r))) : [];
447
+ }), r.length ? (E(), JSON.parse(JSON.stringify(r))) : [];
445
448
  }, fn = (e) => {
446
449
  let t = (Array.isArray(e) ? e : [e]).filter((e) => e && e.id != null);
447
450
  if (!t.length) return [];
@@ -465,7 +468,7 @@ var b = {
465
468
  return i.length ? (A.value = r, y("edge-update", JSON.parse(JSON.stringify(i))), JSON.parse(JSON.stringify(i))) : [];
466
469
  }, pn = (e) => {
467
470
  let t = e && typeof e == "object" ? e : null;
468
- return k.value = [], j.value = /* @__PURE__ */ new Set(), A.value = /* @__PURE__ */ new Map(), t && Array.isArray(t.nodes) ? (T.value = JSON.parse(JSON.stringify(t.nodes)), Wt()) : (T.value = (Array.isArray(v.nodes) ? v.nodes : []).map((e) => ({ ...e })), Ut = T.value), R.value = [], z.value = [], y("node-select", null), y("edge-select", null), B(), on(), en();
471
+ return k.value = [], j.value = /* @__PURE__ */ new Set(), A.value = /* @__PURE__ */ new Map(), t && Array.isArray(t.nodes) ? (T.value = JSON.parse(JSON.stringify(t.nodes)), E()) : (T.value = (Array.isArray(v.nodes) ? v.nodes : []).map((e) => ({ ...e })), Ut = T.value), z.value = [], B.value = [], y("node-select", null), y("edge-select", null), V(), on(), en();
469
472
  };
470
473
  h(() => v.edges, (e) => {
471
474
  zt();
@@ -483,7 +486,7 @@ var b = {
483
486
  r && (A.value = e);
484
487
  }
485
488
  }, { deep: !0 });
486
- let mn = t(() => {
489
+ let P = t(() => {
487
490
  let e = {};
488
491
  M.value.forEach((t) => {
489
492
  let n = [t.from, t.to].sort().join("__");
@@ -521,32 +524,36 @@ var b = {
521
524
  };
522
525
  });
523
526
  }), t;
524
- }), hn = t(() => {
527
+ }), mn = t(() => {
525
528
  let e = /* @__PURE__ */ new Map();
526
529
  for (let t of T.value) e.set(t.id, t);
527
530
  return e;
528
- }), P = (e) => hn.value.get(e), F = (e) => e.state != "none" && b[e.state] && b[e.state].color || "#00f0ff", gn = (e) => b[e.state] || b.normal, _n = (e) => e.type === "text", vn = (e, t) => {
531
+ }), F = (e) => mn.value.get(e), I = (e) => e.state != "none" && b[e.state] && b[e.state].color || "#00f0ff", hn = (e) => b[e.state] || b.normal, gn = (e) => e.type === "text", _n = (e, t) => {
529
532
  let n = Number(e);
530
533
  return Number.isFinite(n) && n > 0 ? n : t;
531
- }, yn = (e) => {
532
- let t = vn(e.width, x), n = vn(e.height, x);
534
+ }, vn = (e) => {
535
+ let t = _n(e.width, x), n = _n(e.height, x);
533
536
  return {
534
537
  sx: t / x,
535
538
  sy: n / x
536
539
  };
537
- }, bn = (e) => {
538
- let { sx: t, sy: n } = yn(e);
540
+ }, yn = (e) => {
541
+ let { sx: t, sy: n } = vn(e);
539
542
  return t === 1 && n === 1 ? "" : `scale(${t}, ${n})`;
540
- }, xn = (e) => {
541
- let { w: t, h: n } = I(e), r = Math.min(10, t * .3), i = Math.min(10, n * .3);
543
+ }, bn = (e) => {
544
+ let { w: t, h: n } = L(e), r = Math.min(10, t * .3), i = Math.min(10, n * .3);
542
545
  return `translate(${t / 2 - r}, ${-(n / 2 - i)})`;
543
- }, Sn = (e) => {
544
- let { sy: t } = yn(e);
545
- return Math.round(48 * t);
546
- }, Cn = (e) => _n(e) ? 4 : e.labelPosition === "top" ? -30 : e.labelPosition === "center" ? 0 : Sn(e), wn = (e) => {
547
- let t = L(e);
548
- if (_n(e) || !e.label) return t;
549
- let n = Bt(e), r = Cn(e);
546
+ }, xn = t(() => {
547
+ let e = Number(v.config.labelGap);
548
+ return Number.isFinite(e) && e >= 0 ? e : 18;
549
+ }), Sn = (e) => {
550
+ if (gn(e)) return 4;
551
+ let { h: t } = L(e);
552
+ return e.labelPosition === "top" ? -(t / 2 + xn.value) : e.labelPosition === "center" ? 0 : t / 2 + xn.value;
553
+ }, Cn = (e) => {
554
+ let t = R(e);
555
+ if (gn(e) || !e.label) return t;
556
+ let n = Bt(e), r = Sn(e);
550
557
  if (e.labelPosition === "top") {
551
558
  let e = r - n - 4;
552
559
  e < t.y && (t.height += t.y - e, t.y = e);
@@ -555,112 +562,123 @@ var b = {
555
562
  i > t.y + t.height && (t.height = i - t.y);
556
563
  }
557
564
  return t;
558
- }, Tn = (e) => e.borderColor !== void 0 || e.borderWidth !== void 0 || e.borderStyle !== void 0, I = (e) => {
559
- let t = _n(e);
565
+ }, wn = (e) => e.borderColor !== void 0 || e.borderWidth !== void 0 || e.borderStyle !== void 0, L = (e) => {
566
+ let t = gn(e);
560
567
  return {
561
- w: vn(e.width, t ? Math.max(60, String(e.label).length * 7 + 16) : x),
562
- h: vn(e.height, t ? 26 : x)
568
+ w: _n(e.width, t ? Math.max(60, String(e.label).length * 7 + 16) : x),
569
+ h: _n(e.height, t ? 26 : x)
563
570
  };
564
- }, L = (e) => {
565
- let { w: t, h: n } = I(e);
571
+ }, R = (e) => {
572
+ let { w: t, h: n } = L(e);
566
573
  return {
567
574
  x: -t / 2,
568
575
  y: -n / 2,
569
576
  width: t,
570
577
  height: n
571
578
  };
572
- }, En = (e) => Tn(e) ? L(e) : null, Dn = (e) => e.background && e.background !== "none" ? e.background : null, R = d([]), z = d([]);
573
- t(() => R.value.length === 1 ? R.value[0] : null), t(() => z.value.length === 1 ? z.value[0] : null);
574
- let On = (e) => R.value.includes(e.id), kn = (e) => z.value.includes(e.id), B = () => {
579
+ }, Tn = (e) => wn(e) ? R(e) : null, En = (e) => e.background && e.background !== "none" ? e.background : null, z = d([]), B = d([]);
580
+ t(() => z.value.length === 1 ? z.value[0] : null), t(() => B.value.length === 1 ? B.value[0] : null);
581
+ let Dn = (e) => z.value.includes(e.id), On = (e) => B.value.includes(e.id), V = () => {
575
582
  y("selection-change", {
576
- nodes: T.value.filter((e) => R.value.includes(e.id)),
577
- edges: M.value.filter((e) => z.value.includes(e.id))
583
+ nodes: T.value.filter((e) => z.value.includes(e.id)),
584
+ edges: M.value.filter((e) => B.value.includes(e.id))
578
585
  });
579
- }, An = t(() => v.config.selectedBorderColor || "#fbbf24"), jn = (e, t) => {
580
- if (!In()) {
586
+ }, kn = (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, An = t(() => kn(v.config.maxSelectNodes)), jn = t(() => kn(v.config.maxSelectEdges)), H = (e, t, n) => {
587
+ let r = new Set(e), i = [];
588
+ for (let e of t) r.has(e) || (r.add(e), i.push(e));
589
+ if (n === Infinity) return [...e, ...i];
590
+ let a = Math.max(0, n - e.length);
591
+ return [...e, ...i.slice(0, a)];
592
+ };
593
+ h([An, jn], ([e, t]) => {
594
+ let n = !1;
595
+ z.value.length > e && (z.value = z.value.slice(0, e), n = !0), B.value.length > t && (B.value = B.value.slice(0, t), n = !0), n && V();
596
+ });
597
+ let Mn = t(() => v.config.selectedBorderColor || "#fbbf24"), Nn = (e, t) => {
598
+ if (!Rn()) {
581
599
  if (t && (t.ctrlKey || t.metaKey)) {
582
- let t = R.value.indexOf(e.id);
583
- t >= 0 ? R.value.splice(t, 1) : R.value.push(e.id);
600
+ let t = z.value.indexOf(e.id);
601
+ t >= 0 ? z.value.splice(t, 1) : z.value = H(z.value, [e.id], An.value);
584
602
  } else {
585
- let t = R.value.length === 1 && R.value[0] === e.id;
586
- R.value = t ? [] : [e.id], z.value = [];
603
+ let t = z.value.length === 1 && z.value[0] === e.id;
604
+ z.value = t ? [] : H([], [e.id], An.value), B.value = [];
587
605
  }
588
- y("node-click", e), y("node-select", On(e) ? e : null), B();
606
+ y("node-click", e), y("node-select", Dn(e) ? e : null), V();
589
607
  }
590
- }, Mn = t(() => v.config.selectedLineColor || "#fbbf24"), Nn = (e, t) => {
591
- if (In()) return;
592
- let n = mn.value[e.id], r = !!(n && n.merged && n.representative), i = r ? M.value.filter((e) => {
593
- let t = mn.value[e.id];
608
+ }, Pn = t(() => v.config.selectedLineColor || "#fbbf24"), Fn = (e, t) => {
609
+ if (Rn()) return;
610
+ let n = P.value[e.id], r = !!(n && n.merged && n.representative), i = r ? M.value.filter((e) => {
611
+ let t = P.value[e.id];
594
612
  return t && t.key === n.key;
595
613
  }) : null, a = r ? i.map((e) => e.id) : [e.id], o = r ? {
596
614
  ...e,
597
615
  bundleEdges: i
598
616
  } : e;
599
- if (t && (t.ctrlKey || t.metaKey)) a.every((e) => z.value.includes(e)) ? z.value = z.value.filter((e) => !a.includes(e)) : z.value = [...z.value, ...a.filter((e) => !z.value.includes(e))];
617
+ if (t && (t.ctrlKey || t.metaKey)) a.every((e) => B.value.includes(e)) ? B.value = B.value.filter((e) => !a.includes(e)) : B.value = H(B.value, a, jn.value);
600
618
  else {
601
- let e = a.length === z.value.length && a.every((e) => z.value.includes(e));
602
- z.value = e ? [] : a, R.value = [];
619
+ let e = a.length === B.value.length && a.every((e) => B.value.includes(e));
620
+ B.value = e ? [] : H([], a, jn.value), z.value = [];
603
621
  }
604
- y("edge-select", kn(e) ? o : null), B();
605
- }, Pn = 0, Fn = (e = 200) => {
606
- Pn = performance.now() + e;
607
- }, In = () => performance.now() < Pn, Ln = () => {
608
- R.value = [], z.value = [], y("node-select", null), y("edge-select", null), B();
609
- }, Rn = (e) => {
610
- if (In()) return;
622
+ y("edge-select", On(e) ? o : null), V();
623
+ }, In = 0, Ln = (e = 200) => {
624
+ In = performance.now() + e;
625
+ }, Rn = () => performance.now() < In, zn = () => {
626
+ z.value = [], B.value = [], y("node-select", null), y("edge-select", null), V();
627
+ }, Bn = (e) => {
628
+ if (Rn()) return;
611
629
  let t = e.target;
612
- t && t.closest && (t.closest(".topology-node") || t.closest(".node-resize-layer") || t.closest(".node-handles")) || Ln();
613
- }, zn = d({
630
+ t && t.closest && (t.closest(".topology-node") || t.closest(".node-resize-layer") || t.closest(".node-handles")) || zn();
631
+ }, Vn = d({
614
632
  width: 1e3,
615
633
  height: 650
616
- }), Bn = d(1), Vn = d(0), Hn = d(0), Un = t(() => -Gn.value / 2 + Vn.value), Wn = t(() => -Kn.value / 2 + Hn.value), Gn = t(() => v.width ?? zn.value.width), Kn = t(() => v.height ?? zn.value.height), qn = null;
634
+ }), Hn = d(1), Un = d(0), Wn = d(0), Gn = t(() => -qn.value / 2 + Un.value), Kn = t(() => -Jn.value / 2 + Wn.value), qn = t(() => v.width ?? Vn.value.width), Jn = t(() => v.height ?? Vn.value.height), Yn = null;
617
635
  l(() => {
618
636
  let e = O.value;
619
637
  if (e) {
620
638
  let t = e.getBoundingClientRect();
621
- t.width > 0 && t.height > 0 && (zn.value = {
639
+ t.width > 0 && t.height > 0 && (Vn.value = {
622
640
  width: t.width,
623
641
  height: t.height
624
642
  });
625
643
  }
626
- e && typeof ResizeObserver < "u" && (qn = new ResizeObserver(() => {
644
+ e && typeof ResizeObserver < "u" && (Yn = new ResizeObserver(() => {
627
645
  let t = e.getBoundingClientRect();
628
- t.width > 0 && t.height > 0 && (zn.value = {
646
+ t.width > 0 && t.height > 0 && (Vn.value = {
629
647
  width: t.width,
630
648
  height: t.height
631
649
  });
632
- }), qn.observe(e));
650
+ }), Yn.observe(e));
633
651
  }), c(() => {
634
- qn &&= (qn.disconnect(), null), q &&= (cancelAnimationFrame(q), 0), K &&= (cancelAnimationFrame(K), 0), Z &&= (cancelAnimationFrame(Z), 0), ni(), fr();
652
+ Yn &&= (Yn.disconnect(), null), Lr &&= (cancelAnimationFrame(Lr), 0), J &&= (cancelAnimationFrame(J), 0), ti &&= (cancelAnimationFrame(ti), 0), ci(), mr();
635
653
  });
636
- let V = t(() => Gn.value / Bn.value), H = t(() => Kn.value / Bn.value), Jn = t(() => ({
637
- x0: Un.value - Mt,
638
- y0: Wn.value - Mt,
639
- x1: Un.value + V.value + Mt,
640
- y1: Wn.value + H.value + Mt
641
- })), Yn = t(() => {
642
- let e = Jn.value;
654
+ let U = t(() => qn.value / Hn.value), W = t(() => Jn.value / Hn.value), Xn = t(() => ({
655
+ x0: Gn.value - Mt,
656
+ y0: Kn.value - Mt,
657
+ x1: Gn.value + U.value + Mt,
658
+ y1: Kn.value + W.value + Mt
659
+ })), Zn = t(() => {
660
+ let e = Xn.value;
643
661
  return T.value.filter((t) => {
644
- let { w: n, h: r } = I(t);
662
+ let { w: n, h: r } = L(t);
645
663
  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;
646
664
  });
647
- }), U = t(() => {
648
- let e = Jn.value;
665
+ }), G = t(() => {
666
+ let e = Xn.value;
649
667
  return M.value.filter((t) => {
650
- if (!vi(t)) return !1;
651
- let n = P(t.from), r = P(t.to);
668
+ if (!wi(t)) return !1;
669
+ let n = F(t.from), r = F(t.to);
652
670
  if (!n || !r) return !1;
653
- let i = I(n).w / 2, a = I(n).h / 2, o = I(r).w / 2, s = I(r).h / 2;
671
+ let i = L(n).w / 2, a = L(n).h / 2, o = L(r).w / 2, s = L(r).h / 2;
654
672
  return Math.min(n.x - i, r.x - o) - Nt <= e.x1 && Math.max(n.x + i, r.x + o) + Nt >= e.x0 && Math.min(n.y - a, r.y - s) - Nt <= e.y1 && Math.max(n.y + a, r.y + s) + Nt >= e.y0;
655
673
  });
656
- }), Xn = (e) => {
674
+ }), Qn = (e) => {
657
675
  if (v.config.enableZoom === !1) return;
658
676
  e.preventDefault();
659
- let t = O.value.getBoundingClientRect(), n = e.clientX - t.left, r = e.clientY - t.top, i = n / t.width, a = r / t.height, o = V.value, s = H.value, c = e.deltaY > 0 ? .9 : 1.1, l = Math.min(jt, Math.max(At, Bn.value * c)), u = Gn.value / l, d = Kn.value / l;
660
- Vn.value += (o - u) * i, Hn.value += (s - d) * a, Bn.value = l;
661
- }, W = d(null), G = d(null), Zn = (e) => {
677
+ let t = O.value.getBoundingClientRect(), n = e.clientX - t.left, r = e.clientY - t.top, i = n / t.width, a = r / t.height, o = U.value, s = W.value, c = e.deltaY > 0 ? .9 : 1.1, l = Math.min(jt, Math.max(At, Hn.value * c)), u = qn.value / l, d = Jn.value / l;
678
+ Un.value += (o - u) * i, Wn.value += (s - d) * a, Hn.value = l;
679
+ }, K = d(null), q = d(null), $n = (e) => {
662
680
  let t = O.value, n = t ? t.getBoundingClientRect() : null;
663
- W.value = {
681
+ K.value = {
664
682
  startX: e.clientX,
665
683
  startY: e.clientY,
666
684
  lastX: e.clientX,
@@ -668,9 +686,9 @@ var b = {
668
686
  moved: !1,
669
687
  rectWidth: n && n.width ? n.width : 0,
670
688
  rectHeight: n && n.height ? n.height : 0
671
- }, dr();
672
- }, Qn = (e) => {
673
- let t = W.value, n = O.value;
689
+ }, pr();
690
+ }, er = (e) => {
691
+ let t = K.value, n = O.value;
674
692
  if (!t || !n) return;
675
693
  let r = t.rectWidth, i = t.rectHeight;
676
694
  if (!r || !i) return;
@@ -680,13 +698,13 @@ var b = {
680
698
  return;
681
699
  }
682
700
  let a = e.clientX - t.lastX, o = e.clientY - t.lastY;
683
- t.lastX = e.clientX, t.lastY = e.clientY, Vn.value -= a * (V.value / r), Hn.value -= o * (H.value / i);
684
- }, $n = () => {
685
- let e = W.value;
686
- W.value = null, e && e.moved && Fn(), pr();
687
- }, er = (e) => {
688
- let t = X(e);
689
- G.value = {
701
+ t.lastX = e.clientX, t.lastY = e.clientY, Un.value -= a * (U.value / r), Wn.value -= o * (W.value / i);
702
+ }, tr = () => {
703
+ let e = K.value;
704
+ K.value = null, e && e.moved && Ln(), hr();
705
+ }, nr = (e) => {
706
+ let t = Z(e);
707
+ q.value = {
690
708
  start: {
691
709
  x: t.x,
692
710
  y: t.y
@@ -698,17 +716,17 @@ var b = {
698
716
  startClientX: e.clientX,
699
717
  startClientY: e.clientY,
700
718
  moved: !1
701
- }, dr();
702
- }, tr = (e) => {
703
- let t = G.value;
719
+ }, pr();
720
+ }, rr = (e) => {
721
+ let t = q.value;
704
722
  if (!t) return;
705
- let n = X(e);
723
+ let n = Z(e);
706
724
  t.current = {
707
725
  x: n.x,
708
726
  y: n.y
709
727
  }, !t.moved && Math.hypot(e.clientX - t.startClientX, e.clientY - t.startClientY) > 3 && (t.moved = !0);
710
- }, nr = t(() => {
711
- let e = G.value;
728
+ }, ir = t(() => {
729
+ let e = q.value;
712
730
  return e ? {
713
731
  x: Math.min(e.start.x, e.current.x),
714
732
  y: Math.min(e.start.y, e.current.y),
@@ -720,66 +738,62 @@ var b = {
720
738
  width: 0,
721
739
  height: 0
722
740
  };
723
- }), rr = () => {
724
- let e = G.value;
725
- if (G.value = null, e && e.moved) {
741
+ }), ar = () => {
742
+ let e = q.value;
743
+ if (q.value = null, e && e.moved) {
726
744
  let t = {
727
745
  x: Math.min(e.start.x, e.current.x),
728
746
  y: Math.min(e.start.y, e.current.y),
729
747
  w: Math.abs(e.current.x - e.start.x),
730
748
  h: Math.abs(e.current.y - e.start.y)
731
749
  }, n = T.value.filter((e) => {
732
- let n = L(e), r = e.x + n.x, i = e.y + n.y;
750
+ let n = R(e), r = e.x + n.x, i = e.y + n.y;
733
751
  return !(r + n.width < t.x || r > t.x + t.w || i + n.height < t.y || i > t.y + t.h);
734
752
  });
735
- if (n.length) {
736
- let e = new Set(R.value);
737
- n.forEach((t) => e.add(t.id)), R.value = [...e], B();
738
- }
739
- Fn();
753
+ n.length && (z.value = H(z.value, n.map((e) => e.id), An.value), V()), Ln();
740
754
  }
741
- pr();
742
- }, ir = (e) => !e || typeof e.closest != "function" ? !1 : !!(e.closest(".topology-node") || e.closest(".node-handles") || e.closest(".node-resize-layer")), ar = (e) => {
755
+ hr();
756
+ }, or = (e) => !e || typeof e.closest != "function" ? !1 : !!(e.closest(".topology-node") || e.closest(".node-handles") || e.closest(".node-resize-layer")), sr = (e) => {
743
757
  if (O.value) {
744
758
  if (e.button === 1) {
745
759
  if (v.config.enablePan === !1) return;
746
- e.preventDefault(), Zn(e);
760
+ e.preventDefault(), $n(e);
747
761
  return;
748
762
  }
749
- if (e.button === 0 && !ir(e.target)) {
763
+ if (e.button === 0 && !or(e.target)) {
750
764
  if (e.ctrlKey || e.metaKey) {
751
765
  if (v.config.enableMarquee === !1) return;
752
- e.preventDefault(), er(e);
766
+ e.preventDefault(), nr(e);
753
767
  return;
754
768
  }
755
- v.config.enablePan !== !1 && (e.preventDefault(), Zn(e));
769
+ v.config.enablePan !== !1 && (e.preventDefault(), $n(e));
756
770
  }
757
771
  }
758
- }, or = !1, K = 0, sr = null, cr = () => {
759
- K = 0;
760
- let e = sr;
761
- sr = null, e && (W.value ? Qn(e) : G.value && tr(e));
762
- }, lr = (e) => {
763
- sr = e, K ||= requestAnimationFrame(cr);
764
- }, ur = () => {
765
- K && (cancelAnimationFrame(K), cr()), W.value && $n(), G.value && rr();
766
- }, dr = () => {
767
- or || (or = !0, window.addEventListener("mousemove", lr, !0), window.addEventListener("mouseup", ur, !0));
772
+ }, cr = !1, J = 0, lr = null, ur = () => {
773
+ J = 0;
774
+ let e = lr;
775
+ lr = null, e && (K.value ? er(e) : q.value && rr(e));
776
+ }, dr = (e) => {
777
+ lr = e, J ||= requestAnimationFrame(ur);
768
778
  }, fr = () => {
769
- or && (or = !1, window.removeEventListener("mousemove", lr, !0), window.removeEventListener("mouseup", ur, !0));
779
+ J && (cancelAnimationFrame(J), ur()), K.value && tr(), q.value && ar();
770
780
  }, pr = () => {
771
- !W.value && !G.value && fr();
772
- }, mr = t(() => {
773
- if (J.value && J.value.side) return { cursor: Br(J.value.side) };
774
- if (G.value) return { cursor: "crosshair" };
775
- if (W.value && W.value.moved) return { cursor: "grabbing" };
776
- }), hr = t(() => v.config.showGrid !== !1), gr = t(() => v.config.gridColor || "#1a2240"), _r = t(() => {
781
+ cr || (cr = !0, window.addEventListener("mousemove", dr, !0), window.addEventListener("mouseup", fr, !0));
782
+ }, mr = () => {
783
+ cr && (cr = !1, window.removeEventListener("mousemove", dr, !0), window.removeEventListener("mouseup", fr, !0));
784
+ }, hr = () => {
785
+ !K.value && !q.value && mr();
786
+ }, gr = t(() => {
787
+ if (Y.value && Y.value.side) return { cursor: Gr(Y.value.side) };
788
+ if (q.value) return { cursor: "crosshair" };
789
+ if (K.value && K.value.moved) return { cursor: "grabbing" };
790
+ }), _r = t(() => v.config.showGrid !== !1), vr = t(() => v.config.gridColor || "#1a2240"), yr = t(() => {
777
791
  let e = Number(v.config.gridStep);
778
- return (Number.isFinite(e) && e > 0 ? e : 40) / Bn.value;
779
- }), vr = t(() => {
792
+ return (Number.isFinite(e) && e > 0 ? e : 40) / Hn.value;
793
+ }), br = t(() => {
780
794
  let e = Number(v.config.gridOpacity);
781
795
  return Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : .5;
782
- }), yr = t(() => {
796
+ }), xr = t(() => {
783
797
  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) => ({
784
798
  offset: e.offset == null ? t === 0 ? "0%" : "100%" : e.offset,
785
799
  color: e.color,
@@ -799,32 +813,37 @@ var b = {
799
813
  r: e.r || "60%",
800
814
  stops: n
801
815
  };
802
- }), br = t(() => v.config.showCenterPoint === !0), xr = t(() => v.config.showEdgeTextBg === !0), Sr = t(() => v.config.edgeTextBgColor || "#0a0e1a"), Cr = t(() => v.config.showNodeHandles === !0), wr = t(() => v.config.showStatusDot !== !1), Tr = (e, t) => {
816
+ }), Sr = t(() => v.config.showCenterPoint === !0), Cr = t(() => v.config.showEdgeTextBg === !0), wr = t(() => v.config.edgeTextBgColor || "#0a0e1a"), Tr = t(() => v.config.showNodeHandles === !0), Er = t(() => v.config.showStatusDot !== !1), Dr = (e, t) => {
803
817
  let n = Number(e);
804
818
  return Number.isFinite(n) && n >= 0 ? n : t;
805
- }, Er = t(() => {
819
+ }, Or = t(() => {
806
820
  let e = v.config.motionFx ?? v.config.fx;
807
- return typeof e == "boolean" ? e : M.value.length <= Tr(v.config.fxMotionMaxEdges, 200);
808
- }), Dr = t(() => {
821
+ return typeof e == "boolean" ? e : M.value.length <= Dr(v.config.fxMotionMaxEdges, 200);
822
+ }), kr = t(() => {
809
823
  let e = v.config.glowFx ?? v.config.fx;
810
- return typeof e == "boolean" ? e : M.value.length <= Tr(v.config.fxGlowMaxEdges, 500);
811
- }), Or = t(() => {
824
+ return typeof e == "boolean" ? e : M.value.length <= Dr(v.config.fxGlowMaxEdges, 500);
825
+ }), Ar = t(() => {
812
826
  let e = v.config.breatheFx ?? v.config.fx;
813
- return typeof e == "boolean" ? e : T.value.length <= Tr(v.config.fxBreatheMaxNodes, 300);
814
- }), kr = (e) => e.borderColor || F(e) || "#94a3b8", Ar = (e) => e.borderWidth || 0, jr = (e) => e.borderStyle === "dashed" ? "8 5" : void 0, Mr = (e, t) => {
827
+ return typeof e == "boolean" ? e : T.value.length <= Dr(v.config.fxBreatheMaxNodes, 300);
828
+ }), jr = (e) => e.animated !== !1, Mr = (e) => e.borderColor || I(e) || "#94a3b8", Nr = (e) => e.borderWidth || 0, Pr = (e) => e.borderStyle === "dashed" ? "8 5" : void 0, Fr = (e) => {
829
+ let t = e.borderRadius;
830
+ if (t == null || t === "") return 6;
831
+ let n = Number(t);
832
+ return Number.isFinite(n) && n >= 0 ? n : 6;
833
+ }, Ir = (e, t) => {
815
834
  if (e.button !== 0 || !v.editable || v.config.nodeDraggable === !1) return;
816
835
  e.stopPropagation();
817
- let n = P(t), r = X(e);
836
+ let n = F(t), r = Z(e);
818
837
  if (Kt.value = {
819
838
  x: r.x - n.x,
820
839
  y: r.y - n.y
821
840
  }, Jt = {
822
841
  x: e.clientX,
823
842
  y: e.clientY
824
- }, Yt = !1, Xt = !!(e.ctrlKey || e.metaKey), R.value.length > 1 && R.value.includes(t)) {
843
+ }, Yt = !1, Xt = !!(e.ctrlKey || e.metaKey), z.value.length > 1 && z.value.includes(t)) {
825
844
  let e = {};
826
- R.value.forEach((t) => {
827
- let n = P(t);
845
+ z.value.forEach((t) => {
846
+ let n = F(t);
828
847
  n && (e[t] = {
829
848
  x: n.x,
830
849
  y: n.y
@@ -838,23 +857,23 @@ var b = {
838
857
  };
839
858
  } else qt.value = null;
840
859
  D.value = t, y("node-drag-start", n);
841
- }, q = 0, Nr = null, Pr = () => {
842
- q = 0;
843
- let e = Nr;
844
- Nr = null, e && Ir(e);
845
- }, Fr = (e) => {
846
- (J.value || D.value) && (Nr = {
860
+ }, Lr = 0, Rr = null, zr = () => {
861
+ Lr = 0;
862
+ let e = Rr;
863
+ Rr = null, e && Vr(e);
864
+ }, Br = (e) => {
865
+ (Y.value || D.value) && (Rr = {
847
866
  clientX: e.clientX,
848
867
  clientY: e.clientY
849
- }, q ||= requestAnimationFrame(Pr));
850
- }, Ir = (e) => {
851
- if (J.value) {
852
- Hr(e);
868
+ }, Lr ||= requestAnimationFrame(zr));
869
+ }, Vr = (e) => {
870
+ if (Y.value) {
871
+ qr(e);
853
872
  return;
854
873
  }
855
874
  if (!D.value) return;
856
- let t = X(e);
857
- !Yt && Jt && Math.hypot(e.clientX - Jt.x, e.clientY - Jt.y) > kt && (Yt = !0, !Xt && !R.value.includes(D.value) && (R.value = [D.value], z.value = [], y("node-select", P(D.value)), B()));
875
+ let t = Z(e);
876
+ !Yt && Jt && Math.hypot(e.clientX - Jt.x, e.clientY - Jt.y) > kt && (Yt = !0, !Xt && !z.value.includes(D.value) && (z.value = H([], [D.value], An.value), B.value = [], y("node-select", z.value.includes(D.value) ? F(D.value) : null), V()));
858
877
  let n = qt.value;
859
878
  if (n) {
860
879
  let e = t.x - n.start.x, r = t.y - n.start.y;
@@ -868,15 +887,15 @@ var b = {
868
887
  x: t.x - Kt.value.x,
869
888
  y: t.y - Kt.value.y
870
889
  } : e);
871
- Wt();
872
- }, Lr = () => {
873
- if (q && (cancelAnimationFrame(q), Pr()), J.value) {
874
- Ur();
890
+ E();
891
+ }, Hr = () => {
892
+ if (Lr && (cancelAnimationFrame(Lr), zr()), Y.value) {
893
+ Jr();
875
894
  return;
876
895
  }
877
- D.value && (Yt && Fn(), D.value = null, qt.value = null, Jt = null, Yt = !1, y("node-drag-end"));
878
- }, J = d(null), Rr = (e, t, n) => Math.min(n, Math.max(t, e)), zr = (e) => {
879
- let t = L(e), n = t.x, r = t.y, i = t.x + t.width, a = t.y + t.height;
896
+ D.value && (Yt && Ln(), D.value = null, qt.value = null, Jt = null, Yt = !1, y("node-drag-end"));
897
+ }, Y = d(null), Ur = (e, t, n) => Math.min(n, Math.max(t, e)), Wr = (e) => {
898
+ let t = R(e), n = t.x, r = t.y, i = t.x + t.width, a = t.y + t.height;
880
899
  return [
881
900
  {
882
901
  side: "nw",
@@ -919,10 +938,10 @@ var b = {
919
938
  y: 0
920
939
  }
921
940
  ];
922
- }, Br = (e) => e === "nw" || e === "se" ? "nwse-resize" : e === "ne" || e === "sw" ? "nesw-resize" : e === "n" || e === "s" ? "ns-resize" : "ew-resize", Vr = (e, t, n) => {
941
+ }, Gr = (e) => e === "nw" || e === "se" ? "nwse-resize" : e === "ne" || e === "sw" ? "nesw-resize" : e === "n" || e === "s" ? "ns-resize" : "ew-resize", Kr = (e, t, n) => {
923
942
  if (!v.editable || v.config.nodeResizable === !1 || !t) return;
924
- let { w: r, h: i } = I(t);
925
- J.value = {
943
+ let { w: r, h: i } = L(t);
944
+ Y.value = {
926
945
  id: t.id,
927
946
  side: n,
928
947
  anchorX: n.includes("e") ? t.x - r / 2 : n.includes("w") ? t.x + r / 2 : null,
@@ -930,19 +949,19 @@ var b = {
930
949
  startW: r,
931
950
  startH: i
932
951
  }, y("node-resize-start", t);
933
- }, Hr = (e) => {
934
- let t = J.value;
952
+ }, qr = (e) => {
953
+ let t = Y.value;
935
954
  if (!t) return;
936
- let n = P(t.id);
955
+ let n = F(t.id);
937
956
  if (!n) return;
938
- let r = X(e), i = t.startW, a = t.startH, o = n.x, s = n.y;
957
+ let r = Z(e), i = t.startW, a = t.startH, o = n.x, s = n.y;
939
958
  if (t.anchorX !== null) {
940
959
  let e = t.side.includes("e");
941
- i = Rr(e ? r.x - t.anchorX : t.anchorX - r.x, Pt, Ft), o = e ? t.anchorX + i / 2 : t.anchorX - i / 2;
960
+ i = Ur(e ? r.x - t.anchorX : t.anchorX - r.x, Pt, Ft), o = e ? t.anchorX + i / 2 : t.anchorX - i / 2;
942
961
  }
943
962
  if (t.anchorY !== null) {
944
963
  let e = t.side.includes("s");
945
- a = Rr(e ? r.y - t.anchorY : t.anchorY - r.y, It, Lt), s = e ? t.anchorY + a / 2 : t.anchorY - a / 2;
964
+ a = Ur(e ? r.y - t.anchorY : t.anchorY - r.y, It, Lt), s = e ? t.anchorY + a / 2 : t.anchorY - a / 2;
946
965
  }
947
966
  T.value = T.value.map((e) => e.id === t.id ? {
948
967
  ...e,
@@ -950,16 +969,16 @@ var b = {
950
969
  y: s,
951
970
  width: i,
952
971
  height: a
953
- } : e), Wt();
954
- }, Ur = () => {
955
- let e = J.value;
956
- J.value = null, e && (Fn(), y("node-resize-end", P(e.id) || null));
957
- }, Wr = t(() => v.editable && v.config.nodeResizable !== !1), Gr = t(() => {
958
- if (!Wr.value) return null;
959
- let e = R.value;
960
- return e.length === 1 && P(e[0]) || null;
961
- }), Y = d(null), Kr = (e) => {
962
- let t = L(e);
972
+ } : e), E();
973
+ }, Jr = () => {
974
+ let e = Y.value;
975
+ Y.value = null, e && (Ln(), y("node-resize-end", F(e.id) || null));
976
+ }, Yr = t(() => v.editable && v.config.nodeResizable !== !1), Xr = t(() => {
977
+ if (!Yr.value) return null;
978
+ let e = z.value;
979
+ return e.length === 1 && F(e[0]) || null;
980
+ }), X = d(null), Zr = (e) => {
981
+ let t = R(e);
963
982
  return [
964
983
  {
965
984
  side: "top",
@@ -982,7 +1001,7 @@ var b = {
982
1001
  y: 0
983
1002
  }
984
1003
  ];
985
- }, qr = (e, t) => {
1004
+ }, Qr = (e, t) => {
986
1005
  let n = O.value;
987
1006
  if (!n) return null;
988
1007
  let r = e, i = t;
@@ -996,7 +1015,7 @@ var b = {
996
1015
  x: s.x,
997
1016
  y: s.y
998
1017
  };
999
- }, Jr = (e, t) => {
1018
+ }, $r = (e, t) => {
1000
1019
  let n = O.value;
1001
1020
  if (!n) return null;
1002
1021
  let r = n.createSVGPoint();
@@ -1008,14 +1027,14 @@ var b = {
1008
1027
  x: a.x,
1009
1028
  y: a.y
1010
1029
  };
1011
- }, X = (e) => qr(e) ?? {
1030
+ }, Z = (e) => Qr(e) ?? {
1012
1031
  x: 0,
1013
1032
  y: 0
1014
- }, Yr = (e, t, n) => {
1015
- let r = P(t);
1033
+ }, ei = (e, t, n) => {
1034
+ let r = F(t);
1016
1035
  if (!r || !O.value) return;
1017
- let i = X(e);
1018
- Y.value = {
1036
+ let i = Z(e);
1037
+ X.value = {
1019
1038
  fromId: t,
1020
1039
  side: n.side,
1021
1040
  ax: r.x + n.x,
@@ -1027,42 +1046,42 @@ var b = {
1027
1046
  try {
1028
1047
  e.target.setPointerCapture?.(e.pointerId);
1029
1048
  } catch {}
1030
- ti();
1031
- }, Z = 0, Xr = null, Zr = () => {
1032
- Z = 0;
1033
- let e = Xr;
1034
- Xr = null, e && Y.value && ii(e);
1035
- }, Qr = (e) => {
1036
- Y.value && (Xr = {
1049
+ si();
1050
+ }, ti = 0, ni = null, ri = () => {
1051
+ ti = 0;
1052
+ let e = ni;
1053
+ ni = null, e && X.value && ui(e);
1054
+ }, ii = (e) => {
1055
+ X.value && (ni = {
1037
1056
  clientX: e.clientX,
1038
1057
  clientY: e.clientY
1039
- }, Z ||= requestAnimationFrame(Zr));
1040
- }, $r = () => {
1041
- Z && (cancelAnimationFrame(Z), Zr()), Y.value && ai();
1042
- }, ei = !1, ti = () => {
1043
- ei || (ei = !0, window.addEventListener("mousemove", Qr, !0), window.addEventListener("mouseup", $r, !0));
1044
- }, ni = () => {
1045
- ei && (ei = !1, window.removeEventListener("mousemove", Qr, !0), window.removeEventListener("mouseup", $r, !0));
1046
- }, ri = (e, t, n) => {
1058
+ }, ti ||= requestAnimationFrame(ri));
1059
+ }, ai = () => {
1060
+ ti && (cancelAnimationFrame(ti), ri()), X.value && di();
1061
+ }, oi = !1, si = () => {
1062
+ oi || (oi = !0, window.addEventListener("mousemove", ii, !0), window.addEventListener("mouseup", ai, !0));
1063
+ }, ci = () => {
1064
+ oi && (oi = !1, window.removeEventListener("mousemove", ii, !0), window.removeEventListener("mouseup", ai, !0));
1065
+ }, li = (e, t, n) => {
1047
1066
  let r = T.value;
1048
1067
  for (let i = r.length - 1; i >= 0; i--) {
1049
1068
  let a = r[i];
1050
1069
  if (a.id === n) continue;
1051
- let o = L(a);
1070
+ let o = R(a);
1052
1071
  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;
1053
1072
  }
1054
1073
  return null;
1055
- }, ii = (e) => {
1056
- let t = Y.value;
1074
+ }, ui = (e) => {
1075
+ let t = X.value;
1057
1076
  if (!t) return;
1058
- let n = X(e);
1077
+ let n = Z(e);
1059
1078
  t.px = n.x, t.py = n.y;
1060
- let r = ri(n.x, n.y, t.fromId);
1079
+ let r = li(n.x, n.y, t.fromId);
1061
1080
  t.overId = r ? r.id : null;
1062
- }, ai = () => {
1063
- ni();
1064
- let e = Y.value;
1065
- if (Y.value = null, !e || !e.overId || e.overId === e.fromId) return;
1081
+ }, di = () => {
1082
+ ci();
1083
+ let e = X.value;
1084
+ if (X.value = null, !e || !e.overId || e.overId === e.fromId) return;
1066
1085
  let t = {
1067
1086
  id: `${re()}`,
1068
1087
  from: e.fromId,
@@ -1072,8 +1091,8 @@ var b = {
1072
1091
  toAnchor: "edge"
1073
1092
  };
1074
1093
  k.value.push(t), y("edge-create", t);
1075
- }, oi = (e, t, n) => {
1076
- let r = e.x, i = e.y, a = t.x - r, o = t.y - i, { w: s, h: c } = I(e);
1094
+ }, fi = (e, t, n) => {
1095
+ let r = e.x, i = e.y, a = t.x - r, o = t.y - i, { w: s, h: c } = L(e);
1077
1096
  if (!n || n === "center" || a === 0 && o === 0) return {
1078
1097
  x: r,
1079
1098
  y: i
@@ -1083,20 +1102,20 @@ var b = {
1083
1102
  x: r + a * p,
1084
1103
  y: i + o * p
1085
1104
  };
1086
- }, si = t(() => {
1105
+ }, pi = t(() => {
1087
1106
  let e = /* @__PURE__ */ new Map();
1088
1107
  M.value.forEach((t) => {
1089
- let n = mn.value[t.id];
1108
+ let n = P.value[t.id];
1090
1109
  n && !n.hidden && (e.has(n.key) || e.set(n.key, []), e.get(n.key).push(t));
1091
1110
  });
1092
1111
  let t = {};
1093
1112
  return e.forEach((e, n) => {
1094
- let [r, i] = n.split("__"), a = P(r), o = P(i);
1113
+ let [r, i] = n.split("__"), a = F(r), o = F(i);
1095
1114
  if (!a || !o) return;
1096
1115
  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, m = e.length, ee = Ot;
1097
1116
  if (m > 1) {
1098
1117
  let e = (m - 1) / 2 * Ot, t = (e) => {
1099
- let { w: t, h: n } = I(e);
1118
+ let { w: t, h: n } = L(e);
1100
1119
  return Math.max(4, (Math.abs(f) * t + Math.abs(p) * n) / 2 - 6);
1101
1120
  }, n = Math.min(1, t(a) / e, t(o) / e);
1102
1121
  ee = Ot * Math.max(.35, n);
@@ -1115,12 +1134,12 @@ var b = {
1115
1134
  bulge: Math.min(l * .15, 50)
1116
1135
  };
1117
1136
  }), t;
1118
- }), ci = (e) => {
1119
- let t = mn.value[e.id], n = t && si.value[t.key];
1137
+ }), mi = (e) => {
1138
+ let t = P.value[e.id], n = t && pi.value[t.key];
1120
1139
  if (!n) return null;
1121
- let r = P(e.from), i = P(e.to);
1140
+ let r = F(e.from), i = F(e.to);
1122
1141
  if (!r || !i) return null;
1123
- let a = n.slots[e.id] || 0, o = a * n.gap, s = oi(r, i, e.fromAnchor), c = oi(i, r, e.toAnchor);
1142
+ let a = n.slots[e.id] || 0, o = a * n.gap, s = fi(r, i, e.fromAnchor), c = fi(i, r, e.toAnchor);
1124
1143
  return {
1125
1144
  frame: n,
1126
1145
  slot: a,
@@ -1133,12 +1152,12 @@ var b = {
1133
1152
  y: c.y + n.ny * o
1134
1153
  }
1135
1154
  };
1136
- }, li = (e) => {
1137
- let t = ci(e);
1155
+ }, hi = (e) => {
1156
+ let t = mi(e);
1138
1157
  if (!t) return "";
1139
1158
  let { from: n, to: r, frame: i, slot: a } = t, o = a * i.gap;
1140
- if (E.value === "straight") return `M ${n.x} ${n.y} L ${r.x} ${r.y}`;
1141
- if (E.value === "polyline") {
1159
+ if (Gt.value === "straight") return `M ${n.x} ${n.y} L ${r.x} ${r.y}`;
1160
+ if (Gt.value === "polyline") {
1142
1161
  if (i.dominant === "v") {
1143
1162
  let e = (n.y + r.y) / 2 + o;
1144
1163
  return `M ${n.x} ${n.y} L ${n.x} ${e} L ${r.x} ${e} L ${r.x} ${r.y}`;
@@ -1148,18 +1167,18 @@ var b = {
1148
1167
  }
1149
1168
  let s = (n.x + r.x) / 2 + i.nx * i.bulge, c = (n.y + r.y) / 2 + i.ny * i.bulge;
1150
1169
  return `M ${n.x} ${n.y} Q ${s} ${c} ${r.x} ${r.y}`;
1151
- }, ui = (e, t) => {
1152
- let n = ci(e);
1170
+ }, gi = (e, t) => {
1171
+ let n = mi(e);
1153
1172
  if (!n) return {
1154
1173
  x: 0,
1155
1174
  y: 0
1156
1175
  };
1157
1176
  let { from: r, to: i, frame: a, slot: o } = n, s = o * a.gap;
1158
- if (E.value === "straight") return {
1177
+ if (Gt.value === "straight") return {
1159
1178
  x: r.x + (i.x - r.x) * t,
1160
1179
  y: r.y + (i.y - r.y) * t
1161
1180
  };
1162
- if (E.value === "polyline") {
1181
+ if (Gt.value === "polyline") {
1163
1182
  if (a.dominant === "v") {
1164
1183
  let e = (r.y + i.y) / 2 + s, n = Math.abs(e - r.y), a = Math.abs(i.x - r.x), o = Math.abs(i.y - e), c = t * (n + a + o || 1);
1165
1184
  return c <= n ? {
@@ -1190,29 +1209,29 @@ var b = {
1190
1209
  x: (1 - t) * (1 - t) * r.x + 2 * (1 - t) * t * c + t * t * i.x,
1191
1210
  y: (1 - t) * (1 - t) * r.y + 2 * (1 - t) * t * l + t * t * i.y
1192
1211
  };
1193
- }, di = t(() => Y.value ? P(Y.value.fromId) : null), fi = t(() => Y.value && Y.value.overId ? P(Y.value.overId) : null), pi = t(() => di.value ? F(di.value) : "#00f0ff"), mi = t(() => {
1194
- let e = Y.value;
1212
+ }, _i = t(() => X.value ? F(X.value.fromId) : null), vi = t(() => X.value && X.value.overId ? F(X.value.overId) : null), yi = t(() => _i.value ? I(_i.value) : "#00f0ff"), bi = t(() => {
1213
+ let e = X.value;
1195
1214
  if (!e) return {
1196
1215
  x: 0,
1197
1216
  y: 0
1198
1217
  };
1199
- let t = fi.value;
1200
- return t && di.value ? oi(t, di.value, "edge") : {
1218
+ let t = vi.value;
1219
+ return t && _i.value ? fi(t, _i.value, "edge") : {
1201
1220
  x: e.px,
1202
1221
  y: e.py
1203
1222
  };
1204
- }), hi = t(() => {
1205
- let e = fi.value;
1223
+ }), xi = t(() => {
1224
+ let e = vi.value;
1206
1225
  if (!e) return null;
1207
- let t = L(e);
1226
+ let t = R(e);
1208
1227
  return {
1209
1228
  x: e.x + t.x - 4,
1210
1229
  y: e.y + t.y - 4,
1211
1230
  w: t.width + 8,
1212
1231
  h: t.height + 8
1213
1232
  };
1214
- }), gi = (e) => {
1215
- let t = e.nodeIds.map((e) => P(e)).filter(Boolean);
1233
+ }), Si = (e) => {
1234
+ let t = e.nodeIds.map((e) => F(e)).filter(Boolean);
1216
1235
  if (t.length === 0) return null;
1217
1236
  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;
1218
1237
  return {
@@ -1221,38 +1240,38 @@ var b = {
1221
1240
  width: a - r,
1222
1241
  height: o - i
1223
1242
  };
1224
- }, _i = t(() => v.groups.map((e) => ({
1243
+ }, Ci = t(() => v.groups.map((e) => ({
1225
1244
  ...e,
1226
- rect: gi(e)
1227
- })).filter((e) => e.rect)), Q = (e) => kn(e) ? Mn.value : (P(e.from), e.centerText && e.centerText.color || "#00f0ff"), vi = (e) => {
1228
- let t = mn.value[e.id];
1245
+ rect: Si(e)
1246
+ })).filter((e) => e.rect)), Q = (e) => On(e) ? Pn.value : (F(e.from), e.centerText && e.centerText.color || "#00f0ff"), wi = (e) => {
1247
+ let t = P.value[e.id];
1229
1248
  return !!t && !t.hidden;
1230
- }, yi = t(() => [...new Set(M.value.map(Q))].map((e) => ({
1249
+ }, Ti = t(() => [...new Set(M.value.map(Q))].map((e) => ({
1231
1250
  key: String(e).replace("#", ""),
1232
1251
  color: e
1233
- }))), bi = (e) => {
1252
+ }))), Ei = (e) => {
1234
1253
  let t = e.endMarker;
1235
1254
  if (!t || t === "none") return "";
1236
1255
  let n = Q(e) || "#00f0ff", r = String(n).replace("#", "");
1237
1256
  return `url(#${t === "dot" ? "edge-dot" : "edge-arrow"}-${r})`;
1238
- }, xi = /* @__PURE__ */ new Map(), Si = {
1257
+ }, Di = /* @__PURE__ */ new Map(), Oi = {
1239
1258
  nodes: null,
1240
1259
  edges: null,
1241
1260
  mode: null,
1242
1261
  epoch: -1
1243
- }, Ci = () => {
1244
- let e = Si;
1245
- (e.nodes !== T.value || e.edges !== M.value || e.mode !== E.value || e.epoch !== Rt) && (Si = {
1262
+ }, ki = () => {
1263
+ let e = Oi;
1264
+ (e.nodes !== T.value || e.edges !== M.value || e.mode !== Gt.value || e.epoch !== Rt) && (Oi = {
1246
1265
  nodes: T.value,
1247
1266
  edges: M.value,
1248
- mode: E.value,
1267
+ mode: Gt.value,
1249
1268
  epoch: Rt
1250
- }, xi = /* @__PURE__ */ new Map());
1269
+ }, Di = /* @__PURE__ */ new Map());
1251
1270
  }, $ = (e) => {
1252
- Ci();
1253
- let t = xi.get(e.id);
1254
- return t === void 0 && (t = li(e), xi.set(e.id, t)), t;
1255
- }, wi = (e, t = 1) => `${2 / e.speed * t}s`, Ti = (e) => `${3 / e.speed}s`, Ei = (e) => S(e).text, Di = (e) => !!e && String(S(e).text ?? "").trim() !== "", Oi = (e, t) => {
1271
+ ki();
1272
+ let t = Di.get(e.id);
1273
+ return t === void 0 && (t = hi(e), Di.set(e.id, t)), t;
1274
+ }, Ai = (e, t = 1) => `${2 / e.speed * t}s`, ji = (e) => `${3 / e.speed}s`, Mi = (e) => S(e).text, Ni = (e) => !!e && String(S(e).text ?? "").trim() !== "", Pi = (e, t) => {
1256
1275
  if (!e) return null;
1257
1276
  let n = S(e), r = Number(t.fontSize) || Number(n.fontSize) || 8, i = String(n.text ?? ""), a = 0;
1258
1277
  for (let e of i) a += e.charCodeAt(0) > 11904 ? 1 : .62;
@@ -1260,34 +1279,34 @@ var b = {
1260
1279
  w: Math.max(14, a * r + 8),
1261
1280
  h: Math.max(12, r + 6)
1262
1281
  };
1263
- }, ki = (e, t) => {
1264
- let n = ui(e, Math.max(0, t - .005)), r = ui(e, Math.min(1, t + .005));
1282
+ }, Fi = (e, t) => {
1283
+ let n = gi(e, Math.max(0, t - .005)), r = gi(e, Math.min(1, t + .005));
1265
1284
  return Math.atan2(r.y - n.y, r.x - n.x) * 180 / Math.PI;
1266
- }, Ai = (e) => {
1285
+ }, Ii = (e) => {
1267
1286
  let t = e % 180;
1268
1287
  return t > 90 && (t -= 180), t < -90 && (t += 180), t;
1269
- }, ji = (e, t, n) => `translate(${t.x}, ${t.y}) rotate(${(S(e).rotation || 0) + (n || 0)})`, Mi = t(() => {
1288
+ }, Li = (e, t, n) => `translate(${t.x}, ${t.y}) rotate(${(S(e).rotation || 0) + (n || 0)})`, Ri = t(() => {
1270
1289
  let e = [];
1271
- for (let t of U.value) {
1272
- let n = mn.value[t.id];
1290
+ for (let t of G.value) {
1291
+ let n = P.value[t.id];
1273
1292
  if (!n) continue;
1274
1293
  let r = n.merged && n.representative, i = !n.merged && (t.fromText || t.centerText || t.toText);
1275
1294
  if (!r && !i) continue;
1276
- let a = P(t.from), o = P(t.to);
1295
+ let a = F(t.from), o = F(t.to);
1277
1296
  a && o && e.push({
1278
1297
  id: t.id,
1279
1298
  edge: t,
1280
1299
  info: n,
1281
1300
  color: a && ie[a.type] || "#00f0ff",
1282
- start: ui(t, .28),
1283
- center: ui(t, .5),
1284
- end: ui(t, .72),
1285
- startAngle: Ai(ki(t, .28)),
1286
- centerAngle: Ai(ki(t, .5)),
1287
- endAngle: Ai(ki(t, .72)),
1288
- fromBox: Oi(t.fromText, t),
1289
- centerBox: Oi(t.centerText, t),
1290
- toBox: Oi(t.toText, t)
1301
+ start: gi(t, .28),
1302
+ center: gi(t, .5),
1303
+ end: gi(t, .72),
1304
+ startAngle: Ii(Fi(t, .28)),
1305
+ centerAngle: Ii(Fi(t, .5)),
1306
+ endAngle: Ii(Fi(t, .72)),
1307
+ fromBox: Pi(t.fromText, t),
1308
+ centerBox: Pi(t.centerText, t),
1309
+ toBox: Pi(t.toText, t)
1291
1310
  });
1292
1311
  }
1293
1312
  return e;
@@ -1301,29 +1320,29 @@ var b = {
1301
1320
  addEdges: un,
1302
1321
  updateNodes: dn,
1303
1322
  updateEdges: fn,
1304
- clientToSvg: qr,
1305
- svgToClient: Jr
1323
+ clientToSvg: Qr,
1324
+ svgToClient: $r
1306
1325
  }), (t, c) => (u(), r("svg", {
1307
1326
  ref_key: "svgRef",
1308
1327
  ref: O,
1309
1328
  class: "topology-svg",
1310
- style: s(mr.value),
1311
- viewBox: `${Un.value} ${Wn.value} ${V.value} ${H.value}`,
1312
- onMousedown: ar,
1313
- onMousemove: Fr,
1314
- onMouseup: Lr,
1315
- onMouseleave: Lr,
1316
- onClick: Rn,
1317
- onWheel: g(Xn, ["prevent"])
1329
+ style: s(gr.value),
1330
+ viewBox: `${Gn.value} ${Kn.value} ${U.value} ${W.value}`,
1331
+ onMousedown: sr,
1332
+ onMousemove: Br,
1333
+ onMouseup: Hr,
1334
+ onMouseleave: Hr,
1335
+ onClick: Bn,
1336
+ onWheel: g(Qn, ["prevent"])
1318
1337
  }, [
1319
1338
  i("defs", null, [
1320
1339
  c[3] ||= a("<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>", 2),
1321
1340
  i("radialGradient", {
1322
1341
  id: "bg-grid",
1323
- cx: yr.value.cx,
1324
- cy: yr.value.cy,
1325
- r: yr.value.r
1326
- }, [(u(!0), r(e, null, f(yr.value.stops, (e, t) => (u(), r("stop", {
1342
+ cx: xr.value.cx,
1343
+ cy: xr.value.cy,
1344
+ r: xr.value.r
1345
+ }, [(u(!0), r(e, null, f(xr.value.stops, (e, t) => (u(), r("stop", {
1327
1346
  key: `bg-stop-${t}`,
1328
1347
  offset: e.offset,
1329
1348
  "stop-color": e.color,
@@ -1350,7 +1369,7 @@ var b = {
1350
1369
  }, null, 8, de)
1351
1370
  ], 8, ce))), 128)),
1352
1371
  c[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),
1353
- (u(!0), r(e, null, f(yi.value, (e) => (u(), r("marker", {
1372
+ (u(!0), r(e, null, f(Ti.value, (e) => (u(), r("marker", {
1354
1373
  key: `m-arrow-${e.key}`,
1355
1374
  id: `edge-arrow-${e.key}`,
1356
1375
  viewBox: "0 0 10 10",
@@ -1364,7 +1383,7 @@ var b = {
1364
1383
  d: "M1,2.5 L9,5 L1,7.5 Z",
1365
1384
  fill: e.color
1366
1385
  }, null, 8, pe)], 8, fe))), 128)),
1367
- (u(!0), r(e, null, f(yi.value, (e) => (u(), r("marker", {
1386
+ (u(!0), r(e, null, f(Ti.value, (e) => (u(), r("marker", {
1368
1387
  key: `m-dot-${e.key}`,
1369
1388
  id: `edge-dot-${e.key}`,
1370
1389
  viewBox: "0 0 10 10",
@@ -1382,31 +1401,31 @@ var b = {
1382
1401
  }, null, 8, he)], 8, me))), 128))
1383
1402
  ]),
1384
1403
  i("rect", {
1385
- width: V.value,
1386
- height: H.value,
1387
- x: Un.value,
1388
- y: Wn.value,
1404
+ width: U.value,
1405
+ height: W.value,
1406
+ x: Gn.value,
1407
+ y: Kn.value,
1389
1408
  fill: "url(#bg-grid)"
1390
1409
  }, null, 8, ge),
1391
- hr.value ? (u(), r(e, { key: 0 }, [i("pattern", {
1410
+ _r.value ? (u(), r(e, { key: 0 }, [i("pattern", {
1392
1411
  id: "grid",
1393
- width: _r.value,
1394
- height: _r.value,
1412
+ width: yr.value,
1413
+ height: yr.value,
1395
1414
  patternUnits: "userSpaceOnUse"
1396
1415
  }, [i("path", {
1397
- d: `M ${_r.value} 0 L 0 0 0 ${_r.value}`,
1416
+ d: `M ${yr.value} 0 L 0 0 0 ${yr.value}`,
1398
1417
  fill: "none",
1399
- stroke: gr.value,
1418
+ stroke: vr.value,
1400
1419
  "stroke-width": "0.5"
1401
1420
  }, null, 8, ve)], 8, _e), i("rect", {
1402
- width: V.value,
1403
- height: H.value,
1404
- x: Un.value,
1405
- y: Wn.value,
1421
+ width: U.value,
1422
+ height: W.value,
1423
+ x: Gn.value,
1424
+ y: Kn.value,
1406
1425
  fill: "url(#grid)",
1407
- opacity: vr.value
1426
+ opacity: br.value
1408
1427
  }, null, 8, ye)], 64)) : n("", !0),
1409
- br.value ? (u(), r("g", be, [...c[5] ||= [
1428
+ Sr.value ? (u(), r("g", be, [...c[5] ||= [
1410
1429
  i("line", {
1411
1430
  x1: "-22",
1412
1431
  y1: "0",
@@ -1438,7 +1457,7 @@ var b = {
1438
1457
  opacity: "0.8"
1439
1458
  }, null, -1)
1440
1459
  ]])) : n("", !0),
1441
- (u(!0), r(e, null, f(_i.value, (e) => (u(), r("g", { key: e.id }, [
1460
+ (u(!0), r(e, null, f(Ci.value, (e) => (u(), r("g", { key: e.id }, [
1442
1461
  i("rect", {
1443
1462
  x: e.rect.x,
1444
1463
  y: e.rect.y,
@@ -1500,16 +1519,16 @@ var b = {
1500
1519
  "letter-spacing": "0.5"
1501
1520
  }, m(e.label), 9, De)
1502
1521
  ]))), 128)),
1503
- (u(!0), r(e, null, f(U.value, (e) => (u(), r("path", {
1522
+ (u(!0), r(e, null, f(G.value, (e) => (u(), r("path", {
1504
1523
  key: `base-${e.id}`,
1505
1524
  d: $(e),
1506
1525
  fill: "none",
1507
1526
  stroke: "#1a2744",
1508
1527
  "stroke-width": "2",
1509
1528
  "stroke-linecap": "round",
1510
- "marker-end": bi(e)
1529
+ "marker-end": Ei(e)
1511
1530
  }, null, 8, Oe))), 128)),
1512
- (u(!0), r(e, null, f(U.value, (t) => (u(), r(e, { key: `glow-${t.id}` }, [Dr.value ? (u(), r("path", {
1531
+ (u(!0), r(e, null, f(G.value, (t) => (u(), r(e, { key: `glow-${t.id}` }, [kr.value ? (u(), r("path", {
1513
1532
  key: 0,
1514
1533
  d: $(t),
1515
1534
  fill: "none",
@@ -1519,16 +1538,16 @@ var b = {
1519
1538
  opacity: "0.15",
1520
1539
  filter: "url(#glow-strong)"
1521
1540
  }, null, 8, ke)) : n("", !0)], 64))), 128)),
1522
- (u(!0), r(e, null, f(U.value, (t) => (u(), r(e, { key: `sel-${t.id}` }, [kn(t) ? (u(), r("path", {
1541
+ (u(!0), r(e, null, f(G.value, (t) => (u(), r(e, { key: `sel-${t.id}` }, [On(t) ? (u(), r("path", {
1523
1542
  key: 0,
1524
1543
  d: $(t),
1525
1544
  fill: "none",
1526
- stroke: Mn.value,
1545
+ stroke: Pn.value,
1527
1546
  "stroke-width": "4",
1528
1547
  opacity: "0.35",
1529
1548
  filter: "url(#glow-strong)"
1530
1549
  }, null, 8, Ae)) : n("", !0)], 64))), 128)),
1531
- (u(!0), r(e, null, f(U.value, (t) => (u(), r(e, { key: `flow-${t.id}` }, [Er.value ? (u(), r("g", je, [
1550
+ (u(!0), r(e, null, f(G.value, (t) => (u(), r(e, { key: `flow-${t.id}` }, [Or.value && jr(t) ? (u(), r("g", je, [
1532
1551
  i("path", {
1533
1552
  d: $(t),
1534
1553
  fill: "none",
@@ -1541,7 +1560,7 @@ var b = {
1541
1560
  attributeName: "stroke-dashoffset",
1542
1561
  from: "0",
1543
1562
  to: "-52",
1544
- dur: wi(t),
1563
+ dur: Ai(t),
1545
1564
  repeatCount: "indefinite"
1546
1565
  }, null, 8, Ne)], 8, Me),
1547
1566
  i("path", {
@@ -1556,7 +1575,7 @@ var b = {
1556
1575
  attributeName: "stroke-dashoffset",
1557
1576
  from: "-30",
1558
1577
  to: "-82",
1559
- dur: wi(t, 1.3),
1578
+ dur: Ai(t, 1.3),
1560
1579
  repeatCount: "indefinite"
1561
1580
  }, null, 8, Fe)], 8, Pe),
1562
1581
  i("path", {
@@ -1572,18 +1591,18 @@ var b = {
1572
1591
  attributeName: "stroke-dashoffset",
1573
1592
  from: "0",
1574
1593
  to: "-84",
1575
- dur: wi(t, .8),
1594
+ dur: Ai(t, .8),
1576
1595
  repeatCount: "indefinite"
1577
1596
  }, null, 8, Le)], 8, Ie)
1578
1597
  ])) : n("", !0)], 64))), 128)),
1579
- (u(!0), r(e, null, f(U.value, (t) => (u(), r(e, { key: `particle-${t.id}` }, [Er.value ? (u(), r("g", Re, [i("circle", {
1598
+ (u(!0), r(e, null, f(G.value, (t) => (u(), r(e, { key: `particle-${t.id}` }, [Or.value && jr(t) ? (u(), r("g", Re, [i("circle", {
1580
1599
  r: "3",
1581
1600
  fill: Q(t),
1582
1601
  opacity: "0.9",
1583
1602
  filter: "url(#glow-core)"
1584
1603
  }, [i("animateMotion", {
1585
1604
  path: $(t),
1586
- dur: Ti(t),
1605
+ dur: ji(t),
1587
1606
  repeatCount: "indefinite"
1588
1607
  }, null, 8, Be)], 8, ze), i("circle", {
1589
1608
  r: "8",
@@ -1592,10 +1611,10 @@ var b = {
1592
1611
  filter: "url(#glow-strong)"
1593
1612
  }, [i("animateMotion", {
1594
1613
  path: $(t),
1595
- dur: Ti(t),
1614
+ dur: ji(t),
1596
1615
  repeatCount: "indefinite"
1597
1616
  }, null, 8, He)], 8, Ve)])) : n("", !0)], 64))), 128)),
1598
- (u(!0), r(e, null, f(Mi.value, (t) => (u(), r(e, { key: `text-${t.id}` }, [t.info.merged && t.info.representative ? (u(), r("g", {
1617
+ (u(!0), r(e, null, f(Ri.value, (t) => (u(), r(e, { key: `text-${t.id}` }, [t.info.merged && t.info.representative ? (u(), r("g", {
1599
1618
  key: 0,
1600
1619
  transform: `translate(${t.center.x}, ${t.center.y}) rotate(${t.centerAngle})`
1601
1620
  }, [i("rect", {
@@ -1617,17 +1636,17 @@ var b = {
1617
1636
  "font-family": "'SF Mono', monospace",
1618
1637
  opacity: "1"
1619
1638
  }, m(t.info.count), 9, Ge)], 8, Ue)) : t.info.merged ? n("", !0) : (u(), r("g", Ke, [
1620
- Di(t.edge.fromText) ? (u(), r("g", {
1639
+ Ni(t.edge.fromText) ? (u(), r("g", {
1621
1640
  key: 0,
1622
- transform: ji(t.edge.fromText, t.start, t.startAngle)
1623
- }, [xr.value ? (u(), r("rect", {
1641
+ transform: Li(t.edge.fromText, t.start, t.startAngle)
1642
+ }, [Cr.value ? (u(), r("rect", {
1624
1643
  key: 0,
1625
1644
  x: -t.fromBox.w / 2,
1626
1645
  y: -t.fromBox.h / 2,
1627
1646
  width: t.fromBox.w,
1628
1647
  height: t.fromBox.h,
1629
1648
  rx: "3",
1630
- fill: Sr.value,
1649
+ fill: wr.value,
1631
1650
  opacity: "0.92",
1632
1651
  stroke: w(t.edge, t.edge.fromText),
1633
1652
  "stroke-opacity": "0.35",
@@ -1641,18 +1660,18 @@ var b = {
1641
1660
  "font-family": "'SF Mono', monospace",
1642
1661
  "font-weight": "500",
1643
1662
  opacity: "0.9"
1644
- }, m(Ei(t.edge.fromText)), 9, Ye)], 8, qe)) : n("", !0),
1645
- Di(t.edge.centerText) ? (u(), r("g", {
1663
+ }, m(Mi(t.edge.fromText)), 9, Ye)], 8, qe)) : n("", !0),
1664
+ Ni(t.edge.centerText) ? (u(), r("g", {
1646
1665
  key: 1,
1647
- transform: ji(t.edge.centerText, t.center, t.centerAngle)
1648
- }, [xr.value ? (u(), r("rect", {
1666
+ transform: Li(t.edge.centerText, t.center, t.centerAngle)
1667
+ }, [Cr.value ? (u(), r("rect", {
1649
1668
  key: 0,
1650
1669
  x: -t.centerBox.w / 2,
1651
1670
  y: -t.centerBox.h / 2,
1652
1671
  width: t.centerBox.w,
1653
1672
  height: t.centerBox.h,
1654
1673
  rx: "3",
1655
- fill: Sr.value,
1674
+ fill: wr.value,
1656
1675
  opacity: "0.92",
1657
1676
  stroke: w(t.edge, t.edge.centerText),
1658
1677
  "stroke-opacity": "0.35",
@@ -1666,18 +1685,18 @@ var b = {
1666
1685
  "font-family": "'SF Mono', monospace",
1667
1686
  "font-weight": "600",
1668
1687
  opacity: "1"
1669
- }, m(Ei(t.edge.centerText)), 9, Qe)], 8, Xe)) : n("", !0),
1670
- Di(t.edge.toText) ? (u(), r("g", {
1688
+ }, m(Mi(t.edge.centerText)), 9, Qe)], 8, Xe)) : n("", !0),
1689
+ Ni(t.edge.toText) ? (u(), r("g", {
1671
1690
  key: 2,
1672
- transform: ji(t.edge.toText, t.end, t.endAngle)
1673
- }, [xr.value ? (u(), r("rect", {
1691
+ transform: Li(t.edge.toText, t.end, t.endAngle)
1692
+ }, [Cr.value ? (u(), r("rect", {
1674
1693
  key: 0,
1675
1694
  x: -t.toBox.w / 2,
1676
1695
  y: -t.toBox.h / 2,
1677
1696
  width: t.toBox.w,
1678
1697
  height: t.toBox.h,
1679
1698
  rx: "3",
1680
- fill: Sr.value,
1699
+ fill: wr.value,
1681
1700
  opacity: "0.92",
1682
1701
  stroke: w(t.edge, t.edge.toText),
1683
1702
  "stroke-opacity": "0.35",
@@ -1691,42 +1710,42 @@ var b = {
1691
1710
  "font-family": "'SF Mono', monospace",
1692
1711
  "font-weight": "500",
1693
1712
  opacity: "0.9"
1694
- }, m(Ei(t.edge.toText)), 9, tt)], 8, $e)) : n("", !0)
1713
+ }, m(Mi(t.edge.toText)), 9, tt)], 8, $e)) : n("", !0)
1695
1714
  ]))], 64))), 128)),
1696
- Y.value ? (u(), r("g", nt, [
1715
+ X.value ? (u(), r("g", nt, [
1697
1716
  i("line", {
1698
- x1: Y.value.ax,
1699
- y1: Y.value.ay,
1700
- x2: mi.value.x,
1701
- y2: mi.value.y,
1702
- stroke: pi.value,
1717
+ x1: X.value.ax,
1718
+ y1: X.value.ay,
1719
+ x2: bi.value.x,
1720
+ y2: bi.value.y,
1721
+ stroke: yi.value,
1703
1722
  "stroke-width": "2",
1704
1723
  "stroke-dasharray": "6 6",
1705
1724
  "stroke-linecap": "round",
1706
1725
  opacity: "0.9"
1707
1726
  }, null, 8, rt),
1708
1727
  i("circle", {
1709
- cx: Y.value.px,
1710
- cy: Y.value.py,
1728
+ cx: X.value.px,
1729
+ cy: X.value.py,
1711
1730
  r: "3.5",
1712
- fill: pi.value,
1731
+ fill: yi.value,
1713
1732
  opacity: "0.9"
1714
1733
  }, null, 8, it),
1715
- Y.value.overId && hi.value ? (u(), r("rect", {
1734
+ X.value.overId && xi.value ? (u(), r("rect", {
1716
1735
  key: 0,
1717
- x: hi.value.x,
1718
- y: hi.value.y,
1719
- width: hi.value.w,
1720
- height: hi.value.h,
1736
+ x: xi.value.x,
1737
+ y: xi.value.y,
1738
+ width: xi.value.w,
1739
+ height: xi.value.h,
1721
1740
  rx: "6",
1722
1741
  fill: "none",
1723
- stroke: pi.value,
1742
+ stroke: yi.value,
1724
1743
  "stroke-width": "1.5",
1725
1744
  "stroke-dasharray": "6 4",
1726
1745
  opacity: "0.9"
1727
1746
  }, null, 8, at)) : n("", !0)
1728
1747
  ])) : n("", !0),
1729
- (u(!0), r(e, null, f(U.value, (e) => (u(), r("path", {
1748
+ (u(!0), r(e, null, f(G.value, (e) => (u(), r("path", {
1730
1749
  key: `hit-${e.id}`,
1731
1750
  d: $(e),
1732
1751
  fill: "none",
@@ -1736,85 +1755,85 @@ var b = {
1736
1755
  "pointer-events": "stroke",
1737
1756
  cursor: "pointer"
1738
1757
  },
1739
- onClick: g((t) => Nn(e, t), ["stop"])
1758
+ onClick: g((t) => Fn(e, t), ["stop"])
1740
1759
  }, null, 8, ot))), 128)),
1741
- (u(!0), r(e, null, f(Yn.value, (a) => (u(), r("g", {
1760
+ (u(!0), r(e, null, f(Zn.value, (a) => (u(), r("g", {
1742
1761
  key: a.id,
1743
1762
  transform: `translate(${a.x}, ${a.y})`,
1744
1763
  class: o(["topology-node", D.value === a.id ? "dragging" : ""]),
1745
- onMousedown: (e) => Mr(e, a.id),
1746
- onClick: (e) => jn(a, e),
1764
+ onMousedown: (e) => Ir(e, a.id),
1765
+ onClick: (e) => Nn(a, e),
1747
1766
  style: s({
1748
1767
  cursor: v.editable && v.config.nodeDraggable !== !1 ? "grab" : "default",
1749
- color: F(a)
1768
+ color: I(a)
1750
1769
  })
1751
1770
  }, [
1752
1771
  i("rect", {
1753
1772
  class: "node-hit-area",
1754
- x: wn(a).x,
1755
- y: wn(a).y,
1756
- width: wn(a).width,
1757
- height: wn(a).height,
1773
+ x: Cn(a).x,
1774
+ y: Cn(a).y,
1775
+ width: Cn(a).width,
1776
+ height: Cn(a).height,
1758
1777
  fill: "transparent",
1759
1778
  "pointer-events": "all"
1760
1779
  }, null, 8, ct),
1761
- Dn(a) && _.viewMode !== "3d" ? (u(), r("rect", {
1780
+ En(a) && _.viewMode !== "3d" ? (u(), r("rect", {
1762
1781
  key: 0,
1763
- x: L(a).x,
1764
- y: L(a).y,
1765
- width: L(a).width,
1766
- height: L(a).height,
1767
- rx: "6",
1768
- fill: Dn(a),
1782
+ x: R(a).x,
1783
+ y: R(a).y,
1784
+ width: R(a).width,
1785
+ height: R(a).height,
1786
+ rx: Fr(a),
1787
+ fill: En(a),
1769
1788
  opacity: "0.15"
1770
1789
  }, null, 8, lt)) : n("", !0),
1771
- En(a) && _.viewMode !== "3d" ? (u(), r("rect", {
1790
+ Tn(a) && _.viewMode !== "3d" ? (u(), r("rect", {
1772
1791
  key: 1,
1773
- x: En(a).x,
1774
- y: En(a).y,
1775
- width: En(a).width,
1776
- height: En(a).height,
1777
- rx: "6",
1792
+ x: Tn(a).x,
1793
+ y: Tn(a).y,
1794
+ width: Tn(a).width,
1795
+ height: Tn(a).height,
1796
+ rx: Fr(a),
1778
1797
  fill: "none",
1779
- stroke: kr(a),
1780
- "stroke-width": Ar(a),
1781
- "stroke-dasharray": jr(a),
1798
+ stroke: Mr(a),
1799
+ "stroke-width": Nr(a),
1800
+ "stroke-dasharray": Pr(a),
1782
1801
  opacity: "0.8"
1783
1802
  }, null, 8, ut)) : n("", !0),
1784
- On(a) && _.viewMode !== "3d" ? (u(), r("rect", {
1803
+ Dn(a) && _.viewMode !== "3d" ? (u(), r("rect", {
1785
1804
  key: 2,
1786
- x: L(a).x,
1787
- y: L(a).y,
1788
- width: L(a).width,
1789
- height: L(a).height,
1790
- rx: "6",
1805
+ x: R(a).x,
1806
+ y: R(a).y,
1807
+ width: R(a).width,
1808
+ height: R(a).height,
1809
+ rx: Fr(a),
1791
1810
  fill: "none",
1792
- stroke: An.value,
1811
+ stroke: Mn.value,
1793
1812
  "stroke-width": "2.5",
1794
1813
  transform: "scale(1.1)",
1795
1814
  style: { "pointer-events": "none" }
1796
1815
  }, null, 8, dt)) : n("", !0),
1797
- _n(a) ? (u(), r(e, { key: 3 }, [i("rect", {
1816
+ gn(a) ? (u(), r(e, { key: 3 }, [i("rect", {
1798
1817
  x: "-4",
1799
1818
  y: "-10",
1800
1819
  width: "8",
1801
1820
  height: "20",
1802
- fill: gn(a).color,
1821
+ fill: hn(a).color,
1803
1822
  opacity: "0.06"
1804
1823
  }, null, 8, ft), i("text", {
1805
1824
  y: "4",
1806
1825
  transform: `rotate(${a.rotation || 0} 0 4)`,
1807
1826
  "text-anchor": "middle",
1808
- fill: Vt(a) || F(a) || gn(a).color,
1827
+ fill: Vt(a) || I(a) || hn(a).color,
1809
1828
  "font-size": Bt(a, 12),
1810
1829
  "font-family": "'SF Mono', 'Cascadia Code', 'Consolas', monospace",
1811
1830
  "font-weight": "600"
1812
1831
  }, m(a.label), 9, pt)], 64)) : (u(), r(e, { key: 4 }, [
1813
- i("g", { transform: bn(a) }, [a.state !== "none" && Or.value ? (u(), r("circle", {
1832
+ i("g", { transform: yn(a) }, [a.state !== "none" && Ar.value ? (u(), r("circle", {
1814
1833
  key: 0,
1815
1834
  r: "30",
1816
1835
  fill: "none",
1817
- stroke: gn(a).color,
1836
+ stroke: hn(a).color,
1818
1837
  "stroke-width": "2.5",
1819
1838
  opacity: "0"
1820
1839
  }, [...c[6] ||= [i("animate", {
@@ -1829,7 +1848,7 @@ var b = {
1829
1848
  repeatCount: "indefinite"
1830
1849
  }, null, -1)]], 8, ht)) : n("", !0), i("g", gt, [p(t.$slots, "node-icon", {
1831
1850
  node: a,
1832
- color: F(a),
1851
+ color: I(a),
1833
1852
  viewMode: _.viewMode
1834
1853
  }, () => [i("rect", {
1835
1854
  x: "-18",
@@ -1837,21 +1856,21 @@ var b = {
1837
1856
  width: "36",
1838
1857
  height: "36",
1839
1858
  rx: "6",
1840
- fill: F(a),
1859
+ fill: I(a),
1841
1860
  opacity: "0.9"
1842
1861
  }, null, 8, _t)])])], 8, mt),
1843
- wr.value ? (u(), r("g", {
1862
+ Er.value ? (u(), r("g", {
1844
1863
  key: 0,
1845
- transform: xn(a)
1864
+ transform: bn(a)
1846
1865
  }, [i("circle", {
1847
1866
  r: "4",
1848
- fill: gn(a).color,
1867
+ fill: hn(a).color,
1849
1868
  stroke: "#0a0e1a",
1850
1869
  "stroke-width": "2"
1851
1870
  }, null, 8, yt)], 8, vt)) : n("", !0),
1852
1871
  i("text", {
1853
- y: Cn(a),
1854
- transform: `rotate(${a.rotation || 0} 0 ${Cn(a)})`,
1872
+ y: Sn(a),
1873
+ transform: `rotate(${a.rotation || 0} 0 ${Sn(a)})`,
1855
1874
  "text-anchor": "middle",
1856
1875
  fill: Vt(a),
1857
1876
  "font-size": Bt(a),
@@ -1864,42 +1883,42 @@ var b = {
1864
1883
  dy: t === 0 ? 0 : "1.2em"
1865
1884
  }, m(e), 9, xt))), 128))], 8, bt)
1866
1885
  ], 64)),
1867
- Cr.value ? (u(), r("g", St, [(u(!0), r(e, null, f(Kr(a), (e) => (u(), r("circle", {
1886
+ Tr.value ? (u(), r("g", St, [(u(!0), r(e, null, f(Zr(a), (e) => (u(), r("circle", {
1868
1887
  key: e.side,
1869
1888
  cx: e.x,
1870
1889
  cy: e.y,
1871
1890
  r: "4.5",
1872
1891
  class: "node-handle",
1873
1892
  fill: "#0a0e1a",
1874
- stroke: F(a),
1893
+ stroke: I(a),
1875
1894
  "stroke-width": "1.5",
1876
- onPointerdown: g((t) => Yr(t, a.id, e), ["stop", "prevent"]),
1877
- onPointermove: g(ii, ["stop"]),
1878
- onPointerup: g(ai, ["stop"]),
1879
- onPointercancel: g(ai, ["stop"]),
1880
- onLostpointercapture: ai,
1895
+ onPointerdown: g((t) => ei(t, a.id, e), ["stop", "prevent"]),
1896
+ onPointermove: g(ui, ["stop"]),
1897
+ onPointerup: g(di, ["stop"]),
1898
+ onPointercancel: g(di, ["stop"]),
1899
+ onLostpointercapture: di,
1881
1900
  onMousedown: c[0] ||= g(() => {}, ["stop", "prevent"]),
1882
1901
  onClick: c[1] ||= g(() => {}, ["stop"])
1883
1902
  }, null, 40, Ct))), 128))])) : n("", !0)
1884
1903
  ], 46, st))), 128)),
1885
- Gr.value ? (u(), r("g", wt, [(u(!0), r(e, null, f(zr(Gr.value), (e) => (u(), r("rect", {
1904
+ Xr.value ? (u(), r("g", wt, [(u(!0), r(e, null, f(Wr(Xr.value), (e) => (u(), r("rect", {
1886
1905
  key: e.side,
1887
- x: Gr.value.x + e.x - 4.5,
1888
- y: Gr.value.y + e.y - 4.5,
1906
+ x: Xr.value.x + e.x - 4.5,
1907
+ y: Xr.value.y + e.y - 4.5,
1889
1908
  width: "9",
1890
1909
  height: "9",
1891
1910
  rx: "2",
1892
1911
  class: o(["node-resize-handle", `rt-${e.side}`]),
1893
- onMousedown: g((t) => Vr(t, Gr.value, e.side), ["stop", "prevent"]),
1912
+ onMousedown: g((t) => Kr(t, Xr.value, e.side), ["stop", "prevent"]),
1894
1913
  onClick: c[2] ||= g(() => {}, ["stop"])
1895
1914
  }, null, 42, Tt))), 128))])) : n("", !0),
1896
- G.value ? (u(), r("rect", {
1915
+ q.value ? (u(), r("rect", {
1897
1916
  key: 4,
1898
1917
  class: "marquee-box",
1899
- x: nr.value.x,
1900
- y: nr.value.y,
1901
- width: nr.value.width,
1902
- height: nr.value.height,
1918
+ x: ir.value.x,
1919
+ y: ir.value.y,
1920
+ width: ir.value.width,
1921
+ height: ir.value.height,
1903
1922
  rx: "2",
1904
1923
  "vector-effect": "non-scaling-stroke"
1905
1924
  }, null, 8, Et)) : n("", !0)