@metadev/daga-react 4.2.14 → 4.2.15

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
@@ -1,9 +1,9 @@
1
- import { jsx as v, jsxs as T, Fragment as ho } from "react/jsx-runtime";
2
- import * as x from "d3";
1
+ import { jsx as y, jsxs as M, Fragment as ho } from "react/jsx-runtime";
2
+ import * as L from "d3";
3
3
  import { debounceTime as go, Subject as Wt, merge as fo, map as uo } from "rxjs";
4
- import { createContext as Fe, useState as D, useContext as Dt, useRef as rt, useEffect as Ct, useMemo as po } from "react";
5
- var g = /* @__PURE__ */ ((s) => (s.Bottom = "bottom", s.Left = "left", s.Right = "right", s.Top = "top", s))(g || {}), Kt = /* @__PURE__ */ ((s) => (s.BottomLeft = "bottom-left", s.BottomRight = "bottom-right", s.TopLeft = "top-left", s.TopRight = "top-right", s))(Kt || {}), Lt = /* @__PURE__ */ ((s) => (s.Left = "left", s.Center = "center", s.Right = "right", s))(Lt || {}), Jt = /* @__PURE__ */ ((s) => (s.Top = "top", s.Center = "center", s.Bottom = "bottom", s))(Jt || {});
6
- const It = (s) => [Math.round(s[0]), Math.round(s[1])], ut = (s, t, e) => t < e ? t <= s && s <= e : e <= s && s <= t, Le = (s, t, e) => (s - t[0]) / (t[1] - t[0]) * (e[1] - e[0]) + e[0], Qt = (s, t, e, a, l, r, i) => {
4
+ import { createContext as Fe, useState as D, useContext as Dt, useRef as rt, useEffect as St, useMemo as po } from "react";
5
+ var g = /* @__PURE__ */ ((s) => (s.Bottom = "bottom", s.Left = "left", s.Right = "right", s.Top = "top", s))(g || {}), Kt = /* @__PURE__ */ ((s) => (s.BottomLeft = "bottom-left", s.BottomRight = "bottom-right", s.TopLeft = "top-left", s.TopRight = "top-right", s))(Kt || {}), xt = /* @__PURE__ */ ((s) => (s.Left = "left", s.Center = "center", s.Right = "right", s))(xt || {}), Jt = /* @__PURE__ */ ((s) => (s.Top = "top", s.Center = "center", s.Bottom = "bottom", s))(Jt || {});
6
+ const At = (s) => [Math.round(s[0]), Math.round(s[1])], ut = (s, t, e) => t < e ? t <= s && s <= e : e <= s && s <= t, Le = (s, t, e) => (s - t[0]) / (t[1] - t[0]) * (e[1] - e[0]) + e[0], Qt = (s, t, e, a, l, r, i) => {
7
7
  const n = (() => {
8
8
  switch (r) {
9
9
  case "start":
@@ -65,9 +65,9 @@ const It = (s) => [Math.round(s[0]), Math.round(s[1])], ut = (s, t, e) => t < e
65
65
  s[1][1],
66
66
  s[0][1]
67
67
  ));
68
- var $ = /* @__PURE__ */ ((s) => (s.Blur = "blur", s.Change = "change", s.Click = "click", s.ContextMenu = "contextmenu", s.DoubleClick = "dblclick", s.Focus = "focus", s.FocusIn = "focusin", s.FocusOut = "focusout", s.Input = "input", s.KeyDown = "keydown", s.KeyUp = "keyup", s.MouseDown = "mousedown", s.MouseEnter = "mouseenter", s.MouseLeave = "mouseleave", s.MouseMove = "mousemove", s.MouseOut = "mouseout", s.MouseOver = "mouseover", s.MouseUp = "mouseup", s.TouchStart = "touchstart", s.TouchEnd = "touchend", s.Wheel = "wheel", s))($ || {}), Z = /* @__PURE__ */ ((s) => (s.Alt = "Alt", s.AltGraph = "AltGraph", s.ArrowDown = "ArrowDown", s.ArrowLeft = "ArrowLeft", s.ArrowRight = "ArrowRight", s.ArrowUp = "ArrowUp", s.Backspace = "Backspace", s.Control = "Control", s.Delete = "Delete", s.End = "End", s.Enter = "Enter", s.Escape = "Escape", s.Home = "Home", s.OS = "OS", s.PageDown = "PageDown", s.PageUp = "PageUp", s.Shift = "Shift", s.Tab = "Tab", s))(Z || {}), A = /* @__PURE__ */ ((s) => (s.Drag = "drag", s.Start = "start", s.End = "end", s))(A || {}), ue = /* @__PURE__ */ ((s) => (s.Zoom = "zoom", s.Start = "start", s.End = "end", s))(ue || {});
69
- const pe = (s) => s.replace(/([!"#$%&'()*+,\-./:;<=>?@[\\\]^`{|}])/g, "\\$1");
70
- var De = /* @__PURE__ */ ((s) => (s.Straight = "straight", s.Bezier = "bezier", s.Square = "square", s))(De || {}), Se = /* @__PURE__ */ ((s) => (s.Solid = "solid", s.Dashed = "dashed", s.GappedDashes = "gapped-dashes", s.Dotted = "dotted", s))(Se || {});
68
+ var $ = /* @__PURE__ */ ((s) => (s.Blur = "blur", s.Change = "change", s.Click = "click", s.ContextMenu = "contextmenu", s.DoubleClick = "dblclick", s.Focus = "focus", s.FocusIn = "focusin", s.FocusOut = "focusout", s.Input = "input", s.KeyDown = "keydown", s.KeyUp = "keyup", s.MouseDown = "mousedown", s.MouseEnter = "mouseenter", s.MouseLeave = "mouseleave", s.MouseMove = "mousemove", s.MouseOut = "mouseout", s.MouseOver = "mouseover", s.MouseUp = "mouseup", s.TouchStart = "touchstart", s.TouchEnd = "touchend", s.Wheel = "wheel", s))($ || {}), K = /* @__PURE__ */ ((s) => (s.Alt = "Alt", s.AltGraph = "AltGraph", s.ArrowDown = "ArrowDown", s.ArrowLeft = "ArrowLeft", s.ArrowRight = "ArrowRight", s.ArrowUp = "ArrowUp", s.Backspace = "Backspace", s.Control = "Control", s.Delete = "Delete", s.End = "End", s.Enter = "Enter", s.Escape = "Escape", s.Home = "Home", s.OS = "OS", s.PageDown = "PageDown", s.PageUp = "PageUp", s.Shift = "Shift", s.Tab = "Tab", s))(K || {}), A = /* @__PURE__ */ ((s) => (s.Drag = "drag", s.Start = "start", s.End = "end", s))(A || {}), pe = /* @__PURE__ */ ((s) => (s.Zoom = "zoom", s.Start = "start", s.End = "end", s))(pe || {});
69
+ const me = (s) => s.replace(/([!"#$%&'()*+,\-./:;<=>?@[\\\]^`{|}])/g, "\\$1");
70
+ var De = /* @__PURE__ */ ((s) => (s.Straight = "straight", s.Bezier = "bezier", s.Square = "square", s))(De || {}), Ce = /* @__PURE__ */ ((s) => (s.Solid = "solid", s.Dashed = "dashed", s.GappedDashes = "gapped-dashes", s.Dotted = "dotted", s))(Ce || {});
71
71
  const vo = 20, yo = (s, t, e, a, l) => {
72
72
  if (typeof s == "function")
73
73
  return s(
@@ -270,7 +270,7 @@ const vo = 20, yo = (s, t, e, a, l) => {
270
270
  }
271
271
  return r;
272
272
  }
273
- }, me = (s, t) => {
273
+ }, ve = (s, t) => {
274
274
  switch (s) {
275
275
  case "dotted":
276
276
  return `${t}`;
@@ -285,8 +285,8 @@ const vo = 20, yo = (s, t, e, a, l) => {
285
285
  const e = s.indexOf(t);
286
286
  return e >= 0 && s.splice(e, 1), s;
287
287
  };
288
- var Mt = /* @__PURE__ */ ((s) => (s.Ellipse = "ellipse", s.Empty = "empty", s.Folder = "folder", s.Hexagon = "hexagon", s.Octagon = "octagon", s.Pill = "pill", s.Rectangle = "rectangle", s.Rhombus = "rhombus", s.RoundedRectangle = "rounded-rectangle", s.StickyNote = "sticky-note", s))(Mt || {});
289
- const ve = (s, t, e, a, l) => {
288
+ var Tt = /* @__PURE__ */ ((s) => (s.Ellipse = "ellipse", s.Empty = "empty", s.Folder = "folder", s.Hexagon = "hexagon", s.Octagon = "octagon", s.Pill = "pill", s.Rectangle = "rectangle", s.Rhombus = "rhombus", s.RoundedRectangle = "rounded-rectangle", s.StickyNote = "sticky-note", s))(Tt || {});
289
+ const ye = (s, t, e, a, l) => {
290
290
  if (typeof s == "function")
291
291
  return s(t, e, a, l);
292
292
  switch (s) {
@@ -314,7 +314,7 @@ const ve = (s, t, e, a, l) => {
314
314
  return Ee(t, e, a, l);
315
315
  }
316
316
  }, Ye = (s, t, e, a) => `M ${s + e / 2} ${t} A ${e / 2} ${a / 2} 0 0 0 ${s + e / 2} ${t + a} A ${e / 2} ${a / 2} 0 1 0 ${s + e / 2} ${t} Z`, bo = () => "Z", ko = (s, t, e, a) => `M ${s} ${t} L ${s + e / 3} ${t} L ${s + e / 2} ${t + a / 6} L ${s + e} ${t + a / 6} L ${s + e} ${t + a} L ${s} ${t + a} Z`, wo = (s, t, e, a) => `M ${s + e / 4} ${t} L ${s + 3 * e / 4} ${t} L ${s + e} ${t + a / 2} L ${s + 3 * e / 4} ${t + a} L ${s + e / 4} ${t + a} L ${s} ${t + a / 2} Z`, So = (s, t, e, a) => `M ${s + e / 4} ${t} L ${s + 3 * e / 4} ${t} L ${s + e} ${t + a / 4} L ${s + e} ${t + 3 * a / 4} L ${s + 3 * e / 4} ${t + a} L ${s + e / 4} ${t + a} L ${s} ${t + 3 * a / 4} L ${s} ${t + a / 4} L ${s + e / 4} ${t} Z`, qt = (s, t, e, a) => a < e ? `M ${s + a / 2} ${t} L ${s + e - a / 2} ${t} A ${a / 2} ${a / 2} 0 0 1 ${s + e} ${t + a / 2} A ${a / 2} ${a / 2} 0 0 1 ${s + e - a / 2} ${t + a} L ${s + a / 2} ${t + a} A ${a / 2} ${a / 2} 0 0 1 ${s} ${t + a / 2} A ${a / 2} ${a / 2} 0 0 1 ${s + a / 2} ${t} Z` : a > e ? `M ${s} ${t + e / 2} L ${s} ${t + a - e / 2} A ${e / 2} ${e / 2} 0 0 0 ${s + e / 2} ${t + a} A ${e / 2} ${e / 2} 0 0 0 ${s + e} ${t + a - e / 2} L ${s + e} ${t + e / 2} A ${e / 2} ${e / 2} 0 0 0 ${s + e / 2} ${t} A ${e / 2} ${e / 2} 0 0 0 ${s} ${t + e / 2} Z` : Ye(s, t, e, a), Ee = (s, t, e, a) => `M ${s} ${t} L ${s + e} ${t} L ${s + e} ${t + a} L ${s} ${t + a} Z`, Co = (s, t, e, a) => `M ${s + e / 2} ${t} L ${s + e} ${t + a / 2} L ${s + e / 2} ${t + a} L ${s} ${t + a / 2} Z`, $o = (s, t, e, a) => `M ${s + e / 4} ${t} L ${s + 3 * e / 4} ${t} A ${e / 4} ${a / 4} 0 0 1 ${s + e} ${t + a / 4} L ${s + e} ${t + 3 * a / 4} A ${e / 4} ${a / 4} 0 0 1 ${s + 3 * e / 4} ${t + a} L ${s + e / 4} ${t + a} A ${e / 4} ${a / 4} 0 0 1 ${s} ${t + 3 * a / 4} L ${s} ${t + a / 4} A ${e / 4} ${a / 4} 0 0 1 ${s + e / 4} ${t} Z`, Ao = (s, t, e, a) => `M ${s} ${t} L ${s + 3 * e / 4} ${t} L ${s + 3 * e / 4} ${t + a / 4} L ${s + 3 * e / 4} ${t} L ${s + e} ${t + a / 4} L ${s + 3 * e / 4} ${t + a / 4} L ${s + e} ${t + a / 4} L ${s + e} ${t + a} L ${s} ${t + a} Z`;
317
- var L = /* @__PURE__ */ ((s) => (s.AllScroll = "all-scroll", s.Auto = "auto", s.Crosshair = "crosshair", s.EWResize = "ew-resize", s.Grab = "grab", s.Grabbing = "grabbing", s.Move = "move", s.NoDrop = "no-drop", s.NSResize = "ns-resize", s.NotAllowed = "not-allowed", s.ZoomIn = "zoom-in", s.ZoomOut = "zoom-out", s))(L || {});
317
+ var E = /* @__PURE__ */ ((s) => (s.AllScroll = "all-scroll", s.Auto = "auto", s.Crosshair = "crosshair", s.EWResize = "ew-resize", s.Grab = "grab", s.Grabbing = "grabbing", s.Move = "move", s.NoDrop = "no-drop", s.NSResize = "ns-resize", s.NotAllowed = "not-allowed", s.ZoomIn = "zoom-in", s.ZoomOut = "zoom-out", s))(E || {});
318
318
  const Io = (s) => Math.max(...s.split(`
319
319
  `).map((t) => t.length)), xo = (s) => s.match(/\n/g)?.length || 0, W = [];
320
320
  for (let s = 0; s < 256; ++s)
@@ -322,15 +322,15 @@ for (let s = 0; s < 256; ++s)
322
322
  function Lo(s, t = 0) {
323
323
  return (W[s[t + 0]] + W[s[t + 1]] + W[s[t + 2]] + W[s[t + 3]] + "-" + W[s[t + 4]] + W[s[t + 5]] + "-" + W[s[t + 6]] + W[s[t + 7]] + "-" + W[s[t + 8]] + W[s[t + 9]] + "-" + W[s[t + 10]] + W[s[t + 11]] + W[s[t + 12]] + W[s[t + 13]] + W[s[t + 14]] + W[s[t + 15]]).toLowerCase();
324
324
  }
325
- let ae;
325
+ let le;
326
326
  const Eo = new Uint8Array(16);
327
327
  function To() {
328
- if (!ae) {
328
+ if (!le) {
329
329
  if (typeof crypto > "u" || !crypto.getRandomValues)
330
330
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
331
- ae = crypto.getRandomValues.bind(crypto);
331
+ le = crypto.getRandomValues.bind(crypto);
332
332
  }
333
- return ae(Eo);
333
+ return le(Eo);
334
334
  }
335
335
  const Mo = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Te = { randomUUID: Mo };
336
336
  function No(s, t, e) {
@@ -343,14 +343,14 @@ function No(s, t, e) {
343
343
  function Me(s, t, e) {
344
344
  return Te.randomUUID && !s ? Te.randomUUID() : No(s);
345
345
  }
346
- const Nt = (s) => {
346
+ const Mt = (s) => {
347
347
  if (typeof s != "object")
348
348
  return s;
349
349
  const t = {};
350
350
  for (const e of Object.entries(s))
351
- typeof e[1] == "object" ? t[e[0]] = Nt(e[1]) : t[e[0]] = e[1];
351
+ typeof e[1] == "object" ? t[e[0]] = Mt(e[1]) : t[e[0]] = e[1];
352
352
  return t;
353
- }, st = (s) => {
353
+ }, nt = (s) => {
354
354
  const { selected: t, highlighted: e, selectedAndHighlighted: a, ...l } = s, r = l, i = {
355
355
  ...r,
356
356
  ...t
@@ -481,8 +481,8 @@ class ee {
481
481
  yield t;
482
482
  }
483
483
  }
484
- const Pt = 0;
485
- class At {
484
+ const Nt = 0;
485
+ class $t {
486
486
  constructor(t, e) {
487
487
  this.selfRemoved = !1, this.selfRemovedTimestamp = null, this.model = t, this._id = e;
488
488
  }
@@ -511,7 +511,7 @@ class At {
511
511
  * @private
512
512
  */
513
513
  select() {
514
- return this.model.canvas?.selectCanvasView()?.select(`[id='${pe(this.id)}']`);
514
+ return this.model.canvas?.selectCanvasView()?.select(`[id='${me(this.id)}']`);
515
515
  }
516
516
  }
517
517
  class ft extends ee {
@@ -557,7 +557,7 @@ class Po {
557
557
  this.name = t, this.label = e, this.type = a, this.defaultValue = l, this.basic = r, this.editable = i, this.rootAttribute = n, this.options = void 0, this.properties = void 0;
558
558
  }
559
559
  }
560
- var M = /* @__PURE__ */ ((s) => (s.Boolean = "boolean", s.Color = "color", s.Date = "date", s.Datetime = "datetime", s.Number = "number", s.Object = "object", s.Option = "option", s.OptionList = "option-list", s.OptionSet = "option-set", s.Text = "text", s.TextArea = "text-area", s.TextList = "text-list", s.TextSet = "text-set", s.TextMap = "text-map", s.Time = "time", s.Url = "url", s))(M || {});
560
+ var N = /* @__PURE__ */ ((s) => (s.Boolean = "boolean", s.Color = "color", s.Date = "date", s.Datetime = "datetime", s.Number = "number", s.Object = "object", s.Option = "option", s.OptionList = "option-list", s.OptionSet = "option-set", s.Text = "text", s.TextArea = "text-area", s.TextList = "text-list", s.TextSet = "text-set", s.TextMap = "text-map", s.Time = "time", s.Url = "url", s))(N || {});
561
561
  class oe {
562
562
  constructor(t = []) {
563
563
  this.propertyList = t, this.propertyMap = {};
@@ -577,10 +577,10 @@ class oe {
577
577
  function kt(s, t) {
578
578
  return !t || s[0] > t[0] ? !0 : s[0] === t[0] ? s[1] >= t[1] : !1;
579
579
  }
580
- const Ne = (s) => s == null || s === "" || s instanceof Array && s.length === 0 || s instanceof Object && Object.keys(s).length === 0, St = (s, t) => s === t || JSON.stringify(s) === JSON.stringify(t), Be = (s, t, e) => {
580
+ const Ne = (s) => s == null || s === "" || s instanceof Array && s.length === 0 || s instanceof Object && Object.keys(s).length === 0, wt = (s, t) => s === t || JSON.stringify(s) === JSON.stringify(t), Be = (s, t, e) => {
581
581
  const a = {}, l = {};
582
582
  for (const r in e.propertySet.propertyMap)
583
- if (e.propertySet.propertyMap[r].type === M.Object) {
583
+ if (e.propertySet.propertyMap[r].type === N.Object) {
584
584
  const i = Be(
585
585
  s[r],
586
586
  t[r],
@@ -588,7 +588,7 @@ const Ne = (s) => s == null || s === "" || s instanceof Array && s.length === 0
588
588
  );
589
589
  Object.keys(i[0]).length > 0 && Object.keys(i[1]).length > 0 && (a[r] = i[0], l[r] = i[1]);
590
590
  } else
591
- St(s[r], t[r]) || (a[r] = s[r], l[r] = t[r]);
591
+ wt(s[r], t[r]) || (a[r] = s[r], l[r] = t[r]);
592
592
  return [a, l];
593
593
  }, zo = (s) => s != null && s.constructor === Object;
594
594
  class yt {
@@ -652,7 +652,7 @@ class yt {
652
652
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
653
653
  getValue(t) {
654
654
  const e = this.propertySet.getProperty(t)?.rootAttribute;
655
- return e != null && (this.values[t] = this.getRootElementValue(e)), this.propertySet.getProperty(t).type === M.Object ? this.valueSets[t].getValues() : this.values[t];
655
+ return e != null && (this.values[t] = this.getRootElementValue(e)), this.propertySet.getProperty(t).type === N.Object ? this.valueSets[t].getValues() : this.values[t];
656
656
  }
657
657
  /**
658
658
  * Obtains all the values in the set.
@@ -662,7 +662,7 @@ class yt {
662
662
  getValues() {
663
663
  const t = {};
664
664
  for (const e in this.propertySet.propertyMap)
665
- this.propertySet.getProperty(e).type === M.Object ? t[e] = this.valueSets[e].getValues() : t[e] = this.getValue(e);
665
+ this.propertySet.getProperty(e).type === N.Object ? t[e] = this.valueSets[e].getValues() : t[e] = this.getValue(e);
666
666
  return t;
667
667
  }
668
668
  /**
@@ -673,7 +673,7 @@ class yt {
673
673
  getValuesForKeys(t) {
674
674
  const e = {};
675
675
  for (const a in t)
676
- this.propertySet.getProperty(a).type === M.Object ? e[a] = this.valueSets[a].getValuesForKeys(
676
+ this.propertySet.getProperty(a).type === N.Object ? e[a] = this.valueSets[a].getValuesForKeys(
677
677
  t[a]
678
678
  ) : e[a] = this.getValue(a);
679
679
  return e;
@@ -686,7 +686,7 @@ class yt {
686
686
  getTimestamps() {
687
687
  const t = {};
688
688
  for (const e in this.propertySet.propertyMap)
689
- if (this.propertySet.getProperty(e).type === M.Object)
689
+ if (this.propertySet.getProperty(e).type === N.Object)
690
690
  t[e] = this.valueSets[e].getTimestamps();
691
691
  else {
692
692
  const l = this.ownTimestamps[e];
@@ -712,7 +712,7 @@ class yt {
712
712
  */
713
713
  hasSetValue(t) {
714
714
  const e = this.getValue(t), a = this.propertySet.getProperty(t);
715
- return a && a.type === M.Object ? this.getSubValueSet(t).hasAnySetValue() : !Ne(e) && !St(e, a?.defaultValue);
715
+ return a && a.type === N.Object ? this.getSubValueSet(t).hasAnySetValue() : !Ne(e) && !wt(e, a?.defaultValue);
716
716
  }
717
717
  /**
718
718
  * Checks if any of the values in the set are not empty or the default value.
@@ -734,7 +734,7 @@ class yt {
734
734
  setValue(t, e) {
735
735
  const a = this.propertySet.getProperty(t);
736
736
  if (a) {
737
- a.type === M.Object ? this.valueSets[t].setValues(e) : (this.values[t] = e, St(e, a.defaultValue) || this.displayProperty(a));
737
+ a.type === N.Object ? this.valueSets[t].setValues(e) : (this.values[t] = e, wt(e, a.defaultValue) || this.displayProperty(a));
738
738
  const l = a.rootAttribute;
739
739
  l != null && this.setRootElementValue(l, e);
740
740
  }
@@ -747,7 +747,7 @@ class yt {
747
747
  setValues(t) {
748
748
  this.resetValues();
749
749
  for (const e in t)
750
- this.propertySet.getProperty(e).type === M.Object ? this.valueSets[e].setValues(
750
+ this.propertySet.getProperty(e).type === N.Object ? this.valueSets[e].setValues(
751
751
  t[e]
752
752
  ) : this.setValue(e, t[e]);
753
753
  }
@@ -759,7 +759,7 @@ class yt {
759
759
  setTimestamps(t) {
760
760
  this.ownTimestamps = {};
761
761
  for (const e in t)
762
- this.propertySet.getProperty(e).type === M.Object ? this.valueSets[e].setTimestamps(
762
+ this.propertySet.getProperty(e).type === N.Object ? this.valueSets[e].setTimestamps(
763
763
  t[e]
764
764
  ) : this.ownTimestamps[e] = t[e];
765
765
  }
@@ -770,7 +770,7 @@ class yt {
770
770
  */
771
771
  overwriteValues(t) {
772
772
  for (const e in t)
773
- this.propertySet.getProperty(e).type === M.Object ? this.valueSets[e].overwriteValues(
773
+ this.propertySet.getProperty(e).type === N.Object ? this.valueSets[e].overwriteValues(
774
774
  t[e]
775
775
  ) : this.setValue(e, t[e]);
776
776
  }
@@ -781,7 +781,7 @@ class yt {
781
781
  */
782
782
  overwriteValuesLww(t, e) {
783
783
  for (const a in t)
784
- this.propertySet.getProperty(a).type === M.Object ? this.valueSets[a].overwriteValuesLww(
784
+ this.propertySet.getProperty(a).type === N.Object ? this.valueSets[a].overwriteValuesLww(
785
785
  t[a],
786
786
  e
787
787
  ) : kt(e, this.ownTimestamps[a]) && (this.setValue(a, t[a]), this.ownTimestamps[a] = e);
@@ -795,7 +795,7 @@ class yt {
795
795
  this.displayedProperties = [], this.hiddenProperties = [], this.ownTimestamps = {};
796
796
  for (const t in this.propertySet.propertyMap) {
797
797
  const e = this.propertySet.getProperty(t), a = e.rootAttribute;
798
- e.type === M.Object ? this.valueSets[t] = this.constructSubValueSet(t) : this.values[t] = Nt(e.defaultValue), a != null && e.defaultValue !== void 0 && !St(
798
+ e.type === N.Object ? this.valueSets[t] = this.constructSubValueSet(t) : this.values[t] = Mt(e.defaultValue), a != null && e.defaultValue !== void 0 && !wt(
799
799
  this.getRootElementValue(a),
800
800
  e.defaultValue
801
801
  ) && this.setRootElementValue(a, this.values[t]), e.basic !== !1 ? this.displayedProperties.push(e) : this.hiddenProperties.push(e);
@@ -810,7 +810,7 @@ class yt {
810
810
  constructSubValueSet(t) {
811
811
  const e = this.propertySet.getProperty(t), a = new oe(e.properties), l = new yt(a, this.rootElement);
812
812
  return l.overwriteValues(
813
- Nt(e.defaultValue)
813
+ Mt(e.defaultValue)
814
814
  ), l;
815
815
  }
816
816
  /**
@@ -839,7 +839,7 @@ class yt {
839
839
  this.hiddenProperties.includes(t) || (this.hiddenProperties.push(t), B(this.displayedProperties, t));
840
840
  }
841
841
  }
842
- const et = {
842
+ const ot = {
843
843
  name: "",
844
844
  label: null,
845
845
  look: {
@@ -847,7 +847,7 @@ const et = {
847
847
  color: "#000000",
848
848
  thickness: 1,
849
849
  shape: De.Straight,
850
- style: Se.Solid,
850
+ style: Ce.Solid,
851
851
  selected: {
852
852
  color: "#AA00AA"
853
853
  },
@@ -864,20 +864,20 @@ const et = {
864
864
  class Xe {
865
865
  constructor(t) {
866
866
  const e = {
867
- ...et,
867
+ ...ot,
868
868
  ...t
869
869
  };
870
870
  this.id = e.id, this.name = e.name, this.label = e.label;
871
- const a = st(e.look);
871
+ const a = nt(e.look);
872
872
  if (this.defaultLook = a.defaultLook, this.selectedLook = a.selectedLook, this.highlightedLook = a.highlightedLook, this.selectedAndHighlightedLook = a.selectedAndHighlightedLook, e.startMarkerLook !== void 0) {
873
- const l = st(
873
+ const l = nt(
874
874
  e.startMarkerLook
875
875
  );
876
876
  this.defaultStartMarkerLook = l.defaultLook, this.selectedStartMarkerLook = l.selectedLook, this.highlightedStartMarkerLook = l.highlightedLook, this.selectedAndHighlightedStartMarkerLook = l.selectedAndHighlightedLook;
877
877
  } else
878
878
  this.defaultStartMarkerLook = null, this.selectedStartMarkerLook = null, this.highlightedStartMarkerLook = null, this.selectedAndHighlightedStartMarkerLook = null;
879
879
  if (e.endMarkerLook !== void 0) {
880
- const l = st(
880
+ const l = nt(
881
881
  e.endMarkerLook
882
882
  );
883
883
  this.defaultEndMarkerLook = l.defaultLook, this.selectedEndMarkerLook = l.selectedLook, this.highlightedEndMarkerLook = l.highlightedLook, this.selectedAndHighlightedEndMarkerLook = l.selectedAndHighlightedLook;
@@ -892,7 +892,7 @@ class Xe {
892
892
  return this.endTypes.indexOf(t) >= 0;
893
893
  }
894
894
  }
895
- class dt extends At {
895
+ class dt extends $t {
896
896
  constructor(t, e, a, l, r) {
897
897
  if (t.connections.get(r) !== void 0)
898
898
  throw new Error(`DiagramConnection with id "${r}" already exists`);
@@ -953,7 +953,7 @@ class dt extends At {
953
953
  */
954
954
  set lookConfig(t) {
955
955
  if (this._lookConfig = t, t) {
956
- const e = st(t);
956
+ const e = nt(t);
957
957
  this._defaultLook = {
958
958
  ...this._defaultLook,
959
959
  ...e.defaultLook
@@ -998,7 +998,7 @@ class dt extends At {
998
998
  */
999
999
  set startMarkerLookConfig(t) {
1000
1000
  if (this._startMarkerLookConfig = t, t) {
1001
- const e = st(
1001
+ const e = nt(
1002
1002
  t
1003
1003
  );
1004
1004
  this._defaultStartMarkerLook = {
@@ -1045,7 +1045,7 @@ class dt extends At {
1045
1045
  */
1046
1046
  set endMarkerLookConfig(t) {
1047
1047
  if (this._endMarkerLookConfig = t, t) {
1048
- const e = st(t);
1048
+ const e = nt(t);
1049
1049
  this._defaultEndMarkerLook = {
1050
1050
  ...this._defaultEndMarkerLook,
1051
1051
  ...e.defaultLook
@@ -1069,7 +1069,7 @@ class dt extends At {
1069
1069
  this.model.canvas?.updateConnectionsInView(this.id);
1070
1070
  }
1071
1071
  raise() {
1072
- this.select()?.raise();
1072
+ this.select()?.raise(), this.start?.raise(!1), this.end?.raise(!1);
1073
1073
  }
1074
1074
  /**
1075
1075
  * Set the start of this connection to the given port or reset this connection's starting port if `undefined`.
@@ -1095,70 +1095,70 @@ class dt extends At {
1095
1095
  * @public
1096
1096
  */
1097
1097
  tighten() {
1098
- const t = this.model.canvas?.allowConnectionLoops || !1, e = this.model.canvas?.allowSharingPorts !== !1, a = this.model.canvas?.allowSharingBothPorts || !1;
1098
+ const t = this.model.canvas?.allowConnectionLoops || !1, e = this.model.canvas?.allowSharingPorts !== !1, a = this.model.canvas?.allowSharingBothPorts || !1, l = this.model.canvas?.tightenConnectionsAcrossPortTypes || !1;
1099
1099
  if (this.start?.rootElement && this.end) {
1100
- const l = this.start.rootElement.ports.map((r) => [
1101
- r,
1102
- r.distanceTo(this.end.coords)
1103
- ]).sort((r, i) => r[1] - i[1]).map((r) => r[0]);
1104
- t: for (const r of l) {
1105
- if (!t && r === this.end || !r.allowsOutgoing || !e && (r.incomingConnections.filter(
1106
- (i) => !i.removed && i !== this
1107
- ).length > 0 || r.outgoingConnections.filter(
1108
- (i) => !i.removed && i !== this
1100
+ const r = this.start.rootElement.ports.map((i) => [
1101
+ i,
1102
+ i.distanceTo(this.end.coords)
1103
+ ]).sort((i, n) => i[1] - n[1]).map((i) => i[0]);
1104
+ t: for (const i of r) {
1105
+ if (!t && i === this.end || !i.allowsOutgoing || !l && i.type !== this.start.type || !e && (i.incomingConnections.filter(
1106
+ (n) => !n.removed && n !== this
1107
+ ).length > 0 || i.outgoingConnections.filter(
1108
+ (n) => !n.removed && n !== this
1109
1109
  ).length > 0))
1110
1110
  continue t;
1111
1111
  if (!a) {
1112
- for (const i of r.outgoingConnections.filter(
1113
- (n) => !n.removed
1112
+ for (const n of i.outgoingConnections.filter(
1113
+ (o) => !o.removed
1114
1114
  ))
1115
- if (i !== this && i.end === this.end)
1115
+ if (n !== this && n.end === this.end)
1116
1116
  continue t;
1117
- for (const i of r.incomingConnections.filter(
1118
- (n) => !n.removed
1117
+ for (const n of i.incomingConnections.filter(
1118
+ (o) => !o.removed
1119
1119
  ))
1120
- if (i !== this && i.start === this.end)
1120
+ if (n !== this && n.start === this.end)
1121
1121
  continue t;
1122
1122
  }
1123
- if (r === this.start)
1123
+ if (i === this.start)
1124
1124
  break t;
1125
- this.setStart(r);
1125
+ this.setStart(i);
1126
1126
  break t;
1127
1127
  }
1128
1128
  }
1129
1129
  if (this.end?.rootElement && this.start) {
1130
- const l = this.end.rootElement.ports.map((r) => [
1131
- r,
1132
- r.distanceTo(this.start.coords)
1133
- ]).sort((r, i) => r[1] - i[1]).map((r) => r[0]);
1134
- t: for (const r of l) {
1135
- if (!t && r === this.start || !r.allowsIncoming || !e && (r.incomingConnections.filter(
1136
- (i) => !i.removed && i !== this
1137
- ).length > 0 || r.outgoingConnections.filter(
1138
- (i) => !i.removed && i !== this
1130
+ const r = this.end.rootElement.ports.map((i) => [
1131
+ i,
1132
+ i.distanceTo(this.start.coords)
1133
+ ]).sort((i, n) => i[1] - n[1]).map((i) => i[0]);
1134
+ t: for (const i of r) {
1135
+ if (!t && i === this.start || !i.allowsIncoming || !l && i.type !== this.end.type || !e && (i.incomingConnections.filter(
1136
+ (n) => !n.removed && n !== this
1137
+ ).length > 0 || i.outgoingConnections.filter(
1138
+ (n) => !n.removed && n !== this
1139
1139
  ).length > 0))
1140
1140
  continue t;
1141
1141
  if (!a) {
1142
- for (const i of r.incomingConnections.filter(
1143
- (n) => !n.removed
1142
+ for (const n of i.incomingConnections.filter(
1143
+ (o) => !o.removed
1144
1144
  ))
1145
- if (i !== this && i.start === this.start)
1145
+ if (n !== this && n.start === this.start)
1146
1146
  continue t;
1147
- for (const i of r.outgoingConnections.filter(
1148
- (n) => !n.removed
1147
+ for (const n of i.outgoingConnections.filter(
1148
+ (o) => !o.removed
1149
1149
  ))
1150
- if (i !== this && i.end === this.start)
1150
+ if (n !== this && n.end === this.start)
1151
1151
  continue t;
1152
1152
  }
1153
- if (r === this.end)
1153
+ if (i === this.end)
1154
1154
  break t;
1155
- this.setEnd(r);
1155
+ this.setEnd(i);
1156
1156
  break t;
1157
1157
  }
1158
1158
  }
1159
1159
  }
1160
1160
  getPriority() {
1161
- return this.start ? this.end ? Math.min(this.start.getPriority(), this.end.getPriority()) : this.start.getPriority() : this.end ? this.end.getPriority() : Pt;
1161
+ return this.start ? this.end ? Math.min(this.start.getPriority(), this.end.getPriority()) : this.start.getPriority() : this.end ? this.end.getPriority() : Nt;
1162
1162
  }
1163
1163
  }
1164
1164
  class Ro extends ft {
@@ -1197,7 +1197,7 @@ class Ro extends ft {
1197
1197
  a,
1198
1198
  l
1199
1199
  );
1200
- return super.add(i), i.updateInView(), i.valueSet.resetValues(), i;
1200
+ return super.add(i), i.updateInView(), i.valueSet.resetValues(), i.start?.raise(!1), i.end?.raise(!1), i;
1201
1201
  }
1202
1202
  remove(t) {
1203
1203
  const e = this.get(t, !0);
@@ -1213,18 +1213,18 @@ const V = {
1213
1213
  color: "#000000",
1214
1214
  selectedColor: "#000000",
1215
1215
  backgroundColor: "#00000000",
1216
- horizontalAlign: Lt.Center,
1216
+ horizontalAlign: xt.Center,
1217
1217
  verticalAlign: Jt.Center,
1218
1218
  orientation: g.Top,
1219
1219
  fit: !1,
1220
1220
  shrink: !0
1221
1221
  };
1222
- class ht extends At {
1222
+ class ht extends $t {
1223
1223
  constructor(t, e, a, l, r, i, n, o, d, c, h, f, b, m, p, u) {
1224
- const y = `${e?.id}_field`;
1225
- if (t.fields.get(y) !== void 0)
1224
+ const v = `${e?.id}_field`;
1225
+ if (t.fields.get(v) !== void 0)
1226
1226
  throw new Error("DiagramField for rootElement already exists");
1227
- if (super(t, y), this.textTimestamp = null, this.rootElement = e, this.coords = a, this.width = l, this.height = r, this.fontSize = i, this.fontFamily = n, this.color = o, this.selectedColor = d, this.horizontalAlign = c, this.verticalAlign = h, !isNaN(Number(f)))
1227
+ if (super(t, v), this.textTimestamp = null, this.rootElement = e, this.coords = a, this.width = l, this.height = r, this.fontSize = i, this.fontFamily = n, this.color = o, this.selectedColor = d, this.horizontalAlign = c, this.verticalAlign = h, !isNaN(Number(f)))
1228
1228
  this.orientation = Number(f);
1229
1229
  else
1230
1230
  switch (f) {
@@ -1273,7 +1273,7 @@ class ht extends At {
1273
1273
  this.coords = t, this.updateInView();
1274
1274
  }
1275
1275
  getPriority() {
1276
- return this.rootElement?.getPriority() || Pt;
1276
+ return this.rootElement?.getPriority() || Nt;
1277
1277
  }
1278
1278
  }
1279
1279
  class Vo extends ft {
@@ -1314,7 +1314,7 @@ class Vo extends ft {
1314
1314
  e && (e.rootElement?.label !== void 0 && e.rootElement.label === e && (e.rootElement.label = void 0), super.remove(t), e.updateInView());
1315
1315
  }
1316
1316
  }
1317
- const K = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : s.margin.length === 1 || s.margin.length === 2 ? s.margin[0] : (s.margin.length === 3, s.margin[2]), Y = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : s.margin.length === 1 ? s.margin[0] : s.margin.length === 2 || s.margin.length === 3 ? s.margin[1] : s.margin[3], ot = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : s.margin.length === 1 ? s.margin[0] : (s.margin.length === 2 || s.margin.length === 3, s.margin[1]), U = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : (s.margin.length === 1 || s.margin.length === 2 || s.margin.length === 3, s.margin[0]), Vt = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : s.padding.length === 1 || s.padding.length === 2 ? s.padding[0] : (s.padding.length === 3, s.padding[2]), Ot = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : s.padding.length === 1 ? s.padding[0] : s.padding.length === 2 || s.padding.length === 3 ? s.padding[1] : s.padding[3], Ht = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : s.padding.length === 1 ? s.padding[0] : (s.padding.length === 2 || s.padding.length === 3, s.padding[1]), _t = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : (s.padding.length === 1 || s.padding.length === 2 || s.padding.length === 3, s.padding[0]);
1317
+ const q = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : s.margin.length === 1 || s.margin.length === 2 ? s.margin[0] : (s.margin.length === 3, s.margin[2]), Y = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : s.margin.length === 1 ? s.margin[0] : s.margin.length === 2 || s.margin.length === 3 ? s.margin[1] : s.margin[3], it = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : s.margin.length === 1 ? s.margin[0] : (s.margin.length === 2 || s.margin.length === 3, s.margin[1]), U = (s) => s?.margin === null || s?.margin === void 0 ? V.margin : typeof s.margin == "number" ? s.margin : s.margin.length === 0 ? V.margin : (s.margin.length === 1 || s.margin.length === 2 || s.margin.length === 3, s.margin[0]), Vt = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : s.padding.length === 1 || s.padding.length === 2 ? s.padding[0] : (s.padding.length === 3, s.padding[2]), Ot = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : s.padding.length === 1 ? s.padding[0] : s.padding.length === 2 || s.padding.length === 3 ? s.padding[1] : s.padding[3], Ht = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : s.padding.length === 1 ? s.padding[0] : (s.padding.length === 2 || s.padding.length === 3, s.padding[1]), _t = (s) => s?.padding === null || s?.padding === void 0 ? V.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? V.padding : (s.padding.length === 1 || s.padding.length === 2 || s.padding.length === 3, s.padding[0]);
1318
1318
  var Gt = /* @__PURE__ */ ((s) => (s[s.OnlyWhenSelected = 0] = "OnlyWhenSelected", s))(Gt || {});
1319
1319
  const Pe = 1, ze = 1, Oo = 1, Ho = 1;
1320
1320
  class _o {
@@ -1330,12 +1330,12 @@ class _o {
1330
1330
  }
1331
1331
  class Go {
1332
1332
  constructor(t) {
1333
- this.label = t.label || null, this.ports = t.ports || [], this.priority = t.priority || Pt, this.resizableX = t.resizableX, this.resizableY = t.resizableY;
1334
- const e = st(t.look || je);
1333
+ this.label = t.label || null, this.ports = t.ports || [], this.priority = t.priority || Nt, this.resizableX = t.resizableX, this.resizableY = t.resizableY;
1334
+ const e = nt(t.look || je);
1335
1335
  this.defaultLook = e.defaultLook, this.selectedLook = e.selectedLook, this.highlightedLook = e.highlightedLook, this.selectedAndHighlightedLook = e.selectedAndHighlightedLook;
1336
1336
  }
1337
1337
  }
1338
- class F extends At {
1338
+ class F extends $t {
1339
1339
  constructor(t, e, a, l, r, i, n, o) {
1340
1340
  if (t.sections.get(o) !== void 0)
1341
1341
  throw new Error(`DiagramSection with id "${o}" already exists`);
@@ -1381,7 +1381,7 @@ class F extends At {
1381
1381
  */
1382
1382
  set lookConfig(t) {
1383
1383
  if (this._lookConfig = t, t) {
1384
- const e = st(t);
1384
+ const e = nt(t);
1385
1385
  this._defaultLook = {
1386
1386
  ...this._defaultLook,
1387
1387
  ...e.defaultLook
@@ -1421,7 +1421,7 @@ class F extends At {
1421
1421
  return this.node?.type?.sectionGrid?.minHeights?.[this.indexYInNode] || Ho;
1422
1422
  }
1423
1423
  getPriority() {
1424
- return this.node?.type?.sectionGrid?.sections?.[this.indexYInNode]?.[this.indexXInNode]?.priority || Pt;
1424
+ return this.node?.type?.sectionGrid?.sections?.[this.indexYInNode]?.[this.indexXInNode]?.priority || Nt;
1425
1425
  }
1426
1426
  /**
1427
1427
  * Returns whether this section can be resized horizontally.
@@ -1575,7 +1575,7 @@ class F extends At {
1575
1575
  this.label && (this.label.coords = [
1576
1576
  this.coords[0] + Y(i?.label),
1577
1577
  this.coords[1] + U(i?.label)
1578
- ], this.label.width = this.width - Y(i?.label) - ot(i?.label), this.label.height = this.height - U(i?.label) - K(i?.label), this.label.updateInView());
1578
+ ], this.label.width = this.width - Y(i?.label) - it(i?.label), this.label.height = this.height - U(i?.label) - q(i?.label), this.label.updateInView());
1579
1579
  for (const n of this.decorators)
1580
1580
  n.move(
1581
1581
  Qt(
@@ -1639,28 +1639,28 @@ class Fo extends ft {
1639
1639
  ...V,
1640
1640
  ...b.type?.label
1641
1641
  }, p = 6 * m.fontSize + Ot(m) + Ht(m), u = m.fontSize + _t(m) + Vt(m);
1642
- let y;
1642
+ let v;
1643
1643
  switch (b.direction) {
1644
1644
  case g.Bottom:
1645
1645
  case g.Left:
1646
1646
  case g.Right:
1647
- y = [
1647
+ v = [
1648
1648
  b.coords[0] - p / 2,
1649
- b.coords[1] - u - K(m)
1649
+ b.coords[1] - u - q(m)
1650
1650
  ];
1651
1651
  break;
1652
1652
  case g.Top:
1653
- y = [
1653
+ v = [
1654
1654
  b.coords[0] - p / 2,
1655
1655
  b.coords[1] + U(m)
1656
1656
  ];
1657
1657
  break;
1658
1658
  default:
1659
- y = b.coords;
1659
+ v = b.coords;
1660
1660
  }
1661
1661
  this.model.fields.new(
1662
1662
  b,
1663
- y,
1663
+ v,
1664
1664
  m.fontSize,
1665
1665
  m.fontFamily,
1666
1666
  m.color,
@@ -1693,8 +1693,8 @@ class Fo extends ft {
1693
1693
  h.fontFamily,
1694
1694
  h.color,
1695
1695
  h.selectedColor,
1696
- o.width - Y(h) - ot(h),
1697
- o.height - U(h) - K(h),
1696
+ o.width - Y(h) - it(h),
1697
+ o.height - U(h) - q(h),
1698
1698
  h.horizontalAlign,
1699
1699
  h.verticalAlign,
1700
1700
  h.orientation,
@@ -1717,7 +1717,7 @@ class Fo extends ft {
1717
1717
  }
1718
1718
  const je = {
1719
1719
  lookType: "shaped-look",
1720
- shape: Mt.Rectangle,
1720
+ shape: Tt.Rectangle,
1721
1721
  fillColor: "#FFFFFF",
1722
1722
  borderColor: "#000000",
1723
1723
  borderThickness: 1,
@@ -1746,7 +1746,7 @@ const je = {
1746
1746
  isUnique: !1,
1747
1747
  canBeParentless: !0,
1748
1748
  childrenTypes: [],
1749
- priority: Pt,
1749
+ priority: Nt,
1750
1750
  properties: []
1751
1751
  };
1752
1752
  class We {
@@ -1756,11 +1756,11 @@ class We {
1756
1756
  ...t
1757
1757
  };
1758
1758
  this.id = e.id, this.name = e.name, this.defaultWidth = e.defaultWidth, this.defaultHeight = e.defaultHeight, this.minWidth = e.minWidth, this.minHeight = e.minHeight, this.resizableX = e.resizableX, this.resizableY = e.resizableY, this.snapToGridOffset = e.snapToGridOffset, this.bottomPadding = Do(e), this.leftPadding = Yo(e), this.rightPadding = Bo(e), this.topPadding = Xo(e), this.label = e.label, this.ports = e.ports, this.decorators = e.decorators, this.sectionGrid = e.sectionGrid ? new _o(e.sectionGrid) : null;
1759
- const a = st(e.look);
1759
+ const a = nt(e.look);
1760
1760
  this.defaultLook = a.defaultLook, this.selectedLook = a.selectedLook, this.highlightedLook = a.highlightedLook, this.selectedAndHighlightedLook = a.selectedAndHighlightedLook, this.isUnique = e.isUnique, this.canBeParentless = e.canBeParentless, this.childrenTypes = e.childrenTypes, this.priority = e.priority, this.propertySet = new oe(t?.properties || []);
1761
1761
  }
1762
1762
  }
1763
- class z extends At {
1763
+ class z extends $t {
1764
1764
  constructor(t, e, a = [0, 0], l) {
1765
1765
  if (t.nodes.get(l) !== void 0)
1766
1766
  throw new Error(`DiagramNode with id "${l}" already exists`);
@@ -1821,7 +1821,7 @@ class z extends At {
1821
1821
  */
1822
1822
  set lookConfig(t) {
1823
1823
  if (this._lookConfig = t, t) {
1824
- const e = st(t);
1824
+ const e = nt(t);
1825
1825
  this._defaultLook = {
1826
1826
  ...this._defaultLook,
1827
1827
  ...e.defaultLook
@@ -2212,7 +2212,7 @@ class z extends At {
2212
2212
  this.label && (this.label.coords = [
2213
2213
  this.coords[0] + Y(this.type.label),
2214
2214
  this.coords[1] + U(this.type.label)
2215
- ], this.label.width = this.width - Y(this.type.label) - ot(this.type.label), this.label.height = this.height - U(this.type.label) - K(this.type.label), this.label.updateInView());
2215
+ ], this.label.width = this.width - Y(this.type.label) - it(this.type.label), this.label.height = this.height - U(this.type.label) - q(this.type.label), this.label.updateInView());
2216
2216
  for (const i of this.decorators)
2217
2217
  i.move(
2218
2218
  Qt(
@@ -2404,7 +2404,7 @@ class Uo extends ft {
2404
2404
  case g.Right:
2405
2405
  b = [
2406
2406
  d.coords[0] - h / 2,
2407
- d.coords[1] - f - K(c)
2407
+ d.coords[1] - f - q(c)
2408
2408
  ];
2409
2409
  break;
2410
2410
  case g.Top:
@@ -2450,8 +2450,8 @@ class Uo extends ft {
2450
2450
  i.fontFamily,
2451
2451
  i.color,
2452
2452
  i.selectedColor,
2453
- r.width - Y(i) - ot(i),
2454
- r.height - U(i) - K(i),
2453
+ r.width - Y(i) - it(i),
2454
+ r.height - U(i) - q(i),
2455
2455
  i.horizontalAlign,
2456
2456
  i.verticalAlign,
2457
2457
  i.orientation,
@@ -2516,7 +2516,7 @@ const Ze = (s) => {
2516
2516
  return s;
2517
2517
  }, Do = (s) => s?.padding === null || s?.padding === void 0 ? gt.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? gt.padding : s.padding.length === 1 || s.padding.length === 2 ? s.padding[0] : (s.padding.length === 3, s.padding[2]), Yo = (s) => s?.padding === null || s?.padding === void 0 ? gt.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? gt.padding : s.padding.length === 1 ? s.padding[0] : s.padding.length === 2 || s.padding.length === 3 ? s.padding[1] : s.padding[3], Bo = (s) => s?.padding === null || s?.padding === void 0 ? gt.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? gt.padding : s.padding.length === 1 ? s.padding[0] : (s.padding.length === 2 || s.padding.length === 3, s.padding[1]), Xo = (s) => s?.padding === null || s?.padding === void 0 ? gt.padding : typeof s.padding == "number" ? s.padding : s.padding.length === 0 ? gt.padding : (s.padding.length === 1 || s.padding.length === 2 || s.padding.length === 3, s.padding[0]), Ke = {
2518
2518
  lookType: "shaped-look",
2519
- shape: Mt.Ellipse,
2519
+ shape: Tt.Ellipse,
2520
2520
  fillColor: "transparent",
2521
2521
  borderColor: "transparent",
2522
2522
  borderThickness: 0,
@@ -2526,7 +2526,7 @@ const Ze = (s) => {
2526
2526
  highlighted: {
2527
2527
  fillColor: "rgba(0, 255, 255, 0.5)"
2528
2528
  }
2529
- }, Zt = st(Ke), qe = {
2529
+ }, Zt = nt(Ke), qe = {
2530
2530
  name: "",
2531
2531
  label: null,
2532
2532
  allowsOutgoing: !0,
@@ -2541,11 +2541,11 @@ class jo {
2541
2541
  ...t
2542
2542
  };
2543
2543
  this.id = e.id, this.name = e.name, this.label = e.label, this.allowsOutgoing = e.allowsOutgoing, this.allowsIncoming = e.allowsIncoming, this.width = e.width;
2544
- const a = st(e.look);
2544
+ const a = nt(e.look);
2545
2545
  this.defaultLook = a.defaultLook, this.selectedLook = a.selectedLook, this.highlightedLook = a.highlightedLook, this.selectedAndHighlightedLook = a.selectedAndHighlightedLook;
2546
2546
  }
2547
2547
  }
2548
- class bt extends At {
2548
+ class bt extends $t {
2549
2549
  constructor(t, e, a, l, r, i, n, o = "floating", d = "floating") {
2550
2550
  if (t.ports.get(n) !== void 0)
2551
2551
  throw new Error(`DiagramPort with id "${n}" already exists`);
@@ -2621,7 +2621,7 @@ class bt extends At {
2621
2621
  */
2622
2622
  set lookConfig(t) {
2623
2623
  if (this._lookConfig = t, t) {
2624
- const e = st(
2624
+ const e = nt(
2625
2625
  t
2626
2626
  );
2627
2627
  this._defaultLook = {
@@ -2660,12 +2660,13 @@ class bt extends At {
2660
2660
  updateInView() {
2661
2661
  this.model.canvas?.updatePortsInView(this.id);
2662
2662
  }
2663
- raise() {
2664
- this.select()?.raise(), this.label && this.label.raise();
2665
- for (const t of this.incomingConnections)
2666
- t.raise();
2667
- for (const t of this.outgoingConnections)
2668
- t.raise();
2663
+ raise(t = !0) {
2664
+ if (this.select()?.raise(), this.label && this.label.raise(), t) {
2665
+ for (const e of this.incomingConnections)
2666
+ e.raise();
2667
+ for (const e of this.outgoingConnections)
2668
+ e.raise();
2669
+ }
2669
2670
  }
2670
2671
  /**
2671
2672
  * Add a connection to this port's list of outgoing connections.
@@ -2695,7 +2696,7 @@ class bt extends At {
2695
2696
  return this.rootElement.node;
2696
2697
  }
2697
2698
  getPriority() {
2698
- return this.rootElement?.getPriority() || Pt;
2699
+ return this.rootElement?.getPriority() || Nt;
2699
2700
  }
2700
2701
  /**
2701
2702
  * Change the coordinates of this port to the given coordinates and move its labels correspondingly.
@@ -2799,8 +2800,8 @@ class Je {
2799
2800
  l.coords[0] + Y(i),
2800
2801
  l.coords[1] + U(i)
2801
2802
  ],
2802
- l.width - Y(i) - ot(i),
2803
- l.height - U(i) - K(i),
2803
+ l.width - Y(i) - it(i),
2804
+ l.height - U(i) - q(i),
2804
2805
  i.fontSize,
2805
2806
  i.fontFamily,
2806
2807
  i.color,
@@ -2842,8 +2843,8 @@ class Je {
2842
2843
  n.coords[0] + Y(d),
2843
2844
  n.coords[1] + U(d)
2844
2845
  ],
2845
- n.width - Y(d) - ot(d),
2846
- n.height - U(d) - K(d),
2846
+ n.width - Y(d) - it(d),
2847
+ n.height - U(d) - q(d),
2847
2848
  d.fontSize,
2848
2849
  d.fontFamily,
2849
2850
  d.color,
@@ -3022,7 +3023,7 @@ class ie {
3022
3023
  do() {
3023
3024
  const t = this.canvas.model.nodes.new(this.typeId, this.coords, this.id);
3024
3025
  this.parentId !== void 0 && this.canvas.model.nodes.get(this.parentId)?.addChild(t), t.label && (t.label.text = this.label || ""), this.values !== void 0 ? t.valueSet.setValues(
3025
- Nt({
3026
+ Mt({
3026
3027
  ...t.valueSet.getValues(),
3027
3028
  ...this.values
3028
3029
  })
@@ -3051,7 +3052,7 @@ class ie {
3051
3052
  );
3052
3053
  }
3053
3054
  }
3054
- class Ce {
3055
+ class $e {
3055
3056
  constructor(t, e, a, l, r, i, n) {
3056
3057
  this.canvas = t, this.nodeId = e, this.copyColumnIndex = a, this.copyRowIndex = l, this.removeColumnIndex = r, this.removeRowIndex = i, this.timestamp = n;
3057
3058
  }
@@ -3071,7 +3072,7 @@ class Ce {
3071
3072
  };
3072
3073
  }
3073
3074
  static deserialize(t, e) {
3074
- return new Ce(
3075
+ return new $e(
3075
3076
  t,
3076
3077
  e.nodeId,
3077
3078
  e.copyColumnIndex,
@@ -3082,7 +3083,7 @@ class Ce {
3082
3083
  );
3083
3084
  }
3084
3085
  }
3085
- class $e {
3086
+ class Ae {
3086
3087
  constructor(t, e, a) {
3087
3088
  this.canvas = t, this.to = e, this.timestamp = a;
3088
3089
  }
@@ -3103,7 +3104,7 @@ class $e {
3103
3104
  };
3104
3105
  }
3105
3106
  static deserialize(t, e) {
3106
- return new $e(
3107
+ return new Ae(
3107
3108
  t,
3108
3109
  e.to,
3109
3110
  e.timestamp
@@ -3140,7 +3141,7 @@ class Ft {
3140
3141
  );
3141
3142
  }
3142
3143
  }
3143
- class it {
3144
+ class st {
3144
3145
  constructor(t, e, a, l) {
3145
3146
  this.canvas = t, this.nodeId = e, this.to = a, this.timestamp = l;
3146
3147
  }
@@ -3165,7 +3166,7 @@ class it {
3165
3166
  };
3166
3167
  }
3167
3168
  static deserialize(t, e) {
3168
- return new it(
3169
+ return new st(
3169
3170
  t,
3170
3171
  e.nodeId,
3171
3172
  e.to,
@@ -3227,7 +3228,7 @@ class se {
3227
3228
  );
3228
3229
  }
3229
3230
  }
3230
- class Et {
3231
+ class Lt {
3231
3232
  constructor(t, e, a, l) {
3232
3233
  this.canvas = t, this.fieldId = e, this.to = a, this.timestamp = l;
3233
3234
  }
@@ -3244,7 +3245,7 @@ class Et {
3244
3245
  };
3245
3246
  }
3246
3247
  static deserialize(t, e) {
3247
- return new Et(
3248
+ return new Lt(
3248
3249
  t,
3249
3250
  e.fieldId,
3250
3251
  e.to,
@@ -3252,7 +3253,7 @@ class Et {
3252
3253
  );
3253
3254
  }
3254
3255
  }
3255
- class Tt {
3256
+ class Et {
3256
3257
  constructor(t, e, a, l) {
3257
3258
  this.canvas = t, this.id = e, this.to = a, this.timestamp = l;
3258
3259
  }
@@ -3271,7 +3272,7 @@ class Tt {
3271
3272
  };
3272
3273
  }
3273
3274
  static deserialize(t, e) {
3274
- return new Tt(
3275
+ return new Et(
3275
3276
  t,
3276
3277
  e.id,
3277
3278
  e.to,
@@ -3399,11 +3400,11 @@ class Zo {
3399
3400
  break;
3400
3401
  }
3401
3402
  case "addSection": {
3402
- Ce.deserialize(this.canvas, t).do();
3403
+ $e.deserialize(this.canvas, t).do();
3403
3404
  break;
3404
3405
  }
3405
3406
  case "applyLayout": {
3406
- $e.deserialize(
3407
+ Ae.deserialize(
3407
3408
  this.canvas,
3408
3409
  t
3409
3410
  ).do();
@@ -3414,7 +3415,7 @@ class Zo {
3414
3415
  break;
3415
3416
  }
3416
3417
  case "setGeometry": {
3417
- it.deserialize(
3418
+ st.deserialize(
3418
3419
  this.canvas,
3419
3420
  t
3420
3421
  ).do();
@@ -3432,11 +3433,11 @@ class Zo {
3432
3433
  break;
3433
3434
  }
3434
3435
  case "editField": {
3435
- Et.deserialize(this.canvas, t).do();
3436
+ Lt.deserialize(this.canvas, t).do();
3436
3437
  break;
3437
3438
  }
3438
3439
  case "updateValues": {
3439
- Tt.deserialize(
3440
+ Et.deserialize(
3440
3441
  this.canvas,
3441
3442
  t
3442
3443
  ).do();
@@ -3513,7 +3514,7 @@ class Ko {
3513
3514
  });
3514
3515
  }
3515
3516
  }
3516
- var w = /* @__PURE__ */ ((s) => (s.AddConnection = "add-connection", s.AddNode = "add-node", s.AddSectionAction = "add-section", s.ApplyLayout = "apply-layout", s.Clipboard = "clipboard", s.ContextMenu = "context-menu", s.EditField = "edit-field", s.MoveNode = "move-node", s.Paste = "paste", s.Remove = "remove", s.StretchNode = "stretch-node", s.StretchSection = "stretch-section", s.UpdateValues = "update-values", s.Zoom = "zoom", s))(w || {});
3517
+ var k = /* @__PURE__ */ ((s) => (s.AddConnection = "add-connection", s.AddNode = "add-node", s.AddSectionAction = "add-section", s.ApplyLayout = "apply-layout", s.Clipboard = "clipboard", s.ContextMenu = "context-menu", s.EditField = "edit-field", s.MoveNode = "move-node", s.Paste = "paste", s.Remove = "remove", s.StretchNode = "stretch-node", s.StretchSection = "stretch-section", s.UpdateValues = "update-values", s.Zoom = "zoom", s))(k || {});
3517
3518
  class qo {
3518
3519
  constructor(t, e, a, l, r, i, n, o, d) {
3519
3520
  this.canvas = t, this.type = e, this.coords = a, this.parentId = l, this.ancestorId = r, this.fromAncestorGeometry = i, this.toAncestorGeometry = n, this.label = o, this.values = d, this.id = this.canvas.collabEngine.freshId();
@@ -3529,7 +3530,7 @@ class qo {
3529
3530
  this.values
3530
3531
  );
3531
3532
  if (this.canvas.collabEngine.doCollaboratively(t), this.ancestorId !== void 0 && this.toAncestorGeometry !== void 0) {
3532
- const e = new it(
3533
+ const e = new st(
3533
3534
  this.canvas,
3534
3535
  this.ancestorId,
3535
3536
  this.toAncestorGeometry,
@@ -3551,7 +3552,7 @@ class qo {
3551
3552
  this.canvas.collabEngine.freshTimestamp()
3552
3553
  );
3553
3554
  if (this.canvas.collabEngine.doCollaboratively(e), this.ancestorId !== void 0 && this.fromAncestorGeometry !== void 0) {
3554
- const a = new it(
3555
+ const a = new st(
3555
3556
  this.canvas,
3556
3557
  this.ancestorId,
3557
3558
  this.fromAncestorGeometry,
@@ -3573,7 +3574,7 @@ class qo {
3573
3574
  this.canvas.collabEngine.freshTimestamp()
3574
3575
  );
3575
3576
  if (this.canvas.collabEngine.doCollaboratively(e), this.ancestorId !== void 0 && this.toAncestorGeometry !== void 0) {
3576
- const a = new it(
3577
+ const a = new st(
3577
3578
  this.canvas,
3578
3579
  this.ancestorId,
3579
3580
  this.toAncestorGeometry,
@@ -3584,7 +3585,7 @@ class qo {
3584
3585
  return t === void 0;
3585
3586
  }
3586
3587
  }
3587
- class le {
3588
+ class de {
3588
3589
  constructor(t, e, a) {
3589
3590
  this.canvas = t, this.nodeIds = e, this.delta = a;
3590
3591
  }
@@ -3617,14 +3618,14 @@ class X {
3617
3618
  do() {
3618
3619
  const t = this.canvas.model.nodes.get(this.nodeId);
3619
3620
  if (t) {
3620
- const e = new it(
3621
+ const e = new st(
3621
3622
  this.canvas,
3622
3623
  this.nodeId,
3623
3624
  this.to,
3624
3625
  this.canvas.collabEngine.freshTimestamp()
3625
3626
  );
3626
3627
  if (this.canvas.collabEngine.doCollaboratively(e), this.ancestorId !== void 0 && this.toAncestorGeometry !== void 0) {
3627
- const a = new it(
3628
+ const a = new st(
3628
3629
  this.canvas,
3629
3630
  this.ancestorId,
3630
3631
  this.toAncestorGeometry,
@@ -3639,14 +3640,14 @@ class X {
3639
3640
  const t = this.canvas.model.nodes.get(this.nodeId);
3640
3641
  if (t) {
3641
3642
  this.to = t.getGeometry();
3642
- const e = new it(
3643
+ const e = new st(
3643
3644
  this.canvas,
3644
3645
  this.nodeId,
3645
3646
  this.from,
3646
3647
  this.canvas.collabEngine.freshTimestamp()
3647
3648
  );
3648
3649
  if (this.canvas.collabEngine.doCollaboratively(e), this.ancestorId !== void 0 && this.fromAncestorGeometry !== void 0) {
3649
- const a = new it(
3650
+ const a = new st(
3650
3651
  this.canvas,
3651
3652
  this.ancestorId,
3652
3653
  this.fromAncestorGeometry,
@@ -3661,7 +3662,7 @@ class X {
3661
3662
  const t = this.canvas.model.nodes.get(this.nodeId);
3662
3663
  if (t) {
3663
3664
  this.from = t.getGeometry();
3664
- const e = new it(
3665
+ const e = new st(
3665
3666
  this.canvas,
3666
3667
  this.nodeId,
3667
3668
  this.to,
@@ -3685,7 +3686,7 @@ class Jo {
3685
3686
  this.canvas.collabEngine.freshTimestamp()
3686
3687
  );
3687
3688
  if (this.canvas.collabEngine.doCollaboratively(e), this.ancestorId !== void 0 && this.toAncestorGeometry !== void 0) {
3688
- const a = new it(
3689
+ const a = new st(
3689
3690
  this.canvas,
3690
3691
  this.ancestorId,
3691
3692
  this.toAncestorGeometry,
@@ -3704,7 +3705,7 @@ class Jo {
3704
3705
  this.canvas.collabEngine.freshTimestamp()
3705
3706
  );
3706
3707
  if (this.canvas.collabEngine.doCollaboratively(e), this.ancestorId !== void 0 && this.fromAncestorGeometry !== void 0) {
3707
- const a = new it(
3708
+ const a = new st(
3708
3709
  this.canvas,
3709
3710
  this.ancestorId,
3710
3711
  this.fromAncestorGeometry,
@@ -3718,7 +3719,7 @@ class Jo {
3718
3719
  return this.do();
3719
3720
  }
3720
3721
  }
3721
- class de {
3722
+ class ce {
3722
3723
  constructor(t, e, a, l) {
3723
3724
  this.canvas = t, this.type = e, this.startId = a, this.endId = l, this.id = this.canvas.collabEngine.freshId();
3724
3725
  }
@@ -3764,7 +3765,7 @@ class Re {
3764
3765
  this.canvas = t, this.fieldId = e, this.from = a, this.to = l;
3765
3766
  }
3766
3767
  do() {
3767
- const t = this.canvas.model.fields.get(this.fieldId), e = new Et(
3768
+ const t = this.canvas.model.fields.get(this.fieldId), e = new Lt(
3768
3769
  this.canvas,
3769
3770
  this.fieldId,
3770
3771
  this.to,
@@ -3776,7 +3777,7 @@ class Re {
3776
3777
  const t = this.canvas.model.fields.get(this.fieldId);
3777
3778
  if (t) {
3778
3779
  this.to = t.text;
3779
- const e = new Et(
3780
+ const e = new Lt(
3780
3781
  this.canvas,
3781
3782
  this.fieldId,
3782
3783
  this.from,
@@ -3790,7 +3791,7 @@ class Re {
3790
3791
  const t = this.canvas.model.fields.get(this.fieldId);
3791
3792
  if (t) {
3792
3793
  this.from = t.text;
3793
- const e = new Et(
3794
+ const e = new Lt(
3794
3795
  this.canvas,
3795
3796
  this.fieldId,
3796
3797
  this.to,
@@ -3806,7 +3807,7 @@ class Qo {
3806
3807
  this.canvas = t, this.id = e, this.from = a, this.to = l;
3807
3808
  }
3808
3809
  do() {
3809
- const t = new Tt(
3810
+ const t = new Et(
3810
3811
  this.canvas,
3811
3812
  this.id,
3812
3813
  this.to,
@@ -3815,7 +3816,7 @@ class Qo {
3815
3816
  return this.canvas.collabEngine.doCollaboratively(t), !0;
3816
3817
  }
3817
3818
  undo() {
3818
- const t = new Tt(
3819
+ const t = new Et(
3819
3820
  this.canvas,
3820
3821
  this.id,
3821
3822
  this.from,
@@ -3828,7 +3829,7 @@ class Qo {
3828
3829
  return !e.rootElement.removed;
3829
3830
  }
3830
3831
  redo() {
3831
- const t = new Tt(
3832
+ const t = new Et(
3832
3833
  this.canvas,
3833
3834
  this.id,
3834
3835
  this.to,
@@ -4040,7 +4041,7 @@ class G extends Yt {
4040
4041
  ), this.targets = t, this.selected = e;
4041
4042
  }
4042
4043
  }
4043
- class Q extends Yt {
4044
+ class tt extends Yt {
4044
4045
  /**
4045
4046
  * Create a diagram highlight event.
4046
4047
  *
@@ -4053,7 +4054,7 @@ class Q extends Yt {
4053
4054
  ), this.target = t;
4054
4055
  }
4055
4056
  }
4056
- class to extends At {
4057
+ class to extends $t {
4057
4058
  constructor(t, e, a, l, r, i, n, o, d = "floating", c = "floating") {
4058
4059
  if (t.objects.get(o) !== void 0)
4059
4060
  throw new Error(`DiagramDecorator with id "${o}" already exists`);
@@ -4121,7 +4122,7 @@ class ii extends ft {
4121
4122
  e && ((e.rootElement instanceof z || e.rootElement instanceof F) && B(e.rootElement.decorators, e), super.remove(t), e.updateInView());
4122
4123
  }
4123
4124
  }
4124
- class si extends At {
4125
+ class si extends $t {
4125
4126
  constructor(t, e, a, l, r, i, n) {
4126
4127
  if (t.objects.get(n) !== void 0)
4127
4128
  throw new Error(`DiagramObject with id "${n}" already exists`);
@@ -4198,51 +4199,51 @@ class eo {
4198
4199
  this.canvas?.cancelAllUserActions(), this.id = void 0, this.name = "", this.description = void 0, this.createdAt = /* @__PURE__ */ new Date(), this.updatedAt = /* @__PURE__ */ new Date(), this.logicalClock = 0, this.nodes.clear(), this.sections.clear(), this.ports.clear(), this.connections.clear(), this.fields.clear(), this.objects.clear(), this.decorators.clear(), this.valueSet.resetValues(), this.canvas?.updateModelInView();
4199
4200
  }
4200
4201
  }
4201
- const vt = (s) => !!s.button, ce = (s, t, e, a, l, r, i, n) => yo(
4202
+ const vt = (s) => !!s.button, he = (s, t, e, a, l, r, i, n, o) => yo(
4202
4203
  s,
4203
- [t, e],
4204
+ [t, ...r, e],
4204
4205
  a,
4205
4206
  l,
4206
4207
  Math.max(
4207
4208
  // reasonable value for the minimumDistanceBeforeTurn relative to the line width
4208
4209
  10,
4209
- i || 0,
4210
- n || 0
4211
- ) * r
4210
+ n || 0,
4211
+ o || 0
4212
+ ) * i
4212
4213
  ), S = (s) => {
4213
- s ? x.select("body").style("cursor", s) : x.select("body").style("cursor", L.Auto);
4214
- }, ct = (s) => s instanceof z ? s : s instanceof F ? s.node || s : s.rootElement instanceof z || s.rootElement instanceof F || s.rootElement instanceof bt ? ct(s.rootElement) : s, ye = (s) => {
4214
+ s ? L.select("body").style("cursor", s) : L.select("body").style("cursor", E.Auto);
4215
+ }, ct = (s) => s instanceof z ? s : s instanceof F ? s.node || s : s.rootElement instanceof z || s.rootElement instanceof F || s.rootElement instanceof bt ? ct(s.rootElement) : s, be = (s) => {
4215
4216
  if (s instanceof z)
4216
4217
  return s.type.resizableX !== !1;
4217
4218
  if (s instanceof F) {
4218
4219
  if (s.type !== void 0)
4219
4220
  return s.type.resizableX !== !1;
4220
4221
  if (s.node !== void 0)
4221
- return ye(s.node);
4222
+ return be(s.node);
4222
4223
  }
4223
4224
  return !1;
4224
- }, be = (s) => {
4225
+ }, ke = (s) => {
4225
4226
  if (s instanceof z)
4226
4227
  return s.type.resizableY !== !1;
4227
4228
  if (s instanceof F) {
4228
4229
  if (s.type !== void 0)
4229
4230
  return s.type.resizableY !== !1;
4230
4231
  if (s.node !== void 0)
4231
- return be(s.node);
4232
+ return ke(s.node);
4232
4233
  }
4233
4234
  return !1;
4234
- }, he = (s) => {
4235
+ }, ge = (s) => {
4235
4236
  s.filter(".shaped-look").append("path"), s.filter(".image-look").append("image").attr("preserveAspectRatio", "none"), s.filter(".stretchable-image-look").append("image").attr("class", "top-left-image").attr("preserveAspectRatio", "none"), s.filter(".stretchable-image-look").append("image").attr("class", "top-image").attr("preserveAspectRatio", "none"), s.filter(".stretchable-image-look").append("image").attr("class", "top-right-image").attr("preserveAspectRatio", "none"), s.filter(".stretchable-image-look").append("image").attr("class", "left-image").attr("preserveAspectRatio", "none"), s.filter(".stretchable-image-look").append("image").attr("class", "center-image").attr("preserveAspectRatio", "none"), s.filter(".stretchable-image-look").append("image").attr("class", "right-image").attr("preserveAspectRatio", "none"), s.filter(".stretchable-image-look").append("image").attr("class", "bottom-left-image").attr("preserveAspectRatio", "none"), s.filter(".stretchable-image-look").append("image").attr("class", "bottom-image").attr("preserveAspectRatio", "none"), s.filter(".stretchable-image-look").append("image").attr("class", "bottom-right-image").attr("preserveAspectRatio", "none");
4236
4237
  }, zt = {
4237
4238
  fillColor: "#FFFFFF",
4238
4239
  borderColor: "#000000",
4239
4240
  borderThickness: 1,
4240
- borderStyle: Se.Solid
4241
- }, ge = (s) => {
4241
+ borderStyle: Ce.Solid
4242
+ }, fe = (s) => {
4242
4243
  s.filter(".shaped-look").select("path").attr(
4243
4244
  "d",
4244
- (t) => ve(
4245
- t.look.shape || Mt.Rectangle,
4245
+ (t) => ye(
4246
+ t.look.shape || Tt.Rectangle,
4246
4247
  0,
4247
4248
  0,
4248
4249
  t.width,
@@ -4259,7 +4260,7 @@ const vt = (s) => !!s.button, ce = (s, t, e, a, l, r, i, n) => yo(
4259
4260
  (t) => `${t.look.borderThickness || zt.borderThickness}px`
4260
4261
  ).attr(
4261
4262
  "stroke-dasharray",
4262
- (t) => me(
4263
+ (t) => ve(
4263
4264
  t.look.borderStyle || zt.borderStyle,
4264
4265
  t.type?.defaultLook?.borderThickness || t.look?.borderThickness || zt.borderThickness
4265
4266
  )
@@ -4326,7 +4327,7 @@ const vt = (s) => !!s.button, ce = (s, t, e, a, l, r, i, n) => yo(
4326
4327
  }
4327
4328
  t.select("rect").attr("fill", `url(#${e})`);
4328
4329
  }
4329
- }, ke = 96, j = 32, xt = ke + j, ai = Math.PI / 4, li = 100, Ve = {
4330
+ }, we = 96, j = 32, It = we + j, ai = Math.PI / 4, li = 100, Ve = {
4330
4331
  customButtons: []
4331
4332
  };
4332
4333
  class di {
@@ -4345,26 +4346,26 @@ class di {
4345
4346
  */
4346
4347
  open(t) {
4347
4348
  this.close();
4348
- const e = this.canvas.getPointerLocationRelativeToRoot(t), a = this.canvas.getPointerLocationRelativeToCanvas(t), l = this.canvas.selectSVGElement().append("foreignObject").attr("class", "daga-context-menu").attr("x", `${e[0] - xt}px`).attr("y", `${e[1] - xt}px`).attr("width", `${2 * xt}px`).attr("height", `${2 * xt}px`).style("pointer-events", "none").on($.ContextMenu, (i) => {
4349
- this.canvas.canUserPerformAction(w.ContextMenu) && (t.preventDefault(), this.open(i));
4349
+ const e = this.canvas.getPointerLocationRelativeToRoot(t), a = this.canvas.getPointerLocationRelativeToCanvas(t), l = this.canvas.selectSVGElement().append("foreignObject").attr("class", "daga-context-menu").attr("x", `${e[0] - It}px`).attr("y", `${e[1] - It}px`).attr("width", `${2 * It}px`).attr("height", `${2 * It}px`).style("pointer-events", "none").on($.ContextMenu, (i) => {
4350
+ this.canvas.canUserPerformAction(k.ContextMenu) && (t.preventDefault(), this.open(i));
4350
4351
  }).on($.Click, (i) => {
4351
4352
  i.preventDefault(), this.close();
4352
4353
  });
4353
4354
  this.contextMenuContainer = l;
4354
4355
  const r = [];
4355
- this.canvas.userSelection.length !== 0 && this.canvas.canUserPerformAction(w.Clipboard) && this.canvas.canUserPerformAction(w.Remove) && r.push({
4356
+ this.canvas.userSelection.length !== 0 && this.canvas.canUserPerformAction(k.Clipboard) && this.canvas.canUserPerformAction(k.Remove) && r.push({
4356
4357
  name: "CUT",
4357
4358
  imageClass: "daga-cut",
4358
4359
  onPress: (i) => {
4359
4360
  i.userSelection.cutToClipboard(), i.cancelAllUserActions();
4360
4361
  }
4361
- }), this.canvas.userSelection.length !== 0 && this.canvas.canUserPerformAction(w.Clipboard) && r.push({
4362
+ }), this.canvas.userSelection.length !== 0 && this.canvas.canUserPerformAction(k.Clipboard) && r.push({
4362
4363
  name: "COPY",
4363
4364
  imageClass: "daga-copy",
4364
4365
  onPress: (i) => {
4365
4366
  i.userSelection.copyToClipboard(), i.cancelAllUserActions();
4366
4367
  }
4367
- }), this.canvas.canUserPerformAction(w.Paste) && r.push({
4368
+ }), this.canvas.canUserPerformAction(k.Paste) && r.push({
4368
4369
  name: "PASTE",
4369
4370
  imageClass: "daga-paste",
4370
4371
  onPress: (i) => {
@@ -4372,7 +4373,7 @@ class di {
4372
4373
  i.getClosestGridPoint(a)
4373
4374
  ), i.cancelAllUserActions();
4374
4375
  }
4375
- }), this.canvas.userSelection.length !== 0 && this.canvas.canUserPerformAction(w.Remove) && r.push({
4376
+ }), this.canvas.userSelection.length !== 0 && this.canvas.canUserPerformAction(k.Remove) && r.push({
4376
4377
  name: "DELETE",
4377
4378
  imageClass: "daga-delete",
4378
4379
  onPress: (i) => {
@@ -4393,16 +4394,16 @@ class di {
4393
4394
  ).attr("tabindex", 0).style("position", "absolute").style("box-sizing", "border-box").style("width", `${2 * j}px`).style("height", `${2 * j}px`).style("border-radius", `${j}px`).style("pointer-events", "auto").on($.Click, (h) => {
4394
4395
  o && (h.preventDefault(), o(this.canvas));
4395
4396
  }).on($.KeyDown, (h) => {
4396
- o && h.key === Z.Enter && (h.preventDefault(), o(this.canvas));
4397
+ o && h.key === K.Enter && (h.preventDefault(), o(this.canvas));
4397
4398
  });
4398
- n.imageClass !== void 0 ? c.append("xhtml:div").style("position", "absolute").style("left", `${0.75 * j}px`).style("top", `${0.5 * j}px`).style("width", `${0.5 * j}px`).style("height", `${0.5 * j}px`).style("background-size", "contain").style("background-repeat", "no-repeat").attr("class", n.imageClass) : n.image !== void 0 && c.append("xhtml:img").style("position", "absolute").style("left", `${0.75 * j}px`).style("top", `${0.5 * j}px`).style("width", `${0.5 * j}px`).style("height", `${0.5 * j}px`).attr("src", n.image), c.append("xhtml:span").style("position", "absolute").style("left", `${0.2 * j}px`).style("top", `${1.1 * j}px`).style("text-align", "center").style("width", `${1.6 * j}px`).style("height", `${0.35 * j}px`).style("margin", "0").style("font-size", `${0.35 * j}px`).style("font-weight", "700").style("user-select", "none").text(n.name), c.transition().ease(x.easeLinear).duration(li).tween("progress", () => (h) => {
4399
+ n.imageClass !== void 0 ? c.append("xhtml:div").style("position", "absolute").style("left", `${0.75 * j}px`).style("top", `${0.5 * j}px`).style("width", `${0.5 * j}px`).style("height", `${0.5 * j}px`).style("background-size", "contain").style("background-repeat", "no-repeat").attr("class", n.imageClass) : n.image !== void 0 && c.append("xhtml:img").style("position", "absolute").style("left", `${0.75 * j}px`).style("top", `${0.5 * j}px`).style("width", `${0.5 * j}px`).style("height", `${0.5 * j}px`).attr("src", n.image), c.append("xhtml:span").style("position", "absolute").style("left", `${0.2 * j}px`).style("top", `${1.1 * j}px`).style("text-align", "center").style("width", `${1.6 * j}px`).style("height", `${0.35 * j}px`).style("margin", "0").style("font-size", `${0.35 * j}px`).style("font-weight", "700").style("user-select", "none").text(n.name), c.transition().ease(L.easeLinear).duration(li).tween("progress", () => (h) => {
4399
4400
  const f = d * h;
4400
4401
  return c.style(
4401
4402
  "left",
4402
- `${Math.sin(f) * ke - j + xt}px`
4403
+ `${Math.sin(f) * we - j + It}px`
4403
4404
  ).style(
4404
4405
  "top",
4405
- `${-Math.cos(f) * ke - j + xt}px`
4406
+ `${-Math.cos(f) * we - j + It}px`
4406
4407
  );
4407
4408
  });
4408
4409
  }
@@ -4508,8 +4509,8 @@ class oo {
4508
4509
  n.push({
4509
4510
  id: o.id,
4510
4511
  type: o.type?.id,
4511
- coords: It(o.coords),
4512
- connectionPoint: It(o.connectionPoint || o.coords),
4512
+ coords: At(o.coords),
4513
+ connectionPoint: At(o.connectionPoint || o.coords),
4513
4514
  direction: o.direction,
4514
4515
  label: o.label?.text || "",
4515
4516
  ...e ? {
@@ -4527,7 +4528,7 @@ class oo {
4527
4528
  label: i.label?.text || "",
4528
4529
  indexXInNode: i.indexXInNode,
4529
4530
  indexYInNode: i.indexYInNode,
4530
- coords: It(i.coords),
4531
+ coords: At(i.coords),
4531
4532
  width: i.width,
4532
4533
  height: i.height,
4533
4534
  ...e ? {
@@ -4545,8 +4546,8 @@ class oo {
4545
4546
  r.push({
4546
4547
  id: i.id,
4547
4548
  type: i.type?.id,
4548
- coords: It(i.coords),
4549
- connectionPoint: It(i.connectionPoint || i.coords),
4549
+ coords: At(i.coords),
4550
+ connectionPoint: At(i.connectionPoint || i.coords),
4550
4551
  direction: i.direction,
4551
4552
  label: i.label?.text || "",
4552
4553
  ...e ? {
@@ -4565,7 +4566,7 @@ class oo {
4565
4566
  sections: l,
4566
4567
  ports: r,
4567
4568
  label: t.label?.text || "",
4568
- coords: It(t.coords),
4569
+ coords: At(t.coords),
4569
4570
  width: t.width,
4570
4571
  height: t.height,
4571
4572
  data: t.valueSet.getValues(),
@@ -4738,18 +4739,18 @@ class fi extends ft {
4738
4739
  if (a === void 0)
4739
4740
  return;
4740
4741
  const l = t?.valueSet;
4741
- l ? (this.propertyEditorSelection = t, e && (this.propertyEditorValues = Nt(l.getValues())), a && (t instanceof z || t instanceof dt ? (t instanceof z ? t.name ? a.title = `${t.type.name}: ${t.name}` : a.title = t.type.name : t instanceof dt && (a.title = t.type.name), a.valueSet = void 0, a.valueSet = l) : (a.title = this.diagramPropertiesText, a.valueSet = void 0, a.valueSet = l))) : (this.propertyEditorSelection = void 0, this.propertyEditorValues = void 0, a && (a.title = "", a.valueSet = void 0));
4742
+ l ? (this.propertyEditorSelection = t, e && (this.propertyEditorValues = Mt(l.getValues())), a && (t instanceof z || t instanceof dt ? (t instanceof z ? t.name ? a.title = `${t.type.name}: ${t.name}` : a.title = t.type.name : t instanceof dt && (a.title = t.type.name), a.valueSet = void 0, a.valueSet = l) : (a.title = this.diagramPropertiesText, a.valueSet = void 0, a.valueSet = l))) : (this.propertyEditorSelection = void 0, this.propertyEditorValues = void 0, a && (a.title = "", a.valueSet = void 0));
4742
4743
  }
4743
4744
  makeUpdateValuesAction() {
4744
4745
  if (this.propertyEditorSelection === void 0 || this.propertyEditorValues === void 0)
4745
4746
  return;
4746
4747
  const t = this.propertyEditorSelection instanceof eo ? void 0 : this.propertyEditorSelection.id;
4747
- if (St(
4748
+ if (wt(
4748
4749
  this.propertyEditorValues,
4749
4750
  this.propertyEditorSelection?.valueSet.getValues()
4750
4751
  ))
4751
4752
  return;
4752
- const e = this.propertyEditorValues, a = Nt(this.propertyEditorSelection?.valueSet.getValues()), [l, r] = Be(
4753
+ const e = this.propertyEditorValues, a = Mt(this.propertyEditorSelection?.valueSet.getValues()), [l, r] = Be(
4753
4754
  e,
4754
4755
  a,
4755
4756
  this.propertyEditorSelection?.valueSet
@@ -4765,7 +4766,7 @@ class fi extends ft {
4765
4766
  const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4766
4767
  const a = ui(e), l = Math.sin(a), r = Math.cos(a), i = (Math.abs(s * r) - Math.abs(t * l)) / (r * r - l * l), n = (Math.abs(s * l) - Math.abs(t * r)) / (l * l - r * r);
4767
4768
  return [i, n];
4768
- }, pi = (s) => /^((?!chrome|android).)*safari/i.test(s), He = pi(navigator.userAgent), mi = 12, H = 6, vi = 25, fe = "diagram-connection-unfinished", te = class te {
4769
+ }, pi = (s) => /^((?!chrome|android).)*safari/i.test(s), He = pi(navigator.userAgent), mi = 12, H = 6, vi = 25, ue = "diagram-connection-unfinished", te = class te {
4769
4770
  /**
4770
4771
  * Constructs a canvas object.
4771
4772
  * @public
@@ -4773,7 +4774,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4773
4774
  * @param config The configuration object used to set the parameters of this canvas.
4774
4775
  */
4775
4776
  constructor(t, e) {
4776
- if (this.backgroundPatternId = `daga-background-pattern-id-${te.canvasCount++}`, this.zoomTransform = x.zoomIdentity, this.draggingFrom = [0, 0], this.dragging = !1, this.secondaryButton = !1, this.validatorChange$ = new Wt(), this.diagramChange$ = new Wt(), this.diagramEvent$ = new Wt(), this.propertyEditorChanges$ = new Wt(), this.parentComponent = t, this.model = new eo(
4777
+ if (this.backgroundPatternId = `daga-background-pattern-id-${te.canvasCount++}`, this.zoomTransform = L.zoomIdentity, this.draggingFrom = [0, 0], this.dragging = !1, this.secondaryButton = !1, this.validatorChange$ = new Wt(), this.diagramChange$ = new Wt(), this.diagramEvent$ = new Wt(), this.propertyEditorChanges$ = new Wt(), this.parentComponent = t, this.model = new eo(
4777
4778
  this,
4778
4779
  void 0,
4779
4780
  e.name || "unnamed",
@@ -4788,7 +4789,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4788
4789
  e.canvas?.highlightSections !== !1
4789
4790
  ), this.contextMenu = new di(this, e.canvas?.contextMenu), this.backgroundColor = e.canvas?.backgroundColor || "#FFFFFF", this.gridStyle = e.canvas?.grid?.style ?? Rt.style, this.gridSize = e.canvas?.grid?.enabled === !1 || e.canvas?.grid === void 0 ? 0 : Math.abs(e.canvas?.grid?.spacing || Rt.spacing), this.gridThickness = Math.abs(
4790
4791
  e.canvas?.grid?.thickness || Rt.thickness
4791
- ), this.gridColor = e.canvas?.grid?.color || Rt.color, this.snapToGrid = e.canvas?.grid?.enabled === !1 || e.canvas?.grid === void 0 ? !1 : e.canvas?.grid?.snap || Rt.snap, this.zoomFactor = e.canvas?.zoomFactor || 2, this.panRate = e.canvas?.panRate || 100, this.inferConnectionType = e.connectionSettings?.inferConnectionType || !1, this.autoTightenConnections = e.connectionSettings?.autoTighten !== !1, this.allowConnectionLoops = e.connectionSettings?.allowLoops || !1, this.allowSharingPorts = e.connectionSettings?.sharePorts !== !1, this.allowSharingBothPorts = e.connectionSettings?.shareBothPorts || !1, this.portHighlightRadius = e.connectionSettings?.portHighlightRadius || 100, this.multipleSelectionOn = !1, this.priorityThresholds = e.canvas?.priorityThresholds || [], this.priorityThreshold = this.priorityThresholds ? this.priorityThresholds[0] : void 0, this.layoutFormat = e.layoutFormat, this.userActions = e.userActions || {}, this.validators = [], this.actionStack = new Ko(this, vi), this.collabEngine = new Zo(this), e.nodeTypes)
4792
+ ), this.gridColor = e.canvas?.grid?.color || Rt.color, this.snapToGrid = e.canvas?.grid?.enabled === !1 || e.canvas?.grid === void 0 ? !1 : e.canvas?.grid?.snap || Rt.snap, this.zoomFactor = e.canvas?.zoomFactor || 2, this.panRate = e.canvas?.panRate || 100, this.inferConnectionType = e.connectionSettings?.inferConnectionType || !1, this.autoTightenConnections = e.connectionSettings?.autoTighten !== !1, this.tightenConnectionsAcrossPortTypes = e.connectionSettings?.tightenAcrossPortTypes || !1, this.allowConnectionLoops = e.connectionSettings?.allowLoops || !1, this.allowSharingPorts = e.connectionSettings?.sharePorts !== !1, this.allowSharingBothPorts = e.connectionSettings?.shareBothPorts || !1, this.portHighlightRadius = e.connectionSettings?.portHighlightRadius || 100, this.multipleSelectionOn = !1, this.priorityThresholds = e.canvas?.priorityThresholds || [], this.priorityThreshold = this.priorityThresholds ? this.priorityThresholds[0] : void 0, this.layoutFormat = e.layoutFormat, this.userActions = e.userActions || {}, this.validators = [], this.actionStack = new Ko(this, vi), this.collabEngine = new Zo(this), e.nodeTypes)
4792
4793
  for (const a of e.nodeTypes) {
4793
4794
  const l = new We({
4794
4795
  ...e.nodeTypeDefaults,
@@ -4843,21 +4844,21 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4843
4844
  }
4844
4845
  // View methods
4845
4846
  initView(t) {
4846
- const e = x.select(t);
4847
- e.html(""), this.diagramRoot = e.append("div").node(), x.select(this.diagramRoot).attr("tabindex", 0).style("width", "100%").style("height", "100%").append("svg").style("width", "100%").style("height", "100%"), x.select(this.diagramRoot).on($.Click, () => {
4848
- x.select(this.diagramRoot).node()?.focus();
4847
+ const e = L.select(t);
4848
+ e.html(""), this.diagramRoot = e.append("div").node(), L.select(this.diagramRoot).attr("tabindex", 0).style("width", "100%").style("height", "100%").append("svg").style("width", "100%").style("height", "100%"), L.select(this.diagramRoot).on($.Click, () => {
4849
+ L.select(this.diagramRoot).node()?.focus();
4849
4850
  }).on($.ContextMenu, (l) => {
4850
4851
  if (this.dragging) {
4851
4852
  l.preventDefault(), l.stopPropagation(), this.dragging = !1;
4852
4853
  return;
4853
4854
  }
4854
4855
  const r = new mt(l, null);
4855
- this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(w.ContextMenu) && (l.preventDefault(), this.contextMenu.open(l));
4856
+ this.diagramEvent$.next(r), !r.defaultPrevented && this.canUserPerformAction(k.ContextMenu) && (l.preventDefault(), this.contextMenu.open(l));
4856
4857
  }).on($.DoubleClick, (l) => {
4857
4858
  const r = new pt(l, null);
4858
4859
  this.diagramEvent$.next(r);
4859
4860
  }).on($.KeyDown, (l) => {
4860
- if (!l.ctrlKey && (l.key === Z.Delete || l.key === Z.Backspace) && this.canUserPerformAction(w.Remove) && (this.userSelection.removeFromModel(), this.cancelAllUserActions()), l.ctrlKey && l.key === "a") {
4861
+ if (!l.ctrlKey && (l.key === K.Delete || l.key === K.Backspace) && this.canUserPerformAction(k.Remove) && (this.userSelection.removeFromModel(), this.cancelAllUserActions()), l.ctrlKey && l.key === "a") {
4861
4862
  l.preventDefault();
4862
4863
  for (const r of this.model.nodes)
4863
4864
  this.userSelection.add(r);
@@ -4880,7 +4881,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4880
4881
  new G(i, !1)
4881
4882
  );
4882
4883
  }
4883
- if (l.ctrlKey && l.key === "c" && this.canUserPerformAction(w.Clipboard) && (l.preventDefault(), this.userSelection.copyToClipboard(), this.cancelAllUserActions()), l.ctrlKey && l.key === "x" && this.canUserPerformAction(w.Clipboard) && this.canUserPerformAction(w.Remove) && (l.preventDefault(), this.userSelection.cutToClipboard(), this.cancelAllUserActions()), l.ctrlKey && l.key === "v" && this.canUserPerformAction(w.Paste)) {
4884
+ if (l.ctrlKey && l.key === "c" && this.canUserPerformAction(k.Clipboard) && (l.preventDefault(), this.userSelection.copyToClipboard(), this.cancelAllUserActions()), l.ctrlKey && l.key === "x" && this.canUserPerformAction(k.Clipboard) && this.canUserPerformAction(k.Remove) && (l.preventDefault(), this.userSelection.cutToClipboard(), this.cancelAllUserActions()), l.ctrlKey && l.key === "v" && this.canUserPerformAction(k.Paste)) {
4884
4885
  l.preventDefault();
4885
4886
  const r = this.getCoordinatesOnScreen();
4886
4887
  this.userSelection.pasteFromClipboard(
@@ -4890,21 +4891,21 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4890
4891
  ])
4891
4892
  ), this.cancelAllUserActions();
4892
4893
  }
4893
- l.ctrlKey && l.key === "y" && (l.preventDefault(), this.actionStack.redo()), l.ctrlKey && l.key === "z" && (l.preventDefault(), this.actionStack.undo()), l.key === "+" && this.canUserPerformAction(w.Zoom) && (l.preventDefault(), this.zoomBy(this.zoomFactor)), l.key === "-" && this.canUserPerformAction(w.Zoom) && (l.preventDefault(), this.zoomBy(1 / this.zoomFactor)), l.key === Z.ArrowLeft && this.canUserPerformAction(w.Zoom) && (l.preventDefault(), this.translateBy(this.panRate / this.zoomTransform.k, 0)), l.key === Z.ArrowRight && this.canUserPerformAction(w.Zoom) && (l.preventDefault(), this.translateBy(-this.panRate / this.zoomTransform.k, 0)), l.key === Z.ArrowDown && this.canUserPerformAction(w.Zoom) && (l.preventDefault(), this.translateBy(0, -this.panRate / this.zoomTransform.k)), l.key === Z.ArrowUp && this.canUserPerformAction(w.Zoom) && (l.preventDefault(), this.translateBy(0, this.panRate / this.zoomTransform.k));
4894
+ l.ctrlKey && l.key === "y" && (l.preventDefault(), this.actionStack.redo()), l.ctrlKey && l.key === "z" && (l.preventDefault(), this.actionStack.undo()), l.key === "+" && this.canUserPerformAction(k.Zoom) && (l.preventDefault(), this.zoomBy(this.zoomFactor)), l.key === "-" && this.canUserPerformAction(k.Zoom) && (l.preventDefault(), this.zoomBy(1 / this.zoomFactor)), l.key === K.ArrowLeft && this.canUserPerformAction(k.Zoom) && (l.preventDefault(), this.translateBy(this.panRate / this.zoomTransform.k, 0)), l.key === K.ArrowRight && this.canUserPerformAction(k.Zoom) && (l.preventDefault(), this.translateBy(-this.panRate / this.zoomTransform.k, 0)), l.key === K.ArrowDown && this.canUserPerformAction(k.Zoom) && (l.preventDefault(), this.translateBy(0, -this.panRate / this.zoomTransform.k)), l.key === K.ArrowUp && this.canUserPerformAction(k.Zoom) && (l.preventDefault(), this.translateBy(0, this.panRate / this.zoomTransform.k));
4894
4895
  });
4895
4896
  const a = this.selectSVGElement().append("g").attr("class", "daga-canvas-view").attr("width", "100%").attr("height", "100%");
4896
4897
  a.call(
4897
- this.zoomBehavior = x.zoom().filter((l) => l.type !== $.DoubleClick).on(ue.Zoom, (l) => {
4898
+ this.zoomBehavior = L.zoom().filter((l) => l.type !== $.DoubleClick).on(pe.Zoom, (l) => {
4898
4899
  if (l.sourceEvent) {
4899
- if (!this.canUserPerformAction(w.Zoom)) {
4900
- S(L.NotAllowed);
4900
+ if (!this.canUserPerformAction(k.Zoom)) {
4901
+ S(E.NotAllowed);
4901
4902
  return;
4902
4903
  }
4903
- l.sourceEvent.type === $.Wheel && l.sourceEvent.wheelDelta !== void 0 ? (l.sourceEvent.wheelDelta > 0 && S(L.ZoomIn), l.sourceEvent.wheelDelta < 0 && S(L.ZoomOut)) : l.sourceEvent.type === $.MouseMove && S(L.AllScroll);
4904
+ l.sourceEvent.type === $.Wheel && l.sourceEvent.wheelDelta !== void 0 ? (l.sourceEvent.wheelDelta > 0 && S(E.ZoomIn), l.sourceEvent.wheelDelta < 0 && S(E.ZoomOut)) : l.sourceEvent.type === $.MouseMove && S(E.AllScroll);
4904
4905
  }
4905
4906
  this.zoomTransform = l.transform;
4906
4907
  const r = l.transform.toString();
4907
- this.selectCanvasElements().attr("transform", r), x.select(`#${this.backgroundPatternId}`).attr(
4908
+ this.selectCanvasElements().attr("transform", r), L.select(`#${this.backgroundPatternId}`).attr(
4908
4909
  "patternTransform",
4909
4910
  r
4910
4911
  ), He && this.updateFieldsInView(), this.contextMenu.close(), this.diagramEvent$.next(
@@ -4913,7 +4914,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4913
4914
  this.zoomTransform.k
4914
4915
  )
4915
4916
  );
4916
- }).on(ue.End, () => {
4917
+ }).on(pe.End, () => {
4917
4918
  S();
4918
4919
  })
4919
4920
  ), a.append("rect").attr("x", 0).attr("y", 0).attr("width", "100%").attr("height", "100%").attr("fill", this.backgroundColor).attr("stroke-width", "0").on($.MouseMove, (l) => {
@@ -4922,9 +4923,9 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4922
4923
  this.unfinishedConnection.endCoords = r;
4923
4924
  }
4924
4925
  }).on($.MouseOver, () => {
4925
- this.userHighlight.size() > 0 && (this.userHighlight.clear(), this.diagramEvent$.next(new Q(null)));
4926
+ this.userHighlight.size() > 0 && (this.userHighlight.clear(), this.diagramEvent$.next(new tt(null)));
4926
4927
  }).on($.Click, () => {
4927
- if (this.userHighlight.size() > 0 && (this.userHighlight.clear(), this.diagramEvent$.next(new Q(null))), this.contextMenu.close(), this.userSelection.size() > 0) {
4928
+ if (this.userHighlight.size() > 0 && (this.userHighlight.clear(), this.diagramEvent$.next(new tt(null))), this.contextMenu.close(), this.userSelection.size() > 0) {
4928
4929
  const l = this.userSelection.all();
4929
4930
  this.userSelection.clear(), this.diagramEvent$.next(
4930
4931
  new G(l, !1)
@@ -4932,7 +4933,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4932
4933
  }
4933
4934
  this.userSelection.openInPropertyEditor(this.model);
4934
4935
  }).call(
4935
- x.drag().filter((l) => this.multipleSelectionOn || vt(l)).on(A.Start, (l) => {
4936
+ L.drag().filter((l) => this.multipleSelectionOn || vt(l)).on(A.Start, (l) => {
4936
4937
  this.startMultipleSelection(l);
4937
4938
  }).on(A.Drag, (l) => {
4938
4939
  this.continueMultipleSelection(l);
@@ -4968,23 +4969,32 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4968
4969
  this.zoomBehavior.scaleTo(this.selectCanvasView(), a), this.zoomBehavior.translateTo(this.selectCanvasView(), t, e);
4969
4970
  return;
4970
4971
  }
4971
- this.zoomBehavior.interpolate(x.interpolate);
4972
+ this.zoomBehavior.interpolate(L.interpolate);
4972
4973
  const [r, i] = this.getViewCoordinates(), n = this.getZoomLevel(), o = t, d = e, c = a;
4973
- this.selectCanvasElements().transition().duration(l).ease(x.easeCubicInOut).tween("progress", () => (h) => {
4974
- const f = h * (o - r) + r, b = h * (d - i) + i, m = h * (c - n) + n;
4975
- this.zoomBehavior.scaleTo(this.selectCanvasView(), m), this.zoomBehavior.translateTo(
4976
- this.selectCanvasView(),
4977
- f,
4978
- b
4979
- );
4974
+ this.selectCanvasElements().transition().duration(l).ease(L.easeCubicInOut).tween("progress", () => {
4975
+ let h = !1;
4976
+ return (f) => {
4977
+ try {
4978
+ if (!h) {
4979
+ const b = f * (o - r) + r, m = f * (d - i) + i, p = f * (c - n) + n;
4980
+ this.zoomBehavior.scaleTo(this.selectCanvasView(), p), this.zoomBehavior.translateTo(
4981
+ this.selectCanvasView(),
4982
+ b,
4983
+ m
4984
+ );
4985
+ }
4986
+ } catch {
4987
+ console.warn("Animation has been interrupted"), h = !0;
4988
+ }
4989
+ };
4980
4990
  });
4981
4991
  }
4982
4992
  center(t, e, a) {
4983
4993
  if (this.model.nodes.length > 0) {
4984
- const l = this.selectCanvasView().select("rect").node()?.getBBox(), r = t?.map((y) => this.model.nodes.get(y)).filter((y) => !!y) || this.model.nodes.all(), i = Math.min(...r.map((y) => y.coords[0])), n = Math.max(
4985
- ...r.map((y) => y.coords[0] + y.width)
4986
- ), o = (i + n) / 2, d = n - i, c = l.width, h = Math.min(...r.map((y) => y.coords[1])), f = Math.max(
4987
- ...r.map((y) => y.coords[1] + y.height)
4994
+ const l = this.selectCanvasView().select("rect").node()?.getBBox(), r = t?.map((v) => this.model.nodes.get(v)).filter((v) => !!v) || this.model.nodes.all(), i = Math.min(...r.map((v) => v.coords[0])), n = Math.max(
4995
+ ...r.map((v) => v.coords[0] + v.width)
4996
+ ), o = (i + n) / 2, d = n - i, c = l.width, h = Math.min(...r.map((v) => v.coords[1])), f = Math.max(
4997
+ ...r.map((v) => v.coords[1] + v.height)
4988
4998
  ), b = (h + f) / 2, m = f - h, p = l.height, u = Math.min(
4989
4999
  c / d,
4990
5000
  p / m,
@@ -5029,21 +5039,21 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5029
5039
  return t;
5030
5040
  }
5031
5041
  getPointerLocationRelativeToCanvas(t) {
5032
- return x.pointer(
5042
+ return L.pointer(
5033
5043
  this.getEventHoldingCoordinates(t),
5034
5044
  this.selectCanvasElements().node()
5035
5045
  );
5036
5046
  }
5037
5047
  getPointerLocationRelativeToRoot(t) {
5038
- return x.pointer(
5048
+ return L.pointer(
5039
5049
  this.getEventHoldingCoordinates(t),
5040
5050
  this.selectSVGElement().node()
5041
5051
  );
5042
5052
  }
5043
5053
  getPointerLocationRelativeToBody(t) {
5044
- return x.pointer(
5054
+ return L.pointer(
5045
5055
  this.getEventHoldingCoordinates(t),
5046
- x.select("body").node()
5056
+ L.select("body").node()
5047
5057
  );
5048
5058
  }
5049
5059
  getPointerLocationRelativeToScreen(t) {
@@ -5065,12 +5075,12 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5065
5075
  );
5066
5076
  const a = e.exit(), l = e.enter().append("g").attr("id", (i) => i.id).attr(
5067
5077
  "class",
5068
- (i) => `diagram-node${ye(i) ? " resizable-x" : ""}${be(i) ? " resizable-y" : ""} ${i.type.defaultLook.lookType}`
5078
+ (i) => `diagram-node${be(i) ? " resizable-x" : ""}${ke(i) ? " resizable-y" : ""} ${i.type.defaultLook.lookType}`
5069
5079
  );
5070
5080
  t && t.length > 0 && (e = e.filter((i) => t.includes(i.id)));
5071
5081
  const r = l.merge(e);
5072
5082
  a.remove(), l.on($.MouseOver, (i, n) => {
5073
- this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new Q(n)));
5083
+ this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new tt(n)));
5074
5084
  }).on($.Click, (i, n) => {
5075
5085
  if (!i.ctrlKey && !i.shiftKey) {
5076
5086
  const o = this.userSelection.all();
@@ -5085,40 +5095,40 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5085
5095
  return;
5086
5096
  }
5087
5097
  const o = new mt(i, n);
5088
- this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(w.ContextMenu) && (i.preventDefault(), this.userHighlight.focusOn(n), this.diagramEvent$.next(new Q(n)), this.userSelection.add(n), this.diagramEvent$.next(new G([n], !0)), this.contextMenu.open(i));
5098
+ this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(k.ContextMenu) && (i.preventDefault(), this.userHighlight.focusOn(n), this.diagramEvent$.next(new tt(n)), this.userSelection.add(n), this.diagramEvent$.next(new G([n], !0)), this.contextMenu.open(i));
5089
5099
  }).on($.DoubleClick, (i, n) => {
5090
5100
  const o = new pt(i, n);
5091
5101
  this.diagramEvent$.next(o);
5092
5102
  }).call(
5093
- x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
5103
+ L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
5094
5104
  this.multipleSelectionOn || this.secondaryButton ? this.startMultipleSelection(i) : this.startMovingNode(i, n);
5095
5105
  }).on(A.Drag, (i, n) => {
5096
5106
  this.multipleSelectionOn || this.secondaryButton ? this.continueMultipleSelection(i) : this.continueMovingNode(i, n);
5097
5107
  }).on(A.End, (i, n) => {
5098
5108
  this.multipleSelectionOn || this.secondaryButton ? this.finishMultipleSelection(i) : this.finishMovingNode(i, n), this.secondaryButton = !1;
5099
5109
  })
5100
- ), he(
5110
+ ), ge(
5101
5111
  l
5102
5112
  ), l.filter(".resizable-x").append("line").attr("class", "left-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
5103
- this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed && S(L.EWResize);
5113
+ this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed && S(E.EWResize);
5104
5114
  }).on($.MouseOut, (i, n) => {
5105
- this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed && S();
5115
+ this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed && S();
5106
5116
  }).call(
5107
- x.drag().on(A.Start, (i, n) => {
5108
- this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed ? (S(L.EWResize), this.currentAction = new X(
5117
+ L.drag().on(A.Start, (i, n) => {
5118
+ this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed ? (S(E.EWResize), this.currentAction = new X(
5109
5119
  this,
5110
- w.StretchNode,
5120
+ k.StretchNode,
5111
5121
  n.id,
5112
5122
  n.getGeometry(),
5113
5123
  n.getGeometry()
5114
- )) : S(L.NotAllowed);
5124
+ )) : S(E.NotAllowed);
5115
5125
  }).on(A.Drag, (i, n) => {
5116
- if (this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed) {
5126
+ if (this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed) {
5117
5127
  const o = this.getPointerLocationRelativeToCanvas(i);
5118
5128
  n.stretch(g.Left, n.coords[0] - o[0]);
5119
5129
  }
5120
5130
  }).on(A.End, (i, n) => {
5121
- if (this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchNode) {
5131
+ if (this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === k.StretchNode) {
5122
5132
  let o = this.getPointerLocationRelativeToCanvas(i);
5123
5133
  this.snapToGrid && (o = this.getClosestGridPoint([
5124
5134
  o[0] - n.type.snapToGridOffset[0],
@@ -5128,25 +5138,25 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5128
5138
  S();
5129
5139
  })
5130
5140
  ), l.filter(".resizable-y").append("line").attr("class", "top-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
5131
- this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed && S(L.NSResize);
5141
+ this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed && S(E.NSResize);
5132
5142
  }).on($.MouseOut, (i, n) => {
5133
- this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed && S();
5143
+ this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed && S();
5134
5144
  }).call(
5135
- x.drag().on(A.Start, (i, n) => {
5136
- this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed ? (S(L.NSResize), this.currentAction = new X(
5145
+ L.drag().on(A.Start, (i, n) => {
5146
+ this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed ? (S(E.NSResize), this.currentAction = new X(
5137
5147
  this,
5138
- w.StretchNode,
5148
+ k.StretchNode,
5139
5149
  n.id,
5140
5150
  n.getGeometry(),
5141
5151
  n.getGeometry()
5142
- )) : S(L.NotAllowed);
5152
+ )) : S(E.NotAllowed);
5143
5153
  }).on(A.Drag, (i, n) => {
5144
- if (this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed) {
5154
+ if (this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed) {
5145
5155
  const o = this.getPointerLocationRelativeToCanvas(i);
5146
5156
  n.stretch(g.Top, n.coords[1] - o[1]);
5147
5157
  }
5148
5158
  }).on(A.End, (i, n) => {
5149
- if (this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchNode) {
5159
+ if (this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === k.StretchNode) {
5150
5160
  let o = this.getPointerLocationRelativeToCanvas(i);
5151
5161
  this.snapToGrid && (o = this.getClosestGridPoint([
5152
5162
  o[0] - n.type.snapToGridOffset[0],
@@ -5156,25 +5166,25 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5156
5166
  S();
5157
5167
  })
5158
5168
  ), l.filter(".resizable-x").append("line").attr("class", "right-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
5159
- this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed && S(L.EWResize);
5169
+ this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed && S(E.EWResize);
5160
5170
  }).on($.MouseOut, (i, n) => {
5161
- this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed && S();
5171
+ this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed && S();
5162
5172
  }).call(
5163
- x.drag().on(A.Start, (i, n) => {
5164
- this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed ? (S(L.EWResize), this.currentAction = new X(
5173
+ L.drag().on(A.Start, (i, n) => {
5174
+ this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed ? (S(E.EWResize), this.currentAction = new X(
5165
5175
  this,
5166
- w.StretchNode,
5176
+ k.StretchNode,
5167
5177
  n.id,
5168
5178
  n.getGeometry(),
5169
5179
  n.getGeometry()
5170
- )) : S(L.NotAllowed);
5180
+ )) : S(E.NotAllowed);
5171
5181
  }).on(A.Drag, (i, n) => {
5172
- if (this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed) {
5182
+ if (this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed) {
5173
5183
  const o = this.getPointerLocationRelativeToCanvas(i);
5174
5184
  n.stretch(g.Right, o[0] - (n.coords[0] + n.width));
5175
5185
  }
5176
5186
  }).on(A.End, (i, n) => {
5177
- if (this.canUserPerformAction(w.StretchNode) && n.getResizableX() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchNode) {
5187
+ if (this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === k.StretchNode) {
5178
5188
  let o = this.getPointerLocationRelativeToCanvas(i);
5179
5189
  this.snapToGrid && (o = this.getClosestGridPoint([
5180
5190
  o[0] - n.type.snapToGridOffset[2],
@@ -5184,20 +5194,20 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5184
5194
  S();
5185
5195
  })
5186
5196
  ), l.filter(".resizable-y").append("line").attr("class", "bottom-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
5187
- this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed && S(L.NSResize);
5197
+ this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed && S(E.NSResize);
5188
5198
  }).on($.MouseOut, (i, n) => {
5189
- this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed && S();
5199
+ this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed && S();
5190
5200
  }).call(
5191
- x.drag().on(A.Start, (i, n) => {
5192
- this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed ? (S(L.NSResize), this.currentAction = new X(
5201
+ L.drag().on(A.Start, (i, n) => {
5202
+ this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed ? (S(E.NSResize), this.currentAction = new X(
5193
5203
  this,
5194
- w.StretchNode,
5204
+ k.StretchNode,
5195
5205
  n.id,
5196
5206
  n.getGeometry(),
5197
5207
  n.getGeometry()
5198
- )) : S(L.NotAllowed);
5208
+ )) : S(E.NotAllowed);
5199
5209
  }).on(A.Drag, (i, n) => {
5200
- if (this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed) {
5210
+ if (this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed) {
5201
5211
  const o = this.getPointerLocationRelativeToCanvas(i);
5202
5212
  n.stretch(
5203
5213
  g.Bottom,
@@ -5205,7 +5215,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5205
5215
  );
5206
5216
  }
5207
5217
  }).on(A.End, (i, n) => {
5208
- if (this.canUserPerformAction(w.StretchNode) && n.getResizableY() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchNode) {
5218
+ if (this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === k.StretchNode) {
5209
5219
  let o = this.getPointerLocationRelativeToCanvas(i);
5210
5220
  this.snapToGrid && this.snapToGrid && (o = this.getClosestGridPoint([
5211
5221
  o[0] - n.type.snapToGridOffset[2],
@@ -5217,7 +5227,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5217
5227
  }
5218
5228
  S();
5219
5229
  })
5220
- ), r.attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).attr("opacity", (i) => i.removed ? 0.5 : 1), ge(
5230
+ ), r.attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).attr("opacity", (i) => i.removed ? 0.5 : 1), fe(
5221
5231
  r
5222
5232
  ), r.filter(".resizable-x").select("line.left-resizer").style("pointer-events", (i) => i.getResizableX() ? "initial" : "none").attr("x1", H / 2).attr("x2", H / 2).attr("y1", 0).attr("y2", (i) => i.height), r.filter(".resizable-y").select("line.top-resizer").style("pointer-events", (i) => i.getResizableY() ? "initial" : "none").attr("x1", 0).attr("x2", (i) => i.width).attr("y1", H / 2).attr("y2", H / 2), r.filter(".resizable-x").select("line.right-resizer").style("pointer-events", (i) => i.getResizableX() ? "initial" : "none").attr("x1", (i) => i.width - H / 2).attr("x2", (i) => i.width - H / 2).attr("y1", 0).attr("y2", (i) => i.height), r.filter(".resizable-y").select("line.bottom-resizer").style("pointer-events", (i) => i.getResizableY() ? "initial" : "none").attr("x1", 0).attr("x2", (i) => i.width).attr("y1", (i) => i.height - H / 2).attr("y2", (i) => i.height - H / 2);
5223
5233
  }
@@ -5230,12 +5240,12 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5230
5240
  );
5231
5241
  const a = e.exit(), l = e.enter().append("g").attr("id", (i) => i.id).attr(
5232
5242
  "class",
5233
- (i) => `diagram-section${ye(i) ? " resizable-x" : ""}${be(i) ? " resizable-y" : ""} ${i.look?.lookType}`
5243
+ (i) => `diagram-section${be(i) ? " resizable-x" : ""}${ke(i) ? " resizable-y" : ""} ${i.look?.lookType}`
5234
5244
  );
5235
5245
  t && t.length > 0 && (e = e.filter((i) => t.includes(i.id)));
5236
5246
  const r = l.merge(e);
5237
5247
  a.remove(), l.on($.MouseOver, (i, n) => {
5238
- this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new Q(n)));
5248
+ this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new tt(n)));
5239
5249
  }).on($.Click, (i, n) => {
5240
5250
  if (!i.ctrlKey && !i.shiftKey) {
5241
5251
  const d = this.userSelection.all();
@@ -5256,10 +5266,10 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5256
5266
  return;
5257
5267
  }
5258
5268
  const o = new mt(i, n);
5259
- if (this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(w.ContextMenu)) {
5269
+ if (this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(k.ContextMenu)) {
5260
5270
  i.preventDefault();
5261
5271
  const d = ct(n);
5262
- this.userHighlight.focusOn(d), this.diagramEvent$.next(new Q(d)), this.userSelection.add(d), this.diagramEvent$.next(
5272
+ this.userHighlight.focusOn(d), this.diagramEvent$.next(new tt(d)), this.userSelection.add(d), this.diagramEvent$.next(
5263
5273
  new G([d], !0)
5264
5274
  ), this.contextMenu.open(i);
5265
5275
  }
@@ -5267,19 +5277,19 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5267
5277
  const o = new pt(i, n);
5268
5278
  this.diagramEvent$.next(o);
5269
5279
  }).call(
5270
- x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
5280
+ L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
5271
5281
  if (this.multipleSelectionOn || this.secondaryButton)
5272
5282
  this.startMultipleSelection(i);
5273
5283
  else {
5274
5284
  const o = n?.node;
5275
- o ? this.startMovingNode(i, o) : S(L.NotAllowed);
5285
+ o ? this.startMovingNode(i, o) : S(E.NotAllowed);
5276
5286
  }
5277
5287
  }).on(A.Drag, (i, n) => {
5278
5288
  if (this.multipleSelectionOn || this.secondaryButton)
5279
5289
  this.continueMultipleSelection(i);
5280
5290
  else {
5281
5291
  const o = n?.node;
5282
- o ? this.continueMovingNode(i, o) : S(L.NotAllowed);
5292
+ o ? this.continueMovingNode(i, o) : S(E.NotAllowed);
5283
5293
  }
5284
5294
  }).on(A.End, (i, n) => {
5285
5295
  if (this.multipleSelectionOn || this.secondaryButton)
@@ -5290,23 +5300,23 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5290
5300
  }
5291
5301
  this.secondaryButton = !1;
5292
5302
  })
5293
- ), he(
5303
+ ), ge(
5294
5304
  l
5295
5305
  ), l.filter(".resizable-x").append("line").attr("class", "left-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
5296
- this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && S(L.EWResize);
5306
+ this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && S(E.EWResize);
5297
5307
  }).on($.MouseOut, (i, n) => {
5298
- this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && S();
5308
+ this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && S();
5299
5309
  }).call(
5300
- x.drag().on(A.Start, (i, n) => {
5301
- this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && n.node ? (S(L.EWResize), this.currentAction = new X(
5310
+ L.drag().on(A.Start, (i, n) => {
5311
+ this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && n.node ? (S(E.EWResize), this.currentAction = new X(
5302
5312
  this,
5303
- w.StretchSection,
5313
+ k.StretchSection,
5304
5314
  n.node.id,
5305
5315
  n.node.getGeometry(),
5306
5316
  n.node.getGeometry()
5307
- )) : S(L.NotAllowed);
5317
+ )) : S(E.NotAllowed);
5308
5318
  }).on(A.Drag, (i, n) => {
5309
- if (this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && n.node) {
5319
+ if (this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && n.node) {
5310
5320
  const o = this.getPointerLocationRelativeToCanvas(i);
5311
5321
  n.node.stretchSections(
5312
5322
  g.Left,
@@ -5316,7 +5326,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5316
5326
  );
5317
5327
  }
5318
5328
  }).on(A.End, (i, n) => {
5319
- if (this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchSection && n.node) {
5329
+ if (this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === k.StretchSection && n.node) {
5320
5330
  let o = this.getPointerLocationRelativeToCanvas(i);
5321
5331
  this.snapToGrid && (o = this.getClosestGridPoint(o)), n.node.stretchSections(
5322
5332
  g.Left,
@@ -5328,20 +5338,20 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5328
5338
  S();
5329
5339
  })
5330
5340
  ), l.filter(".resizable-y").append("line").attr("class", "top-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
5331
- this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && S(L.NSResize);
5341
+ this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && S(E.NSResize);
5332
5342
  }).on($.MouseOut, (i, n) => {
5333
- this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && S();
5343
+ this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && S();
5334
5344
  }).call(
5335
- x.drag().on(A.Start, (i, n) => {
5336
- this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && n.node ? (S(L.NSResize), this.currentAction = new X(
5345
+ L.drag().on(A.Start, (i, n) => {
5346
+ this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && n.node ? (S(E.NSResize), this.currentAction = new X(
5337
5347
  this,
5338
- w.StretchSection,
5348
+ k.StretchSection,
5339
5349
  n.node.id,
5340
5350
  n.node.getGeometry(),
5341
5351
  n.node.getGeometry()
5342
- )) : S(L.NotAllowed);
5352
+ )) : S(E.NotAllowed);
5343
5353
  }).on(A.Drag, (i, n) => {
5344
- if (this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && n.node) {
5354
+ if (this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && n.node) {
5345
5355
  const o = this.getPointerLocationRelativeToCanvas(i);
5346
5356
  n.node.stretchSections(
5347
5357
  g.Top,
@@ -5351,7 +5361,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5351
5361
  );
5352
5362
  }
5353
5363
  }).on(A.End, (i, n) => {
5354
- if (this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchSection && n.node) {
5364
+ if (this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === k.StretchSection && n.node) {
5355
5365
  let o = this.getPointerLocationRelativeToCanvas(i);
5356
5366
  this.snapToGrid && (o = this.getClosestGridPoint(o)), n.node.stretchSections(
5357
5367
  g.Top,
@@ -5363,20 +5373,20 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5363
5373
  S();
5364
5374
  })
5365
5375
  ), l.filter(".resizable-x").append("line").attr("class", "right-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
5366
- this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && S(L.EWResize);
5376
+ this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && S(E.EWResize);
5367
5377
  }).on($.MouseOut, (i, n) => {
5368
- this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && S();
5378
+ this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && S();
5369
5379
  }).call(
5370
- x.drag().on(A.Start, (i, n) => {
5371
- this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && n.node ? (S(L.EWResize), this.currentAction = new X(
5380
+ L.drag().on(A.Start, (i, n) => {
5381
+ this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && n.node ? (S(E.EWResize), this.currentAction = new X(
5372
5382
  this,
5373
- w.StretchSection,
5383
+ k.StretchSection,
5374
5384
  n.node.id,
5375
5385
  n.node.getGeometry(),
5376
5386
  n.node.getGeometry()
5377
- )) : S(L.NotAllowed);
5387
+ )) : S(E.NotAllowed);
5378
5388
  }).on(A.Drag, (i, n) => {
5379
- if (this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && n.node) {
5389
+ if (this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && n.node) {
5380
5390
  const o = this.getPointerLocationRelativeToCanvas(i);
5381
5391
  n.node.stretchSections(
5382
5392
  g.Right,
@@ -5386,7 +5396,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5386
5396
  );
5387
5397
  }
5388
5398
  }).on(A.End, (i, n) => {
5389
- if (this.canUserPerformAction(w.StretchSection) && n.getResizableX() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchSection && n.node) {
5399
+ if (this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === k.StretchSection && n.node) {
5390
5400
  let o = this.getPointerLocationRelativeToCanvas(i);
5391
5401
  this.snapToGrid && (o = this.getClosestGridPoint(o)), n.node.stretchSections(
5392
5402
  g.Right,
@@ -5398,20 +5408,20 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5398
5408
  S();
5399
5409
  })
5400
5410
  ), l.filter(".resizable-y").append("line").attr("class", "bottom-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
5401
- this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && S(L.NSResize);
5411
+ this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && S(E.NSResize);
5402
5412
  }).on($.MouseOut, (i, n) => {
5403
- this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && S();
5413
+ this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && S();
5404
5414
  }).call(
5405
- x.drag().on(A.Start, (i, n) => {
5406
- this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && n.node ? (S(L.NSResize), this.currentAction = new X(
5415
+ L.drag().on(A.Start, (i, n) => {
5416
+ this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && n.node ? (S(E.NSResize), this.currentAction = new X(
5407
5417
  this,
5408
- w.StretchSection,
5418
+ k.StretchSection,
5409
5419
  n.node.id,
5410
5420
  n.node.getGeometry(),
5411
5421
  n.node.getGeometry()
5412
- )) : S(L.NotAllowed);
5422
+ )) : S(E.NotAllowed);
5413
5423
  }).on(A.Drag, (i, n) => {
5414
- if (this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && n.node) {
5424
+ if (this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && n.node) {
5415
5425
  const o = this.getPointerLocationRelativeToCanvas(i);
5416
5426
  n.node.stretchSections(
5417
5427
  g.Bottom,
@@ -5421,7 +5431,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5421
5431
  );
5422
5432
  }
5423
5433
  }).on(A.End, (i, n) => {
5424
- if (this.canUserPerformAction(w.StretchSection) && n.getResizableY() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === w.StretchSection && n.node) {
5434
+ if (this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === k.StretchSection && n.node) {
5425
5435
  let o = this.getPointerLocationRelativeToCanvas(i);
5426
5436
  this.snapToGrid && (o = this.getClosestGridPoint(o)), n.node.stretchSections(
5427
5437
  g.Bottom,
@@ -5432,7 +5442,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5432
5442
  }
5433
5443
  S();
5434
5444
  })
5435
- ), r.attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).attr("opacity", (i) => i.removed ? 0.5 : 1), ge(
5445
+ ), r.attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).attr("opacity", (i) => i.removed ? 0.5 : 1), fe(
5436
5446
  r
5437
5447
  ), r.filter(".resizable-x").select("line.left-resizer").style("pointer-events", (i) => i.getResizableX() ? "initial" : "none").attr("x1", H / 2).attr("x2", H / 2).attr("y1", 0).attr("y2", (i) => i.height), r.filter(".resizable-y").select("line.top-resizer").style("pointer-events", (i) => i.getResizableY() ? "initial" : "none").attr("x1", 0).attr("x2", (i) => i.width).attr("y1", H / 2).attr("y2", H / 2), r.filter(".resizable-x").select("line.right-resizer").style("pointer-events", (i) => i.getResizableX() ? "initial" : "none").attr("x1", (i) => i.width - H / 2).attr("x2", (i) => i.width - H / 2).attr("y1", 0).attr("y2", (i) => i.height), r.filter(".resizable-y").select("line.bottom-resizer").style("pointer-events", (i) => i.getResizableY() ? "initial" : "none").attr("x1", 0).attr("x2", (i) => i.width).attr("y1", (i) => i.height - H / 2).attr("y2", (i) => i.height - H / 2);
5438
5448
  }
@@ -5447,7 +5457,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5447
5457
  t && t.length > 0 && (e = e.filter((i) => t.includes(i.id)));
5448
5458
  const r = l.merge(e);
5449
5459
  a.remove(), l.on($.MouseOver, (i, n) => {
5450
- !this.unfinishedConnection && !this.dragging && (this.userHighlight.focusOn(n), this.diagramEvent$.next(new Q(n))), this.unfinishedConnection && (// can start at the starting port
5460
+ !this.unfinishedConnection && !this.dragging && (this.userHighlight.focusOn(n), this.diagramEvent$.next(new tt(n))), this.unfinishedConnection && (// can start at the starting port
5451
5461
  this.unfinishedConnection.type.canStartFromType(
5452
5462
  this.unfinishedConnection.start?.getNode()?.type?.id || ""
5453
5463
  ) && this.unfinishedConnection.start?.allowsOutgoing && // can end at the ending port
@@ -5459,9 +5469,9 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5459
5469
  ) && n.allowsOutgoing && // can end at the starting port
5460
5470
  this.unfinishedConnection.type.canFinishOnType(
5461
5471
  this.unfinishedConnection.start?.getNode()?.type?.id || ""
5462
- ) && this.unfinishedConnection.start?.allowsIncoming || S(L.NoDrop));
5472
+ ) && this.unfinishedConnection.start?.allowsIncoming || S(E.NoDrop));
5463
5473
  }).on($.MouseOut, () => {
5464
- this.unfinishedConnection && S(L.Grabbing);
5474
+ this.unfinishedConnection && S(E.Grabbing);
5465
5475
  }).on($.Click, (i, n) => {
5466
5476
  if (!i.ctrlKey && !i.shiftKey) {
5467
5477
  const d = this.userSelection.all();
@@ -5482,10 +5492,10 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5482
5492
  return;
5483
5493
  }
5484
5494
  const o = new mt(i, n);
5485
- if (this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(w.ContextMenu)) {
5495
+ if (this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(k.ContextMenu)) {
5486
5496
  i.preventDefault();
5487
5497
  const d = ct(n);
5488
- this.userHighlight.focusOn(d), this.diagramEvent$.next(new Q(d)), this.userSelection.add(d), this.diagramEvent$.next(
5498
+ this.userHighlight.focusOn(d), this.diagramEvent$.next(new tt(d)), this.userSelection.add(d), this.diagramEvent$.next(
5489
5499
  new G([d], !0)
5490
5500
  ), this.contextMenu.open(i);
5491
5501
  }
@@ -5493,22 +5503,23 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5493
5503
  const o = new pt(i, n);
5494
5504
  this.diagramEvent$.next(o);
5495
5505
  }).call(
5496
- x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
5497
- this.multipleSelectionOn || this.secondaryButton ? this.startMultipleSelection(i) : this.canUserPerformAction(w.AddConnection) && (this.allowSharingPorts || n.incomingConnections.filter((o) => !o.removed).length === 0 && n.outgoingConnections.filter((o) => !o.removed).length === 0) && !n.removed ? (S(L.Grabbing), this.startConnection(n), this.unfinishedConnection && (this.unfinishedConnectionTracer = this.selectCanvasElements().append("path").attr("stroke", "none").attr("fill", "none"))) : S(L.NotAllowed);
5506
+ L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
5507
+ this.multipleSelectionOn || this.secondaryButton ? this.startMultipleSelection(i) : this.canUserPerformAction(k.AddConnection) && (this.allowSharingPorts || n.incomingConnections.filter((o) => !o.removed).length === 0 && n.outgoingConnections.filter((o) => !o.removed).length === 0) && !n.removed ? (S(E.Grabbing), this.startConnection(n), this.unfinishedConnection && (this.unfinishedConnectionTracer = this.selectCanvasElements().append("path").attr("stroke", "none").attr("fill", "none"))) : S(E.NotAllowed);
5498
5508
  }).on(A.Drag, (i, n) => {
5499
5509
  if (this.multipleSelectionOn || this.secondaryButton)
5500
5510
  this.continueMultipleSelection(i);
5501
- else if (this.canUserPerformAction(w.AddConnection) && !n.removed && this.unfinishedConnection !== void 0) {
5511
+ else if (this.canUserPerformAction(k.AddConnection) && !n.removed && this.unfinishedConnection !== void 0) {
5502
5512
  const o = [i.x, i.y];
5503
5513
  this.unfinishedConnectionTracer?.attr(
5504
5514
  "d",
5505
- ce(
5506
- this.unfinishedConnection.look.shape || et.look.shape,
5515
+ he(
5516
+ this.unfinishedConnection.look.shape || ot.look.shape,
5507
5517
  this.unfinishedConnection.startCoords,
5508
5518
  o,
5509
5519
  this.unfinishedConnection.startDirection,
5510
5520
  this.unfinishedConnection.endDirection,
5511
- this.unfinishedConnection.type.defaultLook.thickness || et.look.thickness,
5521
+ this.unfinishedConnection.points,
5522
+ this.unfinishedConnection.type.defaultLook.thickness || ot.look.thickness,
5512
5523
  this.unfinishedConnection.type.defaultStartMarkerLook?.width,
5513
5524
  this.unfinishedConnection.type.defaultEndMarkerLook?.width
5514
5525
  )
@@ -5527,7 +5538,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5527
5538
  ];
5528
5539
  } else
5529
5540
  this.unfinishedConnection.endCoords = o;
5530
- if (this.updateConnectionsInView(fe), this.model.ports.length > 0) {
5541
+ if (this.updateConnectionsInView(ue), this.unfinishedConnectionPort?.raise(!1), this.model.ports.length > 0) {
5531
5542
  const c = this.getPointerLocationRelativeToCanvas(i);
5532
5543
  let h = Number.POSITIVE_INFINITY, f;
5533
5544
  for (const b of this.model.ports) {
@@ -5541,7 +5552,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5541
5552
  if (this.multipleSelectionOn || this.secondaryButton)
5542
5553
  this.finishMultipleSelection(i);
5543
5554
  else {
5544
- if (this.canUserPerformAction(w.AddConnection) && !n.removed) {
5555
+ if (this.canUserPerformAction(k.AddConnection) && !n.removed) {
5545
5556
  this.unfinishedConnectionTracer?.remove();
5546
5557
  const o = this.userHighlight.getFocus();
5547
5558
  if (o instanceof bt)
@@ -5570,12 +5581,12 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5570
5581
  }
5571
5582
  this.secondaryButton = !1;
5572
5583
  })
5573
- ), l.filter(".image-look").append("image"), he(
5584
+ ), l.filter(".image-look").append("image"), ge(
5574
5585
  l
5575
5586
  ), r.attr(
5576
5587
  "transform",
5577
5588
  (i) => `translate(${i.coords[0] - i.width / 2},${i.coords[1] - i.width / 2})`
5578
- ).attr("opacity", (i) => i.removed ? 0.5 : 1), ge(
5589
+ ).attr("opacity", (i) => i.removed ? 0.5 : 1), fe(
5579
5590
  r
5580
5591
  );
5581
5592
  }
@@ -5589,7 +5600,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5589
5600
  t && t.length > 0 && (a = a.filter((n) => t.includes(n.id)));
5590
5601
  const i = r.merge(a);
5591
5602
  l.remove(), r.on($.MouseOver, (n, o) => {
5592
- o.end !== void 0 && !this.dragging && (this.userHighlight.focusOn(o), this.diagramEvent$.next(new Q(o)));
5603
+ o.end !== void 0 && !this.dragging && (this.userHighlight.focusOn(o), this.diagramEvent$.next(new tt(o)));
5593
5604
  }).on($.Click, (n, o) => {
5594
5605
  if (!n.ctrlKey && !n.shiftKey) {
5595
5606
  const d = this.userSelection.all();
@@ -5604,12 +5615,12 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5604
5615
  return;
5605
5616
  }
5606
5617
  const d = new mt(n, o);
5607
- this.diagramEvent$.next(d), !d.defaultPrevented && this.canUserPerformAction(w.ContextMenu) && (n.preventDefault(), this.userHighlight.focusOn(o), this.diagramEvent$.next(new Q(o)), this.userSelection.add(o), this.diagramEvent$.next(new G([o], !0)), this.contextMenu.open(n));
5618
+ this.diagramEvent$.next(d), !d.defaultPrevented && this.canUserPerformAction(k.ContextMenu) && (n.preventDefault(), this.userHighlight.focusOn(o), this.diagramEvent$.next(new tt(o)), this.userSelection.add(o), this.diagramEvent$.next(new G([o], !0)), this.contextMenu.open(n));
5608
5619
  }).on($.DoubleClick, (n, o) => {
5609
5620
  const d = new pt(n, o);
5610
5621
  this.diagramEvent$.next(d);
5611
5622
  }).call(
5612
- x.drag().filter((n) => (this.secondaryButton = vt(n), !0)).on(A.Start, (n) => {
5623
+ L.drag().filter((n) => (this.secondaryButton = vt(n), !0)).on(A.Start, (n) => {
5613
5624
  this.startMultipleSelection(n);
5614
5625
  }).on(A.Drag, (n) => {
5615
5626
  this.continueMultipleSelection(n);
@@ -5618,45 +5629,47 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5618
5629
  })
5619
5630
  ), r.append("path").attr("class", "diagram-connection-path"), r.append("path").attr("class", "diagram-connection-path-box"), r.append("marker").attr("id", (n) => `${n.id}-start-marker`).attr("class", "diagram-connection-start-marker").append("image").attr("preserveAspectRatio", "none"), r.append("marker").attr("id", (n) => `${n.id}-end-marker`).attr("class", "diagram-connection-end-marker").append("image").attr("preserveAspectRatio", "none"), r.append("g").attr("class", "diagram-connection-start-label"), r.select("g.diagram-connection-start-label").append("path"), r.select("g.diagram-connection-start-label").append("text").style("user-select", "none"), r.append("g").attr("class", "diagram-connection-middle-label"), r.select("g.diagram-connection-middle-label").append("path"), r.select("g.diagram-connection-middle-label").append("text").style("user-select", "none"), r.append("g").attr("class", "diagram-connection-end-label"), r.select("g.diagram-connection-end-label").append("path"), r.select("g.diagram-connection-end-label").append("text").style("user-select", "none"), i.attr("opacity", (n) => n.removed ? 0.5 : 1).select("path.diagram-connection-path").attr(
5620
5631
  "d",
5621
- (n) => ce(
5622
- n.look.shape || et.look.shape,
5632
+ (n) => he(
5633
+ n.look.shape || ot.look.shape,
5623
5634
  n.startCoords,
5624
5635
  n.endCoords,
5625
5636
  n.startDirection,
5626
5637
  n.endDirection,
5627
- n.type.defaultLook.thickness || et.look.thickness,
5638
+ n.points,
5639
+ n.type.defaultLook.thickness || ot.look.thickness,
5628
5640
  n.type.defaultStartMarkerLook?.width,
5629
5641
  n.type.defaultEndMarkerLook?.width
5630
5642
  )
5631
5643
  ).attr("marker-start", (n) => `url(#${n.id}-start-marker)`).attr("marker-end", (n) => `url(#${n.id}-end-marker)`).attr(
5632
5644
  "stroke",
5633
- (n) => n.look.color || et.look.color
5645
+ (n) => n.look.color || ot.look.color
5634
5646
  ).attr("stroke-width", (n) => `${n.look.thickness}px`).attr(
5635
5647
  "stroke-dasharray",
5636
- (n) => me(
5637
- n.look.style || et.look.style,
5638
- n.type.defaultLook.thickness || et.look.thickness
5648
+ (n) => ve(
5649
+ n.look.style || ot.look.style,
5650
+ n.type.defaultLook.thickness || ot.look.thickness
5639
5651
  )
5640
5652
  ).attr("fill", "none"), i.select("path.diagram-connection-path-box").attr(
5641
5653
  "d",
5642
- (n) => ce(
5643
- n.look.shape || et.look.shape,
5654
+ (n) => he(
5655
+ n.look.shape || ot.look.shape,
5644
5656
  n.startCoords,
5645
5657
  n.endCoords,
5646
5658
  n.startDirection,
5647
5659
  n.endDirection,
5648
- n.type.defaultLook.thickness || et.look.thickness,
5660
+ n.points,
5661
+ n.type.defaultLook.thickness || ot.look.thickness,
5649
5662
  n.type.defaultStartMarkerLook?.width,
5650
5663
  n.type.defaultEndMarkerLook?.width
5651
5664
  )
5652
5665
  ).attr("stroke", "transparent").attr("pointer-events", "stroke").attr(
5653
5666
  "stroke-width",
5654
- (n) => `${(n.look.thickness || et.look.thickness) + mi}px`
5667
+ (n) => `${(n.look.thickness || ot.look.thickness) + mi}px`
5655
5668
  ).attr(
5656
5669
  "stroke-dasharray",
5657
- (n) => me(
5658
- n.look.style || et.look.style,
5659
- n.type.defaultLook.thickness || et.look.thickness
5670
+ (n) => ve(
5671
+ n.look.style || ot.look.style,
5672
+ n.type.defaultLook.thickness || ot.look.thickness
5660
5673
  )
5661
5674
  ).attr("fill", "none"), i.data().forEach((n) => {
5662
5675
  this.updateConnectionLabelsInView(n), this.updateConnectionMarkersInView(n);
@@ -5675,7 +5688,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5675
5688
  t && t.length > 0 && (e = e.filter((i) => t.includes(i.id)));
5676
5689
  const r = l.merge(e);
5677
5690
  if (a.remove(), l.style("box-sizing", "border-box").on($.MouseOver, (i, n) => {
5678
- this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new Q(n)));
5691
+ this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new tt(n)));
5679
5692
  }).on($.Click, (i, n) => {
5680
5693
  if (!i.ctrlKey && !i.shiftKey) {
5681
5694
  const d = this.userSelection.all();
@@ -5696,16 +5709,16 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5696
5709
  return;
5697
5710
  }
5698
5711
  const o = new mt(i, n);
5699
- if (this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(w.ContextMenu)) {
5712
+ if (this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(k.ContextMenu)) {
5700
5713
  i.preventDefault();
5701
5714
  const d = ct(n);
5702
- this.userHighlight.focusOn(d), this.diagramEvent$.next(new Q(d)), this.userSelection.add(d), this.diagramEvent$.next(
5715
+ this.userHighlight.focusOn(d), this.diagramEvent$.next(new tt(d)), this.userSelection.add(d), this.diagramEvent$.next(
5703
5716
  new G([d], !0)
5704
5717
  ), this.contextMenu.open(i);
5705
5718
  }
5706
5719
  }).on($.DoubleClick, (i, n) => {
5707
5720
  const o = new pt(i, n);
5708
- this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(w.EditField) && n.editable && !n.removed && (this.currentAction = new Re(this, n.id, n.text, ""), this.createInputField(
5721
+ this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(k.EditField) && n.editable && !n.removed && (this.currentAction = new Re(this, n.id, n.text, ""), this.createInputField(
5709
5722
  n.text,
5710
5723
  n.coords,
5711
5724
  n.width,
@@ -5720,19 +5733,19 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5720
5733
  }
5721
5734
  ));
5722
5735
  }).call(
5723
- x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
5736
+ L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
5724
5737
  if (this.multipleSelectionOn || this.secondaryButton)
5725
5738
  this.startMultipleSelection(i);
5726
5739
  else {
5727
5740
  let o;
5728
- n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof F && (o = n.rootElement.node), o ? this.startMovingNode(i, o) : S(L.NotAllowed);
5741
+ n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof F && (o = n.rootElement.node), o ? this.startMovingNode(i, o) : S(E.NotAllowed);
5729
5742
  }
5730
5743
  }).on(A.Drag, (i, n) => {
5731
5744
  if (this.multipleSelectionOn || this.secondaryButton)
5732
5745
  this.continueMultipleSelection(i);
5733
5746
  else {
5734
5747
  let o;
5735
- n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof F && (o = n.rootElement.node), o ? this.continueMovingNode(i, o) : S(L.NotAllowed);
5748
+ n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof F && (o = n.rootElement.node), o ? this.continueMovingNode(i, o) : S(E.NotAllowed);
5736
5749
  }
5737
5750
  }).on(A.End, (i, n) => {
5738
5751
  if (this.multipleSelectionOn || this.secondaryButton)
@@ -5745,7 +5758,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5745
5758
  })
5746
5759
  ).append("xhtml:div").style("width", "100%").style("height", "100%").style("display", "flex").append("xhtml:p").style("box-sizing", "border-box").style("outline", 0).style("margin", 0).style("border", 0).style("padding", 0).style("user-select", "none").style("font-kerning", "none").style("white-space", "nowrap"), r.attr("x", 0).attr("y", 0).attr("width", (i) => `${i.width}px`).attr("height", (i) => `${i.height}px`).attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).attr("opacity", (i) => i.removed ? 0.5 : 1).select("div").style(
5747
5760
  "justify-content",
5748
- (i) => i.horizontalAlign === Lt.Center ? "center" : i.horizontalAlign === Lt.Right ? "flex-end" : "flex-start"
5761
+ (i) => i.horizontalAlign === xt.Center ? "center" : i.horizontalAlign === xt.Right ? "flex-end" : "flex-start"
5749
5762
  ).style(
5750
5763
  "align-items",
5751
5764
  (i) => i.verticalAlign === Jt.Center ? "center" : i.verticalAlign === Jt.Bottom ? "end" : "start"
@@ -5757,7 +5770,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5757
5770
  (i) => i.fit ? "default" : `${Oe(i.width, i.height, i.orientation)[1]}px`
5758
5771
  ).style("overflow", (i) => i.fit ? "default" : "clip").style("text-overflow", (i) => i.fit ? "default" : "ellipsis").style(
5759
5772
  "text-align",
5760
- (i) => i.horizontalAlign === Lt.Center ? "center" : i.horizontalAlign === Lt.Right ? "end" : "start"
5773
+ (i) => i.horizontalAlign === xt.Center ? "center" : i.horizontalAlign === xt.Right ? "end" : "start"
5761
5774
  ).style("transform", (i) => `rotate(${i.orientation}deg)`).style("font-size", (i) => `${i.fontSize}px`).style(
5762
5775
  "font-family",
5763
5776
  (i) => i.fontFamily || "'Wonder Unit Sans', sans-serif"
@@ -5791,12 +5804,12 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5791
5804
  return;
5792
5805
  }
5793
5806
  const o = new mt(i, n);
5794
- this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(w.ContextMenu) && (i.preventDefault(), this.contextMenu.open(i));
5807
+ this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(k.ContextMenu) && (i.preventDefault(), this.contextMenu.open(i));
5795
5808
  }).on($.DoubleClick, (i, n) => {
5796
5809
  const o = new pt(i, n);
5797
5810
  this.diagramEvent$.next(o);
5798
5811
  }).call(
5799
- x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i) => {
5812
+ L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i) => {
5800
5813
  (this.multipleSelectionOn || this.secondaryButton) && this.startMultipleSelection(i);
5801
5814
  }).on(A.Drag, (i) => {
5802
5815
  (this.multipleSelectionOn || this.secondaryButton) && this.continueMultipleSelection(i);
@@ -5814,7 +5827,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5814
5827
  );
5815
5828
  const a = e.exit(), l = e.enter().append("g").attr("id", (i) => i.id).attr("class", "diagram-decorator");
5816
5829
  t && t.length > 0 && (e = e.filter((i) => t.includes(i.id))), l.merge(e).attr("width", (i) => `${i.width}px`).attr("height", (i) => `${i.height}px`).attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).html((i) => i.html), a.remove(), l.on($.MouseOver, (i, n) => {
5817
- this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new Q(n)));
5830
+ this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new tt(n)));
5818
5831
  }).on($.Click, (i, n) => {
5819
5832
  if (!i.ctrlKey && !i.shiftKey) {
5820
5833
  const o = this.userSelection.all();
@@ -5837,11 +5850,11 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5837
5850
  return;
5838
5851
  }
5839
5852
  const o = new mt(i, n);
5840
- if (this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(w.ContextMenu) && n.rootElement) {
5853
+ if (this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(k.ContextMenu) && n.rootElement) {
5841
5854
  i.preventDefault();
5842
5855
  const d = ct(n.rootElement);
5843
5856
  this.userHighlight.focusOn(d), this.diagramEvent$.next(
5844
- new Q(d)
5857
+ new tt(d)
5845
5858
  ), this.userSelection.add(d), this.diagramEvent$.next(
5846
5859
  new G([d], !0)
5847
5860
  ), this.contextMenu.open(i);
@@ -5850,19 +5863,19 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5850
5863
  const o = new pt(i, n);
5851
5864
  this.diagramEvent$.next(o);
5852
5865
  }).call(
5853
- x.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
5866
+ L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
5854
5867
  if (this.multipleSelectionOn || this.secondaryButton)
5855
5868
  this.startMultipleSelection(i);
5856
5869
  else {
5857
5870
  let o;
5858
- n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof F && (o = n.rootElement.node), o ? this.startMovingNode(i, o) : S(L.NotAllowed);
5871
+ n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof F && (o = n.rootElement.node), o ? this.startMovingNode(i, o) : S(E.NotAllowed);
5859
5872
  }
5860
5873
  }).on(A.Drag, (i, n) => {
5861
5874
  if (this.multipleSelectionOn || this.secondaryButton)
5862
5875
  this.continueMultipleSelection(i);
5863
5876
  else {
5864
5877
  let o;
5865
- n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof F && (o = n.rootElement.node), o ? this.continueMovingNode(i, o) : S(L.NotAllowed);
5878
+ n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof F && (o = n.rootElement.node), o ? this.continueMovingNode(i, o) : S(E.NotAllowed);
5866
5879
  }
5867
5880
  }).on(A.End, (i, n) => {
5868
5881
  if (this.multipleSelectionOn || this.secondaryButton)
@@ -5877,7 +5890,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5877
5890
  }
5878
5891
  updateConnectionLabelsInView(t) {
5879
5892
  const e = this.selectCanvasView().select(
5880
- `[id='${pe(t.id)}']`
5893
+ `[id='${me(t.id)}']`
5881
5894
  ), l = e.select("path").node(), r = {
5882
5895
  ...V,
5883
5896
  ...t.type.label
@@ -5886,7 +5899,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5886
5899
  const i = l.getTotalLength();
5887
5900
  let n = 0, o = 0, d = 0, c = 0, h = 0, f = 0;
5888
5901
  if (r.backgroundColor === "#00000000") {
5889
- const u = t.endCoords[0] - t.startCoords[0], y = t.endCoords[1] - t.startCoords[1];
5902
+ const u = t.endCoords[0] - t.startCoords[0], v = t.endCoords[1] - t.startCoords[1];
5890
5903
  switch (t.startDirection) {
5891
5904
  case g.Top:
5892
5905
  n = u >= 0 ? -0.5 : 0.5, h = n;
@@ -5895,10 +5908,10 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5895
5908
  n = u >= 0 ? -0.5 : 0.5, h = n;
5896
5909
  break;
5897
5910
  case g.Left:
5898
- o = y > 0 ? -0.5 : 0.5, f = o;
5911
+ o = v > 0 ? -0.5 : 0.5, f = o;
5899
5912
  break;
5900
5913
  case g.Right:
5901
- o = y > 0 ? -0.5 : 0.5, f = o;
5914
+ o = v > 0 ? -0.5 : 0.5, f = o;
5902
5915
  break;
5903
5916
  default:
5904
5917
  n = 0.5, h = n, o = -0.5, f = o;
@@ -5911,15 +5924,15 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5911
5924
  h = u >= 0 ? 0.5 : -0.5;
5912
5925
  break;
5913
5926
  case g.Left:
5914
- f = y > 0 ? 0.5 : -0.5;
5927
+ f = v > 0 ? 0.5 : -0.5;
5915
5928
  break;
5916
5929
  case g.Right:
5917
- f = y > 0 ? 0.5 : -0.5;
5930
+ f = v > 0 ? 0.5 : -0.5;
5918
5931
  break;
5919
5932
  default:
5920
5933
  h = 0.5, f = -0.5;
5921
5934
  }
5922
- Math.abs(u) >= Math.abs(y) ? (d = u > 0 ? -0.5 : 0.5, c = y > 0 ? 0.5 : -0.5) : (d = u > 0 ? 0.5 : -0.5, c = y > 0 ? -0.5 : 0.5);
5935
+ Math.abs(u) >= Math.abs(v) ? (d = u > 0 ? -0.5 : 0.5, c = v > 0 ? 0.5 : -0.5) : (d = u > 0 ? 0.5 : -0.5, c = v > 0 ? -0.5 : 0.5);
5923
5936
  }
5924
5937
  e.select("g.diagram-connection-start-label text").attr("x", 0).attr("y", r.fontSize / 3).attr("text-anchor", "middle").attr("font-family", r.fontFamily).attr("font-size", r.fontSize).attr(
5925
5938
  "fill",
@@ -5927,36 +5940,36 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5927
5940
  ).style("font-kerning", "none").text(t.startLabel);
5928
5941
  const b = e.select("g.diagram-connection-start-label text").node()?.getBoundingClientRect();
5929
5942
  if (b) {
5930
- const u = t.startLabel ? b.width / this.zoomTransform.k + Ot(r) + Ht(r) : 0, y = t.startLabel ? b.height / this.zoomTransform.k + _t(r) + Vt(r) : 0;
5931
- let k;
5943
+ const u = t.startLabel ? b.width / this.zoomTransform.k + Ot(r) + Ht(r) : 0, v = t.startLabel ? b.height / this.zoomTransform.k + _t(r) + Vt(r) : 0;
5944
+ let w;
5932
5945
  switch (t.startDirection) {
5933
5946
  case g.Left:
5934
- k = l.getPointAtLength(
5935
- ot(r) + u / 2
5947
+ w = l.getPointAtLength(
5948
+ it(r) + u / 2
5936
5949
  );
5937
5950
  break;
5938
5951
  case g.Right:
5939
- k = l.getPointAtLength(
5952
+ w = l.getPointAtLength(
5940
5953
  Y(r) + u / 2
5941
5954
  );
5942
5955
  break;
5943
5956
  case g.Top:
5944
- k = l.getPointAtLength(
5945
- K(r) + u / 2
5957
+ w = l.getPointAtLength(
5958
+ q(r) + u / 2
5946
5959
  );
5947
5960
  break;
5948
5961
  case g.Bottom:
5949
- k = l.getPointAtLength(
5962
+ w = l.getPointAtLength(
5950
5963
  U(r) + u / 2
5951
5964
  );
5952
5965
  break;
5953
5966
  default:
5954
- k = l.getPointAtLength(
5967
+ w = l.getPointAtLength(
5955
5968
  Math.max(
5956
5969
  Y(r) + u / 2,
5957
- ot(r) + u / 2,
5958
- U(r) + y / 2,
5959
- K(r) + y / 2
5970
+ it(r) + u / 2,
5971
+ U(r) + v / 2,
5972
+ q(r) + v / 2
5960
5973
  )
5961
5974
  );
5962
5975
  }
@@ -5964,13 +5977,13 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5964
5977
  "d",
5965
5978
  qt(
5966
5979
  -u / 2,
5967
- -y / 2,
5980
+ -v / 2,
5968
5981
  u,
5969
- y
5982
+ v
5970
5983
  )
5971
5984
  ).attr("fill", r.backgroundColor).attr("stroke", "none"), e.select("g.diagram-connection-start-label").attr(
5972
5985
  "transform",
5973
- `translate(${k.x + n * u},${k.y + o * y})`
5986
+ `translate(${w.x + n * u},${w.y + o * v})`
5974
5987
  );
5975
5988
  }
5976
5989
  e.select("g.diagram-connection-middle-label text").attr("x", 0).attr("y", r.fontSize / 3).attr("text-anchor", "middle").attr("font-family", r.fontFamily).attr("font-size", r.fontSize).attr(
@@ -5979,18 +5992,18 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5979
5992
  ).style("font-kerning", "none").text(t.middleLabel);
5980
5993
  const m = e.select("g.diagram-connection-middle-label text").node()?.getBoundingClientRect();
5981
5994
  if (m) {
5982
- const u = t.middleLabel ? m.width / this.zoomTransform.k + Ot(r) + Ht(r) : 0, y = t.middleLabel ? m.height / this.zoomTransform.k + _t(r) + Vt(r) : 0, k = l.getPointAtLength(i / 2);
5995
+ const u = t.middleLabel ? m.width / this.zoomTransform.k + Ot(r) + Ht(r) : 0, v = t.middleLabel ? m.height / this.zoomTransform.k + _t(r) + Vt(r) : 0, w = l.getPointAtLength(i / 2);
5983
5996
  e.select("g.diagram-connection-middle-label path").attr(
5984
5997
  "d",
5985
5998
  qt(
5986
5999
  -u / 2,
5987
- -y / 2,
6000
+ -v / 2,
5988
6001
  u,
5989
- y
6002
+ v
5990
6003
  )
5991
6004
  ).attr("fill", r.backgroundColor).attr("stroke", "none"), e.select("g.diagram-connection-middle-label").attr(
5992
6005
  "transform",
5993
- `translate(${k.x + d * u},${k.y + c * y})`
6006
+ `translate(${w.x + d * u},${w.y + c * v})`
5994
6007
  );
5995
6008
  }
5996
6009
  e.select("g.diagram-connection-end-label text").attr("x", 0).attr("y", r.fontSize / 3).attr("text-anchor", "middle").attr("font-family", r.fontFamily).attr("font-size", r.fontSize).attr(
@@ -5999,36 +6012,36 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5999
6012
  ).style("font-kerning", "none").text(t.endLabel);
6000
6013
  const p = e.select("g.diagram-connection-end-label text").node()?.getBoundingClientRect();
6001
6014
  if (p) {
6002
- const u = t.endLabel ? p.width / this.zoomTransform.k + Ot(r) + Ht(r) : 0, y = t.endLabel ? p.height / this.zoomTransform.k + _t(r) + Vt(r) : 0;
6003
- let k;
6015
+ const u = t.endLabel ? p.width / this.zoomTransform.k + Ot(r) + Ht(r) : 0, v = t.endLabel ? p.height / this.zoomTransform.k + _t(r) + Vt(r) : 0;
6016
+ let w;
6004
6017
  switch (t.endDirection) {
6005
6018
  case g.Left:
6006
- k = l.getPointAtLength(
6007
- i - (ot(r) + u / 2)
6019
+ w = l.getPointAtLength(
6020
+ i - (it(r) + u / 2)
6008
6021
  );
6009
6022
  break;
6010
6023
  case g.Right:
6011
- k = l.getPointAtLength(
6024
+ w = l.getPointAtLength(
6012
6025
  i - (Y(r) + u / 2)
6013
6026
  );
6014
6027
  break;
6015
6028
  case g.Top:
6016
- k = l.getPointAtLength(
6017
- i - (K(r) + u / 2)
6029
+ w = l.getPointAtLength(
6030
+ i - (q(r) + u / 2)
6018
6031
  );
6019
6032
  break;
6020
6033
  case g.Bottom:
6021
- k = l.getPointAtLength(
6034
+ w = l.getPointAtLength(
6022
6035
  i - (U(r) + u / 2)
6023
6036
  );
6024
6037
  break;
6025
6038
  default:
6026
- k = l.getPointAtLength(
6039
+ w = l.getPointAtLength(
6027
6040
  i - Math.max(
6028
6041
  Y(r) + u / 2,
6029
- ot(r) + u / 2,
6030
- U(r) + y / 2,
6031
- K(r) + y / 2
6042
+ it(r) + u / 2,
6043
+ U(r) + v / 2,
6044
+ q(r) + v / 2
6032
6045
  )
6033
6046
  );
6034
6047
  }
@@ -6036,20 +6049,20 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6036
6049
  "d",
6037
6050
  qt(
6038
6051
  -u / 2,
6039
- -y / 2,
6052
+ -v / 2,
6040
6053
  u,
6041
- y
6054
+ v
6042
6055
  )
6043
6056
  ).attr("fill", r.backgroundColor).attr("stroke", "none"), e.select("g.diagram-connection-end-label").attr(
6044
6057
  "transform",
6045
- `translate(${k.x + h * u},${k.y + f * y})`
6058
+ `translate(${w.x + h * u},${w.y + f * v})`
6046
6059
  );
6047
6060
  }
6048
6061
  }
6049
6062
  }
6050
6063
  updateConnectionMarkersInView(t) {
6051
6064
  const e = this.selectCanvasView().select(
6052
- `[id='${pe(t.id)}']`
6065
+ `[id='${me(t.id)}']`
6053
6066
  ), a = e.select("marker.diagram-connection-start-marker"), l = e.select("marker.diagram-connection-end-marker");
6054
6067
  t.startMarkerLook !== null ? a.attr("orient", "auto-start-reverse").attr("markerWidth", t.startMarkerLook.width).attr("markerHeight", t.startMarkerLook.height).attr("refX", t.startMarkerLook.refX).attr("refY", t.startMarkerLook.refY).select("image").attr("href", t.startMarkerLook.image).attr("width", t.startMarkerLook.width).attr("height", t.startMarkerLook.height) : a.attr("orient", "auto-start-reverse").attr("markerWidth", 0).attr("markerHeight", 0), t.endMarkerLook !== null ? l.attr("orient", "auto-start-reverse").attr("markerWidth", t.endMarkerLook.width).attr("markerHeight", t.endMarkerLook.height).attr("refX", t.endMarkerLook.refX).attr("refY", t.endMarkerLook.refY).select("image").attr("href", t.endMarkerLook.image).attr("width", t.endMarkerLook.width).attr("height", t.endMarkerLook.height) : l.attr("orient", "auto-start-reverse").attr("markerWidth", 0).attr("markerHeight", 0);
6055
6068
  }
@@ -6058,7 +6071,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6058
6071
  if (!e)
6059
6072
  return !1;
6060
6073
  if (e.rootElement instanceof z || e.rootElement instanceof F) {
6061
- const a = this.minimumSizeOfField(e), l = a[0] + Y(e.rootElement.type?.label) + ot(e.rootElement.type?.label) - e.rootElement.width, r = a[1] + U(e.rootElement.type?.label) + K(e.rootElement.type?.label) - e.rootElement.height;
6074
+ const a = this.minimumSizeOfField(e), l = a[0] + Y(e.rootElement.type?.label) + it(e.rootElement.type?.label) - e.rootElement.width, r = a[1] + U(e.rootElement.type?.label) + q(e.rootElement.type?.label) - e.rootElement.height;
6062
6075
  return l <= 0 && r <= 0;
6063
6076
  }
6064
6077
  return !0;
@@ -6068,7 +6081,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6068
6081
  if (a) {
6069
6082
  if (a.rootElement instanceof z) {
6070
6083
  const l = this.minimumSizeOfField(a);
6071
- let r = l[0] + Y(a.rootElement.type.label) + ot(a.rootElement.type.label) - a.rootElement.width, i = l[1] + U(a.rootElement.type.label) + K(a.rootElement.type.label) - a.rootElement.height;
6084
+ let r = l[0] + Y(a.rootElement.type.label) + it(a.rootElement.type.label) - a.rootElement.width, i = l[1] + U(a.rootElement.type.label) + q(a.rootElement.type.label) - a.rootElement.height;
6072
6085
  this.snapToGrid && (r = Math.ceil(r / this.gridSize) * this.gridSize, i = Math.ceil(i / this.gridSize) * this.gridSize), a.rootElement.width + r < a.rootElement.type.minWidth && (r = a.rootElement.type.minWidth - a.rootElement.width), a.rootElement.height + i < a.rootElement.type.minHeight && (i = a.rootElement.type.minHeight - a.rootElement.height), (e !== !1 || r > 0) && a.rootElement.stretch(g.Right, r), (e !== !1 || i > 0) && a.rootElement.stretch(g.Bottom, i);
6073
6086
  }
6074
6087
  if (a.rootElement instanceof F) {
@@ -6084,7 +6097,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6084
6097
  )));
6085
6098
  l[0] < r && (l[0] = r), l[1] < i && (l[1] = i);
6086
6099
  const n = a.rootElement.type;
6087
- let o = l[0] + Y(n?.label) + ot(n?.label) - a.rootElement.width, d = l[1] + U(n?.label) + K(n?.label) - a.rootElement.height;
6100
+ let o = l[0] + Y(n?.label) + it(n?.label) - a.rootElement.width, d = l[1] + U(n?.label) + q(n?.label) - a.rootElement.height;
6088
6101
  this.snapToGrid && (o = Math.ceil(o / this.gridSize) * this.gridSize, d = Math.ceil(d / this.gridSize) * this.gridSize), a.rootElement.width + o < (a.rootElement.getMinWidth() || 0) && (o = (a.rootElement.getMinWidth() || 0) - a.rootElement.width), a.rootElement.height + d < (a.rootElement.getMinHeight() || 0) && (d = (a.rootElement.getMinHeight() || 0) - a.rootElement.height), (e || o > 0) && a.rootElement.node?.stretchSections(
6089
6102
  g.Right,
6090
6103
  o,
@@ -6118,10 +6131,10 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6118
6131
  }
6119
6132
  }
6120
6133
  selectRoot() {
6121
- return x.select(this.diagramRoot);
6134
+ return L.select(this.diagramRoot);
6122
6135
  }
6123
6136
  selectSVGElement() {
6124
- return x.select(this.diagramRoot).select("svg");
6137
+ return L.select(this.diagramRoot).select("svg");
6125
6138
  }
6126
6139
  selectCanvasView() {
6127
6140
  return this.selectSVGElement().select(".daga-canvas-view");
@@ -6142,8 +6155,8 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6142
6155
  this.connectionType,
6143
6156
  t,
6144
6157
  void 0,
6145
- fe
6146
- );
6158
+ ue
6159
+ ), this.unfinishedConnectionPort = t;
6147
6160
  else if (this.inferConnectionType) {
6148
6161
  let e = this.model.connections.types.all().find(
6149
6162
  (a) => t.allowsOutgoing && a.canStartFromType(t.getNode()?.type?.id || "")
@@ -6155,8 +6168,8 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6155
6168
  e,
6156
6169
  t,
6157
6170
  void 0,
6158
- fe
6159
- ));
6171
+ ue
6172
+ ), this.unfinishedConnectionPort = t);
6160
6173
  }
6161
6174
  }
6162
6175
  }
@@ -6181,7 +6194,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6181
6194
  ) && this.unfinishedConnection?.start?.allowsOutgoing && this.unfinishedConnection.type.canFinishOnType(
6182
6195
  t.getNode()?.type?.id || ""
6183
6196
  ) && t.allowsIncoming) {
6184
- const e = new de(
6197
+ const e = new ce(
6185
6198
  this,
6186
6199
  this.unfinishedConnection.type,
6187
6200
  this.unfinishedConnection.start?.id,
@@ -6193,7 +6206,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6193
6206
  ) && this.unfinishedConnection?.start?.allowsIncoming && this.unfinishedConnection.type.canStartFromType(
6194
6207
  t.getNode()?.type?.id || ""
6195
6208
  ) && t.allowsOutgoing) {
6196
- const e = new de(
6209
+ const e = new ce(
6197
6210
  this,
6198
6211
  this.unfinishedConnection.type,
6199
6212
  t.id,
@@ -6211,7 +6224,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6211
6224
  this.unfinishedConnection?.start?.getNode()?.type?.id || ""
6212
6225
  ) && this.unfinishedConnection?.start?.allowsIncoming && l.canStartFromType(t.getNode()?.type?.id || "") && t.allowsOutgoing
6213
6226
  ), a = !0), e !== void 0) {
6214
- const l = new de(
6227
+ const l = new ce(
6215
6228
  this,
6216
6229
  e,
6217
6230
  a ? t.id : this.unfinishedConnection.start?.id,
@@ -6225,7 +6238,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6225
6238
  }
6226
6239
  }
6227
6240
  dropConnection() {
6228
- this.unfinishedConnection?.setStart(void 0), this.unfinishedConnection?.setEnd(void 0), this.unfinishedConnection?.select()?.remove(), this.unfinishedConnection = void 0;
6241
+ this.unfinishedConnection?.setStart(void 0), this.unfinishedConnection?.setEnd(void 0), this.unfinishedConnection?.select()?.remove(), this.unfinishedConnection = void 0, this.unfinishedConnectionPort = void 0;
6229
6242
  }
6230
6243
  cancelAllUserActions() {
6231
6244
  this.currentAction = void 0, this.dropConnection(), this.removeInputField(), this.contextMenu.close(), this.userSelection.clear();
@@ -6242,15 +6255,15 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6242
6255
  h.text(t).style("box-sizing", "border-box").style("width", `${a}px`).style("height", `${l}px`).style("font-size", `${r}px`).style("font-family", i).style("resize", "none").style("outline", 0).style("border", 0).style("margin", 0).style("padding", 0).on($.KeyDown, (p) => {
6243
6256
  p.stopPropagation();
6244
6257
  }).on($.KeyUp, (p) => {
6245
- if (p.stopPropagation(), p.key === Z.Escape) {
6258
+ if (p.stopPropagation(), p.key === K.Escape) {
6246
6259
  const u = h.property("value");
6247
6260
  this.removeInputField(), d && d(u);
6248
6261
  }
6249
6262
  }).on($.Input, () => {
6250
6263
  const p = h.property("value");
6251
6264
  h.attr("cols", Io(p) + 1), h.attr("rows", xo(p) + 1), h.style("width", ""), h.style("height", ""), f = h.property("scrollWidth") + 1, b = h.property("scrollHeight") + 1;
6252
- const u = Math.max(f, a), y = Math.max(b, l);
6253
- c?.attr("width", `${u}px`), h.style("width", `${u}px`), c?.attr("height", `${y}px`), h.style("height", `${y}px`), o && o(p);
6265
+ const u = Math.max(f, a), v = Math.max(b, l);
6266
+ c?.attr("width", `${u}px`), h.style("width", `${u}px`), c?.attr("height", `${v}px`), h.style("height", `${v}px`), o && o(p);
6254
6267
  }).on($.Click, (p) => {
6255
6268
  p.stopPropagation();
6256
6269
  }).on($.FocusOut, () => {
@@ -6277,9 +6290,9 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6277
6290
  * Method to call to start the moving of a node triggered by a user drag event.
6278
6291
  */
6279
6292
  startMovingNode(t, e) {
6280
- if (this.canUserPerformAction(w.MoveNode) && !e.removed)
6281
- if (S(L.Grabbing), this.draggingFrom = [t.x, t.y], e.selected && this.userSelection.count((a) => a instanceof z) > 1)
6282
- this.currentAction = new le(
6293
+ if (this.canUserPerformAction(k.MoveNode) && !e.removed)
6294
+ if (S(E.Grabbing), this.draggingFrom = [t.x, t.y], e.selected && this.userSelection.count((a) => a instanceof z) > 1)
6295
+ this.currentAction = new de(
6283
6296
  this,
6284
6297
  this.userSelection.filter((a) => a instanceof z).map((a) => a.id),
6285
6298
  e.coords
@@ -6288,7 +6301,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6288
6301
  const a = e.getLastAncestor();
6289
6302
  this.currentAction = new X(
6290
6303
  this,
6291
- w.MoveNode,
6304
+ k.MoveNode,
6292
6305
  e.id,
6293
6306
  e.getGeometry(),
6294
6307
  e.getGeometry(),
@@ -6298,13 +6311,13 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6298
6311
  );
6299
6312
  }
6300
6313
  else
6301
- S(L.NotAllowed);
6314
+ S(E.NotAllowed);
6302
6315
  }
6303
6316
  /**
6304
6317
  * Method to call to continue the moving of a node triggered by a user drag event.
6305
6318
  */
6306
6319
  continueMovingNode(t, e) {
6307
- if (this.canUserPerformAction(w.MoveNode) && (this.currentAction instanceof le || this.currentAction instanceof X) && !e.removed) {
6320
+ if (this.canUserPerformAction(k.MoveNode) && (this.currentAction instanceof de || this.currentAction instanceof X) && !e.removed) {
6308
6321
  const a = [
6309
6322
  t.x - e.width / 2,
6310
6323
  t.y - e.height / 2
@@ -6319,7 +6332,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6319
6332
  * Method to call to finish the moving of a node triggered by a user drag event.
6320
6333
  */
6321
6334
  finishMovingNode(t, e) {
6322
- if (this.canUserPerformAction(w.MoveNode) && !e.removed && (this.draggingFrom[0] !== t.x || this.draggingFrom[1] !== t.y)) {
6335
+ if (this.canUserPerformAction(k.MoveNode) && !e.removed && (this.draggingFrom[0] !== t.x || this.draggingFrom[1] !== t.y)) {
6323
6336
  let a = [
6324
6337
  t.x - e.width / 2,
6325
6338
  t.y - e.height / 2
@@ -6327,7 +6340,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6327
6340
  if (this.snapToGrid && (a = this.getClosestGridPoint([
6328
6341
  a[0] - e.type.snapToGridOffset[0],
6329
6342
  a[1] - e.type.snapToGridOffset[1]
6330
- ]), a[0] += e.type.snapToGridOffset[0], a[1] += e.type.snapToGridOffset[1]), this.currentAction instanceof le) {
6343
+ ]), a[0] += e.type.snapToGridOffset[0], a[1] += e.type.snapToGridOffset[1]), this.currentAction instanceof de) {
6331
6344
  const l = this.currentAction.delta;
6332
6345
  this.currentAction.delta = [
6333
6346
  a[0] - l[0],
@@ -6372,7 +6385,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6372
6385
  }
6373
6386
  continueMultipleSelection(t) {
6374
6387
  const e = this.getPointerLocationRelativeToCanvas(t);
6375
- (this.draggingFrom[0] !== e[0] || this.draggingFrom[1] !== e[1]) && (S(L.Crosshair), this.multipleSelectionContainer?.attr(
6388
+ (this.draggingFrom[0] !== e[0] || this.draggingFrom[1] !== e[1]) && (S(E.Crosshair), this.multipleSelectionContainer?.attr(
6376
6389
  "x",
6377
6390
  Math.min(this.draggingFrom[0], e[0]) * this.zoomTransform.k + this.zoomTransform.x
6378
6391
  )?.attr(
@@ -6403,7 +6416,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6403
6416
  }
6404
6417
  };
6405
6418
  te.canvasCount = 0;
6406
- let we = te;
6419
+ let Se = te;
6407
6420
  class io {
6408
6421
  constructor() {
6409
6422
  this.grid = [[void 0]], this.offsetX = 0, this.offsetY = 0;
@@ -6656,16 +6669,16 @@ class ki {
6656
6669
  ], u = [
6657
6670
  m.coords[0] + m.width / 2,
6658
6671
  m.coords[1] + m.height / 2
6659
- ], y = Ue(
6672
+ ], v = Ue(
6660
6673
  f.coords,
6661
6674
  m.coords
6662
- ), k = [m.coords[0], m.coords[1]];
6663
- if (b.includes(m) && y > 0 && (y > e + (Math.max(f.width, f.height) + Math.max(m.width, m.height)) / 2 ? (k[0] = k[0] - (u[0] - p[0]) * r, k[1] = k[1] - (u[1] - p[1]) * r) : (k[0] = k[0] + (u[0] - p[0]) * n, k[1] = k[1] + (u[1] - p[1]) * n)), y > 0) {
6664
- const N = i / (y * y);
6665
- k[0] = k[0] + N * (u[0] - p[0]) / y, k[1] = k[1] + N * (u[1] - p[1]) / y;
6675
+ ), w = [m.coords[0], m.coords[1]];
6676
+ if (b.includes(m) && v > 0 && (v > e + (Math.max(f.width, f.height) + Math.max(m.width, m.height)) / 2 ? (w[0] = w[0] - (u[0] - p[0]) * r, w[1] = w[1] - (u[1] - p[1]) * r) : (w[0] = w[0] + (u[0] - p[0]) * n, w[1] = w[1] + (u[1] - p[1]) * n)), v > 0) {
6677
+ const I = i / (v * v);
6678
+ w[0] = w[0] + I * (u[0] - p[0]) / v, w[1] = w[1] + I * (u[1] - p[1]) / v;
6666
6679
  } else
6667
- k[0] = k[0] + o * (Math.random() * 2 - 1), k[1] = k[1] + o * (Math.random() * 2 - 1);
6668
- k[0] = k[0] - (u[0] - h[0]) * d, k[1] = k[1] - (u[1] - h[1]) * d, k[0] - m.coords[0] > c ? k[0] = m.coords[0] + c : k[0] - m.coords[0] < -c && (k[0] = m.coords[0] - c), k[1] - m.coords[1] > c ? k[1] = m.coords[1] + c : k[1] - m.coords[1] < -c && (k[1] = m.coords[1] - c), m.move(k);
6680
+ w[0] = w[0] + o * (Math.random() * 2 - 1), w[1] = w[1] + o * (Math.random() * 2 - 1);
6681
+ w[0] = w[0] - (u[0] - h[0]) * d, w[1] = w[1] - (u[1] - h[1]) * d, w[0] - m.coords[0] > c ? w[0] = m.coords[0] + c : w[0] - m.coords[0] < -c && (w[0] = m.coords[0] - c), w[1] - m.coords[1] > c ? w[1] = m.coords[1] + c : w[1] - m.coords[1] < -c && (w[1] = m.coords[1] - c), m.move(w);
6669
6682
  }
6670
6683
  }
6671
6684
  }
@@ -6743,8 +6756,8 @@ class Si {
6743
6756
  break;
6744
6757
  } else {
6745
6758
  const u = m.getAdjacentNodes();
6746
- for (const y of u)
6747
- f.includes(y) || (h.push(y), f.push(y));
6759
+ for (const v of u)
6760
+ f.includes(v) || (h.push(v), f.push(v));
6748
6761
  }
6749
6762
  }
6750
6763
  b || i[i.length - 1].push(c);
@@ -6782,7 +6795,7 @@ class Ci {
6782
6795
  for (; r.length > 0; ) {
6783
6796
  const c = r[0];
6784
6797
  r.splice(0, 1);
6785
- const h = new Ae(void 0, c);
6798
+ const h = new Ie(void 0, c);
6786
6799
  no(h, r), i.push(h);
6787
6800
  }
6788
6801
  const n = [];
@@ -6823,12 +6836,12 @@ const no = (s, t) => {
6823
6836
  t[e].push(a), ro(a, t, e + 1);
6824
6837
  }
6825
6838
  };
6826
- class Ae {
6839
+ class Ie {
6827
6840
  constructor(t, e) {
6828
6841
  this.parent = t, this.branches = [], this.depth = 0, this.node = e;
6829
6842
  }
6830
6843
  addBranch(t) {
6831
- const e = new Ae(this, t);
6844
+ const e = new Ie(this, t);
6832
6845
  return e.depth = this.depth + 1, this.branches.push(e), e;
6833
6846
  }
6834
6847
  countBranchHeight() {
@@ -6866,7 +6879,7 @@ const _e = {
6866
6879
  priority: new Si(),
6867
6880
  tree: new Ci(),
6868
6881
  vertical: new $i()
6869
- }, Ai = Fe({}), $t = Fe({});
6882
+ }, Ai = Fe({}), Ct = Fe({});
6870
6883
  class Ii {
6871
6884
  constructor(t, e) {
6872
6885
  this.onTitleChange = t, this.onValueSetChange = e;
@@ -6886,7 +6899,7 @@ class Ii {
6886
6899
  highlightProperty(...t) {
6887
6900
  }
6888
6901
  }
6889
- const Ie = ({
6902
+ const xe = ({
6890
6903
  direction: s,
6891
6904
  collapsableSelector: t,
6892
6905
  collapsableAdditionalSelector: e,
@@ -6903,11 +6916,11 @@ const Ie = ({
6903
6916
  c(b), o?.(b);
6904
6917
  let m;
6905
6918
  if (typeof t == "string")
6906
- m = x.select(t), e && (m = m.select(e));
6919
+ m = L.select(t), e && (m = m.select(e));
6907
6920
  else {
6908
6921
  const p = t;
6909
6922
  if (!p) throw new Error("collapsableSelector is not a valid ref");
6910
- m = x.select(p.current), e && (m = m.select(e));
6923
+ m = L.select(p.current), e && (m = m.select(e));
6911
6924
  }
6912
6925
  m.style(r, b ? i : n);
6913
6926
  }
@@ -6923,16 +6936,16 @@ const Ie = ({
6923
6936
  return l ? "daga-vertical-none" : d ? "daga-vertical-up" : "daga-vertical-down";
6924
6937
  }
6925
6938
  };
6926
- return /* @__PURE__ */ v("daga-collapse-button", { children: /* @__PURE__ */ v(
6939
+ return /* @__PURE__ */ y("daga-collapse-button", { children: /* @__PURE__ */ y(
6927
6940
  "button",
6928
6941
  {
6929
6942
  className: `daga-collapse-button daga-${s}`,
6930
6943
  onClick: h,
6931
- children: /* @__PURE__ */ v("div", { className: f() })
6944
+ children: /* @__PURE__ */ y("div", { className: f() })
6932
6945
  }
6933
6946
  ) });
6934
6947
  }, xi = () => {
6935
- const s = Dt($t), t = rt(null), [e, a] = D([]);
6948
+ const s = Dt(Ct), t = rt(null), [e, a] = D([]);
6936
6949
  fo(s.validatorChange$, s.diagramChange$).pipe(
6937
6950
  uo(() => l())
6938
6951
  ).subscribe();
@@ -6958,15 +6971,15 @@ const Ie = ({
6958
6971
  ...i.propertyNames
6959
6972
  ));
6960
6973
  };
6961
- return /* @__PURE__ */ v("daga-errors", { children: /* @__PURE__ */ T("div", { ref: t, className: "daga-errors", children: [
6962
- e.length === 0 && /* @__PURE__ */ v("div", { className: "daga-errors-summary daga-no-errors daga-prevent-user-select", children: /* @__PURE__ */ v("span", { children: "No errors found" }) }),
6963
- e.length > 0 && /* @__PURE__ */ T("div", { className: "daga-errors-summary daga-with-errors daga-prevent-user-select", children: [
6964
- /* @__PURE__ */ T("span", { children: [
6974
+ return /* @__PURE__ */ y("daga-errors", { children: /* @__PURE__ */ M("div", { ref: t, className: "daga-errors", children: [
6975
+ e.length === 0 && /* @__PURE__ */ y("div", { className: "daga-errors-summary daga-no-errors daga-prevent-user-select", children: /* @__PURE__ */ y("span", { children: "No errors found" }) }),
6976
+ e.length > 0 && /* @__PURE__ */ M("div", { className: "daga-errors-summary daga-with-errors daga-prevent-user-select", children: [
6977
+ /* @__PURE__ */ M("span", { children: [
6965
6978
  e.length,
6966
6979
  " errors found"
6967
6980
  ] }),
6968
- /* @__PURE__ */ v("div", { className: "daga-collapse-button-container", children: /* @__PURE__ */ v(
6969
- Ie,
6981
+ /* @__PURE__ */ y("div", { className: "daga-collapse-button-container", children: /* @__PURE__ */ y(
6982
+ xe,
6970
6983
  {
6971
6984
  collapsableSelector: t,
6972
6985
  collapsableAdditionalSelector: ".daga-error-panel",
@@ -6979,7 +6992,7 @@ const Ie = ({
6979
6992
  }
6980
6993
  ) })
6981
6994
  ] }),
6982
- e.length > 0 && /* @__PURE__ */ v("div", { className: "daga-error-panel", children: /* @__PURE__ */ v("ol", { children: e.map((i, n) => /* @__PURE__ */ v(
6995
+ e.length > 0 && /* @__PURE__ */ y("div", { className: "daga-error-panel", children: /* @__PURE__ */ y("ol", { children: e.map((i, n) => /* @__PURE__ */ y(
6983
6996
  "li",
6984
6997
  {
6985
6998
  onClick: () => r(i),
@@ -6996,113 +7009,113 @@ const Ie = ({
6996
7009
  }) => {
6997
7010
  const l = rt(null), [r, i] = D("");
6998
7011
  let n;
6999
- const [o, d] = D([]), [c, h] = D([]), [f, b] = D([]), [m, p] = D([]), [u, y] = D(!1);
7000
- Ct(() => {
7001
- i(t.find((I) => St(I.key, e))?.label || "");
7012
+ const [o, d] = D([]), [c, h] = D([]), [f, b] = D([]), [m, p] = D([]), [u, v] = D(!1);
7013
+ St(() => {
7014
+ i(t.find((x) => wt(x.key, e))?.label || "");
7002
7015
  }, [e, t]);
7003
- const k = (I) => {
7016
+ const w = (x) => {
7004
7017
  if (!s)
7005
- switch (I.key) {
7006
- case Z.PageDown:
7007
- n === void 0 ? (P(0), E(0)) : (P(n + 5), E(n)), I.preventDefault();
7018
+ switch (x.key) {
7019
+ case K.PageDown:
7020
+ n === void 0 ? (P(0), T(0)) : (P(n + 5), T(n)), x.preventDefault();
7008
7021
  break;
7009
- case Z.ArrowDown:
7010
- n === void 0 ? (P(0), E(0)) : (P(n + 1), E(n)), I.preventDefault();
7022
+ case K.ArrowDown:
7023
+ n === void 0 ? (P(0), T(0)) : (P(n + 1), T(n)), x.preventDefault();
7011
7024
  break;
7012
- case Z.PageUp:
7013
- n === void 0 ? (P(t.length - 1), E(t.length - 1)) : (P(n - 5), E(n)), I.preventDefault();
7025
+ case K.PageUp:
7026
+ n === void 0 ? (P(t.length - 1), T(t.length - 1)) : (P(n - 5), T(n)), x.preventDefault();
7014
7027
  break;
7015
- case Z.ArrowUp:
7016
- n === void 0 ? (P(t.length - 1), E(t.length - 1)) : (P(n - 1), E(n)), I.preventDefault();
7028
+ case K.ArrowUp:
7029
+ n === void 0 ? (P(t.length - 1), T(t.length - 1)) : (P(n - 1), T(n)), x.preventDefault();
7017
7030
  break;
7018
- case Z.Escape:
7019
- R(), I.preventDefault();
7031
+ case K.Escape:
7032
+ R(), x.preventDefault();
7020
7033
  break;
7021
- case Z.Enter:
7022
- O(t[n || 0]), I.preventDefault();
7034
+ case K.Enter:
7035
+ O(t[n || 0]), x.preventDefault();
7023
7036
  break;
7024
7037
  default:
7025
- N();
7038
+ I();
7026
7039
  }
7027
- }, N = () => {
7040
+ }, I = () => {
7028
7041
  if (!s) {
7029
- const I = Ge(r.trim());
7042
+ const x = Ge(r.trim());
7030
7043
  d([]), h([]), b([]), p([]);
7031
7044
  for (const _ of t) {
7032
- const q = Ge(_.label).indexOf(I);
7033
- if (q >= 0) {
7034
- const Bt = _.label.substring(0, q), J = _.label.substring(
7035
- q,
7036
- q + I.length
7037
- ), wt = _.label.substring(
7038
- q + I.length
7045
+ const J = Ge(_.label).indexOf(x);
7046
+ if (J >= 0) {
7047
+ const Bt = _.label.substring(0, J), Pt = _.label.substring(
7048
+ J,
7049
+ J + x.length
7050
+ ), Z = _.label.substring(
7051
+ J + x.length
7039
7052
  );
7040
- d((nt) => [...nt, _]), h((nt) => [
7041
- ...nt,
7053
+ d((Q) => [...Q, _]), h((Q) => [
7054
+ ...Q,
7042
7055
  Bt
7043
- ]), b((nt) => [
7044
- ...nt,
7045
- J
7046
- ]), p((nt) => [
7047
- ...nt,
7048
- wt
7056
+ ]), b((Q) => [
7057
+ ...Q,
7058
+ Pt
7059
+ ]), p((Q) => [
7060
+ ...Q,
7061
+ Z
7049
7062
  ]);
7050
7063
  }
7051
7064
  }
7052
- y(!0);
7065
+ v(!0);
7053
7066
  }
7054
7067
  }, R = () => {
7055
- y(!1);
7056
- }, P = (I) => {
7068
+ v(!1);
7069
+ }, P = (x) => {
7057
7070
  if (!s) {
7058
- if (n = I, I === void 0)
7071
+ if (n = x, x === void 0)
7059
7072
  return;
7060
- I < 0 && (n = 0), I >= t.length && (n = t.length - 1);
7073
+ x < 0 && (n = 0), x >= t.length && (n = t.length - 1);
7061
7074
  }
7062
- }, tt = () => {
7075
+ }, et = () => {
7063
7076
  setTimeout(() => {
7064
7077
  R();
7065
7078
  }, Li);
7066
- }, E = (I) => {
7067
- const _ = l.current?.querySelectorAll("li")[I];
7079
+ }, T = (x) => {
7080
+ const _ = l.current?.querySelectorAll("li")[x];
7068
7081
  _ && _.scrollIntoView({ block: "center" });
7069
7082
  }, C = () => {
7070
- s || (i(""), y(!1), n = void 0);
7071
- }, O = (I) => {
7072
- s || (i(I.label), y(!1), n = void 0, a(I.key));
7083
+ s || (i(""), v(!1), n = void 0);
7084
+ }, O = (x) => {
7085
+ s || (i(x.label), v(!1), n = void 0, a(x.key));
7073
7086
  };
7074
- return /* @__PURE__ */ T(
7087
+ return /* @__PURE__ */ M(
7075
7088
  "div",
7076
7089
  {
7077
7090
  ref: l,
7078
7091
  className: `daga-autocomplete ${u ? "daga-showing-options" : ""}`,
7079
7092
  children: [
7080
- /* @__PURE__ */ T("div", { className: "daga-autocomplete-input", children: [
7081
- /* @__PURE__ */ v(
7093
+ /* @__PURE__ */ M("div", { className: "daga-autocomplete-input", children: [
7094
+ /* @__PURE__ */ y(
7082
7095
  "input",
7083
7096
  {
7084
7097
  value: r,
7085
7098
  disabled: s,
7086
- onKeyUp: k,
7087
- onFocus: N,
7088
- onBlur: tt,
7089
- onChange: (I) => i(I.target.value)
7099
+ onKeyUp: w,
7100
+ onFocus: I,
7101
+ onBlur: et,
7102
+ onChange: (x) => i(x.target.value)
7090
7103
  }
7091
7104
  ),
7092
- r !== "" && /* @__PURE__ */ v("button", { className: "daga-clear", onClick: C })
7105
+ r !== "" && /* @__PURE__ */ y("button", { className: "daga-clear", onClick: C })
7093
7106
  ] }),
7094
- /* @__PURE__ */ v("div", { className: "daga-autocomplete-options", children: /* @__PURE__ */ T("ul", { className: "daga-autocomplete-option-list", children: [
7095
- o.length === 0 && /* @__PURE__ */ v("li", { className: "daga-autocomplete-option no-options", children: "(No options)" }),
7096
- o.map((I, _) => /* @__PURE__ */ T(
7107
+ /* @__PURE__ */ y("div", { className: "daga-autocomplete-options", children: /* @__PURE__ */ M("ul", { className: "daga-autocomplete-option-list", children: [
7108
+ o.length === 0 && /* @__PURE__ */ y("li", { className: "daga-autocomplete-option no-options", children: "(No options)" }),
7109
+ o.map((x, _) => /* @__PURE__ */ M(
7097
7110
  "li",
7098
7111
  {
7099
7112
  className: `daga-autocomplete-option ${_ === n ? "daga-focused" : ""}`,
7100
7113
  onMouseMove: () => P(_),
7101
- onClick: () => O(I),
7114
+ onClick: () => O(x),
7102
7115
  children: [
7103
- /* @__PURE__ */ v("span", { children: c[_] }),
7104
- /* @__PURE__ */ v("span", { className: "daga-match", children: f[_] }),
7105
- /* @__PURE__ */ v("span", { children: m[_] })
7116
+ /* @__PURE__ */ y("span", { children: c[_] }),
7117
+ /* @__PURE__ */ y("span", { className: "daga-match", children: f[_] }),
7118
+ /* @__PURE__ */ y("span", { children: m[_] })
7106
7119
  ]
7107
7120
  },
7108
7121
  _
@@ -7119,17 +7132,17 @@ const Ie = ({
7119
7132
  onChange: l
7120
7133
  }) => {
7121
7134
  const [r, i] = D(), [n, o] = D([]), [d, c] = D([]);
7122
- Ct(() => {
7123
- const u = a.length === 0, y = a.map((k) => Ei(e, k));
7124
- o(y), u && l(a), p();
7135
+ St(() => {
7136
+ const u = a.length === 0, v = a.map((w) => Ei(e, w));
7137
+ o(v), u && l(a), p();
7125
7138
  }, [a, e]);
7126
7139
  const h = (u) => {
7127
- for (const y of a)
7128
- if (y === u)
7140
+ for (const v of a)
7141
+ if (v === u)
7129
7142
  return !0;
7130
7143
  return !1;
7131
7144
  }, f = (u) => {
7132
- a.length > u && (a.splice(u, 1), o(n.filter((y, k) => k !== u)), l(a), p());
7145
+ a.length > u && (a.splice(u, 1), o(n.filter((v, w) => w !== u)), l(a), p());
7133
7146
  }, b = () => {
7134
7147
  r !== void 0 && (t || !h(r)) && (l(a.concat(r)), m());
7135
7148
  }, m = () => {
@@ -7137,25 +7150,25 @@ const Ie = ({
7137
7150
  }, p = () => {
7138
7151
  if (!t) {
7139
7152
  const u = [];
7140
- for (const y of e)
7141
- h(y.key) || u.push(y);
7153
+ for (const v of e)
7154
+ h(v.key) || u.push(v);
7142
7155
  c(u);
7143
7156
  }
7144
7157
  };
7145
- return /* @__PURE__ */ T("div", { children: [
7146
- a.map((u, y) => /* @__PURE__ */ T("div", { className: "daga-value-item-element", children: [
7147
- /* @__PURE__ */ v("span", { className: "daga-input", children: n[y] }),
7148
- !s && /* @__PURE__ */ v(
7158
+ return /* @__PURE__ */ M("div", { children: [
7159
+ a.map((u, v) => /* @__PURE__ */ M("div", { className: "daga-value-item-element", children: [
7160
+ /* @__PURE__ */ y("span", { className: "daga-input", children: n[v] }),
7161
+ !s && /* @__PURE__ */ y(
7149
7162
  "button",
7150
7163
  {
7151
7164
  className: "daga-property-button",
7152
- onClick: () => f(y),
7153
- children: /* @__PURE__ */ v("div", { className: "daga-icon daga-close-icon" })
7165
+ onClick: () => f(v),
7166
+ children: /* @__PURE__ */ y("div", { className: "daga-icon daga-close-icon" })
7154
7167
  }
7155
7168
  )
7156
- ] }, y)),
7157
- !s && /* @__PURE__ */ T("div", { className: "daga-value-item-input", children: [
7158
- /* @__PURE__ */ v("div", { className: "daga-input daga-relatively-positioned", children: /* @__PURE__ */ v(
7169
+ ] }, v)),
7170
+ !s && /* @__PURE__ */ M("div", { className: "daga-value-item-input", children: [
7171
+ /* @__PURE__ */ y("div", { className: "daga-input daga-relatively-positioned", children: /* @__PURE__ */ y(
7159
7172
  ao,
7160
7173
  {
7161
7174
  disabled: s,
@@ -7164,7 +7177,7 @@ const Ie = ({
7164
7177
  onChange: i
7165
7178
  }
7166
7179
  ) }),
7167
- /* @__PURE__ */ v("button", { className: "daga-property-button", onClick: b, children: /* @__PURE__ */ v("div", { className: "daga-icon daga-add-icon" }) })
7180
+ /* @__PURE__ */ y("button", { className: "daga-property-button", onClick: b, children: /* @__PURE__ */ y("div", { className: "daga-icon daga-add-icon" }) })
7168
7181
  ] })
7169
7182
  ] });
7170
7183
  }, Mi = ({
@@ -7182,7 +7195,7 @@ const Ie = ({
7182
7195
  e.length > f && a(e.filter((b, m) => m !== f));
7183
7196
  }, o = (f, b, m) => {
7184
7197
  const p = e.map(
7185
- (u, y) => y === b ? m === "blur" ? f.trim() : f : u
7198
+ (u, v) => v === b ? m === "blur" ? f.trim() : f : u
7186
7199
  );
7187
7200
  a(p);
7188
7201
  }, d = () => {
@@ -7193,9 +7206,9 @@ const Ie = ({
7193
7206
  }, h = (f) => {
7194
7207
  f.key === "Enter" && d();
7195
7208
  };
7196
- return /* @__PURE__ */ T(ho, { children: [
7197
- e.map((f, b) => /* @__PURE__ */ T("div", { className: "daga-value-item-element", children: [
7198
- /* @__PURE__ */ v(
7209
+ return /* @__PURE__ */ M(ho, { children: [
7210
+ e.map((f, b) => /* @__PURE__ */ M("div", { className: "daga-value-item-element", children: [
7211
+ /* @__PURE__ */ y(
7199
7212
  "input",
7200
7213
  {
7201
7214
  className: "daga-input",
@@ -7205,18 +7218,18 @@ const Ie = ({
7205
7218
  onBlur: (m) => o(m.target.value, b, "blur")
7206
7219
  }
7207
7220
  ),
7208
- /* @__PURE__ */ v(
7221
+ /* @__PURE__ */ y(
7209
7222
  "button",
7210
7223
  {
7211
7224
  className: "daga-property-button",
7212
7225
  onClick: () => n(b),
7213
- children: /* @__PURE__ */ v("div", { className: "daga-icon daga-close-icon" })
7226
+ children: /* @__PURE__ */ y("div", { className: "daga-icon daga-close-icon" })
7214
7227
  }
7215
7228
  )
7216
7229
  ] }, b)),
7217
- !s && /* @__PURE__ */ T("div", { className: "daga-value-item-input", children: [
7218
- /* @__PURE__ */ T("div", { className: "daga-input daga-relatively-positioned", children: [
7219
- /* @__PURE__ */ v(
7230
+ !s && /* @__PURE__ */ M("div", { className: "daga-value-item-input", children: [
7231
+ /* @__PURE__ */ M("div", { className: "daga-input daga-relatively-positioned", children: [
7232
+ /* @__PURE__ */ y(
7220
7233
  "input",
7221
7234
  {
7222
7235
  type: "text",
@@ -7225,9 +7238,9 @@ const Ie = ({
7225
7238
  onChange: (f) => r(f.target.value)
7226
7239
  }
7227
7240
  ),
7228
- /* @__PURE__ */ v("button", { className: "daga-clear", onClick: c })
7241
+ /* @__PURE__ */ y("button", { className: "daga-clear", onClick: c })
7229
7242
  ] }),
7230
- /* @__PURE__ */ v("button", { className: "daga-property-button", onClick: d, children: /* @__PURE__ */ v("div", { className: "daga-icon daga-add-icon" }) })
7243
+ /* @__PURE__ */ y("button", { className: "daga-property-button", onClick: d, children: /* @__PURE__ */ y("div", { className: "daga-icon daga-add-icon" }) })
7231
7244
  ] })
7232
7245
  ] });
7233
7246
  }, Ni = ({
@@ -7236,42 +7249,42 @@ const Ie = ({
7236
7249
  onChange: e
7237
7250
  }) => {
7238
7251
  const [a, l] = D(""), [r, i] = D(""), [n, o] = D({}), d = (u) => {
7239
- const y = {};
7240
- Object.keys(t).forEach((k) => {
7241
- k !== u && (y[k] = t[k]);
7242
- }), e(y);
7243
- }, c = (u, y, k) => {
7244
- const N = k === "blur" ? y.trim() : y;
7245
- if (k === "blur") {
7246
- if (u !== N) {
7252
+ const v = {};
7253
+ Object.keys(t).forEach((w) => {
7254
+ w !== u && (v[w] = t[w]);
7255
+ }), e(v);
7256
+ }, c = (u, v, w) => {
7257
+ const I = w === "blur" ? v.trim() : v;
7258
+ if (w === "blur") {
7259
+ if (u !== I) {
7247
7260
  const R = {};
7248
7261
  Object.keys(t).forEach((P) => {
7249
- P === u ? R[N] = t[P] : R[P] = t[P];
7262
+ P === u ? R[I] = t[P] : R[P] = t[P];
7250
7263
  }), e(R), o((P) => {
7251
- const tt = { ...P };
7252
- return delete tt[u], tt;
7264
+ const et = { ...P };
7265
+ return delete et[u], et;
7253
7266
  });
7254
7267
  }
7255
7268
  } else
7256
7269
  o((R) => ({
7257
7270
  ...R,
7258
- [u]: y
7271
+ [u]: v
7259
7272
  }));
7260
- }, h = (u, y, k) => {
7261
- const N = k === "blur" ? y.trim() : y;
7262
- if (N !== "") {
7273
+ }, h = (u, v, w) => {
7274
+ const I = w === "blur" ? v.trim() : v;
7275
+ if (I !== "") {
7263
7276
  const R = {};
7264
7277
  Object.keys(t).forEach((P) => {
7265
- P === u ? R[P] = N : R[P] = t[P];
7278
+ P === u ? R[P] = I : R[P] = t[P];
7266
7279
  }), e(R);
7267
7280
  }
7268
7281
  }, f = () => {
7269
- const u = a.trim(), y = r.trim();
7270
- if (u !== "" && y !== "") {
7271
- const k = {};
7272
- Object.keys(t).forEach((N) => {
7273
- k[N] = t[N];
7274
- }), k[u] = y, e(k), l(""), i("");
7282
+ const u = a.trim(), v = r.trim();
7283
+ if (u !== "" && v !== "") {
7284
+ const w = {};
7285
+ Object.keys(t).forEach((I) => {
7286
+ w[I] = t[I];
7287
+ }), w[u] = v, e(w), l(""), i("");
7275
7288
  }
7276
7289
  }, b = () => {
7277
7290
  l("");
@@ -7280,44 +7293,44 @@ const Ie = ({
7280
7293
  }, p = (u) => {
7281
7294
  u.key === "Enter" && f();
7282
7295
  };
7283
- return /* @__PURE__ */ T("div", { children: [
7284
- Object.entries(t).map(([u, y], k) => /* @__PURE__ */ T("div", { className: "daga-value-item-element", children: [
7285
- /* @__PURE__ */ v(
7296
+ return /* @__PURE__ */ M("div", { children: [
7297
+ Object.entries(t).map(([u, v], w) => /* @__PURE__ */ M("div", { className: "daga-value-item-element", children: [
7298
+ /* @__PURE__ */ y(
7286
7299
  "input",
7287
7300
  {
7288
- id: `key-${k}`,
7301
+ id: `key-${w}`,
7289
7302
  className: "daga-input",
7290
7303
  type: "text",
7291
7304
  disabled: s,
7292
7305
  value: n[u] ?? u,
7293
- onChange: (N) => c(u, N.target.value, "change"),
7294
- onBlur: (N) => c(u, N.target.value, "blur")
7306
+ onChange: (I) => c(u, I.target.value, "change"),
7307
+ onBlur: (I) => c(u, I.target.value, "blur")
7295
7308
  }
7296
7309
  ),
7297
- /* @__PURE__ */ v(
7310
+ /* @__PURE__ */ y(
7298
7311
  "input",
7299
7312
  {
7300
- id: `value-${k}`,
7313
+ id: `value-${w}`,
7301
7314
  className: "daga-input",
7302
7315
  type: "text",
7303
7316
  disabled: s,
7304
- value: y,
7305
- onChange: (N) => h(u, N.target.value, "change"),
7306
- onBlur: (N) => h(u, N.target.value, "blur")
7317
+ value: v,
7318
+ onChange: (I) => h(u, I.target.value, "change"),
7319
+ onBlur: (I) => h(u, I.target.value, "blur")
7307
7320
  }
7308
7321
  ),
7309
- /* @__PURE__ */ v(
7322
+ /* @__PURE__ */ y(
7310
7323
  "button",
7311
7324
  {
7312
7325
  className: "daga-property-button",
7313
7326
  onClick: () => d(u),
7314
- children: /* @__PURE__ */ v("div", { className: "daga-icon daga-close-icon" })
7327
+ children: /* @__PURE__ */ y("div", { className: "daga-icon daga-close-icon" })
7315
7328
  }
7316
7329
  )
7317
7330
  ] }, u)),
7318
- !s && /* @__PURE__ */ T("div", { className: "daga-value-item-input", children: [
7319
- /* @__PURE__ */ T("div", { className: "daga-input daga-relatively-positioned", children: [
7320
- /* @__PURE__ */ v(
7331
+ !s && /* @__PURE__ */ M("div", { className: "daga-value-item-input", children: [
7332
+ /* @__PURE__ */ M("div", { className: "daga-input daga-relatively-positioned", children: [
7333
+ /* @__PURE__ */ y(
7321
7334
  "input",
7322
7335
  {
7323
7336
  type: "text",
@@ -7327,10 +7340,10 @@ const Ie = ({
7327
7340
  onBlur: (u) => c(a, u.target.value, "blur")
7328
7341
  }
7329
7342
  ),
7330
- /* @__PURE__ */ v("button", { className: "daga-clear", onClick: b })
7343
+ /* @__PURE__ */ y("button", { className: "daga-clear", onClick: b })
7331
7344
  ] }),
7332
- /* @__PURE__ */ T("div", { className: "daga-input daga-relatively-positioned", children: [
7333
- /* @__PURE__ */ v(
7345
+ /* @__PURE__ */ M("div", { className: "daga-input daga-relatively-positioned", children: [
7346
+ /* @__PURE__ */ y(
7334
7347
  "input",
7335
7348
  {
7336
7349
  type: "text",
@@ -7340,9 +7353,9 @@ const Ie = ({
7340
7353
  onBlur: (u) => h(a, u.target.value, "blur")
7341
7354
  }
7342
7355
  ),
7343
- /* @__PURE__ */ v("button", { className: "daga-clear", onClick: m })
7356
+ /* @__PURE__ */ y("button", { className: "daga-clear", onClick: m })
7344
7357
  ] }),
7345
- /* @__PURE__ */ v("button", { className: "daga-property-button", onClick: f, children: /* @__PURE__ */ v("div", { className: "daga-icon daga-add-icon" }) })
7358
+ /* @__PURE__ */ y("button", { className: "daga-property-button", onClick: f, children: /* @__PURE__ */ y("div", { className: "daga-icon daga-add-icon" }) })
7346
7359
  ] })
7347
7360
  ] });
7348
7361
  }, lo = ({
@@ -7350,7 +7363,7 @@ const Ie = ({
7350
7363
  onValueChange: t,
7351
7364
  depth: e
7352
7365
  }) => {
7353
- const l = Dt($t).canUserPerformAction(w.UpdateValues) && s?.rootElement?.removed !== !0, r = (o) => "daga-property-name-" + o.replace(/\s/g, ""), i = (o) => {
7366
+ const l = Dt(Ct).canUserPerformAction(k.UpdateValues) && s?.rootElement?.removed !== !0, r = (o) => "daga-property-name-" + o.replace(/\s/g, ""), i = (o) => {
7354
7367
  if (typeof o == "string")
7355
7368
  return o;
7356
7369
  if (o == null || isNaN(o.valueOf()))
@@ -7358,13 +7371,13 @@ const Ie = ({
7358
7371
  const d = new Date(o), c = d.getTimezoneOffset();
7359
7372
  return d.setMinutes(d.getMinutes() - c), d.toISOString().substring(0, 19);
7360
7373
  }, n = (o) => new Date(o);
7361
- return /* @__PURE__ */ v("daga-object-editor", { children: s.displayedProperties.map((o) => /* @__PURE__ */ T(
7374
+ return /* @__PURE__ */ y("daga-object-editor", { children: s.displayedProperties.map((o) => /* @__PURE__ */ M(
7362
7375
  "div",
7363
7376
  {
7364
7377
  className: `daga-property ${r(o.name)}`,
7365
7378
  children: [
7366
- /* @__PURE__ */ v("p", { className: "daga-property-name", children: o.label || o.name }),
7367
- o.type === M.Text && /* @__PURE__ */ v(
7379
+ /* @__PURE__ */ y("p", { className: "daga-property-name", children: o.label || o.name }),
7380
+ o.type === N.Text && /* @__PURE__ */ y(
7368
7381
  "input",
7369
7382
  {
7370
7383
  type: "daga-text",
@@ -7373,7 +7386,7 @@ const Ie = ({
7373
7386
  onChange: (d) => t(s, o, d.target.value)
7374
7387
  }
7375
7388
  ),
7376
- o.type === M.TextArea && /* @__PURE__ */ v(
7389
+ o.type === N.TextArea && /* @__PURE__ */ y(
7377
7390
  "textarea",
7378
7391
  {
7379
7392
  disabled: o.editable === !1 || !l,
@@ -7381,7 +7394,7 @@ const Ie = ({
7381
7394
  onChange: (d) => t(s, o, d.target.value)
7382
7395
  }
7383
7396
  ),
7384
- o.type === M.Number && /* @__PURE__ */ v(
7397
+ o.type === N.Number && /* @__PURE__ */ y(
7385
7398
  "input",
7386
7399
  {
7387
7400
  type: "number",
@@ -7390,7 +7403,7 @@ const Ie = ({
7390
7403
  onChange: (d) => t(s, o, d.target.value)
7391
7404
  }
7392
7405
  ),
7393
- o.type === M.Color && /* @__PURE__ */ v(
7406
+ o.type === N.Color && /* @__PURE__ */ y(
7394
7407
  "input",
7395
7408
  {
7396
7409
  type: "text",
@@ -7400,7 +7413,7 @@ const Ie = ({
7400
7413
  onChange: (d) => t(s, o, d.target.value)
7401
7414
  }
7402
7415
  ),
7403
- o.type === M.Datetime && /* @__PURE__ */ v(
7416
+ o.type === N.Datetime && /* @__PURE__ */ y(
7404
7417
  "input",
7405
7418
  {
7406
7419
  type: "datetime-local",
@@ -7415,7 +7428,7 @@ const Ie = ({
7415
7428
  )
7416
7429
  }
7417
7430
  ),
7418
- o.type === M.Date && /* @__PURE__ */ v(
7431
+ o.type === N.Date && /* @__PURE__ */ y(
7419
7432
  "input",
7420
7433
  {
7421
7434
  type: "date",
@@ -7424,7 +7437,7 @@ const Ie = ({
7424
7437
  onChange: (d) => t(s, o, d.target.value)
7425
7438
  }
7426
7439
  ),
7427
- o.type === M.Time && /* @__PURE__ */ v(
7440
+ o.type === N.Time && /* @__PURE__ */ y(
7428
7441
  "input",
7429
7442
  {
7430
7443
  type: "time",
@@ -7433,7 +7446,7 @@ const Ie = ({
7433
7446
  onChange: (d) => t(s, o, d.target.value)
7434
7447
  }
7435
7448
  ),
7436
- o.type === M.Url && /* @__PURE__ */ v(
7449
+ o.type === N.Url && /* @__PURE__ */ y(
7437
7450
  "input",
7438
7451
  {
7439
7452
  type: "url",
@@ -7442,13 +7455,13 @@ const Ie = ({
7442
7455
  onChange: (d) => t(s, o, d.target.value)
7443
7456
  }
7444
7457
  ),
7445
- o.type === M.Boolean && /* @__PURE__ */ T("div", { className: "daga-radio", children: [
7446
- /* @__PURE__ */ T(
7458
+ o.type === N.Boolean && /* @__PURE__ */ M("div", { className: "daga-radio", children: [
7459
+ /* @__PURE__ */ M(
7447
7460
  "label",
7448
7461
  {
7449
7462
  className: "daga-radio-item daga-radio-start" + (s?.getValue(o.name) === !1 ? " daga-checked" : ""),
7450
7463
  children: [
7451
- /* @__PURE__ */ v(
7464
+ /* @__PURE__ */ y(
7452
7465
  "input",
7453
7466
  {
7454
7467
  type: "radio",
@@ -7463,12 +7476,12 @@ const Ie = ({
7463
7476
  ]
7464
7477
  }
7465
7478
  ),
7466
- /* @__PURE__ */ T(
7479
+ /* @__PURE__ */ M(
7467
7480
  "label",
7468
7481
  {
7469
7482
  className: "daga-radio-item daga-radio-end" + (s?.getValue(o.name) === !0 ? " daga-checked" : ""),
7470
7483
  children: [
7471
- /* @__PURE__ */ v(
7484
+ /* @__PURE__ */ y(
7472
7485
  "input",
7473
7486
  {
7474
7487
  type: "radio",
@@ -7484,7 +7497,7 @@ const Ie = ({
7484
7497
  }
7485
7498
  )
7486
7499
  ] }),
7487
- o.type === M.Option && /* @__PURE__ */ v("div", { className: "daga-relatively-positioned", children: /* @__PURE__ */ v(
7500
+ o.type === N.Option && /* @__PURE__ */ y("div", { className: "daga-relatively-positioned", children: /* @__PURE__ */ y(
7488
7501
  ao,
7489
7502
  {
7490
7503
  disabled: o.editable === !1 || !l,
@@ -7493,26 +7506,26 @@ const Ie = ({
7493
7506
  onChange: (d) => t(s, o, d)
7494
7507
  }
7495
7508
  ) }),
7496
- (o.type === M.OptionList || o.type === M.OptionSet) && /* @__PURE__ */ v(
7509
+ (o.type === N.OptionList || o.type === N.OptionSet) && /* @__PURE__ */ y(
7497
7510
  Ti,
7498
7511
  {
7499
7512
  disabled: o.editable === !1 || !l,
7500
- allowRepeats: o.type === M.OptionList,
7513
+ allowRepeats: o.type === N.OptionList,
7501
7514
  options: o.options || [],
7502
7515
  value: s?.getValue(o.name),
7503
7516
  onChange: (d) => t(s, o, d)
7504
7517
  }
7505
7518
  ),
7506
- (o.type === M.TextList || o.type === M.TextSet) && /* @__PURE__ */ v(
7519
+ (o.type === N.TextList || o.type === N.TextSet) && /* @__PURE__ */ y(
7507
7520
  Mi,
7508
7521
  {
7509
7522
  disabled: o.editable === !1 || !l,
7510
- allowRepeats: o.type === M.TextList,
7523
+ allowRepeats: o.type === N.TextList,
7511
7524
  value: s?.getValue(o.name),
7512
7525
  onChange: (d) => t(s, o, d)
7513
7526
  }
7514
7527
  ),
7515
- o.type === M.TextMap && /* @__PURE__ */ v(
7528
+ o.type === N.TextMap && /* @__PURE__ */ y(
7516
7529
  Ni,
7517
7530
  {
7518
7531
  disabled: o.editable === !1 || !l,
@@ -7520,7 +7533,7 @@ const Ie = ({
7520
7533
  onChange: (d) => t(s, o, d)
7521
7534
  }
7522
7535
  ),
7523
- o.type === M.Object && /* @__PURE__ */ v("div", { className: "daga-left-bar", children: /* @__PURE__ */ v(
7536
+ o.type === N.Object && /* @__PURE__ */ y("div", { className: "daga-left-bar", children: /* @__PURE__ */ y(
7524
7537
  lo,
7525
7538
  {
7526
7539
  valueSet: s.getSubValueSet(o.name),
@@ -7533,30 +7546,30 @@ const Ie = ({
7533
7546
  o.name
7534
7547
  )) });
7535
7548
  }, co = ({ valueSet: s, depth: t }) => {
7536
- const e = Dt($t), a = rt(null), l = (o) => "daga-property-name-" + o.replace(/\s/g, ""), r = () => {
7549
+ const e = Dt(Ct), a = rt(null), l = (o) => "daga-property-name-" + o.replace(/\s/g, ""), r = () => {
7537
7550
  for (const o of s?.displayedProperties || []) {
7538
7551
  let d = 0, c = 0, h = 0;
7539
- const f = x.select(a.current).select(
7552
+ const f = L.select(a.current).select(
7540
7553
  `.daga-property.${l(o.name)}.daga-depth-${t}`
7541
7554
  );
7542
7555
  f.select("button.daga-move-button").call(
7543
- x.drag().on(A.Start, (b) => {
7544
- S(L.Grabbing);
7556
+ L.drag().on(A.Start, (b) => {
7557
+ S(E.Grabbing);
7545
7558
  const m = e.getPointerLocationRelativeToScreen(b);
7546
7559
  if (m.length < 2 || isNaN(m[0]) || isNaN(m[1]))
7547
7560
  return;
7548
7561
  const p = f.node()?.getBoundingClientRect();
7549
7562
  d = p?.width || 0, c = p?.height || 0, f.style("position", "fixed").style("left", `${m[0] - d / 2}px`).style("top", `${m[1] - c / 2}px`).style("width", `${d}px`).style("height", `${c}px`).style("z-index", 1);
7550
7563
  }).on(A.Drag, (b) => {
7551
- S(L.Grabbing);
7564
+ S(E.Grabbing);
7552
7565
  const m = e.getPointerLocationRelativeToScreen(b);
7553
- m.length < 2 || isNaN(m[0]) || isNaN(m[1]) || (f.style("position", "fixed").style("left", `${m[0] - d / 2}px`).style("top", `${m[1] - c / 2}px`).style("width", `${d}px`).style("height", `${c}px`).style("z-index", 1), x.select(a.current).select(
7566
+ m.length < 2 || isNaN(m[0]) || isNaN(m[1]) || (f.style("position", "fixed").style("left", `${m[0] - d / 2}px`).style("top", `${m[1] - c / 2}px`).style("width", `${d}px`).style("height", `${c}px`).style("z-index", 1), L.select(a.current).select(
7554
7567
  `.daga-dropbar.daga-index-${h}.daga-depth-${t}`
7555
- ).style("visibility", "hidden").style("height", 0), h = i(m), x.select(a.current).select(
7568
+ ).style("visibility", "hidden").style("height", 0), h = i(m), L.select(a.current).select(
7556
7569
  `.daga-dropbar.daga-index-${h}.daga-depth-${t}`
7557
7570
  ).style("visibility", "visible").style("height", "0.25rem"));
7558
7571
  }).on(A.End, (b) => {
7559
- S(L.Auto), f.style("position", "relative").style("left", 0).style("top", 0).style("z-index", 0).style("width", "unset").style("height", "unset"), x.select(a.current).select(
7572
+ S(E.Auto), f.style("position", "relative").style("left", 0).style("top", 0).style("z-index", 0).style("width", "unset").style("height", "unset"), L.select(a.current).select(
7560
7573
  `.daga-dropbar.daga-index-${h}.daga-depth-${t}`
7561
7574
  ).style("visibility", "hidden").style("height", 0);
7562
7575
  const m = e.getPointerLocationRelativeToScreen(b);
@@ -7574,7 +7587,7 @@ const Ie = ({
7574
7587
  }, i = (o) => {
7575
7588
  const d = s?.propertySet.propertyList || [], c = [];
7576
7589
  for (let h = 0; h <= d.length; ++h) {
7577
- const f = x.select(a.current).select(
7590
+ const f = L.select(a.current).select(
7578
7591
  `.daga-dropbar.daga-index-${h}.daga-depth-${t}`
7579
7592
  ).node()?.getBoundingClientRect();
7580
7593
  f && c.push([
@@ -7599,34 +7612,34 @@ const Ie = ({
7599
7612
  o.target?.value || ""
7600
7613
  ) : d = s?.propertySet.getProperty(o || ""), d && s?.hideProperty(d), r();
7601
7614
  };
7602
- return /* @__PURE__ */ T("daga-property-settings", { ref: a, children: [
7603
- /* @__PURE__ */ v("div", { className: `daga-dropbar daga-index-0 daga-depth-${t}` }),
7604
- s?.displayedProperties.map((o, d) => /* @__PURE__ */ T(
7615
+ return /* @__PURE__ */ M("daga-property-settings", { ref: a, children: [
7616
+ /* @__PURE__ */ y("div", { className: `daga-dropbar daga-index-0 daga-depth-${t}` }),
7617
+ s?.displayedProperties.map((o, d) => /* @__PURE__ */ M(
7605
7618
  "div",
7606
7619
  {
7607
7620
  className: `daga-property-and-dropbar ${l(o.name)} daga-depth-${t}`,
7608
7621
  children: [
7609
- /* @__PURE__ */ T(
7622
+ /* @__PURE__ */ M(
7610
7623
  "div",
7611
7624
  {
7612
7625
  className: `daga-property ${l(o.name)} daga-depth-${t}`,
7613
7626
  children: [
7614
- /* @__PURE__ */ T("div", { className: "daga-property-name", children: [
7615
- /* @__PURE__ */ v("span", { children: o.label || o.name }),
7616
- /* @__PURE__ */ T("div", { className: "daga-buttons", children: [
7617
- /* @__PURE__ */ v("button", { className: "daga-property-button daga-move-button", children: /* @__PURE__ */ v("div", { className: "daga-icon daga-move-icon" }) }),
7618
- /* @__PURE__ */ v(
7627
+ /* @__PURE__ */ M("div", { className: "daga-property-name", children: [
7628
+ /* @__PURE__ */ y("span", { children: o.label || o.name }),
7629
+ /* @__PURE__ */ M("div", { className: "daga-buttons", children: [
7630
+ /* @__PURE__ */ y("button", { className: "daga-property-button daga-move-button", children: /* @__PURE__ */ y("div", { className: "daga-icon daga-move-icon" }) }),
7631
+ /* @__PURE__ */ y(
7619
7632
  "button",
7620
7633
  {
7621
7634
  className: "daga-property-button daga-hide-button",
7622
7635
  onClick: () => n(o.name),
7623
- children: /* @__PURE__ */ v("div", { className: "daga-icon daga-hide-icon" })
7636
+ children: /* @__PURE__ */ y("div", { className: "daga-icon daga-hide-icon" })
7624
7637
  }
7625
7638
  )
7626
7639
  ] })
7627
7640
  ] }),
7628
- o.type !== M.Object && /* @__PURE__ */ v("div", { className: "daga-property-value", children: Pi(s?.getValue(o.name)) }),
7629
- o.type === M.Object && /* @__PURE__ */ v(
7641
+ o.type !== N.Object && /* @__PURE__ */ y("div", { className: "daga-property-value", children: Pi(s?.getValue(o.name)) }),
7642
+ o.type === N.Object && /* @__PURE__ */ y(
7630
7643
  co,
7631
7644
  {
7632
7645
  valueSet: s?.getSubValueSet(o.name),
@@ -7636,7 +7649,7 @@ const Ie = ({
7636
7649
  ]
7637
7650
  }
7638
7651
  ),
7639
- /* @__PURE__ */ v(
7652
+ /* @__PURE__ */ y(
7640
7653
  "div",
7641
7654
  {
7642
7655
  className: `daga-dropbar daga-index-${d + 1} daga-depth-${t}`
@@ -7648,8 +7661,8 @@ const Ie = ({
7648
7661
  ))
7649
7662
  ] });
7650
7663
  }, Pi = (s) => Array.isArray(s) ? s.join(", ") : zo(s) ? Object.entries(s).map((t) => t.map((e) => JSON.stringify(e)).join(": ")).join(", ") : s instanceof Date ? s.toLocaleString() : s == null ? "" : "" + s, zi = ({ location: s, direction: t, width: e, height: a, title: l, valueSet: r, onValueChange: i }) => {
7651
- const n = rt(null), [o, d] = D(!1), [c, h] = D(!1), f = () => x.select(n.current);
7652
- return Ct(() => {
7664
+ const n = rt(null), [o, d] = D(!1), [c, h] = D(!1), f = () => L.select(n.current);
7665
+ return St(() => {
7653
7666
  if (n.current)
7654
7667
  switch (t) {
7655
7668
  case g.Bottom:
@@ -7661,14 +7674,14 @@ const Ie = ({
7661
7674
  f().style("height", e), a && f().select(".daga-panel-content").style("width", a);
7662
7675
  break;
7663
7676
  }
7664
- }, [e, t]), /* @__PURE__ */ v("daga-property-editor", { children: /* @__PURE__ */ T(
7677
+ }, [e, t]), /* @__PURE__ */ y("daga-property-editor", { children: /* @__PURE__ */ M(
7665
7678
  "div",
7666
7679
  {
7667
7680
  ref: n,
7668
7681
  className: `daga-panel daga-bottom daga-${s} daga-${t}`,
7669
7682
  children: [
7670
- /* @__PURE__ */ v(
7671
- Ie,
7683
+ /* @__PURE__ */ y(
7684
+ xe,
7672
7685
  {
7673
7686
  disabled: !r || !r.propertySet || !r.propertySet.hasProperties(),
7674
7687
  collapsed: o,
@@ -7681,15 +7694,15 @@ const Ie = ({
7681
7694
  onCollapse: d
7682
7695
  }
7683
7696
  ),
7684
- /* @__PURE__ */ v("div", { className: "daga-panel-content", children: r && r.propertySet && r.propertySet.hasProperties() && !o && /* @__PURE__ */ T("div", { children: [
7685
- l && /* @__PURE__ */ T("p", { className: "daga-title", children: [
7697
+ /* @__PURE__ */ y("div", { className: "daga-panel-content", children: r && r.propertySet && r.propertySet.hasProperties() && !o && /* @__PURE__ */ M("div", { children: [
7698
+ l && /* @__PURE__ */ M("p", { className: "daga-title", children: [
7686
7699
  l,
7687
- /* @__PURE__ */ v(
7700
+ /* @__PURE__ */ y(
7688
7701
  "button",
7689
7702
  {
7690
7703
  className: "daga-property-button",
7691
7704
  onClick: () => h(!c),
7692
- children: /* @__PURE__ */ v(
7705
+ children: /* @__PURE__ */ y(
7693
7706
  "div",
7694
7707
  {
7695
7708
  className: `daga-icon daga-settings-icon ${c ? "daga-unrotate" : "daga-rotate"}`
@@ -7698,7 +7711,7 @@ const Ie = ({
7698
7711
  }
7699
7712
  )
7700
7713
  ] }),
7701
- !c && /* @__PURE__ */ v(
7714
+ !c && /* @__PURE__ */ y(
7702
7715
  lo,
7703
7716
  {
7704
7717
  valueSet: r,
@@ -7706,13 +7719,13 @@ const Ie = ({
7706
7719
  depth: 0
7707
7720
  }
7708
7721
  ),
7709
- c && /* @__PURE__ */ v(co, { valueSet: r, depth: 0 })
7722
+ c && /* @__PURE__ */ y(co, { valueSet: r, depth: 0 })
7710
7723
  ] }) })
7711
7724
  ]
7712
7725
  }
7713
7726
  ) });
7714
7727
  }, Ri = 6, Vi = (s) => {
7715
- const t = Dt($t), [e, a] = D(
7728
+ const t = Dt(Ct), [e, a] = D(
7716
7729
  s.currentPalette || s.palettes[0]
7717
7730
  ), [l, r] = D(0), [i, n] = D(
7718
7731
  void 0
@@ -7720,110 +7733,110 @@ const Ie = ({
7720
7733
  if (a(p), c().selectAll("*").remove(), r(t.getPriorityThreshold() || 0), p.categories && h(p.categories), p.templates)
7721
7734
  for (const u of p.templates)
7722
7735
  f(u);
7723
- }, c = () => x.select(o.current).select(".daga-palette-view"), h = (p) => {
7736
+ }, c = () => L.select(o.current).select(".daga-palette-view"), h = (p) => {
7724
7737
  const u = c().append("select").style("width", "100%").style("height", "2rem").style("padding", "0.5rem").style("border-radius", "0.25rem").style("background-color", "#f7f8fc").style("border", "1px solid #e6e6e6");
7725
7738
  u.append("option").attr("value", "").text("(None selected)");
7726
- for (const y in p)
7727
- u.append("option").attr("value", y).text(y);
7739
+ for (const v in p)
7740
+ u.append("option").attr("value", v).text(v);
7728
7741
  u.on($.Change, () => {
7729
7742
  i && c().selectAll(".daga-template-container.daga-in-category").remove();
7730
- const y = u.property("value");
7731
- n(y);
7732
- const k = p[y] || [];
7733
- for (const N of k)
7734
- f(N, "daga-in-category");
7743
+ const v = u.property("value");
7744
+ n(v);
7745
+ const w = p[v] || [];
7746
+ for (const I of w)
7747
+ f(I, "daga-in-category");
7735
7748
  }), i && (u.property("value", i), u.dispatch($.Change));
7736
7749
  }, f = (p, u) => {
7737
7750
  if (p.templateType === "node") {
7738
- const y = t.model.nodes.types.get(p.type);
7739
- y ? b(y, p, u) : console.error(`Could not find a node type called '${p.type}'`);
7751
+ const v = t.model.nodes.types.get(p.type);
7752
+ v ? b(v, p, u) : console.error(`Could not find a node type called '${p.type}'`);
7740
7753
  } else if (p.templateType === "connection") {
7741
- const y = t.model.connections.types.get(p.type);
7742
- y ? m(y, p, u) : console.error(
7754
+ const v = t.model.connections.types.get(p.type);
7755
+ v ? m(v, p, u) : console.error(
7743
7756
  `Could not find a connection type called '${p.type}'`
7744
7757
  );
7745
7758
  }
7746
- }, b = (p, u, y) => {
7759
+ }, b = (p, u, v) => {
7747
7760
  if (l !== void 0 && p.priority < l)
7748
7761
  return;
7749
- const k = p.defaultLook.lookType === "shaped-look" ? p.defaultLook.borderThickness || 1 : 0, N = p.defaultHeight + k, R = p.defaultWidth + k, P = u.height || N, tt = u.width || R, E = c().append("div").attr(
7762
+ const w = p.defaultLook.lookType === "shaped-look" ? p.defaultLook.borderThickness || 1 : 0, I = p.defaultHeight + w, R = p.defaultWidth + w, P = u.height || I, et = u.width || R, T = c().append("div").attr(
7750
7763
  "class",
7751
- `daga-template-container ${y !== void 0 ? y : ""}`
7752
- ).style("width", `${tt}px`).style("height", `${P}px`).call(
7753
- x.drag().on(A.Drag, (O) => {
7754
- if (t.canUserPerformAction(w.AddNode)) {
7755
- const I = t.getPointerLocationRelativeToScreen(O);
7756
- if (I.length < 2 || isNaN(I[0]) || isNaN(I[1]))
7764
+ `daga-template-container ${v !== void 0 ? v : ""}`
7765
+ ).style("width", `${et}px`).style("height", `${P}px`).call(
7766
+ L.drag().on(A.Drag, (O) => {
7767
+ if (t.canUserPerformAction(k.AddNode)) {
7768
+ const x = t.getPointerLocationRelativeToScreen(O);
7769
+ if (x.length < 2 || isNaN(x[0]) || isNaN(x[1]))
7757
7770
  return;
7758
- E.style("position", "fixed").style("left", `${I[0] - tt / 2}px`).style("top", `${I[1] - P / 2}px`).style("z-index", 1);
7771
+ T.style("position", "fixed").style("left", `${x[0] - et / 2}px`).style("top", `${x[1] - P / 2}px`).style("z-index", 1);
7759
7772
  }
7760
7773
  }).on(A.Start, (O) => {
7761
- if (t.canUserPerformAction(w.AddNode)) {
7762
- S(L.Grabbing);
7763
- const I = t.getPointerLocationRelativeToScreen(O);
7764
- if (I.length < 2 || isNaN(I[0]) || isNaN(I[1]))
7774
+ if (t.canUserPerformAction(k.AddNode)) {
7775
+ S(E.Grabbing);
7776
+ const x = t.getPointerLocationRelativeToScreen(O);
7777
+ if (x.length < 2 || isNaN(x[0]) || isNaN(x[1]))
7765
7778
  return;
7766
- E.style("position", "fixed").style("left", `${I[0] - tt / 2}px`).style("top", `${I[1] - P / 2}px`).style("z-index", 1), p.isUnique && t.model.nodes.find(
7779
+ T.style("position", "fixed").style("left", `${x[0] - et / 2}px`).style("top", `${x[1] - P / 2}px`).style("z-index", 1), p.isUnique && t.model.nodes.find(
7767
7780
  (_) => !_.removed && _.type.id === p.id
7768
- ) !== void 0 && S(L.NotAllowed);
7781
+ ) !== void 0 && S(E.NotAllowed);
7769
7782
  }
7770
7783
  }).on(A.End, (O) => {
7771
- if (t.canUserPerformAction(w.AddNode)) {
7772
- if (S(L.Auto), E.style("position", "relative").style("left", 0).style("top", 0).style("z-index", "auto"), p.isUnique && t.model.nodes.find(
7784
+ if (t.canUserPerformAction(k.AddNode)) {
7785
+ if (S(E.Auto), T.style("position", "relative").style("left", 0).style("top", 0).style("z-index", "auto"), p.isUnique && t.model.nodes.find(
7773
7786
  (jt) => !jt.removed && jt.type.id === p.id
7774
7787
  ) !== void 0)
7775
7788
  return;
7776
- const I = t.getPointerLocationRelativeToScreen(O);
7777
- if (I.length < 2 || isNaN(I[0]) || isNaN(I[1]))
7789
+ const x = t.getPointerLocationRelativeToScreen(O);
7790
+ if (x.length < 2 || isNaN(x[0]) || isNaN(x[1]))
7778
7791
  return;
7779
7792
  const _ = document.elementFromPoint(
7780
- I[0],
7781
- I[1]
7793
+ x[0],
7794
+ x[1]
7782
7795
  );
7783
7796
  if (_ && !t.selectCanvasView().node()?.contains(_))
7784
7797
  return;
7785
7798
  const lt = t.getPointerLocationRelativeToCanvas(O);
7786
7799
  if (lt.length < 2 || isNaN(lt[0]) || isNaN(lt[1]))
7787
7800
  return;
7788
- let q = [
7801
+ let J = [
7789
7802
  lt[0] - p.defaultWidth / 2,
7790
7803
  lt[1] - p.defaultHeight / 2
7791
7804
  ];
7792
- t.snapToGrid && (q = t.getClosestGridPoint([
7793
- q[0] - p.snapToGridOffset[0],
7794
- q[1] - p.snapToGridOffset[1]
7795
- ]), q[0] += p.snapToGridOffset[0], q[1] += p.snapToGridOffset[1]);
7796
- const J = t.model.nodes.getAtCoordinates(
7805
+ t.snapToGrid && (J = t.getClosestGridPoint([
7806
+ J[0] - p.snapToGridOffset[0],
7807
+ J[1] - p.snapToGridOffset[1]
7808
+ ]), J[0] += p.snapToGridOffset[0], J[1] += p.snapToGridOffset[1]);
7809
+ const Pt = t.model.nodes.getAtCoordinates(
7797
7810
  lt[0],
7798
7811
  lt[1]
7799
7812
  ).filter(
7800
7813
  (jt) => jt.type.childrenTypes.includes(p.id)
7801
- ), wt = Ze(
7802
- J
7803
- ), nt = wt[wt.length - 1];
7804
- if (!p.canBeParentless && nt === void 0)
7814
+ ), Z = Ze(
7815
+ Pt
7816
+ ), Q = Z[Z.length - 1];
7817
+ if (!p.canBeParentless && Q === void 0)
7805
7818
  return;
7806
- const Xt = nt?.getLastAncestor(), xe = new qo(
7819
+ const ae = Q?.getLastAncestor(), Xt = new qo(
7807
7820
  t,
7808
7821
  p,
7809
- q,
7810
- nt?.id,
7811
- Xt?.id,
7812
- Xt?.getGeometry(),
7822
+ J,
7823
+ Q?.id,
7824
+ ae?.id,
7825
+ ae?.getGeometry(),
7813
7826
  void 0,
7814
7827
  u.label,
7815
7828
  u.values
7816
7829
  );
7817
- xe.do(), t?.actionStack.add(xe), S();
7830
+ Xt.do(), t?.actionStack.add(Xt), S();
7818
7831
  }
7819
7832
  })
7820
- ).append("svg").attr("class", `palette-node ${p.id}`).attr("viewBox", `0 0 ${R} ${N}`).attr("preserveAspectRatio", "none").style("position", "relative").style("left", 0).style("top", 0).style("width", `${tt}px`).style("height", `${P}px`), C = u.look || p.defaultLook;
7833
+ ).append("svg").attr("class", `palette-node ${p.id}`).attr("viewBox", `0 0 ${R} ${I}`).attr("preserveAspectRatio", "none").style("position", "relative").style("left", 0).style("top", 0).style("width", `${et}px`).style("height", `${P}px`), C = u.look || p.defaultLook;
7821
7834
  switch (C.lookType) {
7822
7835
  case "shaped-look":
7823
- E.append("path").attr(
7836
+ T.append("path").attr(
7824
7837
  "d",
7825
- ve(
7826
- C.shape || Mt.Rectangle,
7838
+ ye(
7839
+ C.shape || Tt.Rectangle,
7827
7840
  (C.borderThickness || 1) / 2,
7828
7841
  (C.borderThickness || 1) / 2,
7829
7842
  p.defaultWidth,
@@ -7832,33 +7845,33 @@ const Ie = ({
7832
7845
  ).attr("fill", C.fillColor || "#FFFFFF").attr("stroke", C.borderColor || "#000000").attr("stroke-width", `${C.borderThickness}px`);
7833
7846
  break;
7834
7847
  case "image-look":
7835
- E.append("image").attr("x", 0).attr("y", 0).attr("width", p.defaultWidth).attr("height", p.defaultHeight).attr("href", C.backgroundImage).attr("preserveAspectRatio", "none");
7848
+ T.append("image").attr("x", 0).attr("y", 0).attr("width", p.defaultWidth).attr("height", p.defaultHeight).attr("href", C.backgroundImage).attr("preserveAspectRatio", "none");
7836
7849
  break;
7837
7850
  case "stretchable-image-look":
7838
- E.append("image").attr("x", 0).attr("y", 0).attr("width", C.leftMargin).attr("height", C.topMargin).attr("href", C.backgroundImageTopLeft).attr("preserveAspectRatio", "none"), E.append("image").attr("x", C.leftMargin).attr("y", 0).attr(
7851
+ T.append("image").attr("x", 0).attr("y", 0).attr("width", C.leftMargin).attr("height", C.topMargin).attr("href", C.backgroundImageTopLeft).attr("preserveAspectRatio", "none"), T.append("image").attr("x", C.leftMargin).attr("y", 0).attr(
7839
7852
  "width",
7840
7853
  p.defaultWidth - C.rightMargin - C.leftMargin
7841
- ).attr("height", C.topMargin).attr("href", C.backgroundImageTop).attr("preserveAspectRatio", "none"), E.append("image").attr("x", p.defaultWidth - C.rightMargin).attr("y", 0).attr("width", C.rightMargin).attr("height", C.topMargin).attr("href", C.backgroundImageTopRight).attr("preserveAspectRatio", "none"), E.append("image").attr("x", 0).attr("y", C.topMargin).attr("width", C.leftMargin).attr(
7854
+ ).attr("height", C.topMargin).attr("href", C.backgroundImageTop).attr("preserveAspectRatio", "none"), T.append("image").attr("x", p.defaultWidth - C.rightMargin).attr("y", 0).attr("width", C.rightMargin).attr("height", C.topMargin).attr("href", C.backgroundImageTopRight).attr("preserveAspectRatio", "none"), T.append("image").attr("x", 0).attr("y", C.topMargin).attr("width", C.leftMargin).attr(
7842
7855
  "height",
7843
7856
  p.defaultHeight - C.bottomMargin - C.topMargin
7844
- ).attr("href", C.backgroundImageLeft).attr("preserveAspectRatio", "none"), E.append("image").attr("x", C.leftMargin).attr("y", C.topMargin).attr(
7857
+ ).attr("href", C.backgroundImageLeft).attr("preserveAspectRatio", "none"), T.append("image").attr("x", C.leftMargin).attr("y", C.topMargin).attr(
7845
7858
  "width",
7846
7859
  p.defaultWidth - C.rightMargin - C.leftMargin
7847
7860
  ).attr(
7848
7861
  "height",
7849
7862
  p.defaultHeight - C.bottomMargin - C.topMargin
7850
- ).attr("href", C.backgroundImageCenter).attr("preserveAspectRatio", "none"), E.append("image").attr("x", p.defaultWidth - C.rightMargin).attr("y", C.topMargin).attr("width", C.rightMargin).attr(
7863
+ ).attr("href", C.backgroundImageCenter).attr("preserveAspectRatio", "none"), T.append("image").attr("x", p.defaultWidth - C.rightMargin).attr("y", C.topMargin).attr("width", C.rightMargin).attr(
7851
7864
  "height",
7852
7865
  p.defaultHeight - C.bottomMargin - C.topMargin
7853
- ).attr("href", C.backgroundImageRight).attr("preserveAspectRatio", "none"), E.append("image").attr("x", 0).attr("y", p.defaultHeight - C.bottomMargin).attr("width", C.leftMargin).attr("height", C.bottomMargin).attr("href", C.backgroundImageBottomLeft).attr("preserveAspectRatio", "none"), E.append("image").attr("x", C.leftMargin).attr("y", p.defaultHeight - C.bottomMargin).attr(
7866
+ ).attr("href", C.backgroundImageRight).attr("preserveAspectRatio", "none"), T.append("image").attr("x", 0).attr("y", p.defaultHeight - C.bottomMargin).attr("width", C.leftMargin).attr("height", C.bottomMargin).attr("href", C.backgroundImageBottomLeft).attr("preserveAspectRatio", "none"), T.append("image").attr("x", C.leftMargin).attr("y", p.defaultHeight - C.bottomMargin).attr(
7854
7867
  "width",
7855
7868
  p.defaultWidth - C.rightMargin - C.leftMargin
7856
- ).attr("height", C.bottomMargin).attr("href", C.backgroundImageBottom).attr("preserveAspectRatio", "none"), E.append("image").attr("x", p.defaultWidth - C.rightMargin).attr("y", p.defaultHeight - C.bottomMargin).attr("width", C.rightMargin).attr("height", C.bottomMargin).attr("href", C.backgroundImageBottomRight).attr("preserveAspectRatio", "none");
7869
+ ).attr("height", C.bottomMargin).attr("href", C.backgroundImageBottom).attr("preserveAspectRatio", "none"), T.append("image").attr("x", p.defaultWidth - C.rightMargin).attr("y", p.defaultHeight - C.bottomMargin).attr("width", C.rightMargin).attr("height", C.bottomMargin).attr("href", C.backgroundImageBottomRight).attr("preserveAspectRatio", "none");
7857
7870
  }
7858
7871
  if (u.look === void 0) {
7859
7872
  if (p.decorators)
7860
7873
  for (const O of p.decorators)
7861
- E.append("foreignObject").attr("width", `${O.width}px`).attr("height", `${O.height}px`).attr(
7874
+ T.append("foreignObject").attr("width", `${O.width}px`).attr("height", `${O.height}px`).attr(
7862
7875
  "transform",
7863
7876
  `translate(${O.coords[0]},${O.coords[1]})`
7864
7877
  ).html(O.html);
@@ -7868,34 +7881,34 @@ const Ie = ({
7868
7881
  ...p.label,
7869
7882
  ...u.labelLook
7870
7883
  };
7871
- E.append("text").attr(
7884
+ T.append("text").attr(
7872
7885
  "transform",
7873
7886
  `translate(${(Y(O) + p.defaultWidth) / 2},${(U(O) + p.defaultHeight) / 2})`
7874
7887
  ).attr("x", 0).attr("y", 0).attr("font-size", `${O.fontSize}px`).attr("text-anchor", "middle").attr("font-family", O.fontFamily).attr("font-weight", 400).attr("fill", O.color).attr("stroke", "none").style("font-kerning", "none").style("user-select", "none").text(u.label);
7875
7888
  }
7876
7889
  }
7877
- }, m = (p, u, y) => {
7878
- const k = c().append("div").attr(
7890
+ }, m = (p, u, v) => {
7891
+ const w = c().append("div").attr(
7879
7892
  "class",
7880
- `daga-template-container ${y !== void 0 ? y : ""}`
7893
+ `daga-template-container ${v !== void 0 ? v : ""}`
7881
7894
  ).style("width", `${u.width}px`).style("height", `${u.height}px`).append("svg").attr("class", `palette-button ${p.id}`).style("position", "relative").style("left", 0).style("top", 0).style("width", "100%").style("height", "100%").on("click", () => {
7882
7895
  t.connectionType = p;
7883
7896
  });
7884
- k.append("path").attr(
7897
+ w.append("path").attr(
7885
7898
  "d",
7886
- ve(
7887
- Mt.Rectangle,
7899
+ ye(
7900
+ Tt.Rectangle,
7888
7901
  0,
7889
7902
  0,
7890
7903
  u.width,
7891
7904
  u.height
7892
7905
  )
7893
- ).attr("fill", u.backgroundColor).attr("stroke", "black").attr("stroke-width", "1px"), u.icon !== "" && k.append("image").attr("x", 0).attr("y", 0).attr("width", u.width).attr("height", u.height).attr("href", u.icon), u.label !== "" && k.append("text").attr(
7906
+ ).attr("fill", u.backgroundColor).attr("stroke", "black").attr("stroke-width", "1px"), u.icon !== "" && w.append("image").attr("x", 0).attr("y", 0).attr("width", u.width).attr("height", u.height).attr("href", u.icon), u.label !== "" && w.append("text").attr(
7894
7907
  "transform",
7895
7908
  `translate(${u.width / 2},${u.height / 2 + Ri})`
7896
7909
  ).attr("x", 0).attr("y", 0).attr("font-size", "20px").attr("text-anchor", "middle").attr("font-family", "'Wonder Unit Sans', sans-serif").attr("font-weight", 400).attr("fill", "#000000").attr("stroke", "none").style("font-kerning", "none").style("user-select", "none").text(u.label);
7897
7910
  };
7898
- return Ct(() => {
7911
+ return St(() => {
7899
7912
  if (d(s.palettes[0]), o.current)
7900
7913
  switch (s.direction) {
7901
7914
  case g.Bottom:
@@ -7907,14 +7920,14 @@ const Ie = ({
7907
7920
  o.current.style.height = s.width, s.height && (o.current.style.width = s.height);
7908
7921
  break;
7909
7922
  }
7910
- }, [e, s.palettes]), /* @__PURE__ */ v("daga-palette", { children: /* @__PURE__ */ T(
7923
+ }, [e, s.palettes]), /* @__PURE__ */ y("daga-palette", { children: /* @__PURE__ */ M(
7911
7924
  "div",
7912
7925
  {
7913
7926
  ref: o,
7914
7927
  className: `daga-panel daga-${s.location} daga-${s.direction}`,
7915
7928
  children: [
7916
- /* @__PURE__ */ v(
7917
- Ie,
7929
+ /* @__PURE__ */ y(
7930
+ xe,
7918
7931
  {
7919
7932
  direction: s.direction,
7920
7933
  collapsableSelector: o,
@@ -7926,8 +7939,8 @@ const Ie = ({
7926
7939
  disabled: !1
7927
7940
  }
7928
7941
  ),
7929
- /* @__PURE__ */ T("div", { className: "daga-panel-content", children: [
7930
- s.palettes.length > 1 && /* @__PURE__ */ v("div", { className: "daga-panel-tabs", children: s.palettes.map((p) => /* @__PURE__ */ v(
7942
+ /* @__PURE__ */ M("div", { className: "daga-panel-content", children: [
7943
+ s.palettes.length > 1 && /* @__PURE__ */ y("div", { className: "daga-panel-tabs", children: s.palettes.map((p) => /* @__PURE__ */ y(
7931
7944
  "div",
7932
7945
  {
7933
7946
  className: `daga-panel-tab ${p === e ? "daga-current-tab" : ""}`,
@@ -7935,7 +7948,7 @@ const Ie = ({
7935
7948
  children: p.name
7936
7949
  }
7937
7950
  )) }),
7938
- /* @__PURE__ */ v("div", { className: "daga-palette-view" })
7951
+ /* @__PURE__ */ y("div", { className: "daga-palette-view" })
7939
7952
  ] })
7940
7953
  ]
7941
7954
  }
@@ -7943,106 +7956,107 @@ const Ie = ({
7943
7956
  }, Oi = ({
7944
7957
  location: s,
7945
7958
  direction: t,
7946
- enableAction: e,
7947
- enableFilter: a,
7948
- enableLayout: l,
7949
- enableSelection: r,
7950
- enableZoom: i
7959
+ centerAnimationDuration: e,
7960
+ enableAction: a,
7961
+ enableFilter: l,
7962
+ enableLayout: r,
7963
+ enableSelection: i,
7964
+ enableZoom: n
7951
7965
  }) => {
7952
- let n = !1, o = !0, d = !1, c, h, f, b;
7966
+ let o = !1, d = !0, c = !1, h, f, b, m;
7953
7967
  switch (t) {
7954
7968
  case g.Bottom:
7955
- c = "height", h = "scaleY", f = "top", b = "bottom";
7969
+ h = "height", f = "scaleY", b = "top", m = "bottom";
7956
7970
  break;
7957
7971
  case g.Top:
7958
- c = "height", h = "scaleY", f = "bottom", b = "top";
7972
+ h = "height", f = "scaleY", b = "bottom", m = "top";
7959
7973
  break;
7960
7974
  case g.Left:
7961
- c = "width", h = "scaleX", f = "right", b = "left";
7975
+ h = "width", f = "scaleX", b = "right", m = "left";
7962
7976
  break;
7963
7977
  case g.Right:
7964
- c = "width", h = "scaleX", f = "left", b = "right";
7978
+ h = "width", f = "scaleX", b = "left", m = "right";
7965
7979
  break;
7966
7980
  }
7967
- const m = rt(null), p = rt(null), u = rt(null);
7968
- Ct(() => {
7969
- x.select(
7970
- m.current
7971
- ).style(`margin-${b}`, "-1rem").style(c, "0rem").style("transform", `${h}(0)`).style("transform-origin", f);
7981
+ const p = rt(null), u = rt(null), v = rt(null);
7982
+ St(() => {
7983
+ L.select(
7984
+ p.current
7985
+ ).style(`margin-${m}`, "-1rem").style(h, "0rem").style("transform", `${f}(0)`).style("transform-origin", b);
7972
7986
  });
7973
- const y = async () => {
7974
- const J = x.select(
7975
- m.current
7987
+ const w = async () => {
7988
+ const Z = L.select(
7989
+ p.current
7976
7990
  );
7977
- if (!d)
7978
- if (o) {
7979
- o = !1;
7980
- const Xt = `${4 * J.selectChildren().size()}rem`;
7981
- J.transition().duration(500).ease(x.easeLinear).style(c, Xt).style("transform", `${h}(1)`), setTimeout(() => {
7982
- d = !1;
7991
+ if (!c)
7992
+ if (d) {
7993
+ d = !1;
7994
+ const Xt = `${4 * Z.selectChildren().size()}rem`;
7995
+ Z.transition().duration(500).ease(L.easeLinear).style(h, Xt).style("transform", `${f}(1)`), setTimeout(() => {
7996
+ c = !1;
7983
7997
  }, 500);
7984
7998
  } else
7985
- o = !0, J.transition().duration(500).ease(x.easeLinear).style(c, "0rem").style("transform", `${h}(0)`), setTimeout(() => {
7986
- d = !1;
7999
+ d = !0, Z.transition().duration(500).ease(L.easeLinear).style(h, "0rem").style("transform", `${f}(0)`), setTimeout(() => {
8000
+ c = !1;
7987
8001
  }, 500);
7988
- }, k = Dt($t), N = () => {
7989
- k.zoomBy(k.zoomFactor);
7990
- }, R = () => {
7991
- k.zoomBy(1 / k.zoomFactor);
8002
+ }, I = Dt(Ct), R = () => {
8003
+ I.zoomBy(I.zoomFactor);
7992
8004
  }, P = () => {
7993
- k.center();
7994
- }, tt = () => {
7995
- k.layoutFormat && k.layoutFormat in _e && _e[k.layoutFormat].apply(k.model);
7996
- }, E = () => {
7997
- n = !n, x.select(
7998
- u.current
7999
- ).classed("daga-on", n).classed("daga-off", !n);
8000
- const J = k.getPriorityThresholdOptions();
8001
- J && J.length >= 2 && k.setPriorityThreshold(
8002
- J[n ? 1 : 0]
8003
- );
8005
+ I.zoomBy(1 / I.zoomFactor);
8006
+ }, et = () => {
8007
+ I.center(void 0, 1, e);
8008
+ }, T = () => {
8009
+ I.layoutFormat && I.layoutFormat in _e && _e[I.layoutFormat].apply(I.model);
8004
8010
  }, C = () => {
8005
- k.actionStack.undo();
8011
+ o = !o, L.select(
8012
+ v.current
8013
+ ).classed("daga-on", o).classed("daga-off", !o);
8014
+ const Z = I.getPriorityThresholdOptions();
8015
+ Z && Z.length >= 2 && I.setPriorityThreshold(
8016
+ Z[o ? 1 : 0]
8017
+ );
8006
8018
  }, O = () => {
8007
- k.actionStack.redo();
8008
- }, I = () => {
8009
- k.userSelection.copyToClipboard();
8019
+ I.actionStack.undo();
8020
+ }, x = () => {
8021
+ I.actionStack.redo();
8010
8022
  }, _ = () => {
8011
- k.userSelection.cutToClipboard();
8023
+ I.userSelection.copyToClipboard();
8012
8024
  }, lt = () => {
8013
- k.userSelection.pasteFromClipboard();
8014
- }, q = () => {
8015
- k.userSelection.removeFromModel();
8025
+ I.userSelection.cutToClipboard();
8026
+ }, J = () => {
8027
+ I.userSelection.pasteFromClipboard();
8016
8028
  }, Bt = () => {
8017
- k.multipleSelectionOn = !0, x.select(
8018
- p.current
8029
+ I.userSelection.removeFromModel();
8030
+ }, Pt = () => {
8031
+ I.multipleSelectionOn = !0, L.select(
8032
+ u.current
8019
8033
  ).classed("daga-on", !0).classed("daga-off", !1);
8020
- const J = k.diagramEvent$.subscribe((wt) => {
8021
- wt.type === Qe.Selection && (x.select(
8022
- p.current
8023
- ).classed("daga-on", !1).classed("daga-off", !0), J.unsubscribe());
8034
+ const Z = I.diagramEvent$.subscribe((Q) => {
8035
+ Q.type === Qe.Selection && (L.select(
8036
+ u.current
8037
+ ).classed("daga-on", !1).classed("daga-off", !0), Z.unsubscribe());
8024
8038
  });
8025
8039
  };
8026
- return /* @__PURE__ */ v("daga-diagram-buttons", { children: /* @__PURE__ */ T(
8040
+ return /* @__PURE__ */ y("daga-diagram-buttons", { children: /* @__PURE__ */ M(
8027
8041
  "div",
8028
8042
  {
8029
8043
  className: `daga-diagram-buttons daga-${s} daga-${t}`,
8030
8044
  children: [
8031
- i && k.canUserPerformAction(w.Zoom) && /* @__PURE__ */ v("button", { className: "daga-zoom-in", onClick: N, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Zoom in" }) }),
8032
- i && k.canUserPerformAction(w.Zoom) && /* @__PURE__ */ v("button", { className: "daga-zoom-out", onClick: R, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Zoom out" }) }),
8033
- /* @__PURE__ */ T("div", { className: "daga-collapsable-buttons daga-collapsed", ref: m, children: [
8034
- i && k.canUserPerformAction(w.Zoom) && /* @__PURE__ */ v("button", { className: "daga-center", onClick: P, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Fit diagram to screen" }) }),
8035
- e && /* @__PURE__ */ v("button", { className: "daga-undo", onClick: C, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Undo" }) }),
8036
- e && /* @__PURE__ */ v("button", { className: "daga-redo", onClick: O, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Redo" }) }),
8037
- r && /* @__PURE__ */ v("button", { className: "daga-copy", onClick: I, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Copy" }) }),
8038
- r && /* @__PURE__ */ v("button", { className: "daga-cut", onClick: _, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Cut" }) }),
8039
- r && /* @__PURE__ */ v("button", { className: `daga-multiple-selection ${n ? "daga-on" : "daga-off"}`, onClick: Bt, ref: p, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Multiple selection" }) }),
8040
- r && /* @__PURE__ */ v("button", { className: "daga-paste", onClick: lt, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Paste" }) }),
8041
- r && /* @__PURE__ */ v("button", { className: "daga-delete", onClick: q, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Delete" }) }),
8042
- l && k.layoutFormat && /* @__PURE__ */ v("button", { className: "daga-layout", onClick: tt, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Apply layout" }) }),
8043
- a && /* @__PURE__ */ v("button", { className: `daga-filter ${n ? "daga-on" : "daga-off"}`, onClick: E, ref: u, children: /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Apply filter" }) })
8045
+ n && I.canUserPerformAction(k.Zoom) && /* @__PURE__ */ y("button", { className: "daga-zoom-in", onClick: R, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Zoom in" }) }),
8046
+ n && I.canUserPerformAction(k.Zoom) && /* @__PURE__ */ y("button", { className: "daga-zoom-out", onClick: P, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Zoom out" }) }),
8047
+ /* @__PURE__ */ M("div", { className: "daga-collapsable-buttons daga-collapsed", ref: p, children: [
8048
+ n && I.canUserPerformAction(k.Zoom) && /* @__PURE__ */ y("button", { className: "daga-center", onClick: et, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Fit diagram to screen" }) }),
8049
+ a && /* @__PURE__ */ y("button", { className: "daga-undo", onClick: O, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Undo" }) }),
8050
+ a && /* @__PURE__ */ y("button", { className: "daga-redo", onClick: x, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Redo" }) }),
8051
+ i && /* @__PURE__ */ y("button", { className: "daga-copy", onClick: _, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Copy" }) }),
8052
+ i && /* @__PURE__ */ y("button", { className: "daga-cut", onClick: lt, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Cut" }) }),
8053
+ i && /* @__PURE__ */ y("button", { className: `daga-multiple-selection ${o ? "daga-on" : "daga-off"}`, onClick: Pt, ref: u, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Multiple selection" }) }),
8054
+ i && /* @__PURE__ */ y("button", { className: "daga-paste", onClick: J, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Paste" }) }),
8055
+ i && /* @__PURE__ */ y("button", { className: "daga-delete", onClick: Bt, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Delete" }) }),
8056
+ r && I.layoutFormat && /* @__PURE__ */ y("button", { className: "daga-layout", onClick: T, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Apply layout" }) }),
8057
+ l && /* @__PURE__ */ y("button", { className: `daga-filter ${o ? "daga-on" : "daga-off"}`, onClick: C, ref: v, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Apply filter" }) })
8044
8058
  ] }),
8045
- /* @__PURE__ */ v("button", { className: "daga-more-options", onClick: y, children: o ? /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "More options" }) : /* @__PURE__ */ v("span", { className: "daga-tooltip", children: "Less options" }) })
8059
+ /* @__PURE__ */ y("button", { className: "daga-more-options", onClick: w, children: d ? /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "More options" }) : /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Less options" }) })
8046
8060
  ]
8047
8061
  }
8048
8062
  ) });
@@ -8071,15 +8085,15 @@ const Ie = ({
8071
8085
  }, u = {
8072
8086
  refreshPalette: () => {
8073
8087
  }
8074
- }, y = new Ii(
8075
- (E) => f(E),
8076
- (E) => m(E)
8077
- ), k = {
8088
+ }, v = new Ii(
8089
+ (T) => f(T),
8090
+ (T) => m(T)
8091
+ ), w = {
8078
8092
  diagramButtons: p,
8079
8093
  palette: u,
8080
- propertyEditor: y
8081
- }, N = (E = !1) => ((!o.current || E) && (c.forEach((C) => C.unsubscribe()), o.current = new we(k, s)), o.current), R = N(), P = (E) => {
8082
- R.initView(E), c.push(
8094
+ propertyEditor: v
8095
+ }, I = (T = !1) => ((!o.current || T) && (c.forEach((C) => C.unsubscribe()), o.current = new Se(w, s)), o.current), R = I(), P = (T) => {
8096
+ R.initView(T), c.push(
8083
8097
  R.diagramEvent$.subscribe((C) => {
8084
8098
  a?.(C);
8085
8099
  })
@@ -8090,31 +8104,32 @@ const Ie = ({
8090
8104
  })
8091
8105
  );
8092
8106
  };
8093
- Ct(() => {
8107
+ St(() => {
8094
8108
  n.current && (d.current || (P(n.current), d.current = !0, e?.(R)));
8095
8109
  }, [n.current]), po(() => {
8096
- n.current && (N(!0), P(n.current), e?.(R));
8097
- }, [s]), Ct(() => {
8110
+ n.current && (I(!0), P(n.current), e?.(R));
8111
+ }, [s]), St(() => {
8098
8112
  t && r.import(R.model, t);
8099
8113
  }, [t]);
8100
- const tt = (E, C, O) => {
8101
- if (b !== void 0 && C.editable !== !1 && !St(E.getValue(C.name), O)) {
8102
- E.setValue(C.name, O);
8103
- const I = new yt(
8114
+ const et = (T, C, O) => {
8115
+ if (b !== void 0 && C.editable !== !1 && !wt(T.getValue(C.name), O)) {
8116
+ T.setValue(C.name, O);
8117
+ const x = new yt(
8104
8118
  b.propertySet,
8105
8119
  void 0
8106
8120
  );
8107
- I.setValues(b.getValues()), I.rootElement = b.rootElement, y.valueSet = I, b.rootElement.valueSet = I, R.propertyEditorChanges$?.next();
8121
+ x.setValues(b.getValues()), x.rootElement = b.rootElement, v.valueSet = x, b.rootElement.valueSet = x, R.propertyEditorChanges$?.next();
8108
8122
  }
8109
8123
  };
8110
- return /* @__PURE__ */ v("daga-diagram", { children: /* @__PURE__ */ v(Ai.Provider, { value: s, children: /* @__PURE__ */ v($t.Provider, { value: R, children: /* @__PURE__ */ T("daga-diagram-editor", { children: [
8111
- /* @__PURE__ */ v("div", { className: "daga-append-to", ref: n }),
8112
- /* @__PURE__ */ T($t.Provider, { value: R, children: [
8113
- s.components?.buttons !== void 0 && s.components?.buttons?.enabled !== !1 && /* @__PURE__ */ v(
8124
+ return /* @__PURE__ */ y("daga-diagram", { children: /* @__PURE__ */ y(Ai.Provider, { value: s, children: /* @__PURE__ */ y(Ct.Provider, { value: R, children: /* @__PURE__ */ M("daga-diagram-editor", { children: [
8125
+ /* @__PURE__ */ y("div", { className: "daga-append-to", ref: n }),
8126
+ /* @__PURE__ */ M(Ct.Provider, { value: R, children: [
8127
+ s.components?.buttons !== void 0 && s.components?.buttons?.enabled !== !1 && /* @__PURE__ */ y(
8114
8128
  Oi,
8115
8129
  {
8116
8130
  location: s.components?.buttons?.location || Kt.BottomRight,
8117
8131
  direction: s.components?.buttons?.direction || g.Top,
8132
+ centerAnimationDuration: s.components?.buttons?.centerAnimationDuration,
8118
8133
  enableAction: s.components?.buttons?.enableAction !== !1,
8119
8134
  enableFilter: s.components?.buttons?.enableFilter === !0,
8120
8135
  enableLayout: s.components?.buttons?.enableLayout === !0,
@@ -8122,7 +8137,7 @@ const Ie = ({
8122
8137
  enableZoom: s.components?.buttons?.enableZoom !== !1
8123
8138
  }
8124
8139
  ),
8125
- s.components?.palette !== void 0 && s.components?.palette?.enabled !== !1 && s.components?.palette?.sections && (s.components?.palette?.sections?.length || 0) > 0 && /* @__PURE__ */ v(
8140
+ s.components?.palette !== void 0 && s.components?.palette?.enabled !== !1 && s.components?.palette?.sections && (s.components?.palette?.sections?.length || 0) > 0 && /* @__PURE__ */ y(
8126
8141
  Vi,
8127
8142
  {
8128
8143
  location: s.components?.palette?.location || Kt.TopLeft,
@@ -8132,7 +8147,7 @@ const Ie = ({
8132
8147
  palettes: s.components?.palette?.sections || []
8133
8148
  }
8134
8149
  ),
8135
- s.components?.propertyEditor !== void 0 && s.components?.propertyEditor?.enabled !== !1 && /* @__PURE__ */ v(
8150
+ s.components?.propertyEditor !== void 0 && s.components?.propertyEditor?.enabled !== !1 && /* @__PURE__ */ y(
8136
8151
  zi,
8137
8152
  {
8138
8153
  location: s.components?.propertyEditor?.location || Kt.TopRight,
@@ -8141,10 +8156,10 @@ const Ie = ({
8141
8156
  height: s.components?.propertyEditor?.height,
8142
8157
  title: h,
8143
8158
  valueSet: b,
8144
- onValueChange: tt
8159
+ onValueChange: et
8145
8160
  }
8146
8161
  ),
8147
- s.components?.errors !== void 0 && s.components?.errors?.enabled !== !1 && /* @__PURE__ */ v(xi, {})
8162
+ s.components?.errors !== void 0 && s.components?.errors?.enabled !== !1 && /* @__PURE__ */ y(xi, {})
8148
8163
  ] })
8149
8164
  ] }) }) }) });
8150
8165
  };