react-docs-ui 0.6.16 → 0.6.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/dist/{AIChatDialog-W60DtiEW.js → AIChatDialog-BnAX3dRn.js} +2 -2
  2. package/dist/{AISelectionTrigger-MaBGhxTE.js → AISelectionTrigger-SLyb8Vep.js} +2 -2
  3. package/dist/{AISettingsPanel-aiMnncnQ.js → AISettingsPanel-Bsd_wLP4.js} +3 -3
  4. package/dist/{DocsApp-CUrnKwOU.js → DocsApp-CNVM_Zcf.js} +3505 -3212
  5. package/dist/{GlobalContextMenu-DG6x5Y5w.js → GlobalContextMenu-BtVjQk0v.js} +1 -1
  6. package/dist/{MdxContent-CMB8ZbXo.js → MdxContent-D2l4Au7Z.js} +310 -306
  7. package/dist/{MdxContent.lazy-C4rcCv4v.js → MdxContent.lazy-BirC7wrH.js} +1 -1
  8. package/dist/{SearchDialog-tUSKKsxW.js → SearchDialog-DWVre6R9.js} +66 -56
  9. package/dist/{SearchRuntime-5fXpxDsi.js → SearchRuntime-D0rSMKV3.js} +6 -5
  10. package/dist/_basePickBy-3HEi44E5.js +166 -0
  11. package/dist/_baseUniq-CyOGXr0t.js +682 -0
  12. package/dist/arc-DULIiw5L.js +80 -0
  13. package/dist/architecture-PBZL5I3N-DT4oHaWT.js +3 -0
  14. package/dist/architectureDiagram-2XIMDMQ5-CqinFxzU.js +4045 -0
  15. package/dist/array-DHiPsILf.js +6 -0
  16. package/dist/blockDiagram-WCTKOSBZ-4JAhKeqm.js +3025 -0
  17. package/dist/c4Diagram-IC4MRINW-DtmtzsQQ.js +2964 -0
  18. package/dist/channel-BPONoOHQ.js +5 -0
  19. package/dist/chunk-4BX2VUAB-Bv5NGtUU.js +8 -0
  20. package/dist/chunk-55IACEB6-BXL-F-QI.js +8 -0
  21. package/dist/chunk-7E7YKBS2-CuTUVGrY.js +23 -0
  22. package/dist/chunk-7R4GIKGN-Qkaxl46X.js +2596 -0
  23. package/dist/chunk-C72U2L5F-42ScKBi2.js +23 -0
  24. package/dist/chunk-EGIJ26TM-D9jfybGA.js +23 -0
  25. package/dist/chunk-FMBD7UC4-DZXaweDk.js +5 -0
  26. package/dist/chunk-GEFDOKGD-OXBFFBXI.js +1121 -0
  27. package/dist/chunk-GLR3WWYH-BNwKwdNm.js +41 -0
  28. package/dist/chunk-HHEYEP7N-BQ3EJT5G.js +9 -0
  29. package/dist/chunk-JSJVCQXG-DNkHiMyV.js +60 -0
  30. package/dist/chunk-KX2RTZJC-DuTfSwwu.js +25 -0
  31. package/dist/chunk-KYZI473N-COpLSX52.js +3434 -0
  32. package/dist/chunk-L3YUKLVL-BdSnx12A.js +23 -0
  33. package/dist/chunk-MX3YWQON-CrwNXQjz.js +80 -0
  34. package/dist/chunk-NBPlniwU.js +23 -0
  35. package/dist/chunk-NQ4KR5QH-Y07nfCMJ.js +2002 -0
  36. package/dist/chunk-O4XLMI2P-CuexQiBs.js +511 -0
  37. package/dist/chunk-OZEHJAEY-D6vfkGpv.js +64 -0
  38. package/dist/chunk-PQ6SQG4A-6cI0SCcc.js +67 -0
  39. package/dist/chunk-PU5JKC2W-an2DzREj.js +1885 -0
  40. package/dist/chunk-QZHKN3VN-BKMQ36H3.js +15 -0
  41. package/dist/chunk-R5LLSJPH-DOyud7qN.js +35 -0
  42. package/dist/chunk-WL4C6EOR-y1gU9zpd.js +3194 -0
  43. package/dist/chunk-XIRO2GV7-BD1Cp5pB.js +30 -0
  44. package/dist/chunk-XPW4576I-DOBR2ORN.js +1146 -0
  45. package/dist/chunk-XZSTWKYB-BQ9uqNJe.js +15797 -0
  46. package/dist/chunk-YBOYWFTD-BT3l76Xm.js +32 -0
  47. package/dist/classDiagram-VBA2DB6C-AUxID939.js +29 -0
  48. package/dist/classDiagram-v2-RAHNMMFH-tupy2OPi.js +29 -0
  49. package/dist/clone-CRTZj7kp.js +8 -0
  50. package/dist/cose-bilkent-S5V4N54A-Bbd2d2j7.js +2250 -0
  51. package/dist/cytoscape.esm-CQKQOqRt.js +18100 -0
  52. package/dist/dagre-Cyr5_x2X.js +1483 -0
  53. package/dist/dagre-KLK3FWXG-Bjsq-TtB.js +294 -0
  54. package/dist/defaultLocale-P2nWjZJu.js +201 -0
  55. package/dist/diagram-E7M64L7V-CCTuI46e.js +527 -0
  56. package/dist/diagram-IFDJBPK2-DI_KTvRx.js +213 -0
  57. package/dist/diagram-P4PSJMXO-D3SeWDdU.js +133 -0
  58. package/dist/dist-CSS39H68.js +50 -0
  59. package/dist/docs-app.es.js +1 -1
  60. package/dist/erDiagram-INFDFZHY-Db_DAoTf.js +1666 -0
  61. package/dist/flowDiagram-PKNHOUZH-TqyNp9Dn.js +4161 -0
  62. package/dist/ganttDiagram-A5KZAMGK-DqNVbtHo.js +3072 -0
  63. package/dist/gitGraph-HDMCJU4V-DQudxfzL.js +3 -0
  64. package/dist/gitGraphDiagram-K3NZZRJ6-Cga9Wfgb.js +625 -0
  65. package/dist/graphlib-CexrUFs9.js +225 -0
  66. package/dist/info-3K5VOQVL-DiuN3kw6.js +3 -0
  67. package/dist/infoDiagram-LFFYTUFH-bvABxJph.js +19 -0
  68. package/dist/init-GWRygwCo.js +15 -0
  69. package/dist/isArrayLikeObject-CG2kGrxR.js +578 -0
  70. package/dist/isEmpty-C8iIdTg-.js +35 -0
  71. package/dist/ishikawaDiagram-PHBUUO56-DKGPu-hu.js +717 -0
  72. package/dist/journeyDiagram-4ABVD52K-DefcNau0.js +883 -0
  73. package/dist/kanban-definition-K7BYSVSG-BXvFQzdZ.js +971 -0
  74. package/dist/line-ChPoSgrf.js +34 -0
  75. package/dist/linear-BeQrMQNe.js +289 -0
  76. package/dist/math-CgS6d5p2.js +10 -0
  77. package/dist/{shiki-highlighter-BmQSSJpS.js → mdx-components-Bz45lgrV.js} +1387 -1288
  78. package/dist/mdx-components-TEc3uhbY.js +4 -0
  79. package/dist/mermaid-parser.core-CDTyVXPe.js +59 -0
  80. package/dist/mermaid.core-CHJrGTZ9.js +919 -0
  81. package/dist/mindmap-definition-YRQLILUH-CqsMcFhX.js +964 -0
  82. package/dist/ordinal-DUEC8Lr4.js +65 -0
  83. package/dist/packet-RMMSAZCW-ZLaHU0Ov.js +3 -0
  84. package/dist/path-CzRXOvk1.js +85 -0
  85. package/dist/pie-UPGHQEXC-COgIbE0j.js +3 -0
  86. package/dist/pieDiagram-SKSYHLDU-C8Y5Bc8d.js +165 -0
  87. package/dist/quadrantDiagram-337W2JSQ-DRWBX5cn.js +1974 -0
  88. package/dist/radar-KQ55EAFF-ABFVVcns.js +3 -0
  89. package/dist/react-docs-ui.css +1 -1
  90. package/dist/react-docs-ui.es.js +19 -19
  91. package/dist/requirementDiagram-Z7DCOOCP-EkyUnFq8.js +2201 -0
  92. package/dist/rough.esm-qTNNhHn7.js +1352 -0
  93. package/dist/sankeyDiagram-WA2Y5GQK-Cmas7IuZ.js +920 -0
  94. package/dist/sequenceDiagram-2WXFIKYE-B7TrFw3o.js +4109 -0
  95. package/dist/src-B8kKzJ6p.js +2146 -0
  96. package/dist/stateDiagram-RAJIS63D-DyqZyFdt.js +217 -0
  97. package/dist/stateDiagram-v2-FVOUBMTO-5UjWXgt6.js +27 -0
  98. package/dist/timeline-definition-YZTLITO2-qhoXPOhL.js +830 -0
  99. package/dist/treemap-KZPCXAKY-CRdRsoRo.js +3 -0
  100. package/dist/types/components/AnnouncementBar.d.ts +12 -0
  101. package/dist/types/components/AnnouncementBar.d.ts.map +1 -0
  102. package/dist/types/components/DocsLayout.d.ts +8 -2
  103. package/dist/types/components/DocsLayout.d.ts.map +1 -1
  104. package/dist/types/components/HeaderNav.d.ts +17 -1
  105. package/dist/types/components/HeaderNav.d.ts.map +1 -1
  106. package/dist/types/components/MdxContent.d.ts.map +1 -1
  107. package/dist/types/components/MobileSidebar.d.ts +2 -1
  108. package/dist/types/components/MobileSidebar.d.ts.map +1 -1
  109. package/dist/types/components/PageFeedback.d.ts +11 -0
  110. package/dist/types/components/PageFeedback.d.ts.map +1 -0
  111. package/dist/types/components/PageMetaActions.d.ts +15 -0
  112. package/dist/types/components/PageMetaActions.d.ts.map +1 -0
  113. package/dist/types/components/PageNavigation.d.ts +2 -1
  114. package/dist/types/components/PageNavigation.d.ts.map +1 -1
  115. package/dist/types/components/SearchLauncher.d.ts +2 -1
  116. package/dist/types/components/SearchLauncher.d.ts.map +1 -1
  117. package/dist/types/components/SidebarNav.d.ts +2 -1
  118. package/dist/types/components/SidebarNav.d.ts.map +1 -1
  119. package/dist/types/components/mdx-components/Mermaid.d.ts +6 -0
  120. package/dist/types/components/mdx-components/Mermaid.d.ts.map +1 -0
  121. package/dist/types/components/mdx-components/Tabs.d.ts +13 -0
  122. package/dist/types/components/mdx-components/Tabs.d.ts.map +1 -0
  123. package/dist/types/components/mdx-components/index.d.ts +2 -0
  124. package/dist/types/components/mdx-components/index.d.ts.map +1 -1
  125. package/dist/types/components/search/SearchProvider.d.ts +2 -1
  126. package/dist/types/components/search/SearchProvider.d.ts.map +1 -1
  127. package/dist/types/components/search/SearchRuntime.d.ts +2 -1
  128. package/dist/types/components/search/SearchRuntime.d.ts.map +1 -1
  129. package/dist/types/lib/component-scanner.d.ts.map +1 -1
  130. package/dist/types/lib/config.d.ts +42 -0
  131. package/dist/types/lib/config.d.ts.map +1 -1
  132. package/dist/types/lib/navigation.d.ts +1 -1
  133. package/dist/types/lib/navigation.d.ts.map +1 -1
  134. package/dist/types/lib/page-meta.d.ts +16 -0
  135. package/dist/types/lib/page-meta.d.ts.map +1 -0
  136. package/dist/types/lib/search/build/index-generator.d.ts.map +1 -1
  137. package/dist/types/lib/search/build/types.d.ts +1 -0
  138. package/dist/types/lib/search/build/types.d.ts.map +1 -1
  139. package/dist/types/lib/search/runtime/search-engine.d.ts.map +1 -1
  140. package/dist/types/lib/search/runtime/types.d.ts +1 -0
  141. package/dist/types/lib/search/runtime/types.d.ts.map +1 -1
  142. package/dist/types/lib/versioning.d.ts +6 -0
  143. package/dist/types/lib/versioning.d.ts.map +1 -0
  144. package/dist/vennDiagram-LZ73GAT5-DlUUn7LI.js +1858 -0
  145. package/dist/xychartDiagram-JWTSCODW-oT2IR7c0.js +2041 -0
  146. package/package.json +4 -1
  147. /package/dist/{AIProvider-C1_b1iKH.js → AIProvider-niZNPSGi.js} +0 -0
  148. /package/dist/{context-menu-CB7erSoV.js → context-menu-BIQsQup7.js} +0 -0
  149. /package/dist/{dialog-DQ6nkP0y.js → dialog-D8otbqQL.js} +0 -0
  150. /package/dist/{use-toast-d9VPBjMn.js → use-toast-DK69oadB.js} +0 -0
@@ -0,0 +1,3434 @@
1
+ import { i as e, l as t, n } from "./chunk-GEFDOKGD-OXBFFBXI.js";
2
+ import { g as r, h as i, p as a } from "./src-B8kKzJ6p.js";
3
+ import { L as o, R as s, b as c, h as l, j as u, k as d, w as f, y as p } from "./chunk-7R4GIKGN-Qkaxl46X.js";
4
+ import { n as m, r as h } from "./chunk-PU5JKC2W-an2DzREj.js";
5
+ import { n as g, t as _ } from "./chunk-YBOYWFTD-BT3l76Xm.js";
6
+ import { a as v, i as y, r as b, t as x } from "./chunk-PQ6SQG4A-6cI0SCcc.js";
7
+ import { t as S } from "./rough.esm-qTNNhHn7.js";
8
+ //#region node_modules/.pnpm/mermaid@11.13.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-KYZI473N.mjs
9
+ var C = /* @__PURE__ */ i(async (n, r, i) => {
10
+ let s, u = r.useHtmlLabels || l(c()?.htmlLabels);
11
+ s = i || "node default";
12
+ let d = n.insert("g").attr("class", s).attr("id", r.domId || r.id), f = d.insert("g").attr("class", "label").attr("style", t(r.labelStyle)), p;
13
+ p = r.label === void 0 ? "" : typeof r.label == "string" ? r.label : r.label[0];
14
+ let h = !!r.icon || !!r.img, g = r.labelType === "markdown", v = await m(f, o(e(p), c()), {
15
+ useHtmlLabels: u,
16
+ width: r.width || c().flowchart?.wrappingWidth,
17
+ cssClasses: g ? "markdown-node-label" : void 0,
18
+ style: r.labelStyle,
19
+ addSvgBackground: h,
20
+ markdown: g
21
+ }, c()), y = v.getBBox(), b = (r?.padding ?? 0) / 2;
22
+ if (u) {
23
+ let e = v.children[0], t = a(v);
24
+ await _(e, p), y = e.getBoundingClientRect(), t.attr("width", y.width), t.attr("height", y.height);
25
+ }
26
+ return u ? f.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")") : f.attr("transform", "translate(0, " + -y.height / 2 + ")"), r.centerLabel && f.attr("transform", "translate(" + -y.width / 2 + ", " + -y.height / 2 + ")"), f.insert("rect", ":first-child"), {
27
+ shapeSvg: d,
28
+ bbox: y,
29
+ halfPadding: b,
30
+ label: f
31
+ };
32
+ }, "labelHelper"), w = /* @__PURE__ */ i(async (t, n, r) => {
33
+ let i = r.useHtmlLabels ?? f(c()), s = t.insert("g").attr("class", "label").attr("style", r.labelStyle || ""), l = await m(s, o(e(n), c()), {
34
+ useHtmlLabels: i,
35
+ width: r.width || c()?.flowchart?.wrappingWidth,
36
+ style: r.labelStyle,
37
+ addSvgBackground: !!r.icon || !!r.img
38
+ }), u = l.getBBox(), d = r.padding / 2;
39
+ if (f(c())) {
40
+ let e = l.children[0], t = a(l);
41
+ u = e.getBoundingClientRect(), t.attr("width", u.width), t.attr("height", u.height);
42
+ }
43
+ return i ? s.attr("transform", "translate(" + -u.width / 2 + ", " + -u.height / 2 + ")") : s.attr("transform", "translate(0, " + -u.height / 2 + ")"), r.centerLabel && s.attr("transform", "translate(" + -u.width / 2 + ", " + -u.height / 2 + ")"), s.insert("rect", ":first-child"), {
44
+ shapeSvg: t,
45
+ bbox: u,
46
+ halfPadding: d,
47
+ label: s
48
+ };
49
+ }, "insertLabel"), T = /* @__PURE__ */ i((e, t) => {
50
+ let n = t.node().getBBox();
51
+ e.width = n.width, e.height = n.height;
52
+ }, "updateNodeBounds"), E = /* @__PURE__ */ i((e, t) => (e.look === "handDrawn" ? "rough-node" : "node") + " " + e.cssClasses + " " + (t || ""), "getNodeClasses");
53
+ function D(e) {
54
+ let t = e.map((e, t) => `${t === 0 ? "M" : "L"}${e.x},${e.y}`);
55
+ return t.push("Z"), t.join(" ");
56
+ }
57
+ i(D, "createPathFromPoints");
58
+ function O(e, t, n, r, i, a) {
59
+ let o = [], s = n - e, c = r - t, l = s / a, u = 2 * Math.PI / l, d = t + c / 2;
60
+ for (let t = 0; t <= 50; t++) {
61
+ let n = e + t / 50 * s, r = d + i * Math.sin(u * (n - e));
62
+ o.push({
63
+ x: n,
64
+ y: r
65
+ });
66
+ }
67
+ return o;
68
+ }
69
+ i(O, "generateFullSineWavePoints");
70
+ function k(e, t, n, r, i, a) {
71
+ let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
72
+ for (let i = 0; i < r; i++) {
73
+ let r = s + i * c, a = e + n * Math.cos(r), l = t + n * Math.sin(r);
74
+ o.push({
75
+ x: -a,
76
+ y: -l
77
+ });
78
+ }
79
+ return o;
80
+ }
81
+ i(k, "generateCirclePoints");
82
+ var A = /* @__PURE__ */ i((e, t) => {
83
+ 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;
84
+ 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), {
85
+ x: n + c,
86
+ y: r + l
87
+ };
88
+ }, "intersectRect"), j = /* @__PURE__ */ i(async (e, t, n, r = !1, i = !1) => {
89
+ let a = t || "";
90
+ typeof a == "object" && (a = a[0]);
91
+ let o = c(), s = f(o);
92
+ return await m(e, a, {
93
+ style: n,
94
+ isTitle: r,
95
+ useHtmlLabels: s,
96
+ markdown: !1,
97
+ isNode: i,
98
+ width: Infinity
99
+ }, o);
100
+ }, "createLabel"), M = /* @__PURE__ */ i((e, t, n, r, i) => [
101
+ "M",
102
+ e + i,
103
+ t,
104
+ "H",
105
+ e + n - i,
106
+ "A",
107
+ i,
108
+ i,
109
+ 0,
110
+ 0,
111
+ 1,
112
+ e + n,
113
+ t + i,
114
+ "V",
115
+ t + r - i,
116
+ "A",
117
+ i,
118
+ i,
119
+ 0,
120
+ 0,
121
+ 1,
122
+ e + n - i,
123
+ t + r,
124
+ "H",
125
+ e + i,
126
+ "A",
127
+ i,
128
+ i,
129
+ 0,
130
+ 0,
131
+ 1,
132
+ e,
133
+ t + r - i,
134
+ "V",
135
+ t + i,
136
+ "A",
137
+ i,
138
+ i,
139
+ 0,
140
+ 0,
141
+ 1,
142
+ e + i,
143
+ t,
144
+ "Z"
145
+ ].join(" "), "createRoundedRectPathD"), N = /* @__PURE__ */ i(async (e, t) => {
146
+ r.info("Creating subgraph rect for ", t.id, t);
147
+ let n = c(), { themeVariables: i, handDrawnSeed: o } = n, { clusterBkg: s, clusterBorder: l } = i, { labelStyles: u, nodeStyles: d, borderStyles: p, backgroundStyles: h } = y(t), _ = e.insert("g").attr("class", "cluster " + t.cssClasses).attr("id", t.id).attr("data-look", t.look), b = f(n), x = _.insert("g").attr("class", "cluster-label "), C;
148
+ C = t.labelType === "markdown" ? await m(x, t.label, {
149
+ style: t.labelStyle,
150
+ useHtmlLabels: b,
151
+ isNode: !0,
152
+ width: t.width
153
+ }) : await j(x, t.label, t.labelStyle || "", !1, !0);
154
+ let w = C.getBBox();
155
+ if (f(n)) {
156
+ let e = C.children[0], t = a(C);
157
+ w = e.getBoundingClientRect(), t.attr("width", w.width), t.attr("height", w.height);
158
+ }
159
+ let T = t.width <= w.width + t.padding ? w.width + t.padding : t.width;
160
+ t.width <= w.width + t.padding ? t.diff = (T - t.width) / 2 - t.padding : t.diff = -t.padding;
161
+ let E = t.height, D = t.x - T / 2, O = t.y - E / 2;
162
+ r.trace("Data ", t, JSON.stringify(t));
163
+ let k;
164
+ if (t.look === "handDrawn") {
165
+ let e = S.svg(_), n = v(t, {
166
+ roughness: .7,
167
+ fill: s,
168
+ stroke: l,
169
+ fillWeight: 3,
170
+ seed: o
171
+ }), i = e.path(M(D, O, T, E, 0), n);
172
+ k = _.insert(() => (r.debug("Rough node insert CXC", i), i), ":first-child"), k.select("path:nth-child(2)").attr("style", p.join(";")), k.select("path").attr("style", h.join(";").replace("fill", "stroke"));
173
+ } else k = _.insert("rect", ":first-child"), k.attr("style", d).attr("rx", t.rx).attr("ry", t.ry).attr("x", D).attr("y", O).attr("width", T).attr("height", E);
174
+ let { subGraphTitleTopMargin: N } = g(n);
175
+ if (x.attr("transform", `translate(${t.x - w.width / 2}, ${t.y - t.height / 2 + N})`), u) {
176
+ let e = x.select("span");
177
+ e && e.attr("style", u);
178
+ }
179
+ let P = k.node().getBBox();
180
+ return t.offsetX = 0, t.width = P.width, t.height = P.height, t.offsetY = w.height - t.padding / 2, t.intersect = function(e) {
181
+ return A(t, e);
182
+ }, {
183
+ cluster: _,
184
+ labelBBox: w
185
+ };
186
+ }, "rect"), P = {
187
+ rect: N,
188
+ squareRect: N,
189
+ roundedWithTitle: /* @__PURE__ */ i(async (e, t) => {
190
+ let n = c(), { themeVariables: r, handDrawnSeed: i } = n, { altBackground: o, compositeBackground: s, compositeTitleBackground: l, nodeBorder: u } = r, d = e.insert("g").attr("class", t.cssClasses).attr("id", t.id).attr("data-id", t.id).attr("data-look", t.look), p = d.insert("g", ":first-child"), m = d.insert("g").attr("class", "cluster-label"), h = d.append("rect"), g = await j(m, t.label, t.labelStyle, void 0, !0), _ = g.getBBox();
191
+ if (f(n)) {
192
+ let e = g.children[0], t = a(g);
193
+ _ = e.getBoundingClientRect(), t.attr("width", _.width), t.attr("height", _.height);
194
+ }
195
+ let v = 0 * t.padding, y = v / 2, b = (t.width <= _.width + t.padding ? _.width + t.padding : t.width) + v;
196
+ t.width <= _.width + t.padding ? t.diff = (b - t.width) / 2 - t.padding : t.diff = -t.padding;
197
+ let x = t.height + v, C = t.height + v - _.height - 6, w = t.x - b / 2, T = t.y - x / 2;
198
+ t.width = b;
199
+ let E = t.y - t.height / 2 - y + _.height + 2, D;
200
+ if (t.look === "handDrawn") {
201
+ let e = t.cssClasses.includes("statediagram-cluster-alt"), n = S.svg(d), r = t.rx || t.ry ? n.path(M(w, T, b, x, 10), {
202
+ roughness: .7,
203
+ fill: l,
204
+ fillStyle: "solid",
205
+ stroke: u,
206
+ seed: i
207
+ }) : n.rectangle(w, T, b, x, { seed: i });
208
+ D = d.insert(() => r, ":first-child");
209
+ let a = n.rectangle(w, E, b, C, {
210
+ fill: e ? o : s,
211
+ fillStyle: e ? "hachure" : "solid",
212
+ stroke: u,
213
+ seed: i
214
+ });
215
+ D = d.insert(() => r, ":first-child"), h = d.insert(() => a);
216
+ } else D = p.insert("rect", ":first-child"), D.attr("class", "outer").attr("x", w).attr("y", T).attr("width", b).attr("height", x).attr("data-look", t.look), h.attr("class", "inner").attr("x", w).attr("y", E).attr("width", b).attr("height", C);
217
+ return m.attr("transform", `translate(${t.x - _.width / 2}, ${T + 1 - (f(n) ? 0 : 3)})`), t.height = D.node().getBBox().height, t.offsetX = 0, t.offsetY = _.height - t.padding / 2, t.labelBBox = _, t.intersect = function(e) {
218
+ return A(t, e);
219
+ }, {
220
+ cluster: d,
221
+ labelBBox: _
222
+ };
223
+ }, "roundedWithTitle"),
224
+ noteGroup: /* @__PURE__ */ i((e, t) => {
225
+ let n = e.insert("g").attr("class", "note-cluster").attr("id", t.id), r = n.insert("rect", ":first-child"), i = 0 * t.padding, a = i / 2;
226
+ r.attr("rx", t.rx).attr("ry", t.ry).attr("x", t.x - t.width / 2 - a).attr("y", t.y - t.height / 2 - a).attr("width", t.width + i).attr("height", t.height + i).attr("fill", "none");
227
+ let o = r.node().getBBox();
228
+ return t.width = o.width, t.height = o.height, t.intersect = function(e) {
229
+ return A(t, e);
230
+ }, {
231
+ cluster: n,
232
+ labelBBox: {
233
+ width: 0,
234
+ height: 0
235
+ }
236
+ };
237
+ }, "noteGroup"),
238
+ divider: /* @__PURE__ */ i((e, t) => {
239
+ let { themeVariables: n, handDrawnSeed: r } = c(), { nodeBorder: i } = n, a = e.insert("g").attr("class", t.cssClasses).attr("id", t.id).attr("data-look", t.look), o = a.insert("g", ":first-child"), s = 0 * t.padding, l = t.width + s;
240
+ t.diff = -t.padding;
241
+ let u = t.height + s, d = t.x - l / 2, f = t.y - u / 2;
242
+ t.width = l;
243
+ let p;
244
+ if (t.look === "handDrawn") {
245
+ let e = S.svg(a).rectangle(d, f, l, u, {
246
+ fill: "lightgrey",
247
+ roughness: .5,
248
+ strokeLineDash: [5],
249
+ stroke: i,
250
+ seed: r
251
+ });
252
+ p = a.insert(() => e, ":first-child");
253
+ } else p = o.insert("rect", ":first-child"), p.attr("class", "divider").attr("x", d).attr("y", f).attr("width", l).attr("height", u).attr("data-look", t.look);
254
+ return t.height = p.node().getBBox().height, t.offsetX = 0, t.offsetY = 0, t.intersect = function(e) {
255
+ return A(t, e);
256
+ }, {
257
+ cluster: a,
258
+ labelBBox: {}
259
+ };
260
+ }, "divider"),
261
+ kanbanSection: /* @__PURE__ */ i(async (e, t) => {
262
+ r.info("Creating subgraph rect for ", t.id, t);
263
+ let n = c(), { themeVariables: i, handDrawnSeed: o } = n, { clusterBkg: s, clusterBorder: l } = i, { labelStyles: u, nodeStyles: d, borderStyles: p, backgroundStyles: h } = y(t), _ = e.insert("g").attr("class", "cluster " + t.cssClasses).attr("id", t.id).attr("data-look", t.look), b = f(n), x = _.insert("g").attr("class", "cluster-label "), C = await m(x, t.label, {
264
+ style: t.labelStyle,
265
+ useHtmlLabels: b,
266
+ isNode: !0,
267
+ width: t.width
268
+ }), w = C.getBBox();
269
+ if (f(n)) {
270
+ let e = C.children[0], t = a(C);
271
+ w = e.getBoundingClientRect(), t.attr("width", w.width), t.attr("height", w.height);
272
+ }
273
+ let T = t.width <= w.width + t.padding ? w.width + t.padding : t.width;
274
+ t.width <= w.width + t.padding ? t.diff = (T - t.width) / 2 - t.padding : t.diff = -t.padding;
275
+ let E = t.height, D = t.x - T / 2, O = t.y - E / 2;
276
+ r.trace("Data ", t, JSON.stringify(t));
277
+ let k;
278
+ if (t.look === "handDrawn") {
279
+ let e = S.svg(_), n = v(t, {
280
+ roughness: .7,
281
+ fill: s,
282
+ stroke: l,
283
+ fillWeight: 4,
284
+ seed: o
285
+ }), i = e.path(M(D, O, T, E, t.rx), n);
286
+ k = _.insert(() => (r.debug("Rough node insert CXC", i), i), ":first-child"), k.select("path:nth-child(2)").attr("style", p.join(";")), k.select("path").attr("style", h.join(";").replace("fill", "stroke"));
287
+ } else k = _.insert("rect", ":first-child"), k.attr("style", d).attr("rx", t.rx).attr("ry", t.ry).attr("x", D).attr("y", O).attr("width", T).attr("height", E);
288
+ let { subGraphTitleTopMargin: j } = g(n);
289
+ if (x.attr("transform", `translate(${t.x - w.width / 2}, ${t.y - t.height / 2 + j})`), u) {
290
+ let e = x.select("span");
291
+ e && e.attr("style", u);
292
+ }
293
+ let N = k.node().getBBox();
294
+ return t.offsetX = 0, t.width = N.width, t.height = N.height, t.offsetY = w.height - t.padding / 2, t.intersect = function(e) {
295
+ return A(t, e);
296
+ }, {
297
+ cluster: _,
298
+ labelBBox: w
299
+ };
300
+ }, "kanbanSection")
301
+ }, F = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ i(async (e, t) => {
302
+ let n = await P[t.shape || "rect"](e, t);
303
+ return F.set(t.id, n), n;
304
+ }, "insertCluster"), L = /* @__PURE__ */ i(() => {
305
+ F = /* @__PURE__ */ new Map();
306
+ }, "clear");
307
+ function R(e, t) {
308
+ return e.intersect(t);
309
+ }
310
+ i(R, "intersectNode");
311
+ var z = R;
312
+ function B(e, t, n, r) {
313
+ 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);
314
+ r.x < i && (l = -l);
315
+ var u = Math.abs(t * n * s / c);
316
+ return r.y < a && (u = -u), {
317
+ x: i + l,
318
+ y: a + u
319
+ };
320
+ }
321
+ i(B, "intersectEllipse");
322
+ var V = B;
323
+ function ee(e, t, n) {
324
+ return V(e, t, t, n);
325
+ }
326
+ i(ee, "intersectCircle");
327
+ var te = ee;
328
+ function ne(e, t, n, r) {
329
+ {
330
+ 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;
331
+ if (s !== 0 && c !== 0 && H(s, c)) return;
332
+ 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;
333
+ if (Math.abs(p) < l && Math.abs(m) < l && H(p, m)) return;
334
+ let h = i * d - u * a;
335
+ if (h === 0) return;
336
+ let g = Math.abs(h / 2), _ = a * f - d * o, v = _ < 0 ? (_ - g) / h : (_ + g) / h;
337
+ return _ = u * o - i * f, {
338
+ x: v,
339
+ y: _ < 0 ? (_ - g) / h : (_ + g) / h
340
+ };
341
+ }
342
+ }
343
+ i(ne, "intersectLine");
344
+ function H(e, t) {
345
+ return e * t > 0;
346
+ }
347
+ i(H, "sameSign");
348
+ var U = ne;
349
+ function re(e, t, n) {
350
+ let r = e.x, i = e.y, a = [], o = Infinity, s = Infinity;
351
+ typeof t.forEach == "function" ? t.forEach(function(e) {
352
+ o = Math.min(o, e.x), s = Math.min(s, e.y);
353
+ }) : (o = Math.min(o, t.x), s = Math.min(s, t.y));
354
+ let c = r - e.width / 2 - o, l = i - e.height / 2 - s;
355
+ for (let r = 0; r < t.length; r++) {
356
+ let i = t[r], o = t[r < t.length - 1 ? r + 1 : 0], s = U(e, n, {
357
+ x: c + i.x,
358
+ y: l + i.y
359
+ }, {
360
+ x: c + o.x,
361
+ y: l + o.y
362
+ });
363
+ s && a.push(s);
364
+ }
365
+ return a.length ? (a.length > 1 && a.sort(function(e, t) {
366
+ 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);
367
+ return a < c ? -1 : a === c ? 0 : 1;
368
+ }), a[0]) : e;
369
+ }
370
+ i(re, "intersectPolygon");
371
+ var W = {
372
+ node: z,
373
+ circle: te,
374
+ ellipse: V,
375
+ polygon: re,
376
+ rect: A
377
+ };
378
+ function ie(e, n) {
379
+ let { labelStyles: i } = y(n);
380
+ n.labelStyle = i;
381
+ let a = E(n), o = a;
382
+ a || (o = "anchor");
383
+ let s = e.insert("g").attr("class", o).attr("id", n.domId || n.id), { cssStyles: c } = n, l = S.svg(s), u = v(n, {
384
+ fill: "black",
385
+ stroke: "none",
386
+ fillStyle: "solid"
387
+ });
388
+ n.look !== "handDrawn" && (u.roughness = 0);
389
+ let d = l.circle(0, 0, 2, u), f = s.insert(() => d, ":first-child");
390
+ return f.attr("class", "anchor").attr("style", t(c)), T(n, f), n.intersect = function(e) {
391
+ return r.info("Circle intersect", n, 1, e), W.circle(n, 1, e);
392
+ }, s;
393
+ }
394
+ i(ie, "anchor");
395
+ function ae(e, t, n, r, i, a, o) {
396
+ 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);
397
+ if (m > 1) throw Error("The given radii are too small to create an arc between the points.");
398
+ 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;
399
+ o && y < 0 && (y += 2 * Math.PI), !o && y > 0 && (y -= 2 * Math.PI);
400
+ let b = [];
401
+ for (let e = 0; e < 20; e++) {
402
+ let t = v + e / 19 * y, n = g + i * Math.cos(t), r = _ + a * Math.sin(t);
403
+ b.push({
404
+ x: n,
405
+ y: r
406
+ });
407
+ }
408
+ return b;
409
+ }
410
+ i(ae, "generateArcPoints");
411
+ async function oe(e, t) {
412
+ let { labelStyles: n, nodeStyles: r } = y(t);
413
+ t.labelStyle = n;
414
+ let { shapeSvg: i, bbox: a } = await C(e, t, E(t)), o = a.width + t.padding + 20, s = a.height + t.padding, c = s / 2, l = c / (2.5 + s / 50), { cssStyles: u } = t, d = [
415
+ {
416
+ x: o / 2,
417
+ y: -s / 2
418
+ },
419
+ {
420
+ x: -o / 2,
421
+ y: -s / 2
422
+ },
423
+ ...ae(-o / 2, -s / 2, -o / 2, s / 2, l, c, !1),
424
+ {
425
+ x: o / 2,
426
+ y: s / 2
427
+ },
428
+ ...ae(o / 2, s / 2, o / 2, -s / 2, l, c, !0)
429
+ ], f = S.svg(i), p = v(t, {});
430
+ t.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
431
+ let m = D(d), h = f.path(m, p), g = i.insert(() => h, ":first-child");
432
+ return g.attr("class", "basic label-container"), u && t.look !== "handDrawn" && g.selectAll("path").attr("style", u), r && t.look !== "handDrawn" && g.selectAll("path").attr("style", r), g.attr("transform", `translate(${l / 2}, 0)`), T(t, g), t.intersect = function(e) {
433
+ return W.polygon(t, d, e);
434
+ }, i;
435
+ }
436
+ i(oe, "bowTieRect");
437
+ function G(e, t, n, r) {
438
+ return e.insert("polygon", ":first-child").attr("points", r.map(function(e) {
439
+ return e.x + "," + e.y;
440
+ }).join(" ")).attr("class", "label-container").attr("transform", "translate(" + -t / 2 + "," + n / 2 + ")");
441
+ }
442
+ i(G, "insertPolygonShape");
443
+ async function se(e, t) {
444
+ let { labelStyles: n, nodeStyles: r } = y(t);
445
+ t.labelStyle = n;
446
+ let { shapeSvg: i, bbox: a } = await C(e, t, E(t)), o = a.height + t.padding, s = a.width + t.padding + 12, c = s, l = -o, u = [
447
+ {
448
+ x: 12,
449
+ y: l
450
+ },
451
+ {
452
+ x: c,
453
+ y: l
454
+ },
455
+ {
456
+ x: c,
457
+ y: 0
458
+ },
459
+ {
460
+ x: 0,
461
+ y: 0
462
+ },
463
+ {
464
+ x: 0,
465
+ y: l + 12
466
+ },
467
+ {
468
+ x: 12,
469
+ y: l
470
+ }
471
+ ], d, { cssStyles: f } = t;
472
+ if (t.look === "handDrawn") {
473
+ let e = S.svg(i), n = v(t, {}), r = D(u), a = e.path(r, n);
474
+ d = i.insert(() => a, ":first-child").attr("transform", `translate(${-s / 2}, ${o / 2})`), f && d.attr("style", f);
475
+ } else d = G(i, s, o, u);
476
+ return r && d.attr("style", r), T(t, d), t.intersect = function(e) {
477
+ return W.polygon(t, u, e);
478
+ }, i;
479
+ }
480
+ i(se, "card");
481
+ function ce(e, t) {
482
+ let { nodeStyles: n } = y(t);
483
+ t.label = "";
484
+ let r = e.insert("g").attr("class", E(t)).attr("id", t.domId ?? t.id), { cssStyles: i } = t, a = Math.max(28, t.width ?? 0), o = [
485
+ {
486
+ x: 0,
487
+ y: a / 2
488
+ },
489
+ {
490
+ x: a / 2,
491
+ y: 0
492
+ },
493
+ {
494
+ x: 0,
495
+ y: -a / 2
496
+ },
497
+ {
498
+ x: -a / 2,
499
+ y: 0
500
+ }
501
+ ], s = S.svg(r), c = v(t, {});
502
+ t.look !== "handDrawn" && (c.roughness = 0, c.fillStyle = "solid");
503
+ let l = D(o), u = s.path(l, c), d = r.insert(() => u, ":first-child");
504
+ 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) {
505
+ return W.polygon(t, o, e);
506
+ }, r;
507
+ }
508
+ i(ce, "choice");
509
+ async function le(e, n, i) {
510
+ let { labelStyles: a, nodeStyles: o } = y(n);
511
+ n.labelStyle = a;
512
+ let { shapeSvg: s, bbox: c, halfPadding: l } = await C(e, n, E(n)), u = i?.padding ?? l, d = c.width / 2 + u, f, { cssStyles: p } = n;
513
+ if (n.look === "handDrawn") {
514
+ let e = S.svg(s), r = v(n, {}), i = e.circle(0, 0, d * 2, r);
515
+ f = s.insert(() => i, ":first-child"), f.attr("class", "basic label-container").attr("style", t(p));
516
+ } else f = s.insert("circle", ":first-child").attr("class", "basic label-container").attr("style", o).attr("r", d).attr("cx", 0).attr("cy", 0);
517
+ return T(n, f), n.calcIntersect = function(e, t) {
518
+ let n = e.width / 2;
519
+ return W.circle(e, n, t);
520
+ }, n.intersect = function(e) {
521
+ return r.info("Circle intersect", n, d, e), W.circle(n, d, e);
522
+ }, s;
523
+ }
524
+ i(le, "circle");
525
+ function ue(e) {
526
+ let t = Math.cos(Math.PI / 4), n = Math.sin(Math.PI / 4), r = e * 2, i = {
527
+ x: r / 2 * t,
528
+ y: r / 2 * n
529
+ }, a = {
530
+ x: -(r / 2) * t,
531
+ y: r / 2 * n
532
+ }, o = {
533
+ x: -(r / 2) * t,
534
+ y: -(r / 2) * n
535
+ }, s = {
536
+ x: r / 2 * t,
537
+ y: -(r / 2) * n
538
+ };
539
+ return `M ${a.x},${a.y} L ${s.x},${s.y}
540
+ M ${i.x},${i.y} L ${o.x},${o.y}`;
541
+ }
542
+ i(ue, "createLine");
543
+ function de(e, t) {
544
+ let { labelStyles: n, nodeStyles: i } = y(t);
545
+ t.labelStyle = n, t.label = "";
546
+ let a = e.insert("g").attr("class", E(t)).attr("id", t.domId ?? t.id), o = Math.max(30, t?.width ?? 0), { cssStyles: s } = t, c = S.svg(a), l = v(t, {});
547
+ t.look !== "handDrawn" && (l.roughness = 0, l.fillStyle = "solid");
548
+ let u = c.circle(0, 0, o * 2, l), d = ue(o), f = c.path(d, l), p = a.insert(() => u, ":first-child");
549
+ return p.insert(() => f), s && t.look !== "handDrawn" && p.selectAll("path").attr("style", s), i && t.look !== "handDrawn" && p.selectAll("path").attr("style", i), T(t, p), t.intersect = function(e) {
550
+ return r.info("crossedCircle intersect", t, {
551
+ radius: o,
552
+ point: e
553
+ }), W.circle(t, o, e);
554
+ }, a;
555
+ }
556
+ i(de, "crossedCircle");
557
+ function K(e, t, n, r = 100, i = 0, a = 180) {
558
+ let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
559
+ for (let i = 0; i < r; i++) {
560
+ let r = s + i * c, a = e + n * Math.cos(r), l = t + n * Math.sin(r);
561
+ o.push({
562
+ x: -a,
563
+ y: -l
564
+ });
565
+ }
566
+ return o;
567
+ }
568
+ i(K, "generateCirclePoints");
569
+ async function fe(e, t) {
570
+ let { labelStyles: n, nodeStyles: r } = y(t);
571
+ t.labelStyle = n;
572
+ let { shapeSvg: i, bbox: a, label: o } = await C(e, t, E(t)), s = a.width + (t.padding ?? 0), c = a.height + (t.padding ?? 0), l = Math.max(5, c * .1), { cssStyles: u } = t, d = [
573
+ ...K(s / 2, -c / 2, l, 30, -90, 0),
574
+ {
575
+ x: -s / 2 - l,
576
+ y: l
577
+ },
578
+ ...K(s / 2 + l * 2, -l, l, 20, -180, -270),
579
+ ...K(s / 2 + l * 2, l, l, 20, -90, -180),
580
+ {
581
+ x: -s / 2 - l,
582
+ y: -c / 2
583
+ },
584
+ ...K(s / 2, c / 2, l, 20, 0, 90)
585
+ ], f = [
586
+ {
587
+ x: s / 2,
588
+ y: -c / 2 - l
589
+ },
590
+ {
591
+ x: -s / 2,
592
+ y: -c / 2 - l
593
+ },
594
+ ...K(s / 2, -c / 2, l, 20, -90, 0),
595
+ {
596
+ x: -s / 2 - l,
597
+ y: -l
598
+ },
599
+ ...K(s / 2 + s * .1, -l, l, 20, -180, -270),
600
+ ...K(s / 2 + s * .1, l, l, 20, -90, -180),
601
+ {
602
+ x: -s / 2 - l,
603
+ y: c / 2
604
+ },
605
+ ...K(s / 2, c / 2, l, 20, 0, 90),
606
+ {
607
+ x: -s / 2,
608
+ y: c / 2 + l
609
+ },
610
+ {
611
+ x: s / 2,
612
+ y: c / 2 + l
613
+ }
614
+ ], p = S.svg(i), m = v(t, { fill: "none" });
615
+ t.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
616
+ let h = D(d).replace("Z", ""), g = p.path(h, m), _ = D(f), b = p.path(_, { ...m }), x = i.insert("g", ":first-child");
617
+ return x.insert(() => b, ":first-child").attr("stroke-opacity", 0), x.insert(() => g, ":first-child"), x.attr("class", "text"), u && t.look !== "handDrawn" && x.selectAll("path").attr("style", u), r && t.look !== "handDrawn" && x.selectAll("path").attr("style", r), x.attr("transform", `translate(${l}, 0)`), o.attr("transform", `translate(${-s / 2 + l - (a.x - (a.left ?? 0))},${-c / 2 + (t.padding ?? 0) / 2 - (a.y - (a.top ?? 0))})`), T(t, x), t.intersect = function(e) {
618
+ return W.polygon(t, f, e);
619
+ }, i;
620
+ }
621
+ i(fe, "curlyBraceLeft");
622
+ function q(e, t, n, r = 100, i = 0, a = 180) {
623
+ let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
624
+ for (let i = 0; i < r; i++) {
625
+ let r = s + i * c, a = e + n * Math.cos(r), l = t + n * Math.sin(r);
626
+ o.push({
627
+ x: a,
628
+ y: l
629
+ });
630
+ }
631
+ return o;
632
+ }
633
+ i(q, "generateCirclePoints");
634
+ async function pe(e, t) {
635
+ let { labelStyles: n, nodeStyles: r } = y(t);
636
+ t.labelStyle = n;
637
+ let { shapeSvg: i, bbox: a, label: o } = await C(e, t, E(t)), s = a.width + (t.padding ?? 0), c = a.height + (t.padding ?? 0), l = Math.max(5, c * .1), { cssStyles: u } = t, d = [
638
+ ...q(s / 2, -c / 2, l, 20, -90, 0),
639
+ {
640
+ x: s / 2 + l,
641
+ y: -l
642
+ },
643
+ ...q(s / 2 + l * 2, -l, l, 20, -180, -270),
644
+ ...q(s / 2 + l * 2, l, l, 20, -90, -180),
645
+ {
646
+ x: s / 2 + l,
647
+ y: c / 2
648
+ },
649
+ ...q(s / 2, c / 2, l, 20, 0, 90)
650
+ ], f = [
651
+ {
652
+ x: -s / 2,
653
+ y: -c / 2 - l
654
+ },
655
+ {
656
+ x: s / 2,
657
+ y: -c / 2 - l
658
+ },
659
+ ...q(s / 2, -c / 2, l, 20, -90, 0),
660
+ {
661
+ x: s / 2 + l,
662
+ y: -l
663
+ },
664
+ ...q(s / 2 + l * 2, -l, l, 20, -180, -270),
665
+ ...q(s / 2 + l * 2, l, l, 20, -90, -180),
666
+ {
667
+ x: s / 2 + l,
668
+ y: c / 2
669
+ },
670
+ ...q(s / 2, c / 2, l, 20, 0, 90),
671
+ {
672
+ x: s / 2,
673
+ y: c / 2 + l
674
+ },
675
+ {
676
+ x: -s / 2,
677
+ y: c / 2 + l
678
+ }
679
+ ], p = S.svg(i), m = v(t, { fill: "none" });
680
+ t.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
681
+ let h = D(d).replace("Z", ""), g = p.path(h, m), _ = D(f), b = p.path(_, { ...m }), x = i.insert("g", ":first-child");
682
+ return x.insert(() => b, ":first-child").attr("stroke-opacity", 0), x.insert(() => g, ":first-child"), x.attr("class", "text"), u && t.look !== "handDrawn" && x.selectAll("path").attr("style", u), r && t.look !== "handDrawn" && x.selectAll("path").attr("style", r), x.attr("transform", `translate(${-l}, 0)`), o.attr("transform", `translate(${-s / 2 + (t.padding ?? 0) / 2 - (a.x - (a.left ?? 0))},${-c / 2 + (t.padding ?? 0) / 2 - (a.y - (a.top ?? 0))})`), T(t, x), t.intersect = function(e) {
683
+ return W.polygon(t, f, e);
684
+ }, i;
685
+ }
686
+ i(pe, "curlyBraceRight");
687
+ function J(e, t, n, r = 100, i = 0, a = 180) {
688
+ let o = [], s = i * Math.PI / 180, c = (a * Math.PI / 180 - s) / (r - 1);
689
+ for (let i = 0; i < r; i++) {
690
+ let r = s + i * c, a = e + n * Math.cos(r), l = t + n * Math.sin(r);
691
+ o.push({
692
+ x: -a,
693
+ y: -l
694
+ });
695
+ }
696
+ return o;
697
+ }
698
+ i(J, "generateCirclePoints");
699
+ async function me(e, t) {
700
+ let { labelStyles: n, nodeStyles: r } = y(t);
701
+ t.labelStyle = n;
702
+ let { shapeSvg: i, bbox: a, label: o } = await C(e, t, E(t)), s = a.width + (t.padding ?? 0), c = a.height + (t.padding ?? 0), l = Math.max(5, c * .1), { cssStyles: u } = t, d = [
703
+ ...J(s / 2, -c / 2, l, 30, -90, 0),
704
+ {
705
+ x: -s / 2 - l,
706
+ y: l
707
+ },
708
+ ...J(s / 2 + l * 2, -l, l, 20, -180, -270),
709
+ ...J(s / 2 + l * 2, l, l, 20, -90, -180),
710
+ {
711
+ x: -s / 2 - l,
712
+ y: -c / 2
713
+ },
714
+ ...J(s / 2, c / 2, l, 20, 0, 90)
715
+ ], f = [
716
+ ...J(-s / 2 + l + l / 2, -c / 2, l, 20, -90, -180),
717
+ {
718
+ x: s / 2 - l / 2,
719
+ y: l
720
+ },
721
+ ...J(-s / 2 - l / 2, -l, l, 20, 0, 90),
722
+ ...J(-s / 2 - l / 2, l, l, 20, -90, 0),
723
+ {
724
+ x: s / 2 - l / 2,
725
+ y: -l
726
+ },
727
+ ...J(-s / 2 + l + l / 2, c / 2, l, 30, -180, -270)
728
+ ], p = [
729
+ {
730
+ x: s / 2,
731
+ y: -c / 2 - l
732
+ },
733
+ {
734
+ x: -s / 2,
735
+ y: -c / 2 - l
736
+ },
737
+ ...J(s / 2, -c / 2, l, 20, -90, 0),
738
+ {
739
+ x: -s / 2 - l,
740
+ y: -l
741
+ },
742
+ ...J(s / 2 + l * 2, -l, l, 20, -180, -270),
743
+ ...J(s / 2 + l * 2, l, l, 20, -90, -180),
744
+ {
745
+ x: -s / 2 - l,
746
+ y: c / 2
747
+ },
748
+ ...J(s / 2, c / 2, l, 20, 0, 90),
749
+ {
750
+ x: -s / 2,
751
+ y: c / 2 + l
752
+ },
753
+ {
754
+ x: s / 2 - l - l / 2,
755
+ y: c / 2 + l
756
+ },
757
+ ...J(-s / 2 + l + l / 2, -c / 2, l, 20, -90, -180),
758
+ {
759
+ x: s / 2 - l / 2,
760
+ y: l
761
+ },
762
+ ...J(-s / 2 - l / 2, -l, l, 20, 0, 90),
763
+ ...J(-s / 2 - l / 2, l, l, 20, -90, 0),
764
+ {
765
+ x: s / 2 - l / 2,
766
+ y: -l
767
+ },
768
+ ...J(-s / 2 + l + l / 2, c / 2, l, 30, -180, -270)
769
+ ], m = S.svg(i), h = v(t, { fill: "none" });
770
+ t.look !== "handDrawn" && (h.roughness = 0, h.fillStyle = "solid");
771
+ let g = D(d).replace("Z", ""), _ = m.path(g, h), b = D(f).replace("Z", ""), x = m.path(b, h), w = D(p), O = m.path(w, { ...h }), k = i.insert("g", ":first-child");
772
+ return k.insert(() => O, ":first-child").attr("stroke-opacity", 0), k.insert(() => _, ":first-child"), k.insert(() => x, ":first-child"), k.attr("class", "text"), u && t.look !== "handDrawn" && k.selectAll("path").attr("style", u), r && t.look !== "handDrawn" && k.selectAll("path").attr("style", r), k.attr("transform", `translate(${l - l / 4}, 0)`), o.attr("transform", `translate(${-s / 2 + (t.padding ?? 0) / 2 - (a.x - (a.left ?? 0))},${-c / 2 + (t.padding ?? 0) / 2 - (a.y - (a.top ?? 0))})`), T(t, k), t.intersect = function(e) {
773
+ return W.polygon(t, p, e);
774
+ }, i;
775
+ }
776
+ i(me, "curlyBraces");
777
+ async function he(e, t) {
778
+ let { labelStyles: n, nodeStyles: r } = y(t);
779
+ t.labelStyle = n;
780
+ let { shapeSvg: i, bbox: a } = await C(e, t, E(t)), o = Math.max(80, (a.width + (t.padding ?? 0) * 2) * 1.25, t?.width ?? 0), s = Math.max(20, a.height + (t.padding ?? 0) * 2, t?.height ?? 0), c = s / 2, { cssStyles: l } = t, u = S.svg(i), d = v(t, {});
781
+ t.look !== "handDrawn" && (d.roughness = 0, d.fillStyle = "solid");
782
+ let f = o, p = s, m = f - c, h = p / 4, g = [
783
+ {
784
+ x: m,
785
+ y: 0
786
+ },
787
+ {
788
+ x: h,
789
+ y: 0
790
+ },
791
+ {
792
+ x: 0,
793
+ y: p / 2
794
+ },
795
+ {
796
+ x: h,
797
+ y: p
798
+ },
799
+ {
800
+ x: m,
801
+ y: p
802
+ },
803
+ ...k(-m, -p / 2, c, 50, 270, 90)
804
+ ], _ = D(g), b = u.path(_, d), x = i.insert(() => b, ":first-child");
805
+ return x.attr("class", "basic label-container"), l && t.look !== "handDrawn" && x.selectChildren("path").attr("style", l), r && t.look !== "handDrawn" && x.selectChildren("path").attr("style", r), x.attr("transform", `translate(${-o / 2}, ${-s / 2})`), T(t, x), t.intersect = function(e) {
806
+ return W.polygon(t, g, e);
807
+ }, i;
808
+ }
809
+ i(he, "curvedTrapezoid");
810
+ var ge = /* @__PURE__ */ i((e, t, n, r, i, a) => [
811
+ `M${e},${t + a}`,
812
+ `a${i},${a} 0,0,0 ${n},0`,
813
+ `a${i},${a} 0,0,0 ${-n},0`,
814
+ `l0,${r}`,
815
+ `a${i},${a} 0,0,0 ${n},0`,
816
+ `l0,${-r}`
817
+ ].join(" "), "createCylinderPathD"), _e = /* @__PURE__ */ i((e, t, n, r, i, a) => [
818
+ `M${e},${t + a}`,
819
+ `M${e + n},${t + a}`,
820
+ `a${i},${a} 0,0,0 ${-n},0`,
821
+ `l0,${r}`,
822
+ `a${i},${a} 0,0,0 ${n},0`,
823
+ `l0,${-r}`
824
+ ].join(" "), "createOuterCylinderPathD"), ve = /* @__PURE__ */ i((e, t, n, r, i, a) => [`M${e - n / 2},${-r / 2}`, `a${i},${a} 0,0,0 ${n},0`].join(" "), "createInnerCylinderPathD");
825
+ async function ye(e, n) {
826
+ let { labelStyles: r, nodeStyles: i } = y(n);
827
+ n.labelStyle = r;
828
+ let { shapeSvg: a, bbox: o, label: s } = await C(e, n, E(n)), c = Math.max(o.width + n.padding, n.width ?? 0), l = c / 2, u = l / (2.5 + c / 50), d = Math.max(o.height + u + n.padding, n.height ?? 0), f, { cssStyles: p } = n;
829
+ if (n.look === "handDrawn") {
830
+ let e = S.svg(a), t = _e(0, 0, c, d, l, u), r = ve(0, u, c, d, l, u), i = e.path(t, v(n, {})), o = e.path(r, v(n, { fill: "none" }));
831
+ f = a.insert(() => o, ":first-child"), f = a.insert(() => i, ":first-child"), f.attr("class", "basic label-container"), p && f.attr("style", p);
832
+ } else {
833
+ let e = ge(0, 0, c, d, l, u);
834
+ f = a.insert("path", ":first-child").attr("d", e).attr("class", "basic label-container").attr("style", t(p)).attr("style", i);
835
+ }
836
+ return f.attr("label-offset-y", u), f.attr("transform", `translate(${-c / 2}, ${-(d / 2 + u)})`), T(n, f), s.attr("transform", `translate(${-(o.width / 2) - (o.x - (o.left ?? 0))}, ${-(o.height / 2) + (n.padding ?? 0) / 1.5 - (o.y - (o.top ?? 0))})`), n.intersect = function(e) {
837
+ let t = W.rect(n, e), r = t.x - (n.x ?? 0);
838
+ if (l != 0 && (Math.abs(r) < (n.width ?? 0) / 2 || Math.abs(r) == (n.width ?? 0) / 2 && Math.abs(t.y - (n.y ?? 0)) > (n.height ?? 0) / 2 - u)) {
839
+ let i = u * u * (1 - r * r / (l * l));
840
+ i > 0 && (i = Math.sqrt(i)), i = u - i, e.y - (n.y ?? 0) > 0 && (i = -i), t.y += i;
841
+ }
842
+ return t;
843
+ }, a;
844
+ }
845
+ i(ye, "cylinder");
846
+ async function be(e, t) {
847
+ let { labelStyles: n, nodeStyles: r } = y(t);
848
+ t.labelStyle = n;
849
+ let { shapeSvg: i, bbox: a, label: o } = await C(e, t, E(t)), s = a.width + t.padding, c = a.height + t.padding, l = c * .2, u = -s / 2, d = -c / 2 - l / 2, { cssStyles: f } = t, p = S.svg(i), m = v(t, {});
850
+ t.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
851
+ let h = [
852
+ {
853
+ x: u,
854
+ y: d + l
855
+ },
856
+ {
857
+ x: -u,
858
+ y: d + l
859
+ },
860
+ {
861
+ x: -u,
862
+ y: -d
863
+ },
864
+ {
865
+ x: u,
866
+ y: -d
867
+ },
868
+ {
869
+ x: u,
870
+ y: d
871
+ },
872
+ {
873
+ x: -u,
874
+ y: d
875
+ },
876
+ {
877
+ x: -u,
878
+ y: d + l
879
+ }
880
+ ], g = p.polygon(h.map((e) => [e.x, e.y]), m), _ = i.insert(() => g, ":first-child");
881
+ return _.attr("class", "basic label-container"), f && t.look !== "handDrawn" && _.selectAll("path").attr("style", f), r && t.look !== "handDrawn" && _.selectAll("path").attr("style", r), o.attr("transform", `translate(${u + (t.padding ?? 0) / 2 - (a.x - (a.left ?? 0))}, ${d + l + (t.padding ?? 0) / 2 - (a.y - (a.top ?? 0))})`), T(t, _), t.intersect = function(e) {
882
+ return W.rect(t, e);
883
+ }, i;
884
+ }
885
+ i(be, "dividedRectangle");
886
+ async function xe(e, n) {
887
+ let { labelStyles: i, nodeStyles: a } = y(n);
888
+ n.labelStyle = i;
889
+ let { shapeSvg: o, bbox: s, halfPadding: c } = await C(e, n, E(n)), l = s.width / 2 + c + 5, u = s.width / 2 + c, d, { cssStyles: f } = n;
890
+ if (n.look === "handDrawn") {
891
+ let e = S.svg(o), r = v(n, {
892
+ roughness: .2,
893
+ strokeWidth: 2.5
894
+ }), i = v(n, {
895
+ roughness: .2,
896
+ strokeWidth: 1.5
897
+ }), a = e.circle(0, 0, l * 2, r), s = e.circle(0, 0, u * 2, i);
898
+ d = o.insert("g", ":first-child"), d.attr("class", t(n.cssClasses)).attr("style", t(f)), d.node()?.appendChild(a), d.node()?.appendChild(s);
899
+ } else {
900
+ d = o.insert("g", ":first-child");
901
+ let e = d.insert("circle", ":first-child"), t = d.insert("circle");
902
+ d.attr("class", "basic label-container").attr("style", a), e.attr("class", "outer-circle").attr("style", a).attr("r", l).attr("cx", 0).attr("cy", 0), t.attr("class", "inner-circle").attr("style", a).attr("r", u).attr("cx", 0).attr("cy", 0);
903
+ }
904
+ return T(n, d), n.intersect = function(e) {
905
+ return r.info("DoubleCircle intersect", n, l, e), W.circle(n, l, e);
906
+ }, o;
907
+ }
908
+ i(xe, "doublecircle");
909
+ function Se(e, t, { config: { themeVariables: n } }) {
910
+ let { labelStyles: i, nodeStyles: a } = y(t);
911
+ t.label = "", t.labelStyle = i;
912
+ let o = e.insert("g").attr("class", E(t)).attr("id", t.domId ?? t.id), { cssStyles: s } = t, c = S.svg(o), { nodeBorder: l } = n, u = v(t, { fillStyle: "solid" });
913
+ t.look !== "handDrawn" && (u.roughness = 0);
914
+ let d = c.circle(0, 0, 14, u), f = o.insert(() => d, ":first-child");
915
+ return f.selectAll("path").attr("style", `fill: ${l} !important;`), s && s.length > 0 && t.look !== "handDrawn" && f.selectAll("path").attr("style", s), a && t.look !== "handDrawn" && f.selectAll("path").attr("style", a), T(t, f), t.intersect = function(e) {
916
+ return r.info("filledCircle intersect", t, {
917
+ radius: 7,
918
+ point: e
919
+ }), W.circle(t, 7, e);
920
+ }, o;
921
+ }
922
+ i(Se, "filledCircle");
923
+ async function Ce(e, t) {
924
+ let { labelStyles: n, nodeStyles: i } = y(t);
925
+ t.labelStyle = n;
926
+ let { shapeSvg: a, bbox: o, label: s } = await C(e, t, E(t)), c = o.width + (t.padding ?? 0), l = c + o.height, u = c + o.height, d = [
927
+ {
928
+ x: 0,
929
+ y: -l
930
+ },
931
+ {
932
+ x: u,
933
+ y: -l
934
+ },
935
+ {
936
+ x: u / 2,
937
+ y: 0
938
+ }
939
+ ], { cssStyles: f } = t, p = S.svg(a), m = v(t, {});
940
+ t.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
941
+ let h = D(d), g = p.path(h, m), _ = a.insert(() => g, ":first-child").attr("transform", `translate(${-l / 2}, ${l / 2})`);
942
+ return f && t.look !== "handDrawn" && _.selectChildren("path").attr("style", f), i && t.look !== "handDrawn" && _.selectChildren("path").attr("style", i), t.width = c, t.height = l, T(t, _), s.attr("transform", `translate(${-o.width / 2 - (o.x - (o.left ?? 0))}, ${-l / 2 + (t.padding ?? 0) / 2 + (o.y - (o.top ?? 0))})`), t.intersect = function(e) {
943
+ return r.info("Triangle intersect", t, d, e), W.polygon(t, d, e);
944
+ }, a;
945
+ }
946
+ i(Ce, "flippedTriangle");
947
+ function we(e, t, { dir: n, config: { state: r, themeVariables: i } }) {
948
+ let { nodeStyles: a } = y(t);
949
+ t.label = "";
950
+ let o = e.insert("g").attr("class", E(t)).attr("id", t.domId ?? t.id), { cssStyles: s } = t, c = Math.max(70, t?.width ?? 0), l = Math.max(10, t?.height ?? 0);
951
+ n === "LR" && (c = Math.max(10, t?.width ?? 0), l = Math.max(70, t?.height ?? 0));
952
+ let u = -1 * c / 2, d = -1 * l / 2, f = S.svg(o), p = v(t, {
953
+ stroke: i.lineColor,
954
+ fill: i.lineColor
955
+ });
956
+ t.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
957
+ let m = f.rectangle(u, d, c, l, p), h = o.insert(() => m, ":first-child");
958
+ s && t.look !== "handDrawn" && h.selectAll("path").attr("style", s), a && t.look !== "handDrawn" && h.selectAll("path").attr("style", a), T(t, h);
959
+ let g = r?.padding ?? 0;
960
+ return t.width && t.height && (t.width += g / 2 || 0, t.height += g / 2 || 0), t.intersect = function(e) {
961
+ return W.rect(t, e);
962
+ }, o;
963
+ }
964
+ i(we, "forkJoin");
965
+ async function Te(e, t) {
966
+ let { labelStyles: n, nodeStyles: i } = y(t);
967
+ t.labelStyle = n;
968
+ let { shapeSvg: a, bbox: o } = await C(e, t, E(t)), s = Math.max(80, o.width + (t.padding ?? 0) * 2, t?.width ?? 0), c = Math.max(50, o.height + (t.padding ?? 0) * 2, t?.height ?? 0), l = c / 2, { cssStyles: u } = t, d = S.svg(a), f = v(t, {});
969
+ t.look !== "handDrawn" && (f.roughness = 0, f.fillStyle = "solid");
970
+ let p = [
971
+ {
972
+ x: -s / 2,
973
+ y: -c / 2
974
+ },
975
+ {
976
+ x: s / 2 - l,
977
+ y: -c / 2
978
+ },
979
+ ...k(-s / 2 + l, 0, l, 50, 90, 270),
980
+ {
981
+ x: s / 2 - l,
982
+ y: c / 2
983
+ },
984
+ {
985
+ x: -s / 2,
986
+ y: c / 2
987
+ }
988
+ ], m = D(p), h = d.path(m, f), g = a.insert(() => h, ":first-child");
989
+ return g.attr("class", "basic label-container"), u && t.look !== "handDrawn" && g.selectChildren("path").attr("style", u), i && t.look !== "handDrawn" && g.selectChildren("path").attr("style", i), T(t, g), t.intersect = function(e) {
990
+ return r.info("Pill intersect", t, {
991
+ radius: l,
992
+ point: e
993
+ }), W.polygon(t, p, e);
994
+ }, a;
995
+ }
996
+ i(Te, "halfRoundedRectangle");
997
+ var Ee = /* @__PURE__ */ i((e, t, n, r, i) => [
998
+ `M${e + i},${t}`,
999
+ `L${e + n - i},${t}`,
1000
+ `L${e + n},${t - r / 2}`,
1001
+ `L${e + n - i},${t - r}`,
1002
+ `L${e + i},${t - r}`,
1003
+ `L${e},${t - r / 2}`,
1004
+ "Z"
1005
+ ].join(" "), "createHexagonPathD");
1006
+ async function De(e, t) {
1007
+ let { labelStyles: n, nodeStyles: r } = y(t);
1008
+ t.labelStyle = n;
1009
+ let { shapeSvg: i, bbox: a } = await C(e, t, E(t)), o = a.height + t.padding, s = o / 4, c = a.width + 2 * s + t.padding, l = [
1010
+ {
1011
+ x: s,
1012
+ y: 0
1013
+ },
1014
+ {
1015
+ x: c - s,
1016
+ y: 0
1017
+ },
1018
+ {
1019
+ x: c,
1020
+ y: -o / 2
1021
+ },
1022
+ {
1023
+ x: c - s,
1024
+ y: -o
1025
+ },
1026
+ {
1027
+ x: s,
1028
+ y: -o
1029
+ },
1030
+ {
1031
+ x: 0,
1032
+ y: -o / 2
1033
+ }
1034
+ ], u, { cssStyles: d } = t;
1035
+ if (t.look === "handDrawn") {
1036
+ let e = S.svg(i), n = v(t, {}), r = Ee(0, 0, c, o, s), a = e.path(r, n);
1037
+ u = i.insert(() => a, ":first-child").attr("transform", `translate(${-c / 2}, ${o / 2})`), d && u.attr("style", d);
1038
+ } else u = G(i, c, o, l);
1039
+ return r && u.attr("style", r), t.width = c, t.height = o, T(t, u), t.intersect = function(e) {
1040
+ return W.polygon(t, l, e);
1041
+ }, i;
1042
+ }
1043
+ i(De, "hexagon");
1044
+ async function Oe(e, t) {
1045
+ let { labelStyles: n, nodeStyles: i } = y(t);
1046
+ t.label = "", t.labelStyle = n;
1047
+ let { shapeSvg: a } = await C(e, t, E(t)), o = Math.max(30, t?.width ?? 0), s = Math.max(30, t?.height ?? 0), { cssStyles: c } = t, l = S.svg(a), u = v(t, {});
1048
+ t.look !== "handDrawn" && (u.roughness = 0, u.fillStyle = "solid");
1049
+ let d = [
1050
+ {
1051
+ x: 0,
1052
+ y: 0
1053
+ },
1054
+ {
1055
+ x: o,
1056
+ y: 0
1057
+ },
1058
+ {
1059
+ x: 0,
1060
+ y: s
1061
+ },
1062
+ {
1063
+ x: o,
1064
+ y: s
1065
+ }
1066
+ ], f = D(d), p = l.path(f, u), m = a.insert(() => p, ":first-child");
1067
+ return m.attr("class", "basic label-container"), c && t.look !== "handDrawn" && m.selectChildren("path").attr("style", c), i && t.look !== "handDrawn" && m.selectChildren("path").attr("style", i), m.attr("transform", `translate(${-o / 2}, ${-s / 2})`), T(t, m), t.intersect = function(e) {
1068
+ return r.info("Pill intersect", t, { points: d }), W.polygon(t, d, e);
1069
+ }, a;
1070
+ }
1071
+ i(Oe, "hourglass");
1072
+ async function ke(e, t, { config: { themeVariables: n, flowchart: i } }) {
1073
+ let { labelStyles: a } = y(t);
1074
+ t.labelStyle = a;
1075
+ let o = t.assetHeight ?? 48, s = t.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
1076
+ t.width = Math.max(c, l ?? 0);
1077
+ let { shapeSvg: u, bbox: d, label: f } = await C(e, t, "icon-shape default"), p = t.pos === "t", m = c, g = c, { nodeBorder: _ } = n, { stylesMap: b } = x(t), w = -g / 2, E = -m / 2, D = t.label ? 8 : 0, O = S.svg(u), k = v(t, {
1078
+ stroke: "none",
1079
+ fill: "none"
1080
+ });
1081
+ t.look !== "handDrawn" && (k.roughness = 0, k.fillStyle = "solid");
1082
+ let A = O.rectangle(w, E, g, m, k), j = Math.max(g, d.width), M = m + d.height + D, N = O.rectangle(-j / 2, -M / 2, j, M, {
1083
+ ...k,
1084
+ fill: "transparent",
1085
+ stroke: "none"
1086
+ }), P = u.insert(() => A, ":first-child"), F = u.insert(() => N);
1087
+ if (t.icon) {
1088
+ let e = u.append("g");
1089
+ e.html(`<g>${await h(t.icon, {
1090
+ height: c,
1091
+ width: c,
1092
+ fallbackPrefix: ""
1093
+ })}</g>`);
1094
+ let n = e.node().getBBox(), r = n.width, i = n.height, a = n.x, o = n.y;
1095
+ e.attr("transform", `translate(${-r / 2 - a},${p ? d.height / 2 + D / 2 - i / 2 - o : -d.height / 2 - D / 2 - i / 2 - o})`), e.attr("style", `color: ${b.get("stroke") ?? _};`);
1096
+ }
1097
+ return f.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${p ? -M / 2 : M / 2 - d.height})`), P.attr("transform", `translate(0,${p ? d.height / 2 + D / 2 : -d.height / 2 - D / 2})`), T(t, F), t.intersect = function(e) {
1098
+ if (r.info("iconSquare intersect", t, e), !t.label) return W.rect(t, e);
1099
+ let n = t.x ?? 0, i = t.y ?? 0, a = t.height ?? 0, o = [];
1100
+ return o = p ? [
1101
+ {
1102
+ x: n - d.width / 2,
1103
+ y: i - a / 2
1104
+ },
1105
+ {
1106
+ x: n + d.width / 2,
1107
+ y: i - a / 2
1108
+ },
1109
+ {
1110
+ x: n + d.width / 2,
1111
+ y: i - a / 2 + d.height + D
1112
+ },
1113
+ {
1114
+ x: n + g / 2,
1115
+ y: i - a / 2 + d.height + D
1116
+ },
1117
+ {
1118
+ x: n + g / 2,
1119
+ y: i + a / 2
1120
+ },
1121
+ {
1122
+ x: n - g / 2,
1123
+ y: i + a / 2
1124
+ },
1125
+ {
1126
+ x: n - g / 2,
1127
+ y: i - a / 2 + d.height + D
1128
+ },
1129
+ {
1130
+ x: n - d.width / 2,
1131
+ y: i - a / 2 + d.height + D
1132
+ }
1133
+ ] : [
1134
+ {
1135
+ x: n - g / 2,
1136
+ y: i - a / 2
1137
+ },
1138
+ {
1139
+ x: n + g / 2,
1140
+ y: i - a / 2
1141
+ },
1142
+ {
1143
+ x: n + g / 2,
1144
+ y: i - a / 2 + m
1145
+ },
1146
+ {
1147
+ x: n + d.width / 2,
1148
+ y: i - a / 2 + m
1149
+ },
1150
+ {
1151
+ x: n + d.width / 2 / 2,
1152
+ y: i + a / 2
1153
+ },
1154
+ {
1155
+ x: n - d.width / 2,
1156
+ y: i + a / 2
1157
+ },
1158
+ {
1159
+ x: n - d.width / 2,
1160
+ y: i - a / 2 + m
1161
+ },
1162
+ {
1163
+ x: n - g / 2,
1164
+ y: i - a / 2 + m
1165
+ }
1166
+ ], W.polygon(t, o, e);
1167
+ }, u;
1168
+ }
1169
+ i(ke, "icon");
1170
+ async function Ae(e, t, { config: { themeVariables: n, flowchart: i } }) {
1171
+ let { labelStyles: a } = y(t);
1172
+ t.labelStyle = a;
1173
+ let o = t.assetHeight ?? 48, s = t.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
1174
+ t.width = Math.max(c, l ?? 0);
1175
+ let { shapeSvg: u, bbox: d, label: f } = await C(e, t, "icon-shape default"), p = t.label ? 8 : 0, m = t.pos === "t", { nodeBorder: g, mainBkg: _ } = n, { stylesMap: b } = x(t), w = S.svg(u), E = v(t, {});
1176
+ t.look !== "handDrawn" && (E.roughness = 0, E.fillStyle = "solid"), E.stroke = b.get("fill") ?? _;
1177
+ let D = u.append("g");
1178
+ t.icon && D.html(`<g>${await h(t.icon, {
1179
+ height: c,
1180
+ width: c,
1181
+ fallbackPrefix: ""
1182
+ })}</g>`);
1183
+ let O = D.node().getBBox(), k = O.width, A = O.height, j = O.x, M = O.y, N = Math.max(k, A) * Math.SQRT2 + 40, P = w.circle(0, 0, N, E), F = Math.max(N, d.width), I = N + d.height + p, L = w.rectangle(-F / 2, -I / 2, F, I, {
1184
+ ...E,
1185
+ fill: "transparent",
1186
+ stroke: "none"
1187
+ }), R = u.insert(() => P, ":first-child"), z = u.insert(() => L);
1188
+ return D.attr("transform", `translate(${-k / 2 - j},${m ? d.height / 2 + p / 2 - A / 2 - M : -d.height / 2 - p / 2 - A / 2 - M})`), D.attr("style", `color: ${b.get("stroke") ?? g};`), f.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${m ? -I / 2 : I / 2 - d.height})`), R.attr("transform", `translate(0,${m ? d.height / 2 + p / 2 : -d.height / 2 - p / 2})`), T(t, z), t.intersect = function(e) {
1189
+ return r.info("iconSquare intersect", t, e), W.rect(t, e);
1190
+ }, u;
1191
+ }
1192
+ i(Ae, "iconCircle");
1193
+ async function je(e, t, { config: { themeVariables: n, flowchart: i } }) {
1194
+ let { labelStyles: a } = y(t);
1195
+ t.labelStyle = a;
1196
+ let o = t.assetHeight ?? 48, s = t.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
1197
+ t.width = Math.max(c, l ?? 0);
1198
+ let { shapeSvg: u, bbox: d, halfPadding: f, label: p } = await C(e, t, "icon-shape default"), m = t.pos === "t", g = c + f * 2, _ = c + f * 2, { nodeBorder: b, mainBkg: w } = n, { stylesMap: E } = x(t), D = -_ / 2, O = -g / 2, k = t.label ? 8 : 0, A = S.svg(u), j = v(t, {});
1199
+ t.look !== "handDrawn" && (j.roughness = 0, j.fillStyle = "solid"), j.stroke = E.get("fill") ?? w;
1200
+ let N = A.path(M(D, O, _, g, 5), j), P = Math.max(_, d.width), F = g + d.height + k, I = A.rectangle(-P / 2, -F / 2, P, F, {
1201
+ ...j,
1202
+ fill: "transparent",
1203
+ stroke: "none"
1204
+ }), L = u.insert(() => N, ":first-child").attr("class", "icon-shape2"), R = u.insert(() => I);
1205
+ if (t.icon) {
1206
+ let e = u.append("g");
1207
+ e.html(`<g>${await h(t.icon, {
1208
+ height: c,
1209
+ width: c,
1210
+ fallbackPrefix: ""
1211
+ })}</g>`);
1212
+ let n = e.node().getBBox(), r = n.width, i = n.height, a = n.x, o = n.y;
1213
+ e.attr("transform", `translate(${-r / 2 - a},${m ? d.height / 2 + k / 2 - i / 2 - o : -d.height / 2 - k / 2 - i / 2 - o})`), e.attr("style", `color: ${E.get("stroke") ?? b};`);
1214
+ }
1215
+ return p.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${m ? -F / 2 : F / 2 - d.height})`), L.attr("transform", `translate(0,${m ? d.height / 2 + k / 2 : -d.height / 2 - k / 2})`), T(t, R), t.intersect = function(e) {
1216
+ if (r.info("iconSquare intersect", t, e), !t.label) return W.rect(t, e);
1217
+ let n = t.x ?? 0, i = t.y ?? 0, a = t.height ?? 0, o = [];
1218
+ return o = m ? [
1219
+ {
1220
+ x: n - d.width / 2,
1221
+ y: i - a / 2
1222
+ },
1223
+ {
1224
+ x: n + d.width / 2,
1225
+ y: i - a / 2
1226
+ },
1227
+ {
1228
+ x: n + d.width / 2,
1229
+ y: i - a / 2 + d.height + k
1230
+ },
1231
+ {
1232
+ x: n + _ / 2,
1233
+ y: i - a / 2 + d.height + k
1234
+ },
1235
+ {
1236
+ x: n + _ / 2,
1237
+ y: i + a / 2
1238
+ },
1239
+ {
1240
+ x: n - _ / 2,
1241
+ y: i + a / 2
1242
+ },
1243
+ {
1244
+ x: n - _ / 2,
1245
+ y: i - a / 2 + d.height + k
1246
+ },
1247
+ {
1248
+ x: n - d.width / 2,
1249
+ y: i - a / 2 + d.height + k
1250
+ }
1251
+ ] : [
1252
+ {
1253
+ x: n - _ / 2,
1254
+ y: i - a / 2
1255
+ },
1256
+ {
1257
+ x: n + _ / 2,
1258
+ y: i - a / 2
1259
+ },
1260
+ {
1261
+ x: n + _ / 2,
1262
+ y: i - a / 2 + g
1263
+ },
1264
+ {
1265
+ x: n + d.width / 2,
1266
+ y: i - a / 2 + g
1267
+ },
1268
+ {
1269
+ x: n + d.width / 2 / 2,
1270
+ y: i + a / 2
1271
+ },
1272
+ {
1273
+ x: n - d.width / 2,
1274
+ y: i + a / 2
1275
+ },
1276
+ {
1277
+ x: n - d.width / 2,
1278
+ y: i - a / 2 + g
1279
+ },
1280
+ {
1281
+ x: n - _ / 2,
1282
+ y: i - a / 2 + g
1283
+ }
1284
+ ], W.polygon(t, o, e);
1285
+ }, u;
1286
+ }
1287
+ i(je, "iconRounded");
1288
+ async function Me(e, t, { config: { themeVariables: n, flowchart: i } }) {
1289
+ let { labelStyles: a } = y(t);
1290
+ t.labelStyle = a;
1291
+ let o = t.assetHeight ?? 48, s = t.assetWidth ?? 48, c = Math.max(o, s), l = i?.wrappingWidth;
1292
+ t.width = Math.max(c, l ?? 0);
1293
+ let { shapeSvg: u, bbox: d, halfPadding: f, label: p } = await C(e, t, "icon-shape default"), m = t.pos === "t", g = c + f * 2, _ = c + f * 2, { nodeBorder: b, mainBkg: w } = n, { stylesMap: E } = x(t), D = -_ / 2, O = -g / 2, k = t.label ? 8 : 0, A = S.svg(u), j = v(t, {});
1294
+ t.look !== "handDrawn" && (j.roughness = 0, j.fillStyle = "solid"), j.stroke = E.get("fill") ?? w;
1295
+ let N = A.path(M(D, O, _, g, .1), j), P = Math.max(_, d.width), F = g + d.height + k, I = A.rectangle(-P / 2, -F / 2, P, F, {
1296
+ ...j,
1297
+ fill: "transparent",
1298
+ stroke: "none"
1299
+ }), L = u.insert(() => N, ":first-child"), R = u.insert(() => I);
1300
+ if (t.icon) {
1301
+ let e = u.append("g");
1302
+ e.html(`<g>${await h(t.icon, {
1303
+ height: c,
1304
+ width: c,
1305
+ fallbackPrefix: ""
1306
+ })}</g>`);
1307
+ let n = e.node().getBBox(), r = n.width, i = n.height, a = n.x, o = n.y;
1308
+ e.attr("transform", `translate(${-r / 2 - a},${m ? d.height / 2 + k / 2 - i / 2 - o : -d.height / 2 - k / 2 - i / 2 - o})`), e.attr("style", `color: ${E.get("stroke") ?? b};`);
1309
+ }
1310
+ return p.attr("transform", `translate(${-d.width / 2 - (d.x - (d.left ?? 0))},${m ? -F / 2 : F / 2 - d.height})`), L.attr("transform", `translate(0,${m ? d.height / 2 + k / 2 : -d.height / 2 - k / 2})`), T(t, R), t.intersect = function(e) {
1311
+ if (r.info("iconSquare intersect", t, e), !t.label) return W.rect(t, e);
1312
+ let n = t.x ?? 0, i = t.y ?? 0, a = t.height ?? 0, o = [];
1313
+ return o = m ? [
1314
+ {
1315
+ x: n - d.width / 2,
1316
+ y: i - a / 2
1317
+ },
1318
+ {
1319
+ x: n + d.width / 2,
1320
+ y: i - a / 2
1321
+ },
1322
+ {
1323
+ x: n + d.width / 2,
1324
+ y: i - a / 2 + d.height + k
1325
+ },
1326
+ {
1327
+ x: n + _ / 2,
1328
+ y: i - a / 2 + d.height + k
1329
+ },
1330
+ {
1331
+ x: n + _ / 2,
1332
+ y: i + a / 2
1333
+ },
1334
+ {
1335
+ x: n - _ / 2,
1336
+ y: i + a / 2
1337
+ },
1338
+ {
1339
+ x: n - _ / 2,
1340
+ y: i - a / 2 + d.height + k
1341
+ },
1342
+ {
1343
+ x: n - d.width / 2,
1344
+ y: i - a / 2 + d.height + k
1345
+ }
1346
+ ] : [
1347
+ {
1348
+ x: n - _ / 2,
1349
+ y: i - a / 2
1350
+ },
1351
+ {
1352
+ x: n + _ / 2,
1353
+ y: i - a / 2
1354
+ },
1355
+ {
1356
+ x: n + _ / 2,
1357
+ y: i - a / 2 + g
1358
+ },
1359
+ {
1360
+ x: n + d.width / 2,
1361
+ y: i - a / 2 + g
1362
+ },
1363
+ {
1364
+ x: n + d.width / 2 / 2,
1365
+ y: i + a / 2
1366
+ },
1367
+ {
1368
+ x: n - d.width / 2,
1369
+ y: i + a / 2
1370
+ },
1371
+ {
1372
+ x: n - d.width / 2,
1373
+ y: i - a / 2 + g
1374
+ },
1375
+ {
1376
+ x: n - _ / 2,
1377
+ y: i - a / 2 + g
1378
+ }
1379
+ ], W.polygon(t, o, e);
1380
+ }, u;
1381
+ }
1382
+ i(Me, "iconSquare");
1383
+ async function Ne(e, t, { config: { flowchart: n } }) {
1384
+ let i = new Image();
1385
+ i.src = t?.img ?? "", await i.decode();
1386
+ let a = Number(i.naturalWidth.toString().replace("px", "")), o = Number(i.naturalHeight.toString().replace("px", ""));
1387
+ t.imageAspectRatio = a / o;
1388
+ let { labelStyles: s } = y(t);
1389
+ t.labelStyle = s;
1390
+ let c = n?.wrappingWidth;
1391
+ t.defaultWidth = n?.wrappingWidth;
1392
+ let l = Math.max(t.label ? c ?? 0 : 0, t?.assetWidth ?? a), u = t.constraint === "on" && t?.assetHeight ? t.assetHeight * t.imageAspectRatio : l, d = t.constraint === "on" ? u / t.imageAspectRatio : t?.assetHeight ?? o;
1393
+ t.width = Math.max(u, c ?? 0);
1394
+ let { shapeSvg: f, bbox: p, label: m } = await C(e, t, "image-shape default"), h = t.pos === "t", g = -u / 2, _ = -d / 2, b = t.label ? 8 : 0, x = S.svg(f), w = v(t, {});
1395
+ t.look !== "handDrawn" && (w.roughness = 0, w.fillStyle = "solid");
1396
+ let E = x.rectangle(g, _, u, d, w), D = Math.max(u, p.width), O = d + p.height + b, k = x.rectangle(-D / 2, -O / 2, D, O, {
1397
+ ...w,
1398
+ fill: "none",
1399
+ stroke: "none"
1400
+ }), A = f.insert(() => E, ":first-child"), j = f.insert(() => k);
1401
+ if (t.img) {
1402
+ let e = f.append("image");
1403
+ e.attr("href", t.img), e.attr("width", u), e.attr("height", d), e.attr("preserveAspectRatio", "none"), e.attr("transform", `translate(${-u / 2},${h ? O / 2 - d : -O / 2})`);
1404
+ }
1405
+ return m.attr("transform", `translate(${-p.width / 2 - (p.x - (p.left ?? 0))},${h ? -d / 2 - p.height / 2 - b / 2 : d / 2 - p.height / 2 + b / 2})`), A.attr("transform", `translate(0,${h ? p.height / 2 + b / 2 : -p.height / 2 - b / 2})`), T(t, j), t.intersect = function(e) {
1406
+ if (r.info("iconSquare intersect", t, e), !t.label) return W.rect(t, e);
1407
+ let n = t.x ?? 0, i = t.y ?? 0, a = t.height ?? 0, o = [];
1408
+ return o = h ? [
1409
+ {
1410
+ x: n - p.width / 2,
1411
+ y: i - a / 2
1412
+ },
1413
+ {
1414
+ x: n + p.width / 2,
1415
+ y: i - a / 2
1416
+ },
1417
+ {
1418
+ x: n + p.width / 2,
1419
+ y: i - a / 2 + p.height + b
1420
+ },
1421
+ {
1422
+ x: n + u / 2,
1423
+ y: i - a / 2 + p.height + b
1424
+ },
1425
+ {
1426
+ x: n + u / 2,
1427
+ y: i + a / 2
1428
+ },
1429
+ {
1430
+ x: n - u / 2,
1431
+ y: i + a / 2
1432
+ },
1433
+ {
1434
+ x: n - u / 2,
1435
+ y: i - a / 2 + p.height + b
1436
+ },
1437
+ {
1438
+ x: n - p.width / 2,
1439
+ y: i - a / 2 + p.height + b
1440
+ }
1441
+ ] : [
1442
+ {
1443
+ x: n - u / 2,
1444
+ y: i - a / 2
1445
+ },
1446
+ {
1447
+ x: n + u / 2,
1448
+ y: i - a / 2
1449
+ },
1450
+ {
1451
+ x: n + u / 2,
1452
+ y: i - a / 2 + d
1453
+ },
1454
+ {
1455
+ x: n + p.width / 2,
1456
+ y: i - a / 2 + d
1457
+ },
1458
+ {
1459
+ x: n + p.width / 2 / 2,
1460
+ y: i + a / 2
1461
+ },
1462
+ {
1463
+ x: n - p.width / 2,
1464
+ y: i + a / 2
1465
+ },
1466
+ {
1467
+ x: n - p.width / 2,
1468
+ y: i - a / 2 + d
1469
+ },
1470
+ {
1471
+ x: n - u / 2,
1472
+ y: i - a / 2 + d
1473
+ }
1474
+ ], W.polygon(t, o, e);
1475
+ }, f;
1476
+ }
1477
+ i(Ne, "imageSquare");
1478
+ async function Pe(e, t) {
1479
+ let { labelStyles: n, nodeStyles: r } = y(t);
1480
+ t.labelStyle = n;
1481
+ let { shapeSvg: i, bbox: a } = await C(e, t, E(t)), o = Math.max(a.width + (t.padding ?? 0) * 2, t?.width ?? 0), s = Math.max(a.height + (t.padding ?? 0) * 2, t?.height ?? 0), c = [
1482
+ {
1483
+ x: 0,
1484
+ y: 0
1485
+ },
1486
+ {
1487
+ x: o,
1488
+ y: 0
1489
+ },
1490
+ {
1491
+ x: o + 3 * s / 6,
1492
+ y: -s
1493
+ },
1494
+ {
1495
+ x: -3 * s / 6,
1496
+ y: -s
1497
+ }
1498
+ ], l, { cssStyles: u } = t;
1499
+ if (t.look === "handDrawn") {
1500
+ let e = S.svg(i), n = v(t, {}), r = D(c), a = e.path(r, n);
1501
+ l = i.insert(() => a, ":first-child").attr("transform", `translate(${-o / 2}, ${s / 2})`), u && l.attr("style", u);
1502
+ } else l = G(i, o, s, c);
1503
+ return r && l.attr("style", r), t.width = o, t.height = s, T(t, l), t.intersect = function(e) {
1504
+ return W.polygon(t, c, e);
1505
+ }, i;
1506
+ }
1507
+ i(Pe, "inv_trapezoid");
1508
+ async function Y(e, n, r) {
1509
+ let { labelStyles: i, nodeStyles: a } = y(n);
1510
+ n.labelStyle = i;
1511
+ let { shapeSvg: o, bbox: s } = await C(e, n, E(n)), c = Math.max(s.width + r.labelPaddingX * 2, n?.width || 0), l = Math.max(s.height + r.labelPaddingY * 2, n?.height || 0), u = -c / 2, d = -l / 2, f, { rx: p, ry: m } = n, { cssStyles: h } = n;
1512
+ if (r?.rx && r.ry && (p = r.rx, m = r.ry), n.look === "handDrawn") {
1513
+ let e = S.svg(o), r = v(n, {}), i = p || m ? e.path(M(u, d, c, l, p || 0), r) : e.rectangle(u, d, c, l, r);
1514
+ f = o.insert(() => i, ":first-child"), f.attr("class", "basic label-container").attr("style", t(h));
1515
+ } else f = o.insert("rect", ":first-child"), f.attr("class", "basic label-container").attr("style", a).attr("rx", t(p)).attr("ry", t(m)).attr("x", u).attr("y", d).attr("width", c).attr("height", l);
1516
+ return T(n, f), n.calcIntersect = function(e, t) {
1517
+ return W.rect(e, t);
1518
+ }, n.intersect = function(e) {
1519
+ return W.rect(n, e);
1520
+ }, o;
1521
+ }
1522
+ i(Y, "drawRect");
1523
+ async function Fe(e, t) {
1524
+ let { shapeSvg: n, bbox: r, label: i } = await C(e, t, "label"), a = n.insert("rect", ":first-child");
1525
+ 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))})`), T(t, a), t.intersect = function(e) {
1526
+ return W.rect(t, e);
1527
+ }, n;
1528
+ }
1529
+ i(Fe, "labelRect");
1530
+ async function Ie(e, t) {
1531
+ let { labelStyles: n, nodeStyles: r } = y(t);
1532
+ t.labelStyle = n;
1533
+ let { shapeSvg: i, bbox: a } = await C(e, t, E(t)), o = Math.max(a.width + (t.padding ?? 0), t?.width ?? 0), s = Math.max(a.height + (t.padding ?? 0), t?.height ?? 0), c = [
1534
+ {
1535
+ x: 0,
1536
+ y: 0
1537
+ },
1538
+ {
1539
+ x: o + 3 * s / 6,
1540
+ y: 0
1541
+ },
1542
+ {
1543
+ x: o,
1544
+ y: -s
1545
+ },
1546
+ {
1547
+ x: -(3 * s) / 6,
1548
+ y: -s
1549
+ }
1550
+ ], l, { cssStyles: u } = t;
1551
+ if (t.look === "handDrawn") {
1552
+ let e = S.svg(i), n = v(t, {}), r = D(c), a = e.path(r, n);
1553
+ l = i.insert(() => a, ":first-child").attr("transform", `translate(${-o / 2}, ${s / 2})`), u && l.attr("style", u);
1554
+ } else l = G(i, o, s, c);
1555
+ return r && l.attr("style", r), t.width = o, t.height = s, T(t, l), t.intersect = function(e) {
1556
+ return W.polygon(t, c, e);
1557
+ }, i;
1558
+ }
1559
+ i(Ie, "lean_left");
1560
+ async function Le(e, t) {
1561
+ let { labelStyles: n, nodeStyles: r } = y(t);
1562
+ t.labelStyle = n;
1563
+ let { shapeSvg: i, bbox: a } = await C(e, t, E(t)), o = Math.max(a.width + (t.padding ?? 0), t?.width ?? 0), s = Math.max(a.height + (t.padding ?? 0), t?.height ?? 0), c = [
1564
+ {
1565
+ x: -3 * s / 6,
1566
+ y: 0
1567
+ },
1568
+ {
1569
+ x: o,
1570
+ y: 0
1571
+ },
1572
+ {
1573
+ x: o + 3 * s / 6,
1574
+ y: -s
1575
+ },
1576
+ {
1577
+ x: 0,
1578
+ y: -s
1579
+ }
1580
+ ], l, { cssStyles: u } = t;
1581
+ if (t.look === "handDrawn") {
1582
+ let e = S.svg(i), n = v(t, {}), r = D(c), a = e.path(r, n);
1583
+ l = i.insert(() => a, ":first-child").attr("transform", `translate(${-o / 2}, ${s / 2})`), u && l.attr("style", u);
1584
+ } else l = G(i, o, s, c);
1585
+ return r && l.attr("style", r), t.width = o, t.height = s, T(t, l), t.intersect = function(e) {
1586
+ return W.polygon(t, c, e);
1587
+ }, i;
1588
+ }
1589
+ i(Le, "lean_right");
1590
+ function Re(e, t) {
1591
+ let { labelStyles: n, nodeStyles: i } = y(t);
1592
+ t.label = "", t.labelStyle = n;
1593
+ let a = e.insert("g").attr("class", E(t)).attr("id", t.domId ?? t.id), { cssStyles: o } = t, s = Math.max(35, t?.width ?? 0), c = Math.max(35, t?.height ?? 0), l = [
1594
+ {
1595
+ x: s,
1596
+ y: 0
1597
+ },
1598
+ {
1599
+ x: 0,
1600
+ y: c + 7 / 2
1601
+ },
1602
+ {
1603
+ x: s - 14,
1604
+ y: c + 7 / 2
1605
+ },
1606
+ {
1607
+ x: 0,
1608
+ y: 2 * c
1609
+ },
1610
+ {
1611
+ x: s,
1612
+ y: c - 7 / 2
1613
+ },
1614
+ {
1615
+ x: 14,
1616
+ y: c - 7 / 2
1617
+ }
1618
+ ], u = S.svg(a), d = v(t, {});
1619
+ t.look !== "handDrawn" && (d.roughness = 0, d.fillStyle = "solid");
1620
+ let f = D(l), p = u.path(f, d), m = a.insert(() => p, ":first-child");
1621
+ return o && t.look !== "handDrawn" && m.selectAll("path").attr("style", o), i && t.look !== "handDrawn" && m.selectAll("path").attr("style", i), m.attr("transform", `translate(-${s / 2},${-c})`), T(t, m), t.intersect = function(e) {
1622
+ return r.info("lightningBolt intersect", t, e), W.polygon(t, l, e);
1623
+ }, a;
1624
+ }
1625
+ i(Re, "lightningBolt");
1626
+ var ze = /* @__PURE__ */ i((e, t, n, r, i, a, o) => [
1627
+ `M${e},${t + a}`,
1628
+ `a${i},${a} 0,0,0 ${n},0`,
1629
+ `a${i},${a} 0,0,0 ${-n},0`,
1630
+ `l0,${r}`,
1631
+ `a${i},${a} 0,0,0 ${n},0`,
1632
+ `l0,${-r}`,
1633
+ `M${e},${t + a + o}`,
1634
+ `a${i},${a} 0,0,0 ${n},0`
1635
+ ].join(" "), "createCylinderPathD"), Be = /* @__PURE__ */ i((e, t, n, r, i, a, o) => [
1636
+ `M${e},${t + a}`,
1637
+ `M${e + n},${t + a}`,
1638
+ `a${i},${a} 0,0,0 ${-n},0`,
1639
+ `l0,${r}`,
1640
+ `a${i},${a} 0,0,0 ${n},0`,
1641
+ `l0,${-r}`,
1642
+ `M${e},${t + a + o}`,
1643
+ `a${i},${a} 0,0,0 ${n},0`
1644
+ ].join(" "), "createOuterCylinderPathD"), Ve = /* @__PURE__ */ i((e, t, n, r, i, a) => [`M${e - n / 2},${-r / 2}`, `a${i},${a} 0,0,0 ${n},0`].join(" "), "createInnerCylinderPathD");
1645
+ async function He(e, n) {
1646
+ let { labelStyles: r, nodeStyles: i } = y(n);
1647
+ n.labelStyle = r;
1648
+ let { shapeSvg: a, bbox: o, label: s } = await C(e, n, E(n)), c = Math.max(o.width + (n.padding ?? 0), n.width ?? 0), l = c / 2, u = l / (2.5 + c / 50), d = Math.max(o.height + u + (n.padding ?? 0), n.height ?? 0), f = d * .1, p, { cssStyles: m } = n;
1649
+ if (n.look === "handDrawn") {
1650
+ let e = S.svg(a), t = Be(0, 0, c, d, l, u, f), r = Ve(0, u, c, d, l, u), i = v(n, {}), o = e.path(t, i), s = e.path(r, i);
1651
+ a.insert(() => s, ":first-child").attr("class", "line"), p = a.insert(() => o, ":first-child"), p.attr("class", "basic label-container"), m && p.attr("style", m);
1652
+ } else {
1653
+ let e = ze(0, 0, c, d, l, u, f);
1654
+ p = a.insert("path", ":first-child").attr("d", e).attr("class", "basic label-container").attr("style", t(m)).attr("style", i);
1655
+ }
1656
+ return p.attr("label-offset-y", u), p.attr("transform", `translate(${-c / 2}, ${-(d / 2 + u)})`), T(n, p), s.attr("transform", `translate(${-(o.width / 2) - (o.x - (o.left ?? 0))}, ${-(o.height / 2) + u - (o.y - (o.top ?? 0))})`), n.intersect = function(e) {
1657
+ let t = W.rect(n, e), r = t.x - (n.x ?? 0);
1658
+ if (l != 0 && (Math.abs(r) < (n.width ?? 0) / 2 || Math.abs(r) == (n.width ?? 0) / 2 && Math.abs(t.y - (n.y ?? 0)) > (n.height ?? 0) / 2 - u)) {
1659
+ let i = u * u * (1 - r * r / (l * l));
1660
+ i > 0 && (i = Math.sqrt(i)), i = u - i, e.y - (n.y ?? 0) > 0 && (i = -i), t.y += i;
1661
+ }
1662
+ return t;
1663
+ }, a;
1664
+ }
1665
+ i(He, "linedCylinder");
1666
+ async function Ue(e, t) {
1667
+ let { labelStyles: n, nodeStyles: r } = y(t);
1668
+ t.labelStyle = n;
1669
+ let { shapeSvg: i, bbox: a, label: o } = await C(e, t, E(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 / 4, u = c + l, { cssStyles: d } = t, f = S.svg(i), p = v(t, {});
1670
+ t.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
1671
+ let m = [
1672
+ {
1673
+ x: -s / 2 - s / 2 * .1,
1674
+ y: -u / 2
1675
+ },
1676
+ {
1677
+ x: -s / 2 - s / 2 * .1,
1678
+ y: u / 2
1679
+ },
1680
+ ...O(-s / 2 - s / 2 * .1, u / 2, s / 2 + s / 2 * .1, u / 2, l, .8),
1681
+ {
1682
+ x: s / 2 + s / 2 * .1,
1683
+ y: -u / 2
1684
+ },
1685
+ {
1686
+ x: -s / 2 - s / 2 * .1,
1687
+ y: -u / 2
1688
+ },
1689
+ {
1690
+ x: -s / 2,
1691
+ y: -u / 2
1692
+ },
1693
+ {
1694
+ x: -s / 2,
1695
+ y: u / 2 * 1.1
1696
+ },
1697
+ {
1698
+ x: -s / 2,
1699
+ y: -u / 2
1700
+ }
1701
+ ], h = f.polygon(m.map((e) => [e.x, e.y]), p), g = i.insert(() => h, ":first-child");
1702
+ return g.attr("class", "basic label-container"), d && t.look !== "handDrawn" && g.selectAll("path").attr("style", d), r && t.look !== "handDrawn" && g.selectAll("path").attr("style", r), g.attr("transform", `translate(0,${-l / 2})`), o.attr("transform", `translate(${-s / 2 + (t.padding ?? 0) + s / 2 * .1 / 2 - (a.x - (a.left ?? 0))},${-c / 2 + (t.padding ?? 0) - l / 2 - (a.y - (a.top ?? 0))})`), T(t, g), t.intersect = function(e) {
1703
+ return W.polygon(t, m, e);
1704
+ }, i;
1705
+ }
1706
+ i(Ue, "linedWaveEdgedRect");
1707
+ async function We(e, t) {
1708
+ let { labelStyles: n, nodeStyles: r } = y(t);
1709
+ t.labelStyle = n;
1710
+ let { shapeSvg: i, bbox: a, label: o } = await C(e, t, E(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 = -s / 2, u = -c / 2, { cssStyles: d } = t, f = S.svg(i), p = v(t, {}), m = [
1711
+ {
1712
+ x: l - 5,
1713
+ y: u + 5
1714
+ },
1715
+ {
1716
+ x: l - 5,
1717
+ y: u + c + 5
1718
+ },
1719
+ {
1720
+ x: l + s - 5,
1721
+ y: u + c + 5
1722
+ },
1723
+ {
1724
+ x: l + s - 5,
1725
+ y: u + c
1726
+ },
1727
+ {
1728
+ x: l + s,
1729
+ y: u + c
1730
+ },
1731
+ {
1732
+ x: l + s,
1733
+ y: u + c - 5
1734
+ },
1735
+ {
1736
+ x: l + s + 5,
1737
+ y: u + c - 5
1738
+ },
1739
+ {
1740
+ x: l + s + 5,
1741
+ y: u - 5
1742
+ },
1743
+ {
1744
+ x: l + 5,
1745
+ y: u - 5
1746
+ },
1747
+ {
1748
+ x: l + 5,
1749
+ y: u
1750
+ },
1751
+ {
1752
+ x: l,
1753
+ y: u
1754
+ },
1755
+ {
1756
+ x: l,
1757
+ y: u + 5
1758
+ }
1759
+ ], h = [
1760
+ {
1761
+ x: l,
1762
+ y: u + 5
1763
+ },
1764
+ {
1765
+ x: l + s - 5,
1766
+ y: u + 5
1767
+ },
1768
+ {
1769
+ x: l + s - 5,
1770
+ y: u + c
1771
+ },
1772
+ {
1773
+ x: l + s,
1774
+ y: u + c
1775
+ },
1776
+ {
1777
+ x: l + s,
1778
+ y: u
1779
+ },
1780
+ {
1781
+ x: l,
1782
+ y: u
1783
+ }
1784
+ ];
1785
+ t.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
1786
+ let g = D(m), _ = f.path(g, p), b = D(h), x = f.path(b, {
1787
+ ...p,
1788
+ fill: "none"
1789
+ }), w = i.insert(() => x, ":first-child");
1790
+ return w.insert(() => _, ":first-child"), w.attr("class", "basic label-container"), d && t.look !== "handDrawn" && w.selectAll("path").attr("style", d), r && t.look !== "handDrawn" && w.selectAll("path").attr("style", r), o.attr("transform", `translate(${-(a.width / 2) - 5 - (a.x - (a.left ?? 0))}, ${-(a.height / 2) + 5 - (a.y - (a.top ?? 0))})`), T(t, w), t.intersect = function(e) {
1791
+ return W.polygon(t, m, e);
1792
+ }, i;
1793
+ }
1794
+ i(We, "multiRect");
1795
+ async function Ge(e, t) {
1796
+ let { labelStyles: n, nodeStyles: r } = y(t);
1797
+ t.labelStyle = n;
1798
+ let { shapeSvg: i, bbox: a, label: o } = await C(e, t, E(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 / 4, u = c + l, d = -s / 2, f = -u / 2, { cssStyles: p } = t, m = O(d - 5, f + u + 5, d + s - 5, f + u + 5, l, .8), h = m?.[m.length - 1], g = [
1799
+ {
1800
+ x: d - 5,
1801
+ y: f + 5
1802
+ },
1803
+ {
1804
+ x: d - 5,
1805
+ y: f + u + 5
1806
+ },
1807
+ ...m,
1808
+ {
1809
+ x: d + s - 5,
1810
+ y: h.y - 5
1811
+ },
1812
+ {
1813
+ x: d + s,
1814
+ y: h.y - 5
1815
+ },
1816
+ {
1817
+ x: d + s,
1818
+ y: h.y - 10
1819
+ },
1820
+ {
1821
+ x: d + s + 5,
1822
+ y: h.y - 10
1823
+ },
1824
+ {
1825
+ x: d + s + 5,
1826
+ y: f - 5
1827
+ },
1828
+ {
1829
+ x: d + 5,
1830
+ y: f - 5
1831
+ },
1832
+ {
1833
+ x: d + 5,
1834
+ y: f
1835
+ },
1836
+ {
1837
+ x: d,
1838
+ y: f
1839
+ },
1840
+ {
1841
+ x: d,
1842
+ y: f + 5
1843
+ }
1844
+ ], _ = [
1845
+ {
1846
+ x: d,
1847
+ y: f + 5
1848
+ },
1849
+ {
1850
+ x: d + s - 5,
1851
+ y: f + 5
1852
+ },
1853
+ {
1854
+ x: d + s - 5,
1855
+ y: h.y - 5
1856
+ },
1857
+ {
1858
+ x: d + s,
1859
+ y: h.y - 5
1860
+ },
1861
+ {
1862
+ x: d + s,
1863
+ y: f
1864
+ },
1865
+ {
1866
+ x: d,
1867
+ y: f
1868
+ }
1869
+ ], b = S.svg(i), x = v(t, {});
1870
+ t.look !== "handDrawn" && (x.roughness = 0, x.fillStyle = "solid");
1871
+ let w = D(g), k = b.path(w, x), A = D(_), j = b.path(A, x), M = i.insert(() => k, ":first-child");
1872
+ return M.insert(() => j), M.attr("class", "basic label-container"), p && t.look !== "handDrawn" && M.selectAll("path").attr("style", p), r && t.look !== "handDrawn" && M.selectAll("path").attr("style", r), M.attr("transform", `translate(0,${-l / 2})`), o.attr("transform", `translate(${-(a.width / 2) - 5 - (a.x - (a.left ?? 0))}, ${-(a.height / 2) + 5 - l / 2 - (a.y - (a.top ?? 0))})`), T(t, M), t.intersect = function(e) {
1873
+ return W.polygon(t, g, e);
1874
+ }, i;
1875
+ }
1876
+ i(Ge, "multiWaveEdgedRectangle");
1877
+ async function Ke(e, t, { config: { themeVariables: n } }) {
1878
+ let { labelStyles: r, nodeStyles: i } = y(t);
1879
+ t.labelStyle = r, t.useHtmlLabels || f(p()) || (t.centerLabel = !0);
1880
+ let { shapeSvg: a, bbox: o, label: s } = await C(e, t, E(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), u = -c / 2, d = -l / 2, { cssStyles: m } = t, h = S.svg(a), g = v(t, {
1881
+ fill: n.noteBkgColor,
1882
+ stroke: n.noteBorderColor
1883
+ });
1884
+ t.look !== "handDrawn" && (g.roughness = 0, g.fillStyle = "solid");
1885
+ let _ = h.rectangle(u, d, c, l, g), b = a.insert(() => _, ":first-child");
1886
+ return b.attr("class", "basic label-container"), m && t.look !== "handDrawn" && b.selectAll("path").attr("style", m), i && t.look !== "handDrawn" && b.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))})`), T(t, b), t.intersect = function(e) {
1887
+ return W.rect(t, e);
1888
+ }, a;
1889
+ }
1890
+ i(Ke, "note");
1891
+ var qe = /* @__PURE__ */ i((e, t, n) => [
1892
+ `M${e + n / 2},${t}`,
1893
+ `L${e + n},${t - n / 2}`,
1894
+ `L${e + n / 2},${t - n}`,
1895
+ `L${e},${t - n / 2}`,
1896
+ "Z"
1897
+ ].join(" "), "createDecisionBoxPathD");
1898
+ async function Je(e, t) {
1899
+ let { labelStyles: n, nodeStyles: r } = y(t);
1900
+ t.labelStyle = n;
1901
+ let { shapeSvg: i, bbox: a } = await C(e, t, E(t)), o = a.width + t.padding + (a.height + t.padding), s = .5, c = [
1902
+ {
1903
+ x: o / 2,
1904
+ y: 0
1905
+ },
1906
+ {
1907
+ x: o,
1908
+ y: -o / 2
1909
+ },
1910
+ {
1911
+ x: o / 2,
1912
+ y: -o
1913
+ },
1914
+ {
1915
+ x: 0,
1916
+ y: -o / 2
1917
+ }
1918
+ ], l, { cssStyles: u } = t;
1919
+ if (t.look === "handDrawn") {
1920
+ let e = S.svg(i), n = v(t, {}), r = qe(0, 0, o), a = e.path(r, n);
1921
+ l = i.insert(() => a, ":first-child").attr("transform", `translate(${-o / 2 + s}, ${o / 2})`), u && l.attr("style", u);
1922
+ } else l = G(i, o, o, c), l.attr("transform", `translate(${-o / 2 + s}, ${o / 2})`);
1923
+ return r && l.attr("style", r), T(t, l), t.calcIntersect = function(e, t) {
1924
+ let n = e.width, r = [
1925
+ {
1926
+ x: n / 2,
1927
+ y: 0
1928
+ },
1929
+ {
1930
+ x: n,
1931
+ y: -n / 2
1932
+ },
1933
+ {
1934
+ x: n / 2,
1935
+ y: -n
1936
+ },
1937
+ {
1938
+ x: 0,
1939
+ y: -n / 2
1940
+ }
1941
+ ], i = W.polygon(e, r, t);
1942
+ return {
1943
+ x: i.x - .5,
1944
+ y: i.y - .5
1945
+ };
1946
+ }, t.intersect = function(e) {
1947
+ return this.calcIntersect(t, e);
1948
+ }, i;
1949
+ }
1950
+ i(Je, "question");
1951
+ async function Ye(e, t) {
1952
+ let { labelStyles: n, nodeStyles: r } = y(t);
1953
+ t.labelStyle = n;
1954
+ let { shapeSvg: i, bbox: a, label: o } = await C(e, t, E(t)), s = Math.max(a.width + (t.padding ?? 0), t?.width ?? 0), c = Math.max(a.height + (t.padding ?? 0), t?.height ?? 0), l = -s / 2, u = -c / 2, d = u / 2, f = [
1955
+ {
1956
+ x: l + d,
1957
+ y: u
1958
+ },
1959
+ {
1960
+ x: l,
1961
+ y: 0
1962
+ },
1963
+ {
1964
+ x: l + d,
1965
+ y: -u
1966
+ },
1967
+ {
1968
+ x: -l,
1969
+ y: -u
1970
+ },
1971
+ {
1972
+ x: -l,
1973
+ y: u
1974
+ }
1975
+ ], { cssStyles: p } = t, m = S.svg(i), h = v(t, {});
1976
+ t.look !== "handDrawn" && (h.roughness = 0, h.fillStyle = "solid");
1977
+ let g = D(f), _ = m.path(g, h), b = i.insert(() => _, ":first-child");
1978
+ return b.attr("class", "basic label-container"), p && t.look !== "handDrawn" && b.selectAll("path").attr("style", p), r && t.look !== "handDrawn" && b.selectAll("path").attr("style", r), b.attr("transform", `translate(${-d / 2},0)`), o.attr("transform", `translate(${-d / 2 - a.width / 2 - (a.x - (a.left ?? 0))}, ${-(a.height / 2) - (a.y - (a.top ?? 0))})`), T(t, b), t.intersect = function(e) {
1979
+ return W.polygon(t, f, e);
1980
+ }, i;
1981
+ }
1982
+ i(Ye, "rect_left_inv_arrow");
1983
+ async function Xe(e, t) {
1984
+ let { labelStyles: n, nodeStyles: i } = y(t);
1985
+ t.labelStyle = n;
1986
+ let o;
1987
+ o = t.cssClasses ? "node " + t.cssClasses : "node default";
1988
+ let s = e.insert("g").attr("class", o).attr("id", t.domId || t.id), l = s.insert("g"), u = s.insert("g").attr("class", "label").attr("style", i), d = t.description, p = t.label, m = await j(u, p, t.labelStyle, !0, !0), h = {
1989
+ width: 0,
1990
+ height: 0
1991
+ };
1992
+ if (f(c())) {
1993
+ let e = m.children[0], t = a(m);
1994
+ h = e.getBoundingClientRect(), t.attr("width", h.width), t.attr("height", h.height);
1995
+ }
1996
+ r.info("Text 2", d);
1997
+ let g = d || [], _ = m.getBBox(), b = await j(u, Array.isArray(g) ? g.join("<br/>") : g, t.labelStyle, !0, !0), x = b.children[0], C = a(b);
1998
+ h = x.getBoundingClientRect(), C.attr("width", h.width), C.attr("height", h.height);
1999
+ let w = (t.padding || 0) / 2;
2000
+ a(b).attr("transform", "translate( " + (h.width > _.width ? 0 : (_.width - h.width) / 2) + ", " + (_.height + w + 5) + ")"), a(m).attr("transform", "translate( " + (h.width < _.width ? 0 : -(_.width - h.width) / 2) + ", 0)"), h = u.node().getBBox(), u.attr("transform", "translate(" + -h.width / 2 + ", " + (-h.height / 2 - w + 3) + ")");
2001
+ let E = h.width + (t.padding || 0), D = h.height + (t.padding || 0), O = -h.width / 2 - w, k = -h.height / 2 - w, A, N;
2002
+ if (t.look === "handDrawn") {
2003
+ let e = S.svg(s), n = v(t, {}), i = e.path(M(O, k, E, D, t.rx || 0), n), a = e.line(-h.width / 2 - w, -h.height / 2 - w + _.height + w, h.width / 2 + w, -h.height / 2 - w + _.height + w, n);
2004
+ N = s.insert(() => (r.debug("Rough node insert CXC", i), a), ":first-child"), A = s.insert(() => (r.debug("Rough node insert CXC", i), i), ":first-child");
2005
+ } else A = l.insert("rect", ":first-child"), N = l.insert("line"), A.attr("class", "outer title-state").attr("style", i).attr("x", -h.width / 2 - w).attr("y", -h.height / 2 - w).attr("width", h.width + (t.padding || 0)).attr("height", h.height + (t.padding || 0)), N.attr("class", "divider").attr("x1", -h.width / 2 - w).attr("x2", h.width / 2 + w).attr("y1", -h.height / 2 - w + _.height + w).attr("y2", -h.height / 2 - w + _.height + w);
2006
+ return T(t, A), t.intersect = function(e) {
2007
+ return W.rect(t, e);
2008
+ }, s;
2009
+ }
2010
+ i(Xe, "rectWithTitle");
2011
+ async function Ze(e, t) {
2012
+ return Y(e, t, {
2013
+ rx: 5,
2014
+ ry: 5,
2015
+ classes: "",
2016
+ labelPaddingX: (t?.padding || 0) * 1,
2017
+ labelPaddingY: (t?.padding || 0) * 1
2018
+ });
2019
+ }
2020
+ i(Ze, "roundedRect");
2021
+ async function Qe(e, n) {
2022
+ let { labelStyles: r, nodeStyles: i } = y(n);
2023
+ n.labelStyle = r;
2024
+ let { shapeSvg: a, bbox: o, label: s } = await C(e, n, E(n)), c = n?.padding ?? 0, l = Math.max(o.width + (n.padding ?? 0) * 2, n?.width ?? 0), u = Math.max(o.height + (n.padding ?? 0) * 2, n?.height ?? 0), d = -o.width / 2 - c, f = -o.height / 2 - c, { cssStyles: p } = n, m = S.svg(a), h = v(n, {});
2025
+ n.look !== "handDrawn" && (h.roughness = 0, h.fillStyle = "solid");
2026
+ let g = [
2027
+ {
2028
+ x: d,
2029
+ y: f
2030
+ },
2031
+ {
2032
+ x: d + l + 8,
2033
+ y: f
2034
+ },
2035
+ {
2036
+ x: d + l + 8,
2037
+ y: f + u
2038
+ },
2039
+ {
2040
+ x: d - 8,
2041
+ y: f + u
2042
+ },
2043
+ {
2044
+ x: d - 8,
2045
+ y: f
2046
+ },
2047
+ {
2048
+ x: d,
2049
+ y: f
2050
+ },
2051
+ {
2052
+ x: d,
2053
+ y: f + u
2054
+ }
2055
+ ], _ = m.polygon(g.map((e) => [e.x, e.y]), h), b = a.insert(() => _, ":first-child");
2056
+ return b.attr("class", "basic label-container").attr("style", t(p)), i && n.look !== "handDrawn" && b.selectAll("path").attr("style", i), p && n.look !== "handDrawn" && b.selectAll("path").attr("style", i), s.attr("transform", `translate(${-l / 2 + 4 + (n.padding ?? 0) - (o.x - (o.left ?? 0))},${-u / 2 + (n.padding ?? 0) - (o.y - (o.top ?? 0))})`), T(n, b), n.intersect = function(e) {
2057
+ return W.rect(n, e);
2058
+ }, a;
2059
+ }
2060
+ i(Qe, "shadedProcess");
2061
+ async function $e(e, t) {
2062
+ let { labelStyles: n, nodeStyles: r } = y(t);
2063
+ t.labelStyle = n;
2064
+ let { shapeSvg: i, bbox: a, label: o } = await C(e, t, E(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 = -s / 2, u = -c / 2, { cssStyles: d } = t, f = S.svg(i), p = v(t, {});
2065
+ t.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
2066
+ let m = [
2067
+ {
2068
+ x: l,
2069
+ y: u
2070
+ },
2071
+ {
2072
+ x: l,
2073
+ y: u + c
2074
+ },
2075
+ {
2076
+ x: l + s,
2077
+ y: u + c
2078
+ },
2079
+ {
2080
+ x: l + s,
2081
+ y: u - c / 2
2082
+ }
2083
+ ], h = D(m), g = f.path(h, p), _ = i.insert(() => g, ":first-child");
2084
+ return _.attr("class", "basic label-container"), d && t.look !== "handDrawn" && _.selectChildren("path").attr("style", d), r && t.look !== "handDrawn" && _.selectChildren("path").attr("style", r), _.attr("transform", `translate(0, ${c / 4})`), o.attr("transform", `translate(${-s / 2 + (t.padding ?? 0) - (a.x - (a.left ?? 0))}, ${-c / 4 + (t.padding ?? 0) - (a.y - (a.top ?? 0))})`), T(t, _), t.intersect = function(e) {
2085
+ return W.polygon(t, m, e);
2086
+ }, i;
2087
+ }
2088
+ i($e, "slopedRect");
2089
+ async function et(e, t) {
2090
+ return Y(e, t, {
2091
+ rx: 0,
2092
+ ry: 0,
2093
+ classes: "",
2094
+ labelPaddingX: t.labelPaddingX ?? (t?.padding || 0) * 2,
2095
+ labelPaddingY: (t?.padding || 0) * 1
2096
+ });
2097
+ }
2098
+ i(et, "squareRect");
2099
+ async function tt(e, t) {
2100
+ let { labelStyles: n, nodeStyles: r } = y(t);
2101
+ t.labelStyle = n;
2102
+ let { shapeSvg: i, bbox: a } = await C(e, t, E(t)), o = a.height + t.padding, s = a.width + o / 4 + t.padding, c = o / 2, { cssStyles: l } = t, u = S.svg(i), d = v(t, {});
2103
+ t.look !== "handDrawn" && (d.roughness = 0, d.fillStyle = "solid");
2104
+ let f = [
2105
+ {
2106
+ x: -s / 2 + c,
2107
+ y: -o / 2
2108
+ },
2109
+ {
2110
+ x: s / 2 - c,
2111
+ y: -o / 2
2112
+ },
2113
+ ...k(-s / 2 + c, 0, c, 50, 90, 270),
2114
+ {
2115
+ x: s / 2 - c,
2116
+ y: o / 2
2117
+ },
2118
+ ...k(s / 2 - c, 0, c, 50, 270, 450)
2119
+ ], p = D(f), m = u.path(p, d), h = i.insert(() => m, ":first-child");
2120
+ return h.attr("class", "basic label-container outer-path"), l && t.look !== "handDrawn" && h.selectChildren("path").attr("style", l), r && t.look !== "handDrawn" && h.selectChildren("path").attr("style", r), T(t, h), t.intersect = function(e) {
2121
+ return W.polygon(t, f, e);
2122
+ }, i;
2123
+ }
2124
+ i(tt, "stadium");
2125
+ async function nt(e, t) {
2126
+ return Y(e, t, {
2127
+ rx: 5,
2128
+ ry: 5,
2129
+ classes: "flowchart-node"
2130
+ });
2131
+ }
2132
+ i(nt, "state");
2133
+ function rt(e, t, { config: { themeVariables: n } }) {
2134
+ let { labelStyles: r, nodeStyles: i } = y(t);
2135
+ t.labelStyle = r;
2136
+ let { cssStyles: a } = t, { lineColor: o, stateBorder: s, nodeBorder: c } = n, l = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), u = S.svg(l), d = v(t, {});
2137
+ t.look !== "handDrawn" && (d.roughness = 0, d.fillStyle = "solid");
2138
+ let f = u.circle(0, 0, 14, {
2139
+ ...d,
2140
+ stroke: o,
2141
+ strokeWidth: 2
2142
+ }), p = s ?? c, m = u.circle(0, 0, 5, {
2143
+ ...d,
2144
+ fill: p,
2145
+ stroke: p,
2146
+ strokeWidth: 2,
2147
+ fillStyle: "solid"
2148
+ }), h = l.insert(() => f, ":first-child");
2149
+ return h.insert(() => m), a && h.selectAll("path").attr("style", a), i && h.selectAll("path").attr("style", i), T(t, h), t.intersect = function(e) {
2150
+ return W.circle(t, 7, e);
2151
+ }, l;
2152
+ }
2153
+ i(rt, "stateEnd");
2154
+ function it(e, t, { config: { themeVariables: n } }) {
2155
+ let { lineColor: r } = n, i = e.insert("g").attr("class", "node default").attr("id", t.domId || t.id), a;
2156
+ if (t.look === "handDrawn") {
2157
+ let e = S.svg(i).circle(0, 0, 14, b(r));
2158
+ a = i.insert(() => e), a.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14);
2159
+ } else a = i.insert("circle", ":first-child"), a.attr("class", "state-start").attr("r", 7).attr("width", 14).attr("height", 14);
2160
+ return T(t, a), t.intersect = function(e) {
2161
+ return W.circle(t, 7, e);
2162
+ }, i;
2163
+ }
2164
+ i(it, "stateStart");
2165
+ async function at(e, n) {
2166
+ let { labelStyles: r, nodeStyles: i } = y(n);
2167
+ n.labelStyle = r;
2168
+ let { shapeSvg: a, bbox: o } = await C(e, n, E(n)), s = (n?.padding || 0) / 2, c = o.width + n.padding, l = o.height + n.padding, u = -o.width / 2 - s, d = -o.height / 2 - s, f = [
2169
+ {
2170
+ x: 0,
2171
+ y: 0
2172
+ },
2173
+ {
2174
+ x: c,
2175
+ y: 0
2176
+ },
2177
+ {
2178
+ x: c,
2179
+ y: -l
2180
+ },
2181
+ {
2182
+ x: 0,
2183
+ y: -l
2184
+ },
2185
+ {
2186
+ x: 0,
2187
+ y: 0
2188
+ },
2189
+ {
2190
+ x: -8,
2191
+ y: 0
2192
+ },
2193
+ {
2194
+ x: c + 8,
2195
+ y: 0
2196
+ },
2197
+ {
2198
+ x: c + 8,
2199
+ y: -l
2200
+ },
2201
+ {
2202
+ x: -8,
2203
+ y: -l
2204
+ },
2205
+ {
2206
+ x: -8,
2207
+ y: 0
2208
+ }
2209
+ ];
2210
+ if (n.look === "handDrawn") {
2211
+ let e = S.svg(a), r = v(n, {}), i = e.rectangle(u - 8, d, c + 16, l, r), o = e.line(u, d, u, d + l, r), s = e.line(u + c, d, u + c, d + l, r);
2212
+ a.insert(() => o, ":first-child"), a.insert(() => s, ":first-child");
2213
+ let f = a.insert(() => i, ":first-child"), { cssStyles: p } = n;
2214
+ f.attr("class", "basic label-container").attr("style", t(p)), T(n, f);
2215
+ } else {
2216
+ let e = G(a, c, l, f);
2217
+ i && e.attr("style", i), T(n, e);
2218
+ }
2219
+ return n.intersect = function(e) {
2220
+ return W.polygon(n, f, e);
2221
+ }, a;
2222
+ }
2223
+ i(at, "subroutine");
2224
+ async function ot(e, t) {
2225
+ let { labelStyles: n, nodeStyles: r } = y(t);
2226
+ t.labelStyle = n;
2227
+ let { shapeSvg: i, bbox: a } = await C(e, t, E(t)), o = Math.max(a.width + (t.padding ?? 0) * 2, t?.width ?? 0), s = Math.max(a.height + (t.padding ?? 0) * 2, t?.height ?? 0), c = -o / 2, l = -s / 2, u = .2 * s, d = .2 * s, { cssStyles: f } = t, p = S.svg(i), m = v(t, {}), h = [
2228
+ {
2229
+ x: c - u / 2,
2230
+ y: l
2231
+ },
2232
+ {
2233
+ x: c + o + u / 2,
2234
+ y: l
2235
+ },
2236
+ {
2237
+ x: c + o + u / 2,
2238
+ y: l + s
2239
+ },
2240
+ {
2241
+ x: c - u / 2,
2242
+ y: l + s
2243
+ }
2244
+ ], g = [
2245
+ {
2246
+ x: c + o - u / 2,
2247
+ y: l + s
2248
+ },
2249
+ {
2250
+ x: c + o + u / 2,
2251
+ y: l + s
2252
+ },
2253
+ {
2254
+ x: c + o + u / 2,
2255
+ y: l + s - d
2256
+ }
2257
+ ];
2258
+ t.look !== "handDrawn" && (m.roughness = 0, m.fillStyle = "solid");
2259
+ let _ = D(h), b = p.path(_, m), x = D(g), w = p.path(x, {
2260
+ ...m,
2261
+ fillStyle: "solid"
2262
+ }), O = i.insert(() => w, ":first-child");
2263
+ return O.insert(() => b, ":first-child"), O.attr("class", "basic label-container"), f && t.look !== "handDrawn" && O.selectAll("path").attr("style", f), r && t.look !== "handDrawn" && O.selectAll("path").attr("style", r), T(t, O), t.intersect = function(e) {
2264
+ return W.polygon(t, h, e);
2265
+ }, i;
2266
+ }
2267
+ i(ot, "taggedRect");
2268
+ async function st(e, t) {
2269
+ let { labelStyles: n, nodeStyles: r } = y(t);
2270
+ t.labelStyle = n;
2271
+ let { shapeSvg: i, bbox: a, label: o } = await C(e, t, E(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 / 4, u = .2 * s, d = .2 * c, f = c + l, { cssStyles: p } = t, m = S.svg(i), h = v(t, {});
2272
+ t.look !== "handDrawn" && (h.roughness = 0, h.fillStyle = "solid");
2273
+ let g = [
2274
+ {
2275
+ x: -s / 2 - s / 2 * .1,
2276
+ y: f / 2
2277
+ },
2278
+ ...O(-s / 2 - s / 2 * .1, f / 2, s / 2 + s / 2 * .1, f / 2, l, .8),
2279
+ {
2280
+ x: s / 2 + s / 2 * .1,
2281
+ y: -f / 2
2282
+ },
2283
+ {
2284
+ x: -s / 2 - s / 2 * .1,
2285
+ y: -f / 2
2286
+ }
2287
+ ], _ = -s / 2 + s / 2 * .1, b = -f / 2 - d * .4, x = [
2288
+ {
2289
+ x: _ + s - u,
2290
+ y: (b + c) * 1.4
2291
+ },
2292
+ {
2293
+ x: _ + s,
2294
+ y: b + c - d
2295
+ },
2296
+ {
2297
+ x: _ + s,
2298
+ y: (b + c) * .9
2299
+ },
2300
+ ...O(_ + s, (b + c) * 1.3, _ + s - u, (b + c) * 1.5, -c * .03, .5)
2301
+ ], w = D(g), k = m.path(w, h), A = D(x), j = m.path(A, {
2302
+ ...h,
2303
+ fillStyle: "solid"
2304
+ }), M = i.insert(() => j, ":first-child");
2305
+ return M.insert(() => k, ":first-child"), M.attr("class", "basic label-container"), p && t.look !== "handDrawn" && M.selectAll("path").attr("style", p), r && t.look !== "handDrawn" && M.selectAll("path").attr("style", r), M.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))})`), T(t, M), t.intersect = function(e) {
2306
+ return W.polygon(t, g, e);
2307
+ }, i;
2308
+ }
2309
+ i(st, "taggedWaveEdgedRectangle");
2310
+ async function ct(e, t) {
2311
+ let { labelStyles: n, nodeStyles: r } = y(t);
2312
+ t.labelStyle = n;
2313
+ let { shapeSvg: i, bbox: a } = await C(e, t, E(t)), o = Math.max(a.width + t.padding, t?.width || 0), s = Math.max(a.height + t.padding, t?.height || 0), c = -o / 2, l = -s / 2, u = i.insert("rect", ":first-child");
2314
+ 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), T(t, u), t.intersect = function(e) {
2315
+ return W.rect(t, e);
2316
+ }, i;
2317
+ }
2318
+ i(ct, "text");
2319
+ var lt = /* @__PURE__ */ i((e, t, n, r, i, a) => `M${e},${t}
2320
+ a${i},${a} 0,0,1 0,${-r}
2321
+ l${n},0
2322
+ a${i},${a} 0,0,1 0,${r}
2323
+ M${n},${-r}
2324
+ a${i},${a} 0,0,0 0,${r}
2325
+ l${-n},0`, "createCylinderPathD"), ut = /* @__PURE__ */ i((e, t, n, r, i, a) => [
2326
+ `M${e},${t}`,
2327
+ `M${e + n},${t}`,
2328
+ `a${i},${a} 0,0,0 0,${-r}`,
2329
+ `l${-n},0`,
2330
+ `a${i},${a} 0,0,0 0,${r}`,
2331
+ `l${n},0`
2332
+ ].join(" "), "createOuterCylinderPathD"), dt = /* @__PURE__ */ i((e, t, n, r, i, a) => [`M${e + n / 2},${-r / 2}`, `a${i},${a} 0,0,0 0,${r}`].join(" "), "createInnerCylinderPathD");
2333
+ async function ft(e, n) {
2334
+ let { labelStyles: r, nodeStyles: i } = y(n);
2335
+ n.labelStyle = r;
2336
+ let { shapeSvg: a, bbox: o, label: s, halfPadding: c } = await C(e, n, E(n)), l = n.look === "neo" ? c * 2 : c, u = o.height + l, d = u / 2, f = d / (2.5 + u / 50), p = o.width + f + l, { cssStyles: m } = n, h;
2337
+ if (n.look === "handDrawn") {
2338
+ let e = S.svg(a), t = ut(0, 0, p, u, f, d), r = dt(0, 0, p, u, f, d), i = e.path(t, v(n, {})), o = e.path(r, v(n, { fill: "none" }));
2339
+ h = a.insert(() => o, ":first-child"), h = a.insert(() => i, ":first-child"), h.attr("class", "basic label-container"), m && h.attr("style", m);
2340
+ } else {
2341
+ let e = lt(0, 0, p, u, f, d);
2342
+ h = a.insert("path", ":first-child").attr("d", e).attr("class", "basic label-container").attr("style", t(m)).attr("style", i), h.attr("class", "basic label-container"), m && h.selectAll("path").attr("style", m), i && h.selectAll("path").attr("style", i);
2343
+ }
2344
+ return h.attr("label-offset-x", f), h.attr("transform", `translate(${-p / 2}, ${u / 2} )`), s.attr("transform", `translate(${-(o.width / 2) - f - (o.x - (o.left ?? 0))}, ${-(o.height / 2) - (o.y - (o.top ?? 0))})`), T(n, h), n.intersect = function(e) {
2345
+ let t = W.rect(n, e), r = t.y - (n.y ?? 0);
2346
+ if (d != 0 && (Math.abs(r) < (n.height ?? 0) / 2 || Math.abs(r) == (n.height ?? 0) / 2 && Math.abs(t.x - (n.x ?? 0)) > (n.width ?? 0) / 2 - f)) {
2347
+ let i = f * f * (1 - r * r / (d * d));
2348
+ i != 0 && (i = Math.sqrt(Math.abs(i))), i = f - i, e.x - (n.x ?? 0) > 0 && (i = -i), t.x += i;
2349
+ }
2350
+ return t;
2351
+ }, a;
2352
+ }
2353
+ i(ft, "tiltedCylinder");
2354
+ async function pt(e, t) {
2355
+ let { labelStyles: n, nodeStyles: r } = y(t);
2356
+ t.labelStyle = n;
2357
+ let { shapeSvg: i, bbox: a } = await C(e, t, E(t)), o = a.width + t.padding, s = a.height + t.padding, c = [
2358
+ {
2359
+ x: -3 * s / 6,
2360
+ y: 0
2361
+ },
2362
+ {
2363
+ x: o + 3 * s / 6,
2364
+ y: 0
2365
+ },
2366
+ {
2367
+ x: o,
2368
+ y: -s
2369
+ },
2370
+ {
2371
+ x: 0,
2372
+ y: -s
2373
+ }
2374
+ ], l, { cssStyles: u } = t;
2375
+ if (t.look === "handDrawn") {
2376
+ let e = S.svg(i), n = v(t, {}), r = D(c), a = e.path(r, n);
2377
+ l = i.insert(() => a, ":first-child").attr("transform", `translate(${-o / 2}, ${s / 2})`), u && l.attr("style", u);
2378
+ } else l = G(i, o, s, c);
2379
+ return r && l.attr("style", r), t.width = o, t.height = s, T(t, l), t.intersect = function(e) {
2380
+ return W.polygon(t, c, e);
2381
+ }, i;
2382
+ }
2383
+ i(pt, "trapezoid");
2384
+ async function mt(e, t) {
2385
+ let { labelStyles: n, nodeStyles: r } = y(t);
2386
+ t.labelStyle = n;
2387
+ let { shapeSvg: i, bbox: a } = await C(e, t, E(t)), o = Math.max(60, a.width + (t.padding ?? 0) * 2, t?.width ?? 0), s = Math.max(20, a.height + (t.padding ?? 0) * 2, t?.height ?? 0), { cssStyles: c } = t, l = S.svg(i), u = v(t, {});
2388
+ t.look !== "handDrawn" && (u.roughness = 0, u.fillStyle = "solid");
2389
+ let d = [
2390
+ {
2391
+ x: -o / 2 * .8,
2392
+ y: -s / 2
2393
+ },
2394
+ {
2395
+ x: o / 2 * .8,
2396
+ y: -s / 2
2397
+ },
2398
+ {
2399
+ x: o / 2,
2400
+ y: -s / 2 * .6
2401
+ },
2402
+ {
2403
+ x: o / 2,
2404
+ y: s / 2
2405
+ },
2406
+ {
2407
+ x: -o / 2,
2408
+ y: s / 2
2409
+ },
2410
+ {
2411
+ x: -o / 2,
2412
+ y: -s / 2 * .6
2413
+ }
2414
+ ], f = D(d), p = l.path(f, u), m = i.insert(() => p, ":first-child");
2415
+ return m.attr("class", "basic label-container"), c && t.look !== "handDrawn" && m.selectChildren("path").attr("style", c), r && t.look !== "handDrawn" && m.selectChildren("path").attr("style", r), T(t, m), t.intersect = function(e) {
2416
+ return W.polygon(t, d, e);
2417
+ }, i;
2418
+ }
2419
+ i(mt, "trapezoidalPentagon");
2420
+ async function ht(e, t) {
2421
+ let { labelStyles: n, nodeStyles: i } = y(t);
2422
+ t.labelStyle = n;
2423
+ let { shapeSvg: a, bbox: o, label: s } = await C(e, t, E(t)), l = t.useHtmlLabels || f(c()), u = o.width + (t.padding ?? 0), d = u + o.height, p = u + o.height, m = [
2424
+ {
2425
+ x: 0,
2426
+ y: 0
2427
+ },
2428
+ {
2429
+ x: p,
2430
+ y: 0
2431
+ },
2432
+ {
2433
+ x: p / 2,
2434
+ y: -d
2435
+ }
2436
+ ], { cssStyles: h } = t, g = S.svg(a), _ = v(t, {});
2437
+ t.look !== "handDrawn" && (_.roughness = 0, _.fillStyle = "solid");
2438
+ let b = D(m), x = g.path(b, _), w = a.insert(() => x, ":first-child").attr("transform", `translate(${-d / 2}, ${d / 2})`);
2439
+ return h && t.look !== "handDrawn" && w.selectChildren("path").attr("style", h), i && t.look !== "handDrawn" && w.selectChildren("path").attr("style", i), t.width = u, t.height = d, T(t, w), s.attr("transform", `translate(${-o.width / 2 - (o.x - (o.left ?? 0))}, ${d / 2 - (o.height + (t.padding ?? 0) / (l ? 2 : 1) - (o.y - (o.top ?? 0)))})`), t.intersect = function(e) {
2440
+ return r.info("Triangle intersect", t, m, e), W.polygon(t, m, e);
2441
+ }, a;
2442
+ }
2443
+ i(ht, "triangle");
2444
+ async function gt(e, t) {
2445
+ let { labelStyles: n, nodeStyles: r } = y(t);
2446
+ t.labelStyle = n;
2447
+ let { shapeSvg: i, bbox: a, label: o } = await C(e, t, E(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 = c + l, { cssStyles: d } = t, f = 70 - s, p = f > 0 ? f / 2 : 0, m = S.svg(i), h = v(t, {});
2448
+ t.look !== "handDrawn" && (h.roughness = 0, h.fillStyle = "solid");
2449
+ let g = [
2450
+ {
2451
+ x: -s / 2 - p,
2452
+ y: u / 2
2453
+ },
2454
+ ...O(-s / 2 - p, u / 2, s / 2 + p, u / 2, l, .8),
2455
+ {
2456
+ x: s / 2 + p,
2457
+ y: -u / 2
2458
+ },
2459
+ {
2460
+ x: -s / 2 - p,
2461
+ y: -u / 2
2462
+ }
2463
+ ], _ = D(g), b = m.path(_, h), x = i.insert(() => b, ":first-child");
2464
+ return x.attr("class", "basic label-container"), d && t.look !== "handDrawn" && x.selectAll("path").attr("style", d), r && t.look !== "handDrawn" && x.selectAll("path").attr("style", r), x.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 - (a.y - (a.top ?? 0))})`), T(t, x), t.intersect = function(e) {
2465
+ return W.polygon(t, g, e);
2466
+ }, i;
2467
+ }
2468
+ i(gt, "waveEdgedRectangle");
2469
+ async function _t(e, t) {
2470
+ let { labelStyles: n, nodeStyles: r } = y(t);
2471
+ t.labelStyle = n;
2472
+ let { shapeSvg: i, bbox: a } = await C(e, t, E(t)), o = Math.max(a.width + (t.padding ?? 0) * 2, t?.width ?? 0), s = Math.max(a.height + (t.padding ?? 0) * 2, t?.height ?? 0), c = o / s, l = o, u = s;
2473
+ l > u * c ? u = l / c : l = u * c, l = Math.max(l, 100), u = Math.max(u, 50);
2474
+ let d = Math.min(u * .2, u / 4), f = u + d * 2, { cssStyles: p } = t, m = S.svg(i), h = v(t, {});
2475
+ t.look !== "handDrawn" && (h.roughness = 0, h.fillStyle = "solid");
2476
+ let g = [
2477
+ {
2478
+ x: -l / 2,
2479
+ y: f / 2
2480
+ },
2481
+ ...O(-l / 2, f / 2, l / 2, f / 2, d, 1),
2482
+ {
2483
+ x: l / 2,
2484
+ y: -f / 2
2485
+ },
2486
+ ...O(l / 2, -f / 2, -l / 2, -f / 2, d, -1)
2487
+ ], _ = D(g), b = m.path(_, h), x = i.insert(() => b, ":first-child");
2488
+ return x.attr("class", "basic label-container"), p && t.look !== "handDrawn" && x.selectAll("path").attr("style", p), r && t.look !== "handDrawn" && x.selectAll("path").attr("style", r), T(t, x), t.intersect = function(e) {
2489
+ return W.polygon(t, g, e);
2490
+ }, i;
2491
+ }
2492
+ i(_t, "waveRectangle");
2493
+ async function vt(e, t) {
2494
+ let { labelStyles: n, nodeStyles: r } = y(t);
2495
+ t.labelStyle = n;
2496
+ let { shapeSvg: i, bbox: a, label: o } = await C(e, t, E(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 = -s / 2, u = -c / 2, { cssStyles: d } = t, f = S.svg(i), p = v(t, {}), m = [
2497
+ {
2498
+ x: l - 5,
2499
+ y: u - 5
2500
+ },
2501
+ {
2502
+ x: l - 5,
2503
+ y: u + c
2504
+ },
2505
+ {
2506
+ x: l + s,
2507
+ y: u + c
2508
+ },
2509
+ {
2510
+ x: l + s,
2511
+ y: u - 5
2512
+ }
2513
+ ], h = `M${l - 5},${u - 5} L${l + s},${u - 5} L${l + s},${u + c} L${l - 5},${u + c} L${l - 5},${u - 5}
2514
+ M${l - 5},${u} L${l + s},${u}
2515
+ M${l},${u - 5} L${l},${u + c}`;
2516
+ t.look !== "handDrawn" && (p.roughness = 0, p.fillStyle = "solid");
2517
+ let g = f.path(h, p), _ = i.insert(() => g, ":first-child");
2518
+ return _.attr("transform", `translate(${5 / 2}, ${5 / 2})`), _.attr("class", "basic label-container"), d && t.look !== "handDrawn" && _.selectAll("path").attr("style", d), r && t.look !== "handDrawn" && _.selectAll("path").attr("style", r), o.attr("transform", `translate(${-(a.width / 2) + 5 / 2 - (a.x - (a.left ?? 0))}, ${-(a.height / 2) + 5 / 2 - (a.y - (a.top ?? 0))})`), T(t, _), t.intersect = function(e) {
2519
+ return W.polygon(t, m, e);
2520
+ }, i;
2521
+ }
2522
+ i(vt, "windowPane");
2523
+ async function yt(e, t) {
2524
+ let r = t;
2525
+ if (r.alias && (t.label = r.alias), t.look === "handDrawn") {
2526
+ let { themeVariables: n } = p(), { background: r } = n;
2527
+ await yt(e, {
2528
+ ...t,
2529
+ id: t.id + "-background",
2530
+ look: "default",
2531
+ cssStyles: ["stroke: none", `fill: ${r}`]
2532
+ });
2533
+ }
2534
+ let i = p();
2535
+ t.useHtmlLabels = i.htmlLabels;
2536
+ let o = i.er?.diagramPadding ?? 10, s = i.er?.entityPadding ?? 6, { cssStyles: c } = t, { labelStyles: u, nodeStyles: d } = y(t);
2537
+ if (r.attributes.length === 0 && t.label) {
2538
+ let r = {
2539
+ rx: 0,
2540
+ ry: 0,
2541
+ labelPaddingX: o,
2542
+ labelPaddingY: o * 1.5,
2543
+ classes: ""
2544
+ };
2545
+ n(t.label, i) + r.labelPaddingX * 2 < i.er.minEntityWidth && (t.width = i.er.minEntityWidth);
2546
+ let a = await Y(e, t, r);
2547
+ if (!l(i.htmlLabels)) {
2548
+ let e = a.select("text"), t = e.node()?.getBBox();
2549
+ e.attr("transform", `translate(${-t.width / 2}, 0)`);
2550
+ }
2551
+ return a;
2552
+ }
2553
+ i.htmlLabels || (o *= 1.25, s *= 1.25);
2554
+ let f = E(t);
2555
+ f ||= "node default";
2556
+ let m = e.insert("g").attr("class", f).attr("id", t.domId || t.id), h = await X(m, t.label ?? "", i, 0, 0, ["name"], u);
2557
+ h.height += s;
2558
+ let g = 0, _ = [], b = [], x = 0, C = 0, w = 0, D = 0, O = !0, k = !0;
2559
+ for (let e of r.attributes) {
2560
+ let t = await X(m, e.type, i, 0, g, ["attribute-type"], u);
2561
+ x = Math.max(x, t.width + o);
2562
+ let n = await X(m, e.name, i, 0, g, ["attribute-name"], u);
2563
+ C = Math.max(C, n.width + o);
2564
+ let r = await X(m, e.keys.join(), i, 0, g, ["attribute-keys"], u);
2565
+ w = Math.max(w, r.width + o);
2566
+ let a = await X(m, e.comment, i, 0, g, ["attribute-comment"], u);
2567
+ D = Math.max(D, a.width + o);
2568
+ let c = Math.max(t.height, n.height, r.height, a.height) + s;
2569
+ b.push({
2570
+ yOffset: g,
2571
+ rowHeight: c
2572
+ }), g += c;
2573
+ }
2574
+ let A = 4;
2575
+ w <= o && (O = !1, w = 0, A--), D <= o && (k = !1, D = 0, A--);
2576
+ let j = m.node().getBBox();
2577
+ if (h.width + o * 2 - (x + C + w + D) > 0) {
2578
+ let e = h.width + o * 2 - (x + C + w + D);
2579
+ x += e / A, C += e / A, w > 0 && (w += e / A), D > 0 && (D += e / A);
2580
+ }
2581
+ let M = x + C + w + D, N = S.svg(m), P = v(t, {});
2582
+ t.look !== "handDrawn" && (P.roughness = 0, P.fillStyle = "solid");
2583
+ let F = 0;
2584
+ b.length > 0 && (F = b.reduce((e, t) => e + (t?.rowHeight ?? 0), 0));
2585
+ let I = Math.max(j.width + o * 2, t?.width || 0, M), L = Math.max((F ?? 0) + h.height, t?.height || 0), R = -I / 2, z = -L / 2;
2586
+ m.selectAll("g:not(:first-child)").each((e, t, n) => {
2587
+ let r = a(n[t]), i = r.attr("transform"), c = 0, l = 0;
2588
+ if (i) {
2589
+ let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(i);
2590
+ e && (c = parseFloat(e[1]), l = parseFloat(e[2]), r.attr("class").includes("attribute-name") ? c += x : r.attr("class").includes("attribute-keys") ? c += x + C : r.attr("class").includes("attribute-comment") && (c += x + C + w));
2591
+ }
2592
+ r.attr("transform", `translate(${R + o / 2 + c}, ${l + z + h.height + s / 2})`);
2593
+ }), m.select(".name").attr("transform", "translate(" + -h.width / 2 + ", " + (z + s / 2) + ")");
2594
+ let B = N.rectangle(R, z, I, L, P), V = m.insert(() => B, ":first-child").attr("style", c.join("")), { themeVariables: ee } = p(), { rowEven: te, rowOdd: ne, nodeBorder: H } = ee;
2595
+ _.push(0);
2596
+ for (let [e, t] of b.entries()) {
2597
+ let n = (e + 1) % 2 == 0 && t.yOffset !== 0, r = N.rectangle(R, h.height + z + t?.yOffset, I, t?.rowHeight, {
2598
+ ...P,
2599
+ fill: n ? te : ne,
2600
+ stroke: H
2601
+ });
2602
+ m.insert(() => r, "g.label").attr("style", c.join("")).attr("class", `row-rect-${n ? "even" : "odd"}`);
2603
+ }
2604
+ let U = N.line(R, h.height + z, I + R, h.height + z, P);
2605
+ m.insert(() => U).attr("class", "divider"), U = N.line(x + R, h.height + z, x + R, L + z, P), m.insert(() => U).attr("class", "divider"), O && (U = N.line(x + C + R, h.height + z, x + C + R, L + z, P), m.insert(() => U).attr("class", "divider")), k && (U = N.line(x + C + w + R, h.height + z, x + C + w + R, L + z, P), m.insert(() => U).attr("class", "divider"));
2606
+ for (let e of _) U = N.line(R, h.height + z + e, I + R, h.height + z + e, P), m.insert(() => U).attr("class", "divider");
2607
+ if (T(t, V), d && t.look !== "handDrawn") {
2608
+ let e = d.split(";")?.filter((e) => e.includes("stroke"))?.map((e) => `${e}`).join("; ");
2609
+ m.selectAll("path").attr("style", e ?? ""), m.selectAll(".row-rect-even path").attr("style", d);
2610
+ }
2611
+ return t.intersect = function(e) {
2612
+ return W.rect(t, e);
2613
+ }, m;
2614
+ }
2615
+ i(yt, "erBox");
2616
+ async function X(e, t, r, i = 0, o = 0, s = [], c = "") {
2617
+ let d = e.insert("g").attr("class", `label ${s.join(" ")}`).attr("transform", `translate(${i}, ${o})`).attr("style", c);
2618
+ t !== u(t) && (t = u(t), t = t.replaceAll("<", "&lt;").replaceAll(">", "&gt;"));
2619
+ let f = d.node().appendChild(await m(d, t, {
2620
+ width: n(t, r) + 100,
2621
+ style: c,
2622
+ useHtmlLabels: r.htmlLabels
2623
+ }, r));
2624
+ if (t.includes("&lt;") || t.includes("&gt;")) {
2625
+ let e = f.children[0];
2626
+ for (e.textContent = e.textContent.replaceAll("&lt;", "<").replaceAll("&gt;", ">"); e.childNodes[0];) e = e.childNodes[0], e.textContent = e.textContent.replaceAll("&lt;", "<").replaceAll("&gt;", ">");
2627
+ }
2628
+ let p = f.getBBox();
2629
+ if (l(r.htmlLabels)) {
2630
+ let e = f.children[0];
2631
+ e.style.textAlign = "start";
2632
+ let t = a(f);
2633
+ p = e.getBoundingClientRect(), t.attr("width", p.width), t.attr("height", p.height);
2634
+ }
2635
+ return p;
2636
+ }
2637
+ i(X, "addText");
2638
+ async function bt(e, t, n, r, i = n.class.padding ?? 12) {
2639
+ let a = r ? 0 : 3, o = e.insert("g").attr("class", E(t)).attr("id", t.domId || t.id), s = null, c = null, l = null, u = null, d = 0, f = 0, p = 0;
2640
+ if (s = o.insert("g").attr("class", "annotation-group text"), t.annotations.length > 0) {
2641
+ let e = t.annotations[0];
2642
+ await Z(s, { text: `\xAB${e}\xBB` }, 0), d = s.node().getBBox().height;
2643
+ }
2644
+ c = o.insert("g").attr("class", "label-group text"), await Z(c, t, 0, ["font-weight: bolder"]);
2645
+ let m = c.node().getBBox();
2646
+ f = m.height, l = o.insert("g").attr("class", "members-group text");
2647
+ let h = 0;
2648
+ for (let e of t.members) {
2649
+ let t = await Z(l, e, h, [e.parseClassifier()]);
2650
+ h += t + a;
2651
+ }
2652
+ p = l.node().getBBox().height, p <= 0 && (p = i / 2), u = o.insert("g").attr("class", "methods-group text");
2653
+ let g = 0;
2654
+ for (let e of t.methods) {
2655
+ let t = await Z(u, e, g, [e.parseClassifier()]);
2656
+ g += t + a;
2657
+ }
2658
+ let _ = o.node().getBBox();
2659
+ if (s !== null) {
2660
+ let e = s.node().getBBox();
2661
+ s.attr("transform", `translate(${-e.width / 2})`);
2662
+ }
2663
+ 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(), {
2664
+ shapeSvg: o,
2665
+ bbox: _
2666
+ };
2667
+ }
2668
+ i(bt, "textHelper");
2669
+ async function Z(t, r, o, c = []) {
2670
+ let u = t.insert("g").attr("class", "label").attr("style", c.join("; ")), f = p(), h = "useHtmlLabels" in r ? r.useHtmlLabels : l(f.htmlLabels) ?? !0, g = "";
2671
+ g = "text" in r ? r.text : r.label, !h && g.startsWith("\\") && (g = g.substring(1)), d(g) && (h = !0);
2672
+ let _ = await m(u, s(e(g)), {
2673
+ width: n(g, f) + 50,
2674
+ classes: "markdown-node-label",
2675
+ useHtmlLabels: h
2676
+ }, f), v, y = 1;
2677
+ if (h) {
2678
+ let e = _.children[0], t = a(_);
2679
+ y = e.innerHTML.split("<br>").length, e.innerHTML.includes("</math>") && (y += e.innerHTML.split("<mrow>").length - 1);
2680
+ let n = e.getElementsByTagName("img");
2681
+ if (n) {
2682
+ let e = g.replace(/<img[^>]*>/g, "").trim() === "";
2683
+ await Promise.all([...n].map((t) => new Promise((n) => {
2684
+ function r() {
2685
+ if (t.style.display = "flex", t.style.flexDirection = "column", e) {
2686
+ let e = f.fontSize?.toString() ?? window.getComputedStyle(document.body).fontSize, n = parseInt(e, 10) * 5 + "px";
2687
+ t.style.minWidth = n, t.style.maxWidth = n;
2688
+ } else t.style.width = "100%";
2689
+ n(t);
2690
+ }
2691
+ i(r, "setupImage"), setTimeout(() => {
2692
+ t.complete && r();
2693
+ }), t.addEventListener("error", r), t.addEventListener("load", r);
2694
+ })));
2695
+ }
2696
+ v = e.getBoundingClientRect(), t.attr("width", v.width), t.attr("height", v.height);
2697
+ } else {
2698
+ c.includes("font-weight: bolder") && a(_).selectAll("tspan").attr("font-weight", ""), y = _.children.length;
2699
+ let e = _.children[0];
2700
+ (_.textContent === "" || _.textContent.includes("&gt")) && (e.textContent = g[0] + g.substring(1).replaceAll("&gt;", ">").replaceAll("&lt;", "<").trim(), g[1] === " " && (e.textContent = e.textContent[0] + " " + e.textContent.substring(1))), e.textContent === "undefined" && (e.textContent = ""), v = _.getBBox();
2701
+ }
2702
+ return u.attr("transform", "translate(0," + (-v.height / (2 * y) + o) + ")"), v.height;
2703
+ }
2704
+ i(Z, "addText");
2705
+ async function xt(e, t) {
2706
+ let n = c(), r = n.class.padding ?? 12, i = r, o = t.useHtmlLabels ?? l(n.htmlLabels) ?? !0, s = t;
2707
+ s.annotations = s.annotations ?? [], s.members = s.members ?? [], s.methods = s.methods ?? [];
2708
+ let { shapeSvg: u, bbox: d } = await bt(e, t, n, o, i), { labelStyles: f, nodeStyles: p } = y(t);
2709
+ t.labelStyle = f, t.cssStyles = s.styles || "";
2710
+ let m = s.styles?.join(";") || p || "";
2711
+ t.cssStyles ||= m.replaceAll("!important", "").split(";");
2712
+ let h = s.members.length === 0 && s.methods.length === 0 && !n.class?.hideEmptyMembersBox, g = S.svg(u), _ = v(t, {});
2713
+ t.look !== "handDrawn" && (_.roughness = 0, _.fillStyle = "solid");
2714
+ let b = d.width, x = d.height;
2715
+ s.members.length === 0 && s.methods.length === 0 ? x += i : s.members.length > 0 && s.methods.length === 0 && (x += i * 2);
2716
+ let C = -b / 2, w = -x / 2, E = g.rectangle(C - r, w - r - (h ? r : s.members.length === 0 && s.methods.length === 0 ? -r / 2 : 0), b + 2 * r, x + 2 * r + (h ? r * 2 : s.members.length === 0 && s.methods.length === 0 ? -r : 0), _), D = u.insert(() => E, ":first-child");
2717
+ D.attr("class", "basic label-container");
2718
+ let O = D.node().getBBox();
2719
+ u.selectAll(".text").each((e, t, n) => {
2720
+ let i = a(n[t]), c = i.attr("transform"), l = 0;
2721
+ if (c) {
2722
+ let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(c);
2723
+ e && (l = parseFloat(e[2]));
2724
+ }
2725
+ let d = l + w + r - (h ? r : s.members.length === 0 && s.methods.length === 0 ? -r / 2 : 0);
2726
+ o || (d -= 4);
2727
+ let f = C;
2728
+ (i.attr("class").includes("label-group") || i.attr("class").includes("annotation-group")) && (f = -i.node()?.getBBox().width / 2 || 0, u.selectAll("text").each(function(e, t, n) {
2729
+ window.getComputedStyle(n[t]).textAnchor === "middle" && (f = 0);
2730
+ })), i.attr("transform", `translate(${f}, ${d})`);
2731
+ });
2732
+ let k = u.select(".annotation-group").node().getBBox().height - (h ? r / 2 : 0) || 0, A = u.select(".label-group").node().getBBox().height - (h ? r / 2 : 0) || 0, j = u.select(".members-group").node().getBBox().height - (h ? r / 2 : 0) || 0;
2733
+ if (s.members.length > 0 || s.methods.length > 0 || h) {
2734
+ let e = g.line(O.x, k + A + w + r, O.x + O.width, k + A + w + r, _);
2735
+ u.insert(() => e).attr("class", "divider").attr("style", m);
2736
+ }
2737
+ if (h || s.members.length > 0 || s.methods.length > 0) {
2738
+ let e = g.line(O.x, k + A + j + w + i * 2 + r, O.x + O.width, k + A + j + w + r + i * 2, _);
2739
+ u.insert(() => e).attr("class", "divider").attr("style", m);
2740
+ }
2741
+ if (s.look !== "handDrawn" && u.selectAll("path").attr("style", m), D.select(":nth-child(2)").attr("style", m), u.selectAll(".divider").select("path").attr("style", m), t.labelStyle ? u.selectAll("span").attr("style", t.labelStyle) : u.selectAll("span").attr("style", m), !o) {
2742
+ let e = RegExp(/color\s*:\s*([^;]*)/), t = e.exec(m);
2743
+ if (t) {
2744
+ let e = t[0].replace("color", "fill");
2745
+ u.selectAll("tspan").attr("style", e);
2746
+ } else if (f) {
2747
+ let t = e.exec(f);
2748
+ if (t) {
2749
+ let e = t[0].replace("color", "fill");
2750
+ u.selectAll("tspan").attr("style", e);
2751
+ }
2752
+ }
2753
+ }
2754
+ return T(t, D), t.intersect = function(e) {
2755
+ return W.rect(t, e);
2756
+ }, u;
2757
+ }
2758
+ i(xt, "classBox");
2759
+ async function St(e, t) {
2760
+ let { labelStyles: n, nodeStyles: r } = y(t);
2761
+ t.labelStyle = n;
2762
+ let i = t, o = t, s = "verifyMethod" in t, c = E(t), l = e.insert("g").attr("class", c).attr("id", t.domId ?? t.id), u;
2763
+ u = s ? await Q(l, `&lt;&lt;${i.type}&gt;&gt;`, 0, t.labelStyle) : await Q(l, "&lt;&lt;Element&gt;&gt;", 0, t.labelStyle);
2764
+ let d = u, f = await Q(l, i.name, d, t.labelStyle + "; font-weight: bold;");
2765
+ if (d += f + 20, s) {
2766
+ let e = await Q(l, `${i.requirementId ? `ID: ${i.requirementId}` : ""}`, d, t.labelStyle);
2767
+ d += e;
2768
+ let n = await Q(l, `${i.text ? `Text: ${i.text}` : ""}`, d, t.labelStyle);
2769
+ d += n;
2770
+ let r = await Q(l, `${i.risk ? `Risk: ${i.risk}` : ""}`, d, t.labelStyle);
2771
+ d += r, await Q(l, `${i.verifyMethod ? `Verification: ${i.verifyMethod}` : ""}`, d, t.labelStyle);
2772
+ } else {
2773
+ let e = await Q(l, `${o.type ? `Type: ${o.type}` : ""}`, d, t.labelStyle);
2774
+ d += e, await Q(l, `${o.docRef ? `Doc Ref: ${o.docRef}` : ""}`, d, t.labelStyle);
2775
+ }
2776
+ let p = (l.node()?.getBBox().width ?? 200) + 20, m = (l.node()?.getBBox().height ?? 200) + 20, h = -p / 2, g = -m / 2, _ = S.svg(l), b = v(t, {});
2777
+ t.look !== "handDrawn" && (b.roughness = 0, b.fillStyle = "solid");
2778
+ let x = _.rectangle(h, g, p, m, b), C = l.insert(() => x, ":first-child");
2779
+ if (C.attr("class", "basic label-container").attr("style", r), l.selectAll(".label").each((e, t, n) => {
2780
+ let r = a(n[t]), i = r.attr("transform"), o = 0, s = 0;
2781
+ if (i) {
2782
+ let e = RegExp(/translate\(([^,]+),([^)]+)\)/).exec(i);
2783
+ e && (o = parseFloat(e[1]), s = parseFloat(e[2]));
2784
+ }
2785
+ let c = s - m / 2, l = h + 20 / 2;
2786
+ (t === 0 || t === 1) && (l = o), r.attr("transform", `translate(${l}, ${c + 20})`);
2787
+ }), d > u + f + 20) {
2788
+ let e = _.line(h, g + u + f + 20, h + p, g + u + f + 20, b);
2789
+ l.insert(() => e).attr("style", r);
2790
+ }
2791
+ return T(t, C), t.intersect = function(e) {
2792
+ return W.rect(t, e);
2793
+ }, l;
2794
+ }
2795
+ i(St, "requirementBox");
2796
+ async function Q(t, r, i, o = "") {
2797
+ if (r === "") return 0;
2798
+ let l = t.insert("g").attr("class", "label").attr("style", o), u = c(), d = u.htmlLabels ?? !0, f = await m(l, s(e(r)), {
2799
+ width: n(r, u) + 50,
2800
+ classes: "markdown-node-label",
2801
+ useHtmlLabels: d,
2802
+ style: o
2803
+ }, u), p;
2804
+ if (d) {
2805
+ let e = f.children[0], t = a(f);
2806
+ p = e.getBoundingClientRect(), t.attr("width", p.width), t.attr("height", p.height);
2807
+ } else {
2808
+ let e = f.children[0];
2809
+ for (let t of e.children) t.textContent = t.textContent.replaceAll("&gt;", ">").replaceAll("&lt;", "<"), o && t.setAttribute("style", o);
2810
+ p = f.getBBox(), p.height += 6;
2811
+ }
2812
+ return l.attr("transform", `translate(${-p.width / 2},${-p.height / 2 + i})`), p.height;
2813
+ }
2814
+ i(Q, "addText");
2815
+ var Ct = /* @__PURE__ */ i((e) => {
2816
+ switch (e) {
2817
+ case "Very High": return "red";
2818
+ case "High": return "orange";
2819
+ case "Medium": return null;
2820
+ case "Low": return "blue";
2821
+ case "Very Low": return "lightblue";
2822
+ }
2823
+ }, "colorFromPriority");
2824
+ async function wt(e, t, { config: n }) {
2825
+ let { labelStyles: r, nodeStyles: i } = y(t);
2826
+ t.labelStyle = r || "";
2827
+ let a = t.width;
2828
+ t.width = (t.width ?? 200) - 10;
2829
+ let { shapeSvg: o, bbox: s, label: c } = await C(e, t, E(t)), l = t.padding || 10, u = "", d;
2830
+ "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"));
2831
+ let f = {
2832
+ useHtmlLabels: t.useHtmlLabels,
2833
+ labelStyle: t.labelStyle || "",
2834
+ width: t.width,
2835
+ img: t.img,
2836
+ padding: t.padding || 8,
2837
+ centerLabel: !1
2838
+ }, p, m;
2839
+ d ? {label: p, bbox: m} = await w(d, "ticket" in t && t.ticket || "", f) : {label: p, bbox: m} = await w(o, "ticket" in t && t.ticket || "", f);
2840
+ let { label: h, bbox: g } = await w(o, "assigned" in t && t.assigned || "", f);
2841
+ t.width = a;
2842
+ let _ = t?.width || 0, b = Math.max(m.height, g.height) / 2, x = Math.max(s.height + 20, t?.height || 0) + b, D = -_ / 2, O = -x / 2;
2843
+ c.attr("transform", "translate(" + (l - _ / 2) + ", " + (-b - s.height / 2) + ")"), p.attr("transform", "translate(" + (l - _ / 2) + ", " + (-b + s.height / 2) + ")"), h.attr("transform", "translate(" + (l + _ / 2 - g.width - 20) + ", " + (-b + s.height / 2) + ")");
2844
+ let k, { rx: A, ry: j } = t, { cssStyles: N } = t;
2845
+ if (t.look === "handDrawn") {
2846
+ let e = S.svg(o), n = v(t, {}), r = A || j ? e.path(M(D, O, _, x, A || 0), n) : e.rectangle(D, O, _, x, n);
2847
+ k = o.insert(() => r, ":first-child"), k.attr("class", "basic label-container").attr("style", N || null);
2848
+ } else {
2849
+ k = o.insert("rect", ":first-child"), k.attr("class", "basic label-container __APA__").attr("style", i).attr("rx", A ?? 5).attr("ry", j ?? 5).attr("x", D).attr("y", O).attr("width", _).attr("height", x);
2850
+ let e = "priority" in t && t.priority;
2851
+ if (e) {
2852
+ let t = o.append("line"), n = D + 2, r = O + Math.floor((A ?? 0) / 2), i = O + x - Math.floor((A ?? 0) / 2);
2853
+ t.attr("x1", n).attr("y1", r).attr("x2", n).attr("y2", i).attr("stroke-width", "4").attr("stroke", Ct(e));
2854
+ }
2855
+ }
2856
+ return T(t, k), t.height = x, t.intersect = function(e) {
2857
+ return W.rect(t, e);
2858
+ }, o;
2859
+ }
2860
+ i(wt, "kanbanItem");
2861
+ async function Tt(e, n) {
2862
+ let { labelStyles: i, nodeStyles: a } = y(n);
2863
+ n.labelStyle = i;
2864
+ let { shapeSvg: o, bbox: s, halfPadding: c, label: l } = await C(e, n, E(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);
2865
+ l.attr("transform", `translate(${-s.width / 2}, ${-s.height / 2})`);
2866
+ let b, x = `M0 0
2867
+ a${f},${f} 1 0,0 ${g * .25},${-1 * _ * .1}
2868
+ a${f},${f} 1 0,0 ${g * .25},0
2869
+ a${f},${f} 1 0,0 ${g * .25},0
2870
+ a${f},${f} 1 0,0 ${g * .25},${_ * .1}
2871
+
2872
+ a${f},${f} 1 0,0 ${g * .15},${_ * .33}
2873
+ a${f * .8},${f * .8} 1 0,0 0,${_ * .34}
2874
+ a${f},${f} 1 0,0 ${-1 * g * .15},${_ * .33}
2875
+
2876
+ a${f},${f} 1 0,0 ${-1 * g * .25},${_ * .15}
2877
+ a${f},${f} 1 0,0 ${-1 * g * .25},0
2878
+ a${f},${f} 1 0,0 ${-1 * g * .25},0
2879
+ a${f},${f} 1 0,0 ${-1 * g * .25},${-1 * _ * .15}
2880
+
2881
+ a${f},${f} 1 0,0 ${-1 * g * .1},${-1 * _ * .33}
2882
+ a${f * .8},${f * .8} 1 0,0 0,${-1 * _ * .34}
2883
+ a${f},${f} 1 0,0 ${g * .1},${-1 * _ * .33}
2884
+ H0 V0 Z`;
2885
+ if (n.look === "handDrawn") {
2886
+ let e = S.svg(o), r = v(n, {}), i = e.path(x, r);
2887
+ b = o.insert(() => i, ":first-child"), b.attr("class", "basic label-container").attr("style", t(p));
2888
+ } else b = o.insert("path", ":first-child").attr("class", "basic label-container").attr("style", a).attr("d", x);
2889
+ return b.attr("transform", `translate(${-g / 2}, ${-_ / 2})`), T(n, b), n.calcIntersect = function(e, t) {
2890
+ return W.rect(e, t);
2891
+ }, n.intersect = function(e) {
2892
+ return r.info("Bang intersect", n, e), W.rect(n, e);
2893
+ }, o;
2894
+ }
2895
+ i(Tt, "bang");
2896
+ async function Et(e, n) {
2897
+ let { labelStyles: i, nodeStyles: a } = y(n);
2898
+ n.labelStyle = i;
2899
+ let { shapeSvg: o, bbox: s, halfPadding: c, label: l } = await C(e, n, E(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, _, b = `M0 0
2900
+ a${f},${f} 0 0,1 ${u * .25},${-1 * u * .1}
2901
+ a${m},${m} 1 0,1 ${u * .4},${-1 * u * .1}
2902
+ a${p},${p} 1 0,1 ${u * .35},${u * .2}
2903
+
2904
+ a${f},${f} 1 0,1 ${u * .15},${d * .35}
2905
+ a${h},${h} 1 0,1 ${-1 * u * .15},${d * .65}
2906
+
2907
+ a${p},${f} 1 0,1 ${-1 * u * .25},${u * .15}
2908
+ a${m},${m} 1 0,1 ${-1 * u * .5},0
2909
+ a${f},${f} 1 0,1 ${-1 * u * .25},${-1 * u * .15}
2910
+
2911
+ a${f},${f} 1 0,1 ${-1 * u * .1},${-1 * d * .35}
2912
+ a${h},${h} 1 0,1 ${u * .1},${-1 * d * .65}
2913
+ H0 V0 Z`;
2914
+ if (n.look === "handDrawn") {
2915
+ let e = S.svg(o), r = v(n, {}), i = e.path(b, r);
2916
+ _ = o.insert(() => i, ":first-child"), _.attr("class", "basic label-container").attr("style", t(g));
2917
+ } else _ = o.insert("path", ":first-child").attr("class", "basic label-container").attr("style", a).attr("d", b);
2918
+ return l.attr("transform", `translate(${-s.width / 2}, ${-s.height / 2})`), _.attr("transform", `translate(${-u / 2}, ${-d / 2})`), T(n, _), n.calcIntersect = function(e, t) {
2919
+ return W.rect(e, t);
2920
+ }, n.intersect = function(e) {
2921
+ return r.info("Cloud intersect", n, e), W.rect(n, e);
2922
+ }, o;
2923
+ }
2924
+ i(Et, "cloud");
2925
+ async function Dt(e, t) {
2926
+ let { labelStyles: n, nodeStyles: r } = y(t);
2927
+ t.labelStyle = n;
2928
+ let { shapeSvg: i, bbox: a, halfPadding: o, label: s } = await C(e, t, E(t)), c = a.width + 8 * o, l = a.height + 2 * o, u = `
2929
+ M${-c / 2} ${l / 2 - 5}
2930
+ v${-l + 10}
2931
+ q0,-5 5,-5
2932
+ h${c - 10}
2933
+ q5,0 5,5
2934
+ v${l - 10}
2935
+ q0,5 -5,5
2936
+ h${-c + 10}
2937
+ q-5,0 -5,-5
2938
+ Z
2939
+ `, d = i.append("path").attr("id", "node-" + t.id).attr("class", "node-bkg node-" + t.type).attr("style", r).attr("d", u);
2940
+ 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()), T(t, d), t.calcIntersect = function(e, t) {
2941
+ return W.rect(e, t);
2942
+ }, t.intersect = function(e) {
2943
+ return W.rect(t, e);
2944
+ }, i;
2945
+ }
2946
+ i(Dt, "defaultMindmapNode");
2947
+ async function Ot(e, t) {
2948
+ return le(e, t, { padding: t.padding ?? 0 });
2949
+ }
2950
+ i(Ot, "mindmapCircle");
2951
+ var kt = [
2952
+ {
2953
+ semanticName: "Process",
2954
+ name: "Rectangle",
2955
+ shortName: "rect",
2956
+ description: "Standard process shape",
2957
+ aliases: [
2958
+ "proc",
2959
+ "process",
2960
+ "rectangle"
2961
+ ],
2962
+ internalAliases: ["squareRect"],
2963
+ handler: et
2964
+ },
2965
+ {
2966
+ semanticName: "Event",
2967
+ name: "Rounded Rectangle",
2968
+ shortName: "rounded",
2969
+ description: "Represents an event",
2970
+ aliases: ["event"],
2971
+ internalAliases: ["roundedRect"],
2972
+ handler: Ze
2973
+ },
2974
+ {
2975
+ semanticName: "Terminal Point",
2976
+ name: "Stadium",
2977
+ shortName: "stadium",
2978
+ description: "Terminal point",
2979
+ aliases: ["terminal", "pill"],
2980
+ handler: tt
2981
+ },
2982
+ {
2983
+ semanticName: "Subprocess",
2984
+ name: "Framed Rectangle",
2985
+ shortName: "fr-rect",
2986
+ description: "Subprocess",
2987
+ aliases: [
2988
+ "subprocess",
2989
+ "subproc",
2990
+ "framed-rectangle",
2991
+ "subroutine"
2992
+ ],
2993
+ handler: at
2994
+ },
2995
+ {
2996
+ semanticName: "Database",
2997
+ name: "Cylinder",
2998
+ shortName: "cyl",
2999
+ description: "Database storage",
3000
+ aliases: [
3001
+ "db",
3002
+ "database",
3003
+ "cylinder"
3004
+ ],
3005
+ handler: ye
3006
+ },
3007
+ {
3008
+ semanticName: "Start",
3009
+ name: "Circle",
3010
+ shortName: "circle",
3011
+ description: "Starting point",
3012
+ aliases: ["circ"],
3013
+ handler: le
3014
+ },
3015
+ {
3016
+ semanticName: "Bang",
3017
+ name: "Bang",
3018
+ shortName: "bang",
3019
+ description: "Bang",
3020
+ aliases: ["bang"],
3021
+ handler: Tt
3022
+ },
3023
+ {
3024
+ semanticName: "Cloud",
3025
+ name: "Cloud",
3026
+ shortName: "cloud",
3027
+ description: "cloud",
3028
+ aliases: ["cloud"],
3029
+ handler: Et
3030
+ },
3031
+ {
3032
+ semanticName: "Decision",
3033
+ name: "Diamond",
3034
+ shortName: "diam",
3035
+ description: "Decision-making step",
3036
+ aliases: [
3037
+ "decision",
3038
+ "diamond",
3039
+ "question"
3040
+ ],
3041
+ handler: Je
3042
+ },
3043
+ {
3044
+ semanticName: "Prepare Conditional",
3045
+ name: "Hexagon",
3046
+ shortName: "hex",
3047
+ description: "Preparation or condition step",
3048
+ aliases: ["hexagon", "prepare"],
3049
+ handler: De
3050
+ },
3051
+ {
3052
+ semanticName: "Data Input/Output",
3053
+ name: "Lean Right",
3054
+ shortName: "lean-r",
3055
+ description: "Represents input or output",
3056
+ aliases: ["lean-right", "in-out"],
3057
+ internalAliases: ["lean_right"],
3058
+ handler: Le
3059
+ },
3060
+ {
3061
+ semanticName: "Data Input/Output",
3062
+ name: "Lean Left",
3063
+ shortName: "lean-l",
3064
+ description: "Represents output or input",
3065
+ aliases: ["lean-left", "out-in"],
3066
+ internalAliases: ["lean_left"],
3067
+ handler: Ie
3068
+ },
3069
+ {
3070
+ semanticName: "Priority Action",
3071
+ name: "Trapezoid Base Bottom",
3072
+ shortName: "trap-b",
3073
+ description: "Priority action",
3074
+ aliases: [
3075
+ "priority",
3076
+ "trapezoid-bottom",
3077
+ "trapezoid"
3078
+ ],
3079
+ handler: pt
3080
+ },
3081
+ {
3082
+ semanticName: "Manual Operation",
3083
+ name: "Trapezoid Base Top",
3084
+ shortName: "trap-t",
3085
+ description: "Represents a manual task",
3086
+ aliases: [
3087
+ "manual",
3088
+ "trapezoid-top",
3089
+ "inv-trapezoid"
3090
+ ],
3091
+ internalAliases: ["inv_trapezoid"],
3092
+ handler: Pe
3093
+ },
3094
+ {
3095
+ semanticName: "Stop",
3096
+ name: "Double Circle",
3097
+ shortName: "dbl-circ",
3098
+ description: "Represents a stop point",
3099
+ aliases: ["double-circle"],
3100
+ internalAliases: ["doublecircle"],
3101
+ handler: xe
3102
+ },
3103
+ {
3104
+ semanticName: "Text Block",
3105
+ name: "Text Block",
3106
+ shortName: "text",
3107
+ description: "Text block",
3108
+ handler: ct
3109
+ },
3110
+ {
3111
+ semanticName: "Card",
3112
+ name: "Notched Rectangle",
3113
+ shortName: "notch-rect",
3114
+ description: "Represents a card",
3115
+ aliases: ["card", "notched-rectangle"],
3116
+ handler: se
3117
+ },
3118
+ {
3119
+ semanticName: "Lined/Shaded Process",
3120
+ name: "Lined Rectangle",
3121
+ shortName: "lin-rect",
3122
+ description: "Lined process shape",
3123
+ aliases: [
3124
+ "lined-rectangle",
3125
+ "lined-process",
3126
+ "lin-proc",
3127
+ "shaded-process"
3128
+ ],
3129
+ handler: Qe
3130
+ },
3131
+ {
3132
+ semanticName: "Start",
3133
+ name: "Small Circle",
3134
+ shortName: "sm-circ",
3135
+ description: "Small starting point",
3136
+ aliases: ["start", "small-circle"],
3137
+ internalAliases: ["stateStart"],
3138
+ handler: it
3139
+ },
3140
+ {
3141
+ semanticName: "Stop",
3142
+ name: "Framed Circle",
3143
+ shortName: "fr-circ",
3144
+ description: "Stop point",
3145
+ aliases: ["stop", "framed-circle"],
3146
+ internalAliases: ["stateEnd"],
3147
+ handler: rt
3148
+ },
3149
+ {
3150
+ semanticName: "Fork/Join",
3151
+ name: "Filled Rectangle",
3152
+ shortName: "fork",
3153
+ description: "Fork or join in process flow",
3154
+ aliases: ["join"],
3155
+ internalAliases: ["forkJoin"],
3156
+ handler: we
3157
+ },
3158
+ {
3159
+ semanticName: "Collate",
3160
+ name: "Hourglass",
3161
+ shortName: "hourglass",
3162
+ description: "Represents a collate operation",
3163
+ aliases: ["hourglass", "collate"],
3164
+ handler: Oe
3165
+ },
3166
+ {
3167
+ semanticName: "Comment",
3168
+ name: "Curly Brace",
3169
+ shortName: "brace",
3170
+ description: "Adds a comment",
3171
+ aliases: ["comment", "brace-l"],
3172
+ handler: fe
3173
+ },
3174
+ {
3175
+ semanticName: "Comment Right",
3176
+ name: "Curly Brace",
3177
+ shortName: "brace-r",
3178
+ description: "Adds a comment",
3179
+ handler: pe
3180
+ },
3181
+ {
3182
+ semanticName: "Comment with braces on both sides",
3183
+ name: "Curly Braces",
3184
+ shortName: "braces",
3185
+ description: "Adds a comment",
3186
+ handler: me
3187
+ },
3188
+ {
3189
+ semanticName: "Com Link",
3190
+ name: "Lightning Bolt",
3191
+ shortName: "bolt",
3192
+ description: "Communication link",
3193
+ aliases: ["com-link", "lightning-bolt"],
3194
+ handler: Re
3195
+ },
3196
+ {
3197
+ semanticName: "Document",
3198
+ name: "Document",
3199
+ shortName: "doc",
3200
+ description: "Represents a document",
3201
+ aliases: ["doc", "document"],
3202
+ handler: gt
3203
+ },
3204
+ {
3205
+ semanticName: "Delay",
3206
+ name: "Half-Rounded Rectangle",
3207
+ shortName: "delay",
3208
+ description: "Represents a delay",
3209
+ aliases: ["half-rounded-rectangle"],
3210
+ handler: Te
3211
+ },
3212
+ {
3213
+ semanticName: "Direct Access Storage",
3214
+ name: "Horizontal Cylinder",
3215
+ shortName: "h-cyl",
3216
+ description: "Direct access storage",
3217
+ aliases: ["das", "horizontal-cylinder"],
3218
+ handler: ft
3219
+ },
3220
+ {
3221
+ semanticName: "Disk Storage",
3222
+ name: "Lined Cylinder",
3223
+ shortName: "lin-cyl",
3224
+ description: "Disk storage",
3225
+ aliases: ["disk", "lined-cylinder"],
3226
+ handler: He
3227
+ },
3228
+ {
3229
+ semanticName: "Display",
3230
+ name: "Curved Trapezoid",
3231
+ shortName: "curv-trap",
3232
+ description: "Represents a display",
3233
+ aliases: ["curved-trapezoid", "display"],
3234
+ handler: he
3235
+ },
3236
+ {
3237
+ semanticName: "Divided Process",
3238
+ name: "Divided Rectangle",
3239
+ shortName: "div-rect",
3240
+ description: "Divided process shape",
3241
+ aliases: [
3242
+ "div-proc",
3243
+ "divided-rectangle",
3244
+ "divided-process"
3245
+ ],
3246
+ handler: be
3247
+ },
3248
+ {
3249
+ semanticName: "Extract",
3250
+ name: "Triangle",
3251
+ shortName: "tri",
3252
+ description: "Extraction process",
3253
+ aliases: ["extract", "triangle"],
3254
+ handler: ht
3255
+ },
3256
+ {
3257
+ semanticName: "Internal Storage",
3258
+ name: "Window Pane",
3259
+ shortName: "win-pane",
3260
+ description: "Internal storage",
3261
+ aliases: ["internal-storage", "window-pane"],
3262
+ handler: vt
3263
+ },
3264
+ {
3265
+ semanticName: "Junction",
3266
+ name: "Filled Circle",
3267
+ shortName: "f-circ",
3268
+ description: "Junction point",
3269
+ aliases: ["junction", "filled-circle"],
3270
+ handler: Se
3271
+ },
3272
+ {
3273
+ semanticName: "Loop Limit",
3274
+ name: "Trapezoidal Pentagon",
3275
+ shortName: "notch-pent",
3276
+ description: "Loop limit step",
3277
+ aliases: ["loop-limit", "notched-pentagon"],
3278
+ handler: mt
3279
+ },
3280
+ {
3281
+ semanticName: "Manual File",
3282
+ name: "Flipped Triangle",
3283
+ shortName: "flip-tri",
3284
+ description: "Manual file operation",
3285
+ aliases: ["manual-file", "flipped-triangle"],
3286
+ handler: Ce
3287
+ },
3288
+ {
3289
+ semanticName: "Manual Input",
3290
+ name: "Sloped Rectangle",
3291
+ shortName: "sl-rect",
3292
+ description: "Manual input step",
3293
+ aliases: ["manual-input", "sloped-rectangle"],
3294
+ handler: $e
3295
+ },
3296
+ {
3297
+ semanticName: "Multi-Document",
3298
+ name: "Stacked Document",
3299
+ shortName: "docs",
3300
+ description: "Multiple documents",
3301
+ aliases: [
3302
+ "documents",
3303
+ "st-doc",
3304
+ "stacked-document"
3305
+ ],
3306
+ handler: Ge
3307
+ },
3308
+ {
3309
+ semanticName: "Multi-Process",
3310
+ name: "Stacked Rectangle",
3311
+ shortName: "st-rect",
3312
+ description: "Multiple processes",
3313
+ aliases: [
3314
+ "procs",
3315
+ "processes",
3316
+ "stacked-rectangle"
3317
+ ],
3318
+ handler: We
3319
+ },
3320
+ {
3321
+ semanticName: "Stored Data",
3322
+ name: "Bow Tie Rectangle",
3323
+ shortName: "bow-rect",
3324
+ description: "Stored data",
3325
+ aliases: ["stored-data", "bow-tie-rectangle"],
3326
+ handler: oe
3327
+ },
3328
+ {
3329
+ semanticName: "Summary",
3330
+ name: "Crossed Circle",
3331
+ shortName: "cross-circ",
3332
+ description: "Summary",
3333
+ aliases: ["summary", "crossed-circle"],
3334
+ handler: de
3335
+ },
3336
+ {
3337
+ semanticName: "Tagged Document",
3338
+ name: "Tagged Document",
3339
+ shortName: "tag-doc",
3340
+ description: "Tagged document",
3341
+ aliases: ["tag-doc", "tagged-document"],
3342
+ handler: st
3343
+ },
3344
+ {
3345
+ semanticName: "Tagged Process",
3346
+ name: "Tagged Rectangle",
3347
+ shortName: "tag-rect",
3348
+ description: "Tagged process",
3349
+ aliases: [
3350
+ "tagged-rectangle",
3351
+ "tag-proc",
3352
+ "tagged-process"
3353
+ ],
3354
+ handler: ot
3355
+ },
3356
+ {
3357
+ semanticName: "Paper Tape",
3358
+ name: "Flag",
3359
+ shortName: "flag",
3360
+ description: "Paper tape",
3361
+ aliases: ["paper-tape"],
3362
+ handler: _t
3363
+ },
3364
+ {
3365
+ semanticName: "Odd",
3366
+ name: "Odd",
3367
+ shortName: "odd",
3368
+ description: "Odd shape",
3369
+ internalAliases: ["rect_left_inv_arrow"],
3370
+ handler: Ye
3371
+ },
3372
+ {
3373
+ semanticName: "Lined Document",
3374
+ name: "Lined Document",
3375
+ shortName: "lin-doc",
3376
+ description: "Lined document",
3377
+ aliases: ["lined-document"],
3378
+ handler: Ue
3379
+ }
3380
+ ], At = (/* @__PURE__ */ i(() => {
3381
+ let e = [...Object.entries({
3382
+ state: nt,
3383
+ choice: ce,
3384
+ note: Ke,
3385
+ rectWithTitle: Xe,
3386
+ labelRect: Fe,
3387
+ iconSquare: Me,
3388
+ iconCircle: Ae,
3389
+ icon: ke,
3390
+ iconRounded: je,
3391
+ imageSquare: Ne,
3392
+ anchor: ie,
3393
+ kanbanItem: wt,
3394
+ mindmapCircle: Ot,
3395
+ defaultMindmapNode: Dt,
3396
+ classBox: xt,
3397
+ erBox: yt,
3398
+ requirementBox: St
3399
+ }), ...kt.flatMap((e) => [
3400
+ e.shortName,
3401
+ ..."aliases" in e ? e.aliases : [],
3402
+ ..."internalAliases" in e ? e.internalAliases : []
3403
+ ].map((t) => [t, e.handler]))];
3404
+ return Object.fromEntries(e);
3405
+ }, "generateShapeMap"))();
3406
+ function jt(e) {
3407
+ return e in At;
3408
+ }
3409
+ i(jt, "isValidShape");
3410
+ var $ = /* @__PURE__ */ new Map();
3411
+ async function Mt(e, t, n) {
3412
+ let r, i;
3413
+ t.shape === "rect" && (t.rx && t.ry ? t.shape = "roundedRect" : t.shape = "squareRect");
3414
+ let a = t.shape ? At[t.shape] : void 0;
3415
+ if (!a) throw Error(`No such shape: ${t.shape}. Please check your syntax.`);
3416
+ if (t.link) {
3417
+ let o;
3418
+ n.config.securityLevel === "sandbox" ? o = "_top" : t.linkTarget && (o = t.linkTarget || "_blank"), r = e.insert("svg:a").attr("xlink:href", t.link).attr("target", o ?? null), i = await a(r, t, n);
3419
+ } else i = await a(e, t, n), r = i;
3420
+ return t.tooltip && i.attr("title", t.tooltip), $.set(t.id, r), t.haveCallback && r.attr("class", r.attr("class") + " clickable"), r;
3421
+ }
3422
+ i(Mt, "insertNode");
3423
+ var Nt = /* @__PURE__ */ i((e, t) => {
3424
+ $.set(t.id, e);
3425
+ }, "setNodeElem"), Pt = /* @__PURE__ */ i(() => {
3426
+ $.clear();
3427
+ }, "clear"), Ft = /* @__PURE__ */ i((e) => {
3428
+ let t = $.get(e.id);
3429
+ r.trace("Transforming node", e.diff, e, "translate(" + (e.x - e.width / 2 - 5) + ", " + e.width / 2 + ")");
3430
+ let n = e.diff || 0;
3431
+ return e.clusterNode ? t.attr("transform", "translate(" + (e.x + n - e.width / 2) + ", " + (e.y - e.height / 2 - 8) + ")") : t.attr("transform", "translate(" + e.x + ", " + e.y + ")"), n;
3432
+ }, "positionNode");
3433
+ //#endregion
3434
+ export { Mt as a, Ft as c, I as i, Nt as l, Pt as n, jt as o, j as r, C as s, L as t, T as u };