@html-graph/html-graph 8.23.0 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -35,7 +35,7 @@ var e = /* @__PURE__ */ function(e) {
35
35
  i(t.element), this.container.removeChild(t.element), this.attachedNodeIds.delete(e);
36
36
  }
37
37
  attachEdge(e) {
38
- let t = this.graphStore.getEdge(e).payload.shape.svg;
38
+ let t = this.graphStore.getEdge(e).payload.shape.element;
39
39
  this.edgeIdToElementMap.set(e, t), this.container.appendChild(t), this.renderEdge(e), this.updateEdgePriority(e);
40
40
  }
41
41
  detachEdge(e) {
@@ -63,7 +63,7 @@ var e = /* @__PURE__ */ function(e) {
63
63
  updateEdgeShape(e) {
64
64
  let t = this.edgeIdToElementMap.get(e);
65
65
  this.container.removeChild(t);
66
- let n = this.graphStore.getEdge(e).payload.shape.svg;
66
+ let { element: n } = this.graphStore.getEdge(e).payload.shape;
67
67
  this.edgeIdToElementMap.set(e, n), this.container.appendChild(n);
68
68
  }
69
69
  renderEdge(t) {
@@ -76,7 +76,7 @@ var e = /* @__PURE__ */ function(e) {
76
76
  }
77
77
  updateEdgePriority(e) {
78
78
  let t = this.graphStore.getEdge(e);
79
- t.payload.shape.svg.style.zIndex = `${t.payload.priority}`;
79
+ t.payload.shape.element.style.zIndex = `${t.payload.priority}`;
80
80
  }
81
81
  createEdgeRenderPort(e, t, n, r) {
82
82
  let i = this.viewportStore.createContentCoords({
@@ -513,7 +513,7 @@ var e = /* @__PURE__ */ function(e) {
513
513
  if (this.hasEdge(e.id)) throw new p(m.addEdgeWithExistingId(e.id));
514
514
  if (!this.hasPort(e.from)) throw new p(m.addEdgeFromNonexistentPort(e.id, e.from));
515
515
  if (!this.hasPort(e.to)) throw new p(m.addEdgeToNonexistentPort(e.id, e.to));
516
- let t = this.findEdgeIdByElement(e.shape.svg);
516
+ let t = this.findEdgeIdByElement(e.shape.element);
517
517
  if (t !== void 0) throw new p(m.addEdgeWithElementInUse(e.id, t));
518
518
  this.addEdgeInternal(e), this.afterEdgeAddedEmitter.emit(e.id);
519
519
  }
@@ -621,11 +621,11 @@ var e = /* @__PURE__ */ function(e) {
621
621
  shape: e.shape,
622
622
  priority: e.priority
623
623
  }
624
- }), this.edgesElementsMap.set(e.shape.svg, e.id), e.from === e.to ? this.portCycleEdges.get(e.from).add(e.id) : (this.portOutgoingEdges.get(e.from).add(e.id), this.portIncomingEdges.get(e.to).add(e.id));
624
+ }), this.edgesElementsMap.set(e.shape.element, e.id), e.from === e.to ? this.portCycleEdges.get(e.from).add(e.id) : (this.portOutgoingEdges.get(e.from).add(e.id), this.portIncomingEdges.get(e.to).add(e.id));
625
625
  }
626
626
  removeEdgeInternal(e) {
627
627
  let { from: t, to: n, payload: r } = this.getEdge(e);
628
- this.portCycleEdges.get(t).delete(e), this.portCycleEdges.get(n).delete(e), this.portIncomingEdges.get(t).delete(e), this.portIncomingEdges.get(n).delete(e), this.portOutgoingEdges.get(t).delete(e), this.portOutgoingEdges.get(n).delete(e), this.edges.delete(e), this.edgesElementsMap.delete(r.shape.svg);
628
+ this.portCycleEdges.get(t).delete(e), this.portCycleEdges.get(n).delete(e), this.portIncomingEdges.get(t).delete(e), this.portIncomingEdges.get(n).delete(e), this.portOutgoingEdges.get(t).delete(e), this.portOutgoingEdges.get(n).delete(e), this.edges.delete(e), this.edgesElementsMap.delete(r.shape.element);
629
629
  }
630
630
  }, g = (e) => ({
631
631
  scale: 1 / e.scale,
@@ -726,7 +726,7 @@ var e = /* @__PURE__ */ function(e) {
726
726
  }, x = (e, t, n) => {
727
727
  let { x: r, y: i, width: a, height: o } = e.getBoundingClientRect();
728
728
  return t >= r && t <= r + a && n >= i && n <= i + o;
729
- }, S = (e, t, n) => t >= 0 && t <= e.innerWidth && n >= 0 && n <= e.innerHeight, ee = class {
729
+ }, S = (e, t, n) => t >= 0 && t <= e.innerWidth && n >= 0 && n <= e.innerHeight, C = class {
730
730
  element;
731
731
  win;
732
732
  constructor(e, t) {
@@ -735,9 +735,9 @@ var e = /* @__PURE__ */ function(e) {
735
735
  verify(e, t) {
736
736
  return x(this.element, e, t) && S(this.win, e, t);
737
737
  }
738
- }, C = (e, t) => {
738
+ }, w = (e, t) => {
739
739
  t === null ? e.style.removeProperty("cursor") : e.style.cursor = t;
740
- }, w = (e) => {
740
+ }, T = (e) => {
741
741
  let t = document.createElement("div");
742
742
  return {
743
743
  id: e.overlayNodeId,
@@ -750,7 +750,7 @@ var e = /* @__PURE__ */ function(e) {
750
750
  direction: e.portDirection
751
751
  }]
752
752
  };
753
- }, te = (e, t) => {
753
+ }, ee = (e, t) => {
754
754
  let n = t;
755
755
  for (; n !== null;) {
756
756
  let t = e.findPortIdsByElement(n)[0] ?? null;
@@ -765,11 +765,11 @@ var e = /* @__PURE__ */ function(e) {
765
765
  };
766
766
  //#endregion
767
767
  //#region src/configurators/shared/find-port-at-point/get-elements-at-point/get-elements-at-point.ts
768
- function* ne(e, t) {
768
+ function* te(e, t) {
769
769
  let n = e.elementsFromPoint(t.x, t.y);
770
770
  for (let e of n) {
771
771
  if (e.shadowRoot !== null) {
772
- let n = ne(e.shadowRoot, t);
772
+ let n = te(e.shadowRoot, t);
773
773
  for (let e of n) yield e;
774
774
  }
775
775
  yield e;
@@ -777,23 +777,23 @@ function* ne(e, t) {
777
777
  }
778
778
  //#endregion
779
779
  //#region src/configurators/shared/find-port-at-point/find-port-at-point.ts
780
- var re = (e, t) => {
781
- let n = ne(document, t);
780
+ var ne = (e, t) => {
781
+ let n = te(document, t);
782
782
  for (let t of n) {
783
- let n = te(e, t);
783
+ let n = ee(e, t);
784
784
  if (n.status === "portFound") return n.portId;
785
785
  if (n.status === "nodeEncountered") return null;
786
786
  }
787
787
  return null;
788
- }, T = /* @__PURE__ */ function(e) {
788
+ }, E = /* @__PURE__ */ function(e) {
789
789
  return e.StaticNodeId = "static", e.DraggingNodeId = "dragging", e.EdgeId = "edge", e;
790
- }({}), ie = (e, t) => ({
790
+ }({}), re = (e, t) => ({
791
791
  x: e / 2,
792
792
  y: t / 2
793
- }), E = (e, t, n) => ({
793
+ }), D = (e, t, n) => ({
794
794
  x: t.x * e.x - t.y * e.y + ((1 - t.x) * n.x + t.y * n.y),
795
795
  y: t.y * e.x + t.x * e.y + ((1 - t.x) * n.y - t.y * n.x)
796
- }), ae = (e, t, n) => {
796
+ }), ie = (e, t, n) => {
797
797
  let r = {
798
798
  x: e.x + e.width / 2,
799
799
  y: e.y + e.height / 2
@@ -815,14 +815,14 @@ var re = (e, t) => {
815
815
  y: i.y - o
816
816
  }
817
817
  };
818
- }, D = .5 * .5 * .5, O = 3 * D, oe = class {
818
+ }, O = .5 * .5 * .5, k = 3 * O, ae = class {
819
819
  path;
820
820
  midpoint;
821
821
  constructor(e) {
822
- let { from: t, to: n, arrowLength: r, fromDir: i, toDir: a, curvature: o, hasSourceArrow: s, hasTargetArrow: c } = e, l = E({
822
+ let { from: t, to: n, arrowLength: r, fromDir: i, toDir: a, curvature: o, hasSourceArrow: s, hasTargetArrow: c } = e, l = D({
823
823
  x: t.x + r,
824
824
  y: t.y
825
- }, i, t), u = E({
825
+ }, i, t), u = D({
826
826
  x: n.x - r,
827
827
  y: n.y
828
828
  }, a, n), d = {
@@ -831,7 +831,7 @@ var re = (e, t) => {
831
831
  }, f = {
832
832
  x: u.x - a.x * o,
833
833
  y: u.y - a.y * o
834
- }, p = D * l.x + O * d.x + O * f.x + D * u.x, m = D * l.y + O * d.y + O * f.y + D * u.y;
834
+ }, p = O * l.x + k * d.x + k * f.x + O * u.x, m = O * l.y + k * d.y + k * f.y + O * u.y;
835
835
  this.midpoint = {
836
836
  x: p,
837
837
  y: m
@@ -839,23 +839,23 @@ var re = (e, t) => {
839
839
  let h = `M ${l.x} ${l.y} C ${d.x} ${d.y}, ${f.x} ${f.y}, ${u.x} ${u.y}`, g = s ? "" : `M ${t.x} ${t.y} L ${l.x} ${l.y} `, _ = c ? "" : ` M ${u.x} ${u.y} L ${n.x} ${n.y}`;
840
840
  this.path = `${g}${h}${_}`;
841
841
  }
842
- }, se = class {
842
+ }, oe = class {
843
843
  path;
844
844
  midpoint;
845
845
  constructor(e) {
846
- let { hasSourceArrow: t, hasTargetArrow: n, curvature: r, fromDir: i, toDir: a, detourDir: o, from: s, to: c, arrowLength: l, detourDistance: u } = e, d = t ? E({
846
+ let { hasSourceArrow: t, hasTargetArrow: n, curvature: r, fromDir: i, toDir: a, detourDir: o, from: s, to: c, arrowLength: l, detourDistance: u } = e, d = t ? D({
847
847
  x: s.x + l,
848
848
  y: s.y
849
- }, i, s) : s, f = n ? E({
849
+ }, i, s) : s, f = n ? D({
850
850
  x: c.x - l,
851
851
  y: c.y
852
- }, a, c) : c, p = Math.cos(o) * u, m = Math.sin(o) * u, h = E({
852
+ }, a, c) : c, p = Math.cos(o) * u, m = Math.sin(o) * u, h = D({
853
853
  x: s.x + l,
854
854
  y: s.y
855
855
  }, i, s), g = {
856
856
  x: h.x + p,
857
857
  y: h.y + m
858
- }, _ = E({
858
+ }, _ = D({
859
859
  x: c.x - l,
860
860
  y: c.y
861
861
  }, a, c), v = {
@@ -873,7 +873,7 @@ var re = (e, t) => {
873
873
  }, S = {
874
874
  x: h.x + p,
875
875
  y: h.y + m
876
- }, ee = {
876
+ }, C = {
877
877
  x: _.x + p,
878
878
  y: _.y + m
879
879
  };
@@ -881,22 +881,22 @@ var re = (e, t) => {
881
881
  `M ${d.x} ${d.y}`,
882
882
  `L ${h.x} ${h.y}`,
883
883
  `C ${b.x} ${b.y} ${S.x} ${S.y} ${y.x} ${y.y}`,
884
- `C ${ee.x} ${ee.y} ${x.x} ${x.y} ${_.x} ${_.y}`,
884
+ `C ${C.x} ${C.y} ${x.x} ${x.y} ${_.x} ${_.y}`,
885
885
  `L ${f.x} ${f.y}`
886
886
  ].join(" "), this.midpoint = y;
887
887
  }
888
- }, k = Object.freeze({ edgeColor: "--edge-color" }), ce = (e) => {
888
+ }, A = Object.freeze({ edgeColor: "--edge-color" }), se = (e) => {
889
889
  let t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
890
- return t.style.pointerEvents = "none", t.style.position = "absolute", t.style.top = "0", t.style.left = "0", t.style.overflow = "visible", t.style.setProperty(k.edgeColor, e), t;
891
- }, le = (e) => {
890
+ return t.style.pointerEvents = "none", t.style.position = "absolute", t.style.top = "0", t.style.left = "0", t.style.overflow = "visible", t.style.setProperty(A.edgeColor, e), t;
891
+ }, ce = (e) => {
892
892
  let t = document.createElementNS("http://www.w3.org/2000/svg", "path");
893
- return t.setAttribute("stroke", `var(${k.edgeColor})`), t.setAttribute("stroke-width", `${e}`), t.setAttribute("fill", "none"), t;
894
- }, A = () => {
893
+ return t.setAttribute("stroke", `var(${A.edgeColor})`), t.setAttribute("stroke-width", `${e}`), t.setAttribute("fill", "none"), t;
894
+ }, j = () => {
895
895
  let e = document.createElementNS("http://www.w3.org/2000/svg", "path");
896
- return e.setAttribute("fill", `var(${k.edgeColor})`), e;
897
- }, ue = (e, t) => {
896
+ return e.setAttribute("fill", `var(${A.edgeColor})`), e;
897
+ }, le = (e, t) => {
898
898
  e.style.transform = `translate(${t.x}px, ${t.y}px)`, e.style.width = `${t.width}px`, e.style.height = `${t.height}px`;
899
- }, j = (e, t) => {
899
+ }, M = (e, t) => {
900
900
  let n = [];
901
901
  if (e.length > 0 && n.push(`M ${e[0].x} ${e[0].y}`), e.length === 2 && n.push(`L ${e[1].x} ${e[1].y}`), e.length > 2) {
902
902
  let r = e.length - 1, i = 0, a = 0, o = 0;
@@ -917,7 +917,7 @@ var re = (e, t) => {
917
917
  });
918
918
  }
919
919
  return n.join(" ");
920
- }, de = (e, t) => {
920
+ }, ue = (e, t) => {
921
921
  let n = e.linePoint, r = t.linePoint, i = r.x - n.x >= 0, a = e.dir.x >= 0;
922
922
  if (a === t.dir.x >= 0) {
923
923
  let o = a === i, s = {
@@ -991,24 +991,24 @@ var re = (e, t) => {
991
991
  y: s
992
992
  }
993
993
  };
994
- }, M = (e) => ({
994
+ }, N = (e) => ({
995
995
  x: e.y,
996
996
  y: e.x
997
- }), fe = (e, t) => {
998
- let n = de({
999
- arrowPoint: M(e.arrowPoint),
1000
- linePoint: M(e.linePoint),
1001
- dir: M(e.dir)
997
+ }), de = (e, t) => {
998
+ let n = ue({
999
+ arrowPoint: N(e.arrowPoint),
1000
+ linePoint: N(e.linePoint),
1001
+ dir: N(e.dir)
1002
1002
  }, {
1003
- arrowPoint: M(t.arrowPoint),
1004
- linePoint: M(t.linePoint),
1005
- dir: M(t.dir)
1003
+ arrowPoint: N(t.arrowPoint),
1004
+ linePoint: N(t.linePoint),
1005
+ dir: N(t.dir)
1006
1006
  });
1007
1007
  return {
1008
- points: n.points.map((e) => M(e)),
1009
- midpoint: M(n.midpoint)
1008
+ points: n.points.map((e) => N(e)),
1009
+ midpoint: N(n.midpoint)
1010
1010
  };
1011
- }, N = (e) => {
1011
+ }, P = (e) => {
1012
1012
  let t = [];
1013
1013
  for (let n = 1; n < e.length; n++) {
1014
1014
  let r = e[n - 1], i = e[n], a = i.x - r.x, o = i.y - r.y, s = Math.sqrt(a * a + o * o);
@@ -1034,7 +1034,7 @@ var re = (e, t) => {
1034
1034
  }
1035
1035
  if (r === 0 && e.length > 0) return e[0];
1036
1036
  throw Error("Failed to calculate midpoint");
1037
- }, pe = (e, t) => {
1037
+ }, fe = (e, t) => {
1038
1038
  let n = e.linePoint, r = e.arrowPoint, i = t.linePoint, a = t.arrowPoint, o = t.dir.y >= 0, s = e.dir.x >= 0, c = i.y - n.y >= 0, l = s === i.x - n.x >= 0, u = o === c;
1039
1039
  if (l) {
1040
1040
  if (u) {
@@ -1048,7 +1048,7 @@ var re = (e, t) => {
1048
1048
  e,
1049
1049
  a
1050
1050
  ],
1051
- midpoint: N([
1051
+ midpoint: P([
1052
1052
  n,
1053
1053
  e,
1054
1054
  i
@@ -1070,7 +1070,7 @@ var re = (e, t) => {
1070
1070
  i,
1071
1071
  a
1072
1072
  ],
1073
- midpoint: N([
1073
+ midpoint: P([
1074
1074
  n,
1075
1075
  t,
1076
1076
  o,
@@ -1094,7 +1094,7 @@ var re = (e, t) => {
1094
1094
  o,
1095
1095
  a
1096
1096
  ],
1097
- midpoint: N([
1097
+ midpoint: P([
1098
1098
  n,
1099
1099
  t,
1100
1100
  o,
@@ -1114,73 +1114,46 @@ var re = (e, t) => {
1114
1114
  i,
1115
1115
  a
1116
1116
  ],
1117
- midpoint: N([
1117
+ midpoint: P([
1118
1118
  n,
1119
1119
  d,
1120
1120
  i
1121
1121
  ])
1122
1122
  };
1123
- }, me = (e, t) => {
1124
- let n = pe({
1125
- arrowPoint: M(e.arrowPoint),
1126
- linePoint: M(e.linePoint),
1127
- dir: M(e.dir)
1123
+ }, pe = (e, t) => {
1124
+ let n = fe({
1125
+ arrowPoint: N(e.arrowPoint),
1126
+ linePoint: N(e.linePoint),
1127
+ dir: N(e.dir)
1128
1128
  }, {
1129
- arrowPoint: M(t.arrowPoint),
1130
- linePoint: M(t.linePoint),
1131
- dir: M(t.dir)
1129
+ arrowPoint: N(t.arrowPoint),
1130
+ linePoint: N(t.linePoint),
1131
+ dir: N(t.dir)
1132
1132
  });
1133
1133
  return {
1134
- points: n.points.map((e) => M(e)),
1135
- midpoint: M(n.midpoint)
1134
+ points: n.points.map((e) => N(e)),
1135
+ midpoint: N(n.midpoint)
1136
1136
  };
1137
- }, he = (e, t) => {
1137
+ }, me = (e, t) => {
1138
1138
  let n = Math.abs(e.dir.y) < 1e-10, r = Math.abs(t.dir.y) < 1e-10;
1139
- return n ? r ? de(e, t) : pe(e, t) : r ? me(e, t) : fe(e, t);
1140
- }, ge = class {
1139
+ return n ? r ? ue(e, t) : fe(e, t) : r ? pe(e, t) : de(e, t);
1140
+ }, he = class {
1141
1141
  path;
1142
1142
  midpoint;
1143
1143
  constructor(e) {
1144
- let { from: t, to: n, fromDir: r, toDir: i, arrowLength: a, arrowOffset: o, roundness: s, hasSourceArrow: c, hasTargetArrow: l } = e, u = c ? E({
1145
- x: t.x + a,
1146
- y: t.y
1147
- }, r, t) : t, d = l ? E({
1148
- x: n.x - a,
1149
- y: n.y
1150
- }, i, n) : n, f = a + o, p = E({
1151
- x: t.x + f,
1152
- y: t.y
1153
- }, r, t), m = E({
1154
- x: n.x - f,
1155
- y: n.y
1156
- }, i, n), h = de({
1157
- arrowPoint: u,
1158
- linePoint: p,
1159
- dir: r
1160
- }, {
1161
- arrowPoint: d,
1162
- linePoint: m,
1163
- dir: i
1164
- });
1165
- this.path = j(h.points, s), this.midpoint = h.midpoint;
1166
- }
1167
- }, _e = class {
1168
- path;
1169
- midpoint;
1170
- constructor(e) {
1171
- let { hasSourceArrow: t, hasTargetArrow: n, from: r, to: i, arrowLength: a, fromDir: o, toDir: s, arrowOffset: c, detourDir: l, detourDistance: u, roundness: d } = e, f = t ? E({
1144
+ let { hasSourceArrow: t, hasTargetArrow: n, from: r, to: i, arrowLength: a, fromDir: o, toDir: s, arrowOffset: c, detourDir: l, detourDistance: u, roundness: d } = e, f = t ? D({
1172
1145
  x: r.x + a,
1173
1146
  y: r.y
1174
- }, o, r) : r, p = n ? E({
1147
+ }, o, r) : r, p = n ? D({
1175
1148
  x: i.x - a,
1176
1149
  y: i.y
1177
- }, s, i) : i, m = a + c, h = Math.cos(l) * u, g = Math.sin(l) * u, _ = E({
1150
+ }, s, i) : i, m = a + c, h = Math.cos(l) * u, g = Math.sin(l) * u, _ = D({
1178
1151
  x: r.x + m,
1179
1152
  y: r.y
1180
1153
  }, o, r), v = {
1181
1154
  x: _.x + h,
1182
1155
  y: _.y + g
1183
- }, y = E({
1156
+ }, y = D({
1184
1157
  x: i.x - m,
1185
1158
  y: i.y
1186
1159
  }, s, i), b = {
@@ -1190,7 +1163,7 @@ var re = (e, t) => {
1190
1163
  this.midpoint = {
1191
1164
  x: (v.x + b.x) / 2,
1192
1165
  y: (v.y + b.y) / 2
1193
- }, this.path = j([
1166
+ }, this.path = M([
1194
1167
  f,
1195
1168
  _,
1196
1169
  v,
@@ -1199,18 +1172,18 @@ var re = (e, t) => {
1199
1172
  p
1200
1173
  ], d);
1201
1174
  }
1202
- }, ve = class {
1175
+ }, ge = class {
1203
1176
  path;
1204
1177
  midpoint;
1205
1178
  constructor(e) {
1206
- let { from: t, to: n, hasSourceArrow: r, hasTargetArrow: i, arrowLength: a, fromDir: o, toDir: s, arrowOffset: c, roundness: l } = e, u = this.createArrowPoint(r, o, t, a), d = this.createArrowPoint(i, s, n, -a), f = a + c, p = E({
1179
+ let { from: t, to: n, hasSourceArrow: r, hasTargetArrow: i, arrowLength: a, fromDir: o, toDir: s, arrowOffset: c, roundness: l } = e, u = this.createArrowPoint(r, o, t, a), d = this.createArrowPoint(i, s, n, -a), f = a + c, p = D({
1207
1180
  x: t.x + f,
1208
1181
  y: t.y
1209
- }, o, t), m = E({
1182
+ }, o, t), m = D({
1210
1183
  x: n.x - f,
1211
1184
  y: n.y
1212
1185
  }, s, n);
1213
- this.path = j([
1186
+ this.path = M([
1214
1187
  u,
1215
1188
  p,
1216
1189
  m,
@@ -1223,55 +1196,28 @@ var re = (e, t) => {
1223
1196
  };
1224
1197
  }
1225
1198
  createArrowPoint(e, t, n, r) {
1226
- return e ? E({
1199
+ return e ? D({
1227
1200
  x: n.x + r,
1228
1201
  y: n.y
1229
1202
  }, t, n) : n;
1230
1203
  }
1231
- }, ye = class {
1232
- path;
1233
- midpoint;
1234
- constructor(e) {
1235
- let { from: t, to: n, hasSourceArrow: r, hasTargetArrow: i, arrowLength: a, arrowOffset: o, fromDir: s, toDir: c, roundness: l } = e, u = r ? E({
1236
- x: t.x + a,
1237
- y: t.y
1238
- }, s, t) : t, d = i ? E({
1239
- x: n.x - a,
1240
- y: n.y
1241
- }, c, n) : n, f = a + o, p = E({
1242
- x: t.x + f,
1243
- y: t.y
1244
- }, s, t), m = E({
1245
- x: n.x - f,
1246
- y: n.y
1247
- }, c, n), h = fe({
1248
- arrowPoint: u,
1249
- linePoint: p,
1250
- dir: s
1251
- }, {
1252
- arrowPoint: d,
1253
- linePoint: m,
1254
- dir: c
1255
- });
1256
- this.path = j(h.points, l), this.midpoint = h.midpoint;
1257
- }
1258
- }, be = class {
1204
+ }, _e = class {
1259
1205
  path;
1260
1206
  midpoint;
1261
1207
  constructor(e) {
1262
- let { from: t, to: n, fromDir: r, toDir: i, arrowLength: a, arrowOffset: o, roundness: s, hasSourceArrow: c, hasTargetArrow: l } = e, u = c ? E({
1208
+ let { from: t, to: n, fromDir: r, toDir: i, arrowLength: a, arrowOffset: o, roundness: s, hasSourceArrow: c, hasTargetArrow: l } = e, u = c ? D({
1263
1209
  x: t.x + a,
1264
1210
  y: t.y
1265
- }, r, t) : t, d = l ? E({
1211
+ }, r, t) : t, d = l ? D({
1266
1212
  x: n.x - a,
1267
1213
  y: n.y
1268
- }, i, n) : n, f = a + o, p = E({
1214
+ }, i, n) : n, f = a + o, p = D({
1269
1215
  x: t.x + f,
1270
1216
  y: t.y
1271
- }, r, t), m = E({
1217
+ }, r, t), m = D({
1272
1218
  x: n.x - f,
1273
1219
  y: n.y
1274
- }, i, n), h = he({
1220
+ }, i, n), h = me({
1275
1221
  arrowPoint: u,
1276
1222
  linePoint: p,
1277
1223
  dir: r
@@ -1280,9 +1226,9 @@ var re = (e, t) => {
1280
1226
  linePoint: m,
1281
1227
  dir: i
1282
1228
  });
1283
- this.path = j(h.points, s), this.midpoint = h.midpoint;
1229
+ this.path = M(h.points, s), this.midpoint = h.midpoint;
1284
1230
  }
1285
- }, P = class {
1231
+ }, ve = class {
1286
1232
  path;
1287
1233
  midpoint;
1288
1234
  constructor(e) {
@@ -1319,19 +1265,19 @@ var re = (e, t) => {
1319
1265
  x: n,
1320
1266
  y: 0
1321
1267
  }
1322
- ].map((e) => E(e, i, {
1268
+ ].map((e) => D(e, i, {
1323
1269
  x: 0,
1324
1270
  y: 0
1325
1271
  })).map((e) => ({
1326
1272
  x: e.x + a.x,
1327
1273
  y: e.y + a.y
1328
1274
  })), u = `M ${a.x} ${a.y} L ${l[0].x} ${l[0].y} `;
1329
- this.path = `${o ? "" : u}${j(l, e.roundness)}`, this.midpoint = {
1275
+ this.path = `${o ? "" : u}${M(l, e.roundness)}`, this.midpoint = {
1330
1276
  x: (l[3].x + l[4].x) / 2,
1331
1277
  y: (l[3].y + l[4].y) / 2
1332
1278
  };
1333
1279
  }
1334
- }, xe = class {
1280
+ }, ye = class {
1335
1281
  path;
1336
1282
  midpoint;
1337
1283
  constructor(e) {
@@ -1352,7 +1298,7 @@ var re = (e, t) => {
1352
1298
  x: d,
1353
1299
  y: 0
1354
1300
  }
1355
- ].map((e) => E(e, i, {
1301
+ ].map((e) => D(e, i, {
1356
1302
  x: 0,
1357
1303
  y: 0
1358
1304
  })).map((e) => ({
@@ -1366,30 +1312,30 @@ var re = (e, t) => {
1366
1312
  ].join(" "), h = `M ${a.x} ${a.y} L ${p[0].x} ${p[0].y} `;
1367
1313
  this.path = `${o ? "" : h}${m}`, this.midpoint = p[3];
1368
1314
  }
1369
- }, Se = (e, t, n) => {
1315
+ }, be = (e, t, n) => {
1370
1316
  let r = Math.max(e.y, t.y), i = Math.min(e.y, t.y);
1371
1317
  return (n >= 0 ? r : i) + n;
1372
- }, Ce = class {
1318
+ }, xe = class {
1373
1319
  path;
1374
1320
  midpoint;
1375
1321
  constructor(e) {
1376
- let { hasSourceArrow: t, hasTargetArrow: n, arrowLength: r, from: i, to: a, fromDir: o, toDir: s, arrowOffset: c, roundness: l, detourDistance: u } = e, d = t ? E({
1322
+ let { hasSourceArrow: t, hasTargetArrow: n, arrowLength: r, from: i, to: a, fromDir: o, toDir: s, arrowOffset: c, roundness: l, detourDistance: u } = e, d = t ? D({
1377
1323
  x: i.x + r,
1378
1324
  y: i.y
1379
- }, o, i) : i, f = n ? E({
1325
+ }, o, i) : i, f = n ? D({
1380
1326
  x: a.x - r,
1381
1327
  y: a.y
1382
- }, s, a) : a, p = r + c, m = E({
1328
+ }, s, a) : a, p = r + c, m = D({
1383
1329
  x: i.x + p,
1384
1330
  y: i.y
1385
- }, o, i), h = E({
1331
+ }, o, i), h = D({
1386
1332
  x: a.x - p,
1387
1333
  y: a.y
1388
- }, s, a), g = Se(m, h, u);
1334
+ }, s, a), g = be(m, h, u);
1389
1335
  this.midpoint = {
1390
1336
  x: (m.x + h.x) / 2,
1391
1337
  y: g
1392
- }, this.path = j([
1338
+ }, this.path = M([
1393
1339
  d,
1394
1340
  m,
1395
1341
  {
@@ -1404,30 +1350,30 @@ var re = (e, t) => {
1404
1350
  f
1405
1351
  ], l);
1406
1352
  }
1407
- }, we = (e, t, n) => {
1353
+ }, Se = (e, t, n) => {
1408
1354
  let r = Math.max(e.x, t.x), i = Math.min(e.x, t.x);
1409
1355
  return (n >= 0 ? r : i) + n;
1410
- }, Te = class {
1356
+ }, Ce = class {
1411
1357
  path;
1412
1358
  midpoint;
1413
1359
  constructor(e) {
1414
- let { hasSourceArrow: t, hasTargetArrow: n, arrowLength: r, fromDir: i, toDir: a, from: o, to: s, arrowOffset: c, detourDistance: l, roundness: u } = e, d = t ? E({
1360
+ let { hasSourceArrow: t, hasTargetArrow: n, arrowLength: r, fromDir: i, toDir: a, from: o, to: s, arrowOffset: c, detourDistance: l, roundness: u } = e, d = t ? D({
1415
1361
  x: o.x + r,
1416
1362
  y: o.y
1417
- }, i, o) : o, f = n ? E({
1363
+ }, i, o) : o, f = n ? D({
1418
1364
  x: s.x - r,
1419
1365
  y: s.y
1420
- }, a, s) : s, p = r + c, m = E({
1366
+ }, a, s) : s, p = r + c, m = D({
1421
1367
  x: o.x + p,
1422
1368
  y: o.y
1423
- }, i, o), h = E({
1369
+ }, i, o), h = D({
1424
1370
  x: s.x - p,
1425
1371
  y: s.y
1426
- }, a, s), g = we(m, h, l);
1372
+ }, a, s), g = Se(m, h, l);
1427
1373
  this.midpoint = {
1428
1374
  x: g,
1429
1375
  y: (m.y + h.y) / 2
1430
- }, this.path = j([
1376
+ }, this.path = M([
1431
1377
  d,
1432
1378
  m,
1433
1379
  {
@@ -1442,22 +1388,22 @@ var re = (e, t) => {
1442
1388
  f
1443
1389
  ], u);
1444
1390
  }
1445
- }, Ee = class {
1391
+ }, we = class {
1446
1392
  path;
1447
1393
  midpoint;
1448
1394
  constructor(e) {
1449
1395
  let t = Math.abs(e.fromDir.y) < 1e-10, n = Math.abs(e.toDir.y) < 1e-10;
1450
1396
  if (t && n) {
1451
- let t = new Ce(e);
1397
+ let t = new xe(e);
1452
1398
  this.path = t.path, this.midpoint = t.midpoint;
1453
1399
  return;
1454
1400
  }
1455
1401
  if (!t && !n) {
1456
- let t = new Te(e);
1402
+ let t = new Ce(e);
1457
1403
  this.path = t.path, this.midpoint = t.midpoint;
1458
1404
  return;
1459
1405
  }
1460
- let r = new be(e);
1406
+ let r = new _e(e);
1461
1407
  this.path = r.path, this.midpoint = r.midpoint;
1462
1408
  }
1463
1409
  }, F = Object.freeze({
@@ -1482,12 +1428,12 @@ var re = (e, t) => {
1482
1428
  curvature: 90,
1483
1429
  interactiveWidth: 10,
1484
1430
  portOffset: 0
1485
- }), De = (e) => ({
1431
+ }), Te = (e) => ({
1486
1432
  x: Math.cos(e),
1487
1433
  y: Math.sin(e)
1488
1434
  }), I = class {
1489
1435
  params;
1490
- svg;
1436
+ element;
1491
1437
  group = document.createElementNS("http://www.w3.org/2000/svg", "g");
1492
1438
  line;
1493
1439
  sourceArrow = null;
@@ -1496,17 +1442,17 @@ var re = (e, t) => {
1496
1442
  afterRenderEmitter;
1497
1443
  arrowRenderer;
1498
1444
  constructor(e) {
1499
- this.params = e, [this.afterRenderEmitter, this.onAfterRender] = u(), this.arrowRenderer = this.params.arrowRenderer, this.svg = ce(e.color), this.svg.appendChild(this.group), this.line = le(e.width), this.group.appendChild(this.line), e.hasSourceArrow && (this.sourceArrow = A(), this.group.appendChild(this.sourceArrow)), e.hasTargetArrow && (this.targetArrow = A(), this.group.appendChild(this.targetArrow));
1445
+ this.params = e, [this.afterRenderEmitter, this.onAfterRender] = u(), this.arrowRenderer = this.params.arrowRenderer, this.element = se(e.color), this.element.appendChild(this.group), this.line = ce(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));
1500
1446
  }
1501
1447
  render(t) {
1502
- let { x: n, y: r, width: i, height: a, from: o, to: s } = ae(t.from, t.to, this.params.padding);
1503
- ue(this.svg, {
1448
+ let { x: n, y: r, width: i, height: a, from: o, to: s } = ie(t.from, t.to, this.params.padding);
1449
+ le(this.element, {
1504
1450
  x: n,
1505
1451
  y: r,
1506
1452
  width: i,
1507
1453
  height: a
1508
1454
  });
1509
- let c = De(t.from.direction), l = De(t.to.direction), u = {
1455
+ let c = Te(t.from.direction), l = Te(t.to.direction), u = {
1510
1456
  x: -l.x,
1511
1457
  y: -l.y
1512
1458
  }, d;
@@ -1530,7 +1476,7 @@ var re = (e, t) => {
1530
1476
  targetArrowPath: m
1531
1477
  });
1532
1478
  }
1533
- }, Oe = (e) => (t) => {
1479
+ }, Ee = (e) => (t) => {
1534
1480
  let n = [
1535
1481
  {
1536
1482
  x: 0,
@@ -1544,7 +1490,7 @@ var re = (e, t) => {
1544
1490
  x: t.arrowLength,
1545
1491
  y: -e.radius
1546
1492
  }
1547
- ].map((e) => E(e, t.direction, {
1493
+ ].map((e) => D(e, t.direction, {
1548
1494
  x: 0,
1549
1495
  y: 0
1550
1496
  })).map((e) => ({
@@ -1552,7 +1498,7 @@ var re = (e, t) => {
1552
1498
  y: e.y + t.shift.y
1553
1499
  }));
1554
1500
  return `${`M ${n[0].x} ${n[0].y}`} ${`L ${n[1].x} ${n[1].y}`} ${`L ${n[2].x} ${n[2].y}`} Z`;
1555
- }, ke = (e) => (t) => {
1501
+ }, De = (e) => (t) => {
1556
1502
  let n = e.radius, r = t.arrowLength, i = (r * r + 2 * r * n) / (2 * n), a = i + n, o = r + n - n * (r + n) / a, s = n * i / a, c = [
1557
1503
  {
1558
1504
  x: 0,
@@ -1566,7 +1512,7 @@ var re = (e, t) => {
1566
1512
  x: o,
1567
1513
  y: s
1568
1514
  }
1569
- ].map((e) => E(e, t.direction, {
1515
+ ].map((e) => D(e, t.direction, {
1570
1516
  x: 0,
1571
1517
  y: 0
1572
1518
  })).map((e) => ({
@@ -1574,8 +1520,8 @@ var re = (e, t) => {
1574
1520
  y: e.y + t.shift.y
1575
1521
  }));
1576
1522
  return `${`M ${c[0].x} ${c[0].y}`} ${`A ${i} ${i} 0 0 0 ${c[1].x} ${c[1].y}`} ${`A ${n} ${n} 0 0 0 ${c[2].x} ${c[2].y}`} ${`A ${i} ${i} 0 0 0 ${c[0].x} ${c[0].y}`}`;
1577
- }, Ae = (e) => (t) => {
1578
- let n = e.smallRadius, r = e.radius, i = E({
1523
+ }, Oe = (e) => (t) => {
1524
+ let n = e.smallRadius, r = e.radius, i = D({
1579
1525
  x: t.arrowLength,
1580
1526
  y: 0
1581
1527
  }, {
@@ -1594,7 +1540,7 @@ var re = (e, t) => {
1594
1540
  y: -i.y
1595
1541
  },
1596
1542
  i
1597
- ].map((e) => E(e, t.direction, {
1543
+ ].map((e) => D(e, t.direction, {
1598
1544
  x: 0,
1599
1545
  y: 0
1600
1546
  })).map((e) => ({
@@ -1605,16 +1551,16 @@ var re = (e, t) => {
1605
1551
  }, L = (e) => {
1606
1552
  if (typeof e == "function") return e;
1607
1553
  switch (e.type) {
1608
- case "triangle": return Oe({ radius: e.radius ?? F.polygonArrowRadius });
1609
- case "arc": return ke({ radius: e.radius ?? F.circleArrowRadius });
1610
- default: return Ae({
1554
+ case "triangle": return Ee({ radius: e.radius ?? F.polygonArrowRadius });
1555
+ case "arc": return De({ radius: e.radius ?? F.circleArrowRadius });
1556
+ default: return Oe({
1611
1557
  smallRadius: e.smallRadius ?? F.wedgeArrowSmallRadius,
1612
1558
  angle: e.angle ?? F.wedgeArrowAngle,
1613
1559
  radius: e.radius ?? F.wedgeArrowRadius
1614
1560
  });
1615
1561
  }
1616
- }, je = class {
1617
- svg;
1562
+ }, ke = class {
1563
+ element;
1618
1564
  group;
1619
1565
  line;
1620
1566
  sourceArrow;
@@ -1629,7 +1575,7 @@ var re = (e, t) => {
1629
1575
  hasSourceArrow;
1630
1576
  hasTargetArrow;
1631
1577
  pathShape;
1632
- createCyclePath = (e, t, n) => new xe({
1578
+ createCyclePath = (e, t, n) => new ye({
1633
1579
  origin: e,
1634
1580
  dir: n,
1635
1581
  radius: this.portCycleRadius,
@@ -1637,7 +1583,7 @@ var re = (e, t) => {
1637
1583
  arrowLength: this.arrowLength,
1638
1584
  hasArrow: this.hasSourceArrow || this.hasTargetArrow
1639
1585
  });
1640
- createDetourPath = (e, t, n, r) => new se({
1586
+ createDetourPath = (e, t, n, r) => new oe({
1641
1587
  from: e,
1642
1588
  to: t,
1643
1589
  fromDir: n,
@@ -1649,7 +1595,7 @@ var re = (e, t) => {
1649
1595
  hasSourceArrow: this.hasSourceArrow,
1650
1596
  hasTargetArrow: this.hasTargetArrow
1651
1597
  });
1652
- createLinePath = (e, t, n, r) => new oe({
1598
+ createLinePath = (e, t, n, r) => new ae({
1653
1599
  from: e,
1654
1600
  to: t,
1655
1601
  fromDir: n,
@@ -1671,90 +1617,13 @@ var re = (e, t) => {
1671
1617
  createDetourPath: this.createDetourPath,
1672
1618
  createLinePath: this.createLinePath,
1673
1619
  padding: 50
1674
- }), 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;
1620
+ }), this.element = this.pathShape.element, 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;
1675
1621
  }
1676
1622
  render(e) {
1677
1623
  this.pathShape.render(e);
1678
1624
  }
1679
- }, Me = (e) => Math.cos(e) > 0 ? 0 : Math.PI, Ne = class {
1680
- svg;
1681
- group;
1682
- line;
1683
- sourceArrow;
1684
- targetArrow;
1685
- onAfterRender;
1686
- arrowLength;
1687
- arrowOffset;
1688
- roundness;
1689
- cycleSquareSide;
1690
- detourDistance;
1691
- hasSourceArrow;
1692
- hasTargetArrow;
1693
- pathShape;
1694
- createCyclePath = (e, t, n) => new P({
1695
- origin: e,
1696
- dir: n,
1697
- arrowLength: this.arrowLength,
1698
- side: this.cycleSquareSide,
1699
- arrowOffset: this.arrowOffset,
1700
- roundness: this.roundness,
1701
- hasArrow: this.hasSourceArrow || this.hasTargetArrow
1702
- });
1703
- createDetourPath = (e, t, n, r) => new Ce({
1704
- from: e,
1705
- to: t,
1706
- fromDir: n,
1707
- toDir: r,
1708
- arrowLength: this.arrowLength,
1709
- arrowOffset: this.arrowOffset,
1710
- roundness: this.roundness,
1711
- detourDistance: this.detourDistance,
1712
- hasSourceArrow: this.hasSourceArrow,
1713
- hasTargetArrow: this.hasTargetArrow
1714
- });
1715
- createLinePath = (e, t, n, r) => new ge({
1716
- from: e,
1717
- to: t,
1718
- fromDir: n,
1719
- toDir: r,
1720
- arrowLength: this.arrowLength,
1721
- arrowOffset: this.arrowOffset,
1722
- roundness: this.roundness,
1723
- hasSourceArrow: this.hasSourceArrow,
1724
- hasTargetArrow: this.hasTargetArrow
1725
- });
1726
- constructor(e) {
1727
- this.arrowLength = e?.arrowLength ?? F.arrowLength, this.arrowOffset = e?.arrowOffset ?? F.arrowOffset, this.cycleSquareSide = e?.cycleSquareSide ?? F.cycleSquareSide;
1728
- let t = e?.roundness ?? F.roundness;
1729
- this.roundness = Math.min(t, this.arrowOffset, this.cycleSquareSide / 2), this.detourDistance = e?.detourDistance ?? F.detourDistance, this.hasSourceArrow = e?.hasSourceArrow ?? F.hasSourceArrow, this.hasTargetArrow = e?.hasTargetArrow ?? F.hasTargetArrow, this.pathShape = new I({
1730
- color: e?.color ?? F.color,
1731
- width: e?.width ?? F.width,
1732
- arrowRenderer: L(e?.arrowRenderer ?? {}),
1733
- arrowLength: this.arrowLength,
1734
- hasSourceArrow: this.hasSourceArrow,
1735
- hasTargetArrow: this.hasTargetArrow,
1736
- createCyclePath: this.createCyclePath,
1737
- createDetourPath: this.createDetourPath,
1738
- createLinePath: this.createLinePath,
1739
- padding: 50
1740
- }), 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;
1741
- }
1742
- render(e) {
1743
- let { from: t, to: n, category: r } = e;
1744
- this.pathShape.render({
1745
- category: r,
1746
- from: {
1747
- ...t,
1748
- direction: Me(t.direction)
1749
- },
1750
- to: {
1751
- ...n,
1752
- direction: Me(n.direction)
1753
- }
1754
- });
1755
- }
1756
- }, Pe = class {
1757
- svg;
1625
+ }, Ae = class {
1626
+ element;
1758
1627
  group;
1759
1628
  line;
1760
1629
  sourceArrow;
@@ -1769,7 +1638,7 @@ var re = (e, t) => {
1769
1638
  hasSourceArrow;
1770
1639
  hasTargetArrow;
1771
1640
  pathShape;
1772
- createCyclePath = (e, t, n) => new P({
1641
+ createCyclePath = (e, t, n) => new ve({
1773
1642
  origin: e,
1774
1643
  dir: n,
1775
1644
  arrowLength: this.arrowLength,
@@ -1778,7 +1647,7 @@ var re = (e, t) => {
1778
1647
  roundness: this.roundness,
1779
1648
  hasArrow: this.hasSourceArrow || this.hasTargetArrow
1780
1649
  });
1781
- createDetourPath = (e, t, n, r) => new _e({
1650
+ createDetourPath = (e, t, n, r) => new he({
1782
1651
  from: e,
1783
1652
  to: t,
1784
1653
  fromDir: n,
@@ -1791,7 +1660,7 @@ var re = (e, t) => {
1791
1660
  hasSourceArrow: this.hasSourceArrow,
1792
1661
  hasTargetArrow: this.hasTargetArrow
1793
1662
  });
1794
- createLinePath = (e, t, n, r) => new ve({
1663
+ createLinePath = (e, t, n, r) => new ge({
1795
1664
  from: e,
1796
1665
  to: t,
1797
1666
  fromDir: n,
@@ -1816,93 +1685,16 @@ var re = (e, t) => {
1816
1685
  createDetourPath: this.createDetourPath,
1817
1686
  createLinePath: this.createLinePath,
1818
1687
  padding: 50
1819
- }), 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;
1688
+ }), this.element = this.pathShape.element, 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;
1820
1689
  }
1821
1690
  render(e) {
1822
1691
  this.pathShape.render(e);
1823
1692
  }
1824
- }, Fe = Math.PI / 2, Ie = (e) => Math.sin(e) > 0 ? Fe : -Fe, Le = class {
1825
- svg;
1826
- group;
1827
- line;
1828
- sourceArrow;
1829
- targetArrow;
1830
- onAfterRender;
1831
- arrowLength;
1832
- arrowOffset;
1833
- roundness;
1834
- cycleSquareSide;
1835
- detourDistance;
1836
- hasSourceArrow;
1837
- hasTargetArrow;
1838
- pathShape;
1839
- createCyclePath = (e, t, n) => new P({
1840
- origin: e,
1841
- dir: n,
1842
- arrowLength: this.arrowLength,
1843
- side: this.cycleSquareSide,
1844
- arrowOffset: this.arrowOffset,
1845
- roundness: this.roundness,
1846
- hasArrow: this.hasSourceArrow || this.hasTargetArrow
1847
- });
1848
- createDetourPath = (e, t, n, r) => new Te({
1849
- from: e,
1850
- to: t,
1851
- fromDir: n,
1852
- toDir: r,
1853
- arrowLength: this.arrowLength,
1854
- arrowOffset: this.arrowOffset,
1855
- roundness: this.roundness,
1856
- detourDistance: this.detourDistance,
1857
- hasSourceArrow: this.hasSourceArrow,
1858
- hasTargetArrow: this.hasTargetArrow
1859
- });
1860
- createLinePath = (e, t, n, r) => new ye({
1861
- from: e,
1862
- to: t,
1863
- fromDir: n,
1864
- toDir: r,
1865
- arrowLength: this.arrowLength,
1866
- arrowOffset: this.arrowOffset,
1867
- roundness: this.roundness,
1868
- hasSourceArrow: this.hasSourceArrow,
1869
- hasTargetArrow: this.hasTargetArrow
1870
- });
1871
- constructor(e) {
1872
- this.arrowLength = e?.arrowLength ?? F.arrowLength, this.arrowOffset = e?.arrowOffset ?? F.arrowOffset, this.cycleSquareSide = e?.cycleSquareSide ?? F.cycleSquareSide;
1873
- let t = e?.roundness ?? F.roundness;
1874
- this.roundness = Math.min(t, this.arrowOffset, this.cycleSquareSide / 2), this.detourDistance = e?.detourDistance ?? F.detourDistance, this.hasSourceArrow = e?.hasSourceArrow ?? F.hasSourceArrow, this.hasTargetArrow = e?.hasTargetArrow ?? F.hasTargetArrow, this.pathShape = new I({
1875
- color: e?.color ?? F.color,
1876
- width: e?.width ?? F.width,
1877
- arrowRenderer: L(e?.arrowRenderer ?? {}),
1878
- arrowLength: this.arrowLength,
1879
- hasSourceArrow: this.hasSourceArrow,
1880
- hasTargetArrow: this.hasTargetArrow,
1881
- createCyclePath: this.createCyclePath,
1882
- createDetourPath: this.createDetourPath,
1883
- createLinePath: this.createLinePath,
1884
- padding: 50
1885
- }), 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;
1886
- }
1887
- render(e) {
1888
- let { from: t, to: n, category: r } = e;
1889
- this.pathShape.render({
1890
- category: r,
1891
- from: {
1892
- ...t,
1893
- direction: Ie(t.direction)
1894
- },
1895
- to: {
1896
- ...n,
1897
- direction: Ie(n.direction)
1898
- }
1899
- });
1900
- }
1901
- }, Re = (e) => {
1693
+ }, je = (e) => {
1902
1694
  let t = e + Math.PI / 4, n = Math.cos(t), r = Math.sin(t);
1903
1695
  return n > 0 ? r > 0 ? 0 : -Math.PI / 2 : r > 0 ? Math.PI / 2 : Math.PI;
1904
- }, ze = class {
1905
- svg;
1696
+ }, Me = class {
1697
+ element;
1906
1698
  group;
1907
1699
  line;
1908
1700
  sourceArrow;
@@ -1916,7 +1708,7 @@ var re = (e, t) => {
1916
1708
  hasSourceArrow;
1917
1709
  hasTargetArrow;
1918
1710
  pathShape;
1919
- createCyclePath = (e, t, n) => new P({
1711
+ createCyclePath = (e, t, n) => new ve({
1920
1712
  origin: e,
1921
1713
  dir: n,
1922
1714
  arrowLength: this.arrowLength,
@@ -1925,7 +1717,7 @@ var re = (e, t) => {
1925
1717
  roundness: this.roundness,
1926
1718
  hasArrow: this.hasSourceArrow || this.hasTargetArrow
1927
1719
  });
1928
- createDetourPath = (e, t, n, r) => new Ee({
1720
+ createDetourPath = (e, t, n, r) => new we({
1929
1721
  from: e,
1930
1722
  to: t,
1931
1723
  fromDir: n,
@@ -1937,7 +1729,7 @@ var re = (e, t) => {
1937
1729
  hasSourceArrow: this.hasSourceArrow,
1938
1730
  hasTargetArrow: this.hasTargetArrow
1939
1731
  });
1940
- createLinePath = (e, t, n, r) => new be({
1732
+ createLinePath = (e, t, n, r) => new _e({
1941
1733
  from: e,
1942
1734
  to: t,
1943
1735
  fromDir: n,
@@ -1962,7 +1754,7 @@ var re = (e, t) => {
1962
1754
  createDetourPath: this.createDetourPath,
1963
1755
  createLinePath: this.createLinePath,
1964
1756
  padding: 50
1965
- }), 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;
1757
+ }), this.element = this.pathShape.element, 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;
1966
1758
  }
1967
1759
  render(e) {
1968
1760
  let { from: t, to: n, category: r } = e;
@@ -1970,19 +1762,19 @@ var re = (e, t) => {
1970
1762
  category: r,
1971
1763
  from: {
1972
1764
  ...t,
1973
- direction: Re(t.direction)
1765
+ direction: je(t.direction)
1974
1766
  },
1975
1767
  to: {
1976
1768
  ...n,
1977
- direction: Re(n.direction)
1769
+ direction: je(n.direction)
1978
1770
  }
1979
1771
  });
1980
1772
  }
1981
- }, Be = (e) => {
1773
+ }, Ne = (e) => {
1982
1774
  let { direction: t, radius: n } = e, { x: r, y: i } = t, { horizontal: a, vertical: o } = n, s = i / r, c = Math.abs(o / s), l = Math.abs(a * s), u = Math.min(a, c), d = Math.min(o, l);
1983
1775
  return Math.sqrt(u * u + d * d);
1984
- }, Ve = (e) => typeof e == "number" ? () => e : e === "box" ? Be : e, He = F.portOffset, R = class {
1985
- svg;
1776
+ }, Pe = (e) => typeof e == "number" ? () => e : e === "box" ? Ne : e, Fe = F.portOffset, R = class {
1777
+ element;
1986
1778
  group = document.createElementNS("http://www.w3.org/2000/svg", "g");
1987
1779
  line;
1988
1780
  sourceArrow = null;
@@ -1996,11 +1788,11 @@ var re = (e, t) => {
1996
1788
  afterRenderEmitter;
1997
1789
  arrowRenderer;
1998
1790
  constructor(e) {
1999
- [this.afterRenderEmitter, this.onAfterRender] = u(), this.color = e?.color ?? F.color, this.width = e?.width ?? F.width, this.arrowLength = e?.arrowLength ?? F.arrowLength, this.arrowRenderer = L(e?.arrowRenderer ?? {}), this.sourceOffsetFn = Ve(e?.sourceOffset ?? He), this.targetOffsetFn = Ve(e?.targetOffset ?? He), this.svg = ce(this.color), this.svg.appendChild(this.group), this.line = le(this.width), this.group.appendChild(this.line), e?.hasSourceArrow && (this.sourceArrow = A(), this.group.appendChild(this.sourceArrow)), e?.hasTargetArrow && (this.targetArrow = A(), this.group.appendChild(this.targetArrow));
1791
+ [this.afterRenderEmitter, this.onAfterRender] = u(), this.color = e?.color ?? F.color, this.width = e?.width ?? F.width, this.arrowLength = e?.arrowLength ?? F.arrowLength, this.arrowRenderer = L(e?.arrowRenderer ?? {}), this.sourceOffsetFn = Pe(e?.sourceOffset ?? Fe), this.targetOffsetFn = Pe(e?.targetOffset ?? Fe), this.element = se(this.color), this.element.appendChild(this.group), this.line = ce(this.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));
2000
1792
  }
2001
1793
  render(e) {
2002
- let { x: t, y: n, width: r, height: i, from: a, to: o } = ae(e.from, e.to, 50);
2003
- ue(this.svg, {
1794
+ let { x: t, y: n, width: r, height: i, from: a, to: o } = ie(e.from, e.to, 50);
1795
+ le(this.element, {
2004
1796
  x: t,
2005
1797
  y: n,
2006
1798
  width: r,
@@ -2098,43 +1890,43 @@ var re = (e, t) => {
2098
1890
  targetArrowPath: n
2099
1891
  });
2100
1892
  }
2101
- }, Ue = () => {
1893
+ }, Ie = () => {
2102
1894
  let e = document.createElementNS("http://www.w3.org/2000/svg", "g");
2103
1895
  return e.style.pointerEvents = "auto", e.style.cursor = "pointer", e;
2104
- }, We = (e) => {
1896
+ }, Le = (e) => {
2105
1897
  let t = document.createElementNS("http://www.w3.org/2000/svg", "path");
2106
1898
  return t.setAttribute("stroke", "transparent"), t.setAttribute("stroke-width", `${e}`), t.setAttribute("fill", "none"), t.setAttribute("stroke-linecap", "round"), t;
2107
- }, Ge = (e) => {
1899
+ }, Re = (e) => {
2108
1900
  let t = document.createElementNS("http://www.w3.org/2000/svg", "path");
2109
1901
  return t.setAttribute("stroke-linejoin", "round"), t.setAttribute("stroke-width", `${e}`), t.setAttribute("fill", "transparent"), t.setAttribute("stroke", "transparent"), t;
2110
- }, Ke = class extends Error {
1902
+ }, ze = class extends Error {
2111
1903
  constructor(e) {
2112
1904
  super(e), this.name = "InteractiveEdgeError";
2113
1905
  }
2114
- }, qe = class e {
1906
+ }, Be = class e {
2115
1907
  baseEdge;
2116
- svg;
1908
+ element;
2117
1909
  group;
2118
1910
  line;
2119
1911
  sourceArrow;
2120
1912
  targetArrow;
2121
- handle = Ue();
1913
+ handle = Ie();
2122
1914
  onAfterRender;
2123
1915
  interactiveLine;
2124
1916
  interactiveSourceArrow = null;
2125
1917
  interactiveTargetArrow = null;
2126
1918
  constructor(t, n) {
2127
- if (this.baseEdge = t, t instanceof e) throw new Ke("interactive edge can be configured only once");
2128
- 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;
1919
+ if (this.baseEdge = t, t instanceof e) throw new ze("interactive edge can be configured only once");
1920
+ this.element = this.baseEdge.element, 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;
2129
1921
  let r = n?.distance ?? F.interactiveWidth;
2130
- this.interactiveLine = We(r), this.handle.appendChild(this.interactiveLine), this.sourceArrow && (this.interactiveSourceArrow = Ge(r), this.handle.appendChild(this.interactiveSourceArrow)), this.targetArrow && (this.interactiveTargetArrow = Ge(r), this.handle.appendChild(this.interactiveTargetArrow)), this.group.appendChild(this.handle), this.baseEdge.onAfterRender.subscribe((e) => {
1922
+ this.interactiveLine = Le(r), this.handle.appendChild(this.interactiveLine), this.sourceArrow && (this.interactiveSourceArrow = Re(r), this.handle.appendChild(this.interactiveSourceArrow)), this.targetArrow && (this.interactiveTargetArrow = Re(r), this.handle.appendChild(this.interactiveTargetArrow)), this.group.appendChild(this.handle), this.baseEdge.onAfterRender.subscribe((e) => {
2131
1923
  this.interactiveLine.setAttribute("d", e.edgePath.path), this.interactiveSourceArrow && this.interactiveSourceArrow.setAttribute("d", e.sourceArrowPath), this.interactiveTargetArrow && this.interactiveTargetArrow.setAttribute("d", e.targetArrowPath);
2132
1924
  });
2133
1925
  }
2134
1926
  render(e) {
2135
1927
  this.baseEdge.render(e);
2136
1928
  }
2137
- }, Je = class {
1929
+ }, Ve = class {
2138
1930
  baseShape;
2139
1931
  midpointElement;
2140
1932
  group;
@@ -2142,9 +1934,9 @@ var re = (e, t) => {
2142
1934
  sourceArrow;
2143
1935
  targetArrow;
2144
1936
  onAfterRender;
2145
- svg;
1937
+ element;
2146
1938
  constructor(e, t) {
2147
- this.baseShape = e, this.midpointElement = t, this.svg = this.baseShape.svg, this.group = this.baseShape.group, this.line = this.baseShape.line, this.sourceArrow = this.baseShape.sourceArrow, this.targetArrow = this.baseShape.targetArrow, this.onAfterRender = this.baseShape.onAfterRender, this.svg.append(this.midpointElement), this.baseShape.onAfterRender.subscribe((e) => {
1939
+ this.baseShape = e, this.midpointElement = t, this.element = this.baseShape.element, this.group = this.baseShape.group, this.line = this.baseShape.line, this.sourceArrow = this.baseShape.sourceArrow, this.targetArrow = this.baseShape.targetArrow, this.onAfterRender = this.baseShape.onAfterRender, this.element.append(this.midpointElement), this.baseShape.onAfterRender.subscribe((e) => {
2148
1940
  let t = e.edgePath.midpoint, n = `translate(${t.x}px, ${t.y}px)`;
2149
1941
  this.midpointElement.style.setProperty("transform", n);
2150
1942
  });
@@ -2152,7 +1944,7 @@ var re = (e, t) => {
2152
1944
  render(e) {
2153
1945
  this.baseShape.render(e);
2154
1946
  }
2155
- }, Ye = class {
1947
+ }, He = class {
2156
1948
  graphStore;
2157
1949
  onAfterNodeAdded;
2158
1950
  onAfterNodeUpdated;
@@ -2265,7 +2057,7 @@ var re = (e, t) => {
2265
2057
  reset() {
2266
2058
  this.counter = 0;
2267
2059
  }
2268
- }, Xe = class {
2060
+ }, Ue = class {
2269
2061
  graphStore;
2270
2062
  htmlView;
2271
2063
  params;
@@ -2378,17 +2170,13 @@ var re = (e, t) => {
2378
2170
  destroy() {
2379
2171
  this.graphStore.onAfterNodeAdded.unsubscribe(this.onAfterNodeAdded), this.graphStore.onAfterNodeUpdated.unsubscribe(this.onAfterNodeUpdated), this.graphStore.onAfterNodePriorityUpdated.unsubscribe(this.onAfterNodePriorityUpdated), this.graphStore.onBeforeNodeRemoved.unsubscribe(this.onBeforeNodeRemoved), this.graphStore.onAfterPortUpdated.unsubscribe(this.onAfterPortUpdated), this.graphStore.onBeforePortRemoved.unsubscribe(this.onBeforePortUnmarked), this.graphStore.onAfterEdgeAdded.unsubscribe(this.onAfterEdgeAdded), this.graphStore.onAfterEdgeShapeUpdated.unsubscribe(this.onAfterEdgeShapeUpdated), this.graphStore.onAfterEdgeUpdated.unsubscribe(this.onAfterEdgeUpdated), this.graphStore.onAfterEdgePriorityUpdated.unsubscribe(this.onAfterEdgePriorityUpdated), this.graphStore.onBeforeEdgeRemoved.unsubscribe(this.onBeforeEdgeRemoved), this.graphStore.onBeforeClear.unsubscribe(this.onBeforeClear), this.htmlView.destroy();
2380
2172
  }
2381
- }, Ze = (e) => {
2382
- setTimeout(() => {
2383
- e();
2384
- });
2385
- }, Qe = (e) => {
2173
+ }, We = (e) => {
2386
2174
  queueMicrotask(() => {
2387
2175
  e();
2388
2176
  });
2389
2177
  }, B = (e) => {
2390
2178
  e();
2391
- }, $e = class {
2179
+ }, Ge = class {
2392
2180
  viewportStore;
2393
2181
  onBeforeUpdated;
2394
2182
  onAfterUpdated;
@@ -2411,7 +2199,7 @@ var re = (e, t) => {
2411
2199
  createViewportCoords(e) {
2412
2200
  return this.viewportStore.createViewportCoords(e);
2413
2201
  }
2414
- }, et = (e, t) => Symbol.iterator in e ? {
2202
+ }, Ke = (e, t) => Symbol.iterator in e ? {
2415
2203
  minContentScale: t.focus.minContentScale,
2416
2204
  nodes: e,
2417
2205
  contentPadding: t.focus.contentPadding,
@@ -2419,17 +2207,17 @@ var re = (e, t) => {
2419
2207
  } : {
2420
2208
  minContentScale: e.minContentScale ?? t.focus.minContentScale,
2421
2209
  nodes: e.nodes ?? [],
2422
- contentPadding: e.contentPadding ?? e.contentOffset ?? t.focus.contentPadding,
2210
+ contentPadding: e.contentPadding ?? t.focus.contentPadding,
2423
2211
  animationDuration: e.animationDuration ?? t.focus.animationDuration
2424
- }, tt = (e, t, n) => ({
2212
+ }, qe = (e, t, n) => ({
2425
2213
  scale: e.scale,
2426
2214
  x: e.x + e.scale * t,
2427
2215
  y: e.y + e.scale * n
2428
- }), nt = (e, t, n, r) => ({
2216
+ }), Je = (e, t, n, r) => ({
2429
2217
  scale: e.scale * t,
2430
2218
  x: e.scale * (1 - t) * n + e.x,
2431
2219
  y: e.scale * (1 - t) * r + e.y
2432
- }), rt = class {
2220
+ }), Ye = class {
2433
2221
  graphStore;
2434
2222
  viewportStore;
2435
2223
  params;
@@ -2447,16 +2235,16 @@ var re = (e, t) => {
2447
2235
  let { width: n, height: r } = this.viewportStore.getDimensions(), i = {
2448
2236
  x: n / 2,
2449
2237
  y: r / 2
2450
- }, a = this.viewportStore.getViewportMatrix(), o = this.viewportStore.createViewportCoords(e), s = tt(a, o.x - i.x, o.y - i.y), c = t?.contentScale;
2238
+ }, a = this.viewportStore.getViewportMatrix(), o = this.viewportStore.createViewportCoords(e), s = qe(a, o.x - i.x, o.y - i.y), c = t?.contentScale;
2451
2239
  if (c !== void 0) {
2452
2240
  let e = 1 / c;
2453
- s = nt(s, e / a.scale, i.x, i.y);
2241
+ s = Je(s, e / a.scale, i.x, i.y);
2454
2242
  }
2455
2243
  let l = t?.animationDuration ?? 0;
2456
2244
  l > 0 ? this.animateNavigation(a, s, l) : this.viewportStore.patchViewportMatrix(s);
2457
2245
  }
2458
2246
  focus(e) {
2459
- let t = et(e ?? {}, this.params);
2247
+ let t = Ke(e ?? {}, this.params);
2460
2248
  this.params.focus.schedule(() => {
2461
2249
  this.navigate(t);
2462
2250
  });
@@ -2498,11 +2286,11 @@ var re = (e, t) => {
2498
2286
  };
2499
2287
  this.win.requestAnimationFrame(a);
2500
2288
  }
2501
- }, it = (e, t, n) => {
2289
+ }, Xe = (e, t, n) => {
2502
2290
  let r = new h();
2503
- return new d(new Ye(r), new $e(t), new Xe(r, new a(r, t, e), {
2291
+ return new d(new He(r), new Ge(t), new Ue(r, new a(r, t, e), {
2504
2292
  nodes: {
2505
- centerFn: ie,
2293
+ centerFn: re,
2506
2294
  priorityFn: () => 0
2507
2295
  },
2508
2296
  edges: {
@@ -2510,13 +2298,13 @@ var re = (e, t) => {
2510
2298
  priorityFn: () => 0
2511
2299
  },
2512
2300
  ports: { direction: 0 }
2513
- }), new rt(r, t, { focus: {
2301
+ }), new Ye(r, t, { focus: {
2514
2302
  contentPadding: 0,
2515
2303
  minContentScale: 0,
2516
2304
  schedule: B,
2517
2305
  animationDuration: 0
2518
2306
  } }, n));
2519
- }, V = Symbol(), at = class e {
2307
+ }, V = Symbol(), Ze = class e {
2520
2308
  canvas;
2521
2309
  window;
2522
2310
  pointInsideVerifier;
@@ -2610,7 +2398,7 @@ var re = (e, t) => {
2610
2398
  removeWindowTouchListeners() {
2611
2399
  this.window.removeEventListener("touchmove", this.onWindowTouchMove), this.window.removeEventListener("touchend", this.onWindowTouchFinish), this.window.removeEventListener("touchcancel", this.onWindowTouchFinish);
2612
2400
  }
2613
- }, H = Symbol(), ot = class {
2401
+ }, H = Symbol(), Qe = class {
2614
2402
  has(e, t) {
2615
2403
  let n = e[H];
2616
2404
  return n !== void 0 && n.has(t);
@@ -2700,10 +2488,10 @@ var re = (e, t) => {
2700
2488
  let r = Math.sqrt(e * e + t * t);
2701
2489
  this.movedDistance += r, this.movedDistance > this.movementThreshold && n();
2702
2490
  }
2703
- }, st = (e, t) => ({
2491
+ }, G = (e, t) => ({
2704
2492
  from: e.isDirect ? e.staticPortId : t,
2705
2493
  to: e.isDirect ? t : e.staticPortId
2706
- }), ct = class {
2494
+ }), $e = class {
2707
2495
  graph;
2708
2496
  connectionAllowedVerifier;
2709
2497
  constructor(e, t) {
@@ -2714,7 +2502,7 @@ var re = (e, t) => {
2714
2502
  return this.graph.getAllPortIds().forEach((i) => {
2715
2503
  let { element: a, direction: o, nodeId: s } = this.graph.getPort(i), { x: c, y: l } = this.graph.getNode(s);
2716
2504
  if (c === null || l === null) return;
2717
- let u = st(e, i);
2505
+ let u = G(e, i);
2718
2506
  if (!this.connectionAllowedVerifier(u)) return;
2719
2507
  let { top: d, left: f, width: p, height: m } = a.getBoundingClientRect(), h = {
2720
2508
  x: f + p / 2,
@@ -2723,7 +2511,7 @@ var re = (e, t) => {
2723
2511
  v < n && (n = v, t = o);
2724
2512
  }), t;
2725
2513
  }
2726
- }, lt = class {
2514
+ }, et = class {
2727
2515
  direction;
2728
2516
  constructor(e) {
2729
2517
  this.direction = e;
@@ -2731,7 +2519,7 @@ var re = (e, t) => {
2731
2519
  resolve() {
2732
2520
  return this.direction;
2733
2521
  }
2734
- }, ut = class e {
2522
+ }, tt = class e {
2735
2523
  canvas;
2736
2524
  element;
2737
2525
  window;
@@ -2768,19 +2556,14 @@ var re = (e, t) => {
2768
2556
  nodeId: r,
2769
2557
  dx: a.x - i.x,
2770
2558
  dy: a.y - i.y
2771
- }, C(this.element, this.params.dragCursor), this.moveNodeOnTop(r), this.window.addEventListener("mousemove", this.onWindowMouseMove, { passive: !0 }), this.window.addEventListener("mouseup", this.onWindowMouseUp, { passive: !0 });
2559
+ }, w(this.element, this.params.dragCursor), this.moveNodeOnTop(r), this.window.addEventListener("mousemove", this.onWindowMouseMove, { passive: !0 }), this.window.addEventListener("mouseup", this.onWindowMouseUp, { passive: !0 });
2772
2560
  };
2773
2561
  onTouchStart = (e) => {
2774
2562
  if (this.eventTagger.has(e, V)) return;
2775
2563
  let t = e;
2776
2564
  if (t.touches.length !== 1) return;
2777
2565
  let n = t.touches[0], r = e.currentTarget, i = this.canvas.graph.findNodeIdByElement(r), a = this.graph.getNode(i);
2778
- if (!this.params.nodeDragVerifier({
2779
- nodeId: i,
2780
- element: a.element,
2781
- x: a.x,
2782
- y: a.y
2783
- })) return;
2566
+ if (!this.params.nodeDragVerifier(i)) return;
2784
2567
  this.eventTagger.tag(e, V);
2785
2568
  let o = this.calculateContentPoint({
2786
2569
  x: n.clientX,
@@ -2858,7 +2641,7 @@ var re = (e, t) => {
2858
2641
  }
2859
2642
  }
2860
2643
  stopMouseDrag() {
2861
- this.finishDrag(), C(this.element, null), this.removeMouseDragListeners();
2644
+ this.finishDrag(), w(this.element, null), this.removeMouseDragListeners();
2862
2645
  }
2863
2646
  removeMouseDragListeners() {
2864
2647
  this.window.removeEventListener("mouseup", this.onWindowMouseUp), this.window.removeEventListener("mousemove", this.onWindowMouseMove);
@@ -2895,7 +2678,7 @@ var re = (e, t) => {
2895
2678
  let e = this.grabbedNodeState.nodeId;
2896
2679
  this.graph.hasNode(e) && this.params.onNodeDragFinished(e), this.grabbedNodeState = null;
2897
2680
  }
2898
- }, G = (e) => {
2681
+ }, K = (e) => {
2899
2682
  let t = [], n = e.touches.length;
2900
2683
  for (let r = 0; r < n; r++) t.push([e.touches[r].clientX, e.touches[r].clientY]);
2901
2684
  let r = t.reduce((e, t) => [e[0] + t[0], e[1] + t[1]], [0, 0]), i = [r[0] / n, r[1] / n], a = t.map((e) => [e[0] - i[0], e[1] - i[1]]).reduce((e, t) => e + Math.sqrt(t[0] * t[0] + t[1] * t[1]), 0);
@@ -2906,7 +2689,7 @@ var re = (e, t) => {
2906
2689
  touchesCnt: n,
2907
2690
  touches: t
2908
2691
  };
2909
- }, dt = class e {
2692
+ }, nt = class e {
2910
2693
  canvas;
2911
2694
  element;
2912
2695
  window;
@@ -2921,7 +2704,7 @@ var re = (e, t) => {
2921
2704
  this.removeMouseDragListeners(), this.removeTouchDragListeners();
2922
2705
  };
2923
2706
  onMouseDown = (e) => {
2924
- this.eventTagger.has(e, V) || this.params.mouseDownEventVerifier(e) && (C(this.element, this.params.shiftCursor), this.window.addEventListener("mousemove", this.onWindowMouseMove, { passive: !0 }), this.window.addEventListener("mouseup", this.onWindowMouseUp, { passive: !0 }), this.startRegisteredTransform());
2707
+ this.eventTagger.has(e, V) || this.params.mouseDownEventVerifier(e) && (w(this.element, this.params.shiftCursor), this.window.addEventListener("mousemove", this.onWindowMouseMove, { passive: !0 }), this.window.addEventListener("mouseup", this.onWindowMouseUp, { passive: !0 }), this.startRegisteredTransform());
2925
2708
  };
2926
2709
  onWindowMouseMove = (e) => {
2927
2710
  let t = this.pointInsideVerifier.verify(e.clientX, e.clientY);
@@ -2945,14 +2728,14 @@ var re = (e, t) => {
2945
2728
  onTouchStart = (e) => {
2946
2729
  if (!this.eventTagger.has(e, V)) {
2947
2730
  if (this.prevTouches !== null) {
2948
- this.prevTouches = G(e);
2731
+ this.prevTouches = K(e);
2949
2732
  return;
2950
2733
  }
2951
- this.prevTouches = G(e), this.window.addEventListener("touchmove", this.onWindowTouchMove, { passive: !0 }), this.window.addEventListener("touchend", this.onWindowTouchFinish, { passive: !0 }), this.window.addEventListener("touchcancel", this.onWindowTouchFinish, { passive: !0 }), this.startRegisteredTransform();
2734
+ this.prevTouches = K(e), this.window.addEventListener("touchmove", this.onWindowTouchMove, { passive: !0 }), this.window.addEventListener("touchend", this.onWindowTouchFinish, { passive: !0 }), this.window.addEventListener("touchcancel", this.onWindowTouchFinish, { passive: !0 }), this.startRegisteredTransform();
2952
2735
  }
2953
2736
  };
2954
2737
  onWindowTouchMove = (e) => {
2955
- let t = G(e);
2738
+ let t = K(e);
2956
2739
  if (!t.touches.every((e) => this.pointInsideVerifier.verify(e[0], e[1]))) {
2957
2740
  this.stopTouchDrag();
2958
2741
  return;
@@ -2968,7 +2751,7 @@ var re = (e, t) => {
2968
2751
  this.prevTouches = t;
2969
2752
  };
2970
2753
  onWindowTouchFinish = (e) => {
2971
- e.touches.length > 0 ? this.prevTouches = G(e) : this.stopTouchDrag();
2754
+ e.touches.length > 0 ? this.prevTouches = K(e) : this.stopTouchDrag();
2972
2755
  };
2973
2756
  preventWheelScaleListener = (e) => {
2974
2757
  e.preventDefault();
@@ -2982,25 +2765,29 @@ var re = (e, t) => {
2982
2765
  new e(t, n, r, i, a, o);
2983
2766
  }
2984
2767
  moveViewport(e, t) {
2985
- let n = this.viewport.getViewportMatrix(), r = tt(n, e, t), { width: i, height: a } = this.viewport.getDimensions(), o = this.params.transformPreprocessor({
2768
+ let n = this.viewport.getViewportMatrix(), r = qe(n, e, t), { width: i, height: a } = this.viewport.getDimensions(), o = this.params.transformPreprocessor({
2986
2769
  prevTransform: n,
2987
2770
  nextTransform: r,
2988
- canvasWidth: i,
2989
- canvasHeight: a
2771
+ viewport: {
2772
+ width: i,
2773
+ height: a
2774
+ }
2990
2775
  });
2991
2776
  this.performTransform(o);
2992
2777
  }
2993
2778
  scaleViewport(e, t, n) {
2994
- let r = this.canvas.viewport.getViewportMatrix(), i = nt(r, e, t, n), { width: a, height: o } = this.viewport.getDimensions(), s = this.params.transformPreprocessor({
2779
+ let r = this.canvas.viewport.getViewportMatrix(), i = Je(r, e, t, n), { width: a, height: o } = this.viewport.getDimensions(), s = this.params.transformPreprocessor({
2995
2780
  prevTransform: r,
2996
2781
  nextTransform: i,
2997
- canvasWidth: a,
2998
- canvasHeight: o
2782
+ viewport: {
2783
+ width: a,
2784
+ height: o
2785
+ }
2999
2786
  });
3000
2787
  this.performTransform(s);
3001
2788
  }
3002
2789
  stopMouseDrag() {
3003
- C(this.element, null), this.removeMouseDragListeners(), this.finishRegisteredTransform();
2790
+ w(this.element, null), this.removeMouseDragListeners(), this.finishRegisteredTransform();
3004
2791
  }
3005
2792
  removeMouseDragListeners() {
3006
2793
  this.window.removeEventListener("mousemove", this.onWindowMouseMove), this.window.removeEventListener("mouseup", this.onWindowMouseUp);
@@ -3024,12 +2811,14 @@ var re = (e, t) => {
3024
2811
  let e = this.viewport.getViewportMatrix(), { width: t, height: n } = this.viewport.getDimensions(), r = this.params.transformPreprocessor({
3025
2812
  prevTransform: e,
3026
2813
  nextTransform: e,
3027
- canvasWidth: t,
3028
- canvasHeight: n
2814
+ viewport: {
2815
+ width: t,
2816
+ height: n
2817
+ }
3029
2818
  });
3030
2819
  this.params.onResizeTransformStarted(), this.canvas.patchViewportMatrix(r), this.params.onResizeTransformFinished();
3031
2820
  }
3032
- }, ft = class e {
2821
+ }, rt = class e {
3033
2822
  canvas;
3034
2823
  element;
3035
2824
  window;
@@ -3082,7 +2871,7 @@ var re = (e, t) => {
3082
2871
  this.scheduleLoadAreaAroundViewport(), r.onTransformFinished();
3083
2872
  }
3084
2873
  };
3085
- dt.configure(e, this.element, this.window, this.pointInsideVerifier, o, c), this.trigger.subscribe(this.updateLoadedArea), this.canvas.viewport.onAfterUpdated.subscribe(this.onAfterViewportUpdated);
2874
+ nt.configure(e, this.element, this.window, this.pointInsideVerifier, o, c), this.trigger.subscribe(this.updateLoadedArea), this.canvas.viewport.onAfterUpdated.subscribe(this.onAfterViewportUpdated);
3086
2875
  }
3087
2876
  static configure(t, n, r, i, a, o, s, c) {
3088
2877
  new e(t, n, r, i, a, o, s, c);
@@ -3107,21 +2896,21 @@ var re = (e, t) => {
3107
2896
  height: u
3108
2897
  });
3109
2898
  }
3110
- }, pt = () => {
2899
+ }, it = () => {
3111
2900
  let e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
3112
2901
  return e.style.position = "absolute", e.style.inset = "0", e;
3113
- }, mt = () => {
2902
+ }, at = () => {
3114
2903
  let e = document.createElementNS("http://www.w3.org/2000/svg", "rect");
3115
2904
  return e.setAttribute("fill", "url(#pattern)"), e;
3116
- }, ht = () => {
2905
+ }, ot = () => {
3117
2906
  let e = document.createElementNS("http://www.w3.org/2000/svg", "pattern");
3118
2907
  return e.setAttribute("id", "pattern"), e;
3119
- }, gt = class e {
2908
+ }, st = class e {
3120
2909
  canvas;
3121
2910
  backgroundHost;
3122
- svg = pt();
3123
- patternRenderingRectangle = mt();
3124
- pattern = ht();
2911
+ svg = it();
2912
+ patternRenderingRectangle = at();
2913
+ pattern = ot();
3125
2914
  patternContent;
3126
2915
  tileWidth;
3127
2916
  tileHeight;
@@ -3156,7 +2945,7 @@ var re = (e, t) => {
3156
2945
  this.pattern.setAttribute("width", `${n}`), this.pattern.setAttribute("height", `${r}`);
3157
2946
  }
3158
2947
  }
3159
- }, _t = class e {
2948
+ }, ct = class e {
3160
2949
  canvas;
3161
2950
  overlayLayer;
3162
2951
  viewportStore;
@@ -3170,7 +2959,7 @@ var re = (e, t) => {
3170
2959
  this.params.onAfterEdgeCreated(e);
3171
2960
  };
3172
2961
  constructor(e, t, n, r, i, a, o) {
3173
- this.canvas = e, this.overlayLayer = t, this.viewportStore = n, this.window = r, this.pointInsideVerifier = i, this.eventTagger = a, this.params = o, this.overlayCanvas = it(this.overlayLayer, this.viewportStore, this.window);
2962
+ this.canvas = e, this.overlayLayer = t, this.viewportStore = n, this.window = r, this.pointInsideVerifier = i, this.eventTagger = a, this.params = o, this.overlayCanvas = Xe(this.overlayLayer, this.viewportStore, this.window);
3174
2963
  let s = {
3175
2964
  mouseDownEventVerifier: this.params.mouseDownEventVerifier,
3176
2965
  mouseUpEventVerifier: this.params.mouseUpEventVerifier,
@@ -3189,7 +2978,7 @@ var re = (e, t) => {
3189
2978
  this.resetDragState(), this.params.onEdgeCreationInterrupted(e);
3190
2979
  }
3191
2980
  };
3192
- at.configure(this.canvas, this.window, this.pointInsideVerifier, this.eventTagger, s);
2981
+ Ze.configure(this.canvas, this.window, this.pointInsideVerifier, this.eventTagger, s);
3193
2982
  }
3194
2983
  static configure(t, n, r, i, a, o, s) {
3195
2984
  new e(t, n, r, i, a, o, s);
@@ -3202,7 +2991,7 @@ var re = (e, t) => {
3202
2991
  x: t.x - s.x,
3203
2992
  y: t.y - s.y
3204
2993
  }), u = {
3205
- overlayNodeId: T.StaticNodeId,
2994
+ overlayNodeId: E.StaticNodeId,
3206
2995
  portCoords: c,
3207
2996
  portDirection: r.direction
3208
2997
  }, d = n === "direct";
@@ -3214,26 +3003,26 @@ var re = (e, t) => {
3214
3003
  cursor: t,
3215
3004
  ...this.edgeInProgress
3216
3005
  }), p = {
3217
- overlayNodeId: T.DraggingNodeId,
3006
+ overlayNodeId: E.DraggingNodeId,
3218
3007
  portCoords: l,
3219
3008
  portDirection: f ?? r.direction
3220
3009
  }, [m, h] = d ? [u, p] : [p, u];
3221
- this.overlayCanvas.addNode(w(m)), this.overlayCanvas.addNode(w(h)), this.overlayCanvas.addEdge({
3010
+ this.overlayCanvas.addNode(T(m)), this.overlayCanvas.addNode(T(h)), this.overlayCanvas.addEdge({
3222
3011
  from: m.overlayNodeId,
3223
3012
  to: h.overlayNodeId,
3224
- shape: this.params.edgeShapeFactory(T.EdgeId)
3013
+ shape: this.params.edgeShapeFactory(E.EdgeId)
3225
3014
  });
3226
3015
  }
3227
3016
  resetDragState() {
3228
3017
  this.edgeInProgress = null, this.overlayCanvas.clear();
3229
3018
  }
3230
3019
  tryCreateConnection(e) {
3231
- let t = re(this.canvas.graph, e);
3020
+ let t = ne(this.canvas.graph, e);
3232
3021
  if (t === null) {
3233
3022
  this.params.onEdgeCreationInterrupted(this.edgeInProgress);
3234
3023
  return;
3235
3024
  }
3236
- let n = st(this.edgeInProgress, t), r = this.params.connectionAllowedVerifier(n), i = this.params.connectionPreprocessor({
3025
+ let n = G(this.edgeInProgress, t), r = this.params.connectionAllowedVerifier(n), i = this.params.connectionPreprocessor({
3237
3026
  from: n.from,
3238
3027
  to: n.to
3239
3028
  });
@@ -3247,12 +3036,12 @@ var re = (e, t) => {
3247
3036
  cursor: e,
3248
3037
  ...this.edgeInProgress
3249
3038
  });
3250
- this.overlayCanvas.updateNode(T.DraggingNodeId, {
3039
+ this.overlayCanvas.updateNode(E.DraggingNodeId, {
3251
3040
  x: n.x,
3252
3041
  y: n.y
3253
- }).updatePort(T.DraggingNodeId, { direction: r });
3042
+ }).updatePort(E.DraggingNodeId, { direction: r });
3254
3043
  }
3255
- }, vt = class e {
3044
+ }, lt = class e {
3256
3045
  canvas;
3257
3046
  overlayLayer;
3258
3047
  viewportStore;
@@ -3267,7 +3056,7 @@ var re = (e, t) => {
3267
3056
  this.params.onAfterEdgeReattached(e);
3268
3057
  };
3269
3058
  constructor(e, t, n, r, i, a, o) {
3270
- this.canvas = e, this.overlayLayer = t, this.viewportStore = n, this.window = r, this.pointInsideVerifier = i, this.eventTagger = a, this.params = o, this.overlayCanvas = it(this.overlayLayer, this.viewportStore, this.window);
3059
+ this.canvas = e, this.overlayLayer = t, this.viewportStore = n, this.window = r, this.pointInsideVerifier = i, this.eventTagger = a, this.params = o, this.overlayCanvas = Xe(this.overlayLayer, this.viewportStore, this.window);
3271
3060
  let s = {
3272
3061
  mouseDownEventVerifier: this.params.mouseDownEventVerifier,
3273
3062
  mouseUpEventVerifier: this.params.mouseUpEventVerifier,
@@ -3289,7 +3078,7 @@ var re = (e, t) => {
3289
3078
  });
3290
3079
  }
3291
3080
  };
3292
- at.configure(this.canvas, this.window, this.pointInsideVerifier, this.eventTagger, s);
3081
+ Ze.configure(this.canvas, this.window, this.pointInsideVerifier, this.eventTagger, s);
3293
3082
  }
3294
3083
  static configure(t, n, r, i, a, o, s) {
3295
3084
  new e(t, n, r, i, a, o, s);
@@ -3320,21 +3109,21 @@ var re = (e, t) => {
3320
3109
  priority: r.priority
3321
3110
  }, this.canvas.removeEdge(n);
3322
3111
  let m = {
3323
- overlayNodeId: T.StaticNodeId,
3112
+ overlayNodeId: E.StaticNodeId,
3324
3113
  portCoords: f,
3325
3114
  portDirection: c.direction
3326
3115
  }, h = this.params.draggingPortDirectionResolver.resolve({
3327
3116
  cursor: t,
3328
3117
  ...this.edgeInProgress
3329
3118
  }), g = {
3330
- overlayNodeId: T.DraggingNodeId,
3119
+ overlayNodeId: E.DraggingNodeId,
3331
3120
  portCoords: p,
3332
3121
  portDirection: h ?? s.direction
3333
3122
  }, [_, v] = a ? [m, g] : [g, m];
3334
- this.overlayCanvas.addNode(w(_)), this.overlayCanvas.addNode(w(v));
3335
- let y = this.params.draggingEdgeShapeFactory === null ? r.shape : this.params.draggingEdgeShapeFactory(T.EdgeId);
3123
+ this.overlayCanvas.addNode(T(_)), this.overlayCanvas.addNode(T(v));
3124
+ let y = this.params.draggingEdgeShapeFactory === null ? r.shape : this.params.draggingEdgeShapeFactory(E.EdgeId);
3336
3125
  return this.overlayCanvas.addEdge({
3337
- id: T.EdgeId,
3126
+ id: E.EdgeId,
3338
3127
  from: _.overlayNodeId,
3339
3128
  to: v.overlayNodeId,
3340
3129
  shape: y
@@ -3351,14 +3140,14 @@ var re = (e, t) => {
3351
3140
  cursor: e,
3352
3141
  ...this.edgeInProgress
3353
3142
  });
3354
- this.overlayCanvas.updateNode(T.DraggingNodeId, {
3143
+ this.overlayCanvas.updateNode(E.DraggingNodeId, {
3355
3144
  x: r.x,
3356
3145
  y: r.y
3357
- }).updatePort(T.DraggingNodeId, { direction: i });
3146
+ }).updatePort(E.DraggingNodeId, { direction: i });
3358
3147
  }
3359
3148
  tryCreateConnection(e) {
3360
- let t = re(this.canvas.graph, e);
3361
- if (this.overlayCanvas.removeEdge(T.EdgeId), t === null) {
3149
+ let t = ne(this.canvas.graph, e);
3150
+ if (this.overlayCanvas.removeEdge(E.EdgeId), t === null) {
3362
3151
  let e = this.draggingEdgePayload;
3363
3152
  this.params.onEdgeReattachInterrupted({
3364
3153
  id: e.id,
@@ -3369,7 +3158,7 @@ var re = (e, t) => {
3369
3158
  });
3370
3159
  return;
3371
3160
  }
3372
- let { from: n, to: r } = st(this.edgeInProgress, t), i = this.draggingEdgePayload, a = {
3161
+ let { from: n, to: r } = G(this.edgeInProgress, t), i = this.draggingEdgePayload, a = {
3373
3162
  id: i.id,
3374
3163
  from: n,
3375
3164
  to: r,
@@ -3391,7 +3180,7 @@ var re = (e, t) => {
3391
3180
  });
3392
3181
  }
3393
3182
  }
3394
- }, yt = class e {
3183
+ }, ut = class e {
3395
3184
  applier;
3396
3185
  trigger;
3397
3186
  constructor(e, t) {
@@ -3402,7 +3191,7 @@ var re = (e, t) => {
3402
3191
  static configure(t, n) {
3403
3192
  new e(t, n);
3404
3193
  }
3405
- }, bt = class e {
3194
+ }, dt = class e {
3406
3195
  graph;
3407
3196
  applier;
3408
3197
  defererFn;
@@ -3427,7 +3216,7 @@ var re = (e, t) => {
3427
3216
  scheduleApply() {
3428
3217
  this.applyScheduled || (this.applyScheduled = !0, this.defererFn(this.apply));
3429
3218
  }
3430
- }, xt = class {
3219
+ }, ft = class {
3431
3220
  canvas;
3432
3221
  layoutAlgorithm;
3433
3222
  params;
@@ -3443,23 +3232,23 @@ var re = (e, t) => {
3443
3232
  this.params.staticNodeResolver(t) || this.canvas.updateNode(t, e);
3444
3233
  }), this.params.onAfterApplied();
3445
3234
  }
3446
- }, St = class {
3235
+ }, pt = class {
3447
3236
  static configure(e, t) {
3448
- let n = t.applyOn, r = new xt(e, t.algorithm, {
3237
+ let n = t.applyOn, r = new ft(e, t.algorithm, {
3449
3238
  staticNodeResolver: t.staticNodeResolver,
3450
3239
  onBeforeApplied: t.onBeforeApplied,
3451
3240
  onAfterApplied: t.onAfterApplied
3452
3241
  });
3453
3242
  switch (n.type) {
3454
3243
  case "trigger":
3455
- yt.configure(r, n.trigger);
3244
+ ut.configure(r, n.trigger);
3456
3245
  break;
3457
3246
  case "topologyChangeSchedule":
3458
- bt.configure(e.graph, r, n.schedule);
3247
+ dt.configure(e.graph, r, n.schedule);
3459
3248
  break;
3460
3249
  }
3461
3250
  }
3462
- }, Ct = class {
3251
+ }, mt = class {
3463
3252
  win;
3464
3253
  callback;
3465
3254
  previousTimeStamp = void 0;
@@ -3474,7 +3263,7 @@ var re = (e, t) => {
3474
3263
  constructor(e, t) {
3475
3264
  this.win = e, this.callback = t, this.win.requestAnimationFrame(this.step);
3476
3265
  }
3477
- }, wt = class {
3266
+ }, ht = class {
3478
3267
  canvas;
3479
3268
  layoutAlgorithm;
3480
3269
  params;
@@ -3491,23 +3280,23 @@ var re = (e, t) => {
3491
3280
  this.params.staticNodeResolver(t) || this.canvas.updateNode(t, e);
3492
3281
  }), this.params.onAfterApplied();
3493
3282
  }
3494
- }, Tt = class e {
3283
+ }, gt = class e {
3495
3284
  win;
3496
3285
  applier;
3497
3286
  step = (e) => {
3498
3287
  this.applier.apply(e);
3499
3288
  };
3500
3289
  constructor(e, t, n) {
3501
- this.win = n, this.applier = new wt(e, t.algorithm, {
3290
+ this.win = n, this.applier = new ht(e, t.algorithm, {
3502
3291
  staticNodeResolver: t.staticNodeResolver,
3503
3292
  onBeforeApplied: t.onBeforeApplied,
3504
3293
  onAfterApplied: t.onAfterApplied
3505
- }), new Ct(this.win, this.step);
3294
+ }), new mt(this.win, this.step);
3506
3295
  }
3507
3296
  static configure(t, n, r) {
3508
3297
  new e(t, n, r);
3509
3298
  }
3510
- }, Et = class e {
3299
+ }, _t = class e {
3511
3300
  canvas;
3512
3301
  window;
3513
3302
  pointInsideVerifier;
@@ -3543,7 +3332,7 @@ var re = (e, t) => {
3543
3332
  static configure(t, n, r, i, a) {
3544
3333
  new e(t, n, r, i, a);
3545
3334
  }
3546
- }, Dt = class e {
3335
+ }, vt = class e {
3547
3336
  canvas;
3548
3337
  window;
3549
3338
  pointInsideVerifier;
@@ -3553,16 +3342,16 @@ var re = (e, t) => {
3553
3342
  onEdgeSelected;
3554
3343
  onAfterEdgeAdded = (e) => {
3555
3344
  let { shape: t } = this.canvas.graph.getEdge(e);
3556
- this.configurator.enable(t.svg);
3345
+ this.configurator.enable(t.element);
3557
3346
  };
3558
3347
  onBeforeEdgeRemoved = (e) => {
3559
3348
  let { shape: t } = this.canvas.graph.getEdge(e);
3560
- this.configurator.disable(t.svg);
3349
+ this.configurator.disable(t.element);
3561
3350
  };
3562
3351
  reset = () => {
3563
3352
  this.canvas.graph.getAllEdgeIds().forEach((e) => {
3564
3353
  let { shape: t } = this.canvas.graph.getEdge(e);
3565
- this.configurator.disable(t.svg);
3354
+ this.configurator.disable(t.element);
3566
3355
  });
3567
3356
  };
3568
3357
  constructor(e, t, n, r, i) {
@@ -3579,7 +3368,7 @@ var re = (e, t) => {
3579
3368
  static configure(t, n, r, i, a) {
3580
3369
  new e(t, n, r, i, a);
3581
3370
  }
3582
- }, Ot = class e {
3371
+ }, yt = class e {
3583
3372
  canvas;
3584
3373
  element;
3585
3374
  window;
@@ -3603,29 +3392,29 @@ var re = (e, t) => {
3603
3392
  static configure(t, n, r, i, a, o) {
3604
3393
  new e(t, n, r, i, a, o);
3605
3394
  }
3606
- }, kt = () => {
3395
+ }, bt = () => {
3607
3396
  let e = document.createElement("div");
3608
3397
  return e.style.width = "100%", e.style.height = "100%", e.style.position = "relative", e;
3609
- }, At = () => {
3398
+ }, q = () => {
3610
3399
  let e = document.createElement("div");
3611
3400
  return e.style.position = "absolute", e.style.inset = "0", e;
3612
- }, jt = () => {
3613
- let e = At();
3401
+ }, xt = () => {
3402
+ let e = q();
3614
3403
  return e.style.pointerEvents = "none", e;
3615
- }, Mt = class {
3404
+ }, St = class {
3616
3405
  element;
3617
- background = At();
3618
- main = At();
3619
- overlayConnectablePorts = jt();
3620
- overlayDraggableEdges = jt();
3621
- host = kt();
3406
+ background = q();
3407
+ main = q();
3408
+ overlayConnectablePorts = xt();
3409
+ overlayDraggableEdges = xt();
3410
+ host = bt();
3622
3411
  constructor(e) {
3623
3412
  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);
3624
3413
  }
3625
3414
  destroy() {
3626
3415
  this.host.removeChild(this.background), this.host.removeChild(this.main), this.host.removeChild(this.overlayConnectablePorts), this.host.removeChild(this.overlayDraggableEdges), this.element.removeChild(this.host);
3627
3416
  }
3628
- }, K = Object.freeze({
3417
+ }, J = Object.freeze({
3629
3418
  seed: "HTMLGraph is awesome",
3630
3419
  maxTimeDeltaSec: .01,
3631
3420
  nodeCharge: 1e5,
@@ -3639,14 +3428,14 @@ var re = (e, t) => {
3639
3428
  nodeForceCoefficient: 1,
3640
3429
  barnesHutAreaRadiusThreshold: .01,
3641
3430
  barnesHutTheta: 1
3642
- }), q = Object.freeze({
3431
+ }), Y = Object.freeze({
3643
3432
  mouseDownEventVerifier: (e) => e.button === 0,
3644
3433
  mouseUpEventVerifier: (e) => e.button === 0,
3645
3434
  movementThreshold: 10
3646
- }), J = () => {}, Nt = (e, t, n) => e === "closest-connectable-port" || e === "nearest-connectable-port" ? new ct(t, n) : new lt(e), Y = (e) => {
3435
+ }), X = () => {}, Ct = (e, t, n) => e === "nearest-connectable-port" ? new $e(t, n) : typeof e == "number" ? new et(e) : new et(void 0), wt = (e) => {
3647
3436
  if (typeof e == "function") return e;
3648
3437
  switch (e.type) {
3649
- case "straight": return () => new Pe({
3438
+ case "straight": return () => new Ae({
3650
3439
  color: e.color,
3651
3440
  width: e.width,
3652
3441
  arrowLength: e.arrowLength,
@@ -3659,31 +3448,7 @@ var re = (e, t) => {
3659
3448
  detourDistance: e.detourDistance,
3660
3449
  detourDirection: e.detourDirection
3661
3450
  });
3662
- case "horizontal": return () => new Ne({
3663
- color: e.color,
3664
- width: e.width,
3665
- arrowLength: e.arrowLength,
3666
- arrowOffset: e.arrowOffset,
3667
- arrowRenderer: e.arrowRenderer,
3668
- hasSourceArrow: e.hasSourceArrow,
3669
- hasTargetArrow: e.hasTargetArrow,
3670
- cycleSquareSide: e.cycleSquareSide,
3671
- roundness: e.roundness,
3672
- detourDistance: e.detourDistance
3673
- });
3674
- case "vertical": return () => new Le({
3675
- color: e.color,
3676
- width: e.width,
3677
- arrowLength: e.arrowLength,
3678
- arrowOffset: e.arrowOffset,
3679
- arrowRenderer: e.arrowRenderer,
3680
- hasSourceArrow: e.hasSourceArrow,
3681
- hasTargetArrow: e.hasTargetArrow,
3682
- cycleSquareSide: e.cycleSquareSide,
3683
- roundness: e.roundness,
3684
- detourDistance: e.detourDistance
3685
- });
3686
- case "orthogonal": return () => new ze({
3451
+ case "orthogonal": return () => new Me({
3687
3452
  color: e.color,
3688
3453
  width: e.width,
3689
3454
  arrowLength: e.arrowLength,
@@ -3705,7 +3470,7 @@ var re = (e, t) => {
3705
3470
  sourceOffset: e.sourceOffset,
3706
3471
  targetOffset: e.targetOffset
3707
3472
  });
3708
- default: return () => new je({
3473
+ default: return () => new ke({
3709
3474
  color: e.color,
3710
3475
  width: e.width,
3711
3476
  arrowLength: e.arrowLength,
@@ -3719,7 +3484,7 @@ var re = (e, t) => {
3719
3484
  detourDirection: e.detourDirection
3720
3485
  });
3721
3486
  }
3722
- }, Pt = (e) => {
3487
+ }, Tt = (e) => {
3723
3488
  let t = e.nodeDragVerifier ?? (() => !0), n = e.moveOnTop !== !1, r = e.moveEdgesOnTop !== !1 && n, i = e.mouse?.dragCursor, a = i === void 0 ? "grab" : i, o = e.mouse?.mouseDownEventVerifier, s = o === void 0 ? (e) => e.button === 0 : o, c = e.mouse?.mouseUpEventVerifier, l = c === void 0 ? (e) => e.button === 0 : c;
3724
3489
  return {
3725
3490
  moveOnTop: n,
@@ -3728,26 +3493,26 @@ var re = (e, t) => {
3728
3493
  gridSize: e.gridSize ?? null,
3729
3494
  mouseDownEventVerifier: s,
3730
3495
  mouseUpEventVerifier: l,
3731
- onNodeDragStarted: e.events?.onNodeDragStarted ?? J,
3732
- onNodeDrag: e.events?.onNodeDrag ?? J,
3496
+ onNodeDragStarted: e.events?.onNodeDragStarted ?? X,
3497
+ onNodeDrag: e.events?.onNodeDrag ?? X,
3733
3498
  nodeDragVerifier: t,
3734
- onNodeDragFinished: e.events?.onNodeDragFinished ?? J
3499
+ onNodeDragFinished: e.events?.onNodeDragFinished ?? X
3735
3500
  };
3736
- }, Ft = (e) => {
3501
+ }, Et = (e) => {
3737
3502
  let t = e.minX === null ? -Infinity : e.minX, n = e.maxX === null ? Infinity : e.maxX, r = e.minY === null ? -Infinity : e.minY, i = e.maxY === null ? Infinity : e.maxY;
3738
3503
  return (e) => {
3739
3504
  let a = e.nextTransform.x, o = e.nextTransform.y;
3740
3505
  a < t && a < e.prevTransform.x && (a = Math.min(e.prevTransform.x, t));
3741
- let s = n - e.canvasWidth * e.prevTransform.scale;
3506
+ let s = n - e.viewport.width * e.prevTransform.scale;
3742
3507
  a > s && a > e.prevTransform.x && (a = Math.max(e.prevTransform.x, s)), o < r && o < e.prevTransform.y && (o = Math.min(e.prevTransform.y, r));
3743
- let c = i - e.canvasHeight * e.prevTransform.scale;
3508
+ let c = i - e.viewport.height * e.prevTransform.scale;
3744
3509
  return o > c && o > e.prevTransform.y && (o = Math.max(e.prevTransform.y, c)), {
3745
3510
  scale: e.nextTransform.scale,
3746
3511
  x: a,
3747
3512
  y: o
3748
3513
  };
3749
3514
  };
3750
- }, It = (e) => {
3515
+ }, Dt = (e) => {
3751
3516
  let t = e.maxContentScale, n = e.minContentScale, r = t === null ? 0 : 1 / t, i = n === null ? Infinity : 1 / n;
3752
3517
  return (e) => {
3753
3518
  let t = e.prevTransform, n = e.nextTransform, a = n.scale, o = n.x, s = n.y;
@@ -3767,105 +3532,104 @@ var re = (e, t) => {
3767
3532
  y: s
3768
3533
  };
3769
3534
  };
3770
- }, Lt = (e) => (t) => e.reduce((e, n) => n({
3535
+ }, Ot = (e) => (t) => e.reduce((e, n) => n({
3771
3536
  prevTransform: t.prevTransform,
3772
3537
  nextTransform: e,
3773
- canvasWidth: t.canvasWidth,
3774
- canvasHeight: t.canvasHeight
3775
- }), t.nextTransform), Rt = (e) => {
3538
+ viewport: t.viewport
3539
+ }), t.nextTransform), kt = (e) => {
3776
3540
  if (typeof e == "function") return e;
3777
3541
  switch (e.type) {
3778
- case "scale-limit": return It({
3542
+ case "scale-limit": return Dt({
3779
3543
  minContentScale: e.minContentScale ?? 0,
3780
3544
  maxContentScale: e.maxContentScale ?? Infinity
3781
3545
  });
3782
- case "shift-limit": return Ft({
3546
+ case "shift-limit": return Et({
3783
3547
  minX: e.minX ?? -Infinity,
3784
3548
  maxX: e.maxX ?? Infinity,
3785
3549
  minY: e.minY ?? -Infinity,
3786
3550
  maxY: e.maxY ?? Infinity
3787
3551
  });
3788
3552
  }
3789
- }, zt = (e) => {
3553
+ }, At = (e) => {
3790
3554
  let t = e?.scale?.mouseWheelSensitivity, n = t === void 0 ? 1.2 : t, r = e?.transformPreprocessor, i;
3791
- i = r === void 0 ? (e) => e.nextTransform : Array.isArray(r) ? Lt(r.map((e) => Rt(e))) : Rt(r);
3792
- let a = e?.shift?.cursor === void 0 ? "grab" : e.shift.cursor, o = e?.shift?.mouseDownEventVerifier, s = o === void 0 ? (e) => e.button === 0 : o, c = e?.shift?.mouseUpEventVerifier, l = c === void 0 ? (e) => e.button === 0 : c, u = e?.scale?.mouseWheelEventVerifier, d = u === void 0 ? () => !0 : u;
3555
+ i = r === void 0 ? (e) => e.nextTransform : Array.isArray(r) ? Ot(r.map((e) => kt(e))) : kt(r);
3556
+ let a = e?.pan?.cursor === void 0 ? "grab" : e.pan.cursor, o = e?.pan?.mouseDownEventVerifier, s = o === void 0 ? (e) => e.button === 0 : o, c = e?.pan?.mouseUpEventVerifier, l = c === void 0 ? (e) => e.button === 0 : c, u = e?.scale?.mouseWheelEventVerifier, d = u === void 0 ? () => !0 : u;
3793
3557
  return {
3794
3558
  wheelSensitivity: n,
3795
- onTransformStarted: e?.events?.onTransformStarted ?? J,
3796
- onTransformFinished: e?.events?.onTransformFinished ?? J,
3797
- onBeforeTransformChange: e?.events?.onBeforeTransformChange ?? J,
3798
- onTransformChange: e?.events?.onTransformChange ?? J,
3559
+ onTransformStarted: e?.events?.onTransformStarted ?? X,
3560
+ onTransformFinished: e?.events?.onTransformFinished ?? X,
3561
+ onBeforeTransformChange: e?.events?.onBeforeTransformChange ?? X,
3562
+ onTransformChange: e?.events?.onTransformChange ?? X,
3799
3563
  transformPreprocessor: i,
3800
3564
  shiftCursor: a,
3801
3565
  mouseDownEventVerifier: s,
3802
3566
  mouseUpEventVerifier: l,
3803
3567
  mouseWheelEventVerifier: d,
3804
3568
  scaleWheelFinishTimeout: e?.scale?.wheelFinishTimeout ?? 500,
3805
- onResizeTransformStarted: e?.events?.onResizeTransformStarted ?? J,
3806
- onResizeTransformFinished: e?.events?.onResizeTransformFinished ?? J
3569
+ onResizeTransformStarted: e?.events?.onResizeTransformStarted ?? X,
3570
+ onResizeTransformFinished: e?.events?.onResizeTransformFinished ?? X
3807
3571
  };
3808
- }, Bt = (e, t) => {
3572
+ }, jt = (e, t) => {
3809
3573
  let n = document.createElementNS("http://www.w3.org/2000/svg", "circle");
3810
3574
  return n.setAttribute("cx", "0"), n.setAttribute("cy", "0"), n.setAttribute("r", `${e}`), n.setAttribute("fill", `${t}`), n;
3811
- }, Vt = (e) => e instanceof SVGElement ? e : Bt(e?.radius ?? 1.5, e?.color ?? "#d8d8d8"), Ht = (e) => {
3575
+ }, Mt = (e) => e instanceof SVGElement ? e : jt(e?.radius ?? 1.5, e?.color ?? "#d8d8d8"), Nt = (e) => {
3812
3576
  let t = e.tileDimensions;
3813
3577
  return {
3814
3578
  tileWidth: t?.width ?? 25,
3815
3579
  tileHeight: t?.height ?? 25,
3816
- renderer: Vt(e.renderer ?? {}),
3580
+ renderer: Mt(e.renderer ?? {}),
3817
3581
  maxViewportScale: e.maxViewportScale ?? 10
3818
3582
  };
3819
- }, X = Object.freeze({
3583
+ }, Z = Object.freeze({
3820
3584
  connectionTypeResolver: () => "direct",
3821
3585
  connectionPreprocessor: (e) => e,
3822
3586
  connectionAllowedVerifier: () => !0,
3823
3587
  mouseEventVerifier: (e) => e.button === 0
3824
- }), Ut = (e, t, n) => {
3825
- let r = e.connectionAllowedVerifier ?? X.connectionAllowedVerifier;
3588
+ }), Pt = (e, t, n) => {
3589
+ let r = e.connectionAllowedVerifier ?? Z.connectionAllowedVerifier;
3826
3590
  return {
3827
- connectionTypeResolver: e.connectionTypeResolver ?? X.connectionTypeResolver,
3591
+ connectionTypeResolver: e.connectionTypeResolver ?? Z.connectionTypeResolver,
3828
3592
  connectionAllowedVerifier: r,
3829
- draggingPortDirectionResolver: Nt(e.dragPortDirection, n, r),
3830
- edgeShapeFactory: e.edgeShape === void 0 ? t : Y(e.edgeShape),
3831
- connectionPreprocessor: e.connectionPreprocessor ?? X.connectionPreprocessor,
3832
- mouseDownEventVerifier: e.mouseDownEventVerifier ?? X.mouseEventVerifier,
3833
- mouseUpEventVerifier: e.mouseUpEventVerifier ?? X.mouseEventVerifier,
3834
- onAfterEdgeCreated: e.events?.onAfterEdgeCreated ?? J,
3835
- onEdgeCreationInterrupted: e.events?.onEdgeCreationInterrupted ?? J,
3836
- onEdgeCreationPrevented: e.events?.onEdgeCreationPrevented ?? J
3593
+ draggingPortDirectionResolver: Ct(e.dragPortDirection, n, r),
3594
+ edgeShapeFactory: e.edgeShape === void 0 ? t : wt(e.edgeShape),
3595
+ connectionPreprocessor: e.connectionPreprocessor ?? Z.connectionPreprocessor,
3596
+ mouseDownEventVerifier: e.mouseDownEventVerifier ?? Z.mouseEventVerifier,
3597
+ mouseUpEventVerifier: e.mouseUpEventVerifier ?? Z.mouseEventVerifier,
3598
+ onAfterEdgeCreated: e.events?.onAfterEdgeCreated ?? X,
3599
+ onEdgeCreationInterrupted: e.events?.onEdgeCreationInterrupted ?? X,
3600
+ onEdgeCreationPrevented: e.events?.onEdgeCreationPrevented ?? X
3837
3601
  };
3838
- }, Z = Object.freeze({
3602
+ }, Q = Object.freeze({
3839
3603
  connectionAllowedVerifier: () => !0,
3840
3604
  connectionPreprocessor: (e) => e,
3841
- mouseDownEventVerifier: (e) => e.button === 0 && e.ctrlKey,
3605
+ mouseDownEventVerifier: (e) => e.button === 0,
3842
3606
  mouseUpEventVerifier: (e) => e.button === 0
3843
- }), Wt = (e, t) => {
3607
+ }), Ft = (e, t) => {
3844
3608
  let n = (e) => {
3845
3609
  let n = t.getPortAdjacentEdgeIds(e);
3846
3610
  return n.length > 0 ? n[n.length - 1] : null;
3847
- }, r = e.connectionAllowedVerifier ?? Z.connectionAllowedVerifier;
3611
+ }, r = e.connectionAllowedVerifier ?? Q.connectionAllowedVerifier;
3848
3612
  return {
3849
- connectionPreprocessor: e.connectionPreprocessor ?? Z.connectionPreprocessor,
3613
+ connectionPreprocessor: e.connectionPreprocessor ?? Q.connectionPreprocessor,
3850
3614
  connectionAllowedVerifier: r,
3851
- mouseDownEventVerifier: e.mouseDownEventVerifier ?? Z.mouseDownEventVerifier,
3852
- mouseUpEventVerifier: e.mouseUpEventVerifier ?? Z.mouseUpEventVerifier,
3615
+ mouseDownEventVerifier: e.mouseDownEventVerifier ?? Q.mouseDownEventVerifier,
3616
+ mouseUpEventVerifier: e.mouseUpEventVerifier ?? Q.mouseUpEventVerifier,
3853
3617
  draggingEdgeResolver: e.draggingEdgeResolver ?? n,
3854
- draggingEdgeShapeFactory: e.draggingEdgeShape === void 0 ? null : Y(e.draggingEdgeShape),
3855
- onAfterEdgeReattached: e.events?.onAfterEdgeReattached ?? J,
3856
- onEdgeReattachInterrupted: e.events?.onEdgeReattachInterrupted ?? J,
3857
- onEdgeReattachPrevented: e.events?.onEdgeReattachPrevented ?? J,
3858
- draggingPortDirectionResolver: Nt(e.dragPortDirection, t, r)
3618
+ draggingEdgeShapeFactory: e.draggingEdgeShape === void 0 ? null : wt(e.draggingEdgeShape),
3619
+ onAfterEdgeReattached: e.events?.onAfterEdgeReattached ?? X,
3620
+ onEdgeReattachInterrupted: e.events?.onEdgeReattachInterrupted ?? X,
3621
+ onEdgeReattachPrevented: e.events?.onEdgeReattachPrevented ?? X,
3622
+ draggingPortDirectionResolver: Ct(e.dragPortDirection, t, r)
3859
3623
  };
3860
- }, Gt = (e) => ({
3624
+ }, It = (e) => ({
3861
3625
  nodeVerticalRadius: e.nodeContainingRadius.vertical,
3862
3626
  nodeHorizontalRadius: e.nodeContainingRadius.horizontal
3863
- }), Kt = (e) => ({
3864
- onAfterNodeDetached: e?.events?.onAfterNodeDetached ?? J,
3865
- onBeforeNodeAttached: e?.events?.onBeforeNodeAttached ?? J
3866
- }), qt = class extends Error {
3627
+ }), Lt = (e) => ({
3628
+ onAfterNodeDetached: e?.events?.onAfterNodeDetached ?? X,
3629
+ onBeforeNodeAttached: e?.events?.onBeforeNodeAttached ?? X
3630
+ }), Rt = class extends Error {
3867
3631
  name = "CanvasBuilderError";
3868
- }, Jt = class {
3632
+ }, zt = class {
3869
3633
  graph;
3870
3634
  currentCoords;
3871
3635
  dt;
@@ -3900,7 +3664,7 @@ var re = (e, t) => {
3900
3664
  d.x += l, d.y += u, f.x -= l, f.y -= u;
3901
3665
  });
3902
3666
  }
3903
- }, Yt = class {
3667
+ }, Bt = class {
3904
3668
  rand;
3905
3669
  PI2 = 2 * Math.PI;
3906
3670
  constructor(e) {
@@ -3923,11 +3687,11 @@ var re = (e, t) => {
3923
3687
  d: a
3924
3688
  };
3925
3689
  }
3926
- }, Xt = (e) => {
3690
+ }, Vt = (e) => {
3927
3691
  if (e.distance === 0) return e.maxForce;
3928
3692
  let t = e.coefficient * (e.sourceCharge * e.targetCharge / (e.distance * e.distance));
3929
3693
  return Math.min(t, e.maxForce);
3930
- }, Zt = class {
3694
+ }, Ht = class {
3931
3695
  nodeCharge;
3932
3696
  distanceVectorGenerator;
3933
3697
  maxForce;
@@ -3939,7 +3703,7 @@ var re = (e, t) => {
3939
3703
  for (let i = 0; i < r; i++) {
3940
3704
  let a = n[i];
3941
3705
  for (let o = i + 1; o < r; o++) {
3942
- let r = n[o], i = e.get(a), s = e.get(r), c = this.distanceVectorGenerator.create(i, s), l = Xt({
3706
+ let r = n[o], i = e.get(a), s = e.get(r), c = this.distanceVectorGenerator.create(i, s), l = Vt({
3943
3707
  coefficient: 1,
3944
3708
  sourceCharge: this.nodeCharge,
3945
3709
  targetCharge: this.nodeCharge,
@@ -3950,7 +3714,7 @@ var re = (e, t) => {
3950
3714
  }
3951
3715
  }
3952
3716
  }
3953
- }, Qt = (e) => {
3717
+ }, Ut = (e) => {
3954
3718
  if (e.size === 0) return {
3955
3719
  centerX: 0,
3956
3720
  centerY: 0,
@@ -3966,7 +3730,7 @@ var re = (e, t) => {
3966
3730
  centerY: (r + i) / 2,
3967
3731
  radius: s / 2
3968
3732
  };
3969
- }, $t = class {
3733
+ }, Wt = class {
3970
3734
  root;
3971
3735
  leaves = /* @__PURE__ */ new Map();
3972
3736
  coords;
@@ -4122,7 +3886,7 @@ var re = (e, t) => {
4122
3886
  y: n / e.size
4123
3887
  };
4124
3888
  }
4125
- }, en = class {
3889
+ }, Gt = class {
4126
3890
  areaRadiusThreshold;
4127
3891
  nodeMass;
4128
3892
  nodeCharge;
@@ -4134,8 +3898,8 @@ var re = (e, t) => {
4134
3898
  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;
4135
3899
  }
4136
3900
  apply(e, t) {
4137
- let n = new $t({
4138
- box: Qt(e),
3901
+ let n = new Wt({
3902
+ box: Ut(e),
4139
3903
  coords: e,
4140
3904
  areaRadiusThreshold: this.areaRadiusThreshold,
4141
3905
  nodeMass: this.nodeMass,
@@ -4245,7 +4009,7 @@ var re = (e, t) => {
4245
4009
  });
4246
4010
  }
4247
4011
  calculateNodeRepulsiveForce(e) {
4248
- let t = this.distanceVectorGenerator.create(e.sourceCoords, e.targetCoords), n = Xt({
4012
+ let t = this.distanceVectorGenerator.create(e.sourceCoords, e.targetCoords), n = Vt({
4249
4013
  coefficient: this.nodeForceCoefficient,
4250
4014
  sourceCharge: e.sourceCharge,
4251
4015
  targetCharge: e.targetCharge,
@@ -4272,12 +4036,12 @@ var re = (e, t) => {
4272
4036
  this.applyForce(e.totalForce, t);
4273
4037
  }
4274
4038
  }
4275
- }, tn = (e) => e.theta === 0 ? new Zt({
4039
+ }, Kt = (e) => e.theta === 0 ? new Ht({
4276
4040
  nodeCharge: e.nodeCharge,
4277
4041
  nodeForceCoefficient: e.nodeForceCoefficient,
4278
4042
  distanceVectorGenerator: e.distanceVectorGenerator,
4279
4043
  maxForce: e.maxForce
4280
- }) : new en({
4044
+ }) : new Gt({
4281
4045
  nodeCharge: e.nodeCharge,
4282
4046
  nodeForceCoefficient: e.nodeForceCoefficient,
4283
4047
  distanceVectorGenerator: e.distanceVectorGenerator,
@@ -4285,7 +4049,7 @@ var re = (e, t) => {
4285
4049
  theta: e.theta,
4286
4050
  nodeMass: e.nodeMass,
4287
4051
  areaRadiusThreshold: e.areaRadiusThreshold
4288
- }), nn = class {
4052
+ }), qt = class {
4289
4053
  rand;
4290
4054
  sparsity;
4291
4055
  constructor(e) {
@@ -4310,7 +4074,7 @@ var re = (e, t) => {
4310
4074
  });
4311
4075
  }), r;
4312
4076
  }
4313
- }, rn = class {
4077
+ }, Jt = class {
4314
4078
  distanceVectorGenerator;
4315
4079
  nodeForcesApplicationStrategy;
4316
4080
  fillerLayoutAlgorithm;
@@ -4321,7 +4085,7 @@ var re = (e, t) => {
4321
4085
  edgeStiffness;
4322
4086
  convergenceVelocity;
4323
4087
  constructor(e) {
4324
- 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 Yt(e.rand), this.nodeForcesApplicationStrategy = tn({
4088
+ this.maxIterations = e.maxIterations, this.dtSec = e.dtSec, this.nodeMass = e.nodeMass, this.edgeEquilibriumLength = e.edgeEquilibriumLength, this.edgeStiffness = e.edgeStiffness, this.convergenceVelocity = e.stopVelocity, this.distanceVectorGenerator = new Bt(e.rand), this.nodeForcesApplicationStrategy = Kt({
4325
4089
  distanceVectorGenerator: this.distanceVectorGenerator,
4326
4090
  nodeCharge: e.nodeCharge,
4327
4091
  maxForce: e.maxForce,
@@ -4329,7 +4093,7 @@ var re = (e, t) => {
4329
4093
  theta: e.barnesHutTheta,
4330
4094
  areaRadiusThreshold: e.barnesHutAreaRadiusThreshold,
4331
4095
  nodeMass: e.nodeMass
4332
- }), this.fillerLayoutAlgorithm = new nn({
4096
+ }), this.fillerLayoutAlgorithm = new qt({
4333
4097
  rand: e.rand,
4334
4098
  sparsity: e.edgeEquilibriumLength
4335
4099
  });
@@ -4339,7 +4103,7 @@ var re = (e, t) => {
4339
4103
  graph: t,
4340
4104
  viewport: n
4341
4105
  });
4342
- for (let e = 0; e < this.maxIterations && !(new Jt(t, r, {
4106
+ for (let e = 0; e < this.maxIterations && !(new zt(t, r, {
4343
4107
  distanceVectorGenerator: this.distanceVectorGenerator,
4344
4108
  nodeForcesApplicationStrategy: this.nodeForcesApplicationStrategy,
4345
4109
  dtSec: this.dtSec,
@@ -4349,7 +4113,7 @@ var re = (e, t) => {
4349
4113
  }).apply() < this.convergenceVelocity); e++);
4350
4114
  return r;
4351
4115
  }
4352
- }, an = class {
4116
+ }, Yt = class {
4353
4117
  graph;
4354
4118
  nextLayerNodesResolver;
4355
4119
  forest = /* @__PURE__ */ new Set();
@@ -4393,7 +4157,7 @@ var re = (e, t) => {
4393
4157
  }), r = e;
4394
4158
  }
4395
4159
  }
4396
- }, on = class {
4160
+ }, Xt = class {
4397
4161
  params;
4398
4162
  constructor(e) {
4399
4163
  this.params = e;
@@ -4432,13 +4196,13 @@ var re = (e, t) => {
4432
4196
  }
4433
4197
  return n - 2 * this.params.spaceAroundRadius;
4434
4198
  }
4435
- }, sn = class {
4199
+ }, Zt = class {
4436
4200
  tree;
4437
4201
  offsets = /* @__PURE__ */ new Map();
4438
4202
  treeSpans = /* @__PURE__ */ new Map();
4439
4203
  constructor(e, t) {
4440
4204
  this.tree = e;
4441
- let n = t.spaceAroundRadius, r = new on({ spaceAroundRadius: n });
4205
+ let n = t.spaceAroundRadius, r = new Xt({ spaceAroundRadius: n });
4442
4206
  [...this.tree.sequence].reverse().forEach((e) => {
4443
4207
  let t = Array.from(e.children).map((e) => this.treeSpans.get(e.nodeId)), i = r.generate(t), a = 0;
4444
4208
  e.children.forEach((e) => {
@@ -4454,19 +4218,19 @@ var re = (e, t) => {
4454
4218
  generate() {
4455
4219
  return this.offsets;
4456
4220
  }
4457
- }, cn = class {
4221
+ }, Qt = class {
4458
4222
  params;
4459
4223
  constructor(e) {
4460
4224
  this.params = e;
4461
4225
  }
4462
4226
  calculateCoordinates(e) {
4463
- let t = /* @__PURE__ */ new Map(), n = new an(e.graph, this.params.nextLayerNodesResolver).generate(), r = 0;
4227
+ let t = /* @__PURE__ */ new Map(), n = new Yt(e.graph, this.params.nextLayerNodesResolver).generate(), r = 0;
4464
4228
  return n.forEach((e) => {
4465
4229
  t.set(e.root.nodeId, {
4466
4230
  x: r,
4467
4231
  y: 0
4468
4232
  });
4469
- let n = new sn(e, { spaceAroundRadius: this.params.layerSpace / 2 }).generate(), i = [e.root];
4233
+ let n = new Zt(e, { spaceAroundRadius: this.params.layerSpace / 2 }).generate(), i = [e.root];
4470
4234
  for (; i.length > 0;) {
4471
4235
  let e = [];
4472
4236
  r += this.params.layerWidth, i.forEach((i) => {
@@ -4483,7 +4247,7 @@ var re = (e, t) => {
4483
4247
  t.set(n, this.params.transform(e));
4484
4248
  }), t;
4485
4249
  }
4486
- }, ln = (e) => {
4250
+ }, $t = (e) => {
4487
4251
  let { graph: t, currentNodeId: n } = e, r = t.getNodeOutgoingEdgeIds(n).map((e) => {
4488
4252
  let n = t.getEdge(e);
4489
4253
  return t.getPort(n.to).nodeId;
@@ -4492,19 +4256,19 @@ var re = (e, t) => {
4492
4256
  return t.getPort(n.from).nodeId;
4493
4257
  });
4494
4258
  return /* @__PURE__ */ new Set([...r, ...i]);
4495
- }, un = (e) => {
4259
+ }, en = (e) => {
4496
4260
  let { graph: t, currentNodeId: n } = e, r = t.getNodeOutgoingEdgeIds(n).map((e) => {
4497
4261
  let n = t.getEdge(e);
4498
4262
  return t.getPort(n.to).nodeId;
4499
4263
  });
4500
4264
  return new Set(r);
4501
- }, dn = (e) => {
4265
+ }, tn = (e) => {
4502
4266
  let { graph: t, currentNodeId: n } = e, r = t.getNodeIncomingEdgeIds(n).map((e) => {
4503
4267
  let n = t.getEdge(e);
4504
4268
  return t.getPort(n.from).nodeId;
4505
4269
  });
4506
4270
  return new Set(r);
4507
- }, fn = class {
4271
+ }, nn = class {
4508
4272
  distanceVectorGenerator;
4509
4273
  nodeForcesApplicationStrategy;
4510
4274
  convergenceVelocity;
@@ -4514,7 +4278,7 @@ var re = (e, t) => {
4514
4278
  edgeStiffness;
4515
4279
  fillerLayoutAlgorithm;
4516
4280
  constructor(e) {
4517
- this.convergenceVelocity = e.convergenceVelocity, this.maxTimeDeltaSec = e.maxTimeDeltaSec, this.nodeMass = e.nodeMass, this.edgeEquilibriumLength = e.edgeEquilibriumLength, this.edgeStiffness = e.edgeStiffness, this.distanceVectorGenerator = new Yt(e.rand), this.nodeForcesApplicationStrategy = tn({
4281
+ this.convergenceVelocity = e.stopVelocity, this.maxTimeDeltaSec = e.maxTimeDeltaSec, this.nodeMass = e.nodeMass, this.edgeEquilibriumLength = e.edgeEquilibriumLength, this.edgeStiffness = e.edgeStiffness, this.distanceVectorGenerator = new Bt(e.rand), this.nodeForcesApplicationStrategy = Kt({
4518
4282
  distanceVectorGenerator: this.distanceVectorGenerator,
4519
4283
  nodeCharge: e.nodeCharge,
4520
4284
  maxForce: e.maxForce,
@@ -4522,7 +4286,7 @@ var re = (e, t) => {
4522
4286
  theta: e.barnesHutTheta,
4523
4287
  areaRadiusThreshold: e.barnesHutAreaRadiusThreshold,
4524
4288
  nodeMass: e.nodeMass
4525
- }), this.fillerLayoutAlgorithm = new nn({
4289
+ }), this.fillerLayoutAlgorithm = new qt({
4526
4290
  rand: e.rand,
4527
4291
  sparsity: e.edgeEquilibriumLength
4528
4292
  });
@@ -4532,7 +4296,7 @@ var re = (e, t) => {
4532
4296
  graph: t,
4533
4297
  viewport: n
4534
4298
  });
4535
- return new Jt(t, i, {
4299
+ return new zt(t, i, {
4536
4300
  distanceVectorGenerator: this.distanceVectorGenerator,
4537
4301
  nodeForcesApplicationStrategy: this.nodeForcesApplicationStrategy,
4538
4302
  dtSec: Math.min(r, this.maxTimeDeltaSec),
@@ -4544,7 +4308,7 @@ var re = (e, t) => {
4544
4308
  return n.x === null || n.y === null;
4545
4309
  }) ? /* @__PURE__ */ new Map() : i;
4546
4310
  }
4547
- }, pn = (e) => {
4311
+ }, rn = (e) => {
4548
4312
  let t = 1779033703, n = 3144134277, r = 1013904242, i = 2773480762;
4549
4313
  for (let a = 0, o; a < e.length; a++) o = e.charCodeAt(a), t = n ^ Math.imul(t ^ o, 597399067), n = r ^ Math.imul(n ^ o, 2869860233), r = i ^ Math.imul(r ^ o, 951274213), i = t ^ Math.imul(i ^ o, 2716044179);
4550
4314
  return t = Math.imul(r ^ t >>> 18, 597399067), n = Math.imul(i ^ n >>> 22, 2869860233), r = Math.imul(t ^ r >>> 17, 951274213), i = Math.imul(n ^ i >>> 19, 2716044179), t ^= n ^ r ^ i, n ^= t, r ^= t, i ^= t, [
@@ -4553,61 +4317,55 @@ var re = (e, t) => {
4553
4317
  r >>> 0,
4554
4318
  i >>> 0
4555
4319
  ];
4556
- }, mn = (e, t, n, r) => function() {
4320
+ }, an = (e, t, n, r) => function() {
4557
4321
  e |= 0, t |= 0, n |= 0, r |= 0;
4558
4322
  let i = (e + t | 0) + r | 0;
4559
4323
  return r = r + 1 | 0, e = t ^ t >>> 9, t = n + (n << 3) | 0, n = n << 21 | n >>> 11, n = n + i | 0, (i >>> 0) / 4294967296;
4560
- }, hn = (e) => {
4324
+ }, on = (e) => {
4561
4325
  switch (e?.type) {
4562
4326
  case "custom": return e.instance;
4563
4327
  default: {
4564
- let t = pn(e?.seed ?? K.seed);
4565
- return new fn({
4566
- rand: mn(t[0], t[1], t[2], t[3]),
4567
- maxTimeDeltaSec: e?.maxTimeDeltaSec ?? K.maxTimeDeltaSec,
4568
- nodeCharge: e?.nodeCharge ?? K.nodeCharge,
4569
- nodeMass: e?.nodeMass ?? K.nodeMass,
4570
- edgeEquilibriumLength: e?.edgeEquilibriumLength ?? K.edgeEquilibriumLength,
4571
- edgeStiffness: e?.edgeStiffness ?? K.edgeStiffness,
4572
- convergenceVelocity: e?.convergenceVelocity ?? K.convergenceVelocity,
4573
- maxForce: e?.maxForce ?? K.maxForce,
4574
- nodeForceCoefficient: e?.nodeForceCoefficient ?? K.nodeForceCoefficient,
4575
- barnesHutTheta: e?.barnesHut?.theta ?? K.barnesHutTheta,
4576
- barnesHutAreaRadiusThreshold: e?.barnesHut?.areaRadiusThreshold ?? K.barnesHutAreaRadiusThreshold
4328
+ let t = rn(e?.seed ?? J.seed);
4329
+ return new nn({
4330
+ rand: an(t[0], t[1], t[2], t[3]),
4331
+ maxTimeDeltaSec: e?.maxTimeDeltaSec ?? J.maxTimeDeltaSec,
4332
+ nodeCharge: e?.nodeCharge ?? J.nodeCharge,
4333
+ nodeMass: e?.nodeMass ?? J.nodeMass,
4334
+ edgeEquilibriumLength: e?.edgeEquilibriumLength ?? J.edgeEquilibriumLength,
4335
+ edgeStiffness: e?.edgeStiffness ?? J.edgeStiffness,
4336
+ stopVelocity: e?.stopVelocity ?? J.convergenceVelocity,
4337
+ maxForce: e?.maxForce ?? J.maxForce,
4338
+ nodeForceCoefficient: e?.nodeForceCoefficient ?? J.nodeForceCoefficient,
4339
+ barnesHutTheta: e?.barnesHut?.theta ?? J.barnesHutTheta,
4340
+ barnesHutAreaRadiusThreshold: e?.barnesHut?.areaRadiusThreshold ?? J.barnesHutAreaRadiusThreshold
4577
4341
  });
4578
4342
  }
4579
4343
  }
4580
- }, gn = { staticNodeResolver: () => !1 }, _n = (e) => ({
4581
- algorithm: hn(e?.algorithm ?? {}),
4582
- staticNodeResolver: e?.staticNodeResolver ?? gn.staticNodeResolver,
4583
- onBeforeApplied: e?.events?.onBeforeApplied ?? J,
4584
- onAfterApplied: e?.events?.onAfterApplied ?? J
4585
- }), vn = (e) => e instanceof l ? {
4344
+ }, sn = { staticNodeResolver: () => !1 }, cn = (e) => ({
4345
+ algorithm: on(e?.algorithm ?? {}),
4346
+ staticNodeResolver: e?.staticNodeResolver ?? sn.staticNodeResolver,
4347
+ onBeforeApplied: e?.events?.onBeforeApplied ?? X,
4348
+ onAfterApplied: e?.events?.onAfterApplied ?? X
4349
+ }), ln = (e) => e instanceof l ? {
4586
4350
  type: "trigger",
4587
4351
  trigger: e
4588
- } : e === "topologyChangeMicrotask" ? {
4589
- type: "topologyChangeSchedule",
4590
- schedule: Qe
4591
- } : e?.type === "topologyChangeMacrotask" ? {
4592
- type: "topologyChangeSchedule",
4593
- schedule: Ze
4594
4352
  } : {
4595
4353
  type: "topologyChangeSchedule",
4596
- schedule: Qe
4597
- }, yn = Object.freeze({
4354
+ schedule: We
4355
+ }, un = Object.freeze({
4598
4356
  staticNodeResolver: () => !1,
4599
4357
  hierarchicalLayout: {
4600
4358
  layerWidth: 300,
4601
4359
  layerSpace: 300
4602
4360
  }
4603
- }), Q = (e, t) => ({
4361
+ }), $ = (e, t) => ({
4604
4362
  a: e.a * t.a + e.b * t.d,
4605
4363
  b: e.a * t.b + e.b * t.e,
4606
4364
  c: e.a * t.c + e.b * t.f + e.c,
4607
4365
  d: e.d * t.a + e.e * t.d,
4608
4366
  e: e.d * t.b + e.e * t.e,
4609
4367
  f: e.d * t.c + e.e * t.f + e.f
4610
- }), bn = (e) => {
4368
+ }), dn = (e) => {
4611
4369
  let { a: t, b: n, c: r, d: i, e: a, f: o } = e, s = t * a - n * i;
4612
4370
  return {
4613
4371
  a: a / s,
@@ -4617,7 +4375,7 @@ var re = (e, t) => {
4617
4375
  e: t / s,
4618
4376
  f: (r * i - t * o) / s
4619
4377
  };
4620
- }, xn = class {
4378
+ }, fn = class {
4621
4379
  resolve(e) {
4622
4380
  if ("shift" in e) return this.createShiftBaseMatrix(e.shift);
4623
4381
  if ("scale" in e) {
@@ -4659,11 +4417,11 @@ var re = (e, t) => {
4659
4417
  return this.createRelativeTransform(n, r);
4660
4418
  }
4661
4419
  createMirrorRelativeMatrix(e, t) {
4662
- let n = this.createMirrorYBaseMatrix(), r = Q(this.createShiftBaseMatrix(t), this.createRotateBaseMatrix(e));
4420
+ let n = this.createMirrorYBaseMatrix(), r = $(this.createShiftBaseMatrix(t), this.createRotateBaseMatrix(e));
4663
4421
  return this.createRelativeTransform(n, r);
4664
4422
  }
4665
4423
  createRelativeTransform(e, t) {
4666
- return Q(Q(t, e), bn(t));
4424
+ return $($(t, e), dn(t));
4667
4425
  }
4668
4426
  createShiftBaseMatrix(e) {
4669
4427
  return {
@@ -4706,7 +4464,7 @@ var re = (e, t) => {
4706
4464
  f: 0
4707
4465
  };
4708
4466
  }
4709
- }, Sn = (e) => {
4467
+ }, pn = (e) => {
4710
4468
  if (e === void 0) return (e) => e;
4711
4469
  if (typeof e == "function") return e;
4712
4470
  let t = Array.isArray(e) ? e : [e], n = {
@@ -4716,10 +4474,10 @@ var re = (e, t) => {
4716
4474
  d: 0,
4717
4475
  e: 1,
4718
4476
  f: 0
4719
- }, r = new xn();
4477
+ }, r = new fn();
4720
4478
  return t.forEach((e) => {
4721
4479
  let t = r.resolve(e);
4722
- n = Q(n, t);
4480
+ n = $(n, t);
4723
4481
  }), (e) => {
4724
4482
  let { x: t, y: r } = e;
4725
4483
  return {
@@ -4727,47 +4485,47 @@ var re = (e, t) => {
4727
4485
  y: n.d * t + n.e * r + n.f
4728
4486
  };
4729
4487
  };
4730
- }, Cn = (e) => {
4488
+ }, mn = (e) => {
4731
4489
  if (typeof e == "function") return e;
4732
4490
  switch (e) {
4733
- case "outgoing": return un;
4734
- case "incoming": return dn;
4735
- default: return ln;
4491
+ case "outgoing": return en;
4492
+ case "incoming": return tn;
4493
+ default: return $t;
4736
4494
  }
4737
- }, wn = (e) => {
4495
+ }, hn = (e) => {
4738
4496
  switch (e?.type) {
4739
4497
  case "custom": return e.instance;
4740
- case "hierarchical": return new cn({
4741
- layerWidth: e.layerWidth ?? yn.hierarchicalLayout.layerWidth,
4742
- layerSpace: e.layerSpace ?? yn.hierarchicalLayout.layerSpace,
4743
- transform: Sn(e.transform),
4744
- nextLayerNodesResolver: Cn(e.nextLayerNodesResolver)
4498
+ case "hierarchical": return new Qt({
4499
+ layerWidth: e.layerWidth ?? un.hierarchicalLayout.layerWidth,
4500
+ layerSpace: e.layerSpace ?? un.hierarchicalLayout.layerSpace,
4501
+ transform: pn(e.transform),
4502
+ nextLayerNodesResolver: mn(e.nextLayerNodesResolver)
4745
4503
  });
4746
4504
  default: {
4747
- let t = pn(e?.seed ?? K.seed), n = mn(t[0], t[1], t[2], t[3]);
4748
- return new rn({
4749
- dtSec: e?.dtSec ?? K.dtSec,
4750
- maxIterations: e?.maxIterations ?? K.maxIterations,
4505
+ let t = rn(e?.seed ?? J.seed), n = an(t[0], t[1], t[2], t[3]);
4506
+ return new Jt({
4507
+ dtSec: e?.dtSec ?? J.dtSec,
4508
+ maxIterations: e?.maxIterations ?? J.maxIterations,
4751
4509
  rand: n,
4752
- nodeCharge: e?.nodeCharge ?? K.nodeCharge,
4753
- nodeMass: e?.nodeMass ?? K.nodeMass,
4754
- edgeEquilibriumLength: e?.edgeEquilibriumLength ?? K.edgeEquilibriumLength,
4755
- edgeStiffness: e?.edgeStiffness ?? K.edgeStiffness,
4756
- convergenceVelocity: e?.convergenceVelocity ?? K.convergenceVelocity,
4757
- maxForce: e?.maxForce ?? K.maxForce,
4758
- nodeForceCoefficient: e?.nodeForceCoefficient ?? K.nodeForceCoefficient,
4759
- barnesHutTheta: e?.barnesHut?.theta ?? K.barnesHutTheta,
4760
- barnesHutAreaRadiusThreshold: e?.barnesHut?.areaRadiusThreshold ?? K.barnesHutAreaRadiusThreshold
4510
+ nodeCharge: e?.nodeCharge ?? J.nodeCharge,
4511
+ nodeMass: e?.nodeMass ?? J.nodeMass,
4512
+ edgeEquilibriumLength: e?.edgeEquilibriumLength ?? J.edgeEquilibriumLength,
4513
+ edgeStiffness: e?.edgeStiffness ?? J.edgeStiffness,
4514
+ stopVelocity: e?.stopVelocity ?? J.convergenceVelocity,
4515
+ maxForce: e?.maxForce ?? J.maxForce,
4516
+ nodeForceCoefficient: e?.nodeForceCoefficient ?? J.nodeForceCoefficient,
4517
+ barnesHutTheta: e?.barnesHut?.theta ?? J.barnesHutTheta,
4518
+ barnesHutAreaRadiusThreshold: e?.barnesHut?.areaRadiusThreshold ?? J.barnesHutAreaRadiusThreshold
4761
4519
  });
4762
4520
  }
4763
4521
  }
4764
- }, Tn = (e) => ({
4765
- algorithm: wn(e.algorithm),
4766
- applyOn: vn(e.applyOn),
4767
- staticNodeResolver: e.staticNodeResolver ?? yn.staticNodeResolver,
4768
- onBeforeApplied: e.events?.onBeforeApplied ?? J,
4769
- onAfterApplied: e.events?.onAfterApplied ?? J
4770
- }), En = (e, t) => ({
4522
+ }, gn = (e) => ({
4523
+ algorithm: hn(e.algorithm),
4524
+ applyOn: ln(e.applyOn),
4525
+ staticNodeResolver: e.staticNodeResolver ?? un.staticNodeResolver,
4526
+ onBeforeApplied: e.events?.onBeforeApplied ?? X,
4527
+ onAfterApplied: e.events?.onAfterApplied ?? X
4528
+ }), _n = (e, t) => ({
4771
4529
  ...e,
4772
4530
  onNodeDragStarted: (n) => {
4773
4531
  t.add(n), e.onNodeDragStarted(n);
@@ -4775,7 +4533,7 @@ var re = (e, t) => {
4775
4533
  onNodeDragFinished: (n) => {
4776
4534
  t.delete(n), e.onNodeDragFinished(n);
4777
4535
  }
4778
- }), Dn = (e, t) => {
4536
+ }), vn = (e, t) => {
4779
4537
  e.graph.onBeforeNodeRemoved.subscribe((e) => {
4780
4538
  t.delete(e);
4781
4539
  }), e.graph.onBeforeClear.subscribe(() => {
@@ -4783,55 +4541,55 @@ var re = (e, t) => {
4783
4541
  }), e.onBeforeDestroy.subscribe(() => {
4784
4542
  t.clear();
4785
4543
  });
4786
- }, On = (e, t) => ({
4544
+ }, yn = (e, t) => ({
4787
4545
  ...e,
4788
4546
  staticNodeResolver: (n) => e.staticNodeResolver(n) || t.has(n)
4789
- }), $ = (e) => () => e, kn = $(0), An = () => {
4547
+ }), bn = (e) => () => e, xn = bn(0), Sn = () => {
4790
4548
  let e = 0;
4791
4549
  return () => e++;
4792
- }, jn = (e, t) => {
4793
- let n = kn, r = kn, i = An();
4794
- return e === "incremental" && (n = i), t === "incremental" && (r = i), typeof e == "number" && (n = $(e)), typeof t == "number" && (r = $(t)), typeof e == "function" && (n = e), typeof t == "function" && (r = t), {
4550
+ }, Cn = (e, t) => {
4551
+ let n = xn, r = xn, i = Sn();
4552
+ return e === "incremental" && (n = i), t === "incremental" && (r = i), typeof e == "number" && (n = bn(e)), typeof t == "number" && (r = bn(t)), typeof e == "function" && (n = e), typeof t == "function" && (r = t), {
4795
4553
  nodesPriorityFn: n,
4796
4554
  edgesPriorityFn: r
4797
4555
  };
4798
- }, Mn = (e) => {
4799
- let t = jn(e.nodes?.priority, e.edges?.priority);
4556
+ }, wn = (e) => {
4557
+ let t = Cn(e.nodes?.priority, e.edges?.priority);
4800
4558
  return {
4801
4559
  nodes: {
4802
- centerFn: e.nodes?.centerFn ?? ie,
4560
+ centerFn: e.nodes?.centerFn ?? re,
4803
4561
  priorityFn: t.nodesPriorityFn
4804
4562
  },
4805
4563
  ports: { direction: e.ports?.direction ?? 0 },
4806
4564
  edges: {
4807
- shapeFactory: Y(e.edges?.shape ?? {}),
4565
+ shapeFactory: wt(e.edges?.shape ?? {}),
4808
4566
  priorityFn: t.edgesPriorityFn
4809
4567
  }
4810
4568
  };
4811
- }, Nn = (e) => e.applyOn.type === "topologyChangeSchedule" ? e.applyOn.schedule : B, Pn = (e) => {
4812
- let { canvasDefaults: t } = e, n = e.hasLayout ? Nn(e.layoutParams) : B;
4569
+ }, Tn = (e) => e.applyOn.type === "topologyChangeSchedule" ? e.applyOn.schedule : B, En = (e) => {
4570
+ let { canvasDefaults: t } = e, n = e.hasLayout ? Tn(e.layoutParams) : B;
4813
4571
  return { focus: {
4814
- contentPadding: t.focus?.contentPadding ?? t.focus?.contentOffset ?? 100,
4572
+ contentPadding: t.focus?.contentPadding ?? 100,
4815
4573
  minContentScale: t.focus?.minContentScale ?? 0,
4816
4574
  schedule: n,
4817
4575
  animationDuration: t.focus?.animationDuration ?? 0
4818
4576
  } };
4819
- }, Fn = (e) => ({
4577
+ }, Dn = (e) => ({
4820
4578
  onNodeSelected: e.onNodeSelected,
4821
- mouseDownEventVerifier: e.mouseDownEventVerifier ?? q.mouseDownEventVerifier,
4822
- mouseUpEventVerifier: e.mouseUpEventVerifier ?? q.mouseUpEventVerifier,
4823
- movementThreshold: e.movementThreshold ?? q.movementThreshold
4824
- }), In = (e) => ({
4579
+ mouseDownEventVerifier: e.mouseDownEventVerifier ?? Y.mouseDownEventVerifier,
4580
+ mouseUpEventVerifier: e.mouseUpEventVerifier ?? Y.mouseUpEventVerifier,
4581
+ movementThreshold: e.movementThreshold ?? Y.movementThreshold
4582
+ }), On = (e) => ({
4825
4583
  onCanvasSelected: e.onCanvasSelected,
4826
- mouseDownEventVerifier: e.mouseDownEventVerifier ?? q.mouseDownEventVerifier,
4827
- mouseUpEventVerifier: e.mouseUpEventVerifier ?? q.mouseUpEventVerifier,
4828
- movementThreshold: e.movementThreshold ?? q.movementThreshold
4829
- }), Ln = (e) => ({
4584
+ mouseDownEventVerifier: e.mouseDownEventVerifier ?? Y.mouseDownEventVerifier,
4585
+ mouseUpEventVerifier: e.mouseUpEventVerifier ?? Y.mouseUpEventVerifier,
4586
+ movementThreshold: e.movementThreshold ?? Y.movementThreshold
4587
+ }), kn = (e) => ({
4830
4588
  onEdgeSelected: e.onEdgeSelected,
4831
- mouseDownEventVerifier: e.mouseDownEventVerifier ?? q.mouseDownEventVerifier,
4832
- mouseUpEventVerifier: e.mouseUpEventVerifier ?? q.mouseUpEventVerifier,
4833
- movementThreshold: e.movementThreshold ?? q.movementThreshold
4834
- }), Rn = class {
4589
+ mouseDownEventVerifier: e.mouseDownEventVerifier ?? Y.mouseDownEventVerifier,
4590
+ mouseUpEventVerifier: e.mouseUpEventVerifier ?? Y.mouseUpEventVerifier,
4591
+ movementThreshold: e.movementThreshold ?? Y.movementThreshold
4592
+ }), An = class {
4835
4593
  element;
4836
4594
  used = !1;
4837
4595
  canvasDefaults = {};
@@ -4858,9 +4616,9 @@ var re = (e, t) => {
4858
4616
  window = window;
4859
4617
  animationStaticNodes = /* @__PURE__ */ new Set();
4860
4618
  pointInsideVerifier;
4861
- eventTagger = new ot();
4619
+ eventTagger = new Qe();
4862
4620
  constructor(e) {
4863
- this.element = e, this.pointInsideVerifier = new ee(e, this.window);
4621
+ this.element = e, this.pointInsideVerifier = new C(e, this.window);
4864
4622
  }
4865
4623
  setDefaults(e) {
4866
4624
  return this.canvasDefaults = e, this;
@@ -4902,40 +4660,40 @@ var re = (e, t) => {
4902
4660
  return this.userSelectableCanvasConfig = e, this;
4903
4661
  }
4904
4662
  build() {
4905
- if (this.used) throw new qt("Failed to build Canvas because CanvasBuilder is a single-use object");
4663
+ if (this.used) throw new Rt("Failed to build Canvas because CanvasBuilder is a single-use object");
4906
4664
  this.used = !0;
4907
- let e = new y(this.element), t = new h(), n = new Mt(this.element), r = this.createHtmlView(n.main, t, e), i = Mn(this.canvasDefaults), a = new Xe(t, r, i), o = Tn(this.layoutConfig), s = new rt(t, e, Pn({
4665
+ let e = new y(this.element), t = new h(), n = new St(this.element), r = this.createHtmlView(n.main, t, e), i = wn(this.canvasDefaults), a = new Ue(t, r, i), o = gn(this.layoutConfig), s = new Ye(t, e, En({
4908
4666
  canvasDefaults: this.canvasDefaults,
4909
4667
  hasLayout: this.hasLayout,
4910
4668
  layoutParams: o
4911
- }), this.window), c = new $e(e), l = new d(new Ye(t), c, a, s);
4912
- if (this.hasBackground && gt.configure(l, Ht(this.backgroundConfig), n.background), this.hasNodeResizeReactiveEdges && b.configure(l), this.userSelectableEdgesConfig !== void 0) {
4913
- let e = Ln(this.userSelectableEdgesConfig);
4914
- Dt.configure(l, this.window, this.pointInsideVerifier, this.eventTagger, e);
4669
+ }), this.window), c = new Ge(e), l = new d(new He(t), c, a, s);
4670
+ if (this.hasBackground && st.configure(l, Nt(this.backgroundConfig), n.background), this.hasNodeResizeReactiveEdges && b.configure(l), this.userSelectableEdgesConfig !== void 0) {
4671
+ let e = kn(this.userSelectableEdgesConfig);
4672
+ vt.configure(l, this.window, this.pointInsideVerifier, this.eventTagger, e);
4915
4673
  }
4916
4674
  if (this.userSelectableNodesConfig !== void 0) {
4917
- let e = Fn(this.userSelectableNodesConfig);
4918
- Et.configure(l, this.window, this.pointInsideVerifier, this.eventTagger, e);
4675
+ let e = Dn(this.userSelectableNodesConfig);
4676
+ _t.configure(l, this.window, this.pointInsideVerifier, this.eventTagger, e);
4919
4677
  }
4920
4678
  if (this.userSelectableCanvasConfig !== void 0) {
4921
- let e = In(this.userSelectableCanvasConfig);
4922
- Ot.configure(l, n.main, this.window, this.pointInsideVerifier, this.eventTagger, e);
4679
+ let e = On(this.userSelectableCanvasConfig);
4680
+ yt.configure(l, n.main, this.window, this.pointInsideVerifier, this.eventTagger, e);
4923
4681
  }
4924
4682
  if (this.hasDraggableNodes) {
4925
- let e = Pt(this.dragConfig);
4926
- this.hasAnimatedLayout && (e = En(e, this.animationStaticNodes)), ut.configure(l, n.main, this.window, this.pointInsideVerifier, this.eventTagger, e);
4683
+ let e = Tt(this.dragConfig);
4684
+ this.hasAnimatedLayout && (e = _n(e, this.animationStaticNodes)), tt.configure(l, n.main, this.window, this.pointInsideVerifier, this.eventTagger, e);
4927
4685
  }
4928
4686
  if (this.hasUserConnectablePorts) {
4929
- let t = Ut(this.connectablePortsConfig, i.edges.shapeFactory, l.graph);
4930
- _t.configure(l, n.overlayConnectablePorts, e, this.window, this.pointInsideVerifier, this.eventTagger, t);
4687
+ let t = Pt(this.connectablePortsConfig, i.edges.shapeFactory, l.graph);
4688
+ ct.configure(l, n.overlayConnectablePorts, e, this.window, this.pointInsideVerifier, this.eventTagger, t);
4931
4689
  }
4932
4690
  if (this.hasUserDraggableEdges) {
4933
- let t = Wt(this.draggableEdgesConfig, l.graph);
4934
- vt.configure(l, n.overlayDraggableEdges, e, this.window, this.pointInsideVerifier, this.eventTagger, t);
4691
+ let t = Ft(this.draggableEdgesConfig, l.graph);
4692
+ lt.configure(l, n.overlayDraggableEdges, e, this.window, this.pointInsideVerifier, this.eventTagger, t);
4935
4693
  }
4936
- if (this.virtualScrollConfig === void 0 ? this.hasTransformableViewport && dt.configure(l, n.main, this.window, this.pointInsideVerifier, this.eventTagger, zt(this.transformConfig)) : ft.configure(l, n.main, this.window, zt(this.transformConfig), this.boxRenderingTrigger, this.pointInsideVerifier, this.eventTagger, Gt(this.virtualScrollConfig)), this.hasLayout && St.configure(l, o), this.hasAnimatedLayout) {
4937
- let e = _n(this.animatedLayoutConfig);
4938
- this.hasDraggableNodes && (Dn(l, this.animationStaticNodes), e = On(e, this.animationStaticNodes)), Tt.configure(l, e, this.window);
4694
+ if (this.virtualScrollConfig === void 0 ? this.hasTransformableViewport && nt.configure(l, n.main, this.window, this.pointInsideVerifier, this.eventTagger, At(this.transformConfig)) : rt.configure(l, n.main, this.window, At(this.transformConfig), this.boxRenderingTrigger, this.pointInsideVerifier, this.eventTagger, It(this.virtualScrollConfig)), this.hasLayout && pt.configure(l, o), this.hasAnimatedLayout) {
4695
+ let e = cn(this.animatedLayoutConfig);
4696
+ this.hasDraggableNodes && (vn(l, this.animationStaticNodes), e = yn(e, this.animationStaticNodes)), gt.configure(l, e, this.window);
4939
4697
  }
4940
4698
  return l.onBeforeDestroy.subscribe(() => {
4941
4699
  n.destroy();
@@ -4943,8 +4701,8 @@ var re = (e, t) => {
4943
4701
  }
4944
4702
  createHtmlView(e, t, n) {
4945
4703
  let r = new a(t, n, e);
4946
- return this.virtualScrollConfig !== void 0 && (r = new s(r, t, this.boxRenderingTrigger, Kt(this.virtualScrollConfig))), r = new c(r, t), r;
4704
+ return this.virtualScrollConfig !== void 0 && (r = new s(r, t, this.boxRenderingTrigger, Lt(this.virtualScrollConfig))), r = new c(r, t), r;
4947
4705
  }
4948
4706
  };
4949
4707
  //#endregion
4950
- export { je as BezierEdgeShape, Rn as CanvasBuilder, qt as CanvasBuilderError, p as CanvasError, e as ConnectionCategory, R as DirectEdgeShape, l as EventSubject, Ne as HorizontalEdgeShape, Ke as InteractiveEdgeError, qe as InteractiveEdgeShape, Je as MidpointEdgeShape, ze as OrthogonalEdgeShape, Pe as StraightEdgeShape, Le as VerticalEdgeShape, Be as boxPortOffsetFn };
4708
+ export { ke as BezierEdgeShape, An as CanvasBuilder, Rt as CanvasBuilderError, p as CanvasError, e as ConnectionCategory, R as DirectEdgeShape, l as EventSubject, ze as InteractiveEdgeError, Be as InteractiveEdgeShape, Ve as MidpointEdgeShape, Me as OrthogonalEdgeShape, Ae as StraightEdgeShape };