@html-graph/html-graph 7.0.0 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,24 +1,24 @@
1
- var Be = Object.defineProperty;
2
- var Fe = (r, e, t) => e in r ? Be(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var o = (r, e, t) => Fe(r, typeof e != "symbol" ? e + "" : e, t);
1
+ var Fe = Object.defineProperty;
2
+ var Oe = (r, e, t) => e in r ? Fe(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
+ var o = (r, e, t) => Oe(r, typeof e != "symbol" ? e + "" : e, t);
4
4
  const D = (r, e) => ({
5
5
  x: r.scale * e.x + r.x,
6
6
  y: r.scale * e.y + r.y
7
7
  });
8
8
  var C = /* @__PURE__ */ ((r) => (r.Line = "line", r.NodeCycle = "node-cycle", r.PortCycle = "port-cycle", r))(C || {});
9
- const Oe = () => {
9
+ const We = () => {
10
10
  const r = document.createElement("div");
11
11
  return r.style.width = "100%", r.style.height = "100%", r.style.position = "relative", r.style.overflow = "hidden", r;
12
- }, We = () => {
12
+ }, ke = () => {
13
13
  const r = document.createElement("div");
14
14
  return r.style.position = "absolute", r.style.top = "0", r.style.left = "0", r.style.width = "0", r.style.height = "0", r;
15
- }, ke = (r) => {
15
+ }, ze = (r) => {
16
16
  r.style.position = "absolute", r.style.top = "0", r.style.left = "0", r.style.visibility = "hidden";
17
17
  };
18
- class ye {
18
+ class me {
19
19
  constructor(e, t, s) {
20
- o(this, "host", Oe());
21
- o(this, "container", We());
20
+ o(this, "host", We());
21
+ o(this, "container", ke());
22
22
  o(this, "edgeIdToElementMap", /* @__PURE__ */ new Map());
23
23
  o(this, "attachedNodeIds", /* @__PURE__ */ new Set());
24
24
  o(this, "applyTransform", () => {
@@ -29,7 +29,7 @@ class ye {
29
29
  }
30
30
  attachNode(e) {
31
31
  const t = this.graphStore.getNode(e);
32
- ke(t.element), this.attachedNodeIds.add(e), this.container.appendChild(t.element), this.updateNodePosition(e), this.updateNodePriority(e), t.element.style.visibility = "visible";
32
+ ze(t.element), this.attachedNodeIds.add(e), this.container.appendChild(t.element), this.updateNodePosition(e), this.updateNodePriority(e), t.element.style.visibility = "visible";
33
33
  }
34
34
  detachNode(e) {
35
35
  const t = this.graphStore.getNode(e);
@@ -100,7 +100,7 @@ class ye {
100
100
  };
101
101
  }
102
102
  }
103
- class ze {
103
+ class Xe {
104
104
  constructor(e) {
105
105
  o(this, "xFrom", 1 / 0);
106
106
  o(this, "yFrom", 1 / 0);
@@ -120,7 +120,7 @@ class ze {
120
120
  return h <= this.xTo && d >= this.xFrom && c <= this.yTo && g >= this.yFrom;
121
121
  }
122
122
  }
123
- class Xe {
123
+ class Ye {
124
124
  constructor(e, t, s, i) {
125
125
  o(this, "attachedNodes", /* @__PURE__ */ new Set());
126
126
  o(this, "attachedEdges", /* @__PURE__ */ new Set());
@@ -144,7 +144,7 @@ class Xe {
144
144
  this.handleAttachEdge(a);
145
145
  });
146
146
  });
147
- this.htmlView = e, this.graphStore = t, this.trigger = s, this.params = i, this.renderingBox = new ze(this.graphStore), this.trigger.subscribe(this.updateViewport);
147
+ this.htmlView = e, this.graphStore = t, this.trigger = s, this.params = i, this.renderingBox = new Xe(this.graphStore), this.trigger.subscribe(this.updateViewport);
148
148
  }
149
149
  attachNode(e) {
150
150
  this.renderingBox.hasNode(e) && this.handleAttachNode(e);
@@ -198,7 +198,7 @@ class Xe {
198
198
  this.htmlView.detachEdge(e), this.attachedEdges.delete(e);
199
199
  }
200
200
  }
201
- class Ye {
201
+ class He {
202
202
  constructor(e, t) {
203
203
  o(this, "deferredNodes", /* @__PURE__ */ new Set());
204
204
  o(this, "deferredEdges", /* @__PURE__ */ new Set());
@@ -268,7 +268,7 @@ class G {
268
268
  });
269
269
  }
270
270
  }
271
- const S = () => {
271
+ const x = () => {
272
272
  const r = new G();
273
273
  return [r, r];
274
274
  };
@@ -361,7 +361,7 @@ class ve {
361
361
  this.onAfterEdgeShapeUpdated
362
362
  ), this.graphStore.onAfterEdgeUpdated.subscribe(this.onAfterEdgeUpdated), this.graphStore.onAfterEdgePriorityUpdated.subscribe(
363
363
  this.onAfterEdgePriorityUpdated
364
- ), this.graphStore.onBeforeEdgeRemoved.subscribe(this.onBeforeEdgeRemoved), this.graphStore.onBeforeClear.subscribe(this.onBeforeClear), [this.onBeforeDestroyEmitter, this.onBeforeDestroy] = S();
364
+ ), this.graphStore.onBeforeEdgeRemoved.subscribe(this.onBeforeEdgeRemoved), this.graphStore.onBeforeClear.subscribe(this.onBeforeClear), [this.onBeforeDestroyEmitter, this.onBeforeDestroy] = x();
365
365
  }
366
366
  /**
367
367
  * adds new node
@@ -510,7 +510,7 @@ class ve {
510
510
  ), this.graphStore.onBeforeEdgeRemoved.unsubscribe(this.onBeforeEdgeRemoved), this.graphStore.onBeforeClear.unsubscribe(this.onBeforeClear), this.htmlView.destroy(), this.destroyed = !0);
511
511
  }
512
512
  }
513
- class He {
513
+ class je {
514
514
  constructor() {
515
515
  o(this, "singleToMultiMap", /* @__PURE__ */ new Map());
516
516
  o(this, "multiToSingleMap", /* @__PURE__ */ new Map());
@@ -559,7 +559,7 @@ class Ee {
559
559
  o(this, "portIncomingEdges", /* @__PURE__ */ new Map());
560
560
  o(this, "portOutcomingEdges", /* @__PURE__ */ new Map());
561
561
  o(this, "portCycleEdges", /* @__PURE__ */ new Map());
562
- o(this, "elementPorts", new He());
562
+ o(this, "elementPorts", new je());
563
563
  o(this, "afterNodeAddedEmitter");
564
564
  o(this, "onAfterNodeAdded");
565
565
  o(this, "afterNodeUpdatedEmitter");
@@ -586,7 +586,7 @@ class Ee {
586
586
  o(this, "onBeforeEdgeRemoved");
587
587
  o(this, "beforeClearEmitter");
588
588
  o(this, "onBeforeClear");
589
- [this.afterNodeAddedEmitter, this.onAfterNodeAdded] = S(), [this.afterNodeUpdatedEmitter, this.onAfterNodeUpdated] = S(), [this.afterNodePriorityUpdatedEmitter, this.onAfterNodePriorityUpdated] = S(), [this.beforeNodeRemovedEmitter, this.onBeforeNodeRemoved] = S(), [this.afterPortAddedEmitter, this.onAfterPortAdded] = S(), [this.afterPortUpdatedEmitter, this.onAfterPortUpdated] = S(), [this.beforePortRemovedEmitter, this.onBeforePortRemoved] = S(), [this.afterEdgeAddedEmitter, this.onAfterEdgeAdded] = S(), [this.afterEdgeShapeUpdatedEmitter, this.onAfterEdgeShapeUpdated] = S(), [this.afterEdgeUpdatedEmitter, this.onAfterEdgeUpdated] = S(), [this.afterEdgePriorityUpdatedEmitter, this.onAfterEdgePriorityUpdated] = S(), [this.beforeEdgeRemovedEmitter, this.onBeforeEdgeRemoved] = S(), [this.beforeClearEmitter, this.onBeforeClear] = S();
589
+ [this.afterNodeAddedEmitter, this.onAfterNodeAdded] = x(), [this.afterNodeUpdatedEmitter, this.onAfterNodeUpdated] = x(), [this.afterNodePriorityUpdatedEmitter, this.onAfterNodePriorityUpdated] = x(), [this.beforeNodeRemovedEmitter, this.onBeforeNodeRemoved] = x(), [this.afterPortAddedEmitter, this.onAfterPortAdded] = x(), [this.afterPortUpdatedEmitter, this.onAfterPortUpdated] = x(), [this.beforePortRemovedEmitter, this.onBeforePortRemoved] = x(), [this.afterEdgeAddedEmitter, this.onAfterEdgeAdded] = x(), [this.afterEdgeShapeUpdatedEmitter, this.onAfterEdgeShapeUpdated] = x(), [this.afterEdgeUpdatedEmitter, this.onAfterEdgeUpdated] = x(), [this.afterEdgePriorityUpdatedEmitter, this.onAfterEdgePriorityUpdated] = x(), [this.beforeEdgeRemovedEmitter, this.onBeforeEdgeRemoved] = x(), [this.beforeClearEmitter, this.onBeforeClear] = x();
590
590
  }
591
591
  addNode(e) {
592
592
  const t = /* @__PURE__ */ new Map(), s = {
@@ -766,13 +766,13 @@ const ce = (r) => ({
766
766
  x: 0,
767
767
  y: 0
768
768
  };
769
- class je {
769
+ class Ge {
770
770
  constructor() {
771
771
  o(this, "viewportMatrix", le);
772
772
  o(this, "contentMatrix", le);
773
773
  o(this, "afterUpdateEmitter");
774
774
  o(this, "onAfterUpdated");
775
- [this.afterUpdateEmitter, this.onAfterUpdated] = S();
775
+ [this.afterUpdateEmitter, this.onAfterUpdated] = x();
776
776
  }
777
777
  getViewportMatrix() {
778
778
  return this.viewportMatrix;
@@ -825,10 +825,10 @@ class K {
825
825
  this.canvas.updateNode(t);
826
826
  }
827
827
  }
828
- const Ge = (r, e, t) => {
828
+ const Ke = (r, e, t) => {
829
829
  const { x: s, y: i, width: n, height: a } = r.getBoundingClientRect();
830
830
  return e >= s && e <= s + n && t >= i && t <= i + a;
831
- }, Ke = (r, e, t) => e >= 0 && e <= r.innerWidth && t >= 0 && t <= r.innerHeight, V = (r, e, t, s) => Ge(e, t, s) && Ke(r, t, s), B = (r, e) => {
831
+ }, Ze = (r, e, t) => e >= 0 && e <= r.innerWidth && t >= 0 && t <= r.innerHeight, V = (r, e, t, s) => Ke(e, t, s) && Ze(r, t, s), B = (r, e) => {
832
832
  e !== null ? r.style.cursor = e : r.style.removeProperty("cursor");
833
833
  }, F = (r) => {
834
834
  const e = document.createElement("div");
@@ -845,31 +845,31 @@ const Ge = (r, e, t) => {
845
845
  }
846
846
  ]
847
847
  };
848
- }, Ze = (r, e) => {
848
+ }, Je = (r, e) => {
849
849
  let t = e, s = null;
850
850
  for (; t !== null && (s = r.getElementPortIds(t)[0] ?? null, s === null); )
851
851
  t = t.parentElement;
852
852
  return s;
853
- }, Ae = (r, e) => {
854
- const t = document.elementsFromPoint(e.x, e.y);
853
+ }, Ae = (r, e) => r.elementsFromPoint(e.x, e.y).map((t) => t.shadowRoot !== null ? [...Ae(t.shadowRoot, e), t] : [t]).flat(), xe = (r, e) => {
854
+ const t = Ae(document, e);
855
855
  for (const s of t) {
856
- const i = Ze(r, s);
856
+ const i = Je(r, s);
857
857
  if (i !== null)
858
858
  return i;
859
859
  }
860
860
  return null;
861
861
  };
862
862
  var b = /* @__PURE__ */ ((r) => (r.Static = "static", r.Dragging = "dragging", r.Edge = "edge", r))(b || {});
863
- const xe = (r, e) => ({
863
+ const Se = (r, e) => ({
864
864
  x: r / 2,
865
865
  y: e / 2
866
866
  }), p = {
867
867
  x: 0,
868
868
  y: 0
869
- }, y = (r, e, t) => ({
869
+ }, m = (r, e, t) => ({
870
870
  x: e.x * r.x - e.y * r.y + ((1 - e.x) * t.x + e.y * t.y),
871
871
  y: e.y * r.x + e.x * r.y + ((1 - e.x) * t.y - e.y * t.x)
872
- }), Se = (r, e) => {
872
+ }), Pe = (r, e) => {
873
873
  const t = {
874
874
  x: r.x + r.width / 2,
875
875
  y: r.y + r.height / 2
@@ -889,18 +889,18 @@ const xe = (r, e) => ({
889
889
  x: e * r.x + (1 - e) / 2 * s.x,
890
890
  y: t * r.y + (1 - t) / 2 * s.y
891
891
  });
892
- class Je {
892
+ class Qe {
893
893
  constructor(e) {
894
894
  o(this, "path");
895
895
  o(this, "midpoint");
896
896
  this.params = e;
897
897
  const t = this.params.to;
898
898
  this.midpoint = { x: t.x / 2, y: t.y / 2 };
899
- const s = y(
899
+ const s = m(
900
900
  { x: this.params.arrowLength, y: p.y },
901
901
  this.params.sourceDirection,
902
902
  p
903
- ), i = y(
903
+ ), i = m(
904
904
  { x: this.params.to.x - this.params.arrowLength, y: this.params.to.y },
905
905
  this.params.targetDirection,
906
906
  this.params.to
@@ -914,30 +914,30 @@ class Je {
914
914
  this.path = `${d}${h}${c}`;
915
915
  }
916
916
  }
917
- class Qe {
917
+ class qe {
918
918
  constructor(e) {
919
919
  o(this, "path");
920
920
  o(this, "midpoint");
921
921
  this.params = e;
922
- const t = this.params.hasSourceArrow ? y(
922
+ const t = this.params.hasSourceArrow ? m(
923
923
  { x: this.params.arrowLength, y: p.y },
924
924
  this.params.sourceDirection,
925
925
  p
926
- ) : p, s = this.params.hasTargetArrow ? y(
926
+ ) : p, s = this.params.hasTargetArrow ? m(
927
927
  {
928
928
  x: this.params.to.x - this.params.arrowLength,
929
929
  y: this.params.to.y
930
930
  },
931
931
  this.params.targetDirection,
932
932
  this.params.to
933
- ) : this.params.to, i = this.params.arrowLength, n = Math.cos(this.params.detourDirection) * this.params.detourDistance, a = Math.sin(this.params.detourDirection) * this.params.detourDistance, h = n * this.params.flipX, d = a * this.params.flipY, c = y(
933
+ ) : this.params.to, i = this.params.arrowLength, n = Math.cos(this.params.detourDirection) * this.params.detourDistance, a = Math.sin(this.params.detourDirection) * this.params.detourDistance, h = n * this.params.flipX, d = a * this.params.flipY, c = m(
934
934
  { x: i, y: p.y },
935
935
  this.params.sourceDirection,
936
936
  p
937
937
  ), g = {
938
938
  x: c.x + h,
939
939
  y: c.y + d
940
- }, l = y(
940
+ }, l = m(
941
941
  { x: this.params.to.x - i, y: this.params.to.y },
942
942
  this.params.targetDirection,
943
943
  this.params.to
@@ -947,7 +947,7 @@ class Qe {
947
947
  }, w = {
948
948
  x: (g.x + u.x) / 2,
949
949
  y: (g.y + u.y) / 2
950
- }, m = {
950
+ }, y = {
951
951
  x: c.x + this.params.curvature * this.params.sourceDirection.x,
952
952
  y: c.y + this.params.curvature * this.params.sourceDirection.y
953
953
  }, v = {
@@ -963,7 +963,7 @@ class Qe {
963
963
  this.path = [
964
964
  `M ${t.x} ${t.y}`,
965
965
  `L ${c.x} ${c.y}`,
966
- `C ${m.x} ${m.y} ${E.x} ${E.y} ${w.x} ${w.y}`,
966
+ `C ${y.x} ${y.y} ${E.x} ${E.y} ${w.x} ${w.y}`,
967
967
  `C ${A.x} ${A.y} ${v.x} ${v.y} ${l.x} ${l.y}`,
968
968
  `L ${s.x} ${s.y}`
969
969
  ].join(" "), this.midpoint = W(w, e.flipX, e.flipY, e.to);
@@ -971,19 +971,19 @@ class Qe {
971
971
  }
972
972
  const Z = Object.freeze({
973
973
  edgeColor: "--edge-color"
974
- }), Pe = (r) => {
974
+ }), be = (r) => {
975
975
  const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
976
976
  return e.style.pointerEvents = "none", e.style.position = "absolute", e.style.top = "0", e.style.left = "0", e.style.overflow = "visible", e.style.setProperty(Z.edgeColor, r), e;
977
- }, be = (r) => {
977
+ }, Te = (r) => {
978
978
  const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
979
979
  return e.setAttribute("stroke", `var(${Z.edgeColor})`), e.setAttribute("stroke-width", `${r}`), e.setAttribute("fill", "none"), e;
980
980
  }, O = () => {
981
981
  const r = document.createElementNS("http://www.w3.org/2000/svg", "path");
982
982
  return r.setAttribute("fill", `var(${Z.edgeColor})`), r;
983
- }, Te = () => {
983
+ }, De = () => {
984
984
  const r = document.createElementNS("http://www.w3.org/2000/svg", "g");
985
985
  return r.style.transformOrigin = "50% 50%", r;
986
- }, De = (r, e) => {
986
+ }, Ne = (r, e) => {
987
987
  r.style.transform = `translate(${e.x}px, ${e.y}px)`, r.style.width = `${Math.max(e.width, 1)}px`, r.style.height = `${Math.max(e.height, 1)}px`;
988
988
  }, L = (r, e) => {
989
989
  const t = [];
@@ -992,42 +992,42 @@ const Z = Object.freeze({
992
992
  let i = 0, n = 0, a = 0;
993
993
  r.forEach((h, d) => {
994
994
  let c = 0, g = 0, l = 0;
995
- const u = d > 0, w = d < s, m = u && w;
995
+ const u = d > 0, w = d < s, y = u && w;
996
996
  if (u && (c = -i, g = -n, l = a), w) {
997
997
  const $ = r[d + 1];
998
998
  i = $.x - h.x, n = $.y - h.y, a = Math.sqrt(i * i + n * n);
999
999
  }
1000
- const E = a !== 0 ? Math.min((m ? e : 0) / a, d < s - 1 ? 0.5 : 1) : 0, A = m ? { x: h.x + i * E, y: h.y + n * E } : h, T = l !== 0 ? Math.min((m ? e : 0) / l, d > 1 ? 0.5 : 1) : 0, N = m ? { x: h.x + c * T, y: h.y + g * T } : h;
1001
- d > 0 && t.push(`L ${N.x} ${N.y}`), m && t.push(
1000
+ const E = a !== 0 ? Math.min((y ? e : 0) / a, d < s - 1 ? 0.5 : 1) : 0, A = y ? { x: h.x + i * E, y: h.y + n * E } : h, T = l !== 0 ? Math.min((y ? e : 0) / l, d > 1 ? 0.5 : 1) : 0, N = y ? { x: h.x + c * T, y: h.y + g * T } : h;
1001
+ d > 0 && t.push(`L ${N.x} ${N.y}`), y && t.push(
1002
1002
  `C ${h.x} ${h.y} ${h.x} ${h.y} ${A.x} ${A.y}`
1003
1003
  );
1004
1004
  });
1005
1005
  }
1006
1006
  return t.join(" ");
1007
1007
  };
1008
- class qe {
1008
+ class _e {
1009
1009
  constructor(e) {
1010
1010
  o(this, "path");
1011
1011
  o(this, "midpoint");
1012
1012
  this.params = e;
1013
1013
  const t = this.params.to;
1014
1014
  this.midpoint = { x: t.x / 2, y: t.y / 2 };
1015
- const s = this.params.hasSourceArrow ? y(
1015
+ const s = this.params.hasSourceArrow ? m(
1016
1016
  { x: this.params.arrowLength, y: p.y },
1017
1017
  this.params.sourceDirection,
1018
1018
  p
1019
- ) : p, i = this.params.hasTargetArrow ? y(
1019
+ ) : p, i = this.params.hasTargetArrow ? m(
1020
1020
  {
1021
1021
  x: this.params.to.x - this.params.arrowLength,
1022
1022
  y: this.params.to.y
1023
1023
  },
1024
1024
  this.params.targetDirection,
1025
1025
  this.params.to
1026
- ) : this.params.to, n = this.params.arrowLength + this.params.arrowOffset, a = n - this.params.roundness, h = y(
1026
+ ) : this.params.to, n = this.params.arrowLength + this.params.arrowOffset, a = n - this.params.roundness, h = m(
1027
1027
  { x: a, y: p.y },
1028
1028
  this.params.sourceDirection,
1029
1029
  p
1030
- ), d = y(
1030
+ ), d = m(
1031
1031
  { x: this.params.to.x - a, y: this.params.to.y },
1032
1032
  this.params.targetDirection,
1033
1033
  this.params.to
@@ -1037,34 +1037,34 @@ class qe {
1037
1037
  }, u = { x: l.x, y: g }, w = {
1038
1038
  x: this.params.flipX > 0 ? this.params.to.x - c : this.params.to.x + n,
1039
1039
  y: d.y
1040
- }, m = { x: w.x, y: g };
1040
+ }, y = { x: w.x, y: g };
1041
1041
  this.path = L(
1042
- [s, h, l, u, m, w, d, i],
1042
+ [s, h, l, u, y, w, d, i],
1043
1043
  this.params.roundness
1044
1044
  );
1045
1045
  }
1046
1046
  }
1047
- class _e {
1047
+ class et {
1048
1048
  constructor(e) {
1049
1049
  o(this, "path");
1050
1050
  o(this, "midpoint");
1051
1051
  this.params = e;
1052
- const t = this.params.hasSourceArrow ? y(
1052
+ const t = this.params.hasSourceArrow ? m(
1053
1053
  { x: this.params.arrowLength, y: p.y },
1054
1054
  this.params.sourceDirection,
1055
1055
  p
1056
- ) : p, s = this.params.hasTargetArrow ? y(
1056
+ ) : p, s = this.params.hasTargetArrow ? m(
1057
1057
  {
1058
1058
  x: this.params.to.x - this.params.arrowLength,
1059
1059
  y: this.params.to.y
1060
1060
  },
1061
1061
  this.params.targetDirection,
1062
1062
  this.params.to
1063
- ) : this.params.to, i = this.params.arrowLength + this.params.arrowOffset, n = y(
1063
+ ) : this.params.to, i = this.params.arrowLength + this.params.arrowOffset, n = m(
1064
1064
  { x: i, y: p.y },
1065
1065
  this.params.sourceDirection,
1066
1066
  p
1067
- ), a = Math.cos(this.params.detourDirection) * this.params.detourDistance, h = Math.sin(this.params.detourDirection) * this.params.detourDistance, d = a * this.params.flipX, c = h * this.params.flipY, g = { x: n.x + d, y: n.y + c }, l = y(
1067
+ ), a = Math.cos(this.params.detourDirection) * this.params.detourDistance, h = Math.sin(this.params.detourDirection) * this.params.detourDistance, d = a * this.params.flipX, c = h * this.params.flipY, g = { x: n.x + d, y: n.y + c }, l = m(
1068
1068
  { x: this.params.to.x - i, y: this.params.to.y },
1069
1069
  this.params.targetDirection,
1070
1070
  this.params.to
@@ -1075,29 +1075,29 @@ class _e {
1075
1075
  );
1076
1076
  }
1077
1077
  }
1078
- class et {
1078
+ class tt {
1079
1079
  constructor(e) {
1080
1080
  o(this, "path");
1081
1081
  o(this, "midpoint");
1082
1082
  this.params = e;
1083
1083
  const t = this.params.to;
1084
1084
  this.midpoint = { x: t.x / 2, y: t.y / 2 };
1085
- const s = this.params.hasSourceArrow ? y(
1085
+ const s = this.params.hasSourceArrow ? m(
1086
1086
  { x: this.params.arrowLength, y: p.y },
1087
1087
  this.params.sourceDirection,
1088
1088
  p
1089
- ) : p, i = this.params.hasTargetArrow ? y(
1089
+ ) : p, i = this.params.hasTargetArrow ? m(
1090
1090
  {
1091
1091
  x: this.params.to.x - this.params.arrowLength,
1092
1092
  y: this.params.to.y
1093
1093
  },
1094
1094
  this.params.targetDirection,
1095
1095
  this.params.to
1096
- ) : this.params.to, n = this.params.arrowLength + this.params.arrowOffset, a = y(
1096
+ ) : this.params.to, n = this.params.arrowLength + this.params.arrowOffset, a = m(
1097
1097
  { x: n, y: p.y },
1098
1098
  this.params.sourceDirection,
1099
1099
  p
1100
- ), h = y(
1100
+ ), h = m(
1101
1101
  { x: this.params.to.x - n, y: this.params.to.y },
1102
1102
  this.params.targetDirection,
1103
1103
  this.params.to
@@ -1105,29 +1105,29 @@ class et {
1105
1105
  this.path = L([s, a, h, i], this.params.roundness);
1106
1106
  }
1107
1107
  }
1108
- class tt {
1108
+ class rt {
1109
1109
  constructor(e) {
1110
1110
  o(this, "path");
1111
1111
  o(this, "midpoint");
1112
1112
  this.params = e;
1113
1113
  const t = this.params.to;
1114
1114
  this.midpoint = { x: t.x / 2, y: t.y / 2 };
1115
- const s = this.params.hasSourceArrow ? y(
1115
+ const s = this.params.hasSourceArrow ? m(
1116
1116
  { x: this.params.arrowLength, y: p.y },
1117
1117
  this.params.sourceDirection,
1118
1118
  p
1119
- ) : p, i = this.params.hasTargetArrow ? y(
1119
+ ) : p, i = this.params.hasTargetArrow ? m(
1120
1120
  {
1121
1121
  x: this.params.to.x - this.params.arrowLength,
1122
1122
  y: this.params.to.y
1123
1123
  },
1124
1124
  this.params.targetDirection,
1125
1125
  this.params.to
1126
- ) : this.params.to, n = this.params.arrowLength + this.params.arrowOffset, a = n - this.params.roundness, h = y(
1126
+ ) : this.params.to, n = this.params.arrowLength + this.params.arrowOffset, a = n - this.params.roundness, h = m(
1127
1127
  { x: a, y: p.y },
1128
1128
  this.params.sourceDirection,
1129
1129
  p
1130
- ), d = y(
1130
+ ), d = m(
1131
1131
  { x: this.params.to.x - a, y: this.params.to.y },
1132
1132
  this.params.targetDirection,
1133
1133
  this.params.to
@@ -1137,9 +1137,9 @@ class tt {
1137
1137
  }, u = { x: g, y: l.y }, w = {
1138
1138
  x: d.x,
1139
1139
  y: this.params.flipY > 0 ? this.params.to.y - c : this.params.to.y + n
1140
- }, m = { x: g, y: w.y };
1140
+ }, y = { x: g, y: w.y };
1141
1141
  this.path = L(
1142
- [s, h, l, u, m, w, d, i],
1142
+ [s, h, l, u, y, w, d, i],
1143
1143
  this.params.roundness
1144
1144
  );
1145
1145
  }
@@ -1159,12 +1159,12 @@ class J {
1159
1159
  { x: i, y: p.y },
1160
1160
  { x: this.params.arrowLength, y: p.y }
1161
1161
  ].map(
1162
- (c) => y(c, this.params.sourceDirection, p)
1162
+ (c) => m(c, this.params.sourceDirection, p)
1163
1163
  ), d = `M ${p.x} ${p.y} L ${h[0].x} ${h[0].y} `;
1164
1164
  this.path = `${this.params.hasSourceArrow || this.params.hasTargetArrow ? "" : d}${L(h, this.params.roundness)}`, this.midpoint = { x: (h[3].x + h[4].x) / 2, y: (h[3].y + h[4].y) / 2 };
1165
1165
  }
1166
1166
  }
1167
- class rt {
1167
+ class st {
1168
1168
  constructor(e) {
1169
1169
  o(this, "path");
1170
1170
  o(this, "midpoint");
@@ -1175,7 +1175,7 @@ class rt {
1175
1175
  { x: c, y: -n },
1176
1176
  { x: d, y: 0 }
1177
1177
  ].map(
1178
- (m) => y(m, this.params.sourceDirection, p)
1178
+ (y) => m(y, this.params.sourceDirection, p)
1179
1179
  ), u = [
1180
1180
  `M ${l[0].x} ${l[0].y}`,
1181
1181
  `A ${t} ${t} 0 0 1 ${l[1].x} ${l[1].y}`,
@@ -1185,7 +1185,7 @@ class rt {
1185
1185
  this.path = `${this.params.hasSourceArrow || this.params.hasTargetArrow ? "" : w}${u}`, this.midpoint = l[3];
1186
1186
  }
1187
1187
  }
1188
- class st {
1188
+ class ot {
1189
1189
  constructor(e) {
1190
1190
  o(this, "path");
1191
1191
  o(this, "midpoint");
@@ -1221,27 +1221,27 @@ class st {
1221
1221
  };
1222
1222
  }
1223
1223
  }
1224
- class ot {
1224
+ class it {
1225
1225
  constructor(e) {
1226
1226
  o(this, "path");
1227
1227
  o(this, "midpoint");
1228
1228
  this.params = e;
1229
- const t = this.params.hasSourceArrow ? y(
1229
+ const t = this.params.hasSourceArrow ? m(
1230
1230
  { x: this.params.arrowLength, y: p.y },
1231
1231
  this.params.sourceDirection,
1232
1232
  p
1233
- ) : p, s = this.params.hasTargetArrow ? y(
1233
+ ) : p, s = this.params.hasTargetArrow ? m(
1234
1234
  {
1235
1235
  x: this.params.to.x - this.params.arrowLength,
1236
1236
  y: this.params.to.y
1237
1237
  },
1238
1238
  this.params.targetDirection,
1239
1239
  this.params.to
1240
- ) : this.params.to, i = this.params.arrowLength + this.params.arrowOffset, n = y(
1240
+ ) : this.params.to, i = this.params.arrowLength + this.params.arrowOffset, n = m(
1241
1241
  { x: i, y: p.y },
1242
1242
  this.params.sourceDirection,
1243
1243
  p
1244
- ), a = y(
1244
+ ), a = m(
1245
1245
  { x: this.params.to.x - i, y: this.params.to.y },
1246
1246
  this.params.targetDirection,
1247
1247
  this.params.to
@@ -1262,27 +1262,27 @@ class ot {
1262
1262
  );
1263
1263
  }
1264
1264
  }
1265
- class it {
1265
+ class nt {
1266
1266
  constructor(e) {
1267
1267
  o(this, "path");
1268
1268
  o(this, "midpoint");
1269
1269
  this.params = e;
1270
- const t = this.params.hasSourceArrow ? y(
1270
+ const t = this.params.hasSourceArrow ? m(
1271
1271
  { x: this.params.arrowLength, y: p.y },
1272
1272
  this.params.sourceDirection,
1273
1273
  p
1274
- ) : p, s = this.params.hasTargetArrow ? y(
1274
+ ) : p, s = this.params.hasTargetArrow ? m(
1275
1275
  {
1276
1276
  x: this.params.to.x - this.params.arrowLength,
1277
1277
  y: this.params.to.y
1278
1278
  },
1279
1279
  this.params.targetDirection,
1280
1280
  this.params.to
1281
- ) : this.params.to, i = this.params.arrowLength + this.params.arrowOffset, n = y(
1281
+ ) : this.params.to, i = this.params.arrowLength + this.params.arrowOffset, n = m(
1282
1282
  { x: i, y: p.y },
1283
1283
  this.params.sourceDirection,
1284
1284
  p
1285
- ), a = y(
1285
+ ), a = m(
1286
1286
  { x: this.params.to.x - i, y: this.params.to.y },
1287
1287
  this.params.targetDirection,
1288
1288
  this.params.to
@@ -1329,21 +1329,21 @@ const f = Object.freeze({
1329
1329
  class k {
1330
1330
  constructor(e) {
1331
1331
  o(this, "svg");
1332
- o(this, "group", Te());
1332
+ o(this, "group", De());
1333
1333
  o(this, "line");
1334
1334
  o(this, "sourceArrow", null);
1335
1335
  o(this, "targetArrow", null);
1336
1336
  o(this, "onAfterRender");
1337
1337
  o(this, "afterRenderEmitter");
1338
1338
  o(this, "arrowRenderer");
1339
- this.params = e, [this.afterRenderEmitter, this.onAfterRender] = S(), this.arrowRenderer = this.params.arrowRenderer, this.svg = Pe(e.color), this.svg.appendChild(this.group), this.line = be(e.width), this.group.appendChild(this.line), e.hasSourceArrow && (this.sourceArrow = O(), this.group.appendChild(this.sourceArrow)), e.hasTargetArrow && (this.targetArrow = O(), this.group.appendChild(this.targetArrow));
1339
+ this.params = e, [this.afterRenderEmitter, this.onAfterRender] = x(), this.arrowRenderer = this.params.arrowRenderer, this.svg = be(e.color), this.svg.appendChild(this.group), this.line = Te(e.width), this.group.appendChild(this.line), e.hasSourceArrow && (this.sourceArrow = O(), this.group.appendChild(this.sourceArrow)), e.hasTargetArrow && (this.targetArrow = O(), this.group.appendChild(this.targetArrow));
1340
1340
  }
1341
1341
  render(e) {
1342
- const { x: t, y: s, width: i, height: n, flipX: a, flipY: h } = Se(
1342
+ const { x: t, y: s, width: i, height: n, flipX: a, flipY: h } = Pe(
1343
1343
  e.from,
1344
1344
  e.to
1345
1345
  );
1346
- De(this.svg, { x: t, y: s, width: i, height: n }), this.group.style.transform = `scale(${a}, ${h})`;
1346
+ Ne(this.svg, { x: t, y: s, width: i, height: n }), this.group.style.transform = `scale(${a}, ${h})`;
1347
1347
  const d = ge(
1348
1348
  e.from.direction,
1349
1349
  a,
@@ -1366,12 +1366,12 @@ class k {
1366
1366
  h
1367
1367
  );
1368
1368
  this.line.setAttribute("d", w.path);
1369
- let m = null;
1370
- this.sourceArrow && (m = this.arrowRenderer({
1369
+ let y = null;
1370
+ this.sourceArrow && (y = this.arrowRenderer({
1371
1371
  direction: d,
1372
1372
  shift: p,
1373
1373
  arrowLength: this.params.arrowLength
1374
- }), this.sourceArrow.setAttribute("d", m));
1374
+ }), this.sourceArrow.setAttribute("d", y));
1375
1375
  let v = null;
1376
1376
  this.targetArrow && (v = this.arrowRenderer({
1377
1377
  direction: l,
@@ -1379,33 +1379,33 @@ class k {
1379
1379
  arrowLength: this.params.arrowLength
1380
1380
  }), this.targetArrow.setAttribute("d", v)), this.afterRenderEmitter.emit({
1381
1381
  edgePath: w,
1382
- sourceArrowPath: m,
1382
+ sourceArrowPath: y,
1383
1383
  targetArrowPath: v
1384
1384
  });
1385
1385
  }
1386
1386
  }
1387
- const nt = (r) => (e) => {
1387
+ const at = (r) => (e) => {
1388
1388
  const s = [
1389
1389
  p,
1390
1390
  { x: e.arrowLength, y: r.radius },
1391
1391
  { x: e.arrowLength, y: -r.radius }
1392
1392
  ].map(
1393
- (h) => y(h, e.direction, p)
1393
+ (h) => m(h, e.direction, p)
1394
1394
  ).map((h) => ({
1395
1395
  x: h.x + e.shift.x,
1396
1396
  y: h.y + e.shift.y
1397
1397
  })), i = `M ${s[0].x} ${s[0].y}`, n = `L ${s[1].x} ${s[1].y}`, a = `L ${s[2].x} ${s[2].y}`;
1398
1398
  return `${i} ${n} ${a} Z`;
1399
- }, at = (r) => (e) => {
1399
+ }, ht = (r) => (e) => {
1400
1400
  const t = r.radius, s = e.arrowLength, i = (s * s + 2 * s * t) / (2 * t), n = i + t, a = s + t - t * (s + t) / n, h = t * i / n, c = [p, { x: a, y: -h }, { x: a, y: h }].map(
1401
- (m) => y(m, e.direction, p)
1402
- ).map((m) => ({
1403
- x: m.x + e.shift.x,
1404
- y: m.y + e.shift.y
1401
+ (y) => m(y, e.direction, p)
1402
+ ).map((y) => ({
1403
+ x: y.x + e.shift.x,
1404
+ y: y.y + e.shift.y
1405
1405
  })), g = `M ${c[0].x} ${c[0].y}`, l = `A ${i} ${i} 0 0 0 ${c[1].x} ${c[1].y}`, u = `A ${t} ${t} 0 0 0 ${c[2].x} ${c[2].y}`, w = `A ${i} ${i} 0 0 0 ${c[0].x} ${c[0].y}`;
1406
1406
  return `${g} ${l} ${u} ${w}`;
1407
- }, ht = (r) => (e) => {
1408
- const t = r.smallRadius, s = r.radius, i = y(
1407
+ }, dt = (r) => (e) => {
1408
+ const t = r.smallRadius, s = r.radius, i = m(
1409
1409
  {
1410
1410
  x: e.arrowLength,
1411
1411
  y: 0
@@ -1419,7 +1419,7 @@ const nt = (r) => (e) => {
1419
1419
  y: 0
1420
1420
  }
1421
1421
  ), a = [p, { x: i.x, y: -i.y }, i].map(
1422
- (l) => y(l, e.direction, p)
1422
+ (l) => m(l, e.direction, p)
1423
1423
  ).map((l) => ({
1424
1424
  x: l.x + e.shift.x,
1425
1425
  y: l.y + e.shift.y
@@ -1430,22 +1430,22 @@ const nt = (r) => (e) => {
1430
1430
  return r;
1431
1431
  switch (r.type) {
1432
1432
  case "triangle":
1433
- return nt({
1433
+ return at({
1434
1434
  radius: r.radius ?? f.polygonArrowRadius
1435
1435
  });
1436
1436
  case "arc":
1437
- return at({
1437
+ return ht({
1438
1438
  radius: r.radius ?? f.circleArrowRadius
1439
1439
  });
1440
1440
  default:
1441
- return ht({
1441
+ return dt({
1442
1442
  smallRadius: r.smallRadius ?? f.wedgeArrowSmallRadius,
1443
1443
  angle: r.angle ?? f.wedgeArrowAngle,
1444
1444
  radius: r.radius ?? f.wedgeArrowRadius
1445
1445
  });
1446
1446
  }
1447
1447
  };
1448
- class dt {
1448
+ class ct {
1449
1449
  constructor(e) {
1450
1450
  o(this, "svg");
1451
1451
  o(this, "group");
@@ -1462,7 +1462,7 @@ class dt {
1462
1462
  o(this, "hasSourceArrow");
1463
1463
  o(this, "hasTargetArrow");
1464
1464
  o(this, "pathShape");
1465
- o(this, "createCyclePath", (e) => new rt({
1465
+ o(this, "createCyclePath", (e) => new st({
1466
1466
  sourceDirection: e,
1467
1467
  radius: this.portCycleRadius,
1468
1468
  smallRadius: this.portCycleSmallRadius,
@@ -1470,7 +1470,7 @@ class dt {
1470
1470
  hasSourceArrow: this.hasSourceArrow,
1471
1471
  hasTargetArrow: this.hasTargetArrow
1472
1472
  }));
1473
- o(this, "createDetourPath", (e, t, s, i, n) => new Qe({
1473
+ o(this, "createDetourPath", (e, t, s, i, n) => new qe({
1474
1474
  to: s,
1475
1475
  sourceDirection: e,
1476
1476
  targetDirection: t,
@@ -1483,7 +1483,7 @@ class dt {
1483
1483
  hasSourceArrow: this.hasSourceArrow,
1484
1484
  hasTargetArrow: this.hasTargetArrow
1485
1485
  }));
1486
- o(this, "createLinePath", (e, t, s) => new Je({
1486
+ o(this, "createLinePath", (e, t, s) => new Qe({
1487
1487
  to: s,
1488
1488
  sourceDirection: e,
1489
1489
  targetDirection: t,
@@ -1508,7 +1508,7 @@ class dt {
1508
1508
  this.pathShape.render(e);
1509
1509
  }
1510
1510
  }
1511
- class ct {
1511
+ class lt {
1512
1512
  constructor(e) {
1513
1513
  o(this, "svg");
1514
1514
  o(this, "group");
@@ -1533,7 +1533,7 @@ class ct {
1533
1533
  hasSourceArrow: this.hasSourceArrow,
1534
1534
  hasTargetArrow: this.hasTargetArrow
1535
1535
  }));
1536
- o(this, "createDetourPath", (e, t, s, i, n) => new ot({
1536
+ o(this, "createDetourPath", (e, t, s, i, n) => new it({
1537
1537
  to: s,
1538
1538
  sourceDirection: e,
1539
1539
  targetDirection: t,
@@ -1546,7 +1546,7 @@ class ct {
1546
1546
  hasSourceArrow: this.hasSourceArrow,
1547
1547
  hasTargetArrow: this.hasTargetArrow
1548
1548
  }));
1549
- o(this, "createLinePath", (e, t, s, i) => new qe({
1549
+ o(this, "createLinePath", (e, t, s, i) => new _e({
1550
1550
  to: s,
1551
1551
  sourceDirection: e,
1552
1552
  targetDirection: t,
@@ -1579,7 +1579,7 @@ class ct {
1579
1579
  this.pathShape.render(e);
1580
1580
  }
1581
1581
  }
1582
- class lt {
1582
+ class gt {
1583
1583
  constructor(e) {
1584
1584
  o(this, "svg");
1585
1585
  o(this, "group");
@@ -1605,7 +1605,7 @@ class lt {
1605
1605
  hasSourceArrow: this.hasSourceArrow,
1606
1606
  hasTargetArrow: this.hasTargetArrow
1607
1607
  }));
1608
- o(this, "createDetourPath", (e, t, s, i, n) => new _e({
1608
+ o(this, "createDetourPath", (e, t, s, i, n) => new et({
1609
1609
  to: s,
1610
1610
  sourceDirection: e,
1611
1611
  targetDirection: t,
@@ -1619,7 +1619,7 @@ class lt {
1619
1619
  hasSourceArrow: this.hasSourceArrow,
1620
1620
  hasTargetArrow: this.hasTargetArrow
1621
1621
  }));
1622
- o(this, "createLinePath", (e, t, s) => new et({
1622
+ o(this, "createLinePath", (e, t, s) => new tt({
1623
1623
  to: s,
1624
1624
  sourceDirection: e,
1625
1625
  targetDirection: t,
@@ -1651,7 +1651,7 @@ class lt {
1651
1651
  this.pathShape.render(e);
1652
1652
  }
1653
1653
  }
1654
- class gt {
1654
+ class ut {
1655
1655
  constructor(e) {
1656
1656
  o(this, "svg");
1657
1657
  o(this, "group");
@@ -1676,7 +1676,7 @@ class gt {
1676
1676
  hasSourceArrow: this.hasSourceArrow,
1677
1677
  hasTargetArrow: this.hasTargetArrow
1678
1678
  }));
1679
- o(this, "createDetourPath", (e, t, s, i, n) => new it({
1679
+ o(this, "createDetourPath", (e, t, s, i, n) => new nt({
1680
1680
  to: s,
1681
1681
  sourceDirection: e,
1682
1682
  targetDirection: t,
@@ -1689,7 +1689,7 @@ class gt {
1689
1689
  hasSourceArrow: this.hasSourceArrow,
1690
1690
  hasTargetArrow: this.hasTargetArrow
1691
1691
  }));
1692
- o(this, "createLinePath", (e, t, s, i, n) => new tt({
1692
+ o(this, "createLinePath", (e, t, s, i, n) => new rt({
1693
1693
  to: s,
1694
1694
  sourceDirection: e,
1695
1695
  targetDirection: t,
@@ -1722,10 +1722,10 @@ class gt {
1722
1722
  this.pathShape.render(e);
1723
1723
  }
1724
1724
  }
1725
- class Ne {
1725
+ class Me {
1726
1726
  constructor(e) {
1727
1727
  o(this, "svg");
1728
- o(this, "group", Te());
1728
+ o(this, "group", De());
1729
1729
  o(this, "line");
1730
1730
  o(this, "sourceArrow", null);
1731
1731
  o(this, "targetArrow", null);
@@ -1737,15 +1737,15 @@ class Ne {
1737
1737
  o(this, "onAfterRender");
1738
1738
  o(this, "afterRenderEmitter");
1739
1739
  o(this, "arrowRenderer");
1740
- [this.afterRenderEmitter, this.onAfterRender] = S(), this.color = (e == null ? void 0 : e.color) ?? f.color, this.width = (e == null ? void 0 : e.width) ?? f.width, this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? f.arrowLength, this.arrowRenderer = I((e == null ? void 0 : e.arrowRenderer) ?? {}), this.sourceOffset = (e == null ? void 0 : e.sourceOffset) ?? f.preOffset, this.targetOffset = (e == null ? void 0 : e.targetOffset) ?? f.preOffset, this.svg = Pe(this.color), this.svg.appendChild(this.group), this.line = be(this.width), this.group.appendChild(this.line), e != null && e.hasSourceArrow && (this.sourceArrow = O(), this.group.appendChild(this.sourceArrow)), e != null && e.hasTargetArrow && (this.targetArrow = O(), this.group.appendChild(this.targetArrow));
1740
+ [this.afterRenderEmitter, this.onAfterRender] = x(), this.color = (e == null ? void 0 : e.color) ?? f.color, this.width = (e == null ? void 0 : e.width) ?? f.width, this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? f.arrowLength, this.arrowRenderer = I((e == null ? void 0 : e.arrowRenderer) ?? {}), this.sourceOffset = (e == null ? void 0 : e.sourceOffset) ?? f.preOffset, this.targetOffset = (e == null ? void 0 : e.targetOffset) ?? f.preOffset, this.svg = be(this.color), this.svg.appendChild(this.group), this.line = Te(this.width), this.group.appendChild(this.line), e != null && e.hasSourceArrow && (this.sourceArrow = O(), this.group.appendChild(this.sourceArrow)), e != null && e.hasTargetArrow && (this.targetArrow = O(), this.group.appendChild(this.targetArrow));
1741
1741
  }
1742
1742
  render(e) {
1743
- const { x: t, y: s, width: i, height: n, flipX: a, flipY: h } = Se(
1743
+ const { x: t, y: s, width: i, height: n, flipX: a, flipY: h } = Pe(
1744
1744
  e.from,
1745
1745
  e.to
1746
1746
  );
1747
- De(this.svg, { x: t, y: s, width: i, height: n }), this.group.style.transform = `scale(${a}, ${h})`;
1748
- const d = { x: i, y: n }, c = new st({
1747
+ Ne(this.svg, { x: t, y: s, width: i, height: n }), this.group.style.transform = `scale(${a}, ${h})`;
1748
+ const d = { x: i, y: n }, c = new ot({
1749
1749
  to: d,
1750
1750
  sourceOffset: this.sourceOffset,
1751
1751
  targetOffset: this.targetOffset,
@@ -1764,26 +1764,26 @@ class Ne {
1764
1764
  y: d.y / u
1765
1765
  };
1766
1766
  if (this.sourceArrow) {
1767
- const m = {
1767
+ const y = {
1768
1768
  x: w.x * this.sourceOffset,
1769
1769
  y: w.y * this.sourceOffset
1770
1770
  };
1771
1771
  g = this.arrowRenderer({
1772
1772
  direction: w,
1773
- shift: m,
1773
+ shift: y,
1774
1774
  arrowLength: this.arrowLength
1775
1775
  }), this.sourceArrow.setAttribute("d", g);
1776
1776
  }
1777
1777
  if (this.targetArrow) {
1778
- const m = {
1778
+ const y = {
1779
1779
  x: w.x * this.targetOffset,
1780
1780
  y: w.y * this.targetOffset
1781
1781
  };
1782
1782
  l = this.arrowRenderer({
1783
1783
  direction: { x: -w.x, y: -w.y },
1784
1784
  shift: {
1785
- x: d.x - m.x,
1786
- y: d.y - m.y
1785
+ x: d.x - y.x,
1786
+ y: d.y - y.y
1787
1787
  },
1788
1788
  arrowLength: this.arrowLength
1789
1789
  }), this.targetArrow.setAttribute("d", l);
@@ -1796,40 +1796,40 @@ class Ne {
1796
1796
  });
1797
1797
  }
1798
1798
  }
1799
- const ut = () => {
1799
+ const pt = () => {
1800
1800
  const r = document.createElementNS("http://www.w3.org/2000/svg", "g");
1801
1801
  return r.style.pointerEvents = "auto", r.style.cursor = "pointer", r;
1802
- }, pt = (r) => {
1802
+ }, wt = (r) => {
1803
1803
  const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
1804
1804
  return e.setAttribute("stroke", "transparent"), e.setAttribute("stroke-width", `${r}`), e.setAttribute("fill", "none"), e.setAttribute("stroke-linecap", "round"), e;
1805
1805
  }, ue = (r) => {
1806
1806
  const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
1807
1807
  return e.setAttribute("stroke-linejoin", "round"), e.setAttribute("stroke-width", `${r}`), e.setAttribute("fill", "transparent"), e.setAttribute("stroke", "transparent"), e;
1808
1808
  };
1809
- class wt extends Error {
1809
+ class ft extends Error {
1810
1810
  constructor(e) {
1811
1811
  super(e), this.name = "InteractiveEdgeError";
1812
1812
  }
1813
1813
  }
1814
- class Me {
1814
+ class Le {
1815
1815
  constructor(e, t) {
1816
1816
  o(this, "svg");
1817
1817
  o(this, "group");
1818
1818
  o(this, "line");
1819
1819
  o(this, "sourceArrow");
1820
1820
  o(this, "targetArrow");
1821
- o(this, "handle", ut());
1821
+ o(this, "handle", pt());
1822
1822
  o(this, "onAfterRender");
1823
1823
  o(this, "interactiveLine");
1824
1824
  o(this, "interactiveSourceArrow", null);
1825
1825
  o(this, "interactiveTargetArrow", null);
1826
- if (this.baseEdge = e, e instanceof Me)
1827
- throw new wt(
1826
+ if (this.baseEdge = e, e instanceof Le)
1827
+ throw new ft(
1828
1828
  "interactive edge can be configured only once"
1829
1829
  );
1830
1830
  this.svg = this.baseEdge.svg, this.group = this.baseEdge.group, this.line = this.baseEdge.line, this.sourceArrow = this.baseEdge.sourceArrow, this.targetArrow = this.baseEdge.targetArrow, this.onAfterRender = this.baseEdge.onAfterRender;
1831
1831
  const s = (t == null ? void 0 : t.distance) ?? f.interactiveWidth;
1832
- this.interactiveLine = pt(s), this.handle.appendChild(this.interactiveLine), this.sourceArrow && (this.interactiveSourceArrow = ue(s), this.handle.appendChild(this.interactiveSourceArrow)), this.targetArrow && (this.interactiveTargetArrow = ue(s), this.handle.appendChild(this.interactiveTargetArrow)), this.group.appendChild(this.handle), this.baseEdge.onAfterRender.subscribe((i) => {
1832
+ this.interactiveLine = wt(s), this.handle.appendChild(this.interactiveLine), this.sourceArrow && (this.interactiveSourceArrow = ue(s), this.handle.appendChild(this.interactiveSourceArrow)), this.targetArrow && (this.interactiveTargetArrow = ue(s), this.handle.appendChild(this.interactiveTargetArrow)), this.group.appendChild(this.handle), this.baseEdge.onAfterRender.subscribe((i) => {
1833
1833
  this.interactiveLine.setAttribute("d", i.edgePath.path), this.interactiveSourceArrow && this.interactiveSourceArrow.setAttribute("d", i.sourceArrowPath), this.interactiveTargetArrow && this.interactiveTargetArrow.setAttribute("d", i.targetArrowPath);
1834
1834
  });
1835
1835
  }
@@ -1837,7 +1837,7 @@ class Me {
1837
1837
  this.baseEdge.render(e);
1838
1838
  }
1839
1839
  }
1840
- class Jt {
1840
+ class Qt {
1841
1841
  constructor(e, t) {
1842
1842
  o(this, "group");
1843
1843
  o(this, "line");
@@ -1854,7 +1854,7 @@ class Jt {
1854
1854
  this.baseShape.render(e);
1855
1855
  }
1856
1856
  }
1857
- class Le {
1857
+ class Re {
1858
1858
  constructor(e) {
1859
1859
  o(this, "onAfterNodeAdded");
1860
1860
  o(this, "onAfterNodeUpdated");
@@ -1947,7 +1947,7 @@ class Le {
1947
1947
  return this.graphStore.getNode(e) === void 0 ? null : this.graphStore.getNodeAdjacentEdgeIds(e);
1948
1948
  }
1949
1949
  }
1950
- class Re {
1950
+ class Ce {
1951
1951
  constructor(e) {
1952
1952
  o(this, "onAfterUpdated");
1953
1953
  this.viewportStore = e, this.onAfterUpdated = this.viewportStore.onAfterUpdated;
@@ -1959,14 +1959,14 @@ class Re {
1959
1959
  return { ...this.viewportStore.getContentMatrix() };
1960
1960
  }
1961
1961
  }
1962
- const Ce = (r, e) => {
1963
- const t = new Ee(), s = new Le(t), i = new Re(e), n = new ye(t, e, r), a = {
1962
+ const Ve = (r, e) => {
1963
+ const t = new Ee(), s = new Re(t), i = new Ce(e), n = new me(t, e, r), a = {
1964
1964
  nodes: {
1965
- centerFn: xe,
1965
+ centerFn: Se,
1966
1966
  priorityFn: () => 0
1967
1967
  },
1968
1968
  edges: {
1969
- shapeFactory: () => new Ne(),
1969
+ shapeFactory: () => new Me(),
1970
1970
  priorityFn: () => 0
1971
1971
  },
1972
1972
  ports: {
@@ -2279,7 +2279,7 @@ class Q {
2279
2279
  return e;
2280
2280
  }
2281
2281
  }
2282
- const ft = (r, e, t) => ({
2282
+ const yt = (r, e, t) => ({
2283
2283
  scale: r.scale,
2284
2284
  x: r.x + r.scale * e,
2285
2285
  y: r.y + r.scale * t
@@ -2406,7 +2406,7 @@ class X {
2406
2406
  new X(e, t, s, i);
2407
2407
  }
2408
2408
  moveViewport(e, t) {
2409
- const s = this.viewport.getViewportMatrix(), i = ft(s, e, t), { width: n, height: a } = this.element.getBoundingClientRect(), h = this.params.transformPreprocessor({
2409
+ const s = this.viewport.getViewportMatrix(), i = yt(s, e, t), { width: n, height: a } = this.element.getBoundingClientRect(), h = this.params.transformPreprocessor({
2410
2410
  prevTransform: s,
2411
2411
  nextTransform: i,
2412
2412
  canvasWidth: n,
@@ -2527,13 +2527,13 @@ class q {
2527
2527
  this.trigger.emit({ x: s, y: i, width: n, height: a });
2528
2528
  }
2529
2529
  }
2530
- const yt = () => {
2530
+ const vt = () => {
2531
2531
  const r = document.createElementNS("http://www.w3.org/2000/svg", "svg");
2532
2532
  return r.style.position = "absolute", r.style.inset = "0", r;
2533
- }, vt = () => {
2533
+ }, Et = () => {
2534
2534
  const r = document.createElementNS("http://www.w3.org/2000/svg", "rect");
2535
2535
  return r.setAttribute("fill", "url(#pattern)"), r;
2536
- }, Et = () => {
2536
+ }, At = () => {
2537
2537
  const r = document.createElementNS(
2538
2538
  "http://www.w3.org/2000/svg",
2539
2539
  "pattern"
@@ -2542,9 +2542,9 @@ const yt = () => {
2542
2542
  };
2543
2543
  class _ {
2544
2544
  constructor(e, t, s) {
2545
- o(this, "svg", yt());
2546
- o(this, "patternRenderingRectangle", vt());
2547
- o(this, "pattern", Et());
2545
+ o(this, "svg", vt());
2546
+ o(this, "patternRenderingRectangle", Et());
2547
+ o(this, "pattern", At());
2548
2548
  o(this, "patternContent");
2549
2549
  o(this, "tileWidth");
2550
2550
  o(this, "tileHeight");
@@ -2584,7 +2584,7 @@ class ee {
2584
2584
  o(this, "onEdgeCreated", (e) => {
2585
2585
  this.params.onAfterEdgeCreated(e);
2586
2586
  });
2587
- this.canvas = e, this.overlayLayer = t, this.viewportStore = s, this.window = i, this.params = n, this.overlayCanvas = Ce(
2587
+ this.canvas = e, this.overlayLayer = t, this.viewportStore = s, this.window = i, this.params = n, this.overlayCanvas = Ve(
2588
2588
  this.overlayLayer,
2589
2589
  this.viewportStore
2590
2590
  ), z.configure(
@@ -2638,9 +2638,9 @@ class ee {
2638
2638
  portDirection: this.params.dragPortDirection
2639
2639
  };
2640
2640
  this.isTargetDragging = s === "direct";
2641
- const [m, v] = this.isTargetDragging ? [u, w] : [w, u];
2642
- this.overlayCanvas.addNode(F(m)), this.overlayCanvas.addNode(F(v)), this.overlayCanvas.addEdge({
2643
- from: m.overlayId,
2641
+ const [y, v] = this.isTargetDragging ? [u, w] : [w, u];
2642
+ this.overlayCanvas.addNode(F(y)), this.overlayCanvas.addNode(F(v)), this.overlayCanvas.addEdge({
2643
+ from: y.overlayId,
2644
2644
  to: v.overlayId,
2645
2645
  shape: this.params.edgeShapeFactory(b.Edge)
2646
2646
  });
@@ -2649,7 +2649,7 @@ class ee {
2649
2649
  this.staticPortId = null, this.isTargetDragging = !0, this.overlayCanvas.clear();
2650
2650
  }
2651
2651
  tryCreateConnection(e) {
2652
- const t = Ae(this.canvas.graph, e), s = this.staticPortId;
2652
+ const t = xe(this.canvas.graph, e), s = this.staticPortId;
2653
2653
  if (t === null) {
2654
2654
  this.params.onEdgeCreationInterrupted({
2655
2655
  staticPortId: s,
@@ -2680,7 +2680,7 @@ class te {
2680
2680
  o(this, "onEdgeReattached", (e) => {
2681
2681
  this.params.onAfterEdgeReattached(e);
2682
2682
  });
2683
- this.canvas = e, this.overlayLayer = t, this.viewportStore = s, this.window = i, this.params = n, this.overlayCanvas = Ce(
2683
+ this.canvas = e, this.overlayLayer = t, this.viewportStore = s, this.window = i, this.params = n, this.overlayCanvas = Ve(
2684
2684
  this.overlayLayer,
2685
2685
  this.viewportStore
2686
2686
  ), z.configure(
@@ -2724,7 +2724,7 @@ class te {
2724
2724
  const d = this.canvas.graph.getPort(e), c = this.canvas.graph.getPort(h), g = c.element.getBoundingClientRect(), l = {
2725
2725
  x: g.x + g.width / 2,
2726
2726
  y: g.y + g.height / 2
2727
- }, u = this.canvas.viewport.getViewportMatrix(), w = this.overlayLayer.getBoundingClientRect(), m = D(u, {
2727
+ }, u = this.canvas.viewport.getViewportMatrix(), w = this.overlayLayer.getBoundingClientRect(), y = D(u, {
2728
2728
  x: l.x - w.x,
2729
2729
  y: l.y - w.y
2730
2730
  }), v = D(u, {
@@ -2740,7 +2740,7 @@ class te {
2740
2740
  }, this.canvas.removeEdge(s);
2741
2741
  const E = {
2742
2742
  overlayId: b.Static,
2743
- portCoords: m,
2743
+ portCoords: y,
2744
2744
  portDirection: c.direction
2745
2745
  }, A = {
2746
2746
  overlayId: b.Dragging,
@@ -2770,7 +2770,7 @@ class te {
2770
2770
  });
2771
2771
  }
2772
2772
  tryCreateConnection(e) {
2773
- const t = Ae(this.canvas.graph, e);
2773
+ const t = xe(this.canvas.graph, e);
2774
2774
  if (this.overlayCanvas.removeEdge(b.Edge), t === null) {
2775
2775
  const d = this.draggingEdgePayload;
2776
2776
  this.params.onEdgeReattachInterrupted({
@@ -2852,7 +2852,7 @@ class se {
2852
2852
  });
2853
2853
  }
2854
2854
  }
2855
- class At {
2855
+ class xt {
2856
2856
  static configure(e, t) {
2857
2857
  const s = t.applyOn;
2858
2858
  switch (s.type) {
@@ -2874,7 +2874,7 @@ class At {
2874
2874
  }
2875
2875
  }
2876
2876
  }
2877
- class xt {
2877
+ class St {
2878
2878
  constructor(e, t) {
2879
2879
  o(this, "previousTimeStamp");
2880
2880
  o(this, "step", (e) => {
@@ -2899,13 +2899,13 @@ class oe {
2899
2899
  this.staticNodes.has(i) || this.canvas.updateNode(i, { x: s.x, y: s.y });
2900
2900
  });
2901
2901
  });
2902
- this.canvas = e, this.algorithm = t, this.staticNodes = s, this.win = i, new xt(this.win, this.step);
2902
+ this.canvas = e, this.algorithm = t, this.staticNodes = s, this.win = i, new St(this.win, this.step);
2903
2903
  }
2904
2904
  static configure(e, t, s, i) {
2905
2905
  new oe(e, t, s, i);
2906
2906
  }
2907
2907
  }
2908
- const St = () => {
2908
+ const Pt = () => {
2909
2909
  const r = document.createElement("div");
2910
2910
  return r.style.width = "100%", r.style.height = "100%", r.style.position = "relative", r;
2911
2911
  }, H = () => {
@@ -2915,25 +2915,25 @@ const St = () => {
2915
2915
  const r = H();
2916
2916
  return r.style.pointerEvents = "none", r;
2917
2917
  };
2918
- class Pt {
2918
+ class bt {
2919
2919
  constructor(e) {
2920
2920
  o(this, "background", H());
2921
2921
  o(this, "main", H());
2922
2922
  o(this, "overlayConnectablePorts", pe());
2923
2923
  o(this, "overlayDraggableEdges", pe());
2924
- o(this, "host", St());
2924
+ o(this, "host", Pt());
2925
2925
  this.element = e, this.element.appendChild(this.host), this.host.appendChild(this.background), this.host.appendChild(this.main), this.host.appendChild(this.overlayConnectablePorts), this.host.appendChild(this.overlayDraggableEdges);
2926
2926
  }
2927
2927
  destroy() {
2928
2928
  this.host.removeChild(this.background), this.host.removeChild(this.main), this.host.removeChild(this.overlayConnectablePorts), this.host.removeChild(this.overlayDraggableEdges), this.element.removeChild(this.host);
2929
2929
  }
2930
2930
  }
2931
- const j = (r) => () => r, we = j(0), bt = () => {
2931
+ const j = (r) => () => r, we = j(0), Tt = () => {
2932
2932
  let r = 0;
2933
2933
  return () => r++;
2934
- }, Tt = (r, e) => {
2934
+ }, Dt = (r, e) => {
2935
2935
  let t = we, s = we;
2936
- const i = bt();
2936
+ const i = Tt();
2937
2937
  return r === "incremental" && (t = i), e === "incremental" && (s = i), typeof r == "number" && (t = j(r)), typeof e == "number" && (s = j(e)), typeof r == "function" && (t = r), typeof e == "function" && (s = e), {
2938
2938
  nodesPriorityFn: t,
2939
2939
  edgesPriorityFn: s
@@ -2943,7 +2943,7 @@ const j = (r) => () => r, we = j(0), bt = () => {
2943
2943
  return r;
2944
2944
  switch (r.type) {
2945
2945
  case "straight":
2946
- return () => new lt({
2946
+ return () => new gt({
2947
2947
  color: r.color,
2948
2948
  width: r.width,
2949
2949
  arrowLength: r.arrowLength,
@@ -2957,7 +2957,7 @@ const j = (r) => () => r, we = j(0), bt = () => {
2957
2957
  detourDirection: r.detourDirection
2958
2958
  });
2959
2959
  case "horizontal":
2960
- return () => new ct({
2960
+ return () => new lt({
2961
2961
  color: r.color,
2962
2962
  width: r.width,
2963
2963
  arrowLength: r.arrowLength,
@@ -2970,7 +2970,7 @@ const j = (r) => () => r, we = j(0), bt = () => {
2970
2970
  detourDistance: r.detourDistance
2971
2971
  });
2972
2972
  case "vertical":
2973
- return () => new gt({
2973
+ return () => new ut({
2974
2974
  color: r.color,
2975
2975
  width: r.width,
2976
2976
  arrowLength: r.arrowLength,
@@ -2983,7 +2983,7 @@ const j = (r) => () => r, we = j(0), bt = () => {
2983
2983
  detourDistance: r.detourDistance
2984
2984
  });
2985
2985
  case "direct":
2986
- return () => new Ne({
2986
+ return () => new Me({
2987
2987
  color: r.color,
2988
2988
  width: r.width,
2989
2989
  arrowLength: r.arrowLength,
@@ -2994,7 +2994,7 @@ const j = (r) => () => r, we = j(0), bt = () => {
2994
2994
  targetOffset: r.targetOffset
2995
2995
  });
2996
2996
  default:
2997
- return () => new dt({
2997
+ return () => new ct({
2998
2998
  color: r.color,
2999
2999
  width: r.width,
3000
3000
  arrowLength: r.arrowLength,
@@ -3008,15 +3008,15 @@ const j = (r) => () => r, we = j(0), bt = () => {
3008
3008
  detourDirection: r.detourDirection
3009
3009
  });
3010
3010
  }
3011
- }, Dt = (r) => {
3011
+ }, Nt = (r) => {
3012
3012
  var t, s, i, n, a;
3013
- const e = Tt(
3013
+ const e = Dt(
3014
3014
  (t = r.nodes) == null ? void 0 : t.priority,
3015
3015
  (s = r.edges) == null ? void 0 : s.priority
3016
3016
  );
3017
3017
  return {
3018
3018
  nodes: {
3019
- centerFn: ((i = r.nodes) == null ? void 0 : i.centerFn) ?? xe,
3019
+ centerFn: ((i = r.nodes) == null ? void 0 : i.centerFn) ?? Se,
3020
3020
  priorityFn: e.nodesPriorityFn
3021
3021
  },
3022
3022
  ports: {
@@ -3027,11 +3027,11 @@ const j = (r) => () => r, we = j(0), bt = () => {
3027
3027
  priorityFn: e.edgesPriorityFn
3028
3028
  }
3029
3029
  };
3030
- }, Nt = (r) => {
3031
- var u, w, m, v, E;
3030
+ }, Mt = (r) => {
3031
+ var u, w, y, v, E;
3032
3032
  const e = ((u = r.events) == null ? void 0 : u.onNodeDrag) ?? (() => {
3033
3033
  }), t = r.nodeDragVerifier ?? (() => !0), s = ((w = r.events) == null ? void 0 : w.onNodeDragFinished) ?? (() => {
3034
- }), i = r.moveOnTop !== !1, n = r.moveEdgesOnTop !== !1 && i, a = (m = r.mouse) == null ? void 0 : m.dragCursor, h = a !== void 0 ? a : "grab", d = (v = r.mouse) == null ? void 0 : v.mouseDownEventVerifier, c = d !== void 0 ? d : (A) => A.button === 0, g = (E = r.mouse) == null ? void 0 : E.mouseUpEventVerifier, l = g !== void 0 ? g : (A) => A.button === 0;
3034
+ }), i = r.moveOnTop !== !1, n = r.moveEdgesOnTop !== !1 && i, a = (y = r.mouse) == null ? void 0 : y.dragCursor, h = a !== void 0 ? a : "grab", d = (v = r.mouse) == null ? void 0 : v.mouseDownEventVerifier, c = d !== void 0 ? d : (A) => A.button === 0, g = (E = r.mouse) == null ? void 0 : E.mouseUpEventVerifier, l = g !== void 0 ? g : (A) => A.button === 0;
3035
3035
  return {
3036
3036
  moveOnTop: i,
3037
3037
  moveEdgesOnTop: n,
@@ -3043,7 +3043,7 @@ const j = (r) => () => r, we = j(0), bt = () => {
3043
3043
  nodeDragVerifier: t,
3044
3044
  onNodeDragFinished: s
3045
3045
  };
3046
- }, Mt = (r) => {
3046
+ }, Lt = (r) => {
3047
3047
  const e = r.minX !== null ? r.minX : -1 / 0, t = r.maxX !== null ? r.maxX : 1 / 0, s = r.minY !== null ? r.minY : -1 / 0, i = r.maxY !== null ? r.maxY : 1 / 0;
3048
3048
  return (n) => {
3049
3049
  let a = n.nextTransform.x, h = n.nextTransform.y;
@@ -3053,7 +3053,7 @@ const j = (r) => () => r, we = j(0), bt = () => {
3053
3053
  const g = n.canvasHeight * n.prevTransform.scale, l = i - g;
3054
3054
  return h > l && h > n.prevTransform.y && (h = Math.max(n.prevTransform.y, l)), { scale: n.nextTransform.scale, x: a, y: h };
3055
3055
  };
3056
- }, Lt = (r) => {
3056
+ }, Rt = (r) => {
3057
3057
  const e = r.maxContentScale, t = r.minContentScale, s = e !== null ? 1 / e : 0, i = t !== null ? 1 / t : 1 / 0;
3058
3058
  return (n) => {
3059
3059
  const a = n.prevTransform, h = n.nextTransform;
@@ -3074,7 +3074,7 @@ const j = (r) => () => r, we = j(0), bt = () => {
3074
3074
  y: g
3075
3075
  };
3076
3076
  };
3077
- }, Rt = (r) => (e) => r.reduce(
3077
+ }, Ct = (r) => (e) => r.reduce(
3078
3078
  (t, s) => s({
3079
3079
  prevTransform: e.prevTransform,
3080
3080
  nextTransform: t,
@@ -3087,23 +3087,23 @@ const j = (r) => () => r, we = j(0), bt = () => {
3087
3087
  return r;
3088
3088
  switch (r.type) {
3089
3089
  case "scale-limit":
3090
- return Lt({
3090
+ return Rt({
3091
3091
  minContentScale: r.minContentScale ?? 0,
3092
3092
  maxContentScale: r.maxContentScale ?? 1 / 0
3093
3093
  });
3094
3094
  case "shift-limit":
3095
- return Mt({
3095
+ return Lt({
3096
3096
  minX: r.minX ?? -1 / 0,
3097
3097
  maxX: r.maxX ?? 1 / 0,
3098
3098
  minY: r.minY ?? -1 / 0,
3099
3099
  maxY: r.maxY ?? 1 / 0
3100
3100
  });
3101
3101
  }
3102
- }, me = (r) => {
3103
- var m, v, E, A, R, T, N, $, ne, ae, he, de;
3104
- const e = (m = r == null ? void 0 : r.scale) == null ? void 0 : m.mouseWheelSensitivity, t = e !== void 0 ? e : 1.2, s = r == null ? void 0 : r.transformPreprocessor;
3102
+ }, ye = (r) => {
3103
+ var y, v, E, A, R, T, N, $, ne, ae, he, de;
3104
+ const e = (y = r == null ? void 0 : r.scale) == null ? void 0 : y.mouseWheelSensitivity, t = e !== void 0 ? e : 1.2, s = r == null ? void 0 : r.transformPreprocessor;
3105
3105
  let i;
3106
- s !== void 0 ? Array.isArray(s) ? i = Rt(
3106
+ s !== void 0 ? Array.isArray(s) ? i = Ct(
3107
3107
  s.map(
3108
3108
  (M) => fe(M)
3109
3109
  )
@@ -3130,24 +3130,24 @@ const j = (r) => () => r, we = j(0), bt = () => {
3130
3130
  onResizeTransformFinished: ((de = r == null ? void 0 : r.events) == null ? void 0 : de.onResizeTransformFinished) ?? (() => {
3131
3131
  })
3132
3132
  };
3133
- }, Ct = (r, e) => {
3133
+ }, Vt = (r, e) => {
3134
3134
  const t = document.createElementNS(
3135
3135
  "http://www.w3.org/2000/svg",
3136
3136
  "circle"
3137
3137
  );
3138
3138
  return t.setAttribute("cx", "0"), t.setAttribute("cy", "0"), t.setAttribute("r", `${r}`), t.setAttribute("fill", `${e}`), t;
3139
- }, Vt = (r) => r instanceof SVGElement ? r : Ct(
3139
+ }, $t = (r) => r instanceof SVGElement ? r : Vt(
3140
3140
  (r == null ? void 0 : r.radius) ?? 1.5,
3141
3141
  (r == null ? void 0 : r.color) ?? "#d8d8d8"
3142
- ), $t = (r) => {
3143
- const e = r.tileDimensions, t = (e == null ? void 0 : e.width) ?? 25, s = (e == null ? void 0 : e.height) ?? 25, i = Vt(r.renderer ?? {});
3142
+ ), It = (r) => {
3143
+ const e = r.tileDimensions, t = (e == null ? void 0 : e.width) ?? 25, s = (e == null ? void 0 : e.height) ?? 25, i = $t(r.renderer ?? {});
3144
3144
  return {
3145
3145
  tileWidth: t,
3146
3146
  tileHeight: s,
3147
3147
  renderer: i,
3148
3148
  maxViewportScale: r.maxViewportScale ?? 10
3149
3149
  };
3150
- }, It = (r, e, t) => {
3150
+ }, Ut = (r, e, t) => {
3151
3151
  var c, g, l;
3152
3152
  const s = () => "direct", i = (u) => u, n = (u) => u.button === 0, a = () => {
3153
3153
  }, h = () => {
@@ -3164,7 +3164,7 @@ const j = (r) => () => r, we = j(0), bt = () => {
3164
3164
  dragPortDirection: r.dragPortDirection ?? t,
3165
3165
  edgeShapeFactory: r.edgeShape !== void 0 ? ie(r.edgeShape) : e
3166
3166
  };
3167
- }, Ut = (r, e) => {
3167
+ }, Bt = (r, e) => {
3168
3168
  var c, g, l;
3169
3169
  const t = (u) => u, s = (u) => u.button === 0 && u.ctrlKey, i = (u) => u.button === 0, n = (u) => {
3170
3170
  const w = e.getPortAdjacentEdgeIds(u);
@@ -3183,10 +3183,10 @@ const j = (r) => () => r, we = j(0), bt = () => {
3183
3183
  onEdgeReattachInterrupted: ((g = r.events) == null ? void 0 : g.onEdgeReattachInterrupted) ?? d,
3184
3184
  onEdgeReattachPrevented: ((l = r.events) == null ? void 0 : l.onEdgeReattachPrevented) ?? h
3185
3185
  };
3186
- }, Bt = (r) => ({
3186
+ }, Ft = (r) => ({
3187
3187
  nodeVerticalRadius: r.nodeContainingRadius.vertical,
3188
3188
  nodeHorizontalRadius: r.nodeContainingRadius.horizontal
3189
- }), Ft = (r) => {
3189
+ }), Ot = (r) => {
3190
3190
  var e, t;
3191
3191
  return {
3192
3192
  onAfterNodeDetached: ((e = r == null ? void 0 : r.events) == null ? void 0 : e.onAfterNodeDetached) ?? (() => {
@@ -3195,13 +3195,13 @@ const j = (r) => () => r, we = j(0), bt = () => {
3195
3195
  })
3196
3196
  };
3197
3197
  };
3198
- class Ot extends Error {
3198
+ class Wt extends Error {
3199
3199
  constructor() {
3200
3200
  super(...arguments);
3201
3201
  o(this, "name", "CanvasBuilderError");
3202
3202
  }
3203
3203
  }
3204
- class Wt {
3204
+ class kt {
3205
3205
  constructor(e, t) {
3206
3206
  this.coordinates = e, this.rand = t;
3207
3207
  }
@@ -3215,7 +3215,7 @@ class Wt {
3215
3215
  return { ex: c, ey: g, d2: h, d };
3216
3216
  }
3217
3217
  }
3218
- class Ve {
3218
+ class $e {
3219
3219
  constructor(e, t, s) {
3220
3220
  o(this, "dtSec");
3221
3221
  o(this, "k");
@@ -3231,7 +3231,7 @@ class Ve {
3231
3231
  s.forEach((a) => {
3232
3232
  t.set(a, { x: 0, y: 0 });
3233
3233
  });
3234
- const i = new Wt(
3234
+ const i = new kt(
3235
3235
  this.currentCoords,
3236
3236
  this.params.rand
3237
3237
  ), n = s.length;
@@ -3241,13 +3241,13 @@ class Ve {
3241
3241
  const c = s[d], g = i.getVector(h, c);
3242
3242
  if (g.d > this.effectiveDistance)
3243
3243
  continue;
3244
- const l = this.k / g.d2, u = l * g.ex, w = l * g.ey, m = u / 2, v = w / 2, E = t.get(h), A = t.get(c);
3245
- E.x -= m, E.y -= v, A.x += m, A.y += v;
3244
+ const l = this.k / g.d2, u = l * g.ex, w = l * g.ey, y = u / 2, v = w / 2, E = t.get(h), A = t.get(c);
3245
+ E.x -= y, E.y -= v, A.x += y, A.y += v;
3246
3246
  }
3247
3247
  }
3248
3248
  return this.graph.getAllEdgeIds().forEach((a) => {
3249
- const h = this.graph.getEdge(a), d = this.graph.getPort(h.from), c = this.graph.getPort(h.to), g = i.getVector(d.nodeId, c.nodeId), u = (g.d - this.edgeEquilibriumLength) * this.edgeStiffness / 2, w = g.ex * u, m = g.ey * u, v = t.get(d.nodeId), E = t.get(c.nodeId);
3250
- v.x += w, v.y += m, E.x -= w, E.y -= m;
3249
+ const h = this.graph.getEdge(a), d = this.graph.getPort(h.from), c = this.graph.getPort(h.to), g = i.getVector(d.nodeId, c.nodeId), u = (g.d - this.edgeEquilibriumLength) * this.edgeStiffness / 2, w = g.ex * u, y = g.ey * u, v = t.get(d.nodeId), E = t.get(c.nodeId);
3250
+ v.x += w, v.y += y, E.x -= w, E.y -= y;
3251
3251
  }), this.currentCoords.forEach((a, h) => {
3252
3252
  const d = t.get(h), c = {
3253
3253
  x: d.x / this.nodeMass * this.dtSec,
@@ -3257,7 +3257,7 @@ class Ve {
3257
3257
  }), e;
3258
3258
  }
3259
3259
  }
3260
- const $e = (r, e, t) => {
3260
+ const Ie = (r, e, t) => {
3261
3261
  const s = /* @__PURE__ */ new Map(), i = r.getAllNodeIds(), n = Math.sqrt(i.length) * t;
3262
3262
  return i.forEach((a) => {
3263
3263
  const h = r.getNode(a);
@@ -3267,17 +3267,17 @@ const $e = (r, e, t) => {
3267
3267
  });
3268
3268
  }), s;
3269
3269
  };
3270
- class kt {
3270
+ class zt {
3271
3271
  constructor(e) {
3272
3272
  this.params = e;
3273
3273
  }
3274
3274
  calculateCoordinates(e) {
3275
- const t = $e(
3275
+ const t = Ie(
3276
3276
  e,
3277
3277
  this.params.rand,
3278
3278
  this.params.edgeEquilibriumLength
3279
3279
  );
3280
- for (let s = 0; s < this.params.maxIterations && !(new Ve(e, t, {
3280
+ for (let s = 0; s < this.params.maxIterations && !(new $e(e, t, {
3281
3281
  rand: this.params.rand,
3282
3282
  dtSec: this.params.dtSec,
3283
3283
  nodeMass: this.params.nodeMass,
@@ -3290,17 +3290,17 @@ class kt {
3290
3290
  return t;
3291
3291
  }
3292
3292
  }
3293
- class zt {
3293
+ class Xt {
3294
3294
  constructor(e) {
3295
3295
  this.params = e;
3296
3296
  }
3297
3297
  calculateNextCoordinates(e, t) {
3298
- const s = $e(
3298
+ const s = Ie(
3299
3299
  e,
3300
3300
  this.params.rand,
3301
3301
  this.params.edgeEquilibriumLength
3302
3302
  );
3303
- return new Ve(e, s, {
3303
+ return new $e(e, s, {
3304
3304
  rand: this.params.rand,
3305
3305
  dtSec: Math.min(t, this.params.maxTimeDeltaSec),
3306
3306
  nodeMass: this.params.nodeMass,
@@ -3314,16 +3314,16 @@ class zt {
3314
3314
  }) ? /* @__PURE__ */ new Map() : s;
3315
3315
  }
3316
3316
  }
3317
- const Ie = (r) => {
3317
+ const Ue = (r) => {
3318
3318
  let e = 1779033703, t = 3144134277, s = 1013904242, i = 2773480762;
3319
3319
  for (let n = 0, a; n < r.length; n++)
3320
3320
  a = r.charCodeAt(n), e = t ^ Math.imul(e ^ a, 597399067), t = s ^ Math.imul(t ^ a, 2869860233), s = i ^ Math.imul(s ^ a, 951274213), i = e ^ Math.imul(i ^ a, 2716044179);
3321
3321
  return e = Math.imul(s ^ e >>> 18, 597399067), t = Math.imul(i ^ t >>> 22, 2869860233), s = Math.imul(e ^ s >>> 17, 951274213), i = Math.imul(t ^ i >>> 19, 2716044179), e ^= t ^ s ^ i, t ^= e, s ^= e, i ^= e, [e >>> 0, t >>> 0, s >>> 0, i >>> 0];
3322
- }, Ue = (r, e, t, s) => function() {
3322
+ }, Be = (r, e, t, s) => function() {
3323
3323
  r |= 0, e |= 0, t |= 0, s |= 0;
3324
3324
  const i = (r + e | 0) + s | 0;
3325
3325
  return s = s + 1 | 0, r = e ^ e >>> 9, e = t + (t << 3) | 0, t = t << 21 | t >>> 11, t = t + i | 0, (i >>> 0) / 4294967296;
3326
- }, x = Object.freeze({
3326
+ }, S = Object.freeze({
3327
3327
  seed: "HTMLGraph is awesome",
3328
3328
  maxTimeDeltaSec: 0.1,
3329
3329
  nodeCharge: 1e5,
@@ -3334,67 +3334,66 @@ const Ie = (r) => {
3334
3334
  dtSec: 0.02,
3335
3335
  maxIterations: 100,
3336
3336
  convergenceDelta: 1e-3
3337
- }), Xt = (r) => {
3337
+ }), Yt = (r) => {
3338
3338
  var e;
3339
3339
  switch ((e = r == null ? void 0 : r.algorithm) == null ? void 0 : e.type) {
3340
3340
  case "custom":
3341
3341
  return r.algorithm.instance;
3342
3342
  default: {
3343
- const t = r == null ? void 0 : r.algorithm, s = Ie((t == null ? void 0 : t.seed) ?? x.seed), i = Ue(s[0], s[1], s[2], s[3]);
3344
- return new zt({
3343
+ const t = r == null ? void 0 : r.algorithm, s = Ue((t == null ? void 0 : t.seed) ?? S.seed), i = Be(s[0], s[1], s[2], s[3]);
3344
+ return new Xt({
3345
3345
  rand: i,
3346
- maxTimeDeltaSec: (t == null ? void 0 : t.maxTimeDeltaSec) ?? x.maxTimeDeltaSec,
3347
- nodeCharge: (t == null ? void 0 : t.nodeCharge) ?? x.nodeCharge,
3348
- nodeMass: (t == null ? void 0 : t.nodeMass) ?? x.nodeMass,
3349
- edgeEquilibriumLength: (t == null ? void 0 : t.edgeEquilibriumLength) ?? x.edgeEquilibriumLength,
3350
- effectiveDistance: x.effectiveDistance,
3351
- edgeStiffness: (t == null ? void 0 : t.edgeStiffness) ?? x.edgeStiffness,
3352
- convergenceDelta: (t == null ? void 0 : t.convergenceDelta) ?? x.convergenceDelta
3346
+ maxTimeDeltaSec: (t == null ? void 0 : t.maxTimeDeltaSec) ?? S.maxTimeDeltaSec,
3347
+ nodeCharge: (t == null ? void 0 : t.nodeCharge) ?? S.nodeCharge,
3348
+ nodeMass: (t == null ? void 0 : t.nodeMass) ?? S.nodeMass,
3349
+ edgeEquilibriumLength: (t == null ? void 0 : t.edgeEquilibriumLength) ?? S.edgeEquilibriumLength,
3350
+ effectiveDistance: S.effectiveDistance,
3351
+ edgeStiffness: (t == null ? void 0 : t.edgeStiffness) ?? S.edgeStiffness,
3352
+ convergenceDelta: (t == null ? void 0 : t.convergenceDelta) ?? S.convergenceDelta
3353
3353
  });
3354
3354
  }
3355
3355
  }
3356
- }, Yt = (r) => r instanceof G ? {
3356
+ }, Ht = (r) => r instanceof G ? {
3357
3357
  type: "manual",
3358
3358
  trigger: r
3359
3359
  } : {
3360
3360
  type: "topologyChangeTimeout"
3361
- }, Ht = (r) => {
3361
+ }, jt = (r) => {
3362
3362
  switch (r == null ? void 0 : r.type) {
3363
3363
  case "custom":
3364
3364
  return r.instance;
3365
3365
  default: {
3366
- const e = Ie((r == null ? void 0 : r.seed) ?? x.seed), t = Ue(e[0], e[1], e[2], e[3]);
3367
- return new kt({
3368
- dtSec: (r == null ? void 0 : r.dtSec) ?? x.dtSec,
3369
- maxIterations: (r == null ? void 0 : r.maxIterations) ?? x.maxIterations,
3366
+ const e = Ue((r == null ? void 0 : r.seed) ?? S.seed), t = Be(e[0], e[1], e[2], e[3]);
3367
+ return new zt({
3368
+ dtSec: (r == null ? void 0 : r.dtSec) ?? S.dtSec,
3369
+ maxIterations: (r == null ? void 0 : r.maxIterations) ?? S.maxIterations,
3370
3370
  rand: t,
3371
- maxTimeDeltaSec: (r == null ? void 0 : r.maxTimeDeltaSec) ?? x.maxTimeDeltaSec,
3372
- nodeCharge: (r == null ? void 0 : r.nodeCharge) ?? x.nodeCharge,
3373
- nodeMass: (r == null ? void 0 : r.nodeMass) ?? x.nodeMass,
3374
- edgeEquilibriumLength: (r == null ? void 0 : r.edgeEquilibriumLength) ?? x.edgeEquilibriumLength,
3375
- edgeStiffness: (r == null ? void 0 : r.edgeStiffness) ?? x.edgeStiffness,
3376
- effectiveDistance: (r == null ? void 0 : r.effectiveDistance) ?? x.effectiveDistance,
3377
- convergenceDelta: (r == null ? void 0 : r.convergenceDelta) ?? x.convergenceDelta
3371
+ nodeCharge: (r == null ? void 0 : r.nodeCharge) ?? S.nodeCharge,
3372
+ nodeMass: (r == null ? void 0 : r.nodeMass) ?? S.nodeMass,
3373
+ edgeEquilibriumLength: (r == null ? void 0 : r.edgeEquilibriumLength) ?? S.edgeEquilibriumLength,
3374
+ edgeStiffness: (r == null ? void 0 : r.edgeStiffness) ?? S.edgeStiffness,
3375
+ effectiveDistance: (r == null ? void 0 : r.effectiveDistance) ?? S.effectiveDistance,
3376
+ convergenceDelta: (r == null ? void 0 : r.convergenceDelta) ?? S.convergenceDelta
3378
3377
  });
3379
3378
  }
3380
3379
  }
3381
- }, jt = (r) => ({
3382
- algorithm: Ht(r == null ? void 0 : r.algorithm),
3383
- applyOn: Yt(r == null ? void 0 : r.applyOn)
3384
- }), Gt = (r, e) => ({
3380
+ }, Gt = (r) => ({
3381
+ algorithm: jt(r == null ? void 0 : r.algorithm),
3382
+ applyOn: Ht(r == null ? void 0 : r.applyOn)
3383
+ }), Kt = (r, e) => ({
3385
3384
  ...r,
3386
3385
  nodeDragVerifier: (t) => (e.add(t), r.nodeDragVerifier(t)),
3387
3386
  onNodeDragFinished: (t) => {
3388
3387
  e.delete(t), r.onNodeDragFinished(t);
3389
3388
  }
3390
- }), Kt = (r, e) => {
3389
+ }), Zt = (r, e) => {
3391
3390
  r.onBeforeNodeRemoved.subscribe((t) => {
3392
3391
  e.delete(t);
3393
3392
  }), r.onBeforeClear.subscribe(() => {
3394
3393
  e.clear();
3395
3394
  });
3396
3395
  };
3397
- class Qt {
3396
+ class qt {
3398
3397
  constructor(e) {
3399
3398
  o(this, "used", !1);
3400
3399
  o(this, "canvasDefaults", {});
@@ -3416,9 +3415,9 @@ class Qt {
3416
3415
  o(this, "hasLayout", !1);
3417
3416
  o(this, "boxRenderingTrigger", new G());
3418
3417
  o(this, "graphStore", new Ee());
3419
- o(this, "viewportStore", new je());
3420
- o(this, "graph", new Le(this.graphStore));
3421
- o(this, "viewport", new Re(this.viewportStore));
3418
+ o(this, "viewportStore", new Ge());
3419
+ o(this, "graph", new Re(this.graphStore));
3420
+ o(this, "viewport", new Ce(this.viewportStore));
3422
3421
  o(this, "window", window);
3423
3422
  o(this, "animationStaticNodes", /* @__PURE__ */ new Set());
3424
3423
  this.element = e;
@@ -3489,21 +3488,21 @@ class Qt {
3489
3488
  */
3490
3489
  build() {
3491
3490
  if (this.used)
3492
- throw new Ot("CanvasBuilder is a single use object");
3491
+ throw new Wt("CanvasBuilder is a single use object");
3493
3492
  this.used = !0;
3494
- const e = new Pt(this.element);
3495
- let t = new ye(
3493
+ const e = new bt(this.element);
3494
+ let t = new me(
3496
3495
  this.graphStore,
3497
3496
  this.viewportStore,
3498
3497
  e.main
3499
3498
  );
3500
- this.virtualScrollConfig !== void 0 && (t = new Xe(
3499
+ this.virtualScrollConfig !== void 0 && (t = new Ye(
3501
3500
  t,
3502
3501
  this.graphStore,
3503
3502
  this.boxRenderingTrigger,
3504
- Ft(this.virtualScrollConfig)
3505
- )), t = new Ye(t, this.graphStore);
3506
- const s = Dt(this.canvasDefaults), i = new ve(
3503
+ Ot(this.virtualScrollConfig)
3504
+ )), t = new He(t, this.graphStore);
3505
+ const s = Nt(this.canvasDefaults), i = new ve(
3507
3506
  this.graph,
3508
3507
  this.viewport,
3509
3508
  this.graphStore,
@@ -3513,11 +3512,11 @@ class Qt {
3513
3512
  );
3514
3513
  if (this.hasBackground && _.configure(
3515
3514
  i,
3516
- $t(this.backgroundConfig),
3515
+ It(this.backgroundConfig),
3517
3516
  e.background
3518
3517
  ), this.hasNodeResizeReactiveEdges && K.configure(i), this.hasDraggableNodes) {
3519
- let a = Nt(this.dragConfig);
3520
- this.hasAnimatedLayout && (a = Gt(
3518
+ let a = Mt(this.dragConfig);
3519
+ this.hasAnimatedLayout && (a = Kt(
3521
3520
  a,
3522
3521
  this.animationStaticNodes
3523
3522
  )), Q.configure(
@@ -3528,7 +3527,7 @@ class Qt {
3528
3527
  );
3529
3528
  }
3530
3529
  if (this.hasUserConnectablePorts) {
3531
- const a = It(
3530
+ const a = Ut(
3532
3531
  this.connectablePortsConfig,
3533
3532
  s.edges.shapeFactory,
3534
3533
  s.ports.direction
@@ -3542,7 +3541,7 @@ class Qt {
3542
3541
  );
3543
3542
  }
3544
3543
  if (this.hasUserDraggableEdges) {
3545
- const a = Ut(
3544
+ const a = Bt(
3546
3545
  this.draggableEdgesConfig,
3547
3546
  i.graph
3548
3547
  );
@@ -3558,23 +3557,23 @@ class Qt {
3558
3557
  i,
3559
3558
  e.main,
3560
3559
  this.window,
3561
- me(this.transformConfig),
3560
+ ye(this.transformConfig),
3562
3561
  this.boxRenderingTrigger,
3563
- Bt(this.virtualScrollConfig)
3562
+ Ft(this.virtualScrollConfig)
3564
3563
  ) : this.hasTransformableViewport && X.configure(
3565
3564
  i,
3566
3565
  e.main,
3567
3566
  this.window,
3568
- me(this.transformConfig)
3569
- ), this.hasLayout && At.configure(
3567
+ ye(this.transformConfig)
3568
+ ), this.hasLayout && xt.configure(
3570
3569
  i,
3571
- jt(this.layoutConfig)
3572
- ), this.hasAnimatedLayout && (Kt(
3570
+ Gt(this.layoutConfig)
3571
+ ), this.hasAnimatedLayout && (Zt(
3573
3572
  i.graph,
3574
3573
  this.animationStaticNodes
3575
3574
  ), oe.configure(
3576
3575
  i,
3577
- Xt(this.animatedLayoutConfig),
3576
+ Yt(this.animatedLayoutConfig),
3578
3577
  this.animationStaticNodes,
3579
3578
  this.window
3580
3579
  ));
@@ -3585,16 +3584,16 @@ class Qt {
3585
3584
  }
3586
3585
  }
3587
3586
  export {
3588
- dt as BezierEdgeShape,
3589
- Qt as CanvasBuilder,
3590
- Ot as CanvasBuilderError,
3587
+ ct as BezierEdgeShape,
3588
+ qt as CanvasBuilder,
3589
+ Wt as CanvasBuilderError,
3591
3590
  P as CanvasError,
3592
- Ne as DirectEdgeShape,
3591
+ Me as DirectEdgeShape,
3593
3592
  G as EventSubject,
3594
- ct as HorizontalEdgeShape,
3595
- wt as InteractiveEdgeError,
3596
- Me as InteractiveEdgeShape,
3597
- Jt as MidpointEdgeShape,
3598
- lt as StraightEdgeShape,
3599
- gt as VerticalEdgeShape
3593
+ lt as HorizontalEdgeShape,
3594
+ ft as InteractiveEdgeError,
3595
+ Le as InteractiveEdgeShape,
3596
+ Qt as MidpointEdgeShape,
3597
+ gt as StraightEdgeShape,
3598
+ ut as VerticalEdgeShape
3600
3599
  };