@html-graph/html-graph 8.20.0 → 8.21.1

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,22 +1,22 @@
1
- var ht = Object.defineProperty;
2
- var dt = (r, e, t) => e in r ? ht(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
- var i = (r, e, t) => dt(r, typeof e != "symbol" ? e + "" : e, t);
1
+ var ct = Object.defineProperty;
2
+ var lt = (r, e, t) => e in r ? ct(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
3
+ var i = (r, e, t) => lt(r, typeof e != "symbol" ? e + "" : e, t);
4
4
  var U = /* @__PURE__ */ ((r) => (r.Line = "line", r.NodeCycle = "node-cycle", r.PortCycle = "port-cycle", r))(U || {});
5
- const ct = () => {
5
+ const ut = () => {
6
6
  const r = document.createElement("div");
7
7
  return r.style.width = "100%", r.style.height = "100%", r.style.position = "relative", r.style.overflow = "hidden", r;
8
- }, lt = () => {
8
+ }, gt = () => {
9
9
  const r = document.createElement("div");
10
10
  return r.style.position = "absolute", r.style.top = "0", r.style.left = "0", r.style.width = "0", r.style.height = "0", r;
11
- }, ut = (r) => {
11
+ }, pt = (r) => {
12
12
  r.style.position = "absolute", r.style.top = "0", r.style.left = "0", r.style.visibility = "hidden";
13
- }, gt = (r) => {
13
+ }, wt = (r) => {
14
14
  r.style.removeProperty("position"), r.style.removeProperty("top"), r.style.removeProperty("left"), r.style.removeProperty("visibility"), r.style.removeProperty("transform");
15
15
  };
16
- class Fe {
16
+ class $e {
17
17
  constructor(e, t, o) {
18
- i(this, "host", ct());
19
- i(this, "container", lt());
18
+ i(this, "host", ut());
19
+ i(this, "container", gt());
20
20
  i(this, "edgeIdToElementMap", /* @__PURE__ */ new Map());
21
21
  i(this, "attachedNodeIds", /* @__PURE__ */ new Set());
22
22
  i(this, "applyTransform", () => {
@@ -27,11 +27,11 @@ class Fe {
27
27
  }
28
28
  attachNode(e) {
29
29
  const t = this.graphStore.getNode(e);
30
- ut(t.element), this.attachedNodeIds.add(e), this.container.appendChild(t.element), this.updateNodePosition(e), this.updateNodePriority(e), t.element.style.visibility = "visible";
30
+ pt(t.element), this.attachedNodeIds.add(e), this.container.appendChild(t.element), this.updateNodePosition(e), this.updateNodePriority(e), t.element.style.visibility = "visible";
31
31
  }
32
32
  detachNode(e) {
33
33
  const t = this.graphStore.getNode(e);
34
- gt(t.element), this.container.removeChild(t.element), this.attachedNodeIds.delete(e);
34
+ wt(t.element), this.container.removeChild(t.element), this.attachedNodeIds.delete(e);
35
35
  }
36
36
  attachEdge(e) {
37
37
  const t = this.graphStore.getEdge(e).payload.shape.svg;
@@ -93,7 +93,7 @@ class Fe {
93
93
  };
94
94
  }
95
95
  }
96
- class pt {
96
+ class yt {
97
97
  constructor(e) {
98
98
  i(this, "xFrom", 1 / 0);
99
99
  i(this, "yFrom", 1 / 0);
@@ -113,7 +113,7 @@ class pt {
113
113
  return h <= this.xTo && d >= this.xFrom && c <= this.yTo && u >= this.yFrom;
114
114
  }
115
115
  }
116
- class wt {
116
+ class ft {
117
117
  constructor(e, t, o, s) {
118
118
  i(this, "attachedNodes", /* @__PURE__ */ new Set());
119
119
  i(this, "attachedEdges", /* @__PURE__ */ new Set());
@@ -137,7 +137,7 @@ class wt {
137
137
  this.handleAttachEdge(a);
138
138
  });
139
139
  });
140
- this.htmlView = e, this.graphStore = t, this.trigger = o, this.params = s, this.renderingBox = new pt(this.graphStore), this.trigger.subscribe(this.updateViewport);
140
+ this.htmlView = e, this.graphStore = t, this.trigger = o, this.params = s, this.renderingBox = new yt(this.graphStore), this.trigger.subscribe(this.updateViewport);
141
141
  }
142
142
  attachNode(e) {
143
143
  this.renderingBox.hasNode(e) && this.handleAttachNode(e);
@@ -191,7 +191,7 @@ class wt {
191
191
  this.htmlView.detachEdge(e), this.attachedEdges.delete(e);
192
192
  }
193
193
  }
194
- class yt {
194
+ class vt {
195
195
  constructor(e, t) {
196
196
  i(this, "deferredNodes", /* @__PURE__ */ new Set());
197
197
  i(this, "deferredEdges", /* @__PURE__ */ new Set());
@@ -245,7 +245,7 @@ class yt {
245
245
  this.isEdgeValid(e) && (this.deferredEdges.delete(e), this.htmlView.attachEdge(e));
246
246
  }
247
247
  }
248
- class q {
248
+ class te {
249
249
  constructor() {
250
250
  i(this, "callbacks", /* @__PURE__ */ new Set());
251
251
  }
@@ -262,10 +262,10 @@ class q {
262
262
  }
263
263
  }
264
264
  const C = () => {
265
- const r = new q();
265
+ const r = new te();
266
266
  return [r, r];
267
267
  };
268
- class Ue {
268
+ class Be {
269
269
  constructor(e, t, o, s) {
270
270
  i(this, "beforeDestroyEmitter");
271
271
  i(this, "destroyed", !1);
@@ -318,7 +318,7 @@ class Ue {
318
318
  this.destroyed || (this.destroyed = !0, this.beforeDestroyEmitter.emit(), this.graphController.destroy(), this.viewportController.destroy());
319
319
  }
320
320
  }
321
- class ft {
321
+ class mt {
322
322
  constructor() {
323
323
  i(this, "singleToMultiMap", /* @__PURE__ */ new Map());
324
324
  i(this, "multiToSingleMap", /* @__PURE__ */ new Map());
@@ -387,7 +387,7 @@ const b = Object.freeze({
387
387
  removeNonexistentEdge: (r) => `Failed to remove edge with ID ${JSON.stringify(r)} because it does not exist`,
388
388
  accessEdgesForNonexistentPort: (r) => `Failed to access edges for port with ID ${JSON.stringify(r)} because the port does not exist`
389
389
  });
390
- class $e {
390
+ class Oe {
391
391
  constructor() {
392
392
  i(this, "nodes", /* @__PURE__ */ new Map());
393
393
  i(this, "ports", /* @__PURE__ */ new Map());
@@ -396,7 +396,7 @@ class $e {
396
396
  i(this, "portIncomingEdges", /* @__PURE__ */ new Map());
397
397
  i(this, "portOutgoingEdges", /* @__PURE__ */ new Map());
398
398
  i(this, "portCycleEdges", /* @__PURE__ */ new Map());
399
- i(this, "elementPorts", new ft());
399
+ i(this, "elementPorts", new mt());
400
400
  i(this, "edgesElementsMap", /* @__PURE__ */ new Map());
401
401
  i(this, "afterNodeAddedEmitter");
402
402
  i(this, "onAfterNodeAdded");
@@ -682,22 +682,22 @@ class $e {
682
682
  this.portCycleEdges.get(t).delete(e), this.portCycleEdges.get(o).delete(e), this.portIncomingEdges.get(t).delete(e), this.portIncomingEdges.get(o).delete(e), this.portOutgoingEdges.get(t).delete(e), this.portOutgoingEdges.get(o).delete(e), this.edges.delete(e), this.edgesElementsMap.delete(s.shape.svg);
683
683
  }
684
684
  }
685
- const me = (r) => ({
685
+ const Ee = (r) => ({
686
686
  scale: 1 / r.scale,
687
687
  x: -r.x / r.scale,
688
688
  y: -r.y / r.scale
689
- }), xe = {
689
+ }), Ae = {
690
690
  scale: 1,
691
691
  x: 0,
692
692
  y: 0
693
- }, Ee = (r, e) => ({
693
+ }, Se = (r, e) => ({
694
694
  x: r.scale * e.x + r.x,
695
695
  y: r.scale * e.y + r.y
696
696
  });
697
- class vt {
697
+ class xt {
698
698
  constructor(e) {
699
- i(this, "viewportMatrix", xe);
700
- i(this, "contentMatrix", xe);
699
+ i(this, "viewportMatrix", Ae);
700
+ i(this, "contentMatrix", Ae);
701
701
  i(this, "beforeUpdateEmitter");
702
702
  i(this, "onBeforeUpdated");
703
703
  i(this, "afterUpdateEmitter");
@@ -720,30 +720,30 @@ class vt {
720
720
  scale: e.scale ?? this.viewportMatrix.scale,
721
721
  x: e.x ?? this.viewportMatrix.x,
722
722
  y: e.y ?? this.viewportMatrix.y
723
- }, this.beforeUpdateEmitter.emit(), this.contentMatrix = me(this.viewportMatrix), this.afterUpdateEmitter.emit();
723
+ }, this.beforeUpdateEmitter.emit(), this.contentMatrix = Ee(this.viewportMatrix), this.afterUpdateEmitter.emit();
724
724
  }
725
725
  patchContentMatrix(e) {
726
726
  this.contentMatrix = {
727
727
  scale: e.scale ?? this.contentMatrix.scale,
728
728
  x: e.x ?? this.contentMatrix.x,
729
729
  y: e.y ?? this.contentMatrix.y
730
- }, this.beforeUpdateEmitter.emit(), this.viewportMatrix = me(this.contentMatrix), this.afterUpdateEmitter.emit();
730
+ }, this.beforeUpdateEmitter.emit(), this.viewportMatrix = Ee(this.contentMatrix), this.afterUpdateEmitter.emit();
731
731
  }
732
732
  getDimensions() {
733
733
  const { width: e, height: t } = this.host.getBoundingClientRect();
734
734
  return { width: e, height: t };
735
735
  }
736
736
  createContentCoords(e) {
737
- return Ee(this.viewportMatrix, e);
737
+ return Se(this.viewportMatrix, e);
738
738
  }
739
739
  createViewportCoords(e) {
740
- return Ee(this.contentMatrix, e);
740
+ return Se(this.contentMatrix, e);
741
741
  }
742
742
  destroy() {
743
743
  this.observer.disconnect();
744
744
  }
745
745
  }
746
- class ee {
746
+ class re {
747
747
  constructor(e) {
748
748
  i(this, "elementToNodeId", /* @__PURE__ */ new Map());
749
749
  i(this, "nodesResizeObserver");
@@ -769,28 +769,28 @@ class ee {
769
769
  }), this.canvas.graph.onAfterNodeAdded.subscribe(this.onAfterNodeAdded), this.canvas.graph.onBeforeNodeRemoved.subscribe(this.onBeforeNodeRemoved), this.canvas.graph.onBeforeClear.subscribe(this.reset), this.canvas.onBeforeDestroy.subscribe(this.revert);
770
770
  }
771
771
  static configure(e) {
772
- new ee(e);
772
+ new re(e);
773
773
  }
774
774
  handleNodeResize(e) {
775
775
  const t = this.elementToNodeId.get(e);
776
776
  this.canvas.updateNode(t);
777
777
  }
778
778
  }
779
- const mt = (r, e, t) => {
779
+ const Et = (r, e, t) => {
780
780
  const { x: o, y: s, width: n, height: a } = r.getBoundingClientRect();
781
781
  return e >= o && e <= o + n && t >= s && t <= s + a;
782
- }, xt = (r, e, t) => e >= 0 && e <= r.innerWidth && t >= 0 && t <= r.innerHeight;
783
- class Et {
782
+ }, At = (r, e, t) => e >= 0 && e <= r.innerWidth && t >= 0 && t <= r.innerHeight;
783
+ class St {
784
784
  constructor(e, t) {
785
785
  this.element = e, this.win = t;
786
786
  }
787
787
  verify(e, t) {
788
- return mt(this.element, e, t) && xt(this.win, e, t);
788
+ return Et(this.element, e, t) && At(this.win, e, t);
789
789
  }
790
790
  }
791
- const H = (r, e) => {
791
+ const X = (r, e) => {
792
792
  e !== null ? r.style.cursor = e : r.style.removeProperty("cursor");
793
- }, Y = (r) => {
793
+ }, G = (r) => {
794
794
  const e = document.createElement("div");
795
795
  return {
796
796
  id: r.overlayNodeId,
@@ -805,7 +805,7 @@ const H = (r, e) => {
805
805
  }
806
806
  ]
807
807
  };
808
- }, At = (r, e) => {
808
+ }, bt = (r, e) => {
809
809
  let t = e;
810
810
  for (; t !== null; ) {
811
811
  const o = r.findPortIdsByElement(t)[0] ?? null;
@@ -824,21 +824,21 @@ const H = (r, e) => {
824
824
  status: "notFound"
825
825
  };
826
826
  };
827
- function* Be(r, e) {
827
+ function* We(r, e) {
828
828
  const t = r.elementsFromPoint(e.x, e.y);
829
829
  for (const o of t) {
830
830
  if (o.shadowRoot !== null) {
831
- const s = Be(o.shadowRoot, e);
831
+ const s = We(o.shadowRoot, e);
832
832
  for (const n of s)
833
833
  yield n;
834
834
  }
835
835
  yield o;
836
836
  }
837
837
  }
838
- const Oe = (r, e) => {
839
- const t = Be(document, e);
838
+ const ze = (r, e) => {
839
+ const t = We(document, e);
840
840
  for (const o of t) {
841
- const s = At(r, o);
841
+ const s = bt(r, o);
842
842
  if (s.status === "portFound")
843
843
  return s.portId;
844
844
  if (s.status === "nodeEncountered")
@@ -847,13 +847,13 @@ const Oe = (r, e) => {
847
847
  return null;
848
848
  };
849
849
  var R = /* @__PURE__ */ ((r) => (r.StaticNodeId = "static", r.DraggingNodeId = "dragging", r.EdgeId = "edge", r))(R || {});
850
- const We = (r, e) => ({
850
+ const ke = (r, e) => ({
851
851
  x: r / 2,
852
852
  y: e / 2
853
853
  }), x = (r, e, t) => ({
854
854
  x: e.x * r.x - e.y * r.y + ((1 - e.x) * t.x + e.y * t.y),
855
855
  y: e.y * r.x + e.x * r.y + ((1 - e.x) * t.y - e.y * t.x)
856
- }), ze = (r, e, t) => {
856
+ }), He = (r, e, t) => {
857
857
  const o = {
858
858
  x: r.x + r.width / 2,
859
859
  y: r.y + r.height / 2
@@ -869,8 +869,8 @@ const We = (r, e) => ({
869
869
  from: { x: o.x - n, y: o.y - a },
870
870
  to: { x: s.x - n, y: s.y - a }
871
871
  };
872
- };
873
- class St {
872
+ }, B = 0.5 * 0.5 * 0.5, z = 3 * B;
873
+ class Pt {
874
874
  constructor(e) {
875
875
  i(this, "path");
876
876
  i(this, "midpoint");
@@ -883,27 +883,27 @@ class St {
883
883
  curvature: h,
884
884
  hasSourceArrow: d,
885
885
  hasTargetArrow: c
886
- } = e, u = (t.x + o.x) / 2, l = (t.y + o.y) / 2;
887
- this.midpoint = { x: u, y: l };
888
- const g = x(
886
+ } = e, u = x(
889
887
  { x: t.x + s, y: t.y },
890
888
  n,
891
889
  t
892
- ), p = x(
890
+ ), l = x(
893
891
  { x: o.x - s, y: o.y },
894
892
  a,
895
893
  o
896
- ), w = {
897
- x: g.x + n.x * h,
898
- y: g.y + n.y * h
899
- }, y = {
900
- x: p.x - a.x * h,
901
- y: p.y - a.y * h
902
- }, f = `M ${g.x} ${g.y} C ${w.x} ${w.y}, ${y.x} ${y.y}, ${p.x} ${p.y}`, m = d ? "" : `M ${t.x} ${t.y} L ${g.x} ${g.y} `, E = c ? "" : ` M ${p.x} ${p.y} L ${o.x} ${o.y}`;
894
+ ), g = {
895
+ x: u.x + n.x * h,
896
+ y: u.y + n.y * h
897
+ }, p = {
898
+ x: l.x - a.x * h,
899
+ y: l.y - a.y * h
900
+ }, w = B * u.x + z * g.x + z * p.x + B * l.x, y = B * u.y + z * g.y + z * p.y + B * l.y;
901
+ this.midpoint = { x: w, y };
902
+ const f = `M ${u.x} ${u.y} C ${g.x} ${g.y}, ${p.x} ${p.y}, ${l.x} ${l.y}`, m = d ? "" : `M ${t.x} ${t.y} L ${u.x} ${u.y} `, E = c ? "" : ` M ${l.x} ${l.y} L ${o.x} ${o.y}`;
903
903
  this.path = `${m}${f}${E}`;
904
904
  }
905
905
  }
906
- class bt {
906
+ class Nt {
907
907
  constructor(e) {
908
908
  i(this, "path");
909
909
  i(this, "midpoint");
@@ -968,18 +968,18 @@ class bt {
968
968
  ].join(" "), this.midpoint = T;
969
969
  }
970
970
  }
971
- const te = Object.freeze({
971
+ const oe = Object.freeze({
972
972
  edgeColor: "--edge-color"
973
- }), ke = (r) => {
973
+ }), Ye = (r) => {
974
974
  const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
975
- return e.style.pointerEvents = "none", e.style.position = "absolute", e.style.top = "0", e.style.left = "0", e.style.overflow = "visible", e.style.setProperty(te.edgeColor, r), e;
976
- }, He = (r) => {
975
+ return e.style.pointerEvents = "none", e.style.position = "absolute", e.style.top = "0", e.style.left = "0", e.style.overflow = "visible", e.style.setProperty(oe.edgeColor, r), e;
976
+ }, Xe = (r) => {
977
977
  const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
978
- return e.setAttribute("stroke", `var(${te.edgeColor})`), e.setAttribute("stroke-width", `${r}`), e.setAttribute("fill", "none"), e;
979
- }, X = () => {
978
+ return e.setAttribute("stroke", `var(${oe.edgeColor})`), e.setAttribute("stroke-width", `${r}`), e.setAttribute("fill", "none"), e;
979
+ }, j = () => {
980
980
  const r = document.createElementNS("http://www.w3.org/2000/svg", "path");
981
- return r.setAttribute("fill", `var(${te.edgeColor})`), r;
982
- }, Ye = (r, e) => {
981
+ return r.setAttribute("fill", `var(${oe.edgeColor})`), r;
982
+ }, Ge = (r, e) => {
983
983
  r.style.transform = `translate(${e.x}px, ${e.y}px)`, r.style.width = `${e.width}px`, r.style.height = `${e.height}px`;
984
984
  }, F = (r, e) => {
985
985
  const t = [];
@@ -1000,7 +1000,7 @@ const te = Object.freeze({
1000
1000
  });
1001
1001
  }
1002
1002
  return t.join(" ");
1003
- }, Pt = (r, e) => {
1003
+ }, Ct = (r, e) => {
1004
1004
  const t = r.linePoint, o = e.linePoint, s = o.x - t.x >= 0, n = r.dirX >= 0, a = e.dirX >= 0;
1005
1005
  if (n === a) {
1006
1006
  const l = n === s, g = (t.x + o.x) / 2, p = (t.y + o.y) / 2, w = { x: g, y: p };
@@ -1038,7 +1038,7 @@ const te = Object.freeze({
1038
1038
  midpoint: { x: u.x, y: c }
1039
1039
  };
1040
1040
  };
1041
- class Nt {
1041
+ class Tt {
1042
1042
  constructor(e) {
1043
1043
  i(this, "path");
1044
1044
  i(this, "midpoint");
@@ -1060,14 +1060,14 @@ class Nt {
1060
1060
  { x: t.x + p, y: t.y },
1061
1061
  s,
1062
1062
  t
1063
- ), y = x({ x: o.x - p, y: o.y }, n, o), f = Pt(
1063
+ ), y = x({ x: o.x - p, y: o.y }, n, o), f = Ct(
1064
1064
  { arrowPoint: l, linePoint: w, dirX: s.x },
1065
1065
  { arrowPoint: g, linePoint: y, dirX: n.x }
1066
1066
  );
1067
1067
  this.path = F(f.points, d), this.midpoint = f.midpoint;
1068
1068
  }
1069
1069
  }
1070
- class Ct {
1070
+ class Mt {
1071
1071
  constructor(e) {
1072
1072
  i(this, "path");
1073
1073
  i(this, "midpoint");
@@ -1118,7 +1118,7 @@ class Ct {
1118
1118
  );
1119
1119
  }
1120
1120
  }
1121
- class Tt {
1121
+ class Dt {
1122
1122
  constructor(e) {
1123
1123
  i(this, "path");
1124
1124
  i(this, "midpoint");
@@ -1160,7 +1160,7 @@ class Tt {
1160
1160
  return x(n, t, o);
1161
1161
  }
1162
1162
  }
1163
- const Mt = (r, e) => {
1163
+ const Rt = (r, e) => {
1164
1164
  const t = r.linePoint, o = e.linePoint, s = o.y - t.y >= 0, n = r.dirY >= 0, a = e.dirY >= 0;
1165
1165
  if (n === a) {
1166
1166
  const l = n === s, g = (t.x + o.x) / 2, p = (t.y + o.y) / 2, w = { x: g, y: p };
@@ -1198,7 +1198,7 @@ const Mt = (r, e) => {
1198
1198
  midpoint: { x: c, y: u.y }
1199
1199
  };
1200
1200
  };
1201
- class Dt {
1201
+ class Lt {
1202
1202
  constructor(e) {
1203
1203
  i(this, "path");
1204
1204
  i(this, "midpoint");
@@ -1220,14 +1220,14 @@ class Dt {
1220
1220
  { x: t.x + p, y: t.y },
1221
1221
  d,
1222
1222
  t
1223
- ), y = x({ x: o.x - p, y: o.y }, c, o), f = Mt(
1223
+ ), y = x({ x: o.x - p, y: o.y }, c, o), f = Rt(
1224
1224
  { arrowPoint: l, linePoint: w, dirY: d.y },
1225
1225
  { arrowPoint: g, linePoint: y, dirY: c.y }
1226
1226
  );
1227
1227
  this.path = F(f.points, u), this.midpoint = f.midpoint;
1228
1228
  }
1229
1229
  }
1230
- class re {
1230
+ class se {
1231
1231
  constructor(e) {
1232
1232
  i(this, "path");
1233
1233
  i(this, "midpoint");
@@ -1244,7 +1244,7 @@ class re {
1244
1244
  this.path = `${h ? "" : g}${F(l, e.roundness)}`, this.midpoint = { x: (l[3].x + l[4].x) / 2, y: (l[3].y + l[4].y) / 2 };
1245
1245
  }
1246
1246
  }
1247
- class Rt {
1247
+ class Vt {
1248
1248
  constructor(e) {
1249
1249
  i(this, "path");
1250
1250
  i(this, "midpoint");
@@ -1262,11 +1262,11 @@ class Rt {
1262
1262
  this.path = `${h ? "" : m}${f}`, this.midpoint = y[3];
1263
1263
  }
1264
1264
  }
1265
- const Lt = (r, e, t) => {
1265
+ const It = (r, e, t) => {
1266
1266
  const o = Math.max(r.y, e.y), s = Math.min(r.y, e.y);
1267
1267
  return (t >= 0 ? o : s) + t;
1268
1268
  };
1269
- class Vt {
1269
+ class Ft {
1270
1270
  constructor(e) {
1271
1271
  i(this, "path");
1272
1272
  i(this, "midpoint");
@@ -1300,7 +1300,7 @@ class Vt {
1300
1300
  { x: a.x - w, y: a.y },
1301
1301
  d,
1302
1302
  a
1303
- ), m = Lt(y, f, l);
1303
+ ), m = It(y, f, l);
1304
1304
  this.midpoint = {
1305
1305
  x: (y.x + f.x) / 2,
1306
1306
  y: m
@@ -1317,11 +1317,11 @@ class Vt {
1317
1317
  );
1318
1318
  }
1319
1319
  }
1320
- const It = (r, e, t) => {
1320
+ const Ut = (r, e, t) => {
1321
1321
  const o = Math.max(r.x, e.x), s = Math.min(r.x, e.x);
1322
1322
  return (t >= 0 ? o : s) + t;
1323
1323
  };
1324
- class Ft {
1324
+ class $t {
1325
1325
  constructor(e) {
1326
1326
  i(this, "path");
1327
1327
  i(this, "midpoint");
@@ -1355,7 +1355,7 @@ class Ft {
1355
1355
  { x: d.x - w, y: d.y },
1356
1356
  a,
1357
1357
  d
1358
- ), m = It(y, f, u);
1358
+ ), m = Ut(y, f, u);
1359
1359
  this.midpoint = {
1360
1360
  x: m,
1361
1361
  y: (y.y + f.y) / 2
@@ -1394,8 +1394,8 @@ const v = Object.freeze({
1394
1394
  curvature: 90,
1395
1395
  interactiveWidth: 10,
1396
1396
  portOffset: 0
1397
- }), Ae = (r) => ({ x: Math.cos(r), y: Math.sin(r) });
1398
- class G {
1397
+ }), be = (r) => ({ x: Math.cos(r), y: Math.sin(r) });
1398
+ class J {
1399
1399
  constructor(e) {
1400
1400
  i(this, "svg");
1401
1401
  i(this, "group", document.createElementNS(
@@ -1408,16 +1408,16 @@ class G {
1408
1408
  i(this, "onAfterRender");
1409
1409
  i(this, "afterRenderEmitter");
1410
1410
  i(this, "arrowRenderer");
1411
- this.params = e, [this.afterRenderEmitter, this.onAfterRender] = C(), this.arrowRenderer = this.params.arrowRenderer, this.svg = ke(e.color), this.svg.appendChild(this.group), this.line = He(e.width), this.group.appendChild(this.line), e.hasSourceArrow && (this.sourceArrow = X(), this.group.appendChild(this.sourceArrow)), e.hasTargetArrow && (this.targetArrow = X(), this.group.appendChild(this.targetArrow));
1411
+ this.params = e, [this.afterRenderEmitter, this.onAfterRender] = C(), this.arrowRenderer = this.params.arrowRenderer, this.svg = Ye(e.color), this.svg.appendChild(this.group), this.line = Xe(e.width), this.group.appendChild(this.line), e.hasSourceArrow && (this.sourceArrow = j(), this.group.appendChild(this.sourceArrow)), e.hasTargetArrow && (this.targetArrow = j(), this.group.appendChild(this.targetArrow));
1412
1412
  }
1413
1413
  render(e) {
1414
- const { x: t, y: o, width: s, height: n, from: a, to: h } = ze(
1414
+ const { x: t, y: o, width: s, height: n, from: a, to: h } = He(
1415
1415
  e.from,
1416
1416
  e.to,
1417
1417
  this.params.padding
1418
1418
  );
1419
- Ye(this.svg, { x: t, y: o, width: s, height: n });
1420
- const d = Ae(e.from.direction), c = Ae(e.to.direction);
1419
+ Ge(this.svg, { x: t, y: o, width: s, height: n });
1420
+ const d = be(e.from.direction), c = be(e.to.direction);
1421
1421
  let u = { x: -c.x, y: -c.y }, l;
1422
1422
  e.category === U.PortCycle ? (l = this.params.createCyclePath, u = d) : e.category === U.NodeCycle ? l = this.params.createDetourPath : l = this.params.createLinePath;
1423
1423
  const g = l(a, h, d, c);
@@ -1440,7 +1440,7 @@ class G {
1440
1440
  });
1441
1441
  }
1442
1442
  }
1443
- const Ut = (r) => (e) => {
1443
+ const Bt = (r) => (e) => {
1444
1444
  const o = [
1445
1445
  { x: 0, y: 0 },
1446
1446
  { x: e.arrowLength, y: r.radius },
@@ -1452,7 +1452,7 @@ const Ut = (r) => (e) => {
1452
1452
  y: h.y + e.shift.y
1453
1453
  })), s = `M ${o[0].x} ${o[0].y}`, n = `L ${o[1].x} ${o[1].y}`, a = `L ${o[2].x} ${o[2].y}`;
1454
1454
  return `${s} ${n} ${a} Z`;
1455
- }, $t = (r) => (e) => {
1455
+ }, Ot = (r) => (e) => {
1456
1456
  const t = r.radius, o = e.arrowLength, s = (o * o + 2 * o * t) / (2 * t), n = s + t, a = o + t - t * (o + t) / n, h = t * s / n, c = [
1457
1457
  { x: 0, y: 0 },
1458
1458
  { x: a, y: -h },
@@ -1464,7 +1464,7 @@ const Ut = (r) => (e) => {
1464
1464
  y: w.y + e.shift.y
1465
1465
  })), u = `M ${c[0].x} ${c[0].y}`, l = `A ${s} ${s} 0 0 0 ${c[1].x} ${c[1].y}`, g = `A ${t} ${t} 0 0 0 ${c[2].x} ${c[2].y}`, p = `A ${s} ${s} 0 0 0 ${c[0].x} ${c[0].y}`;
1466
1466
  return `${u} ${l} ${g} ${p}`;
1467
- }, Bt = (r) => (e) => {
1467
+ }, Wt = (r) => (e) => {
1468
1468
  const t = r.smallRadius, o = r.radius, s = x(
1469
1469
  {
1470
1470
  x: e.arrowLength,
@@ -1485,27 +1485,27 @@ const Ut = (r) => (e) => {
1485
1485
  y: l.y + e.shift.y
1486
1486
  })), h = `M ${a[0].x} ${a[0].y}`, d = `A ${o} ${o} 0 0 1 ${a[1].x} ${a[1].y}`, c = `A ${t} ${t} 0 0 1 ${a[2].x} ${a[2].y}`, u = `A ${o} ${o} 0 0 1 ${a[0].x} ${a[0].y}`;
1487
1487
  return `${h} ${d} ${c} ${u}`;
1488
- }, B = (r) => {
1488
+ }, O = (r) => {
1489
1489
  if (typeof r == "function")
1490
1490
  return r;
1491
1491
  switch (r.type) {
1492
1492
  case "triangle":
1493
- return Ut({
1493
+ return Bt({
1494
1494
  radius: r.radius ?? v.polygonArrowRadius
1495
1495
  });
1496
1496
  case "arc":
1497
- return $t({
1497
+ return Ot({
1498
1498
  radius: r.radius ?? v.circleArrowRadius
1499
1499
  });
1500
1500
  default:
1501
- return Bt({
1501
+ return Wt({
1502
1502
  smallRadius: r.smallRadius ?? v.wedgeArrowSmallRadius,
1503
1503
  angle: r.angle ?? v.wedgeArrowAngle,
1504
1504
  radius: r.radius ?? v.wedgeArrowRadius
1505
1505
  });
1506
1506
  }
1507
- }, O = 50;
1508
- class Ot {
1507
+ }, W = 50;
1508
+ class zt {
1509
1509
  constructor(e) {
1510
1510
  i(this, "svg");
1511
1511
  i(this, "group");
@@ -1522,7 +1522,7 @@ class Ot {
1522
1522
  i(this, "hasSourceArrow");
1523
1523
  i(this, "hasTargetArrow");
1524
1524
  i(this, "pathShape");
1525
- i(this, "createCyclePath", (e, t, o) => new Rt({
1525
+ i(this, "createCyclePath", (e, t, o) => new Vt({
1526
1526
  origin: e,
1527
1527
  dir: o,
1528
1528
  radius: this.portCycleRadius,
@@ -1530,7 +1530,7 @@ class Ot {
1530
1530
  arrowLength: this.arrowLength,
1531
1531
  hasArrow: this.hasSourceArrow || this.hasTargetArrow
1532
1532
  }));
1533
- i(this, "createDetourPath", (e, t, o, s) => new bt({
1533
+ i(this, "createDetourPath", (e, t, o, s) => new Nt({
1534
1534
  from: e,
1535
1535
  to: t,
1536
1536
  fromDir: o,
@@ -1542,7 +1542,7 @@ class Ot {
1542
1542
  hasSourceArrow: this.hasSourceArrow,
1543
1543
  hasTargetArrow: this.hasTargetArrow
1544
1544
  }));
1545
- i(this, "createLinePath", (e, t, o, s) => new St({
1545
+ i(this, "createLinePath", (e, t, o, s) => new Pt({
1546
1546
  from: e,
1547
1547
  to: t,
1548
1548
  fromDir: o,
@@ -1552,25 +1552,25 @@ class Ot {
1552
1552
  hasSourceArrow: this.hasSourceArrow,
1553
1553
  hasTargetArrow: this.hasTargetArrow
1554
1554
  }));
1555
- this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? v.arrowLength, this.curvature = (e == null ? void 0 : e.curvature) ?? v.curvature, this.portCycleRadius = (e == null ? void 0 : e.cycleRadius) ?? v.cycleRadius, this.portCycleSmallRadius = (e == null ? void 0 : e.smallCycleRadius) ?? v.smallCycleRadius, this.detourDirection = (e == null ? void 0 : e.detourDirection) ?? v.detourDirection, this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? v.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? v.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? v.hasTargetArrow, this.pathShape = new G({
1555
+ this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? v.arrowLength, this.curvature = (e == null ? void 0 : e.curvature) ?? v.curvature, this.portCycleRadius = (e == null ? void 0 : e.cycleRadius) ?? v.cycleRadius, this.portCycleSmallRadius = (e == null ? void 0 : e.smallCycleRadius) ?? v.smallCycleRadius, this.detourDirection = (e == null ? void 0 : e.detourDirection) ?? v.detourDirection, this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? v.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? v.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? v.hasTargetArrow, this.pathShape = new J({
1556
1556
  color: (e == null ? void 0 : e.color) ?? v.color,
1557
1557
  width: (e == null ? void 0 : e.width) ?? v.width,
1558
- arrowRenderer: B((e == null ? void 0 : e.arrowRenderer) ?? {}),
1558
+ arrowRenderer: O((e == null ? void 0 : e.arrowRenderer) ?? {}),
1559
1559
  arrowLength: this.arrowLength,
1560
1560
  hasSourceArrow: this.hasSourceArrow,
1561
1561
  hasTargetArrow: this.hasTargetArrow,
1562
1562
  createCyclePath: this.createCyclePath,
1563
1563
  createDetourPath: this.createDetourPath,
1564
1564
  createLinePath: this.createLinePath,
1565
- padding: O
1565
+ padding: W
1566
1566
  }), this.svg = this.pathShape.svg, this.group = this.pathShape.group, this.line = this.pathShape.line, this.sourceArrow = this.pathShape.sourceArrow, this.targetArrow = this.pathShape.targetArrow, this.onAfterRender = this.pathShape.onAfterRender;
1567
1567
  }
1568
1568
  render(e) {
1569
1569
  this.pathShape.render(e);
1570
1570
  }
1571
1571
  }
1572
- const Se = (r) => Math.cos(r) > 0 ? 0 : Math.PI;
1573
- class Wt {
1572
+ const Pe = (r) => Math.cos(r) > 0 ? 0 : Math.PI;
1573
+ class kt {
1574
1574
  constructor(e) {
1575
1575
  i(this, "svg");
1576
1576
  i(this, "group");
@@ -1586,7 +1586,7 @@ class Wt {
1586
1586
  i(this, "hasSourceArrow");
1587
1587
  i(this, "hasTargetArrow");
1588
1588
  i(this, "pathShape");
1589
- i(this, "createCyclePath", (e, t, o) => new re({
1589
+ i(this, "createCyclePath", (e, t, o) => new se({
1590
1590
  origin: e,
1591
1591
  dir: o,
1592
1592
  arrowLength: this.arrowLength,
@@ -1595,7 +1595,7 @@ class Wt {
1595
1595
  roundness: this.roundness,
1596
1596
  hasArrow: this.hasSourceArrow || this.hasTargetArrow
1597
1597
  }));
1598
- i(this, "createDetourPath", (e, t, o, s) => new Vt({
1598
+ i(this, "createDetourPath", (e, t, o, s) => new Ft({
1599
1599
  from: e,
1600
1600
  to: t,
1601
1601
  fromDir: o,
@@ -1607,7 +1607,7 @@ class Wt {
1607
1607
  hasSourceArrow: this.hasSourceArrow,
1608
1608
  hasTargetArrow: this.hasTargetArrow
1609
1609
  }));
1610
- i(this, "createLinePath", (e, t, o, s) => new Nt({
1610
+ i(this, "createLinePath", (e, t, o, s) => new Tt({
1611
1611
  from: e,
1612
1612
  to: t,
1613
1613
  fromDir: o,
@@ -1624,17 +1624,17 @@ class Wt {
1624
1624
  t,
1625
1625
  this.arrowOffset,
1626
1626
  this.cycleSquareSide / 2
1627
- ), this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? v.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? v.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? v.hasTargetArrow, this.pathShape = new G({
1627
+ ), this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? v.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? v.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? v.hasTargetArrow, this.pathShape = new J({
1628
1628
  color: (e == null ? void 0 : e.color) ?? v.color,
1629
1629
  width: (e == null ? void 0 : e.width) ?? v.width,
1630
- arrowRenderer: B((e == null ? void 0 : e.arrowRenderer) ?? {}),
1630
+ arrowRenderer: O((e == null ? void 0 : e.arrowRenderer) ?? {}),
1631
1631
  arrowLength: this.arrowLength,
1632
1632
  hasSourceArrow: this.hasSourceArrow,
1633
1633
  hasTargetArrow: this.hasTargetArrow,
1634
1634
  createCyclePath: this.createCyclePath,
1635
1635
  createDetourPath: this.createDetourPath,
1636
1636
  createLinePath: this.createLinePath,
1637
- padding: O
1637
+ padding: W
1638
1638
  }), this.svg = this.pathShape.svg, this.group = this.pathShape.group, this.line = this.pathShape.line, this.sourceArrow = this.pathShape.sourceArrow, this.targetArrow = this.pathShape.targetArrow, this.onAfterRender = this.pathShape.onAfterRender;
1639
1639
  }
1640
1640
  render(e) {
@@ -1643,16 +1643,16 @@ class Wt {
1643
1643
  category: s,
1644
1644
  from: {
1645
1645
  ...t,
1646
- direction: Se(t.direction)
1646
+ direction: Pe(t.direction)
1647
1647
  },
1648
1648
  to: {
1649
1649
  ...o,
1650
- direction: Se(o.direction)
1650
+ direction: Pe(o.direction)
1651
1651
  }
1652
1652
  });
1653
1653
  }
1654
1654
  }
1655
- class zt {
1655
+ class Ht {
1656
1656
  constructor(e) {
1657
1657
  i(this, "svg");
1658
1658
  i(this, "group");
@@ -1669,7 +1669,7 @@ class zt {
1669
1669
  i(this, "hasSourceArrow");
1670
1670
  i(this, "hasTargetArrow");
1671
1671
  i(this, "pathShape");
1672
- i(this, "createCyclePath", (e, t, o) => new re({
1672
+ i(this, "createCyclePath", (e, t, o) => new se({
1673
1673
  origin: e,
1674
1674
  dir: o,
1675
1675
  arrowLength: this.arrowLength,
@@ -1678,7 +1678,7 @@ class zt {
1678
1678
  roundness: this.roundness,
1679
1679
  hasArrow: this.hasSourceArrow || this.hasTargetArrow
1680
1680
  }));
1681
- i(this, "createDetourPath", (e, t, o, s) => new Ct({
1681
+ i(this, "createDetourPath", (e, t, o, s) => new Mt({
1682
1682
  from: e,
1683
1683
  to: t,
1684
1684
  fromDir: o,
@@ -1691,7 +1691,7 @@ class zt {
1691
1691
  hasSourceArrow: this.hasSourceArrow,
1692
1692
  hasTargetArrow: this.hasTargetArrow
1693
1693
  }));
1694
- i(this, "createLinePath", (e, t, o, s) => new Tt({
1694
+ i(this, "createLinePath", (e, t, o, s) => new Dt({
1695
1695
  from: e,
1696
1696
  to: t,
1697
1697
  fromDir: o,
@@ -1708,25 +1708,25 @@ class zt {
1708
1708
  t,
1709
1709
  this.arrowOffset,
1710
1710
  this.cycleSquareSide / 2
1711
- ), this.detourDirection = (e == null ? void 0 : e.detourDirection) ?? v.detourDirection, this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? v.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? v.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? v.hasTargetArrow, this.pathShape = new G({
1711
+ ), this.detourDirection = (e == null ? void 0 : e.detourDirection) ?? v.detourDirection, this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? v.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? v.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? v.hasTargetArrow, this.pathShape = new J({
1712
1712
  color: (e == null ? void 0 : e.color) ?? v.color,
1713
1713
  width: (e == null ? void 0 : e.width) ?? v.width,
1714
- arrowRenderer: B((e == null ? void 0 : e.arrowRenderer) ?? {}),
1714
+ arrowRenderer: O((e == null ? void 0 : e.arrowRenderer) ?? {}),
1715
1715
  arrowLength: this.arrowLength,
1716
1716
  hasSourceArrow: this.hasSourceArrow,
1717
1717
  hasTargetArrow: this.hasTargetArrow,
1718
1718
  createCyclePath: this.createCyclePath,
1719
1719
  createDetourPath: this.createDetourPath,
1720
1720
  createLinePath: this.createLinePath,
1721
- padding: O
1721
+ padding: W
1722
1722
  }), this.svg = this.pathShape.svg, this.group = this.pathShape.group, this.line = this.pathShape.line, this.sourceArrow = this.pathShape.sourceArrow, this.targetArrow = this.pathShape.targetArrow, this.onAfterRender = this.pathShape.onAfterRender;
1723
1723
  }
1724
1724
  render(e) {
1725
1725
  this.pathShape.render(e);
1726
1726
  }
1727
1727
  }
1728
- const be = Math.PI / 2, Pe = (r) => Math.sin(r) > 0 ? be : -be;
1729
- class kt {
1728
+ const Ne = Math.PI / 2, Ce = (r) => Math.sin(r) > 0 ? Ne : -Ne;
1729
+ class Yt {
1730
1730
  constructor(e) {
1731
1731
  i(this, "svg");
1732
1732
  i(this, "group");
@@ -1742,7 +1742,7 @@ class kt {
1742
1742
  i(this, "hasSourceArrow");
1743
1743
  i(this, "hasTargetArrow");
1744
1744
  i(this, "pathShape");
1745
- i(this, "createCyclePath", (e, t, o) => new re({
1745
+ i(this, "createCyclePath", (e, t, o) => new se({
1746
1746
  origin: e,
1747
1747
  dir: o,
1748
1748
  arrowLength: this.arrowLength,
@@ -1751,7 +1751,7 @@ class kt {
1751
1751
  roundness: this.roundness,
1752
1752
  hasArrow: this.hasSourceArrow || this.hasTargetArrow
1753
1753
  }));
1754
- i(this, "createDetourPath", (e, t, o, s) => new Ft({
1754
+ i(this, "createDetourPath", (e, t, o, s) => new $t({
1755
1755
  from: e,
1756
1756
  to: t,
1757
1757
  fromDir: o,
@@ -1763,7 +1763,7 @@ class kt {
1763
1763
  hasSourceArrow: this.hasSourceArrow,
1764
1764
  hasTargetArrow: this.hasTargetArrow
1765
1765
  }));
1766
- i(this, "createLinePath", (e, t, o, s) => new Dt({
1766
+ i(this, "createLinePath", (e, t, o, s) => new Lt({
1767
1767
  from: e,
1768
1768
  to: t,
1769
1769
  fromDir: o,
@@ -1780,17 +1780,17 @@ class kt {
1780
1780
  t,
1781
1781
  this.arrowOffset,
1782
1782
  this.cycleSquareSide / 2
1783
- ), this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? v.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? v.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? v.hasTargetArrow, this.pathShape = new G({
1783
+ ), this.detourDistance = (e == null ? void 0 : e.detourDistance) ?? v.detourDistance, this.hasSourceArrow = (e == null ? void 0 : e.hasSourceArrow) ?? v.hasSourceArrow, this.hasTargetArrow = (e == null ? void 0 : e.hasTargetArrow) ?? v.hasTargetArrow, this.pathShape = new J({
1784
1784
  color: (e == null ? void 0 : e.color) ?? v.color,
1785
1785
  width: (e == null ? void 0 : e.width) ?? v.width,
1786
- arrowRenderer: B((e == null ? void 0 : e.arrowRenderer) ?? {}),
1786
+ arrowRenderer: O((e == null ? void 0 : e.arrowRenderer) ?? {}),
1787
1787
  arrowLength: this.arrowLength,
1788
1788
  hasSourceArrow: this.hasSourceArrow,
1789
1789
  hasTargetArrow: this.hasTargetArrow,
1790
1790
  createCyclePath: this.createCyclePath,
1791
1791
  createDetourPath: this.createDetourPath,
1792
1792
  createLinePath: this.createLinePath,
1793
- padding: O
1793
+ padding: W
1794
1794
  }), this.svg = this.pathShape.svg, this.group = this.pathShape.group, this.line = this.pathShape.line, this.sourceArrow = this.pathShape.sourceArrow, this.targetArrow = this.pathShape.targetArrow, this.onAfterRender = this.pathShape.onAfterRender;
1795
1795
  }
1796
1796
  render(e) {
@@ -1799,17 +1799,20 @@ class kt {
1799
1799
  category: s,
1800
1800
  from: {
1801
1801
  ...t,
1802
- direction: Pe(t.direction)
1802
+ direction: Ce(t.direction)
1803
1803
  },
1804
1804
  to: {
1805
1805
  ...o,
1806
- direction: Pe(o.direction)
1806
+ direction: Ce(o.direction)
1807
1807
  }
1808
1808
  });
1809
1809
  }
1810
1810
  }
1811
- const Ne = (r) => typeof r == "number" ? () => r : r, Ce = v.portOffset;
1812
- class Xe {
1811
+ const Xt = (r) => {
1812
+ const { direction: e, radius: t } = r, { x: o, y: s } = e, { horizontal: n, vertical: a } = t, h = s / o, d = Math.abs(a / h), c = Math.abs(n * h), u = Math.min(n, d), l = Math.min(a, c);
1813
+ return Math.sqrt(u * u + l * l);
1814
+ }, Te = (r) => typeof r == "number" ? () => r : r === "box" ? Xt : r, Me = v.portOffset;
1815
+ class je {
1813
1816
  constructor(e) {
1814
1817
  i(this, "svg");
1815
1818
  i(this, "group", document.createElementNS(
@@ -1827,19 +1830,19 @@ class Xe {
1827
1830
  i(this, "onAfterRender");
1828
1831
  i(this, "afterRenderEmitter");
1829
1832
  i(this, "arrowRenderer");
1830
- [this.afterRenderEmitter, this.onAfterRender] = C(), this.color = (e == null ? void 0 : e.color) ?? v.color, this.width = (e == null ? void 0 : e.width) ?? v.width, this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? v.arrowLength, this.arrowRenderer = B((e == null ? void 0 : e.arrowRenderer) ?? {}), this.sourceOffsetFn = Ne(
1831
- (e == null ? void 0 : e.sourceOffset) ?? Ce
1832
- ), this.targetOffsetFn = Ne(
1833
- (e == null ? void 0 : e.targetOffset) ?? Ce
1834
- ), this.svg = ke(this.color), this.svg.appendChild(this.group), this.line = He(this.width), this.group.appendChild(this.line), e != null && e.hasSourceArrow && (this.sourceArrow = X(), this.group.appendChild(this.sourceArrow)), e != null && e.hasTargetArrow && (this.targetArrow = X(), this.group.appendChild(this.targetArrow));
1833
+ [this.afterRenderEmitter, this.onAfterRender] = C(), this.color = (e == null ? void 0 : e.color) ?? v.color, this.width = (e == null ? void 0 : e.width) ?? v.width, this.arrowLength = (e == null ? void 0 : e.arrowLength) ?? v.arrowLength, this.arrowRenderer = O((e == null ? void 0 : e.arrowRenderer) ?? {}), this.sourceOffsetFn = Te(
1834
+ (e == null ? void 0 : e.sourceOffset) ?? Me
1835
+ ), this.targetOffsetFn = Te(
1836
+ (e == null ? void 0 : e.targetOffset) ?? Me
1837
+ ), this.svg = Ye(this.color), this.svg.appendChild(this.group), this.line = Xe(this.width), this.group.appendChild(this.line), e != null && e.hasSourceArrow && (this.sourceArrow = j(), this.group.appendChild(this.sourceArrow)), e != null && e.hasTargetArrow && (this.targetArrow = j(), this.group.appendChild(this.targetArrow));
1835
1838
  }
1836
1839
  render(e) {
1837
- const { x: t, y: o, width: s, height: n, from: a, to: h } = ze(
1840
+ const { x: t, y: o, width: s, height: n, from: a, to: h } = He(
1838
1841
  e.from,
1839
1842
  e.to,
1840
- O
1843
+ W
1841
1844
  );
1842
- Ye(this.svg, { x: t, y: o, width: s, height: n });
1845
+ Ge(this.svg, { x: t, y: o, width: s, height: n });
1843
1846
  const d = h.x - a.x, c = h.y - a.y, u = Math.sqrt(d * d + c * c);
1844
1847
  if (u === 0) {
1845
1848
  this.renderEmpty(a);
@@ -1916,25 +1919,22 @@ class Xe {
1916
1919
  });
1917
1920
  }
1918
1921
  }
1919
- const _r = (r) => {
1920
- const { direction: e, radius: t } = r, { x: o, y: s } = e, { horizontal: n, vertical: a } = t, h = s / o, d = Math.abs(a / h), c = Math.abs(n * h), u = Math.min(n, d), l = Math.min(a, c);
1921
- return Math.sqrt(u * u + l * l);
1922
- }, Ht = () => {
1922
+ const Gt = () => {
1923
1923
  const r = document.createElementNS("http://www.w3.org/2000/svg", "g");
1924
1924
  return r.style.pointerEvents = "auto", r.style.cursor = "pointer", r;
1925
- }, Yt = (r) => {
1925
+ }, jt = (r) => {
1926
1926
  const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
1927
1927
  return e.setAttribute("stroke", "transparent"), e.setAttribute("stroke-width", `${r}`), e.setAttribute("fill", "none"), e.setAttribute("stroke-linecap", "round"), e;
1928
- }, Te = (r) => {
1928
+ }, De = (r) => {
1929
1929
  const e = document.createElementNS("http://www.w3.org/2000/svg", "path");
1930
1930
  return e.setAttribute("stroke-linejoin", "round"), e.setAttribute("stroke-width", `${r}`), e.setAttribute("fill", "transparent"), e.setAttribute("stroke", "transparent"), e;
1931
1931
  };
1932
- class Xt extends Error {
1932
+ class Jt extends Error {
1933
1933
  constructor(e) {
1934
1934
  super(e), this.name = "InteractiveEdgeError";
1935
1935
  }
1936
1936
  }
1937
- class Ge {
1937
+ class Je {
1938
1938
  constructor(e, t) {
1939
1939
  i(this, "svg");
1940
1940
  i(this, "group");
@@ -1946,18 +1946,18 @@ class Ge {
1946
1946
  * @deprecated
1947
1947
  * use shape.svg instead
1948
1948
  */
1949
- i(this, "handle", Ht());
1949
+ i(this, "handle", Gt());
1950
1950
  i(this, "onAfterRender");
1951
1951
  i(this, "interactiveLine");
1952
1952
  i(this, "interactiveSourceArrow", null);
1953
1953
  i(this, "interactiveTargetArrow", null);
1954
- if (this.baseEdge = e, e instanceof Ge)
1955
- throw new Xt(
1954
+ if (this.baseEdge = e, e instanceof Je)
1955
+ throw new Jt(
1956
1956
  "interactive edge can be configured only once"
1957
1957
  );
1958
1958
  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;
1959
1959
  const o = (t == null ? void 0 : t.distance) ?? v.interactiveWidth;
1960
- this.interactiveLine = Yt(o), this.handle.appendChild(this.interactiveLine), this.sourceArrow && (this.interactiveSourceArrow = Te(o), this.handle.appendChild(this.interactiveSourceArrow)), this.targetArrow && (this.interactiveTargetArrow = Te(o), this.handle.appendChild(this.interactiveTargetArrow)), this.group.appendChild(this.handle), this.baseEdge.onAfterRender.subscribe((s) => {
1960
+ this.interactiveLine = jt(o), this.handle.appendChild(this.interactiveLine), this.sourceArrow && (this.interactiveSourceArrow = De(o), this.handle.appendChild(this.interactiveSourceArrow)), this.targetArrow && (this.interactiveTargetArrow = De(o), this.handle.appendChild(this.interactiveTargetArrow)), this.group.appendChild(this.handle), this.baseEdge.onAfterRender.subscribe((s) => {
1961
1961
  this.interactiveLine.setAttribute("d", s.edgePath.path), this.interactiveSourceArrow && this.interactiveSourceArrow.setAttribute("d", s.sourceArrowPath), this.interactiveTargetArrow && this.interactiveTargetArrow.setAttribute("d", s.targetArrowPath);
1962
1962
  });
1963
1963
  }
@@ -1965,7 +1965,7 @@ class Ge {
1965
1965
  this.baseEdge.render(e);
1966
1966
  }
1967
1967
  }
1968
- class qr {
1968
+ class to {
1969
1969
  constructor(e, t) {
1970
1970
  i(this, "group");
1971
1971
  i(this, "line");
@@ -1982,7 +1982,7 @@ class qr {
1982
1982
  this.baseShape.render(e);
1983
1983
  }
1984
1984
  }
1985
- class je {
1985
+ class Ke {
1986
1986
  constructor(e) {
1987
1987
  i(this, "onAfterNodeAdded");
1988
1988
  i(this, "onAfterNodeUpdated");
@@ -2081,7 +2081,7 @@ class je {
2081
2081
  return this.graphStore.getNodeAdjacentEdgeIds(e);
2082
2082
  }
2083
2083
  }
2084
- class K {
2084
+ class Z {
2085
2085
  constructor(e) {
2086
2086
  i(this, "counter", 0);
2087
2087
  this.checkExists = e;
@@ -2097,15 +2097,15 @@ class K {
2097
2097
  this.counter = 0;
2098
2098
  }
2099
2099
  }
2100
- class Je {
2100
+ class Qe {
2101
2101
  constructor(e, t, o) {
2102
- i(this, "nodeIdGenerator", new K(
2102
+ i(this, "nodeIdGenerator", new Z(
2103
2103
  (e) => this.graphStore.hasNode(e)
2104
2104
  ));
2105
- i(this, "portIdGenerator", new K(
2105
+ i(this, "portIdGenerator", new Z(
2106
2106
  (e) => this.graphStore.hasPort(e)
2107
2107
  ));
2108
- i(this, "edgeIdGenerator", new K(
2108
+ i(this, "edgeIdGenerator", new Z(
2109
2109
  (e) => this.graphStore.hasEdge(e)
2110
2110
  ));
2111
2111
  i(this, "onAfterNodeAdded", (e) => {
@@ -2228,18 +2228,18 @@ class Je {
2228
2228
  ), this.graphStore.onBeforeEdgeRemoved.unsubscribe(this.onBeforeEdgeRemoved), this.graphStore.onBeforeClear.unsubscribe(this.onBeforeClear), this.htmlView.destroy();
2229
2229
  }
2230
2230
  }
2231
- const Gt = (r) => {
2231
+ const Kt = (r) => {
2232
2232
  setTimeout(() => {
2233
2233
  r();
2234
2234
  });
2235
- }, Me = (r) => {
2235
+ }, Re = (r) => {
2236
2236
  queueMicrotask(() => {
2237
2237
  r();
2238
2238
  });
2239
- }, oe = (r) => {
2239
+ }, ie = (r) => {
2240
2240
  r();
2241
2241
  };
2242
- class Ke {
2242
+ class Ze {
2243
2243
  constructor(e) {
2244
2244
  i(this, "onBeforeUpdated");
2245
2245
  i(this, "onAfterUpdated");
@@ -2262,7 +2262,7 @@ class Ke {
2262
2262
  return this.viewportStore.createViewportCoords(e);
2263
2263
  }
2264
2264
  }
2265
- const jt = (r, e) => Symbol.iterator in r ? {
2265
+ const Qt = (r, e) => Symbol.iterator in r ? {
2266
2266
  minContentScale: e.focus.minContentScale,
2267
2267
  nodes: r,
2268
2268
  contentPadding: e.focus.contentPadding,
@@ -2272,16 +2272,16 @@ const jt = (r, e) => Symbol.iterator in r ? {
2272
2272
  nodes: r.nodes ?? [],
2273
2273
  contentPadding: r.contentPadding ?? r.contentOffset ?? e.focus.contentPadding,
2274
2274
  animationDuration: r.animationDuration ?? e.focus.animationDuration
2275
- }, Qe = (r, e, t) => ({
2275
+ }, _e = (r, e, t) => ({
2276
2276
  scale: r.scale,
2277
2277
  x: r.x + r.scale * e,
2278
2278
  y: r.y + r.scale * t
2279
- }), Ze = (r, e, t, o) => ({
2279
+ }), qe = (r, e, t, o) => ({
2280
2280
  scale: r.scale * e,
2281
2281
  x: r.scale * (1 - e) * t + r.x,
2282
2282
  y: r.scale * (1 - e) * o + r.y
2283
2283
  });
2284
- class _e {
2284
+ class et {
2285
2285
  constructor(e, t, o, s) {
2286
2286
  this.graphStore = e, this.viewportStore = t, this.params = o, this.win = s;
2287
2287
  }
@@ -2293,11 +2293,11 @@ class _e {
2293
2293
  }
2294
2294
  center(e, t) {
2295
2295
  const { width: o, height: s } = this.viewportStore.getDimensions(), n = { x: o / 2, y: s / 2 }, a = this.viewportStore.getViewportMatrix(), h = this.viewportStore.createViewportCoords(e), d = h.x - n.x, c = h.y - n.y;
2296
- let u = Qe(a, d, c);
2296
+ let u = _e(a, d, c);
2297
2297
  const l = t == null ? void 0 : t.contentScale;
2298
2298
  if (l !== void 0) {
2299
2299
  const p = 1 / l;
2300
- u = Ze(
2300
+ u = qe(
2301
2301
  u,
2302
2302
  p / a.scale,
2303
2303
  n.x,
@@ -2308,7 +2308,7 @@ class _e {
2308
2308
  g > 0 ? this.animateNavigation(a, u, g) : this.viewportStore.patchViewportMatrix(u);
2309
2309
  }
2310
2310
  focus(e) {
2311
- const t = jt(e ?? {}, this.params);
2311
+ const t = Qt(e ?? {}, this.params);
2312
2312
  this.params.focus.schedule(() => {
2313
2313
  this.navigate(t);
2314
2314
  });
@@ -2357,20 +2357,20 @@ class _e {
2357
2357
  this.win.requestAnimationFrame(a);
2358
2358
  }
2359
2359
  }
2360
- const qe = (r, e, t) => {
2361
- const o = new $e(), s = new je(o), n = new Ke(e), a = new Fe(o, e, r), h = {
2360
+ const tt = (r, e, t) => {
2361
+ const o = new Oe(), s = new Ke(o), n = new Ze(e), a = new $e(o, e, r), h = {
2362
2362
  nodes: {
2363
- centerFn: We,
2363
+ centerFn: ke,
2364
2364
  priorityFn: () => 0
2365
2365
  },
2366
2366
  edges: {
2367
- shapeFactory: () => new Xe(),
2367
+ shapeFactory: () => new je(),
2368
2368
  priorityFn: () => 0
2369
2369
  },
2370
2370
  ports: {
2371
2371
  direction: 0
2372
2372
  }
2373
- }, d = new Je(
2373
+ }, d = new Qe(
2374
2374
  o,
2375
2375
  a,
2376
2376
  h
@@ -2378,18 +2378,18 @@ const qe = (r, e, t) => {
2378
2378
  focus: {
2379
2379
  contentPadding: 0,
2380
2380
  minContentScale: 0,
2381
- schedule: oe,
2381
+ schedule: ie,
2382
2382
  animationDuration: 0
2383
2383
  }
2384
- }, u = new _e(
2384
+ }, u = new et(
2385
2385
  o,
2386
2386
  e,
2387
2387
  c,
2388
2388
  t
2389
2389
  );
2390
- return new Ue(s, n, d, u);
2390
+ return new Be(s, n, d, u);
2391
2391
  };
2392
- class j {
2392
+ class K {
2393
2393
  constructor(e, t, o, s) {
2394
2394
  i(this, "onAfterPortMarked", (e) => {
2395
2395
  const t = this.canvas.graph.getPort(e);
@@ -2470,7 +2470,7 @@ class j {
2470
2470
  this.canvas = e, this.window = t, this.pointInsideVerifier = o, this.params = s, this.canvas.graph.onAfterPortMarked.subscribe(this.onAfterPortMarked), this.canvas.graph.onBeforePortUnmarked.subscribe(this.onBeforePortUnmarked), this.canvas.graph.onBeforeClear.subscribe(this.reset), this.canvas.onBeforeDestroy.subscribe(this.revert);
2471
2471
  }
2472
2472
  static configure(e, t, o, s) {
2473
- new j(e, t, o, s);
2473
+ new K(e, t, o, s);
2474
2474
  }
2475
2475
  hookPortEvents(e) {
2476
2476
  e.addEventListener("mousedown", this.onPortMouseDown, {
@@ -2489,7 +2489,7 @@ class j {
2489
2489
  this.window.removeEventListener("touchmove", this.onWindowTouchMove), this.window.removeEventListener("touchend", this.onWindowTouchFinish), this.window.removeEventListener("touchcancel", this.onWindowTouchFinish);
2490
2490
  }
2491
2491
  }
2492
- class Jt {
2492
+ class Zt {
2493
2493
  constructor() {
2494
2494
  i(this, "field", "_htmlGraphTags");
2495
2495
  }
@@ -2502,8 +2502,8 @@ class Jt {
2502
2502
  s === void 0 ? o[this.field] = /* @__PURE__ */ new Set([t]) : s.add(t);
2503
2503
  }
2504
2504
  }
2505
- const se = Symbol();
2506
- class ie {
2505
+ const ne = Symbol();
2506
+ class ae {
2507
2507
  constructor(e, t, o) {
2508
2508
  i(this, "onSelected");
2509
2509
  i(this, "mouseDownEventVerifier");
@@ -2593,11 +2593,11 @@ class ie {
2593
2593
  this.movedDistance += s, this.movedDistance > this.movementThreshold && o();
2594
2594
  }
2595
2595
  }
2596
- const ne = (r, e) => ({
2596
+ const he = (r, e) => ({
2597
2597
  from: r.isDirect ? r.staticPortId : e,
2598
2598
  to: r.isDirect ? e : r.staticPortId
2599
2599
  });
2600
- class De {
2600
+ class Le {
2601
2601
  constructor(e, t) {
2602
2602
  this.graph = e, this.connectionAllowedVerifier = t;
2603
2603
  }
@@ -2608,7 +2608,7 @@ class De {
2608
2608
  const { element: a, direction: h, nodeId: d } = this.graph.getPort(n), { x: c, y: u } = this.graph.getNode(d);
2609
2609
  if (c === null || u === null)
2610
2610
  return;
2611
- const l = ne(e, n);
2611
+ const l = he(e, n);
2612
2612
  if (!this.connectionAllowedVerifier(l))
2613
2613
  return;
2614
2614
  const { top: g, left: p, width: w, height: y } = a.getBoundingClientRect(), f = { x: p + w / 2, y: g + y / 2 }, m = s.x - f.x, E = s.y - f.y, A = Math.sqrt(m * m + E * E);
@@ -2616,7 +2616,7 @@ class De {
2616
2616
  }), t;
2617
2617
  }
2618
2618
  }
2619
- class Kt {
2619
+ class _t {
2620
2620
  constructor(e) {
2621
2621
  this.direction = e;
2622
2622
  }
@@ -2624,7 +2624,7 @@ class Kt {
2624
2624
  return this.direction;
2625
2625
  }
2626
2626
  }
2627
- class ae {
2627
+ class de {
2628
2628
  constructor(e, t, o, s, n) {
2629
2629
  i(this, "grabbedNode", null);
2630
2630
  i(this, "maxNodePriority", 0);
@@ -2661,7 +2661,7 @@ class ae {
2661
2661
  nodeId: s,
2662
2662
  dx: h.x - n.x,
2663
2663
  dy: h.y - n.y
2664
- }, H(this.element, this.params.dragCursor), this.moveNodeOnTop(s), this.window.addEventListener("mousemove", this.onWindowMouseMove, {
2664
+ }, X(this.element, this.params.dragCursor), this.moveNodeOnTop(s), this.window.addEventListener("mousemove", this.onWindowMouseMove, {
2665
2665
  passive: !0
2666
2666
  }), this.window.addEventListener("mouseup", this.onWindowMouseUp, {
2667
2667
  passive: !0
@@ -2743,7 +2743,7 @@ class ae {
2743
2743
  this.canvas = e, this.element = t, this.window = o, this.pointInsideVerifier = s, this.params = n, this.graph = e.graph, this.graph.onAfterNodeAdded.subscribe(this.onAfterNodeAdded), this.graph.onAfterNodeUpdated.subscribe(this.onAfterNodeUpdated), this.graph.onBeforeNodeRemoved.subscribe(this.onBeforeNodeRemoved), this.graph.onBeforeClear.subscribe(this.reset), this.canvas.onBeforeDestroy.subscribe(this.revert);
2744
2744
  }
2745
2745
  static configure(e, t, o, s, n) {
2746
- new ae(
2746
+ new de(
2747
2747
  e,
2748
2748
  t,
2749
2749
  o,
@@ -2775,7 +2775,7 @@ class ae {
2775
2775
  }
2776
2776
  }
2777
2777
  stopMouseDrag() {
2778
- this.grabbedNode !== null && this.graph.hasNode(this.grabbedNode.nodeId) && this.params.onNodeDragFinished(this.grabbedNode.nodeId), this.grabbedNode = null, H(this.element, null), this.removeMouseDragListeners();
2778
+ this.grabbedNode !== null && this.graph.hasNode(this.grabbedNode.nodeId) && this.params.onNodeDragFinished(this.grabbedNode.nodeId), this.grabbedNode = null, X(this.element, null), this.removeMouseDragListeners();
2779
2779
  }
2780
2780
  removeMouseDragListeners() {
2781
2781
  this.window.removeEventListener("mouseup", this.onWindowMouseUp), this.window.removeEventListener("mousemove", this.onWindowMouseMove);
@@ -2818,7 +2818,7 @@ class ae {
2818
2818
  return e;
2819
2819
  }
2820
2820
  }
2821
- const W = (r) => {
2821
+ const k = (r) => {
2822
2822
  const e = [], t = r.touches.length;
2823
2823
  for (let h = 0; h < t; h++)
2824
2824
  e.push([r.touches[h].clientX, r.touches[h].clientY]);
@@ -2837,7 +2837,7 @@ const W = (r) => {
2837
2837
  touches: e
2838
2838
  };
2839
2839
  };
2840
- class J {
2840
+ class Q {
2841
2841
  constructor(e, t, o, s, n) {
2842
2842
  i(this, "viewport");
2843
2843
  i(this, "prevTouches", null);
@@ -2847,7 +2847,7 @@ class J {
2847
2847
  this.removeMouseDragListeners(), this.removeTouchDragListeners();
2848
2848
  });
2849
2849
  i(this, "onMouseDown", (e) => {
2850
- this.params.mouseDownEventVerifier(e) && (H(this.element, this.params.shiftCursor), this.window.addEventListener("mousemove", this.onWindowMouseMove, {
2850
+ this.params.mouseDownEventVerifier(e) && (X(this.element, this.params.shiftCursor), this.window.addEventListener("mousemove", this.onWindowMouseMove, {
2851
2851
  passive: !0
2852
2852
  }), this.window.addEventListener("mouseup", this.onWindowMouseUp, {
2853
2853
  passive: !0
@@ -2878,10 +2878,10 @@ class J {
2878
2878
  });
2879
2879
  i(this, "onTouchStart", (e) => {
2880
2880
  if (this.prevTouches !== null) {
2881
- this.prevTouches = W(e);
2881
+ this.prevTouches = k(e);
2882
2882
  return;
2883
2883
  }
2884
- this.prevTouches = W(e), this.window.addEventListener("touchmove", this.onWindowTouchMove, {
2884
+ this.prevTouches = k(e), this.window.addEventListener("touchmove", this.onWindowTouchMove, {
2885
2885
  passive: !0
2886
2886
  }), this.window.addEventListener("touchend", this.onWindowTouchFinish, {
2887
2887
  passive: !0
@@ -2890,7 +2890,7 @@ class J {
2890
2890
  }), this.startRegisteredTransform();
2891
2891
  });
2892
2892
  i(this, "onWindowTouchMove", (e) => {
2893
- const t = W(e);
2893
+ const t = k(e);
2894
2894
  if (!t.touches.every(
2895
2895
  (s) => this.pointInsideVerifier.verify(s[0], s[1])
2896
2896
  )) {
@@ -2907,7 +2907,7 @@ class J {
2907
2907
  this.prevTouches = t;
2908
2908
  });
2909
2909
  i(this, "onWindowTouchFinish", (e) => {
2910
- e.touches.length > 0 ? this.prevTouches = W(e) : this.stopTouchDrag();
2910
+ e.touches.length > 0 ? this.prevTouches = k(e) : this.stopTouchDrag();
2911
2911
  });
2912
2912
  i(this, "preventWheelScaleListener", (e) => {
2913
2913
  e.preventDefault();
@@ -2925,7 +2925,7 @@ class J {
2925
2925
  }), e.onBeforeDestroy.subscribe(this.revert);
2926
2926
  }
2927
2927
  static configure(e, t, o, s, n) {
2928
- new J(
2928
+ new Q(
2929
2929
  e,
2930
2930
  t,
2931
2931
  o,
@@ -2934,7 +2934,7 @@ class J {
2934
2934
  );
2935
2935
  }
2936
2936
  moveViewport(e, t) {
2937
- const o = this.viewport.getViewportMatrix(), s = Qe(o, e, t), { width: n, height: a } = this.viewport.getDimensions(), h = this.params.transformPreprocessor({
2937
+ const o = this.viewport.getViewportMatrix(), s = _e(o, e, t), { width: n, height: a } = this.viewport.getDimensions(), h = this.params.transformPreprocessor({
2938
2938
  prevTransform: o,
2939
2939
  nextTransform: s,
2940
2940
  canvasWidth: n,
@@ -2943,7 +2943,7 @@ class J {
2943
2943
  this.performTransform(h);
2944
2944
  }
2945
2945
  scaleViewport(e, t, o) {
2946
- const s = this.canvas.viewport.getViewportMatrix(), n = Ze(s, e, t, o), { width: a, height: h } = this.viewport.getDimensions(), d = this.params.transformPreprocessor({
2946
+ const s = this.canvas.viewport.getViewportMatrix(), n = qe(s, e, t, o), { width: a, height: h } = this.viewport.getDimensions(), d = this.params.transformPreprocessor({
2947
2947
  prevTransform: s,
2948
2948
  nextTransform: n,
2949
2949
  canvasWidth: a,
@@ -2952,7 +2952,7 @@ class J {
2952
2952
  this.performTransform(d);
2953
2953
  }
2954
2954
  stopMouseDrag() {
2955
- H(this.element, null), this.removeMouseDragListeners(), this.finishRegisteredTransform();
2955
+ X(this.element, null), this.removeMouseDragListeners(), this.finishRegisteredTransform();
2956
2956
  }
2957
2957
  removeMouseDragListeners() {
2958
2958
  this.window.removeEventListener("mousemove", this.onWindowMouseMove), this.window.removeEventListener("mouseup", this.onWindowMouseUp);
@@ -2982,7 +2982,7 @@ class J {
2982
2982
  this.params.onResizeTransformStarted(), this.canvas.patchViewportMatrix(s), this.params.onResizeTransformFinished();
2983
2983
  }
2984
2984
  }
2985
- class he {
2985
+ class ce {
2986
2986
  constructor(e, t, o, s, n, a, h) {
2987
2987
  i(this, "nodeHorizontal");
2988
2988
  i(this, "nodeVertical");
@@ -3029,7 +3029,7 @@ class he {
3029
3029
  this.scheduleLoadAreaAroundViewport(), s.onTransformFinished();
3030
3030
  }
3031
3031
  };
3032
- J.configure(
3032
+ Q.configure(
3033
3033
  e,
3034
3034
  this.element,
3035
3035
  this.window,
@@ -3038,7 +3038,7 @@ class he {
3038
3038
  ), this.trigger.subscribe(this.updateLoadedArea), this.canvas.viewport.onAfterUpdated.subscribe(this.onAfterViewportUpdated);
3039
3039
  }
3040
3040
  static configure(e, t, o, s, n, a, h) {
3041
- new he(
3041
+ new ce(
3042
3042
  e,
3043
3043
  t,
3044
3044
  o,
@@ -3069,24 +3069,24 @@ class he {
3069
3069
  });
3070
3070
  }
3071
3071
  }
3072
- const Qt = () => {
3072
+ const qt = () => {
3073
3073
  const r = document.createElementNS("http://www.w3.org/2000/svg", "svg");
3074
3074
  return r.style.position = "absolute", r.style.inset = "0", r;
3075
- }, Zt = () => {
3075
+ }, er = () => {
3076
3076
  const r = document.createElementNS("http://www.w3.org/2000/svg", "rect");
3077
3077
  return r.setAttribute("fill", "url(#pattern)"), r;
3078
- }, _t = () => {
3078
+ }, tr = () => {
3079
3079
  const r = document.createElementNS(
3080
3080
  "http://www.w3.org/2000/svg",
3081
3081
  "pattern"
3082
3082
  );
3083
3083
  return r.setAttribute("id", "pattern"), r;
3084
3084
  };
3085
- class de {
3085
+ class le {
3086
3086
  constructor(e, t, o) {
3087
- i(this, "svg", Qt());
3088
- i(this, "patternRenderingRectangle", Zt());
3089
- i(this, "pattern", _t());
3087
+ i(this, "svg", qt());
3088
+ i(this, "patternRenderingRectangle", er());
3089
+ i(this, "pattern", tr());
3090
3090
  i(this, "patternContent");
3091
3091
  i(this, "tileWidth");
3092
3092
  i(this, "tileHeight");
@@ -3107,7 +3107,7 @@ class de {
3107
3107
  }), this.canvas.viewport.onAfterUpdated.subscribe(this.onAfterTransformUpdated), this.onAfterTransformUpdated();
3108
3108
  }
3109
3109
  static configure(e, t, o) {
3110
- new de(e, t, o);
3110
+ new le(e, t, o);
3111
3111
  }
3112
3112
  updateVisibility() {
3113
3113
  const { scale: e } = this.canvas.viewport.getViewportMatrix(), t = e > this.maxViewportScale;
@@ -3121,14 +3121,14 @@ class de {
3121
3121
  }
3122
3122
  }
3123
3123
  }
3124
- class ce {
3124
+ class ue {
3125
3125
  constructor(e, t, o, s, n, a) {
3126
3126
  i(this, "overlayCanvas");
3127
3127
  i(this, "edgeInProgress", null);
3128
3128
  i(this, "onEdgeCreated", (e) => {
3129
3129
  this.params.onAfterEdgeCreated(e);
3130
3130
  });
3131
- this.canvas = e, this.overlayLayer = t, this.viewportStore = o, this.window = s, this.pointInsideVerifier = n, this.params = a, this.overlayCanvas = qe(
3131
+ this.canvas = e, this.overlayLayer = t, this.viewportStore = o, this.window = s, this.pointInsideVerifier = n, this.params = a, this.overlayCanvas = tt(
3132
3132
  this.overlayLayer,
3133
3133
  this.viewportStore,
3134
3134
  this.window
@@ -3151,7 +3151,7 @@ class ce {
3151
3151
  this.resetDragState(), this.params.onEdgeCreationInterrupted(d);
3152
3152
  }
3153
3153
  };
3154
- j.configure(
3154
+ K.configure(
3155
3155
  this.canvas,
3156
3156
  this.window,
3157
3157
  this.pointInsideVerifier,
@@ -3159,7 +3159,7 @@ class ce {
3159
3159
  );
3160
3160
  }
3161
3161
  static configure(e, t, o, s, n, a) {
3162
- new ce(
3162
+ new ue(
3163
3163
  e,
3164
3164
  t,
3165
3165
  o,
@@ -3194,7 +3194,7 @@ class ce {
3194
3194
  portCoords: u,
3195
3195
  portDirection: p ?? s.direction
3196
3196
  }, [y, f] = g ? [l, w] : [w, l];
3197
- this.overlayCanvas.addNode(Y(y)), this.overlayCanvas.addNode(Y(f)), this.overlayCanvas.addEdge({
3197
+ this.overlayCanvas.addNode(G(y)), this.overlayCanvas.addNode(G(f)), this.overlayCanvas.addEdge({
3198
3198
  from: y.overlayNodeId,
3199
3199
  to: f.overlayNodeId,
3200
3200
  shape: this.params.edgeShapeFactory(R.EdgeId)
@@ -3204,12 +3204,12 @@ class ce {
3204
3204
  this.edgeInProgress = null, this.overlayCanvas.clear();
3205
3205
  }
3206
3206
  tryCreateConnection(e) {
3207
- const t = Oe(this.canvas.graph, e);
3207
+ const t = ze(this.canvas.graph, e);
3208
3208
  if (t === null) {
3209
3209
  this.params.onEdgeCreationInterrupted(this.edgeInProgress);
3210
3210
  return;
3211
3211
  }
3212
- const o = ne(
3212
+ const o = he(
3213
3213
  this.edgeInProgress,
3214
3214
  t
3215
3215
  ), s = this.params.connectionAllowedVerifier(o), n = this.params.connectionPreprocessor({
@@ -3232,7 +3232,7 @@ class ce {
3232
3232
  }).updatePort(R.DraggingNodeId, { direction: s });
3233
3233
  }
3234
3234
  }
3235
- class le {
3235
+ class ge {
3236
3236
  constructor(e, t, o, s, n, a) {
3237
3237
  i(this, "overlayCanvas");
3238
3238
  i(this, "edgeInProgress", null);
@@ -3240,7 +3240,7 @@ class le {
3240
3240
  i(this, "onEdgeReattached", (e) => {
3241
3241
  this.params.onAfterEdgeReattached(e);
3242
3242
  });
3243
- this.canvas = e, this.overlayLayer = t, this.viewportStore = o, this.window = s, this.pointInsideVerifier = n, this.params = a, this.overlayCanvas = qe(
3243
+ this.canvas = e, this.overlayLayer = t, this.viewportStore = o, this.window = s, this.pointInsideVerifier = n, this.params = a, this.overlayCanvas = tt(
3244
3244
  this.overlayLayer,
3245
3245
  this.viewportStore,
3246
3246
  this.window
@@ -3266,7 +3266,7 @@ class le {
3266
3266
  });
3267
3267
  }
3268
3268
  };
3269
- j.configure(
3269
+ K.configure(
3270
3270
  this.canvas,
3271
3271
  this.window,
3272
3272
  this.pointInsideVerifier,
@@ -3274,7 +3274,7 @@ class le {
3274
3274
  );
3275
3275
  }
3276
3276
  static configure(e, t, o, s, n, a) {
3277
- new le(
3277
+ new ge(
3278
3278
  e,
3279
3279
  t,
3280
3280
  o,
@@ -3320,7 +3320,7 @@ class le {
3320
3320
  portCoords: w,
3321
3321
  portDirection: f ?? d.direction
3322
3322
  }, [E, A] = a ? [y, m] : [m, y];
3323
- this.overlayCanvas.addNode(Y(E)), this.overlayCanvas.addNode(Y(A));
3323
+ this.overlayCanvas.addNode(G(E)), this.overlayCanvas.addNode(G(A));
3324
3324
  const T = this.params.draggingEdgeShapeFactory !== null ? this.params.draggingEdgeShapeFactory(R.EdgeId) : s.shape;
3325
3325
  return this.overlayCanvas.addEdge({
3326
3326
  id: R.EdgeId,
@@ -3346,7 +3346,7 @@ class le {
3346
3346
  }).updatePort(R.DraggingNodeId, { direction: n });
3347
3347
  }
3348
3348
  tryCreateConnection(e) {
3349
- const t = Oe(this.canvas.graph, e);
3349
+ const t = ze(this.canvas.graph, e);
3350
3350
  if (this.overlayCanvas.removeEdge(R.EdgeId), t === null) {
3351
3351
  const c = this.draggingEdgePayload;
3352
3352
  this.params.onEdgeReattachInterrupted({
@@ -3358,7 +3358,7 @@ class le {
3358
3358
  });
3359
3359
  return;
3360
3360
  }
3361
- const { from: o, to: s } = ne(
3361
+ const { from: o, to: s } = he(
3362
3362
  this.edgeInProgress,
3363
3363
  t
3364
3364
  ), n = this.draggingEdgePayload, a = {
@@ -3385,17 +3385,17 @@ class le {
3385
3385
  }
3386
3386
  }
3387
3387
  }
3388
- class ue {
3388
+ class pe {
3389
3389
  constructor(e, t) {
3390
3390
  this.applier = e, this.trigger = t, this.trigger.subscribe(() => {
3391
3391
  this.applier.apply();
3392
3392
  });
3393
3393
  }
3394
3394
  static configure(e, t) {
3395
- new ue(e, t);
3395
+ new pe(e, t);
3396
3396
  }
3397
3397
  }
3398
- class ge {
3398
+ class we {
3399
3399
  constructor(e, t, o) {
3400
3400
  i(this, "applyScheduled", !1);
3401
3401
  i(this, "apply", () => {
@@ -3412,7 +3412,7 @@ class ge {
3412
3412
  });
3413
3413
  }
3414
3414
  static configure(e, t, o) {
3415
- new ge(
3415
+ new we(
3416
3416
  e,
3417
3417
  t,
3418
3418
  o
@@ -3422,7 +3422,7 @@ class ge {
3422
3422
  this.applyScheduled || (this.applyScheduled = !0, this.defererFn(this.apply));
3423
3423
  }
3424
3424
  }
3425
- class qt {
3425
+ class rr {
3426
3426
  constructor(e, t, o) {
3427
3427
  this.canvas = e, this.layoutAlgorithm = t, this.params = o;
3428
3428
  }
@@ -3436,23 +3436,23 @@ class qt {
3436
3436
  }), this.params.onAfterApplied();
3437
3437
  }
3438
3438
  }
3439
- class er {
3439
+ class or {
3440
3440
  static configure(e, t) {
3441
- const o = t.applyOn, s = new qt(e, t.algorithm, {
3441
+ const o = t.applyOn, s = new rr(e, t.algorithm, {
3442
3442
  staticNodeResolver: t.staticNodeResolver,
3443
3443
  onBeforeApplied: t.onBeforeApplied,
3444
3444
  onAfterApplied: t.onAfterApplied
3445
3445
  });
3446
3446
  switch (o.type) {
3447
3447
  case "trigger": {
3448
- ue.configure(
3448
+ pe.configure(
3449
3449
  s,
3450
3450
  o.trigger
3451
3451
  );
3452
3452
  break;
3453
3453
  }
3454
3454
  case "topologyChangeSchedule": {
3455
- ge.configure(
3455
+ we.configure(
3456
3456
  e.graph,
3457
3457
  s,
3458
3458
  o.schedule
@@ -3462,7 +3462,7 @@ class er {
3462
3462
  }
3463
3463
  }
3464
3464
  }
3465
- class tr {
3465
+ class sr {
3466
3466
  constructor(e, t) {
3467
3467
  i(this, "previousTimeStamp");
3468
3468
  i(this, "step", (e) => {
@@ -3477,7 +3477,7 @@ class tr {
3477
3477
  this.win = e, this.callback = t, this.win.requestAnimationFrame(this.step);
3478
3478
  }
3479
3479
  }
3480
- class rr {
3480
+ class ir {
3481
3481
  constructor(e, t, o) {
3482
3482
  this.canvas = e, this.layoutAlgorithm = t, this.params = o;
3483
3483
  }
@@ -3492,27 +3492,27 @@ class rr {
3492
3492
  }), this.params.onAfterApplied();
3493
3493
  }
3494
3494
  }
3495
- class pe {
3495
+ class ye {
3496
3496
  constructor(e, t, o) {
3497
3497
  i(this, "applier");
3498
3498
  i(this, "step", (e) => {
3499
3499
  this.applier.apply(e);
3500
3500
  });
3501
- this.win = o, this.applier = new rr(e, t.algorithm, {
3501
+ this.win = o, this.applier = new ir(e, t.algorithm, {
3502
3502
  staticNodeResolver: t.staticNodeResolver,
3503
3503
  onBeforeApplied: t.onBeforeApplied,
3504
3504
  onAfterApplied: t.onAfterApplied
3505
- }), new tr(this.win, this.step);
3505
+ }), new sr(this.win, this.step);
3506
3506
  }
3507
3507
  static configure(e, t, o) {
3508
- new pe(e, t, o);
3508
+ new ye(e, t, o);
3509
3509
  }
3510
3510
  }
3511
- class we {
3511
+ class fe {
3512
3512
  constructor(e, t, o, s, n) {
3513
3513
  i(this, "configurator");
3514
3514
  i(this, "onNodeSelected");
3515
- i(this, "selectionHandledTag", se);
3515
+ i(this, "selectionHandledTag", ne);
3516
3516
  i(this, "onAfterNodeAdded", (e) => {
3517
3517
  const { element: t } = this.canvas.graph.getNode(e);
3518
3518
  this.configurator.enable(t);
@@ -3527,7 +3527,7 @@ class we {
3527
3527
  this.configurator.disable(t);
3528
3528
  });
3529
3529
  });
3530
- this.canvas = e, this.window = t, this.pointInsideVerifier = o, this.eventTagger = s, this.onNodeSelected = n.onNodeSelected, this.configurator = new ie(
3530
+ this.canvas = e, this.window = t, this.pointInsideVerifier = o, this.eventTagger = s, this.onNodeSelected = n.onNodeSelected, this.configurator = new ae(
3531
3531
  this.window,
3532
3532
  this.pointInsideVerifier,
3533
3533
  {
@@ -3542,7 +3542,7 @@ class we {
3542
3542
  ), this.canvas.graph.onAfterNodeAdded.subscribe(this.onAfterNodeAdded), this.canvas.graph.onBeforeNodeRemoved.subscribe(this.onBeforeNodeRemoved), this.canvas.graph.onBeforeClear.subscribe(this.reset), this.canvas.onBeforeDestroy.subscribe(this.reset);
3543
3543
  }
3544
3544
  static configure(e, t, o, s, n) {
3545
- new we(
3545
+ new fe(
3546
3546
  e,
3547
3547
  t,
3548
3548
  o,
@@ -3551,10 +3551,10 @@ class we {
3551
3551
  );
3552
3552
  }
3553
3553
  }
3554
- class ye {
3554
+ class ve {
3555
3555
  constructor(e, t, o, s, n) {
3556
3556
  i(this, "configurator");
3557
- i(this, "selectionHandledTag", se);
3557
+ i(this, "selectionHandledTag", ne);
3558
3558
  i(this, "onEdgeSelected");
3559
3559
  i(this, "onAfterEdgeAdded", (e) => {
3560
3560
  const { shape: t } = this.canvas.graph.getEdge(e);
@@ -3570,7 +3570,7 @@ class ye {
3570
3570
  this.configurator.disable(t.svg);
3571
3571
  });
3572
3572
  });
3573
- this.canvas = e, this.window = t, this.pointInsideVerifier = o, this.eventTagger = s, this.onEdgeSelected = n.onEdgeSelected, this.configurator = new ie(
3573
+ this.canvas = e, this.window = t, this.pointInsideVerifier = o, this.eventTagger = s, this.onEdgeSelected = n.onEdgeSelected, this.configurator = new ae(
3574
3574
  this.window,
3575
3575
  this.pointInsideVerifier,
3576
3576
  {
@@ -3585,7 +3585,7 @@ class ye {
3585
3585
  ), this.canvas.graph.onAfterEdgeAdded.subscribe(this.onAfterEdgeAdded), this.canvas.graph.onBeforeEdgeRemoved.subscribe(this.onBeforeEdgeRemoved), this.canvas.graph.onBeforeClear.subscribe(this.reset), this.canvas.onBeforeDestroy.subscribe(this.reset);
3586
3586
  }
3587
3587
  static configure(e, t, o, s, n) {
3588
- new ye(
3588
+ new ve(
3589
3589
  e,
3590
3590
  t,
3591
3591
  o,
@@ -3594,12 +3594,12 @@ class ye {
3594
3594
  );
3595
3595
  }
3596
3596
  }
3597
- class fe {
3597
+ class me {
3598
3598
  constructor(e, t, o, s, n, a) {
3599
3599
  i(this, "configurator");
3600
3600
  i(this, "onCanvasSelected");
3601
- i(this, "selectionHandledTag", se);
3602
- this.canvas = e, this.element = t, this.window = o, this.pointInsideVerifier = s, this.eventTagger = n, this.onCanvasSelected = a.onCanvasSelected, this.configurator = new ie(
3601
+ i(this, "selectionHandledTag", ne);
3602
+ this.canvas = e, this.element = t, this.window = o, this.pointInsideVerifier = s, this.eventTagger = n, this.onCanvasSelected = a.onCanvasSelected, this.configurator = new ae(
3603
3603
  this.window,
3604
3604
  this.pointInsideVerifier,
3605
3605
  {
@@ -3615,7 +3615,7 @@ class fe {
3615
3615
  });
3616
3616
  }
3617
3617
  static configure(e, t, o, s, n, a) {
3618
- new fe(
3618
+ new me(
3619
3619
  e,
3620
3620
  t,
3621
3621
  o,
@@ -3625,23 +3625,23 @@ class fe {
3625
3625
  );
3626
3626
  }
3627
3627
  }
3628
- const or = () => {
3628
+ const nr = () => {
3629
3629
  const r = document.createElement("div");
3630
3630
  return r.style.width = "100%", r.style.height = "100%", r.style.position = "relative", r;
3631
- }, Q = () => {
3631
+ }, _ = () => {
3632
3632
  const r = document.createElement("div");
3633
3633
  return r.style.position = "absolute", r.style.inset = "0", r;
3634
- }, Re = () => {
3635
- const r = Q();
3634
+ }, Ve = () => {
3635
+ const r = _();
3636
3636
  return r.style.pointerEvents = "none", r;
3637
3637
  };
3638
- class sr {
3638
+ class ar {
3639
3639
  constructor(e) {
3640
- i(this, "background", Q());
3641
- i(this, "main", Q());
3642
- i(this, "overlayConnectablePorts", Re());
3643
- i(this, "overlayDraggableEdges", Re());
3644
- i(this, "host", or());
3640
+ i(this, "background", _());
3641
+ i(this, "main", _());
3642
+ i(this, "overlayConnectablePorts", Ve());
3643
+ i(this, "overlayDraggableEdges", Ve());
3644
+ i(this, "host", nr());
3645
3645
  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);
3646
3646
  }
3647
3647
  destroy() {
@@ -3667,18 +3667,18 @@ const P = Object.freeze({
3667
3667
  mouseUpEventVerifier: (r) => r.button === 0,
3668
3668
  movementThreshold: 10
3669
3669
  }), N = () => {
3670
- }, et = (r, e, t) => r === "closest-connectable-port" ? new De(
3670
+ }, rt = (r, e, t) => r === "closest-connectable-port" ? new Le(
3671
3671
  e,
3672
3672
  t
3673
- ) : r === "nearest-connectable-port" ? new De(
3673
+ ) : r === "nearest-connectable-port" ? new Le(
3674
3674
  e,
3675
3675
  t
3676
- ) : new Kt(r), ve = (r) => {
3676
+ ) : new _t(r), xe = (r) => {
3677
3677
  if (typeof r == "function")
3678
3678
  return r;
3679
3679
  switch (r.type) {
3680
3680
  case "straight":
3681
- return () => new zt({
3681
+ return () => new Ht({
3682
3682
  color: r.color,
3683
3683
  width: r.width,
3684
3684
  arrowLength: r.arrowLength,
@@ -3692,7 +3692,7 @@ const P = Object.freeze({
3692
3692
  detourDirection: r.detourDirection
3693
3693
  });
3694
3694
  case "horizontal":
3695
- return () => new Wt({
3695
+ return () => new kt({
3696
3696
  color: r.color,
3697
3697
  width: r.width,
3698
3698
  arrowLength: r.arrowLength,
@@ -3705,7 +3705,7 @@ const P = Object.freeze({
3705
3705
  detourDistance: r.detourDistance
3706
3706
  });
3707
3707
  case "vertical":
3708
- return () => new kt({
3708
+ return () => new Yt({
3709
3709
  color: r.color,
3710
3710
  width: r.width,
3711
3711
  arrowLength: r.arrowLength,
@@ -3718,7 +3718,7 @@ const P = Object.freeze({
3718
3718
  detourDistance: r.detourDistance
3719
3719
  });
3720
3720
  case "direct":
3721
- return () => new Xe({
3721
+ return () => new je({
3722
3722
  color: r.color,
3723
3723
  width: r.width,
3724
3724
  arrowLength: r.arrowLength,
@@ -3729,7 +3729,7 @@ const P = Object.freeze({
3729
3729
  targetOffset: r.targetOffset
3730
3730
  });
3731
3731
  default:
3732
- return () => new Ot({
3732
+ return () => new zt({
3733
3733
  color: r.color,
3734
3734
  width: r.width,
3735
3735
  arrowLength: r.arrowLength,
@@ -3743,7 +3743,7 @@ const P = Object.freeze({
3743
3743
  detourDirection: r.detourDirection
3744
3744
  });
3745
3745
  }
3746
- }, ir = (r) => {
3746
+ }, hr = (r) => {
3747
3747
  var u, l, g, p, w, y;
3748
3748
  const e = r.nodeDragVerifier ?? (() => !0), t = r.moveOnTop !== !1, o = r.moveEdgesOnTop !== !1 && t, s = (u = r.mouse) == null ? void 0 : u.dragCursor, n = s !== void 0 ? s : "grab", a = (l = r.mouse) == null ? void 0 : l.mouseDownEventVerifier, h = a !== void 0 ? a : (f) => f.button === 0, d = (g = r.mouse) == null ? void 0 : g.mouseUpEventVerifier, c = d !== void 0 ? d : (f) => f.button === 0;
3749
3749
  return {
@@ -3758,7 +3758,7 @@ const P = Object.freeze({
3758
3758
  nodeDragVerifier: e,
3759
3759
  onNodeDragFinished: ((y = r.events) == null ? void 0 : y.onNodeDragFinished) ?? N
3760
3760
  };
3761
- }, nr = (r) => {
3761
+ }, dr = (r) => {
3762
3762
  const e = r.minX !== null ? r.minX : -1 / 0, t = r.maxX !== null ? r.maxX : 1 / 0, o = r.minY !== null ? r.minY : -1 / 0, s = r.maxY !== null ? r.maxY : 1 / 0;
3763
3763
  return (n) => {
3764
3764
  let a = n.nextTransform.x, h = n.nextTransform.y;
@@ -3768,7 +3768,7 @@ const P = Object.freeze({
3768
3768
  const u = n.canvasHeight * n.prevTransform.scale, l = s - u;
3769
3769
  return h > l && h > n.prevTransform.y && (h = Math.max(n.prevTransform.y, l)), { scale: n.nextTransform.scale, x: a, y: h };
3770
3770
  };
3771
- }, ar = (r) => {
3771
+ }, cr = (r) => {
3772
3772
  const e = r.maxContentScale, t = r.minContentScale, o = e !== null ? 1 / e : 0, s = t !== null ? 1 / t : 1 / 0;
3773
3773
  return (n) => {
3774
3774
  const a = n.prevTransform, h = n.nextTransform;
@@ -3789,7 +3789,7 @@ const P = Object.freeze({
3789
3789
  y: u
3790
3790
  };
3791
3791
  };
3792
- }, hr = (r) => (e) => r.reduce(
3792
+ }, lr = (r) => (e) => r.reduce(
3793
3793
  (t, o) => o({
3794
3794
  prevTransform: e.prevTransform,
3795
3795
  nextTransform: t,
@@ -3797,32 +3797,32 @@ const P = Object.freeze({
3797
3797
  canvasHeight: e.canvasHeight
3798
3798
  }),
3799
3799
  e.nextTransform
3800
- ), Le = (r) => {
3800
+ ), Ie = (r) => {
3801
3801
  if (typeof r == "function")
3802
3802
  return r;
3803
3803
  switch (r.type) {
3804
3804
  case "scale-limit":
3805
- return ar({
3805
+ return cr({
3806
3806
  minContentScale: r.minContentScale ?? 0,
3807
3807
  maxContentScale: r.maxContentScale ?? 1 / 0
3808
3808
  });
3809
3809
  case "shift-limit":
3810
- return nr({
3810
+ return dr({
3811
3811
  minX: r.minX ?? -1 / 0,
3812
3812
  maxX: r.maxX ?? 1 / 0,
3813
3813
  minY: r.minY ?? -1 / 0,
3814
3814
  maxY: r.maxY ?? 1 / 0
3815
3815
  });
3816
3816
  }
3817
- }, Ve = (r) => {
3817
+ }, Fe = (r) => {
3818
3818
  var g, p, w, y, f, m, E, A, T, M, L, V;
3819
3819
  const e = (g = r == null ? void 0 : r.scale) == null ? void 0 : g.mouseWheelSensitivity, t = e !== void 0 ? e : 1.2, o = r == null ? void 0 : r.transformPreprocessor;
3820
3820
  let s;
3821
- o !== void 0 ? Array.isArray(o) ? s = hr(
3821
+ o !== void 0 ? Array.isArray(o) ? s = lr(
3822
3822
  o.map(
3823
- (D) => Le(D)
3823
+ (D) => Ie(D)
3824
3824
  )
3825
- ) : s = Le(o) : s = (D) => D.nextTransform;
3825
+ ) : s = Ie(o) : s = (D) => D.nextTransform;
3826
3826
  const n = ((p = r == null ? void 0 : r.shift) == null ? void 0 : p.cursor) !== void 0 ? r.shift.cursor : "grab", a = (w = r == null ? void 0 : r.shift) == null ? void 0 : w.mouseDownEventVerifier, h = a !== void 0 ? a : (D) => D.button === 0, d = (y = r == null ? void 0 : r.shift) == null ? void 0 : y.mouseUpEventVerifier, c = d !== void 0 ? d : (D) => D.button === 0, u = (f = r == null ? void 0 : r.scale) == null ? void 0 : f.mouseWheelEventVerifier, l = u !== void 0 ? u : () => !0;
3827
3827
  return {
3828
3828
  wheelSensitivity: t,
@@ -3839,17 +3839,17 @@ const P = Object.freeze({
3839
3839
  onResizeTransformStarted: ((L = r == null ? void 0 : r.events) == null ? void 0 : L.onResizeTransformStarted) ?? N,
3840
3840
  onResizeTransformFinished: ((V = r == null ? void 0 : r.events) == null ? void 0 : V.onResizeTransformFinished) ?? N
3841
3841
  };
3842
- }, dr = (r, e) => {
3842
+ }, ur = (r, e) => {
3843
3843
  const t = document.createElementNS(
3844
3844
  "http://www.w3.org/2000/svg",
3845
3845
  "circle"
3846
3846
  );
3847
3847
  return t.setAttribute("cx", "0"), t.setAttribute("cy", "0"), t.setAttribute("r", `${r}`), t.setAttribute("fill", `${e}`), t;
3848
- }, cr = (r) => r instanceof SVGElement ? r : dr(
3848
+ }, gr = (r) => r instanceof SVGElement ? r : ur(
3849
3849
  (r == null ? void 0 : r.radius) ?? 1.5,
3850
3850
  (r == null ? void 0 : r.color) ?? "#d8d8d8"
3851
- ), lr = (r) => {
3852
- const e = r.tileDimensions, t = (e == null ? void 0 : e.width) ?? 25, o = (e == null ? void 0 : e.height) ?? 25, s = cr(r.renderer ?? {});
3851
+ ), pr = (r) => {
3852
+ const e = r.tileDimensions, t = (e == null ? void 0 : e.width) ?? 25, o = (e == null ? void 0 : e.height) ?? 25, s = gr(r.renderer ?? {});
3853
3853
  return {
3854
3854
  tileWidth: t,
3855
3855
  tileHeight: o,
@@ -3861,18 +3861,18 @@ const P = Object.freeze({
3861
3861
  connectionPreprocessor: (r) => r,
3862
3862
  connectionAllowedVerifier: () => !0,
3863
3863
  mouseEventVerifier: (r) => r.button === 0
3864
- }), ur = (r, e, t) => {
3864
+ }), wr = (r, e, t) => {
3865
3865
  var s, n, a;
3866
3866
  const o = r.connectionAllowedVerifier ?? $.connectionAllowedVerifier;
3867
3867
  return {
3868
3868
  connectionTypeResolver: r.connectionTypeResolver ?? $.connectionTypeResolver,
3869
3869
  connectionAllowedVerifier: o,
3870
- draggingPortDirectionResolver: et(
3870
+ draggingPortDirectionResolver: rt(
3871
3871
  r.dragPortDirection,
3872
3872
  t,
3873
3873
  o
3874
3874
  ),
3875
- edgeShapeFactory: r.edgeShape !== void 0 ? ve(r.edgeShape) : e,
3875
+ edgeShapeFactory: r.edgeShape !== void 0 ? xe(r.edgeShape) : e,
3876
3876
  connectionPreprocessor: r.connectionPreprocessor ?? $.connectionPreprocessor,
3877
3877
  mouseDownEventVerifier: r.mouseDownEventVerifier ?? $.mouseEventVerifier,
3878
3878
  mouseUpEventVerifier: r.mouseUpEventVerifier ?? $.mouseEventVerifier,
@@ -3880,51 +3880,51 @@ const P = Object.freeze({
3880
3880
  onEdgeCreationInterrupted: ((n = r.events) == null ? void 0 : n.onEdgeCreationInterrupted) ?? N,
3881
3881
  onEdgeCreationPrevented: ((a = r.events) == null ? void 0 : a.onEdgeCreationPrevented) ?? N
3882
3882
  };
3883
- }, z = Object.freeze({
3883
+ }, H = Object.freeze({
3884
3884
  connectionAllowedVerifier: () => !0,
3885
3885
  connectionPreprocessor: (r) => r,
3886
3886
  // TODO: remove ctrl key
3887
3887
  mouseDownEventVerifier: (r) => r.button === 0 && r.ctrlKey,
3888
3888
  mouseUpEventVerifier: (r) => r.button === 0
3889
- }), gr = (r, e) => {
3889
+ }), yr = (r, e) => {
3890
3890
  var s, n, a;
3891
3891
  const t = (h) => {
3892
3892
  const d = e.getPortAdjacentEdgeIds(h);
3893
3893
  return d.length > 0 ? d[d.length - 1] : null;
3894
- }, o = r.connectionAllowedVerifier ?? z.connectionAllowedVerifier;
3894
+ }, o = r.connectionAllowedVerifier ?? H.connectionAllowedVerifier;
3895
3895
  return {
3896
- connectionPreprocessor: r.connectionPreprocessor ?? z.connectionPreprocessor,
3896
+ connectionPreprocessor: r.connectionPreprocessor ?? H.connectionPreprocessor,
3897
3897
  connectionAllowedVerifier: o,
3898
- mouseDownEventVerifier: r.mouseDownEventVerifier ?? z.mouseDownEventVerifier,
3899
- mouseUpEventVerifier: r.mouseUpEventVerifier ?? z.mouseUpEventVerifier,
3898
+ mouseDownEventVerifier: r.mouseDownEventVerifier ?? H.mouseDownEventVerifier,
3899
+ mouseUpEventVerifier: r.mouseUpEventVerifier ?? H.mouseUpEventVerifier,
3900
3900
  draggingEdgeResolver: r.draggingEdgeResolver ?? t,
3901
- draggingEdgeShapeFactory: r.draggingEdgeShape !== void 0 ? ve(r.draggingEdgeShape) : null,
3901
+ draggingEdgeShapeFactory: r.draggingEdgeShape !== void 0 ? xe(r.draggingEdgeShape) : null,
3902
3902
  onAfterEdgeReattached: ((s = r.events) == null ? void 0 : s.onAfterEdgeReattached) ?? N,
3903
3903
  onEdgeReattachInterrupted: ((n = r.events) == null ? void 0 : n.onEdgeReattachInterrupted) ?? N,
3904
3904
  onEdgeReattachPrevented: ((a = r.events) == null ? void 0 : a.onEdgeReattachPrevented) ?? N,
3905
- draggingPortDirectionResolver: et(
3905
+ draggingPortDirectionResolver: rt(
3906
3906
  r.dragPortDirection,
3907
3907
  e,
3908
3908
  o
3909
3909
  )
3910
3910
  };
3911
- }, pr = (r) => ({
3911
+ }, fr = (r) => ({
3912
3912
  nodeVerticalRadius: r.nodeContainingRadius.vertical,
3913
3913
  nodeHorizontalRadius: r.nodeContainingRadius.horizontal
3914
- }), wr = (r) => {
3914
+ }), vr = (r) => {
3915
3915
  var e, t;
3916
3916
  return {
3917
3917
  onAfterNodeDetached: ((e = r == null ? void 0 : r.events) == null ? void 0 : e.onAfterNodeDetached) ?? N,
3918
3918
  onBeforeNodeAttached: ((t = r == null ? void 0 : r.events) == null ? void 0 : t.onBeforeNodeAttached) ?? N
3919
3919
  };
3920
3920
  };
3921
- class yr extends Error {
3921
+ class mr extends Error {
3922
3922
  constructor() {
3923
3923
  super(...arguments);
3924
3924
  i(this, "name", "CanvasBuilderError");
3925
3925
  }
3926
3926
  }
3927
- class tt {
3927
+ class ot {
3928
3928
  constructor(e, t, o) {
3929
3929
  i(this, "dt");
3930
3930
  i(this, "nodeMass");
@@ -3962,7 +3962,7 @@ class tt {
3962
3962
  });
3963
3963
  }
3964
3964
  }
3965
- class rt {
3965
+ class st {
3966
3966
  constructor(e) {
3967
3967
  i(this, "PI2", 2 * Math.PI);
3968
3968
  this.rand = e;
@@ -3981,13 +3981,13 @@ class rt {
3981
3981
  return { ex: h, ey: d, d: a };
3982
3982
  }
3983
3983
  }
3984
- const ot = (r) => {
3984
+ const it = (r) => {
3985
3985
  if (r.distance === 0)
3986
3986
  return r.maxForce;
3987
3987
  const e = r.coefficient * (r.sourceCharge * r.targetCharge / (r.distance * r.distance));
3988
3988
  return Math.min(e, r.maxForce);
3989
3989
  };
3990
- class fr {
3990
+ class xr {
3991
3991
  constructor(e) {
3992
3992
  i(this, "nodeCharge");
3993
3993
  i(this, "distanceVectorGenerator");
@@ -4002,7 +4002,7 @@ class fr {
4002
4002
  const d = o[h], c = e.get(a), u = e.get(d), l = this.distanceVectorGenerator.create(
4003
4003
  c,
4004
4004
  u
4005
- ), g = ot({
4005
+ ), g = it({
4006
4006
  coefficient: 1,
4007
4007
  sourceCharge: this.nodeCharge,
4008
4008
  targetCharge: this.nodeCharge,
@@ -4014,7 +4014,7 @@ class fr {
4014
4014
  }
4015
4015
  }
4016
4016
  }
4017
- const vr = (r) => {
4017
+ const Er = (r) => {
4018
4018
  if (r.size === 0)
4019
4019
  return {
4020
4020
  centerX: 0,
@@ -4032,7 +4032,7 @@ const vr = (r) => {
4032
4032
  radius: h / 2
4033
4033
  };
4034
4034
  };
4035
- class mr {
4035
+ class Ar {
4036
4036
  constructor(e) {
4037
4037
  i(this, "root");
4038
4038
  i(this, "leaves", /* @__PURE__ */ new Map());
@@ -4189,7 +4189,7 @@ class mr {
4189
4189
  }), { x: t / e.size, y: o / e.size };
4190
4190
  }
4191
4191
  }
4192
- class xr {
4192
+ class Sr {
4193
4193
  constructor(e) {
4194
4194
  i(this, "areaRadiusThreshold");
4195
4195
  i(this, "nodeMass");
@@ -4201,7 +4201,7 @@ class xr {
4201
4201
  this.areaRadiusThreshold = e.areaRadiusThreshold, this.nodeMass = e.nodeMass, this.nodeCharge = e.nodeCharge, this.theta = e.theta, this.distanceVectorGenerator = e.distanceVectorGenerator, this.nodeForceCoefficient = e.nodeForceCoefficient, this.maxForce = e.maxForce;
4202
4202
  }
4203
4203
  apply(e, t) {
4204
- const o = vr(e), s = new mr({
4204
+ const o = Er(e), s = new Ar({
4205
4205
  box: o,
4206
4206
  coords: e,
4207
4207
  areaRadiusThreshold: this.areaRadiusThreshold,
@@ -4316,7 +4316,7 @@ class xr {
4316
4316
  const t = this.distanceVectorGenerator.create(
4317
4317
  e.sourceCoords,
4318
4318
  e.targetCoords
4319
- ), o = ot({
4319
+ ), o = it({
4320
4320
  coefficient: this.nodeForceCoefficient,
4321
4321
  sourceCharge: e.sourceCharge,
4322
4322
  targetCharge: e.targetCharge,
@@ -4351,7 +4351,7 @@ class xr {
4351
4351
  }
4352
4352
  }
4353
4353
  }
4354
- const st = (r) => r.theta !== 0 ? new xr({
4354
+ const nt = (r) => r.theta !== 0 ? new Sr({
4355
4355
  nodeCharge: r.nodeCharge,
4356
4356
  nodeForceCoefficient: r.nodeForceCoefficient,
4357
4357
  distanceVectorGenerator: r.distanceVectorGenerator,
@@ -4359,13 +4359,13 @@ const st = (r) => r.theta !== 0 ? new xr({
4359
4359
  theta: r.theta,
4360
4360
  nodeMass: r.nodeMass,
4361
4361
  areaRadiusThreshold: r.areaRadiusThreshold
4362
- }) : new fr({
4362
+ }) : new xr({
4363
4363
  nodeCharge: r.nodeCharge,
4364
4364
  nodeForceCoefficient: r.nodeForceCoefficient,
4365
4365
  distanceVectorGenerator: r.distanceVectorGenerator,
4366
4366
  maxForce: r.maxForce
4367
4367
  });
4368
- class it {
4368
+ class at {
4369
4369
  constructor(e) {
4370
4370
  i(this, "rand");
4371
4371
  i(this, "sparsity");
@@ -4388,7 +4388,7 @@ class it {
4388
4388
  }), s;
4389
4389
  }
4390
4390
  }
4391
- class Er {
4391
+ class br {
4392
4392
  constructor(e) {
4393
4393
  i(this, "distanceVectorGenerator");
4394
4394
  i(this, "nodeForcesApplicationStrategy");
@@ -4399,7 +4399,7 @@ class Er {
4399
4399
  i(this, "edgeEquilibriumLength");
4400
4400
  i(this, "edgeStiffness");
4401
4401
  i(this, "convergenceVelocity");
4402
- this.maxIterations = e.maxIterations, this.dtSec = e.dtSec, this.nodeMass = e.nodeMass, this.edgeEquilibriumLength = e.edgeEquilibriumLength, this.edgeStiffness = e.edgeStiffness, this.convergenceVelocity = e.convergenceVelocity, this.distanceVectorGenerator = new rt(e.rand), this.nodeForcesApplicationStrategy = st({
4402
+ this.maxIterations = e.maxIterations, this.dtSec = e.dtSec, this.nodeMass = e.nodeMass, this.edgeEquilibriumLength = e.edgeEquilibriumLength, this.edgeStiffness = e.edgeStiffness, this.convergenceVelocity = e.convergenceVelocity, this.distanceVectorGenerator = new st(e.rand), this.nodeForcesApplicationStrategy = nt({
4403
4403
  distanceVectorGenerator: this.distanceVectorGenerator,
4404
4404
  nodeCharge: e.nodeCharge,
4405
4405
  maxForce: e.maxForce,
@@ -4407,7 +4407,7 @@ class Er {
4407
4407
  theta: e.barnesHutTheta,
4408
4408
  areaRadiusThreshold: e.barnesHutAreaRadiusThreshold,
4409
4409
  nodeMass: e.nodeMass
4410
- }), this.fillerLayoutAlgorithm = new it({
4410
+ }), this.fillerLayoutAlgorithm = new at({
4411
4411
  rand: e.rand,
4412
4412
  sparsity: e.edgeEquilibriumLength
4413
4413
  });
@@ -4417,7 +4417,7 @@ class Er {
4417
4417
  graph: t,
4418
4418
  viewport: o
4419
4419
  });
4420
- for (let n = 0; n < this.maxIterations && !(new tt(
4420
+ for (let n = 0; n < this.maxIterations && !(new ot(
4421
4421
  t,
4422
4422
  s,
4423
4423
  {
@@ -4433,7 +4433,7 @@ class Er {
4433
4433
  return s;
4434
4434
  }
4435
4435
  }
4436
- class Ar {
4436
+ class Pr {
4437
4437
  constructor(e, t) {
4438
4438
  i(this, "forest", /* @__PURE__ */ new Set());
4439
4439
  i(this, "remainingNodeIds");
@@ -4474,7 +4474,7 @@ class Ar {
4474
4474
  }
4475
4475
  }
4476
4476
  }
4477
- class Sr {
4477
+ class Nr {
4478
4478
  constructor(e) {
4479
4479
  this.params = e;
4480
4480
  }
@@ -4515,12 +4515,12 @@ class Sr {
4515
4515
  return o - 2 * this.params.spaceAroundRadius;
4516
4516
  }
4517
4517
  }
4518
- class br {
4518
+ class Cr {
4519
4519
  constructor(e, t) {
4520
4520
  i(this, "offsets", /* @__PURE__ */ new Map());
4521
4521
  i(this, "treeSpans", /* @__PURE__ */ new Map());
4522
4522
  this.tree = e;
4523
- const o = t.spaceAroundRadius, s = new Sr({
4523
+ const o = t.spaceAroundRadius, s = new Nr({
4524
4524
  spaceAroundRadius: o
4525
4525
  });
4526
4526
  [...this.tree.sequence].reverse().forEach((n) => {
@@ -4542,19 +4542,19 @@ class br {
4542
4542
  return this.offsets;
4543
4543
  }
4544
4544
  }
4545
- class Pr {
4545
+ class Tr {
4546
4546
  constructor(e) {
4547
4547
  this.params = e;
4548
4548
  }
4549
4549
  calculateCoordinates(e) {
4550
- const t = /* @__PURE__ */ new Map(), s = new Ar(
4550
+ const t = /* @__PURE__ */ new Map(), s = new Pr(
4551
4551
  e.graph,
4552
4552
  this.params.nextLayerNodesResolver
4553
4553
  ).generate();
4554
4554
  let n = 0;
4555
4555
  return s.forEach((a) => {
4556
4556
  t.set(a.root.nodeId, { x: n, y: 0 });
4557
- const d = new br(a, {
4557
+ const d = new Cr(a, {
4558
4558
  spaceAroundRadius: this.params.layerSpace / 2
4559
4559
  }).generate();
4560
4560
  let c = [a.root];
@@ -4575,7 +4575,7 @@ class Pr {
4575
4575
  }), t;
4576
4576
  }
4577
4577
  }
4578
- const Nr = (r) => {
4578
+ const Mr = (r) => {
4579
4579
  const { graph: e, currentNodeId: t } = r, o = e.getNodeOutgoingEdgeIds(t).map((n) => {
4580
4580
  const a = e.getEdge(n);
4581
4581
  return e.getPort(a.to).nodeId;
@@ -4584,20 +4584,20 @@ const Nr = (r) => {
4584
4584
  return e.getPort(a.from).nodeId;
4585
4585
  });
4586
4586
  return /* @__PURE__ */ new Set([...o, ...s]);
4587
- }, Cr = (r) => {
4587
+ }, Dr = (r) => {
4588
4588
  const { graph: e, currentNodeId: t } = r, o = e.getNodeOutgoingEdgeIds(t).map((s) => {
4589
4589
  const n = e.getEdge(s);
4590
4590
  return e.getPort(n.to).nodeId;
4591
4591
  });
4592
4592
  return new Set(o);
4593
- }, Tr = (r) => {
4593
+ }, Rr = (r) => {
4594
4594
  const { graph: e, currentNodeId: t } = r, o = e.getNodeIncomingEdgeIds(t).map((s) => {
4595
4595
  const n = e.getEdge(s);
4596
4596
  return e.getPort(n.from).nodeId;
4597
4597
  });
4598
4598
  return new Set(o);
4599
4599
  };
4600
- class Mr {
4600
+ class Lr {
4601
4601
  constructor(e) {
4602
4602
  i(this, "distanceVectorGenerator");
4603
4603
  i(this, "nodeForcesApplicationStrategy");
@@ -4607,7 +4607,7 @@ class Mr {
4607
4607
  i(this, "edgeEquilibriumLength");
4608
4608
  i(this, "edgeStiffness");
4609
4609
  i(this, "fillerLayoutAlgorithm");
4610
- this.convergenceVelocity = e.convergenceVelocity, this.maxTimeDeltaSec = e.maxTimeDeltaSec, this.nodeMass = e.nodeMass, this.edgeEquilibriumLength = e.edgeEquilibriumLength, this.edgeStiffness = e.edgeStiffness, this.distanceVectorGenerator = new rt(e.rand), this.nodeForcesApplicationStrategy = st({
4610
+ this.convergenceVelocity = e.convergenceVelocity, this.maxTimeDeltaSec = e.maxTimeDeltaSec, this.nodeMass = e.nodeMass, this.edgeEquilibriumLength = e.edgeEquilibriumLength, this.edgeStiffness = e.edgeStiffness, this.distanceVectorGenerator = new st(e.rand), this.nodeForcesApplicationStrategy = nt({
4611
4611
  distanceVectorGenerator: this.distanceVectorGenerator,
4612
4612
  nodeCharge: e.nodeCharge,
4613
4613
  maxForce: e.maxForce,
@@ -4615,7 +4615,7 @@ class Mr {
4615
4615
  theta: e.barnesHutTheta,
4616
4616
  areaRadiusThreshold: e.barnesHutAreaRadiusThreshold,
4617
4617
  nodeMass: e.nodeMass
4618
- }), this.fillerLayoutAlgorithm = new it({
4618
+ }), this.fillerLayoutAlgorithm = new at({
4619
4619
  rand: e.rand,
4620
4620
  sparsity: e.edgeEquilibriumLength
4621
4621
  });
@@ -4625,7 +4625,7 @@ class Mr {
4625
4625
  graph: t,
4626
4626
  viewport: o
4627
4627
  });
4628
- return new tt(
4628
+ return new ot(
4629
4629
  t,
4630
4630
  n,
4631
4631
  {
@@ -4642,23 +4642,23 @@ class Mr {
4642
4642
  }) ? /* @__PURE__ */ new Map() : n;
4643
4643
  }
4644
4644
  }
4645
- const nt = (r) => {
4645
+ const ht = (r) => {
4646
4646
  let e = 1779033703, t = 3144134277, o = 1013904242, s = 2773480762;
4647
4647
  for (let n = 0, a; n < r.length; n++)
4648
4648
  a = r.charCodeAt(n), e = t ^ Math.imul(e ^ a, 597399067), t = o ^ Math.imul(t ^ a, 2869860233), o = s ^ Math.imul(o ^ a, 951274213), s = e ^ Math.imul(s ^ a, 2716044179);
4649
4649
  return e = Math.imul(o ^ e >>> 18, 597399067), t = Math.imul(s ^ t >>> 22, 2869860233), o = Math.imul(e ^ o >>> 17, 951274213), s = Math.imul(t ^ s >>> 19, 2716044179), e ^= t ^ o ^ s, t ^= e, o ^= e, s ^= e, [e >>> 0, t >>> 0, o >>> 0, s >>> 0];
4650
- }, at = (r, e, t, o) => function() {
4650
+ }, dt = (r, e, t, o) => function() {
4651
4651
  r |= 0, e |= 0, t |= 0, o |= 0;
4652
4652
  const s = (r + e | 0) + o | 0;
4653
4653
  return o = o + 1 | 0, r = e ^ e >>> 9, e = t + (t << 3) | 0, t = t << 21 | t >>> 11, t = t + s | 0, (s >>> 0) / 4294967296;
4654
- }, Dr = (r) => {
4654
+ }, Vr = (r) => {
4655
4655
  var e, t;
4656
4656
  switch (r == null ? void 0 : r.type) {
4657
4657
  case "custom":
4658
4658
  return r.instance;
4659
4659
  default: {
4660
- const o = nt((r == null ? void 0 : r.seed) ?? P.seed), s = at(o[0], o[1], o[2], o[3]);
4661
- return new Mr({
4660
+ const o = ht((r == null ? void 0 : r.seed) ?? P.seed), s = dt(o[0], o[1], o[2], o[3]);
4661
+ return new Lr({
4662
4662
  rand: s,
4663
4663
  maxTimeDeltaSec: (r == null ? void 0 : r.maxTimeDeltaSec) ?? P.maxTimeDeltaSec,
4664
4664
  nodeCharge: (r == null ? void 0 : r.nodeCharge) ?? P.nodeCharge,
@@ -4674,42 +4674,42 @@ const nt = (r) => {
4674
4674
  });
4675
4675
  }
4676
4676
  }
4677
- }, Rr = {
4677
+ }, Ir = {
4678
4678
  staticNodeResolver: () => !1
4679
- }, Lr = (r) => {
4679
+ }, Fr = (r) => {
4680
4680
  var t, o;
4681
4681
  return {
4682
- algorithm: Dr((r == null ? void 0 : r.algorithm) ?? {}),
4683
- staticNodeResolver: (r == null ? void 0 : r.staticNodeResolver) ?? Rr.staticNodeResolver,
4682
+ algorithm: Vr((r == null ? void 0 : r.algorithm) ?? {}),
4683
+ staticNodeResolver: (r == null ? void 0 : r.staticNodeResolver) ?? Ir.staticNodeResolver,
4684
4684
  onBeforeApplied: ((t = r == null ? void 0 : r.events) == null ? void 0 : t.onBeforeApplied) ?? N,
4685
4685
  onAfterApplied: ((o = r == null ? void 0 : r.events) == null ? void 0 : o.onAfterApplied) ?? N
4686
4686
  };
4687
- }, Vr = (r) => r instanceof q ? {
4687
+ }, Ur = (r) => r instanceof te ? {
4688
4688
  type: "trigger",
4689
4689
  trigger: r
4690
4690
  } : r === "topologyChangeMicrotask" ? {
4691
4691
  type: "topologyChangeSchedule",
4692
- schedule: Me
4692
+ schedule: Re
4693
4693
  } : (r == null ? void 0 : r.type) === "topologyChangeMacrotask" ? {
4694
4694
  type: "topologyChangeSchedule",
4695
- schedule: Gt
4695
+ schedule: Kt
4696
4696
  } : {
4697
4697
  type: "topologyChangeSchedule",
4698
- schedule: Me
4699
- }, Z = Object.freeze({
4698
+ schedule: Re
4699
+ }, q = Object.freeze({
4700
4700
  staticNodeResolver: () => !1,
4701
4701
  hierarchicalLayout: {
4702
4702
  layerWidth: 300,
4703
4703
  layerSpace: 300
4704
4704
  }
4705
- }), k = (r, e) => ({
4705
+ }), Y = (r, e) => ({
4706
4706
  a: r.a * e.a + r.b * e.d,
4707
4707
  b: r.a * e.b + r.b * e.e,
4708
4708
  c: r.a * e.c + r.b * e.f + r.c,
4709
4709
  d: r.d * e.a + r.e * e.d,
4710
4710
  e: r.d * e.b + r.e * e.e,
4711
4711
  f: r.d * e.c + r.e * e.f + r.f
4712
- }), Ir = (r) => {
4712
+ }), $r = (r) => {
4713
4713
  const { a: e, b: t, c: o, d: s, e: n, f: a } = r, h = e * n - t * s;
4714
4714
  return {
4715
4715
  a: n / h,
@@ -4720,7 +4720,7 @@ const nt = (r) => {
4720
4720
  f: (o * s - e * a) / h
4721
4721
  };
4722
4722
  };
4723
- class Fr {
4723
+ class Br {
4724
4724
  resolve(e) {
4725
4725
  if ("shift" in e)
4726
4726
  return this.createShiftBaseMatrix(e.shift);
@@ -4754,18 +4754,18 @@ class Fr {
4754
4754
  return this.createRelativeTransform(o, s);
4755
4755
  }
4756
4756
  createMirrorRelativeMatrix(e, t) {
4757
- const o = this.createMirrorYBaseMatrix(), s = k(
4757
+ const o = this.createMirrorYBaseMatrix(), s = Y(
4758
4758
  this.createShiftBaseMatrix(t),
4759
4759
  this.createRotateBaseMatrix(e)
4760
4760
  );
4761
4761
  return this.createRelativeTransform(o, s);
4762
4762
  }
4763
4763
  createRelativeTransform(e, t) {
4764
- const o = k(
4764
+ const o = Y(
4765
4765
  t,
4766
4766
  e
4767
- ), s = Ir(t);
4768
- return k(o, s);
4767
+ ), s = $r(t);
4768
+ return Y(o, s);
4769
4769
  }
4770
4770
  createShiftBaseMatrix(e) {
4771
4771
  return {
@@ -4809,7 +4809,7 @@ class Fr {
4809
4809
  };
4810
4810
  }
4811
4811
  }
4812
- const Ur = (r) => {
4812
+ const Or = (r) => {
4813
4813
  if (r === void 0)
4814
4814
  return (s) => s;
4815
4815
  if (typeof r == "function")
@@ -4823,10 +4823,10 @@ const Ur = (r) => {
4823
4823
  e: 1,
4824
4824
  f: 0
4825
4825
  };
4826
- const o = new Fr();
4826
+ const o = new Br();
4827
4827
  return e.forEach((s) => {
4828
4828
  const n = o.resolve(s);
4829
- t = k(t, n);
4829
+ t = Y(t, n);
4830
4830
  }), (s) => {
4831
4831
  const { x: n, y: a } = s;
4832
4832
  return {
@@ -4834,34 +4834,34 @@ const Ur = (r) => {
4834
4834
  y: t.d * n + t.e * a + t.f
4835
4835
  };
4836
4836
  };
4837
- }, $r = (r) => {
4837
+ }, Wr = (r) => {
4838
4838
  if (typeof r == "function")
4839
4839
  return r;
4840
4840
  switch (r) {
4841
4841
  case "outgoing":
4842
- return Cr;
4842
+ return Dr;
4843
4843
  case "incoming":
4844
- return Tr;
4844
+ return Rr;
4845
4845
  default:
4846
- return Nr;
4846
+ return Mr;
4847
4847
  }
4848
- }, Br = (r) => {
4848
+ }, zr = (r) => {
4849
4849
  var e, t;
4850
4850
  switch (r == null ? void 0 : r.type) {
4851
4851
  case "custom":
4852
4852
  return r.instance;
4853
4853
  case "hierarchical":
4854
- return new Pr({
4855
- layerWidth: r.layerWidth ?? Z.hierarchicalLayout.layerWidth,
4856
- layerSpace: r.layerSpace ?? Z.hierarchicalLayout.layerSpace,
4857
- transform: Ur(r.transform),
4858
- nextLayerNodesResolver: $r(
4854
+ return new Tr({
4855
+ layerWidth: r.layerWidth ?? q.hierarchicalLayout.layerWidth,
4856
+ layerSpace: r.layerSpace ?? q.hierarchicalLayout.layerSpace,
4857
+ transform: Or(r.transform),
4858
+ nextLayerNodesResolver: Wr(
4859
4859
  r.nextLayerNodesResolver
4860
4860
  )
4861
4861
  });
4862
4862
  default: {
4863
- const o = nt((r == null ? void 0 : r.seed) ?? P.seed), s = at(o[0], o[1], o[2], o[3]);
4864
- return new Er({
4863
+ const o = ht((r == null ? void 0 : r.seed) ?? P.seed), s = dt(o[0], o[1], o[2], o[3]);
4864
+ return new br({
4865
4865
  dtSec: (r == null ? void 0 : r.dtSec) ?? P.dtSec,
4866
4866
  maxIterations: (r == null ? void 0 : r.maxIterations) ?? P.maxIterations,
4867
4867
  rand: s,
@@ -4877,16 +4877,16 @@ const Ur = (r) => {
4877
4877
  });
4878
4878
  }
4879
4879
  }
4880
- }, Or = (r) => {
4880
+ }, kr = (r) => {
4881
4881
  var e, t;
4882
4882
  return {
4883
- algorithm: Br(r.algorithm),
4884
- applyOn: Vr(r.applyOn),
4885
- staticNodeResolver: r.staticNodeResolver ?? Z.staticNodeResolver,
4883
+ algorithm: zr(r.algorithm),
4884
+ applyOn: Ur(r.applyOn),
4885
+ staticNodeResolver: r.staticNodeResolver ?? q.staticNodeResolver,
4886
4886
  onBeforeApplied: ((e = r.events) == null ? void 0 : e.onBeforeApplied) ?? N,
4887
4887
  onAfterApplied: ((t = r.events) == null ? void 0 : t.onAfterApplied) ?? N
4888
4888
  };
4889
- }, Wr = (r, e) => ({
4889
+ }, Hr = (r, e) => ({
4890
4890
  ...r,
4891
4891
  onNodeDragStarted: (t) => {
4892
4892
  e.add(t), r.onNodeDragStarted(t);
@@ -4894,7 +4894,7 @@ const Ur = (r) => {
4894
4894
  onNodeDragFinished: (t) => {
4895
4895
  e.delete(t), r.onNodeDragFinished(t);
4896
4896
  }
4897
- }), zr = (r, e) => {
4897
+ }), Yr = (r, e) => {
4898
4898
  r.graph.onBeforeNodeRemoved.subscribe((t) => {
4899
4899
  e.delete(t);
4900
4900
  }), r.graph.onBeforeClear.subscribe(() => {
@@ -4902,41 +4902,41 @@ const Ur = (r) => {
4902
4902
  }), r.onBeforeDestroy.subscribe(() => {
4903
4903
  e.clear();
4904
4904
  });
4905
- }, kr = (r, e) => ({
4905
+ }, Xr = (r, e) => ({
4906
4906
  ...r,
4907
4907
  staticNodeResolver: (t) => r.staticNodeResolver(t) || e.has(t)
4908
- }), _ = (r) => () => r, Ie = _(0), Hr = () => {
4908
+ }), ee = (r) => () => r, Ue = ee(0), Gr = () => {
4909
4909
  let r = 0;
4910
4910
  return () => r++;
4911
- }, Yr = (r, e) => {
4912
- let t = Ie, o = Ie;
4913
- const s = Hr();
4914
- return r === "incremental" && (t = s), e === "incremental" && (o = s), typeof r == "number" && (t = _(r)), typeof e == "number" && (o = _(e)), typeof r == "function" && (t = r), typeof e == "function" && (o = e), {
4911
+ }, jr = (r, e) => {
4912
+ let t = Ue, o = Ue;
4913
+ const s = Gr();
4914
+ return r === "incremental" && (t = s), e === "incremental" && (o = s), typeof r == "number" && (t = ee(r)), typeof e == "number" && (o = ee(e)), typeof r == "function" && (t = r), typeof e == "function" && (o = e), {
4915
4915
  nodesPriorityFn: t,
4916
4916
  edgesPriorityFn: o
4917
4917
  };
4918
- }, Xr = (r) => {
4918
+ }, Jr = (r) => {
4919
4919
  var t, o, s, n, a;
4920
- const e = Yr(
4920
+ const e = jr(
4921
4921
  (t = r.nodes) == null ? void 0 : t.priority,
4922
4922
  (o = r.edges) == null ? void 0 : o.priority
4923
4923
  );
4924
4924
  return {
4925
4925
  nodes: {
4926
- centerFn: ((s = r.nodes) == null ? void 0 : s.centerFn) ?? We,
4926
+ centerFn: ((s = r.nodes) == null ? void 0 : s.centerFn) ?? ke,
4927
4927
  priorityFn: e.nodesPriorityFn
4928
4928
  },
4929
4929
  ports: {
4930
4930
  direction: ((n = r.ports) == null ? void 0 : n.direction) ?? 0
4931
4931
  },
4932
4932
  edges: {
4933
- shapeFactory: ve(((a = r.edges) == null ? void 0 : a.shape) ?? {}),
4933
+ shapeFactory: xe(((a = r.edges) == null ? void 0 : a.shape) ?? {}),
4934
4934
  priorityFn: e.edgesPriorityFn
4935
4935
  }
4936
4936
  };
4937
- }, Gr = (r) => r.applyOn.type === "topologyChangeSchedule" ? r.applyOn.schedule : oe, jr = (r) => {
4937
+ }, Kr = (r) => r.applyOn.type === "topologyChangeSchedule" ? r.applyOn.schedule : ie, Qr = (r) => {
4938
4938
  var o, s, n, a;
4939
- const { canvasDefaults: e } = r, t = r.hasLayout ? Gr(r.layoutParams) : oe;
4939
+ const { canvasDefaults: e } = r, t = r.hasLayout ? Kr(r.layoutParams) : ie;
4940
4940
  return {
4941
4941
  focus: {
4942
4942
  contentPadding: ((o = e.focus) == null ? void 0 : o.contentPadding) ?? ((s = e.focus) == null ? void 0 : s.contentOffset) ?? 100,
@@ -4945,23 +4945,23 @@ const Ur = (r) => {
4945
4945
  animationDuration: ((a = e.focus) == null ? void 0 : a.animationDuration) ?? 0
4946
4946
  }
4947
4947
  };
4948
- }, Jr = (r) => ({
4948
+ }, Zr = (r) => ({
4949
4949
  onNodeSelected: r.onNodeSelected,
4950
4950
  mouseDownEventVerifier: r.mouseDownEventVerifier ?? I.mouseDownEventVerifier,
4951
4951
  mouseUpEventVerifier: r.mouseUpEventVerifier ?? I.mouseUpEventVerifier,
4952
4952
  movementThreshold: r.movementThreshold ?? I.movementThreshold
4953
- }), Kr = (r) => ({
4953
+ }), _r = (r) => ({
4954
4954
  onCanvasSelected: r.onCanvasSelected,
4955
4955
  mouseDownEventVerifier: r.mouseDownEventVerifier ?? I.mouseDownEventVerifier,
4956
4956
  mouseUpEventVerifier: r.mouseUpEventVerifier ?? I.mouseUpEventVerifier,
4957
4957
  movementThreshold: r.movementThreshold ?? I.movementThreshold
4958
- }), Qr = (r) => ({
4958
+ }), qr = (r) => ({
4959
4959
  onEdgeSelected: r.onEdgeSelected,
4960
4960
  mouseDownEventVerifier: r.mouseDownEventVerifier ?? I.mouseDownEventVerifier,
4961
4961
  mouseUpEventVerifier: r.mouseUpEventVerifier ?? I.mouseUpEventVerifier,
4962
4962
  movementThreshold: r.movementThreshold ?? I.movementThreshold
4963
4963
  });
4964
- class eo {
4964
+ class ro {
4965
4965
  constructor(e) {
4966
4966
  i(this, "used", !1);
4967
4967
  i(this, "canvasDefaults", {});
@@ -4984,12 +4984,12 @@ class eo {
4984
4984
  i(this, "hasUserDraggableEdges", !1);
4985
4985
  i(this, "hasAnimatedLayout", !1);
4986
4986
  i(this, "hasLayout", !1);
4987
- i(this, "boxRenderingTrigger", new q());
4987
+ i(this, "boxRenderingTrigger", new te());
4988
4988
  i(this, "window", window);
4989
4989
  i(this, "animationStaticNodes", /* @__PURE__ */ new Set());
4990
4990
  i(this, "pointInsideVerifier");
4991
- i(this, "eventTagger", new Jt());
4992
- this.element = e, this.pointInsideVerifier = new Et(e, this.window);
4991
+ i(this, "eventTagger", new Zt());
4992
+ this.element = e, this.pointInsideVerifier = new St(e, this.window);
4993
4993
  }
4994
4994
  setDefaults(e) {
4995
4995
  return this.canvasDefaults = e, this;
@@ -5032,44 +5032,44 @@ class eo {
5032
5032
  }
5033
5033
  build() {
5034
5034
  if (this.used)
5035
- throw new yr(
5035
+ throw new mr(
5036
5036
  "Failed to build Canvas because CanvasBuilder is a single-use object"
5037
5037
  );
5038
5038
  this.used = !0;
5039
- const e = new vt(this.element), t = new $e(), o = new sr(this.element), s = this.createHtmlView(
5039
+ const e = new xt(this.element), t = new Oe(), o = new ar(this.element), s = this.createHtmlView(
5040
5040
  o.main,
5041
5041
  t,
5042
5042
  e
5043
- ), n = Xr(
5043
+ ), n = Jr(
5044
5044
  this.canvasDefaults
5045
- ), a = new Je(
5045
+ ), a = new Qe(
5046
5046
  t,
5047
5047
  s,
5048
5048
  n
5049
- ), h = Or(this.layoutConfig), d = jr({
5049
+ ), h = kr(this.layoutConfig), d = Qr({
5050
5050
  canvasDefaults: this.canvasDefaults,
5051
5051
  hasLayout: this.hasLayout,
5052
5052
  layoutParams: h
5053
- }), c = new _e(
5053
+ }), c = new et(
5054
5054
  t,
5055
5055
  e,
5056
5056
  d,
5057
5057
  this.window
5058
- ), u = new Ke(e), l = new je(t), g = new Ue(
5058
+ ), u = new Ze(e), l = new Ke(t), g = new Be(
5059
5059
  l,
5060
5060
  u,
5061
5061
  a,
5062
5062
  c
5063
5063
  );
5064
- if (this.hasBackground && de.configure(
5064
+ if (this.hasBackground && le.configure(
5065
5065
  g,
5066
- lr(this.backgroundConfig),
5066
+ pr(this.backgroundConfig),
5067
5067
  o.background
5068
- ), this.hasNodeResizeReactiveEdges && ee.configure(g), this.userSelectableEdgesConfig !== void 0) {
5069
- const p = Qr(
5068
+ ), this.hasNodeResizeReactiveEdges && re.configure(g), this.userSelectableEdgesConfig !== void 0) {
5069
+ const p = qr(
5070
5070
  this.userSelectableEdgesConfig
5071
5071
  );
5072
- ye.configure(
5072
+ ve.configure(
5073
5073
  g,
5074
5074
  this.window,
5075
5075
  this.pointInsideVerifier,
@@ -5078,10 +5078,10 @@ class eo {
5078
5078
  );
5079
5079
  }
5080
5080
  if (this.userSelectableNodesConfig !== void 0) {
5081
- const p = Jr(
5081
+ const p = Zr(
5082
5082
  this.userSelectableNodesConfig
5083
5083
  );
5084
- we.configure(
5084
+ fe.configure(
5085
5085
  g,
5086
5086
  this.window,
5087
5087
  this.pointInsideVerifier,
@@ -5090,10 +5090,10 @@ class eo {
5090
5090
  );
5091
5091
  }
5092
5092
  if (this.userSelectableCanvasConfig !== void 0) {
5093
- const p = Kr(
5093
+ const p = _r(
5094
5094
  this.userSelectableCanvasConfig
5095
5095
  );
5096
- fe.configure(
5096
+ me.configure(
5097
5097
  g,
5098
5098
  o.main,
5099
5099
  this.window,
@@ -5103,11 +5103,11 @@ class eo {
5103
5103
  );
5104
5104
  }
5105
5105
  if (this.hasDraggableNodes) {
5106
- let p = ir(this.dragConfig);
5107
- this.hasAnimatedLayout && (p = Wr(
5106
+ let p = hr(this.dragConfig);
5107
+ this.hasAnimatedLayout && (p = Hr(
5108
5108
  p,
5109
5109
  this.animationStaticNodes
5110
- )), ae.configure(
5110
+ )), de.configure(
5111
5111
  g,
5112
5112
  o.main,
5113
5113
  this.window,
@@ -5116,12 +5116,12 @@ class eo {
5116
5116
  );
5117
5117
  }
5118
5118
  if (this.hasUserConnectablePorts) {
5119
- const p = ur(
5119
+ const p = wr(
5120
5120
  this.connectablePortsConfig,
5121
5121
  n.edges.shapeFactory,
5122
5122
  g.graph
5123
5123
  );
5124
- ce.configure(
5124
+ ue.configure(
5125
5125
  g,
5126
5126
  o.overlayConnectablePorts,
5127
5127
  e,
@@ -5131,11 +5131,11 @@ class eo {
5131
5131
  );
5132
5132
  }
5133
5133
  if (this.hasUserDraggableEdges) {
5134
- const p = gr(
5134
+ const p = yr(
5135
5135
  this.draggableEdgesConfig,
5136
5136
  g.graph
5137
5137
  );
5138
- le.configure(
5138
+ ge.configure(
5139
5139
  g,
5140
5140
  o.overlayDraggableEdges,
5141
5141
  e,
@@ -5144,57 +5144,57 @@ class eo {
5144
5144
  p
5145
5145
  );
5146
5146
  }
5147
- if (this.virtualScrollConfig !== void 0 ? he.configure(
5147
+ if (this.virtualScrollConfig !== void 0 ? ce.configure(
5148
5148
  g,
5149
5149
  o.main,
5150
5150
  this.window,
5151
- Ve(this.transformConfig),
5151
+ Fe(this.transformConfig),
5152
5152
  this.boxRenderingTrigger,
5153
5153
  this.pointInsideVerifier,
5154
- pr(this.virtualScrollConfig)
5155
- ) : this.hasTransformableViewport && J.configure(
5154
+ fr(this.virtualScrollConfig)
5155
+ ) : this.hasTransformableViewport && Q.configure(
5156
5156
  g,
5157
5157
  o.main,
5158
5158
  this.window,
5159
5159
  this.pointInsideVerifier,
5160
- Ve(this.transformConfig)
5161
- ), this.hasLayout && er.configure(g, h), this.hasAnimatedLayout) {
5162
- let p = Lr(this.animatedLayoutConfig);
5163
- this.hasDraggableNodes && (zr(
5160
+ Fe(this.transformConfig)
5161
+ ), this.hasLayout && or.configure(g, h), this.hasAnimatedLayout) {
5162
+ let p = Fr(this.animatedLayoutConfig);
5163
+ this.hasDraggableNodes && (Yr(
5164
5164
  g,
5165
5165
  this.animationStaticNodes
5166
- ), p = kr(
5166
+ ), p = Xr(
5167
5167
  p,
5168
5168
  this.animationStaticNodes
5169
- )), pe.configure(g, p, this.window);
5169
+ )), ye.configure(g, p, this.window);
5170
5170
  }
5171
5171
  return g.onBeforeDestroy.subscribe(() => {
5172
5172
  o.destroy();
5173
5173
  }), g;
5174
5174
  }
5175
5175
  createHtmlView(e, t, o) {
5176
- let s = new Fe(t, o, e);
5177
- return this.virtualScrollConfig !== void 0 && (s = new wt(
5176
+ let s = new $e(t, o, e);
5177
+ return this.virtualScrollConfig !== void 0 && (s = new ft(
5178
5178
  s,
5179
5179
  t,
5180
5180
  this.boxRenderingTrigger,
5181
- wr(this.virtualScrollConfig)
5182
- )), s = new yt(s, t), s;
5181
+ vr(this.virtualScrollConfig)
5182
+ )), s = new vt(s, t), s;
5183
5183
  }
5184
5184
  }
5185
5185
  export {
5186
- Ot as BezierEdgeShape,
5187
- eo as CanvasBuilder,
5188
- yr as CanvasBuilderError,
5186
+ zt as BezierEdgeShape,
5187
+ ro as CanvasBuilder,
5188
+ mr as CanvasBuilderError,
5189
5189
  S as CanvasError,
5190
5190
  U as ConnectionCategory,
5191
- Xe as DirectEdgeShape,
5192
- q as EventSubject,
5193
- Wt as HorizontalEdgeShape,
5194
- Xt as InteractiveEdgeError,
5195
- Ge as InteractiveEdgeShape,
5196
- qr as MidpointEdgeShape,
5197
- zt as StraightEdgeShape,
5198
- kt as VerticalEdgeShape,
5199
- _r as boxPortOffsetFn
5191
+ je as DirectEdgeShape,
5192
+ te as EventSubject,
5193
+ kt as HorizontalEdgeShape,
5194
+ Jt as InteractiveEdgeError,
5195
+ Je as InteractiveEdgeShape,
5196
+ to as MidpointEdgeShape,
5197
+ Ht as StraightEdgeShape,
5198
+ Yt as VerticalEdgeShape,
5199
+ Xt as boxPortOffsetFn
5200
5200
  };