@metadev/daga-react 4.2.1 → 4.2.2

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/index.mjs CHANGED
@@ -67,7 +67,7 @@ const Mt = (i) => [Math.round(i[0]), Math.round(i[1])], bt = (i, t, e) => t < e
67
67
  i[1][1],
68
68
  i[0][1]
69
69
  ));
70
- var E = /* @__PURE__ */ ((i) => (i.Blur = "blur", i.Change = "change", i.Click = "click", i.ContextMenu = "contextmenu", i.DoubleClick = "dblclick", i.Focus = "focus", i.FocusIn = "focusin", i.FocusOut = "focusout", i.Input = "input", i.KeyDown = "keydown", i.KeyUp = "keyup", i.MouseDown = "mousedown", i.MouseEnter = "mouseenter", i.MouseLeave = "mouseleave", i.MouseMove = "mousemove", i.MouseOut = "mouseout", i.MouseOver = "mouseover", i.MouseUp = "mouseup", i.TouchStart = "touchstart", i.TouchEnd = "touchend", i.Wheel = "wheel", i))(E || {}), et = /* @__PURE__ */ ((i) => (i.Alt = "Alt", i.AltGraph = "AltGraph", i.ArrowDown = "ArrowDown", i.ArrowLeft = "ArrowLeft", i.ArrowRight = "ArrowRight", i.ArrowUp = "ArrowUp", i.Backspace = "Backspace", i.Control = "Control", i.Delete = "Delete", i.End = "End", i.Enter = "Enter", i.Escape = "Escape", i.Home = "Home", i.OS = "OS", i.PageDown = "PageDown", i.PageUp = "PageUp", i.Shift = "Shift", i.Tab = "Tab", i))(et || {}), $ = /* @__PURE__ */ ((i) => (i.Drag = "drag", i.Start = "start", i.End = "end", i))($ || {}), fe = /* @__PURE__ */ ((i) => (i.Zoom = "zoom", i.Start = "start", i.End = "end", i))(fe || {});
70
+ var x = /* @__PURE__ */ ((i) => (i.Blur = "blur", i.Change = "change", i.Click = "click", i.ContextMenu = "contextmenu", i.DoubleClick = "dblclick", i.Focus = "focus", i.FocusIn = "focusin", i.FocusOut = "focusout", i.Input = "input", i.KeyDown = "keydown", i.KeyUp = "keyup", i.MouseDown = "mousedown", i.MouseEnter = "mouseenter", i.MouseLeave = "mouseleave", i.MouseMove = "mousemove", i.MouseOut = "mouseout", i.MouseOver = "mouseover", i.MouseUp = "mouseup", i.TouchStart = "touchstart", i.TouchEnd = "touchend", i.Wheel = "wheel", i))(x || {}), et = /* @__PURE__ */ ((i) => (i.Alt = "Alt", i.AltGraph = "AltGraph", i.ArrowDown = "ArrowDown", i.ArrowLeft = "ArrowLeft", i.ArrowRight = "ArrowRight", i.ArrowUp = "ArrowUp", i.Backspace = "Backspace", i.Control = "Control", i.Delete = "Delete", i.End = "End", i.Enter = "Enter", i.Escape = "Escape", i.Home = "Home", i.OS = "OS", i.PageDown = "PageDown", i.PageUp = "PageUp", i.Shift = "Shift", i.Tab = "Tab", i))(et || {}), $ = /* @__PURE__ */ ((i) => (i.Drag = "drag", i.Start = "start", i.End = "end", i))($ || {}), fe = /* @__PURE__ */ ((i) => (i.Zoom = "zoom", i.Start = "start", i.End = "end", i))(fe || {});
71
71
  const pe = (i) => i.replace(/([!"#$%&'()*+,\-./:;<=>?@[\\\]^`{|}])/g, "\\$1");
72
72
  var vi = /* @__PURE__ */ ((i) => (i.Straight = "straight", i.Bezier = "bezier", i.Square = "square", i))(vi || {}), yi = /* @__PURE__ */ ((i) => (i.Solid = "solid", i.Dashed = "dashed", i.GappedDashes = "gapped-dashes", i.Dotted = "dotted", i))(yi || {});
73
73
  const Yi = 20, Xi = (i, t, e, s, r) => {
@@ -1501,7 +1501,7 @@ class po extends yt {
1501
1501
  * @private
1502
1502
  */
1503
1503
  new(t, e, s, r, l, o, n) {
1504
- var d, u, p, m, f, g, v, w, b, x;
1504
+ var d, u, p, m, f, g, v, w, b, E;
1505
1505
  const a = new Y(
1506
1506
  this.model,
1507
1507
  t,
@@ -1575,7 +1575,7 @@ class po extends yt {
1575
1575
  );
1576
1576
  }
1577
1577
  }
1578
- const h = (x = (b = (w = (v = t.type.sectionGrid) == null ? void 0 : v.sections) == null ? void 0 : w[s]) == null ? void 0 : b[e]) == null ? void 0 : x.label;
1578
+ const h = (E = (b = (w = (v = t.type.sectionGrid) == null ? void 0 : v.sections) == null ? void 0 : w[s]) == null ? void 0 : b[e]) == null ? void 0 : E.label;
1579
1579
  if (h) {
1580
1580
  const I = {
1581
1581
  ...D,
@@ -2274,28 +2274,28 @@ class vo extends yt {
2274
2274
  ...D,
2275
2275
  ...(d = g.type) == null ? void 0 : d.label
2276
2276
  }, w = 6 * v.fontSize + Ht(v) + Gt(v), b = v.fontSize + Ft(v) + Dt(v);
2277
- let x;
2277
+ let E;
2278
2278
  switch (g.direction) {
2279
2279
  case y.Bottom:
2280
2280
  case y.Left:
2281
2281
  case y.Right:
2282
- x = [
2282
+ E = [
2283
2283
  g.coords[0] - w / 2,
2284
2284
  g.coords[1] - b - st(v)
2285
2285
  ];
2286
2286
  break;
2287
2287
  case y.Top:
2288
- x = [
2288
+ E = [
2289
2289
  g.coords[0] - w / 2,
2290
2290
  g.coords[1] + X(v)
2291
2291
  ];
2292
2292
  break;
2293
2293
  default:
2294
- x = g.coords;
2294
+ E = g.coords;
2295
2295
  }
2296
2296
  this.model.fields.new(
2297
2297
  g,
2298
- x,
2298
+ E,
2299
2299
  v.fontSize,
2300
2300
  v.fontFamily,
2301
2301
  v.color,
@@ -2709,7 +2709,7 @@ class Ei {
2709
2709
  const b = {
2710
2710
  ...D,
2711
2711
  ...(p = (u = (d = (h = s.sectionGrid) == null ? void 0 : h.sections) == null ? void 0 : d[g.indexYInNode]) == null ? void 0 : u[g.indexXInNode]) == null ? void 0 : p.label
2712
- }, x = new pt(
2712
+ }, E = new pt(
2713
2713
  t,
2714
2714
  v,
2715
2715
  [
@@ -2730,13 +2730,13 @@ class Ei {
2730
2730
  b.fit,
2731
2731
  b.shrink
2732
2732
  );
2733
- x.text = g.label, v.label = x, t.fields.add(x), x.updateInView();
2733
+ E.text = g.label, v.label = E, t.fields.add(E), E.updateInView();
2734
2734
  }
2735
2735
  let w = 0;
2736
2736
  for (const b of g.ports || []) {
2737
- const x = b.type !== void 0 ? t.ports.types.get(b.type) : void 0, I = new It(
2737
+ const E = b.type !== void 0 ? t.ports.types.get(b.type) : void 0, I = new It(
2738
2738
  t,
2739
- x,
2739
+ E,
2740
2740
  v,
2741
2741
  b.coords,
2742
2742
  b.connectionPoint,
@@ -2744,10 +2744,10 @@ class Ei {
2744
2744
  b.id
2745
2745
  );
2746
2746
  if (v.ports.push(I), t.ports.add(I), b.label) {
2747
- if (s.ports.length > w && (x != null && x.label)) {
2747
+ if (s.ports.length > w && (E != null && E.label)) {
2748
2748
  const T = {
2749
2749
  ...D,
2750
- ...x == null ? void 0 : x.label
2750
+ ...E == null ? void 0 : E.label
2751
2751
  };
2752
2752
  let M;
2753
2753
  switch (I.direction) {
@@ -2819,34 +2819,34 @@ class Ei {
2819
2819
  ...D,
2820
2820
  ...v == null ? void 0 : v.label
2821
2821
  };
2822
- let x;
2822
+ let E;
2823
2823
  switch (w.direction) {
2824
2824
  case y.Top:
2825
2825
  case y.Left:
2826
- x = [
2826
+ E = [
2827
2827
  w.coords[0] - b.fontSize,
2828
2828
  w.coords[1] - b.fontSize
2829
2829
  ];
2830
2830
  break;
2831
2831
  case y.Bottom:
2832
- x = [
2832
+ E = [
2833
2833
  w.coords[0] - b.fontSize,
2834
2834
  w.coords[1] + b.fontSize
2835
2835
  ];
2836
2836
  break;
2837
2837
  case y.Right:
2838
- x = [
2838
+ E = [
2839
2839
  w.coords[0] + b.fontSize,
2840
2840
  w.coords[1] - b.fontSize
2841
2841
  ];
2842
2842
  break;
2843
2843
  default:
2844
- x = w.coords;
2844
+ E = w.coords;
2845
2845
  }
2846
2846
  const I = new pt(
2847
2847
  t,
2848
2848
  w,
2849
- x,
2849
+ E,
2850
2850
  b.fontSize,
2851
2851
  b.fontSize,
2852
2852
  b.fontSize,
@@ -4165,9 +4165,9 @@ class _o {
4165
4165
  */
4166
4166
  open(t) {
4167
4167
  this.close();
4168
- const e = this.canvas.getPointerLocationRelativeToRoot(t), s = this.canvas.getPointerLocationRelativeToCanvas(t), r = this.canvas.selectSVGElement().append("foreignObject").attr("class", "daga-context-menu").attr("x", `${e[0] - Nt}px`).attr("y", `${e[1] - Nt}px`).attr("width", `${2 * Nt}px`).attr("height", `${2 * Nt}px`).style("pointer-events", "none").on(E.ContextMenu, (o) => {
4168
+ const e = this.canvas.getPointerLocationRelativeToRoot(t), s = this.canvas.getPointerLocationRelativeToCanvas(t), r = this.canvas.selectSVGElement().append("foreignObject").attr("class", "daga-context-menu").attr("x", `${e[0] - Nt}px`).attr("y", `${e[1] - Nt}px`).attr("width", `${2 * Nt}px`).attr("height", `${2 * Nt}px`).style("pointer-events", "none").on(x.ContextMenu, (o) => {
4169
4169
  this.canvas.canUserPerformAction(S.ContextMenu) && (t.preventDefault(), this.open(o));
4170
- }).on(E.Click, (o) => {
4170
+ }).on(x.Click, (o) => {
4171
4171
  o.preventDefault(), this.close();
4172
4172
  });
4173
4173
  this.contextMenuContainer = r;
@@ -4210,9 +4210,9 @@ class _o {
4210
4210
  const n = l[o], a = n.onPress, c = (o + 0.5 - l.length / 2) * Ro, h = r.append("xhtml:div").attr(
4211
4211
  "class",
4212
4212
  `daga-context-menu-button ${n.onPress !== void 0 ? " daga-clickable" : ""}`
4213
- ).attr("tabindex", 0).style("position", "absolute").style("box-sizing", "border-box").style("width", `${2 * Z}px`).style("height", `${2 * Z}px`).style("border-radius", `${Z}px`).style("pointer-events", "auto").on(E.Click, (d) => {
4213
+ ).attr("tabindex", 0).style("position", "absolute").style("box-sizing", "border-box").style("width", `${2 * Z}px`).style("height", `${2 * Z}px`).style("border-radius", `${Z}px`).style("pointer-events", "auto").on(x.Click, (d) => {
4214
4214
  a && (d.preventDefault(), a(this.canvas));
4215
- }).on(E.KeyDown, (d) => {
4215
+ }).on(x.KeyDown, (d) => {
4216
4216
  a && d.key === et.Enter && (d.preventDefault(), a(this.canvas));
4217
4217
  });
4218
4218
  n.imageClass !== void 0 ? h.append("xhtml:div").style("position", "absolute").style("left", `${0.75 * Z}px`).style("top", `${0.5 * Z}px`).style("width", `${0.5 * Z}px`).style("height", `${0.5 * Z}px`).style("background-size", "contain").style("background-repeat", "no-repeat").attr("class", n.imageClass) : n.image !== void 0 && h.append("xhtml:img").style("position", "absolute").style("left", `${0.75 * Z}px`).style("top", `${0.5 * Z}px`).style("width", `${0.5 * Z}px`).style("height", `${0.5 * Z}px`).attr("src", n.image), h.append("xhtml:span").style("position", "absolute").style("left", `${0.2 * Z}px`).style("top", `${1.1 * Z}px`).style("text-align", "center").style("width", `${1.6 * Z}px`).style("height", `${0.35 * Z}px`).style("margin", "0").style("font-size", `${0.35 * Z}px`).style("font-weight", "700").style("user-select", "none").text(n.name), h.transition().ease(N.easeLinear).duration(Vo).tween("progress", () => (d) => {
@@ -4591,7 +4591,7 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
4591
4591
  * @param config The configuration object used to set the parameters of this canvas.
4592
4592
  */
4593
4593
  constructor(t, e) {
4594
- var s, r, l, o, n, a, c, h, d, u, p, m, f, g, v, w, b, x, I, T, M;
4594
+ var s, r, l, o, n, a, c, h, d, u, p, m, f, g, v, w, b, E, I, T, M;
4595
4595
  if (this.backgroundPatternId = `daga-background-pattern-id-${Jt.canvasCount++}`, this.zoomTransform = N.zoomIdentity, this.draggingFrom = [0, 0], this.dragging = !1, this.secondaryButton = !1, this.validatorChange$ = new Xt(), this.diagramChange$ = new Xt(), this.diagramEvent$ = new Xt(), this.propertyEditorChanges$ = new Xt(), this.parentComponent = t, this.model = new $i(
4596
4596
  this,
4597
4597
  void 0,
@@ -4601,7 +4601,7 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
4601
4601
  e.properties || []
4602
4602
  ), this.userSelection = new Go(this), this.userHighlight = new Oo(this), this.contextMenu = new _o(this, (s = e.canvas) == null ? void 0 : s.contextMenu), this.backgroundColor = ((r = e.canvas) == null ? void 0 : r.backgroundColor) || "#FFFFFF", this.gridStyle = ((o = (l = e.canvas) == null ? void 0 : l.grid) == null ? void 0 : o.style) ?? Ot.style, this.gridSize = ((a = (n = e.canvas) == null ? void 0 : n.grid) == null ? void 0 : a.enabled) === !1 || ((c = e.canvas) == null ? void 0 : c.grid) === void 0 ? 0 : Math.abs(((d = (h = e.canvas) == null ? void 0 : h.grid) == null ? void 0 : d.spacing) || Ot.spacing), this.gridThickness = Math.abs(
4603
4603
  ((p = (u = e.canvas) == null ? void 0 : u.grid) == null ? void 0 : p.thickness) || Ot.thickness
4604
- ), this.gridColor = ((f = (m = e.canvas) == null ? void 0 : m.grid) == null ? void 0 : f.color) || Ot.color, this.snapToGrid = ((v = (g = e.canvas) == null ? void 0 : g.grid) == null ? void 0 : v.enabled) === !1 || ((w = e.canvas) == null ? void 0 : w.grid) === void 0 ? !1 : ((x = (b = e.canvas) == null ? void 0 : b.grid) == null ? void 0 : x.snap) || Ot.snap, this.zoomFactor = ((I = e.canvas) == null ? void 0 : I.zoomFactor) || 2, this.panRate = ((T = e.canvas) == null ? void 0 : T.panRate) || 100, this.inferConnectionType = e.inferConnectionType || !1, this.multipleSelectionOn = !1, this.priorityThresholds = ((M = e.canvas) == null ? void 0 : M.priorityThresholds) || [], this.priorityThreshold = this.priorityThresholds ? this.priorityThresholds[0] : void 0, this.layoutFormat = e.layoutFormat, this.userActions = e.userActions || {}, this.validators = [], this.actionStack = new Ao(this, Uo), this.collabEngine = new Io(this), e.nodeTypes)
4604
+ ), this.gridColor = ((f = (m = e.canvas) == null ? void 0 : m.grid) == null ? void 0 : f.color) || Ot.color, this.snapToGrid = ((v = (g = e.canvas) == null ? void 0 : g.grid) == null ? void 0 : v.enabled) === !1 || ((w = e.canvas) == null ? void 0 : w.grid) === void 0 ? !1 : ((E = (b = e.canvas) == null ? void 0 : b.grid) == null ? void 0 : E.snap) || Ot.snap, this.zoomFactor = ((I = e.canvas) == null ? void 0 : I.zoomFactor) || 2, this.panRate = ((T = e.canvas) == null ? void 0 : T.panRate) || 100, this.inferConnectionType = e.inferConnectionType || !1, this.multipleSelectionOn = !1, this.priorityThresholds = ((M = e.canvas) == null ? void 0 : M.priorityThresholds) || [], this.priorityThreshold = this.priorityThresholds ? this.priorityThresholds[0] : void 0, this.layoutFormat = e.layoutFormat, this.userActions = e.userActions || {}, this.validators = [], this.actionStack = new Ao(this, Uo), this.collabEngine = new Io(this), e.nodeTypes)
4605
4605
  for (const C of e.nodeTypes) {
4606
4606
  const z = new Si({
4607
4607
  ...e.nodeTypeDefaults,
@@ -4657,20 +4657,20 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
4657
4657
  // View methods
4658
4658
  initView(t) {
4659
4659
  const e = N.select(t);
4660
- e.html(""), this.diagramRoot = e.append("div").node(), N.select(this.diagramRoot).attr("tabindex", 0).style("width", "100%").style("height", "100%").append("svg").style("width", "100%").style("height", "100%"), N.select(this.diagramRoot).on(E.Click, () => {
4660
+ e.html(""), this.diagramRoot = e.append("div").node(), N.select(this.diagramRoot).attr("tabindex", 0).style("width", "100%").style("height", "100%").append("svg").style("width", "100%").style("height", "100%"), N.select(this.diagramRoot).on(x.Click, () => {
4661
4661
  var r;
4662
4662
  (r = N.select(this.diagramRoot).node()) == null || r.focus();
4663
- }).on(E.ContextMenu, (r) => {
4663
+ }).on(x.ContextMenu, (r) => {
4664
4664
  if (this.dragging) {
4665
4665
  r.preventDefault(), r.stopPropagation(), this.dragging = !1;
4666
4666
  return;
4667
4667
  }
4668
4668
  const l = new wt(r, null);
4669
4669
  this.diagramEvent$.next(l), !l.defaultPrevented && this.canUserPerformAction(S.ContextMenu) && (r.preventDefault(), this.contextMenu.open(r));
4670
- }).on(E.DoubleClick, (r) => {
4670
+ }).on(x.DoubleClick, (r) => {
4671
4671
  const l = new kt(r, null);
4672
4672
  this.diagramEvent$.next(l);
4673
- }).on(E.KeyDown, (r) => {
4673
+ }).on(x.KeyDown, (r) => {
4674
4674
  if (!r.ctrlKey && (r.key === et.Delete || r.key === et.Backspace) && this.canUserPerformAction(S.Remove) && (this.userSelection.removeFromModel(), this.cancelAllUserActions()), r.ctrlKey && r.key === "a") {
4675
4675
  r.preventDefault();
4676
4676
  for (const l of this.model.nodes)
@@ -4708,13 +4708,13 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
4708
4708
  });
4709
4709
  const s = this.selectSVGElement().append("g").attr("class", "daga-canvas-view").attr("width", "100%").attr("height", "100%");
4710
4710
  s.call(
4711
- this.zoomBehavior = N.zoom().on(fe.Zoom, (r) => {
4711
+ this.zoomBehavior = N.zoom().filter((r) => r.type !== x.DoubleClick).on(fe.Zoom, (r) => {
4712
4712
  if (r.sourceEvent) {
4713
4713
  if (!this.canUserPerformAction(S.Zoom)) {
4714
4714
  A(P.NotAllowed);
4715
4715
  return;
4716
4716
  }
4717
- r.sourceEvent.type === E.Wheel && r.sourceEvent.wheelDelta !== void 0 ? (r.sourceEvent.wheelDelta > 0 && A(P.ZoomIn), r.sourceEvent.wheelDelta < 0 && A(P.ZoomOut)) : r.sourceEvent.type === E.MouseMove && A(P.AllScroll);
4717
+ r.sourceEvent.type === x.Wheel && r.sourceEvent.wheelDelta !== void 0 ? (r.sourceEvent.wheelDelta > 0 && A(P.ZoomIn), r.sourceEvent.wheelDelta < 0 && A(P.ZoomOut)) : r.sourceEvent.type === x.MouseMove && A(P.AllScroll);
4718
4718
  }
4719
4719
  this.zoomTransform = r.transform;
4720
4720
  const l = r.transform.toString();
@@ -4725,14 +4725,14 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
4725
4725
  }).on(fe.End, () => {
4726
4726
  A();
4727
4727
  })
4728
- ), s.append("rect").attr("x", 0).attr("y", 0).attr("width", "100%").attr("height", "100%").attr("fill", this.backgroundColor).attr("stroke-width", "0").on(E.MouseMove, (r) => {
4728
+ ), s.append("rect").attr("x", 0).attr("y", 0).attr("width", "100%").attr("height", "100%").attr("fill", this.backgroundColor).attr("stroke-width", "0").on(x.MouseMove, (r) => {
4729
4729
  if (this.unfinishedConnection !== void 0) {
4730
4730
  const l = this.getPointerLocationRelativeToCanvas(r);
4731
4731
  this.unfinishedConnection.endCoords = l;
4732
4732
  }
4733
- }).on(E.MouseOver, () => {
4733
+ }).on(x.MouseOver, () => {
4734
4734
  this.userHighlight.size() > 0 && (this.userHighlight.clear(), this.diagramEvent$.next(new ot(null)));
4735
- }).on(E.Click, () => {
4735
+ }).on(x.Click, () => {
4736
4736
  if (this.userHighlight.size() > 0 && (this.userHighlight.clear(), this.diagramEvent$.next(new ot(null))), this.contextMenu.close(), this.userSelection.size() > 0) {
4737
4737
  const r = this.userSelection.all();
4738
4738
  this.userSelection.clear(), this.diagramEvent$.next(
@@ -4849,9 +4849,9 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
4849
4849
  );
4850
4850
  t && t.length > 0 && (e = e.filter((o) => t.includes(o.id)));
4851
4851
  const l = r.merge(e);
4852
- s.remove(), r.on(E.MouseOver, (o, n) => {
4852
+ s.remove(), r.on(x.MouseOver, (o, n) => {
4853
4853
  this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new ot(n)));
4854
- }).on(E.Click, (o, n) => {
4854
+ }).on(x.Click, (o, n) => {
4855
4855
  if (!o.ctrlKey && !o.shiftKey) {
4856
4856
  const a = this.userSelection.all();
4857
4857
  this.userSelection.clear(), this.diagramEvent$.next(
@@ -4859,14 +4859,14 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
4859
4859
  );
4860
4860
  }
4861
4861
  this.userSelection.toggle(n), this.diagramEvent$.next(new F([n], n.selected));
4862
- }).on(E.ContextMenu, (o, n) => {
4862
+ }).on(x.ContextMenu, (o, n) => {
4863
4863
  if (this.dragging) {
4864
4864
  o.preventDefault(), o.stopPropagation(), this.dragging = !1;
4865
4865
  return;
4866
4866
  }
4867
4867
  const a = new wt(o, n);
4868
4868
  this.diagramEvent$.next(a), !a.defaultPrevented && this.canUserPerformAction(S.ContextMenu) && (o.preventDefault(), this.userHighlight.focusOn(n), this.diagramEvent$.next(new ot(n)), this.userSelection.add(n), this.diagramEvent$.next(new F([n], !0)), this.contextMenu.open(o));
4869
- }).on(E.DoubleClick, (o, n) => {
4869
+ }).on(x.DoubleClick, (o, n) => {
4870
4870
  const a = new kt(o, n);
4871
4871
  this.diagramEvent$.next(a);
4872
4872
  }).call(
@@ -4879,9 +4879,9 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
4879
4879
  })
4880
4880
  ), ge(
4881
4881
  r
4882
- ), r.filter(".resizable-x").append("line").attr("class", "left-resizer").attr("stroke", "transparent").attr("stroke-width", `${G}px`).on(E.MouseOver, (o, n) => {
4882
+ ), r.filter(".resizable-x").append("line").attr("class", "left-resizer").attr("stroke", "transparent").attr("stroke-width", `${G}px`).on(x.MouseOver, (o, n) => {
4883
4883
  this.canUserPerformAction(S.StretchNode) && n.type.resizableX && !n.removed && A(P.EWResize);
4884
- }).on(E.MouseOut, (o, n) => {
4884
+ }).on(x.MouseOut, (o, n) => {
4885
4885
  this.canUserPerformAction(S.StretchNode) && n.type.resizableX && !n.removed && A();
4886
4886
  }).call(
4887
4887
  N.drag().on($.Start, (o, n) => {
@@ -4904,9 +4904,9 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
4904
4904
  }
4905
4905
  A();
4906
4906
  })
4907
- ), r.filter(".resizable-y").append("line").attr("class", "top-resizer").attr("stroke", "transparent").attr("stroke-width", `${G}px`).on(E.MouseOver, (o, n) => {
4907
+ ), r.filter(".resizable-y").append("line").attr("class", "top-resizer").attr("stroke", "transparent").attr("stroke-width", `${G}px`).on(x.MouseOver, (o, n) => {
4908
4908
  this.canUserPerformAction(S.StretchNode) && n.type.resizableY && !n.removed && A(P.NSResize);
4909
- }).on(E.MouseOut, (o, n) => {
4909
+ }).on(x.MouseOut, (o, n) => {
4910
4910
  this.canUserPerformAction(S.StretchNode) && n.type.resizableY && !n.removed && A();
4911
4911
  }).call(
4912
4912
  N.drag().on($.Start, (o, n) => {
@@ -4929,9 +4929,9 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
4929
4929
  }
4930
4930
  A();
4931
4931
  })
4932
- ), r.filter(".resizable-x").append("line").attr("class", "right-resizer").attr("stroke", "transparent").attr("stroke-width", `${G}px`).on(E.MouseOver, (o, n) => {
4932
+ ), r.filter(".resizable-x").append("line").attr("class", "right-resizer").attr("stroke", "transparent").attr("stroke-width", `${G}px`).on(x.MouseOver, (o, n) => {
4933
4933
  this.canUserPerformAction(S.StretchNode) && n.type.resizableX && !n.removed && A(P.EWResize);
4934
- }).on(E.MouseOut, (o, n) => {
4934
+ }).on(x.MouseOut, (o, n) => {
4935
4935
  this.canUserPerformAction(S.StretchNode) && n.type.resizableX && !n.removed && A();
4936
4936
  }).call(
4937
4937
  N.drag().on($.Start, (o, n) => {
@@ -4954,9 +4954,9 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
4954
4954
  }
4955
4955
  A();
4956
4956
  })
4957
- ), r.filter(".resizable-y").append("line").attr("class", "bottom-resizer").attr("stroke", "transparent").attr("stroke-width", `${G}px`).on(E.MouseOver, (o, n) => {
4957
+ ), r.filter(".resizable-y").append("line").attr("class", "bottom-resizer").attr("stroke", "transparent").attr("stroke-width", `${G}px`).on(x.MouseOver, (o, n) => {
4958
4958
  this.canUserPerformAction(S.StretchNode) && n.type.resizableY && !n.removed && A(P.NSResize);
4959
- }).on(E.MouseOut, (o, n) => {
4959
+ }).on(x.MouseOut, (o, n) => {
4960
4960
  this.canUserPerformAction(S.StretchNode) && n.type.resizableY && !n.removed && A();
4961
4961
  }).call(
4962
4962
  N.drag().on($.Start, (o, n) => {
@@ -5005,9 +5005,9 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5005
5005
  );
5006
5006
  t && t.length > 0 && (e = e.filter((o) => t.includes(o.id)));
5007
5007
  const l = r.merge(e);
5008
- s.remove(), r.on(E.MouseOver, (o, n) => {
5008
+ s.remove(), r.on(x.MouseOver, (o, n) => {
5009
5009
  this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new ot(n)));
5010
- }).on(E.Click, (o, n) => {
5010
+ }).on(x.Click, (o, n) => {
5011
5011
  if (!o.ctrlKey && !o.shiftKey) {
5012
5012
  const c = this.userSelection.all();
5013
5013
  this.userSelection.clear(), this.diagramEvent$.next(
@@ -5021,7 +5021,7 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5021
5021
  a.selected
5022
5022
  )
5023
5023
  );
5024
- }).on(E.ContextMenu, (o, n) => {
5024
+ }).on(x.ContextMenu, (o, n) => {
5025
5025
  if (this.dragging) {
5026
5026
  o.preventDefault(), o.stopPropagation(), this.dragging = !1;
5027
5027
  return;
@@ -5034,7 +5034,7 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5034
5034
  new F([c], !0)
5035
5035
  ), this.contextMenu.open(o);
5036
5036
  }
5037
- }).on(E.DoubleClick, (o, n) => {
5037
+ }).on(x.DoubleClick, (o, n) => {
5038
5038
  const a = new kt(o, n);
5039
5039
  this.diagramEvent$.next(a);
5040
5040
  }).call(
@@ -5063,9 +5063,9 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5063
5063
  })
5064
5064
  ), ge(
5065
5065
  r
5066
- ), r.filter(".resizable-x").append("line").attr("class", "left-resizer").attr("stroke", "transparent").attr("stroke-width", `${G}px`).on(E.MouseOver, (o, n) => {
5066
+ ), r.filter(".resizable-x").append("line").attr("class", "left-resizer").attr("stroke", "transparent").attr("stroke-width", `${G}px`).on(x.MouseOver, (o, n) => {
5067
5067
  this.canUserPerformAction(S.StretchSection) && n.getResizableX() && !n.removed && A(P.EWResize);
5068
- }).on(E.MouseOut, (o, n) => {
5068
+ }).on(x.MouseOut, (o, n) => {
5069
5069
  this.canUserPerformAction(S.StretchSection) && n.getResizableX() && !n.removed && A();
5070
5070
  }).call(
5071
5071
  N.drag().on($.Start, (o, n) => {
@@ -5098,9 +5098,9 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5098
5098
  }
5099
5099
  A();
5100
5100
  })
5101
- ), r.filter(".resizable-y").append("line").attr("class", "top-resizer").attr("stroke", "transparent").attr("stroke-width", `${G}px`).on(E.MouseOver, (o, n) => {
5101
+ ), r.filter(".resizable-y").append("line").attr("class", "top-resizer").attr("stroke", "transparent").attr("stroke-width", `${G}px`).on(x.MouseOver, (o, n) => {
5102
5102
  this.canUserPerformAction(S.StretchSection) && n.getResizableY() && !n.removed && A(P.NSResize);
5103
- }).on(E.MouseOut, (o, n) => {
5103
+ }).on(x.MouseOut, (o, n) => {
5104
5104
  this.canUserPerformAction(S.StretchSection) && n.getResizableY() && !n.removed && A();
5105
5105
  }).call(
5106
5106
  N.drag().on($.Start, (o, n) => {
@@ -5133,9 +5133,9 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5133
5133
  }
5134
5134
  A();
5135
5135
  })
5136
- ), r.filter(".resizable-x").append("line").attr("class", "right-resizer").attr("stroke", "transparent").attr("stroke-width", `${G}px`).on(E.MouseOver, (o, n) => {
5136
+ ), r.filter(".resizable-x").append("line").attr("class", "right-resizer").attr("stroke", "transparent").attr("stroke-width", `${G}px`).on(x.MouseOver, (o, n) => {
5137
5137
  this.canUserPerformAction(S.StretchSection) && n.getResizableX() && !n.removed && A(P.EWResize);
5138
- }).on(E.MouseOut, (o, n) => {
5138
+ }).on(x.MouseOut, (o, n) => {
5139
5139
  this.canUserPerformAction(S.StretchSection) && n.getResizableX() && !n.removed && A();
5140
5140
  }).call(
5141
5141
  N.drag().on($.Start, (o, n) => {
@@ -5168,9 +5168,9 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5168
5168
  }
5169
5169
  A();
5170
5170
  })
5171
- ), r.filter(".resizable-y").append("line").attr("class", "bottom-resizer").attr("stroke", "transparent").attr("stroke-width", `${G}px`).on(E.MouseOver, (o, n) => {
5171
+ ), r.filter(".resizable-y").append("line").attr("class", "bottom-resizer").attr("stroke", "transparent").attr("stroke-width", `${G}px`).on(x.MouseOver, (o, n) => {
5172
5172
  this.canUserPerformAction(S.StretchSection) && n.getResizableY() && !n.removed && A(P.NSResize);
5173
- }).on(E.MouseOut, (o, n) => {
5173
+ }).on(x.MouseOut, (o, n) => {
5174
5174
  this.canUserPerformAction(S.StretchSection) && n.getResizableY() && !n.removed && A();
5175
5175
  }).call(
5176
5176
  N.drag().on($.Start, (o, n) => {
@@ -5217,7 +5217,7 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5217
5217
  const s = e.exit(), r = e.enter().append("g").attr("id", (o) => o.id).attr("class", (o) => `diagram-port ${o.look.lookType}`);
5218
5218
  t && t.length > 0 && (e = e.filter((o) => t.includes(o.id)));
5219
5219
  const l = r.merge(e);
5220
- s.remove(), r.on(E.MouseOver, (o, n) => {
5220
+ s.remove(), r.on(x.MouseOver, (o, n) => {
5221
5221
  var a, c, h, d, u, p, m, f, g, v, w, b;
5222
5222
  !this.unfinishedConnection && !this.dragging && (this.userHighlight.focusOn(n), this.diagramEvent$.next(new ot(n))), this.unfinishedConnection && (// can start at the starting port
5223
5223
  this.unfinishedConnection.type.canStartFromType(
@@ -5232,9 +5232,9 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5232
5232
  this.unfinishedConnection.type.canFinishOnType(
5233
5233
  ((w = (v = (g = this.unfinishedConnection.start) == null ? void 0 : g.getNode()) == null ? void 0 : v.type) == null ? void 0 : w.id) || ""
5234
5234
  ) && ((b = this.unfinishedConnection.start) != null && b.allowsIncoming) || A(P.NoDrop));
5235
- }).on(E.MouseOut, () => {
5235
+ }).on(x.MouseOut, () => {
5236
5236
  this.unfinishedConnection && A(P.Grabbing);
5237
- }).on(E.Click, (o, n) => {
5237
+ }).on(x.Click, (o, n) => {
5238
5238
  if (!o.ctrlKey && !o.shiftKey) {
5239
5239
  const c = this.userSelection.all();
5240
5240
  this.userSelection.clear(), this.diagramEvent$.next(
@@ -5248,7 +5248,7 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5248
5248
  a.selected
5249
5249
  )
5250
5250
  );
5251
- }).on(E.ContextMenu, (o, n) => {
5251
+ }).on(x.ContextMenu, (o, n) => {
5252
5252
  if (this.dragging) {
5253
5253
  o.preventDefault(), o.stopPropagation(), this.dragging = !1;
5254
5254
  return;
@@ -5261,7 +5261,7 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5261
5261
  new F([c], !0)
5262
5262
  ), this.contextMenu.open(o);
5263
5263
  }
5264
- }).on(E.DoubleClick, (o, n) => {
5264
+ }).on(x.DoubleClick, (o, n) => {
5265
5265
  const a = new kt(o, n);
5266
5266
  this.diagramEvent$.next(a);
5267
5267
  }).call(
@@ -5362,9 +5362,9 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5362
5362
  const r = s.exit(), l = s.enter().append("g").attr("id", (n) => n.id).attr("class", "diagram-connection");
5363
5363
  t && t.length > 0 && (s = s.filter((n) => t.includes(n.id)));
5364
5364
  const o = l.merge(s);
5365
- r.remove(), l.on(E.MouseOver, (n, a) => {
5365
+ r.remove(), l.on(x.MouseOver, (n, a) => {
5366
5366
  a.end !== void 0 && !this.dragging && (this.userHighlight.focusOn(a), this.diagramEvent$.next(new ot(a)));
5367
- }).on(E.Click, (n, a) => {
5367
+ }).on(x.Click, (n, a) => {
5368
5368
  if (!n.ctrlKey && !n.shiftKey) {
5369
5369
  const c = this.userSelection.all();
5370
5370
  this.userSelection.clear(), this.diagramEvent$.next(
@@ -5372,14 +5372,14 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5372
5372
  );
5373
5373
  }
5374
5374
  this.userSelection.toggle(a), this.diagramEvent$.next(new F([a], a.selected));
5375
- }).on(E.ContextMenu, (n, a) => {
5375
+ }).on(x.ContextMenu, (n, a) => {
5376
5376
  if (this.dragging) {
5377
5377
  n.preventDefault(), n.stopPropagation(), this.dragging = !1;
5378
5378
  return;
5379
5379
  }
5380
5380
  const c = new wt(n, a);
5381
5381
  this.diagramEvent$.next(c), !c.defaultPrevented && this.canUserPerformAction(S.ContextMenu) && (n.preventDefault(), this.userHighlight.focusOn(a), this.diagramEvent$.next(new ot(a)), this.userSelection.add(a), this.diagramEvent$.next(new F([a], !0)), this.contextMenu.open(n));
5382
- }).on(E.DoubleClick, (n, a) => {
5382
+ }).on(x.DoubleClick, (n, a) => {
5383
5383
  const c = new kt(n, a);
5384
5384
  this.diagramEvent$.next(c);
5385
5385
  }).call(
@@ -5445,9 +5445,9 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5445
5445
  const s = e.exit(), r = e.enter().append("foreignObject").attr("id", (o) => o.id).attr("class", "diagram-field");
5446
5446
  t && t.length > 0 && (e = e.filter((o) => t.includes(o.id)));
5447
5447
  const l = r.merge(e);
5448
- s.remove(), r.style("box-sizing", "border-box").on(E.MouseOver, (o, n) => {
5448
+ s.remove(), r.style("box-sizing", "border-box").on(x.MouseOver, (o, n) => {
5449
5449
  this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new ot(n)));
5450
- }).on(E.Click, (o, n) => {
5450
+ }).on(x.Click, (o, n) => {
5451
5451
  if (!o.ctrlKey && !o.shiftKey) {
5452
5452
  const c = this.userSelection.all();
5453
5453
  this.userSelection.clear(), this.diagramEvent$.next(
@@ -5461,7 +5461,7 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5461
5461
  a.selected
5462
5462
  )
5463
5463
  );
5464
- }).on(E.ContextMenu, (o, n) => {
5464
+ }).on(x.ContextMenu, (o, n) => {
5465
5465
  if (this.dragging) {
5466
5466
  o.preventDefault(), o.stopPropagation(), this.dragging = !1;
5467
5467
  return;
@@ -5474,7 +5474,7 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5474
5474
  new F([c], !0)
5475
5475
  ), this.contextMenu.open(o);
5476
5476
  }
5477
- }).on(E.DoubleClick, (o, n) => {
5477
+ }).on(x.DoubleClick, (o, n) => {
5478
5478
  const a = new kt(o, n);
5479
5479
  this.diagramEvent$.next(a), !a.defaultPrevented && this.canUserPerformAction(S.EditField) && n.editable && !n.removed && (this.currentAction = new di(this, n.id, n.text, ""), this.createInputField(
5480
5480
  n.text,
@@ -5549,14 +5549,14 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5549
5549
  (o) => o.id
5550
5550
  );
5551
5551
  const s = e.exit(), r = e.enter().append("foreignObject").attr("id", (o) => o.id).attr("class", "diagram-object");
5552
- t && t.length > 0 && (e = e.filter((o) => t.includes(o.id))), r.merge(e).attr("width", (o) => `${o.width}px`).attr("height", (o) => `${o.height}px`).attr("transform", (o) => `translate(${o.coords[0]},${o.coords[1]})`).html((o) => o.html), s.remove(), r.on(E.ContextMenu, (o, n) => {
5552
+ t && t.length > 0 && (e = e.filter((o) => t.includes(o.id))), r.merge(e).attr("width", (o) => `${o.width}px`).attr("height", (o) => `${o.height}px`).attr("transform", (o) => `translate(${o.coords[0]},${o.coords[1]})`).html((o) => o.html), s.remove(), r.on(x.ContextMenu, (o, n) => {
5553
5553
  if (this.dragging) {
5554
5554
  o.preventDefault(), o.stopPropagation(), this.dragging = !1;
5555
5555
  return;
5556
5556
  }
5557
5557
  const a = new wt(o, n);
5558
5558
  this.diagramEvent$.next(a), !a.defaultPrevented && this.canUserPerformAction(S.ContextMenu) && (o.preventDefault(), this.contextMenu.open(o));
5559
- }).on(E.DoubleClick, (o, n) => {
5559
+ }).on(x.DoubleClick, (o, n) => {
5560
5560
  const a = new kt(o, n);
5561
5561
  this.diagramEvent$.next(a);
5562
5562
  }).call(
@@ -5579,9 +5579,9 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5579
5579
  (o) => o.id
5580
5580
  );
5581
5581
  const s = e.exit(), r = e.enter().append("foreignObject").attr("id", (o) => o.id).attr("class", "diagram-decorator");
5582
- t && t.length > 0 && (e = e.filter((o) => t.includes(o.id))), r.merge(e).attr("width", (o) => `${o.width}px`).attr("height", (o) => `${o.height}px`).attr("transform", (o) => `translate(${o.coords[0]},${o.coords[1]})`).html((o) => o.html), s.remove(), r.on(E.MouseOver, (o, n) => {
5582
+ t && t.length > 0 && (e = e.filter((o) => t.includes(o.id))), r.merge(e).attr("width", (o) => `${o.width}px`).attr("height", (o) => `${o.height}px`).attr("transform", (o) => `translate(${o.coords[0]},${o.coords[1]})`).html((o) => o.html), s.remove(), r.on(x.MouseOver, (o, n) => {
5583
5583
  this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new ot(n)));
5584
- }).on(E.Click, (o, n) => {
5584
+ }).on(x.Click, (o, n) => {
5585
5585
  if (!o.ctrlKey && !o.shiftKey) {
5586
5586
  const a = this.userSelection.all();
5587
5587
  this.userSelection.clear(), this.diagramEvent$.next(
@@ -5597,7 +5597,7 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5597
5597
  )
5598
5598
  );
5599
5599
  }
5600
- }).on(E.ContextMenu, (o, n) => {
5600
+ }).on(x.ContextMenu, (o, n) => {
5601
5601
  if (this.dragging) {
5602
5602
  o.preventDefault(), o.stopPropagation(), this.dragging = !1;
5603
5603
  return;
@@ -5612,7 +5612,7 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5612
5612
  new F([c], !0)
5613
5613
  ), this.contextMenu.open(o);
5614
5614
  }
5615
- }).on(E.DoubleClick, (o, n) => {
5615
+ }).on(x.DoubleClick, (o, n) => {
5616
5616
  const a = new kt(o, n);
5617
5617
  this.diagramEvent$.next(a);
5618
5618
  }).call(
@@ -5851,7 +5851,7 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5851
5851
  }
5852
5852
  }
5853
5853
  finishConnection(t) {
5854
- var e, s, r, l, o, n, a, c, h, d, u, p, m, f, g, v, w, b, x, I;
5854
+ var e, s, r, l, o, n, a, c, h, d, u, p, m, f, g, v, w, b, E, I;
5855
5855
  if (this.userHighlight.clear(), this.unfinishedConnection !== void 0)
5856
5856
  if (this.unfinishedConnection.start !== t)
5857
5857
  if (this.unfinishedConnection.type.canStartFromType(
@@ -5898,7 +5898,7 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5898
5898
  const C = new de(
5899
5899
  this,
5900
5900
  T,
5901
- M ? t.id : (x = this.unfinishedConnection.start) == null ? void 0 : x.id,
5901
+ M ? t.id : (E = this.unfinishedConnection.start) == null ? void 0 : E.id,
5902
5902
  M ? (I = this.unfinishedConnection.start) == null ? void 0 : I.id : t.id
5903
5903
  );
5904
5904
  this.dropConnection(), C.do(), this.actionStack.add(C);
@@ -5925,21 +5925,21 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5925
5925
  this.inputFieldContainer = h;
5926
5926
  const d = h.append("xhtml:textarea");
5927
5927
  let u, p;
5928
- d.text(t).style("box-sizing", "border-box").style("width", `${s}px`).style("height", `${r}px`).style("font-size", `${l}px`).style("font-family", o).style("resize", "none").style("outline", 0).style("border", 0).style("margin", 0).style("padding", 0).on(E.KeyDown, (f) => {
5928
+ d.text(t).style("box-sizing", "border-box").style("width", `${s}px`).style("height", `${r}px`).style("font-size", `${l}px`).style("font-family", o).style("resize", "none").style("outline", 0).style("border", 0).style("margin", 0).style("padding", 0).on(x.KeyDown, (f) => {
5929
5929
  f.stopPropagation();
5930
- }).on(E.KeyUp, (f) => {
5930
+ }).on(x.KeyUp, (f) => {
5931
5931
  if (f.stopPropagation(), f.key === et.Escape) {
5932
5932
  const g = d.property("value");
5933
5933
  this.removeInputField(), c && c(g);
5934
5934
  }
5935
- }).on(E.Input, () => {
5935
+ }).on(x.Input, () => {
5936
5936
  const f = d.property("value");
5937
5937
  d.attr("cols", to(f) + 1), d.attr("rows", eo(f) + 1), d.style("width", ""), d.style("height", ""), u = d.property("scrollWidth") + 1, p = d.property("scrollHeight") + 1;
5938
5938
  const g = Math.max(u, s), v = Math.max(p, r);
5939
5939
  h == null || h.attr("width", `${g}px`), d.style("width", `${g}px`), h == null || h.attr("height", `${v}px`), d.style("height", `${v}px`), a && a(f);
5940
- }).on(E.Click, (f) => {
5940
+ }).on(x.Click, (f) => {
5941
5941
  f.stopPropagation();
5942
- }).on(E.FocusOut, () => {
5942
+ }).on(x.FocusOut, () => {
5943
5943
  const f = d.property("value");
5944
5944
  this.removeInputField(), c && c(f);
5945
5945
  });
@@ -5948,7 +5948,7 @@ const Fo = (i) => i * Math.PI / 180, gi = (i, t, e) => {
5948
5948
  }
5949
5949
  removeInputField() {
5950
5950
  var t, e, s;
5951
- (e = (t = this.inputFieldContainer) == null ? void 0 : t.select("input")) == null || e.on(E.Blur, null), (s = this.inputFieldContainer) == null || s.remove(), this.inputFieldContainer = void 0;
5951
+ (e = (t = this.inputFieldContainer) == null ? void 0 : t.select("input")) == null || e.on(x.Blur, null), (s = this.inputFieldContainer) == null || s.remove(), this.inputFieldContainer = void 0;
5952
5952
  }
5953
5953
  minimumSizeOfField(t) {
5954
5954
  var r, l;
@@ -6353,8 +6353,8 @@ class Wo {
6353
6353
  f.coords
6354
6354
  ), b = [f.coords[0], f.coords[1]];
6355
6355
  if (m.includes(f) && w > 0 && (w > e + (Math.max(p.width, p.height) + Math.max(f.width, f.height)) / 2 ? (b[0] = b[0] - (v[0] - g[0]) * l, b[1] = b[1] - (v[1] - g[1]) * l) : (b[0] = b[0] + (v[0] - g[0]) * n, b[1] = b[1] + (v[1] - g[1]) * n)), w > 0) {
6356
- const x = o / (w * w);
6357
- b[0] = b[0] + x * (v[0] - g[0]) / w, b[1] = b[1] + x * (v[1] - g[1]) / w;
6356
+ const E = o / (w * w);
6357
+ b[0] = b[0] + E * (v[0] - g[0]) / w, b[1] = b[1] + E * (v[1] - g[1]) / w;
6358
6358
  } else
6359
6359
  b[0] = b[0] + a * (Math.random() * 2 - 1), b[1] = b[1] + a * (Math.random() * 2 - 1);
6360
6360
  b[0] = b[0] - (v[0] - u[0]) * c, b[1] = b[1] - (v[1] - u[1]) * c, b[0] - f.coords[0] > h ? b[0] = f.coords[0] + h : b[0] - f.coords[0] < -h && (b[0] = f.coords[0] - h), b[1] - f.coords[1] > h ? b[1] = f.coords[1] + h : b[1] - f.coords[1] < -h && (b[1] = f.coords[1] - h), f.move(b);
@@ -6711,7 +6711,7 @@ const Se = ({
6711
6711
  n === void 0 ? (I(t.length - 1), M(t.length - 1)) : (I(n - 1), M(n)), L.preventDefault();
6712
6712
  break;
6713
6713
  case et.Escape:
6714
- x(), L.preventDefault();
6714
+ E(), L.preventDefault();
6715
6715
  break;
6716
6716
  case et.Enter:
6717
6717
  z(t[n || 0]), L.preventDefault();
@@ -6746,7 +6746,7 @@ const Se = ({
6746
6746
  }
6747
6747
  v(!0);
6748
6748
  }
6749
- }, x = () => {
6749
+ }, E = () => {
6750
6750
  v(!1);
6751
6751
  }, I = (L) => {
6752
6752
  if (!i) {
@@ -6756,7 +6756,7 @@ const Se = ({
6756
6756
  }
6757
6757
  }, T = () => {
6758
6758
  setTimeout(() => {
6759
- x();
6759
+ E();
6760
6760
  }, is);
6761
6761
  }, M = (L) => {
6762
6762
  var q;
@@ -6943,26 +6943,26 @@ const Se = ({
6943
6943
  const b = w === "blur" ? v.trim() : v;
6944
6944
  if (w === "blur") {
6945
6945
  if (g !== b) {
6946
- const x = {};
6946
+ const E = {};
6947
6947
  Object.keys(t).forEach((I) => {
6948
- I === g ? x[b] = t[I] : x[I] = t[I];
6949
- }), e(x), a((I) => {
6948
+ I === g ? E[b] = t[I] : E[I] = t[I];
6949
+ }), e(E), a((I) => {
6950
6950
  const T = { ...I };
6951
6951
  return delete T[g], T;
6952
6952
  });
6953
6953
  }
6954
6954
  } else
6955
- a((x) => ({
6956
- ...x,
6955
+ a((E) => ({
6956
+ ...E,
6957
6957
  [g]: v
6958
6958
  }));
6959
6959
  }, d = (g, v, w) => {
6960
6960
  const b = w === "blur" ? v.trim() : v;
6961
6961
  if (b !== "") {
6962
- const x = {};
6962
+ const E = {};
6963
6963
  Object.keys(t).forEach((I) => {
6964
- I === g ? x[I] = b : x[I] = t[I];
6965
- }), e(x);
6964
+ I === g ? E[I] = b : E[I] = t[I];
6965
+ }), e(E);
6966
6966
  }
6967
6967
  }, u = () => {
6968
6968
  const g = s.trim(), v = l.trim();
@@ -7411,14 +7411,14 @@ const Se = ({
7411
7411
  g.append("option").attr("value", "").text("(None selected)");
7412
7412
  for (const v in f)
7413
7413
  g.append("option").attr("value", v).text(v);
7414
- g.on(E.Change, () => {
7414
+ g.on(x.Change, () => {
7415
7415
  o && h().selectAll(".daga-template-container.daga-in-category").remove();
7416
7416
  const v = g.property("value");
7417
7417
  n(v);
7418
7418
  const w = f[v] || [];
7419
7419
  for (const b of w)
7420
7420
  u(b, "daga-in-category");
7421
- }), o && (g.property("value", o), g.dispatch(E.Change));
7421
+ }), o && (g.property("value", o), g.dispatch(x.Change));
7422
7422
  }, u = (f, g) => {
7423
7423
  if (f.templateType === "node") {
7424
7424
  const v = t.model.nodes.types.get(f.type);
@@ -7432,7 +7432,7 @@ const Se = ({
7432
7432
  }, p = (f, g, v) => {
7433
7433
  if (r !== void 0 && f.priority < r)
7434
7434
  return;
7435
- const w = f.defaultLook.lookType === "shaped-look" ? f.defaultLook.borderThickness : 0, b = f.defaultHeight + w, x = f.defaultWidth + w, I = g.height || b, T = g.width || x, M = h().append("div").attr(
7435
+ const w = f.defaultLook.lookType === "shaped-look" ? f.defaultLook.borderThickness : 0, b = f.defaultHeight + w, E = f.defaultWidth + w, I = g.height || b, T = g.width || E, M = h().append("div").attr(
7436
7436
  "class",
7437
7437
  `daga-template-container ${v !== void 0 ? v : ""}`
7438
7438
  ).style("width", `${T}px`).style("height", `${I}px`).call(
@@ -7501,7 +7501,7 @@ const Se = ({
7501
7501
  _t.do(), t == null || t.actionStack.add(_t), A();
7502
7502
  }
7503
7503
  })
7504
- ).append("svg").attr("class", `palette-node ${f.id}`).attr("viewBox", `0 0 ${x} ${b}`).attr("preserveAspectRatio", "none").style("position", "relative").style("left", 0).style("top", 0).style("width", `${T}px`).style("height", `${I}px`), C = g.look || f.defaultLook;
7504
+ ).append("svg").attr("class", `palette-node ${f.id}`).attr("viewBox", `0 0 ${E} ${b}`).attr("preserveAspectRatio", "none").style("position", "relative").style("left", 0).style("top", 0).style("width", `${T}px`).style("height", `${I}px`), C = g.look || f.defaultLook;
7505
7505
  switch (C.lookType) {
7506
7506
  case "shaped-look":
7507
7507
  M.append("path").attr(
@@ -7671,7 +7671,7 @@ const Se = ({
7671
7671
  }, 500);
7672
7672
  }, w = Yt(Lt), b = () => {
7673
7673
  w.zoomBy(w.zoomFactor);
7674
- }, x = () => {
7674
+ }, E = () => {
7675
7675
  w.zoomBy(1 / w.zoomFactor);
7676
7676
  }, I = () => {
7677
7677
  w.center();
@@ -7713,7 +7713,7 @@ const Se = ({
7713
7713
  className: `daga-diagram-buttons daga-${i} daga-${t}`,
7714
7714
  children: [
7715
7715
  o && w.canUserPerformAction(S.Zoom) && /* @__PURE__ */ k("button", { className: "daga-zoom-in", onClick: b, children: /* @__PURE__ */ k("span", { className: "daga-tooltip", children: "Zoom in" }) }),
7716
- o && w.canUserPerformAction(S.Zoom) && /* @__PURE__ */ k("button", { className: "daga-zoom-out", onClick: x, children: /* @__PURE__ */ k("span", { className: "daga-tooltip", children: "Zoom out" }) }),
7716
+ o && w.canUserPerformAction(S.Zoom) && /* @__PURE__ */ k("button", { className: "daga-zoom-out", onClick: E, children: /* @__PURE__ */ k("span", { className: "daga-tooltip", children: "Zoom out" }) }),
7717
7717
  /* @__PURE__ */ V("div", { className: "daga-collapsable-buttons daga-collapsed", ref: m, children: [
7718
7718
  o && w.canUserPerformAction(S.Zoom) && /* @__PURE__ */ k("button", { className: "daga-center", onClick: I, children: /* @__PURE__ */ k("span", { className: "daga-tooltip", children: "Fit diagram to screen" }) }),
7719
7719
  e && /* @__PURE__ */ k("button", { className: "daga-undo", onClick: C, children: /* @__PURE__ */ k("span", { className: "daga-tooltip", children: "Undo" }) }),
@@ -7763,24 +7763,24 @@ const Se = ({
7763
7763
  diagramButtons: f,
7764
7764
  palette: g,
7765
7765
  propertyEditor: v
7766
- }, b = (ht = !1) => ((!a.current || ht) && (h.forEach((mt) => mt.unsubscribe()), a.current = new be(w, i)), a.current), x = b(), I = (ht) => {
7767
- x.initView(ht), h.push(
7768
- x.diagramEvent$.subscribe((mt) => {
7766
+ }, b = (ht = !1) => ((!a.current || ht) && (h.forEach((mt) => mt.unsubscribe()), a.current = new be(w, i)), a.current), E = b(), I = (ht) => {
7767
+ E.initView(ht), h.push(
7768
+ E.diagramEvent$.subscribe((mt) => {
7769
7769
  s == null || s(mt);
7770
7770
  })
7771
7771
  ), h.push(
7772
- x.diagramChange$.subscribe(() => {
7773
- const mt = o.export(x.model);
7772
+ E.diagramChange$.subscribe(() => {
7773
+ const mt = o.export(E.model);
7774
7774
  r == null || r(mt);
7775
7775
  })
7776
7776
  );
7777
7777
  };
7778
7778
  Tt(() => {
7779
- n.current && (c.current || (I(n.current), c.current = !0, e == null || e(x)));
7779
+ n.current && (c.current || (I(n.current), c.current = !0, e == null || e(E)));
7780
7780
  }, [n.current]), Bi(() => {
7781
- n.current && (b(!0), I(n.current), e == null || e(x));
7781
+ n.current && (b(!0), I(n.current), e == null || e(E));
7782
7782
  }, [i]), Tt(() => {
7783
- t && l.import(x.model, t);
7783
+ t && l.import(E.model, t);
7784
7784
  }, [t]);
7785
7785
  const T = (ht, mt, ti) => {
7786
7786
  var ei;
@@ -7790,12 +7790,12 @@ const Se = ({
7790
7790
  p.propertySet,
7791
7791
  p.rootElement
7792
7792
  );
7793
- ae.setValues(p.getValues()), v.valueSet = ae, p.rootElement.valueSet = ae, (ei = x.propertyEditorChanges$) == null || ei.next();
7793
+ ae.setValues(p.getValues()), v.valueSet = ae, p.rootElement.valueSet = ae, (ei = E.propertyEditorChanges$) == null || ei.next();
7794
7794
  }
7795
7795
  };
7796
- return /* @__PURE__ */ k("daga-diagram", { children: /* @__PURE__ */ k(Qo.Provider, { value: i, children: /* @__PURE__ */ k(Lt.Provider, { value: x, children: /* @__PURE__ */ V("daga-diagram-editor", { children: [
7796
+ return /* @__PURE__ */ k("daga-diagram", { children: /* @__PURE__ */ k(Qo.Provider, { value: i, children: /* @__PURE__ */ k(Lt.Provider, { value: E, children: /* @__PURE__ */ V("daga-diagram-editor", { children: [
7797
7797
  /* @__PURE__ */ k("div", { className: "daga-append-to", ref: n }),
7798
- /* @__PURE__ */ V(Lt.Provider, { value: x, children: [
7798
+ /* @__PURE__ */ V(Lt.Provider, { value: E, children: [
7799
7799
  ((M = i.components) == null ? void 0 : M.buttons) !== void 0 && ((z = (C = i.components) == null ? void 0 : C.buttons) == null ? void 0 : z.enabled) !== !1 && /* @__PURE__ */ k(
7800
7800
  hs,
7801
7801
  {