vue3-network-graph 0.1.2 → 0.1.4

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",
@@ -216,7 +219,7 @@ var b = {
216
219
  "font-size",
217
220
  "font-weight"
218
221
  ], xt = ["dy"], St = {
219
- key: 5,
222
+ key: 6,
220
223
  class: "node-handles"
221
224
  }, Ct = [
222
225
  "cx",
@@ -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 = w.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 = w.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 && (w.value = w.value.filter((t) => !e.has(t.id)), T()), 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 && (w.value = w.value.filter((t) => !e.has(t.id)), T()), 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
  })));
@@ -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) ? (w.value = JSON.parse(JSON.stringify(t.nodes)), T()) : (w.value = (Array.isArray(v.nodes) ? v.nodes : []).map((e) => ({ ...e })), Wt = w.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) ? (w.value = JSON.parse(JSON.stringify(t.nodes)), T()) : (w.value = (Array.isArray(v.nodes) ? v.nodes : []).map((e) => ({ ...e })), Wt = w.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
  Bt();
@@ -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,11 +524,11 @@ 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 w.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.nodeType === "text", _n = (e) => e.nodeType === "border-only", vn = (e, t) => {
529
532
  let n = Number(e);
530
533
  return Number.isFinite(n) && n > 0 ? n : t;
531
534
  }, yn = (e) => {
@@ -538,14 +541,18 @@ var b = {
538
541
  let { sx: t, sy: n } = yn(e);
539
542
  return t === 1 && n === 1 ? "" : `scale(${t}, ${n})`;
540
543
  }, xn = (e) => {
541
- let { w: t, h: n } = I(e), r = Math.min(10, t * .3), i = Math.min(10, n * .3);
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;
546
+ }, Sn = t(() => {
547
+ let e = Number(v.config.labelGap);
548
+ return Number.isFinite(e) && e >= 0 ? e : 18;
549
+ }), Cn = (e) => {
550
+ if (gn(e)) return 4;
551
+ let { h: t } = L(e);
552
+ return e.labelPosition === "top" ? -(t / 2 + Sn.value) : e.labelPosition === "center" ? 0 : t / 2 + Sn.value;
553
+ }, wn = (e) => {
554
+ let t = R(e);
555
+ if (gn(e) || !e.label) return t;
549
556
  let n = Vt(e), r = Cn(e);
550
557
  if (e.labelPosition === "top") {
551
558
  let e = r - n - 4;
@@ -555,28 +562,28 @@ 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
+ }, Tn = (e) => e.borderColor !== void 0 || e.borderWidth !== void 0 || e.borderStyle !== void 0, L = (e) => {
566
+ let t = gn(e), n = _n(e);
560
567
  return {
561
- w: vn(e.width, t ? Math.max(60, String(e.label).length * 7 + 16) : At),
562
- h: vn(e.height, t ? 26 : At)
568
+ w: vn(e.width, t ? Math.max(60, String(e.label).length * 7 + 16) : n ? Math.max(80, String(e.label).length * 8 + 24) : At),
569
+ h: vn(e.height, t ? 26 : n ? 40 : At)
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
+ }, En = (e) => Tn(e) ? R(e) : null, Dn = (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 On = (e) => z.value.includes(e.id), kn = (e) => B.value.includes(e.id), V = () => {
575
582
  y("selection-change", {
576
- nodes: w.value.filter((e) => R.value.includes(e.id)),
577
- edges: M.value.filter((e) => z.value.includes(e.id))
583
+ nodes: w.value.filter((e) => z.value.includes(e.id)),
584
+ edges: M.value.filter((e) => B.value.includes(e.id))
578
585
  });
579
- }, An = (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, jn = t(() => An(v.config.maxSelectNodes)), Mn = t(() => An(v.config.maxSelectEdges)), V = (e, t, n) => {
586
+ }, An = (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, jn = t(() => An(v.config.maxSelectNodes)), Mn = t(() => An(v.config.maxSelectEdges)), H = (e, t, n) => {
580
587
  let r = new Set(e), i = [];
581
588
  for (let e of t) r.has(e) || (r.add(e), i.push(e));
582
589
  if (n === Infinity) return [...e, ...i];
@@ -585,93 +592,117 @@ var b = {
585
592
  };
586
593
  h([jn, Mn], ([e, t]) => {
587
594
  let n = !1;
588
- 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();
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();
589
596
  });
590
597
  let Nn = t(() => v.config.selectedBorderColor || "#fbbf24"), Pn = (e, t) => {
591
- if (!zn()) {
598
+ if (!Wn()) {
592
599
  if (t && (t.ctrlKey || t.metaKey)) {
593
- let t = R.value.indexOf(e.id);
594
- t >= 0 ? R.value.splice(t, 1) : R.value = V(R.value, [e.id], jn.value);
600
+ let t = z.value.indexOf(e.id);
601
+ t >= 0 ? z.value.splice(t, 1) : z.value = H(z.value, [e.id], jn.value);
595
602
  } else {
596
- let t = R.value.length === 1 && R.value[0] === e.id;
597
- R.value = t ? [] : V([], [e.id], jn.value), z.value = [];
603
+ let t = z.value.length === 1 && z.value[0] === e.id;
604
+ z.value = t ? [] : H([], [e.id], jn.value), B.value = [];
598
605
  }
599
- y("node-click", e), y("node-select", On(e) ? e : null), B();
606
+ y("node-click", e), y("node-select", On(e) ? e : null), V();
600
607
  }
601
- }, Fn = t(() => v.config.selectedLineColor || "#fbbf24"), In = (e, t) => {
602
- if (zn()) return;
603
- let n = mn.value[e.id], r = !!(n && n.merged && n.representative), i = r ? M.value.filter((e) => {
604
- let t = mn.value[e.id];
608
+ }, Fn = (e) => {
609
+ let t = w.value.find((t) => t.id === e);
610
+ if (!t || v.config.enableZOrder === !1) return !1;
611
+ let n = t.zIndex ?? 0, r = w.value.filter((e) => (e.zIndex ?? 0) > n);
612
+ return r.length !== 0 && (t.zIndex = Math.min(...r.map((e) => e.zIndex ?? 0)), !0);
613
+ }, In = (e) => {
614
+ let t = w.value.find((t) => t.id === e);
615
+ if (!t || v.config.enableZOrder === !1) return !1;
616
+ let n = t.zIndex ?? 0, r = w.value.filter((e) => (e.zIndex ?? 0) < n);
617
+ return r.length !== 0 && (t.zIndex = Math.max(...r.map((e) => e.zIndex ?? 0)), !0);
618
+ }, Ln = (e) => {
619
+ let t = w.value.find((t) => t.id === e);
620
+ return !t || v.config.enableZOrder === !1 ? !1 : (t.zIndex = Math.max(...w.value.map((e) => e.zIndex ?? 0), 0) + 1, !0);
621
+ }, Rn = (e) => {
622
+ let t = w.value.find((t) => t.id === e);
623
+ return !t || v.config.enableZOrder === !1 ? !1 : (t.zIndex = Math.min(...w.value.map((e) => e.zIndex ?? 0), 0) - 1, !0);
624
+ }, zn = () => {
625
+ if (!O.value) return;
626
+ let e = O.value.cloneNode(!0);
627
+ e.querySelectorAll("animate, animateMotion, animateTransform, set").forEach((e) => e.remove()), e.querySelectorAll(".center-crosshair").forEach((e) => e.remove()), e.setAttribute("width", U.value || "800"), e.setAttribute("height", W.value || "600");
628
+ let t = new XMLSerializer().serializeToString(e);
629
+ t = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + t;
630
+ let n = new Blob([t], { type: "image/svg+xml;charset=utf-8" }), r = URL.createObjectURL(n), i = document.createElement("a");
631
+ 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);
632
+ }, Bn = t(() => v.config.selectedLineColor || "#fbbf24"), Vn = (e, t) => {
633
+ if (Wn()) return;
634
+ let n = P.value[e.id], r = !!(n && n.merged && n.representative), i = r ? M.value.filter((e) => {
635
+ let t = P.value[e.id];
605
636
  return t && t.key === n.key;
606
637
  }) : null, a = r ? i.map((e) => e.id) : [e.id], o = r ? {
607
638
  ...e,
608
639
  bundleEdges: i
609
640
  } : e;
610
- 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, Mn.value);
641
+ 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, Mn.value);
611
642
  else {
612
- let e = a.length === z.value.length && a.every((e) => z.value.includes(e));
613
- z.value = e ? [] : V([], a, Mn.value), R.value = [];
643
+ let e = a.length === B.value.length && a.every((e) => B.value.includes(e));
644
+ B.value = e ? [] : H([], a, Mn.value), z.value = [];
614
645
  }
615
- y("edge-select", kn(e) ? o : null), B();
616
- }, Ln = 0, Rn = (e = 200) => {
617
- Ln = performance.now() + e;
618
- }, zn = () => performance.now() < Ln, Bn = () => {
619
- R.value = [], z.value = [], y("node-select", null), y("edge-select", null), B();
620
- }, Vn = (e) => {
621
- if (zn()) return;
646
+ y("edge-select", kn(e) ? o : null), V();
647
+ }, Hn = 0, Un = (e = 200) => {
648
+ Hn = performance.now() + e;
649
+ }, Wn = () => performance.now() < Hn, Gn = () => {
650
+ z.value = [], B.value = [], y("node-select", null), y("edge-select", null), V();
651
+ }, Kn = (e) => {
652
+ if (Wn()) return;
622
653
  let t = e.target;
623
- t && t.closest && (t.closest(".topology-node") || t.closest(".node-resize-layer") || t.closest(".node-handles")) || Bn();
624
- }, Hn = d({
654
+ t && t.closest && (t.closest(".topology-node") || t.closest(".node-resize-layer") || t.closest(".node-handles")) || Gn();
655
+ }, qn = d({
625
656
  width: 1e3,
626
657
  height: 650
627
- }), Un = d(1), Wn = d(0), Gn = d(0), Kn = t(() => -Jn.value / 2 + Wn.value), qn = t(() => -Yn.value / 2 + Gn.value), Jn = t(() => v.width ?? Hn.value.width), Yn = t(() => v.height ?? Hn.value.height), Xn = null;
658
+ }), Jn = d(1), Yn = d(0), Xn = d(0), Zn = t(() => -$n.value / 2 + Yn.value), Qn = t(() => -er.value / 2 + Xn.value), $n = t(() => v.width ?? qn.value.width), er = t(() => v.height ?? qn.value.height), tr = null;
628
659
  l(() => {
629
660
  let e = O.value;
630
661
  if (e) {
631
662
  let t = e.getBoundingClientRect();
632
- t.width > 0 && t.height > 0 && (Hn.value = {
663
+ t.width > 0 && t.height > 0 && (qn.value = {
633
664
  width: t.width,
634
665
  height: t.height
635
666
  });
636
667
  }
637
- e && typeof ResizeObserver < "u" && (Xn = new ResizeObserver(() => {
668
+ e && typeof ResizeObserver < "u" && (tr = new ResizeObserver(() => {
638
669
  let t = e.getBoundingClientRect();
639
- t.width > 0 && t.height > 0 && (Hn.value = {
670
+ t.width > 0 && t.height > 0 && (qn.value = {
640
671
  width: t.width,
641
672
  height: t.height
642
673
  });
643
- }), Xn.observe(e));
674
+ }), tr.observe(e));
644
675
  }), c(() => {
645
- Xn &&= (Xn.disconnect(), null), Lr &&= (cancelAnimationFrame(Lr), 0), q &&= (cancelAnimationFrame(q), 0), Z &&= (cancelAnimationFrame(Z), 0), si(), hr();
676
+ tr &&= (tr.disconnect(), null), Wr &&= (cancelAnimationFrame(Wr), 0), hr &&= (cancelAnimationFrame(hr), 0), Z &&= (cancelAnimationFrame(Z), 0), mi(), xr();
646
677
  });
647
- let H = t(() => Jn.value / Un.value), U = t(() => Yn.value / Un.value), Zn = t(() => ({
648
- x0: Kn.value - Nt,
649
- y0: qn.value - Nt,
650
- x1: Kn.value + H.value + Nt,
651
- y1: qn.value + U.value + Nt
652
- })), Qn = t(() => {
653
- let e = Zn.value;
654
- return w.value.filter((t) => {
655
- let { w: n, h: r } = I(t);
678
+ let U = t(() => $n.value / Jn.value), W = t(() => er.value / Jn.value), nr = t(() => ({
679
+ x0: Zn.value - Nt,
680
+ y0: Qn.value - Nt,
681
+ x1: Zn.value + U.value + Nt,
682
+ y1: Qn.value + W.value + Nt
683
+ })), rr = t(() => {
684
+ let e = nr.value, t = w.value.filter((t) => {
685
+ let { w: n, h: r } = L(t);
656
686
  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;
657
687
  });
658
- }), W = t(() => {
659
- let e = Zn.value;
688
+ return v.config.enableZOrder !== !1 && t.sort((e, t) => (e.zIndex ?? 0) - (t.zIndex ?? 0)), t;
689
+ }), G = t(() => {
690
+ let e = nr.value;
660
691
  return M.value.filter((t) => {
661
- if (!Ci(t)) return !1;
662
- let n = P(t.from), r = P(t.to);
692
+ if (!Ai(t)) return !1;
693
+ let n = F(t.from), r = F(t.to);
663
694
  if (!n || !r) return !1;
664
- let i = I(n).w / 2, a = I(n).h / 2, o = I(r).w / 2, s = I(r).h / 2;
695
+ let i = L(n).w / 2, a = L(n).h / 2, o = L(r).w / 2, s = L(r).h / 2;
665
696
  return Math.min(n.x - i, r.x - o) - Pt <= e.x1 && Math.max(n.x + i, r.x + o) + Pt >= e.x0 && Math.min(n.y - a, r.y - s) - Pt <= e.y1 && Math.max(n.y + a, r.y + s) + Pt >= e.y0;
666
697
  });
667
- }), $n = (e) => {
698
+ }), ir = (e) => {
668
699
  if (v.config.enableZoom === !1) return;
669
700
  e.preventDefault();
670
- let t = O.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(Mt, Math.max(jt, Un.value * c)), u = Jn.value / l, d = Yn.value / l;
671
- Wn.value += (o - u) * i, Gn.value += (s - d) * a, Un.value = l;
672
- }, G = d(null), K = d(null), er = (e) => {
701
+ 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(Mt, Math.max(jt, Jn.value * c)), u = $n.value / l, d = er.value / l;
702
+ Yn.value += (o - u) * i, Xn.value += (s - d) * a, Jn.value = l;
703
+ }, K = d(null), q = d(null), ar = (e) => {
673
704
  let t = O.value, n = t ? t.getBoundingClientRect() : null;
674
- G.value = {
705
+ K.value = {
675
706
  startX: e.clientX,
676
707
  startY: e.clientY,
677
708
  lastX: e.clientX,
@@ -679,9 +710,9 @@ var b = {
679
710
  moved: !1,
680
711
  rectWidth: n && n.width ? n.width : 0,
681
712
  rectHeight: n && n.height ? n.height : 0
682
- }, mr();
683
- }, tr = (e) => {
684
- let t = G.value, n = O.value;
713
+ }, br();
714
+ }, or = (e) => {
715
+ let t = K.value, n = O.value;
685
716
  if (!t || !n) return;
686
717
  let r = t.rectWidth, i = t.rectHeight;
687
718
  if (!r || !i) return;
@@ -691,13 +722,13 @@ var b = {
691
722
  return;
692
723
  }
693
724
  let a = e.clientX - t.lastX, o = e.clientY - t.lastY;
694
- t.lastX = e.clientX, t.lastY = e.clientY, Wn.value -= a * (H.value / r), Gn.value -= o * (U.value / i);
695
- }, nr = () => {
696
- let e = G.value;
697
- G.value = null, e && e.moved && Rn(), gr();
698
- }, rr = (e) => {
725
+ t.lastX = e.clientX, t.lastY = e.clientY, Yn.value -= a * (U.value / r), Xn.value -= o * (W.value / i);
726
+ }, sr = () => {
727
+ let e = K.value;
728
+ K.value = null, e && e.moved && Un(), Sr();
729
+ }, cr = (e) => {
699
730
  let t = X(e);
700
- K.value = {
731
+ q.value = {
701
732
  start: {
702
733
  x: t.x,
703
734
  y: t.y
@@ -709,17 +740,17 @@ var b = {
709
740
  startClientX: e.clientX,
710
741
  startClientY: e.clientY,
711
742
  moved: !1
712
- }, mr();
713
- }, ir = (e) => {
714
- let t = K.value;
743
+ }, br();
744
+ }, lr = (e) => {
745
+ let t = q.value;
715
746
  if (!t) return;
716
747
  let n = X(e);
717
748
  t.current = {
718
749
  x: n.x,
719
750
  y: n.y
720
751
  }, !t.moved && Math.hypot(e.clientX - t.startClientX, e.clientY - t.startClientY) > 3 && (t.moved = !0);
721
- }, ar = t(() => {
722
- let e = K.value;
752
+ }, ur = t(() => {
753
+ let e = q.value;
723
754
  return e ? {
724
755
  x: Math.min(e.start.x, e.current.x),
725
756
  y: Math.min(e.start.y, e.current.y),
@@ -731,62 +762,62 @@ var b = {
731
762
  width: 0,
732
763
  height: 0
733
764
  };
734
- }), or = () => {
735
- let e = K.value;
736
- if (K.value = null, e && e.moved) {
765
+ }), dr = () => {
766
+ let e = q.value;
767
+ if (q.value = null, e && e.moved) {
737
768
  let t = {
738
769
  x: Math.min(e.start.x, e.current.x),
739
770
  y: Math.min(e.start.y, e.current.y),
740
771
  w: Math.abs(e.current.x - e.start.x),
741
772
  h: Math.abs(e.current.y - e.start.y)
742
773
  }, n = w.value.filter((e) => {
743
- let n = L(e), r = e.x + n.x, i = e.y + n.y;
774
+ let n = R(e), r = e.x + n.x, i = e.y + n.y;
744
775
  return !(r + n.width < t.x || r > t.x + t.w || i + n.height < t.y || i > t.y + t.h);
745
776
  });
746
- n.length && (R.value = V(R.value, n.map((e) => e.id), jn.value), B()), Rn();
777
+ n.length && (z.value = H(z.value, n.map((e) => e.id), jn.value), V()), Un();
747
778
  }
748
- gr();
749
- }, sr = (e) => !e || typeof e.closest != "function" ? !1 : !!(e.closest(".topology-node") || e.closest(".node-handles") || e.closest(".node-resize-layer")), cr = (e) => {
779
+ Sr();
780
+ }, fr = (e) => !e || typeof e.closest != "function" ? !1 : !!(e.closest(".topology-node") || e.closest(".node-handles") || e.closest(".node-resize-layer")), pr = (e) => {
750
781
  if (O.value) {
751
782
  if (e.button === 1) {
752
783
  if (v.config.enablePan === !1) return;
753
- e.preventDefault(), er(e);
784
+ e.preventDefault(), ar(e);
754
785
  return;
755
786
  }
756
- if (e.button === 0 && !sr(e.target)) {
787
+ if (e.button === 0 && !fr(e.target)) {
757
788
  if (e.ctrlKey || e.metaKey) {
758
789
  if (v.config.enableMarquee === !1) return;
759
- e.preventDefault(), rr(e);
790
+ e.preventDefault(), cr(e);
760
791
  return;
761
792
  }
762
- v.config.enablePan !== !1 && (e.preventDefault(), er(e));
793
+ v.config.enablePan !== !1 && (e.preventDefault(), ar(e));
763
794
  }
764
795
  }
765
- }, lr = !1, q = 0, ur = null, dr = () => {
766
- q = 0;
767
- let e = ur;
768
- ur = null, e && (G.value ? tr(e) : K.value && ir(e));
769
- }, fr = (e) => {
770
- ur = e, q ||= requestAnimationFrame(dr);
771
- }, pr = () => {
772
- q && (cancelAnimationFrame(q), dr()), G.value && nr(), K.value && or();
773
- }, mr = () => {
774
- lr || (lr = !0, window.addEventListener("mousemove", fr, !0), window.addEventListener("mouseup", pr, !0));
775
- }, hr = () => {
776
- lr && (lr = !1, window.removeEventListener("mousemove", fr, !0), window.removeEventListener("mouseup", pr, !0));
777
- }, gr = () => {
778
- !G.value && !K.value && hr();
779
- }, _r = t(() => {
780
- if (J.value && J.value.side) return { cursor: Gr(J.value.side) };
781
- if (K.value) return { cursor: "crosshair" };
782
- if (G.value && G.value.moved) return { cursor: "grabbing" };
783
- }), vr = t(() => v.config.showGrid !== !1), yr = t(() => v.config.gridColor || "#1a2240"), br = t(() => {
796
+ }, mr = !1, hr = 0, gr = null, _r = () => {
797
+ hr = 0;
798
+ let e = gr;
799
+ gr = null, e && (K.value ? or(e) : q.value && lr(e));
800
+ }, vr = (e) => {
801
+ gr = e, hr ||= requestAnimationFrame(_r);
802
+ }, yr = () => {
803
+ hr && (cancelAnimationFrame(hr), _r()), K.value && sr(), q.value && dr();
804
+ }, br = () => {
805
+ mr || (mr = !0, window.addEventListener("mousemove", vr, !0), window.addEventListener("mouseup", yr, !0));
806
+ }, xr = () => {
807
+ mr && (mr = !1, window.removeEventListener("mousemove", vr, !0), window.removeEventListener("mouseup", yr, !0));
808
+ }, Sr = () => {
809
+ !K.value && !q.value && xr();
810
+ }, Cr = t(() => {
811
+ if (J.value && J.value.side) return { cursor: Qr(J.value.side) };
812
+ if (q.value) return { cursor: "crosshair" };
813
+ if (K.value && K.value.moved) return { cursor: "grabbing" };
814
+ }), wr = t(() => v.config.showGrid !== !1), Tr = t(() => v.config.gridColor || "#1a2240"), Er = t(() => {
784
815
  let e = Number(v.config.gridStep);
785
- return (Number.isFinite(e) && e > 0 ? e : 40) / Un.value;
786
- }), xr = t(() => {
816
+ return (Number.isFinite(e) && e > 0 ? e : 40) / Jn.value;
817
+ }), Dr = t(() => {
787
818
  let e = Number(v.config.gridOpacity);
788
819
  return Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : .5;
789
- }), Sr = t(() => {
820
+ }), Or = t(() => {
790
821
  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) => ({
791
822
  offset: e.offset == null ? t === 0 ? "0%" : "100%" : e.offset,
792
823
  color: e.color,
@@ -806,32 +837,48 @@ var b = {
806
837
  r: e.r || "60%",
807
838
  stops: n
808
839
  };
809
- }), Cr = t(() => v.config.showCenterPoint === !0), wr = t(() => v.config.showEdgeTextBg === !0), Tr = t(() => v.config.edgeTextBgColor || "#0a0e1a"), Er = t(() => v.config.showNodeHandles === !0), Dr = t(() => v.config.showStatusDot !== !1), Or = (e, t) => {
840
+ }), kr = t(() => v.config.showCenterPoint === !0), Ar = t(() => v.config.showEdgeTextBg === !0), jr = t(() => v.config.edgeTextBgColor || "#0a0e1a"), Mr = t(() => v.config.showNodeHandles === !0), Nr = t(() => v.config.showStatusDot !== !1), Pr = (e, t) => {
810
841
  let n = Number(e);
811
842
  return Number.isFinite(n) && n >= 0 ? n : t;
812
- }, kr = t(() => {
843
+ }, Fr = t(() => {
813
844
  let e = v.config.motionFx ?? v.config.fx;
814
- return typeof e == "boolean" ? e : M.value.length <= Or(v.config.fxMotionMaxEdges, 200);
815
- }), Ar = t(() => {
845
+ return typeof e == "boolean" ? e ? "all" : "none" : [
846
+ "none",
847
+ "flow",
848
+ "particle",
849
+ "all"
850
+ ].includes(e) ? e : M.value.length <= Pr(v.config.fxMotionMaxEdges, 200) ? "all" : "none";
851
+ }), Ir = t(() => {
816
852
  let e = v.config.glowFx ?? v.config.fx;
817
- return typeof e == "boolean" ? e : M.value.length <= Or(v.config.fxGlowMaxEdges, 500);
818
- }), jr = t(() => {
853
+ return typeof e == "boolean" ? e : M.value.length <= Pr(v.config.fxGlowMaxEdges, 500);
854
+ }), Lr = t(() => {
819
855
  let e = v.config.breatheFx ?? v.config.fx;
820
- return typeof e == "boolean" ? e : w.value.length <= Or(v.config.fxBreatheMaxNodes, 300);
821
- }), Mr = (e) => e.animated !== !1, Nr = (e) => e.borderColor || F(e) || "#94a3b8", Pr = (e) => e.borderWidth || 0, Fr = (e) => e.borderStyle === "dashed" ? "8 5" : void 0, Ir = (e, t) => {
856
+ return typeof e == "boolean" ? e : w.value.length <= Pr(v.config.fxBreatheMaxNodes, 300);
857
+ }), Rr = (e) => {
858
+ if (e.animatedMode !== void 0) {
859
+ let t = e.animatedMode;
860
+ return !t || t === "all" ? Fr.value : t === "none" ? "none" : t;
861
+ }
862
+ return e.animated === void 0 || e.animated ? Fr.value : "none";
863
+ }, zr = (e) => e.borderColor || I(e) || "#94a3b8", Br = (e) => e.borderWidth || 0, Vr = (e) => e.borderStyle === "dashed" ? "8 5" : void 0, Hr = (e) => {
864
+ let t = e.borderRadius;
865
+ if (t == null || t === "") return 6;
866
+ let n = Number(t);
867
+ return Number.isFinite(n) && n >= 0 ? n : 6;
868
+ }, Ur = (e, t) => {
822
869
  if (e.button !== 0 || !v.editable || v.config.nodeDraggable === !1) return;
823
870
  e.stopPropagation();
824
- let n = P(t), r = X(e);
871
+ let n = F(t), r = X(e);
825
872
  if (Kt.value = {
826
873
  x: r.x - n.x,
827
874
  y: r.y - n.y
828
875
  }, Jt = {
829
876
  x: e.clientX,
830
877
  y: e.clientY
831
- }, Yt = !1, Xt = !!(e.ctrlKey || e.metaKey), R.value.length > 1 && R.value.includes(t)) {
878
+ }, Yt = !1, Xt = !!(e.ctrlKey || e.metaKey), z.value.length > 1 && z.value.includes(t)) {
832
879
  let e = {};
833
- R.value.forEach((t) => {
834
- let n = P(t);
880
+ z.value.forEach((t) => {
881
+ let n = F(t);
835
882
  n && (e[t] = {
836
883
  x: n.x,
837
884
  y: n.y
@@ -845,23 +892,23 @@ var b = {
845
892
  };
846
893
  } else qt.value = null;
847
894
  D.value = t, y("node-drag-start", n);
848
- }, Lr = 0, Rr = null, zr = () => {
849
- Lr = 0;
850
- let e = Rr;
851
- Rr = null, e && Vr(e);
852
- }, Br = (e) => {
853
- (J.value || D.value) && (Rr = {
895
+ }, Wr = 0, Gr = null, Kr = () => {
896
+ Wr = 0;
897
+ let e = Gr;
898
+ Gr = null, e && Jr(e);
899
+ }, qr = (e) => {
900
+ (J.value || D.value) && (Gr = {
854
901
  clientX: e.clientX,
855
902
  clientY: e.clientY
856
- }, Lr ||= requestAnimationFrame(zr));
857
- }, Vr = (e) => {
903
+ }, Wr ||= requestAnimationFrame(Kr));
904
+ }, Jr = (e) => {
858
905
  if (J.value) {
859
- qr(e);
906
+ ei(e);
860
907
  return;
861
908
  }
862
909
  if (!D.value) return;
863
910
  let t = X(e);
864
- !Yt && Jt && Math.hypot(e.clientX - Jt.x, e.clientY - Jt.y) > kt && (Yt = !0, !Xt && !R.value.includes(D.value) && (R.value = V([], [D.value], jn.value), z.value = [], y("node-select", R.value.includes(D.value) ? P(D.value) : null), B()));
911
+ !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], jn.value), B.value = [], y("node-select", z.value.includes(D.value) ? F(D.value) : null), V()));
865
912
  let n = qt.value;
866
913
  if (n) {
867
914
  let e = t.x - n.start.x, r = t.y - n.start.y;
@@ -876,14 +923,14 @@ var b = {
876
923
  y: t.y - Kt.value.y
877
924
  } : e);
878
925
  T();
879
- }, Hr = () => {
880
- if (Lr && (cancelAnimationFrame(Lr), zr()), J.value) {
881
- Jr();
926
+ }, Yr = () => {
927
+ if (Wr && (cancelAnimationFrame(Wr), Kr()), J.value) {
928
+ ti();
882
929
  return;
883
930
  }
884
- D.value && (Yt && Rn(), D.value = null, qt.value = null, Jt = null, Yt = !1, y("node-drag-end"));
885
- }, J = d(null), Ur = (e, t, n) => Math.min(n, Math.max(t, e)), Wr = (e) => {
886
- let t = L(e), n = t.x, r = t.y, i = t.x + t.width, a = t.y + t.height;
931
+ D.value && (Yt && Un(), D.value = null, qt.value = null, Jt = null, Yt = !1, y("node-drag-end"));
932
+ }, J = d(null), Xr = (e, t, n) => Math.min(n, Math.max(t, e)), Zr = (e) => {
933
+ let t = R(e), n = t.x, r = t.y, i = t.x + t.width, a = t.y + t.height;
887
934
  return [
888
935
  {
889
936
  side: "nw",
@@ -926,9 +973,9 @@ var b = {
926
973
  y: 0
927
974
  }
928
975
  ];
929
- }, 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) => {
976
+ }, Qr = (e) => e === "nw" || e === "se" ? "nwse-resize" : e === "ne" || e === "sw" ? "nesw-resize" : e === "n" || e === "s" ? "ns-resize" : "ew-resize", $r = (e, t, n) => {
930
977
  if (!v.editable || v.config.nodeResizable === !1 || !t) return;
931
- let { w: r, h: i } = I(t);
978
+ let { w: r, h: i } = L(t);
932
979
  J.value = {
933
980
  id: t.id,
934
981
  side: n,
@@ -937,19 +984,19 @@ var b = {
937
984
  startW: r,
938
985
  startH: i
939
986
  }, y("node-resize-start", t);
940
- }, qr = (e) => {
987
+ }, ei = (e) => {
941
988
  let t = J.value;
942
989
  if (!t) return;
943
- let n = P(t.id);
990
+ let n = F(t.id);
944
991
  if (!n) return;
945
992
  let r = X(e), i = t.startW, a = t.startH, o = n.x, s = n.y;
946
993
  if (t.anchorX !== null) {
947
994
  let e = t.side.includes("e");
948
- i = Ur(e ? r.x - t.anchorX : t.anchorX - r.x, Ft, It), o = e ? t.anchorX + i / 2 : t.anchorX - i / 2;
995
+ i = Xr(e ? r.x - t.anchorX : t.anchorX - r.x, Ft, It), o = e ? t.anchorX + i / 2 : t.anchorX - i / 2;
949
996
  }
950
997
  if (t.anchorY !== null) {
951
998
  let e = t.side.includes("s");
952
- a = Ur(e ? r.y - t.anchorY : t.anchorY - r.y, Lt, Rt), s = e ? t.anchorY + a / 2 : t.anchorY - a / 2;
999
+ a = Xr(e ? r.y - t.anchorY : t.anchorY - r.y, Lt, Rt), s = e ? t.anchorY + a / 2 : t.anchorY - a / 2;
953
1000
  }
954
1001
  w.value = w.value.map((e) => e.id === t.id ? {
955
1002
  ...e,
@@ -958,15 +1005,15 @@ var b = {
958
1005
  width: i,
959
1006
  height: a
960
1007
  } : e), T();
961
- }, Jr = () => {
1008
+ }, ti = () => {
962
1009
  let e = J.value;
963
- J.value = null, e && (Rn(), y("node-resize-end", P(e.id) || null));
964
- }, Yr = t(() => v.editable && v.config.nodeResizable !== !1), Xr = t(() => {
965
- if (!Yr.value) return null;
966
- let e = R.value;
967
- return e.length === 1 && P(e[0]) || null;
968
- }), Y = d(null), Zr = (e) => {
969
- let t = L(e);
1010
+ J.value = null, e && (Un(), y("node-resize-end", F(e.id) || null));
1011
+ }, ni = t(() => v.editable && v.config.nodeResizable !== !1), ri = t(() => {
1012
+ if (!ni.value) return null;
1013
+ let e = z.value;
1014
+ return e.length === 1 && F(e[0]) || null;
1015
+ }), Y = d(null), ii = (e) => {
1016
+ let t = R(e);
970
1017
  return [
971
1018
  {
972
1019
  side: "top",
@@ -989,7 +1036,7 @@ var b = {
989
1036
  y: 0
990
1037
  }
991
1038
  ];
992
- }, Qr = (e, t) => {
1039
+ }, ai = (e, t) => {
993
1040
  let n = O.value;
994
1041
  if (!n) return null;
995
1042
  let r = e, i = t;
@@ -1003,7 +1050,7 @@ var b = {
1003
1050
  x: s.x,
1004
1051
  y: s.y
1005
1052
  };
1006
- }, $r = (e, t) => {
1053
+ }, oi = (e, t) => {
1007
1054
  let n = O.value;
1008
1055
  if (!n) return null;
1009
1056
  let r = n.createSVGPoint();
@@ -1015,11 +1062,11 @@ var b = {
1015
1062
  x: a.x,
1016
1063
  y: a.y
1017
1064
  };
1018
- }, X = (e) => Qr(e) ?? {
1065
+ }, X = (e) => ai(e) ?? {
1019
1066
  x: 0,
1020
1067
  y: 0
1021
- }, ei = (e, t, n) => {
1022
- let r = P(t);
1068
+ }, si = (e, t, n) => {
1069
+ let r = F(t);
1023
1070
  if (!r || !O.value) return;
1024
1071
  let i = X(e);
1025
1072
  Y.value = {
@@ -1034,40 +1081,40 @@ var b = {
1034
1081
  try {
1035
1082
  e.target.setPointerCapture?.(e.pointerId);
1036
1083
  } catch {}
1037
- oi();
1038
- }, Z = 0, ti = null, ni = () => {
1084
+ pi();
1085
+ }, Z = 0, ci = null, li = () => {
1039
1086
  Z = 0;
1040
- let e = ti;
1041
- ti = null, e && Y.value && li(e);
1042
- }, ri = (e) => {
1043
- Y.value && (ti = {
1087
+ let e = ci;
1088
+ ci = null, e && Y.value && gi(e);
1089
+ }, ui = (e) => {
1090
+ Y.value && (ci = {
1044
1091
  clientX: e.clientX,
1045
1092
  clientY: e.clientY
1046
- }, Z ||= requestAnimationFrame(ni));
1047
- }, ii = () => {
1048
- Z && (cancelAnimationFrame(Z), ni()), Y.value && ui();
1049
- }, ai = !1, oi = () => {
1050
- ai || (ai = !0, window.addEventListener("mousemove", ri, !0), window.addEventListener("mouseup", ii, !0));
1051
- }, si = () => {
1052
- ai && (ai = !1, window.removeEventListener("mousemove", ri, !0), window.removeEventListener("mouseup", ii, !0));
1053
- }, ci = (e, t, n) => {
1093
+ }, Z ||= requestAnimationFrame(li));
1094
+ }, di = () => {
1095
+ Z && (cancelAnimationFrame(Z), li()), Y.value && _i();
1096
+ }, fi = !1, pi = () => {
1097
+ fi || (fi = !0, window.addEventListener("mousemove", ui, !0), window.addEventListener("mouseup", di, !0));
1098
+ }, mi = () => {
1099
+ fi && (fi = !1, window.removeEventListener("mousemove", ui, !0), window.removeEventListener("mouseup", di, !0));
1100
+ }, hi = (e, t, n) => {
1054
1101
  let r = w.value;
1055
1102
  for (let i = r.length - 1; i >= 0; i--) {
1056
1103
  let a = r[i];
1057
1104
  if (a.id === n) continue;
1058
- let o = L(a);
1105
+ let o = R(a);
1059
1106
  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;
1060
1107
  }
1061
1108
  return null;
1062
- }, li = (e) => {
1109
+ }, gi = (e) => {
1063
1110
  let t = Y.value;
1064
1111
  if (!t) return;
1065
1112
  let n = X(e);
1066
1113
  t.px = n.x, t.py = n.y;
1067
- let r = ci(n.x, n.y, t.fromId);
1114
+ let r = hi(n.x, n.y, t.fromId);
1068
1115
  t.overId = r ? r.id : null;
1069
- }, ui = () => {
1070
- si();
1116
+ }, _i = () => {
1117
+ mi();
1071
1118
  let e = Y.value;
1072
1119
  if (Y.value = null, !e || !e.overId || e.overId === e.fromId) return;
1073
1120
  let t = {
@@ -1079,8 +1126,8 @@ var b = {
1079
1126
  toAnchor: "edge"
1080
1127
  };
1081
1128
  k.value.push(t), y("edge-create", t);
1082
- }, di = (e, t, n) => {
1083
- let r = e.x, i = e.y, a = t.x - r, o = t.y - i, { w: s, h: c } = I(e);
1129
+ }, vi = (e, t, n) => {
1130
+ let r = e.x, i = e.y, a = t.x - r, o = t.y - i, { w: s, h: c } = L(e);
1084
1131
  if (!n || n === "center" || a === 0 && o === 0) return {
1085
1132
  x: r,
1086
1133
  y: i
@@ -1090,20 +1137,20 @@ var b = {
1090
1137
  x: r + a * p,
1091
1138
  y: i + o * p
1092
1139
  };
1093
- }, fi = t(() => {
1140
+ }, yi = t(() => {
1094
1141
  let e = /* @__PURE__ */ new Map();
1095
1142
  M.value.forEach((t) => {
1096
- let n = mn.value[t.id];
1143
+ let n = P.value[t.id];
1097
1144
  n && !n.hidden && (e.has(n.key) || e.set(n.key, []), e.get(n.key).push(t));
1098
1145
  });
1099
1146
  let t = {};
1100
1147
  return e.forEach((e, n) => {
1101
- let [r, i] = n.split("__"), a = P(r), o = P(i);
1148
+ let [r, i] = n.split("__"), a = F(r), o = F(i);
1102
1149
  if (!a || !o) return;
1103
1150
  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;
1104
1151
  if (m > 1) {
1105
1152
  let e = (m - 1) / 2 * Ot, t = (e) => {
1106
- let { w: t, h: n } = I(e);
1153
+ let { w: t, h: n } = L(e);
1107
1154
  return Math.max(4, (Math.abs(f) * t + Math.abs(p) * n) / 2 - 6);
1108
1155
  }, n = Math.min(1, t(a) / e, t(o) / e);
1109
1156
  ee = Ot * Math.max(.35, n);
@@ -1122,12 +1169,12 @@ var b = {
1122
1169
  bulge: Math.min(l * .15, 50)
1123
1170
  };
1124
1171
  }), t;
1125
- }), pi = (e) => {
1126
- let t = mn.value[e.id], n = t && fi.value[t.key];
1172
+ }), bi = (e) => {
1173
+ let t = P.value[e.id], n = t && yi.value[t.key];
1127
1174
  if (!n) return null;
1128
- let r = P(e.from), i = P(e.to);
1175
+ let r = F(e.from), i = F(e.to);
1129
1176
  if (!r || !i) return null;
1130
- let a = n.slots[e.id] || 0, o = a * n.gap, s = di(r, i, e.fromAnchor), c = di(i, r, e.toAnchor);
1177
+ let a = n.slots[e.id] || 0, o = a * n.gap, s = vi(r, i, e.fromAnchor), c = vi(i, r, e.toAnchor);
1131
1178
  return {
1132
1179
  frame: n,
1133
1180
  slot: a,
@@ -1140,8 +1187,8 @@ var b = {
1140
1187
  y: c.y + n.ny * o
1141
1188
  }
1142
1189
  };
1143
- }, mi = (e) => {
1144
- let t = pi(e);
1190
+ }, xi = (e) => {
1191
+ let t = bi(e);
1145
1192
  if (!t) return "";
1146
1193
  let { from: n, to: r, frame: i, slot: a } = t, o = a * i.gap;
1147
1194
  if (E.value === "straight") return `M ${n.x} ${n.y} L ${r.x} ${r.y}`;
@@ -1155,8 +1202,8 @@ var b = {
1155
1202
  }
1156
1203
  let s = (n.x + r.x) / 2 + i.nx * i.bulge, c = (n.y + r.y) / 2 + i.ny * i.bulge;
1157
1204
  return `M ${n.x} ${n.y} Q ${s} ${c} ${r.x} ${r.y}`;
1158
- }, hi = (e, t) => {
1159
- let n = pi(e);
1205
+ }, Si = (e, t) => {
1206
+ let n = bi(e);
1160
1207
  if (!n) return {
1161
1208
  x: 0,
1162
1209
  y: 0
@@ -1197,29 +1244,29 @@ var b = {
1197
1244
  x: (1 - t) * (1 - t) * r.x + 2 * (1 - t) * t * c + t * t * i.x,
1198
1245
  y: (1 - t) * (1 - t) * r.y + 2 * (1 - t) * t * l + t * t * i.y
1199
1246
  };
1200
- }, gi = t(() => Y.value ? P(Y.value.fromId) : null), _i = t(() => Y.value && Y.value.overId ? P(Y.value.overId) : null), vi = t(() => gi.value ? F(gi.value) : "#00f0ff"), yi = t(() => {
1247
+ }, Ci = t(() => Y.value ? F(Y.value.fromId) : null), wi = t(() => Y.value && Y.value.overId ? F(Y.value.overId) : null), Ti = t(() => Ci.value ? I(Ci.value) : "#00f0ff"), Ei = t(() => {
1201
1248
  let e = Y.value;
1202
1249
  if (!e) return {
1203
1250
  x: 0,
1204
1251
  y: 0
1205
1252
  };
1206
- let t = _i.value;
1207
- return t && gi.value ? di(t, gi.value, "edge") : {
1253
+ let t = wi.value;
1254
+ return t && Ci.value ? vi(t, Ci.value, "edge") : {
1208
1255
  x: e.px,
1209
1256
  y: e.py
1210
1257
  };
1211
- }), bi = t(() => {
1212
- let e = _i.value;
1258
+ }), Di = t(() => {
1259
+ let e = wi.value;
1213
1260
  if (!e) return null;
1214
- let t = L(e);
1261
+ let t = R(e);
1215
1262
  return {
1216
1263
  x: e.x + t.x - 4,
1217
1264
  y: e.y + t.y - 4,
1218
1265
  w: t.width + 8,
1219
1266
  h: t.height + 8
1220
1267
  };
1221
- }), xi = (e) => {
1222
- let t = e.nodeIds.map((e) => P(e)).filter(Boolean);
1268
+ }), Oi = (e) => {
1269
+ let t = e.nodeIds.map((e) => F(e)).filter(Boolean);
1223
1270
  if (t.length === 0) return null;
1224
1271
  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;
1225
1272
  return {
@@ -1228,38 +1275,44 @@ var b = {
1228
1275
  width: a - r,
1229
1276
  height: o - i
1230
1277
  };
1231
- }, Si = t(() => v.groups.map((e) => ({
1278
+ }, ki = t(() => v.groups.map((e) => ({
1232
1279
  ...e,
1233
- rect: xi(e)
1234
- })).filter((e) => e.rect)), Q = (e) => kn(e) ? Fn.value : (P(e.from), e.centerText && e.centerText.color || "#00f0ff"), Ci = (e) => {
1235
- let t = mn.value[e.id];
1280
+ rect: Oi(e)
1281
+ })).filter((e) => e.rect)), Q = (e) => kn(e) ? Bn.value : (F(e.from), e.centerText && e.centerText.color || "#00f0ff"), Ai = (e) => {
1282
+ let t = P.value[e.id];
1236
1283
  return !!t && !t.hidden;
1237
- }, wi = t(() => [...new Set(M.value.map(Q))].map((e) => ({
1284
+ }, ji = t(() => [...new Set(M.value.map(Q))].map((e) => ({
1238
1285
  key: String(e).replace("#", ""),
1239
1286
  color: e
1240
- }))), Ti = (e) => {
1287
+ }))), Mi = (e) => {
1241
1288
  let t = e.endMarker;
1242
1289
  if (!t || t === "none") return "";
1243
1290
  let n = Q(e) || "#00f0ff", r = String(n).replace("#", "");
1244
1291
  return `url(#${t === "dot" ? "edge-dot" : "edge-arrow"}-${r})`;
1245
- }, Ei = /* @__PURE__ */ new Map(), Di = {
1292
+ }, Ni = /* @__PURE__ */ new Map(), Pi = {
1246
1293
  nodes: null,
1247
1294
  edges: null,
1248
1295
  mode: null,
1249
1296
  epoch: -1
1250
- }, Oi = () => {
1251
- let e = Di;
1252
- (e.nodes !== w.value || e.edges !== M.value || e.mode !== E.value || e.epoch !== zt) && (Di = {
1297
+ }, Fi = () => {
1298
+ let e = Pi;
1299
+ (e.nodes !== w.value || e.edges !== M.value || e.mode !== E.value || e.epoch !== zt) && (Pi = {
1253
1300
  nodes: w.value,
1254
1301
  edges: M.value,
1255
1302
  mode: E.value,
1256
1303
  epoch: zt
1257
- }, Ei = /* @__PURE__ */ new Map());
1304
+ }, Ni = /* @__PURE__ */ new Map());
1258
1305
  }, $ = (e) => {
1259
- Oi();
1260
- let t = Ei.get(e.id);
1261
- return t === void 0 && (t = mi(e), Ei.set(e.id, t)), t;
1262
- }, ki = (e, t = 1) => `${2 / e.speed * t}s`, Ai = (e) => `${3 / e.speed}s`, ji = (e) => x(e).text, Mi = (e) => !!e && String(x(e).text ?? "").trim() !== "", Ni = (e, t) => {
1306
+ Fi();
1307
+ let t = Ni.get(e.id);
1308
+ return t === void 0 && (t = xi(e), Ni.set(e.id, t)), t;
1309
+ }, Ii = (e, t = 1) => `${2 / e.speed * t}s`, Li = (e) => `${3 / e.speed}s`, Ri = (e) => {
1310
+ let t = Rr(e);
1311
+ return t === "flow" || t === "all";
1312
+ }, zi = (e) => {
1313
+ let t = Rr(e);
1314
+ return t === "particle" || t === "all";
1315
+ }, Bi = (e) => x(e).text, Vi = (e) => !!e && String(x(e).text ?? "").trim() !== "", Hi = (e, t) => {
1263
1316
  if (!e) return null;
1264
1317
  let n = x(e), r = Number(t.fontSize) || Number(n.fontSize) || 8, i = String(n.text ?? ""), a = 0;
1265
1318
  for (let e of i) a += e.charCodeAt(0) > 11904 ? 1 : .62;
@@ -1267,34 +1320,34 @@ var b = {
1267
1320
  w: Math.max(14, a * r + 8),
1268
1321
  h: Math.max(12, r + 6)
1269
1322
  };
1270
- }, Pi = (e, t) => {
1271
- let n = hi(e, Math.max(0, t - .005)), r = hi(e, Math.min(1, t + .005));
1323
+ }, Ui = (e, t) => {
1324
+ let n = Si(e, Math.max(0, t - .005)), r = Si(e, Math.min(1, t + .005));
1272
1325
  return Math.atan2(r.y - n.y, r.x - n.x) * 180 / Math.PI;
1273
- }, Fi = (e) => {
1326
+ }, Wi = (e) => {
1274
1327
  let t = e % 180;
1275
1328
  return t > 90 && (t -= 180), t < -90 && (t += 180), t;
1276
- }, Ii = (e, t, n) => `translate(${t.x}, ${t.y}) rotate(${(x(e).rotation || 0) + (n || 0)})`, Li = t(() => {
1329
+ }, Gi = (e, t, n) => `translate(${t.x}, ${t.y}) rotate(${(x(e).rotation || 0) + (n || 0)})`, Ki = t(() => {
1277
1330
  let e = [];
1278
- for (let t of W.value) {
1279
- let n = mn.value[t.id];
1331
+ for (let t of G.value) {
1332
+ let n = P.value[t.id];
1280
1333
  if (!n) continue;
1281
1334
  let r = n.merged && n.representative, i = !n.merged && (t.fromText || t.centerText || t.toText);
1282
1335
  if (!r && !i) continue;
1283
- let a = P(t.from), o = P(t.to);
1336
+ let a = F(t.from), o = F(t.to);
1284
1337
  a && o && e.push({
1285
1338
  id: t.id,
1286
1339
  edge: t,
1287
1340
  info: n,
1288
- color: a && ie[a.type] || "#00f0ff",
1289
- start: hi(t, .28),
1290
- center: hi(t, .5),
1291
- end: hi(t, .72),
1292
- startAngle: Fi(Pi(t, .28)),
1293
- centerAngle: Fi(Pi(t, .5)),
1294
- endAngle: Fi(Pi(t, .72)),
1295
- fromBox: Ni(t.fromText, t),
1296
- centerBox: Ni(t.centerText, t),
1297
- toBox: Ni(t.toText, t)
1341
+ color: a && ie[a.nodeType] || "#00f0ff",
1342
+ start: Si(t, .28),
1343
+ center: Si(t, .5),
1344
+ end: Si(t, .72),
1345
+ startAngle: Wi(Ui(t, .28)),
1346
+ centerAngle: Wi(Ui(t, .5)),
1347
+ endAngle: Wi(Ui(t, .72)),
1348
+ fromBox: Hi(t.fromText, t),
1349
+ centerBox: Hi(t.centerText, t),
1350
+ toBox: Hi(t.toText, t)
1298
1351
  });
1299
1352
  }
1300
1353
  return e;
@@ -1308,29 +1361,34 @@ var b = {
1308
1361
  addEdges: un,
1309
1362
  updateNodes: dn,
1310
1363
  updateEdges: fn,
1311
- clientToSvg: Qr,
1312
- svgToClient: $r
1364
+ clientToSvg: ai,
1365
+ svgToClient: oi,
1366
+ moveLayerUp: Fn,
1367
+ moveLayerDown: In,
1368
+ moveToFront: Ln,
1369
+ moveToBack: Rn,
1370
+ downloadSVG: zn
1313
1371
  }), (t, c) => (u(), r("svg", {
1314
1372
  ref_key: "svgRef",
1315
1373
  ref: O,
1316
1374
  class: "topology-svg",
1317
- style: s(_r.value),
1318
- viewBox: `${Kn.value} ${qn.value} ${H.value} ${U.value}`,
1319
- onMousedown: cr,
1320
- onMousemove: Br,
1321
- onMouseup: Hr,
1322
- onMouseleave: Hr,
1323
- onClick: Vn,
1324
- onWheel: g($n, ["prevent"])
1375
+ style: s(Cr.value),
1376
+ viewBox: `${Zn.value} ${Qn.value} ${U.value} ${W.value}`,
1377
+ onMousedown: pr,
1378
+ onMousemove: qr,
1379
+ onMouseup: Yr,
1380
+ onMouseleave: Yr,
1381
+ onClick: Kn,
1382
+ onWheel: g(ir, ["prevent"])
1325
1383
  }, [
1326
1384
  i("defs", null, [
1327
1385
  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),
1328
1386
  i("radialGradient", {
1329
1387
  id: "bg-grid",
1330
- cx: Sr.value.cx,
1331
- cy: Sr.value.cy,
1332
- r: Sr.value.r
1333
- }, [(u(!0), r(e, null, f(Sr.value.stops, (e, t) => (u(), r("stop", {
1388
+ cx: Or.value.cx,
1389
+ cy: Or.value.cy,
1390
+ r: Or.value.r
1391
+ }, [(u(!0), r(e, null, f(Or.value.stops, (e, t) => (u(), r("stop", {
1334
1392
  key: `bg-stop-${t}`,
1335
1393
  offset: e.offset,
1336
1394
  "stop-color": e.color,
@@ -1357,7 +1415,7 @@ var b = {
1357
1415
  }, null, 8, de)
1358
1416
  ], 8, ce))), 128)),
1359
1417
  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),
1360
- (u(!0), r(e, null, f(wi.value, (e) => (u(), r("marker", {
1418
+ (u(!0), r(e, null, f(ji.value, (e) => (u(), r("marker", {
1361
1419
  key: `m-arrow-${e.key}`,
1362
1420
  id: `edge-arrow-${e.key}`,
1363
1421
  viewBox: "0 0 10 10",
@@ -1371,7 +1429,7 @@ var b = {
1371
1429
  d: "M1,2.5 L9,5 L1,7.5 Z",
1372
1430
  fill: e.color
1373
1431
  }, null, 8, pe)], 8, fe))), 128)),
1374
- (u(!0), r(e, null, f(wi.value, (e) => (u(), r("marker", {
1432
+ (u(!0), r(e, null, f(ji.value, (e) => (u(), r("marker", {
1375
1433
  key: `m-dot-${e.key}`,
1376
1434
  id: `edge-dot-${e.key}`,
1377
1435
  viewBox: "0 0 10 10",
@@ -1389,31 +1447,31 @@ var b = {
1389
1447
  }, null, 8, he)], 8, me))), 128))
1390
1448
  ]),
1391
1449
  i("rect", {
1392
- width: H.value,
1393
- height: U.value,
1394
- x: Kn.value,
1395
- y: qn.value,
1450
+ width: U.value,
1451
+ height: W.value,
1452
+ x: Zn.value,
1453
+ y: Qn.value,
1396
1454
  fill: "url(#bg-grid)"
1397
1455
  }, null, 8, ge),
1398
- vr.value ? (u(), r(e, { key: 0 }, [i("pattern", {
1456
+ wr.value ? (u(), r(e, { key: 0 }, [i("pattern", {
1399
1457
  id: "grid",
1400
- width: br.value,
1401
- height: br.value,
1458
+ width: Er.value,
1459
+ height: Er.value,
1402
1460
  patternUnits: "userSpaceOnUse"
1403
1461
  }, [i("path", {
1404
- d: `M ${br.value} 0 L 0 0 0 ${br.value}`,
1462
+ d: `M ${Er.value} 0 L 0 0 0 ${Er.value}`,
1405
1463
  fill: "none",
1406
- stroke: yr.value,
1464
+ stroke: Tr.value,
1407
1465
  "stroke-width": "0.5"
1408
1466
  }, null, 8, ve)], 8, _e), i("rect", {
1409
- width: H.value,
1410
- height: U.value,
1411
- x: Kn.value,
1412
- y: qn.value,
1467
+ width: U.value,
1468
+ height: W.value,
1469
+ x: Zn.value,
1470
+ y: Qn.value,
1413
1471
  fill: "url(#grid)",
1414
- opacity: xr.value
1472
+ opacity: Dr.value
1415
1473
  }, null, 8, ye)], 64)) : n("", !0),
1416
- Cr.value ? (u(), r("g", be, [...c[5] ||= [
1474
+ kr.value ? (u(), r("g", be, [...c[5] ||= [
1417
1475
  i("line", {
1418
1476
  x1: "-22",
1419
1477
  y1: "0",
@@ -1445,7 +1503,7 @@ var b = {
1445
1503
  opacity: "0.8"
1446
1504
  }, null, -1)
1447
1505
  ]])) : n("", !0),
1448
- (u(!0), r(e, null, f(Si.value, (e) => (u(), r("g", { key: e.id }, [
1506
+ (u(!0), r(e, null, f(ki.value, (e) => (u(), r("g", { key: e.id }, [
1449
1507
  i("rect", {
1450
1508
  x: e.rect.x,
1451
1509
  y: e.rect.y,
@@ -1507,16 +1565,16 @@ var b = {
1507
1565
  "letter-spacing": "0.5"
1508
1566
  }, m(e.label), 9, De)
1509
1567
  ]))), 128)),
1510
- (u(!0), r(e, null, f(W.value, (e) => (u(), r("path", {
1568
+ (u(!0), r(e, null, f(G.value, (e) => (u(), r("path", {
1511
1569
  key: `base-${e.id}`,
1512
1570
  d: $(e),
1513
1571
  fill: "none",
1514
1572
  stroke: "#1a2744",
1515
1573
  "stroke-width": "2",
1516
1574
  "stroke-linecap": "round",
1517
- "marker-end": Ti(e)
1575
+ "marker-end": Mi(e)
1518
1576
  }, null, 8, Oe))), 128)),
1519
- (u(!0), r(e, null, f(W.value, (t) => (u(), r(e, { key: `glow-${t.id}` }, [Ar.value ? (u(), r("path", {
1577
+ (u(!0), r(e, null, f(G.value, (t) => (u(), r(e, { key: `glow-${t.id}` }, [Ir.value ? (u(), r("path", {
1520
1578
  key: 0,
1521
1579
  d: $(t),
1522
1580
  fill: "none",
@@ -1526,16 +1584,16 @@ var b = {
1526
1584
  opacity: "0.15",
1527
1585
  filter: "url(#glow-strong)"
1528
1586
  }, null, 8, ke)) : n("", !0)], 64))), 128)),
1529
- (u(!0), r(e, null, f(W.value, (t) => (u(), r(e, { key: `sel-${t.id}` }, [kn(t) ? (u(), r("path", {
1587
+ (u(!0), r(e, null, f(G.value, (t) => (u(), r(e, { key: `sel-${t.id}` }, [kn(t) ? (u(), r("path", {
1530
1588
  key: 0,
1531
1589
  d: $(t),
1532
1590
  fill: "none",
1533
- stroke: Fn.value,
1591
+ stroke: Bn.value,
1534
1592
  "stroke-width": "4",
1535
1593
  opacity: "0.35",
1536
1594
  filter: "url(#glow-strong)"
1537
1595
  }, null, 8, Ae)) : n("", !0)], 64))), 128)),
1538
- (u(!0), r(e, null, f(W.value, (t) => (u(), r(e, { key: `flow-${t.id}` }, [kr.value && Mr(t) ? (u(), r("g", je, [
1596
+ (u(!0), r(e, null, f(G.value, (t) => (u(), r(e, { key: `flow-${t.id}` }, [Ri(t) ? (u(), r("g", je, [
1539
1597
  i("path", {
1540
1598
  d: $(t),
1541
1599
  fill: "none",
@@ -1548,7 +1606,7 @@ var b = {
1548
1606
  attributeName: "stroke-dashoffset",
1549
1607
  from: "0",
1550
1608
  to: "-52",
1551
- dur: ki(t),
1609
+ dur: Ii(t),
1552
1610
  repeatCount: "indefinite"
1553
1611
  }, null, 8, Ne)], 8, Me),
1554
1612
  i("path", {
@@ -1563,7 +1621,7 @@ var b = {
1563
1621
  attributeName: "stroke-dashoffset",
1564
1622
  from: "-30",
1565
1623
  to: "-82",
1566
- dur: ki(t, 1.3),
1624
+ dur: Ii(t, 1.3),
1567
1625
  repeatCount: "indefinite"
1568
1626
  }, null, 8, Fe)], 8, Pe),
1569
1627
  i("path", {
@@ -1579,18 +1637,18 @@ var b = {
1579
1637
  attributeName: "stroke-dashoffset",
1580
1638
  from: "0",
1581
1639
  to: "-84",
1582
- dur: ki(t, .8),
1640
+ dur: Ii(t, .8),
1583
1641
  repeatCount: "indefinite"
1584
1642
  }, null, 8, Le)], 8, Ie)
1585
1643
  ])) : n("", !0)], 64))), 128)),
1586
- (u(!0), r(e, null, f(W.value, (t) => (u(), r(e, { key: `particle-${t.id}` }, [kr.value && Mr(t) ? (u(), r("g", Re, [i("circle", {
1644
+ (u(!0), r(e, null, f(G.value, (t) => (u(), r(e, { key: `particle-${t.id}` }, [zi(t) ? (u(), r("g", Re, [i("circle", {
1587
1645
  r: "3",
1588
1646
  fill: Q(t),
1589
1647
  opacity: "0.9",
1590
1648
  filter: "url(#glow-core)"
1591
1649
  }, [i("animateMotion", {
1592
1650
  path: $(t),
1593
- dur: Ai(t),
1651
+ dur: Li(t),
1594
1652
  repeatCount: "indefinite"
1595
1653
  }, null, 8, Be)], 8, ze), i("circle", {
1596
1654
  r: "8",
@@ -1599,10 +1657,10 @@ var b = {
1599
1657
  filter: "url(#glow-strong)"
1600
1658
  }, [i("animateMotion", {
1601
1659
  path: $(t),
1602
- dur: Ai(t),
1660
+ dur: Li(t),
1603
1661
  repeatCount: "indefinite"
1604
1662
  }, null, 8, He)], 8, Ve)])) : n("", !0)], 64))), 128)),
1605
- (u(!0), r(e, null, f(Li.value, (t) => (u(), r(e, { key: `text-${t.id}` }, [t.info.merged && t.info.representative ? (u(), r("g", {
1663
+ (u(!0), r(e, null, f(Ki.value, (t) => (u(), r(e, { key: `text-${t.id}` }, [t.info.merged && t.info.representative ? (u(), r("g", {
1606
1664
  key: 0,
1607
1665
  transform: `translate(${t.center.x}, ${t.center.y}) rotate(${t.centerAngle})`
1608
1666
  }, [i("rect", {
@@ -1624,17 +1682,17 @@ var b = {
1624
1682
  "font-family": "'SF Mono', monospace",
1625
1683
  opacity: "1"
1626
1684
  }, m(t.info.count), 9, Ge)], 8, Ue)) : t.info.merged ? n("", !0) : (u(), r("g", Ke, [
1627
- Mi(t.edge.fromText) ? (u(), r("g", {
1685
+ Vi(t.edge.fromText) ? (u(), r("g", {
1628
1686
  key: 0,
1629
- transform: Ii(t.edge.fromText, t.start, t.startAngle)
1630
- }, [wr.value ? (u(), r("rect", {
1687
+ transform: Gi(t.edge.fromText, t.start, t.startAngle)
1688
+ }, [Ar.value ? (u(), r("rect", {
1631
1689
  key: 0,
1632
1690
  x: -t.fromBox.w / 2,
1633
1691
  y: -t.fromBox.h / 2,
1634
1692
  width: t.fromBox.w,
1635
1693
  height: t.fromBox.h,
1636
1694
  rx: "3",
1637
- fill: Tr.value,
1695
+ fill: jr.value,
1638
1696
  opacity: "0.92",
1639
1697
  stroke: C(t.edge, t.edge.fromText),
1640
1698
  "stroke-opacity": "0.35",
@@ -1648,18 +1706,18 @@ var b = {
1648
1706
  "font-family": "'SF Mono', monospace",
1649
1707
  "font-weight": "500",
1650
1708
  opacity: "0.9"
1651
- }, m(ji(t.edge.fromText)), 9, Ye)], 8, qe)) : n("", !0),
1652
- Mi(t.edge.centerText) ? (u(), r("g", {
1709
+ }, m(Bi(t.edge.fromText)), 9, Ye)], 8, qe)) : n("", !0),
1710
+ Vi(t.edge.centerText) ? (u(), r("g", {
1653
1711
  key: 1,
1654
- transform: Ii(t.edge.centerText, t.center, t.centerAngle)
1655
- }, [wr.value ? (u(), r("rect", {
1712
+ transform: Gi(t.edge.centerText, t.center, t.centerAngle)
1713
+ }, [Ar.value ? (u(), r("rect", {
1656
1714
  key: 0,
1657
1715
  x: -t.centerBox.w / 2,
1658
1716
  y: -t.centerBox.h / 2,
1659
1717
  width: t.centerBox.w,
1660
1718
  height: t.centerBox.h,
1661
1719
  rx: "3",
1662
- fill: Tr.value,
1720
+ fill: jr.value,
1663
1721
  opacity: "0.92",
1664
1722
  stroke: C(t.edge, t.edge.centerText),
1665
1723
  "stroke-opacity": "0.35",
@@ -1673,18 +1731,18 @@ var b = {
1673
1731
  "font-family": "'SF Mono', monospace",
1674
1732
  "font-weight": "600",
1675
1733
  opacity: "1"
1676
- }, m(ji(t.edge.centerText)), 9, Qe)], 8, Xe)) : n("", !0),
1677
- Mi(t.edge.toText) ? (u(), r("g", {
1734
+ }, m(Bi(t.edge.centerText)), 9, Qe)], 8, Xe)) : n("", !0),
1735
+ Vi(t.edge.toText) ? (u(), r("g", {
1678
1736
  key: 2,
1679
- transform: Ii(t.edge.toText, t.end, t.endAngle)
1680
- }, [wr.value ? (u(), r("rect", {
1737
+ transform: Gi(t.edge.toText, t.end, t.endAngle)
1738
+ }, [Ar.value ? (u(), r("rect", {
1681
1739
  key: 0,
1682
1740
  x: -t.toBox.w / 2,
1683
1741
  y: -t.toBox.h / 2,
1684
1742
  width: t.toBox.w,
1685
1743
  height: t.toBox.h,
1686
1744
  rx: "3",
1687
- fill: Tr.value,
1745
+ fill: jr.value,
1688
1746
  opacity: "0.92",
1689
1747
  stroke: C(t.edge, t.edge.toText),
1690
1748
  "stroke-opacity": "0.35",
@@ -1698,15 +1756,15 @@ var b = {
1698
1756
  "font-family": "'SF Mono', monospace",
1699
1757
  "font-weight": "500",
1700
1758
  opacity: "0.9"
1701
- }, m(ji(t.edge.toText)), 9, tt)], 8, $e)) : n("", !0)
1759
+ }, m(Bi(t.edge.toText)), 9, tt)], 8, $e)) : n("", !0)
1702
1760
  ]))], 64))), 128)),
1703
1761
  Y.value ? (u(), r("g", nt, [
1704
1762
  i("line", {
1705
1763
  x1: Y.value.ax,
1706
1764
  y1: Y.value.ay,
1707
- x2: yi.value.x,
1708
- y2: yi.value.y,
1709
- stroke: vi.value,
1765
+ x2: Ei.value.x,
1766
+ y2: Ei.value.y,
1767
+ stroke: Ti.value,
1710
1768
  "stroke-width": "2",
1711
1769
  "stroke-dasharray": "6 6",
1712
1770
  "stroke-linecap": "round",
@@ -1716,24 +1774,24 @@ var b = {
1716
1774
  cx: Y.value.px,
1717
1775
  cy: Y.value.py,
1718
1776
  r: "3.5",
1719
- fill: vi.value,
1777
+ fill: Ti.value,
1720
1778
  opacity: "0.9"
1721
1779
  }, null, 8, it),
1722
- Y.value.overId && bi.value ? (u(), r("rect", {
1780
+ Y.value.overId && Di.value ? (u(), r("rect", {
1723
1781
  key: 0,
1724
- x: bi.value.x,
1725
- y: bi.value.y,
1726
- width: bi.value.w,
1727
- height: bi.value.h,
1782
+ x: Di.value.x,
1783
+ y: Di.value.y,
1784
+ width: Di.value.w,
1785
+ height: Di.value.h,
1728
1786
  rx: "6",
1729
1787
  fill: "none",
1730
- stroke: vi.value,
1788
+ stroke: Ti.value,
1731
1789
  "stroke-width": "1.5",
1732
1790
  "stroke-dasharray": "6 4",
1733
1791
  opacity: "0.9"
1734
1792
  }, null, 8, at)) : n("", !0)
1735
1793
  ])) : n("", !0),
1736
- (u(!0), r(e, null, f(W.value, (e) => (u(), r("path", {
1794
+ (u(!0), r(e, null, f(G.value, (e) => (u(), r("path", {
1737
1795
  key: `hit-${e.id}`,
1738
1796
  d: $(e),
1739
1797
  fill: "none",
@@ -1743,17 +1801,17 @@ var b = {
1743
1801
  "pointer-events": "stroke",
1744
1802
  cursor: "pointer"
1745
1803
  },
1746
- onClick: g((t) => In(e, t), ["stop"])
1804
+ onClick: g((t) => Vn(e, t), ["stop"])
1747
1805
  }, null, 8, ot))), 128)),
1748
- (u(!0), r(e, null, f(Qn.value, (a) => (u(), r("g", {
1806
+ (u(!0), r(e, null, f(rr.value, (a) => (u(), r("g", {
1749
1807
  key: a.id,
1750
1808
  transform: `translate(${a.x}, ${a.y})`,
1751
1809
  class: o(["topology-node", D.value === a.id ? "dragging" : ""]),
1752
- onMousedown: (e) => Ir(e, a.id),
1810
+ onMousedown: (e) => Ur(e, a.id),
1753
1811
  onClick: (e) => Pn(a, e),
1754
1812
  style: s({
1755
1813
  cursor: v.editable && v.config.nodeDraggable !== !1 ? "grab" : "default",
1756
- color: F(a)
1814
+ color: I(a)
1757
1815
  })
1758
1816
  }, [
1759
1817
  i("rect", {
@@ -1767,11 +1825,11 @@ var b = {
1767
1825
  }, null, 8, ct),
1768
1826
  Dn(a) && _.viewMode !== "3d" ? (u(), r("rect", {
1769
1827
  key: 0,
1770
- x: L(a).x,
1771
- y: L(a).y,
1772
- width: L(a).width,
1773
- height: L(a).height,
1774
- rx: "6",
1828
+ x: R(a).x,
1829
+ y: R(a).y,
1830
+ width: R(a).width,
1831
+ height: R(a).height,
1832
+ rx: Hr(a),
1775
1833
  fill: Dn(a),
1776
1834
  opacity: "0.15"
1777
1835
  }, null, 8, lt)) : n("", !0),
@@ -1781,47 +1839,47 @@ var b = {
1781
1839
  y: En(a).y,
1782
1840
  width: En(a).width,
1783
1841
  height: En(a).height,
1784
- rx: "6",
1842
+ rx: Hr(a),
1785
1843
  fill: "none",
1786
- stroke: Nr(a),
1787
- "stroke-width": Pr(a),
1788
- "stroke-dasharray": Fr(a),
1844
+ stroke: zr(a),
1845
+ "stroke-width": Br(a),
1846
+ "stroke-dasharray": Vr(a),
1789
1847
  opacity: "0.8"
1790
1848
  }, null, 8, ut)) : n("", !0),
1791
1849
  On(a) && _.viewMode !== "3d" ? (u(), r("rect", {
1792
1850
  key: 2,
1793
- x: L(a).x,
1794
- y: L(a).y,
1795
- width: L(a).width,
1796
- height: L(a).height,
1797
- rx: "6",
1851
+ x: R(a).x,
1852
+ y: R(a).y,
1853
+ width: R(a).width,
1854
+ height: R(a).height,
1855
+ rx: Hr(a),
1798
1856
  fill: "none",
1799
1857
  stroke: Nn.value,
1800
1858
  "stroke-width": "2.5",
1801
1859
  transform: "scale(1.1)",
1802
1860
  style: { "pointer-events": "none" }
1803
1861
  }, null, 8, dt)) : n("", !0),
1804
- _n(a) ? (u(), r(e, { key: 3 }, [i("rect", {
1862
+ gn(a) ? (u(), r(e, { key: 3 }, [i("rect", {
1805
1863
  x: "-4",
1806
1864
  y: "-10",
1807
1865
  width: "8",
1808
1866
  height: "20",
1809
- fill: gn(a).color,
1867
+ fill: hn(a).color,
1810
1868
  opacity: "0.06"
1811
1869
  }, null, 8, ft), i("text", {
1812
1870
  y: "4",
1813
1871
  transform: `rotate(${a.rotation || 0} 0 4)`,
1814
1872
  "text-anchor": "middle",
1815
- fill: Ht(a) || F(a) || gn(a).color,
1873
+ fill: Ht(a) || I(a) || hn(a).color,
1816
1874
  "font-size": Vt(a, 12),
1817
1875
  "font-family": "'SF Mono', 'Cascadia Code', 'Consolas', monospace",
1818
1876
  "font-weight": "600"
1819
- }, m(a.label), 9, pt)], 64)) : (u(), r(e, { key: 4 }, [
1820
- i("g", { transform: bn(a) }, [a.state !== "none" && jr.value ? (u(), r("circle", {
1877
+ }, m(a.label), 9, pt)], 64)) : _n(a) ? (u(), r(e, { key: 4 }, [], 64)) : (u(), r(e, { key: 5 }, [
1878
+ i("g", { transform: bn(a) }, [a.state !== "none" && Lr.value ? (u(), r("circle", {
1821
1879
  key: 0,
1822
1880
  r: "30",
1823
1881
  fill: "none",
1824
- stroke: gn(a).color,
1882
+ stroke: hn(a).color,
1825
1883
  "stroke-width": "2.5",
1826
1884
  opacity: "0"
1827
1885
  }, [...c[6] ||= [i("animate", {
@@ -1836,7 +1894,7 @@ var b = {
1836
1894
  repeatCount: "indefinite"
1837
1895
  }, null, -1)]], 8, ht)) : n("", !0), i("g", gt, [p(t.$slots, "node-icon", {
1838
1896
  node: a,
1839
- color: F(a),
1897
+ color: I(a),
1840
1898
  viewMode: _.viewMode
1841
1899
  }, () => [i("rect", {
1842
1900
  x: "-18",
@@ -1844,15 +1902,15 @@ var b = {
1844
1902
  width: "36",
1845
1903
  height: "36",
1846
1904
  rx: "6",
1847
- fill: F(a),
1905
+ fill: I(a),
1848
1906
  opacity: "0.9"
1849
1907
  }, null, 8, _t)])])], 8, mt),
1850
- Dr.value ? (u(), r("g", {
1908
+ Nr.value ? (u(), r("g", {
1851
1909
  key: 0,
1852
1910
  transform: xn(a)
1853
1911
  }, [i("circle", {
1854
1912
  r: "4",
1855
- fill: gn(a).color,
1913
+ fill: hn(a).color,
1856
1914
  stroke: "#0a0e1a",
1857
1915
  "stroke-width": "2"
1858
1916
  }, null, 8, yt)], 8, vt)) : n("", !0),
@@ -1871,42 +1929,42 @@ var b = {
1871
1929
  dy: t === 0 ? 0 : "1.2em"
1872
1930
  }, m(e), 9, xt))), 128))], 8, bt)
1873
1931
  ], 64)),
1874
- Er.value ? (u(), r("g", St, [(u(!0), r(e, null, f(Zr(a), (e) => (u(), r("circle", {
1932
+ Mr.value ? (u(), r("g", St, [(u(!0), r(e, null, f(ii(a), (e) => (u(), r("circle", {
1875
1933
  key: e.side,
1876
1934
  cx: e.x,
1877
1935
  cy: e.y,
1878
1936
  r: "4.5",
1879
1937
  class: "node-handle",
1880
1938
  fill: "#0a0e1a",
1881
- stroke: F(a),
1939
+ stroke: I(a),
1882
1940
  "stroke-width": "1.5",
1883
- onPointerdown: g((t) => ei(t, a.id, e), ["stop", "prevent"]),
1884
- onPointermove: g(li, ["stop"]),
1885
- onPointerup: g(ui, ["stop"]),
1886
- onPointercancel: g(ui, ["stop"]),
1887
- onLostpointercapture: ui,
1941
+ onPointerdown: g((t) => si(t, a.id, e), ["stop", "prevent"]),
1942
+ onPointermove: g(gi, ["stop"]),
1943
+ onPointerup: g(_i, ["stop"]),
1944
+ onPointercancel: g(_i, ["stop"]),
1945
+ onLostpointercapture: _i,
1888
1946
  onMousedown: c[0] ||= g(() => {}, ["stop", "prevent"]),
1889
1947
  onClick: c[1] ||= g(() => {}, ["stop"])
1890
1948
  }, null, 40, Ct))), 128))])) : n("", !0)
1891
1949
  ], 46, st))), 128)),
1892
- Xr.value ? (u(), r("g", wt, [(u(!0), r(e, null, f(Wr(Xr.value), (e) => (u(), r("rect", {
1950
+ ri.value ? (u(), r("g", wt, [(u(!0), r(e, null, f(Zr(ri.value), (e) => (u(), r("rect", {
1893
1951
  key: e.side,
1894
- x: Xr.value.x + e.x - 4.5,
1895
- y: Xr.value.y + e.y - 4.5,
1952
+ x: ri.value.x + e.x - 4.5,
1953
+ y: ri.value.y + e.y - 4.5,
1896
1954
  width: "9",
1897
1955
  height: "9",
1898
1956
  rx: "2",
1899
1957
  class: o(["node-resize-handle", `rt-${e.side}`]),
1900
- onMousedown: g((t) => Kr(t, Xr.value, e.side), ["stop", "prevent"]),
1958
+ onMousedown: g((t) => $r(t, ri.value, e.side), ["stop", "prevent"]),
1901
1959
  onClick: c[2] ||= g(() => {}, ["stop"])
1902
1960
  }, null, 42, Tt))), 128))])) : n("", !0),
1903
- K.value ? (u(), r("rect", {
1961
+ q.value ? (u(), r("rect", {
1904
1962
  key: 4,
1905
1963
  class: "marquee-box",
1906
- x: ar.value.x,
1907
- y: ar.value.y,
1908
- width: ar.value.width,
1909
- height: ar.value.height,
1964
+ x: ur.value.x,
1965
+ y: ur.value.y,
1966
+ width: ur.value.width,
1967
+ height: ur.value.height,
1910
1968
  rx: "2",
1911
1969
  "vector-effect": "non-scaling-stroke"
1912
1970
  }, null, 8, Et)) : n("", !0)