@metadev/daga-react 4.2.16 → 4.2.18

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 y, jsxs as M, Fragment as ho } from "react/jsx-runtime";
1
+ import { jsx as y, jsxs as M, Fragment as lo } from "react/jsx-runtime";
2
2
  import * as L from "d3";
3
- import { debounceTime as go, Subject as jt, merge as fo, map as uo } from "rxjs";
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 || {}), 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) => {
3
+ import { debounceTime as co, Subject as Zt, merge as ho, map as go } from "rxjs";
4
+ import { createContext as _e, useState as D, useContext as Bt, useRef as rt, useEffect as $t, useMemo as fo } from "react";
5
+ var g = /* @__PURE__ */ ((s) => (s.Bottom = "bottom", s.Left = "left", s.Right = "right", s.Top = "top", s))(g || {}), qt = /* @__PURE__ */ ((s) => (s.BottomLeft = "bottom-left", s.BottomRight = "bottom-right", s.TopLeft = "top-left", s.TopRight = "top-right", s))(qt || {}), yt = /* @__PURE__ */ ((s) => (s.Left = "left", s.Center = "center", s.Right = "right", s))(yt || {}), bt = /* @__PURE__ */ ((s) => (s.Top = "top", s.Center = "center", s.Bottom = "bottom", s))(bt || {});
6
+ const Lt = (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":
@@ -32,7 +32,7 @@ const It = (s) => [Math.round(s[0]), Math.round(s[1])], ut = (s, t, e) => t < e
32
32
  }
33
33
  })();
34
34
  return [n, o];
35
- }, Ue = (s, t) => ((s[0] - t[0]) ** 2 + (s[1] - t[1]) ** 2) ** 0.5, mo = (s, t) => (ut(
35
+ }, Ge = (s, t) => ((s[0] - t[0]) ** 2 + (s[1] - t[1]) ** 2) ** 0.5, uo = (s, t) => (ut(
36
36
  s[0][0],
37
37
  t[0][0],
38
38
  t[1][0]
@@ -65,10 +65,10 @@ 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))($ || {}), 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 || {});
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 || {}), I = /* @__PURE__ */ ((s) => (s.Drag = "drag", s.Start = "start", s.End = "end", s))(I || {}), pe = /* @__PURE__ */ ((s) => (s.Zoom = "zoom", s.Start = "start", s.End = "end", s))(pe || {});
69
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
- const vo = 20, yo = (s, t, e, a, l) => {
70
+ var Fe = /* @__PURE__ */ ((s) => (s.Straight = "straight", s.Bezier = "bezier", s.Square = "square", s))(Fe || {}), Ce = /* @__PURE__ */ ((s) => (s.Solid = "solid", s.Dashed = "dashed", s.GappedDashes = "gapped-dashes", s.Dotted = "dotted", s))(Ce || {});
71
+ const po = 20, mo = (s, t, e, a, l) => {
72
72
  if (typeof s == "function")
73
73
  return s(
74
74
  t,
@@ -81,7 +81,7 @@ const vo = 20, yo = (s, t, e, a, l) => {
81
81
  if (t.length === 1)
82
82
  return `M ${t[0][0]} ${t[0][1]}`;
83
83
  {
84
- l = l || vo;
84
+ l = l || po;
85
85
  let r = "", i, n;
86
86
  switch (s) {
87
87
  case "straight":
@@ -285,72 +285,72 @@ 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 || {});
288
+ var Nt = /* @__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))(Nt || {});
289
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) {
293
293
  case "ellipse":
294
- return Ye(t, e, a, l);
294
+ return Ue(t, e, a, l);
295
295
  case "empty":
296
- return bo();
296
+ return vo();
297
297
  case "folder":
298
- return ko(t, e, a, l);
298
+ return yo(t, e, a, l);
299
299
  case "hexagon":
300
- return wo(t, e, a, l);
300
+ return bo(t, e, a, l);
301
301
  case "octagon":
302
- return So(t, e, a, l);
302
+ return ko(t, e, a, l);
303
303
  case "pill":
304
- return qt(t, e, a, l);
304
+ return Jt(t, e, a, l);
305
305
  case "rectangle":
306
306
  return Ee(t, e, a, l);
307
307
  case "rhombus":
308
- return Co(t, e, a, l);
308
+ return wo(t, e, a, l);
309
309
  case "rounded-rectangle":
310
- return $o(t, e, a, l);
310
+ return So(t, e, a, l);
311
311
  case "sticky-note":
312
- return Ao(t, e, a, l);
312
+ return Co(t, e, a, l);
313
313
  default:
314
314
  return Ee(t, e, a, l);
315
315
  }
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`;
316
+ }, Ue = (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`, vo = () => "Z", yo = (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`, bo = (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`, ko = (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`, Jt = (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` : Ue(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`, wo = (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`, So = (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`, Co = (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
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
- const Io = (s) => Math.max(...s.split(`
319
- `).map((t) => t.length)), xo = (s) => s.match(/\n/g)?.length || 0, j = [];
318
+ const $o = (s) => Math.max(...s.split(`
319
+ `).map((t) => t.length)), Ao = (s) => s.match(/\n/g)?.length || 0, j = [];
320
320
  for (let s = 0; s < 256; ++s)
321
321
  j.push((s + 256).toString(16).slice(1));
322
- function Lo(s, t = 0) {
322
+ function Io(s, t = 0) {
323
323
  return (j[s[t + 0]] + j[s[t + 1]] + j[s[t + 2]] + j[s[t + 3]] + "-" + j[s[t + 4]] + j[s[t + 5]] + "-" + j[s[t + 6]] + j[s[t + 7]] + "-" + j[s[t + 8]] + j[s[t + 9]] + "-" + j[s[t + 10]] + j[s[t + 11]] + j[s[t + 12]] + j[s[t + 13]] + j[s[t + 14]] + j[s[t + 15]]).toLowerCase();
324
324
  }
325
325
  let le;
326
- const Eo = new Uint8Array(16);
327
- function To() {
326
+ const xo = new Uint8Array(16);
327
+ function Lo() {
328
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
331
  le = crypto.getRandomValues.bind(crypto);
332
332
  }
333
- return le(Eo);
333
+ return le(xo);
334
334
  }
335
- const Mo = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Te = { randomUUID: Mo };
336
- function No(s, t, e) {
335
+ const Eo = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Te = { randomUUID: Eo };
336
+ function To(s, t, e) {
337
337
  s = s || {};
338
- const a = s.random ?? s.rng?.() ?? To();
338
+ const a = s.random ?? s.rng?.() ?? Lo();
339
339
  if (a.length < 16)
340
340
  throw new Error("Random bytes length must be >= 16");
341
- return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, Lo(a);
341
+ return a[6] = a[6] & 15 | 64, a[8] = a[8] & 63 | 128, Io(a);
342
342
  }
343
343
  function Me(s, t, e) {
344
- return Te.randomUUID && !s ? Te.randomUUID() : No(s);
344
+ return Te.randomUUID && !s ? Te.randomUUID() : To(s);
345
345
  }
346
- const Ct = (s) => {
346
+ const At = (s) => {
347
347
  if (typeof s != "object")
348
348
  return s;
349
349
  if (Array.isArray(s))
350
- return s.map(Ct);
350
+ return s.map(At);
351
351
  const t = {};
352
352
  for (const e of Object.entries(s))
353
- t[e[0]] = Ct(e[1]);
353
+ t[e[0]] = At(e[1]);
354
354
  return t;
355
355
  }, nt = (s) => {
356
356
  const { selected: t, highlighted: e, selectedAndHighlighted: a, ...l } = s, r = l, i = {
@@ -483,8 +483,8 @@ class ee {
483
483
  yield t;
484
484
  }
485
485
  }
486
- const Nt = 0;
487
- class At {
486
+ const Pt = 0;
487
+ class xt {
488
488
  constructor(t, e) {
489
489
  this.selfRemoved = !1, this.selfRemovedTimestamp = null, this.model = t, this._id = e;
490
490
  }
@@ -554,7 +554,7 @@ class ft extends ee {
554
554
  yield e;
555
555
  }
556
556
  }
557
- class Po {
557
+ class Mo {
558
558
  constructor(t, e, a, l, r, i, n) {
559
559
  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;
560
560
  }
@@ -576,24 +576,24 @@ class oe {
576
576
  return this.propertyList.length > 0;
577
577
  }
578
578
  }
579
- function kt(s, t) {
579
+ function St(s, t) {
580
580
  return !t || s[0] > t[0] ? !0 : s[0] === t[0] ? s[1] >= t[1] : !1;
581
581
  }
582
- 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) => {
582
+ const Ne = (s) => s == null || s === "" || s instanceof Array && s.length === 0 || s instanceof Object && Object.keys(s).length === 0, Ct = (s, t) => s === t || JSON.stringify(s) === JSON.stringify(t), De = (s, t, e) => {
583
583
  const a = {}, l = {};
584
584
  for (const r in e.propertySet.propertyMap)
585
585
  if (e.propertySet.propertyMap[r].type === N.Object) {
586
- const i = Be(
586
+ const i = De(
587
587
  s[r],
588
588
  t[r],
589
589
  e.getSubValueSet(r)
590
590
  );
591
591
  Object.keys(i[0]).length > 0 && Object.keys(i[1]).length > 0 && (a[r] = i[0], l[r] = i[1]);
592
592
  } else
593
- wt(s[r], t[r]) || (a[r] = s[r], l[r] = t[r]);
593
+ Ct(s[r], t[r]) || (a[r] = s[r], l[r] = t[r]);
594
594
  return [a, l];
595
- }, zo = (s) => s != null && s.constructor === Object;
596
- class yt {
595
+ }, No = (s) => s != null && s.constructor === Object;
596
+ class kt {
597
597
  constructor(t, e) {
598
598
  this.displayedProperties = [], this.hiddenProperties = [], this.values = {}, this.valueSets = {}, this.ownTimestamps = {}, this.propertySet = t, this.rootElement = e, this.resetValues();
599
599
  }
@@ -714,7 +714,7 @@ class yt {
714
714
  */
715
715
  hasSetValue(t) {
716
716
  const e = this.getValue(t), a = this.propertySet.getProperty(t);
717
- return a && a.type === N.Object ? this.getSubValueSet(t).hasAnySetValue() : !Ne(e) && !wt(e, a?.defaultValue);
717
+ return a && a.type === N.Object ? this.getSubValueSet(t).hasAnySetValue() : !Ne(e) && !Ct(e, a?.defaultValue);
718
718
  }
719
719
  /**
720
720
  * Checks if any of the values in the set are not empty or the default value.
@@ -736,7 +736,7 @@ class yt {
736
736
  setValue(t, e) {
737
737
  const a = this.propertySet.getProperty(t);
738
738
  if (a) {
739
- a.type === N.Object ? this.valueSets[t].setValues(e) : (this.values[t] = e, wt(e, a.defaultValue) || this.displayProperty(a));
739
+ a.type === N.Object ? this.valueSets[t].setValues(e) : (this.values[t] = e, Ct(e, a.defaultValue) || this.displayProperty(a));
740
740
  const l = a.rootAttribute;
741
741
  l != null && this.setRootElementValue(l, e);
742
742
  }
@@ -786,7 +786,7 @@ class yt {
786
786
  this.propertySet.getProperty(a).type === N.Object ? this.valueSets[a].overwriteValuesLww(
787
787
  t[a],
788
788
  e
789
- ) : kt(e, this.ownTimestamps[a]) && (this.setValue(a, t[a]), this.ownTimestamps[a] = e);
789
+ ) : St(e, this.ownTimestamps[a]) && (this.setValue(a, t[a]), this.ownTimestamps[a] = e);
790
790
  }
791
791
  /**
792
792
  * Sets all the values of this set to the defaults.
@@ -797,7 +797,7 @@ class yt {
797
797
  this.displayedProperties = [], this.hiddenProperties = [], this.ownTimestamps = {};
798
798
  for (const t in this.propertySet.propertyMap) {
799
799
  const e = this.propertySet.getProperty(t), a = e.rootAttribute;
800
- e.type === N.Object ? this.valueSets[t] = this.constructSubValueSet(t) : this.values[t] = Ct(e.defaultValue), a != null && e.defaultValue !== void 0 && !wt(
800
+ e.type === N.Object ? this.valueSets[t] = this.constructSubValueSet(t) : this.values[t] = At(e.defaultValue), a != null && e.defaultValue !== void 0 && !Ct(
801
801
  this.getRootElementValue(a),
802
802
  e.defaultValue
803
803
  ) && this.setRootElementValue(a, this.values[t]), e.basic !== !1 ? this.displayedProperties.push(e) : this.hiddenProperties.push(e);
@@ -810,9 +810,9 @@ class yt {
810
810
  * @returns The constructed ValueSet.
811
811
  */
812
812
  constructSubValueSet(t) {
813
- const e = this.propertySet.getProperty(t), a = new oe(e.properties), l = new yt(a, this.rootElement);
813
+ const e = this.propertySet.getProperty(t), a = new oe(e.properties), l = new kt(a, this.rootElement);
814
814
  return l.overwriteValues(
815
- Ct(e.defaultValue)
815
+ At(e.defaultValue)
816
816
  ), l;
817
817
  }
818
818
  /**
@@ -841,14 +841,14 @@ class yt {
841
841
  this.hiddenProperties.includes(t) || (this.hiddenProperties.push(t), B(this.displayedProperties, t));
842
842
  }
843
843
  }
844
- const ot = {
844
+ const et = {
845
845
  name: "",
846
846
  label: null,
847
847
  look: {
848
848
  lookType: "connection-look",
849
849
  color: "#000000",
850
850
  thickness: 1,
851
- shape: De.Straight,
851
+ shape: Fe.Straight,
852
852
  style: Ce.Solid,
853
853
  selected: {
854
854
  color: "#AA00AA"
@@ -863,10 +863,10 @@ const ot = {
863
863
  endTypes: [],
864
864
  properties: []
865
865
  };
866
- class Xe {
866
+ class Ye {
867
867
  constructor(t) {
868
868
  const e = {
869
- ...ot,
869
+ ...et,
870
870
  ...t
871
871
  };
872
872
  this.id = e.id, this.name = e.name, this.label = e.label;
@@ -894,19 +894,19 @@ class Xe {
894
894
  return this.endTypes.indexOf(t) >= 0;
895
895
  }
896
896
  }
897
- class dt extends At {
897
+ class dt extends xt {
898
898
  constructor(t, e, a, l, r) {
899
899
  if (t.connections.get(r) !== void 0)
900
900
  throw new Error(`DiagramConnection with id "${r}" already exists`);
901
901
  if (!r)
902
902
  throw new Error("DiagramConnection cannot have an empty or null id");
903
- super(t, r), this.startCoords = [0, 0], this.endCoords = [0, 0], this.startLabel = "", this.middleLabel = "", this.endLabel = "", this.points = [], this._type = e, this.valueSet = new yt(e.propertySet, this), this.originalData = {}, this.setStart(a), this.setEnd(l);
903
+ super(t, r), this.startCoords = [0, 0], this.endCoords = [0, 0], this.startLabel = "", this.middleLabel = "", this.endLabel = "", this.points = [], this._type = e, this.valueSet = new kt(e.propertySet, this), this.originalData = {}, this.setStart(a), this.setEnd(l);
904
904
  }
905
905
  get type() {
906
906
  return this._type;
907
907
  }
908
908
  set type(t) {
909
- t !== this._type && (this._type = t, this.valueSet && (this.valueSet = new yt(t.propertySet, this)), this.model.canvas?.userSelection?.openInPropertyEditor(this, !1), this.updateInView());
909
+ t !== this._type && (this._type = t, this.valueSet && (this.valueSet = new kt(t.propertySet, this)), this.model.canvas?.userSelection?.openInPropertyEditor(this, !1), this.updateInView());
910
910
  }
911
911
  get typeString() {
912
912
  return this.type.id;
@@ -1160,10 +1160,10 @@ class dt extends At {
1160
1160
  }
1161
1161
  }
1162
1162
  getPriority() {
1163
- return this.start ? this.end ? Math.min(this.start.getPriority(), this.end.getPriority()) : this.start.getPriority() : this.end ? this.end.getPriority() : Nt;
1163
+ return this.start ? this.end ? Math.min(this.start.getPriority(), this.end.getPriority()) : this.start.getPriority() : this.end ? this.end.getPriority() : Pt;
1164
1164
  }
1165
1165
  }
1166
- class Ro extends ft {
1166
+ class Po extends ft {
1167
1167
  /**
1168
1168
  * Instance a set of connections for the given model. This method is used internally.
1169
1169
  * @private
@@ -1182,7 +1182,7 @@ class Ro extends ft {
1182
1182
  */
1183
1183
  new(t, e, a, l) {
1184
1184
  let r;
1185
- if (t instanceof Xe)
1185
+ if (t instanceof Ye)
1186
1186
  r = t;
1187
1187
  else {
1188
1188
  const n = this.types.get(t);
@@ -1215,18 +1215,19 @@ const V = {
1215
1215
  color: "#000000",
1216
1216
  selectedColor: "#000000",
1217
1217
  backgroundColor: "#00000000",
1218
- horizontalAlign: Lt.Center,
1219
- verticalAlign: Jt.Center,
1218
+ horizontalAlign: yt.Center,
1219
+ verticalAlign: bt.Center,
1220
1220
  orientation: g.Top,
1221
+ multiline: !1,
1221
1222
  fit: !1,
1222
1223
  shrink: !0
1223
1224
  };
1224
- class ht extends At {
1225
- constructor(t, e, a, l, r, i, n, o, d, c, h, f, b, m, p, u) {
1226
- const v = `${e?.id}_field`;
1227
- if (t.fields.get(v) !== void 0)
1225
+ class ht extends xt {
1226
+ constructor(t, e, a, l, r, i, n, o, d, c, h, f, b, m, v, u, p) {
1227
+ const w = `${e?.id}_field`;
1228
+ if (t.fields.get(w) !== void 0)
1228
1229
  throw new Error("DiagramField for rootElement already exists");
1229
- 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)))
1230
+ if (super(t, w), 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)))
1230
1231
  this.orientation = Number(f);
1231
1232
  else
1232
1233
  switch (f) {
@@ -1245,7 +1246,7 @@ class ht extends At {
1245
1246
  default:
1246
1247
  this.orientation = 0;
1247
1248
  }
1248
- this.defaultText = b, this._text = b, this.editable = m, this.fit = p, this.shrink = u;
1249
+ this.multiline = b, this.defaultText = m, this._text = m, this.editable = v, this.fit = u, this.shrink = p;
1249
1250
  }
1250
1251
  /**
1251
1252
  * Text contents of this field.
@@ -1275,10 +1276,10 @@ class ht extends At {
1275
1276
  this.coords = t, this.updateInView();
1276
1277
  }
1277
1278
  getPriority() {
1278
- return this.rootElement?.getPriority() || Nt;
1279
+ return this.rootElement?.getPriority() || Pt;
1279
1280
  }
1280
1281
  }
1281
- class Vo extends ft {
1282
+ class zo extends ft {
1282
1283
  /**
1283
1284
  * Instance a set of fields for the given model. This method is used internally.
1284
1285
  * @private
@@ -1290,8 +1291,8 @@ class Vo extends ft {
1290
1291
  * Instance a new field and add it to this set. This method is normally called when instancing an element with a field and it is rarely called by itself.
1291
1292
  * @private
1292
1293
  */
1293
- new(t, e, a, l, r, i, n, o, d, c, h, f, b, m, p) {
1294
- const u = new ht(
1294
+ new(t, e, a, l, r, i, n, o, d, c, h, f, b, m, v, u) {
1295
+ const p = new ht(
1295
1296
  this.model,
1296
1297
  t,
1297
1298
  e,
@@ -1307,37 +1308,38 @@ class Vo extends ft {
1307
1308
  f,
1308
1309
  b,
1309
1310
  m,
1310
- p
1311
+ v,
1312
+ u
1311
1313
  );
1312
- return super.add(u), u.updateInView(), t !== void 0 && (t.label = u), u;
1314
+ return super.add(p), p.updateInView(), t !== void 0 && (t.label = p), p;
1313
1315
  }
1314
1316
  remove(t) {
1315
1317
  const e = this.get(t, !0);
1316
1318
  e && (e.rootElement?.label !== void 0 && e.rootElement.label === e && (e.rootElement.label = void 0), super.remove(t), e.updateInView());
1317
1319
  }
1318
1320
  }
1319
- 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]);
1320
- var Gt = /* @__PURE__ */ ((s) => (s[s.OnlyWhenSelected = 0] = "OnlyWhenSelected", s))(Gt || {});
1321
- const Pe = 1, ze = 1, Oo = 1, Ho = 1;
1322
- class _o {
1321
+ 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]), 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.length === 2 ? s.padding[0] : (s.padding.length === 3, s.padding[2]), _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[0] : s.padding.length === 2 || s.padding.length === 3 ? s.padding[1] : s.padding[3], Gt = (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]), Ft = (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]);
1322
+ var Ut = /* @__PURE__ */ ((s) => (s[s.OnlyWhenSelected = 0] = "OnlyWhenSelected", s))(Ut || {});
1323
+ const Pe = 1, ze = 1, Ro = 1, Vo = 1;
1324
+ class Oo {
1323
1325
  constructor(t) {
1324
1326
  this.margin = t.margin || 0, this.defaultWidths = t.defaultWidths || null, this.defaultHeights = t.defaultHeights || null, this.minWidths = t.minWidths || null, this.minHeights = t.minHeights || null, this.sections = [];
1325
1327
  for (const e of t.sections) {
1326
1328
  const a = [];
1327
1329
  this.sections.push(a);
1328
1330
  for (const l of e)
1329
- a.push(new Go(l));
1331
+ a.push(new Ho(l));
1330
1332
  }
1331
1333
  }
1332
1334
  }
1333
- class Go {
1335
+ class Ho {
1334
1336
  constructor(t) {
1335
- this.label = t.label || null, this.ports = t.ports || [], this.priority = t.priority || Nt, this.resizableX = t.resizableX, this.resizableY = t.resizableY;
1336
- const e = nt(t.look || We);
1337
+ this.label = t.label || null, this.ports = t.ports || [], this.priority = t.priority || Pt, this.resizableX = t.resizableX, this.resizableY = t.resizableY;
1338
+ const e = nt(t.look || Be);
1337
1339
  this.defaultLook = e.defaultLook, this.selectedLook = e.selectedLook, this.highlightedLook = e.highlightedLook, this.selectedAndHighlightedLook = e.selectedAndHighlightedLook;
1338
1340
  }
1339
1341
  }
1340
- class F extends At {
1342
+ class F extends xt {
1341
1343
  constructor(t, e, a, l, r, i, n, o) {
1342
1344
  if (t.sections.get(o) !== void 0)
1343
1345
  throw new Error(`DiagramSection with id "${o}" already exists`);
@@ -1417,13 +1419,13 @@ class F extends At {
1417
1419
  return this.node?.type?.sectionGrid?.sections?.[this.indexYInNode]?.[this.indexXInNode];
1418
1420
  }
1419
1421
  getMinWidth() {
1420
- return this.node?.type?.sectionGrid?.minWidths?.[this.indexXInNode] || Oo;
1422
+ return this.node?.type?.sectionGrid?.minWidths?.[this.indexXInNode] || Ro;
1421
1423
  }
1422
1424
  getMinHeight() {
1423
- return this.node?.type?.sectionGrid?.minHeights?.[this.indexYInNode] || Ho;
1425
+ return this.node?.type?.sectionGrid?.minHeights?.[this.indexYInNode] || Vo;
1424
1426
  }
1425
1427
  getPriority() {
1426
- return this.node?.type?.sectionGrid?.sections?.[this.indexYInNode]?.[this.indexXInNode]?.priority || Nt;
1428
+ return this.node?.type?.sectionGrid?.sections?.[this.indexYInNode]?.[this.indexXInNode]?.priority || Pt;
1427
1429
  }
1428
1430
  /**
1429
1431
  * Returns whether this section can be resized horizontally.
@@ -1433,7 +1435,7 @@ class F extends At {
1433
1435
  */
1434
1436
  getResizableX() {
1435
1437
  const t = this.type;
1436
- return t?.resizableX !== void 0 ? t.resizableX === Gt.OnlyWhenSelected ? this.selected : t.resizableX : this.node?.getResizableX() || !1;
1438
+ return t?.resizableX !== void 0 ? t.resizableX === Ut.OnlyWhenSelected ? this.selected : t.resizableX : this.node?.getResizableX() || !1;
1437
1439
  }
1438
1440
  /**
1439
1441
  * Returns whether this section can be resized vertically.
@@ -1443,7 +1445,7 @@ class F extends At {
1443
1445
  */
1444
1446
  getResizableY() {
1445
1447
  const t = this.type;
1446
- return t?.resizableY !== void 0 ? t.resizableY === Gt.OnlyWhenSelected ? this.selected : t.resizableY : this.node?.getResizableY() || !1;
1448
+ return t?.resizableY !== void 0 ? t.resizableY === Ut.OnlyWhenSelected ? this.selected : t.resizableY : this.node?.getResizableY() || !1;
1447
1449
  }
1448
1450
  /**
1449
1451
  * Get the port of this section which is closest to the given coordinates.
@@ -1593,7 +1595,7 @@ class F extends At {
1593
1595
  this.model.canvas?.autoTightenConnections !== !1 && this.getConnections().forEach((n) => n.tighten()), this.updateInView();
1594
1596
  }
1595
1597
  }
1596
- class Fo extends ft {
1598
+ class _o extends ft {
1597
1599
  /**
1598
1600
  * Instance a set of sections for the given model. This method is used internally.
1599
1601
  * @private
@@ -1640,38 +1642,39 @@ class Fo extends ft {
1640
1642
  const m = {
1641
1643
  ...V,
1642
1644
  ...b.type?.label
1643
- }, p = 6 * m.fontSize + Ot(m) + Ht(m), u = m.fontSize + _t(m) + Vt(m);
1644
- let v;
1645
+ }, v = 6 * m.fontSize + _t(m) + Gt(m), u = m.fontSize + Ft(m) + Ht(m);
1646
+ let p;
1645
1647
  switch (b.direction) {
1646
1648
  case g.Bottom:
1647
1649
  case g.Left:
1648
1650
  case g.Right:
1649
- v = [
1650
- b.coords[0] - p / 2,
1651
+ p = [
1652
+ b.coords[0] - v / 2,
1651
1653
  b.coords[1] - u - q(m)
1652
1654
  ];
1653
1655
  break;
1654
1656
  case g.Top:
1655
- v = [
1656
- b.coords[0] - p / 2,
1657
+ p = [
1658
+ b.coords[0] - v / 2,
1657
1659
  b.coords[1] + U(m)
1658
1660
  ];
1659
1661
  break;
1660
1662
  default:
1661
- v = b.coords;
1663
+ p = b.coords;
1662
1664
  }
1663
1665
  this.model.fields.new(
1664
1666
  b,
1665
- v,
1667
+ p,
1666
1668
  m.fontSize,
1667
1669
  m.fontFamily,
1668
1670
  m.color,
1669
1671
  m.selectedColor,
1670
- p,
1672
+ v,
1671
1673
  u,
1672
1674
  m.horizontalAlign,
1673
1675
  m.verticalAlign,
1674
1676
  m.orientation,
1677
+ m.multiline,
1675
1678
  "",
1676
1679
  m.editable,
1677
1680
  m.fit,
@@ -1700,6 +1703,7 @@ class Fo extends ft {
1700
1703
  h.horizontalAlign,
1701
1704
  h.verticalAlign,
1702
1705
  h.orientation,
1706
+ h.multiline,
1703
1707
  "",
1704
1708
  h.editable,
1705
1709
  h.fit,
@@ -1717,9 +1721,9 @@ class Fo extends ft {
1717
1721
  }
1718
1722
  }
1719
1723
  }
1720
- const We = {
1724
+ const Be = {
1721
1725
  lookType: "shaped-look",
1722
- shape: Mt.Rectangle,
1726
+ shape: Nt.Rectangle,
1723
1727
  fillColor: "#FFFFFF",
1724
1728
  borderColor: "#000000",
1725
1729
  borderThickness: 1,
@@ -1744,37 +1748,37 @@ const We = {
1744
1748
  ports: [],
1745
1749
  decorators: [],
1746
1750
  sectionGrid: null,
1747
- look: We,
1751
+ look: Be,
1748
1752
  isUnique: !1,
1749
1753
  canBeParentless: !0,
1750
1754
  childrenTypes: [],
1751
- priority: Nt,
1755
+ priority: Pt,
1752
1756
  properties: []
1753
1757
  };
1754
- class je {
1758
+ class Xe {
1755
1759
  constructor(t) {
1756
1760
  const e = {
1757
1761
  ...gt,
1758
1762
  ...t
1759
1763
  };
1760
- 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;
1764
+ 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 = Fo(e), this.leftPadding = Uo(e), this.rightPadding = Do(e), this.topPadding = Yo(e), this.label = e.label, this.ports = e.ports, this.decorators = e.decorators, this.sectionGrid = e.sectionGrid ? new Oo(e.sectionGrid) : null;
1761
1765
  const a = nt(e.look);
1762
1766
  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 || []);
1763
1767
  }
1764
1768
  }
1765
- class z extends At {
1769
+ class z extends xt {
1766
1770
  constructor(t, e, a = [0, 0], l) {
1767
1771
  if (t.nodes.get(l) !== void 0)
1768
1772
  throw new Error(`DiagramNode with id "${l}" already exists`);
1769
1773
  if (!l)
1770
1774
  throw new Error("DiagramNode cannot have an empty or null id");
1771
- super(t, l), this.children = [], this.sections = [], this.ports = [], this.decorators = [], this.geometryTimestamp = null, this._type = e, this.valueSet = new yt(e.propertySet, this), this.originalData = {}, this.coords = a, this.width = e.defaultWidth, this.height = e.defaultHeight;
1775
+ super(t, l), this.children = [], this.sections = [], this.ports = [], this.decorators = [], this.geometryTimestamp = null, this._type = e, this.valueSet = new kt(e.propertySet, this), this.originalData = {}, this.coords = a, this.width = e.defaultWidth, this.height = e.defaultHeight;
1772
1776
  }
1773
1777
  get type() {
1774
1778
  return this._type;
1775
1779
  }
1776
1780
  set type(t) {
1777
- t !== this._type && (this._type = t, this.valueSet && (this.valueSet = new yt(t.propertySet, this)), this.model.canvas?.userSelection?.openInPropertyEditor(this, !1), this.updateInView());
1781
+ t !== this._type && (this._type = t, this.valueSet && (this.valueSet = new kt(t.propertySet, this)), this.model.canvas?.userSelection?.openInPropertyEditor(this, !1), this.updateInView());
1778
1782
  }
1779
1783
  get typeString() {
1780
1784
  return this.type.id;
@@ -1867,7 +1871,7 @@ class z extends At {
1867
1871
  */
1868
1872
  getResizableX() {
1869
1873
  const t = this.type.resizableX;
1870
- return t === Gt.OnlyWhenSelected ? this.selected : t;
1874
+ return t === Ut.OnlyWhenSelected ? this.selected : t;
1871
1875
  }
1872
1876
  /**
1873
1877
  * Returns whether this node can be resized vertically.
@@ -1875,7 +1879,7 @@ class z extends At {
1875
1879
  */
1876
1880
  getResizableY() {
1877
1881
  const t = this.type.resizableY;
1878
- return t === Gt.OnlyWhenSelected ? this.selected : t;
1882
+ return t === Ut.OnlyWhenSelected ? this.selected : t;
1879
1883
  }
1880
1884
  /**
1881
1885
  * Get the port of this node which is closest to the given coordinates.
@@ -2332,7 +2336,7 @@ class z extends At {
2332
2336
  this.stretch(g.Bottom, e + a);
2333
2337
  }
2334
2338
  }
2335
- class Uo extends ft {
2339
+ class Go extends ft {
2336
2340
  /**
2337
2341
  * Instance a set of nodes for the given model. This method is used internally.
2338
2342
  * @private
@@ -2350,7 +2354,7 @@ class Uo extends ft {
2350
2354
  */
2351
2355
  new(t, e, a) {
2352
2356
  let l;
2353
- if (t instanceof je)
2357
+ if (t instanceof Xe)
2354
2358
  l = t;
2355
2359
  else {
2356
2360
  const i = this.types.get(t);
@@ -2398,7 +2402,7 @@ class Uo extends ft {
2398
2402
  const c = {
2399
2403
  ...V,
2400
2404
  ...d.type?.label
2401
- }, h = 6 * c.fontSize + Ot(c) + Ht(c), f = c.fontSize + _t(c) + Vt(c);
2405
+ }, h = 6 * c.fontSize + _t(c) + Gt(c), f = c.fontSize + Ft(c) + Ht(c);
2402
2406
  let b;
2403
2407
  switch (d.direction) {
2404
2408
  case g.Bottom:
@@ -2430,6 +2434,7 @@ class Uo extends ft {
2430
2434
  c.horizontalAlign,
2431
2435
  c.verticalAlign,
2432
2436
  c.orientation,
2437
+ c.multiline,
2433
2438
  "",
2434
2439
  c.editable,
2435
2440
  c.fit,
@@ -2457,6 +2462,7 @@ class Uo extends ft {
2457
2462
  i.horizontalAlign,
2458
2463
  i.verticalAlign,
2459
2464
  i.orientation,
2465
+ i.multiline,
2460
2466
  "",
2461
2467
  i.editable,
2462
2468
  i.fit,
@@ -2511,14 +2517,14 @@ class Uo extends ft {
2511
2517
  return a;
2512
2518
  }
2513
2519
  }
2514
- const Ze = (s) => {
2520
+ const We = (s) => {
2515
2521
  for (let t = 0; t < s.length; ++t)
2516
2522
  for (let e = 0; e < s.length; ++e)
2517
2523
  e !== t && s[e].isAncestorOf(s[t]) && (s.splice(e, 1), --e, t > e && --t);
2518
2524
  return s;
2519
- }, 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 = {
2525
+ }, Fo = (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]), Uo = (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], 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[0] : (s.padding.length === 2 || s.padding.length === 3, s.padding[1]), 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.length === 2 || s.padding.length === 3, s.padding[0]), je = {
2520
2526
  lookType: "shaped-look",
2521
- shape: Mt.Ellipse,
2527
+ shape: Nt.Ellipse,
2522
2528
  fillColor: "transparent",
2523
2529
  borderColor: "transparent",
2524
2530
  borderThickness: 0,
@@ -2528,18 +2534,18 @@ const Ze = (s) => {
2528
2534
  highlighted: {
2529
2535
  fillColor: "rgba(0, 255, 255, 0.5)"
2530
2536
  }
2531
- }, Zt = nt(Ke), qe = {
2537
+ }, Kt = nt(je), Ze = {
2532
2538
  name: "",
2533
2539
  label: null,
2534
2540
  allowsOutgoing: !0,
2535
2541
  allowsIncoming: !0,
2536
2542
  width: 24,
2537
- look: Ke
2543
+ look: je
2538
2544
  };
2539
- class Wo {
2545
+ class Bo {
2540
2546
  constructor(t) {
2541
2547
  const e = {
2542
- ...qe,
2548
+ ...Ze,
2543
2549
  ...t
2544
2550
  };
2545
2551
  this.id = e.id, this.name = e.name, this.label = e.label, this.allowsOutgoing = e.allowsOutgoing, this.allowsIncoming = e.allowsIncoming, this.width = e.width;
@@ -2547,7 +2553,7 @@ class Wo {
2547
2553
  this.defaultLook = a.defaultLook, this.selectedLook = a.selectedLook, this.highlightedLook = a.highlightedLook, this.selectedAndHighlightedLook = a.selectedAndHighlightedLook;
2548
2554
  }
2549
2555
  }
2550
- class bt extends At {
2556
+ class wt extends xt {
2551
2557
  constructor(t, e, a, l, r, i, n, o = "floating", d = "floating") {
2552
2558
  if (t.ports.get(n) !== void 0)
2553
2559
  throw new Error(`DiagramPort with id "${n}" already exists`);
@@ -2600,7 +2606,7 @@ class bt extends At {
2600
2606
  * @private
2601
2607
  */
2602
2608
  get look() {
2603
- return this.selected ? this.highlighted ? this._selectedAndHighlightedLook !== void 0 ? this._selectedAndHighlightedLook : (this.type || Zt)?.selectedAndHighlightedLook : this._selectedLook !== void 0 ? this._selectedLook : (this.type || Zt)?.selectedLook : this.highlighted ? this._highlightedLook !== void 0 ? this._highlightedLook : (this.type || Zt)?.highlightedLook : this._defaultLook !== void 0 ? this._defaultLook : (this.type || Zt)?.defaultLook;
2609
+ return this.selected ? this.highlighted ? this._selectedAndHighlightedLook !== void 0 ? this._selectedAndHighlightedLook : (this.type || Kt)?.selectedAndHighlightedLook : this._selectedLook !== void 0 ? this._selectedLook : (this.type || Kt)?.selectedLook : this.highlighted ? this._highlightedLook !== void 0 ? this._highlightedLook : (this.type || Kt)?.highlightedLook : this._defaultLook !== void 0 ? this._defaultLook : (this.type || Kt)?.defaultLook;
2604
2610
  }
2605
2611
  /**
2606
2612
  * An alias for the `lookConfig` attribute.
@@ -2647,7 +2653,7 @@ class bt extends At {
2647
2653
  * @private
2648
2654
  */
2649
2655
  get width() {
2650
- return this.type?.width || qe.width;
2656
+ return this.type?.width || Ze.width;
2651
2657
  }
2652
2658
  /**
2653
2659
  * Current height of this port. Same as the width.
@@ -2698,7 +2704,7 @@ class bt extends At {
2698
2704
  return this.rootElement.node;
2699
2705
  }
2700
2706
  getPriority() {
2701
- return this.rootElement?.getPriority() || Nt;
2707
+ return this.rootElement?.getPriority() || Pt;
2702
2708
  }
2703
2709
  /**
2704
2710
  * Change the coordinates of this port to the given coordinates and move its labels correspondingly.
@@ -2721,10 +2727,10 @@ class bt extends At {
2721
2727
  ]), this.updateInView();
2722
2728
  }
2723
2729
  distanceTo(t) {
2724
- return Ue(this.coords, t);
2730
+ return Ge(this.coords, t);
2725
2731
  }
2726
2732
  }
2727
- class jo extends ft {
2733
+ class Xo extends ft {
2728
2734
  /**
2729
2735
  * Instance a set of ports for the given model. This method is used internally.
2730
2736
  * @private
@@ -2737,7 +2743,7 @@ class jo extends ft {
2737
2743
  * @private
2738
2744
  */
2739
2745
  new(t, e, a, l, r, i, n = "floating", o = "floating") {
2740
- const d = new bt(
2746
+ const d = new wt(
2741
2747
  this.model,
2742
2748
  t,
2743
2749
  e,
@@ -2761,7 +2767,7 @@ class jo extends ft {
2761
2767
  }
2762
2768
  }
2763
2769
  }
2764
- class Je {
2770
+ class Ke {
2765
2771
  import(t, e) {
2766
2772
  t.clear(), e.id && (t.id = e.id), t.name = e.name, t.description = e.description, t.type = e.type, t.createdAt = new Date(e.createdAt), t.updatedAt = new Date(e.updatedAt);
2767
2773
  for (const a of e.nodes || [])
@@ -2810,6 +2816,7 @@ class Je {
2810
2816
  i.horizontalAlign,
2811
2817
  i.verticalAlign,
2812
2818
  i.orientation,
2819
+ i.multiline,
2813
2820
  "",
2814
2821
  i.editable,
2815
2822
  i.fit,
@@ -2852,6 +2859,7 @@ class Je {
2852
2859
  d.horizontalAlign,
2853
2860
  d.verticalAlign,
2854
2861
  d.orientation,
2862
+ d.multiline,
2855
2863
  "",
2856
2864
  d.editable,
2857
2865
  d.fit,
@@ -2861,7 +2869,7 @@ class Je {
2861
2869
  }
2862
2870
  let o = 0;
2863
2871
  for (const d of i.ports || []) {
2864
- const c = d.type !== void 0 ? t.ports.types.get(d.type) : void 0, h = new bt(
2872
+ const c = d.type !== void 0 ? t.ports.types.get(d.type) : void 0, h = new wt(
2865
2873
  t,
2866
2874
  c,
2867
2875
  n,
@@ -2913,6 +2921,7 @@ class Je {
2913
2921
  f.horizontalAlign,
2914
2922
  f.verticalAlign,
2915
2923
  f.orientation,
2924
+ f.multiline,
2916
2925
  "",
2917
2926
  f.editable,
2918
2927
  f.fit,
@@ -2931,7 +2940,7 @@ class Je {
2931
2940
  }
2932
2941
  let r = 0;
2933
2942
  for (const i of e.ports || []) {
2934
- const n = i.type !== void 0 ? t.ports.types.get(i.type) : void 0, o = new bt(
2943
+ const n = i.type !== void 0 ? t.ports.types.get(i.type) : void 0, o = new wt(
2935
2944
  t,
2936
2945
  n,
2937
2946
  l,
@@ -2983,6 +2992,7 @@ class Je {
2983
2992
  d.horizontalAlign,
2984
2993
  d.verticalAlign,
2985
2994
  d.orientation,
2995
+ d.multiline,
2986
2996
  "",
2987
2997
  d.editable,
2988
2998
  d.fit,
@@ -3023,7 +3033,7 @@ class ie {
3023
3033
  do() {
3024
3034
  const t = this.canvas.model.nodes.new(this.typeId, this.coords, this.id);
3025
3035
  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(
3026
- Ct({
3036
+ At({
3027
3037
  ...t.valueSet.getValues(),
3028
3038
  ...this.values
3029
3039
  })
@@ -3058,7 +3068,7 @@ class $e {
3058
3068
  }
3059
3069
  do() {
3060
3070
  const t = this.canvas.model.nodes.get(this.nodeId);
3061
- t && kt(this.timestamp, t.geometryTimestamp) && (this.copyColumnIndex !== void 0 && t.copySectionColumn(this.copyColumnIndex), this.copyRowIndex !== void 0 && t.copySectionRow(this.copyRowIndex), this.removeColumnIndex !== void 0 && t.removeSectionColumn(this.removeColumnIndex), this.removeRowIndex !== void 0 && t.removeSectionRow(this.removeRowIndex), t.geometryTimestamp = this.timestamp);
3071
+ t && St(this.timestamp, t.geometryTimestamp) && (this.copyColumnIndex !== void 0 && t.copySectionColumn(this.copyColumnIndex), this.copyRowIndex !== void 0 && t.copySectionRow(this.copyRowIndex), this.removeColumnIndex !== void 0 && t.removeSectionColumn(this.removeColumnIndex), this.removeRowIndex !== void 0 && t.removeSectionRow(this.removeRowIndex), t.geometryTimestamp = this.timestamp);
3062
3072
  }
3063
3073
  serialize() {
3064
3074
  return {
@@ -3090,7 +3100,7 @@ class Ae {
3090
3100
  do() {
3091
3101
  for (const t in this.to) {
3092
3102
  const e = this.canvas.model.nodes.get(t, !0);
3093
- if (e && kt(this.timestamp, e.geometryTimestamp)) {
3103
+ if (e && St(this.timestamp, e.geometryTimestamp)) {
3094
3104
  const a = this.to[t];
3095
3105
  e.move([a[0], a[1]]), e.geometryTimestamp = this.timestamp;
3096
3106
  }
@@ -3111,14 +3121,14 @@ class Ae {
3111
3121
  );
3112
3122
  }
3113
3123
  }
3114
- class Ft {
3124
+ class Dt {
3115
3125
  constructor(t, e, a, l) {
3116
3126
  this.canvas = t, this.nodeIds = e, this.delta = a, this.timestamp = l;
3117
3127
  }
3118
3128
  do() {
3119
3129
  for (const t of this.nodeIds) {
3120
3130
  const e = this.canvas.model.nodes.get(t, !0);
3121
- e && kt(this.timestamp, e.geometryTimestamp) && (e.move([
3131
+ e && St(this.timestamp, e.geometryTimestamp) && (e.move([
3122
3132
  e.coords[0] + this.delta[0],
3123
3133
  e.coords[1] + this.delta[1]
3124
3134
  ]), e.parent?.fitToChild(e), e.geometryTimestamp = this.timestamp);
@@ -3133,7 +3143,7 @@ class Ft {
3133
3143
  };
3134
3144
  }
3135
3145
  static deserialize(t, e) {
3136
- return new Ft(
3146
+ return new Dt(
3137
3147
  t,
3138
3148
  e.nodeIds,
3139
3149
  e.delta,
@@ -3147,7 +3157,7 @@ class st {
3147
3157
  }
3148
3158
  do() {
3149
3159
  const t = this.canvas.model.nodes.get(this.nodeId, !0);
3150
- if (t && kt(this.timestamp, t.geometryTimestamp)) {
3160
+ if (t && St(this.timestamp, t.geometryTimestamp)) {
3151
3161
  t.setGeometry(this.to), t.label?.fit && this.canvas.fitFieldRootInView(t.label.id, t.label.shrink);
3152
3162
  for (const e of t.sections)
3153
3163
  e.label?.fit && this.canvas.fitFieldRootInView(
@@ -3174,13 +3184,13 @@ class st {
3174
3184
  );
3175
3185
  }
3176
3186
  }
3177
- class Ut {
3187
+ class Yt {
3178
3188
  constructor(t, e, a, l, r) {
3179
3189
  this.canvas = t, this.childId = e, this.parentId = a, this.childGeometry = l, this.timestamp = r;
3180
3190
  }
3181
3191
  do() {
3182
3192
  const t = this.canvas.model.nodes.get(this.childId, !0), e = this.parentId !== void 0 ? this.canvas.model.nodes.get(this.parentId, !0) : void 0;
3183
- t && (this.parentId === void 0 || e) && kt(this.timestamp, t.geometryTimestamp) && (t.parent?.removeChild(t), t.setGeometry(this.childGeometry), e?.addChild(t));
3193
+ t && (this.parentId === void 0 || e) && St(this.timestamp, t.geometryTimestamp) && (t.parent?.removeChild(t), t.setGeometry(this.childGeometry), e?.addChild(t));
3184
3194
  }
3185
3195
  serialize() {
3186
3196
  return {
@@ -3192,7 +3202,7 @@ class Ut {
3192
3202
  };
3193
3203
  }
3194
3204
  static deserialize(t, e) {
3195
- return new Ut(
3205
+ return new Yt(
3196
3206
  t,
3197
3207
  e.childId,
3198
3208
  e.parentId,
@@ -3228,13 +3238,13 @@ class se {
3228
3238
  );
3229
3239
  }
3230
3240
  }
3231
- class Et {
3241
+ class Tt {
3232
3242
  constructor(t, e, a, l) {
3233
3243
  this.canvas = t, this.fieldId = e, this.to = a, this.timestamp = l;
3234
3244
  }
3235
3245
  do() {
3236
3246
  const t = this.canvas.model.fields.get(this.fieldId, !0);
3237
- t && kt(this.timestamp, t.textTimestamp) && (t.text = this.to, t.textTimestamp = this.timestamp);
3247
+ t && St(this.timestamp, t.textTimestamp) && (t.text = this.to, t.textTimestamp = this.timestamp);
3238
3248
  }
3239
3249
  serialize() {
3240
3250
  return {
@@ -3245,7 +3255,7 @@ class Et {
3245
3255
  };
3246
3256
  }
3247
3257
  static deserialize(t, e) {
3248
- return new Et(
3258
+ return new Tt(
3249
3259
  t,
3250
3260
  e.fieldId,
3251
3261
  e.to,
@@ -3253,7 +3263,7 @@ class Et {
3253
3263
  );
3254
3264
  }
3255
3265
  }
3256
- class Tt {
3266
+ class Mt {
3257
3267
  constructor(t, e, a, l) {
3258
3268
  this.canvas = t, this.id = e, this.to = a, this.timestamp = l;
3259
3269
  }
@@ -3272,7 +3282,7 @@ class Tt {
3272
3282
  };
3273
3283
  }
3274
3284
  static deserialize(t, e) {
3275
- return new Tt(
3285
+ return new Mt(
3276
3286
  t,
3277
3287
  e.id,
3278
3288
  e.to,
@@ -3285,7 +3295,7 @@ class at {
3285
3295
  this.canvas = t, this.nodeIds = e, this.sectionIds = a, this.portIds = l, this.connectionIds = r, this.fieldIds = i, this.selfRemoved = n, this.timestamp = o;
3286
3296
  }
3287
3297
  doOne(t) {
3288
- t && kt(this.timestamp, t.selfRemovedTimestamp) && (t.selfRemoved = this.selfRemoved, t.selfRemovedTimestamp = this.timestamp);
3298
+ t && St(this.timestamp, t.selfRemovedTimestamp) && (t.selfRemoved = this.selfRemoved, t.selfRemovedTimestamp = this.timestamp);
3289
3299
  }
3290
3300
  do() {
3291
3301
  for (const t of this.nodeIds)
@@ -3330,7 +3340,7 @@ class ne {
3330
3340
  this.canvas = t, this.nodes = e, this.connections = a;
3331
3341
  }
3332
3342
  do() {
3333
- const t = new Je();
3343
+ const t = new Ke();
3334
3344
  this.canvas.userSelection.clear();
3335
3345
  for (const e of this.nodes) {
3336
3346
  const a = t.importNode(this.canvas.model, e);
@@ -3359,7 +3369,7 @@ class ne {
3359
3369
  );
3360
3370
  }
3361
3371
  }
3362
- class Zo {
3372
+ class Wo {
3363
3373
  constructor(t) {
3364
3374
  this.isInRoom = !1, this.canvas = t, this.replicaId = Me();
3365
3375
  }
@@ -3411,7 +3421,7 @@ class Zo {
3411
3421
  break;
3412
3422
  }
3413
3423
  case "move": {
3414
- Ft.deserialize(this.canvas, t).do();
3424
+ Dt.deserialize(this.canvas, t).do();
3415
3425
  break;
3416
3426
  }
3417
3427
  case "setGeometry": {
@@ -3422,7 +3432,7 @@ class Zo {
3422
3432
  break;
3423
3433
  }
3424
3434
  case "setParent": {
3425
- Ut.deserialize(this.canvas, t).do();
3435
+ Yt.deserialize(this.canvas, t).do();
3426
3436
  break;
3427
3437
  }
3428
3438
  case "addConnection": {
@@ -3433,11 +3443,11 @@ class Zo {
3433
3443
  break;
3434
3444
  }
3435
3445
  case "editField": {
3436
- Et.deserialize(this.canvas, t).do();
3446
+ Tt.deserialize(this.canvas, t).do();
3437
3447
  break;
3438
3448
  }
3439
3449
  case "updateValues": {
3440
- Tt.deserialize(
3450
+ Mt.deserialize(
3441
3451
  this.canvas,
3442
3452
  t
3443
3453
  ).do();
@@ -3462,7 +3472,7 @@ class Zo {
3462
3472
  }
3463
3473
  }
3464
3474
  }
3465
- class Ko {
3475
+ class jo {
3466
3476
  constructor(t, e) {
3467
3477
  this.canvas = t, this.maximum = e, this.history = [], this.index = 0;
3468
3478
  }
@@ -3515,7 +3525,7 @@ class Ko {
3515
3525
  }
3516
3526
  }
3517
3527
  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 || {});
3518
- class qo {
3528
+ class Zo {
3519
3529
  constructor(t, e, a, l, r, i, n, o, d) {
3520
3530
  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();
3521
3531
  }
@@ -3590,7 +3600,7 @@ class de {
3590
3600
  this.canvas = t, this.nodeIds = e, this.delta = a;
3591
3601
  }
3592
3602
  do() {
3593
- const t = new Ft(
3603
+ const t = new Dt(
3594
3604
  this.canvas,
3595
3605
  this.nodeIds,
3596
3606
  this.delta,
@@ -3599,7 +3609,7 @@ class de {
3599
3609
  return this.canvas.collabEngine.doCollaboratively(t), this.nodeIds.map((e) => this.canvas.model.nodes.get(e) !== void 0).includes(!0) && (this.delta[0] !== 0 || this.delta[1] !== 0);
3600
3610
  }
3601
3611
  undo() {
3602
- const t = new Ft(
3612
+ const t = new Dt(
3603
3613
  this.canvas,
3604
3614
  this.nodeIds,
3605
3615
  [-this.delta[0], -this.delta[1]],
@@ -3673,12 +3683,12 @@ class X {
3673
3683
  return t !== void 0;
3674
3684
  }
3675
3685
  }
3676
- class Jo {
3686
+ class Ko {
3677
3687
  constructor(t, e, a, l, r, i, n, o, d) {
3678
3688
  this.canvas = t, this.childId = e, this.fromParentId = a, this.toParentId = l, this.fromChildGeometry = r, this.toChildGeometry = i, this.ancestorId = n, this.fromAncestorGeometry = o, this.toAncestorGeometry = d;
3679
3689
  }
3680
3690
  do() {
3681
- const t = this.canvas.model.nodes.get(this.childId), e = new Ut(
3691
+ const t = this.canvas.model.nodes.get(this.childId), e = new Yt(
3682
3692
  this.canvas,
3683
3693
  this.childId,
3684
3694
  this.toParentId,
@@ -3697,7 +3707,7 @@ class Jo {
3697
3707
  return t !== void 0;
3698
3708
  }
3699
3709
  undo() {
3700
- const t = this.canvas.model.nodes.get(this.childId), e = new Ut(
3710
+ const t = this.canvas.model.nodes.get(this.childId), e = new Yt(
3701
3711
  this.canvas,
3702
3712
  this.childId,
3703
3713
  this.fromParentId,
@@ -3765,7 +3775,7 @@ class Re {
3765
3775
  this.canvas = t, this.fieldId = e, this.from = a, this.to = l;
3766
3776
  }
3767
3777
  do() {
3768
- const t = this.canvas.model.fields.get(this.fieldId), e = new Et(
3778
+ const t = this.canvas.model.fields.get(this.fieldId), e = new Tt(
3769
3779
  this.canvas,
3770
3780
  this.fieldId,
3771
3781
  this.to,
@@ -3777,7 +3787,7 @@ class Re {
3777
3787
  const t = this.canvas.model.fields.get(this.fieldId);
3778
3788
  if (t) {
3779
3789
  this.to = t.text;
3780
- const e = new Et(
3790
+ const e = new Tt(
3781
3791
  this.canvas,
3782
3792
  this.fieldId,
3783
3793
  this.from,
@@ -3791,7 +3801,7 @@ class Re {
3791
3801
  const t = this.canvas.model.fields.get(this.fieldId);
3792
3802
  if (t) {
3793
3803
  this.from = t.text;
3794
- const e = new Et(
3804
+ const e = new Tt(
3795
3805
  this.canvas,
3796
3806
  this.fieldId,
3797
3807
  this.to,
@@ -3802,12 +3812,12 @@ class Re {
3802
3812
  return t !== void 0;
3803
3813
  }
3804
3814
  }
3805
- class Qo {
3815
+ class qo {
3806
3816
  constructor(t, e, a, l) {
3807
3817
  this.canvas = t, this.id = e, this.from = a, this.to = l;
3808
3818
  }
3809
3819
  do() {
3810
- const t = new Tt(
3820
+ const t = new Mt(
3811
3821
  this.canvas,
3812
3822
  this.id,
3813
3823
  this.to,
@@ -3816,7 +3826,7 @@ class Qo {
3816
3826
  return this.canvas.collabEngine.doCollaboratively(t), !0;
3817
3827
  }
3818
3828
  undo() {
3819
- const t = new Tt(
3829
+ const t = new Mt(
3820
3830
  this.canvas,
3821
3831
  this.id,
3822
3832
  this.from,
@@ -3829,7 +3839,7 @@ class Qo {
3829
3839
  return !e.rootElement.removed;
3830
3840
  }
3831
3841
  redo() {
3832
- const t = new Tt(
3842
+ const t = new Mt(
3833
3843
  this.canvas,
3834
3844
  this.id,
3835
3845
  this.to,
@@ -3842,7 +3852,7 @@ class Qo {
3842
3852
  return !e.rootElement.removed;
3843
3853
  }
3844
3854
  }
3845
- class ti {
3855
+ class Jo {
3846
3856
  constructor(t, e, a, l, r, i) {
3847
3857
  this.canvas = t, this.nodeIds = e, this.sectionIds = a, this.portIds = l, this.connectionIds = r, this.fieldIds = i;
3848
3858
  }
@@ -3884,7 +3894,7 @@ class ti {
3884
3894
  return this.do();
3885
3895
  }
3886
3896
  }
3887
- class ei {
3897
+ class Qo {
3888
3898
  constructor(t, e, a, l) {
3889
3899
  this.canvas = t, this.nodes = e, this.connections = a, this.coords = l;
3890
3900
  }
@@ -3975,7 +3985,7 @@ class ei {
3975
3985
  return this.canvas.collabEngine.doCollaboratively(e), t;
3976
3986
  }
3977
3987
  }
3978
- class Yt {
3988
+ class zt {
3979
3989
  constructor(t) {
3980
3990
  this.type = t, this.defaultPrevented = !1;
3981
3991
  }
@@ -3983,8 +3993,8 @@ class Yt {
3983
3993
  this.defaultPrevented = !0;
3984
3994
  }
3985
3995
  }
3986
- var Qe = /* @__PURE__ */ ((s) => (s[s.Zoom = 0] = "Zoom", s[s.DoubleClick = 1] = "DoubleClick", s[s.SecondaryClick = 2] = "SecondaryClick", s[s.Selection = 3] = "Selection", s[s.Highlight = 4] = "Highlight", s))(Qe || {});
3987
- class oi extends Yt {
3996
+ var qe = /* @__PURE__ */ ((s) => (s[s.Zoom = 0] = "Zoom", s[s.DoubleClick = 1] = "DoubleClick", s[s.SecondaryClick = 2] = "SecondaryClick", s[s.Selection = 3] = "Selection", s[s.Highlight = 4] = "Highlight", s[s.DraggingNode = 5] = "DraggingNode", s))(qe || {});
3997
+ class ti extends zt {
3988
3998
  /**
3989
3999
  * Create a diagram zoom event.
3990
4000
  *
@@ -3997,7 +4007,7 @@ class oi extends Yt {
3997
4007
  ), this.coords = t, this.zoom = e;
3998
4008
  }
3999
4009
  }
4000
- class pt extends Yt {
4010
+ class pt extends zt {
4001
4011
  /**
4002
4012
  * Create a diagram double click event.
4003
4013
  *
@@ -4012,7 +4022,7 @@ class pt extends Yt {
4012
4022
  ), this.cause = t, this.target = e, this.coords = a;
4013
4023
  }
4014
4024
  }
4015
- class mt extends Yt {
4025
+ class mt extends zt {
4016
4026
  /**
4017
4027
  * Create a diagram secondary click event.
4018
4028
  *
@@ -4027,7 +4037,7 @@ class mt extends Yt {
4027
4037
  ), this.cause = t, this.target = e, this.coords = a;
4028
4038
  }
4029
4039
  }
4030
- class G extends Yt {
4040
+ class G extends zt {
4031
4041
  /**
4032
4042
  * Create a diagram selection event.
4033
4043
  *
@@ -4041,7 +4051,7 @@ class G extends Yt {
4041
4051
  ), this.targets = t, this.selected = e;
4042
4052
  }
4043
4053
  }
4044
- class tt extends Yt {
4054
+ class tt extends zt {
4045
4055
  /**
4046
4056
  * Create a diagram highlight event.
4047
4057
  *
@@ -4054,7 +4064,20 @@ class tt extends Yt {
4054
4064
  ), this.target = t;
4055
4065
  }
4056
4066
  }
4057
- class to extends At {
4067
+ class ei extends zt {
4068
+ /**
4069
+ * Create a diagram dragging node event.
4070
+ *
4071
+ * @param target Diagram node which is targeted by the event.
4072
+ */
4073
+ constructor(t) {
4074
+ super(
4075
+ 5
4076
+ /* DraggingNode */
4077
+ ), this.target = t;
4078
+ }
4079
+ }
4080
+ class Je extends xt {
4058
4081
  constructor(t, e, a, l, r, i, n, o, d = "floating", c = "floating") {
4059
4082
  if (t.objects.get(o) !== void 0)
4060
4083
  throw new Error(`DiagramDecorator with id "${o}" already exists`);
@@ -4083,7 +4106,7 @@ class to extends At {
4083
4106
  return this.priority;
4084
4107
  }
4085
4108
  }
4086
- class ii extends ft {
4109
+ class oi extends ft {
4087
4110
  /**
4088
4111
  * Instance a set of decorators for the given model. This method is used internally.
4089
4112
  * @private
@@ -4103,7 +4126,7 @@ class ii extends ft {
4103
4126
  * @returns The instanced decorator.
4104
4127
  */
4105
4128
  new(t, e, a, l, r, i, n, o = "floating", d = "floating") {
4106
- const c = new to(
4129
+ const c = new Je(
4107
4130
  this.model,
4108
4131
  t,
4109
4132
  e,
@@ -4122,7 +4145,7 @@ class ii extends ft {
4122
4145
  e && ((e.rootElement instanceof z || e.rootElement instanceof F) && B(e.rootElement.decorators, e), super.remove(t), e.updateInView());
4123
4146
  }
4124
4147
  }
4125
- class si extends At {
4148
+ class ii extends xt {
4126
4149
  constructor(t, e, a, l, r, i, n) {
4127
4150
  if (t.objects.get(n) !== void 0)
4128
4151
  throw new Error(`DiagramObject with id "${n}" already exists`);
@@ -4151,7 +4174,7 @@ class si extends At {
4151
4174
  return this.priority;
4152
4175
  }
4153
4176
  }
4154
- class ni extends ft {
4177
+ class si extends ft {
4155
4178
  /**
4156
4179
  * Instance a set of objects for the given model. This method is used internally.
4157
4180
  * @private
@@ -4171,7 +4194,7 @@ class ni extends ft {
4171
4194
  * @returns The instanced object.
4172
4195
  */
4173
4196
  new(t, e, a, l, r, i) {
4174
- const n = new si(
4197
+ const n = new ii(
4175
4198
  this.model,
4176
4199
  t,
4177
4200
  e,
@@ -4187,9 +4210,9 @@ class ni extends ft {
4187
4210
  e && (super.remove(t), e.updateInView());
4188
4211
  }
4189
4212
  }
4190
- class eo {
4213
+ class Qe {
4191
4214
  constructor(t, e, a, l, r, i = []) {
4192
- this.nodes = new Uo(this), this.sections = new Fo(this), this.ports = new jo(this), this.connections = new Ro(this), this.fields = new Vo(this), this.objects = new ni(this), this.decorators = new ii(this), this.canvas = t, this.id = e, this.name = a, this.description = l, this.type = r, this.createdAt = /* @__PURE__ */ new Date(), this.updatedAt = /* @__PURE__ */ new Date(), this.logicalClock = 0, this.valueSet = new yt(new oe(i), this);
4215
+ this.nodes = new Go(this), this.sections = new _o(this), this.ports = new Xo(this), this.connections = new Po(this), this.fields = new zo(this), this.objects = new si(this), this.decorators = new oi(this), this.canvas = t, this.id = e, this.name = a, this.description = l, this.type = r, this.createdAt = /* @__PURE__ */ new Date(), this.updatedAt = /* @__PURE__ */ new Date(), this.logicalClock = 0, this.valueSet = new kt(new oe(i), this);
4193
4216
  }
4194
4217
  /**
4195
4218
  * Deletes everything in this diagram.
@@ -4199,7 +4222,7 @@ class eo {
4199
4222
  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();
4200
4223
  }
4201
4224
  }
4202
- const vt = (s) => !!s.button, he = (s, t, e, a, l, r, i, n, o) => yo(
4225
+ const vt = (s) => !!s.button, he = (s, t, e, a, l, r, i, n, o) => mo(
4203
4226
  s,
4204
4227
  [t, ...r, e],
4205
4228
  a,
@@ -4212,7 +4235,7 @@ const vt = (s) => !!s.button, he = (s, t, e, a, l, r, i, n, o) => yo(
4212
4235
  ) * i
4213
4236
  ), S = (s) => {
4214
4237
  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) => {
4238
+ }, ct = (s) => s instanceof z ? s : s instanceof F ? s.node || s : s.rootElement instanceof z || s.rootElement instanceof F || s.rootElement instanceof wt ? ct(s.rootElement) : s, be = (s) => {
4216
4239
  if (s instanceof z)
4217
4240
  return s.type.resizableX !== !1;
4218
4241
  if (s instanceof F) {
@@ -4234,7 +4257,7 @@ const vt = (s) => !!s.button, he = (s, t, e, a, l, r, i, n, o) => yo(
4234
4257
  return !1;
4235
4258
  }, ge = (s) => {
4236
4259
  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");
4237
- }, zt = {
4260
+ }, Vt = {
4238
4261
  fillColor: "#FFFFFF",
4239
4262
  borderColor: "#000000",
4240
4263
  borderThickness: 1,
@@ -4243,7 +4266,7 @@ const vt = (s) => !!s.button, he = (s, t, e, a, l, r, i, n, o) => yo(
4243
4266
  s.filter(".shaped-look").select("path").attr(
4244
4267
  "d",
4245
4268
  (t) => ye(
4246
- t.look.shape || Mt.Rectangle,
4269
+ t.look.shape || Nt.Rectangle,
4247
4270
  0,
4248
4271
  0,
4249
4272
  t.width,
@@ -4251,18 +4274,18 @@ const vt = (s) => !!s.button, he = (s, t, e, a, l, r, i, n, o) => yo(
4251
4274
  )
4252
4275
  ).attr(
4253
4276
  "fill",
4254
- (t) => t.look.fillColor || zt.fillColor
4277
+ (t) => t.look.fillColor || Vt.fillColor
4255
4278
  ).attr(
4256
4279
  "stroke",
4257
- (t) => t.look.borderColor || zt.borderColor
4280
+ (t) => t.look.borderColor || Vt.borderColor
4258
4281
  ).attr(
4259
4282
  "stroke-width",
4260
- (t) => `${t.look.borderThickness || zt.borderThickness}px`
4283
+ (t) => `${t.look.borderThickness || Vt.borderThickness}px`
4261
4284
  ).attr(
4262
4285
  "stroke-dasharray",
4263
4286
  (t) => ve(
4264
- t.look.borderStyle || zt.borderStyle,
4265
- t.type?.defaultLook?.borderThickness || t.look?.borderThickness || zt.borderThickness
4287
+ t.look.borderStyle || Vt.borderStyle,
4288
+ t.type?.defaultLook?.borderThickness || t.look?.borderThickness || Vt.borderThickness
4266
4289
  )
4267
4290
  ), s.filter(".image-look").select("image").attr("x", 0).attr("y", 0).attr("width", (t) => t.width).attr("height", (t) => t.height).attr("href", (t) => t.look.backgroundImage), s.filter(".stretchable-image-look").select("image.top-left-image").attr("x", 0).attr("y", 0).attr("width", (t) => t.look.leftMargin).attr("height", (t) => t.look.topMargin).attr(
4268
4291
  "href",
@@ -4301,13 +4324,13 @@ const vt = (s) => !!s.button, he = (s, t, e, a, l, r, i, n, o) => yo(
4301
4324
  "href",
4302
4325
  (t) => t.look.backgroundImageBottomRight
4303
4326
  );
4304
- }, Rt = {
4327
+ }, Ot = {
4305
4328
  style: "dots",
4306
4329
  color: "rgba(0, 0, 0, 0.1)",
4307
4330
  snap: !1,
4308
4331
  spacing: 10,
4309
4332
  thickness: 0.05
4310
- }, ri = (s, t, e) => {
4333
+ }, ni = (s, t, e) => {
4311
4334
  const a = t.append("defs");
4312
4335
  if (s.gridSize > 0 && isFinite(s.gridSize)) {
4313
4336
  const l = a.append("pattern").attr("id", e).attr("x", -s.gridSize / 2).attr("y", -s.gridSize / 2).attr("width", s.gridSize).attr("height", s.gridSize).attr("patternUnits", "userSpaceOnUse");
@@ -4327,10 +4350,10 @@ const vt = (s) => !!s.button, he = (s, t, e, a, l, r, i, n, o) => yo(
4327
4350
  }
4328
4351
  t.select("rect").attr("fill", `url(#${e})`);
4329
4352
  }
4330
- }, we = 96, W = 32, xt = we + W, ai = Math.PI / 4, li = 100, Ve = {
4353
+ }, we = 96, W = 32, Et = we + W, ri = Math.PI / 4, ai = 100, Ve = {
4331
4354
  customButtons: []
4332
4355
  };
4333
- class di {
4356
+ class li {
4334
4357
  /**
4335
4358
  * Constructs a context menu object.
4336
4359
  * @public
@@ -4346,7 +4369,7 @@ class di {
4346
4369
  */
4347
4370
  open(t) {
4348
4371
  this.close();
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] - 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) => {
4372
+ 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] - Et}px`).attr("y", `${e[1] - Et}px`).attr("width", `${2 * Et}px`).attr("height", `${2 * Et}px`).style("pointer-events", "none").on($.ContextMenu, (i) => {
4350
4373
  this.canvas.canUserPerformAction(k.ContextMenu) && (t.preventDefault(), this.open(i));
4351
4374
  }).on($.Click, (i) => {
4352
4375
  i.preventDefault(), this.close();
@@ -4388,22 +4411,22 @@ class di {
4388
4411
  onPress: void 0
4389
4412
  });
4390
4413
  for (let i = 0; i < r.length; ++i) {
4391
- const n = r[i], o = n.onPress, d = (i + 0.5 - r.length / 2) * ai, c = l.append("xhtml:div").attr(
4414
+ const n = r[i], o = n.onPress, d = (i + 0.5 - r.length / 2) * ri, c = l.append("xhtml:div").attr(
4392
4415
  "class",
4393
4416
  `daga-context-menu-button ${n.onPress !== void 0 ? " daga-clickable" : ""}`
4394
4417
  ).attr("tabindex", 0).style("position", "absolute").style("box-sizing", "border-box").style("width", `${2 * W}px`).style("height", `${2 * W}px`).style("border-radius", `${W}px`).style("pointer-events", "auto").on($.Click, (h) => {
4395
4418
  o && (h.preventDefault(), o(this.canvas));
4396
4419
  }).on($.KeyDown, (h) => {
4397
- o && h.key === K.Enter && (h.preventDefault(), o(this.canvas));
4420
+ o && h.key === Z.Enter && (h.preventDefault(), o(this.canvas));
4398
4421
  });
4399
- n.imageClass !== void 0 ? c.append("xhtml:div").style("position", "absolute").style("left", `${0.75 * W}px`).style("top", `${0.5 * W}px`).style("width", `${0.5 * W}px`).style("height", `${0.5 * W}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 * W}px`).style("top", `${0.5 * W}px`).style("width", `${0.5 * W}px`).style("height", `${0.5 * W}px`).attr("src", n.image), c.append("xhtml:span").style("position", "absolute").style("left", `${0.2 * W}px`).style("top", `${1.1 * W}px`).style("text-align", "center").style("width", `${1.6 * W}px`).style("height", `${0.35 * W}px`).style("margin", "0").style("font-size", `${0.35 * W}px`).style("font-weight", "700").style("user-select", "none").text(n.name), c.transition().ease(L.easeLinear).duration(li).tween("progress", () => (h) => {
4422
+ n.imageClass !== void 0 ? c.append("xhtml:div").style("position", "absolute").style("left", `${0.75 * W}px`).style("top", `${0.5 * W}px`).style("width", `${0.5 * W}px`).style("height", `${0.5 * W}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 * W}px`).style("top", `${0.5 * W}px`).style("width", `${0.5 * W}px`).style("height", `${0.5 * W}px`).attr("src", n.image), c.append("xhtml:span").style("position", "absolute").style("left", `${0.2 * W}px`).style("top", `${1.1 * W}px`).style("text-align", "center").style("width", `${1.6 * W}px`).style("height", `${0.35 * W}px`).style("margin", "0").style("font-size", `${0.35 * W}px`).style("font-weight", "700").style("user-select", "none").text(n.name), c.transition().ease(L.easeLinear).duration(ai).tween("progress", () => (h) => {
4400
4423
  const f = d * h;
4401
4424
  return c.style(
4402
4425
  "left",
4403
- `${Math.sin(f) * we - W + xt}px`
4426
+ `${Math.sin(f) * we - W + Et}px`
4404
4427
  ).style(
4405
4428
  "top",
4406
- `${-Math.cos(f) * we - W + xt}px`
4429
+ `${-Math.cos(f) * we - W + Et}px`
4407
4430
  );
4408
4431
  });
4409
4432
  }
@@ -4416,7 +4439,7 @@ class di {
4416
4439
  this.contextMenuContainer?.remove(), this.contextMenuContainer = void 0;
4417
4440
  }
4418
4441
  }
4419
- class ci extends ft {
4442
+ class di extends ft {
4420
4443
  /**
4421
4444
  * Constructs a user highlight object.
4422
4445
  * @public
@@ -4438,7 +4461,7 @@ class ci extends ft {
4438
4461
  * @param element
4439
4462
  */
4440
4463
  focusOn(t) {
4441
- this.clear(), this.focus = t, (t instanceof ht || t instanceof to) && t.rootElement ? this.focusOn(t.rootElement) : this.add(t);
4464
+ this.clear(), this.focus = t, (t instanceof ht || t instanceof Je) && t.rootElement ? this.focusOn(t.rootElement) : this.add(t);
4442
4465
  }
4443
4466
  add(t) {
4444
4467
  if (super.add(t), t instanceof z) {
@@ -4460,7 +4483,7 @@ class ci extends ft {
4460
4483
  super.add(e), this.canvas.updatePortsInView(e.id);
4461
4484
  t.label && (super.add(t.label), this.canvas.updateFieldsInView(t.label.id)), this.canvas.updateSectionsInView(t.id);
4462
4485
  }
4463
- else t instanceof bt ? (t.label && (super.add(t.label), this.canvas.updateFieldsInView(t.label.id)), this.canvas.updatePortsInView(t.id)) : t instanceof dt && this.canvas.updateConnectionsInView(t.id);
4486
+ else t instanceof wt ? (t.label && (super.add(t.label), this.canvas.updateFieldsInView(t.label.id)), this.canvas.updatePortsInView(t.id)) : t instanceof dt && this.canvas.updateConnectionsInView(t.id);
4464
4487
  }
4465
4488
  clear() {
4466
4489
  for (; this.entities.length > 0; ) {
@@ -4470,13 +4493,13 @@ class ci extends ft {
4470
4493
  this.focus = void 0;
4471
4494
  }
4472
4495
  }
4473
- const hi = 1;
4474
- class oo {
4496
+ const ci = 1;
4497
+ class to {
4475
4498
  export(t, e = !1) {
4476
4499
  const a = {
4477
4500
  name: t.name,
4478
4501
  type: t.type,
4479
- typeVersion: hi,
4502
+ typeVersion: ci,
4480
4503
  createdAt: t.createdAt,
4481
4504
  updatedAt: t.updatedAt,
4482
4505
  nodes: [],
@@ -4509,8 +4532,8 @@ class oo {
4509
4532
  n.push({
4510
4533
  id: o.id,
4511
4534
  type: o.type?.id,
4512
- coords: It(o.coords),
4513
- connectionPoint: It(o.connectionPoint || o.coords),
4535
+ coords: Lt(o.coords),
4536
+ connectionPoint: Lt(o.connectionPoint || o.coords),
4514
4537
  direction: o.direction,
4515
4538
  label: o.label?.text || "",
4516
4539
  ...e ? {
@@ -4528,7 +4551,7 @@ class oo {
4528
4551
  label: i.label?.text || "",
4529
4552
  indexXInNode: i.indexXInNode,
4530
4553
  indexYInNode: i.indexYInNode,
4531
- coords: It(i.coords),
4554
+ coords: Lt(i.coords),
4532
4555
  width: i.width,
4533
4556
  height: i.height,
4534
4557
  ...e ? {
@@ -4546,8 +4569,8 @@ class oo {
4546
4569
  r.push({
4547
4570
  id: i.id,
4548
4571
  type: i.type?.id,
4549
- coords: It(i.coords),
4550
- connectionPoint: It(i.connectionPoint || i.coords),
4572
+ coords: Lt(i.coords),
4573
+ connectionPoint: Lt(i.connectionPoint || i.coords),
4551
4574
  direction: i.direction,
4552
4575
  label: i.label?.text || "",
4553
4576
  ...e ? {
@@ -4566,7 +4589,7 @@ class oo {
4566
4589
  sections: l,
4567
4590
  ports: r,
4568
4591
  label: t.label?.text || "",
4569
- coords: It(t.coords),
4592
+ coords: Lt(t.coords),
4570
4593
  width: t.width,
4571
4594
  height: t.height,
4572
4595
  data: t.valueSet.getValues(),
@@ -4614,17 +4637,17 @@ class oo {
4614
4637
  } : {};
4615
4638
  }
4616
4639
  }
4617
- const gi = "Diagram properties";
4618
- class fi extends ft {
4640
+ const hi = "Diagram properties";
4641
+ class gi extends ft {
4619
4642
  /**
4620
4643
  * Constructs a user selection object.
4621
4644
  * @public
4622
4645
  * @param canvas A canvas.
4623
4646
  */
4624
4647
  constructor(t, e) {
4625
- super(), this.canvas = t, this.canvas.propertyEditorChanges$.pipe(go(2e3)).subscribe(() => {
4648
+ super(), this.canvas = t, this.canvas.propertyEditorChanges$.pipe(co(2e3)).subscribe(() => {
4626
4649
  this.makeUpdateValuesAction();
4627
- }), this.diagramPropertiesText = e !== void 0 ? e : gi;
4650
+ }), this.diagramPropertiesText = e !== void 0 ? e : hi;
4628
4651
  }
4629
4652
  add(t) {
4630
4653
  if (!this.contains(t.id) && (this.length === 0 ? this.propertyEditorSelection === void 0 && (t instanceof z || t instanceof dt) ? this.openInPropertyEditor(t) : this.propertyEditorSelection === void 0 && t instanceof F ? this.openInPropertyEditor(t.node) : this.openInPropertyEditor(void 0) : this.openInPropertyEditor(void 0), super.add(t), t.updateInView(), t instanceof z && t.sections))
@@ -4672,8 +4695,8 @@ class fi extends ft {
4672
4695
  if (this.length > 0) {
4673
4696
  const t = [], e = [], a = [], l = [], r = [];
4674
4697
  for (const n of this.all())
4675
- n instanceof z ? t.push(n.id) : n instanceof F ? e.push(n.id) : n instanceof bt ? a.push(n.id) : n instanceof dt ? l.push(n.id) : n instanceof ht && r.push(n.id);
4676
- const i = new ti(
4698
+ n instanceof z ? t.push(n.id) : n instanceof F ? e.push(n.id) : n instanceof wt ? a.push(n.id) : n instanceof dt ? l.push(n.id) : n instanceof ht && r.push(n.id);
4699
+ const i = new Jo(
4677
4700
  this.canvas,
4678
4701
  t,
4679
4702
  e,
@@ -4689,7 +4712,7 @@ class fi extends ft {
4689
4712
  * @public
4690
4713
  */
4691
4714
  copyToClipboard() {
4692
- const t = { type: "daga-user-selection", nodes: [], connections: [] }, e = new oo();
4715
+ const t = { type: "daga-user-selection", nodes: [], connections: [] }, e = new to();
4693
4716
  for (const a of this.all())
4694
4717
  a instanceof z && t.nodes.push(e.exportNode(a, !1)), a instanceof dt && t.connections.push(
4695
4718
  e.exportConnection(a, !1)
@@ -4713,7 +4736,7 @@ class fi extends ft {
4713
4736
  const a = JSON.parse(e);
4714
4737
  if (a.type !== "daga-user-selection")
4715
4738
  return;
4716
- const l = new ei(
4739
+ const l = new Qo(
4717
4740
  this.canvas,
4718
4741
  a.nodes,
4719
4742
  a.connections,
@@ -4739,22 +4762,22 @@ class fi extends ft {
4739
4762
  if (a === void 0)
4740
4763
  return;
4741
4764
  const l = t?.valueSet;
4742
- l ? (this.propertyEditorSelection = t, e && (this.propertyEditorValues = Ct(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));
4765
+ l ? (this.propertyEditorSelection = t, e && (this.propertyEditorValues = At(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));
4743
4766
  }
4744
4767
  makeUpdateValuesAction() {
4745
4768
  if (this.propertyEditorSelection === void 0 || this.propertyEditorValues === void 0)
4746
4769
  return;
4747
- const t = this.propertyEditorSelection instanceof eo ? void 0 : this.propertyEditorSelection.id;
4748
- if (wt(
4770
+ const t = this.propertyEditorSelection instanceof Qe ? void 0 : this.propertyEditorSelection.id;
4771
+ if (Ct(
4749
4772
  this.propertyEditorValues,
4750
4773
  this.propertyEditorSelection?.valueSet.getValues()
4751
4774
  ))
4752
4775
  return;
4753
- const e = this.propertyEditorValues, a = Ct(this.propertyEditorSelection?.valueSet.getValues()), [l, r] = Be(
4776
+ const e = this.propertyEditorValues, a = At(this.propertyEditorSelection?.valueSet.getValues()), [l, r] = De(
4754
4777
  e,
4755
4778
  a,
4756
4779
  this.propertyEditorSelection?.valueSet
4757
- ), i = new Qo(
4780
+ ), i = new qo(
4758
4781
  this.canvas,
4759
4782
  t,
4760
4783
  l,
@@ -4763,10 +4786,7 @@ class fi extends ft {
4763
4786
  i.do(), this.canvas.actionStack.add(i), this.propertyEditorValues = a;
4764
4787
  }
4765
4788
  }
4766
- const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
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);
4768
- return [i, n];
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 {
4789
+ const fi = 12, H = 6, ui = 25, ue = "diagram-connection-unfinished", te = class te {
4770
4790
  /**
4771
4791
  * Constructs a canvas object.
4772
4792
  * @public
@@ -4774,24 +4794,24 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4774
4794
  * @param config The configuration object used to set the parameters of this canvas.
4775
4795
  */
4776
4796
  constructor(t, e) {
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 jt(), this.diagramChange$ = new jt(), this.diagramEvent$ = new jt(), this.propertyEditorChanges$ = new jt(), this.parentComponent = t, this.model = new eo(
4797
+ 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 Zt(), this.diagramChange$ = new Zt(), this.diagramEvent$ = new Zt(), this.propertyEditorChanges$ = new Zt(), this.parentComponent = t, this.model = new Qe(
4778
4798
  this,
4779
4799
  void 0,
4780
4800
  e.name || "unnamed",
4781
4801
  "",
4782
4802
  e.type || "",
4783
4803
  e.properties || []
4784
- ), this.userSelection = new fi(
4804
+ ), this.userSelection = new gi(
4785
4805
  this,
4786
4806
  e.components?.propertyEditor?.title
4787
- ), this.userHighlight = new ci(
4807
+ ), this.userHighlight = new di(
4788
4808
  this,
4789
4809
  e.canvas?.highlightSections !== !1
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(
4791
- e.canvas?.grid?.thickness || Rt.thickness
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)
4810
+ ), this.contextMenu = new li(this, e.canvas?.contextMenu), this.backgroundColor = e.canvas?.backgroundColor || "#FFFFFF", this.gridStyle = e.canvas?.grid?.style ?? Ot.style, this.gridSize = e.canvas?.grid?.enabled === !1 || e.canvas?.grid === void 0 ? 0 : Math.abs(e.canvas?.grid?.spacing || Ot.spacing), this.gridThickness = Math.abs(
4811
+ e.canvas?.grid?.thickness || Ot.thickness
4812
+ ), this.gridColor = e.canvas?.grid?.color || Ot.color, this.snapToGrid = e.canvas?.grid?.enabled === !1 || e.canvas?.grid === void 0 ? !1 : e.canvas?.grid?.snap || Ot.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 jo(this, ui), this.collabEngine = new Wo(this), e.nodeTypes)
4793
4813
  for (const a of e.nodeTypes) {
4794
- const l = new je({
4814
+ const l = new Xe({
4795
4815
  ...e.nodeTypeDefaults,
4796
4816
  ...a
4797
4817
  });
@@ -4799,7 +4819,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4799
4819
  }
4800
4820
  if (e.portTypes)
4801
4821
  for (const a of e.portTypes) {
4802
- const l = new Wo({
4822
+ const l = new Bo({
4803
4823
  ...e.portTypeDefaults,
4804
4824
  ...a
4805
4825
  });
@@ -4807,7 +4827,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4807
4827
  }
4808
4828
  if (e.connectionTypes) {
4809
4829
  for (const a of e.connectionTypes) {
4810
- const l = new Xe({
4830
+ const l = new Ye({
4811
4831
  ...e.connectionTypeDefaults,
4812
4832
  ...a
4813
4833
  });
@@ -4858,7 +4878,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4858
4878
  const r = new pt(l, null);
4859
4879
  this.diagramEvent$.next(r);
4860
4880
  }).on($.KeyDown, (l) => {
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") {
4881
+ if (!l.ctrlKey && (l.key === Z.Delete || l.key === Z.Backspace) && this.canUserPerformAction(k.Remove) && (this.userSelection.removeFromModel(), this.cancelAllUserActions()), l.ctrlKey && l.key === "a") {
4862
4882
  l.preventDefault();
4863
4883
  for (const r of this.model.nodes)
4864
4884
  this.userSelection.add(r);
@@ -4891,7 +4911,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4891
4911
  ])
4892
4912
  ), this.cancelAllUserActions();
4893
4913
  }
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));
4914
+ 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 === Z.ArrowLeft && this.canUserPerformAction(k.Zoom) && (l.preventDefault(), this.translateBy(this.panRate / this.zoomTransform.k, 0)), l.key === Z.ArrowRight && this.canUserPerformAction(k.Zoom) && (l.preventDefault(), this.translateBy(-this.panRate / this.zoomTransform.k, 0)), l.key === Z.ArrowDown && this.canUserPerformAction(k.Zoom) && (l.preventDefault(), this.translateBy(0, -this.panRate / this.zoomTransform.k)), l.key === Z.ArrowUp && this.canUserPerformAction(k.Zoom) && (l.preventDefault(), this.translateBy(0, this.panRate / this.zoomTransform.k));
4895
4915
  });
4896
4916
  const a = this.selectSVGElement().append("g").attr("class", "daga-canvas-view").attr("width", "100%").attr("height", "100%");
4897
4917
  a.call(
@@ -4908,8 +4928,8 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4908
4928
  this.selectCanvasElements().attr("transform", r), L.select(`#${this.backgroundPatternId}`).attr(
4909
4929
  "patternTransform",
4910
4930
  r
4911
- ), He && this.updateFieldsInView(), this.contextMenu.close(), this.diagramEvent$.next(
4912
- new oi(
4931
+ ), this.contextMenu.close(), this.diagramEvent$.next(
4932
+ new ti(
4913
4933
  [this.zoomTransform.x, this.zoomTransform.y],
4914
4934
  this.zoomTransform.k
4915
4935
  )
@@ -4933,14 +4953,14 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4933
4953
  }
4934
4954
  this.userSelection.openInPropertyEditor(this.model);
4935
4955
  }).call(
4936
- L.drag().filter((l) => this.multipleSelectionOn || vt(l)).on(A.Start, (l) => {
4956
+ L.drag().filter((l) => this.multipleSelectionOn || vt(l)).on(I.Start, (l) => {
4937
4957
  this.startMultipleSelection(l);
4938
- }).on(A.Drag, (l) => {
4958
+ }).on(I.Drag, (l) => {
4939
4959
  this.continueMultipleSelection(l);
4940
- }).on(A.End, (l) => {
4960
+ }).on(I.End, (l) => {
4941
4961
  this.finishMultipleSelection(l);
4942
4962
  })
4943
- ), ri(this, a, this.backgroundPatternId), a.append("g").attr("class", "daga-canvas-elements");
4963
+ ), ni(this, a, this.backgroundPatternId), a.append("g").attr("class", "daga-canvas-elements");
4944
4964
  }
4945
4965
  getZoomLevel() {
4946
4966
  return this.zoomTransform.k;
@@ -4976,8 +4996,8 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4976
4996
  return (f) => {
4977
4997
  try {
4978
4998
  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(
4999
+ const b = f * (o - r) + r, m = f * (d - i) + i, v = f * (c - n) + n;
5000
+ this.zoomBehavior.scaleTo(this.selectCanvasView(), v), this.zoomBehavior.translateTo(
4981
5001
  this.selectCanvasView(),
4982
5002
  b,
4983
5003
  m
@@ -4991,13 +5011,13 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
4991
5011
  }
4992
5012
  center(t, e, a) {
4993
5013
  if (this.model.nodes.length > 0) {
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)
4998
- ), b = (h + f) / 2, m = f - h, p = l.height, u = Math.min(
5014
+ const l = this.selectCanvasView().select("rect").node()?.getBBox(), r = t?.map((p) => this.model.nodes.get(p)).filter((p) => !!p) || this.model.nodes.all(), i = Math.min(...r.map((p) => p.coords[0])), n = Math.max(
5015
+ ...r.map((p) => p.coords[0] + p.width)
5016
+ ), o = (i + n) / 2, d = n - i, c = l.width, h = Math.min(...r.map((p) => p.coords[1])), f = Math.max(
5017
+ ...r.map((p) => p.coords[1] + p.height)
5018
+ ), b = (h + f) / 2, m = f - h, v = l.height, u = Math.min(
4999
5019
  c / d,
5000
- p / m,
5020
+ v / m,
5001
5021
  e !== void 0 ? e : 1
5002
5022
  );
5003
5023
  this.zoomAndPanTo(o, b, u, a);
@@ -5100,21 +5120,21 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5100
5120
  const o = new pt(i, n);
5101
5121
  this.diagramEvent$.next(o);
5102
5122
  }).call(
5103
- L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
5123
+ L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(I.Start, (i, n) => {
5104
5124
  this.multipleSelectionOn || this.secondaryButton ? this.startMultipleSelection(i) : this.startMovingNode(i, n);
5105
- }).on(A.Drag, (i, n) => {
5125
+ }).on(I.Drag, (i, n) => {
5106
5126
  this.multipleSelectionOn || this.secondaryButton ? this.continueMultipleSelection(i) : this.continueMovingNode(i, n);
5107
- }).on(A.End, (i, n) => {
5127
+ }).on(I.End, (i, n) => {
5108
5128
  this.multipleSelectionOn || this.secondaryButton ? this.finishMultipleSelection(i) : this.finishMovingNode(i, n), this.secondaryButton = !1;
5109
5129
  })
5110
5130
  ), ge(
5111
5131
  l
5112
- ), l.filter(".resizable-x").append("line").attr("class", "left-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
5132
+ ), l.filter(".resizable-x").append("line").attr("class", "left-resizer").attr("stroke", "transparent").attr("stroke-width", H).on($.MouseOver, (i, n) => {
5113
5133
  this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed && S(E.EWResize);
5114
5134
  }).on($.MouseOut, (i, n) => {
5115
5135
  this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed && S();
5116
5136
  }).call(
5117
- L.drag().on(A.Start, (i, n) => {
5137
+ L.drag().on(I.Start, (i, n) => {
5118
5138
  this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed ? (S(E.EWResize), this.currentAction = new X(
5119
5139
  this,
5120
5140
  k.StretchNode,
@@ -5122,12 +5142,12 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5122
5142
  n.getGeometry(),
5123
5143
  n.getGeometry()
5124
5144
  )) : S(E.NotAllowed);
5125
- }).on(A.Drag, (i, n) => {
5145
+ }).on(I.Drag, (i, n) => {
5126
5146
  if (this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed) {
5127
5147
  const o = this.getPointerLocationRelativeToCanvas(i);
5128
5148
  n.stretch(g.Left, n.coords[0] - o[0]);
5129
5149
  }
5130
- }).on(A.End, (i, n) => {
5150
+ }).on(I.End, (i, n) => {
5131
5151
  if (this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === k.StretchNode) {
5132
5152
  let o = this.getPointerLocationRelativeToCanvas(i);
5133
5153
  this.snapToGrid && (o = this.getClosestGridPoint([
@@ -5137,12 +5157,12 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5137
5157
  }
5138
5158
  S();
5139
5159
  })
5140
- ), l.filter(".resizable-y").append("line").attr("class", "top-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
5160
+ ), l.filter(".resizable-y").append("line").attr("class", "top-resizer").attr("stroke", "transparent").attr("stroke-width", H).on($.MouseOver, (i, n) => {
5141
5161
  this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed && S(E.NSResize);
5142
5162
  }).on($.MouseOut, (i, n) => {
5143
5163
  this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed && S();
5144
5164
  }).call(
5145
- L.drag().on(A.Start, (i, n) => {
5165
+ L.drag().on(I.Start, (i, n) => {
5146
5166
  this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed ? (S(E.NSResize), this.currentAction = new X(
5147
5167
  this,
5148
5168
  k.StretchNode,
@@ -5150,12 +5170,12 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5150
5170
  n.getGeometry(),
5151
5171
  n.getGeometry()
5152
5172
  )) : S(E.NotAllowed);
5153
- }).on(A.Drag, (i, n) => {
5173
+ }).on(I.Drag, (i, n) => {
5154
5174
  if (this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed) {
5155
5175
  const o = this.getPointerLocationRelativeToCanvas(i);
5156
5176
  n.stretch(g.Top, n.coords[1] - o[1]);
5157
5177
  }
5158
- }).on(A.End, (i, n) => {
5178
+ }).on(I.End, (i, n) => {
5159
5179
  if (this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === k.StretchNode) {
5160
5180
  let o = this.getPointerLocationRelativeToCanvas(i);
5161
5181
  this.snapToGrid && (o = this.getClosestGridPoint([
@@ -5165,12 +5185,12 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5165
5185
  }
5166
5186
  S();
5167
5187
  })
5168
- ), l.filter(".resizable-x").append("line").attr("class", "right-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
5188
+ ), l.filter(".resizable-x").append("line").attr("class", "right-resizer").attr("stroke", "transparent").attr("stroke-width", H).on($.MouseOver, (i, n) => {
5169
5189
  this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed && S(E.EWResize);
5170
5190
  }).on($.MouseOut, (i, n) => {
5171
5191
  this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed && S();
5172
5192
  }).call(
5173
- L.drag().on(A.Start, (i, n) => {
5193
+ L.drag().on(I.Start, (i, n) => {
5174
5194
  this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed ? (S(E.EWResize), this.currentAction = new X(
5175
5195
  this,
5176
5196
  k.StretchNode,
@@ -5178,12 +5198,12 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5178
5198
  n.getGeometry(),
5179
5199
  n.getGeometry()
5180
5200
  )) : S(E.NotAllowed);
5181
- }).on(A.Drag, (i, n) => {
5201
+ }).on(I.Drag, (i, n) => {
5182
5202
  if (this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed) {
5183
5203
  const o = this.getPointerLocationRelativeToCanvas(i);
5184
5204
  n.stretch(g.Right, o[0] - (n.coords[0] + n.width));
5185
5205
  }
5186
- }).on(A.End, (i, n) => {
5206
+ }).on(I.End, (i, n) => {
5187
5207
  if (this.canUserPerformAction(k.StretchNode) && n.getResizableX() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === k.StretchNode) {
5188
5208
  let o = this.getPointerLocationRelativeToCanvas(i);
5189
5209
  this.snapToGrid && (o = this.getClosestGridPoint([
@@ -5193,12 +5213,12 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5193
5213
  }
5194
5214
  S();
5195
5215
  })
5196
- ), l.filter(".resizable-y").append("line").attr("class", "bottom-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
5216
+ ), l.filter(".resizable-y").append("line").attr("class", "bottom-resizer").attr("stroke", "transparent").attr("stroke-width", H).on($.MouseOver, (i, n) => {
5197
5217
  this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed && S(E.NSResize);
5198
5218
  }).on($.MouseOut, (i, n) => {
5199
5219
  this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed && S();
5200
5220
  }).call(
5201
- L.drag().on(A.Start, (i, n) => {
5221
+ L.drag().on(I.Start, (i, n) => {
5202
5222
  this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed ? (S(E.NSResize), this.currentAction = new X(
5203
5223
  this,
5204
5224
  k.StretchNode,
@@ -5206,7 +5226,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5206
5226
  n.getGeometry(),
5207
5227
  n.getGeometry()
5208
5228
  )) : S(E.NotAllowed);
5209
- }).on(A.Drag, (i, n) => {
5229
+ }).on(I.Drag, (i, n) => {
5210
5230
  if (this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed) {
5211
5231
  const o = this.getPointerLocationRelativeToCanvas(i);
5212
5232
  n.stretch(
@@ -5214,7 +5234,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5214
5234
  o[1] - (n.coords[1] + n.height)
5215
5235
  );
5216
5236
  }
5217
- }).on(A.End, (i, n) => {
5237
+ }).on(I.End, (i, n) => {
5218
5238
  if (this.canUserPerformAction(k.StretchNode) && n.getResizableY() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === k.StretchNode) {
5219
5239
  let o = this.getPointerLocationRelativeToCanvas(i);
5220
5240
  this.snapToGrid && this.snapToGrid && (o = this.getClosestGridPoint([
@@ -5277,21 +5297,21 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5277
5297
  const o = new pt(i, n);
5278
5298
  this.diagramEvent$.next(o);
5279
5299
  }).call(
5280
- L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
5300
+ L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(I.Start, (i, n) => {
5281
5301
  if (this.multipleSelectionOn || this.secondaryButton)
5282
5302
  this.startMultipleSelection(i);
5283
5303
  else {
5284
5304
  const o = n?.node;
5285
5305
  o ? this.startMovingNode(i, o) : S(E.NotAllowed);
5286
5306
  }
5287
- }).on(A.Drag, (i, n) => {
5307
+ }).on(I.Drag, (i, n) => {
5288
5308
  if (this.multipleSelectionOn || this.secondaryButton)
5289
5309
  this.continueMultipleSelection(i);
5290
5310
  else {
5291
5311
  const o = n?.node;
5292
5312
  o ? this.continueMovingNode(i, o) : S(E.NotAllowed);
5293
5313
  }
5294
- }).on(A.End, (i, n) => {
5314
+ }).on(I.End, (i, n) => {
5295
5315
  if (this.multipleSelectionOn || this.secondaryButton)
5296
5316
  this.finishMultipleSelection(i);
5297
5317
  else {
@@ -5302,12 +5322,12 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5302
5322
  })
5303
5323
  ), ge(
5304
5324
  l
5305
- ), l.filter(".resizable-x").append("line").attr("class", "left-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
5325
+ ), l.filter(".resizable-x").append("line").attr("class", "left-resizer").attr("stroke", "transparent").attr("stroke-width", H).on($.MouseOver, (i, n) => {
5306
5326
  this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && S(E.EWResize);
5307
5327
  }).on($.MouseOut, (i, n) => {
5308
5328
  this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && S();
5309
5329
  }).call(
5310
- L.drag().on(A.Start, (i, n) => {
5330
+ L.drag().on(I.Start, (i, n) => {
5311
5331
  this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && n.node ? (S(E.EWResize), this.currentAction = new X(
5312
5332
  this,
5313
5333
  k.StretchSection,
@@ -5315,7 +5335,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5315
5335
  n.node.getGeometry(),
5316
5336
  n.node.getGeometry()
5317
5337
  )) : S(E.NotAllowed);
5318
- }).on(A.Drag, (i, n) => {
5338
+ }).on(I.Drag, (i, n) => {
5319
5339
  if (this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && n.node) {
5320
5340
  const o = this.getPointerLocationRelativeToCanvas(i);
5321
5341
  n.node.stretchSections(
@@ -5325,7 +5345,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5325
5345
  n.indexYInNode
5326
5346
  );
5327
5347
  }
5328
- }).on(A.End, (i, n) => {
5348
+ }).on(I.End, (i, n) => {
5329
5349
  if (this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === k.StretchSection && n.node) {
5330
5350
  let o = this.getPointerLocationRelativeToCanvas(i);
5331
5351
  this.snapToGrid && (o = this.getClosestGridPoint(o)), n.node.stretchSections(
@@ -5337,12 +5357,12 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5337
5357
  }
5338
5358
  S();
5339
5359
  })
5340
- ), l.filter(".resizable-y").append("line").attr("class", "top-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
5360
+ ), l.filter(".resizable-y").append("line").attr("class", "top-resizer").attr("stroke", "transparent").attr("stroke-width", H).on($.MouseOver, (i, n) => {
5341
5361
  this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && S(E.NSResize);
5342
5362
  }).on($.MouseOut, (i, n) => {
5343
5363
  this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && S();
5344
5364
  }).call(
5345
- L.drag().on(A.Start, (i, n) => {
5365
+ L.drag().on(I.Start, (i, n) => {
5346
5366
  this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && n.node ? (S(E.NSResize), this.currentAction = new X(
5347
5367
  this,
5348
5368
  k.StretchSection,
@@ -5350,7 +5370,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5350
5370
  n.node.getGeometry(),
5351
5371
  n.node.getGeometry()
5352
5372
  )) : S(E.NotAllowed);
5353
- }).on(A.Drag, (i, n) => {
5373
+ }).on(I.Drag, (i, n) => {
5354
5374
  if (this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && n.node) {
5355
5375
  const o = this.getPointerLocationRelativeToCanvas(i);
5356
5376
  n.node.stretchSections(
@@ -5360,7 +5380,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5360
5380
  n.indexYInNode
5361
5381
  );
5362
5382
  }
5363
- }).on(A.End, (i, n) => {
5383
+ }).on(I.End, (i, n) => {
5364
5384
  if (this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === k.StretchSection && n.node) {
5365
5385
  let o = this.getPointerLocationRelativeToCanvas(i);
5366
5386
  this.snapToGrid && (o = this.getClosestGridPoint(o)), n.node.stretchSections(
@@ -5372,12 +5392,12 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5372
5392
  }
5373
5393
  S();
5374
5394
  })
5375
- ), l.filter(".resizable-x").append("line").attr("class", "right-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
5395
+ ), l.filter(".resizable-x").append("line").attr("class", "right-resizer").attr("stroke", "transparent").attr("stroke-width", H).on($.MouseOver, (i, n) => {
5376
5396
  this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && S(E.EWResize);
5377
5397
  }).on($.MouseOut, (i, n) => {
5378
5398
  this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && S();
5379
5399
  }).call(
5380
- L.drag().on(A.Start, (i, n) => {
5400
+ L.drag().on(I.Start, (i, n) => {
5381
5401
  this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && n.node ? (S(E.EWResize), this.currentAction = new X(
5382
5402
  this,
5383
5403
  k.StretchSection,
@@ -5385,7 +5405,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5385
5405
  n.node.getGeometry(),
5386
5406
  n.node.getGeometry()
5387
5407
  )) : S(E.NotAllowed);
5388
- }).on(A.Drag, (i, n) => {
5408
+ }).on(I.Drag, (i, n) => {
5389
5409
  if (this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && n.node) {
5390
5410
  const o = this.getPointerLocationRelativeToCanvas(i);
5391
5411
  n.node.stretchSections(
@@ -5395,7 +5415,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5395
5415
  n.indexYInNode
5396
5416
  );
5397
5417
  }
5398
- }).on(A.End, (i, n) => {
5418
+ }).on(I.End, (i, n) => {
5399
5419
  if (this.canUserPerformAction(k.StretchSection) && n.getResizableX() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === k.StretchSection && n.node) {
5400
5420
  let o = this.getPointerLocationRelativeToCanvas(i);
5401
5421
  this.snapToGrid && (o = this.getClosestGridPoint(o)), n.node.stretchSections(
@@ -5407,12 +5427,12 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5407
5427
  }
5408
5428
  S();
5409
5429
  })
5410
- ), l.filter(".resizable-y").append("line").attr("class", "bottom-resizer").attr("stroke", "transparent").attr("stroke-width", `${H}px`).on($.MouseOver, (i, n) => {
5430
+ ), l.filter(".resizable-y").append("line").attr("class", "bottom-resizer").attr("stroke", "transparent").attr("stroke-width", H).on($.MouseOver, (i, n) => {
5411
5431
  this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && S(E.NSResize);
5412
5432
  }).on($.MouseOut, (i, n) => {
5413
5433
  this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && S();
5414
5434
  }).call(
5415
- L.drag().on(A.Start, (i, n) => {
5435
+ L.drag().on(I.Start, (i, n) => {
5416
5436
  this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && n.node ? (S(E.NSResize), this.currentAction = new X(
5417
5437
  this,
5418
5438
  k.StretchSection,
@@ -5420,7 +5440,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5420
5440
  n.node.getGeometry(),
5421
5441
  n.node.getGeometry()
5422
5442
  )) : S(E.NotAllowed);
5423
- }).on(A.Drag, (i, n) => {
5443
+ }).on(I.Drag, (i, n) => {
5424
5444
  if (this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && n.node) {
5425
5445
  const o = this.getPointerLocationRelativeToCanvas(i);
5426
5446
  n.node.stretchSections(
@@ -5430,7 +5450,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5430
5450
  n.indexYInNode
5431
5451
  );
5432
5452
  }
5433
- }).on(A.End, (i, n) => {
5453
+ }).on(I.End, (i, n) => {
5434
5454
  if (this.canUserPerformAction(k.StretchSection) && n.getResizableY() && !n.removed && this.currentAction instanceof X && this.currentAction.intent === k.StretchSection && n.node) {
5435
5455
  let o = this.getPointerLocationRelativeToCanvas(i);
5436
5456
  this.snapToGrid && (o = this.getClosestGridPoint(o)), n.node.stretchSections(
@@ -5503,9 +5523,9 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5503
5523
  const o = new pt(i, n);
5504
5524
  this.diagramEvent$.next(o);
5505
5525
  }).call(
5506
- L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
5526
+ L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(I.Start, (i, n) => {
5507
5527
  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);
5508
- }).on(A.Drag, (i, n) => {
5528
+ }).on(I.Drag, (i, n) => {
5509
5529
  if (this.multipleSelectionOn || this.secondaryButton)
5510
5530
  this.continueMultipleSelection(i);
5511
5531
  else if (this.canUserPerformAction(k.AddConnection) && !n.removed && this.unfinishedConnection !== void 0) {
@@ -5513,13 +5533,13 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5513
5533
  this.unfinishedConnectionTracer?.attr(
5514
5534
  "d",
5515
5535
  he(
5516
- this.unfinishedConnection.look.shape || ot.look.shape,
5536
+ this.unfinishedConnection.look.shape || et.look.shape,
5517
5537
  this.unfinishedConnection.startCoords,
5518
5538
  o,
5519
5539
  this.unfinishedConnection.startDirection,
5520
5540
  this.unfinishedConnection.endDirection,
5521
5541
  this.unfinishedConnection.points,
5522
- this.unfinishedConnection.type.defaultLook.thickness || ot.look.thickness,
5542
+ this.unfinishedConnection.type.defaultLook.thickness || et.look.thickness,
5523
5543
  this.unfinishedConnection.type.defaultStartMarkerLook?.width,
5524
5544
  this.unfinishedConnection.type.defaultEndMarkerLook?.width
5525
5545
  )
@@ -5548,16 +5568,16 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5548
5568
  f && h < this.portHighlightRadius ? this.userHighlight.focusOn(f) : this.userHighlight.clear();
5549
5569
  }
5550
5570
  }
5551
- }).on(A.End, (i, n) => {
5571
+ }).on(I.End, (i, n) => {
5552
5572
  if (this.multipleSelectionOn || this.secondaryButton)
5553
5573
  this.finishMultipleSelection(i);
5554
5574
  else {
5555
5575
  if (this.canUserPerformAction(k.AddConnection) && !n.removed) {
5556
5576
  this.unfinishedConnectionTracer?.remove();
5557
5577
  const o = this.userHighlight.getFocus();
5558
- if (o instanceof bt)
5578
+ if (o instanceof wt)
5559
5579
  this.finishConnection(o);
5560
- else if (o instanceof ht && o.rootElement instanceof bt)
5580
+ else if (o instanceof ht && o.rootElement instanceof wt)
5561
5581
  this.finishConnection(o.rootElement);
5562
5582
  else if (o instanceof z || o instanceof F || o instanceof ht) {
5563
5583
  let d;
@@ -5620,74 +5640,75 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5620
5640
  const d = new pt(n, o);
5621
5641
  this.diagramEvent$.next(d);
5622
5642
  }).call(
5623
- L.drag().filter((n) => (this.secondaryButton = vt(n), !0)).on(A.Start, (n) => {
5643
+ L.drag().filter((n) => (this.secondaryButton = vt(n), !0)).on(I.Start, (n) => {
5624
5644
  this.startMultipleSelection(n);
5625
- }).on(A.Drag, (n) => {
5645
+ }).on(I.Drag, (n) => {
5626
5646
  this.continueMultipleSelection(n);
5627
- }).on(A.End, (n) => {
5647
+ }).on(I.End, (n) => {
5628
5648
  this.finishMultipleSelection(n);
5629
5649
  })
5630
5650
  ), 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(
5631
5651
  "d",
5632
5652
  (n) => he(
5633
- n.look.shape || ot.look.shape,
5653
+ n.look.shape || et.look.shape,
5634
5654
  n.startCoords,
5635
5655
  n.endCoords,
5636
5656
  n.startDirection,
5637
5657
  n.endDirection,
5638
5658
  n.points,
5639
- n.type.defaultLook.thickness || ot.look.thickness,
5659
+ n.type.defaultLook.thickness || et.look.thickness,
5640
5660
  n.type.defaultStartMarkerLook?.width,
5641
5661
  n.type.defaultEndMarkerLook?.width
5642
5662
  )
5643
5663
  ).attr("marker-start", (n) => `url(#${n.id}-start-marker)`).attr("marker-end", (n) => `url(#${n.id}-end-marker)`).attr(
5644
5664
  "stroke",
5645
- (n) => n.look.color || ot.look.color
5646
- ).attr("stroke-width", (n) => `${n.look.thickness}px`).attr(
5665
+ (n) => n.look.color || et.look.color
5666
+ ).attr(
5667
+ "stroke-width",
5668
+ (n) => n.look.thickness || et.look.thickness
5669
+ ).attr(
5647
5670
  "stroke-dasharray",
5648
5671
  (n) => ve(
5649
- n.look.style || ot.look.style,
5650
- n.type.defaultLook.thickness || ot.look.thickness
5672
+ n.look.style || et.look.style,
5673
+ n.type.defaultLook.thickness || et.look.thickness
5651
5674
  )
5652
5675
  ).attr("fill", "none"), i.select("path.diagram-connection-path-box").attr(
5653
5676
  "d",
5654
5677
  (n) => he(
5655
- n.look.shape || ot.look.shape,
5678
+ n.look.shape || et.look.shape,
5656
5679
  n.startCoords,
5657
5680
  n.endCoords,
5658
5681
  n.startDirection,
5659
5682
  n.endDirection,
5660
5683
  n.points,
5661
- n.type.defaultLook.thickness || ot.look.thickness,
5684
+ n.type.defaultLook.thickness || et.look.thickness,
5662
5685
  n.type.defaultStartMarkerLook?.width,
5663
5686
  n.type.defaultEndMarkerLook?.width
5664
5687
  )
5665
5688
  ).attr("stroke", "transparent").attr("pointer-events", "stroke").attr(
5666
5689
  "stroke-width",
5667
- (n) => `${(n.look.thickness || ot.look.thickness) + mi}px`
5690
+ (n) => (n.look.thickness || et.look.thickness) + fi
5668
5691
  ).attr(
5669
5692
  "stroke-dasharray",
5670
5693
  (n) => ve(
5671
- n.look.style || ot.look.style,
5672
- n.type.defaultLook.thickness || ot.look.thickness
5694
+ n.look.style || et.look.style,
5695
+ n.type.defaultLook.thickness || et.look.thickness
5673
5696
  )
5674
5697
  ).attr("fill", "none"), i.data().forEach((n) => {
5675
5698
  this.updateConnectionLabelsInView(n), this.updateConnectionMarkersInView(n);
5676
5699
  });
5677
5700
  }
5678
5701
  updateFieldsInView(...t) {
5679
- let e = this.selectCanvasElements().selectAll(
5680
- "foreignObject.diagram-field"
5681
- ).data(
5702
+ let e = this.selectCanvasElements().selectAll("g.diagram-field").data(
5682
5703
  this.model.fields.filter(
5683
5704
  (i) => this.priorityThreshold !== void 0 ? i.getPriority() >= this.priorityThreshold : !0
5684
5705
  ),
5685
5706
  (i) => i.id
5686
5707
  );
5687
- const a = e.exit(), l = e.enter().append("foreignObject").attr("id", (i) => i.id).attr("class", "diagram-field");
5708
+ const a = e.exit(), l = e.enter().append("g").attr("id", (i) => i.id).attr("class", "diagram-field");
5688
5709
  t && t.length > 0 && (e = e.filter((i) => t.includes(i.id)));
5689
5710
  const r = l.merge(e);
5690
- if (a.remove(), l.style("box-sizing", "border-box").on($.MouseOver, (i, n) => {
5711
+ a.remove(), l.on($.MouseOver, (i, n) => {
5691
5712
  this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new tt(n)));
5692
5713
  }).on($.Click, (i, n) => {
5693
5714
  if (!i.ctrlKey && !i.shiftKey) {
@@ -5720,21 +5741,21 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5720
5741
  const o = new pt(i, n);
5721
5742
  this.diagramEvent$.next(o), !o.defaultPrevented && this.canUserPerformAction(k.EditField) && n.editable && !n.removed && (this.currentAction = new Re(this, n.id, n.text, ""), this.openTextInput(n.id));
5722
5743
  }).call(
5723
- L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
5744
+ L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(I.Start, (i, n) => {
5724
5745
  if (this.multipleSelectionOn || this.secondaryButton)
5725
5746
  this.startMultipleSelection(i);
5726
5747
  else {
5727
5748
  let o;
5728
5749
  n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof F && (o = n.rootElement.node), o ? this.startMovingNode(i, o) : S(E.NotAllowed);
5729
5750
  }
5730
- }).on(A.Drag, (i, n) => {
5751
+ }).on(I.Drag, (i, n) => {
5731
5752
  if (this.multipleSelectionOn || this.secondaryButton)
5732
5753
  this.continueMultipleSelection(i);
5733
5754
  else {
5734
5755
  let o;
5735
5756
  n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof F && (o = n.rootElement.node), o ? this.continueMovingNode(i, o) : S(E.NotAllowed);
5736
5757
  }
5737
- }).on(A.End, (i, n) => {
5758
+ }).on(I.End, (i, n) => {
5738
5759
  if (this.multipleSelectionOn || this.secondaryButton)
5739
5760
  this.finishMultipleSelection(i);
5740
5761
  else {
@@ -5743,39 +5764,30 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5743
5764
  }
5744
5765
  this.secondaryButton = !1;
5745
5766
  })
5746
- ).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
- "justify-content",
5748
- (i) => i.horizontalAlign === Lt.Center ? "center" : i.horizontalAlign === Lt.Right ? "flex-end" : "flex-start"
5749
- ).style(
5750
- "align-items",
5751
- (i) => i.verticalAlign === Jt.Center ? "center" : i.verticalAlign === Jt.Bottom ? "end" : "start"
5752
- ).select("p").style(
5753
- "max-width",
5754
- (i) => i.fit ? "default" : `${Oe(i.width, i.height, i.orientation)[0]}px`
5755
- ).style(
5756
- "max-height",
5757
- (i) => i.fit ? "default" : `${Oe(i.width, i.height, i.orientation)[1]}px`
5758
- ).style("overflow", (i) => i.fit ? "default" : "clip").style("text-overflow", (i) => i.fit ? "default" : "ellipsis").style(
5759
- "text-align",
5760
- (i) => i.horizontalAlign === Lt.Center ? "center" : i.horizontalAlign === Lt.Right ? "end" : "start"
5761
- ).style("transform", (i) => `rotate(${i.orientation}deg)`).style("font-size", (i) => `${i.fontSize}px`).style(
5767
+ ), l.append("text"), l.append("rect"), r.attr("x", 0).attr("y", 0).attr("width", (i) => i.width).attr("height", (i) => i.height).attr(
5768
+ "transform",
5769
+ (i) => `translate(${i.coords[0]},${i.coords[1]}) rotate(${i.orientation} ${i.width / 2} ${i.height / 2})`
5770
+ ).attr("opacity", (i) => i.removed ? 0.5 : 1).select("text").attr(
5771
+ "x",
5772
+ (i) => i.horizontalAlign === yt.Center ? i.width / 2 : i.horizontalAlign === yt.Right ? i.width : 0
5773
+ ).attr(
5774
+ "text-anchor",
5775
+ (i) => i.horizontalAlign === yt.Center ? "middle" : i.horizontalAlign === yt.Right ? "end" : "start"
5776
+ ).attr(
5777
+ "y",
5778
+ (i) => i.verticalAlign === bt.Center ? i.height / 2 : i.verticalAlign === bt.Bottom ? i.height : 0
5779
+ ).attr(
5780
+ "dominant-baseline",
5781
+ (i) => i.verticalAlign === bt.Center ? "middle" : i.verticalAlign === bt.Bottom ? "auto" : "hanging"
5782
+ ).attr("font-size", (i) => i.fontSize).attr(
5762
5783
  "font-family",
5763
5784
  (i) => i.fontFamily || "'Wonder Unit Sans', sans-serif"
5764
- ).style("font-weight", (i) => i.highlighted ? 600 : 400).style(
5765
- "color",
5785
+ ).attr("font-weight", (i) => i.highlighted ? 600 : 400).attr(
5786
+ "fill",
5766
5787
  (i) => i.selected ? i.selectedColor || "#000000" : i.color || "#000000"
5767
- ).html(
5768
- (i) => i.text.replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/\n/g, "<br/>")
5769
- ), He) {
5770
- const i = this.zoomTransform.k;
5771
- r.attr("width", (n) => `${n.width * i}px`).attr("height", (n) => `${n.height * i}px`).select("div").style("position", "absolute").style(
5772
- "left",
5773
- (n) => `${n.coords[0] * i + this.zoomTransform.x}px`
5774
- ).style(
5775
- "top",
5776
- (n) => `${n.coords[1] * i + this.zoomTransform.y}px`
5777
- ).select("p").style("font-size", (n) => `${n.fontSize * i}px`);
5778
- }
5788
+ ).each((i) => {
5789
+ this.setFieldTextAndWrap(i);
5790
+ }), r.select("rect").attr("x", 0).attr("y", 0).attr("width", (i) => i.width).attr("height", (i) => i.height).attr("fill", "transparent");
5779
5791
  }
5780
5792
  updateObjectsInView(...t) {
5781
5793
  let e = this.selectCanvasElements().selectAll("g.diagram-object").data(
@@ -5785,7 +5797,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5785
5797
  (i) => i.id
5786
5798
  );
5787
5799
  const a = e.exit(), l = e.enter().append("g").attr("id", (i) => i.id).attr("class", "diagram-object");
5788
- 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($.ContextMenu, (i, n) => {
5800
+ t && t.length > 0 && (e = e.filter((i) => t.includes(i.id))), l.merge(e).attr("width", (i) => i.width).attr("height", (i) => i.height).attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).html((i) => i.html), a.remove(), l.on($.ContextMenu, (i, n) => {
5789
5801
  if (this.dragging) {
5790
5802
  i.preventDefault(), i.stopPropagation(), this.dragging = !1;
5791
5803
  return;
@@ -5796,11 +5808,11 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5796
5808
  const o = new pt(i, n);
5797
5809
  this.diagramEvent$.next(o);
5798
5810
  }).call(
5799
- L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i) => {
5811
+ L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(I.Start, (i) => {
5800
5812
  (this.multipleSelectionOn || this.secondaryButton) && this.startMultipleSelection(i);
5801
- }).on(A.Drag, (i) => {
5813
+ }).on(I.Drag, (i) => {
5802
5814
  (this.multipleSelectionOn || this.secondaryButton) && this.continueMultipleSelection(i);
5803
- }).on(A.End, (i) => {
5815
+ }).on(I.End, (i) => {
5804
5816
  (this.multipleSelectionOn || this.secondaryButton) && this.finishMultipleSelection(i);
5805
5817
  })
5806
5818
  );
@@ -5813,7 +5825,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5813
5825
  (i) => i.id
5814
5826
  );
5815
5827
  const a = e.exit(), l = e.enter().append("g").attr("id", (i) => i.id).attr("class", "diagram-decorator");
5816
- 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) => {
5828
+ t && t.length > 0 && (e = e.filter((i) => t.includes(i.id))), l.merge(e).attr("width", (i) => i.width).attr("height", (i) => i.height).attr("transform", (i) => `translate(${i.coords[0]},${i.coords[1]})`).html((i) => i.html), a.remove(), l.on($.MouseOver, (i, n) => {
5817
5829
  this.dragging || (this.userHighlight.focusOn(n), this.diagramEvent$.next(new tt(n)));
5818
5830
  }).on($.Click, (i, n) => {
5819
5831
  if (!i.ctrlKey && !i.shiftKey) {
@@ -5850,21 +5862,21 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5850
5862
  const o = new pt(i, n);
5851
5863
  this.diagramEvent$.next(o);
5852
5864
  }).call(
5853
- L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(A.Start, (i, n) => {
5865
+ L.drag().filter((i) => (this.secondaryButton = vt(i), !0)).on(I.Start, (i, n) => {
5854
5866
  if (this.multipleSelectionOn || this.secondaryButton)
5855
5867
  this.startMultipleSelection(i);
5856
5868
  else {
5857
5869
  let o;
5858
5870
  n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof F && (o = n.rootElement.node), o ? this.startMovingNode(i, o) : S(E.NotAllowed);
5859
5871
  }
5860
- }).on(A.Drag, (i, n) => {
5872
+ }).on(I.Drag, (i, n) => {
5861
5873
  if (this.multipleSelectionOn || this.secondaryButton)
5862
5874
  this.continueMultipleSelection(i);
5863
5875
  else {
5864
5876
  let o;
5865
5877
  n.rootElement instanceof z ? o = n.rootElement : n.rootElement instanceof F && (o = n.rootElement.node), o ? this.continueMovingNode(i, o) : S(E.NotAllowed);
5866
5878
  }
5867
- }).on(A.End, (i, n) => {
5879
+ }).on(I.End, (i, n) => {
5868
5880
  if (this.multipleSelectionOn || this.secondaryButton)
5869
5881
  this.finishMultipleSelection(i);
5870
5882
  else {
@@ -5886,7 +5898,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5886
5898
  const i = l.getTotalLength();
5887
5899
  let n = 0, o = 0, d = 0, c = 0, h = 0, f = 0;
5888
5900
  if (r.backgroundColor === "#00000000") {
5889
- const u = t.endCoords[0] - t.startCoords[0], v = t.endCoords[1] - t.startCoords[1];
5901
+ const u = t.endCoords[0] - t.startCoords[0], p = t.endCoords[1] - t.startCoords[1];
5890
5902
  switch (t.startDirection) {
5891
5903
  case g.Top:
5892
5904
  n = u >= 0 ? -0.5 : 0.5, h = n;
@@ -5895,10 +5907,10 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5895
5907
  n = u >= 0 ? -0.5 : 0.5, h = n;
5896
5908
  break;
5897
5909
  case g.Left:
5898
- o = v > 0 ? -0.5 : 0.5, f = o;
5910
+ o = p > 0 ? -0.5 : 0.5, f = o;
5899
5911
  break;
5900
5912
  case g.Right:
5901
- o = v > 0 ? -0.5 : 0.5, f = o;
5913
+ o = p > 0 ? -0.5 : 0.5, f = o;
5902
5914
  break;
5903
5915
  default:
5904
5916
  n = 0.5, h = n, o = -0.5, f = o;
@@ -5911,15 +5923,15 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5911
5923
  h = u >= 0 ? 0.5 : -0.5;
5912
5924
  break;
5913
5925
  case g.Left:
5914
- f = v > 0 ? 0.5 : -0.5;
5926
+ f = p > 0 ? 0.5 : -0.5;
5915
5927
  break;
5916
5928
  case g.Right:
5917
- f = v > 0 ? 0.5 : -0.5;
5929
+ f = p > 0 ? 0.5 : -0.5;
5918
5930
  break;
5919
5931
  default:
5920
5932
  h = 0.5, f = -0.5;
5921
5933
  }
5922
- 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);
5934
+ Math.abs(u) >= Math.abs(p) ? (d = u > 0 ? -0.5 : 0.5, c = p > 0 ? 0.5 : -0.5) : (d = u > 0 ? 0.5 : -0.5, c = p > 0 ? -0.5 : 0.5);
5923
5935
  }
5924
5936
  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
5937
  "fill",
@@ -5927,7 +5939,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5927
5939
  ).style("font-kerning", "none").text(t.startLabel);
5928
5940
  const b = e.select("g.diagram-connection-start-label text").node()?.getBoundingClientRect();
5929
5941
  if (b) {
5930
- 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;
5942
+ const u = t.startLabel ? b.width / this.zoomTransform.k + _t(r) + Gt(r) : 0, p = t.startLabel ? b.height / this.zoomTransform.k + Ft(r) + Ht(r) : 0;
5931
5943
  let w;
5932
5944
  switch (t.startDirection) {
5933
5945
  case g.Left:
@@ -5955,22 +5967,22 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5955
5967
  Math.max(
5956
5968
  Y(r) + u / 2,
5957
5969
  it(r) + u / 2,
5958
- U(r) + v / 2,
5959
- q(r) + v / 2
5970
+ U(r) + p / 2,
5971
+ q(r) + p / 2
5960
5972
  )
5961
5973
  );
5962
5974
  }
5963
5975
  e.select("g.diagram-connection-start-label path").attr(
5964
5976
  "d",
5965
- qt(
5977
+ Jt(
5966
5978
  -u / 2,
5967
- -v / 2,
5979
+ -p / 2,
5968
5980
  u,
5969
- v
5981
+ p
5970
5982
  )
5971
5983
  ).attr("fill", r.backgroundColor).attr("stroke", "none"), e.select("g.diagram-connection-start-label").attr(
5972
5984
  "transform",
5973
- `translate(${w.x + n * u},${w.y + o * v})`
5985
+ `translate(${w.x + n * u},${w.y + o * p})`
5974
5986
  );
5975
5987
  }
5976
5988
  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,27 +5991,27 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
5979
5991
  ).style("font-kerning", "none").text(t.middleLabel);
5980
5992
  const m = e.select("g.diagram-connection-middle-label text").node()?.getBoundingClientRect();
5981
5993
  if (m) {
5982
- 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);
5994
+ const u = t.middleLabel ? m.width / this.zoomTransform.k + _t(r) + Gt(r) : 0, p = t.middleLabel ? m.height / this.zoomTransform.k + Ft(r) + Ht(r) : 0, w = l.getPointAtLength(i / 2);
5983
5995
  e.select("g.diagram-connection-middle-label path").attr(
5984
5996
  "d",
5985
- qt(
5997
+ Jt(
5986
5998
  -u / 2,
5987
- -v / 2,
5999
+ -p / 2,
5988
6000
  u,
5989
- v
6001
+ p
5990
6002
  )
5991
6003
  ).attr("fill", r.backgroundColor).attr("stroke", "none"), e.select("g.diagram-connection-middle-label").attr(
5992
6004
  "transform",
5993
- `translate(${w.x + d * u},${w.y + c * v})`
6005
+ `translate(${w.x + d * u},${w.y + c * p})`
5994
6006
  );
5995
6007
  }
5996
6008
  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(
5997
6009
  "fill",
5998
6010
  t.selected ? r.selectedColor : r.color
5999
6011
  ).style("font-kerning", "none").text(t.endLabel);
6000
- const p = e.select("g.diagram-connection-end-label text").node()?.getBoundingClientRect();
6001
- if (p) {
6002
- 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;
6012
+ const v = e.select("g.diagram-connection-end-label text").node()?.getBoundingClientRect();
6013
+ if (v) {
6014
+ const u = t.endLabel ? v.width / this.zoomTransform.k + _t(r) + Gt(r) : 0, p = t.endLabel ? v.height / this.zoomTransform.k + Ft(r) + Ht(r) : 0;
6003
6015
  let w;
6004
6016
  switch (t.endDirection) {
6005
6017
  case g.Left:
@@ -6027,22 +6039,22 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6027
6039
  i - Math.max(
6028
6040
  Y(r) + u / 2,
6029
6041
  it(r) + u / 2,
6030
- U(r) + v / 2,
6031
- q(r) + v / 2
6042
+ U(r) + p / 2,
6043
+ q(r) + p / 2
6032
6044
  )
6033
6045
  );
6034
6046
  }
6035
6047
  e.select("g.diagram-connection-end-label path").attr(
6036
6048
  "d",
6037
- qt(
6049
+ Jt(
6038
6050
  -u / 2,
6039
- -v / 2,
6051
+ -p / 2,
6040
6052
  u,
6041
- v
6053
+ p
6042
6054
  )
6043
6055
  ).attr("fill", r.backgroundColor).attr("stroke", "none"), e.select("g.diagram-connection-end-label").attr(
6044
6056
  "transform",
6045
- `translate(${w.x + h * u},${w.y + f * v})`
6057
+ `translate(${w.x + h * u},${w.y + f * p})`
6046
6058
  );
6047
6059
  }
6048
6060
  }
@@ -6243,6 +6255,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6243
6255
  e.fontSize,
6244
6256
  e.fontFamily || V.fontFamily,
6245
6257
  e.orientation,
6258
+ e.multiline,
6246
6259
  () => {
6247
6260
  },
6248
6261
  (a) => {
@@ -6250,38 +6263,38 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6250
6263
  }
6251
6264
  );
6252
6265
  }
6253
- createInputField(t, e, a, l, r, i, n, o, d) {
6266
+ createInputField(t, e, a, l, r, i, n, o, d, c) {
6254
6267
  this.removeInputField();
6255
- const c = this.selectCanvasElements().append("foreignObject").attr("x", `${e[0]}px`).attr("y", `${e[1]}px`).attr("width", `${a}px`).attr("height", `${l}px`).style("box-sizing", "border-box").style("border", "1px solid");
6256
- this.inputFieldContainer = c;
6257
- const h = c.append("xhtml:textarea");
6258
- let f, b;
6259
- 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) => {
6260
- p.stopPropagation();
6261
- }).on($.KeyUp, (p) => {
6262
- if (p.stopPropagation(), p.key === K.Escape) {
6263
- const u = h.property("value");
6264
- this.removeInputField(), d && d(u);
6268
+ const h = this.selectCanvasElements().append("foreignObject").attr("x", `${e[0]}px`).attr("y", `${e[1]}px`).attr("width", `${a}px`).attr("height", `${l}px`).style("box-sizing", "border-box").style("border", "1px solid");
6269
+ this.inputFieldContainer = h;
6270
+ const f = h.append("xhtml:textarea");
6271
+ let b, m;
6272
+ f.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, (u) => {
6273
+ if (u.stopPropagation(), u.key === Z.Escape || u.key === Z.Enter && !o) {
6274
+ const p = f.property("value") || "";
6275
+ this.removeInputField(), c && c(p);
6265
6276
  }
6266
- }).on($.Input, () => {
6267
- const p = h.property("value");
6268
- 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;
6269
- const u = Math.max(f, a), v = Math.max(b, l);
6270
- c?.attr("width", `${u}px`), h.style("width", `${u}px`), c?.attr("height", `${v}px`), h.style("height", `${v}px`), o && o(p);
6271
- }).on($.Click, (p) => {
6272
- p.stopPropagation();
6277
+ }).on($.KeyUp, (u) => {
6278
+ u.stopPropagation();
6279
+ }).on($.Input, (u) => {
6280
+ const p = f.property("value");
6281
+ f.attr("cols", $o(p) + 1), f.attr("rows", Ao(p) + 1), f.style("width", ""), f.style("height", ""), b = f.property("scrollWidth") + 1, m = f.property("scrollHeight") + 1;
6282
+ const w = Math.max(b, a), A = Math.max(m, l);
6283
+ h?.attr("width", `${w}px`), f.style("width", `${w}px`), h?.attr("height", `${A}px`), f.style("height", `${A}px`), d && d(p);
6284
+ }).on($.Click, (u) => {
6285
+ u.stopPropagation();
6273
6286
  }).on($.FocusOut, () => {
6274
- const p = h.property("value");
6275
- this.removeInputField(), d && d(p);
6287
+ const u = f.property("value");
6288
+ this.removeInputField(), c && c(u);
6276
6289
  });
6277
- const m = h.node();
6278
- m.focus(), m.select();
6290
+ const v = f.node();
6291
+ v.focus(), v.select();
6279
6292
  }
6280
6293
  removeInputField() {
6281
6294
  this.inputFieldContainer?.select("input")?.on($.Blur, null), this.inputFieldContainer?.remove(), this.inputFieldContainer = void 0;
6282
6295
  }
6283
6296
  minimumSizeOfField(t) {
6284
- const e = t.select()?.select("p")?.node();
6297
+ const e = t.select()?.select("text")?.node();
6285
6298
  if (!e)
6286
6299
  return [0, 0];
6287
6300
  const a = e.getBoundingClientRect();
@@ -6290,6 +6303,37 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6290
6303
  a.height / this.zoomTransform.k
6291
6304
  ];
6292
6305
  }
6306
+ setFieldTextAndWrap(t) {
6307
+ const e = t.select()?.select("text"), a = e?.node();
6308
+ if (e && a)
6309
+ this.setFieldText(t, e, t.text);
6310
+ else
6311
+ return;
6312
+ if (t.fit)
6313
+ return;
6314
+ let l = this.minimumSizeOfField(t);
6315
+ for (; l[0] > t.width || l[1] > t.height; ) {
6316
+ const r = e?.html()?.replace(/<\/tspan>/g, `
6317
+ `)?.replace(/<tspan[^>]*>/g, "")?.slice(0, -1) || "";
6318
+ let i = "...";
6319
+ if (r.endsWith("...") ? i = r.slice(0, -4) + "..." : i = r.slice(0, -1) + "...", e && this.setFieldText(t, e, i), i === "...")
6320
+ return;
6321
+ l = this.minimumSizeOfField(t);
6322
+ }
6323
+ }
6324
+ setFieldText(t, e, a) {
6325
+ const l = a.split(`
6326
+ `);
6327
+ e.html("");
6328
+ for (let r = 0; r < l.length; ++r)
6329
+ e.append("tspan").attr(
6330
+ "x",
6331
+ t.horizontalAlign === yt.Center ? t.width / 2 : t.horizontalAlign === yt.Right ? t.width : 0
6332
+ ).attr(
6333
+ "y",
6334
+ t.verticalAlign === bt.Center ? (r + 0.5 - l.length / 2) * t.fontSize + t.height / 2 : t.verticalAlign === bt.Bottom ? t.height - (l.length - r - 1) * t.fontSize : r * t.fontSize
6335
+ ).text(l[r]);
6336
+ }
6293
6337
  /**
6294
6338
  * Method to call to start the moving of a node triggered by a user drag event.
6295
6339
  */
@@ -6329,7 +6373,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6329
6373
  e.selected ? this.userSelection.move([
6330
6374
  a[0] - e.coords[0],
6331
6375
  a[1] - e.coords[1]
6332
- ]) : e.move(a), this.userHighlight.clear(), this.dragging = !0;
6376
+ ]) : e.move(a), this.userHighlight.clear(), this.dragging = !0, this.diagramEvent$.next(new ei(e));
6333
6377
  }
6334
6378
  }
6335
6379
  /**
@@ -6357,11 +6401,11 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6357
6401
  e.move(a);
6358
6402
  const r = this.model.nodes.getAtCoordinates(t.x, t.y).filter((o) => o.id !== e.id && !o.isDescendantOf(e)).filter(
6359
6403
  (o) => o.type.childrenTypes.includes(e.type.id)
6360
- ), i = Ze(
6404
+ ), i = We(
6361
6405
  r
6362
6406
  ), n = i[i.length - 1];
6363
6407
  if (n !== e.parent && (e.type.canBeParentless || n !== void 0)) {
6364
- const o = n?.getLastAncestor(), d = this.currentAction.from, c = new Jo(
6408
+ const o = n?.getLastAncestor(), d = this.currentAction.from, c = new Ko(
6365
6409
  this,
6366
6410
  e.id,
6367
6411
  e.parent?.id,
@@ -6407,7 +6451,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6407
6451
  const e = this.getPointerLocationRelativeToCanvas(t);
6408
6452
  this.multipleSelectionContainer?.remove(), this.multipleSelectionContainer = void 0, this.userSelection.clear();
6409
6453
  for (const a of this.model.nodes)
6410
- mo(
6454
+ uo(
6411
6455
  [
6412
6456
  a.coords,
6413
6457
  [a.coords[0] + a.width, a.coords[1] + a.height]
@@ -6421,7 +6465,7 @@ const ui = (s) => s * Math.PI / 180, Oe = (s, t, e) => {
6421
6465
  };
6422
6466
  te.canvasCount = 0;
6423
6467
  let Se = te;
6424
- class io {
6468
+ class eo {
6425
6469
  constructor() {
6426
6470
  this.grid = [[void 0]], this.offsetX = 0, this.offsetY = 0;
6427
6471
  }
@@ -6533,16 +6577,16 @@ class io {
6533
6577
  }
6534
6578
  }
6535
6579
  }
6536
- class yi {
6580
+ class pi {
6537
6581
  constructor(t) {
6538
6582
  this.gapSize = t;
6539
6583
  }
6540
6584
  apply(t) {
6541
6585
  if (t.nodes.length === 0)
6542
6586
  return t;
6543
- const e = new io(), a = t.nodes.filter((n) => !n.parent);
6587
+ const e = new eo(), a = t.nodes.filter((n) => !n.parent);
6544
6588
  for (; a.length > 0; )
6545
- so(
6589
+ oo(
6546
6590
  a[0],
6547
6591
  e,
6548
6592
  [0, 0],
@@ -6560,25 +6604,25 @@ class yi {
6560
6604
  return t;
6561
6605
  }
6562
6606
  }
6563
- const so = (s, t, e, a) => {
6607
+ const oo = (s, t, e, a) => {
6564
6608
  const l = t.getClosestEmptyCoordinate(e);
6565
6609
  t.set(l, s), B(a, s);
6566
6610
  for (const r of s.getAdjacentNodes())
6567
- a.includes(r) && so(
6611
+ a.includes(r) && oo(
6568
6612
  r,
6569
6613
  t,
6570
6614
  l,
6571
6615
  a
6572
6616
  );
6573
6617
  };
6574
- class bi {
6618
+ class mi {
6575
6619
  constructor(t) {
6576
6620
  this.gapSize = t;
6577
6621
  }
6578
6622
  apply(t) {
6579
6623
  if (t.nodes.length === 0)
6580
6624
  return t;
6581
- const e = new io(), a = t.nodes.filter((c) => !c.parent), l = {}, r = a[0];
6625
+ const e = new eo(), a = t.nodes.filter((c) => !c.parent), l = {}, r = a[0];
6582
6626
  let i = [r];
6583
6627
  for (l[r.id] = [0, 0]; a.length > 0; ) {
6584
6628
  const c = [];
@@ -6646,7 +6690,7 @@ class re {
6646
6690
  return t;
6647
6691
  }
6648
6692
  }
6649
- class ki {
6693
+ class vi {
6650
6694
  constructor(t) {
6651
6695
  this.gapSize = t;
6652
6696
  }
@@ -6667,19 +6711,19 @@ class ki {
6667
6711
  for (const f of t.nodes) {
6668
6712
  const b = f.getAdjacentNodes();
6669
6713
  for (const m of t.nodes) {
6670
- const p = [
6714
+ const v = [
6671
6715
  f.coords[0] + f.width / 2,
6672
6716
  f.coords[1] + f.height / 2
6673
6717
  ], u = [
6674
6718
  m.coords[0] + m.width / 2,
6675
6719
  m.coords[1] + m.height / 2
6676
- ], v = Ue(
6720
+ ], p = Ge(
6677
6721
  f.coords,
6678
6722
  m.coords
6679
6723
  ), w = [m.coords[0], m.coords[1]];
6680
- 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) {
6681
- const I = i / (v * v);
6682
- w[0] = w[0] + I * (u[0] - p[0]) / v, w[1] = w[1] + I * (u[1] - p[1]) / v;
6724
+ if (b.includes(m) && p > 0 && (p > e + (Math.max(f.width, f.height) + Math.max(m.width, m.height)) / 2 ? (w[0] = w[0] - (u[0] - v[0]) * r, w[1] = w[1] - (u[1] - v[1]) * r) : (w[0] = w[0] + (u[0] - v[0]) * n, w[1] = w[1] + (u[1] - v[1]) * n)), p > 0) {
6725
+ const A = i / (p * p);
6726
+ w[0] = w[0] + A * (u[0] - v[0]) / p, w[1] = w[1] + A * (u[1] - v[1]) / p;
6683
6727
  } else
6684
6728
  w[0] = w[0] + o * (Math.random() * 2 - 1), w[1] = w[1] + o * (Math.random() * 2 - 1);
6685
6729
  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);
@@ -6699,7 +6743,7 @@ class ki {
6699
6743
  return t;
6700
6744
  }
6701
6745
  }
6702
- class wi {
6746
+ class yi {
6703
6747
  constructor(t) {
6704
6748
  this.gapSize = t;
6705
6749
  }
@@ -6714,7 +6758,7 @@ class wi {
6714
6758
  return t;
6715
6759
  }
6716
6760
  }
6717
- class Si {
6761
+ class bi {
6718
6762
  constructor(t) {
6719
6763
  this.gapSize = t;
6720
6764
  }
@@ -6737,8 +6781,8 @@ class Si {
6737
6781
  const b = h[0];
6738
6782
  h.splice(0, 1), n.includes(b) && (o.push(b), B(n, b));
6739
6783
  const m = b.getAdjacentNodes();
6740
- for (const p of m)
6741
- f.includes(p) || (h.push(p), f.push(p));
6784
+ for (const v of m)
6785
+ f.includes(v) || (h.push(v), f.push(v));
6742
6786
  }
6743
6787
  for (const b of n)
6744
6788
  o.push(b);
@@ -6754,14 +6798,14 @@ class Si {
6754
6798
  for (; h.length > 0; ) {
6755
6799
  const m = h[0];
6756
6800
  h.splice(0, 1);
6757
- const p = o.indexOf(m);
6758
- if (p >= 0) {
6759
- i[p].push(c), b = !0;
6801
+ const v = o.indexOf(m);
6802
+ if (v >= 0) {
6803
+ i[v].push(c), b = !0;
6760
6804
  break;
6761
6805
  } else {
6762
6806
  const u = m.getAdjacentNodes();
6763
- for (const v of u)
6764
- f.includes(v) || (h.push(v), f.push(v));
6807
+ for (const p of u)
6808
+ f.includes(p) || (h.push(p), f.push(p));
6765
6809
  }
6766
6810
  }
6767
6811
  b || i[i.length - 1].push(c);
@@ -6781,7 +6825,7 @@ class Si {
6781
6825
  return t;
6782
6826
  }
6783
6827
  }
6784
- class Ci {
6828
+ class ki {
6785
6829
  constructor(t) {
6786
6830
  this.gapSize = t;
6787
6831
  }
@@ -6800,11 +6844,11 @@ class Ci {
6800
6844
  const c = r[0];
6801
6845
  r.splice(0, 1);
6802
6846
  const h = new Ie(void 0, c);
6803
- no(h, r), i.push(h);
6847
+ io(h, r), i.push(h);
6804
6848
  }
6805
6849
  const n = [];
6806
6850
  for (const c of i)
6807
- n.push([c]), ro(c, n, n.length);
6851
+ n.push([c]), so(c, n, n.length);
6808
6852
  const o = Math.max(...t.nodes.map((c) => c.height));
6809
6853
  let d = 0;
6810
6854
  for (let c = 0; c < n.length; ++c) {
@@ -6823,21 +6867,21 @@ class Ci {
6823
6867
  return t;
6824
6868
  }
6825
6869
  }
6826
- const no = (s, t) => {
6870
+ const io = (s, t) => {
6827
6871
  for (const e of s.node.getAdjacentNodes().sort((a, l) => l.getPriority() - a.getPriority())) {
6828
6872
  const a = t.indexOf(e);
6829
6873
  if (a >= 0) {
6830
6874
  t.splice(a, 1);
6831
6875
  const l = s.addBranch(e);
6832
- no(l, t);
6876
+ io(l, t);
6833
6877
  }
6834
6878
  }
6835
- }, ro = (s, t, e) => {
6879
+ }, so = (s, t, e) => {
6836
6880
  if (s.branches.length > 0) {
6837
6881
  for (; e >= t.length; )
6838
6882
  t.push([]);
6839
6883
  for (const a of s.branches)
6840
- t[e].push(a), ro(a, t, e + 1);
6884
+ t[e].push(a), so(a, t, e + 1);
6841
6885
  }
6842
6886
  };
6843
6887
  class Ie {
@@ -6859,7 +6903,7 @@ class Ie {
6859
6903
  }
6860
6904
  }
6861
6905
  }
6862
- class $i {
6906
+ class wi {
6863
6907
  constructor(t) {
6864
6908
  this.gapSize = t;
6865
6909
  }
@@ -6874,17 +6918,17 @@ class $i {
6874
6918
  return t;
6875
6919
  }
6876
6920
  }
6877
- const _e = {
6878
- adjacency: new yi(),
6921
+ const Oe = {
6922
+ adjacency: new pi(),
6879
6923
  breadth: new re(),
6880
- "breadth-adjacency": new bi(),
6881
- force: new ki(),
6882
- horizontal: new wi(),
6883
- priority: new Si(),
6884
- tree: new Ci(),
6885
- vertical: new $i()
6886
- }, Ai = Fe({}), $t = Fe({});
6887
- class Ii {
6924
+ "breadth-adjacency": new mi(),
6925
+ force: new vi(),
6926
+ horizontal: new yi(),
6927
+ priority: new bi(),
6928
+ tree: new ki(),
6929
+ vertical: new wi()
6930
+ }, Si = _e({}), It = _e({});
6931
+ class Ci {
6888
6932
  constructor(t, e) {
6889
6933
  this.onTitleChange = t, this.onValueSetChange = e;
6890
6934
  }
@@ -6922,9 +6966,9 @@ const xe = ({
6922
6966
  if (typeof t == "string")
6923
6967
  m = L.select(t), e && (m = m.select(e));
6924
6968
  else {
6925
- const p = t;
6926
- if (!p) throw new Error("collapsableSelector is not a valid ref");
6927
- m = L.select(p.current), e && (m = m.select(e));
6969
+ const v = t;
6970
+ if (!v) throw new Error("collapsableSelector is not a valid ref");
6971
+ m = L.select(v.current), e && (m = m.select(e));
6928
6972
  }
6929
6973
  m.style(r, b ? i : n);
6930
6974
  }
@@ -6948,10 +6992,10 @@ const xe = ({
6948
6992
  children: /* @__PURE__ */ y("div", { className: f() })
6949
6993
  }
6950
6994
  ) });
6951
- }, xi = () => {
6952
- const s = Dt($t), t = rt(null), [e, a] = D([]);
6953
- fo(s.validatorChange$, s.diagramChange$).pipe(
6954
- uo(() => l())
6995
+ }, $i = () => {
6996
+ const s = Bt(It), t = rt(null), [e, a] = D([]);
6997
+ ho(s.validatorChange$, s.diagramChange$).pipe(
6998
+ go(() => l())
6955
6999
  ).subscribe();
6956
7000
  const l = () => {
6957
7001
  a([]);
@@ -7005,7 +7049,7 @@ const xe = ({
7005
7049
  n
7006
7050
  )) }) })
7007
7051
  ] }) });
7008
- }, Li = 200, Ge = (s) => (s || "").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, ""), ao = ({
7052
+ }, Ai = 200, He = (s) => (s || "").toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g, ""), no = ({
7009
7053
  disabled: s,
7010
7054
  options: t,
7011
7055
  value: e,
@@ -7013,80 +7057,80 @@ const xe = ({
7013
7057
  }) => {
7014
7058
  const l = rt(null), [r, i] = D("");
7015
7059
  let n;
7016
- const [o, d] = D([]), [c, h] = D([]), [f, b] = D([]), [m, p] = D([]), [u, v] = D(!1);
7017
- St(() => {
7018
- i(t.find((x) => wt(x.key, e))?.label || "");
7060
+ const [o, d] = D([]), [c, h] = D([]), [f, b] = D([]), [m, v] = D([]), [u, p] = D(!1);
7061
+ $t(() => {
7062
+ i(t.find((x) => Ct(x.key, e))?.label || "");
7019
7063
  }, [e, t]);
7020
7064
  const w = (x) => {
7021
7065
  if (!s)
7022
7066
  switch (x.key) {
7023
- case K.PageDown:
7067
+ case Z.PageDown:
7024
7068
  n === void 0 ? (P(0), T(0)) : (P(n + 5), T(n)), x.preventDefault();
7025
7069
  break;
7026
- case K.ArrowDown:
7070
+ case Z.ArrowDown:
7027
7071
  n === void 0 ? (P(0), T(0)) : (P(n + 1), T(n)), x.preventDefault();
7028
7072
  break;
7029
- case K.PageUp:
7073
+ case Z.PageUp:
7030
7074
  n === void 0 ? (P(t.length - 1), T(t.length - 1)) : (P(n - 5), T(n)), x.preventDefault();
7031
7075
  break;
7032
- case K.ArrowUp:
7076
+ case Z.ArrowUp:
7033
7077
  n === void 0 ? (P(t.length - 1), T(t.length - 1)) : (P(n - 1), T(n)), x.preventDefault();
7034
7078
  break;
7035
- case K.Escape:
7079
+ case Z.Escape:
7036
7080
  R(), x.preventDefault();
7037
7081
  break;
7038
- case K.Enter:
7082
+ case Z.Enter:
7039
7083
  O(t[n || 0]), x.preventDefault();
7040
7084
  break;
7041
7085
  default:
7042
- I();
7086
+ A();
7043
7087
  }
7044
- }, I = () => {
7088
+ }, A = () => {
7045
7089
  if (!s) {
7046
- const x = Ge(r.trim());
7047
- d([]), h([]), b([]), p([]);
7090
+ const x = He(r.trim());
7091
+ d([]), h([]), b([]), v([]);
7048
7092
  for (const _ of t) {
7049
- const J = Ge(_.label).indexOf(x);
7093
+ const J = He(_.label).indexOf(x);
7050
7094
  if (J >= 0) {
7051
- const Bt = _.label.substring(0, J), Pt = _.label.substring(
7095
+ const Xt = _.label.substring(0, J), Rt = _.label.substring(
7052
7096
  J,
7053
7097
  J + x.length
7054
- ), Z = _.label.substring(
7098
+ ), K = _.label.substring(
7055
7099
  J + x.length
7056
7100
  );
7057
7101
  d((Q) => [...Q, _]), h((Q) => [
7058
7102
  ...Q,
7059
- Bt
7103
+ Xt
7060
7104
  ]), b((Q) => [
7061
7105
  ...Q,
7062
- Pt
7063
- ]), p((Q) => [
7106
+ Rt
7107
+ ]), v((Q) => [
7064
7108
  ...Q,
7065
- Z
7109
+ K
7066
7110
  ]);
7067
7111
  }
7068
7112
  }
7069
- v(!0);
7113
+ p(!0);
7070
7114
  }
7071
7115
  }, R = () => {
7072
- v(!1);
7116
+ p(!1);
7073
7117
  }, P = (x) => {
7074
7118
  if (!s) {
7075
7119
  if (n = x, x === void 0)
7076
7120
  return;
7077
7121
  x < 0 && (n = 0), x >= t.length && (n = t.length - 1);
7078
7122
  }
7079
- }, et = () => {
7123
+ }, ot = () => {
7080
7124
  setTimeout(() => {
7081
7125
  R();
7082
- }, Li);
7126
+ }, Ai);
7083
7127
  }, T = (x) => {
7084
7128
  const _ = l.current?.querySelectorAll("li")[x];
7085
7129
  _ && _.scrollIntoView({ block: "center" });
7086
7130
  }, C = () => {
7087
- s || (i(""), v(!1), n = void 0);
7131
+ s || (i(""), p(!1), n = void 0);
7088
7132
  }, O = (x) => {
7089
- s || (i(x.label), v(!1), n = void 0, a(x.key));
7133
+ s || (i(x.label), p(!1), n = void 0, a(x.key));
7090
7134
  };
7091
7135
  return /* @__PURE__ */ M(
7092
7136
  "div",
@@ -7101,8 +7145,8 @@ const xe = ({
7101
7145
  value: r,
7102
7146
  disabled: s,
7103
7147
  onKeyUp: w,
7104
- onFocus: I,
7105
- onBlur: et,
7148
+ onFocus: A,
7149
+ onBlur: ot,
7106
7150
  onChange: (x) => i(x.target.value)
7107
7151
  }
7108
7152
  ),
@@ -7128,7 +7172,7 @@ const xe = ({
7128
7172
  ]
7129
7173
  }
7130
7174
  );
7131
- }, Ei = (s, t) => s.find((e) => e.key === t)?.label || `${t}`, Ti = ({
7175
+ }, Ii = (s, t) => s.find((e) => e.key === t)?.label || `${t}`, xi = ({
7132
7176
  disabled: s,
7133
7177
  allowRepeats: t,
7134
7178
  options: e,
@@ -7136,44 +7180,44 @@ const xe = ({
7136
7180
  onChange: l
7137
7181
  }) => {
7138
7182
  const [r, i] = D(), [n, o] = D([]), [d, c] = D([]);
7139
- St(() => {
7140
- const u = a.length === 0, v = a.map((w) => Ei(e, w));
7141
- o(v), u && l(a), p();
7183
+ $t(() => {
7184
+ const u = a.length === 0, p = a.map((w) => Ii(e, w));
7185
+ o(p), u && l(a), v();
7142
7186
  }, [a, e]);
7143
7187
  const h = (u) => {
7144
- for (const v of a)
7145
- if (v === u)
7188
+ for (const p of a)
7189
+ if (p === u)
7146
7190
  return !0;
7147
7191
  return !1;
7148
7192
  }, f = (u) => {
7149
- a.length > u && (a.splice(u, 1), o(n.filter((v, w) => w !== u)), l(a), p());
7193
+ a.length > u && (a.splice(u, 1), o(n.filter((p, w) => w !== u)), l(a), v());
7150
7194
  }, b = () => {
7151
7195
  r !== void 0 && (t || !h(r)) && (l(a.concat(r)), m());
7152
7196
  }, m = () => {
7153
7197
  i("");
7154
- }, p = () => {
7198
+ }, v = () => {
7155
7199
  if (!t) {
7156
7200
  const u = [];
7157
- for (const v of e)
7158
- h(v.key) || u.push(v);
7201
+ for (const p of e)
7202
+ h(p.key) || u.push(p);
7159
7203
  c(u);
7160
7204
  }
7161
7205
  };
7162
7206
  return /* @__PURE__ */ M("div", { children: [
7163
- a.map((u, v) => /* @__PURE__ */ M("div", { className: "daga-value-item-element", children: [
7164
- /* @__PURE__ */ y("span", { className: "daga-input", children: n[v] }),
7207
+ a.map((u, p) => /* @__PURE__ */ M("div", { className: "daga-value-item-element", children: [
7208
+ /* @__PURE__ */ y("span", { className: "daga-input", children: n[p] }),
7165
7209
  !s && /* @__PURE__ */ y(
7166
7210
  "button",
7167
7211
  {
7168
7212
  className: "daga-property-button",
7169
- onClick: () => f(v),
7213
+ onClick: () => f(p),
7170
7214
  children: /* @__PURE__ */ y("div", { className: "daga-icon daga-close-icon" })
7171
7215
  }
7172
7216
  )
7173
- ] }, v)),
7217
+ ] }, p)),
7174
7218
  !s && /* @__PURE__ */ M("div", { className: "daga-value-item-input", children: [
7175
7219
  /* @__PURE__ */ y("div", { className: "daga-input daga-relatively-positioned", children: /* @__PURE__ */ y(
7176
- ao,
7220
+ no,
7177
7221
  {
7178
7222
  disabled: s,
7179
7223
  options: t ? e || [] : d || [],
@@ -7184,7 +7228,7 @@ const xe = ({
7184
7228
  /* @__PURE__ */ y("button", { className: "daga-property-button", onClick: b, children: /* @__PURE__ */ y("div", { className: "daga-icon daga-add-icon" }) })
7185
7229
  ] })
7186
7230
  ] });
7187
- }, Mi = ({
7231
+ }, Li = ({
7188
7232
  disabled: s,
7189
7233
  allowRepeats: t,
7190
7234
  value: e,
@@ -7198,10 +7242,10 @@ const xe = ({
7198
7242
  }, n = (f) => {
7199
7243
  e.length > f && a(e.filter((b, m) => m !== f));
7200
7244
  }, o = (f, b, m) => {
7201
- const p = e.map(
7202
- (u, v) => v === b ? m === "blur" ? f.trim() : f : u
7245
+ const v = e.map(
7246
+ (u, p) => p === b ? m === "blur" ? f.trim() : f : u
7203
7247
  );
7204
- a(p);
7248
+ a(v);
7205
7249
  }, d = () => {
7206
7250
  const f = l.trim();
7207
7251
  f !== "" && (t || !i(f)) && (a(e.concat(f)), c());
@@ -7210,7 +7254,7 @@ const xe = ({
7210
7254
  }, h = (f) => {
7211
7255
  f.key === "Enter" && d();
7212
7256
  };
7213
- return /* @__PURE__ */ M(ho, { children: [
7257
+ return /* @__PURE__ */ M(lo, { children: [
7214
7258
  e.map((f, b) => /* @__PURE__ */ M("div", { className: "daga-value-item-element", children: [
7215
7259
  /* @__PURE__ */ y(
7216
7260
  "input",
@@ -7247,58 +7291,58 @@ const xe = ({
7247
7291
  /* @__PURE__ */ y("button", { className: "daga-property-button", onClick: d, children: /* @__PURE__ */ y("div", { className: "daga-icon daga-add-icon" }) })
7248
7292
  ] })
7249
7293
  ] });
7250
- }, Ni = ({
7294
+ }, Ei = ({
7251
7295
  disabled: s,
7252
7296
  value: t,
7253
7297
  onChange: e
7254
7298
  }) => {
7255
7299
  const [a, l] = D(""), [r, i] = D(""), [n, o] = D({}), d = (u) => {
7256
- const v = {};
7300
+ const p = {};
7257
7301
  Object.keys(t).forEach((w) => {
7258
- w !== u && (v[w] = t[w]);
7259
- }), e(v);
7260
- }, c = (u, v, w) => {
7261
- const I = w === "blur" ? v.trim() : v;
7302
+ w !== u && (p[w] = t[w]);
7303
+ }), e(p);
7304
+ }, c = (u, p, w) => {
7305
+ const A = w === "blur" ? p.trim() : p;
7262
7306
  if (w === "blur") {
7263
- if (u !== I) {
7307
+ if (u !== A) {
7264
7308
  const R = {};
7265
7309
  Object.keys(t).forEach((P) => {
7266
- P === u ? R[I] = t[P] : R[P] = t[P];
7310
+ P === u ? R[A] = t[P] : R[P] = t[P];
7267
7311
  }), e(R), o((P) => {
7268
- const et = { ...P };
7269
- return delete et[u], et;
7312
+ const ot = { ...P };
7313
+ return delete ot[u], ot;
7270
7314
  });
7271
7315
  }
7272
7316
  } else
7273
7317
  o((R) => ({
7274
7318
  ...R,
7275
- [u]: v
7319
+ [u]: p
7276
7320
  }));
7277
- }, h = (u, v, w) => {
7278
- const I = w === "blur" ? v.trim() : v;
7279
- if (I !== "") {
7321
+ }, h = (u, p, w) => {
7322
+ const A = w === "blur" ? p.trim() : p;
7323
+ if (A !== "") {
7280
7324
  const R = {};
7281
7325
  Object.keys(t).forEach((P) => {
7282
- P === u ? R[P] = I : R[P] = t[P];
7326
+ P === u ? R[P] = A : R[P] = t[P];
7283
7327
  }), e(R);
7284
7328
  }
7285
7329
  }, f = () => {
7286
- const u = a.trim(), v = r.trim();
7287
- if (u !== "" && v !== "") {
7330
+ const u = a.trim(), p = r.trim();
7331
+ if (u !== "" && p !== "") {
7288
7332
  const w = {};
7289
- Object.keys(t).forEach((I) => {
7290
- w[I] = t[I];
7291
- }), w[u] = v, e(w), l(""), i("");
7333
+ Object.keys(t).forEach((A) => {
7334
+ w[A] = t[A];
7335
+ }), w[u] = p, e(w), l(""), i("");
7292
7336
  }
7293
7337
  }, b = () => {
7294
7338
  l("");
7295
7339
  }, m = () => {
7296
7340
  i("");
7297
- }, p = (u) => {
7341
+ }, v = (u) => {
7298
7342
  u.key === "Enter" && f();
7299
7343
  };
7300
7344
  return /* @__PURE__ */ M("div", { children: [
7301
- Object.entries(t).map(([u, v], w) => /* @__PURE__ */ M("div", { className: "daga-value-item-element", children: [
7345
+ Object.entries(t).map(([u, p], w) => /* @__PURE__ */ M("div", { className: "daga-value-item-element", children: [
7302
7346
  /* @__PURE__ */ y(
7303
7347
  "input",
7304
7348
  {
@@ -7307,8 +7351,8 @@ const xe = ({
7307
7351
  type: "text",
7308
7352
  disabled: s,
7309
7353
  value: n[u] ?? u,
7310
- onChange: (I) => c(u, I.target.value, "change"),
7311
- onBlur: (I) => c(u, I.target.value, "blur")
7354
+ onChange: (A) => c(u, A.target.value, "change"),
7355
+ onBlur: (A) => c(u, A.target.value, "blur")
7312
7356
  }
7313
7357
  ),
7314
7358
  /* @__PURE__ */ y(
@@ -7318,9 +7362,9 @@ const xe = ({
7318
7362
  className: "daga-input",
7319
7363
  type: "text",
7320
7364
  disabled: s,
7321
- value: v,
7322
- onChange: (I) => h(u, I.target.value, "change"),
7323
- onBlur: (I) => h(u, I.target.value, "blur")
7365
+ value: p,
7366
+ onChange: (A) => h(u, A.target.value, "change"),
7367
+ onBlur: (A) => h(u, A.target.value, "blur")
7324
7368
  }
7325
7369
  ),
7326
7370
  /* @__PURE__ */ y(
@@ -7339,7 +7383,7 @@ const xe = ({
7339
7383
  {
7340
7384
  type: "text",
7341
7385
  value: a,
7342
- onKeyUp: p,
7386
+ onKeyUp: v,
7343
7387
  onChange: (u) => l(u.target.value),
7344
7388
  onBlur: (u) => c(a, u.target.value, "blur")
7345
7389
  }
@@ -7352,7 +7396,7 @@ const xe = ({
7352
7396
  {
7353
7397
  type: "text",
7354
7398
  value: r,
7355
- onKeyUp: p,
7399
+ onKeyUp: v,
7356
7400
  onChange: (u) => i(u.target.value),
7357
7401
  onBlur: (u) => h(a, u.target.value, "blur")
7358
7402
  }
@@ -7362,12 +7406,12 @@ const xe = ({
7362
7406
  /* @__PURE__ */ y("button", { className: "daga-property-button", onClick: f, children: /* @__PURE__ */ y("div", { className: "daga-icon daga-add-icon" }) })
7363
7407
  ] })
7364
7408
  ] });
7365
- }, lo = ({
7409
+ }, ro = ({
7366
7410
  valueSet: s,
7367
7411
  onValueChange: t,
7368
7412
  depth: e
7369
7413
  }) => {
7370
- const l = Dt($t).canUserPerformAction(k.UpdateValues) && s?.rootElement?.removed !== !0, r = (o) => "daga-property-name-" + o.replace(/\s/g, ""), i = (o) => {
7414
+ const l = Bt(It).canUserPerformAction(k.UpdateValues) && s?.rootElement?.removed !== !0, r = (o) => "daga-property-name-" + o.replace(/\s/g, ""), i = (o) => {
7371
7415
  if (typeof o == "string")
7372
7416
  return o;
7373
7417
  if (o == null || isNaN(o.valueOf()))
@@ -7502,7 +7546,7 @@ const xe = ({
7502
7546
  )
7503
7547
  ] }),
7504
7548
  o.type === N.Option && /* @__PURE__ */ y("div", { className: "daga-relatively-positioned", children: /* @__PURE__ */ y(
7505
- ao,
7549
+ no,
7506
7550
  {
7507
7551
  disabled: o.editable === !1 || !l,
7508
7552
  options: o.options || [],
@@ -7511,7 +7555,7 @@ const xe = ({
7511
7555
  }
7512
7556
  ) }),
7513
7557
  (o.type === N.OptionList || o.type === N.OptionSet) && /* @__PURE__ */ y(
7514
- Ti,
7558
+ xi,
7515
7559
  {
7516
7560
  disabled: o.editable === !1 || !l,
7517
7561
  allowRepeats: o.type === N.OptionList,
@@ -7521,7 +7565,7 @@ const xe = ({
7521
7565
  }
7522
7566
  ),
7523
7567
  (o.type === N.TextList || o.type === N.TextSet) && /* @__PURE__ */ y(
7524
- Mi,
7568
+ Li,
7525
7569
  {
7526
7570
  disabled: o.editable === !1 || !l,
7527
7571
  allowRepeats: o.type === N.TextList,
@@ -7530,7 +7574,7 @@ const xe = ({
7530
7574
  }
7531
7575
  ),
7532
7576
  o.type === N.TextMap && /* @__PURE__ */ y(
7533
- Ni,
7577
+ Ei,
7534
7578
  {
7535
7579
  disabled: o.editable === !1 || !l,
7536
7580
  value: s?.getValue(o.name),
@@ -7538,7 +7582,7 @@ const xe = ({
7538
7582
  }
7539
7583
  ),
7540
7584
  o.type === N.Object && /* @__PURE__ */ y("div", { className: "daga-left-bar", children: /* @__PURE__ */ y(
7541
- lo,
7585
+ ro,
7542
7586
  {
7543
7587
  valueSet: s.getSubValueSet(o.name),
7544
7588
  onValueChange: t,
@@ -7549,22 +7593,22 @@ const xe = ({
7549
7593
  },
7550
7594
  o.name
7551
7595
  )) });
7552
- }, co = ({ valueSet: s, depth: t }) => {
7553
- const e = Dt($t), a = rt(null), l = (o) => "daga-property-name-" + o.replace(/\s/g, ""), r = () => {
7596
+ }, ao = ({ valueSet: s, depth: t }) => {
7597
+ const e = Bt(It), a = rt(null), l = (o) => "daga-property-name-" + o.replace(/\s/g, ""), r = () => {
7554
7598
  for (const o of s?.displayedProperties || []) {
7555
7599
  let d = 0, c = 0, h = 0;
7556
7600
  const f = L.select(a.current).select(
7557
7601
  `.daga-property.${l(o.name)}.daga-depth-${t}`
7558
7602
  );
7559
7603
  f.select("button.daga-move-button").call(
7560
- L.drag().on(A.Start, (b) => {
7604
+ L.drag().on(I.Start, (b) => {
7561
7605
  S(E.Grabbing);
7562
7606
  const m = e.getPointerLocationRelativeToScreen(b);
7563
7607
  if (m.length < 2 || isNaN(m[0]) || isNaN(m[1]))
7564
7608
  return;
7565
- const p = f.node()?.getBoundingClientRect();
7566
- 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);
7567
- }).on(A.Drag, (b) => {
7609
+ const v = f.node()?.getBoundingClientRect();
7610
+ d = v?.width || 0, c = v?.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);
7611
+ }).on(I.Drag, (b) => {
7568
7612
  S(E.Grabbing);
7569
7613
  const m = e.getPointerLocationRelativeToScreen(b);
7570
7614
  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(
@@ -7572,7 +7616,7 @@ const xe = ({
7572
7616
  ).style("visibility", "hidden").style("height", 0), h = i(m), L.select(a.current).select(
7573
7617
  `.daga-dropbar.daga-index-${h}.daga-depth-${t}`
7574
7618
  ).style("visibility", "visible").style("height", "0.25rem"));
7575
- }).on(A.End, (b) => {
7619
+ }).on(I.End, (b) => {
7576
7620
  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(
7577
7621
  `.daga-dropbar.daga-index-${h}.daga-depth-${t}`
7578
7622
  ).style("visibility", "hidden").style("height", 0);
@@ -7612,7 +7656,7 @@ const xe = ({
7612
7656
  if (s === void 0)
7613
7657
  return;
7614
7658
  let d;
7615
- o instanceof Po ? d = o : o instanceof Event ? d = s?.propertySet.getProperty(
7659
+ o instanceof Mo ? d = o : o instanceof Event ? d = s?.propertySet.getProperty(
7616
7660
  o.target?.value || ""
7617
7661
  ) : d = s?.propertySet.getProperty(o || ""), d && s?.hideProperty(d), r();
7618
7662
  };
@@ -7642,9 +7686,9 @@ const xe = ({
7642
7686
  )
7643
7687
  ] })
7644
7688
  ] }),
7645
- o.type !== N.Object && /* @__PURE__ */ y("div", { className: "daga-property-value", children: Pi(s?.getValue(o.name)) }),
7689
+ o.type !== N.Object && /* @__PURE__ */ y("div", { className: "daga-property-value", children: Ti(s?.getValue(o.name)) }),
7646
7690
  o.type === N.Object && /* @__PURE__ */ y(
7647
- co,
7691
+ ao,
7648
7692
  {
7649
7693
  valueSet: s?.getSubValueSet(o.name),
7650
7694
  depth: t + 1
@@ -7664,9 +7708,9 @@ const xe = ({
7664
7708
  o.name
7665
7709
  ))
7666
7710
  ] });
7667
- }, 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 }) => {
7711
+ }, Ti = (s) => Array.isArray(s) ? s.join(", ") : No(s) ? Object.entries(s).map((t) => t.map((e) => JSON.stringify(e)).join(": ")).join(", ") : s instanceof Date ? s.toLocaleString() : s == null ? "" : "" + s, Mi = ({ location: s, direction: t, width: e, height: a, title: l, valueSet: r, onValueChange: i }) => {
7668
7712
  const n = rt(null), [o, d] = D(!1), [c, h] = D(!1), f = () => L.select(n.current);
7669
- return St(() => {
7713
+ return $t(() => {
7670
7714
  if (n.current)
7671
7715
  switch (t) {
7672
7716
  case g.Bottom:
@@ -7716,78 +7760,78 @@ const xe = ({
7716
7760
  )
7717
7761
  ] }),
7718
7762
  !c && /* @__PURE__ */ y(
7719
- lo,
7763
+ ro,
7720
7764
  {
7721
7765
  valueSet: r,
7722
7766
  onValueChange: i,
7723
7767
  depth: 0
7724
7768
  }
7725
7769
  ),
7726
- c && /* @__PURE__ */ y(co, { valueSet: r, depth: 0 })
7770
+ c && /* @__PURE__ */ y(ao, { valueSet: r, depth: 0 })
7727
7771
  ] }) })
7728
7772
  ]
7729
7773
  }
7730
7774
  ) });
7731
- }, Ri = 6, Vi = (s) => {
7732
- const t = Dt($t), [e, a] = D(
7775
+ }, Ni = 6, Pi = (s) => {
7776
+ const t = Bt(It), [e, a] = D(
7733
7777
  s.currentPalette || s.palettes[0]
7734
7778
  ), [l, r] = D(0), [i, n] = D(
7735
7779
  void 0
7736
- ), o = rt(null), d = (p) => {
7737
- if (a(p), c().selectAll("*").remove(), r(t.getPriorityThreshold() || 0), p.categories && h(p.categories), p.templates)
7738
- for (const u of p.templates)
7780
+ ), o = rt(null), d = (v) => {
7781
+ if (a(v), c().selectAll("*").remove(), r(t.getPriorityThreshold() || 0), v.categories && h(v.categories), v.templates)
7782
+ for (const u of v.templates)
7739
7783
  f(u);
7740
- }, c = () => L.select(o.current).select(".daga-palette-view"), h = (p) => {
7784
+ }, c = () => L.select(o.current).select(".daga-palette-view"), h = (v) => {
7741
7785
  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");
7742
7786
  u.append("option").attr("value", "").text("(None selected)");
7743
- for (const v in p)
7744
- u.append("option").attr("value", v).text(v);
7787
+ for (const p in v)
7788
+ u.append("option").attr("value", p).text(p);
7745
7789
  u.on($.Change, () => {
7746
7790
  i && c().selectAll(".daga-template-container.daga-in-category").remove();
7747
- const v = u.property("value");
7748
- n(v);
7749
- const w = p[v] || [];
7750
- for (const I of w)
7751
- f(I, "daga-in-category");
7791
+ const p = u.property("value");
7792
+ n(p);
7793
+ const w = v[p] || [];
7794
+ for (const A of w)
7795
+ f(A, "daga-in-category");
7752
7796
  }), i && (u.property("value", i), u.dispatch($.Change));
7753
- }, f = (p, u) => {
7754
- if (p.templateType === "node") {
7755
- const v = t.model.nodes.types.get(p.type);
7756
- v ? b(v, p, u) : console.error(`Could not find a node type called '${p.type}'`);
7757
- } else if (p.templateType === "connection") {
7758
- const v = t.model.connections.types.get(p.type);
7759
- v ? m(v, p, u) : console.error(
7760
- `Could not find a connection type called '${p.type}'`
7797
+ }, f = (v, u) => {
7798
+ if (v.templateType === "node") {
7799
+ const p = t.model.nodes.types.get(v.type);
7800
+ p ? b(p, v, u) : console.error(`Could not find a node type called '${v.type}'`);
7801
+ } else if (v.templateType === "connection") {
7802
+ const p = t.model.connections.types.get(v.type);
7803
+ p ? m(p, v, u) : console.error(
7804
+ `Could not find a connection type called '${v.type}'`
7761
7805
  );
7762
7806
  }
7763
- }, b = (p, u, v) => {
7764
- if (l !== void 0 && p.priority < l)
7807
+ }, b = (v, u, p) => {
7808
+ if (l !== void 0 && v.priority < l)
7765
7809
  return;
7766
- 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(
7810
+ const w = v.defaultLook.lookType === "shaped-look" ? v.defaultLook.borderThickness || 1 : 0, A = v.defaultHeight + w, R = v.defaultWidth + w, P = u.height || A, ot = u.width || R, T = c().append("div").attr(
7767
7811
  "class",
7768
- `daga-template-container ${v !== void 0 ? v : ""}`
7769
- ).style("width", `${et}px`).style("height", `${P}px`).call(
7770
- L.drag().on(A.Drag, (O) => {
7812
+ `daga-template-container ${p !== void 0 ? p : ""}`
7813
+ ).style("width", `${ot}px`).style("height", `${P}px`).call(
7814
+ L.drag().on(I.Drag, (O) => {
7771
7815
  if (t.canUserPerformAction(k.AddNode)) {
7772
7816
  const x = t.getPointerLocationRelativeToScreen(O);
7773
7817
  if (x.length < 2 || isNaN(x[0]) || isNaN(x[1]))
7774
7818
  return;
7775
- T.style("position", "fixed").style("left", `${x[0] - et / 2}px`).style("top", `${x[1] - P / 2}px`).style("z-index", 1);
7819
+ T.style("position", "fixed").style("left", `${x[0] - ot / 2}px`).style("top", `${x[1] - P / 2}px`).style("z-index", 1);
7776
7820
  }
7777
- }).on(A.Start, (O) => {
7821
+ }).on(I.Start, (O) => {
7778
7822
  if (t.canUserPerformAction(k.AddNode)) {
7779
7823
  S(E.Grabbing);
7780
7824
  const x = t.getPointerLocationRelativeToScreen(O);
7781
7825
  if (x.length < 2 || isNaN(x[0]) || isNaN(x[1]))
7782
7826
  return;
7783
- 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(
7784
- (_) => !_.removed && _.type.id === p.id
7827
+ T.style("position", "fixed").style("left", `${x[0] - ot / 2}px`).style("top", `${x[1] - P / 2}px`).style("z-index", 1), v.isUnique && t.model.nodes.find(
7828
+ (_) => !_.removed && _.type.id === v.id
7785
7829
  ) !== void 0 && S(E.NotAllowed);
7786
7830
  }
7787
- }).on(A.End, (O) => {
7831
+ }).on(I.End, (O) => {
7788
7832
  if (t.canUserPerformAction(k.AddNode)) {
7789
- if (S(E.Auto), T.style("position", "relative").style("left", 0).style("top", 0).style("z-index", "auto"), p.isUnique && t.model.nodes.find(
7790
- (Wt) => !Wt.removed && Wt.type.id === p.id
7833
+ if (S(E.Auto), T.style("position", "relative").style("left", 0).style("top", 0).style("z-index", "auto"), v.isUnique && t.model.nodes.find(
7834
+ (jt) => !jt.removed && jt.type.id === v.id
7791
7835
  ) !== void 0)
7792
7836
  return;
7793
7837
  const x = t.getPointerLocationRelativeToScreen(O);
@@ -7803,26 +7847,26 @@ const xe = ({
7803
7847
  if (lt.length < 2 || isNaN(lt[0]) || isNaN(lt[1]))
7804
7848
  return;
7805
7849
  let J = [
7806
- lt[0] - p.defaultWidth / 2,
7807
- lt[1] - p.defaultHeight / 2
7850
+ lt[0] - v.defaultWidth / 2,
7851
+ lt[1] - v.defaultHeight / 2
7808
7852
  ];
7809
7853
  t.snapToGrid && (J = t.getClosestGridPoint([
7810
- J[0] - p.snapToGridOffset[0],
7811
- J[1] - p.snapToGridOffset[1]
7812
- ]), J[0] += p.snapToGridOffset[0], J[1] += p.snapToGridOffset[1]);
7813
- const Pt = t.model.nodes.getAtCoordinates(
7854
+ J[0] - v.snapToGridOffset[0],
7855
+ J[1] - v.snapToGridOffset[1]
7856
+ ]), J[0] += v.snapToGridOffset[0], J[1] += v.snapToGridOffset[1]);
7857
+ const Rt = t.model.nodes.getAtCoordinates(
7814
7858
  lt[0],
7815
7859
  lt[1]
7816
7860
  ).filter(
7817
- (Wt) => Wt.type.childrenTypes.includes(p.id)
7818
- ), Z = Ze(
7819
- Pt
7820
- ), Q = Z[Z.length - 1];
7821
- if (!p.canBeParentless && Q === void 0)
7861
+ (jt) => jt.type.childrenTypes.includes(v.id)
7862
+ ), K = We(
7863
+ Rt
7864
+ ), Q = K[K.length - 1];
7865
+ if (!v.canBeParentless && Q === void 0)
7822
7866
  return;
7823
- const ae = Q?.getLastAncestor(), Xt = new qo(
7867
+ const ae = Q?.getLastAncestor(), Wt = new Zo(
7824
7868
  t,
7825
- p,
7869
+ v,
7826
7870
  J,
7827
7871
  Q?.id,
7828
7872
  ae?.id,
@@ -7831,50 +7875,50 @@ const xe = ({
7831
7875
  u.label,
7832
7876
  u.values
7833
7877
  );
7834
- Xt.do(), t?.actionStack.add(Xt), S();
7878
+ Wt.do(), t?.actionStack.add(Wt), S();
7835
7879
  }
7836
7880
  })
7837
- ).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;
7881
+ ).append("svg").attr("class", `palette-node ${v.id}`).attr("viewBox", `0 0 ${R} ${A}`).attr("preserveAspectRatio", "none").style("position", "relative").style("left", 0).style("top", 0).style("width", `${ot}px`).style("height", `${P}px`), C = u.look || v.defaultLook;
7838
7882
  switch (C.lookType) {
7839
7883
  case "shaped-look":
7840
7884
  T.append("path").attr(
7841
7885
  "d",
7842
7886
  ye(
7843
- C.shape || Mt.Rectangle,
7887
+ C.shape || Nt.Rectangle,
7844
7888
  (C.borderThickness || 1) / 2,
7845
7889
  (C.borderThickness || 1) / 2,
7846
- p.defaultWidth,
7847
- p.defaultHeight
7890
+ v.defaultWidth,
7891
+ v.defaultHeight
7848
7892
  )
7849
7893
  ).attr("fill", C.fillColor || "#FFFFFF").attr("stroke", C.borderColor || "#000000").attr("stroke-width", `${C.borderThickness}px`);
7850
7894
  break;
7851
7895
  case "image-look":
7852
- T.append("image").attr("x", 0).attr("y", 0).attr("width", p.defaultWidth).attr("height", p.defaultHeight).attr("href", C.backgroundImage).attr("preserveAspectRatio", "none");
7896
+ T.append("image").attr("x", 0).attr("y", 0).attr("width", v.defaultWidth).attr("height", v.defaultHeight).attr("href", C.backgroundImage).attr("preserveAspectRatio", "none");
7853
7897
  break;
7854
7898
  case "stretchable-image-look":
7855
7899
  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(
7856
7900
  "width",
7857
- p.defaultWidth - C.rightMargin - C.leftMargin
7858
- ).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(
7901
+ v.defaultWidth - C.rightMargin - C.leftMargin
7902
+ ).attr("height", C.topMargin).attr("href", C.backgroundImageTop).attr("preserveAspectRatio", "none"), T.append("image").attr("x", v.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(
7859
7903
  "height",
7860
- p.defaultHeight - C.bottomMargin - C.topMargin
7904
+ v.defaultHeight - C.bottomMargin - C.topMargin
7861
7905
  ).attr("href", C.backgroundImageLeft).attr("preserveAspectRatio", "none"), T.append("image").attr("x", C.leftMargin).attr("y", C.topMargin).attr(
7862
7906
  "width",
7863
- p.defaultWidth - C.rightMargin - C.leftMargin
7907
+ v.defaultWidth - C.rightMargin - C.leftMargin
7864
7908
  ).attr(
7865
7909
  "height",
7866
- p.defaultHeight - C.bottomMargin - C.topMargin
7867
- ).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(
7910
+ v.defaultHeight - C.bottomMargin - C.topMargin
7911
+ ).attr("href", C.backgroundImageCenter).attr("preserveAspectRatio", "none"), T.append("image").attr("x", v.defaultWidth - C.rightMargin).attr("y", C.topMargin).attr("width", C.rightMargin).attr(
7868
7912
  "height",
7869
- p.defaultHeight - C.bottomMargin - C.topMargin
7870
- ).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(
7913
+ v.defaultHeight - C.bottomMargin - C.topMargin
7914
+ ).attr("href", C.backgroundImageRight).attr("preserveAspectRatio", "none"), T.append("image").attr("x", 0).attr("y", v.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", v.defaultHeight - C.bottomMargin).attr(
7871
7915
  "width",
7872
- p.defaultWidth - C.rightMargin - C.leftMargin
7873
- ).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");
7916
+ v.defaultWidth - C.rightMargin - C.leftMargin
7917
+ ).attr("height", C.bottomMargin).attr("href", C.backgroundImageBottom).attr("preserveAspectRatio", "none"), T.append("image").attr("x", v.defaultWidth - C.rightMargin).attr("y", v.defaultHeight - C.bottomMargin).attr("width", C.rightMargin).attr("height", C.bottomMargin).attr("href", C.backgroundImageBottomRight).attr("preserveAspectRatio", "none");
7874
7918
  }
7875
7919
  if (u.look === void 0) {
7876
- if (p.decorators)
7877
- for (const O of p.decorators)
7920
+ if (v.decorators)
7921
+ for (const O of v.decorators)
7878
7922
  T.append("foreignObject").attr("width", `${O.width}px`).attr("height", `${O.height}px`).attr(
7879
7923
  "transform",
7880
7924
  `translate(${O.coords[0]},${O.coords[1]})`
@@ -7882,26 +7926,26 @@ const xe = ({
7882
7926
  if (u.label) {
7883
7927
  const O = {
7884
7928
  ...V,
7885
- ...p.label,
7929
+ ...v.label,
7886
7930
  ...u.labelLook
7887
7931
  };
7888
7932
  T.append("text").attr(
7889
7933
  "transform",
7890
- `translate(${(Y(O) + p.defaultWidth) / 2},${(U(O) + p.defaultHeight) / 2})`
7934
+ `translate(${(Y(O) + v.defaultWidth) / 2},${(U(O) + v.defaultHeight) / 2})`
7891
7935
  ).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);
7892
7936
  }
7893
7937
  }
7894
- }, m = (p, u, v) => {
7938
+ }, m = (v, u, p) => {
7895
7939
  const w = c().append("div").attr(
7896
7940
  "class",
7897
- `daga-template-container ${v !== void 0 ? v : ""}`
7898
- ).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", () => {
7899
- t.connectionType = p;
7941
+ `daga-template-container ${p !== void 0 ? p : ""}`
7942
+ ).style("width", `${u.width}px`).style("height", `${u.height}px`).append("svg").attr("class", `palette-button ${v.id}`).style("position", "relative").style("left", 0).style("top", 0).style("width", "100%").style("height", "100%").on("click", () => {
7943
+ t.connectionType = v;
7900
7944
  });
7901
7945
  w.append("path").attr(
7902
7946
  "d",
7903
7947
  ye(
7904
- Mt.Rectangle,
7948
+ Nt.Rectangle,
7905
7949
  0,
7906
7950
  0,
7907
7951
  u.width,
@@ -7909,10 +7953,10 @@ const xe = ({
7909
7953
  )
7910
7954
  ).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(
7911
7955
  "transform",
7912
- `translate(${u.width / 2},${u.height / 2 + Ri})`
7956
+ `translate(${u.width / 2},${u.height / 2 + Ni})`
7913
7957
  ).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);
7914
7958
  };
7915
- return St(() => {
7959
+ return $t(() => {
7916
7960
  if (d(s.palettes[0]), o.current)
7917
7961
  switch (s.direction) {
7918
7962
  case g.Bottom:
@@ -7944,12 +7988,12 @@ const xe = ({
7944
7988
  }
7945
7989
  ),
7946
7990
  /* @__PURE__ */ M("div", { className: "daga-panel-content", children: [
7947
- s.palettes.length > 1 && /* @__PURE__ */ y("div", { className: "daga-panel-tabs", children: s.palettes.map((p) => /* @__PURE__ */ y(
7991
+ s.palettes.length > 1 && /* @__PURE__ */ y("div", { className: "daga-panel-tabs", children: s.palettes.map((v) => /* @__PURE__ */ y(
7948
7992
  "div",
7949
7993
  {
7950
- className: `daga-panel-tab ${p === e ? "daga-current-tab" : ""}`,
7951
- onClick: () => d(p),
7952
- children: p.name
7994
+ className: `daga-panel-tab ${v === e ? "daga-current-tab" : ""}`,
7995
+ onClick: () => d(v),
7996
+ children: v.name
7953
7997
  }
7954
7998
  )) }),
7955
7999
  /* @__PURE__ */ y("div", { className: "daga-palette-view" })
@@ -7957,7 +8001,7 @@ const xe = ({
7957
8001
  ]
7958
8002
  }
7959
8003
  ) });
7960
- }, Oi = ({
8004
+ }, zi = ({
7961
8005
  location: s,
7962
8006
  direction: t,
7963
8007
  centerAnimationDuration: e,
@@ -7982,63 +8026,63 @@ const xe = ({
7982
8026
  h = "width", f = "scaleX", b = "left", m = "right";
7983
8027
  break;
7984
8028
  }
7985
- const p = rt(null), u = rt(null), v = rt(null);
7986
- St(() => {
8029
+ const v = rt(null), u = rt(null), p = rt(null);
8030
+ $t(() => {
7987
8031
  L.select(
7988
- p.current
8032
+ v.current
7989
8033
  ).style(`margin-${m}`, "-1rem").style(h, "0rem").style("transform", `${f}(0)`).style("transform-origin", b);
7990
8034
  });
7991
8035
  const w = async () => {
7992
- const Z = L.select(
7993
- p.current
8036
+ const K = L.select(
8037
+ v.current
7994
8038
  );
7995
8039
  if (!c)
7996
8040
  if (d) {
7997
8041
  d = !1;
7998
- const Xt = `${4 * Z.selectChildren().size()}rem`;
7999
- Z.transition().duration(500).ease(L.easeLinear).style(h, Xt).style("transform", `${f}(1)`), setTimeout(() => {
8042
+ const Wt = `${4 * K.selectChildren().size()}rem`;
8043
+ K.transition().duration(500).ease(L.easeLinear).style(h, Wt).style("transform", `${f}(1)`), setTimeout(() => {
8000
8044
  c = !1;
8001
8045
  }, 500);
8002
8046
  } else
8003
- d = !0, Z.transition().duration(500).ease(L.easeLinear).style(h, "0rem").style("transform", `${f}(0)`), setTimeout(() => {
8047
+ d = !0, K.transition().duration(500).ease(L.easeLinear).style(h, "0rem").style("transform", `${f}(0)`), setTimeout(() => {
8004
8048
  c = !1;
8005
8049
  }, 500);
8006
- }, I = Dt($t), R = () => {
8007
- I.zoomBy(I.zoomFactor);
8050
+ }, A = Bt(It), R = () => {
8051
+ A.zoomBy(A.zoomFactor);
8008
8052
  }, P = () => {
8009
- I.zoomBy(1 / I.zoomFactor);
8010
- }, et = () => {
8011
- I.center(void 0, 1, e);
8053
+ A.zoomBy(1 / A.zoomFactor);
8054
+ }, ot = () => {
8055
+ A.center(void 0, 1, e);
8012
8056
  }, T = () => {
8013
- I.layoutFormat && I.layoutFormat in _e && _e[I.layoutFormat].apply(I.model);
8057
+ A.layoutFormat && A.layoutFormat in Oe && Oe[A.layoutFormat].apply(A.model);
8014
8058
  }, C = () => {
8015
8059
  o = !o, L.select(
8016
- v.current
8060
+ p.current
8017
8061
  ).classed("daga-on", o).classed("daga-off", !o);
8018
- const Z = I.getPriorityThresholdOptions();
8019
- Z && Z.length >= 2 && I.setPriorityThreshold(
8020
- Z[o ? 1 : 0]
8062
+ const K = A.getPriorityThresholdOptions();
8063
+ K && K.length >= 2 && A.setPriorityThreshold(
8064
+ K[o ? 1 : 0]
8021
8065
  );
8022
8066
  }, O = () => {
8023
- I.actionStack.undo();
8067
+ A.actionStack.undo();
8024
8068
  }, x = () => {
8025
- I.actionStack.redo();
8069
+ A.actionStack.redo();
8026
8070
  }, _ = () => {
8027
- I.userSelection.copyToClipboard();
8071
+ A.userSelection.copyToClipboard();
8028
8072
  }, lt = () => {
8029
- I.userSelection.cutToClipboard();
8073
+ A.userSelection.cutToClipboard();
8030
8074
  }, J = () => {
8031
- I.userSelection.pasteFromClipboard();
8032
- }, Bt = () => {
8033
- I.userSelection.removeFromModel();
8034
- }, Pt = () => {
8035
- I.multipleSelectionOn = !0, L.select(
8075
+ A.userSelection.pasteFromClipboard();
8076
+ }, Xt = () => {
8077
+ A.userSelection.removeFromModel();
8078
+ }, Rt = () => {
8079
+ A.multipleSelectionOn = !0, L.select(
8036
8080
  u.current
8037
8081
  ).classed("daga-on", !0).classed("daga-off", !1);
8038
- const Z = I.diagramEvent$.subscribe((Q) => {
8039
- Q.type === Qe.Selection && (L.select(
8082
+ const K = A.diagramEvent$.subscribe((Q) => {
8083
+ Q.type === qe.Selection && (L.select(
8040
8084
  u.current
8041
- ).classed("daga-on", !1).classed("daga-off", !0), Z.unsubscribe());
8085
+ ).classed("daga-on", !1).classed("daga-off", !0), K.unsubscribe());
8042
8086
  });
8043
8087
  };
8044
8088
  return /* @__PURE__ */ y("daga-diagram-buttons", { children: /* @__PURE__ */ M(
@@ -8046,32 +8090,32 @@ const xe = ({
8046
8090
  {
8047
8091
  className: `daga-diagram-buttons daga-${s} daga-${t}`,
8048
8092
  children: [
8049
- n && I.canUserPerformAction(k.Zoom) && /* @__PURE__ */ y("button", { className: "daga-zoom-in", onClick: R, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Zoom in" }) }),
8050
- n && I.canUserPerformAction(k.Zoom) && /* @__PURE__ */ y("button", { className: "daga-zoom-out", onClick: P, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Zoom out" }) }),
8051
- /* @__PURE__ */ M("div", { className: "daga-collapsable-buttons daga-collapsed", ref: p, children: [
8052
- 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" }) }),
8093
+ n && A.canUserPerformAction(k.Zoom) && /* @__PURE__ */ y("button", { className: "daga-zoom-in", onClick: R, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Zoom in" }) }),
8094
+ n && A.canUserPerformAction(k.Zoom) && /* @__PURE__ */ y("button", { className: "daga-zoom-out", onClick: P, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Zoom out" }) }),
8095
+ /* @__PURE__ */ M("div", { className: "daga-collapsable-buttons daga-collapsed", ref: v, children: [
8096
+ n && A.canUserPerformAction(k.Zoom) && /* @__PURE__ */ y("button", { className: "daga-center", onClick: ot, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Fit diagram to screen" }) }),
8053
8097
  a && /* @__PURE__ */ y("button", { className: "daga-undo", onClick: O, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Undo" }) }),
8054
8098
  a && /* @__PURE__ */ y("button", { className: "daga-redo", onClick: x, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Redo" }) }),
8055
8099
  i && /* @__PURE__ */ y("button", { className: "daga-copy", onClick: _, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Copy" }) }),
8056
8100
  i && /* @__PURE__ */ y("button", { className: "daga-cut", onClick: lt, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Cut" }) }),
8057
- 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" }) }),
8101
+ i && /* @__PURE__ */ y("button", { className: `daga-multiple-selection ${o ? "daga-on" : "daga-off"}`, onClick: Rt, ref: u, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Multiple selection" }) }),
8058
8102
  i && /* @__PURE__ */ y("button", { className: "daga-paste", onClick: J, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Paste" }) }),
8059
- i && /* @__PURE__ */ y("button", { className: "daga-delete", onClick: Bt, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Delete" }) }),
8060
- r && I.layoutFormat && /* @__PURE__ */ y("button", { className: "daga-layout", onClick: T, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Apply layout" }) }),
8061
- 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" }) })
8103
+ i && /* @__PURE__ */ y("button", { className: "daga-delete", onClick: Xt, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Delete" }) }),
8104
+ r && A.layoutFormat && /* @__PURE__ */ y("button", { className: "daga-layout", onClick: T, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Apply layout" }) }),
8105
+ l && /* @__PURE__ */ y("button", { className: `daga-filter ${o ? "daga-on" : "daga-off"}`, onClick: C, ref: p, children: /* @__PURE__ */ y("span", { className: "daga-tooltip", children: "Apply filter" }) })
8062
8106
  ] }),
8063
8107
  /* @__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" }) })
8064
8108
  ]
8065
8109
  }
8066
8110
  ) });
8067
- }, Fi = ({
8111
+ }, Hi = ({
8068
8112
  config: s,
8069
8113
  model: t,
8070
8114
  onCanvasCreated: e,
8071
8115
  onDiagramEvent: a,
8072
8116
  onModelChange: l
8073
8117
  }) => {
8074
- const r = new Je(), i = new oo(), n = rt(null), o = rt(void 0), d = rt(!1), c = [], [h, f] = D(void 0), [b, m] = D(void 0), p = {
8118
+ const r = new Ke(), i = new to(), n = rt(null), o = rt(void 0), d = rt(!1), c = [], [h, f] = D(void 0), [b, m] = D(void 0), v = {
8075
8119
  zoomIn: () => {
8076
8120
  },
8077
8121
  zoomOut: () => {
@@ -8089,14 +8133,14 @@ const xe = ({
8089
8133
  }, u = {
8090
8134
  refreshPalette: () => {
8091
8135
  }
8092
- }, v = new Ii(
8136
+ }, p = new Ci(
8093
8137
  (T) => f(T),
8094
8138
  (T) => m(T)
8095
8139
  ), w = {
8096
- diagramButtons: p,
8140
+ diagramButtons: v,
8097
8141
  palette: u,
8098
- propertyEditor: v
8099
- }, I = (T = !1) => ((!o.current || T) && (c.forEach((C) => C.unsubscribe()), o.current = new Se(w, s)), o.current), R = I(), P = (T) => {
8142
+ propertyEditor: p
8143
+ }, A = (T = !1) => ((!o.current || T) && (c.forEach((C) => C.unsubscribe()), o.current = new Se(w, s)), o.current), R = A(), P = (T) => {
8100
8144
  R.initView(T), c.push(
8101
8145
  R.diagramEvent$.subscribe((C) => {
8102
8146
  a?.(C);
@@ -8108,30 +8152,30 @@ const xe = ({
8108
8152
  })
8109
8153
  );
8110
8154
  };
8111
- St(() => {
8155
+ $t(() => {
8112
8156
  n.current && (d.current || (P(n.current), d.current = !0, e?.(R)));
8113
- }, [n.current]), po(() => {
8114
- n.current && (I(!0), P(n.current), e?.(R));
8115
- }, [s]), St(() => {
8157
+ }, [n.current]), fo(() => {
8158
+ n.current && (A(!0), P(n.current), e?.(R));
8159
+ }, [s]), $t(() => {
8116
8160
  t && r.import(R.model, t);
8117
8161
  }, [t]);
8118
- const et = (T, C, O) => {
8119
- if (b !== void 0 && C.editable !== !1 && !wt(T.getValue(C.name), O)) {
8162
+ const ot = (T, C, O) => {
8163
+ if (b !== void 0 && C.editable !== !1 && !Ct(T.getValue(C.name), O)) {
8120
8164
  T.setValue(C.name, O);
8121
- const x = new yt(
8165
+ const x = new kt(
8122
8166
  b.propertySet,
8123
8167
  void 0
8124
8168
  );
8125
- x.setValues(b.getValues()), x.rootElement = b.rootElement, v.valueSet = x, b.rootElement.valueSet = x, R.propertyEditorChanges$?.next();
8169
+ x.setValues(b.getValues()), x.rootElement = b.rootElement, p.valueSet = x, b.rootElement.valueSet = x, R.propertyEditorChanges$?.next();
8126
8170
  }
8127
8171
  };
8128
- return /* @__PURE__ */ y("daga-diagram", { children: /* @__PURE__ */ y(Ai.Provider, { value: s, children: /* @__PURE__ */ y($t.Provider, { value: R, children: /* @__PURE__ */ M("daga-diagram-editor", { children: [
8172
+ return /* @__PURE__ */ y("daga-diagram", { children: /* @__PURE__ */ y(Si.Provider, { value: s, children: /* @__PURE__ */ y(It.Provider, { value: R, children: /* @__PURE__ */ M("daga-diagram-editor", { children: [
8129
8173
  /* @__PURE__ */ y("div", { className: "daga-append-to", ref: n }),
8130
- /* @__PURE__ */ M($t.Provider, { value: R, children: [
8174
+ /* @__PURE__ */ M(It.Provider, { value: R, children: [
8131
8175
  s.components?.buttons !== void 0 && s.components?.buttons?.enabled !== !1 && /* @__PURE__ */ y(
8132
- Oi,
8176
+ zi,
8133
8177
  {
8134
- location: s.components?.buttons?.location || Kt.BottomRight,
8178
+ location: s.components?.buttons?.location || qt.BottomRight,
8135
8179
  direction: s.components?.buttons?.direction || g.Top,
8136
8180
  centerAnimationDuration: s.components?.buttons?.centerAnimationDuration,
8137
8181
  enableAction: s.components?.buttons?.enableAction !== !1,
@@ -8142,9 +8186,9 @@ const xe = ({
8142
8186
  }
8143
8187
  ),
8144
8188
  s.components?.palette !== void 0 && s.components?.palette?.enabled !== !1 && s.components?.palette?.sections && (s.components?.palette?.sections?.length || 0) > 0 && /* @__PURE__ */ y(
8145
- Vi,
8189
+ Pi,
8146
8190
  {
8147
- location: s.components?.palette?.location || Kt.TopLeft,
8191
+ location: s.components?.palette?.location || qt.TopLeft,
8148
8192
  direction: s.components?.palette?.direction || g.Bottom,
8149
8193
  width: s.components?.palette?.width || "12rem",
8150
8194
  height: s.components?.palette?.height,
@@ -8152,21 +8196,21 @@ const xe = ({
8152
8196
  }
8153
8197
  ),
8154
8198
  s.components?.propertyEditor !== void 0 && s.components?.propertyEditor?.enabled !== !1 && /* @__PURE__ */ y(
8155
- zi,
8199
+ Mi,
8156
8200
  {
8157
- location: s.components?.propertyEditor?.location || Kt.TopRight,
8201
+ location: s.components?.propertyEditor?.location || qt.TopRight,
8158
8202
  direction: s.components?.propertyEditor?.direction || g.Bottom,
8159
8203
  width: s.components?.propertyEditor?.width || "24rem",
8160
8204
  height: s.components?.propertyEditor?.height,
8161
8205
  title: h,
8162
8206
  valueSet: b,
8163
- onValueChange: et
8207
+ onValueChange: ot
8164
8208
  }
8165
8209
  ),
8166
- s.components?.errors !== void 0 && s.components?.errors?.enabled !== !1 && /* @__PURE__ */ y(xi, {})
8210
+ s.components?.errors !== void 0 && s.components?.errors?.enabled !== !1 && /* @__PURE__ */ y($i, {})
8167
8211
  ] })
8168
8212
  ] }) }) }) });
8169
8213
  };
8170
8214
  export {
8171
- Fi as DagaDiagram
8215
+ Hi as DagaDiagram
8172
8216
  };