@miragon/value-chain-renderer 0.7.1 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/README.md +30 -16
  2. package/dist/bounds/VcBounds.d.ts +6 -4
  3. package/dist/bounds/VcBounds.d.ts.map +1 -1
  4. package/dist/bounds/index.d.ts +1 -1
  5. package/dist/bounds/index.d.ts.map +1 -1
  6. package/dist/collaborative/CollaborativeValueChain.d.ts +5 -4
  7. package/dist/collaborative/CollaborativeValueChain.d.ts.map +1 -1
  8. package/dist/context-pad/VcContextPadProvider.d.ts +1 -1
  9. package/dist/diagram-menu/ShortcutsDialog.d.ts +1 -1
  10. package/dist/diagram-menu/menu.d.ts +3 -3
  11. package/dist/diagram-menu/shortcuts.d.ts +1 -1
  12. package/dist/draw/VcRenderer.d.ts +9 -0
  13. package/dist/draw/VcRenderer.d.ts.map +1 -1
  14. package/dist/draw/canvas2d.d.ts +3 -0
  15. package/dist/draw/canvas2d.d.ts.map +1 -0
  16. package/dist/draw/fill.d.ts +26 -0
  17. package/dist/draw/fill.d.ts.map +1 -0
  18. package/dist/draw/geometry.d.ts +15 -0
  19. package/dist/draw/geometry.d.ts.map +1 -1
  20. package/dist/draw/labelBox.d.ts +15 -0
  21. package/dist/draw/labelBox.d.ts.map +1 -0
  22. package/dist/draw/lucide.d.ts +4 -4
  23. package/dist/draw/styles.d.ts +21 -3
  24. package/dist/draw/styles.d.ts.map +1 -1
  25. package/dist/index.js +712 -487
  26. package/dist/index.js.map +1 -1
  27. package/dist/io/saveSvg.d.ts +1 -1
  28. package/dist/keyboard/VcCanvasKeys.d.ts +19 -0
  29. package/dist/keyboard/VcCanvasKeys.d.ts.map +1 -0
  30. package/dist/keyboard/index.d.ts +4 -1
  31. package/dist/keyboard/index.d.ts.map +1 -1
  32. package/dist/model/VcDiagramElementFactory.d.ts +4 -4
  33. package/dist/model/di-types.d.ts +3 -3
  34. package/dist/popup/VcColorPickerProvider.d.ts.map +1 -1
  35. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -42,55 +42,53 @@ import Ie from "diagram-js/lib/features/distribute-elements";
42
42
  import Le from "diagram-js/lib/features/keyboard";
43
43
  import Re from "diagram-js/lib/features/editor-actions";
44
44
  import ze from "diagram-js/lib/features/keyboard/KeyboardBindings";
45
- import { hasModifier as Be, isCmd as Ve, isKey as y } from "diagram-js/lib/features/keyboard/KeyboardUtil";
46
- import He from "diagram-js/lib/features/ordering/OrderingProvider";
47
- import Ue from "diagram-js/lib/features/copy-paste";
48
- import We from "diagram-js/lib/features/resize";
49
- import { MODELER_API_VERSION as Ge } from "@miragon/modeler-api";
50
- //#region src/io/saveSvg.ts
51
- var Ke = 20, qe = {
45
+ import { hasModifier as Be, isCmd as Ve, isKey as He } from "diagram-js/lib/features/keyboard/KeyboardUtil";
46
+ import Ue from "diagram-js/lib/features/ordering/OrderingProvider";
47
+ import We from "diagram-js/lib/features/copy-paste";
48
+ import Ge from "diagram-js/lib/features/resize";
49
+ import { MODELER_API_VERSION as Ke } from "@miragon/modeler-api";
50
+ // src/io/saveSvg.ts
51
+ var qe = 20, Je = {
52
52
  x: 0,
53
53
  y: 0,
54
54
  width: 800,
55
55
  height: 600
56
- }, Je = [
56
+ }, Ye = [
57
57
  "tabindex",
58
58
  "role",
59
59
  "aria-label",
60
60
  "aria-roledescription"
61
61
  ];
62
- function b(e, t) {
62
+ function Xe(e, t) {
63
63
  let n = [...e.getContainer().children].find((e) => e instanceof SVGSVGElement);
64
64
  if (!n) throw Error("No SVG found in the canvas container.");
65
- let r = t.contentBounds(Ke) ?? qe, i = n.cloneNode(!0);
66
- for (let e of Je) i.removeAttribute(e);
65
+ let r = t.contentBounds(qe) ?? Je, i = n.cloneNode(!0);
66
+ for (let e of Ye) i.removeAttribute(e);
67
67
  i.setAttribute("xmlns", "http://www.w3.org/2000/svg"), i.setAttribute("viewBox", `${r.x} ${r.y} ${r.width} ${r.height}`), i.setAttribute("width", String(r.width)), i.setAttribute("height", String(r.height));
68
68
  let a = i.querySelector(".viewport");
69
69
  return a && a.removeAttribute("transform"), { svg: `<?xml version="1.0" encoding="utf-8"?>\n${new XMLSerializer().serializeToString(i)}` };
70
70
  }
71
- //#endregion
72
- //#region src/model/di-types.ts
73
- function x(e) {
71
+ // src/model/di-types.ts
72
+ function y(e) {
74
73
  return typeof e == "object" && !!e;
75
74
  }
75
+ function b(e) {
76
+ return y(e) && (e.vcType === "step" || e.vcType === "orgUnit");
77
+ }
78
+ function x(e) {
79
+ return y(e) && e.vcType === "step";
80
+ }
76
81
  function S(e) {
77
- return x(e) && (e.vcType === "step" || e.vcType === "orgUnit");
82
+ return y(e) && e.vcType === "orgUnit";
78
83
  }
79
84
  function C(e) {
80
- return x(e) && e.vcType === "step";
85
+ return y(e) && (e.vcType === "sequence" || e.vcType === "hierarchy" || e.vcType === "assignment") && "waypoints" in e;
81
86
  }
82
87
  function w(e) {
83
- return x(e) && e.vcType === "orgUnit";
84
- }
85
- function T(e) {
86
- return x(e) && (e.vcType === "sequence" || e.vcType === "hierarchy" || e.vcType === "assignment") && "waypoints" in e;
88
+ return b(e) || C(e);
87
89
  }
88
- function E(e) {
89
- return S(e) || T(e);
90
- }
91
- //#endregion
92
- //#region src/VcBaseViewer.ts
93
- var Ye = class {
90
+ // src/VcBaseViewer.ts
91
+ var Ze = class {
94
92
  _diagram;
95
93
  _container;
96
94
  _options;
@@ -127,11 +125,11 @@ var Ye = class {
127
125
  return this.get("vcExporter").export();
128
126
  }
129
127
  saveSVG() {
130
- return b(this.get("canvas"), this.get("vcBounds"));
128
+ return Xe(this.get("canvas"), this.get("vcBounds"));
131
129
  }
132
130
  fitViewport() {
133
131
  let e = this.get("canvas");
134
- this.get("elementRegistry").getAll().some(E) && (e.zoom("fit-viewport"), e.zoom() > 1 && e.zoom(1));
132
+ this.get("elementRegistry").getAll().some(w) && (e.zoom("fit-viewport"), e.zoom() > 1 && e.zoom(1));
135
133
  }
136
134
  clear() {
137
135
  this.get("vcImporter").clear(), this.getOptional("commandStack")?.clear();
@@ -160,7 +158,7 @@ var Ye = class {
160
158
  }
161
159
  _createContainer(e) {
162
160
  let t = e.container ?? document.createElement("div");
163
- return t.classList.add("vc-container"), t.style.width = Xe(e.width ?? "100%"), t.style.height = Xe(e.height ?? (e.container ? "100%" : "600px")), t;
161
+ return t.classList.add("vc-container"), t.style.width = Qe(e.width ?? "100%"), t.style.height = Qe(e.height ?? (e.container ? "100%" : "600px")), t;
164
162
  }
165
163
  _ensureDiagram() {
166
164
  if (!this._diagram) {
@@ -179,12 +177,11 @@ var Ye = class {
179
177
  return this._diagram;
180
178
  }
181
179
  };
182
- function Xe(e) {
180
+ function Qe(e) {
183
181
  return typeof e == "number" ? `${e}px` : e;
184
182
  }
185
- //#endregion
186
- //#region src/model/VcElementFactory.ts
187
- var Ze = class {
183
+ // src/model/VcElementFactory.ts
184
+ var $e = class {
188
185
  elementFactory;
189
186
  static $inject = ["elementFactory"];
190
187
  constructor(e) {
@@ -233,18 +230,18 @@ var Ze = class {
233
230
  vcLabel: e
234
231
  });
235
232
  }
236
- }, Qe = "0123456789abcdefghijklmnopqrstuvwxyz", $e = 8, et = {
233
+ }, et = "0123456789abcdefghijklmnopqrstuvwxyz", tt = 8, nt = {
237
234
  step: "step",
238
235
  orgUnit: "org",
239
236
  sequence: "sequence",
240
237
  hierarchy: "hierarchy",
241
238
  assignment: "assignment"
242
239
  };
243
- function tt() {
244
- let e = crypto.getRandomValues(new Uint8Array($e));
245
- return Array.from(e, (e) => Qe[e % 36]).join("");
240
+ function rt() {
241
+ let e = crypto.getRandomValues(new Uint8Array(tt));
242
+ return Array.from(e, (e) => et[e % 36]).join("");
246
243
  }
247
- var nt = class extends ee {
244
+ var it = class extends ee {
248
245
  elementRegistry;
249
246
  static $inject = ["elementRegistry"];
250
247
  constructor(e) {
@@ -263,52 +260,21 @@ var nt = class extends ee {
263
260
  }
264
261
  }
265
262
  unusedId(e, t) {
266
- let n = t?.vcType, r = typeof n == "string" && et[n] || e, i;
263
+ let n = t?.vcType, r = typeof n == "string" && nt[n] || e, i;
267
264
  do
268
- i = `${r}_${tt()}`;
265
+ i = `${r}_${rt()}`;
269
266
  while (this.elementRegistry.get(i));
270
267
  return i;
271
268
  }
272
- }, rt = {
273
- elementFactory: ["type", nt],
274
- vcElementFactory: ["type", Ze]
275
- };
276
- //#endregion
277
- //#region src/draw/geometry.ts
278
- function D(e, t) {
279
- return Math.min(t / 2, .4 * e);
280
- }
281
- function it(e, t) {
282
- return O(0, 0, e, t);
283
- }
284
- function at(e, t) {
285
- let n = D(e, t);
286
- return Math.max(7, n - 5);
287
- }
288
- function O(e, t, n, r) {
289
- let i = D(n, r), a = t + r / 2;
290
- return [
291
- `M${e},${t}`,
292
- `L${e + n - i},${t}`,
293
- `L${e + n},${a}`,
294
- `L${e + n - i},${t + r}`,
295
- `L${e},${t + r}`,
296
- `L${e + i},${a}`,
297
- "Z"
298
- ].join("");
269
+ }, at = {
270
+ elementFactory: ["type", it],
271
+ vcElementFactory: ["type", $e]
272
+ }, ot;
273
+ function st() {
274
+ return ot ??= typeof document < "u" && typeof CanvasRenderingContext2D < "u" ? document.createElement("canvas").getContext("2d") : null, ot;
299
275
  }
300
- function k(e, t, n, r) {
301
- let i = n / 2, a = r / 2, o = e + i;
302
- return [
303
- `M${o},${t}`,
304
- `A${i},${a} 0 0 1 ${o},${t + r}`,
305
- `A${i},${a} 0 0 1 ${o},${t}`,
306
- "Z"
307
- ].join("");
308
- }
309
- //#endregion
310
- //#region src/theme/cd-tokens.generated.json
311
- var ot = {
276
+ // src/theme/cd-tokens.generated.json
277
+ var T = {
312
278
  "--cd-ui-grund": "#F9F7F7",
313
279
  "--cd-ui-flaeche": "#FFFFFF",
314
280
  "--cd-ui-flaeche-hoch": "#FFFFFF",
@@ -335,36 +301,266 @@ var ot = {
335
301
  "--cd-ui-wortmarke": "#00E676",
336
302
  "--cd-ui-backdrop": "rgba(29, 29, 29, 0.42)",
337
303
  "--cd-ui-chrome-deckkraft": "84%"
338
- }, A = {
339
- ink: ot["--cd-ui-text"],
340
- fill: ot["--cd-ui-plot"]
341
- }, j = {
304
+ }, E = {
305
+ "--cd-blau": "#335DE5",
306
+ "--cd-gruen": "#00E676",
307
+ "--cd-grau": "#F9F7F7",
308
+ "--cd-schwarz": "#1D1D1D",
309
+ "--cd-weiss": "#FFFFFF",
310
+ "--cd-blau-link": "#2B50D4",
311
+ "--cd-blau-hell": "#6B8AFF",
312
+ "--cd-success": "#00E676",
313
+ "--cd-success-soft": "#DAFBEB",
314
+ "--cd-success-hell": "#00E676",
315
+ "--cd-warning": "#FFB000",
316
+ "--cd-warning-soft": "#FFF1D2",
317
+ "--cd-warning-hell": "#FFB000",
318
+ "--cd-danger": "#CD1839",
319
+ "--cd-danger-soft": "#FBEEF0",
320
+ "--cd-danger-hell": "#FB6D73",
321
+ "--cd-info": "#335DE5",
322
+ "--cd-info-soft": "#EEF1FD",
323
+ "--cd-info-hell": "#6B8AFF",
324
+ "--cd-linie": "#E6E2E2",
325
+ "--cd-kontur": "#8F8A8A",
326
+ "--cd-text-leise": "#6B6666"
327
+ }, D = {
328
+ ink: T["--cd-ui-text"],
329
+ fill: T["--cd-ui-plot"],
330
+ surround: T["--cd-ui-grund"]
331
+ }, O = {
342
332
  family: "'Geist Variable', 'Geist', ui-sans-serif, system-ui, sans-serif",
343
333
  size: 12,
344
334
  lineHeight: 1.2
345
- }, st = [
335
+ }, ct = [
346
336
  { label: "Default" },
347
337
  {
348
338
  label: "Blue",
349
- color: "hsl(205, 100%, 45%)"
339
+ color: E["--cd-blau"]
350
340
  },
351
341
  {
352
342
  label: "Green",
353
- color: "hsl(150, 86%, 34%)"
343
+ color: E["--cd-gruen"]
354
344
  },
355
345
  {
356
- label: "Orange",
357
- color: "hsl(29, 89%, 44%)"
346
+ label: "Gray",
347
+ color: E["--cd-grau"]
358
348
  },
359
349
  {
360
- label: "Red",
361
- color: "hsl(360, 100%, 45%)"
350
+ label: "Black",
351
+ color: E["--cd-schwarz"]
352
+ },
353
+ {
354
+ label: "White",
355
+ color: E["--cd-weiss"]
362
356
  },
363
357
  {
364
- label: "Purple",
365
- color: "hsl(287, 65%, 44%)"
358
+ label: "Amber",
359
+ color: E["--cd-warning"]
360
+ },
361
+ {
362
+ label: "Red",
363
+ color: E["--cd-danger"]
364
+ }
365
+ ], k = {
366
+ dark: E["--cd-schwarz"],
367
+ light: E["--cd-weiss"]
368
+ };
369
+ // src/draw/fill.ts
370
+ function lt(e) {
371
+ let t = e === void 0 ? void 0 : ft(e);
372
+ if (!t) return {
373
+ fill: D.fill,
374
+ label: D.ink,
375
+ halo: D.fill
376
+ };
377
+ let n = xt(t);
378
+ return {
379
+ fill: _t(t),
380
+ label: yt(n),
381
+ halo: vt(n)
382
+ };
383
+ }
384
+ var ut = {
385
+ label: D.ink,
386
+ halo: D.surround
387
+ }, dt = /* @__PURE__ */ new Map();
388
+ function ft(e) {
389
+ return dt.has(e) || dt.set(e, pt(e)), dt.get(e);
390
+ }
391
+ function pt(e) {
392
+ let t = st();
393
+ if (!t) return gt(e);
394
+ let n = mt(t, e);
395
+ if (n !== void 0) return gt(n) ?? ht(t, n);
396
+ }
397
+ function mt(e, t) {
398
+ e.fillStyle = D.ink, e.fillStyle = t;
399
+ let n = String(e.fillStyle);
400
+ return e.fillStyle = D.fill, e.fillStyle = t, String(e.fillStyle) === n ? n : void 0;
401
+ }
402
+ function ht(e, t) {
403
+ e.clearRect(0, 0, 1, 1), e.fillStyle = t, e.fillRect(0, 0, 1, 1);
404
+ let [n = 0, r = 0, i = 0, a = 0] = e.getImageData(0, 0, 1, 1).data;
405
+ return e.clearRect(0, 0, 1, 1), [
406
+ n,
407
+ r,
408
+ i,
409
+ Number((a / 255).toFixed(3))
410
+ ];
411
+ }
412
+ function gt(e) {
413
+ let t = /^#([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(e.trim())?.[1];
414
+ if (t) {
415
+ let e = t.length <= 4 ? [...t].map((e) => e + e).join("") : t, n = (t) => parseInt(e.slice(t * 2, t * 2 + 2), 16);
416
+ return [
417
+ n(0),
418
+ n(1),
419
+ n(2),
420
+ e.length === 8 ? n(3) / 255 : 1
421
+ ];
422
+ }
423
+ let n = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+)\s*)?\)$/i.exec(e.trim());
424
+ if (n) {
425
+ let [, e, t, r, i] = n;
426
+ return [
427
+ Number(e),
428
+ Number(t),
429
+ Number(r),
430
+ i === void 0 ? 1 : Number(i)
431
+ ];
432
+ }
433
+ }
434
+ function _t([e, t, n, r]) {
435
+ return r < 1 ? `rgba(${e}, ${t}, ${n}, ${Number(r.toFixed(3))})` : vt([
436
+ e,
437
+ t,
438
+ n
439
+ ]);
440
+ }
441
+ function vt(e) {
442
+ return `#${e.map((e) => Math.round(e).toString(16).padStart(2, "0")).join("")}`.toUpperCase();
443
+ }
444
+ function yt(e) {
445
+ let t = Ct(e, bt(k.dark));
446
+ return Ct(e, bt(k.light)) > t ? k.light : k.dark;
447
+ }
448
+ function bt(e) {
449
+ let [t, n, r] = gt(e) ?? [
450
+ 0,
451
+ 0,
452
+ 0
453
+ ];
454
+ return [
455
+ t,
456
+ n,
457
+ r
458
+ ];
459
+ }
460
+ function xt([e, t, n, r]) {
461
+ let i = bt(D.fill), a = (e, t) => e * r + t * (1 - r);
462
+ return [
463
+ a(e, i[0]),
464
+ a(t, i[1]),
465
+ a(n, i[2])
466
+ ];
467
+ }
468
+ function St([e, t, n]) {
469
+ let r = (e) => {
470
+ let t = e / 255;
471
+ return t <= .04045 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
472
+ };
473
+ return .2126 * r(e) + .7152 * r(t) + .0722 * r(n);
474
+ }
475
+ function Ct(e, t) {
476
+ let [n, r] = [St(e), St(t)].sort((e, t) => t - e);
477
+ return (n + .05) / (r + .05);
478
+ }
479
+ // src/draw/geometry.ts
480
+ function A(e, t) {
481
+ return Math.min(t / 2, .4 * e);
482
+ }
483
+ function wt(e, t) {
484
+ return j(0, 0, e, t);
485
+ }
486
+ function Tt(e, t) {
487
+ let n = A(e, t);
488
+ return Math.max(7, n - 5);
489
+ }
490
+ function j(e, t, n, r) {
491
+ let i = A(n, r), a = t + r / 2;
492
+ return [
493
+ `M${e},${t}`,
494
+ `L${e + n - i},${t}`,
495
+ `L${e + n},${a}`,
496
+ `L${e + n - i},${t + r}`,
497
+ `L${e},${t + r}`,
498
+ `L${e + i},${a}`,
499
+ "Z"
500
+ ].join("");
501
+ }
502
+ function M(e, t, n, r) {
503
+ let i = n / 2, a = r / 2, o = e + i;
504
+ return [
505
+ `M${o},${t}`,
506
+ `A${i},${a} 0 0 1 ${o},${t + r}`,
507
+ `A${i},${a} 0 0 1 ${o},${t}`,
508
+ "Z"
509
+ ].join("");
510
+ }
511
+ function Et(e, t, n) {
512
+ let r = t / 2;
513
+ if (!(r > 0) || n < 0 || n > t) return;
514
+ let i = A(e, t), a = i * (1 - Math.abs(n - r) / r);
515
+ return [a, e - i + a];
516
+ }
517
+ function Dt(e, t, n) {
518
+ let r = e / 2, i = t / 2;
519
+ if (!(i > 0)) return;
520
+ let a = (n - i) / i;
521
+ if (Math.abs(a) > 1) return;
522
+ let o = r * Math.sqrt(1 - a * a);
523
+ return [r - o, r + o];
524
+ }
525
+ function Ot(e, t, n, r) {
526
+ let i = r.y + r.height / 2, a = e ? Dt(t, n, i) : Et(t, n, i);
527
+ return a ? (Math.min(r.x + r.width, a[1]) - Math.max(r.x, a[0])) * 2 >= r.width : !1;
528
+ }
529
+ // src/draw/labelBox.ts
530
+ var kt = `${O.size}px ${O.family}`;
531
+ function At(e) {
532
+ let t = st();
533
+ if (!t) return [];
534
+ t.font = kt;
535
+ let n = [];
536
+ for (let r of e.querySelectorAll("tspan")) {
537
+ let e = r.textContent ?? "";
538
+ if (!e.trim()) continue;
539
+ let i = Number(r.getAttribute("x")), a = Number(r.getAttribute("y")), o = t.measureText(e), s = i - Math.max(0, o.actualBoundingBoxLeft), c = i + Math.max(o.width, o.actualBoundingBoxRight), l = a - Math.max(o.fontBoundingBoxAscent, o.actualBoundingBoxAscent), u = a + Math.max(o.fontBoundingBoxDescent, o.actualBoundingBoxDescent);
540
+ s <= c && l <= u && n.push({
541
+ element: r,
542
+ box: {
543
+ x: s,
544
+ y: l,
545
+ width: c - s,
546
+ height: u - l
547
+ }
548
+ });
366
549
  }
367
- ], ct = 1500, lt = "M 1 5 L 11 10 L 1 15 Z", ut = 0, dt = class extends te {
550
+ return n;
551
+ }
552
+ function jt(e) {
553
+ if (e.length === 0) return;
554
+ let t = Math.min(...e.map(({ box: e }) => e.x)), n = Math.min(...e.map(({ box: e }) => e.y)), r = Math.max(...e.map(({ box: e }) => e.x + e.width)), i = Math.max(...e.map(({ box: e }) => e.y + e.height));
555
+ return {
556
+ x: t,
557
+ y: n,
558
+ width: r - t,
559
+ height: i - n
560
+ };
561
+ }
562
+ // src/draw/VcRenderer.ts
563
+ var Mt = 1500, Nt = "M 1 5 L 11 10 L 1 15 Z", Pt = 0, Ft = class extends te {
368
564
  elementRegistry;
369
565
  graphicsFactory;
370
566
  static $inject = [
@@ -373,39 +569,40 @@ var ot = {
373
569
  "graphicsFactory"
374
570
  ];
375
571
  textUtil = new ne({ style: {
376
- fontFamily: j.family,
377
- fontSize: j.size,
572
+ fontFamily: O.family,
573
+ fontSize: O.size,
378
574
  fontWeight: "normal",
379
- lineHeight: j.lineHeight
575
+ lineHeight: O.lineHeight
380
576
  } });
381
- markerSuffix = `${ut += 1}`;
577
+ markerSuffix = `${Pt += 1}`;
578
+ labelBoxes = /* @__PURE__ */ new WeakMap();
382
579
  constructor(e, t, n) {
383
- super(e, ct), this.elementRegistry = t, this.graphicsFactory = n, this.relayoutLabelsWhenTheFontArrives(e);
580
+ super(e, Mt), this.elementRegistry = t, this.graphicsFactory = n, this.relayoutLabelsWhenTheFontArrives(e);
384
581
  }
385
582
  relayoutLabelsWhenTheFontArrives(e) {
386
- let t = typeof document > "u" ? void 0 : document.fonts, n = `${j.size}px ${j.family}`;
583
+ let t = typeof document > "u" ? void 0 : document.fonts, n = `${O.size}px ${O.family}`;
387
584
  if (!t || t.check(n)) return;
388
585
  let r = !1;
389
586
  e.on("diagram.destroy", () => {
390
587
  r = !0;
391
588
  }), t.load(n).then((e) => {
392
- if (!(r || e.length === 0)) for (let e of this.elementRegistry.getAll()) S(e) && e.vcLabel && this.graphicsFactory.update("shape", e, this.elementRegistry.getGraphics(e));
589
+ if (!(r || e.length === 0)) for (let e of this.elementRegistry.getAll()) b(e) && e.vcLabel && this.graphicsFactory.update("shape", e, this.elementRegistry.getGraphics(e));
393
590
  }, () => void 0);
394
591
  }
395
592
  canRender(e) {
396
- return S(e) || T(e);
593
+ return b(e) || C(e);
397
594
  }
398
595
  drawShape(e, t) {
399
- let n = t, r = n.color ?? A.ink, i = w(n), a = h("path");
596
+ let n = t, r = lt(n.color), i = S(n), a = h("path");
400
597
  if (m(a, {
401
- d: i ? k(0, 0, n.width, n.height) : it(n.width, n.height),
402
- fill: A.fill,
403
- stroke: r,
598
+ d: i ? M(0, 0, n.width, n.height) : wt(n.width, n.height),
599
+ fill: r.fill,
600
+ stroke: D.ink,
404
601
  "stroke-width": 2,
405
602
  "stroke-linecap": "round",
406
603
  "stroke-linejoin": "round"
407
- }), p(e, a), n.vcLabel) {
408
- let t = i ? 12 : at(n.width, n.height), a = this.textUtil.createText(n.vcLabel, {
604
+ }), p(e, a), this.labelBoxes.delete(t), n.vcLabel) {
605
+ let a = i ? 12 : Tt(n.width, n.height), o = this.textUtil.createText(n.vcLabel, {
409
606
  box: {
410
607
  width: n.width,
411
608
  height: n.height
@@ -414,17 +611,39 @@ var ot = {
414
611
  padding: {
415
612
  top: 7,
416
613
  bottom: 7,
417
- left: t,
418
- right: t
614
+ left: a,
615
+ right: a
419
616
  },
420
- style: { fill: r }
617
+ style: {
618
+ fill: r.label,
619
+ stroke: r.halo,
620
+ "stroke-width": 3,
621
+ "stroke-linejoin": "round",
622
+ "paint-order": "stroke"
623
+ }
624
+ });
625
+ p(e, o);
626
+ let s = At(o);
627
+ for (let e of s) Ot(i, n.width, n.height, e.box) || m(e.element, {
628
+ fill: ut.label,
629
+ stroke: ut.halo
421
630
  });
422
- p(e, a);
631
+ let c = jt(s);
632
+ c && this.labelBoxes.set(t, c);
423
633
  }
424
634
  return a;
425
635
  }
636
+ labelBounds(e) {
637
+ let t = this.labelBoxes.get(e);
638
+ if (t) return {
639
+ x: e.x + t.x,
640
+ y: e.y + t.y,
641
+ width: t.width,
642
+ height: t.height
643
+ };
644
+ }
426
645
  drawConnection(e, t) {
427
- let n = t, r = A.ink, i = {
646
+ let n = t, r = D.ink, i = {
428
647
  stroke: r,
429
648
  "stroke-width": 2,
430
649
  "stroke-linecap": "round",
@@ -439,7 +658,7 @@ var ot = {
439
658
  return p(e, a), a;
440
659
  }
441
660
  getShapePath(e) {
442
- return w(e) ? k(e.x, e.y, e.width, e.height) : O(e.x, e.y, e.width, e.height);
661
+ return S(e) ? M(e.x, e.y, e.width, e.height) : j(e.x, e.y, e.width, e.height);
443
662
  }
444
663
  getConnectionPath(e) {
445
664
  let [t, ...n] = e.waypoints;
@@ -462,7 +681,7 @@ var ot = {
462
681
  });
463
682
  let a = h("path");
464
683
  m(a, {
465
- d: lt,
684
+ d: Nt,
466
685
  fill: t,
467
686
  stroke: t,
468
687
  "stroke-width": 1,
@@ -471,29 +690,33 @@ var ot = {
471
690
  }
472
691
  return `url(#${n})`;
473
692
  }
474
- }, ft = {
693
+ }, N = {
475
694
  __init__: ["vcRenderer"],
476
- vcRenderer: ["type", dt]
477
- }, pt = class {
695
+ vcRenderer: ["type", Ft]
696
+ }, It = class {
478
697
  elementRegistry;
479
- static $inject = ["elementRegistry"];
480
- constructor(e) {
481
- this.elementRegistry = e;
698
+ vcRenderer;
699
+ static $inject = ["elementRegistry", "vcRenderer"];
700
+ constructor(e, t) {
701
+ this.elementRegistry = e, this.vcRenderer = t;
482
702
  }
483
703
  isEmpty() {
484
- return !this.elementRegistry.getAll().some(S);
704
+ return !this.elementRegistry.getAll().some(b);
485
705
  }
486
706
  contentBounds(e = 0) {
487
707
  if (this.isEmpty()) return;
488
- let t = this.elementRegistry.filter(E), { x: n, y: r, width: i, height: a } = ie(t);
708
+ let t = this.elementRegistry.filter(w), n = t.filter(b).flatMap((e) => this.vcRenderer.labelBounds(e) ?? []), { x: r, y: i, width: a, height: o } = ie([...t, ...n]);
489
709
  return {
490
- x: n - e,
491
- y: r - e,
492
- width: i + 2 * e,
493
- height: a + 2 * e
710
+ x: r - e,
711
+ y: i - e,
712
+ width: a + 2 * e,
713
+ height: o + 2 * e
494
714
  };
495
715
  }
496
- }, mt = { vcBounds: ["type", pt] }, M = "vc-root", ht = 20, gt = .001, _t = class {
716
+ }, Lt = {
717
+ __depends__: [N],
718
+ vcBounds: ["type", It]
719
+ }, P = "vc-root", Rt = 20, zt = .001, Bt = class {
497
720
  canvas;
498
721
  elementFactory;
499
722
  vcElementFactory;
@@ -549,19 +772,19 @@ var ot = {
549
772
  let e = new Set(this.canvas.getRootElements());
550
773
  for (let t of [...this.elementRegistry.getAll()]) if (e.has(t)) t.id === "vc-root" && (t.businessObject = void 0);
551
774
  else try {
552
- T(t) ? this.canvas.removeConnection(t) : S(t) && this.canvas.removeShape(t);
775
+ C(t) ? this.canvas.removeConnection(t) : b(t) && this.canvas.removeShape(t);
553
776
  } catch {}
554
777
  }
555
778
  diagramRoot() {
556
- let e = this.elementRegistry.get(M);
557
- e || (e = this.elementFactory.createRoot({ id: M }), this.canvas.setRootElement(e));
779
+ let e = this.elementRegistry.get(P);
780
+ e || (e = this.elementFactory.createRoot({ id: P }), this.canvas.setRootElement(e));
558
781
  for (let t of this.canvas.getRootElements()) t !== e && this.canvas.removeRootElement(t);
559
782
  return e;
560
783
  }
561
784
  fitToContent() {
562
785
  let { width: e, height: t } = this.canvas.getSize();
563
786
  if (!(e > 0 && t > 0)) return;
564
- let n = this.vcBounds.contentBounds(ht);
787
+ let n = this.vcBounds.contentBounds(Rt);
565
788
  if (!n) {
566
789
  this.canvas.viewbox({
567
790
  x: 0,
@@ -571,7 +794,7 @@ var ot = {
571
794
  });
572
795
  return;
573
796
  }
574
- let r = Math.max(Math.min(e / n.width, t / n.height, 1), gt);
797
+ let r = Math.max(Math.min(e / n.width, t / n.height, 1), zt);
575
798
  this.canvas.viewbox({
576
799
  x: n.x + n.width / 2 - e / 2 / r,
577
800
  y: n.y + n.height / 2 - t / 2 / r,
@@ -579,7 +802,7 @@ var ot = {
579
802
  height: t / r
580
803
  });
581
804
  }
582
- }, vt = class {
805
+ }, Vt = class {
583
806
  elementRegistry;
584
807
  static $inject = ["elementRegistry"];
585
808
  constructor(e) {
@@ -588,7 +811,7 @@ var ot = {
588
811
  export() {
589
812
  let e = [], n = [];
590
813
  for (let t of this.elementRegistry.getAll()) if (t.id !== "vc-root") {
591
- if (T(t)) {
814
+ if (C(t)) {
592
815
  if (!t.source || !t.target) continue;
593
816
  let e = t.businessObject;
594
817
  n.push({
@@ -602,7 +825,7 @@ var ot = {
602
825
  y: e.y
603
826
  }))
604
827
  });
605
- } else if (S(t)) {
828
+ } else if (b(t)) {
606
829
  let n = t.businessObject, r = n ? c(n) : {}, i = {
607
830
  x: t.x,
608
831
  y: t.y,
@@ -644,13 +867,12 @@ var ot = {
644
867
  });
645
868
  }
646
869
  rootData() {
647
- return this.elementRegistry.get(M)?.businessObject;
870
+ return this.elementRegistry.get(P)?.businessObject;
648
871
  }
649
872
  };
650
- //#endregion
651
- //#region src/io/png.ts
652
- async function yt(e, t = 2) {
653
- let { width: n, height: r } = bt(e), i = URL.createObjectURL(new Blob([e], { type: "image/svg+xml" }));
873
+ // src/io/png.ts
874
+ async function Ht(e, t = 2) {
875
+ let { width: n, height: r } = Ut(e), i = URL.createObjectURL(new Blob([e], { type: "image/svg+xml" }));
654
876
  try {
655
877
  let e = new Image();
656
878
  e.width = n, e.height = r, await new Promise((t, n) => {
@@ -660,7 +882,7 @@ async function yt(e, t = 2) {
660
882
  a.width = Math.round(n * t), a.height = Math.round(r * t);
661
883
  let o = a.getContext("2d");
662
884
  if (!o) throw Error("Canvas 2D context not available.");
663
- o.fillStyle = A.fill, o.fillRect(0, 0, a.width, a.height), o.drawImage(e, 0, 0, a.width, a.height);
885
+ o.fillStyle = D.fill, o.fillRect(0, 0, a.width, a.height), o.drawImage(e, 0, 0, a.width, a.height);
664
886
  let s = await new Promise((e) => a.toBlob(e, "image/png"));
665
887
  if (!s) throw Error("PNG generation failed.");
666
888
  return s;
@@ -668,34 +890,33 @@ async function yt(e, t = 2) {
668
890
  URL.revokeObjectURL(i);
669
891
  }
670
892
  }
671
- function bt(e) {
893
+ function Ut(e) {
672
894
  let t = /width="(\d+(?:\.\d+)?)"/.exec(e), n = /height="(\d+(?:\.\d+)?)"/.exec(e);
673
895
  return {
674
896
  width: t ? Number(t[1]) : 1e3,
675
897
  height: n ? Number(n[1]) : 700
676
898
  };
677
899
  }
678
- function xt(e) {
900
+ function Wt(e) {
679
901
  return new Promise((t, n) => {
680
902
  let r = new FileReader();
681
903
  r.onload = () => t(String(r.result).split(",")[1] ?? ""), r.onerror = () => n(/* @__PURE__ */ Error("Could not read the export blob.")), r.readAsDataURL(e);
682
904
  });
683
905
  }
684
- //#endregion
685
- //#region src/io/index.ts
686
- var St = {
687
- __depends__: [mt],
688
- vcImporter: ["type", _t],
689
- vcExporter: ["type", vt]
690
- }, Ct = class extends Ye {
906
+ // src/io/index.ts
907
+ var Gt = {
908
+ __depends__: [Lt],
909
+ vcImporter: ["type", Bt],
910
+ vcExporter: ["type", Vt]
911
+ }, Kt = class extends Ze {
691
912
  _getModules() {
692
913
  return [
693
- rt,
694
- ft,
695
- St
914
+ at,
915
+ N,
916
+ Gt
696
917
  ];
697
918
  }
698
- }, N = class extends Ct {
919
+ }, F = class extends Kt {
699
920
  _getModules() {
700
921
  return [
701
922
  ...super._getModules(),
@@ -704,31 +925,30 @@ var St = {
704
925
  se
705
926
  ];
706
927
  }
707
- }, wt = class {
928
+ }, qt = class {
708
929
  execute(e) {
709
930
  let { element: t, properties: n } = e, r = t, i = {};
710
- for (let e of Object.keys(n)) i[e] = r[e], Tt(r, e, n[e]);
931
+ for (let e of Object.keys(n)) i[e] = r[e], Jt(r, e, n[e]);
711
932
  return e.oldProperties = i, [t];
712
933
  }
713
934
  revert(e) {
714
935
  let { element: t, oldProperties: n } = e, r = t;
715
- if (n) for (let e of Object.keys(n)) Tt(r, e, n[e]);
936
+ if (n) for (let e of Object.keys(n)) Jt(r, e, n[e]);
716
937
  return [t];
717
938
  }
718
939
  };
719
- function Tt(e, t, n) {
940
+ function Jt(e, t, n) {
720
941
  n === void 0 ? delete e[t] : e[t] = n;
721
942
  }
722
- //#endregion
723
- //#region src/modeling/VcModeling.ts
724
- var Et = "element.updateProperties", Dt = class {
943
+ // src/modeling/VcModeling.ts
944
+ var Yt = "element.updateProperties", Xt = class {
725
945
  commandStack;
726
946
  static $inject = ["commandStack"];
727
947
  constructor(e) {
728
- this.commandStack = e, e.registerHandler(Et, wt);
948
+ this.commandStack = e, e.registerHandler(Yt, qt);
729
949
  }
730
950
  updateProperties(e, t) {
731
- this.commandStack.execute(Et, {
951
+ this.commandStack.execute(Yt, {
732
952
  element: e,
733
953
  properties: t
734
954
  });
@@ -742,7 +962,7 @@ var Et = "element.updateProperties", Dt = class {
742
962
  setConnectionType(e, t) {
743
963
  t !== e.vcType && this.updateProperties(e, { vcType: t });
744
964
  }
745
- }, Ot = 25, kt = 10, At = 10, jt = class extends ve {
965
+ }, Zt = 25, Qt = 10, $t = 10, en = class extends ve {
746
966
  connectionDocking;
747
967
  static $inject = ["connectionDocking"];
748
968
  constructor(e) {
@@ -754,7 +974,7 @@ var Et = "element.updateProperties", Dt = class {
754
974
  x: e.x,
755
975
  y: e.y
756
976
  })) ?? [];
757
- let i = It(e) ? this.hierarchyWaypoints(n, r, t) : this.sequenceWaypoints(e, n, r, t), a = {
977
+ let i = on(e) ? this.hierarchyWaypoints(n, r, t) : this.sequenceWaypoints(e, n, r, t), a = {
758
978
  ...e,
759
979
  source: n,
760
980
  target: r,
@@ -763,9 +983,9 @@ var Et = "element.updateProperties", Dt = class {
763
983
  try {
764
984
  o = this.connectionDocking.getCroppedWaypoints(a, n, r);
765
985
  } catch {}
766
- if (!Lt(o)) {
986
+ if (!sn(o)) {
767
987
  let e = [g(n), g(r)];
768
- return Lt(e) ? e : [];
988
+ return sn(e) ? e : [];
769
989
  }
770
990
  return o;
771
991
  }
@@ -783,9 +1003,9 @@ var Et = "element.updateProperties", Dt = class {
783
1003
  hierarchyWaypoints(e, t, n) {
784
1004
  let r = g(e), i = g(t);
785
1005
  if (t.y >= e.y + e.height) {
786
- let n = Nt(e), a = n.length ? n : [t];
787
- if (Pt(a, e)) return _(ye(r, i, "v:v"));
788
- let o = e.y + e.height, s = Math.min(...a.map((e) => e.y)), c = Math.max(o + kt, (o + s) / 2), l = Math.min(...a.map((e) => e.x)), u = r.x <= l - 10 ? r.x : l - Ot;
1006
+ let n = nn(e), a = n.length ? n : [t];
1007
+ if (rn(a, e)) return _(ye(r, i, "v:v"));
1008
+ let o = e.y + e.height, s = Math.min(...a.map((e) => e.y)), c = Math.max(o + Qt, (o + s) / 2), l = Math.min(...a.map((e) => e.x)), u = r.x <= l - 10 ? r.x : l - Zt;
789
1009
  return _([
790
1010
  r,
791
1011
  {
@@ -806,42 +1026,41 @@ var Et = "element.updateProperties", Dt = class {
806
1026
  return _(be(e, t, r, i, { preferredLayouts: ["v:v"] }));
807
1027
  }
808
1028
  };
809
- function Mt(e) {
1029
+ function tn(e) {
810
1030
  return {
811
- min: e.x + At,
812
- max: e.x + e.width - D(e.width, e.height) - At
1031
+ min: e.x + $t,
1032
+ max: e.x + e.width - A(e.width, e.height) - $t
813
1033
  };
814
1034
  }
815
- function Nt(e) {
816
- return (e.outgoing ?? []).filter((e) => It(e)).map((e) => e.target).filter((e) => !!e);
1035
+ function nn(e) {
1036
+ return (e.outgoing ?? []).filter((e) => on(e)).map((e) => e.target).filter((e) => !!e);
817
1037
  }
818
- function Pt(e, t) {
1038
+ function rn(e, t) {
819
1039
  if (!e.length) return !1;
820
1040
  if (e.length >= 2) {
821
1041
  let t = e.map((e) => e.y);
822
- return Math.max(...t) - Math.min(...t) <= Ft;
1042
+ return Math.max(...t) - Math.min(...t) <= an;
823
1043
  }
824
- let n = e[0], r = n.x + n.width / 2, i = Mt(t);
1044
+ let n = e[0], r = n.x + n.width / 2, i = tn(t);
825
1045
  return r >= i.min && r <= i.max;
826
1046
  }
827
- var Ft = 10;
828
- function It(e) {
1047
+ var an = 10;
1048
+ function on(e) {
829
1049
  return e.vcType === "hierarchy";
830
1050
  }
831
- function Lt(e) {
1051
+ function sn(e) {
832
1052
  return e.every((e) => Number.isFinite(e.x) && Number.isFinite(e.y));
833
1053
  }
834
- //#endregion
835
- //#region src/modeling/VcConnectionTypeBehavior.ts
836
- var Rt = class extends xe {
1054
+ // src/modeling/VcConnectionTypeBehavior.ts
1055
+ var cn = class extends xe {
837
1056
  static $inject = ["eventBus", "modeling"];
838
1057
  constructor(e, t) {
839
1058
  super(e), this.postExecute(["element.updateProperties"], (e) => {
840
1059
  let { element: n, properties: r } = e;
841
- r && "vcType" in r && T(n) && t.layoutConnection(n);
1060
+ r && "vcType" in r && C(n) && t.layoutConnection(n);
842
1061
  }, !0);
843
1062
  }
844
- }, zt = class extends xe {
1063
+ }, ln = class extends xe {
845
1064
  modeling;
846
1065
  layouter;
847
1066
  static $inject = [
@@ -863,74 +1082,72 @@ var Rt = class extends xe {
863
1082
  e.shape,
864
1083
  ...e.shapes ?? [],
865
1084
  ...e.elements ?? []
866
- ].filter(S), n = e.connection, r = /* @__PURE__ */ new Set();
867
- T(n) && n.vcType === "hierarchy" && n.source && r.add(n.source);
1085
+ ].filter(b), n = e.connection, r = /* @__PURE__ */ new Set();
1086
+ C(n) && n.vcType === "hierarchy" && n.source && r.add(n.source);
868
1087
  for (let e of t) {
869
- Bt(e).length && r.add(e);
870
- for (let t of e.incoming ?? []) T(t) && t.vcType === "hierarchy" && t.source && r.add(t.source);
1088
+ un(e).length && r.add(e);
1089
+ for (let t of e.incoming ?? []) C(t) && t.vcType === "hierarchy" && t.source && r.add(t.source);
871
1090
  }
872
- for (let e of r) for (let t of Bt(e)) Vt(this.layouter.layoutConnection(t), t.waypoints ?? []) || this.modeling.layoutConnection(t);
1091
+ for (let e of r) for (let t of un(e)) dn(this.layouter.layoutConnection(t), t.waypoints ?? []) || this.modeling.layoutConnection(t);
873
1092
  }
874
1093
  };
875
- function Bt(e) {
876
- return (e.outgoing ?? []).filter((e) => T(e) && e.vcType === "hierarchy");
1094
+ function un(e) {
1095
+ return (e.outgoing ?? []).filter((e) => C(e) && e.vcType === "hierarchy");
877
1096
  }
878
- function Vt(e, t) {
1097
+ function dn(e, t) {
879
1098
  return e.length === t.length && e.every((e, n) => e.x === t[n].x && e.y === t[n].y);
880
1099
  }
881
- //#endregion
882
- //#region src/modeling/index.ts
883
- var Ht = {
1100
+ // src/modeling/index.ts
1101
+ var fn = {
884
1102
  __init__: [
885
1103
  "vcModeling",
886
1104
  "vcConnectionTypeBehavior",
887
1105
  "vcHierarchyRelayoutBehavior"
888
1106
  ],
889
- vcModeling: ["type", Dt],
890
- vcConnectionTypeBehavior: ["type", Rt],
891
- vcHierarchyRelayoutBehavior: ["type", zt],
892
- layouter: ["type", jt],
1107
+ vcModeling: ["type", Xt],
1108
+ vcConnectionTypeBehavior: ["type", cn],
1109
+ vcHierarchyRelayoutBehavior: ["type", ln],
1110
+ layouter: ["type", en],
893
1111
  connectionDocking: ["type", _e]
894
- }, Ut = class extends Ce {
1112
+ }, pn = class extends Ce {
895
1113
  vcConnect;
896
1114
  static $inject = ["eventBus", "vcConnect"];
897
1115
  constructor(e, t) {
898
1116
  super(e), this.vcConnect = t;
899
1117
  }
900
1118
  init() {
901
- this.addRule("connection.start", (e) => S(e.source)), this.addRule("connection.create", (e) => {
1119
+ this.addRule("connection.start", (e) => b(e.source)), this.addRule("connection.create", (e) => {
902
1120
  let { source: t, target: n } = e, r = this.resolveType(t, n);
903
- return !r || Kt(t, n, r) ? !1 : { vcType: r };
1121
+ return !r || gn(t, n, r) ? !1 : { vcType: r };
904
1122
  }), this.addRule("connection.reconnect", (e) => {
905
1123
  let { source: t, target: n, connection: r } = e;
906
- return !T(r) || !S(t) || !S(n) || t === n || !Gt(r.vcType, t, n) ? !1 : !Kt(t, n, r.vcType, r);
907
- }), this.addRule("connection.updateWaypoints", (e) => T(e.connection)), this.addRule("shape.create", (e) => Wt(e.target)), this.addRule("elements.create", (e) => Wt(e.target)), this.addRule(["shape.move", "elements.move"], () => !0), this.addRule("shape.resize", (e) => S(e.shape)), this.addRule(["elements.align", "elements.distribute"], (e) => (e.elements ?? []).filter(S));
1124
+ return !C(r) || !b(t) || !b(n) || t === n || !hn(r.vcType, t, n) ? !1 : !gn(t, n, r.vcType, r);
1125
+ }), this.addRule("connection.updateWaypoints", (e) => C(e.connection)), this.addRule("shape.create", (e) => mn(e.target)), this.addRule("elements.create", (e) => mn(e.target)), this.addRule(["shape.move", "elements.move"], () => !0), this.addRule("shape.resize", (e) => b(e.shape)), this.addRule(["elements.align", "elements.distribute"], (e) => (e.elements ?? []).filter(b));
908
1126
  }
909
1127
  resolveType(e, t) {
910
- if (!S(e) || !S(t) || e === t) return null;
911
- if (C(e) && C(t)) {
1128
+ if (!b(e) || !b(t) || e === t) return null;
1129
+ if (x(e) && x(t)) {
912
1130
  let e = this.vcConnect.pendingType;
913
1131
  return e === "assignment" ? null : e;
914
1132
  }
915
- return C(e) && w(t) || w(e) && C(t) ? "assignment" : null;
1133
+ return x(e) && S(t) || S(e) && x(t) ? "assignment" : null;
916
1134
  }
917
1135
  };
918
- function Wt(e) {
919
- return !!e && !S(e) && !T(e) && !e.parent;
1136
+ function mn(e) {
1137
+ return !!e && !b(e) && !C(e) && !e.parent;
920
1138
  }
921
- function Gt(e, t, n) {
922
- return e === "assignment" ? C(t) && w(n) || w(t) && C(n) : C(t) && C(n);
1139
+ function hn(e, t, n) {
1140
+ return e === "assignment" ? x(t) && S(n) || S(t) && x(n) : x(t) && x(n);
923
1141
  }
924
- function Kt(e, t, n, r) {
925
- return [...e.outgoing ?? [], ...n === "assignment" ? e.incoming ?? [] : []].some((e) => e !== r && T(e) && e.vcType === n && (e.target === t || e.source === t));
1142
+ function gn(e, t, n, r) {
1143
+ return [...e.outgoing ?? [], ...n === "assignment" ? e.incoming ?? [] : []].some((e) => e !== r && C(e) && e.vcType === n && (e.target === t || e.source === t));
926
1144
  }
927
- //#endregion
928
- //#region src/rules/index.ts
929
- var qt = {
1145
+ // src/rules/index.ts
1146
+ var _n = {
930
1147
  __depends__: [Se],
931
1148
  __init__: ["vcRules"],
932
- vcRules: ["type", Ut]
933
- }, Jt = class {
1149
+ vcRules: ["type", pn]
1150
+ }, vn = class {
934
1151
  connect;
935
1152
  static $inject = ["connect", "eventBus"];
936
1153
  pendingType = "sequence";
@@ -946,11 +1163,11 @@ var qt = {
946
1163
  start(e, t, n) {
947
1164
  this.pendingType = n, this.connect.start(e, t);
948
1165
  }
949
- }, Yt = {
1166
+ }, yn = {
950
1167
  __depends__: [we],
951
1168
  __init__: ["vcConnect"],
952
- vcConnect: ["type", Jt]
953
- }, Xt = class {
1169
+ vcConnect: ["type", vn]
1170
+ }, bn = class {
954
1171
  autoPlace;
955
1172
  create;
956
1173
  factory;
@@ -975,16 +1192,16 @@ var qt = {
975
1192
  createShape(e) {
976
1193
  return e === "assignment" ? this.factory.createNewOrgUnit() : this.factory.createNewStep();
977
1194
  }
978
- }, Zt = 200, Qt = 45, $t = 45, en = 30, tn = 20, nn = 30, rn = 10, an = class {
1195
+ }, xn = 200, Sn = 45, Cn = 45, wn = 30, Tn = 20, En = 30, Dn = 10, On = class {
979
1196
  static $inject = [
980
1197
  "eventBus",
981
1198
  "vcConnect",
982
1199
  "elementRegistry"
983
1200
  ];
984
1201
  constructor(e, t, n) {
985
- e.on("autoPlace", Zt, (e) => {
1202
+ e.on("autoPlace", xn, (e) => {
986
1203
  let { source: n, shape: r } = e;
987
- if (!S(n)) return;
1204
+ if (!b(n)) return;
988
1205
  let i = this.desiredPosition(t.pendingType, n, r);
989
1206
  return this.deconflict(i, r);
990
1207
  }), this.elementRegistry = n;
@@ -995,67 +1212,66 @@ var qt = {
995
1212
  }
996
1213
  sequencePosition(e, t) {
997
1214
  return {
998
- x: e.x + e.width + Qt + t.width / 2,
1215
+ x: e.x + e.width + Sn + t.width / 2,
999
1216
  y: e.y + e.height / 2
1000
1217
  };
1001
1218
  }
1002
1219
  assignmentPosition(e, t) {
1003
1220
  return {
1004
1221
  x: e.x + e.width / 2,
1005
- y: e.y + e.height + $t + t.height / 2
1222
+ y: e.y + e.height + Cn + t.height / 2
1006
1223
  };
1007
1224
  }
1008
1225
  hierarchyPosition(e, t) {
1009
- let n = Nt(e);
1226
+ let n = nn(e);
1010
1227
  if (!n.length) return {
1011
1228
  x: e.x + e.width / 2 + 10 + t.width / 2,
1012
- y: e.y + e.height + $t + t.height / 2
1229
+ y: e.y + e.height + Cn + t.height / 2
1013
1230
  };
1014
- if (Pt(n, e)) {
1015
- let e = on(n);
1231
+ if (rn(n, e)) {
1232
+ let e = kn(n);
1016
1233
  return {
1017
- x: e.x + e.width + tn + t.width / 2,
1234
+ x: e.x + e.width + Tn + t.width / 2,
1018
1235
  y: e.y + t.height / 2
1019
1236
  };
1020
1237
  }
1021
- let r = sn(n);
1238
+ let r = An(n);
1022
1239
  return {
1023
1240
  x: r.x + t.width / 2,
1024
- y: r.y + r.height + en + t.height / 2
1241
+ y: r.y + r.height + wn + t.height / 2
1025
1242
  };
1026
1243
  }
1027
1244
  deconflict(e, t) {
1028
- let n = this.elementRegistry.getAll().filter(S), r = { ...e };
1245
+ let n = this.elementRegistry.getAll().filter(b), r = { ...e };
1029
1246
  for (let e = 0; e < 50; e += 1) {
1030
1247
  let e = {
1031
- x: r.x - t.width / 2 - rn,
1032
- y: r.y - t.height / 2 - rn,
1248
+ x: r.x - t.width / 2 - Dn,
1249
+ y: r.y - t.height / 2 - Dn,
1033
1250
  width: t.width + 20,
1034
1251
  height: t.height + 20
1035
1252
  };
1036
1253
  if (!n.some((t) => t.x < e.x + e.width && t.x + t.width > e.x && t.y < e.y + e.height && t.y + t.height > e.y)) break;
1037
- r.y += nn;
1254
+ r.y += En;
1038
1255
  }
1039
1256
  return r;
1040
1257
  }
1041
1258
  };
1042
- function on(e) {
1259
+ function kn(e) {
1043
1260
  return e.reduce((e, t) => !e || t.x + t.width > e.x + e.width ? t : e, void 0);
1044
1261
  }
1045
- function sn(e) {
1262
+ function An(e) {
1046
1263
  return e.reduce((e, t) => !e || t.y + t.height > e.y + e.height ? t : e, void 0);
1047
1264
  }
1048
- //#endregion
1049
- //#region src/append/index.ts
1050
- var cn = {
1265
+ // src/append/index.ts
1266
+ var jn = {
1051
1267
  __depends__: [
1052
1268
  Te,
1053
1269
  Ee,
1054
1270
  De
1055
1271
  ],
1056
1272
  __init__: ["vcAutoPlaceBehavior", "vcCreatePreviewBehavior"],
1057
- vcAppend: ["type", Xt],
1058
- vcAutoPlaceBehavior: ["type", an],
1273
+ vcAppend: ["type", bn],
1274
+ vcAutoPlaceBehavior: ["type", On],
1059
1275
  vcCreatePreviewBehavior: ["type", class {
1060
1276
  static $inject = ["injector", "eventBus"];
1061
1277
  constructor(e, t) {
@@ -1082,7 +1298,7 @@ var cn = {
1082
1298
  }));
1083
1299
  }
1084
1300
  }]
1085
- }, ln = {
1301
+ }, Mn = {
1086
1302
  "square-dashed-mouse-pointer": "<path d=\"M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z\"/><path d=\"M5 3a2 2 0 0 0-2 2\"/><path d=\"M19 3a2 2 0 0 1 2 2\"/><path d=\"M5 21a2 2 0 0 1-2-2\"/><path d=\"M9 3h1\"/><path d=\"M9 21h2\"/><path d=\"M14 3h1\"/><path d=\"M3 9v1\"/><path d=\"M21 9v2\"/><path d=\"M3 14v1\"/>",
1087
1303
  hand: "<path d=\"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2\"/><path d=\"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2\"/><path d=\"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8\"/><path d=\"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15\"/>",
1088
1304
  "unfold-horizontal": "<path d=\"M16 12h6\"/><path d=\"M8 12H2\"/><path d=\"M12 2v2\"/><path d=\"M12 8v2\"/><path d=\"M12 14v2\"/><path d=\"M12 20v2\"/><path d=\"m19 15 3-3-3-3\"/><path d=\"m5 9-3 3 3 3\"/>",
@@ -1092,10 +1308,10 @@ var cn = {
1092
1308
  "arrow-left-right": "<path d=\"M8 3 4 7l4 4\"/><path d=\"M4 7h16\"/><path d=\"m16 21 4-4-4-4\"/><path d=\"M20 17H4\"/>",
1093
1309
  "align-start-vertical": "<rect width=\"9\" height=\"6\" x=\"6\" y=\"14\" rx=\"2\"/><rect width=\"16\" height=\"6\" x=\"6\" y=\"4\" rx=\"2\"/><path d=\"M2 2v20\"/>",
1094
1310
  x: "<path d=\"M18 6 6 18\"/><path d=\"m6 6 12 12\"/>"
1095
- }, P = {
1311
+ }, I = {
1096
1312
  size: 16,
1097
1313
  strokeWidth: 2.5
1098
- }, F = {
1314
+ }, L = {
1099
1315
  size: 20,
1100
1316
  strokeWidth: 2
1101
1317
  };
@@ -1104,43 +1320,41 @@ var cn = {
1104
1320
  * Copyright (c) 2026 Lucide Icons and Contributors
1105
1321
  * Derived from Feather, as Lucide's LICENSE lists them: trash and x. Feather @license MIT
1106
1322
  * Copyright (c) 2013-present Cole Bemis */
1107
- function I(e, t = P) {
1108
- return `<svg xmlns="http://www.w3.org/2000/svg" width="${t.size}" height="${t.size}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${t.strokeWidth}" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${ln[e]}</svg>`;
1323
+ function R(e, t = I) {
1324
+ return `<svg xmlns="http://www.w3.org/2000/svg" width="${t.size}" height="${t.size}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${t.strokeWidth}" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${Mn[e]}</svg>`;
1109
1325
  }
1110
- //#endregion
1111
- //#region src/draw/icons.ts
1112
- function L(e, t = "0 0 24 24") {
1113
- return `<svg xmlns="http://www.w3.org/2000/svg" width="${P.size}" height="${P.size}" viewBox="${t}" fill="none" stroke="currentColor" stroke-width="${P.strokeWidth}" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${e}</svg>`;
1326
+ // src/draw/icons.ts
1327
+ function z(e, t = "0 0 24 24") {
1328
+ return `<svg xmlns="http://www.w3.org/2000/svg" width="${I.size}" height="${I.size}" viewBox="${t}" fill="none" stroke="currentColor" stroke-width="${I.strokeWidth}" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${e}</svg>`;
1114
1329
  }
1115
- function un(e) {
1116
- return `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="${A.fill}" stroke="${A.ink}" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${e}</svg>`;
1117
- }
1118
- var R = {
1119
- handTool: I("hand", F),
1120
- lassoTool: I("square-dashed-mouse-pointer", F),
1121
- spaceTool: I("unfold-horizontal", F),
1122
- globalConnect: I("workflow", F),
1123
- createStep: un("<path d=\"M3 7 h12 l6 5 -6 5 H3 l4.5 -5 Z\"/>"),
1124
- createOrgUnit: un("<ellipse cx=\"12\" cy=\"12\" rx=\"9.5\" ry=\"6.5\"/>"),
1125
- appendStep: L("<path d=\"M2.5 12 h4.5 m-2 -2 2 2 -2 2\" stroke-dasharray=\"2.6 2\"/><path d=\"M9 7 h8 l4 5 -4 5 H9 l3 -5 Z\"/>"),
1126
- appendSubStep: L("<path d=\"M7 3 v8.5 h2.5\" /><path d=\"M11 7 h7.5 l3 4.5 -3 4.5 H11 l2.5 -4.5 Z\" transform=\"translate(-1.5 0.5)\"/>", "0 0 22 22"),
1127
- connectSequence: L("<path d=\"M4 19 L17.5 5.5\" stroke-dasharray=\"3 2.6\"/><path d=\"M13 5 h5.5 v5.5\" />"),
1128
- connectHierarchy: L("<path d=\"M6 4 v14 h11.5 m-3.5 -3.5 3.5 3.5 -3.5 3.5\"/>"),
1129
- appendOrgUnit: L("<path d=\"M12 3.5 v5\"/><ellipse cx=\"12\" cy=\"15\" rx=\"8.5\" ry=\"5.5\"/>"),
1130
- toggleType: I("arrow-left-right"),
1131
- align: I("align-start-vertical"),
1132
- color: I("palette"),
1133
- trash: I("trash")
1330
+ function Nn(e) {
1331
+ return `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="${D.fill}" stroke="${D.ink}" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${e}</svg>`;
1332
+ }
1333
+ var B = {
1334
+ handTool: R("hand", L),
1335
+ lassoTool: R("square-dashed-mouse-pointer", L),
1336
+ spaceTool: R("unfold-horizontal", L),
1337
+ globalConnect: R("workflow", L),
1338
+ createStep: Nn("<path d=\"M3 7 h12 l6 5 -6 5 H3 l4.5 -5 Z\"/>"),
1339
+ createOrgUnit: Nn("<ellipse cx=\"12\" cy=\"12\" rx=\"9.5\" ry=\"6.5\"/>"),
1340
+ appendStep: z("<path d=\"M2.5 12 h4.5 m-2 -2 2 2 -2 2\" stroke-dasharray=\"2.6 2\"/><path d=\"M9 7 h8 l4 5 -4 5 H9 l3 -5 Z\"/>"),
1341
+ appendSubStep: z("<path d=\"M7 3 v8.5 h2.5\" /><path d=\"M11 7 h7.5 l3 4.5 -3 4.5 H11 l2.5 -4.5 Z\" transform=\"translate(-1.5 0.5)\"/>", "0 0 22 22"),
1342
+ connectSequence: z("<path d=\"M4 19 L17.5 5.5\" stroke-dasharray=\"3 2.6\"/><path d=\"M13 5 h5.5 v5.5\" />"),
1343
+ connectHierarchy: z("<path d=\"M6 4 v14 h11.5 m-3.5 -3.5 3.5 3.5 -3.5 3.5\"/>"),
1344
+ appendOrgUnit: z("<path d=\"M12 3.5 v5\"/><ellipse cx=\"12\" cy=\"15\" rx=\"8.5\" ry=\"5.5\"/>"),
1345
+ toggleType: R("arrow-left-right"),
1346
+ align: R("align-start-vertical"),
1347
+ color: R("palette"),
1348
+ trash: R("trash")
1134
1349
  };
1135
- function z(e, t = !1) {
1350
+ function V(e, t = !1) {
1136
1351
  return `<div class="entry vc-palette-entry"${t ? " draggable=\"true\"" : ""}>${e}</div>`;
1137
1352
  }
1138
- function B(e, t = !1) {
1353
+ function H(e, t = !1) {
1139
1354
  return `<div class="entry vc-cp-entry"${t ? " draggable=\"true\"" : ""}>${e}</div>`;
1140
1355
  }
1141
- //#endregion
1142
- //#region src/palette/VcPaletteProvider.ts
1143
- var dn = 24, fn = class {
1356
+ // src/palette/VcPaletteProvider.ts
1357
+ var Pn = 24, Fn = class {
1144
1358
  create;
1145
1359
  factory;
1146
1360
  handTool;
@@ -1175,41 +1389,41 @@ var dn = 24, fn = class {
1175
1389
  let e = (e) => (t) => {
1176
1390
  if (this.editLock()?.isReadOnly()) return;
1177
1391
  let n = e();
1178
- pn(t) ? this.placeInFreeRect(n) : this.create.start(t, n);
1392
+ In(t) ? this.placeInFreeRect(n) : this.create.start(t, n);
1179
1393
  }, t = e(() => this.factory.createNewStep()), n = e(() => this.factory.createNewOrgUnit());
1180
1394
  return {
1181
1395
  "lasso-tool": {
1182
1396
  group: "tools",
1183
1397
  title: "Lasso",
1184
1398
  shortcut: "L",
1185
- html: z(R.lassoTool),
1399
+ html: V(B.lassoTool),
1186
1400
  action: { click: (e) => this.lassoTool.activateSelection(e, !1) }
1187
1401
  },
1188
1402
  "hand-tool": {
1189
1403
  group: "tools",
1190
1404
  title: "Hand",
1191
1405
  shortcut: "H",
1192
- html: z(R.handTool),
1406
+ html: V(B.handTool),
1193
1407
  action: { click: (e) => this.handTool.activateHand(e, !1, !1) }
1194
1408
  },
1195
1409
  "space-tool": {
1196
1410
  group: "tools",
1197
1411
  title: "Create or remove space",
1198
1412
  shortcut: "S",
1199
- html: z(R.spaceTool),
1413
+ html: V(B.spaceTool),
1200
1414
  action: { click: (e) => this.spaceTool.activateSelection(e, !1, !1) }
1201
1415
  },
1202
1416
  "global-connect-tool": {
1203
1417
  group: "tools",
1204
1418
  title: "Connect",
1205
1419
  shortcut: "C",
1206
- html: z(R.globalConnect),
1420
+ html: V(B.globalConnect),
1207
1421
  action: { click: (e) => this.globalConnect.start(e, !1) }
1208
1422
  },
1209
1423
  "create.step": {
1210
1424
  group: "value-chain",
1211
1425
  title: "Step",
1212
- html: z(R.createStep, !0),
1426
+ html: V(B.createStep, !0),
1213
1427
  action: {
1214
1428
  click: t,
1215
1429
  dragstart: t
@@ -1218,7 +1432,7 @@ var dn = 24, fn = class {
1218
1432
  "create.org-unit": {
1219
1433
  group: "value-chain",
1220
1434
  title: "Organizational unit",
1221
- html: z(R.createOrgUnit, !0),
1435
+ html: V(B.createOrgUnit, !0),
1222
1436
  action: {
1223
1437
  click: n,
1224
1438
  dragstart: n
@@ -1231,7 +1445,7 @@ var dn = 24, fn = class {
1231
1445
  x: t.x,
1232
1446
  y: t.y
1233
1447
  };
1234
- for (; this.centreTaken(n);) n.x += dn, n.y += dn;
1448
+ for (; this.centreTaken(n);) n.x += Pn, n.y += Pn;
1235
1449
  let r = this.modeling.createShape(e, n, this.canvas.getRootElement());
1236
1450
  this.selection.select(r), this.canvas.focus(), this.injector.get("directEditing", !1)?.activate(r);
1237
1451
  }
@@ -1256,18 +1470,17 @@ var dn = 24, fn = class {
1256
1470
  };
1257
1471
  }
1258
1472
  centreTaken(e) {
1259
- return this.elementRegistry.filter(S).some((t) => Math.abs(t.x + t.width / 2 - e.x) < 1 && Math.abs(t.y + t.height / 2 - e.y) < 1);
1473
+ return this.elementRegistry.filter(b).some((t) => Math.abs(t.x + t.width / 2 - e.x) < 1 && Math.abs(t.y + t.height / 2 - e.y) < 1);
1260
1474
  }
1261
1475
  editLock() {
1262
1476
  return this.injector.get("vcReadOnly", !1);
1263
1477
  }
1264
1478
  };
1265
- function pn(e) {
1479
+ function In(e) {
1266
1480
  return e.type === "click" && e.detail === 0;
1267
1481
  }
1268
- //#endregion
1269
- //#region src/palette/index.ts
1270
- var mn = {
1482
+ // src/palette/index.ts
1483
+ var Ln = {
1271
1484
  __depends__: [
1272
1485
  Oe,
1273
1486
  Ee,
@@ -1277,42 +1490,42 @@ var mn = {
1277
1490
  Me
1278
1491
  ],
1279
1492
  __init__: ["vcPaletteProvider"],
1280
- vcPaletteProvider: ["type", fn]
1281
- }, V = "vc-color-picker";
1282
- function hn(e) {
1283
- return `<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><rect x="1" y="1" width="14" height="14" rx="2" fill="${A.fill}" stroke="${e}" stroke-width="2"/></svg>`;
1493
+ vcPaletteProvider: ["type", Fn]
1494
+ }, U = "vc-color-picker";
1495
+ function Rn(e) {
1496
+ return `<svg viewBox="0 0 16 16" width="16" height="16" aria-hidden="true"><rect x="1" y="1" width="14" height="14" rx="2" fill="${lt(e).fill}" stroke="${D.ink}" stroke-width="2"/></svg>`;
1284
1497
  }
1285
- var gn = class {
1498
+ var zn = class {
1286
1499
  vcModeling;
1287
1500
  static $inject = ["popupMenu", "vcModeling"];
1288
1501
  constructor(e, t) {
1289
- this.vcModeling = t, e.registerProvider(V, this);
1502
+ this.vcModeling = t, e.registerProvider(U, this);
1290
1503
  }
1291
1504
  getPopupMenuEntries(e) {
1292
1505
  let t = Array.isArray(e) ? e[0] : e;
1293
- if (!S(t)) return {};
1506
+ if (!b(t)) return {};
1294
1507
  let n = {};
1295
- for (let e of st) n[`color-${e.label.toLowerCase()}`] = {
1508
+ for (let e of ct) n[`color-${e.label.toLowerCase()}`] = {
1296
1509
  label: e.label,
1297
- imageHtml: hn(e.color ?? A.ink),
1510
+ imageHtml: Rn(e.color),
1298
1511
  action: () => this.vcModeling.setColor(t, e.color)
1299
1512
  };
1300
1513
  return n;
1301
1514
  }
1302
- }, H = "vc-align-elements";
1303
- function U(e) {
1515
+ }, W = "vc-align-elements";
1516
+ function G(e) {
1304
1517
  return `<svg viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" aria-hidden="true">${e}</svg>`;
1305
1518
  }
1306
- var W = {
1307
- left: U("<path d=\"M3 2v12\"/><rect x=\"5\" y=\"4\" width=\"8\" height=\"3\"/><rect x=\"5\" y=\"9\" width=\"5\" height=\"3\"/>"),
1308
- center: U("<path d=\"M8 2v12\"/><rect x=\"4\" y=\"4\" width=\"8\" height=\"3\"/><rect x=\"5.5\" y=\"9\" width=\"5\" height=\"3\"/>"),
1309
- right: U("<path d=\"M13 2v12\"/><rect x=\"3\" y=\"4\" width=\"8\" height=\"3\"/><rect x=\"6\" y=\"9\" width=\"5\" height=\"3\"/>"),
1310
- top: U("<path d=\"M2 3h12\"/><rect x=\"4\" y=\"5\" width=\"3\" height=\"8\"/><rect x=\"9\" y=\"5\" width=\"3\" height=\"5\"/>"),
1311
- middle: U("<path d=\"M2 8h12\"/><rect x=\"4\" y=\"4\" width=\"3\" height=\"8\"/><rect x=\"9\" y=\"5.5\" width=\"3\" height=\"5\"/>"),
1312
- bottom: U("<path d=\"M2 13h12\"/><rect x=\"4\" y=\"3\" width=\"3\" height=\"8\"/><rect x=\"9\" y=\"6\" width=\"3\" height=\"5\"/>"),
1313
- horizontal: U("<rect x=\"2\" y=\"5\" width=\"3\" height=\"6\"/><rect x=\"6.5\" y=\"5\" width=\"3\" height=\"6\"/><rect x=\"11\" y=\"5\" width=\"3\" height=\"6\"/>"),
1314
- vertical: U("<rect x=\"5\" y=\"2\" width=\"6\" height=\"3\"/><rect x=\"5\" y=\"6.5\" width=\"6\" height=\"3\"/><rect x=\"5\" y=\"11\" width=\"6\" height=\"3\"/>")
1315
- }, _n = class {
1519
+ var K = {
1520
+ left: G("<path d=\"M3 2v12\"/><rect x=\"5\" y=\"4\" width=\"8\" height=\"3\"/><rect x=\"5\" y=\"9\" width=\"5\" height=\"3\"/>"),
1521
+ center: G("<path d=\"M8 2v12\"/><rect x=\"4\" y=\"4\" width=\"8\" height=\"3\"/><rect x=\"5.5\" y=\"9\" width=\"5\" height=\"3\"/>"),
1522
+ right: G("<path d=\"M13 2v12\"/><rect x=\"3\" y=\"4\" width=\"8\" height=\"3\"/><rect x=\"6\" y=\"9\" width=\"5\" height=\"3\"/>"),
1523
+ top: G("<path d=\"M2 3h12\"/><rect x=\"4\" y=\"5\" width=\"3\" height=\"8\"/><rect x=\"9\" y=\"5\" width=\"3\" height=\"5\"/>"),
1524
+ middle: G("<path d=\"M2 8h12\"/><rect x=\"4\" y=\"4\" width=\"3\" height=\"8\"/><rect x=\"9\" y=\"5.5\" width=\"3\" height=\"5\"/>"),
1525
+ bottom: G("<path d=\"M2 13h12\"/><rect x=\"4\" y=\"3\" width=\"3\" height=\"8\"/><rect x=\"9\" y=\"6\" width=\"3\" height=\"5\"/>"),
1526
+ horizontal: G("<rect x=\"2\" y=\"5\" width=\"3\" height=\"6\"/><rect x=\"6.5\" y=\"5\" width=\"3\" height=\"6\"/><rect x=\"11\" y=\"5\" width=\"3\" height=\"6\"/>"),
1527
+ vertical: G("<rect x=\"5\" y=\"2\" width=\"6\" height=\"3\"/><rect x=\"5\" y=\"6.5\" width=\"6\" height=\"3\"/><rect x=\"5\" y=\"11\" width=\"6\" height=\"3\"/>")
1528
+ }, Bn = class {
1316
1529
  alignElements;
1317
1530
  distributeElements;
1318
1531
  static $inject = [
@@ -1321,10 +1534,10 @@ var W = {
1321
1534
  "distributeElements"
1322
1535
  ];
1323
1536
  constructor(e, t, n) {
1324
- this.alignElements = t, this.distributeElements = n, e.registerProvider(H, this);
1537
+ this.alignElements = t, this.distributeElements = n, e.registerProvider(W, this);
1325
1538
  }
1326
1539
  getPopupMenuEntries(e) {
1327
- let t = (Array.isArray(e) ? e : [e]).filter(S);
1540
+ let t = (Array.isArray(e) ? e : [e]).filter(b);
1328
1541
  if (t.length < 2) return {};
1329
1542
  let n = (e, n, r) => ({
1330
1543
  label: n,
@@ -1332,26 +1545,26 @@ var W = {
1332
1545
  imageHtml: r,
1333
1546
  action: () => this.alignElements.trigger(t, e)
1334
1547
  }), r = {
1335
- "align-left": n("left", "Align left", W.left),
1336
- "align-center": n("center", "Align center", W.center),
1337
- "align-right": n("right", "Align right", W.right),
1338
- "align-top": n("top", "Align top", W.top),
1339
- "align-middle": n("middle", "Align middle", W.middle),
1340
- "align-bottom": n("bottom", "Align bottom", W.bottom)
1548
+ "align-left": n("left", "Align left", K.left),
1549
+ "align-center": n("center", "Align center", K.center),
1550
+ "align-right": n("right", "Align right", K.right),
1551
+ "align-top": n("top", "Align top", K.top),
1552
+ "align-middle": n("middle", "Align middle", K.middle),
1553
+ "align-bottom": n("bottom", "Align bottom", K.bottom)
1341
1554
  };
1342
1555
  return t.length >= 3 && (r["distribute-horizontally"] = {
1343
1556
  label: "Distribute horizontally",
1344
1557
  group: "distribute",
1345
- imageHtml: W.horizontal,
1558
+ imageHtml: K.horizontal,
1346
1559
  action: () => this.distributeElements.trigger(t, "horizontal")
1347
1560
  }, r["distribute-vertically"] = {
1348
1561
  label: "Distribute vertically",
1349
1562
  group: "distribute",
1350
- imageHtml: W.vertical,
1563
+ imageHtml: K.vertical,
1351
1564
  action: () => this.distributeElements.trigger(t, "vertical")
1352
1565
  }), r;
1353
1566
  }
1354
- }, vn = class {
1567
+ }, Vn = class {
1355
1568
  modeling;
1356
1569
  popupMenu;
1357
1570
  vcAppend;
@@ -1373,56 +1586,56 @@ var W = {
1373
1586
  getContextPadEntries(e) {
1374
1587
  let t = {};
1375
1588
  if (this.readOnly.isReadOnly()) return t;
1376
- if (C(e) && this.addStepEntries(t, e), w(e)) {
1589
+ if (x(e) && this.addStepEntries(t, e), S(e)) {
1377
1590
  let n = (t) => {
1378
1591
  this.vcConnect.start(t, e, "assignment");
1379
1592
  };
1380
1593
  t["connect.assignment"] = {
1381
1594
  group: "connect",
1382
1595
  title: "Connect to step",
1383
- html: B(R.connectHierarchy, !0),
1596
+ html: H(B.connectHierarchy, !0),
1384
1597
  action: {
1385
1598
  click: n,
1386
1599
  dragstart: n
1387
1600
  }
1388
1601
  };
1389
1602
  }
1390
- if (S(e) && (t["set-color"] = {
1603
+ if (b(e) && (t["set-color"] = {
1391
1604
  group: "edit",
1392
1605
  title: "Set color",
1393
- html: B(R.color),
1606
+ html: H(B.color),
1394
1607
  action: { click: (t) => {
1395
1608
  let n = t;
1396
- this.popupMenu.open(e, V, {
1609
+ this.popupMenu.open(e, U, {
1397
1610
  x: n.clientX,
1398
1611
  y: n.clientY
1399
1612
  });
1400
1613
  } }
1401
- }), T(e) && e.vcType !== "assignment") {
1614
+ }), C(e) && e.vcType !== "assignment") {
1402
1615
  let n = e, r = n.vcType === "sequence" ? "hierarchy" : "sequence";
1403
1616
  t["toggle-type"] = {
1404
1617
  group: "edit",
1405
1618
  title: `Switch to "${r === "sequence" ? "is predecessor of" : "is process-oriented superior"}"`,
1406
- html: B(R.toggleType),
1619
+ html: H(B.toggleType),
1407
1620
  action: { click: () => this.vcModeling.setConnectionType(n, r) }
1408
1621
  };
1409
1622
  }
1410
- return (S(e) || T(e)) && (t.delete = {
1623
+ return (b(e) || C(e)) && (t.delete = {
1411
1624
  group: "edit",
1412
1625
  title: "Delete",
1413
- html: B(R.trash),
1626
+ html: H(B.trash),
1414
1627
  action: { click: () => this.modeling.removeElements([e]) }
1415
1628
  }), t;
1416
1629
  }
1417
1630
  getMultiElementContextPadEntries(e) {
1418
1631
  let t = {};
1419
- return this.readOnly.isReadOnly() || (e.filter(S).length >= 2 && (t.align = {
1632
+ return this.readOnly.isReadOnly() || (e.filter(b).length >= 2 && (t.align = {
1420
1633
  group: "edit",
1421
1634
  title: "Align / distribute",
1422
- html: B(R.align),
1635
+ html: H(B.align),
1423
1636
  action: { click: (t) => {
1424
1637
  let n = t;
1425
- this.popupMenu.open(e, H, {
1638
+ this.popupMenu.open(e, W, {
1426
1639
  x: n.clientX,
1427
1640
  y: n.clientY
1428
1641
  });
@@ -1430,7 +1643,7 @@ var W = {
1430
1643
  }), t.delete = {
1431
1644
  group: "edit",
1432
1645
  title: "Delete",
1433
- html: B(R.trash),
1646
+ html: H(B.trash),
1434
1647
  action: { click: () => this.modeling.removeElements([...e]) }
1435
1648
  }), t;
1436
1649
  }
@@ -1445,7 +1658,7 @@ var W = {
1445
1658
  e["append.step"] = {
1446
1659
  group: "model",
1447
1660
  title: "Append step (is predecessor of)",
1448
- html: B(R.appendStep, !0),
1661
+ html: H(B.appendStep, !0),
1449
1662
  action: {
1450
1663
  click: n("sequence"),
1451
1664
  dragstart: r("sequence")
@@ -1453,7 +1666,7 @@ var W = {
1453
1666
  }, e["append.sub-step"] = {
1454
1667
  group: "model",
1455
1668
  title: "Append sub-step (is process-oriented superior)",
1456
- html: B(R.appendSubStep, !0),
1669
+ html: H(B.appendSubStep, !0),
1457
1670
  action: {
1458
1671
  click: n("hierarchy"),
1459
1672
  dragstart: r("hierarchy")
@@ -1461,7 +1674,7 @@ var W = {
1461
1674
  }, e["append.org-unit"] = {
1462
1675
  group: "model",
1463
1676
  title: "Append organizational unit",
1464
- html: B(R.appendOrgUnit, !0),
1677
+ html: H(B.appendOrgUnit, !0),
1465
1678
  action: {
1466
1679
  click: n("assignment"),
1467
1680
  dragstart: r("assignment")
@@ -1469,7 +1682,7 @@ var W = {
1469
1682
  }, e["connect.sequence"] = {
1470
1683
  group: "connect",
1471
1684
  title: "Connect (is predecessor of)",
1472
- html: B(R.connectSequence, !0),
1685
+ html: H(B.connectSequence, !0),
1473
1686
  action: {
1474
1687
  click: i("sequence"),
1475
1688
  dragstart: i("sequence")
@@ -1477,18 +1690,18 @@ var W = {
1477
1690
  }, e["connect.hierarchy"] = {
1478
1691
  group: "connect",
1479
1692
  title: "Connect (is process-oriented superior)",
1480
- html: B(R.connectHierarchy, !0),
1693
+ html: H(B.connectHierarchy, !0),
1481
1694
  action: {
1482
1695
  click: i("hierarchy"),
1483
1696
  dragstart: i("hierarchy")
1484
1697
  }
1485
1698
  };
1486
1699
  }
1487
- }, yn = {
1700
+ }, Hn = {
1488
1701
  __depends__: [Ne, v],
1489
1702
  __init__: ["vcContextPadProvider"],
1490
- vcContextPadProvider: ["type", vn]
1491
- }, bn = class {
1703
+ vcContextPadProvider: ["type", Vn]
1704
+ }, Un = class {
1492
1705
  directEditing;
1493
1706
  canvas;
1494
1707
  vcModeling;
@@ -1504,12 +1717,12 @@ var W = {
1504
1717
  resumeTimer;
1505
1718
  constructor(e, t, n, r, i) {
1506
1719
  this.directEditing = e, this.canvas = t, this.vcModeling = r, this.elementRegistry = i, e.registerProvider(this), n.on("element.dblclick", (t) => {
1507
- t.element && S(t.element) && e.activate(t.element);
1720
+ t.element && b(t.element) && e.activate(t.element);
1508
1721
  }), n.on("autoPlace.end", 500, (t) => {
1509
- t.shape && S(t.shape) && e.activate(t.shape);
1722
+ t.shape && b(t.shape) && e.activate(t.shape);
1510
1723
  }), n.on("create.end", 500, (t) => {
1511
1724
  let { source: n, shape: r, canExecute: i } = t.context;
1512
- n && i && r && S(r) && e.activate(r);
1725
+ n && i && r && b(r) && e.activate(r);
1513
1726
  }), n.on([
1514
1727
  "element.mousedown",
1515
1728
  "drag.init",
@@ -1525,7 +1738,7 @@ var W = {
1525
1738
  }
1526
1739
  openEdit() {
1527
1740
  let e = this.directEditing._active?.element;
1528
- if (this.directEditing.isActive() && S(e)) return {
1741
+ if (this.directEditing.isActive() && b(e)) return {
1529
1742
  element: e,
1530
1743
  text: this.directEditing.getValue()
1531
1744
  };
@@ -1546,7 +1759,7 @@ var W = {
1546
1759
  }
1547
1760
  resume(e) {
1548
1761
  let t = this.elementRegistry.get(e.elementId);
1549
- if (!S(t) || !this.directEditing.activate(t)) return;
1762
+ if (!b(t) || !this.directEditing.activate(t)) return;
1550
1763
  let n = this.directEditing._textbox?.content;
1551
1764
  if (!n) return;
1552
1765
  n.innerText = e.text;
@@ -1567,8 +1780,8 @@ var W = {
1567
1780
  }), t.content.style.fontSize = n.style?.fontSize ?? "", e.context.bounds = n.bounds;
1568
1781
  }
1569
1782
  activate(e) {
1570
- if (!S(e)) return;
1571
- let t = e, n = this.canvas.getAbsoluteBBox(t), r = this.canvas.zoom(), i = (w(t) ? 12 : at(t.width, t.height)) * r;
1783
+ if (!b(e)) return;
1784
+ let t = e, n = this.canvas.getAbsoluteBBox(t), r = this.canvas.zoom(), i = (S(t) ? 12 : Tt(t.width, t.height)) * r;
1572
1785
  return {
1573
1786
  bounds: {
1574
1787
  x: n.x + i,
@@ -1577,10 +1790,10 @@ var W = {
1577
1790
  height: n.height
1578
1791
  },
1579
1792
  style: {
1580
- fontFamily: j.family,
1581
- fontSize: `${j.size * r}px`,
1793
+ fontFamily: O.family,
1794
+ fontSize: `${O.size * r}px`,
1582
1795
  fontWeight: "normal",
1583
- lineHeight: String(j.lineHeight),
1796
+ lineHeight: String(O.lineHeight),
1584
1797
  textAlign: "center",
1585
1798
  backgroundColor: "var(--cd-ui-flaeche-hoch)",
1586
1799
  border: "1px solid var(--cd-ui-interaktion)"
@@ -1590,31 +1803,46 @@ var W = {
1590
1803
  };
1591
1804
  }
1592
1805
  update(e, t) {
1593
- this.vcModeling.updateLabel(e, xn(t));
1806
+ this.vcModeling.updateLabel(e, Wn(t));
1594
1807
  }
1595
1808
  };
1596
- function xn(e) {
1809
+ function Wn(e) {
1597
1810
  return e.replace(/\r\n?/g, "\n").trim();
1598
1811
  }
1599
- //#endregion
1600
- //#region src/label-editing/index.ts
1601
- var Sn = {
1812
+ // src/label-editing/index.ts
1813
+ var Gn = {
1602
1814
  __depends__: [Pe],
1603
1815
  __init__: ["vcLabelEditingProvider"],
1604
- vcLabelEditingProvider: ["type", bn]
1605
- }, Cn = {
1816
+ vcLabelEditingProvider: ["type", Un]
1817
+ }, Kn = {
1606
1818
  __depends__: [v],
1607
1819
  __init__: ["vcColorPickerProvider"],
1608
- vcColorPickerProvider: ["type", gn]
1609
- }, wn = {
1820
+ vcColorPickerProvider: ["type", zn]
1821
+ }, qn = {
1610
1822
  __depends__: [
1611
1823
  v,
1612
1824
  Fe,
1613
1825
  Ie
1614
1826
  ],
1615
1827
  __init__: ["vcAlignMenuProvider"],
1616
- vcAlignMenuProvider: ["type", _n]
1617
- }, Tn = /* @__PURE__ */ new Set(["undo", "redo"]), En = class extends ze {
1828
+ vcAlignMenuProvider: ["type", Bn]
1829
+ }, Jn = 1e4, Yn = ["palette.trigger", "contextPad.trigger"], Xn = class {
1830
+ static $inject = ["eventBus", "canvas"];
1831
+ constructor(e, t) {
1832
+ e.on("keyboard.keydown", Jn, (e) => Zn(e.keyEvent) ? void 0 : !1), e.on(Yn, (e) => {
1833
+ let n = e.event?.type;
1834
+ n === "dragstart" || n === "click" && Qn(e.event) ? t.focus() : n === "click" && t.restoreFocus();
1835
+ });
1836
+ }
1837
+ };
1838
+ function Zn(e) {
1839
+ return typeof e.key == "string" && !e.defaultPrevented && !e.isComposing;
1840
+ }
1841
+ function Qn(e) {
1842
+ return (e?.detail ?? 0) > 0;
1843
+ }
1844
+ // src/keyboard/VcKeyboardBindings.ts
1845
+ var $n = /* @__PURE__ */ new Set(["undo", "redo"]), er = class extends ze {
1618
1846
  static $inject = [
1619
1847
  "eventBus",
1620
1848
  "keyboard",
@@ -1625,25 +1853,25 @@ var Sn = {
1625
1853
  super(e, t), this.undoRedoKeys = n?.undoRedoKeys ?? !0;
1626
1854
  }
1627
1855
  registerBindings(e, t) {
1628
- let n = this.undoRedoKeys ? t : Object.create(t, { isRegistered: { value: (e) => !Tn.has(e) && t.isRegistered(e) } });
1856
+ let n = this.undoRedoKeys ? t : Object.create(t, { isRegistered: { value: (e) => !$n.has(e) && t.isRegistered(e) } });
1629
1857
  super.registerBindings(e, n);
1630
1858
  let r = (n, r) => {
1631
1859
  t.isRegistered(n) && e.addListener(r);
1632
1860
  }, i = (e, n) => {
1633
1861
  r(e, (r) => {
1634
1862
  let i = r.keyEvent;
1635
- if (y(n, i) && !Be(i)) return t.trigger(e, {}), !0;
1863
+ if (He(n, i) && !Be(i)) return t.trigger(e, {}), !0;
1636
1864
  });
1637
1865
  };
1638
1866
  i("lassoTool", ["l", "L"]), i("handTool", ["h", "H"]), i("spaceTool", ["s", "S"]), i("globalConnectTool", ["c", "C"]), i("directEditing", ["e", "E"]), r("selectAll", (e) => {
1639
1867
  let n = e.keyEvent;
1640
- if (Ve(n) && y(["a", "A"], n) && !n.shiftKey && !n.altKey) return t.trigger("selectAll", {}), !0;
1868
+ if (Ve(n) && He(["a", "A"], n) && !n.shiftKey && !n.altKey) return t.trigger("selectAll", {}), !0;
1641
1869
  });
1642
1870
  }
1643
- }, Dn = 1500, On = class {
1871
+ }, tr = 1500, nr = class {
1644
1872
  static $inject = ["eventBus", "injector"];
1645
1873
  constructor(e, t) {
1646
- e.on("editorActions.init", Dn, (e) => {
1874
+ e.on("editorActions.init", tr, (e) => {
1647
1875
  let { editorActions: n } = e, r = t.get("vcReadOnly", !1), i = () => !r?.isReadOnly(), a = (e, r, i, a = () => !0) => {
1648
1876
  let o = t.get(r, !1);
1649
1877
  o && n.register({ [e]: () => {
@@ -1652,7 +1880,7 @@ var Sn = {
1652
1880
  };
1653
1881
  a("handTool", "handTool", (e) => e.toggle()), a("lassoTool", "lassoTool", (e) => e.toggle()), a("spaceTool", "spaceTool", (e) => e.toggle(), i), a("globalConnectTool", "globalConnect", (e) => e.toggle(), i);
1654
1882
  let o = t.get("elementRegistry", !1), s = t.get("selection", !1);
1655
- o && s && n.register({ selectAll: () => s.select(o.filter(E)) });
1883
+ o && s && n.register({ selectAll: () => s.select(o.filter(w)) });
1656
1884
  let c = t.get("directEditing", !1);
1657
1885
  c && s && n.register({ directEditing: () => {
1658
1886
  let e = s.get();
@@ -1660,53 +1888,54 @@ var Sn = {
1660
1888
  } });
1661
1889
  });
1662
1890
  }
1663
- }, kn = {
1891
+ }, rr = {
1664
1892
  __depends__: [Le, Re],
1665
- __init__: ["vcEditorActions"],
1666
- keyboardBindings: ["type", En],
1667
- vcEditorActions: ["type", On]
1668
- }, An = class extends He {
1893
+ __init__: ["vcEditorActions", "vcCanvasKeys"],
1894
+ keyboardBindings: ["type", er],
1895
+ vcEditorActions: ["type", nr],
1896
+ vcCanvasKeys: ["type", Xn]
1897
+ }, ir = class extends Ue {
1669
1898
  static $inject = ["eventBus"];
1670
1899
  constructor(e) {
1671
1900
  super(e);
1672
1901
  }
1673
1902
  getOrdering(e, t) {
1674
- return T(e) ? {
1903
+ return C(e) ? {
1675
1904
  parent: t,
1676
- index: (t.children ?? []).filter((t) => t !== e && T(t)).length
1905
+ index: (t.children ?? []).filter((t) => t !== e && C(t)).length
1677
1906
  } : { parent: t };
1678
1907
  }
1679
- }, jn = {
1908
+ }, ar = {
1680
1909
  __init__: ["vcOrderingProvider"],
1681
- vcOrderingProvider: ["type", An]
1682
- }, Mn = class {
1910
+ vcOrderingProvider: ["type", ir]
1911
+ }, or = class {
1683
1912
  static $inject = ["eventBus"];
1684
1913
  constructor(e) {
1685
1914
  e.on("copyPaste.copyElement", (e) => {
1686
1915
  let { descriptor: t, element: n } = e;
1687
- S(n) ? (t.vcType = n.vcType, t.vcLabel = n.vcLabel, n.color !== void 0 && (t.color = n.color), n.link !== void 0 && (t.link = n.link)) : T(n) && (t.vcType = n.vcType);
1916
+ b(n) ? (t.vcType = n.vcType, t.vcLabel = n.vcLabel, n.color !== void 0 && (t.color = n.color), n.link !== void 0 && (t.link = n.link)) : C(n) && (t.vcType = n.vcType);
1688
1917
  });
1689
1918
  }
1690
- }, Nn = {
1691
- __depends__: [Ue],
1919
+ }, sr = {
1920
+ __depends__: [We],
1692
1921
  __init__: ["vcCopyPasteBehavior"],
1693
- vcCopyPasteBehavior: ["type", Mn]
1694
- }, Pn = class {
1922
+ vcCopyPasteBehavior: ["type", or]
1923
+ }, cr = class {
1695
1924
  static $inject = ["eventBus"];
1696
1925
  constructor(e) {
1697
1926
  e.on("resize.start", (e) => {
1698
- S(e.context.shape) && (e.context.minDimensions = { ...i });
1927
+ b(e.context.shape) && (e.context.minDimensions = { ...i });
1699
1928
  }), e.on("spaceTool.getMinDimensions", (e) => {
1700
1929
  let t = {};
1701
- for (let n of e.shapes) S(n) && (t[n.id] = { ...i });
1930
+ for (let n of e.shapes) b(n) && (t[n.id] = { ...i });
1702
1931
  return t;
1703
1932
  });
1704
1933
  }
1705
- }, Fn = {
1706
- __depends__: [We],
1934
+ }, lr = {
1935
+ __depends__: [Ge],
1707
1936
  __init__: ["vcResizeBehavior"],
1708
- vcResizeBehavior: ["type", Pn]
1709
- }, In = "valueChain.readOnly.changed", G = 5e3, Ln = [
1937
+ vcResizeBehavior: ["type", cr]
1938
+ }, ur = "valueChain.readOnly.changed", q = 5e3, dr = [
1710
1939
  "elements.move",
1711
1940
  "shape.move",
1712
1941
  "shape.resize",
@@ -1720,32 +1949,32 @@ var Sn = {
1720
1949
  "elements.delete",
1721
1950
  "elements.align",
1722
1951
  "elements.distribute"
1723
- ], Rn = class extends Ce {
1952
+ ], fr = class extends Ce {
1724
1953
  bus;
1725
1954
  injector;
1726
1955
  static $inject = ["eventBus", "injector"];
1727
1956
  readOnly = !1;
1728
1957
  constructor(e, t) {
1729
- super(e), this.bus = e, this.injector = t, e.on("copyPaste.pasteElements", G, () => !this.readOnly && void 0), e.on("directEditing.activate.allowed", G, () => !this.readOnly && void 0);
1958
+ super(e), this.bus = e, this.injector = t, e.on("copyPaste.pasteElements", q, () => !this.readOnly && void 0), e.on("directEditing.activate.allowed", q, () => !this.readOnly && void 0);
1730
1959
  }
1731
1960
  init() {
1732
- this.addRule(Ln, G, () => !this.readOnly && void 0);
1961
+ this.addRule(dr, q, () => !this.readOnly && void 0);
1733
1962
  }
1734
1963
  isReadOnly() {
1735
1964
  return this.readOnly;
1736
1965
  }
1737
1966
  setReadOnly(e) {
1738
- this.readOnly !== e && (this.readOnly = e, e && this.interruptEdits(), this.bus.fire(In, { readOnly: e }));
1967
+ this.readOnly !== e && (this.readOnly = e, e && this.interruptEdits(), this.bus.fire(ur, { readOnly: e }));
1739
1968
  }
1740
1969
  interruptEdits() {
1741
1970
  let e = (e) => this.injector.get(e, !1);
1742
1971
  e("directEditing")?.cancel(), e("dragging")?.cancel(), e("popupMenu")?.close(), e("contextPad")?.close();
1743
1972
  }
1744
- }, zn = {
1973
+ }, pr = {
1745
1974
  __depends__: [Se],
1746
1975
  __init__: ["vcReadOnly"],
1747
- vcReadOnly: ["type", Rn]
1748
- }, Bn = class extends N {
1976
+ vcReadOnly: ["type", fr]
1977
+ }, mr = class extends F {
1749
1978
  _getModules() {
1750
1979
  return [
1751
1980
  ...super._getModules(),
@@ -1758,20 +1987,20 @@ var Sn = {
1758
1987
  me,
1759
1988
  he,
1760
1989
  ge,
1761
- zn,
1762
- Ht,
1763
- qt,
1764
- Yt,
1765
- cn,
1766
- mn,
1990
+ pr,
1991
+ fn,
1992
+ _n,
1767
1993
  yn,
1768
- Sn,
1769
- Cn,
1770
- wn,
1771
- kn,
1772
1994
  jn,
1773
- Nn,
1774
- Fn
1995
+ Ln,
1996
+ Hn,
1997
+ Gn,
1998
+ Kn,
1999
+ qn,
2000
+ rr,
2001
+ ar,
2002
+ sr,
2003
+ lr
1775
2004
  ];
1776
2005
  }
1777
2006
  undo() {
@@ -1786,19 +2015,19 @@ var Sn = {
1786
2015
  canRedo() {
1787
2016
  return this.get("commandStack").canRedo();
1788
2017
  }
1789
- }, Vn = "value-chain", Hn = "New value chain";
1790
- function Un(e = {}) {
1791
- return qn(new Bn({
1792
- ...Gn(e),
2018
+ }, hr = "value-chain", gr = "New value chain";
2019
+ function _r(e = {}) {
2020
+ return xr(new mr({
2021
+ ...yr(e),
1793
2022
  undoRedoKeys: e.undoRedoKeys ?? !0,
1794
2023
  freeArea: e.freeArea,
1795
2024
  freeRectCenter: e.freeRectCenter
1796
2025
  }), !0);
1797
2026
  }
1798
- function Wn(e = {}) {
1799
- return qn(new N(Gn(e)), !1);
2027
+ function vr(e = {}) {
2028
+ return xr(new F(yr(e)), !1);
1800
2029
  }
1801
- function Gn(e) {
2030
+ function yr(e) {
1802
2031
  return {
1803
2032
  width: "100%",
1804
2033
  height: "100%",
@@ -1806,13 +2035,13 @@ function Gn(e) {
1806
2035
  fitOnImport: e.fitOnImport ?? !0
1807
2036
  };
1808
2037
  }
1809
- function Kn(e) {
1810
- return e.trim() === "" ? o(Hn) : u(e);
2038
+ function br(e) {
2039
+ return e.trim() === "" ? o(gr) : u(e);
1811
2040
  }
1812
- function qn(e, t) {
2041
+ function xr(e, t) {
1813
2042
  let n = e.get("eventBus"), r = e.get("canvas"), i = e.get("elementRegistry"), a = e.get("selection"), o = e.get("vcBounds"), s = /* @__PURE__ */ new Set(), c = !1, l = "", u = {
1814
- notation: Vn,
1815
- apiVersion: Ge,
2043
+ notation: hr,
2044
+ apiVersion: Ke,
1816
2045
  editable: t
1817
2046
  };
1818
2047
  return t && n.on("commandStack.changed", () => {
@@ -1820,21 +2049,21 @@ function qn(e, t) {
1820
2049
  }), {
1821
2050
  meta: u,
1822
2051
  elements: {
1823
- list: () => c ? [] : i.getAll().filter(S).map(Jn),
2052
+ list: () => c ? [] : i.getAll().filter(b).map(Cr),
1824
2053
  reveal(e) {
1825
2054
  if (c) return !1;
1826
2055
  let t = i.get(e);
1827
- return S(t) ? (a.select(t), r.scrollToElement(t), !0) : !1;
2056
+ return b(t) ? (a.select(t), r.scrollToElement(t), !0) : !1;
1828
2057
  },
1829
- selection: () => c ? [] : K(a.get()),
2058
+ selection: () => c ? [] : Sr(a.get()),
1830
2059
  onSelection(e) {
1831
- let t = (t) => e(K(t.newSelection ?? []));
2060
+ let t = (t) => e(Sr(t.newSelection ?? []));
1832
2061
  return n.on("selection.changed", t), () => n.off("selection.changed", t);
1833
2062
  },
1834
2063
  bounds(e) {
1835
2064
  if (c) return;
1836
2065
  let t = i.get(e);
1837
- if (!S(t)) return;
2066
+ if (!b(t)) return;
1838
2067
  let { x: n, y: r, width: a, height: o } = t;
1839
2068
  return {
1840
2069
  x: n,
@@ -1851,7 +2080,7 @@ function qn(e, t) {
1851
2080
  importText(t) {
1852
2081
  if (c) return Promise.reject(/* @__PURE__ */ Error("The modeler was destroyed."));
1853
2082
  try {
1854
- let n = e.importDocument(Kn(t));
2083
+ let n = e.importDocument(br(t));
1855
2084
  return Promise.resolve({ warnings: n.map((e) => e.message) });
1856
2085
  } catch (e) {
1857
2086
  return Promise.reject(e instanceof Error ? e : Error(String(e)));
@@ -1871,13 +2100,13 @@ function qn(e, t) {
1871
2100
  width: n,
1872
2101
  height: i
1873
2102
  };
1874
- return Yn(a) ? a : void 0;
2103
+ return wr(a) ? a : void 0;
1875
2104
  } catch {
1876
2105
  return;
1877
2106
  }
1878
2107
  },
1879
2108
  setViewState(e) {
1880
- !c && Yn(e) && r.viewbox({
2109
+ !c && wr(e) && r.viewbox({
1881
2110
  x: e.x,
1882
2111
  y: e.y,
1883
2112
  width: e.width,
@@ -1899,26 +2128,25 @@ function qn(e, t) {
1899
2128
  }
1900
2129
  };
1901
2130
  }
1902
- function K(e) {
1903
- return e.filter(S).map((e) => e.id);
2131
+ function Sr(e) {
2132
+ return e.filter(b).map((e) => e.id);
1904
2133
  }
1905
- function Jn(e) {
2134
+ function Cr(e) {
1906
2135
  return e.vcLabel ? {
1907
2136
  id: e.id,
1908
2137
  name: e.vcLabel
1909
2138
  } : { id: e.id };
1910
2139
  }
1911
- function Yn(e) {
2140
+ function wr(e) {
1912
2141
  if (typeof e != "object" || !e) return !1;
1913
2142
  let { x: t, y: n, width: r, height: i } = e;
1914
- return q(t) && q(n) && q(r) && q(i) && r > 0 && i > 0;
2143
+ return J(t) && J(n) && J(r) && J(i) && r > 0 && i > 0;
1915
2144
  }
1916
- function q(e) {
2145
+ function J(e) {
1917
2146
  return typeof e == "number" && Number.isFinite(e);
1918
2147
  }
1919
- //#endregion
1920
- //#region src/diagram-menu/menu.ts
1921
- function J(e, t, n, r) {
2148
+ // src/diagram-menu/menu.ts
2149
+ function Y(e, t, n, r) {
1922
2150
  return {
1923
2151
  kind: "action",
1924
2152
  id: e,
@@ -1928,14 +2156,14 @@ function J(e, t, n, r) {
1928
2156
  onSelect: () => n.onSelect()
1929
2157
  };
1930
2158
  }
1931
- var Y = "Export as JSON";
1932
- function Xn(e) {
2159
+ var X = "Export as JSON";
2160
+ function Tr(e) {
1933
2161
  let { exports: t } = e;
1934
2162
  return {
1935
2163
  export: [
1936
- J("export-png", "Export as PNG", t.png, "file-image"),
1937
- J("export-svg", "Export as SVG", t.svg, "file-code-corner"),
1938
- ...t.json ? [J("export-json", Y, t.json)] : []
2164
+ Y("export-png", "Export as PNG", t.png, "file-image"),
2165
+ Y("export-svg", "Export as SVG", t.svg, "file-code-corner"),
2166
+ ...t.json ? [Y("export-json", X, t.json)] : []
1939
2167
  ],
1940
2168
  help: [{
1941
2169
  kind: "dialog",
@@ -1946,25 +2174,24 @@ function Xn(e) {
1946
2174
  }]
1947
2175
  };
1948
2176
  }
1949
- //#endregion
1950
- //#region src/diagram-menu/shortcuts.ts
1951
- var X = [
2177
+ // src/diagram-menu/shortcuts.ts
2178
+ var Z = [
1952
2179
  "←",
1953
2180
  "↑",
1954
2181
  "→",
1955
2182
  "↓"
1956
2183
  ];
1957
- function Zn(e, t, n) {
2184
+ function Er(e, t, n) {
1958
2185
  return t === "mac" ? `⌘${e}` : `${n.ctrl}+${e}`;
1959
2186
  }
1960
- function Qn(e) {
2187
+ function Dr(e) {
1961
2188
  try {
1962
2189
  return new Intl.NumberFormat(e, { style: "percent" }).format(1);
1963
2190
  } catch {
1964
2191
  return new Intl.NumberFormat("en", { style: "percent" }).format(1);
1965
2192
  }
1966
2193
  }
1967
- function $n(e, t) {
2194
+ function Or(e, t) {
1968
2195
  if (e === "mac") return {
1969
2196
  zoomIn: "⌘+",
1970
2197
  zoomOut: "⌘−",
@@ -1979,7 +2206,7 @@ function $n(e, t) {
1979
2206
  fit: `${r}+1`
1980
2207
  };
1981
2208
  }
1982
- function er(e, t) {
2209
+ function kr(e, t) {
1983
2210
  if (e === "mac") return {
1984
2211
  undo: ["⌘Z"],
1985
2212
  redo: ["⌘⇧Z"],
@@ -1989,8 +2216,8 @@ function er(e, t) {
1989
2216
  paste: ["⌘V"],
1990
2217
  duplicate: ["⌘D"],
1991
2218
  remove: ["⌫"],
1992
- coarseMove: X.map((e) => `⇧${e}`),
1993
- moveCanvas: X.map((e) => `⌘${e}`),
2219
+ coarseMove: Z.map((e) => `⇧${e}`),
2220
+ moveCanvas: Z.map((e) => `⌘${e}`),
1994
2221
  lassoDrag: ["⇧ Drag"]
1995
2222
  };
1996
2223
  let { ctrl: n, shift: r } = t;
@@ -2003,28 +2230,28 @@ function er(e, t) {
2003
2230
  paste: [`${n}+V`],
2004
2231
  duplicate: [`${n}+D`],
2005
2232
  remove: ["Del", "Backspace"],
2006
- coarseMove: X.map((e) => `${r}+${e}`),
2007
- moveCanvas: X.map((e) => `${n}+${e}`),
2233
+ coarseMove: Z.map((e) => `${r}+${e}`),
2234
+ moveCanvas: Z.map((e) => `${n}+${e}`),
2008
2235
  lassoDrag: [`${r}+Drag`]
2009
2236
  };
2010
2237
  }
2011
- function tr(e) {
2238
+ function Ar(e) {
2012
2239
  let { platform: t, messages: n } = e;
2013
2240
  return {
2014
2241
  title: "File",
2015
2242
  rows: [{
2016
2243
  action: n.openFile ?? "Open…",
2017
- keys: [Zn("O", t, n.keyNames)]
2244
+ keys: [Er("O", t, n.keyNames)]
2018
2245
  }, {
2019
- action: Y,
2020
- keys: [Zn("S", t, n.keyNames)]
2246
+ action: X,
2247
+ keys: [Er("S", t, n.keyNames)]
2021
2248
  }]
2022
2249
  };
2023
2250
  }
2024
- function nr(e, t = {}) {
2025
- let { platform: n, messages: r } = e, i = $n(n, r.keyNames), a = er(n, r.keyNames);
2251
+ function jr(e, t = {}) {
2252
+ let { platform: n, messages: r } = e, i = Or(n, r.keyNames), a = kr(n, r.keyNames);
2026
2253
  return [
2027
- ...t.fileKeys ? [tr(e)] : [],
2254
+ ...t.fileKeys ? [Ar(e)] : [],
2028
2255
  {
2029
2256
  title: "View",
2030
2257
  rows: [
@@ -2037,7 +2264,7 @@ function nr(e, t = {}) {
2037
2264
  keys: [i.zoomOut]
2038
2265
  },
2039
2266
  {
2040
- action: r.zoomToActual(Qn(e.lang)),
2267
+ action: r.zoomToActual(Dr(e.lang)),
2041
2268
  keys: [i.zoomToActual]
2042
2269
  },
2043
2270
  {
@@ -2091,7 +2318,7 @@ function nr(e, t = {}) {
2091
2318
  },
2092
2319
  {
2093
2320
  action: "Move selection",
2094
- keys: X
2321
+ keys: Z
2095
2322
  },
2096
2323
  {
2097
2324
  action: "Move selection in large steps",
@@ -2130,41 +2357,40 @@ function nr(e, t = {}) {
2130
2357
  }
2131
2358
  ];
2132
2359
  }
2133
- //#endregion
2134
- //#region src/diagram-menu/ShortcutsDialog.ts
2135
- var Z = "vc-shortcuts", Q = "vc-shortcuts-title";
2360
+ // src/diagram-menu/ShortcutsDialog.ts
2361
+ var Q = "vc-shortcuts", Mr = "vc-shortcuts-title";
2136
2362
  function $(e, t, n) {
2137
2363
  let r = document.createElement(e);
2138
2364
  return r.className = t, n !== void 0 && (r.textContent = n), r;
2139
2365
  }
2140
- function rr(e, t) {
2141
- let n = $("section", `${Z}-group`), r = `${Q}-group-${t}`, i = $("h4", `${Z}-group-title`, e.title);
2366
+ function Nr(e, t) {
2367
+ let n = $("section", `${Q}-group`), r = `${Mr}-group-${t}`, i = $("h4", `${Q}-group-title`, e.title);
2142
2368
  i.id = r;
2143
- let a = $("table", `${Z}-table`);
2369
+ let a = $("table", `${Q}-table`);
2144
2370
  a.setAttribute("aria-labelledby", r);
2145
2371
  let o = a.createTBody();
2146
2372
  for (let t of e.rows) {
2147
- let e = o.insertRow(), n = $("th", `${Z}-action`, t.action);
2373
+ let e = o.insertRow(), n = $("th", `${Q}-action`, t.action);
2148
2374
  n.scope = "row";
2149
- let r = $("td", `${Z}-keys`);
2150
- for (let e of t.keys) r.append($("kbd", `${Z}-key`, e));
2375
+ let r = $("td", `${Q}-keys`);
2376
+ for (let e of t.keys) r.append($("kbd", `${Q}-key`, e));
2151
2377
  e.append(n, r);
2152
2378
  }
2153
2379
  return n.append(i, a), n;
2154
2380
  }
2155
- function ir(e, t, n) {
2156
- let r = $("div", `${Z}-panel`), i = $("header", `${Z}-header`), a = $("h3", `${Z}-title`, "Keyboard shortcuts");
2157
- a.id = Q;
2158
- let o = $("button", `${Z}-close`);
2159
- o.type = "button", o.setAttribute("aria-label", e.messages.close), o.innerHTML = I("x"), o.addEventListener("click", n), i.append(a, o);
2160
- let s = $("div", `${Z}-body`);
2161
- return s.append(...nr(e, t).map(rr)), r.append(i, s), r;
2381
+ function Pr(e, t, n) {
2382
+ let r = $("div", `${Q}-panel`), i = $("header", `${Q}-header`), a = $("h3", `${Q}-title`, "Keyboard shortcuts");
2383
+ a.id = Mr;
2384
+ let o = $("button", `${Q}-close`);
2385
+ o.type = "button", o.setAttribute("aria-label", e.messages.close), o.innerHTML = R("x"), o.addEventListener("click", n), i.append(a, o);
2386
+ let s = $("div", `${Q}-body`);
2387
+ return s.append(...jr(e, t).map(Nr)), r.append(i, s), r;
2162
2388
  }
2163
- function ar(e, t = {}) {
2389
+ function Fr(e, t = {}) {
2164
2390
  let n;
2165
2391
  function r() {
2166
- let n = $("dialog", Z);
2167
- return n.setAttribute("aria-labelledby", Q), n.append(ir(e, t, () => n.close())), n.addEventListener("click", (e) => {
2392
+ let n = $("dialog", Q);
2393
+ return n.setAttribute("aria-labelledby", Mr), n.append(Pr(e, t, () => n.close())), n.addEventListener("click", (e) => {
2168
2394
  e.target === n && n.close();
2169
2395
  }), n.addEventListener("close", () => {
2170
2396
  e.menu.trigger.hidden || e.menu.trigger.focus({ preventScroll: !0 });
@@ -2183,7 +2409,6 @@ function ar(e, t = {}) {
2183
2409
  }
2184
2410
  };
2185
2411
  }
2186
- //#endregion
2187
- export { H as ALIGN_MENU_PROVIDER_ID, Hn as BLANK_DOCUMENT_NAME, A as COLORS, st as COLOR_OPTIONS, V as COLOR_PICKER_PROVIDER_ID, j as FONT, R as ICONS, Y as JSON_EXPORT_LABEL, Bn as Modeler, N as NavigatedViewer, In as READ_ONLY_CHANGED_EVENT, M as ROOT_ID, Vn as VALUE_CHAIN_NOTATION, _n as VcAlignMenuProvider, Xt as VcAppend, Ye as VcBaseViewer, pt as VcBounds, gn as VcColorPickerProvider, Jt as VcConnect, Rt as VcConnectionTypeBehavior, vn as VcContextPadProvider, Mn as VcCopyPasteBehavior, nt as VcDiagramElementFactory, On as VcEditorActions, Ze as VcElementFactory, vt as VcExporter, _t as VcImporter, En as VcKeyboardBindings, bn as VcLabelEditingProvider, jt as VcLayouter, Dt as VcModeling, An as VcOrderingProvider, fn as VcPaletteProvider, Rn as VcReadOnly, dt as VcRenderer, Pn as VcResizeBehavior, Ut as VcRules, Ct as Viewer, xt as blobToBase64, it as chevronPath, O as chevronPathAt, Un as createCollaborativeModeler, Wn as createCollaborativeViewer, ar as createShortcutsDialog, Xn as diagramMenu, nr as diagramShortcuts, k as ellipsePathAt, St as ioModule, w as isOrgUnit, C as isStep, T as isVcConnection, E as isVcElement, S as isVcShape, D as notchDepth, b as saveSVG, yt as svgToPng, wn as vcAlignMenuModule, cn as vcAppendModule, mt as vcBoundsModule, Cn as vcColorPickerModule, Yt as vcConnectModule, yn as vcContextPadModule, Nn as vcCopyPasteModule, ft as vcDrawModule, kn as vcKeyboardModule, Sn as vcLabelEditingModule, rt as vcModelModule, Ht as vcModelingModule, jn as vcOrderingModule, mn as vcPaletteModule, zn as vcReadOnlyModule, Fn as vcResizeModule, qt as vcRulesModule };
2412
+ export { W as ALIGN_MENU_PROVIDER_ID, gr as BLANK_DOCUMENT_NAME, D as COLORS, ct as COLOR_OPTIONS, U as COLOR_PICKER_PROVIDER_ID, O as FONT, B as ICONS, X as JSON_EXPORT_LABEL, mr as Modeler, F as NavigatedViewer, ur as READ_ONLY_CHANGED_EVENT, P as ROOT_ID, hr as VALUE_CHAIN_NOTATION, Bn as VcAlignMenuProvider, bn as VcAppend, Ze as VcBaseViewer, It as VcBounds, zn as VcColorPickerProvider, vn as VcConnect, cn as VcConnectionTypeBehavior, Vn as VcContextPadProvider, or as VcCopyPasteBehavior, it as VcDiagramElementFactory, nr as VcEditorActions, $e as VcElementFactory, Vt as VcExporter, Bt as VcImporter, er as VcKeyboardBindings, Un as VcLabelEditingProvider, en as VcLayouter, Xt as VcModeling, ir as VcOrderingProvider, Fn as VcPaletteProvider, fr as VcReadOnly, Ft as VcRenderer, cr as VcResizeBehavior, pn as VcRules, Kt as Viewer, Wt as blobToBase64, wt as chevronPath, j as chevronPathAt, _r as createCollaborativeModeler, vr as createCollaborativeViewer, Fr as createShortcutsDialog, Tr as diagramMenu, jr as diagramShortcuts, M as ellipsePathAt, Gt as ioModule, S as isOrgUnit, x as isStep, C as isVcConnection, w as isVcElement, b as isVcShape, A as notchDepth, Xe as saveSVG, Ht as svgToPng, qn as vcAlignMenuModule, jn as vcAppendModule, Lt as vcBoundsModule, Kn as vcColorPickerModule, yn as vcConnectModule, Hn as vcContextPadModule, sr as vcCopyPasteModule, N as vcDrawModule, rr as vcKeyboardModule, Gn as vcLabelEditingModule, at as vcModelModule, fn as vcModelingModule, ar as vcOrderingModule, Ln as vcPaletteModule, pr as vcReadOnlyModule, lr as vcResizeModule, _n as vcRulesModule };
2188
2413
 
2189
2414
  //# sourceMappingURL=index.js.map