@nxgt/material 1.13.0 → 1.16.0

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 (150) hide show
  1. package/README.md +4 -0
  2. package/dist/abnfDiagram-O67JEVCF-mm89LXw2.js +89 -0
  3. package/dist/architecture-7GRP2DOG-DDr0RGVC.js +3 -0
  4. package/dist/architectureDiagram-NJMV4G6O-CGoA5SIv.js +4146 -0
  5. package/dist/array-CApNbSU9.js +6 -0
  6. package/dist/blockDiagram-BEXU5L5S-Dq8gitB4.js +1946 -0
  7. package/dist/c4Diagram-YGBWAQC7-DO_alqIu.js +2990 -0
  8. package/dist/channel-1fT-W0NS.js +5 -0
  9. package/dist/chunk-2Q5K7J3B-kzxEEeTu.js +15 -0
  10. package/dist/chunk-3FUC2YCW-C3yD2fMw.js +364 -0
  11. package/dist/chunk-5DYCD2WN-Dn2jrYde.js +37 -0
  12. package/dist/chunk-5VM5RSS4-Cr17nBXp.js +5 -0
  13. package/dist/chunk-6AEJRKK7-JyfUnUEu.js +10 -0
  14. package/dist/chunk-742MDFTN-BbWkrtj2.js +275 -0
  15. package/dist/chunk-7INBJB4K-C3x7JNTG.js +4487 -0
  16. package/dist/chunk-7M6MHVWA-Cc7UTu4b.js +4256 -0
  17. package/dist/chunk-7PRAP22T-C8rsGRvH.js +67 -0
  18. package/dist/chunk-DUW6YSOI-BdOla2G8.js +10 -0
  19. package/dist/chunk-FOHPRMQF-Crq0JMf2.js +21388 -0
  20. package/dist/chunk-GNY47TPC-d-Bi8r0p.js +75 -0
  21. package/dist/chunk-GTNCS2PH-CTS015lZ.js +490 -0
  22. package/dist/chunk-GWA4HPMP-B4pgM-E1.js +61 -0
  23. package/dist/chunk-J5ZVWO5B-CYzz6Pq8.js +12 -0
  24. package/dist/chunk-JWPE2WC7-Ccb0QaC8.js +8 -0
  25. package/dist/chunk-LNGE3PJU-CiGrDO_F.js +1513 -0
  26. package/dist/chunk-MBY4JIJT-Dg6AeftH.js +1847 -0
  27. package/dist/chunk-NETBCI7D-TXZM0vKz.js +236 -0
  28. package/dist/chunk-O7XYJQB3-md6vjVm4.js +3922 -0
  29. package/dist/chunk-UA2S7LBM-DQTYPe9y.js +363 -0
  30. package/dist/chunk-WEXAMYUT-DmKWJz6y.js +26 -0
  31. package/dist/chunk-XXDRQBXY-C9XIYQdM.js +9 -0
  32. package/dist/chunk-Y2CYZVJY-i11wjrBe.js +12 -0
  33. package/dist/chunk-Z7XXMR3K-BoDf6lxl.js +677 -0
  34. package/dist/chunk-ZIGJFQKS-CP5430fN.js +663 -0
  35. package/dist/classDiagram-v2-NBCMYWYE-6KoTmufe.js +3397 -0
  36. package/dist/components.js +3 -3
  37. package/dist/cose-bilkent-JH36ORCC-CejnZl_t.js +2251 -0
  38. package/dist/cynefin-OW5HDTMX-B8HVdZhp.js +3 -0
  39. package/dist/cynefinDiagram-VND7K2PF-DZnc0dlm.js +349 -0
  40. package/dist/cytoscape.esm-_jXi1N4y.js +18151 -0
  41. package/dist/dagre-6A5THRUB-cuS57NO5.js +2192 -0
  42. package/dist/diagram-22UHCM2B-zQSFmH0t.js +5084 -0
  43. package/dist/diagram-3UASUU5V-D45Fgu1j.js +724 -0
  44. package/dist/diagram-ATOU4E4O-YMtQnlqd.js +432 -0
  45. package/dist/diagram-CDSNMT55-DP7UmEW1.js +301 -0
  46. package/dist/diagram-MLGK6HIB-WvSqrTRC.js +134 -0
  47. package/dist/diagram-MPIPVDR6-C2F3__mt.js +214 -0
  48. package/dist/dist-1DdJvBEt.js +50 -0
  49. package/dist/{dist-BGGDEbJ3.js → dist-DppLdkXt.js} +2 -2
  50. package/dist/dnd.js +2 -2
  51. package/dist/ebnfDiagram-ZINNZB2B-BZC6cSiy.js +100 -0
  52. package/dist/elk-276RUBZZ-7DJf1MEV.js +47598 -0
  53. package/dist/erDiagram-OPXOYQCR-YKlEVEF0.js +1970 -0
  54. package/dist/eventmodeling-NTZA5JFV-C1CEo-26.js +3 -0
  55. package/dist/flowDiagram-KWPJA3E3-DyLvzIlg.js +17 -0
  56. package/dist/ganttDiagram-FUAMR5RP-KIaOrYOF.js +2928 -0
  57. package/dist/gitGraph-4MIJSDKK-BTeCS_5q.js +3 -0
  58. package/dist/gitGraphDiagram-X574FWY7-DpFW-7JE.js +729 -0
  59. package/dist/graphlib-DFaO_iIU.js +372 -0
  60. package/dist/{hooks-DReKyuyc.js → hooks-C5xy0u03.js} +1 -1
  61. package/dist/hooks.js +1 -1
  62. package/dist/{i18n-DtDrodl8.js → i18n-Cech9IAc.js} +314 -841
  63. package/dist/i18n.js +1 -1
  64. package/dist/info-A6RAGUB7-BvtuPd9C.js +3 -0
  65. package/dist/infoDiagram-VRGFBTTK-H3F-BCnu.js +20 -0
  66. package/dist/init-Buj1GKRa.js +27 -0
  67. package/dist/isArrayLikeObject-VG1KOJ3m.js +539 -0
  68. package/dist/ishikawaDiagram-OU5B5YK6-DgQDmcF3.js +719 -0
  69. package/dist/journeyDiagram-ZHPQQLJL-CanDOlfn.js +884 -0
  70. package/dist/kanban-definition-PNTS6WVX-DmnUgxgb.js +976 -0
  71. package/dist/katex-BMQ6LGsM.js +21962 -0
  72. package/dist/lib/components/index.d.ts +4 -0
  73. package/dist/lib/components/ui/chat/chat-composer-mentions.d.ts +8 -0
  74. package/dist/lib/components/ui/chat/chat-composer.d.ts +5 -1
  75. package/dist/lib/components/ui/chat/chat-markdown.d.ts +2 -2
  76. package/dist/lib/components/ui/emoji/emoji-list.d.ts +5 -0
  77. package/dist/lib/components/ui/emoji/emoji-picker.d.ts +7 -0
  78. package/dist/lib/components/ui/emoji/emoji.utils.d.ts +2 -0
  79. package/dist/lib/components/ui/emoji/emoji.utils.test.d.ts +1 -0
  80. package/dist/lib/components/ui/emoji/index.d.ts +4 -0
  81. package/dist/lib/components/ui/emoji/types.d.ts +6 -0
  82. package/dist/lib/components/ui/entity-header.stories.d.ts +1 -0
  83. package/dist/lib/components/ui/kanban/kanban.stories.d.ts +1 -0
  84. package/dist/lib/components/ui/markdown/index.d.ts +3 -0
  85. package/dist/lib/components/ui/markdown/markdown.d.ts +7 -0
  86. package/dist/lib/components/ui/markdown/markdown.stories.d.ts +14 -0
  87. package/dist/lib/components/ui/markdown/markdown.test.d.ts +1 -0
  88. package/dist/lib/components/ui/markdown/markdown.utils.d.ts +1 -0
  89. package/dist/lib/components/ui/markdown/mermaid.lazy.d.ts +12 -0
  90. package/dist/lib/components/ui/markdown/partials/markdown-code.d.ts +2 -0
  91. package/dist/lib/components/ui/markdown/partials/mermaid-diagram.d.ts +4 -0
  92. package/dist/lib/components/ui/mentions/index.d.ts +3 -0
  93. package/dist/lib/components/ui/mentions/mention-list.d.ts +8 -0
  94. package/dist/lib/components/ui/mentions/mentions.utils.d.ts +7 -0
  95. package/dist/lib/components/ui/mentions/mentions.utils.test.d.ts +1 -0
  96. package/dist/lib/components/ui/mentions/types.d.ts +7 -0
  97. package/dist/lib/components/ui/rich-text-editor/extensions/mention/mention-list.d.ts +12 -1
  98. package/dist/lib/components/ui/terminal/index.d.ts +2 -0
  99. package/dist/lib/components/ui/terminal/terminal.d.ts +11 -0
  100. package/dist/lib/components/ui/terminal/terminal.stories.d.ts +14 -0
  101. package/dist/lib/components/ui/terminal/terminal.utils.d.ts +5 -0
  102. package/dist/lib/components/ui/terminal/terminal.utils.test.d.ts +1 -0
  103. package/dist/lib/i18n/resources/en/index.d.ts +7 -0
  104. package/dist/lib/i18n/resources/en/material.json.d.ts +7 -0
  105. package/dist/lib/i18n/resources/fr/index.d.ts +7 -0
  106. package/dist/lib/i18n/resources/fr/material.json.d.ts +7 -0
  107. package/dist/lib/i18n/resources/index.d.ts +14 -0
  108. package/dist/lib/i18n/translator.d.ts +1 -1
  109. package/dist/{lib-CD3tyuc8.js → lib-Bbw5QPoj.js} +472 -471
  110. package/dist/lib.js +2 -2
  111. package/dist/{main-r84Yresa.js → main-BjDU9FDM.js} +59393 -30376
  112. package/dist/main.js +6 -6
  113. package/dist/material.css +1 -1
  114. package/dist/math-C5EhTgJw.js +10 -0
  115. package/dist/mermaid-parser.core-Cz-MfB4Z.js +638 -0
  116. package/dist/mermaid.core-BI1sunfX.js +1096 -0
  117. package/dist/mindmap-definition-NLK3R4M7-DW0BIU_q.js +1008 -0
  118. package/dist/ordinal-DuP05kVQ.js +65 -0
  119. package/dist/packet-AYTQ26CC-CshIswP8.js +3 -0
  120. package/dist/path-Cjou0lUh.js +85 -0
  121. package/dist/pegDiagram-GJSIUBJH-CJIx0u4M.js +94 -0
  122. package/dist/pie-WAS4IAKB-CYs22y4X.js +3 -0
  123. package/dist/pieDiagram-5QR66LMP-zAhv5fKz.js +157 -0
  124. package/dist/quadrantDiagram-O4NWA36T-CO4n_yQo.js +2001 -0
  125. package/dist/radar-RG4KPBEZ-BOJKjbGv.js +3 -0
  126. package/dist/railroad-74A4TZTK-Dt1BmUkI.js +3 -0
  127. package/dist/railroad-abnf-HS5TGJTU-Cs9GMUMY.js +3 -0
  128. package/dist/railroad-ebnf-LZEXJU2U-D4y0fXoW.js +3 -0
  129. package/dist/railroad-peg-WCYAUIDC-D2f_ZNR5.js +3 -0
  130. package/dist/railroadDiagram-XR7U4H2S-B8iV7mfe.js +76 -0
  131. package/dist/requirementDiagram-PLB6GJNP-CGoX1NrW.js +2228 -0
  132. package/dist/rough.esm-rcMoXTJj.js +1352 -0
  133. package/dist/sankeyDiagram-IPEJSGJF-DdSM2wiI.js +962 -0
  134. package/dist/sequenceDiagram-PO4LG4MO-CCRqF5XO.js +4200 -0
  135. package/dist/sizeCapture-INFHLROL-CHXIsPO_.js +46 -0
  136. package/dist/src-B4npqWNl.js +1775 -0
  137. package/dist/stateDiagram-v2-GCMORJYK-CQTX5ks8.js +2143 -0
  138. package/dist/step-B6KjpKgN.js +706 -0
  139. package/dist/string-B-ZWXCs2.js +392 -0
  140. package/dist/swimlanes-2SLR337P-C2NNOb5n.js +4763 -0
  141. package/dist/swimlanesDiagram-TC7HE7FX-CPsqPrbP.js +28 -0
  142. package/dist/timeline-definition-EJHVYXUP-DuxGHv-N.js +1073 -0
  143. package/dist/treeView-Q6P3EWNA-BrJylG9N.js +3 -0
  144. package/dist/treemap-WGGIJYW6-DpIZuqbj.js +3 -0
  145. package/dist/usecaseDiagram-POWQR4AR-cuAeIBW3.js +9932 -0
  146. package/dist/vennDiagram-UO4OBE2U-DLwBSAnC.js +1880 -0
  147. package/dist/wardley-WFR3VGLG-CbwdAAbH.js +3 -0
  148. package/dist/wardleyDiagram-VNRHLVJA-D7IZU6vu.js +645 -0
  149. package/dist/xychartDiagram-PMCCYNJV-BDOFv_xK.js +2167 -0
  150. package/package.json +7 -1
@@ -0,0 +1,4487 @@
1
+ import { n as e, t } from "./src-B4npqWNl.js";
2
+ import { a as n, p as r, r as i, u as a } from "./chunk-ZIGJFQKS-CP5430fN.js";
3
+ import { n as o } from "./chunk-Y2CYZVJY-i11wjrBe.js";
4
+ import { A as s, B as c, M as l, T as u, b as d, f, g as p, x as m, z as h } from "./chunk-O7XYJQB3-md6vjVm4.js";
5
+ import { n as g, t as _ } from "./chunk-742MDFTN-BbWkrtj2.js";
6
+ import { n as v, r as y } from "./chunk-MBY4JIJT-Dg6AeftH.js";
7
+ import { a as b, i as x, r as S, t as C } from "./chunk-7PRAP22T-C8rsGRvH.js";
8
+ import { s as w } from "./chunk-J5ZVWO5B-CYzz6Pq8.js";
9
+ import { t as T } from "./rough.esm-rcMoXTJj.js";
10
+ //#region node_modules/mermaid/dist/chunks/mermaid.core/chunk-7INBJB4K.mjs
11
+ var E = 1, D = 3;
12
+ async function O(e) {
13
+ let t = e.getElementsByTagName("img");
14
+ if (!t || t.length === 0) return;
15
+ let n = !k(e);
16
+ await Promise.all([...t].map((e) => new Promise((t) => {
17
+ function i() {
18
+ if (e.style.display = "flex", e.style.flexDirection = "column", n) {
19
+ let [t = f.fontSize] = r(m().fontSize ? m().fontSize : window.getComputedStyle(document.body).fontSize), n = t * 5 + "px";
20
+ e.style.minWidth = n, e.style.maxWidth = n;
21
+ } else e.style.width = "100%";
22
+ t(e);
23
+ }
24
+ o(i, "setupImage"), setTimeout(() => {
25
+ e.complete && i();
26
+ }), e.addEventListener("error", i), e.addEventListener("load", i);
27
+ })));
28
+ }
29
+ o(O, "configureLabelImages");
30
+ function k(e) {
31
+ return e.nodeType === D ? e.textContent?.trim() !== "" : e.nodeType !== E || e.tagName.toLowerCase() === "img" ? !1 : [...e.childNodes].some(k);
32
+ }
33
+ o(k, "hasTextBesidesImages");
34
+ var A = 3, j = 32, M = /* @__PURE__ */ o(async (e, r, i) => {
35
+ let o = m(), s = e.insert("g").attr("class", i ?? "node default").attr("id", r.domId || r.id), c = s.insert("g").attr("class", "label").attr("style", a(r.labelStyle)), l = [
36
+ {
37
+ text: typeof r.label == "string" ? r.label : r.label?.[0] ?? "",
38
+ cssClass: "c4-name"
39
+ },
40
+ {
41
+ text: r.stereotype,
42
+ cssClass: "c4-type"
43
+ },
44
+ ...(r.description ?? []).map((e) => ({
45
+ text: e,
46
+ cssClass: "c4-descr"
47
+ }))
48
+ ].filter((e) => e.text), u = r.width ? Math.max(r.width - 2 * (r.padding ?? 0), j) : m().flowchart?.wrappingWidth ?? 200, d = o.c4?.wrap ?? !0 ? u : Infinity, f = await Promise.all(l.map(async (e) => {
49
+ let i = c.append("g").attr("class", e.cssClass), a = await v(i, h(n(e.text ?? ""), o), {
50
+ useHtmlLabels: !1,
51
+ markdown: !1,
52
+ isNode: !0,
53
+ width: d,
54
+ style: r.labelStyle
55
+ }, o);
56
+ return t(a).selectAll("tspan.text-outer-tspan").attr("text-anchor", "middle"), t(a).selectAll("tspan.text-inner-tspan").attr("font-weight", null).attr("font-style", null), {
57
+ el: i,
58
+ box: i.node().getBBox()
59
+ };
60
+ })), p = Math.max(...f.map(({ box: e }) => e.width), 0), g = 0;
61
+ for (let { el: e, box: t } of f) e.attr("transform", `translate(${p / 2 - t.x - t.width / 2}, ${g - t.y})`), g += t.height + A;
62
+ let _ = f.length > 0 ? g - A : 0;
63
+ return c.insert("rect", ":first-child"), c.attr("transform", `translate(${-p / 2}, ${-_ / 2})`), {
64
+ shapeSvg: s,
65
+ bbox: c.node().getBBox(),
66
+ halfPadding: (r.padding ?? 0) / 2,
67
+ label: c
68
+ };
69
+ }, "c4LabelHelper"), N = /* @__PURE__ */ o((e, t) => {
70
+ let { x: n, y: r, width: i, height: a } = e;
71
+ return i >= t ? e : "left" in e ? {
72
+ x: n,
73
+ y: r,
74
+ width: t,
75
+ height: a,
76
+ top: r,
77
+ left: n,
78
+ bottom: r + a,
79
+ right: n + t,
80
+ toJSON: /* @__PURE__ */ o(() => ({}), "toJSON")
81
+ } : {
82
+ x: n - (t - i) / 2,
83
+ y: r,
84
+ width: t,
85
+ height: a
86
+ };
87
+ }, "withMinWidth"), P = /* @__PURE__ */ o(async (e, r, i) => {
88
+ if (r.stereotype !== void 0) return M(e, r, i);
89
+ let o, s = r.useHtmlLabels || p(m()?.htmlLabels);
90
+ o = i || "node default";
91
+ let c = e.insert("g").attr("class", o).attr("id", r.domId || r.id), l = c.insert("g").attr("class", "label").attr("style", a(r.labelStyle)), u;
92
+ u = r.label === void 0 ? "" : typeof r.label == "string" ? r.label : r.label[0];
93
+ let d = !!r.icon || !!r.img, f = r.labelType === "markdown", g = u && !r.width ? r.minWidth ?? 0 : 0, _ = await v(l, h(n(u), m()), {
94
+ useHtmlLabels: s,
95
+ width: r.width || r.wrappingWidth || m().flowchart?.wrappingWidth,
96
+ minWidth: g,
97
+ classes: f ? "markdown-node-label" : "",
98
+ style: r.labelStyle,
99
+ addSvgBackground: d,
100
+ markdown: f
101
+ }, m()), b = (r?.padding ?? 0) / 2, x;
102
+ if (s) {
103
+ let e = _.children[0], n = t(_);
104
+ await O(e), x = await y.measure(() => e.getBoundingClientRect()), x = N(x, g), n.attr("width", x.width), n.attr("height", x.height);
105
+ } else x = await y.measure(() => _.getBBox()), x = N(x, g);
106
+ return s ? l.attr("transform", "translate(" + -x.width / 2 + ", " + -x.height / 2 + ")") : l.attr("transform", "translate(0, " + -x.height / 2 + ")"), r.centerLabel && l.attr("transform", "translate(" + -x.width / 2 + ", " + -x.height / 2 + ")"), l.insert("rect", ":first-child"), {
107
+ shapeSvg: c,
108
+ bbox: x,
109
+ halfPadding: b,
110
+ label: l
111
+ };
112
+ }, "labelHelper"), F = /* @__PURE__ */ o(async (e, r, i) => {
113
+ let a = i.useHtmlLabels ?? u(m()), o = e.insert("g").attr("class", "label").attr("style", i.labelStyle || ""), s = await v(o, h(n(r), m()), {
114
+ useHtmlLabels: a,
115
+ width: i.width || m()?.flowchart?.wrappingWidth,
116
+ style: i.labelStyle,
117
+ addSvgBackground: !!i.icon || !!i.img
118
+ }), c = i.padding / 2, l;
119
+ if (u(m())) {
120
+ let e = s.children[0], n = t(s);
121
+ l = await y.measure(() => e.getBoundingClientRect()), n.attr("width", l.width), n.attr("height", l.height);
122
+ } else l = await y.measure(() => s.getBBox());
123
+ return a ? o.attr("transform", "translate(" + -l.width / 2 + ", " + -l.height / 2 + ")") : o.attr("transform", "translate(0, " + -l.height / 2 + ")"), i.centerLabel && o.attr("transform", "translate(" + -l.width / 2 + ", " + -l.height / 2 + ")"), o.insert("rect", ":first-child"), {
124
+ shapeSvg: e,
125
+ bbox: l,
126
+ halfPadding: c,
127
+ label: o
128
+ };
129
+ }, "insertLabel"), I = /* @__PURE__ */ o((e, t, n) => {
130
+ if (n) {
131
+ e.width = n.width, e.height = n.height;
132
+ return;
133
+ }
134
+ let r = t.node().getBBox();
135
+ e.width = r.width, e.height = r.height;
136
+ }, "updateNodeBounds"), L = /* @__PURE__ */ o((e, t) => (e.look === "handDrawn" ? "rough-node" : "node") + " " + e.cssClasses + " " + (t || ""), "getNodeClasses");
137
+ function R(e) {
138
+ let t = e.map((e, t) => `${t === 0 ? "M" : "L"}${e.x},${e.y}`);
139
+ return t.push("Z"), t.join(" ");
140
+ }
141
+ o(R, "createPathFromPoints");
142
+ function z(e, t, n, r, i, a) {
143
+ let o = [], s = n - e, c = r - t, l = s / a, u = 2 * Math.PI / l, d = t + c / 2;
144
+ for (let t = 0; t <= 50; t++) {
145
+ let n = e + t / 50 * s, r = d + i * Math.sin(u * (n - e));
146
+ o.push({
147
+ x: n,
148
+ y: r
149
+ });
150
+ }
151
+ return o;
152
+ }
153
+ o(z, "generateFullSineWavePoints");
154
+ function B(e, t, n, r, i, a) {
155
+ let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
156
+ for (let i = 0; i < r; i++) {
157
+ let r = s + i * c, a = e + n * Math.cos(r), l = t + n * Math.sin(r);
158
+ o.push({
159
+ x: -a,
160
+ y: -l
161
+ });
162
+ }
163
+ return o;
164
+ }
165
+ o(B, "generateCirclePoints");
166
+ function ee(e) {
167
+ let t = Array.from(e.childNodes).filter((e) => e.tagName === "path"), n = document.createElementNS("http://www.w3.org/2000/svg", "path"), r = t.map((e) => e.getAttribute("d")).filter((e) => e !== null).join(" ");
168
+ n.setAttribute("d", r);
169
+ let i = t.find((e) => e.getAttribute("fill") !== "none"), a = t.find((e) => e.getAttribute("stroke") !== "none"), s = /* @__PURE__ */ o((e, t) => e?.getAttribute(t) ?? void 0, "getAttr");
170
+ if (i) {
171
+ let e = {
172
+ fill: s(i, "fill"),
173
+ "fill-opacity": s(i, "fill-opacity") ?? "1"
174
+ };
175
+ Object.entries(e).forEach(([e, t]) => {
176
+ t && n.setAttribute(e, t);
177
+ });
178
+ }
179
+ if (a) {
180
+ let e = {
181
+ stroke: s(a, "stroke"),
182
+ "stroke-width": s(a, "stroke-width") ?? "1",
183
+ "stroke-opacity": s(a, "stroke-opacity") ?? "1"
184
+ };
185
+ Object.entries(e).forEach(([e, t]) => {
186
+ t && n.setAttribute(e, t);
187
+ });
188
+ }
189
+ let c = document.createElementNS("http://www.w3.org/2000/svg", "g");
190
+ return c.appendChild(n), c;
191
+ }
192
+ o(ee, "mergePaths");
193
+ var V = /* @__PURE__ */ o((e, t) => {
194
+ var n = e.x, r = e.y, i = t.x - n, a = t.y - r, o = e.width / 2, s = e.height / 2, c, l;
195
+ return Math.abs(a) * o > Math.abs(i) * s ? (a < 0 && (s = -s), c = a === 0 ? 0 : s * i / a, l = s) : (i < 0 && (o = -o), c = o, l = i === 0 ? 0 : o * a / i), {
196
+ x: n + c,
197
+ y: r + l
198
+ };
199
+ }, "intersectRect");
200
+ function te(e, t) {
201
+ return e.intersect(t);
202
+ }
203
+ o(te, "intersectNode");
204
+ var H = te;
205
+ function U(e, t, n, r) {
206
+ var i = e.x, a = e.y, o = i - r.x, s = a - r.y, c = Math.sqrt(t * t * s * s + n * n * o * o), l = Math.abs(t * n * o / c);
207
+ r.x < i && (l = -l);
208
+ var u = Math.abs(t * n * s / c);
209
+ return r.y < a && (u = -u), {
210
+ x: i + l,
211
+ y: a + u
212
+ };
213
+ }
214
+ o(U, "intersectEllipse");
215
+ var ne = U;
216
+ function re(e, t, n) {
217
+ return ne(e, t, t, n);
218
+ }
219
+ o(re, "intersectCircle");
220
+ var ie = re;
221
+ function W(e, t, n, r) {
222
+ {
223
+ let i = t.y - e.y, a = e.x - t.x, o = t.x * e.y - e.x * t.y, s = i * n.x + a * n.y + o, c = i * r.x + a * r.y + o, l = 1e-6;
224
+ if (s !== 0 && c !== 0 && G(s, c)) return;
225
+ let u = r.y - n.y, d = n.x - r.x, f = r.x * n.y - n.x * r.y, p = u * e.x + d * e.y + f, m = u * t.x + d * t.y + f;
226
+ if (Math.abs(p) < l && Math.abs(m) < l && G(p, m)) return;
227
+ let h = i * d - u * a;
228
+ return h === 0 ? void 0 : {
229
+ x: (a * f - d * o) / h,
230
+ y: (u * o - i * f) / h
231
+ };
232
+ }
233
+ }
234
+ o(W, "intersectLine");
235
+ function G(e, t) {
236
+ return e * t > 0;
237
+ }
238
+ o(G, "sameSign");
239
+ var ae = W;
240
+ function oe(e, t, n) {
241
+ let r = e.x, i = e.y, a = [], o = Infinity, s = Infinity;
242
+ typeof t.forEach == "function" ? t.forEach(function(e) {
243
+ o = Math.min(o, e.x), s = Math.min(s, e.y);
244
+ }) : (o = Math.min(o, t.x), s = Math.min(s, t.y));
245
+ let c = r - e.width / 2 - o, l = i - e.height / 2 - s;
246
+ for (let r = 0; r < t.length; r++) {
247
+ let i = t[r], o = t[r < t.length - 1 ? r + 1 : 0], s = ae(e, n, {
248
+ x: c + i.x,
249
+ y: l + i.y
250
+ }, {
251
+ x: c + o.x,
252
+ y: l + o.y
253
+ });
254
+ s && a.push(s);
255
+ }
256
+ return a.length ? (a.length > 1 && a.sort(function(e, t) {
257
+ let r = e.x - n.x, i = e.y - n.y, a = Math.sqrt(r * r + i * i), o = t.x - n.x, s = t.y - n.y, c = Math.sqrt(o * o + s * s);
258
+ return a < c ? -1 : a === c ? 0 : 1;
259
+ }), a[0]) : e;
260
+ }
261
+ o(oe, "intersectPolygon");
262
+ var K = {
263
+ node: H,
264
+ circle: ie,
265
+ ellipse: ne,
266
+ polygon: oe,
267
+ rect: V
268
+ }, q = /* @__PURE__ */ o((e, t, n, r, i) => [
269
+ "M",
270
+ e + i,
271
+ t,
272
+ "H",
273
+ e + n - i,
274
+ "A",
275
+ i,
276
+ i,
277
+ 0,
278
+ 0,
279
+ 1,
280
+ e + n,
281
+ t + i,
282
+ "V",
283
+ t + r - i,
284
+ "A",
285
+ i,
286
+ i,
287
+ 0,
288
+ 0,
289
+ 1,
290
+ e + n - i,
291
+ t + r,
292
+ "H",
293
+ e + i,
294
+ "A",
295
+ i,
296
+ i,
297
+ 0,
298
+ 0,
299
+ 1,
300
+ e,
301
+ t + r - i,
302
+ "V",
303
+ t + i,
304
+ "A",
305
+ i,
306
+ i,
307
+ 0,
308
+ 0,
309
+ 1,
310
+ e + i,
311
+ t,
312
+ "Z"
313
+ ].join(" "), "createRoundedRectPathD"), se = /* @__PURE__ */ o(async (e, t, n, r = !1, i = !1) => {
314
+ let a = t || "";
315
+ typeof a == "object" && (a = a[0]);
316
+ let o = m(), s = u(o);
317
+ return await v(e, a, {
318
+ style: n,
319
+ isTitle: r,
320
+ useHtmlLabels: s,
321
+ markdown: !1,
322
+ isNode: i,
323
+ width: Infinity
324
+ }, o);
325
+ }, "createLabel");
326
+ function ce(t, n) {
327
+ let { labelStyles: r } = x(n);
328
+ n.labelStyle = r;
329
+ let i = L(n), o = i;
330
+ i || (o = "anchor");
331
+ let s = t.insert("g").attr("class", o).attr("id", n.domId || n.id), { cssStyles: c } = n, l = T.svg(s), u = b(n, {
332
+ fill: "black",
333
+ stroke: "none",
334
+ fillStyle: "solid"
335
+ });
336
+ n.look !== "handDrawn" && (u.roughness = 0);
337
+ let d = l.circle(0, 0, 2, u), f = s.insert(() => d, ":first-child");
338
+ return f.attr("class", "anchor").attr("style", a(c)), I(n, f), n.intersect = function(t) {
339
+ return e.info("Circle intersect", n, 1, t), K.circle(n, 1, t);
340
+ }, s;
341
+ }
342
+ o(ce, "anchor");
343
+ function le(e, t, n, r, i, a, o) {
344
+ let s = (e + n) / 2, c = (t + r) / 2, l = Math.atan2(r - t, n - e), u = (n - e) / 2, d = (r - t) / 2, f = u / i, p = d / a, m = Math.sqrt(f ** 2 + p ** 2);
345
+ if (m > 1) throw Error("The given radii are too small to create an arc between the points.");
346
+ let h = Math.sqrt(1 - m ** 2), g = s + h * a * Math.sin(l) * (o ? -1 : 1), _ = c - h * i * Math.cos(l) * (o ? -1 : 1), v = Math.atan2((t - _) / a, (e - g) / i), y = Math.atan2((r - _) / a, (n - g) / i) - v;
347
+ o && y < 0 && (y += 2 * Math.PI), !o && y > 0 && (y -= 2 * Math.PI);
348
+ let b = [];
349
+ for (let e = 0; e < 20; e++) {
350
+ let t = v + e / 19 * y, n = g + i * Math.cos(t), r = _ + a * Math.sin(t);
351
+ b.push({
352
+ x: n,
353
+ y: r
354
+ });
355
+ }
356
+ return b;
357
+ }
358
+ o(le, "generateArcPoints");
359
+ function ue(e, t, n) {
360
+ let [r, i] = [t, n].sort((e, t) => t - e);
361
+ return i * (1 - Math.sqrt(1 - (e / r / 2) ** 2));
362
+ }
363
+ o(ue, "calculateArcSagitta");
364
+ async function de(e, t) {
365
+ let { labelStyles: n, nodeStyles: r } = x(t);
366
+ t.labelStyle = n;
367
+ let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, s = t.look === "neo" ? 12 : i, c = /* @__PURE__ */ o((e) => e + s, "calcTotalHeight"), l = /* @__PURE__ */ o((e) => {
368
+ let t = e / 2;
369
+ return [t / (2.5 + e / 50), t];
370
+ }, "calcEllipseRadius"), { shapeSvg: u, bbox: d } = await P(e, t, L(t)), f = c(t?.height ? t?.height : d.height), [p, m] = l(f), h = ue(f, p, m), g = (t?.width ? t?.width : d.width) + a * 2 + h - h, _ = f, { cssStyles: v } = t, y = [
371
+ {
372
+ x: g / 2,
373
+ y: -_ / 2
374
+ },
375
+ {
376
+ x: -g / 2,
377
+ y: -_ / 2
378
+ },
379
+ ...le(-g / 2, -_ / 2, -g / 2, _ / 2, p, m, !1),
380
+ {
381
+ x: g / 2,
382
+ y: _ / 2
383
+ },
384
+ ...le(g / 2, _ / 2, g / 2, -_ / 2, p, m, !0)
385
+ ], S = T.svg(u), C = b(t, {});
386
+ t.look !== "handDrawn" && (C.roughness = 0, C.fillStyle = "solid");
387
+ let w = R(y), E = S.path(w, C), D = u.insert(() => E, ":first-child");
388
+ return D.attr("class", "basic label-container outer-path"), v && t.look !== "handDrawn" && D.selectAll("path").attr("style", v), r && t.look !== "handDrawn" && D.selectAll("path").attr("style", r), D.attr("transform", `translate(${p / 2}, 0)`), I(t, D), t.intersect = function(e) {
389
+ return K.polygon(t, y, e);
390
+ }, u;
391
+ }
392
+ o(de, "bowTieRect");
393
+ async function fe(e, t, { config: { themeVariables: n } }) {
394
+ let { labelStyles: r, nodeStyles: i } = x(t);
395
+ t.labelStyle = r;
396
+ let { shapeSvg: a, bbox: s, label: c } = await P(e, t, L(t)), l = n?.nodeBorder ?? n?.lineColor ?? "currentColor", u = t.padding ?? 12, d = Math.max(s.width + u * 2, t.width ?? 0, 80), f = Math.max(Math.min(d * .08, 12), 5), p = Math.max(s.height + u * 2 + f, t.height ?? 0), m = -p / 2 + f, h = p / 2, g = d * .72, _ = [
397
+ `M${-d / 2},${m}`,
398
+ `L${-g / 2},${h}`,
399
+ `A${g / 2},${f} 0 0 0 ${g / 2},${h}`,
400
+ `L${d / 2},${m}`,
401
+ `A${d / 2},${f} 0 0 0 ${-d / 2},${m}`,
402
+ "Z"
403
+ ].join(" "), { cssStyles: v } = t, y = a.insert("g", ":first-child").attr("class", "basic label-container");
404
+ if (t.look === "handDrawn") {
405
+ let e = T.svg(a).path(_, b(t, {}));
406
+ y.node()?.appendChild(e), v && y.attr("style", v);
407
+ } else y.append("path").attr("d", _).attr("style", i);
408
+ y.append("ellipse").attr("cx", 0).attr("cy", m).attr("rx", d / 2).attr("ry", f).attr("style", `fill:none;stroke:${l};stroke-width:1px`), I(t, y);
409
+ let S = m + (h - m) / 2;
410
+ c.attr("transform", `translate(${-(s.width / 2) - (s.x - (s.left ?? 0))}, ${S - s.height / 2 - (s.y - (s.top ?? 0))})`);
411
+ let C = /* @__PURE__ */ o((e, t, n) => Array.from({ length: 13 }, (r, i) => {
412
+ let a = Math.PI - i * Math.PI / 12;
413
+ return {
414
+ x: e * Math.cos(a),
415
+ y: t + n * f * Math.sin(a)
416
+ };
417
+ }), "arc"), w = [...C(d / 2, m, -1), ...C(g / 2, h, 1).reverse()];
418
+ return t.intersect = function(e) {
419
+ return K.polygon(t, w, e);
420
+ }, a;
421
+ }
422
+ o(fe, "bucket");
423
+ var pe = 20, me = 8, he = 80, ge = 8;
424
+ function _e(e) {
425
+ let { themeVariables: t } = m(), n = t.clusterBkg, r = t.clusterBorder;
426
+ switch (e) {
427
+ case "flow": return {
428
+ rx: 10,
429
+ fill: "none",
430
+ stroke: t.flowContainerStroke || t.secondaryBorderColor,
431
+ strokeWidth: .75,
432
+ cssClass: "flow-collapsed"
433
+ };
434
+ default: return {
435
+ rx: ge,
436
+ fill: n,
437
+ stroke: r,
438
+ cssClass: "collapsed-group"
439
+ };
440
+ }
441
+ }
442
+ o(_e, "getCollapsedStyle");
443
+ async function ve(e, t) {
444
+ let n = _e(t.metadata?.containerType), { fill: r, stroke: i } = n, { nodeStyles: o } = x(t), { shapeSvg: s, bbox: c } = await P(e, t, L(t)), { theme: l, themeVariables: d } = m();
445
+ w(s, t.colorIndex, l, d.borderColorArray);
446
+ let f = t.padding ?? 8, p = c.height, h = Math.max(c.width + f * 2, he, t?.width ?? 0), g = Math.max(p + me + pe + f * 2, t?.height ?? 0), _ = -h / 2, v = -g / 2, y = -(me + pe) / 2, S = s.select(".label");
447
+ S && (t.useHtmlLabels ?? u(m()) ? S.attr("transform", `translate(${-c.width / 2}, ${-c.height / 2 + y})`) : S.attr("transform", `translate(0, ${-c.height / 2 + y})`));
448
+ let C;
449
+ if (t.look === "handDrawn") {
450
+ let e = T.svg(s), o = b(t, {
451
+ fill: r,
452
+ stroke: i,
453
+ ...n.strokeWidth === void 0 ? {} : { strokeWidth: n.strokeWidth },
454
+ ...r === "none" ? { fillWeight: 0 } : { fillStyle: "solid" }
455
+ }), c = e.path(q(_, v, h, g, n.rx), o);
456
+ C = s.insert(() => c, ":first-child"), C.attr("class", "basic label-container " + n.cssClass).attr("style", a(t.cssStyles));
457
+ } else C = s.insert("rect", ":first-child"), C.attr("class", "basic label-container " + n.cssClass).attr("style", o).attr("rx", n.rx).attr("ry", n.rx).attr("x", _).attr("y", v).attr("width", h).attr("height", g).attr("fill", r).attr("stroke", i), n.strokeWidth !== void 0 && C.attr("stroke-width", n.strokeWidth + "px");
458
+ let E = v + f + p + me;
459
+ s.append("line").attr("class", "collapsed-separator").attr("x1", _ + 8).attr("y1", E).attr("x2", _ + h - 8).attr("y2", E).attr("stroke", i).attr("stroke-dasharray", "3, 3");
460
+ let D = E + pe / 2;
461
+ for (let e = -1; e <= 1; e++) s.append("circle").attr("class", "collapsed-indicator").attr("cx", e * 10).attr("cy", D).attr("r", 2.5).attr("fill", i);
462
+ return I(t, C), t.calcIntersect = function(e, t) {
463
+ return K.rect(e, t);
464
+ }, t.intersect = function(e) {
465
+ return K.rect(t, e);
466
+ }, s;
467
+ }
468
+ o(ve, "collapsedGroup");
469
+ function J(e, t, n, r) {
470
+ return e.insert("polygon", ":first-child").attr("points", r.map(function(e) {
471
+ return e.x + "," + e.y;
472
+ }).join(" ")).attr("class", "label-container").attr("transform", "translate(" + -t / 2 + "," + n / 2 + ")");
473
+ }
474
+ o(J, "insertPolygonShape");
475
+ var ye = [
476
+ "right",
477
+ "left",
478
+ "up",
479
+ "down"
480
+ ], be = "point", xe = /* @__PURE__ */ o((e) => {
481
+ let t = /* @__PURE__ */ new Set();
482
+ for (let n of e) switch (n) {
483
+ case "x":
484
+ t.add("right"), t.add("left");
485
+ break;
486
+ case "y":
487
+ t.add("up"), t.add("down");
488
+ break;
489
+ default:
490
+ t.add(n);
491
+ break;
492
+ }
493
+ return t;
494
+ }, "expandAndDeduplicateDirections"), Se = /* @__PURE__ */ o((e) => ye.filter((t) => e.has(t)).join("|") || be, "getDirectionKey"), Ce = {
495
+ "right|left|up|down": /* @__PURE__ */ o(({ height: e, midpoint: t, padding: n, width: r }) => [
496
+ {
497
+ x: 0,
498
+ y: 0
499
+ },
500
+ {
501
+ x: t,
502
+ y: 0
503
+ },
504
+ {
505
+ x: r / 2,
506
+ y: 2 * n
507
+ },
508
+ {
509
+ x: r - t,
510
+ y: 0
511
+ },
512
+ {
513
+ x: r,
514
+ y: 0
515
+ },
516
+ {
517
+ x: r,
518
+ y: -e / 3
519
+ },
520
+ {
521
+ x: r + 2 * n,
522
+ y: -e / 2
523
+ },
524
+ {
525
+ x: r,
526
+ y: -2 * e / 3
527
+ },
528
+ {
529
+ x: r,
530
+ y: -e
531
+ },
532
+ {
533
+ x: r - t,
534
+ y: -e
535
+ },
536
+ {
537
+ x: r / 2,
538
+ y: -e - 2 * n
539
+ },
540
+ {
541
+ x: t,
542
+ y: -e
543
+ },
544
+ {
545
+ x: 0,
546
+ y: -e
547
+ },
548
+ {
549
+ x: 0,
550
+ y: -2 * e / 3
551
+ },
552
+ {
553
+ x: -2 * n,
554
+ y: -e / 2
555
+ },
556
+ {
557
+ x: 0,
558
+ y: -e / 3
559
+ }
560
+ ], "right|left|up|down"),
561
+ "right|left|up": /* @__PURE__ */ o(({ height: e, midpoint: t, width: n }) => [
562
+ {
563
+ x: t,
564
+ y: 0
565
+ },
566
+ {
567
+ x: n - t,
568
+ y: 0
569
+ },
570
+ {
571
+ x: n,
572
+ y: -e / 2
573
+ },
574
+ {
575
+ x: n - t,
576
+ y: -e
577
+ },
578
+ {
579
+ x: t,
580
+ y: -e
581
+ },
582
+ {
583
+ x: 0,
584
+ y: -e / 2
585
+ }
586
+ ], "right|left|up"),
587
+ "right|left|down": /* @__PURE__ */ o(({ height: e, midpoint: t, width: n }) => [
588
+ {
589
+ x: 0,
590
+ y: 0
591
+ },
592
+ {
593
+ x: t,
594
+ y: -e
595
+ },
596
+ {
597
+ x: n - t,
598
+ y: -e
599
+ },
600
+ {
601
+ x: n,
602
+ y: 0
603
+ }
604
+ ], "right|left|down"),
605
+ "right|up|down": /* @__PURE__ */ o(({ height: e, midpoint: t, width: n }) => [
606
+ {
607
+ x: 0,
608
+ y: 0
609
+ },
610
+ {
611
+ x: n,
612
+ y: -t
613
+ },
614
+ {
615
+ x: n,
616
+ y: -e + t
617
+ },
618
+ {
619
+ x: 0,
620
+ y: -e
621
+ }
622
+ ], "right|up|down"),
623
+ "left|up|down": /* @__PURE__ */ o(({ height: e, midpoint: t, width: n }) => [
624
+ {
625
+ x: n,
626
+ y: 0
627
+ },
628
+ {
629
+ x: 0,
630
+ y: -t
631
+ },
632
+ {
633
+ x: 0,
634
+ y: -e + t
635
+ },
636
+ {
637
+ x: n,
638
+ y: -e
639
+ }
640
+ ], "left|up|down"),
641
+ "right|left": /* @__PURE__ */ o(({ height: e, midpoint: t, padding: n, width: r }) => [
642
+ {
643
+ x: t,
644
+ y: 0
645
+ },
646
+ {
647
+ x: t,
648
+ y: -n
649
+ },
650
+ {
651
+ x: r - t,
652
+ y: -n
653
+ },
654
+ {
655
+ x: r - t,
656
+ y: 0
657
+ },
658
+ {
659
+ x: r,
660
+ y: -e / 2
661
+ },
662
+ {
663
+ x: r - t,
664
+ y: -e
665
+ },
666
+ {
667
+ x: r - t,
668
+ y: -e + n
669
+ },
670
+ {
671
+ x: t,
672
+ y: -e + n
673
+ },
674
+ {
675
+ x: t,
676
+ y: -e
677
+ },
678
+ {
679
+ x: 0,
680
+ y: -e / 2
681
+ }
682
+ ], "right|left"),
683
+ "up|down": /* @__PURE__ */ o(({ height: e, midpoint: t, padding: n, width: r }) => [
684
+ {
685
+ x: r / 2,
686
+ y: 0
687
+ },
688
+ {
689
+ x: 0,
690
+ y: -n
691
+ },
692
+ {
693
+ x: t,
694
+ y: -n
695
+ },
696
+ {
697
+ x: t,
698
+ y: -e + n
699
+ },
700
+ {
701
+ x: 0,
702
+ y: -e + n
703
+ },
704
+ {
705
+ x: r / 2,
706
+ y: -e
707
+ },
708
+ {
709
+ x: r,
710
+ y: -e + n
711
+ },
712
+ {
713
+ x: r - t,
714
+ y: -e + n
715
+ },
716
+ {
717
+ x: r - t,
718
+ y: -n
719
+ },
720
+ {
721
+ x: r,
722
+ y: -n
723
+ }
724
+ ], "up|down"),
725
+ "right|up": /* @__PURE__ */ o(({ height: e, midpoint: t, width: n }) => [
726
+ {
727
+ x: 0,
728
+ y: 0
729
+ },
730
+ {
731
+ x: n,
732
+ y: -t
733
+ },
734
+ {
735
+ x: 0,
736
+ y: -e
737
+ }
738
+ ], "right|up"),
739
+ "right|down": /* @__PURE__ */ o(({ height: e, width: t }) => [
740
+ {
741
+ x: 0,
742
+ y: 0
743
+ },
744
+ {
745
+ x: t,
746
+ y: 0
747
+ },
748
+ {
749
+ x: 0,
750
+ y: -e
751
+ }
752
+ ], "right|down"),
753
+ "left|up": /* @__PURE__ */ o(({ height: e, midpoint: t, width: n }) => [
754
+ {
755
+ x: n,
756
+ y: 0
757
+ },
758
+ {
759
+ x: 0,
760
+ y: -t
761
+ },
762
+ {
763
+ x: n,
764
+ y: -e
765
+ }
766
+ ], "left|up"),
767
+ "left|down": /* @__PURE__ */ o(({ height: e, width: t }) => [
768
+ {
769
+ x: t,
770
+ y: 0
771
+ },
772
+ {
773
+ x: 0,
774
+ y: 0
775
+ },
776
+ {
777
+ x: t,
778
+ y: -e
779
+ }
780
+ ], "left|down"),
781
+ right: /* @__PURE__ */ o(({ height: e, midpoint: t, padding: n, width: r }) => [
782
+ {
783
+ x: t,
784
+ y: -n
785
+ },
786
+ {
787
+ x: t,
788
+ y: -n
789
+ },
790
+ {
791
+ x: r - t,
792
+ y: -n
793
+ },
794
+ {
795
+ x: r - t,
796
+ y: 0
797
+ },
798
+ {
799
+ x: r,
800
+ y: -e / 2
801
+ },
802
+ {
803
+ x: r - t,
804
+ y: -e
805
+ },
806
+ {
807
+ x: r - t,
808
+ y: -e + n
809
+ },
810
+ {
811
+ x: t,
812
+ y: -e + n
813
+ },
814
+ {
815
+ x: t,
816
+ y: -e + n
817
+ }
818
+ ], "right"),
819
+ left: /* @__PURE__ */ o(({ height: e, midpoint: t, padding: n, width: r }) => [
820
+ {
821
+ x: t,
822
+ y: 0
823
+ },
824
+ {
825
+ x: t,
826
+ y: -n
827
+ },
828
+ {
829
+ x: r - t,
830
+ y: -n
831
+ },
832
+ {
833
+ x: r - t,
834
+ y: -e + n
835
+ },
836
+ {
837
+ x: t,
838
+ y: -e + n
839
+ },
840
+ {
841
+ x: t,
842
+ y: -e
843
+ },
844
+ {
845
+ x: 0,
846
+ y: -e / 2
847
+ }
848
+ ], "left"),
849
+ up: /* @__PURE__ */ o(({ height: e, midpoint: t, padding: n, width: r }) => [
850
+ {
851
+ x: t,
852
+ y: -n
853
+ },
854
+ {
855
+ x: t,
856
+ y: -e + n
857
+ },
858
+ {
859
+ x: 0,
860
+ y: -e + n
861
+ },
862
+ {
863
+ x: r / 2,
864
+ y: -e
865
+ },
866
+ {
867
+ x: r,
868
+ y: -e + n
869
+ },
870
+ {
871
+ x: r - t,
872
+ y: -e + n
873
+ },
874
+ {
875
+ x: r - t,
876
+ y: -n
877
+ }
878
+ ], "up"),
879
+ down: /* @__PURE__ */ o(({ height: e, midpoint: t, padding: n, width: r }) => [
880
+ {
881
+ x: r / 2,
882
+ y: 0
883
+ },
884
+ {
885
+ x: 0,
886
+ y: -n
887
+ },
888
+ {
889
+ x: t,
890
+ y: -n
891
+ },
892
+ {
893
+ x: t,
894
+ y: -e + n
895
+ },
896
+ {
897
+ x: r - t,
898
+ y: -e + n
899
+ },
900
+ {
901
+ x: r - t,
902
+ y: -n
903
+ },
904
+ {
905
+ x: r,
906
+ y: -n
907
+ }
908
+ ], "down"),
909
+ [be]: () => [{
910
+ x: 0,
911
+ y: 0
912
+ }]
913
+ }, we = /* @__PURE__ */ o((e, t, n, r) => {
914
+ let i = xe(e), a = (n.padding ?? 0) / 2, o = t.height + 4 * a, s = o / 2, c = r ?? t.width + 2 * s + 2 * a;
915
+ return (Ce[Se(i)] ?? Ce[be])({
916
+ height: o,
917
+ midpoint: s,
918
+ padding: a,
919
+ width: c
920
+ });
921
+ }, "getArrowPoints");
922
+ async function Te(e, t) {
923
+ let n = t, { shapeSvg: r, bbox: i } = await P(e, n, L(n)), a = n.padding ?? 0, o = i.height + 2 * a, s = o / 2, c = i.width + 2 * s + a, l = n.width ?? 0, u = n.positioned && (n.widthInColumns ?? 1) > 1 && l > c ? l : c, d = we(n.directions ?? [], i, n, u), f = J(r, u, o, d);
924
+ return f.attr("style", n.style ?? null), I(n, f), n.intersect = function(e) {
925
+ return K.polygon(n, d, e);
926
+ }, r;
927
+ }
928
+ o(Te, "block_arrow");
929
+ async function Ee(e, t, { config: { themeVariables: n } }) {
930
+ let { labelStyles: r, nodeStyles: i } = x(t);
931
+ t.labelStyle = r;
932
+ let { shapeSvg: a, bbox: o, label: s } = await P(e, t, L(t)), c = n?.nodeBorder ?? n?.lineColor ?? "currentColor", l = t.padding ?? 12, u = Math.max(o.width + l * 2, t.width ?? 0, 90), d = Math.max(o.height + l * 2 + 18, t.height ?? 0), f = -d / 2, { cssStyles: p } = t, m = a.insert("g", ":first-child").attr("class", "basic label-container");
933
+ if (t.look === "handDrawn") {
934
+ let e = T.svg(a).path(q(-u / 2, f, u, d, 12), b(t, {}));
935
+ m.node()?.appendChild(e), p && m.attr("style", p);
936
+ } else m.append("rect").attr("x", -u / 2).attr("y", f).attr("width", u).attr("height", d).attr("rx", 12).attr("ry", 12).attr("style", i);
937
+ m.append("line").attr("x1", -u / 2).attr("y1", f + 18).attr("x2", u / 2).attr("y2", f + 18).attr("style", `stroke:${c};stroke-width:1px`);
938
+ for (let e = 0; e < 3; e++) m.append("circle").attr("cx", -u / 2 + 12 + e * 9).attr("cy", f + 18 / 2).attr("r", 2.5).attr("style", `fill:${c};stroke:none`);
939
+ m.append("rect").attr("class", "browser-address-bar").attr("x", -u / 2 + 44).attr("y", f + 4).attr("width", Math.max(u - 56, 10)).attr("height", 10).attr("rx", 3).attr("ry", 3).attr("style", `fill:none;stroke:${c};stroke-width:1px;opacity:0.6`), I(t, m);
940
+ let h = f + 18 + (d - 18) / 2;
941
+ return s.attr("transform", `translate(${-(o.width / 2) - (o.x - (o.left ?? 0))}, ${h - o.height / 2 - (o.y - (o.top ?? 0))})`), t.intersect = function(e) {
942
+ return K.rect(t, e);
943
+ }, a;
944
+ }
945
+ o(Ee, "browser");
946
+ var De = 12;
947
+ async function Oe(e, t) {
948
+ let { labelStyles: n, nodeStyles: r } = x(t);
949
+ t.labelStyle = n;
950
+ let i = t.padding ?? 0, a = t.look === "neo" ? 28 : i, o = t.look === "neo" ? 24 : i, { shapeSvg: s, bbox: c } = await P(e, t, L(t)), l = (t?.width ?? c.width) + (t.look === "neo" ? a * 2 : a + De), u = (t?.height ?? c.height) + (t.look === "neo" ? o * 2 : o), d = l, f = -u, p = [
951
+ {
952
+ x: 0 + De,
953
+ y: f
954
+ },
955
+ {
956
+ x: d,
957
+ y: f
958
+ },
959
+ {
960
+ x: d,
961
+ y: 0
962
+ },
963
+ {
964
+ x: 0,
965
+ y: 0
966
+ },
967
+ {
968
+ x: 0,
969
+ y: f + De
970
+ },
971
+ {
972
+ x: 0 + De,
973
+ y: f
974
+ }
975
+ ], m, { cssStyles: h } = t;
976
+ if (t.look === "handDrawn") {
977
+ let e = T.svg(s), n = b(t, {}), r = R(p), i = e.path(r, n);
978
+ m = s.insert(() => i, ":first-child").attr("transform", `translate(${-l / 2}, ${u / 2})`), h && m.attr("style", h);
979
+ } else m = J(s, l, u, p);
980
+ return r && m.attr("style", r), I(t, m), t.intersect = function(e) {
981
+ return K.polygon(t, p, e);
982
+ }, s;
983
+ }
984
+ o(Oe, "card");
985
+ function ke(e, t) {
986
+ let { nodeStyles: n } = x(t);
987
+ t.label = "";
988
+ let r = e.insert("g").attr("class", L(t)).attr("id", t.domId ?? t.id), { cssStyles: i } = t, a = Math.max(28, t.width ?? 0), o = [
989
+ {
990
+ x: 0,
991
+ y: a / 2
992
+ },
993
+ {
994
+ x: a / 2,
995
+ y: 0
996
+ },
997
+ {
998
+ x: 0,
999
+ y: -a / 2
1000
+ },
1001
+ {
1002
+ x: -a / 2,
1003
+ y: 0
1004
+ }
1005
+ ], s = T.svg(r), c = b(t, {});
1006
+ t.look !== "handDrawn" && (c.roughness = 0, c.fillStyle = "solid");
1007
+ let l = R(o), u = s.path(l, c), d = r.insert(() => u, ":first-child");
1008
+ return i && t.look !== "handDrawn" && d.selectAll("path").attr("style", i), n && t.look !== "handDrawn" && d.selectAll("path").attr("style", n), t.width = 28, t.height = 28, t.intersect = function(e) {
1009
+ return K.polygon(t, o, e);
1010
+ }, r;
1011
+ }
1012
+ o(ke, "choice");
1013
+ async function Ae(t, n, r) {
1014
+ let { labelStyles: i, nodeStyles: o } = x(n);
1015
+ n.labelStyle = i;
1016
+ let { shapeSvg: s, bbox: c, halfPadding: l } = await P(t, n, L(n)), u = r?.padding ?? l, d = Math.sqrt(c.width ** 2 + c.height ** 2) / 2, f = n.look === "neo" ? d + 32 : d + u, p, { cssStyles: m } = n;
1017
+ if (n.look === "handDrawn") {
1018
+ let e = T.svg(s), t = b(n, {}), r = e.circle(0, 0, f * 2, t);
1019
+ p = s.insert(() => r, ":first-child"), p.attr("class", "basic label-container").attr("style", a(m));
1020
+ } else p = s.insert("circle", ":first-child").attr("class", "basic label-container").attr("style", o).attr("r", f).attr("cx", 0).attr("cy", 0);
1021
+ return I(n, p), n.calcIntersect = function(e, t) {
1022
+ let n = e.width / 2;
1023
+ return K.circle(e, n, t);
1024
+ }, n.intersect = function(t) {
1025
+ return e.info("Circle intersect", n, f, t), K.circle(n, f, t);
1026
+ }, s;
1027
+ }
1028
+ o(Ae, "circle");
1029
+ async function je(e, t) {
1030
+ let n = t, { shapeSvg: r, bbox: i, halfPadding: a } = await P(e, n, [
1031
+ "node",
1032
+ n.cssClasses,
1033
+ n.class
1034
+ ].filter(Boolean).join(" ")), o = r.insert("rect", ":first-child"), s = n.padding ?? 0, c = n.positioned ? n.width ?? 0 : i.width + s, l = n.positioned ? n.height ?? 0 : i.height + s, u = n.positioned ? -c / 2 : -i.width / 2 - a, d = n.positioned ? -l / 2 : -i.height / 2 - a;
1035
+ return o.attr("class", "basic cluster composite label-container").attr("style", n.style ?? null).attr("rx", n.rx ?? null).attr("ry", n.ry ?? null).attr("x", u).attr("y", d).attr("width", c).attr("height", l), I(n, o), n.intersect = function(e) {
1036
+ return K.rect(n, e);
1037
+ }, r;
1038
+ }
1039
+ o(je, "composite");
1040
+ async function Me(e, t, { config: { themeVariables: n } }) {
1041
+ let { labelStyles: r, nodeStyles: i } = x(t);
1042
+ t.labelStyle = r;
1043
+ let { shapeSvg: a, bbox: o, label: s } = await P(e, t, L(t)), c = n?.nodeBorder ?? n?.lineColor ?? "currentColor", l = t.padding ?? 12, u = Math.max(o.width + l * 2, t.width ?? 0, 90), d = Math.max(o.height + l * 2 + 20, t.height ?? 0), f = -d / 2, { cssStyles: p } = t, m = a.insert("g", ":first-child").attr("class", "basic label-container");
1044
+ if (t.look === "handDrawn") {
1045
+ let e = T.svg(a).path(q(-u / 2, f, u, d, 12), b(t, {}));
1046
+ m.node()?.appendChild(e), p && m.attr("style", p);
1047
+ } else m.append("rect").attr("x", -u / 2).attr("y", f).attr("width", u).attr("height", d).attr("rx", 12).attr("ry", 12).attr("style", i);
1048
+ m.append("text").attr("x", -u / 2 + 12).attr("y", f + 16).attr("class", "console-glyph").attr("style", `font-family:monospace;font-weight:bold;font-size:14px;fill:${c}`).text(">_"), I(t, m);
1049
+ let h = f + 20 + (d - 20) / 2;
1050
+ return s.attr("transform", `translate(${-(o.width / 2) - (o.x - (o.left ?? 0))}, ${h - o.height / 2 - (o.y - (o.top ?? 0))})`), t.intersect = function(e) {
1051
+ return K.rect(t, e);
1052
+ }, a;
1053
+ }
1054
+ o(Me, "consoleWindow");
1055
+ function Ne(e) {
1056
+ let t = Math.cos(Math.PI / 4), n = Math.sin(Math.PI / 4), r = e * 2, i = {
1057
+ x: r / 2 * t,
1058
+ y: r / 2 * n
1059
+ }, a = {
1060
+ x: -(r / 2) * t,
1061
+ y: r / 2 * n
1062
+ }, o = {
1063
+ x: -(r / 2) * t,
1064
+ y: -(r / 2) * n
1065
+ }, s = {
1066
+ x: r / 2 * t,
1067
+ y: -(r / 2) * n
1068
+ };
1069
+ return `M ${a.x},${a.y} L ${s.x},${s.y}
1070
+ M ${i.x},${i.y} L ${o.x},${o.y}`;
1071
+ }
1072
+ o(Ne, "createLine");
1073
+ function Pe(t, n) {
1074
+ let { labelStyles: r, nodeStyles: i } = x(n);
1075
+ n.labelStyle = r, n.label = "";
1076
+ let a = t.insert("g").attr("class", L(n)).attr("id", n.domId ?? n.id), o = Math.max(30, n?.width ?? 0), { cssStyles: s } = n, c = T.svg(a), l = b(n, {});
1077
+ n.look !== "handDrawn" && (l.roughness = 0, l.fillStyle = "solid");
1078
+ let u = c.circle(0, 0, o * 2, l), d = Ne(o), f = c.path(d, l), p = a.insert(() => u, ":first-child");
1079
+ return p.insert(() => f), p.attr("class", "outer-path"), s && n.look !== "handDrawn" && p.selectAll("path").attr("style", s), i && n.look !== "handDrawn" && p.selectAll("path").attr("style", i), I(n, p), n.intersect = function(t) {
1080
+ return e.info("crossedCircle intersect", n, {
1081
+ radius: o,
1082
+ point: t
1083
+ }), K.circle(n, o, t);
1084
+ }, a;
1085
+ }
1086
+ o(Pe, "crossedCircle");
1087
+ function Y(e, t, n, r = 100, i = 0, a = 180) {
1088
+ let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
1089
+ for (let i = 0; i < r; i++) {
1090
+ let r = s + i * c, a = e + n * Math.cos(r), l = t + n * Math.sin(r);
1091
+ o.push({
1092
+ x: -a,
1093
+ y: -l
1094
+ });
1095
+ }
1096
+ return o;
1097
+ }
1098
+ o(Y, "generateCirclePoints");
1099
+ async function Fe(e, t) {
1100
+ let { labelStyles: n, nodeStyles: r } = x(t);
1101
+ t.labelStyle = n;
1102
+ let { shapeSvg: i, bbox: a, label: o } = await P(e, t, L(t)), s = t.look === "neo" ? 18 : t.padding ?? 0, c = t.look === "neo" ? 12 : t.padding ?? 0, l = a.width + s, u = a.height + c, d = Math.max(5, u * .1), { cssStyles: f } = t, p = [
1103
+ ...Y(l / 2, -u / 2, d, 30, -90, 0),
1104
+ {
1105
+ x: -l / 2 - d,
1106
+ y: d
1107
+ },
1108
+ ...Y(l / 2 + d * 2, -d, d, 20, -180, -270),
1109
+ ...Y(l / 2 + d * 2, d, d, 20, -90, -180),
1110
+ {
1111
+ x: -l / 2 - d,
1112
+ y: -u / 2
1113
+ },
1114
+ ...Y(l / 2, u / 2, d, 20, 0, 90)
1115
+ ], m = [
1116
+ {
1117
+ x: l / 2,
1118
+ y: -u / 2 - d
1119
+ },
1120
+ {
1121
+ x: -l / 2,
1122
+ y: -u / 2 - d
1123
+ },
1124
+ ...Y(l / 2, -u / 2, d, 20, -90, 0),
1125
+ {
1126
+ x: -l / 2 - d,
1127
+ y: -d
1128
+ },
1129
+ ...Y(l / 2 + l * .1, -d, d, 20, -180, -270),
1130
+ ...Y(l / 2 + l * .1, d, d, 20, -90, -180),
1131
+ {
1132
+ x: -l / 2 - d,
1133
+ y: u / 2
1134
+ },
1135
+ ...Y(l / 2, u / 2, d, 20, 0, 90),
1136
+ {
1137
+ x: -l / 2,
1138
+ y: u / 2 + d
1139
+ },
1140
+ {
1141
+ x: l / 2,
1142
+ y: u / 2 + d
1143
+ }
1144
+ ], h = T.svg(i), g = b(t, { fill: "none" });
1145
+ t.look !== "handDrawn" && (g.roughness = 0, g.fillStyle = "solid");
1146
+ let _ = R(p).replace("Z", ""), v = h.path(_, g), y = R(m), S = h.path(y, { ...g }), C = i.insert("g", ":first-child");
1147
+ return C.insert(() => S, ":first-child").attr("stroke-opacity", 0), C.insert(() => v, ":first-child"), C.attr("class", "text"), f && t.look !== "handDrawn" && C.selectAll("path").attr("style", f), r && t.look !== "handDrawn" && C.selectAll("path").attr("style", r), C.attr("transform", `translate(${d}, 0)`), o.attr("transform", `translate(${-l / 2 + d - (a.x - (a.left ?? 0))},${-u / 2 + (t.padding ?? 0) / 2 - (a.y - (a.top ?? 0))})`), I(t, C), t.intersect = function(e) {
1148
+ return K.polygon(t, m, e);
1149
+ }, i;
1150
+ }
1151
+ o(Fe, "curlyBraceLeft");
1152
+ function X(e, t, n, r = 100, i = 0, a = 180) {
1153
+ let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
1154
+ for (let i = 0; i < r; i++) {
1155
+ let r = s + i * c, a = e + n * Math.cos(r), l = t + n * Math.sin(r);
1156
+ o.push({
1157
+ x: a,
1158
+ y: l
1159
+ });
1160
+ }
1161
+ return o;
1162
+ }
1163
+ o(X, "generateCirclePoints");
1164
+ async function Ie(e, t) {
1165
+ let { labelStyles: n, nodeStyles: r } = x(t);
1166
+ t.labelStyle = n;
1167
+ let { shapeSvg: i, bbox: a, label: o } = await P(e, t, L(t)), s = t.look === "neo" ? 18 : t.padding ?? 0, c = t.look === "neo" ? 12 : t.padding ?? 0, l = a.width + (t.look === "neo" ? s * 2 : s), u = a.height + (t.look === "neo" ? c * 2 : c), d = Math.max(5, u * .1), { cssStyles: f } = t, p = [
1168
+ ...X(l / 2, -u / 2, d, 20, -90, 0),
1169
+ {
1170
+ x: l / 2 + d,
1171
+ y: -d
1172
+ },
1173
+ ...X(l / 2 + d * 2, -d, d, 20, -180, -270),
1174
+ ...X(l / 2 + d * 2, d, d, 20, -90, -180),
1175
+ {
1176
+ x: l / 2 + d,
1177
+ y: u / 2
1178
+ },
1179
+ ...X(l / 2, u / 2, d, 20, 0, 90)
1180
+ ], m = [
1181
+ {
1182
+ x: -l / 2,
1183
+ y: -u / 2 - d
1184
+ },
1185
+ {
1186
+ x: l / 2,
1187
+ y: -u / 2 - d
1188
+ },
1189
+ ...X(l / 2, -u / 2, d, 20, -90, 0),
1190
+ {
1191
+ x: l / 2 + d,
1192
+ y: -d
1193
+ },
1194
+ ...X(l / 2 + d * 2, -d, d, 20, -180, -270),
1195
+ ...X(l / 2 + d * 2, d, d, 20, -90, -180),
1196
+ {
1197
+ x: l / 2 + d,
1198
+ y: u / 2
1199
+ },
1200
+ ...X(l / 2, u / 2, d, 20, 0, 90),
1201
+ {
1202
+ x: l / 2,
1203
+ y: u / 2 + d
1204
+ },
1205
+ {
1206
+ x: -l / 2,
1207
+ y: u / 2 + d
1208
+ }
1209
+ ], h = T.svg(i), g = b(t, { fill: "none" });
1210
+ t.look !== "handDrawn" && (g.roughness = 0, g.fillStyle = "solid");
1211
+ let _ = R(p).replace("Z", ""), v = h.path(_, g), y = R(m), S = h.path(y, { ...g }), C = i.insert("g", ":first-child");
1212
+ return C.insert(() => S, ":first-child").attr("stroke-opacity", 0), C.insert(() => v, ":first-child"), C.attr("class", "text"), f && t.look !== "handDrawn" && C.selectAll("path").attr("style", f), r && t.look !== "handDrawn" && C.selectAll("path").attr("style", r), C.attr("transform", `translate(${-d}, 0)`), o.attr("transform", `translate(${-l / 2 + (t.padding ?? 0) / 2 - (a.x - (a.left ?? 0))},${-u / 2 + (t.padding ?? 0) / 2 - (a.y - (a.top ?? 0))})`), I(t, C), t.intersect = function(e) {
1213
+ return K.polygon(t, m, e);
1214
+ }, i;
1215
+ }
1216
+ o(Ie, "curlyBraceRight");
1217
+ function Z(e, t, n, r = 100, i = 0, a = 180) {
1218
+ let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
1219
+ for (let i = 0; i < r; i++) {
1220
+ let r = s + i * c, a = e + n * Math.cos(r), l = t + n * Math.sin(r);
1221
+ o.push({
1222
+ x: -a,
1223
+ y: -l
1224
+ });
1225
+ }
1226
+ return o;
1227
+ }
1228
+ o(Z, "generateCirclePoints");
1229
+ async function Le(e, t) {
1230
+ let { labelStyles: n, nodeStyles: r } = x(t);
1231
+ t.labelStyle = n;
1232
+ let { shapeSvg: i, bbox: a, label: o } = await P(e, t, L(t)), s = t.look === "neo" ? 18 : t.padding ?? 0, c = t.look === "neo" ? 12 : t.padding ?? 0, l = a.width + (t.look === "neo" ? s * 2 : s), u = a.height + (t.look === "neo" ? c * 2 : c), d = Math.max(5, u * .1), { cssStyles: f } = t, p = [
1233
+ ...Z(l / 2, -u / 2, d, 30, -90, 0),
1234
+ {
1235
+ x: -l / 2 - d,
1236
+ y: d
1237
+ },
1238
+ ...Z(l / 2 + d * 2, -d, d, 20, -180, -270),
1239
+ ...Z(l / 2 + d * 2, d, d, 20, -90, -180),
1240
+ {
1241
+ x: -l / 2 - d,
1242
+ y: -u / 2
1243
+ },
1244
+ ...Z(l / 2, u / 2, d, 20, 0, 90)
1245
+ ], m = [
1246
+ ...Z(-l / 2 + d + d / 2, -u / 2, d, 20, -90, -180),
1247
+ {
1248
+ x: l / 2 - d / 2,
1249
+ y: d
1250
+ },
1251
+ ...Z(-l / 2 - d / 2, -d, d, 20, 0, 90),
1252
+ ...Z(-l / 2 - d / 2, d, d, 20, -90, 0),
1253
+ {
1254
+ x: l / 2 - d / 2,
1255
+ y: -d
1256
+ },
1257
+ ...Z(-l / 2 + d + d / 2, u / 2, d, 30, -180, -270)
1258
+ ], h = [
1259
+ {
1260
+ x: l / 2,
1261
+ y: -u / 2 - d
1262
+ },
1263
+ {
1264
+ x: -l / 2,
1265
+ y: -u / 2 - d
1266
+ },
1267
+ ...Z(l / 2, -u / 2, d, 20, -90, 0),
1268
+ {
1269
+ x: -l / 2 - d,
1270
+ y: -d
1271
+ },
1272
+ ...Z(l / 2 + d * 2, -d, d, 20, -180, -270),
1273
+ ...Z(l / 2 + d * 2, d, d, 20, -90, -180),
1274
+ {
1275
+ x: -l / 2 - d,
1276
+ y: u / 2
1277
+ },
1278
+ ...Z(l / 2, u / 2, d, 20, 0, 90),
1279
+ {
1280
+ x: -l / 2,
1281
+ y: u / 2 + d
1282
+ },
1283
+ {
1284
+ x: l / 2 - d - d / 2,
1285
+ y: u / 2 + d
1286
+ },
1287
+ ...Z(-l / 2 + d + d / 2, -u / 2, d, 20, -90, -180),
1288
+ {
1289
+ x: l / 2 - d / 2,
1290
+ y: d
1291
+ },
1292
+ ...Z(-l / 2 - d / 2, -d, d, 20, 0, 90),
1293
+ ...Z(-l / 2 - d / 2, d, d, 20, -90, 0),
1294
+ {
1295
+ x: l / 2 - d / 2,
1296
+ y: -d
1297
+ },
1298
+ ...Z(-l / 2 + d + d / 2, u / 2, d, 30, -180, -270)
1299
+ ], g = T.svg(i), _ = b(t, { fill: "none" });
1300
+ t.look !== "handDrawn" && (_.roughness = 0, _.fillStyle = "solid");
1301
+ let v = R(p).replace("Z", ""), y = g.path(v, _), S = R(m).replace("Z", ""), C = g.path(S, _), w = R(h), E = g.path(w, { ..._ }), D = i.insert("g", ":first-child");
1302
+ return D.insert(() => E, ":first-child").attr("stroke-opacity", 0), D.insert(() => y, ":first-child"), D.insert(() => C, ":first-child"), D.attr("class", "text"), f && t.look !== "handDrawn" && D.selectAll("path").attr("style", f), r && t.look !== "handDrawn" && D.selectAll("path").attr("style", r), D.attr("transform", `translate(${d - d / 4}, 0)`), o.attr("transform", `translate(${-l / 2 + (t.padding ?? 0) / 2 - (a.x - (a.left ?? 0))},${-u / 2 + (t.padding ?? 0) / 2 - (a.y - (a.top ?? 0))})`), I(t, D), t.intersect = function(e) {
1303
+ return K.polygon(t, h, e);
1304
+ }, i;
1305
+ }
1306
+ o(Le, "curlyBraces");
1307
+ async function Re(e, t) {
1308
+ let { labelStyles: n, nodeStyles: r } = x(t);
1309
+ t.labelStyle = n;
1310
+ let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i, { shapeSvg: s, bbox: c } = await P(e, t, L(t)), l = Math.max(5, c.height + o * 2, t?.height ?? 0), u = l / 2, d = u - Math.sqrt(Math.max(0, u ** 2 - (c.height / 2) ** 2)), f = Math.max(l / 4, d), p = Math.max(20, c.width + a * 2 + f * 2, (c.width + a * 2) * 1.25, t?.width ?? 0), { cssStyles: m } = t, h = T.svg(s), g = b(t, {});
1311
+ t.look !== "handDrawn" && (g.roughness = 0, g.fillStyle = "solid");
1312
+ let _ = p, v = l, y = _ - u, S = v / 4, C = [
1313
+ {
1314
+ x: y,
1315
+ y: 0
1316
+ },
1317
+ {
1318
+ x: S,
1319
+ y: 0
1320
+ },
1321
+ {
1322
+ x: 0,
1323
+ y: v / 2
1324
+ },
1325
+ {
1326
+ x: S,
1327
+ y: v
1328
+ },
1329
+ {
1330
+ x: y,
1331
+ y: v
1332
+ },
1333
+ ...B(-y, -v / 2, u, 50, 270, 90)
1334
+ ], w = R(C), E = h.path(w, g), D = s.insert(() => E, ":first-child");
1335
+ return D.attr("class", "basic label-container outer-path"), m && t.look !== "handDrawn" && D.selectChildren("path").attr("style", m), r && t.look !== "handDrawn" && D.selectChildren("path").attr("style", r), D.attr("transform", `translate(${-p / 2}, ${-l / 2})`), I(t, D), t.intersect = function(e) {
1336
+ return K.polygon(t, C, e);
1337
+ }, s;
1338
+ }
1339
+ o(Re, "curvedTrapezoid");
1340
+ async function ze(e, t) {
1341
+ let { labelStyles: n, nodeStyles: r } = x(t);
1342
+ t.labelStyle = n;
1343
+ let { shapeSvg: i, bbox: a, label: o } = await P(e, t, L(t)), s = t.padding ?? 20, c = Math.max(a.width + s * 2, t.width ?? 0, 100), l = Math.min(Math.max(c * .23, 16), 56), u = l * .27, d = Math.max(a.height + s * 2, t.height ? t.height - (2 * l - u) : 0), f = Math.min(c * .177, d * .45), p = d + 2 * l - u, m = -p / 2, h = m + 2 * l - u, g = i.insert("g", ":first-child").attr("class", "basic label-container"), { cssStyles: _ } = t;
1344
+ if (t.look === "handDrawn") {
1345
+ let e = T.svg(i), n = b(t, {}), r = e.path(q(-c / 2, h, c, d, f), n), a = e.circle(0, m + l, l * 2, n);
1346
+ g.insert(() => a, ":first-child"), g.insert(() => r, ":first-child"), _ && g.attr("style", _);
1347
+ } else g.append("rect").attr("x", -c / 2).attr("y", h).attr("width", c).attr("height", d).attr("rx", f).attr("ry", f).attr("style", r), g.append("circle").attr("cx", 0).attr("cy", m + l).attr("r", l).attr("style", r);
1348
+ I(t, g);
1349
+ let v = h + d / 2;
1350
+ o.attr("transform", `translate(${-(a.width / 2) - (a.x - (a.left ?? 0))}, ${v - a.height / 2 - (a.y - (a.top ?? 0))})`);
1351
+ let y = m + l, S = Math.asin(Math.min(1, (h - y) / l)) * 180 / Math.PI, C = [
1352
+ ...B(0, -y, l, 24, 180 + S, -S),
1353
+ ...B(-(-c / 2 + f), -(h + f), f, 12, 90, 0),
1354
+ ...B(-(-c / 2 + f), -(p / 2 - f), f, 12, 360, 270),
1355
+ ...B(-(c / 2 - f), -(p / 2 - f), f, 12, 270, 180),
1356
+ ...B(-(c / 2 - f), -(h + f), f, 12, 180, 90)
1357
+ ];
1358
+ return t.intersect = function(e) {
1359
+ return K.polygon(t, C, e);
1360
+ }, i;
1361
+ }
1362
+ o(ze, "person");
1363
+ var Be = /* @__PURE__ */ o((e, t, n, r, i, a) => [
1364
+ `M${e},${t + a}`,
1365
+ `a${i},${a} 0,0,0 ${n},0`,
1366
+ `a${i},${a} 0,0,0 ${-n},0`,
1367
+ `l0,${r}`,
1368
+ `a${i},${a} 0,0,0 ${n},0`,
1369
+ `l0,${-r}`
1370
+ ].join(" "), "createCylinderPathD"), Ve = /* @__PURE__ */ o((e, t, n, r, i, a) => [
1371
+ `M${e},${t + a}`,
1372
+ `M${e + n},${t + a}`,
1373
+ `a${i},${a} 0,0,0 ${-n},0`,
1374
+ `l0,${r}`,
1375
+ `a${i},${a} 0,0,0 ${n},0`,
1376
+ `l0,${-r}`
1377
+ ].join(" "), "createOuterCylinderPathD"), He = /* @__PURE__ */ o((e, t, n, r, i, a) => [`M${e - n / 2},${-r / 2}`, `a${i},${a} 0,0,0 ${n},0`].join(" "), "createInnerCylinderPathD"), Ue = 8, We = 8;
1378
+ async function Ge(e, t) {
1379
+ let { labelStyles: n, nodeStyles: r } = x(t);
1380
+ t.labelStyle = n;
1381
+ let i = t.padding ?? 0, o = t.look === "neo" ? 24 : i, s = t.look === "neo" ? 24 : i, c = t.width ?? 0;
1382
+ if (t.width && (t.width -= s, t.width < We && (t.width = We)), t.height) {
1383
+ let e = c / 2 / (2.5 + c / 50);
1384
+ t.height = t.height - o - e * 3, t.height < Ue && (t.height = Ue);
1385
+ }
1386
+ let { shapeSvg: l, bbox: u, label: d } = await P(e, t, L(t)), f = Math.max(t.width ?? 0, u.width) + s, p = f / 2, m = p / (2.5 + f / 50), h = Math.max(t.height ?? 0, u.height) + o + m, g, { cssStyles: _ } = t;
1387
+ if (t.look === "handDrawn") {
1388
+ let e = T.svg(l), n = Ve(0, 0, f, h, p, m), r = He(0, m, f, h, p, m), i = b(t, {}), a = e.path(n, i), o = e.path(r, b(t, { fill: "none" }));
1389
+ g = l.insert(() => o, ":first-child"), g = l.insert(() => a, ":first-child"), g.attr("class", "basic label-container"), _ && g.attr("style", _);
1390
+ } else {
1391
+ let e = Be(0, 0, f, h, p, m);
1392
+ g = l.insert("path", ":first-child").attr("d", e).attr("class", "basic label-container outer-path").attr("style", a(_)).attr("style", r);
1393
+ }
1394
+ return g.attr("label-offset-y", m), g.attr("transform", `translate(${-f / 2}, ${-(h / 2 + m)})`), I(t, g), d.attr("transform", `translate(${-(u.width / 2) - (u.x - (u.left ?? 0))}, ${-(u.height / 2) + (t.padding ?? 0) / 1.5 - (u.y - (u.top ?? 0))})`), t.intersect = function(e) {
1395
+ let n = K.rect(t, e), r = n.x - (t.x ?? 0);
1396
+ if (p != 0 && (Math.abs(r) < (t.width ?? 0) / 2 || Math.abs(r) == (t.width ?? 0) / 2 && Math.abs(n.y - (t.y ?? 0)) > (t.height ?? 0) / 2 - m)) {
1397
+ let i = m * m * (1 - r * r / (p * p));
1398
+ i > 0 && (i = Math.sqrt(i)), i = m - i, e.y - (t.y ?? 0) > 0 && (i = -i), n.y += i;
1399
+ }
1400
+ return n;
1401
+ }, l;
1402
+ }
1403
+ o(Ge, "cylinder");
1404
+ async function Ke(e, t, n) {
1405
+ let { labelStyles: r, nodeStyles: i } = x(t);
1406
+ t.labelStyle = r;
1407
+ let { shapeSvg: o, bbox: s } = await P(e, t, L(t)), c = Math.max(s.width + n.labelPaddingX * 2, t?.width || 0), l = Math.max(s.height + n.labelPaddingY * 2, t?.height || 0), u = -c / 2, d = -l / 2, f, { rx: p, ry: m } = t, { cssStyles: h } = t;
1408
+ if (n?.rx && n.ry && (p = n.rx, m = n.ry), t.look === "handDrawn") {
1409
+ let e = T.svg(o), n = b(t, {}), r = p || m ? e.path(q(u, d, c, l, p || 0), n) : e.rectangle(u, d, c, l, n);
1410
+ f = o.insert(() => r, ":first-child"), f.attr("class", "basic label-container").attr("style", a(h));
1411
+ } else f = o.insert("rect", ":first-child"), f.attr("class", "basic label-container").attr("style", i).attr("rx", a(p)).attr("ry", a(m)).attr("x", u).attr("y", d).attr("width", c).attr("height", l);
1412
+ return I(t, f, t.look === "handDrawn" ? void 0 : {
1413
+ width: c,
1414
+ height: l
1415
+ }), t.calcIntersect = function(e, t) {
1416
+ return K.rect(e, t);
1417
+ }, t.intersect = function(e) {
1418
+ return K.rect(t, e);
1419
+ }, o;
1420
+ }
1421
+ o(Ke, "drawRect");
1422
+ async function qe(e, t) {
1423
+ let { cssClasses: n, labelPaddingX: r, labelPaddingY: i, padding: a, width: o, height: s } = t, c = await Ke(e, t, {
1424
+ rx: 0,
1425
+ ry: 0,
1426
+ classes: n ?? "",
1427
+ labelPaddingX: r ?? (a ?? 0) * 2,
1428
+ labelPaddingY: i ?? a ?? 0
1429
+ });
1430
+ if (t.look === "handDrawn") {
1431
+ let e = T.svg(c), n = b(t, {}), r = c.select(".basic.label-container > path:nth-child(2)"), i = r.node();
1432
+ if (!i) return c;
1433
+ let a = null;
1434
+ if (i instanceof SVGGraphicsElement) a = i.getBBox();
1435
+ else return c;
1436
+ return c.insert(() => e.line(a.x, a.y, a.x + a.width, a.y, n), ".basic.label-container g.label"), c.insert(() => e.line(a.x, a.y + a.height, a.x + a.width, a.y + a.height, n), ".basic.label-container g.label"), r.remove(), c;
1437
+ }
1438
+ let l = c.select(".basic.label-container"), u = (Number(l.attr("width")) || o) ?? 0, d = (Number(l.attr("height")) || s) ?? 0;
1439
+ return u > 0 && d > 0 && l.attr("stroke-dasharray", `${u} ${d}`), c;
1440
+ }
1441
+ o(qe, "datastore");
1442
+ async function Je(e, t) {
1443
+ let { labelStyles: n, nodeStyles: r } = x(t);
1444
+ t.labelStyle = n;
1445
+ let i = t.look === "neo" ? 16 : t.padding ?? 0, a = t.look === "neo" ? 16 : t.padding ?? 0, { shapeSvg: o, bbox: s, label: c } = await P(e, t, L(t)), l = s.width + i, u = s.height + a, d = u * .2, f = -l / 2, p = -u / 2 - d / 2, { cssStyles: m } = t, h = T.svg(o), g = b(t, {});
1446
+ t.look !== "handDrawn" && (g.roughness = 0, g.fillStyle = "solid");
1447
+ let _ = [
1448
+ {
1449
+ x: f,
1450
+ y: p + d
1451
+ },
1452
+ {
1453
+ x: -f,
1454
+ y: p + d
1455
+ },
1456
+ {
1457
+ x: -f,
1458
+ y: -p
1459
+ },
1460
+ {
1461
+ x: f,
1462
+ y: -p
1463
+ },
1464
+ {
1465
+ x: f,
1466
+ y: p
1467
+ },
1468
+ {
1469
+ x: -f,
1470
+ y: p
1471
+ },
1472
+ {
1473
+ x: -f,
1474
+ y: p + d
1475
+ }
1476
+ ], v = h.polygon(_.map((e) => [e.x, e.y]), g), y = o.insert(() => v, ":first-child");
1477
+ return y.attr("class", "basic label-container outer-path"), m && t.look !== "handDrawn" && y.selectAll("path").attr("style", m), r && t.look !== "handDrawn" && y.selectAll("path").attr("style", r), c.attr("transform", `translate(${f + (t.padding ?? 0) / 2 - (s.x - (s.left ?? 0))}, ${p + d + (t.padding ?? 0) / 2 - (s.y - (s.top ?? 0))})`), I(t, y), t.intersect = function(e) {
1478
+ return K.rect(t, e);
1479
+ }, o;
1480
+ }
1481
+ o(Je, "dividedRectangle");
1482
+ async function Ye(t, n) {
1483
+ let { labelStyles: r, nodeStyles: i } = x(n), o = n.look === "neo" ? 12 : 5;
1484
+ n.labelStyle = r;
1485
+ let s = n.padding ?? 0, c = n.look === "neo" ? 16 : s, { shapeSvg: l, bbox: u } = await P(t, n, L(n)), d = Math.sqrt(u.width ** 2 + u.height ** 2) / 2, f = (n?.width ? n?.width / 2 : d) + (c ?? 0), p = f + o, m, { cssStyles: h } = n;
1486
+ if (n.look === "handDrawn") {
1487
+ let e = T.svg(l), t = b(n, {
1488
+ roughness: .2,
1489
+ strokeWidth: 2.5
1490
+ }), r = b(n, {
1491
+ roughness: .2,
1492
+ strokeWidth: 1.5
1493
+ }), i = e.circle(0, 0, p * 2, t), o = e.circle(0, 0, f * 2, r);
1494
+ m = l.insert("g", ":first-child"), m.attr("class", a(n.cssClasses)).attr("style", a(h)), m.node()?.appendChild(i), m.node()?.appendChild(o);
1495
+ } else {
1496
+ m = l.insert("g", ":first-child");
1497
+ let e = m.insert("circle", ":first-child"), t = m.insert("circle");
1498
+ m.attr("class", "basic label-container").attr("style", i), e.attr("class", "outer-circle").attr("style", i).attr("r", p).attr("cx", 0).attr("cy", 0), t.attr("class", "inner-circle").attr("style", i).attr("r", f).attr("cx", 0).attr("cy", 0);
1499
+ }
1500
+ return I(n, m), n.intersect = function(t) {
1501
+ return e.info("DoubleCircle intersect", n, p, t), K.circle(n, p, t);
1502
+ }, l;
1503
+ }
1504
+ o(Ye, "doublecircle");
1505
+ async function Xe(e, t) {
1506
+ let { labelStyles: n, nodeStyles: r } = x(t);
1507
+ t.labelStyle = n;
1508
+ let { shapeSvg: i, bbox: a, halfPadding: o } = await P(e, t, L(t)), { theme: s, themeVariables: c } = m();
1509
+ w(i, t.colorIndex, s, c.borderColorArray);
1510
+ let l = o ?? 10, u = a.width / 2 + l * 2, d = a.height / 2 + l * 2, f, { cssStyles: p } = t;
1511
+ if (t.look === "handDrawn") {
1512
+ let e = T.svg(i), n = b(t, {}), r = e.ellipse(0, 0, u * 2, d * 2, n);
1513
+ f = i.insert(() => r, ":first-child"), f.attr("class", "basic label-container"), p && f.attr("style", p);
1514
+ } else f = i.insert("ellipse", ":first-child").attr("class", "basic label-container").attr("style", r).attr("rx", u).attr("ry", d).attr("cx", 0).attr("cy", 0);
1515
+ return t.width = u * 2, t.height = d * 2, I(t, f), t.calcIntersect = function(e, t) {
1516
+ let n = e.width / 2, r = e.height / 2;
1517
+ return K.ellipse(e, n, r, t);
1518
+ }, t.intersect = function(e) {
1519
+ return K.ellipse(t, u, d, e);
1520
+ }, i;
1521
+ }
1522
+ o(Xe, "usecaseEllipse");
1523
+ function Ze(t, n, { config: { themeVariables: r } }) {
1524
+ let { labelStyles: i, nodeStyles: a } = x(n);
1525
+ n.label = "", n.labelStyle = i;
1526
+ let o = t.insert("g").attr("class", L(n)).attr("id", n.domId ?? n.id), { cssStyles: s } = n, c = T.svg(o), { nodeBorder: l } = r, u = b(n, { fillStyle: "solid" });
1527
+ n.look !== "handDrawn" && (u.roughness = 0);
1528
+ let d = c.circle(0, 0, 14, u), f = o.insert(() => d, ":first-child");
1529
+ return f.selectAll("path").attr("style", `fill: ${l} !important;`), s && s.length > 0 && n.look !== "handDrawn" && f.selectAll("path").attr("style", s), a && n.look !== "handDrawn" && f.selectAll("path").attr("style", a), I(n, f), n.intersect = function(t) {
1530
+ return e.info("filledCircle intersect", n, {
1531
+ radius: 7,
1532
+ point: t
1533
+ }), K.circle(n, 7, t);
1534
+ }, o;
1535
+ }
1536
+ o(Ze, "filledCircle");
1537
+ var Qe = 10, $e = 10;
1538
+ async function et(t, n) {
1539
+ let { labelStyles: r, nodeStyles: i } = x(n);
1540
+ n.labelStyle = r;
1541
+ let a = n.padding ?? 0, o = n.look === "neo" ? a * 2 : a;
1542
+ (n.width || n.height) && (n.height = n?.height ?? 0, n.height < Qe && (n.height = Qe), n.width = (n?.width ?? 0) - o - o / 2, n.width < $e && (n.width = $e));
1543
+ let { shapeSvg: s, bbox: c, label: l } = await P(t, n, L(n)), u = (n?.width ? n?.width : c.width) + (o ?? 0), d = n?.height ? n?.height : u + c.height, f = d, p = [
1544
+ {
1545
+ x: 0,
1546
+ y: -d
1547
+ },
1548
+ {
1549
+ x: f,
1550
+ y: -d
1551
+ },
1552
+ {
1553
+ x: f / 2,
1554
+ y: 0
1555
+ }
1556
+ ], { cssStyles: m } = n, h = T.svg(s), g = b(n, {});
1557
+ n.look !== "handDrawn" && (g.roughness = 0, g.fillStyle = "solid");
1558
+ let _ = R(p), v = h.path(_, g), y = s.insert(() => v, ":first-child").attr("transform", `translate(${-d / 2}, ${d / 2})`).attr("class", "outer-path");
1559
+ return m && n.look !== "handDrawn" && y.selectChildren("path").attr("style", m), i && n.look !== "handDrawn" && y.selectChildren("path").attr("style", i), n.width = u, n.height = d, I(n, y), l.attr("transform", `translate(${-c.width / 2 - (c.x - (c.left ?? 0))}, ${-d / 2 + (n.padding ?? 0) / 2 + (c.y - (c.top ?? 0))})`), n.intersect = function(t) {
1560
+ return e.info("Triangle intersect", n, p, t), K.polygon(n, p, t);
1561
+ }, s;
1562
+ }
1563
+ o(et, "flippedTriangle");
1564
+ async function tt(e, t) {
1565
+ let { labelStyles: n, nodeStyles: r } = x(t);
1566
+ t.labelStyle = n;
1567
+ let { shapeSvg: i, bbox: a, label: o } = await P(e, t, L(t)), s = t.padding ?? 12, c = Math.max(a.width + s * 2, t.width ?? 0, 90), l = a.height + s * 2, u = Math.max(Math.min(l * .16, 14), 8), d = Math.max(l + u, t.height ?? 0), f = d - u, p = Math.max(c * .38, 28), m = -d / 2, h = [
1568
+ {
1569
+ x: -c / 2,
1570
+ y: m
1571
+ },
1572
+ {
1573
+ x: -c / 2 + p,
1574
+ y: m
1575
+ },
1576
+ {
1577
+ x: -c / 2 + p,
1578
+ y: m + u
1579
+ },
1580
+ {
1581
+ x: c / 2,
1582
+ y: m + u
1583
+ },
1584
+ {
1585
+ x: c / 2,
1586
+ y: d / 2
1587
+ },
1588
+ {
1589
+ x: -c / 2,
1590
+ y: d / 2
1591
+ }
1592
+ ], g = [
1593
+ `M${h[0].x},${h[0].y}`,
1594
+ ...h.slice(1).map((e) => `L${e.x},${e.y}`),
1595
+ "Z"
1596
+ ].join(" "), { cssStyles: _ } = t, v;
1597
+ if (t.look === "handDrawn") {
1598
+ let e = T.svg(i).path(g, b(t, {}));
1599
+ v = i.insert(() => e, ":first-child").attr("class", "basic label-container"), _ && v.attr("style", _);
1600
+ } else v = i.insert("path", ":first-child").attr("d", g).attr("class", "basic label-container").attr("style", r);
1601
+ t.look === "handDrawn" ? I(t, v) : I(t, v, {
1602
+ width: c,
1603
+ height: d
1604
+ });
1605
+ let y = m + u + f / 2;
1606
+ return o.attr("transform", `translate(${-(a.width / 2) - (a.x - (a.left ?? 0))}, ${y - a.height / 2 - (a.y - (a.top ?? 0))})`), t.intersect = function(e) {
1607
+ return K.polygon(t, h, e);
1608
+ }, i;
1609
+ }
1610
+ o(tt, "folder");
1611
+ function nt(e, t, { dir: n, config: { state: r, themeVariables: i } }) {
1612
+ let { nodeStyles: a } = x(t);
1613
+ t.label = "";
1614
+ let o = e.insert("g").attr("class", L(t)).attr("id", t.domId ?? t.id), { cssStyles: s } = t, c = Math.max(70, t?.width ?? 0), l = Math.max(10, t?.height ?? 0);
1615
+ (n === "LR" || n === "RL") && (c = Math.max(10, t?.width ?? 0), l = Math.max(70, t?.height ?? 0));
1616
+ let u = -1 * c / 2, d = -1 * l / 2, f = T.svg(o), p = b(t, {
1617
+ stroke: i.lineColor,
1618
+ fill: i.lineColor
1619
+ });
1620
+ t.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
1621
+ let m = f.rectangle(u, d, c, l, p), h = o.insert(() => m, ":first-child");
1622
+ s && t.look !== "handDrawn" && h.selectAll("path").attr("style", s), a && t.look !== "handDrawn" && h.selectAll("path").attr("style", a), I(t, h);
1623
+ let g = r?.padding ?? 0;
1624
+ return t.width && t.height && (t.width += g / 2 || 0, t.height += g / 2 || 0), t.intersect = function(e) {
1625
+ return K.rect(t, e);
1626
+ }, o;
1627
+ }
1628
+ o(nt, "forkJoin");
1629
+ async function rt(t, n) {
1630
+ let { labelStyles: r, nodeStyles: i } = x(n);
1631
+ n.labelStyle = r;
1632
+ let a = n.look === "neo" ? 16 : n.padding ?? 0, o = n.look === "neo" ? 12 : n.padding ?? 0;
1633
+ (n.width || n.height) && (n.height = (n?.height ?? 0) - o * 2, n.height < 10 && (n.height = 10), n.width = (n?.width ?? 0) - a * 2, n.width < 15 && (n.width = 15));
1634
+ let { shapeSvg: s, bbox: c } = await P(t, n, L(n)), l = (n?.height ? n?.height : Math.max(10, c.height)) + o * 2, u = l / 2, d = u - Math.sqrt(Math.max(0, u ** 2 - (c.height / 2) ** 2)), f = (n?.width ? n?.width : Math.max(15, c.width) + d * 2) + a * 2, { cssStyles: p } = n, m = T.svg(s), h = b(n, {});
1635
+ n.look !== "handDrawn" && (h.roughness = 0, h.fillStyle = "solid");
1636
+ let g = [
1637
+ {
1638
+ x: -f / 2,
1639
+ y: -l / 2
1640
+ },
1641
+ {
1642
+ x: f / 2 - u,
1643
+ y: -l / 2
1644
+ },
1645
+ ...B(-f / 2 + u, 0, u, 50, 90, 270),
1646
+ {
1647
+ x: f / 2 - u,
1648
+ y: l / 2
1649
+ },
1650
+ {
1651
+ x: -f / 2,
1652
+ y: l / 2
1653
+ }
1654
+ ], _ = R(g), v = m.path(_, h), y = s.insert(() => v, ":first-child");
1655
+ return y.attr("class", "basic label-container outer-path"), p && n.look !== "handDrawn" && y.selectChildren("path").attr("style", p), i && n.look !== "handDrawn" && y.selectChildren("path").attr("style", i), I(n, y), n.intersect = function(t) {
1656
+ return e.info("Pill intersect", n, {
1657
+ radius: u,
1658
+ point: t
1659
+ }), K.polygon(n, g, t);
1660
+ }, s;
1661
+ }
1662
+ o(rt, "halfRoundedRectangle");
1663
+ var it = /* @__PURE__ */ o((e, t, n, r, i) => [
1664
+ `M${e + i},${t}`,
1665
+ `L${e + n - i},${t}`,
1666
+ `L${e + n},${t - r / 2}`,
1667
+ `L${e + n - i},${t - r}`,
1668
+ `L${e + i},${t - r}`,
1669
+ `L${e},${t - r / 2}`,
1670
+ "Z"
1671
+ ].join(" "), "createHexagonPathD");
1672
+ async function at(e, t) {
1673
+ let { labelStyles: n, nodeStyles: r } = x(t), i = t.look === "neo" ? 3.5 : 4;
1674
+ t.labelStyle = n;
1675
+ let a = t.padding ?? 0, o = t.look === "neo" ? 70 : a, s = t.look === "neo" ? 32 : a;
1676
+ if (t.width || t.height) {
1677
+ let e = (t.height ?? 0) / i;
1678
+ t.width = (t?.width ?? 0) - 2 * e - s, t.height = (t.height ?? 0) - o;
1679
+ }
1680
+ let { shapeSvg: c, bbox: l } = await P(e, t, L(t)), u = (t?.height ? t?.height : l.height) + o, d = u / i, f = (t?.width ? t?.width : l.width) + 2 * d + s, p = [
1681
+ {
1682
+ x: d,
1683
+ y: 0
1684
+ },
1685
+ {
1686
+ x: f - d,
1687
+ y: 0
1688
+ },
1689
+ {
1690
+ x: f,
1691
+ y: -u / 2
1692
+ },
1693
+ {
1694
+ x: f - d,
1695
+ y: -u
1696
+ },
1697
+ {
1698
+ x: d,
1699
+ y: -u
1700
+ },
1701
+ {
1702
+ x: 0,
1703
+ y: -u / 2
1704
+ }
1705
+ ], m, { cssStyles: h } = t;
1706
+ if (t.look === "handDrawn") {
1707
+ let e = T.svg(c), n = b(t, {}), r = it(0, 0, f, u, d), i = e.path(r, n);
1708
+ m = c.insert(() => i, ":first-child").attr("transform", `translate(${-f / 2}, ${u / 2})`), h && m.attr("style", h);
1709
+ } else m = J(c, f, u, p);
1710
+ return r && m.attr("style", r), t.width = f, t.height = u, I(t, m), t.intersect = function(e) {
1711
+ return K.polygon(t, p, e);
1712
+ }, c;
1713
+ }
1714
+ o(at, "hexagon");
1715
+ async function ot(t, n) {
1716
+ let { labelStyles: r, nodeStyles: i } = x(n);
1717
+ n.label = "", n.labelStyle = r;
1718
+ let { shapeSvg: a } = await P(t, n, L(n)), o = Math.max(30, n?.width ?? 0), s = Math.max(30, n?.height ?? 0), { cssStyles: c } = n, l = T.svg(a), u = b(n, {});
1719
+ n.look !== "handDrawn" && (u.roughness = 0, u.fillStyle = "solid");
1720
+ let d = [
1721
+ {
1722
+ x: 0,
1723
+ y: 0
1724
+ },
1725
+ {
1726
+ x: o,
1727
+ y: 0
1728
+ },
1729
+ {
1730
+ x: 0,
1731
+ y: s
1732
+ },
1733
+ {
1734
+ x: o,
1735
+ y: s
1736
+ }
1737
+ ], f = R(d), p = l.path(f, u), m = a.insert(() => p, ":first-child");
1738
+ return m.attr("class", "basic label-container outer-path"), c && n.look !== "handDrawn" && m.selectChildren("path").attr("style", c), i && n.look !== "handDrawn" && m.selectChildren("path").attr("style", i), m.attr("transform", `translate(${-o / 2}, ${-s / 2})`), I(n, m), n.intersect = function(t) {
1739
+ return e.info("Pill intersect", n, { points: d }), K.polygon(n, d, t);
1740
+ }, a;
1741
+ }
1742
+ o(ot, "hourglass");
1743
+ async function st(t, n, { config: { themeVariables: r, flowchart: i } }) {
1744
+ let { labelStyles: a } = x(n);
1745
+ n.labelStyle = a;
1746
+ let o = n.assetHeight ?? 48, s = n.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
1747
+ n.width = Math.max(c, l ?? 0);
1748
+ let { shapeSvg: u, bbox: d, label: f } = await P(t, n, "icon-shape default"), p = n.pos === "t", m = c, h = c, { nodeBorder: g } = r, { stylesMap: v } = C(n), y = -h / 2, S = -m / 2, w = n.label ? 8 : 0, E = T.svg(u), D = b(n, {
1749
+ stroke: "none",
1750
+ fill: "none"
1751
+ });
1752
+ n.look !== "handDrawn" && (D.roughness = 0, D.fillStyle = "solid");
1753
+ let O = E.rectangle(y, S, h, m, D), k = Math.max(h, d.width), A = m + d.height + w, j = E.rectangle(-k / 2, -A / 2, k, A, {
1754
+ ...D,
1755
+ fill: "transparent",
1756
+ stroke: "none"
1757
+ }), M = u.insert(() => O, ":first-child"), N = u.insert(() => j);
1758
+ if (n.icon) {
1759
+ let e = u.append("g");
1760
+ e.html(`<g>${await _(n.icon, {
1761
+ height: c,
1762
+ width: c,
1763
+ fallbackPrefix: ""
1764
+ })}</g>`);
1765
+ let t = e.node().getBBox(), r = t.width, i = t.height, a = t.x, o = t.y;
1766
+ e.attr("transform", `translate(${-r / 2 - a},${p ? d.height / 2 + w / 2 - i / 2 - o : -d.height / 2 - w / 2 - i / 2 - o})`), e.attr("style", `color: ${v.get("stroke") ?? g};`);
1767
+ }
1768
+ return f.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${p ? -A / 2 : A / 2 - d.height})`), M.attr("transform", `translate(0,${p ? d.height / 2 + w / 2 : -d.height / 2 - w / 2})`), I(n, N), n.intersect = function(t) {
1769
+ if (e.info("iconSquare intersect", n, t), !n.label) return K.rect(n, t);
1770
+ let r = n.x ?? 0, i = n.y ?? 0, a = n.height ?? 0, o = [];
1771
+ return o = p ? [
1772
+ {
1773
+ x: r - d.width / 2,
1774
+ y: i - a / 2
1775
+ },
1776
+ {
1777
+ x: r + d.width / 2,
1778
+ y: i - a / 2
1779
+ },
1780
+ {
1781
+ x: r + d.width / 2,
1782
+ y: i - a / 2 + d.height + w
1783
+ },
1784
+ {
1785
+ x: r + h / 2,
1786
+ y: i - a / 2 + d.height + w
1787
+ },
1788
+ {
1789
+ x: r + h / 2,
1790
+ y: i + a / 2
1791
+ },
1792
+ {
1793
+ x: r - h / 2,
1794
+ y: i + a / 2
1795
+ },
1796
+ {
1797
+ x: r - h / 2,
1798
+ y: i - a / 2 + d.height + w
1799
+ },
1800
+ {
1801
+ x: r - d.width / 2,
1802
+ y: i - a / 2 + d.height + w
1803
+ }
1804
+ ] : [
1805
+ {
1806
+ x: r - h / 2,
1807
+ y: i - a / 2
1808
+ },
1809
+ {
1810
+ x: r + h / 2,
1811
+ y: i - a / 2
1812
+ },
1813
+ {
1814
+ x: r + h / 2,
1815
+ y: i - a / 2 + m
1816
+ },
1817
+ {
1818
+ x: r + d.width / 2,
1819
+ y: i - a / 2 + m
1820
+ },
1821
+ {
1822
+ x: r + d.width / 2 / 2,
1823
+ y: i + a / 2
1824
+ },
1825
+ {
1826
+ x: r - d.width / 2,
1827
+ y: i + a / 2
1828
+ },
1829
+ {
1830
+ x: r - d.width / 2,
1831
+ y: i - a / 2 + m
1832
+ },
1833
+ {
1834
+ x: r - h / 2,
1835
+ y: i - a / 2 + m
1836
+ }
1837
+ ], K.polygon(n, o, t);
1838
+ }, u;
1839
+ }
1840
+ o(st, "icon");
1841
+ async function ct(t, n, { config: { themeVariables: r, flowchart: i } }) {
1842
+ let { labelStyles: a } = x(n);
1843
+ n.labelStyle = a;
1844
+ let o = n.assetHeight ?? 48, s = n.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
1845
+ n.width = Math.max(c, l ?? 0);
1846
+ let { shapeSvg: u, bbox: d, label: f } = await P(t, n, "icon-shape default"), p = n.label ? 8 : 0, m = n.pos === "t", { nodeBorder: h, mainBkg: g } = r, { stylesMap: v } = C(n), y = T.svg(u), S = b(n, {});
1847
+ n.look !== "handDrawn" && (S.roughness = 0, S.fillStyle = "solid"), S.stroke = v.get("fill") ?? g;
1848
+ let w = u.append("g");
1849
+ n.icon && w.html(`<g>${await _(n.icon, {
1850
+ height: c,
1851
+ width: c,
1852
+ fallbackPrefix: ""
1853
+ })}</g>`);
1854
+ let E = w.node().getBBox(), D = E.width, O = E.height, k = E.x, A = E.y, j = Math.max(D, O) * Math.SQRT2 + 40, M = y.circle(0, 0, j, S), N = Math.max(j, d.width), F = j + d.height + p, L = y.rectangle(-N / 2, -F / 2, N, F, {
1855
+ ...S,
1856
+ fill: "transparent",
1857
+ stroke: "none"
1858
+ }), R = u.insert(() => M, ":first-child"), z = u.insert(() => L);
1859
+ return w.attr("transform", `translate(${-D / 2 - k},${m ? d.height / 2 + p / 2 - O / 2 - A : -d.height / 2 - p / 2 - O / 2 - A})`), w.attr("style", `color: ${v.get("stroke") ?? h};`), f.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${m ? -F / 2 : F / 2 - d.height})`), R.attr("transform", `translate(0,${m ? d.height / 2 + p / 2 : -d.height / 2 - p / 2})`), I(n, z), n.intersect = function(t) {
1860
+ return e.info("iconSquare intersect", n, t), K.rect(n, t);
1861
+ }, u;
1862
+ }
1863
+ o(ct, "iconCircle");
1864
+ async function lt(t, n, { config: { themeVariables: r, flowchart: i } }) {
1865
+ let { labelStyles: a } = x(n);
1866
+ n.labelStyle = a;
1867
+ let o = n.assetHeight ?? 48, s = n.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
1868
+ n.width = Math.max(c, l ?? 0);
1869
+ let { shapeSvg: u, bbox: d, halfPadding: f, label: p } = await P(t, n, "icon-shape default"), m = n.pos === "t", h = c + f * 2, g = c + f * 2, { nodeBorder: v, mainBkg: y } = r, { stylesMap: S } = C(n), w = -g / 2, E = -h / 2, D = n.label ? 8 : 0, O = T.svg(u), k = b(n, {});
1870
+ n.look !== "handDrawn" && (k.roughness = 0, k.fillStyle = "solid"), k.stroke = S.get("fill") ?? y;
1871
+ let A = O.path(q(w, E, g, h, 5), k), j = Math.max(g, d.width), M = h + d.height + D, N = O.rectangle(-j / 2, -M / 2, j, M, {
1872
+ ...k,
1873
+ fill: "transparent",
1874
+ stroke: "none"
1875
+ }), F = u.insert(() => A, ":first-child").attr("class", "icon-shape2"), L = u.insert(() => N);
1876
+ if (n.icon) {
1877
+ let e = u.append("g");
1878
+ e.html(`<g>${await _(n.icon, {
1879
+ height: c,
1880
+ width: c,
1881
+ fallbackPrefix: ""
1882
+ })}</g>`);
1883
+ let t = e.node().getBBox(), r = t.width, i = t.height, a = t.x, o = t.y;
1884
+ e.attr("transform", `translate(${-r / 2 - a},${m ? d.height / 2 + D / 2 - i / 2 - o : -d.height / 2 - D / 2 - i / 2 - o})`), e.attr("style", `color: ${S.get("stroke") ?? v};`);
1885
+ }
1886
+ return p.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${m ? -M / 2 : M / 2 - d.height})`), F.attr("transform", `translate(0,${m ? d.height / 2 + D / 2 : -d.height / 2 - D / 2})`), I(n, L), n.intersect = function(t) {
1887
+ if (e.info("iconSquare intersect", n, t), !n.label) return K.rect(n, t);
1888
+ let r = n.x ?? 0, i = n.y ?? 0, a = n.height ?? 0, o = [];
1889
+ return o = m ? [
1890
+ {
1891
+ x: r - d.width / 2,
1892
+ y: i - a / 2
1893
+ },
1894
+ {
1895
+ x: r + d.width / 2,
1896
+ y: i - a / 2
1897
+ },
1898
+ {
1899
+ x: r + d.width / 2,
1900
+ y: i - a / 2 + d.height + D
1901
+ },
1902
+ {
1903
+ x: r + g / 2,
1904
+ y: i - a / 2 + d.height + D
1905
+ },
1906
+ {
1907
+ x: r + g / 2,
1908
+ y: i + a / 2
1909
+ },
1910
+ {
1911
+ x: r - g / 2,
1912
+ y: i + a / 2
1913
+ },
1914
+ {
1915
+ x: r - g / 2,
1916
+ y: i - a / 2 + d.height + D
1917
+ },
1918
+ {
1919
+ x: r - d.width / 2,
1920
+ y: i - a / 2 + d.height + D
1921
+ }
1922
+ ] : [
1923
+ {
1924
+ x: r - g / 2,
1925
+ y: i - a / 2
1926
+ },
1927
+ {
1928
+ x: r + g / 2,
1929
+ y: i - a / 2
1930
+ },
1931
+ {
1932
+ x: r + g / 2,
1933
+ y: i - a / 2 + h
1934
+ },
1935
+ {
1936
+ x: r + d.width / 2,
1937
+ y: i - a / 2 + h
1938
+ },
1939
+ {
1940
+ x: r + d.width / 2 / 2,
1941
+ y: i + a / 2
1942
+ },
1943
+ {
1944
+ x: r - d.width / 2,
1945
+ y: i + a / 2
1946
+ },
1947
+ {
1948
+ x: r - d.width / 2,
1949
+ y: i - a / 2 + h
1950
+ },
1951
+ {
1952
+ x: r - g / 2,
1953
+ y: i - a / 2 + h
1954
+ }
1955
+ ], K.polygon(n, o, t);
1956
+ }, u;
1957
+ }
1958
+ o(lt, "iconRounded");
1959
+ async function ut(t, n, { config: { themeVariables: r, flowchart: i } }) {
1960
+ let { labelStyles: a } = x(n);
1961
+ n.labelStyle = a;
1962
+ let o = n.assetHeight ?? 48, s = n.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
1963
+ n.width = Math.max(c, l ?? 0);
1964
+ let { shapeSvg: u, bbox: d, halfPadding: f, label: p } = await P(t, n, "icon-shape default"), m = n.pos === "t", h = c + f * 2, g = c + f * 2, { nodeBorder: v, mainBkg: y } = r, { stylesMap: S } = C(n), w = -g / 2, E = -h / 2, D = n.label ? 8 : 0, O = T.svg(u), k = b(n, {});
1965
+ n.look !== "handDrawn" && (k.roughness = 0, k.fillStyle = "solid"), k.stroke = S.get("fill") ?? y;
1966
+ let A = O.path(q(w, E, g, h, .1), k), j = Math.max(g, d.width), M = h + d.height + D, N = O.rectangle(-j / 2, -M / 2, j, M, {
1967
+ ...k,
1968
+ fill: "transparent",
1969
+ stroke: "none"
1970
+ }), F = u.insert(() => A, ":first-child"), L = u.insert(() => N);
1971
+ if (n.icon) {
1972
+ let e = u.append("g");
1973
+ e.html(`<g>${await _(n.icon, {
1974
+ height: c,
1975
+ width: c,
1976
+ fallbackPrefix: ""
1977
+ })}</g>`);
1978
+ let t = e.node().getBBox(), r = t.width, i = t.height, a = t.x, o = t.y;
1979
+ e.attr("transform", `translate(${-r / 2 - a},${m ? d.height / 2 + D / 2 - i / 2 - o : -d.height / 2 - D / 2 - i / 2 - o})`), e.attr("style", `color: ${S.get("stroke") ?? v};`);
1980
+ }
1981
+ return p.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${m ? -M / 2 : M / 2 - d.height})`), F.attr("transform", `translate(0,${m ? d.height / 2 + D / 2 : -d.height / 2 - D / 2})`), I(n, L), n.intersect = function(t) {
1982
+ if (e.info("iconSquare intersect", n, t), !n.label) return K.rect(n, t);
1983
+ let r = n.x ?? 0, i = n.y ?? 0, a = n.height ?? 0, o = [];
1984
+ return o = m ? [
1985
+ {
1986
+ x: r - d.width / 2,
1987
+ y: i - a / 2
1988
+ },
1989
+ {
1990
+ x: r + d.width / 2,
1991
+ y: i - a / 2
1992
+ },
1993
+ {
1994
+ x: r + d.width / 2,
1995
+ y: i - a / 2 + d.height + D
1996
+ },
1997
+ {
1998
+ x: r + g / 2,
1999
+ y: i - a / 2 + d.height + D
2000
+ },
2001
+ {
2002
+ x: r + g / 2,
2003
+ y: i + a / 2
2004
+ },
2005
+ {
2006
+ x: r - g / 2,
2007
+ y: i + a / 2
2008
+ },
2009
+ {
2010
+ x: r - g / 2,
2011
+ y: i - a / 2 + d.height + D
2012
+ },
2013
+ {
2014
+ x: r - d.width / 2,
2015
+ y: i - a / 2 + d.height + D
2016
+ }
2017
+ ] : [
2018
+ {
2019
+ x: r - g / 2,
2020
+ y: i - a / 2
2021
+ },
2022
+ {
2023
+ x: r + g / 2,
2024
+ y: i - a / 2
2025
+ },
2026
+ {
2027
+ x: r + g / 2,
2028
+ y: i - a / 2 + h
2029
+ },
2030
+ {
2031
+ x: r + d.width / 2,
2032
+ y: i - a / 2 + h
2033
+ },
2034
+ {
2035
+ x: r + d.width / 2 / 2,
2036
+ y: i + a / 2
2037
+ },
2038
+ {
2039
+ x: r - d.width / 2,
2040
+ y: i + a / 2
2041
+ },
2042
+ {
2043
+ x: r - d.width / 2,
2044
+ y: i - a / 2 + h
2045
+ },
2046
+ {
2047
+ x: r - g / 2,
2048
+ y: i - a / 2 + h
2049
+ }
2050
+ ], K.polygon(n, o, t);
2051
+ }, u;
2052
+ }
2053
+ o(ut, "iconSquare");
2054
+ async function dt(t, n, { config: { flowchart: r } }) {
2055
+ let i = new Image();
2056
+ i.src = n?.img ?? "", await i.decode();
2057
+ let a = Number(i.naturalWidth.toString().replace("px", "")), o = Number(i.naturalHeight.toString().replace("px", ""));
2058
+ n.imageAspectRatio = a / o;
2059
+ let { labelStyles: s } = x(n);
2060
+ n.labelStyle = s;
2061
+ let c = r?.wrappingWidth;
2062
+ n.defaultWidth = r?.wrappingWidth;
2063
+ let l = Math.max(n.label ? c ?? 0 : 0, n?.assetWidth ?? a), u = n.constraint === "on" && n?.assetHeight ? n.assetHeight * n.imageAspectRatio : l, d = n.constraint === "on" ? u / n.imageAspectRatio : n?.assetHeight ?? o;
2064
+ n.width = Math.max(u, c ?? 0);
2065
+ let { shapeSvg: f, bbox: p, label: m } = await P(t, n, "image-shape default"), h = n.pos === "t", g = -u / 2, _ = -d / 2, v = n.label ? 8 : 0, y = T.svg(f), S = b(n, {});
2066
+ n.look !== "handDrawn" && (S.roughness = 0, S.fillStyle = "solid");
2067
+ let C = y.rectangle(g, _, u, d, S), w = Math.max(u, p.width), E = d + p.height + v, D = y.rectangle(-w / 2, -E / 2, w, E, {
2068
+ ...S,
2069
+ fill: "none",
2070
+ stroke: "none"
2071
+ }), O = f.insert(() => C, ":first-child"), k = f.insert(() => D);
2072
+ if (n.img) {
2073
+ let e = f.append("image");
2074
+ e.attr("href", n.img), e.attr("width", u), e.attr("height", d), e.attr("preserveAspectRatio", "none"), e.attr("transform", `translate(${-u / 2},${h ? E / 2 - d : -E / 2})`);
2075
+ }
2076
+ return m.attr("transform", `translate(${-p.width / 2 - (p.x - (p.left ?? 0))},${h ? -d / 2 - p.height / 2 - v / 2 : d / 2 - p.height / 2 + v / 2})`), O.attr("transform", `translate(0,${h ? p.height / 2 + v / 2 : -p.height / 2 - v / 2})`), I(n, k), n.intersect = function(t) {
2077
+ if (e.info("iconSquare intersect", n, t), !n.label) return K.rect(n, t);
2078
+ let r = n.x ?? 0, i = n.y ?? 0, a = n.height ?? 0, o = [];
2079
+ return o = h ? [
2080
+ {
2081
+ x: r - p.width / 2,
2082
+ y: i - a / 2
2083
+ },
2084
+ {
2085
+ x: r + p.width / 2,
2086
+ y: i - a / 2
2087
+ },
2088
+ {
2089
+ x: r + p.width / 2,
2090
+ y: i - a / 2 + p.height + v
2091
+ },
2092
+ {
2093
+ x: r + u / 2,
2094
+ y: i - a / 2 + p.height + v
2095
+ },
2096
+ {
2097
+ x: r + u / 2,
2098
+ y: i + a / 2
2099
+ },
2100
+ {
2101
+ x: r - u / 2,
2102
+ y: i + a / 2
2103
+ },
2104
+ {
2105
+ x: r - u / 2,
2106
+ y: i - a / 2 + p.height + v
2107
+ },
2108
+ {
2109
+ x: r - p.width / 2,
2110
+ y: i - a / 2 + p.height + v
2111
+ }
2112
+ ] : [
2113
+ {
2114
+ x: r - u / 2,
2115
+ y: i - a / 2
2116
+ },
2117
+ {
2118
+ x: r + u / 2,
2119
+ y: i - a / 2
2120
+ },
2121
+ {
2122
+ x: r + u / 2,
2123
+ y: i - a / 2 + d
2124
+ },
2125
+ {
2126
+ x: r + p.width / 2,
2127
+ y: i - a / 2 + d
2128
+ },
2129
+ {
2130
+ x: r + p.width / 2 / 2,
2131
+ y: i + a / 2
2132
+ },
2133
+ {
2134
+ x: r - p.width / 2,
2135
+ y: i + a / 2
2136
+ },
2137
+ {
2138
+ x: r - p.width / 2,
2139
+ y: i - a / 2 + d
2140
+ },
2141
+ {
2142
+ x: r - u / 2,
2143
+ y: i - a / 2 + d
2144
+ }
2145
+ ], K.polygon(n, o, t);
2146
+ }, f;
2147
+ }
2148
+ o(dt, "imageSquare");
2149
+ async function ft(e, t) {
2150
+ let { labelStyles: n, nodeStyles: r } = x(t);
2151
+ t.labelStyle = n;
2152
+ let i = t.padding ?? 0, a = i, o = t.look === "neo" ? i * 2 : i, { shapeSvg: s, bbox: c } = await P(e, t, L(t)), l = Math.max(c.height + a * 2, t.height ?? 0), u = Math.max(c.width + o * 2, (t.width ?? 0) - l), d = [
2153
+ {
2154
+ x: 0,
2155
+ y: 0
2156
+ },
2157
+ {
2158
+ x: u,
2159
+ y: 0
2160
+ },
2161
+ {
2162
+ x: u + 3 * l / 6,
2163
+ y: -l
2164
+ },
2165
+ {
2166
+ x: -3 * l / 6,
2167
+ y: -l
2168
+ }
2169
+ ], f, { cssStyles: p } = t;
2170
+ if (t.look === "handDrawn") {
2171
+ let e = T.svg(s), n = b(t, {}), r = R(d), i = e.path(r, n);
2172
+ f = s.insert(() => i, ":first-child").attr("transform", `translate(${-u / 2}, ${l / 2})`), p && f.attr("style", p);
2173
+ } else f = J(s, u, l, d);
2174
+ return r && f.attr("style", r), t.width = u, t.height = l, I(t, f), t.intersect = function(e) {
2175
+ return K.polygon(t, d, e);
2176
+ }, s;
2177
+ }
2178
+ o(ft, "inv_trapezoid");
2179
+ async function pt(e, t) {
2180
+ let { shapeSvg: n, bbox: r, label: i } = await P(e, t, "label"), a = n.insert("rect", ":first-child");
2181
+ return a.attr("width", .1).attr("height", .1), n.attr("class", "label edgeLabel"), i.attr("transform", `translate(${-(r.width / 2) - (r.x - (r.left ?? 0))}, ${-(r.height / 2) - (r.y - (r.top ?? 0))})`), I(t, a), t.intersect = function(e) {
2182
+ return K.rect(t, e);
2183
+ }, n;
2184
+ }
2185
+ o(pt, "labelRect");
2186
+ async function mt(e, t) {
2187
+ let { labelStyles: n, nodeStyles: r } = x(t);
2188
+ t.labelStyle = n;
2189
+ let i = t.padding ?? 0, a = i, o = t.look === "neo" ? i * 2 : i, { shapeSvg: s, bbox: c } = await P(e, t, L(t)), l = Math.max(c.height + a, t.height ?? 0), u = Math.max(c.width + o, (t.width ?? 0) - l), d = [
2190
+ {
2191
+ x: 0,
2192
+ y: 0
2193
+ },
2194
+ {
2195
+ x: u + 3 * l / 6,
2196
+ y: 0
2197
+ },
2198
+ {
2199
+ x: u,
2200
+ y: -l
2201
+ },
2202
+ {
2203
+ x: -(3 * l) / 6,
2204
+ y: -l
2205
+ }
2206
+ ], f, { cssStyles: p } = t;
2207
+ if (t.look === "handDrawn") {
2208
+ let e = T.svg(s), n = b(t, {}), r = R(d), i = e.path(r, n);
2209
+ f = s.insert(() => i, ":first-child").attr("transform", `translate(${-u / 2}, ${l / 2})`), p && f.attr("style", p);
2210
+ } else f = J(s, u, l, d);
2211
+ return r && f.attr("style", r), t.width = u, t.height = l, I(t, f), t.intersect = function(e) {
2212
+ return K.polygon(t, d, e);
2213
+ }, s;
2214
+ }
2215
+ o(mt, "lean_left");
2216
+ async function ht(e, t) {
2217
+ let { labelStyles: n, nodeStyles: r } = x(t);
2218
+ t.labelStyle = n;
2219
+ let i = t.padding ?? 0, a = i, o = t.look === "neo" ? i * 2 : i, { shapeSvg: s, bbox: c } = await P(e, t, L(t)), l = Math.max(c.height + a, t.height ?? 0), u = Math.max(c.width + o, (t.width ?? 0) - l), d = [
2220
+ {
2221
+ x: -3 * l / 6,
2222
+ y: 0
2223
+ },
2224
+ {
2225
+ x: u,
2226
+ y: 0
2227
+ },
2228
+ {
2229
+ x: u + 3 * l / 6,
2230
+ y: -l
2231
+ },
2232
+ {
2233
+ x: 0,
2234
+ y: -l
2235
+ }
2236
+ ], f, { cssStyles: p } = t;
2237
+ if (t.look === "handDrawn") {
2238
+ let e = T.svg(s), n = b(t, {}), r = R(d), i = e.path(r, n);
2239
+ f = s.insert(() => i, ":first-child").attr("transform", `translate(${-u / 2}, ${l / 2})`), p && f.attr("style", p);
2240
+ } else f = J(s, u, l, d);
2241
+ return r && f.attr("style", r), t.width = u, t.height = l, I(t, f), t.intersect = function(e) {
2242
+ return K.polygon(t, d, e);
2243
+ }, s;
2244
+ }
2245
+ o(ht, "lean_right");
2246
+ function gt(t, n) {
2247
+ let { labelStyles: r, nodeStyles: i } = x(n);
2248
+ n.label = "", n.labelStyle = r;
2249
+ let a = t.insert("g").attr("class", L(n)).attr("id", n.domId ?? n.id), { cssStyles: o } = n, s = Math.max(35, n?.width ?? 0), c = Math.max(35, n?.height ?? 0), l = [
2250
+ {
2251
+ x: s,
2252
+ y: 0
2253
+ },
2254
+ {
2255
+ x: 0,
2256
+ y: c + 7 / 2
2257
+ },
2258
+ {
2259
+ x: s - 14,
2260
+ y: c + 7 / 2
2261
+ },
2262
+ {
2263
+ x: 0,
2264
+ y: 2 * c
2265
+ },
2266
+ {
2267
+ x: s,
2268
+ y: c - 7 / 2
2269
+ },
2270
+ {
2271
+ x: 14,
2272
+ y: c - 7 / 2
2273
+ }
2274
+ ], u = T.svg(a), d = b(n, {});
2275
+ n.look !== "handDrawn" && (d.roughness = 0, d.fillStyle = "solid");
2276
+ let f = R(l), p = u.path(f, d), m = a.insert(() => p, ":first-child");
2277
+ return m.attr("class", "outer-path"), o && n.look !== "handDrawn" && m.selectAll("path").attr("style", o), i && n.look !== "handDrawn" && m.selectAll("path").attr("style", i), m.attr("transform", `translate(-${s / 2},${-c})`), I(n, m), n.intersect = function(t) {
2278
+ return e.info("lightningBolt intersect", n, t), K.polygon(n, l, t);
2279
+ }, a;
2280
+ }
2281
+ o(gt, "lightningBolt");
2282
+ var _t = /* @__PURE__ */ o((e, t, n, r, i, a, o) => [
2283
+ `M${e},${t + a}`,
2284
+ `a${i},${a} 0,0,0 ${n},0`,
2285
+ `a${i},${a} 0,0,0 ${-n},0`,
2286
+ `l0,${r}`,
2287
+ `a${i},${a} 0,0,0 ${n},0`,
2288
+ `l0,${-r}`,
2289
+ `M${e},${t + a + o}`,
2290
+ `a${i},${a} 0,0,0 ${n},0`
2291
+ ].join(" "), "createCylinderPathD"), vt = /* @__PURE__ */ o((e, t, n, r, i, a, o) => [
2292
+ `M${e},${t + a}`,
2293
+ `M${e + n},${t + a}`,
2294
+ `a${i},${a} 0,0,0 ${-n},0`,
2295
+ `l0,${r}`,
2296
+ `a${i},${a} 0,0,0 ${n},0`,
2297
+ `l0,${-r}`,
2298
+ `M${e},${t + a + o}`,
2299
+ `a${i},${a} 0,0,0 ${n},0`
2300
+ ].join(" "), "createOuterCylinderPathD"), yt = /* @__PURE__ */ o((e, t, n, r, i, a) => [`M${e - n / 2},${-r / 2}`, `a${i},${a} 0,0,0 ${n},0`].join(" "), "createInnerCylinderPathD"), bt = 10, xt = 10;
2301
+ async function St(e, t) {
2302
+ let { labelStyles: n, nodeStyles: r } = x(t);
2303
+ t.labelStyle = n;
2304
+ let i = t.padding ?? 0, o = t.look === "neo" ? 16 : i, s = t.look === "neo" ? 24 : i;
2305
+ if (t.width || t.height) {
2306
+ let e = t.width ?? 0;
2307
+ t.width = (t.width ?? 0) - o, t.width < xt && (t.width = xt);
2308
+ let n = e / 2 / (2.5 + e / 50);
2309
+ t.height = (t.height ?? 0) - s - n * 3, t.height < bt && (t.height = bt);
2310
+ }
2311
+ let { shapeSvg: c, bbox: l, label: u } = await P(e, t, L(t)), d = (t?.width ? t?.width : l.width) + o * 2, f = d / 2, p = f / (2.5 + d / 50), m = (t?.height ? t?.height : l.height) + p + s * 2, h = m * .1, g, { cssStyles: _ } = t;
2312
+ if (t.look === "handDrawn") {
2313
+ let e = T.svg(c), n = vt(0, 0, d, m, f, p, h), r = yt(0, p, d, m, f, p), i = b(t, {}), a = e.path(n, i), o = e.path(r, i);
2314
+ c.insert(() => o, ":first-child").attr("class", "line"), g = c.insert(() => a, ":first-child"), g.attr("class", "basic label-container"), _ && g.attr("style", _);
2315
+ } else {
2316
+ let e = _t(0, 0, d, m, f, p, h);
2317
+ g = c.insert("path", ":first-child").attr("d", e).attr("class", "basic label-container outer-path").attr("style", a(_)).attr("style", r);
2318
+ }
2319
+ return g.attr("label-offset-y", p), g.attr("transform", `translate(${-d / 2}, ${-(m / 2 + p)})`), I(t, g), u.attr("transform", `translate(${-(l.width / 2) - (l.x - (l.left ?? 0))}, ${-(l.height / 2) + p - (l.y - (l.top ?? 0))})`), t.intersect = function(e) {
2320
+ let n = K.rect(t, e), r = n.x - (t.x ?? 0);
2321
+ if (f != 0 && (Math.abs(r) < (t.width ?? 0) / 2 || Math.abs(r) == (t.width ?? 0) / 2 && Math.abs(n.y - (t.y ?? 0)) > (t.height ?? 0) / 2 - p)) {
2322
+ let i = p * p * (1 - r * r / (f * f));
2323
+ i > 0 && (i = Math.sqrt(i)), i = p - i, e.y - (t.y ?? 0) > 0 && (i = -i), n.y += i;
2324
+ }
2325
+ return n;
2326
+ }, c;
2327
+ }
2328
+ o(St, "linedCylinder");
2329
+ async function Ct(e, t) {
2330
+ let { labelStyles: n, nodeStyles: r } = x(t);
2331
+ t.labelStyle = n;
2332
+ let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i;
2333
+ (t.width || t.height) && (t.width = (t.width ?? 0) * 10 / 11 - a * 2, t.width < 10 && (t.width = 10), t.height = (t?.height ?? 0) - o * 2, t.height < 10 && (t.height = 10));
2334
+ let { shapeSvg: s, bbox: c, label: l } = await P(e, t, L(t)), u = (t?.width ? t?.width : c.width) + (a ?? 0) * 2, d = (t?.height ? t?.height : c.height) + (o ?? 0) * 2, f = t.look === "neo" ? d / 4 : d / 8, p = d + f, { cssStyles: m } = t, h = T.svg(s), g = b(t, {});
2335
+ t.look !== "handDrawn" && (g.roughness = 0, g.fillStyle = "solid");
2336
+ let _ = [
2337
+ {
2338
+ x: -u / 2 - u / 2 * .1,
2339
+ y: -p / 2
2340
+ },
2341
+ {
2342
+ x: -u / 2 - u / 2 * .1,
2343
+ y: p / 2
2344
+ },
2345
+ ...z(-u / 2 - u / 2 * .1, p / 2, u / 2 + u / 2 * .1, p / 2, f, .8),
2346
+ {
2347
+ x: u / 2 + u / 2 * .1,
2348
+ y: -p / 2
2349
+ },
2350
+ {
2351
+ x: -u / 2 - u / 2 * .1,
2352
+ y: -p / 2
2353
+ },
2354
+ {
2355
+ x: -u / 2,
2356
+ y: -p / 2
2357
+ },
2358
+ {
2359
+ x: -u / 2,
2360
+ y: p / 2 * 1.1
2361
+ },
2362
+ {
2363
+ x: -u / 2,
2364
+ y: -p / 2
2365
+ }
2366
+ ], v = h.polygon(_.map((e) => [e.x, e.y]), g), y = s.insert(() => v, ":first-child");
2367
+ return y.attr("class", "basic label-container outer-path"), m && t.look !== "handDrawn" && y.selectAll("path").attr("style", m), r && t.look !== "handDrawn" && y.selectAll("path").attr("style", r), y.attr("transform", `translate(0,${-f / 2})`), l.attr("transform", `translate(${-u / 2 + (t.padding ?? 0) + u / 2 * .1 / 2 - (c.x - (c.left ?? 0))},${-d / 2 + (t.padding ?? 0) - f - (c.y - (c.top ?? 0))})`), I(t, y), t.intersect = function(e) {
2368
+ return K.polygon(t, _, e);
2369
+ }, s;
2370
+ }
2371
+ o(Ct, "linedWaveEdgedRect");
2372
+ var wt = 56, Tt = 72, Et = 8, Dt = 2, Ot = 8, kt = {
2373
+ normal: "usecase-actor-shape usecase-actor-normal",
2374
+ hollow: "usecase-actor-hollow",
2375
+ awesome: "usecase-actor-awesome",
2376
+ icon: "usecase-actor-icon"
2377
+ }, At = Math.PI / 3, jt = .6, Mt = /* @__PURE__ */ o((e, t) => {
2378
+ let n = t * jt, r = t * Math.sqrt(1 - jt ** 2), i = Math.cos(At), a = -Math.sin(At), o = n * -a, s = e + n * i, c = r * i, l = r * a;
2379
+ return `M ${o - c} ${s - l} L ${o + c} ${s + l}`;
2380
+ }, "businessMarkerPathForCircle"), Nt = {
2381
+ normal: Mt(-24, 12),
2382
+ hollow: Mt(-23, 9),
2383
+ awesome: Mt(-21, 13),
2384
+ icon: "M 12 -8 L 26 -26"
2385
+ }, Pt = /* @__PURE__ */ o((e, t, n) => {
2386
+ let r = (t.x ?? 0) - (t.left ?? 0), i = (t.y ?? 0) - (t.top ?? 0);
2387
+ e.attr("transform", `translate(${-t.width / 2 - r},${n - t.height / 2 - i})`);
2388
+ }, "positionLabel"), Ft = /* @__PURE__ */ o((e, t, n, r, i = !1) => {
2389
+ if (t.look === "handDrawn") {
2390
+ let a = T.svg(e).path(n, b(t, i ? { fill: "none" } : {}));
2391
+ return e.insert(() => a, ":first-child").attr("class", r);
2392
+ }
2393
+ let a = e.append("path").attr("class", r).attr("d", n);
2394
+ return i && a.attr("fill", "none"), a;
2395
+ }, "appendActorPath"), It = /* @__PURE__ */ o((e, t, n, r, i, a, o = !1) => {
2396
+ if (t.look === "handDrawn") {
2397
+ let s = T.svg(e).circle(n, r, i * 2, b(t, o ? { fill: "none" } : {}));
2398
+ return e.insert(() => s, ":first-child").attr("class", a);
2399
+ }
2400
+ let s = e.append("circle").attr("class", a).attr("cx", n).attr("cy", r).attr("r", i);
2401
+ return o && s.attr("fill", "none"), s;
2402
+ }, "appendActorCircle"), Lt = /* @__PURE__ */ o((e, t, n) => {
2403
+ t.business && e.append("path").attr("class", "usecase-business-marker usecase-actor-business-marker").attr("d", Nt[n]).attr("fill", "none").attr("style", "stroke: inherit !important; stroke-width: inherit !important");
2404
+ }, "appendBusinessActorMarker");
2405
+ async function Rt(e, t, n, r) {
2406
+ let { labelStyles: i, nodeStyles: a } = x(t);
2407
+ t.labelStyle = i;
2408
+ let { shapeSvg: o, bbox: s, label: c } = await P(e, n === "icon" || t.stereotype !== void 0 ? {
2409
+ ...t,
2410
+ icon: n === "icon" ? void 0 : t.icon,
2411
+ stereotype: void 0
2412
+ } : t, L(t, `usecase-actor-variant usecase-actor-${n}`)), l = t.accessibleName ?? t.label;
2413
+ l && o.attr("role", "img").attr("aria-label", l), c.attr("class", "label actor-label usecase-actor-label");
2414
+ let { theme: u, themeVariables: d } = m();
2415
+ w(o, t.colorIndex, u, d.borderColorArray);
2416
+ let f, p;
2417
+ if (t.stereotype) {
2418
+ let e = await F(o, `\xAB${t.stereotype}\xBB`, {
2419
+ labelStyle: i,
2420
+ useHtmlLabels: t.useHtmlLabels,
2421
+ padding: 0,
2422
+ centerLabel: !0,
2423
+ width: t.wrappingWidth
2424
+ });
2425
+ f = e.label.attr("class", "label usecase-stereotype"), p = e.bbox;
2426
+ }
2427
+ let h = o.append("g").attr("class", `usecase-actor-glyph ${kt[n]}`).attr("style", a || null);
2428
+ await r(h, t), Lt(h, t, n);
2429
+ let g = t.padding ?? Ot, _ = p?.height ?? 0, v = Tt + Et + s.height + (p ? _ + Dt : 0), y = Math.max(wt, s.width, p?.width ?? 0) + g * 2, b = v + g * 2, S = -v / 2;
2430
+ h.attr("transform", `translate(0,${S + Tt / 2})`);
2431
+ let C = S + Tt + Et;
2432
+ return f && p && (C += _ / 2, Pt(f, p, C), C += _ / 2 + Dt), Pt(c, s, C + s.height / 2), I(t, o.insert("rect", ":first-child").attr("class", "usecase-actor-outline").attr("x", -y / 2).attr("y", -b / 2).attr("width", y).attr("height", b).attr("opacity", 0).attr("aria-hidden", "true")), t.intersect = (e) => K.rect(t, e), o;
2433
+ }
2434
+ o(Rt, "renderUsecaseActor");
2435
+ var zt = [
2436
+ "M 0 -12",
2437
+ "C 6.627 -12 12 -17.373 12 -24",
2438
+ "C 12 -30.627 6.627 -36 0 -36",
2439
+ "C -6.627 -36 -12 -30.627 -12 -24",
2440
+ "C -12 -17.373 -6.627 -12 0 -12 Z",
2441
+ "M 0 -12 V 8",
2442
+ "M -17 -5 H 17",
2443
+ "M 0 8 L -15 28",
2444
+ "M 0 8 L 15 28"
2445
+ ].join(" ");
2446
+ async function Bt(e, t) {
2447
+ return Rt(e, t, "normal", (e, t) => {
2448
+ Ft(e, t, zt, "usecase-actor-stick");
2449
+ });
2450
+ }
2451
+ o(Bt, "usecaseActor");
2452
+ var Vt = [
2453
+ "M 0 -34",
2454
+ "C 7.18 -34 13 -28.18 13 -21",
2455
+ "C 13 -13.82 7.18 -8 0 -8",
2456
+ "C -7.18 -8 -13 -13.82 -13 -21",
2457
+ "C -13 -28.18 -7.18 -34 0 -34 Z",
2458
+ "M -24 25",
2459
+ "C -24 7 -14 -3 0 -3",
2460
+ "C 14 -3 24 7 24 25",
2461
+ "C 24 28 21 30 18 30",
2462
+ "H -18",
2463
+ "C -21 30 -24 28 -24 25 Z"
2464
+ ].join(" ");
2465
+ async function Ht(e, t) {
2466
+ return Rt(e, t, "awesome", (e, t) => {
2467
+ Ft(e, t, Vt, "usecase-actor-awesome-silhouette");
2468
+ });
2469
+ }
2470
+ o(Ht, "usecaseActorAwesome");
2471
+ var Ut = [
2472
+ "M -22 -10",
2473
+ "H 22",
2474
+ "V 0",
2475
+ "H 6",
2476
+ "L 22 17",
2477
+ "L 13 28",
2478
+ "L 0 13",
2479
+ "L -13 28",
2480
+ "L -22 17",
2481
+ "L -6 0",
2482
+ "H -22",
2483
+ "Z"
2484
+ ].join(" ");
2485
+ async function Wt(e, t) {
2486
+ return Rt(e, t, "hollow", (e, t) => {
2487
+ It(e, t, 0, -23, 9, "usecase-actor-hollow-head", !0), Ft(e, t, Ut, "usecase-actor-hollow-body", !0);
2488
+ });
2489
+ }
2490
+ o(Wt, "usecaseActorHollow");
2491
+ var Gt = 52, Kt = 42, qt = -2, Jt = /* @__PURE__ */ o(async (e, t) => {
2492
+ let n = -Gt / 2, r = qt - Gt / 2;
2493
+ if (t.look === "handDrawn") {
2494
+ let i = T.svg(e).rectangle(n, r, Gt, Gt, b(t, {}));
2495
+ e.insert(() => i, ":first-child").attr("class", "usecase-actor-icon-frame");
2496
+ } else e.append("rect").attr("class", "usecase-actor-icon-frame").attr("x", n).attr("y", r).attr("width", Gt).attr("height", Gt).attr("rx", 4).attr("ry", 4);
2497
+ let i = t.icon ?? "", a = await g(i.includes(":") ? i : `fa:${i}`), o = await _(i, {
2498
+ height: Kt,
2499
+ width: Kt,
2500
+ fallbackPrefix: "fa"
2501
+ }), s = e.append("g").attr("class", `usecase-actor-icon-symbol${a ? "" : " usecase-actor-icon-fallback"}`).attr("aria-hidden", "true").html(`<g>${o}</g>`), c = s.node()?.getBBox();
2502
+ c && s.attr("transform", `translate(${-c.width / 2 - c.x},${qt - c.height / 2 - c.y})`);
2503
+ }, "drawIconActor");
2504
+ async function Yt(e, t) {
2505
+ return Rt(e, t, "icon", Jt);
2506
+ }
2507
+ o(Yt, "usecaseActorIcon");
2508
+ var Xt = /* @__PURE__ */ o((e, t, n) => {
2509
+ let r = (t.x ?? 0) - (t.left ?? 0), i = (t.y ?? 0) - (t.top ?? 0);
2510
+ e.attr("transform", `translate(${-t.width / 2 - r},${n - t.height / 2 - i})`);
2511
+ }, "positionLabel");
2512
+ async function Zt(e, t) {
2513
+ let n = t, { labelStyles: r, nodeStyles: i } = x(t);
2514
+ t.labelStyle = r;
2515
+ let { shapeSvg: a, bbox: o, halfPadding: s, label: c } = await P(e, n.stereotype ? {
2516
+ ...t,
2517
+ stereotype: void 0
2518
+ } : t, L(t, "usecase-business-shape"));
2519
+ c.attr("class", "label usecase-label");
2520
+ let { theme: l, themeVariables: u } = m();
2521
+ w(a, t.colorIndex, l, u.borderColorArray);
2522
+ let d, f;
2523
+ if (n.stereotype) {
2524
+ let e = await F(a, `\xAB${n.stereotype}\xBB`, {
2525
+ labelStyle: r,
2526
+ useHtmlLabels: t.useHtmlLabels,
2527
+ padding: 0,
2528
+ centerLabel: !0,
2529
+ width: t.wrappingWidth
2530
+ });
2531
+ d = e.label.attr("class", "label usecase-stereotype"), f = e.bbox;
2532
+ }
2533
+ let p = f ? 2 : 0, h = o.height + (f?.height ?? 0) + p, g = Math.max(o.width, f?.width ?? 0), _ = s ?? 10, v = g / 2 + _ * 2, y = h / 2 + _ * 2, S = Math.min(Math.max(_ / 5, 1), _ / 2), C = g / 2 + S, E = v - S, D = C / v, O = E / v, k = y * Math.sqrt(Math.max(0, 1 - D * D)), A = -y * Math.sqrt(Math.max(0, 1 - O * O));
2534
+ d && f && Xt(d, f, -h / 2 + f.height / 2), Xt(c, o, h / 2 - o.height / 2);
2535
+ let j;
2536
+ if (t.look === "handDrawn") {
2537
+ let e = T.svg(a).ellipse(0, 0, v * 2, y * 2, b(t, {}));
2538
+ j = a.insert(() => e, ":first-child").attr("class", "basic label-container usecase-business-ellipse");
2539
+ } else j = a.insert("ellipse", ":first-child").attr("class", "basic label-container usecase-business-ellipse").attr("style", i).attr("rx", v).attr("ry", y).attr("cx", 0).attr("cy", 0);
2540
+ a.append("path").attr("class", "usecase-business-marker").attr("d", `M ${C} ${k} L ${E} ${A}`).attr("fill", "none").attr("style", i || null);
2541
+ let M = n.accessibleName ?? n.label;
2542
+ return M && a.attr("role", "img").attr("aria-label", M), I(t, j), t.calcIntersect = (e, t) => K.ellipse(e, e.width / 2, e.height / 2, t), t.intersect = (e) => K.ellipse(t, v, y, e), a;
2543
+ }
2544
+ o(Zt, "usecaseBusiness");
2545
+ var Qt = 8, $t = 4, en = 1, tn = /* @__PURE__ */ o((e, t, n, r) => {
2546
+ let i = (t.x ?? 0) - (t.left ?? 0), a = (t.y ?? 0) - (t.top ?? 0);
2547
+ e.attr("transform", `translate(${n - t.width / 2 - i},${r - t.height / 2 - a})`);
2548
+ }, "positionLabel"), nn = /* @__PURE__ */ o((e) => {
2549
+ let t = Number.parseFloat(e ?? "");
2550
+ return Number.isFinite(t) && t >= 0 ? t : en;
2551
+ }, "numericStrokeWidth");
2552
+ async function rn(e, t) {
2553
+ let n = t, { labelStyles: r, nodeStyles: i } = x(t), { stylesMap: a } = C(t);
2554
+ t.labelStyle = r;
2555
+ let { shapeSvg: s, bbox: c, label: l } = await P(e, t, L(t, "usecase-json-table"));
2556
+ s.attr("role", "img"), n.accessibleName && s.attr("aria-label", n.accessibleName), l.attr("class", "label usecase-json-title");
2557
+ let u = s.append("g").attr("class", "usecase-json-table-grid"), d = [];
2558
+ for (let e of n.jsonRows ?? []) {
2559
+ let n = await F(u, e.key, {
2560
+ labelStyle: r,
2561
+ useHtmlLabels: t.useHtmlLabels,
2562
+ padding: 0,
2563
+ centerLabel: !0
2564
+ }), i = await F(u, e.value, {
2565
+ labelStyle: r,
2566
+ useHtmlLabels: t.useHtmlLabels,
2567
+ padding: 0,
2568
+ centerLabel: !0
2569
+ });
2570
+ d.push({
2571
+ key: {
2572
+ label: n.label.attr("class", "label usecase-json-key"),
2573
+ bbox: n.bbox
2574
+ },
2575
+ value: {
2576
+ label: i.label.attr("class", "label usecase-json-value"),
2577
+ bbox: i.bbox
2578
+ }
2579
+ });
2580
+ }
2581
+ let f = Math.max(0, ...d.map(({ key: e }) => e.bbox.width)) + Qt * 2, p = Math.max(0, ...d.map(({ value: e }) => e.bbox.width)) + Qt * 2, m = c.width + Qt * 2, h = Math.max(m, f + p), g = p + Math.max(0, h - f - p), _ = c.height + $t * 2, v = d.map(({ key: e, value: t }) => Math.max(e.bbox.height, t.bbox.height) + $t * 2), y = _ + v.reduce((e, t) => e + t, 0), S = nn(a.get("stroke-width")), w = h + S * 2, E = y + S * 2, D = -h / 2, O = -y / 2, k = t.look === "handDrawn" ? T.svg(s) : void 0, A = k ? b(t, {}) : void 0, j = /* @__PURE__ */ o((e, t, n, r, a, o) => {
2582
+ if (k && A) {
2583
+ let i = k.rectangle(n, r, a, o, A);
2584
+ return e.insert(() => i, ":first-child").attr("class", t);
2585
+ }
2586
+ return e.insert("rect", ":first-child").attr("class", t).attr("x", n).attr("y", r).attr("width", a).attr("height", o).attr("style", i);
2587
+ }, "insertCell"), M = j(s, "label-container usecase-json-border", -w / 2, -E / 2, w, E);
2588
+ j(u, "usecase-json-cell usecase-json-title-cell", D, O, h, _), u.node()?.append(l.node()), tn(l, c, 0, O + _ / 2);
2589
+ let N = O + _;
2590
+ return d.forEach(({ key: e, value: t }, n) => {
2591
+ let r = v[n], i = u.append("g").attr("class", "usecase-json-row").attr("data-row-index", n).attr("transform", `translate(0,${N})`);
2592
+ j(i, "usecase-json-cell usecase-json-key-cell", D, 0, f, r), j(i, "usecase-json-cell usecase-json-value-cell", D + f, 0, g, r), i.node()?.append(e.label.node(), t.label.node()), tn(e.label, e.bbox, D + f / 2, r / 2), tn(t.label, t.bbox, D + f + g / 2, r / 2), N += r;
2593
+ }), I(t, M), t.intersect = (e) => K.rect(t, e), s;
2594
+ }
2595
+ o(rn, "usecaseJsonTable");
2596
+ async function an(e, t) {
2597
+ let { labelStyles: n, nodeStyles: r } = x(t);
2598
+ t.labelStyle = n;
2599
+ let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i, s = t.look === "neo" ? 10 : 5;
2600
+ (t.width || t.height) && (t.width = Math.max((t?.width ?? 0) - a * 2 - 2 * s, 10), t.height = Math.max((t?.height ?? 0) - o * 2 - 2 * s, 10));
2601
+ let { shapeSvg: c, bbox: l, label: u } = await P(e, t, L(t)), d = (t?.width ? t?.width : l.width) + a * 2 + 2 * s, f = (t?.height ? t?.height : l.height) + o * 2 + 2 * s, p = d - 2 * s, m = f - 2 * s, h = -p / 2, g = -m / 2, { cssStyles: _ } = t, v = T.svg(c), y = b(t, {}), S = [
2602
+ {
2603
+ x: h - s,
2604
+ y: g + s
2605
+ },
2606
+ {
2607
+ x: h - s,
2608
+ y: g + m + s
2609
+ },
2610
+ {
2611
+ x: h + p - s,
2612
+ y: g + m + s
2613
+ },
2614
+ {
2615
+ x: h + p - s,
2616
+ y: g + m
2617
+ },
2618
+ {
2619
+ x: h + p,
2620
+ y: g + m
2621
+ },
2622
+ {
2623
+ x: h + p,
2624
+ y: g + m - s
2625
+ },
2626
+ {
2627
+ x: h + p + s,
2628
+ y: g + m - s
2629
+ },
2630
+ {
2631
+ x: h + p + s,
2632
+ y: g - s
2633
+ },
2634
+ {
2635
+ x: h + s,
2636
+ y: g - s
2637
+ },
2638
+ {
2639
+ x: h + s,
2640
+ y: g
2641
+ },
2642
+ {
2643
+ x: h,
2644
+ y: g
2645
+ },
2646
+ {
2647
+ x: h,
2648
+ y: g + s
2649
+ }
2650
+ ], C = [
2651
+ {
2652
+ x: h,
2653
+ y: g + s
2654
+ },
2655
+ {
2656
+ x: h + p - s,
2657
+ y: g + s
2658
+ },
2659
+ {
2660
+ x: h + p - s,
2661
+ y: g + m
2662
+ },
2663
+ {
2664
+ x: h + p,
2665
+ y: g + m
2666
+ },
2667
+ {
2668
+ x: h + p,
2669
+ y: g
2670
+ },
2671
+ {
2672
+ x: h,
2673
+ y: g
2674
+ }
2675
+ ];
2676
+ t.look !== "handDrawn" && (y.roughness = 0, y.fillStyle = "solid");
2677
+ let w = R(S), E = v.path(w, y), D = R(C), O = v.path(D, y);
2678
+ t.look !== "handDrawn" && (E = ee(E), O = ee(O));
2679
+ let k = c.insert("g", ":first-child");
2680
+ return k.insert(() => E), k.insert(() => O), k.attr("class", "basic label-container outer-path"), _ && t.look !== "handDrawn" && k.selectAll("path").attr("style", _), r && t.look !== "handDrawn" && k.selectAll("path").attr("style", r), u.attr("transform", `translate(${-(l.width / 2) - s - (l.x - (l.left ?? 0))}, ${-(l.height / 2) + s - (l.y - (l.top ?? 0))})`), I(t, k), t.intersect = function(e) {
2681
+ return K.polygon(t, S, e);
2682
+ }, c;
2683
+ }
2684
+ o(an, "multiRect");
2685
+ async function on(e, t) {
2686
+ let { labelStyles: n, nodeStyles: r } = x(t);
2687
+ t.labelStyle = n;
2688
+ let { shapeSvg: i, bbox: a, label: o } = await P(e, t, L(t)), s = t.padding ?? 0, c = t.look === "neo" ? 16 : s, l = t.look === "neo" ? 12 : s, u = !0;
2689
+ (t.width || t.height) && (u = !1, t.width = (t?.width ?? 0) - c * 2, t.height = (t?.height ?? 0) - l * 3);
2690
+ let d = Math.max(a.width, t?.width ?? 0) + c * 2, f = Math.max(a.height, t?.height ?? 0) + l * 3, p = t.look === "neo" ? f / 4 : f / 8, m = f + (u ? p / 2 : -p / 2), h = -d / 2, g = -m / 2, { cssStyles: _ } = t, v = z(h - 10, g + m + 10, h + d - 10, g + m + 10, p, .8), y = v?.[v.length - 1], S = [
2691
+ {
2692
+ x: h - 10,
2693
+ y: g + 10
2694
+ },
2695
+ {
2696
+ x: h - 10,
2697
+ y: g + m + 10
2698
+ },
2699
+ ...v,
2700
+ {
2701
+ x: h + d - 10,
2702
+ y: y.y - 10
2703
+ },
2704
+ {
2705
+ x: h + d,
2706
+ y: y.y - 10
2707
+ },
2708
+ {
2709
+ x: h + d,
2710
+ y: y.y - 20
2711
+ },
2712
+ {
2713
+ x: h + d + 10,
2714
+ y: y.y - 20
2715
+ },
2716
+ {
2717
+ x: h + d + 10,
2718
+ y: g - 10
2719
+ },
2720
+ {
2721
+ x: h + 10,
2722
+ y: g - 10
2723
+ },
2724
+ {
2725
+ x: h + 10,
2726
+ y: g
2727
+ },
2728
+ {
2729
+ x: h,
2730
+ y: g
2731
+ },
2732
+ {
2733
+ x: h,
2734
+ y: g + 10
2735
+ }
2736
+ ], C = [
2737
+ {
2738
+ x: h,
2739
+ y: g + 10
2740
+ },
2741
+ {
2742
+ x: h + d - 10,
2743
+ y: g + 10
2744
+ },
2745
+ {
2746
+ x: h + d - 10,
2747
+ y: y.y - 10
2748
+ },
2749
+ {
2750
+ x: h + d,
2751
+ y: y.y - 10
2752
+ },
2753
+ {
2754
+ x: h + d,
2755
+ y: g
2756
+ },
2757
+ {
2758
+ x: h,
2759
+ y: g
2760
+ }
2761
+ ], w = T.svg(i), E = b(t, {});
2762
+ t.look !== "handDrawn" && (E.roughness = 0, E.fillStyle = "solid");
2763
+ let D = R(S), O = w.path(D, E), k = R(C), A = w.path(k, E), j = i.insert(() => O, ":first-child");
2764
+ return j.insert(() => A), j.attr("class", "basic label-container outer-path"), _ && t.look !== "handDrawn" && j.selectAll("path").attr("style", _), r && t.look !== "handDrawn" && j.selectAll("path").attr("style", r), j.attr("transform", `translate(0,${-p / 2})`), o.attr("transform", `translate(${-(a.width / 2) - 10 - (a.x - (a.left ?? 0))}, ${-(a.height / 2) + 10 - p - (a.y - (a.top ?? 0))})`), I(t, j), t.intersect = function(e) {
2765
+ return K.polygon(t, S, e);
2766
+ }, i;
2767
+ }
2768
+ o(on, "multiWaveEdgedRectangle");
2769
+ async function sn(e, t, { config: { themeVariables: n } }) {
2770
+ let { labelStyles: r, nodeStyles: i } = x(t);
2771
+ t.labelStyle = r, t.useHtmlLabels || u(d()) || (t.centerLabel = !0);
2772
+ let { shapeSvg: a, bbox: o, label: s } = await P(e, t, L(t)), c = Math.max(o.width + (t.padding ?? 0) * 2, t?.width ?? 0), l = Math.max(o.height + (t.padding ?? 0) * 2, t?.height ?? 0), f = -c / 2, p = -l / 2, { cssStyles: m } = t, h = T.svg(a), g = b(t, {
2773
+ fill: n.noteBkgColor,
2774
+ stroke: n.noteBorderColor
2775
+ });
2776
+ t.look !== "handDrawn" && (g.roughness = 0, g.fillStyle = "solid");
2777
+ let _ = h.rectangle(f, p, c, l, g), v = a.insert(() => _, ":first-child");
2778
+ return v.attr("class", "basic label-container outer-path"), s.attr("class", "label noteLabel"), m && t.look !== "handDrawn" && v.selectAll("path").attr("style", m), i && t.look !== "handDrawn" && v.selectAll("path").attr("style", i), s.attr("transform", `translate(${-o.width / 2 - (o.x - (o.left ?? 0))}, ${-(o.height / 2) - (o.y - (o.top ?? 0))})`), I(t, v), t.intersect = function(e) {
2779
+ return K.rect(t, e);
2780
+ }, a;
2781
+ }
2782
+ o(sn, "note");
2783
+ var cn = /* @__PURE__ */ o((e, t, n) => [
2784
+ `M${e + n / 2},${t}`,
2785
+ `L${e + n},${t - n / 2}`,
2786
+ `L${e + n / 2},${t - n}`,
2787
+ `L${e},${t - n / 2}`,
2788
+ "Z"
2789
+ ].join(" "), "createDecisionBoxPathD");
2790
+ async function ln(e, t) {
2791
+ let { labelStyles: n, nodeStyles: r } = x(t);
2792
+ t.labelStyle = n;
2793
+ let { shapeSvg: i, bbox: a } = await P(e, t, L(t)), o = a.width + (t.padding ?? 0) + (a.height + (t.padding ?? 0)), s = .5, c = [
2794
+ {
2795
+ x: o / 2,
2796
+ y: 0
2797
+ },
2798
+ {
2799
+ x: o,
2800
+ y: -o / 2
2801
+ },
2802
+ {
2803
+ x: o / 2,
2804
+ y: -o
2805
+ },
2806
+ {
2807
+ x: 0,
2808
+ y: -o / 2
2809
+ }
2810
+ ], l, { cssStyles: u } = t;
2811
+ if (t.look === "handDrawn") {
2812
+ let e = T.svg(i), n = b(t, {}), r = cn(0, 0, o), a = e.path(r, n);
2813
+ l = i.insert(() => a, ":first-child").attr("transform", `translate(${-o / 2 + s}, ${o / 2})`), u && l.attr("style", u);
2814
+ } else l = J(i, o, o, c), l.attr("transform", `translate(${-o / 2 + s}, ${o / 2})`);
2815
+ return r && l.attr("style", r), I(t, l), t.calcIntersect = function(e, t) {
2816
+ let n = e.width, r = [
2817
+ {
2818
+ x: n / 2,
2819
+ y: 0
2820
+ },
2821
+ {
2822
+ x: n,
2823
+ y: -n / 2
2824
+ },
2825
+ {
2826
+ x: n / 2,
2827
+ y: -n
2828
+ },
2829
+ {
2830
+ x: 0,
2831
+ y: -n / 2
2832
+ }
2833
+ ];
2834
+ return K.polygon(e, r, t);
2835
+ }, t.intersect = function(e) {
2836
+ return this.calcIntersect(t, e);
2837
+ }, i;
2838
+ }
2839
+ o(ln, "question");
2840
+ async function un(e, t) {
2841
+ let { labelStyles: n, nodeStyles: r } = x(t);
2842
+ t.labelStyle = n;
2843
+ let i = t.padding ?? 0, a = t.look === "neo" ? 21 : i ?? 0, o = t.look === "neo" ? 12 : i ?? 0, { shapeSvg: s, bbox: c, label: l } = await P(e, t, L(t)), u = c.width + (t.look === "neo" ? a * 2 : a), d = Math.max(c.height + (t.look === "neo" ? o * 2 : o), t.height ?? 0), f = d / 4, p = -Math.max(u, (t.width ?? 0) - f) / 2, m = -d / 2, h = m / 2, g = [
2844
+ {
2845
+ x: p + h,
2846
+ y: m
2847
+ },
2848
+ {
2849
+ x: p,
2850
+ y: 0
2851
+ },
2852
+ {
2853
+ x: p + h,
2854
+ y: -m
2855
+ },
2856
+ {
2857
+ x: -p,
2858
+ y: -m
2859
+ },
2860
+ {
2861
+ x: -p,
2862
+ y: m
2863
+ }
2864
+ ], { cssStyles: _ } = t, v = T.svg(s), y = b(t, {});
2865
+ t.look !== "handDrawn" && (y.roughness = 0, y.fillStyle = "solid");
2866
+ let S = R(g), C = v.path(S, y), w = s.insert(() => C, ":first-child");
2867
+ return w.attr("class", "basic label-container outer-path"), _ && t.look !== "handDrawn" && w.selectAll("path").attr("style", _), r && t.look !== "handDrawn" && w.selectAll("path").attr("style", r), w.attr("transform", `translate(${-h / 2},0)`), l.attr("transform", `translate(${-h / 2 - c.width / 2 - (c.x - (c.left ?? 0))}, ${-(c.height / 2) - (c.y - (c.top ?? 0))})`), I(t, w), t.intersect = function(e) {
2868
+ return K.polygon(t, g, e);
2869
+ }, s;
2870
+ }
2871
+ o(un, "rect_left_inv_arrow");
2872
+ async function dn(n, r) {
2873
+ let { labelStyles: i, nodeStyles: a } = x(r);
2874
+ r.labelStyle = i;
2875
+ let o;
2876
+ o = r.cssClasses ? "node " + r.cssClasses : "node default";
2877
+ let s = n.insert("g").attr("class", o).attr("id", r.domId || r.id), c = s.insert("g"), l = s.insert("g").attr("class", "label").attr("style", a), d = r.description, f = r.label, p = await se(l, f, r.labelStyle, !0, !0), h = {
2878
+ width: 0,
2879
+ height: 0
2880
+ };
2881
+ if (u(m())) {
2882
+ let e = p.children[0], n = t(p);
2883
+ h = e.getBoundingClientRect(), n.attr("width", h.width), n.attr("height", h.height);
2884
+ }
2885
+ e.info("Text 2", d);
2886
+ let g = d || [], _ = p.getBBox(), v = await se(l, Array.isArray(g) ? g.join("<br/>") : g, r.labelStyle, !0, !0), y = v.children[0], S = t(v);
2887
+ h = y.getBoundingClientRect(), S.attr("width", h.width), S.attr("height", h.height);
2888
+ let C = (r.padding || 0) / 2;
2889
+ t(v).attr("transform", "translate( " + (h.width > _.width ? 0 : (_.width - h.width) / 2) + ", " + (_.height + C + 5) + ")"), t(p).attr("transform", "translate( " + (h.width < _.width ? 0 : -(_.width - h.width) / 2) + ", 0)"), h = l.node().getBBox(), l.attr("transform", "translate(" + -h.width / 2 + ", " + (-h.height / 2 - C + 3) + ")");
2890
+ let w = h.width + (r.padding || 0), E = h.height + (r.padding || 0), D = -h.width / 2 - C, O = -h.height / 2 - C, k, A;
2891
+ if (r.look === "handDrawn") {
2892
+ let t = T.svg(s), n = b(r, {}), i = t.path(q(D, O, w, E, r.rx || 0), n), a = t.line(-h.width / 2 - C, -h.height / 2 - C + _.height + C, h.width / 2 + C, -h.height / 2 - C + _.height + C, n);
2893
+ A = s.insert(() => (e.debug("Rough node insert CXC", i), a), ":first-child"), k = s.insert(() => (e.debug("Rough node insert CXC", i), i), ":first-child");
2894
+ } else k = c.insert("rect", ":first-child"), A = c.insert("line"), k.attr("class", "outer title-state").attr("style", a).attr("x", -h.width / 2 - C).attr("y", -h.height / 2 - C).attr("width", h.width + (r.padding || 0)).attr("height", h.height + (r.padding || 0)), A.attr("class", "divider").attr("x1", -h.width / 2 - C).attr("x2", h.width / 2 + C).attr("y1", -h.height / 2 - C + _.height + C).attr("y2", -h.height / 2 - C + _.height + C);
2895
+ return I(r, k), r.intersect = function(e) {
2896
+ return K.rect(r, e);
2897
+ }, s;
2898
+ }
2899
+ o(dn, "rectWithTitle");
2900
+ async function fn(e, t, { config: { themeVariables: n } }) {
2901
+ let r = n?.radius ?? 5;
2902
+ return Ke(e, t, {
2903
+ rx: r,
2904
+ ry: r,
2905
+ classes: "",
2906
+ labelPaddingX: (t?.padding ?? 0) * 1,
2907
+ labelPaddingY: (t?.padding ?? 0) * 1
2908
+ });
2909
+ }
2910
+ o(fn, "roundedRect");
2911
+ var pn = 8;
2912
+ async function mn(e, t) {
2913
+ let { labelStyles: n, nodeStyles: r } = x(t);
2914
+ t.labelStyle = n;
2915
+ let i = t.look === "neo" ? 16 : t.padding ?? 0, o = t.look === "neo" ? 12 : t.padding ?? 0, { shapeSvg: s, bbox: c, label: l } = await P(e, t, L(t)), u = (t?.width ?? c.width) + i * 2 + (t.look === "neo" ? pn : pn * 2), d = (t?.height ?? c.height) + o * 2, f = u - pn, p = d, m = pn - u / 2, h = -d / 2, { cssStyles: g } = t, _ = T.svg(s), v = b(t, {});
2916
+ t.look !== "handDrawn" && (v.roughness = 0, v.fillStyle = "solid");
2917
+ let y = [
2918
+ {
2919
+ x: m,
2920
+ y: h
2921
+ },
2922
+ {
2923
+ x: m + f,
2924
+ y: h
2925
+ },
2926
+ {
2927
+ x: m + f,
2928
+ y: h + p
2929
+ },
2930
+ {
2931
+ x: m - pn,
2932
+ y: h + p
2933
+ },
2934
+ {
2935
+ x: m - pn,
2936
+ y: h
2937
+ },
2938
+ {
2939
+ x: m,
2940
+ y: h
2941
+ },
2942
+ {
2943
+ x: m,
2944
+ y: h + p
2945
+ }
2946
+ ], S = _.polygon(y.map((e) => [e.x, e.y]), v), C = s.insert(() => S, ":first-child");
2947
+ return C.attr("class", "basic label-container outer-path").attr("style", a(g)), r && t.look !== "handDrawn" && C.selectAll("path").attr("style", r), g && t.look !== "handDrawn" && C.selectAll("path").attr("style", r), l.attr("transform", `translate(${pn / 2 - c.width / 2 - (c.x - (c.left ?? 0))}, ${-(c.height / 2) - (c.y - (c.top ?? 0))})`), I(t, C), t.intersect = function(e) {
2948
+ return K.rect(t, e);
2949
+ }, s;
2950
+ }
2951
+ o(mn, "shadedProcess");
2952
+ async function hn(e, t) {
2953
+ let { labelStyles: n, nodeStyles: r } = x(t);
2954
+ t.labelStyle = n;
2955
+ let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i;
2956
+ (t.width || t.height) && (t.width = Math.max((t?.width ?? 0) - a * 2, 10), t.height = Math.max((t?.height ?? 0) / 1.5 - o * 2, 10));
2957
+ let { shapeSvg: s, bbox: c, label: l } = await P(e, t, L(t)), u = (t?.width ? t?.width : c.width) + a * 2, d = ((t?.height ? t?.height : c.height) + o * 2) * 1.5, f = u, p = d / 1.5, m = -f / 2, h = -p / 2, { cssStyles: g } = t, _ = T.svg(s), v = b(t, {});
2958
+ t.look !== "handDrawn" && (v.roughness = 0, v.fillStyle = "solid");
2959
+ let y = [
2960
+ {
2961
+ x: m,
2962
+ y: h
2963
+ },
2964
+ {
2965
+ x: m,
2966
+ y: h + p
2967
+ },
2968
+ {
2969
+ x: m + f,
2970
+ y: h + p
2971
+ },
2972
+ {
2973
+ x: m + f,
2974
+ y: h - p / 2
2975
+ }
2976
+ ], S = R(y), C = _.path(S, v), w = s.insert(() => C, ":first-child");
2977
+ return w.attr("class", "basic label-container outer-path"), g && t.look !== "handDrawn" && w.selectChildren("path").attr("style", g), r && t.look !== "handDrawn" && w.selectChildren("path").attr("style", r), w.attr("transform", `translate(0, ${p / 4})`), l.attr("transform", `translate(${-f / 2 + (t.padding ?? 0) - (c.x - (c.left ?? 0))}, ${-p / 4 + (t.padding ?? 0) - (c.y - (c.top ?? 0))})`), I(t, w), t.intersect = function(e) {
2978
+ return K.polygon(t, y, e);
2979
+ }, s;
2980
+ }
2981
+ o(hn, "slopedRect");
2982
+ async function gn(e, t) {
2983
+ let n = t.padding ?? 0, r = t.look === "neo" ? 16 : n * 2, i = t.look === "neo" ? 12 : n, a = await Ke(e, t, {
2984
+ rx: 0,
2985
+ ry: 0,
2986
+ classes: "",
2987
+ labelPaddingX: t.labelPaddingX ?? r,
2988
+ labelPaddingY: i
2989
+ });
2990
+ if (t.colorIndex !== void 0) {
2991
+ let { theme: e, themeVariables: n } = m();
2992
+ w(a, t.colorIndex, e, n.borderColorArray);
2993
+ }
2994
+ return a;
2995
+ }
2996
+ o(gn, "squareRect");
2997
+ var _n = 50, vn = /* @__PURE__ */ o((e, t, n) => {
2998
+ let r = e.height + n, i = r * Math.cos(Math.PI / (2 * (_n - 1))), a = Math.sqrt(Math.max(0, i ** 2 - e.height ** 2));
2999
+ return {
3000
+ w: Math.max(e.width + r / 4 + t, 1.5 * r + (r - i), e.width + t + r - a),
3001
+ h: r
3002
+ };
3003
+ }, "stadiumDimensions");
3004
+ async function yn(e, t) {
3005
+ let { labelStyles: n, nodeStyles: r } = x(t);
3006
+ t.labelStyle = n;
3007
+ let i = t.padding ?? 0, a = t.look === "neo" ? 40 : i, o = t.look === "neo" ? 24 : i, { shapeSvg: s, bbox: c } = await P(e, t, L(t)), { w: l, h: u } = vn(c, a, o), d = u / 2, { cssStyles: f } = t, p = T.svg(s), m = b(t, {});
3008
+ t.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
3009
+ let h = [
3010
+ {
3011
+ x: -l / 2 + d,
3012
+ y: -u / 2
3013
+ },
3014
+ {
3015
+ x: l / 2 - d,
3016
+ y: -u / 2
3017
+ },
3018
+ ...B(-l / 2 + d, 0, d, _n, 90, 270),
3019
+ {
3020
+ x: l / 2 - d,
3021
+ y: u / 2
3022
+ },
3023
+ ...B(l / 2 - d, 0, d, _n, 270, 450)
3024
+ ], g = R(h), _ = p.path(g, m), v = s.insert(() => _, ":first-child");
3025
+ return v.attr("class", "basic label-container outer-path"), f && t.look !== "handDrawn" && v.selectChildren("path").attr("style", f), r && t.look !== "handDrawn" && v.selectChildren("path").attr("style", r), I(t, v), t.intersect = function(e) {
3026
+ return K.polygon(t, h, e);
3027
+ }, s;
3028
+ }
3029
+ o(yn, "stadium");
3030
+ async function bn(e, t) {
3031
+ return Ke(e, t, {
3032
+ rx: t.look === "neo" ? 3 : 5,
3033
+ ry: t.look === "neo" ? 3 : 5,
3034
+ classes: "flowchart-node"
3035
+ });
3036
+ }
3037
+ o(bn, "state");
3038
+ function xn(e, t, { config: { themeVariables: n } }) {
3039
+ let { labelStyles: r, nodeStyles: i } = x(t);
3040
+ t.labelStyle = r;
3041
+ let { cssStyles: a } = t, { lineColor: o, stateBorder: s, nodeBorder: c, nodeShadow: l } = n;
3042
+ (t.width || t.height) && ((t.width ?? 0) < 14 && (t.width = 14), (t.height ?? 0) < 14 && (t.height = 14)), t.width ||= 14, t.height ||= 14;
3043
+ let u = e.insert("g").attr("class", "node default").attr("id", t.domId ?? t.id), d = T.svg(u), f = b(t, {});
3044
+ t.look !== "handDrawn" && (f.roughness = 0, f.fillStyle = "solid");
3045
+ let p = d.circle(0, 0, t.width, {
3046
+ ...f,
3047
+ stroke: o,
3048
+ strokeWidth: 2
3049
+ }), m = s ?? c, h = (t.width ?? 0) * 5 / 14, g = d.circle(0, 0, h, {
3050
+ ...f,
3051
+ fill: m,
3052
+ stroke: m,
3053
+ strokeWidth: 2,
3054
+ fillStyle: "solid"
3055
+ }), _ = u.insert(() => p, ":first-child");
3056
+ if (_.insert(() => g), t.look !== "handDrawn" && _.attr("class", "outer-path"), a && _.selectAll("path").attr("style", a), i && _.selectAll("path").attr("style", i), t.width < 25 && l && t.look !== "handDrawn") {
3057
+ let t = e.node()?.ownerSVGElement?.id ?? "", n = t ? `${t}-drop-shadow-small` : "drop-shadow-small";
3058
+ _.attr("style", `filter:url(#${n})`);
3059
+ }
3060
+ return I(t, _), t.intersect = function(e) {
3061
+ return K.circle(t, (t.width ?? 0) / 2, e);
3062
+ }, u;
3063
+ }
3064
+ o(xn, "stateEnd");
3065
+ function Sn(e, t, { config: { themeVariables: n } }) {
3066
+ let { lineColor: r, nodeShadow: i } = n;
3067
+ (t.width || t.height) && ((t.width ?? 0) < 14 && (t.width = 14), (t.height ?? 0) < 14 && (t.height = 14)), t.width ||= 14, t.height ||= 14;
3068
+ let a = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), o;
3069
+ if (t.look === "handDrawn") {
3070
+ let e = T.svg(a).circle(0, 0, t.width, S(r));
3071
+ o = a.insert(() => e), o.attr("class", "state-start").attr("r", (t.width ?? 7) / 2).attr("width", t.width ?? 14).attr("height", t.height ?? 14);
3072
+ } else o = a.insert("circle", ":first-child"), o.attr("class", "state-start").attr("r", (t.width ?? 7) / 2).attr("width", t.width ?? 14).attr("height", t.height ?? 14);
3073
+ if (t.width < 25 && i && t.look !== "handDrawn") {
3074
+ let t = e.node()?.ownerSVGElement?.id ?? "", n = t ? `${t}-drop-shadow-small` : "drop-shadow-small";
3075
+ o.attr("style", `filter:url(#${n})`);
3076
+ }
3077
+ return I(t, o), t.intersect = function(e) {
3078
+ return K.circle(t, (t.width ?? 7) / 2, e);
3079
+ }, a;
3080
+ }
3081
+ o(Sn, "stateStart");
3082
+ var Cn = 8;
3083
+ async function wn(e, t) {
3084
+ let { labelStyles: n, nodeStyles: r } = x(t);
3085
+ t.labelStyle = n;
3086
+ let i = t?.padding ?? 8, o = t.look === "neo" ? 28 : i, s = t.look === "neo" ? 12 : i, { shapeSvg: c, bbox: l } = await P(e, t, L(t)), u = Math.max(l.width + 2 * Cn + o, t.width ?? 0), d = Math.max(l.height + s, t.height ?? 0), f = u - 2 * Cn, p = d, m = -u / 2, h = -d / 2, g = [
3087
+ {
3088
+ x: 0,
3089
+ y: 0
3090
+ },
3091
+ {
3092
+ x: f,
3093
+ y: 0
3094
+ },
3095
+ {
3096
+ x: f,
3097
+ y: -p
3098
+ },
3099
+ {
3100
+ x: 0,
3101
+ y: -p
3102
+ },
3103
+ {
3104
+ x: 0,
3105
+ y: 0
3106
+ },
3107
+ {
3108
+ x: -8,
3109
+ y: 0
3110
+ },
3111
+ {
3112
+ x: f + 8,
3113
+ y: 0
3114
+ },
3115
+ {
3116
+ x: f + 8,
3117
+ y: -p
3118
+ },
3119
+ {
3120
+ x: -8,
3121
+ y: -p
3122
+ },
3123
+ {
3124
+ x: -8,
3125
+ y: 0
3126
+ }
3127
+ ];
3128
+ if (t.look === "handDrawn") {
3129
+ let e = T.svg(c), n = b(t, {}), r = e.rectangle(m, h, f + 16, p, n), i = e.line(m + Cn, h, m + Cn, h + p, n), o = e.line(m + Cn + f, h, m + Cn + f, h + p, n);
3130
+ c.insert(() => i, ":first-child"), c.insert(() => o, ":first-child");
3131
+ let s = c.insert(() => r, ":first-child"), { cssStyles: l } = t;
3132
+ s.attr("class", "basic label-container").attr("style", a(l)), I(t, s);
3133
+ } else {
3134
+ let e = J(c, f, p, g);
3135
+ r && e.attr("style", r), I(t, e);
3136
+ }
3137
+ return t.intersect = function(e) {
3138
+ return K.polygon(t, g, e);
3139
+ }, c;
3140
+ }
3141
+ o(wn, "subroutine");
3142
+ var Tn = .2;
3143
+ async function En(e, t) {
3144
+ let { labelStyles: n, nodeStyles: r } = x(t);
3145
+ t.labelStyle = n;
3146
+ let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i;
3147
+ (t.width || t.height) && (t.height = Math.max((t?.height ?? 0) - o * 2, 10), t.width = Math.max((t?.width ?? 0) - a * 2 - Tn * (t.height + o * 2), 10));
3148
+ let { shapeSvg: s, bbox: c } = await P(e, t, L(t)), l = (t?.height ? t?.height : c.height) + o * 2, u = Tn * l, d = Tn * l, f = (t?.width ? t?.width : c.width) + a * 2 + u - u, p = l, m = -f / 2, h = -p / 2, { cssStyles: g } = t, _ = T.svg(s), v = b(t, {}), y = [
3149
+ {
3150
+ x: m - u / 2,
3151
+ y: h
3152
+ },
3153
+ {
3154
+ x: m + f + u / 2,
3155
+ y: h
3156
+ },
3157
+ {
3158
+ x: m + f + u / 2,
3159
+ y: h + p
3160
+ },
3161
+ {
3162
+ x: m - u / 2,
3163
+ y: h + p
3164
+ }
3165
+ ], S = [
3166
+ {
3167
+ x: m + f - u / 2,
3168
+ y: h + p
3169
+ },
3170
+ {
3171
+ x: m + f + u / 2,
3172
+ y: h + p
3173
+ },
3174
+ {
3175
+ x: m + f + u / 2,
3176
+ y: h + p - d
3177
+ }
3178
+ ];
3179
+ t.look !== "handDrawn" && (v.roughness = 0, v.fillStyle = "solid");
3180
+ let C = R(y), w = _.path(C, v), E = R(S), D = _.path(E, {
3181
+ ...v,
3182
+ fillStyle: "solid"
3183
+ }), O = s.insert(() => D, ":first-child");
3184
+ return O.insert(() => w, ":first-child"), O.attr("class", "basic label-container outer-path"), g && t.look !== "handDrawn" && O.selectAll("path").attr("style", g), r && t.look !== "handDrawn" && O.selectAll("path").attr("style", r), I(t, O), t.intersect = function(e) {
3185
+ return K.polygon(t, y, e);
3186
+ }, s;
3187
+ }
3188
+ o(En, "taggedRect");
3189
+ async function Dn(e, t) {
3190
+ let { labelStyles: n, nodeStyles: r } = x(t);
3191
+ t.labelStyle = n;
3192
+ let { shapeSvg: i, bbox: a, label: o } = await P(e, t, L(t)), s = Math.max(a.width + (t.padding ?? 0) * 2, t?.width ?? 0), c = Math.max(a.height + (t.padding ?? 0) * 2, t?.height ?? 0), l = c / 8, u = .2 * s, d = .2 * c, f = c + l, { cssStyles: p } = t, m = T.svg(i), h = b(t, {});
3193
+ t.look !== "handDrawn" && (h.roughness = 0, h.fillStyle = "solid");
3194
+ let g = [
3195
+ {
3196
+ x: -s / 2 - s / 2 * .1,
3197
+ y: f / 2
3198
+ },
3199
+ ...z(-s / 2 - s / 2 * .1, f / 2, s / 2 + s / 2 * .1, f / 2, l, .8),
3200
+ {
3201
+ x: s / 2 + s / 2 * .1,
3202
+ y: -f / 2
3203
+ },
3204
+ {
3205
+ x: -s / 2 - s / 2 * .1,
3206
+ y: -f / 2
3207
+ }
3208
+ ], _ = -s / 2 + s / 2 * .1, v = -f / 2 - d * .4, y = [
3209
+ {
3210
+ x: _ + s - u,
3211
+ y: (v + c) * 1.3
3212
+ },
3213
+ {
3214
+ x: _ + s,
3215
+ y: v + c - d
3216
+ },
3217
+ {
3218
+ x: _ + s,
3219
+ y: (v + c) * .9
3220
+ },
3221
+ ...z(_ + s, (v + c) * 1.25, _ + s - u, (v + c) * 1.3, -c * .02, .5)
3222
+ ], S = R(g), C = m.path(S, h), w = R(y), E = m.path(w, {
3223
+ ...h,
3224
+ fillStyle: "solid"
3225
+ }), D = i.insert(() => E, ":first-child");
3226
+ return D.insert(() => C, ":first-child"), D.attr("class", "basic label-container outer-path"), p && t.look !== "handDrawn" && D.selectAll("path").attr("style", p), r && t.look !== "handDrawn" && D.selectAll("path").attr("style", r), D.attr("transform", `translate(0,${-l / 2})`), o.attr("transform", `translate(${-s / 2 + (t.padding ?? 0) - (a.x - (a.left ?? 0))},${-c / 2 + (t.padding ?? 0) - l / 2 - (a.y - (a.top ?? 0))})`), I(t, D), t.intersect = function(e) {
3227
+ return K.polygon(t, g, e);
3228
+ }, i;
3229
+ }
3230
+ o(Dn, "taggedWaveEdgedRectangle");
3231
+ async function On(e, t) {
3232
+ let { labelStyles: n, nodeStyles: r } = x(t);
3233
+ t.labelStyle = n;
3234
+ let { shapeSvg: i, bbox: a } = await P(e, t, L(t)), o = Math.max(a.width + (t.padding ?? 0), t?.width || 0), s = Math.max(a.height + (t.padding ?? 0), t?.height || 0), c = -o / 2, l = -s / 2, u = i.insert("rect", ":first-child");
3235
+ return u.attr("class", "text").attr("style", r).attr("rx", 0).attr("ry", 0).attr("x", c).attr("y", l).attr("width", o).attr("height", s), I(t, u), t.intersect = function(e) {
3236
+ return K.rect(t, e);
3237
+ }, i;
3238
+ }
3239
+ o(On, "text");
3240
+ var kn = /* @__PURE__ */ o((e, t, n, r, i, a) => `M${e},${t}
3241
+ a${i},${a} 0,0,1 0,${-r}
3242
+ l${n},0
3243
+ a${i},${a} 0,0,1 0,${r}
3244
+ M${n},${-r}
3245
+ a${i},${a} 0,0,0 0,${r}
3246
+ l${-n},0`, "createCylinderPathD"), An = /* @__PURE__ */ o((e, t, n, r, i, a) => [
3247
+ `M${e},${t}`,
3248
+ `M${e + n},${t}`,
3249
+ `a${i},${a} 0,0,0 0,${-r}`,
3250
+ `l${-n},0`,
3251
+ `a${i},${a} 0,0,0 0,${r}`,
3252
+ `l${n},0`
3253
+ ].join(" "), "createOuterCylinderPathD"), jn = /* @__PURE__ */ o((e, t, n, r, i, a) => [`M${e + n / 2},${-r / 2}`, `a${i},${a} 0,0,0 0,${r}`].join(" "), "createInnerCylinderPathD"), Mn = 5, Nn = 10;
3254
+ async function Pn(e, t) {
3255
+ let { labelStyles: n, nodeStyles: r } = x(t);
3256
+ t.labelStyle = n;
3257
+ let i = t.padding ?? 0, o = t.look === "neo" ? 12 : i / 2, s = t.height ?? 0;
3258
+ if (t.height && (t.height -= o, t.height < Mn && (t.height = Mn)), t.width) {
3259
+ let e = s / 2 / (2.5 + s / 50);
3260
+ t.width = t.width - o - e * 3, t.width < Nn && (t.width = Nn);
3261
+ }
3262
+ let { shapeSvg: c, bbox: l, label: u } = await P(e, t, L(t)), d = Math.max(t.height ?? 0, l.height) + o, f = d / 2, p = f / (2.5 + d / 50), m = Math.max(t.width ?? 0, l.width) + p + o, { cssStyles: h } = t, g;
3263
+ if (t.look === "handDrawn") {
3264
+ let e = T.svg(c), n = An(0, 0, m, d, p, f), r = jn(0, 0, m, d, p, f), i = e.path(n, b(t, {})), a = e.path(r, b(t, { fill: "none" }));
3265
+ g = c.insert(() => a, ":first-child"), g = c.insert(() => i, ":first-child"), g.attr("class", "basic label-container"), h && g.attr("style", h);
3266
+ } else {
3267
+ let e = kn(0, 0, m, d, p, f);
3268
+ g = c.insert("path", ":first-child").attr("d", e).attr("class", "basic label-container").attr("style", a(h)).attr("style", r), g.attr("class", "basic label-container outer-path"), h && g.selectAll("path").attr("style", h), r && g.selectAll("path").attr("style", r);
3269
+ }
3270
+ return g.attr("label-offset-x", p), g.attr("transform", `translate(${-m / 2}, ${d / 2} )`), u.attr("transform", `translate(${-(l.width / 2) - p - (l.x - (l.left ?? 0))}, ${-(l.height / 2) - (l.y - (l.top ?? 0))})`), I(t, g), t.intersect = function(e) {
3271
+ let n = K.rect(t, e), r = n.y - (t.y ?? 0);
3272
+ if (f != 0 && (Math.abs(r) < (t.height ?? 0) / 2 || Math.abs(r) == (t.height ?? 0) / 2 && Math.abs(n.x - (t.x ?? 0)) > (t.width ?? 0) / 2 - p)) {
3273
+ let i = p * p * (1 - r * r / (f * f));
3274
+ i != 0 && (i = Math.sqrt(Math.abs(i))), i = p - i, e.x - (t.x ?? 0) > 0 && (i = -i), n.x += i;
3275
+ }
3276
+ return n;
3277
+ }, c;
3278
+ }
3279
+ o(Pn, "tiltedCylinder");
3280
+ async function Fn(e, t) {
3281
+ let { labelStyles: n, nodeStyles: r } = x(t);
3282
+ t.labelStyle = n;
3283
+ let i = t.padding ?? 0, a = (t.look, i), o = t.look === "neo" ? i * 2 : i, { shapeSvg: s, bbox: c } = await P(e, t, L(t)), l = Math.max(c.height + a, t.height ?? 0), u = Math.max(c.width + o, (t.width ?? 0) - l), d = [
3284
+ {
3285
+ x: -3 * l / 6,
3286
+ y: 0
3287
+ },
3288
+ {
3289
+ x: u + 3 * l / 6,
3290
+ y: 0
3291
+ },
3292
+ {
3293
+ x: u,
3294
+ y: -l
3295
+ },
3296
+ {
3297
+ x: 0,
3298
+ y: -l
3299
+ }
3300
+ ], f, { cssStyles: p } = t;
3301
+ if (t.look === "handDrawn") {
3302
+ let e = T.svg(s), n = b(t, {}), r = R(d), i = e.path(r, n);
3303
+ f = s.insert(() => i, ":first-child").attr("transform", `translate(${-u / 2}, ${l / 2})`), p && f.attr("style", p);
3304
+ } else f = J(s, u, l, d);
3305
+ return r && f.attr("style", r), t.width = u, t.height = l, I(t, f), t.intersect = function(e) {
3306
+ return K.polygon(t, d, e);
3307
+ }, s;
3308
+ }
3309
+ o(Fn, "trapezoid");
3310
+ async function In(e, t) {
3311
+ let { labelStyles: n, nodeStyles: r } = x(t);
3312
+ t.labelStyle = n;
3313
+ let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i;
3314
+ (t.width || t.height) && (t.height = (t.height ?? 0) - o * 2, t.height < 5 && (t.height = 5), t.width = (t.width ?? 0) - a * 2, t.width < 15 && (t.width = 15));
3315
+ let { shapeSvg: s, bbox: c } = await P(e, t, L(t)), l = (t?.width ? t?.width : c.width) + a * 2, u = (t?.height ? t?.height : c.height) + o * 2, { cssStyles: d } = t, f = T.svg(s), p = b(t, {});
3316
+ t.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
3317
+ let m = [
3318
+ {
3319
+ x: -l / 2 * .8,
3320
+ y: -u / 2
3321
+ },
3322
+ {
3323
+ x: l / 2 * .8,
3324
+ y: -u / 2
3325
+ },
3326
+ {
3327
+ x: l / 2,
3328
+ y: -u / 2 * .6
3329
+ },
3330
+ {
3331
+ x: l / 2,
3332
+ y: u / 2
3333
+ },
3334
+ {
3335
+ x: -l / 2,
3336
+ y: u / 2
3337
+ },
3338
+ {
3339
+ x: -l / 2,
3340
+ y: -u / 2 * .6
3341
+ }
3342
+ ], h = R(m), g = f.path(h, p), _ = s.insert(() => g, ":first-child");
3343
+ return _.attr("class", "basic label-container outer-path"), d && t.look !== "handDrawn" && _.selectChildren("path").attr("style", d), r && t.look !== "handDrawn" && _.selectChildren("path").attr("style", r), I(t, _), t.intersect = function(e) {
3344
+ return K.polygon(t, m, e);
3345
+ }, s;
3346
+ }
3347
+ o(In, "trapezoidalPentagon");
3348
+ var Ln = 10, Rn = 10;
3349
+ async function zn(t, n) {
3350
+ let { labelStyles: r, nodeStyles: i } = x(n);
3351
+ n.labelStyle = r;
3352
+ let a = n.padding ?? 0, o = n.look === "neo" ? a * 2 : a;
3353
+ (n.width || n.height) && (n.width = ((n?.width ?? 0) - o) / 2, n.width < Rn && (n.width = Rn), n.height = n?.height ?? 0, n.height < Ln && (n.height = Ln));
3354
+ let { shapeSvg: s, bbox: c, label: l } = await P(t, n, L(n)), u = p(m().flowchart?.htmlLabels), d = (n?.width ? n?.width : c.width) + o, f = n?.height ? n?.height : d + c.height, h = f, g = [
3355
+ {
3356
+ x: 0,
3357
+ y: 0
3358
+ },
3359
+ {
3360
+ x: h,
3361
+ y: 0
3362
+ },
3363
+ {
3364
+ x: h / 2,
3365
+ y: -f
3366
+ }
3367
+ ], { cssStyles: _ } = n, v = T.svg(s), y = b(n, {});
3368
+ n.look !== "handDrawn" && (y.roughness = 0, y.fillStyle = "solid");
3369
+ let S = R(g), C = v.path(S, y), w = s.insert(() => C, ":first-child").attr("transform", `translate(${-f / 2}, ${f / 2})`).attr("class", "outer-path");
3370
+ return _ && n.look !== "handDrawn" && w.selectChildren("path").attr("style", _), i && n.look !== "handDrawn" && w.selectChildren("path").attr("style", i), n.width = d, n.height = f, I(n, w), l.attr("transform", `translate(${-c.width / 2 - (c.x - (c.left ?? 0))}, ${f / 2 - (c.height + (n.padding ?? 0) / (u ? 2 : 1) - (c.y - (c.top ?? 0)))})`), n.intersect = function(t) {
3371
+ return e.info("Triangle intersect", n, g, t), K.polygon(n, g, t);
3372
+ }, s;
3373
+ }
3374
+ o(zn, "triangle");
3375
+ async function Bn(e, t) {
3376
+ let { labelStyles: n, nodeStyles: r } = x(t);
3377
+ t.labelStyle = n;
3378
+ let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 12 : i, s = !0;
3379
+ (t.width || t.height) && (s = !1, t.width = (t?.width ?? 0) - a * 2, t.width < 10 && (t.width = 10), t.height = (t?.height ?? 0) - o * 2, t.height < 10 && (t.height = 10));
3380
+ let { shapeSvg: c, bbox: l, label: u } = await P(e, t, L(t)), d = (t?.width ? t?.width : l.width) + (a ?? 0) * 2, f = (t?.height ? t?.height : l.height) + (o ?? 0) * 2, p = t.look === "neo" ? f / 4 : f / 8, m = f + (s ? p : -p), { cssStyles: h } = t, g = 14 - d, _ = g > 0 ? g / 2 : 0, v = T.svg(c), y = b(t, {});
3381
+ t.look !== "handDrawn" && (y.roughness = 0, y.fillStyle = "solid");
3382
+ let S = [
3383
+ {
3384
+ x: -d / 2 - _,
3385
+ y: m / 2
3386
+ },
3387
+ ...z(-d / 2 - _, m / 2, d / 2 + _, m / 2, p, .8),
3388
+ {
3389
+ x: d / 2 + _,
3390
+ y: -m / 2
3391
+ },
3392
+ {
3393
+ x: -d / 2 - _,
3394
+ y: -m / 2
3395
+ }
3396
+ ], C = R(S), w = v.path(C, y), E = c.insert(() => w, ":first-child");
3397
+ return E.attr("class", "basic label-container outer-path"), h && t.look !== "handDrawn" && E.selectAll("path").attr("style", h), r && t.look !== "handDrawn" && E.selectAll("path").attr("style", r), E.attr("transform", `translate(0,${-p / 2})`), u.attr("transform", `translate(${-d / 2 + (t.padding ?? 0) - (l.x - (l.left ?? 0))},${-f / 2 + (t.padding ?? 0) - p - (l.y - (l.top ?? 0))})`), I(t, E), t.intersect = function(e) {
3398
+ return K.polygon(t, S, e);
3399
+ }, c;
3400
+ }
3401
+ o(Bn, "waveEdgedRectangle");
3402
+ async function Vn(e, t) {
3403
+ let { labelStyles: n, nodeStyles: r } = x(t);
3404
+ t.labelStyle = n;
3405
+ let i = t.padding ?? 0, a = t.look === "neo" ? 16 : i, o = t.look === "neo" ? 20 : i;
3406
+ if (t.width || t.height) {
3407
+ t.width = t?.width ?? 0, t.width < 20 && (t.width = 20), t.height = t?.height ?? 0, t.height < 10 && (t.height = 10);
3408
+ let e = Math.min(t.height * .2, t.height / 4);
3409
+ t.height = Math.ceil(t.height - o - 20 / 9 * e), t.width -= a * 2;
3410
+ }
3411
+ let { shapeSvg: s, bbox: c } = await P(e, t, L(t)), l = (t?.width ? t?.width : c.width) + a * 2, u = (t?.height ? t?.height : c.height) + o, d = u / 8, f = u + d * 2, { cssStyles: p } = t, m = T.svg(s), h = b(t, {});
3412
+ t.look !== "handDrawn" && (h.roughness = 0, h.fillStyle = "solid");
3413
+ let g = [
3414
+ {
3415
+ x: -l / 2,
3416
+ y: f / 2
3417
+ },
3418
+ ...z(-l / 2, f / 2, l / 2, f / 2, d, 1),
3419
+ {
3420
+ x: l / 2,
3421
+ y: -f / 2
3422
+ },
3423
+ ...z(l / 2, -f / 2, -l / 2, -f / 2, d, -1)
3424
+ ], _ = R(g), v = m.path(_, h), y = s.insert(() => v, ":first-child");
3425
+ return y.attr("class", "basic label-container"), p && t.look !== "handDrawn" && y.selectAll("path").attr("style", p), r && t.look !== "handDrawn" && y.selectAll("path").attr("style", r), I(t, y), t.intersect = function(e) {
3426
+ return K.polygon(t, g, e);
3427
+ }, s;
3428
+ }
3429
+ o(Vn, "waveRectangle");
3430
+ var Q = 10;
3431
+ async function Hn(e, t) {
3432
+ let { labelStyles: n, nodeStyles: r } = x(t);
3433
+ t.labelStyle = n;
3434
+ let i = t.look === "neo" ? 16 : t.padding ?? 0, a = t.look === "neo" ? 12 : t.padding ?? 0;
3435
+ (t.width || t.height) && (t.width = Math.max((t?.width ?? 0) - i * 2 - Q, 10), t.height = Math.max((t?.height ?? 0) - a * 2 - Q, 10));
3436
+ let { shapeSvg: o, bbox: s, label: c } = await P(e, t, L(t)), l = (t?.width ? t?.width : s.width) + i * 2 + Q, u = (t?.height ? t?.height : s.height) + a * 2 + Q, d = l - Q, f = u - Q, p = -d / 2, m = -f / 2, { cssStyles: h } = t, g = T.svg(o), _ = b(t, {}), v = [
3437
+ {
3438
+ x: p - Q,
3439
+ y: m - Q
3440
+ },
3441
+ {
3442
+ x: p - Q,
3443
+ y: m + f
3444
+ },
3445
+ {
3446
+ x: p + d,
3447
+ y: m + f
3448
+ },
3449
+ {
3450
+ x: p + d,
3451
+ y: m - Q
3452
+ }
3453
+ ], y = `M${p - Q},${m - Q} L${p + d},${m - Q} L${p + d},${m + f} L${p - Q},${m + f} L${p - Q},${m - Q}
3454
+ M${p - Q},${m} L${p + d},${m}
3455
+ M${p},${m - Q} L${p},${m + f}`;
3456
+ t.look !== "handDrawn" && (_.roughness = 0, _.fillStyle = "solid");
3457
+ let S = g.path(y, _), C = o.insert(() => S, ":first-child");
3458
+ return C.attr("transform", `translate(${Q / 2}, ${Q / 2})`), C.attr("class", "basic label-container outer-path"), h && t.look !== "handDrawn" && C.selectAll("path").attr("style", h), r && t.look !== "handDrawn" && C.selectAll("path").attr("style", r), c.attr("transform", `translate(${-(s.width / 2) + Q / 2 - (s.x - (s.left ?? 0))}, ${-(s.height / 2) + Q / 2 - (s.y - (s.top ?? 0))})`), I(t, C), t.intersect = function(e) {
3459
+ return K.polygon(t, v, e);
3460
+ }, o;
3461
+ }
3462
+ o(Hn, "windowPane");
3463
+ var Un = /* @__PURE__ */ new Set(["redux-color", "redux-dark-color"]), Wn = /* @__PURE__ */ new Set([
3464
+ "redux",
3465
+ "redux-dark",
3466
+ "redux-color",
3467
+ "redux-dark-color"
3468
+ ]);
3469
+ async function Gn(e, n) {
3470
+ let r = n;
3471
+ r.alias && (n.label = r.alias);
3472
+ let { theme: a, themeVariables: o } = d(), { rowEven: s, rowOdd: c, nodeBorder: l, borderColorArray: u } = o;
3473
+ if (n.look === "handDrawn") {
3474
+ let { themeVariables: t } = d(), { background: r } = t;
3475
+ await Gn(e, {
3476
+ ...n,
3477
+ id: n.id + "-background",
3478
+ domId: (n.domId || n.id) + "-background",
3479
+ look: "default",
3480
+ cssStyles: ["stroke: none", `fill: ${r}`]
3481
+ });
3482
+ }
3483
+ let f = d();
3484
+ n.useHtmlLabels = f.htmlLabels;
3485
+ let m = f.er?.diagramPadding ?? 10, h = f.er?.entityPadding ?? 6, { cssStyles: g } = n, { labelStyles: _, nodeStyles: v } = x(n);
3486
+ if (r.attributes.length === 0 && n.label) {
3487
+ let t = {
3488
+ rx: 0,
3489
+ ry: 0,
3490
+ labelPaddingX: m,
3491
+ labelPaddingY: m * 1.5,
3492
+ classes: ""
3493
+ };
3494
+ i(n.label, f) + t.labelPaddingX * 2 < f.er.minEntityWidth && (n.width = f.er.minEntityWidth);
3495
+ let o = await Ke(e, n, t);
3496
+ if (a != null && Un.has(a)) {
3497
+ let e = r.colorIndex ?? 0;
3498
+ o.attr("data-color-id", `color-${e % u.length}`);
3499
+ }
3500
+ if (!p(f.htmlLabels)) {
3501
+ let e = o.select("text"), t = e.node()?.getBBox();
3502
+ e.attr("transform", `translate(${-t.width / 2}, 0)`);
3503
+ }
3504
+ return o;
3505
+ }
3506
+ f.htmlLabels || (m *= 1.25, h *= 1.25);
3507
+ let y = L(n);
3508
+ y ||= "node default";
3509
+ let S = e.insert("g").attr("class", y).attr("id", n.domId || n.id), C = await Kn(S, n.label ?? "", f, 0, 0, ["name"], _);
3510
+ C.height += h;
3511
+ let w = 0, E = [], D = [], O = 0, k = 0, A = 0, j = 0, M = !0, N = !0;
3512
+ for (let e of r.attributes) {
3513
+ let t = await Kn(S, e.type, f, 0, w, ["attribute-type"], _);
3514
+ O = Math.max(O, t.width + m);
3515
+ let n = await Kn(S, e.name, f, 0, w, ["attribute-name"], _);
3516
+ k = Math.max(k, n.width + m);
3517
+ let r = await Kn(S, e.keys.join(), f, 0, w, ["attribute-keys"], _);
3518
+ A = Math.max(A, r.width + m);
3519
+ let i = await Kn(S, e.comment, f, 0, w, ["attribute-comment"], _);
3520
+ j = Math.max(j, i.width + m);
3521
+ let a = Math.max(t.height, n.height, r.height, i.height) + h;
3522
+ D.push({
3523
+ yOffset: w,
3524
+ rowHeight: a
3525
+ }), w += a;
3526
+ }
3527
+ let P = 4;
3528
+ A <= m && (M = !1, A = 0, P--), j <= m && (N = !1, j = 0, P--);
3529
+ let F = S.node().getBBox();
3530
+ if (C.width + m * 2 - (O + k + A + j) > 0) {
3531
+ let e = C.width + m * 2 - (O + k + A + j);
3532
+ O += e / P, k += e / P, A > 0 && (A += e / P), j > 0 && (j += e / P);
3533
+ }
3534
+ let R = O + k + A + j, z = T.svg(S), B = b(n, {});
3535
+ n.look !== "handDrawn" && (B.roughness = 0, B.fillStyle = "solid");
3536
+ let ee = 0;
3537
+ D.length > 0 && (ee = D.reduce((e, t) => e + (t?.rowHeight ?? 0), 0));
3538
+ let V = Math.max(F.width + m * 2, n?.width || 0, R), te = Math.max((ee ?? 0) + C.height, n?.height || 0), H = -V / 2, U = -te / 2;
3539
+ if (S.selectAll("g:not(:first-child)").each((e, n, r) => {
3540
+ let i = t(r[n]), a = i.attr("transform"), o = 0, s = 0;
3541
+ if (a) {
3542
+ let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);
3543
+ e && (o = parseFloat(e[1]), s = parseFloat(e[2]), i.attr("class").includes("attribute-name") ? o += O : i.attr("class").includes("attribute-keys") ? o += O + k : i.attr("class").includes("attribute-comment") && (o += O + k + A));
3544
+ }
3545
+ i.attr("transform", `translate(${H + m / 2 + o}, ${s + U + C.height + h / 2})`);
3546
+ }), S.select(".name").attr("transform", "translate(" + -C.width / 2 + ", " + (U + h / 2) + ")"), a != null && Un.has(a)) {
3547
+ let e = r.colorIndex ?? 0;
3548
+ S.attr("data-color-id", `color-${e % u.length}`);
3549
+ }
3550
+ let ne = z.rectangle(H, U, V, te, B), re = S.insert(() => ne, ":first-child").attr("class", "outer-path").attr("style", g.join(""));
3551
+ E.push(0);
3552
+ for (let [e, t] of D.entries()) {
3553
+ let n = (e + 1) % 2 == 0 && t.yOffset !== 0, r = z.rectangle(H, C.height + U + t?.yOffset, V, t?.rowHeight, {
3554
+ ...B,
3555
+ fill: n ? s : c,
3556
+ stroke: l
3557
+ });
3558
+ S.insert(() => r, "g.label").attr("style", g.join("")).attr("class", `row-rect-${n ? "even" : "odd"}`);
3559
+ }
3560
+ let ie = 1e-4, W = qn(H, C.height + U, V + H, C.height + U, ie), G = z.polygon(W.map((e) => [e.x, e.y]), B);
3561
+ if (S.insert(() => G).attr("class", "divider"), W = qn(O + H, C.height + U, O + H, te + U, ie), G = z.polygon(W.map((e) => [e.x, e.y]), B), S.insert(() => G).attr("class", "divider"), M) {
3562
+ let e = O + k + H;
3563
+ W = qn(e, C.height + U, e, te + U, ie), G = z.polygon(W.map((e) => [e.x, e.y]), B), S.insert(() => G).attr("class", "divider");
3564
+ }
3565
+ if (N) {
3566
+ let e = O + k + A + H;
3567
+ W = qn(e, C.height + U, e, te + U, ie), G = z.polygon(W.map((e) => [e.x, e.y]), B), S.insert(() => G).attr("class", "divider");
3568
+ }
3569
+ for (let e of E) {
3570
+ let t = C.height + U + e;
3571
+ W = qn(H, t, V + H, t, ie), G = z.polygon(W.map((e) => [e.x, e.y]), B), S.insert(() => G).attr("class", "divider");
3572
+ }
3573
+ if (I(n, re), v && n.look !== "handDrawn") if (a != null && Wn.has(a)) S.selectAll("path").attr("style", v);
3574
+ else {
3575
+ let e = v.split(";")?.filter((e) => e.includes("stroke"))?.map((e) => `${e}`).join("; ");
3576
+ S.selectAll("path").attr("style", e ?? ""), S.selectAll(".row-rect-even path").attr("style", v);
3577
+ }
3578
+ return n.intersect = function(e) {
3579
+ return K.rect(n, e);
3580
+ }, S;
3581
+ }
3582
+ o(Gn, "erBox");
3583
+ async function Kn(e, n, r, a = 0, o = 0, s = [], c = "") {
3584
+ let u = e.insert("g").attr("class", `label ${s.join(" ")}`).attr("transform", `translate(${a}, ${o})`).attr("style", c);
3585
+ n !== l(n) && (n = l(n), n = n.replaceAll("<", "&lt;").replaceAll(">", "&gt;"));
3586
+ let d = u.node().appendChild(await v(u, n, {
3587
+ width: i(n, r) + 100,
3588
+ style: c,
3589
+ useHtmlLabels: r.htmlLabels
3590
+ }, r));
3591
+ if (n.includes("&lt;") || n.includes("&gt;")) {
3592
+ let e = d.children[0];
3593
+ for (e.textContent = e.textContent.replaceAll("&lt;", "<").replaceAll("&gt;", ">"); e.childNodes[0];) e = e.childNodes[0], e.textContent = e.textContent.replaceAll("&lt;", "<").replaceAll("&gt;", ">");
3594
+ }
3595
+ let f = d.getBBox();
3596
+ if (p(r.htmlLabels)) {
3597
+ let e = d.children[0];
3598
+ e.style.textAlign = "start";
3599
+ let n = t(d);
3600
+ f = e.getBoundingClientRect(), n.attr("width", f.width), n.attr("height", f.height);
3601
+ }
3602
+ return f;
3603
+ }
3604
+ o(Kn, "addText");
3605
+ function qn(e, t, n, r, i) {
3606
+ return e === n ? [
3607
+ {
3608
+ x: e - i / 2,
3609
+ y: t
3610
+ },
3611
+ {
3612
+ x: e + i / 2,
3613
+ y: t
3614
+ },
3615
+ {
3616
+ x: n + i / 2,
3617
+ y: r
3618
+ },
3619
+ {
3620
+ x: n - i / 2,
3621
+ y: r
3622
+ }
3623
+ ] : [
3624
+ {
3625
+ x: e,
3626
+ y: t - i / 2
3627
+ },
3628
+ {
3629
+ x: e,
3630
+ y: t + i / 2
3631
+ },
3632
+ {
3633
+ x: n,
3634
+ y: r + i / 2
3635
+ },
3636
+ {
3637
+ x: n,
3638
+ y: r - i / 2
3639
+ }
3640
+ ];
3641
+ }
3642
+ o(qn, "lineToPolygon");
3643
+ async function Jn(e, t, n, r, i = n.class.padding ?? 12) {
3644
+ let a = r ? 0 : 3, o = e.insert("g").attr("class", L(t)).attr("id", t.domId || t.id), s = null, c = null, l = null, u = null, d = 0, f = 0, p = 0;
3645
+ if (s = o.insert("g").attr("class", "annotation-group text"), t.annotations.length > 0) {
3646
+ let e = t.annotations[0];
3647
+ await Yn(s, { text: `\xAB${e}\xBB` }, 0), d = s.node().getBBox().height;
3648
+ }
3649
+ c = o.insert("g").attr("class", "label-group text"), await Yn(c, t, 0, ["font-weight: bolder"]);
3650
+ let m = c.node().getBBox();
3651
+ f = m.height, l = o.insert("g").attr("class", "members-group text");
3652
+ let h = 0;
3653
+ for (let e of t.members) {
3654
+ let t = await Yn(l, e, h, [e.parseClassifier()]);
3655
+ h += t + a;
3656
+ }
3657
+ p = l.node().getBBox().height, p <= 0 && (p = i / 2), u = o.insert("g").attr("class", "methods-group text");
3658
+ let g = 0;
3659
+ for (let e of t.methods) {
3660
+ let t = await Yn(u, e, g, [e.parseClassifier()]);
3661
+ g += t + a;
3662
+ }
3663
+ let _ = o.node().getBBox();
3664
+ if (s !== null) {
3665
+ let e = s.node().getBBox();
3666
+ s.attr("transform", `translate(${-e.width / 2})`);
3667
+ }
3668
+ return c.attr("transform", `translate(${-m.width / 2}, ${d})`), _ = o.node().getBBox(), l.attr("transform", `translate(0, ${d + f + i * 2})`), _ = o.node().getBBox(), u.attr("transform", `translate(0, ${d + f + (p ? p + i * 4 : i * 2)})`), _ = o.node().getBBox(), {
3669
+ shapeSvg: o,
3670
+ bbox: _
3671
+ };
3672
+ }
3673
+ o(Jn, "textHelper");
3674
+ async function Yn(e, r, a, o = []) {
3675
+ let l = e.insert("g").attr("class", "label").attr("style", o.join("; ")), u = d(), f = "useHtmlLabels" in r ? r.useHtmlLabels : p(u.htmlLabels) ?? !0, m = "";
3676
+ m = "text" in r ? r.text : r.label, !f && m.startsWith("\\") && (m = m.substring(1)), s(m) && (f = !0);
3677
+ let h = await v(l, c(n(m)), {
3678
+ width: i(m, u) + 50,
3679
+ classes: "markdown-node-label",
3680
+ useHtmlLabels: f
3681
+ }, u), g, _ = 1;
3682
+ if (f) {
3683
+ let e = h.children[0], n = t(h);
3684
+ _ = e.innerHTML.split("<br>").length, e.innerHTML.includes("</math>") && (_ += e.innerHTML.split("<mrow>").length - 1), await O(e), g = e.getBoundingClientRect(), n.attr("width", g.width), n.attr("height", g.height);
3685
+ } else {
3686
+ o.includes("font-weight: bolder") && t(h).selectAll("tspan").attr("font-weight", ""), _ = h.children.length;
3687
+ let e = h.children[0];
3688
+ (h.textContent === "" || h.textContent.includes("&gt")) && (e.textContent = m[0] + m.substring(1).replaceAll("&gt;", ">").replaceAll("&lt;", "<").trim(), m[1] === " " && (e.textContent = e.textContent[0] + " " + e.textContent.substring(1))), e.textContent === "undefined" && (e.textContent = ""), g = h.getBBox();
3689
+ }
3690
+ return l.attr("transform", "translate(0," + (-g.height / (2 * _) + a) + ")"), g.height;
3691
+ }
3692
+ o(Yn, "addText");
3693
+ async function Xn(e, n) {
3694
+ let r = m(), { theme: i, themeVariables: a } = r, { useGradient: o, borderColorArray: s } = a, c = r.class.padding ?? 12, l = c, u = n.useHtmlLabels ?? p(r.htmlLabels) ?? !0, d = n;
3695
+ d.annotations = d.annotations ?? [], d.members = d.members ?? [], d.methods = d.methods ?? [];
3696
+ let { shapeSvg: f, bbox: h } = await Jn(e, n, r, u, l);
3697
+ w(f, n.colorIndex, i, s);
3698
+ let { labelStyles: g, nodeStyles: _ } = x(n);
3699
+ n.labelStyle = g, n.cssStyles = d.styles || "";
3700
+ let v = d.styles?.join(";") || _ || "";
3701
+ n.cssStyles ||= v.replaceAll("!important", "").split(";");
3702
+ let y = d.members.length === 0 && d.methods.length === 0 && !r.class?.hideEmptyMembersBox, S = T.svg(f), C = b(n, {});
3703
+ n.look !== "handDrawn" && (C.roughness = 0, C.fillStyle = "solid");
3704
+ let E = Math.max(n.width ?? 0, h.width), D = Math.max(n.height ?? 0, h.height), O = (n.height ?? 0) > h.height;
3705
+ d.members.length === 0 && d.methods.length === 0 ? D += l : d.members.length > 0 && d.methods.length === 0 && (D += l * 2);
3706
+ let k = -E / 2, A = -D / 2, j = y ? c * 2 : d.members.length === 0 && d.methods.length === 0 ? -c : 0;
3707
+ O && (j = c * 2);
3708
+ let M = S.rectangle(k - c, A - c - (y ? c : d.members.length === 0 && d.methods.length === 0 ? -c / 2 : 0), E + 2 * c, D + 2 * c + j, C), N = f.insert(() => M, ":first-child");
3709
+ N.attr("class", "basic label-container outer-path");
3710
+ let P = N.node().getBBox(), F = f.select(".annotation-group").node().getBBox().height - (y ? c / 2 : 0) || 0, L = f.select(".label-group").node().getBBox().height - (y ? c / 2 : 0) || 0, R = f.select(".members-group").node().getBBox().height - (y ? c / 2 : 0) || 0, z = (F + L + A + c - (A - c - (y ? c : d.members.length === 0 && d.methods.length === 0 ? -c / 2 : 0))) / 2;
3711
+ if (f.selectAll(".text").each((e, n, i) => {
3712
+ let a = t(i[n]), o = a.attr("transform"), s = 0;
3713
+ if (o) {
3714
+ let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(o);
3715
+ e && (s = parseFloat(e[2]));
3716
+ }
3717
+ let p = s + A + c - (y ? c : d.members.length === 0 && d.methods.length === 0 ? -c / 2 : 0);
3718
+ if (a.attr("class").includes("methods-group")) {
3719
+ let e = Math.max(R, l / 2);
3720
+ p = O ? Math.max(z, F + L + e + A + l * 2 + c) + l * 2 : F + L + e + A + l * 4 + c;
3721
+ }
3722
+ d.members.length === 0 && d.methods.length === 0 && r.class?.hideEmptyMembersBox && (p = d.annotations.length > 0 ? s - l : s), u || (p -= 4);
3723
+ let m = k;
3724
+ (a.attr("class").includes("label-group") || a.attr("class").includes("annotation-group")) && (m = -a.node()?.getBBox().width / 2 || 0, f.selectAll("text").each(function(e, t, n) {
3725
+ window.getComputedStyle(n[t]).textAnchor === "middle" && (m = 0);
3726
+ })), a.attr("transform", `translate(${m}, ${p})`);
3727
+ }), d.members.length > 0 || d.methods.length > 0 || y) {
3728
+ let e = F + L + A + c, t = S.line(P.x, e, P.x + P.width, e + .001, C);
3729
+ f.insert(() => t).attr("class", `divider${n.look === "neo" && !o ? " neo-line" : ""}`).attr("style", v);
3730
+ }
3731
+ if (y || d.members.length > 0 || d.methods.length > 0) {
3732
+ let e = F + L + R + A + l * 2 + c, t = S.line(P.x, O ? Math.max(z, e) : e, P.x + P.width, (O ? Math.max(z, e) : e) + .001, C);
3733
+ f.insert(() => t).attr("class", `divider${n.look === "neo" && !o ? " neo-line" : ""}`).attr("style", v);
3734
+ }
3735
+ if (d.look !== "handDrawn" && f.selectAll("path").attr("style", v), N.select(":nth-child(2)").attr("style", v), f.selectAll(".divider").select("path").attr("style", v), n.labelStyle ? f.selectAll("span").attr("style", n.labelStyle) : f.selectAll("span").attr("style", v), !u) {
3736
+ let e = RegExp(/color\s*:\s*([^;]*)/), t = e.exec(v);
3737
+ if (t) {
3738
+ let e = t[0].replace("color", "fill");
3739
+ f.selectAll("tspan").attr("style", e);
3740
+ } else if (g) {
3741
+ let t = e.exec(g);
3742
+ if (t) {
3743
+ let e = t[0].replace("color", "fill");
3744
+ f.selectAll("tspan").attr("style", e);
3745
+ }
3746
+ }
3747
+ }
3748
+ return I(n, N), n.intersect = function(e) {
3749
+ return K.rect(n, e);
3750
+ }, f;
3751
+ }
3752
+ o(Xn, "classBox");
3753
+ async function Zn(e, n) {
3754
+ let { labelStyles: r, nodeStyles: i } = x(n);
3755
+ n.labelStyle = r;
3756
+ let a = n, o = n, s = "verifyMethod" in n, c = L(n), l = m(), { themeVariables: u } = l, { borderColorArray: d, requirementEdgeLabelBackground: f } = u, p = l.layout === "elk" ? "start" : "center", h = e.insert("g").attr("class", c).attr("id", n.domId ?? n.id), g;
3757
+ g = s ? await $(h, `&lt;&lt;${a.type}&gt;&gt;`, 0, n.labelStyle) : await $(h, "&lt;&lt;Element&gt;&gt;", 0, n.labelStyle);
3758
+ let _ = g, v = await $(h, a.name, _, n.labelStyle + "; font-weight: bold;");
3759
+ if (_ += v + 20, s) {
3760
+ let e = await $(h, `${a.requirementId ? `ID: ${a.requirementId}` : ""}`, _, n.labelStyle, p);
3761
+ _ += e;
3762
+ let t = await $(h, `${a.text ? `Text: ${a.text}` : ""}`, _, n.labelStyle, p);
3763
+ _ += t;
3764
+ let r = await $(h, `${a.risk ? `Risk: ${a.risk}` : ""}`, _, n.labelStyle, p);
3765
+ _ += r, await $(h, `${a.verifyMethod ? `Verification: ${a.verifyMethod}` : ""}`, _, n.labelStyle, p);
3766
+ } else {
3767
+ let e = await $(h, `${o.type ? `Type: ${o.type}` : ""}`, _, n.labelStyle, p);
3768
+ _ += e, await $(h, `${o.docRef ? `Doc Ref: ${o.docRef}` : ""}`, _, n.labelStyle, p);
3769
+ }
3770
+ let y = (h.node()?.getBBox().width ?? 200) + 20, S = (h.node()?.getBBox().height ?? 200) + 20, C = -y / 2, w = -S / 2, E = T.svg(h), D = b(n, {});
3771
+ n.look !== "handDrawn" && (D.roughness = 0, D.fillStyle = "solid");
3772
+ let O = E.rectangle(C, w, y, S, D), k = h.insert(() => O, ":first-child");
3773
+ if (k.attr("class", "basic label-container outer-path").attr("style", i), d?.length) {
3774
+ let e = n.colorIndex ?? 0;
3775
+ h.attr("data-color-id", `color-${e % d.length}`);
3776
+ }
3777
+ if (h.selectAll(".label").each((e, n, r) => {
3778
+ let i = t(r[n]), a = i.attr("transform"), o = 0, s = 0;
3779
+ if (a) {
3780
+ let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(a);
3781
+ e && (o = parseFloat(e[1]), s = parseFloat(e[2]));
3782
+ }
3783
+ let c = s - S / 2, l = C + 20 / 2;
3784
+ (n === 0 || n === 1) && (l = o), i.attr("transform", `translate(${l}, ${c + 20})`);
3785
+ }), _ > g + v + 20) {
3786
+ let e = w + g + v + 20, t;
3787
+ if (n.look === "neo") {
3788
+ let n = .001, r = [
3789
+ [C, e],
3790
+ [C + y, e],
3791
+ [C + y, e + n],
3792
+ [C, e + n]
3793
+ ];
3794
+ t = E.polygon(r, D);
3795
+ } else t = E.line(C, e, C + y, e, D);
3796
+ h.insert(() => t).attr("class", "divider");
3797
+ }
3798
+ return I(n, k), n.intersect = function(e) {
3799
+ return K.rect(n, e);
3800
+ }, i && n.look !== "handDrawn" && (f || d?.length) && h.selectAll("path").attr("style", i), h;
3801
+ }
3802
+ o(Zn, "requirementBox");
3803
+ async function $(e, r, a, o = "", s = "center") {
3804
+ if (r === "") return 0;
3805
+ let l = e.insert("g").attr("class", "label").attr("style", o), u = m(), d = u.htmlLabels ?? !0, f = await v(l, c(n(r)), {
3806
+ width: i(r, u) + 50,
3807
+ classes: "markdown-node-label",
3808
+ useHtmlLabels: d,
3809
+ style: o
3810
+ }, u), p;
3811
+ if (d) {
3812
+ let e = f.children[0], n = t(f);
3813
+ s === "start" && t(e).style("text-align", "left"), p = e.getBoundingClientRect(), n.attr("width", p.width), n.attr("height", p.height);
3814
+ } else {
3815
+ let e = f.children[0];
3816
+ for (let t of e.children) o && t.setAttribute("style", o);
3817
+ if (s === "start") {
3818
+ e.setAttribute("text-anchor", "start");
3819
+ for (let t of e.children) t.setAttribute("text-anchor", "start");
3820
+ }
3821
+ p = f.getBBox(), p.height += 6;
3822
+ }
3823
+ return l.attr("transform", `translate(${-p.width / 2},${-p.height / 2 + a})`), p.height;
3824
+ }
3825
+ o($, "addText");
3826
+ var Qn = /* @__PURE__ */ o((e) => {
3827
+ switch (e) {
3828
+ case "Very High": return "red";
3829
+ case "High": return "orange";
3830
+ case "Medium": return null;
3831
+ case "Low": return "blue";
3832
+ case "Very Low": return "lightblue";
3833
+ }
3834
+ }, "colorFromPriority");
3835
+ async function $n(e, t, { config: n }) {
3836
+ let { labelStyles: r, nodeStyles: i } = x(t);
3837
+ t.labelStyle = r || "";
3838
+ let a = t.width;
3839
+ t.width = (t.width ?? 200) - 10;
3840
+ let { shapeSvg: o, bbox: s, label: c } = await P(e, t, L(t)), l = t.padding || 10, u = "", d;
3841
+ "ticket" in t && t.ticket && n?.kanban?.ticketBaseUrl && (u = n?.kanban?.ticketBaseUrl.replace("#TICKET#", t.ticket), d = o.insert("svg:a", ":first-child").attr("class", "kanban-ticket-link").attr("xlink:href", u).attr("target", "_blank"));
3842
+ let f = {
3843
+ useHtmlLabels: t.useHtmlLabels,
3844
+ labelStyle: t.labelStyle || "",
3845
+ width: t.width,
3846
+ img: t.img,
3847
+ padding: t.padding || 8,
3848
+ centerLabel: !1
3849
+ }, p, m;
3850
+ d ? {label: p, bbox: m} = await F(d, "ticket" in t && t.ticket || "", f) : {label: p, bbox: m} = await F(o, "ticket" in t && t.ticket || "", f);
3851
+ let { label: h, bbox: g } = await F(o, "assigned" in t && t.assigned || "", f);
3852
+ t.width = a;
3853
+ let _ = t?.width || 0, v = Math.max(m.height, g.height) / 2, y = Math.max(s.height + 20, t?.height || 0) + v, S = -_ / 2, C = -y / 2;
3854
+ c.attr("transform", "translate(" + (l - _ / 2) + ", " + (-v - s.height / 2) + ")"), p.attr("transform", "translate(" + (l - _ / 2) + ", " + (-v + s.height / 2) + ")"), h.attr("transform", "translate(" + (l + _ / 2 - g.width - 20) + ", " + (-v + s.height / 2) + ")");
3855
+ let w, { rx: E, ry: D } = t, { cssStyles: O } = t;
3856
+ if (t.look === "handDrawn") {
3857
+ let e = T.svg(o), n = b(t, {}), r = E || D ? e.path(q(S, C, _, y, E || 0), n) : e.rectangle(S, C, _, y, n);
3858
+ w = o.insert(() => r, ":first-child"), w.attr("class", "basic label-container").attr("style", O || null);
3859
+ } else {
3860
+ w = o.insert("rect", ":first-child"), w.attr("class", "basic label-container __APA__").attr("style", i).attr("rx", E ?? 5).attr("ry", D ?? 5).attr("x", S).attr("y", C).attr("width", _).attr("height", y);
3861
+ let e = "priority" in t && t.priority;
3862
+ if (e) {
3863
+ let t = o.append("line"), n = S + 2, r = C + Math.floor((E ?? 0) / 2), i = C + y - Math.floor((E ?? 0) / 2);
3864
+ t.attr("x1", n).attr("y1", r).attr("x2", n).attr("y2", i).attr("stroke-width", "4").attr("stroke", Qn(e));
3865
+ }
3866
+ }
3867
+ return I(t, w), t.height = y, t.intersect = function(e) {
3868
+ return K.rect(t, e);
3869
+ }, o;
3870
+ }
3871
+ o($n, "kanbanItem");
3872
+ async function er(t, n) {
3873
+ let { labelStyles: r, nodeStyles: i } = x(n);
3874
+ n.labelStyle = r;
3875
+ let { shapeSvg: o, bbox: s, halfPadding: c, label: l } = await P(t, n, L(n)), u = s.width + 10 * c, d = s.height + 8 * c, f = .15 * u, { cssStyles: p } = n, m = s.width + 20, h = s.height + 20, g = Math.max(u, m), _ = Math.max(d, h);
3876
+ l.attr("transform", `translate(${-s.width / 2}, ${-s.height / 2})`);
3877
+ let v, y = `M0 0
3878
+ a${f},${f} 1 0,0 ${g * .25},${-1 * _ * .1}
3879
+ a${f},${f} 1 0,0 ${g * .25},0
3880
+ a${f},${f} 1 0,0 ${g * .25},0
3881
+ a${f},${f} 1 0,0 ${g * .25},${_ * .1}
3882
+
3883
+ a${f},${f} 1 0,0 ${g * .15},${_ * .33}
3884
+ a${f * .8},${f * .8} 1 0,0 0,${_ * .34}
3885
+ a${f},${f} 1 0,0 ${-1 * g * .15},${_ * .33}
3886
+
3887
+ a${f},${f} 1 0,0 ${-1 * g * .25},${_ * .15}
3888
+ a${f},${f} 1 0,0 ${-1 * g * .25},0
3889
+ a${f},${f} 1 0,0 ${-1 * g * .25},0
3890
+ a${f},${f} 1 0,0 ${-1 * g * .25},${-1 * _ * .15}
3891
+
3892
+ a${f},${f} 1 0,0 ${-1 * g * .1},${-1 * _ * .33}
3893
+ a${f * .8},${f * .8} 1 0,0 0,${-1 * _ * .34}
3894
+ a${f},${f} 1 0,0 ${g * .1},${-1 * _ * .33}
3895
+ H0 V0 Z`;
3896
+ if (n.look === "handDrawn") {
3897
+ let e = T.svg(o), t = b(n, {}), r = e.path(y, t);
3898
+ v = o.insert(() => r, ":first-child"), v.attr("class", "basic label-container").attr("style", a(p));
3899
+ } else v = o.insert("path", ":first-child").attr("class", "basic label-container").attr("style", i).attr("d", y);
3900
+ return v.attr("transform", `translate(${-g / 2}, ${-_ / 2})`), I(n, v), n.calcIntersect = function(e, t) {
3901
+ return K.rect(e, t);
3902
+ }, n.intersect = function(t) {
3903
+ return e.info("Bang intersect", n, t), K.rect(n, t);
3904
+ }, o;
3905
+ }
3906
+ o(er, "bang");
3907
+ async function tr(t, n) {
3908
+ let { labelStyles: r, nodeStyles: i } = x(n);
3909
+ n.labelStyle = r;
3910
+ let { shapeSvg: o, bbox: s, halfPadding: c, label: l } = await P(t, n, L(n)), u = s.width + 2 * c, d = s.height + 2 * c, f = .15 * u, p = .25 * u, m = .35 * u, h = .2 * u, { cssStyles: g } = n, _, v = `M0 0
3911
+ a${f},${f} 0 0,1 ${u * .25},${-1 * u * .1}
3912
+ a${m},${m} 1 0,1 ${u * .4},${-1 * u * .1}
3913
+ a${p},${p} 1 0,1 ${u * .35},${u * .2}
3914
+
3915
+ a${f},${f} 1 0,1 ${u * .15},${d * .35}
3916
+ a${h},${h} 1 0,1 ${-1 * u * .15},${d * .65}
3917
+
3918
+ a${p},${f} 1 0,1 ${-1 * u * .25},${u * .15}
3919
+ a${m},${m} 1 0,1 ${-1 * u * .5},0
3920
+ a${f},${f} 1 0,1 ${-1 * u * .25},${-1 * u * .15}
3921
+
3922
+ a${f},${f} 1 0,1 ${-1 * u * .1},${-1 * d * .35}
3923
+ a${h},${h} 1 0,1 ${u * .1},${-1 * d * .65}
3924
+ H0 V0 Z`;
3925
+ if (n.look === "handDrawn") {
3926
+ let e = T.svg(o), t = b(n, {}), r = e.path(v, t);
3927
+ _ = o.insert(() => r, ":first-child"), _.attr("class", "basic label-container").attr("style", a(g));
3928
+ } else _ = o.insert("path", ":first-child").attr("class", "basic label-container").attr("style", i).attr("d", v);
3929
+ return l.attr("transform", `translate(${-s.width / 2}, ${-s.height / 2})`), _.attr("transform", `translate(${-u / 2}, ${-d / 2})`), I(n, _), n.calcIntersect = function(e, t) {
3930
+ return K.rect(e, t);
3931
+ }, n.intersect = function(t) {
3932
+ return e.info("Cloud intersect", n, t), K.rect(n, t);
3933
+ }, o;
3934
+ }
3935
+ o(tr, "cloud");
3936
+ async function nr(e, t) {
3937
+ let { labelStyles: n, nodeStyles: r } = x(t);
3938
+ t.labelStyle = n;
3939
+ let { shapeSvg: i, bbox: a, halfPadding: o, label: s } = await P(e, t, L(t)), c = a.width + 8 * o, l = a.height + 2 * o, u = t.look === "neo" ? `
3940
+ M${-c / 2} ${l / 2 - 5}
3941
+ v${-l + 10}
3942
+ q0,-5 5,-5
3943
+ h${c - 10}
3944
+ q5,0 5,5
3945
+ v${l - 5}
3946
+ H${-c / 2}
3947
+ Z
3948
+ ` : `
3949
+ M${-c / 2} ${l / 2 - 5}
3950
+ v${-l + 10}
3951
+ q0,-5 5,-5
3952
+ h${c - 10}
3953
+ q5,0 5,5
3954
+ v${l - 10}
3955
+ q0,5 -5,5
3956
+ h${-(c - 10)}
3957
+ q-5,0 -5,-5
3958
+ Z
3959
+ `;
3960
+ if (!t.domId) throw Error(`defaultMindmapNode: node "${t.id}" is missing a domId \u2014 was render.ts domId prefixing skipped?`);
3961
+ let d = i.append("path").attr("id", t.domId).attr("class", "node-bkg node-" + t.type).attr("style", r).attr("d", u);
3962
+ return i.append("line").attr("class", "node-line-").attr("x1", -c / 2).attr("y1", l / 2).attr("x2", c / 2).attr("y2", l / 2), s.attr("transform", `translate(${-a.width / 2}, ${-a.height / 2})`), i.append(() => s.node()), I(t, d), t.calcIntersect = function(e, t) {
3963
+ return K.rect(e, t);
3964
+ }, t.intersect = function(e) {
3965
+ return K.rect(t, e);
3966
+ }, i;
3967
+ }
3968
+ o(nr, "defaultMindmapNode");
3969
+ async function rr(e, t) {
3970
+ return Ae(e, t, { padding: t.padding ?? 0 });
3971
+ }
3972
+ o(rr, "mindmapCircle");
3973
+ var ir = [
3974
+ {
3975
+ semanticName: "Process",
3976
+ name: "Rectangle",
3977
+ shortName: "rect",
3978
+ description: "Standard process shape",
3979
+ aliases: [
3980
+ "proc",
3981
+ "process",
3982
+ "rectangle"
3983
+ ],
3984
+ internalAliases: ["squareRect"],
3985
+ handler: gn
3986
+ },
3987
+ {
3988
+ semanticName: "Event",
3989
+ name: "Rounded Rectangle",
3990
+ shortName: "rounded",
3991
+ description: "Represents an event",
3992
+ aliases: ["event"],
3993
+ internalAliases: ["roundedRect"],
3994
+ handler: fn
3995
+ },
3996
+ {
3997
+ semanticName: "Terminal Point",
3998
+ name: "Stadium",
3999
+ shortName: "stadium",
4000
+ description: "Terminal point",
4001
+ aliases: ["terminal", "pill"],
4002
+ handler: yn
4003
+ },
4004
+ {
4005
+ semanticName: "Subprocess",
4006
+ name: "Framed Rectangle",
4007
+ shortName: "fr-rect",
4008
+ description: "Subprocess",
4009
+ aliases: [
4010
+ "subprocess",
4011
+ "subproc",
4012
+ "framed-rectangle",
4013
+ "subroutine"
4014
+ ],
4015
+ handler: wn
4016
+ },
4017
+ {
4018
+ semanticName: "Database",
4019
+ name: "Cylinder",
4020
+ shortName: "cyl",
4021
+ description: "Database storage",
4022
+ aliases: [
4023
+ "db",
4024
+ "database",
4025
+ "cylinder"
4026
+ ],
4027
+ handler: Ge
4028
+ },
4029
+ {
4030
+ semanticName: "Data Store",
4031
+ name: "Data Store",
4032
+ shortName: "datastore",
4033
+ description: "Data flow diagram data store",
4034
+ aliases: ["data-store"],
4035
+ handler: qe
4036
+ },
4037
+ {
4038
+ semanticName: "Folder",
4039
+ name: "Folder",
4040
+ shortName: "folder",
4041
+ description: "Folder or directory",
4042
+ aliases: ["directory"],
4043
+ handler: tt
4044
+ },
4045
+ {
4046
+ semanticName: "Bucket",
4047
+ name: "Bucket",
4048
+ shortName: "bucket",
4049
+ description: "Object storage bucket",
4050
+ handler: fe
4051
+ },
4052
+ {
4053
+ semanticName: "Console",
4054
+ name: "Console (terminal window)",
4055
+ shortName: "console",
4056
+ description: "Terminal or console window",
4057
+ handler: Me
4058
+ },
4059
+ {
4060
+ semanticName: "Browser",
4061
+ name: "Browser",
4062
+ shortName: "browser",
4063
+ description: "Browser window",
4064
+ handler: Ee
4065
+ },
4066
+ {
4067
+ semanticName: "Person",
4068
+ name: "Person",
4069
+ shortName: "person",
4070
+ description: "Person (circular head above a rounded body)",
4071
+ handler: ze
4072
+ },
4073
+ {
4074
+ semanticName: "Start",
4075
+ name: "Circle",
4076
+ shortName: "circle",
4077
+ description: "Starting point",
4078
+ aliases: ["circ"],
4079
+ handler: Ae
4080
+ },
4081
+ {
4082
+ semanticName: "Bang",
4083
+ name: "Bang",
4084
+ shortName: "bang",
4085
+ description: "Bang",
4086
+ aliases: ["bang"],
4087
+ handler: er
4088
+ },
4089
+ {
4090
+ semanticName: "Cloud",
4091
+ name: "Cloud",
4092
+ shortName: "cloud",
4093
+ description: "cloud",
4094
+ aliases: ["cloud"],
4095
+ handler: tr
4096
+ },
4097
+ {
4098
+ semanticName: "Decision",
4099
+ name: "Diamond",
4100
+ shortName: "diam",
4101
+ description: "Decision-making step",
4102
+ aliases: [
4103
+ "decision",
4104
+ "diamond",
4105
+ "question"
4106
+ ],
4107
+ handler: ln
4108
+ },
4109
+ {
4110
+ semanticName: "Prepare Conditional",
4111
+ name: "Hexagon",
4112
+ shortName: "hex",
4113
+ description: "Preparation or condition step",
4114
+ aliases: ["hexagon", "prepare"],
4115
+ handler: at
4116
+ },
4117
+ {
4118
+ semanticName: "Data Input/Output",
4119
+ name: "Lean Right",
4120
+ shortName: "lean-r",
4121
+ description: "Represents input or output",
4122
+ aliases: ["lean-right", "in-out"],
4123
+ internalAliases: ["lean_right"],
4124
+ handler: ht
4125
+ },
4126
+ {
4127
+ semanticName: "Data Input/Output",
4128
+ name: "Lean Left",
4129
+ shortName: "lean-l",
4130
+ description: "Represents output or input",
4131
+ aliases: ["lean-left", "out-in"],
4132
+ internalAliases: ["lean_left"],
4133
+ handler: mt
4134
+ },
4135
+ {
4136
+ semanticName: "Priority Action",
4137
+ name: "Trapezoid Base Bottom",
4138
+ shortName: "trap-b",
4139
+ description: "Priority action",
4140
+ aliases: [
4141
+ "priority",
4142
+ "trapezoid-bottom",
4143
+ "trapezoid"
4144
+ ],
4145
+ handler: Fn
4146
+ },
4147
+ {
4148
+ semanticName: "Manual Operation",
4149
+ name: "Trapezoid Base Top",
4150
+ shortName: "trap-t",
4151
+ description: "Represents a manual task",
4152
+ aliases: [
4153
+ "manual",
4154
+ "trapezoid-top",
4155
+ "inv-trapezoid"
4156
+ ],
4157
+ internalAliases: ["inv_trapezoid"],
4158
+ handler: ft
4159
+ },
4160
+ {
4161
+ semanticName: "Stop",
4162
+ name: "Double Circle",
4163
+ shortName: "dbl-circ",
4164
+ description: "Represents a stop point",
4165
+ aliases: ["double-circle"],
4166
+ internalAliases: ["doublecircle"],
4167
+ handler: Ye
4168
+ },
4169
+ {
4170
+ semanticName: "Text Block",
4171
+ name: "Text Block",
4172
+ shortName: "text",
4173
+ description: "Text block",
4174
+ handler: On
4175
+ },
4176
+ {
4177
+ semanticName: "Card",
4178
+ name: "Notched Rectangle",
4179
+ shortName: "notch-rect",
4180
+ description: "Represents a card",
4181
+ aliases: ["card", "notched-rectangle"],
4182
+ handler: Oe
4183
+ },
4184
+ {
4185
+ semanticName: "Lined/Shaded Process",
4186
+ name: "Lined Rectangle",
4187
+ shortName: "lin-rect",
4188
+ description: "Lined process shape",
4189
+ aliases: [
4190
+ "lined-rectangle",
4191
+ "lined-process",
4192
+ "lin-proc",
4193
+ "shaded-process"
4194
+ ],
4195
+ handler: mn
4196
+ },
4197
+ {
4198
+ semanticName: "Start",
4199
+ name: "Small Circle",
4200
+ shortName: "sm-circ",
4201
+ description: "Small starting point",
4202
+ aliases: ["start", "small-circle"],
4203
+ internalAliases: ["stateStart"],
4204
+ handler: Sn
4205
+ },
4206
+ {
4207
+ semanticName: "Stop",
4208
+ name: "Framed Circle",
4209
+ shortName: "fr-circ",
4210
+ description: "Stop point",
4211
+ aliases: ["stop", "framed-circle"],
4212
+ internalAliases: ["stateEnd"],
4213
+ handler: xn
4214
+ },
4215
+ {
4216
+ semanticName: "Fork/Join",
4217
+ name: "Filled Rectangle",
4218
+ shortName: "fork",
4219
+ description: "Fork or join in process flow",
4220
+ aliases: ["join"],
4221
+ internalAliases: ["forkJoin"],
4222
+ handler: nt
4223
+ },
4224
+ {
4225
+ semanticName: "Collate",
4226
+ name: "Hourglass",
4227
+ shortName: "hourglass",
4228
+ description: "Represents a collate operation",
4229
+ aliases: ["hourglass", "collate"],
4230
+ handler: ot
4231
+ },
4232
+ {
4233
+ semanticName: "Comment",
4234
+ name: "Curly Brace",
4235
+ shortName: "brace",
4236
+ description: "Adds a comment",
4237
+ aliases: ["comment", "brace-l"],
4238
+ handler: Fe
4239
+ },
4240
+ {
4241
+ semanticName: "Comment Right",
4242
+ name: "Curly Brace",
4243
+ shortName: "brace-r",
4244
+ description: "Adds a comment",
4245
+ handler: Ie
4246
+ },
4247
+ {
4248
+ semanticName: "Comment with braces on both sides",
4249
+ name: "Curly Braces",
4250
+ shortName: "braces",
4251
+ description: "Adds a comment",
4252
+ handler: Le
4253
+ },
4254
+ {
4255
+ semanticName: "Com Link",
4256
+ name: "Lightning Bolt",
4257
+ shortName: "bolt",
4258
+ description: "Communication link",
4259
+ aliases: ["com-link", "lightning-bolt"],
4260
+ handler: gt
4261
+ },
4262
+ {
4263
+ semanticName: "Document",
4264
+ name: "Document",
4265
+ shortName: "doc",
4266
+ description: "Represents a document",
4267
+ aliases: ["doc", "document"],
4268
+ handler: Bn
4269
+ },
4270
+ {
4271
+ semanticName: "Delay",
4272
+ name: "Half-Rounded Rectangle",
4273
+ shortName: "delay",
4274
+ description: "Represents a delay",
4275
+ aliases: ["half-rounded-rectangle"],
4276
+ handler: rt
4277
+ },
4278
+ {
4279
+ semanticName: "Direct Access Storage",
4280
+ name: "Horizontal Cylinder",
4281
+ shortName: "h-cyl",
4282
+ description: "Direct access storage",
4283
+ aliases: ["das", "horizontal-cylinder"],
4284
+ handler: Pn
4285
+ },
4286
+ {
4287
+ semanticName: "Disk Storage",
4288
+ name: "Lined Cylinder",
4289
+ shortName: "lin-cyl",
4290
+ description: "Disk storage",
4291
+ aliases: ["disk", "lined-cylinder"],
4292
+ handler: St
4293
+ },
4294
+ {
4295
+ semanticName: "Display",
4296
+ name: "Curved Trapezoid",
4297
+ shortName: "curv-trap",
4298
+ description: "Represents a display",
4299
+ aliases: ["curved-trapezoid", "display"],
4300
+ handler: Re
4301
+ },
4302
+ {
4303
+ semanticName: "Divided Process",
4304
+ name: "Divided Rectangle",
4305
+ shortName: "div-rect",
4306
+ description: "Divided process shape",
4307
+ aliases: [
4308
+ "div-proc",
4309
+ "divided-rectangle",
4310
+ "divided-process"
4311
+ ],
4312
+ handler: Je
4313
+ },
4314
+ {
4315
+ semanticName: "Extract",
4316
+ name: "Triangle",
4317
+ shortName: "tri",
4318
+ description: "Extraction process",
4319
+ aliases: ["extract", "triangle"],
4320
+ handler: zn
4321
+ },
4322
+ {
4323
+ semanticName: "Internal Storage",
4324
+ name: "Window Pane",
4325
+ shortName: "win-pane",
4326
+ description: "Internal storage",
4327
+ aliases: ["internal-storage", "window-pane"],
4328
+ handler: Hn
4329
+ },
4330
+ {
4331
+ semanticName: "Junction",
4332
+ name: "Filled Circle",
4333
+ shortName: "f-circ",
4334
+ description: "Junction point",
4335
+ aliases: ["junction", "filled-circle"],
4336
+ handler: Ze
4337
+ },
4338
+ {
4339
+ semanticName: "Loop Limit",
4340
+ name: "Trapezoidal Pentagon",
4341
+ shortName: "notch-pent",
4342
+ description: "Loop limit step",
4343
+ aliases: ["loop-limit", "notched-pentagon"],
4344
+ handler: In
4345
+ },
4346
+ {
4347
+ semanticName: "Manual File",
4348
+ name: "Flipped Triangle",
4349
+ shortName: "flip-tri",
4350
+ description: "Manual file operation",
4351
+ aliases: ["manual-file", "flipped-triangle"],
4352
+ handler: et
4353
+ },
4354
+ {
4355
+ semanticName: "Manual Input",
4356
+ name: "Sloped Rectangle",
4357
+ shortName: "sl-rect",
4358
+ description: "Manual input step",
4359
+ aliases: ["manual-input", "sloped-rectangle"],
4360
+ handler: hn
4361
+ },
4362
+ {
4363
+ semanticName: "Multi-Document",
4364
+ name: "Stacked Document",
4365
+ shortName: "docs",
4366
+ description: "Multiple documents",
4367
+ aliases: [
4368
+ "documents",
4369
+ "st-doc",
4370
+ "stacked-document"
4371
+ ],
4372
+ handler: on
4373
+ },
4374
+ {
4375
+ semanticName: "Multi-Process",
4376
+ name: "Stacked Rectangle",
4377
+ shortName: "st-rect",
4378
+ description: "Multiple processes",
4379
+ aliases: [
4380
+ "procs",
4381
+ "processes",
4382
+ "stacked-rectangle"
4383
+ ],
4384
+ handler: an
4385
+ },
4386
+ {
4387
+ semanticName: "Stored Data",
4388
+ name: "Bow Tie Rectangle",
4389
+ shortName: "bow-rect",
4390
+ description: "Stored data",
4391
+ aliases: ["stored-data", "bow-tie-rectangle"],
4392
+ handler: de
4393
+ },
4394
+ {
4395
+ semanticName: "Summary",
4396
+ name: "Crossed Circle",
4397
+ shortName: "cross-circ",
4398
+ description: "Summary",
4399
+ aliases: ["summary", "crossed-circle"],
4400
+ handler: Pe
4401
+ },
4402
+ {
4403
+ semanticName: "Tagged Document",
4404
+ name: "Tagged Document",
4405
+ shortName: "tag-doc",
4406
+ description: "Tagged document",
4407
+ aliases: ["tag-doc", "tagged-document"],
4408
+ handler: Dn
4409
+ },
4410
+ {
4411
+ semanticName: "Tagged Process",
4412
+ name: "Tagged Rectangle",
4413
+ shortName: "tag-rect",
4414
+ description: "Tagged process",
4415
+ aliases: [
4416
+ "tagged-rectangle",
4417
+ "tag-proc",
4418
+ "tagged-process"
4419
+ ],
4420
+ handler: En
4421
+ },
4422
+ {
4423
+ semanticName: "Paper Tape",
4424
+ name: "Flag",
4425
+ shortName: "flag",
4426
+ description: "Paper tape",
4427
+ aliases: ["paper-tape"],
4428
+ handler: Vn
4429
+ },
4430
+ {
4431
+ semanticName: "Odd",
4432
+ name: "Odd",
4433
+ shortName: "odd",
4434
+ description: "Odd shape",
4435
+ internalAliases: ["rect_left_inv_arrow"],
4436
+ handler: un
4437
+ },
4438
+ {
4439
+ semanticName: "Lined Document",
4440
+ name: "Lined Document",
4441
+ shortName: "lin-doc",
4442
+ description: "Lined document",
4443
+ aliases: ["lined-document"],
4444
+ handler: Ct
4445
+ }
4446
+ ], ar = (/* @__PURE__ */ o(() => {
4447
+ let e = [...Object.entries({
4448
+ state: bn,
4449
+ choice: ke,
4450
+ note: sn,
4451
+ composite: je,
4452
+ rectWithTitle: dn,
4453
+ labelRect: pt,
4454
+ block_arrow: Te,
4455
+ collapsedGroup: ve,
4456
+ iconSquare: ut,
4457
+ iconCircle: ct,
4458
+ icon: st,
4459
+ iconRounded: lt,
4460
+ imageSquare: dt,
4461
+ anchor: ce,
4462
+ kanbanItem: $n,
4463
+ mindmapCircle: rr,
4464
+ defaultMindmapNode: nr,
4465
+ classBox: Xn,
4466
+ erBox: Gn,
4467
+ requirementBox: Zn,
4468
+ usecaseActor: Bt,
4469
+ usecaseActorHollow: Wt,
4470
+ usecaseActorAwesome: Ht,
4471
+ usecaseActorIcon: Yt,
4472
+ usecaseBusiness: Zt,
4473
+ usecaseEllipse: Xe,
4474
+ usecaseJsonTable: rn
4475
+ }), ...ir.flatMap((e) => [
4476
+ e.shortName,
4477
+ ..."aliases" in e ? e.aliases : [],
4478
+ ..."internalAliases" in e ? e.internalAliases : []
4479
+ ].map((t) => [t, e.handler]))];
4480
+ return Object.fromEntries(e);
4481
+ }, "generateShapeMap"))();
4482
+ function or(e) {
4483
+ return e in ar;
4484
+ }
4485
+ o(or, "isValidShape");
4486
+ //#endregion
4487
+ export { or as a, I as c, V as i, q as n, P as o, K as r, ar as s, se as t };