@linkurious/ogma-annotations 1.1.7 → 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -12,7 +12,7 @@ var $e = { exports: {} };
12
12
  })("Vector", function() {
13
13
  var l = function() {
14
14
  var t = Math.PI * 2, r = 180 / Math.PI, a = Math.PI / 180;
15
- function c(s) {
15
+ function h(s) {
16
16
  return Math.round(s * 1e8) / 1e8;
17
17
  }
18
18
  function d(s, f) {
@@ -192,7 +192,7 @@ var $e = { exports: {} };
192
192
  // @return self.
193
193
  rotateRadiansSelf: function(s) {
194
194
  var f = Math.cos(s), m = Math.sin(s), A = this.x * f - this.y * m, T = this.x * m + this.y * f;
195
- return this.x = c(A), this.y = c(T), this;
195
+ return this.x = h(A), this.y = h(T), this;
196
196
  },
197
197
  // [API]
198
198
  // [chainable]
@@ -609,7 +609,7 @@ function Bt(u) {
609
609
  return u.type == "Point" ? l = [u.coordinates] : u.type == "LineString" || u.type == "MultiPoint" ? l = u.coordinates : u.type == "Polygon" || u.type == "MultiLineString" ? l = u.coordinates.reduce(function(t, r) {
610
610
  return t.concat(r);
611
611
  }, []) : u.type == "MultiPolygon" ? l = u.coordinates.reduce(
612
- (t, r) => t.concat(r.reduce((a, c) => a.concat(c), [])),
612
+ (t, r) => t.concat(r.reduce((a, h) => a.concat(h), [])),
613
613
  []
614
614
  ) : u.type == "Feature" ? l = Bt(u.geometry) : u.type == "GeometryCollection" ? l = u.geometries.reduce(
615
615
  (t, r) => t.concat(Bt(r)),
@@ -628,18 +628,18 @@ function Ft(u, l, t) {
628
628
  }
629
629
  function je(u, l = 5, t = 30) {
630
630
  var s;
631
- const { start: r, end: a } = Vt(u), c = new U(r.x, r.y), g = new U(a.x, a.y).sub(c), p = u.properties.style && u.properties.style.strokeWidth ? (s = u.properties.style) == null ? void 0 : s.strokeWidth : 0;
631
+ const { start: r, end: a } = Vt(u), h = new U(r.x, r.y), g = new U(a.x, a.y).sub(h), p = u.properties.style && u.properties.style.strokeWidth ? (s = u.properties.style) == null ? void 0 : s.strokeWidth : 0;
632
632
  return Math.min(t, Math.max(3 * p, g.length() * 0.1, l));
633
633
  }
634
634
  function ke(u, l, t, r) {
635
635
  const a = l.clone().normalize().invert().mul(r);
636
636
  if (!t || t === "none")
637
637
  return "";
638
- const c = u.clone().add(a.rotateRadians(Math.PI / 8)), d = u.clone().add(a.rotateRadians(-Math.PI / 8)), g = `${u.x} ${u.y}`;
639
- return `M ${c.x} ${c.y} L ${g} ${d.x} ${d.y} ${t === "arrow" ? "" : `${c.x} ${c.y}`}`;
638
+ const h = u.clone().add(a.rotateRadians(Math.PI / 8)), d = u.clone().add(a.rotateRadians(-Math.PI / 8)), g = `${u.x} ${u.y}`;
639
+ return `M ${h.x} ${h.y} L ${g} ${d.x} ${d.y} ${t === "arrow" ? "" : `${h.x} ${h.y}`}`;
640
640
  }
641
641
  function Ln(u, l, t, r, a) {
642
- const { start: c, end: d } = Vt(u), { tail: g, head: p, strokeColor: s, strokeWidth: f } = u.properties.style || t, m = new U(c.x, c.y), A = new U(d.x, d.y), T = A.clone().sub(m), S = je(u, r, a), C = Mt("path");
642
+ const { start: h, end: d } = Vt(u), { tail: g, head: p, strokeColor: s, strokeWidth: f } = u.properties.style || t, m = new U(h.x, h.y), A = new U(d.x, d.y), T = A.clone().sub(m), S = je(u, r, a), C = Mt("path");
643
643
  C.setAttribute("data-annotation", `${u.id}`), C.setAttribute("data-annotation-type", "arrow");
644
644
  const k = p === "arrow-plain" || g === "arrow";
645
645
  C.setAttribute("stroke", s || "none"), C.setAttribute("stroke-width", `${f}`), C.setAttribute("fill", k ? s || "" : "none"), C.setAttribute("stroke-linecap", "round"), C.setAttribute("stroke-linejoin", "round");
@@ -656,7 +656,7 @@ var Fe = { exports: {} };
656
656
  function a(p, s, f) {
657
657
  this.fn = p, this.context = s, this.once = f || !1;
658
658
  }
659
- function c(p, s, f, m, A) {
659
+ function h(p, s, f, m, A) {
660
660
  if (typeof f != "function")
661
661
  throw new TypeError("The listener must be a function");
662
662
  var T = new a(f, m || p, A), S = t ? t + s : s;
@@ -735,9 +735,9 @@ var Fe = { exports: {} };
735
735
  }
736
736
  return !0;
737
737
  }, g.prototype.on = function(s, f, m) {
738
- return c(this, s, f, m, !1);
738
+ return h(this, s, f, m, !1);
739
739
  }, g.prototype.once = function(s, f, m) {
740
- return c(this, s, f, m, !0);
740
+ return h(this, s, f, m, !0);
741
741
  }, g.prototype.removeListener = function(s, f, m, A) {
742
742
  var T = t ? t + s : s;
743
743
  if (!this._events[T])
@@ -842,9 +842,9 @@ class qe extends Be {
842
842
  if (!t)
843
843
  return;
844
844
  const a = t.id;
845
- Object.keys(r).forEach((c) => {
846
- if (c !== "id")
847
- if (c === "properties") {
845
+ Object.keys(r).forEach((h) => {
846
+ if (h !== "id")
847
+ if (h === "properties") {
848
848
  const d = r.properties || { style: {} };
849
849
  t.properties = {
850
850
  ...t.properties || {},
@@ -855,17 +855,18 @@ class qe extends Be {
855
855
  }
856
856
  };
857
857
  } else
858
- c === "geometry" ? t.geometry = {
858
+ h === "geometry" ? t.geometry = {
859
859
  ...t.geometry,
860
860
  ...r.geometry
861
- } : t[c] = r[c];
861
+ } : t[h] = r[h];
862
862
  }), a === this.selectedId && this.refreshEditor(), this.layer.refresh();
863
863
  }
864
864
  getById(t) {
865
- for (let r = 0; r < this.elements.length; r++) {
866
- const a = this.elements[r];
867
- if (a.id === t)
868
- return a;
865
+ const r = Number(t);
866
+ for (let a = 0; a < this.elements.length; a++) {
867
+ const h = this.elements[a];
868
+ if (!(h.id !== t && h.id !== r))
869
+ return h;
869
870
  }
870
871
  }
871
872
  /**
@@ -982,8 +983,8 @@ class Hn extends qe {
982
983
  v(this, "onMouseMove", (t) => {
983
984
  if (!this.isDragging || this.draggedHandle === q)
984
985
  return;
985
- const r = this.handles[this.draggedHandle], a = this.ogma.view.getAngle(), { x: c, y: d } = new U(t.clientX - this.startX, t.clientY - this.startY).divScalar(this.ogma.view.getZoom()).rotateRadians(a), g = r.id === Te, p = r.id === Ie, s = r.id === _e;
986
- (g || p) && Ne(this.arrow, this.start.x + c, this.start.y + d), (g || s) && Re(this.arrow, this.end.x + c, this.end.y + d), this.emit(
986
+ const r = this.handles[this.draggedHandle], a = this.ogma.view.getAngle(), { x: h, y: d } = new U(t.clientX - this.startX, t.clientY - this.startY).divScalar(this.ogma.view.getZoom()).rotateRadians(a), g = r.id === Te, p = r.id === Ie, s = r.id === _e;
987
+ (g || p) && Ne(this.arrow, this.start.x + h, this.start.y + d), (g || s) && Re(this.arrow, this.end.x + h, this.end.y + d), this.emit(
987
988
  Ut,
988
989
  this.arrow,
989
990
  g ? "line" : p ? "start" : "end"
@@ -1004,8 +1005,8 @@ class Hn extends qe {
1004
1005
  startDrawing(t, r, a = Dn(t, r, t, r, Lt)) {
1005
1006
  var g;
1006
1007
  this.add(a), this.hoveredId = a.id;
1007
- const c = this.ogma.view.graphToScreenCoordinates({ x: t, y: r }), d = ((g = this.ogma.getContainer()) == null ? void 0 : g.getBoundingClientRect()) || { left: 0, top: 0 };
1008
- this.startDragging(this.getById(a.id), c.x + (d == null ? void 0 : d.left), c.y + d.top), this.draggedHandle = 2;
1008
+ const h = this.ogma.view.graphToScreenCoordinates({ x: t, y: r }), d = ((g = this.ogma.getContainer()) == null ? void 0 : g.getBoundingClientRect()) || { left: 0, top: 0 };
1009
+ this.startDragging(this.getById(a.id), h.x + (d == null ? void 0 : d.left), h.y + d.top), this.draggedHandle = 2;
1009
1010
  }
1010
1011
  cancelDrawing() {
1011
1012
  this.isDragging && (this.remove(this.arrow.id), this.emit(St, this.arrow), this.restoreDragging(), this.isDragging = !1, this.draggedHandle = q);
@@ -1015,23 +1016,23 @@ class Hn extends qe {
1015
1016
  }
1016
1017
  detect(t, r = 0) {
1017
1018
  return this.elements.find((a) => {
1018
- const { start: c, end: d } = Vt(a), g = new U(t.x, t.y).sub(
1019
- new U((c.x + d.x) / 2, (c.y + d.y) / 2)
1020
- ), p = new U(d.x, d.y).sub(new U(c.x, c.y)), s = p.length(), f = p.normalize(), m = je(a);
1019
+ const { start: h, end: d } = Vt(a), g = new U(t.x, t.y).sub(
1020
+ new U((h.x + d.x) / 2, (h.y + d.y) / 2)
1021
+ ), p = new U(d.x, d.y).sub(new U(h.x, h.y)), s = p.length(), f = p.normalize(), m = je(a);
1021
1022
  return Math.abs(f.dot(g)) < s / 2 + r && Math.abs(f.rotateRadians(Math.PI / 2).dot(g)) < m / 2 + r;
1022
1023
  });
1023
1024
  }
1024
1025
  refreshEditor() {
1025
1026
  if (+this.selectedId < 0 && +this.hoveredId < 0)
1026
1027
  return;
1027
- const t = this.selectedId !== q ? this.getById(this.selectedId) : this.getById(this.hoveredId), r = Vt(t), a = this.ogma.view.graphToScreenCoordinates(r.start), c = this.ogma.view.graphToScreenCoordinates(r.end), d = Math.min(this.ogma.view.getZoom(), this.maxHandleScale), [g, p, s] = Array.prototype.slice.call(
1028
+ const t = this.selectedId !== q ? this.getById(this.selectedId) : this.getById(this.hoveredId), r = Vt(t), a = this.ogma.view.graphToScreenCoordinates(r.start), h = this.ogma.view.graphToScreenCoordinates(r.end), d = Math.min(this.ogma.view.getZoom(), this.maxHandleScale), [g, p, s] = Array.prototype.slice.call(
1028
1029
  this.editor.element.querySelectorAll(".handle")
1029
1030
  );
1030
- p.style.transform = `translate(${a.x}px, ${a.y}px) translate(-50%, -50%) scale(${d})`, s.style.transform = `translate(${c.x}px, ${c.y}px) translate(-50%, -50%) scale(${d}`;
1031
+ p.style.transform = `translate(${a.x}px, ${a.y}px) translate(-50%, -50%) scale(${d})`, s.style.transform = `translate(${h.x}px, ${h.y}px) translate(-50%, -50%) scale(${d}`;
1031
1032
  const f = {
1032
- x: (c.x + a.x) / 2,
1033
- y: (c.y + a.y) / 2
1034
- }, m = new U(c.x - a.x, c.y - a.y), A = m.mul(1 / m.length()), T = Math.atan2(A.y, A.x);
1033
+ x: (h.x + a.x) / 2,
1034
+ y: (h.y + a.y) / 2
1035
+ }, m = new U(h.x - a.x, h.y - a.y), A = m.mul(1 / m.length()), T = Math.atan2(A.y, A.x);
1035
1036
  g.style.width = `${m.length()}px`, g.style.left = `${f.x}px`, g.style.top = `${f.y}px`, g.style.transform = `translate(-50%, -50%) rotate(${T}rad)`;
1036
1037
  }
1037
1038
  getDefaultOptions() {
@@ -1041,7 +1042,7 @@ class Hn extends qe {
1041
1042
  t.innerHTML = "";
1042
1043
  const r = Mt("g"), a = this.ogma.view.getAngle();
1043
1044
  r.setAttribute("transform", `rotate(${-a * (180 / Math.PI)})`), this.elements.forEach(
1044
- (c) => Ln(c, r, Lt, this.minArrowHeight, this.maxArrowHeight)
1045
+ (h) => Ln(h, r, Lt, this.minArrowHeight, this.maxArrowHeight)
1045
1046
  ), t.appendChild(r);
1046
1047
  }
1047
1048
  refreshDrawing() {
@@ -1085,13 +1086,13 @@ const At = {
1085
1086
  }, De = {
1086
1087
  handleSize: 3.5,
1087
1088
  placeholder: "Your text..."
1088
- }, jn = (u = 0, l = 0, t = 100, r = 50, a = "", c = { ...At }) => ({
1089
+ }, jn = (u = 0, l = 0, t = 100, r = 50, a = "", h = { ...At }) => ({
1089
1090
  id: Xt(),
1090
1091
  type: "Feature",
1091
1092
  properties: {
1092
1093
  type: "text",
1093
1094
  content: a,
1094
- style: { ...At, ...c }
1095
+ style: { ...At, ...h }
1095
1096
  },
1096
1097
  geometry: {
1097
1098
  type: "Polygon",
@@ -1123,19 +1124,19 @@ var Ve = { exports: {} };
1123
1124
  }, a(e);
1124
1125
  }
1125
1126
  t.d(r, { default: () => Sn });
1126
- var c = /^((?:[a-z\d-]+\s+)*)([\d.]+(%|em|px)|(?:x+-)?large|(?:x+-)?small|medium)(?:\s*\/\s*(normal|[\d.]+(%|px|em)?))?(\s.+)?$/, d = /\bsmall-caps\b/, g = /\b(?:italic|oblique)\b/, p = /\bbold(?:er)?\b/, s = 13.3333333, f = { "xx-small": 9, "x-small": 10, smaller: 13.3333, small: 13, medium: 16, large: 18, larger: 19.2, "x-large": 24, "xx-large": 32 };
1127
+ var h = /^((?:[a-z\d-]+\s+)*)([\d.]+(%|em|px)|(?:x+-)?large|(?:x+-)?small|medium)(?:\s*\/\s*(normal|[\d.]+(%|px|em)?))?(\s.+)?$/, d = /\bsmall-caps\b/, g = /\b(?:italic|oblique)\b/, p = /\bbold(?:er)?\b/, s = 13.3333333, f = { "xx-small": 9, "x-small": 10, smaller: 13.3333, small: 13, medium: 16, large: 18, larger: 19.2, "x-large": 24, "xx-large": 32 };
1127
1128
  function m(e) {
1128
1129
  var n = "", o = this;
1129
1130
  return o.style && o.style !== "normal" && (n += o.style), o.variant && o.variant !== "normal" && (n += (n ? " " : "") + o.variant), o.weight && o.weight !== "normal" && (n += (n ? " " : "") + o.weight), o.size && (n += (n ? " " : "") + o.size + "px", o.height !== o.size && (n += "/" + o.height + "px")), o.family && (n += (n ? " " : "") + o.family), e && (n += "::" + o.baseline), e && (n += "::" + o.color), n;
1130
1131
  }
1131
1132
  var A = { id: "", family: "sans-serif", height: 14, size: 12, variant: "", style: "", weight: "", baseline: "", color: null, toString: m, valueOf: m };
1132
1133
  function T(e) {
1133
- var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, o = c.exec(e);
1134
+ var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, o = h.exec(e);
1134
1135
  n.family = (o[6] || "").trim();
1135
1136
  var i = f[o[2]] || parseFloat(o[2]);
1136
1137
  o[3] === "%" ? i *= 0.16 : o[3] === "em" ? i *= 16 : o[3] === "pt" && (i *= s), n.size = i;
1137
- var h = parseFloat(o[4]);
1138
- if (h !== "normal" && h !== "inherit" && h ? o[5] && o[5] !== "em" ? o[5] === "pt" ? n.height = h * s : o[5] === "%" ? n.height = 0.01 * i : n.height = h : n.height = h * i : n.height = Math.round(i * (7 / 6)), d.test(o[1]) && (n.variant = "small-caps"), g.test(o[1]) && (n.style = "italic"), p.test(o[1]))
1138
+ var c = parseFloat(o[4]);
1139
+ if (c !== "normal" && c !== "inherit" && c ? o[5] && o[5] !== "em" ? o[5] === "pt" ? n.height = c * s : o[5] === "%" ? n.height = 0.01 * i : n.height = c : n.height = c * i : n.height = Math.round(i * (7 / 6)), d.test(o[1]) && (n.variant = "small-caps"), g.test(o[1]) && (n.style = "italic"), p.test(o[1]))
1139
1140
  n.weight = "bold";
1140
1141
  else {
1141
1142
  var y = parseInt(/\b(\d+)\b/.exec(o[1]), 10);
@@ -1144,7 +1145,7 @@ var Ve = { exports: {} };
1144
1145
  return n;
1145
1146
  }
1146
1147
  function S() {
1147
- var e, n, o, i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "12px/14px sans-serif", h = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, y = 14, w = 12, x = null, b = null, E = "";
1148
+ var e, n, o, i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "12px/14px sans-serif", c = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, y = 14, w = 12, x = null, b = null, E = "";
1148
1149
  if (i && i.nodeType) {
1149
1150
  var O = i && (i.ownerDocument && i.ownerDocument.defaultView || i.document && i || i.defaultView), M = O.getComputedStyle(i, null);
1150
1151
  e = M.getPropertyValue("font-family") || "", w = parseFloat(M.getPropertyValue("font-size")), y = M.getPropertyValue("line-height"), x = M.getPropertyValue("font-weight"), b = M.getPropertyValue("font-style"), E = M.getPropertyValue("font-variant") || "";
@@ -1153,9 +1154,9 @@ var Ve = { exports: {} };
1153
1154
  e = I.family, w = I.size, y = I.height, E = I.variant, b = I.style, x = I.weight;
1154
1155
  } else
1155
1156
  a(i) === "object" && (e = i.family, w = i.size, y = i.height, E = i.variant, x = i.weight, b = i.style, n = i.baseline, o = i.color);
1156
- h.size && h.size < 3 && (w *= h.size), y = y !== "normal" && y ? parseFloat(y) : w * (7 / 6), h.height && h.height < 3 && (y *= h.height);
1157
+ c.size && c.size < 3 && (w *= c.size), y = y !== "normal" && y ? parseFloat(y) : w * (7 / 6), c.height && c.height < 3 && (y *= c.height);
1157
1158
  var z = Object.create(A);
1158
- return z.family = h.family || e || "sans-serif", z.height = y ?? 14, z.size = w ?? 12, z.variant = h.variant || E || "", z.style = h.style || b || "", z.weight = h.weight || x || "", z.baseline = n || 0, h.baseline != null && (z.baseline = h.baseline), z.color = h.color || o || "", z.id = m.call(z, !0), z;
1159
+ return z.family = c.family || e || "sans-serif", z.height = y ?? 14, z.size = w ?? 12, z.variant = c.variant || E || "", z.style = c.style || b || "", z.weight = c.weight || x || "", z.baseline = n || 0, c.baseline != null && (z.baseline = c.baseline), z.color = c.color || o || "", z.id = m.call(z, !0), z;
1159
1160
  }
1160
1161
  const C = { "\n": 0.28, "\r": 0.28, " ": 0.28, " ": 0.28, " ": 0.28, "᠎": 0, " ": 0.5, " ": 1, " ": 0.5, " ": 1, " ": 0.33, " ": 0.25, " ": 0.16, " ": 0.56, " ": 0.28, " ": 0.2, " ": 0.15, "​": 0, " ": 0.16, " ": 0.22, " ": 1, "\uFEFF": 0 };
1161
1162
  var k, F = function(e) {
@@ -1163,8 +1164,8 @@ var Ve = { exports: {} };
1163
1164
  if (n && n.getContext) {
1164
1165
  var o = n.getContext("2d");
1165
1166
  if (o && typeof o.measureText == "function")
1166
- return function(i, h) {
1167
- return o.font = String(h), o.measureText(i).width;
1167
+ return function(i, c) {
1168
+ return o.font = String(c), o.measureText(i).width;
1168
1169
  };
1169
1170
  }
1170
1171
  }(typeof document < "u" ? document : null) || (k = {}, function(e, n) {
@@ -1175,14 +1176,14 @@ var Ve = { exports: {} };
1175
1176
  return e.length * k[n].size;
1176
1177
  }), X = {}, D = { trim: !0, collapse: !0 };
1177
1178
  function Y(e, n, o) {
1178
- var i = Object.assign({}, D, o), h = String(e);
1179
- if (!h)
1179
+ var i = Object.assign({}, D, o), c = String(e);
1180
+ if (!c)
1180
1181
  return 0;
1181
- if (h in C) {
1182
- var y = n.id + "/" + h;
1183
- return y in X || (X[y] = F("_".concat(h, "_"), n) - F("__", n)), X[y];
1182
+ if (c in C) {
1183
+ var y = n.id + "/" + c;
1184
+ return y in X || (X[y] = F("_".concat(c, "_"), n) - F("__", n)), X[y];
1184
1185
  }
1185
- return i.trim && i.collapse ? i.trim ? h = h.trim() : i.collapse && (h = h.replace(/\s+/g, " ")) : h = h.replace(/\n/g, " "), F(h, n) + n.size * (e.tracking || 0);
1186
+ return i.trim && i.collapse ? i.trim ? c = c.trim() : i.collapse && (c = c.replace(/\s+/g, " ")) : c = c.replace(/\n/g, " "), F(c, n) + n.size * (e.tracking || 0);
1186
1187
  }
1187
1188
  function G(e) {
1188
1189
  return G = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
@@ -1217,8 +1218,8 @@ var Ve = { exports: {} };
1217
1218
  return function() {
1218
1219
  var o, i = Ct(e);
1219
1220
  if (n) {
1220
- var h = Ct(this).constructor;
1221
- o = Reflect.construct(i, arguments, h);
1221
+ var c = Ct(this).constructor;
1222
+ o = Reflect.construct(i, arguments, c);
1222
1223
  } else
1223
1224
  o = i.apply(this, arguments);
1224
1225
  return Ue(this, o);
@@ -1247,7 +1248,7 @@ var Ve = { exports: {} };
1247
1248
  function ue(e, n) {
1248
1249
  for (var o = 0; o < n.length; o++) {
1249
1250
  var i = n[o];
1250
- i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, (h = function(y, w) {
1251
+ i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, (c = function(y, w) {
1251
1252
  if (G(y) !== "object" || y === null)
1252
1253
  return y;
1253
1254
  var x = y[Symbol.toPrimitive];
@@ -1258,9 +1259,9 @@ var Ve = { exports: {} };
1258
1259
  throw new TypeError("@@toPrimitive must return a primitive value.");
1259
1260
  }
1260
1261
  return String(y);
1261
- }(i.key, "string"), G(h) === "symbol" ? h : String(h)), i);
1262
+ }(i.key, "string"), G(c) === "symbol" ? c : String(c)), i);
1262
1263
  }
1263
- var h;
1264
+ var c;
1264
1265
  }
1265
1266
  function Pt(e, n, o) {
1266
1267
  return n && ue(e.prototype, n), o && ue(e, o), Object.defineProperty(e, "prototype", { writable: !1 }), e;
@@ -1302,16 +1303,16 @@ var Ve = { exports: {} };
1302
1303
  }(N), Zt = /^[\n\r\t\x20\xA0\u2000-\u200B\u205F\u3000]/, Ye = /^[^\n\r\t\u0020\u2000-\u200B\u205F\u3000]{2,}/, de = /^[\xA0\u2011\u202F\u2060\uFEFF]/, Xe = /^(?:[;\xAD%?…]|,(?!\d))/, Ge = /^[´±°¢£¤$¥\u2212]/;
1303
1304
  function Nt(e, n) {
1304
1305
  n !== !1 && (e = e.trim());
1305
- for (var o, i, h = [], y = e.charAt(0), w = 0, x = 1, b = e.length; x < b; x++) {
1306
+ for (var o, i, c = [], y = e.charAt(0), w = 0, x = 1, b = e.length; x < b; x++) {
1306
1307
  o = e.charAt(x), i = e.charAt(x + 1);
1307
1308
  var E = Zt.test(y), O = Zt.test(o), M = O || E, I = void 0;
1308
1309
  if ((Ge.test(o) && !de.test(y) || Xe.test(y + i) && !de.test(o)) && (M = !0), y !== "-" && y !== "‐" && y !== "–" && y !== "—" || ((I = Zt.test(e.charAt(x - 2))) && !O && (M = !1), !I && Ye.test(o + i) && (M = !0)), M) {
1309
1310
  var z = e.slice(w, x);
1310
- /\u00AD$/.test(z) ? (h.push(new N(z.slice(0, -1))), h.push(new pt())) : (h.push(new N(z)), h.push(new Tt())), w = x;
1311
+ /\u00AD$/.test(z) ? (c.push(new N(z.slice(0, -1))), c.push(new pt())) : (c.push(new N(z)), c.push(new Tt())), w = x;
1311
1312
  }
1312
1313
  y = o;
1313
1314
  }
1314
- return h.push(new N(e.slice(w))), h;
1315
+ return c.push(new N(e.slice(w))), c;
1315
1316
  }
1316
1317
  const fe = { nbsp: " ", iexcl: "¡", cent: "¢", pound: "£", curren: "¤", yen: "¥", brvbar: "¦", sect: "§", uml: "¨", copy: "©", ordf: "ª", laquo: "«", not: "¬", shy: "­", reg: "®", macr: "¯", deg: "°", plusmn: "±", sup2: "²", sup3: "³", acute: "´", micro: "µ", para: "¶", middot: "·", cedil: "¸", sup1: "¹", ordm: "º", raquo: "»", frac14: "¼", frac12: "½", frac34: "¾", iquest: "¿", Agrave: "À", Aacute: "Á", Acirc: "Â", Atilde: "Ã", Auml: "Ä", Aring: "Å", AElig: "Æ", Ccedil: "Ç", Egrave: "È", Eacute: "É", Ecirc: "Ê", Euml: "Ë", Igrave: "Ì", Iacute: "Í", Icirc: "Î", Iuml: "Ï", ETH: "Ð", Ntilde: "Ñ", Ograve: "Ò", Oacute: "Ó", Ocirc: "Ô", Otilde: "Õ", Ouml: "Ö", times: "×", Oslash: "Ø", Ugrave: "Ù", Uacute: "Ú", Ucirc: "Û", Uuml: "Ü", Yacute: "Ý", THORN: "Þ", szlig: "ß", agrave: "à", aacute: "á", acirc: "â", atilde: "ã", auml: "ä", aring: "å", aelig: "æ", ccedil: "ç", egrave: "è", eacute: "é", ecirc: "ê", euml: "ë", igrave: "ì", iacute: "í", icirc: "î", iuml: "ï", eth: "ð", ntilde: "ñ", ograve: "ò", oacute: "ó", ocirc: "ô", otilde: "õ", ouml: "ö", divide: "÷", oslash: "ø", ugrave: "ù", uacute: "ú", ucirc: "û", uuml: "ü", yacute: "ý", thorn: "þ", yuml: "ÿ", fnof: "ƒ", Alpha: "Α", Beta: "Β", Gamma: "Γ", Delta: "Δ", Epsilon: "Ε", Zeta: "Ζ", Eta: "Η", Theta: "Θ", Iota: "Ι", Kappa: "Κ", Lambda: "Λ", Mu: "Μ", Nu: "Ν", Xi: "Ξ", Omicron: "Ο", Pi: "Π", Rho: "Ρ", Sigma: "Σ", Tau: "Τ", Upsilon: "Υ", Phi: "Φ", Chi: "Χ", Psi: "Ψ", Omega: "Ω", alpha: "α", beta: "β", gamma: "γ", delta: "δ", epsilon: "ε", zeta: "ζ", eta: "η", theta: "θ", iota: "ι", kappa: "κ", lambda: "λ", mu: "μ", nu: "ν", xi: "ξ", omicron: "ο", pi: "π", rho: "ρ", sigmaf: "ς", sigma: "σ", tau: "τ", upsilon: "υ", phi: "φ", chi: "χ", psi: "ψ", omega: "ω", thetasym: "ϑ", upsih: "ϒ", piv: "ϖ", bull: "•", hellip: "…", prime: "′", Prime: "″", oline: "‾", frasl: "⁄", weierp: "℘", image: "ℑ", real: "ℜ", trade: "™", alefsym: "ℵ", larr: "←", uarr: "↑", rarr: "→", darr: "↓", harr: "↔", crarr: "↵", lArr: "⇐", uArr: "⇑", rArr: "⇒", dArr: "⇓", hArr: "⇔", forall: "∀", part: "∂", exist: "∃", empty: "∅", nabla: "∇", isin: "∈", notin: "∉", ni: "∋", prod: "∏", sum: "∑", minus: "−", lowast: "∗", radic: "√", prop: "∝", infin: "∞", ang: "∠", and: "⊥", or: "⊦", cap: "∩", cup: "∪", int: "∫", there4: "∴", sim: "∼", cong: "≅", asymp: "≈", ne: "≠", equiv: "≡", le: "≤", ge: "≥", sub: "⊂", sup: "⊃", nsub: "⊄", sube: "⊆", supe: "⊇", oplus: "⊕", otimes: "⊗", perp: "⊥", sdot: "⋅", lceil: "⌈", rceil: "⌉", lfloor: "⌊", rfloor: "⌋", lang: "〈", rang: "〉", loz: "◊", spades: "♠", clubs: "♣", hearts: "♥", diams: "♦", quot: '"', amp: "&", lt: "<", gt: ">", OElig: "Œ", oelig: "œ", Scaron: "Š", scaron: "š", Yuml: "Ÿ", circ: "ˆ", tilde: "˜", ensp: " ", emsp: " ", thinsp: " ", zwnj: "‌", zwj: "‍", lrm: "‎", rlm: "‏", ndash: "–", mdash: "—", lsquo: "‘", rsquo: "’", sbquo: "‚", ldquo: "“", rdquo: "”", bdquo: "„", dagger: "†", Dagger: "‡", permil: "‰", lsaquo: "‹", rsaquo: "›" };
1317
1318
  var Ze = /^[\n\r\x20\u2000-\u200B\u205F\u3000]/, We = /^<\/([a-zA-Z0-9]+)([^>]*)>/, Ke = /^<([a-zA-Z0-9]+)((?:\s[^=\s/]+(?:\s*=\s*(?:"[^"]+"|'[^']+'|[^>\\s]+))?)+)?\s*(\/?)>(\n*)/, Je = /^<!--(.+?)-->/, Qe = /&(?:#(\d\d{2,})|#x([\da-fA-F]{2,})|([a-zA-Z][a-zA-Z1-4]{1,8}));/g, pe = { b: function(e) {
@@ -1342,12 +1343,12 @@ var Ve = { exports: {} };
1342
1343
  e.sup = !0;
1343
1344
  } }, tn = { div: 1, li: 1, blockquote: 2, h1: 2, h2: 2, h3: 2, h4: 2, h5: 2, h6: 2, ul: 2, ol: 2, hr: 2, p: 2 };
1344
1345
  function ge(e) {
1345
- return e.replace(Qe, function(n, o, i, h) {
1346
+ return e.replace(Qe, function(n, o, i, c) {
1346
1347
  if (o || i) {
1347
1348
  var y = o ? 10 : 16;
1348
1349
  return String.fromCharCode(parseInt(o || i, y));
1349
1350
  }
1350
- return h in fe ? fe[h] : n;
1351
+ return c in fe ? fe[c] : n;
1351
1352
  });
1352
1353
  }
1353
1354
  function en(e) {
@@ -1399,8 +1400,8 @@ var Ve = { exports: {} };
1399
1400
  return (e.style || e.weight || e.baseline || e.color || e.size || e.family) && (o = S(n, e)), o;
1400
1401
  }
1401
1402
  function me(e, n, o) {
1402
- for (var i, h, y = e.width; y + o.width > n && e.length; )
1403
- h = (i = e[e.length - 1]).width, i.width > o.width ? (i.value = i.value.slice(0, -1), i.width = Y(i, i.font), y += i.width) : e.pop(), y -= h;
1403
+ for (var i, c, y = e.width; y + o.width > n && e.length; )
1404
+ c = (i = e[e.length - 1]).width, i.width > o.width ? (i.value = i.value.slice(0, -1), i.width = Y(i, i.font), y += i.width) : e.pop(), y -= c;
1404
1405
  e[e.length - 1] instanceof pt && e.pop(), i = e[e.length - 1] || i || {}, o.font = S(o.font, i.bold, i.italic, ""), o.href = e.length ? i.href : null, o.rel = e.length ? i.rel : null, o.target = e.length ? i.target : null, e.push(o);
1405
1406
  }
1406
1407
  function vt(e) {
@@ -1435,12 +1436,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1435
1436
  return !e && !n || e === n;
1436
1437
  };
1437
1438
  function gn(e, n) {
1438
- var o = [], i = n.font(), h = i.size, y = i.family, w = n.align(), x = n.createElement();
1439
+ var o = [], i = n.font(), c = i.size, y = i.family, w = n.align(), x = n.createElement();
1439
1440
  if (e.length) {
1440
- var b = i.height, E = n.valign(), O = n.height()(), M = n.width()(0), I = !isFinite(M) && e.length === 1, z = I ? null : n.x(), R = vt(b / h), Q = I ? null : vt(b / (1.15 * h + (b - h) / 2));
1441
+ var b = i.height, E = n.valign(), O = n.height()(), M = n.width()(0), I = !isFinite(M) && e.length === 1, z = I ? null : n.x(), R = vt(b / c), Q = I ? null : vt(b / (1.15 * c + (b - c) / 2));
1441
1442
  if (pn[E] && isFinite(O)) {
1442
1443
  var $ = E === "bottom" ? 1 : 0.5;
1443
- Q += (O * $ - b * e.length * $) / h;
1444
+ Q += (O * $ - b * e.length * $) / c;
1444
1445
  }
1445
1446
  var L = w === "justify", H = 0;
1446
1447
  w === "right" ? H = M : w === "center" && (H = M / 2);
@@ -1456,7 +1457,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1456
1457
  P = [];
1457
1458
  for (var xt = 0, Dt = 0, ht = void 0, W = 0, Rt = lt.length; W < Rt; W++) {
1458
1459
  var B = lt[W], K = B.font;
1459
- B.whitespace && xt++, Dt += B.width, W && !B.tracking && !st && Kt(K.id, at) && Kt(B.class, dt) && Kt(ht, B.href) ? j += B.value : (_(), j = B.value, Z = { fontFamily: K.family !== y ? K.family : null, fontSize: K.size !== h ? K.size : null, fontWeight: K.weight || null, fontStyle: K.style || null, fontVariant: K.variant !== "normal" && K.variant || null, fill: K.color || null, baselineShift: K.baseline ? 100 * K.baseline + "%" : null, className: B.class || null }, st && (Z.dx = vt(st), st = 0), B.tracking && (st = K.size * B.tracking), B.href && !ht ? (ht = B.href, tt = "a", Z.href = ht, Z.rel = B.rel, Z.target = B.target) : ht = null, at = K.id, dt = B.class);
1460
+ B.whitespace && xt++, Dt += B.width, W && !B.tracking && !st && Kt(K.id, at) && Kt(B.class, dt) && Kt(ht, B.href) ? j += B.value : (_(), j = B.value, Z = { fontFamily: K.family !== y ? K.family : null, fontSize: K.size !== c ? K.size : null, fontWeight: K.weight || null, fontStyle: K.style || null, fontVariant: K.variant !== "normal" && K.variant || null, fill: K.color || null, baselineShift: K.baseline ? 100 * K.baseline + "%" : null, className: B.class || null }, st && (Z.dx = vt(st), st = 0), B.tracking && (st = K.size * B.tracking), B.href && !ht ? (ht = B.href, tt = "a", Z.href = ht, Z.rel = B.rel, Z.target = B.target) : ht = null, at = K.id, dt = B.class);
1460
1461
  }
1461
1462
  if (_(), I)
1462
1463
  o.push.apply(o, ve(P));
@@ -1468,19 +1469,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1468
1469
  o.push(x("tspan", { x: z(it), dy: vt(it ? R : Q) + "em" }, " "));
1469
1470
  }
1470
1471
  }
1471
- return x.apply(void 0, ["text", { fontFamily: y, fontSize: h, textAnchor: fn[w] || "start" }].concat(o));
1472
+ return x.apply(void 0, ["text", { fontFamily: y, fontSize: c, textAnchor: fn[w] || "start" }].concat(o));
1472
1473
  }
1473
1474
  var yn = { middle: 0.5, center: 0.5, bottom: 1, end: 1 };
1474
1475
  function mn(e, n, o) {
1475
1476
  if (e.length) {
1476
1477
  o.textBaseline = "middle";
1477
- var i = n.font(), h = i.height, y = i.size, w = n.valign(), x = n.height()(), b = n.width()(0), E = n.align(), O = E === "justify", M = 0.5 * h, I = yn[w];
1478
+ var i = n.font(), c = i.height, y = i.size, w = n.valign(), x = n.height()(), b = n.width()(0), E = n.align(), O = E === "justify", M = 0.5 * c, I = yn[w];
1478
1479
  if (I && isFinite(x)) {
1479
- var z = e.length * h;
1480
+ var z = e.length * c;
1480
1481
  M += x * I - z * I;
1481
1482
  }
1482
1483
  e.forEach(function(R, Q) {
1483
- var $ = n.x()(Q), L = Q * h + M, H = 0, P = 0;
1484
+ var $ = n.x()(Q), L = Q * c + M, H = 0, P = 0;
1484
1485
  R.forEach(function(j) {
1485
1486
  j.whitespace && H++, P += j.width;
1486
1487
  });
@@ -1526,7 +1527,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1526
1527
  function vn(e, n) {
1527
1528
  for (var o = 0; o < n.length; o++) {
1528
1529
  var i = n[o];
1529
- i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, (h = function(y, w) {
1530
+ i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, (c = function(y, w) {
1530
1531
  if (It(y) !== "object" || y === null)
1531
1532
  return y;
1532
1533
  var x = y[Symbol.toPrimitive];
@@ -1537,9 +1538,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1537
1538
  throw new TypeError("@@toPrimitive must return a primitive value.");
1538
1539
  }
1539
1540
  return String(y);
1540
- }(i.key, "string"), It(h) === "symbol" ? h : String(h)), i);
1541
+ }(i.key, "string"), It(c) === "symbol" ? c : String(c)), i);
1541
1542
  }
1542
- var h;
1543
+ var c;
1543
1544
  }
1544
1545
  var xn = S(), Qt = function(e) {
1545
1546
  return typeof e == "function" ? e : function() {
@@ -1557,12 +1558,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1557
1558
  }, x: function() {
1558
1559
  return 0;
1559
1560
  }, font: null, tAnchor: 0, parser: e.defaultparser }, i)
1560
- for (var h in i)
1561
- typeof this[h] == "function" && this[h](i[h]);
1561
+ for (var c in i)
1562
+ typeof this[c] == "function" && this[c](i[c]);
1562
1563
  }
1563
1564
  var n, o;
1564
1565
  return n = e, o = [{ key: "linebreak", value: function(i) {
1565
- var h = this, y = this.props.parser(String(i)), w = this.font(), x = function(b, E, O) {
1566
+ var c = this, y = this.props.parser(String(i)), w = this.font(), x = function(b, E, O) {
1566
1567
  if (!b.length)
1567
1568
  return [];
1568
1569
  var M = E.height(), I = E.width(), z = E.overflowLine(), R = E.overflowWrap(), Q = S(O, !0, !1), $ = isFinite(M()) ? Math.floor(M() / O.height) : 1 / 0;
@@ -1632,7 +1633,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1632
1633
  return W.font = O, W.width = ht, W;
1633
1634
  }(y, this, w);
1634
1635
  return x.height = x.length * w.height, x.render = function(b) {
1635
- return h.render(x, b);
1636
+ return c.render(x, b);
1636
1637
  }, x.svg = x.render, x.draw = x.render, x;
1637
1638
  } }, { key: "font", value: function(i) {
1638
1639
  return arguments.length ? (this.props.font = S(i), this) : this.props.font || S(xn);
@@ -1645,13 +1646,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1645
1646
  } }, { key: "align", value: function(i) {
1646
1647
  if (!arguments.length)
1647
1648
  return this.props.align;
1648
- var h = String(i).toLowerCase();
1649
- return h === "left" || h === "start" ? (this.props.align = "left", this.props.tAnchor = 0) : h === "center" || h === "middle" ? (this.props.align = "center", this.props.tAnchor = -0.5) : h === "end" || h === "right" ? (this.props.align = "right", this.props.tAnchor = -1) : h === "justify" && (this.props.align = i, this.props.tAnchor = 0), this;
1649
+ var c = String(i).toLowerCase();
1650
+ return c === "left" || c === "start" ? (this.props.align = "left", this.props.tAnchor = 0) : c === "center" || c === "middle" ? (this.props.align = "center", this.props.tAnchor = -0.5) : c === "end" || c === "right" ? (this.props.align = "right", this.props.tAnchor = -1) : c === "justify" && (this.props.align = i, this.props.tAnchor = 0), this;
1650
1651
  } }, { key: "overflowWrap", value: function(i) {
1651
1652
  if (!arguments.length)
1652
1653
  return this.props.overflowWrap || "normal";
1653
- var h = String(i).toLowerCase();
1654
- return h === "break-word" ? this.props.overflowWrap = "break-word" : h !== "normal" && i != null || (this.props.overflowWrap = null), this;
1654
+ var c = String(i).toLowerCase();
1655
+ return c === "break-word" ? this.props.overflowWrap = "break-word" : c !== "normal" && i != null || (this.props.overflowWrap = null), this;
1655
1656
  } }, { key: "width", value: function(i) {
1656
1657
  return arguments.length ? (this.props.width = Qt(i), this) : this.props.width;
1657
1658
  } }, { key: "height", value: function(i) {
@@ -1662,8 +1663,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1662
1663
  if (!arguments.length)
1663
1664
  return this.props.parser;
1664
1665
  if (typeof i == "string") {
1665
- var h = e[i] || e[i + "parser"];
1666
- typeof h == "function" && (i = h);
1666
+ var c = e[i] || e[i + "parser"];
1667
+ typeof c == "function" && (i = c);
1667
1668
  }
1668
1669
  if (typeof i != "function")
1669
1670
  throw new Error("Unknown parser: " + i);
@@ -1691,7 +1692,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1691
1692
  function wn(e, n) {
1692
1693
  for (var o = 0; o < n.length; o++) {
1693
1694
  var i = n[o];
1694
- i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, (h = function(y, w) {
1695
+ i.enumerable = i.enumerable || !1, i.configurable = !0, "value" in i && (i.writable = !0), Object.defineProperty(e, (c = function(y, w) {
1695
1696
  if (_t(y) !== "object" || y === null)
1696
1697
  return y;
1697
1698
  var x = y[Symbol.toPrimitive];
@@ -1702,9 +1703,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1702
1703
  throw new TypeError("@@toPrimitive must return a primitive value.");
1703
1704
  }
1704
1705
  return String(y);
1705
- }(i.key, "string"), _t(h) === "symbol" ? h : String(h)), i);
1706
+ }(i.key, "string"), _t(c) === "symbol" ? c : String(c)), i);
1706
1707
  }
1707
- var h;
1708
+ var c;
1708
1709
  }
1709
1710
  var we = function(e) {
1710
1711
  return typeof e == "function" ? e : function() {
@@ -1720,13 +1721,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1720
1721
  }, height: function() {
1721
1722
  return 1 / 0;
1722
1723
  }, rotation: 0, vAnchor: 0, hAnchor: 0 }, i)
1723
- for (var h in i)
1724
- typeof this[h] == "function" && this[h](i[h]);
1724
+ for (var c in i)
1725
+ typeof this[c] == "function" && this[c](i[c]);
1725
1726
  this.render = this.render.bind(this);
1726
1727
  }
1727
1728
  var n, o;
1728
1729
  return n = e, o = [{ key: "anchor", value: function(i) {
1729
- var h = this.props, y = h.hAnchor, w = h.vAnchor, x = h.width, b = h.height;
1730
+ var c = this.props, y = c.hAnchor, w = c.vAnchor, x = c.width, b = c.height;
1730
1731
  if (!arguments.length)
1731
1732
  return [y * x(0), w * b(0)];
1732
1733
  if (typeof i == "string") {
@@ -1744,7 +1745,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1744
1745
  return arguments.length ? (this.props.rotation = i, this) : this.props.rotation;
1745
1746
  } }, { key: "createElement", value: function(i) {
1746
1747
  return arguments.length ? (this.props.createElement = i, this) : this.props.createElement || e.createElement;
1747
- } }, { key: "canvas", value: function(i, h) {
1748
+ } }, { key: "canvas", value: function(i, c) {
1748
1749
  var y, w = i.getContext ? i.getContext("2d") : i;
1749
1750
  return w.save(), w.rotate(this.rotate() * Math.PI / 180), w.translate.apply(w, function(x) {
1750
1751
  if (Array.isArray(x))
@@ -1762,7 +1763,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1762
1763
  }(y) || function() {
1763
1764
  throw new TypeError(`Invalid attempt to spread non-iterable instance.
1764
1765
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
1765
- }()), h(w), w.restore(), w;
1766
+ }()), c(w), w.restore(), w;
1766
1767
  } }, { key: "render", value: function() {
1767
1768
  var i = xe(arguments);
1768
1769
  if (i.d3)
@@ -1770,8 +1771,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1770
1771
  if (i.ctx)
1771
1772
  return this.canvas(i.ctx, i.fn);
1772
1773
  if (i.text) {
1773
- var h = typeof i.text.render == "function" ? i.text.render() : i.text;
1774
- return this.createElement()("g", { transform: "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")") }, h);
1774
+ var c = typeof i.text.render == "function" ? i.text.render() : i.text;
1775
+ return this.createElement()("g", { transform: "rotate(".concat(this.rotate(), ") translate(").concat(this.anchor(), ")") }, c);
1775
1776
  }
1776
1777
  } }], o && wn(n.prototype, o), Object.defineProperty(n, "prototype", { writable: !1 }), e;
1777
1778
  }(), bn = Object.prototype.hasOwnProperty, ee = {};
@@ -1793,7 +1794,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1793
1794
  if (n && o.setAttribute)
1794
1795
  for (var i in n)
1795
1796
  bn.call(n, i) && n[i] != null && o.setAttribute(i === "className" ? "class" : An(i), n[i]);
1796
- for (var h = arguments.length, y = new Array(h > 2 ? h - 2 : 0), w = 2; w < h; w++)
1797
+ for (var c = arguments.length, y = new Array(c > 2 ? c - 2 : 0), w = 2; w < c; w++)
1797
1798
  y[w - 2] = arguments[w];
1798
1799
  return y != null && y.length && y.forEach(function(x) {
1799
1800
  Ae(o, x);
@@ -1802,19 +1803,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1802
1803
  }
1803
1804
  rt.createElement = Se, rt.textparser = Nt, rt.defaultparser = Nt, rt.htmlparser = function(e) {
1804
1805
  e = String(e || "").trim();
1805
- for (var n, o, i = { weight: null, style: null, sub: !1, sup: !1, href: null, color: null, rel: null, target: null }, h = [], y = [], w = function(M) {
1806
+ for (var n, o, i = { weight: null, style: null, sub: !1, sup: !1, href: null, color: null, rel: null, target: null }, c = [], y = [], w = function(M) {
1806
1807
  for (var I in i)
1807
1808
  i[I] && (M[I] = i[I]);
1808
- h.push(M);
1809
+ c.push(M);
1809
1810
  }, x = function(M) {
1810
- var I = h.length, z = tn[M];
1811
+ var I = c.length, z = tn[M];
1811
1812
  if (I && z) {
1812
- for (var R = I - 1; h[R] && (h[R] instanceof Tt || Ze.test(h[R].value)); )
1813
+ for (var R = I - 1; c[R] && (c[R] instanceof Tt || Ze.test(c[R].value)); )
1813
1814
  R--;
1814
- for (; z && h[R] && h[R] instanceof nt; )
1815
+ for (; z && c[R] && c[R] instanceof nt; )
1815
1816
  R--, z--;
1816
1817
  for (; z-- > 0; )
1817
- h.push(new nt());
1818
+ c.push(new nt());
1818
1819
  }
1819
1820
  }; e.length; ) {
1820
1821
  if (n = /^[^<]+/.exec(e))
@@ -1826,14 +1827,14 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1826
1827
  var b = n[1];
1827
1828
  x(b), y.push(i), i = Object.create(i), pe[b] && pe[b](i, "");
1828
1829
  var E = rn(n[2]);
1829
- b === "a" && (E.href && (i.href = E.href), E.rel && (i.rel = E.rel), E.target && (i.target = E.target)), E.class && (i.class = i.class ? i.class + " " + E.class : E.class), E.style && (o = /(?:^|\s|;)color\s*:\s*([^;\s"']+)/.exec(E.style)) && o[1] && (i.color = o[1]), b === "br" && h.push(new nt());
1830
+ b === "a" && (E.href && (i.href = E.href), E.rel && (i.rel = E.rel), E.target && (i.target = E.target)), E.class && (i.class = i.class ? i.class + " " + E.class : E.class), E.style && (o = /(?:^|\s|;)color\s*:\s*([^;\s"']+)/.exec(E.style)) && o[1] && (i.color = o[1]), b === "br" && c.push(new nt());
1830
1831
  } else
1831
1832
  n = [e.slice(0, 1)], w(new N(n[0]));
1832
1833
  e = e.slice(n[0].length);
1833
1834
  }
1834
- for (var O = h[h.length - 1]; O instanceof nt; )
1835
- h.pop(), O = h[h.length - 1];
1836
- return h;
1835
+ for (var O = c[c.length - 1]; O instanceof nt; )
1836
+ c.pop(), O = c[c.length - 1];
1837
+ return c;
1837
1838
  }, rt.latexparser = function(e) {
1838
1839
  e = String(e || "").trim();
1839
1840
  var n = [0];
@@ -1852,17 +1853,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1852
1853
  }).replace(/\\verb,(.*?),/, function($, L) {
1853
1854
  return "\\verb,".concat(n[+L], ",");
1854
1855
  });
1855
- for (var o, i = { weight: null, italic: null, variant: null, sub: !1, sup: !1, href: null }, h = [], y = [], w = function($) {
1856
+ for (var o, i = { weight: null, italic: null, variant: null, sub: !1, sup: !1, href: null }, c = [], y = [], w = function($) {
1856
1857
  for (var L in i)
1857
1858
  i[L] && ($[L] = i[L]);
1858
- return h.push($), $;
1859
+ return c.push($), $;
1859
1860
  }, x = function() {
1860
1861
  y.push(i), i = Object.create(i);
1861
1862
  }, b = function() {
1862
1863
  if (!y.length)
1863
1864
  throw new Error("Unexpected }");
1864
1865
  i = y.pop();
1865
- }, E = { tokens: h, open_context: x, close_context: b, add_token: w }; e.length; ) {
1866
+ }, E = { tokens: c, open_context: x, close_context: b, add_token: w }; e.length; ) {
1866
1867
  if (o = an.exec(e))
1867
1868
  Nt(o[0], !1).forEach(w);
1868
1869
  else if (o = ln.exec(e))
@@ -1901,7 +1902,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1901
1902
  }
1902
1903
  e = e.slice(o[0].length);
1903
1904
  }
1904
- return h;
1905
+ return c;
1905
1906
  }, rt.measureText = function(e, n, o) {
1906
1907
  return Y(e, S(n), o);
1907
1908
  }, rt.Token = N, rt.Break = Tt, rt.LineBreak = nt, rt.SoftHyphen = pt, rt.Rotator = be, be.createElement = Se;
@@ -1912,13 +1913,13 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
1912
1913
  var Fn = Ve.exports;
1913
1914
  const Oe = /* @__PURE__ */ ce(Fn);
1914
1915
  function Bn(u, l) {
1915
- const t = ut(u), { fontSize: r, font: a, padding: c = 0 } = u.properties.style || {};
1916
+ const t = ut(u), { fontSize: r, font: a, padding: h = 0 } = u.properties.style || {};
1916
1917
  if (t.width === t.height && t.width === 0)
1917
1918
  return;
1918
1919
  const p = new Oe({
1919
1920
  font: `${r}px/${r}px ${a}`.replace(/(px)+/g, "px"),
1920
- width: t.width - c * 2,
1921
- height: t.height - c * 2,
1921
+ width: t.width - h * 2,
1922
+ height: t.height - h * 2,
1922
1923
  align: "left",
1923
1924
  valign: "top",
1924
1925
  x: 0,
@@ -1929,7 +1930,7 @@ function Bn(u, l) {
1929
1930
  u.properties.content.replaceAll(`
1930
1931
  `, "<br>")
1931
1932
  ).render();
1932
- p.setAttribute("transform", `translate(${c}, ${c})`), l.appendChild(p);
1933
+ p.setAttribute("transform", `translate(${h}, ${h})`), l.appendChild(p);
1933
1934
  }
1934
1935
  const Me = 20;
1935
1936
  class qn extends qe {
@@ -1968,16 +1969,16 @@ class qn extends qe {
1968
1969
  });
1969
1970
  v(this, "startDrawing", (t, r, a = jn(t, r, 0, 0, "", At)) => {
1970
1971
  this.add(a);
1971
- const c = this.ogma.view.graphToScreenCoordinates({ x: t, y: r });
1972
- this.select(a.id), this.startDragging(this.getById(a.id), c.x, c.y), this.draggedHandle = 6;
1972
+ const h = this.ogma.view.graphToScreenCoordinates({ x: t, y: r });
1973
+ this.select(a.id), this.startDragging(this.getById(a.id), h.x, h.y), this.draggedHandle = 6;
1973
1974
  });
1974
1975
  v(this, "cancelDrawing", () => {
1975
1976
  this.isDragging && (this.remove(this.annotation.id), this.annotation = { ...re }, this.draggedHandle = q, this.isDragging = !1, this.emit(St, this.annotation));
1976
1977
  });
1977
1978
  v(this, "startDragging", (t, r, a) => {
1978
1979
  this.annotation = t;
1979
- const c = ct(this.annotation), d = ut(this.annotation);
1980
- this.rect.x = c.x, this.rect.y = c.y, this.rect.width = d.width, this.rect.height = d.height, this.startX = r, this.startY = a, this.disableDragging(), this.textArea.classList.add("noevents"), this.textArea.setAttribute("disabled", "disabled"), this.emit(Yt, this.annotation), this.isDragging = !0;
1980
+ const h = ct(this.annotation), d = ut(this.annotation);
1981
+ this.rect.x = h.x, this.rect.y = h.y, this.rect.width = d.width, this.rect.height = d.height, this.startX = r, this.startY = a, this.disableDragging(), this.textArea.classList.add("noevents"), this.textArea.setAttribute("disabled", "disabled"), this.emit(Yt, this.annotation), this.isDragging = !0;
1981
1982
  });
1982
1983
  v(this, "onHandleMouseDown", (t) => {
1983
1984
  const r = this.getById(this.selectedId) || this.getById(this.hoveredId);
@@ -1990,10 +1991,10 @@ class qn extends qe {
1990
1991
  if (!this.isDragging)
1991
1992
  return;
1992
1993
  t.stopPropagation(), t.preventDefault();
1993
- const r = this.handles[this.draggedHandle], a = r.classList.contains("top"), c = r.classList.contains("left"), d = r.classList.contains("right"), g = r.classList.contains("bottom"), p = r.classList.contains("line-handle"), s = this.ogma.view.getZoom(), f = (t.clientX - this.startX) / s, m = (t.clientY - this.startY) / s, A = this.ogma.view.getAngle(), T = new U(f, m).rotateRadians(A);
1994
- (g && c || a && d) && (T.y = 0, T.x = 0);
1995
- const S = c || p ? this.rect.x + T.x : this.rect.x, C = a || p ? this.rect.y + T.y : this.rect.y, k = Math.max(
1996
- this.rect.width + f * (p || c ? 0 : 1),
1994
+ const r = this.handles[this.draggedHandle], a = r.classList.contains("top"), h = r.classList.contains("left"), d = r.classList.contains("right"), g = r.classList.contains("bottom"), p = r.classList.contains("line-handle"), s = this.ogma.view.getZoom(), f = (t.clientX - this.startX) / s, m = (t.clientY - this.startY) / s, A = this.ogma.view.getAngle(), T = new U(f, m).rotateRadians(A);
1995
+ (g && h || a && d) && (T.y = 0, T.x = 0);
1996
+ const S = h || p ? this.rect.x + T.x : this.rect.x, C = a || p ? this.rect.y + T.y : this.rect.y, k = Math.max(
1997
+ this.rect.width + f * (p || h ? 0 : 1),
1997
1998
  Me
1998
1999
  ), F = Math.max(
1999
2000
  this.rect.height + m * (p || a ? 0 : 1),
@@ -2017,16 +2018,16 @@ class qn extends qe {
2017
2018
  a.addEventListener("input", this._onInput), a.addEventListener("focus", this._onFocus), a.addEventListener("blur", this._onBlur), a.spellcheck = !1, this.handles = Array.prototype.slice.call(
2018
2019
  this.editor.element.querySelectorAll(".annotation-text-handle > .handle")
2019
2020
  ), this.handles.forEach(
2020
- (c) => c.addEventListener("mousedown", this.onHandleMouseDown)
2021
+ (h) => h.addEventListener("mousedown", this.onHandleMouseDown)
2021
2022
  ), document.addEventListener("mouseup", this.onMouseUp), document.addEventListener("mousemove", this.onMouseMove, !0), t.events.on(["viewChanged", "zoom"], this.onViewChanged);
2022
2023
  }
2023
2024
  _canRemove() {
2024
2025
  return !this.isFocused;
2025
2026
  }
2026
2027
  detect({ x: t, y: r }, a = 0) {
2027
- const c = new U(t, r), d = this.ogma.view.getAngle();
2028
+ const h = new U(t, r), d = this.ogma.view.getAngle();
2028
2029
  return this.elements.find((g) => {
2029
- const { x: p, y: s } = ct(g), { width: f, height: m } = ut(g), A = new U(p, s), { x: T, y: S } = c.sub(A).rotateRadians(-d);
2030
+ const { x: p, y: s } = ct(g), { width: f, height: m } = ut(g), A = new U(p, s), { x: T, y: S } = h.sub(A).rotateRadians(-d);
2030
2031
  return T > -a && T < f + a && S > -a && S < m + a;
2031
2032
  });
2032
2033
  }
@@ -2053,14 +2054,17 @@ class qn extends qe {
2053
2054
  const { x: Et, y: kt } = new U(f.x, f.y).rotateRadians(-a);
2054
2055
  D.setAttribute("transform", `translate(${Et},${kt})`), D.classList.add(p), D.setAttribute("data-annotation", `${d.id}`), D.setAttribute("data-annotation-type", "text"), t.appendChild(D);
2055
2056
  });
2056
- const c = Mt("style");
2057
- c.innerHTML = r, t.firstChild && t.insertBefore(c, t.firstChild);
2057
+ const h = Mt("style");
2058
+ h.innerHTML = r, t.firstChild && t.insertBefore(h, t.firstChild);
2058
2059
  }
2059
2060
  refreshDrawing() {
2060
2061
  const t = this.ogma.view.getAngle();
2061
2062
  [...this.layer.element.children].forEach((r) => {
2062
- const a = ct(this.getById(+r.getAttribute("data-annotation"))), { x: c, y: d } = new U(a.x, a.y).rotateRadians(-t);
2063
- r.setAttribute("transform", `translate(${c},${d})`);
2063
+ const a = r.getAttribute("data-annotation");
2064
+ if (!a)
2065
+ return;
2066
+ const h = ct(this.getById(a)), { x: d, y: g } = new U(h.x, h.y).rotateRadians(-t);
2067
+ r.setAttribute("transform", `translate(${d},${g})`);
2064
2068
  });
2065
2069
  }
2066
2070
  getDefaultOptions() {
@@ -2069,14 +2073,14 @@ class qn extends qe {
2069
2073
  refreshEditor() {
2070
2074
  if (+this.selectedId < 0 && +this.hoveredId < 0)
2071
2075
  return;
2072
- const t = this.getById(this.selectedId) || this.getById(this.hoveredId), r = ut(t), a = this.ogma.view.graphToScreenCoordinates(ct(t)), c = this.ogma.view.getZoom(), {
2076
+ const t = this.getById(this.selectedId) || this.getById(this.hoveredId), r = ut(t), a = this.ogma.view.graphToScreenCoordinates(ct(t)), h = this.ogma.view.getZoom(), {
2073
2077
  font: d,
2074
2078
  fontSize: g,
2075
2079
  color: p,
2076
2080
  background: s,
2077
2081
  padding: f = 0
2078
- } = t.properties.style || At, m = (g || 1) * c;
2079
- this.textArea.value = t.properties.content, this.editor.element.style.transform = `translate(${a.x}px, ${a.y}px)translate(-50%, -50%)translate(${r.width / 2 * c}px, ${r.height / 2 * c}px)`, this.editor.element.style.width = `${r.width * c}px`, this.editor.element.style.height = `${r.height * c}px`, this.textArea.style.font = `${m} ${d}`, this.textArea.style.fontFamily = d || "sans-serif", this.textArea.style.fontSize = `${m}px`, this.textArea.style.padding = `${c * f}px`, this.textArea.style.lineHeight = `${m}px`, this.textArea.style.boxSizing = "border-box", this.textArea.style.color = p || "black", this.textArea.style.background = s || "transparent", this.textArea.placeholder = this.placeholder, this.layer.refresh();
2082
+ } = t.properties.style || At, m = (g || 1) * h;
2083
+ this.textArea.value = t.properties.content, this.editor.element.style.transform = `translate(${a.x}px, ${a.y}px)translate(-50%, -50%)translate(${r.width / 2 * h}px, ${r.height / 2 * h}px)`, this.editor.element.style.width = `${r.width * h}px`, this.editor.element.style.height = `${r.height * h}px`, this.textArea.style.font = `${m} ${d}`, this.textArea.style.fontFamily = d || "sans-serif", this.textArea.style.fontSize = `${m}px`, this.textArea.style.padding = `${h * f}px`, this.textArea.style.lineHeight = `${m}px`, this.textArea.style.boxSizing = "border-box", this.textArea.style.color = p || "black", this.textArea.style.background = s || "transparent", this.textArea.placeholder = this.placeholder, this.layer.refresh();
2080
2084
  }
2081
2085
  select(t) {
2082
2086
  super.select(t), this.textArea.focus();
@@ -2091,20 +2095,20 @@ class Vn {
2091
2095
  v(this, "linksByTargetId", {});
2092
2096
  v(this, "linksByArrowId", {});
2093
2097
  }
2094
- add(l, t, r, a, c) {
2098
+ add(l, t, r, a, h) {
2095
2099
  const d = Xt(), g = l.id, p = {
2096
2100
  id: d,
2097
2101
  arrow: g,
2098
2102
  target: r,
2099
2103
  targetType: a,
2100
- connectionPoint: c,
2104
+ connectionPoint: h,
2101
2105
  side: t
2102
2106
  };
2103
2107
  return this.links[d] = p, this.linksByTargetId[r] || (this.linksByTargetId[r] = []), this.linksByTargetId[r].push(d), this.linksByArrowId[g] || (this.linksByArrowId[g] = {}), this.linksByArrowId[g][t] = d, l.properties.link = l.properties.link || {}, l.properties.link[t] = {
2104
2108
  id: r,
2105
2109
  side: t,
2106
2110
  type: a,
2107
- magnet: c
2111
+ magnet: h
2108
2112
  }, this;
2109
2113
  }
2110
2114
  arrowIsLinked(l, t) {
@@ -2117,9 +2121,9 @@ class Vn {
2117
2121
  const r = l.id, a = (g = this.linksByArrowId[r]) == null ? void 0 : g[t];
2118
2122
  if ((p = l.properties.link) == null || delete p[t], !a)
2119
2123
  return this;
2120
- const c = this.links[a];
2124
+ const h = this.links[a];
2121
2125
  delete this.links[a];
2122
- const d = this.linksByTargetId[c.target];
2126
+ const d = this.linksByTargetId[h.target];
2123
2127
  for (let s = 0; s < d.length; s++)
2124
2128
  if (d[s] === a) {
2125
2129
  d.splice(s, 1);
@@ -2184,23 +2188,23 @@ class Gn extends Be {
2184
2188
  Ce.forEach((a) => {
2185
2189
  if (!this.textToMagnet)
2186
2190
  return;
2187
- const c = ut(this.textToMagnet), d = ct(this.textToMagnet), { x: g, y: p } = new U(a.x, a.y).mul({ x: c.width, y: c.height }).rotateRadians(this.ogma.view.getAngle()).add(d);
2191
+ const h = ut(this.textToMagnet), d = ct(this.textToMagnet), { x: g, y: p } = new U(a.x, a.y).mul({ x: h.width, y: h.height }).rotateRadians(this.ogma.view.getAngle()).add(d);
2188
2192
  t.moveTo(g, p), t.arc(g, p, this.options.magnetHandleRadius / r, 0, Math.PI * 2);
2189
2193
  }), t.fill(), t.closePath();
2190
2194
  });
2191
2195
  v(this, "_onFeatureDrag", (t, r) => {
2192
2196
  const a = r;
2193
2197
  if (ot(t) && a === "line")
2194
- ["start", "end"].find((c) => {
2195
- const d = c === "start" ? zt(t) : qt(t);
2196
- return this._snapToText(t, a, d) || this._findAndSnapToNode(t, c, d);
2198
+ ["start", "end"].find((h) => {
2199
+ const d = h === "start" ? zt(t) : qt(t);
2200
+ return this._snapToText(t, a, d) || this._findAndSnapToNode(t, h, d);
2197
2201
  });
2198
2202
  else if (ot(t) && a !== "line") {
2199
- const c = a === "start" ? zt(t) : qt(t);
2200
- this._snapToText(t, a, c) || this._findAndSnapToNode(t, a, c);
2203
+ const h = a === "start" ? zt(t) : qt(t);
2204
+ this._snapToText(t, a, h) || this._findAndSnapToNode(t, a, h);
2201
2205
  } else
2202
- mt(t) && (this.activeLinks.forEach(({ arrow: c, side: d, connectionPoint: g }) => {
2203
- const p = this.getAnnotation(c), s = ut(t), f = ct(t), m = new U(g.x, g.y).mul({ x: s.width, y: s.height }).rotateRadians(this.ogma.view.getAngle()).add(f);
2206
+ mt(t) && (this.activeLinks.forEach(({ arrow: h, side: d, connectionPoint: g }) => {
2207
+ const p = this.getAnnotation(h), s = ut(t), f = ct(t), m = new U(g.x, g.y).mul({ x: s.width, y: s.height }).rotateRadians(this.ogma.view.getAngle()).add(f);
2204
2208
  p.geometry.coordinates[d === "start" ? 0 : 1] = [m.x, m.y];
2205
2209
  }), this.activeLinks.length && this.arrows.refreshLayer());
2206
2210
  this.layer.refresh(), this.emit(Ut, t, r);
@@ -2268,33 +2272,33 @@ class Gn extends Be {
2268
2272
  }), this.layer = t.layers.addCanvasLayer(this._render), this.layer.moveToBottom();
2269
2273
  }
2270
2274
  _moveNodes(t, r, a) {
2271
- t.forEach((c) => {
2272
- const d = this.links.getTargetLinks(c.getId(), "node"), g = c.getPosition();
2275
+ t.forEach((h) => {
2276
+ const d = this.links.getTargetLinks(h.getId(), "node"), g = h.getPosition();
2273
2277
  d.forEach((p) => {
2274
2278
  const s = this.getAnnotation(p.arrow), f = p.side, m = jt(
2275
2279
  s,
2276
2280
  f === "start" ? "end" : "start"
2277
2281
  );
2278
2282
  let A = g;
2279
- const T = +c.getAttribute("radius"), S = 1e-6;
2283
+ const T = +h.getAttribute("radius"), S = 1e-6;
2280
2284
  (p.connectionPoint.x - (g.x - r) > S || p.connectionPoint.y - (g.y - a) > S) && (A = Ft(m, g, T)), bt(s, f, A.x, A.y);
2281
2285
  });
2282
2286
  }), this.arrows.refreshLayer();
2283
2287
  }
2284
2288
  _snapToText(t, r, a) {
2285
- const c = this.texts.detect(a, this.options.detectMargin);
2286
- if (this.links.remove(t, r), !c)
2289
+ const h = this.texts.detect(a, this.options.detectMargin);
2290
+ if (this.links.remove(t, r), !h)
2287
2291
  return !1;
2288
- this.textToMagnet = c;
2289
- const d = this.findMagnetPoint(Ce, c, a);
2290
- return d ? (bt(t, r, d.point.x, d.point.y), this.links.add(t, r, c.id, "text", d.magnet), !0) : !1;
2292
+ this.textToMagnet = h;
2293
+ const d = this.findMagnetPoint(Ce, h, a);
2294
+ return d ? (bt(t, r, d.point.x, d.point.y), this.links.add(t, r, h.id, "text", d.magnet), !0) : !1;
2291
2295
  }
2292
2296
  _findAndSnapToNode(t, r, a) {
2293
- const c = this.ogma.view.graphToScreenCoordinates(a), d = this.ogma.view.getElementAt(c);
2294
- this.links.remove(t, r), d && d.isNode ? (this.hoveredNode = d, this.hoveredNode.setSelected(!0), this._snapToNode(t, r, d, c)) : (this.hoveredNode && this.hoveredNode.setSelected(!1), this.hoveredNode = null);
2297
+ const h = this.ogma.view.graphToScreenCoordinates(a), d = this.ogma.view.getElementAt(h);
2298
+ this.links.remove(t, r), d && d.isNode ? (this.hoveredNode = d, this.hoveredNode.setSelected(!0), this._snapToNode(t, r, d, h)) : (this.hoveredNode && this.hoveredNode.setSelected(!1), this.hoveredNode = null);
2295
2299
  }
2296
- _snapToNode(t, r, a, c) {
2297
- const d = a.getPositionOnScreen(), g = +a.getAttribute("radius"), p = g * this.ogma.view.getZoom(), s = c.x - d.x, f = c.y - d.y, m = Math.sqrt(s * s + f * f), A = a.getPosition();
2300
+ _snapToNode(t, r, a, h) {
2301
+ const d = a.getPositionOnScreen(), g = +a.getAttribute("radius"), p = g * this.ogma.view.getZoom(), s = h.x - d.x, f = h.y - d.y, m = Math.sqrt(s * s + f * f), A = a.getPosition();
2298
2302
  if (m < p + this.options.detectMargin) {
2299
2303
  let T = A;
2300
2304
  if (m > p / 2) {
@@ -2306,11 +2310,11 @@ class Gn extends Be {
2306
2310
  }
2307
2311
  refreshTextLinks() {
2308
2312
  let t = !1;
2309
- this.links.forEach(({ connectionPoint: r, targetType: a, target: c, arrow: d, side: g }) => {
2313
+ this.links.forEach(({ connectionPoint: r, targetType: a, target: h, arrow: d, side: g }) => {
2310
2314
  if (a !== "text")
2311
2315
  return;
2312
2316
  t = !0;
2313
- const p = this.getAnnotation(c), s = this.getAnnotation(d), f = ut(p), m = ct(p), A = new U(r.x, r.y).mul({ x: f.width, y: f.height }).rotateRadians(this.ogma.view.getAngle()).add(m);
2317
+ const p = this.getAnnotation(h), s = this.getAnnotation(d), f = ut(p), m = ct(p), A = new U(r.x, r.y).mul({ x: f.width, y: f.height }).rotateRadians(this.ogma.view.getAngle()).add(m);
2314
2318
  bt(s, g, A.x, A.y);
2315
2319
  }), t && this.arrows.refreshLayer();
2316
2320
  }
@@ -2321,7 +2325,7 @@ class Gn extends Be {
2321
2325
  return this.selected;
2322
2326
  }
2323
2327
  findMagnetPoint(t, r, a) {
2324
- let c;
2328
+ let h;
2325
2329
  for (const d of t) {
2326
2330
  const g = ut(r), p = ct(r), s = new U(d.x, d.y).mul({ x: g.width, y: g.height }).rotateRadians(this.ogma.view.getAngle()).add(p), f = s.sub(a).length(), m = Math.min(
2327
2331
  this.options.magnetRadius * this.ogma.view.getZoom(),
@@ -2330,14 +2334,14 @@ class Gn extends Be {
2330
2334
  g.height / 2
2331
2335
  );
2332
2336
  if (f < Math.max(m, this.options.magnetHandleRadius)) {
2333
- c = {
2337
+ h = {
2334
2338
  point: s,
2335
2339
  magnet: d
2336
2340
  };
2337
2341
  break;
2338
2342
  }
2339
2343
  }
2340
- return c;
2344
+ return h;
2341
2345
  }
2342
2346
  /**
2343
2347
  * Set the options for the controller
@@ -2370,11 +2374,11 @@ class Gn extends Be {
2370
2374
  */
2371
2375
  add(t) {
2372
2376
  if (ze(t)) {
2373
- const [r, a] = t.features.reduce((c, d) => (ot(d) ? c[1].push(d) : mt(d) && c[0].push(d), c), [[], []]);
2377
+ const [r, a] = t.features.reduce((h, d) => (ot(d) ? h[1].push(d) : mt(d) && h[0].push(d), h), [[], []]);
2374
2378
  return r.forEach(
2375
- (c) => this.add(c)
2379
+ (h) => this.add(h)
2376
2380
  ), a.forEach(
2377
- (c) => this.add(c)
2381
+ (h) => this.add(h)
2378
2382
  ), this.arrows.refreshLayer(), this;
2379
2383
  }
2380
2384
  switch (t.properties.type) {
@@ -2402,8 +2406,8 @@ class Gn extends Be {
2402
2406
  const a = t.properties.link[r];
2403
2407
  if (!a)
2404
2408
  continue;
2405
- const c = this.getAnnotation(a.id);
2406
- if (a.type === "text" && c)
2409
+ const h = this.getAnnotation(a.id);
2410
+ if (a.type === "text" && h)
2407
2411
  this.links.add(t, r, a.id, a.type, a.magnet);
2408
2412
  else if (a.type === "node") {
2409
2413
  const d = this.ogma.getNode(a.id);
@@ -2445,7 +2449,7 @@ class Gn extends Be {
2445
2449
  * @param style The new style
2446
2450
  */
2447
2451
  updateStyle(t, r) {
2448
- const a = this.getAnnotations().features.find((c) => c.id === t);
2452
+ const a = this.getAnnotations().features.find((h) => h.id === t);
2449
2453
  return a ? (ot(a) ? this.arrows.updateStyle(a, r) : mt(a) && this.texts.updateStyle(a, r), this.onUpdate(a), this) : this;
2450
2454
  }
2451
2455
  /**