for-humanity 0.12.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (226) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/README.md +16 -9
  3. package/dist/browser.js +16 -16
  4. package/dist/cli.css +2 -968
  5. package/dist/cli.js +92 -2318
  6. package/dist/config.js +1 -0
  7. package/dist/constant/copy.d.ts +100 -0
  8. package/dist/constant/site.d.ts +20 -0
  9. package/dist/constant/status.d.ts +19 -0
  10. package/dist/copy-C1uzvEnr.js +103 -0
  11. package/dist/group-path-XAThmzvC.js +10 -0
  12. package/dist/load-site-CbpLEhwu.js +2379 -0
  13. package/dist/logger-Dv1i9xSV.js +9 -0
  14. package/dist/mermaid/THIRD-PARTY-NOTICES.txt +3134 -0
  15. package/dist/mermaid/chunk--TN-qHgG.js +2 -0
  16. package/dist/mermaid/chunk-0kM1Lv4D.js +2 -0
  17. package/dist/mermaid/chunk-3FHei3pH.js +2001 -0
  18. package/dist/mermaid/chunk-3_2p2GqN.js +2 -0
  19. package/dist/mermaid/chunk-6HLei9i0.js +84 -0
  20. package/dist/mermaid/chunk-7Sz3kAwl.js +2214 -0
  21. package/dist/mermaid/chunk-7Tarqbpa.js +18047 -0
  22. package/dist/mermaid/chunk-9kkt8lzL.js +10 -0
  23. package/dist/mermaid/chunk-B--pNBQF.js +884 -0
  24. package/dist/mermaid/chunk-B4F-pysn.js +4241 -0
  25. package/dist/mermaid/chunk-B58sEIY_.js +14 -0
  26. package/dist/mermaid/chunk-B9_UWzSH.js +1517 -0
  27. package/dist/mermaid/chunk-BB8uZHwY.js +75 -0
  28. package/dist/mermaid/chunk-BFfk0LEc.js +717 -0
  29. package/dist/mermaid/chunk-BKri0qr7.js +89 -0
  30. package/dist/mermaid/chunk-BL404pH5.js +26 -0
  31. package/dist/mermaid/chunk-BLeiQSWo.js +354 -0
  32. package/dist/mermaid/chunk-BOmH_UFd.js +2 -0
  33. package/dist/mermaid/chunk-BSej9Nhy.js +1361 -0
  34. package/dist/mermaid/chunk-BYzrzvCI.js +12 -0
  35. package/dist/mermaid/chunk-BariMtWr.js +3020 -0
  36. package/dist/mermaid/chunk-BcrBoMwH.js +2352 -0
  37. package/dist/mermaid/chunk-Bok8z-Yo.js +67 -0
  38. package/dist/mermaid/chunk-BpTHLKQM.js +1970 -0
  39. package/dist/mermaid/chunk-BqjuxRsC.js +733 -0
  40. package/dist/mermaid/chunk-BuvPd-s5.js +1073 -0
  41. package/dist/mermaid/chunk-BvVehae3.js +5069 -0
  42. package/dist/mermaid/chunk-C-JABYpd.js +3075 -0
  43. package/dist/mermaid/chunk-C9XlTm4w.js +2 -0
  44. package/dist/mermaid/chunk-CApNbSU9.js +6 -0
  45. package/dist/mermaid/chunk-CCM2AH-C.js +9 -0
  46. package/dist/mermaid/chunk-CD1E0F_N.js +2 -0
  47. package/dist/mermaid/chunk-CDWvKG7D.js +2 -0
  48. package/dist/mermaid/chunk-CEVPpC1F.js +34 -0
  49. package/dist/mermaid/chunk-CLDr12lf.js +47504 -0
  50. package/dist/mermaid/chunk-CLVYqOBI.js +61 -0
  51. package/dist/mermaid/chunk-CLeOkFb5.js +15 -0
  52. package/dist/mermaid/chunk-CLgRAtOz.js +37 -0
  53. package/dist/mermaid/chunk-CMqFNUBl.js +134 -0
  54. package/dist/mermaid/chunk-CTPaBJXB.js +2 -0
  55. package/dist/mermaid/chunk-CVi6IGBL.js +2 -0
  56. package/dist/mermaid/chunk-CWV_EN-4.js +4745 -0
  57. package/dist/mermaid/chunk-CZ0dAs3g.js +2 -0
  58. package/dist/mermaid/chunk-C_YGy4Fn.js +236 -0
  59. package/dist/mermaid/chunk-CcVH22Yt.js +100 -0
  60. package/dist/mermaid/chunk-CgG6CD9_.js +7175 -0
  61. package/dist/mermaid/chunk-CgOP6IDB.js +3397 -0
  62. package/dist/mermaid/chunk-Cgg2UTSf.js +13 -0
  63. package/dist/mermaid/chunk-ChJfJJ1A.js +214 -0
  64. package/dist/mermaid/chunk-Ck5XRA46.js +447 -0
  65. package/dist/mermaid/chunk-Ckuw16cl.js +203 -0
  66. package/dist/mermaid/chunk-CpAbRCbF.js +1880 -0
  67. package/dist/mermaid/chunk-CuYekbSv.js +2 -0
  68. package/dist/mermaid/chunk-CwS4wZ5a.js +2 -0
  69. package/dist/mermaid/chunk-D-bcrBO3.js +82 -0
  70. package/dist/mermaid/chunk-D3IEAkCW.js +76 -0
  71. package/dist/mermaid/chunk-D8XfBJ_K.js +645 -0
  72. package/dist/mermaid/chunk-D9Ddd9y4.js +2228 -0
  73. package/dist/mermaid/chunk-DBh1mIbK.js +12 -0
  74. package/dist/mermaid/chunk-DD6Df6Ic.js +5 -0
  75. package/dist/mermaid/chunk-DGVDaXjx.js +8 -0
  76. package/dist/mermaid/chunk-DK9KqIXj.js +632 -0
  77. package/dist/mermaid/chunk-DORnIAsy.js +4487 -0
  78. package/dist/mermaid/chunk-DU69_VcF.js +363 -0
  79. package/dist/mermaid/chunk-DVNvSFoz.js +2144 -0
  80. package/dist/mermaid/chunk-DZe-4kde.js +20 -0
  81. package/dist/mermaid/chunk-D_a06Rz4.js +287 -0
  82. package/dist/mermaid/chunk-DfyFJJi2.js +972 -0
  83. package/dist/mermaid/chunk-DhKYPp1Z.js +2 -0
  84. package/dist/mermaid/chunk-DjFqgNTG.js +94 -0
  85. package/dist/mermaid/chunk-DmbDDrr-.js +65 -0
  86. package/dist/mermaid/chunk-DpuxlyL_.js +696 -0
  87. package/dist/mermaid/chunk-DqGhppWe.js +2 -0
  88. package/dist/mermaid/chunk-DqPZxHXa.js +5 -0
  89. package/dist/mermaid/chunk-Dt_1Jyif.js +293 -0
  90. package/dist/mermaid/chunk-DyQBE_NW.js +1935 -0
  91. package/dist/mermaid/chunk-JckyC4mW.js +1009 -0
  92. package/dist/mermaid/chunk-K7Myuj2-.js +1334 -0
  93. package/dist/mermaid/chunk-KuPYb48V.js +275 -0
  94. package/dist/mermaid/chunk-MFVRUoO0.js +4020 -0
  95. package/dist/mermaid/chunk-MbInCS_6.js +28 -0
  96. package/dist/mermaid/chunk-MexOLyKV.js +355 -0
  97. package/dist/mermaid/chunk-NnbDtJzg.js +21856 -0
  98. package/dist/mermaid/chunk-SGpOYZbI.js +2139 -0
  99. package/dist/mermaid/chunk-TbxLDlcU.js +198 -0
  100. package/dist/mermaid/chunk-TftHqGLg.js +490 -0
  101. package/dist/mermaid/chunk-UjQ8vA_Z.js +4138 -0
  102. package/dist/mermaid/chunk-YgmVTKqc.js +16 -0
  103. package/dist/mermaid/chunk-_a9EZE1v.js +1798 -0
  104. package/dist/mermaid/chunk-dTb8jqeP.js +2 -0
  105. package/dist/mermaid/chunk-fFdMfF8S.js +2240 -0
  106. package/dist/mermaid/chunk-feYbMzBj.js +1267 -0
  107. package/dist/mermaid/chunk-g3Pn8DkW.js +46 -0
  108. package/dist/mermaid/chunk-hM77LvCb.js +19832 -0
  109. package/dist/mermaid/chunk-hUDb-eAW.js +527 -0
  110. package/dist/mermaid/chunk-tpABtZ-3.js +4252 -0
  111. package/dist/mermaid/chunk-xIbz3oFK.js +59 -0
  112. package/dist/mermaid/chunk-yBz-vst0.js +976 -0
  113. package/dist/mermaid/mermaid-BhtR3wyB.js +1145 -0
  114. package/dist/run-site-command-C80YoNOe.js +129 -0
  115. package/dist/site-config-bllORGpm.js +90 -0
  116. package/dist/site.js +1 -0
  117. package/dist/start-dev-server-C4_Lu1nZ.js +176 -0
  118. package/dist/to-change-queue-DbEnZGNK.js +34 -0
  119. package/dist/to-error-message-pF6_7wGK.js +16 -0
  120. package/dist/type/group-path.d.ts +7 -0
  121. package/dist/type/site-config.d.ts +57 -0
  122. package/package.json +34 -17
  123. package/src/component/widget/cursor-face/_constant/cursor-face.ts +0 -14
  124. package/src/component/widget/cursor-face/wg-cursor-face.css +0 -15
  125. package/src/component/widget/cursor-face/wg-cursor-face.tsx +0 -153
  126. package/src/component/widget/navigation/_constant/locale.ts +0 -9
  127. package/src/component/widget/navigation/_constant/navigation-data-schema.ts +0 -33
  128. package/src/component/widget/navigation/_constant/navigation.ts +0 -9
  129. package/src/component/widget/navigation/_constant/reading-line.ts +0 -4
  130. package/src/component/widget/navigation/_function/restore-navigation-scroll.ts +0 -59
  131. package/src/component/widget/navigation/_function/to-doc-groups/_to-doc-branches.ts +0 -15
  132. package/src/component/widget/navigation/_function/to-doc-groups/_to-doc-group-branches.ts +0 -70
  133. package/src/component/widget/navigation/_function/to-doc-groups/to-doc-groups.ts +0 -15
  134. package/src/component/widget/navigation/_function/to-navigation-data/_to-navigation-document.ts +0 -13
  135. package/src/component/widget/navigation/_function/to-navigation-data/_to-navigation-group.ts +0 -13
  136. package/src/component/widget/navigation/_function/to-navigation-data/to-navigation-data.ts +0 -18
  137. package/src/component/widget/navigation/_function/to-navigation-json.ts +0 -8
  138. package/src/component/widget/navigation/_function/to-toc-groups.ts +0 -38
  139. package/src/component/widget/navigation/_type/doc-branch.ts +0 -11
  140. package/src/component/widget/navigation/_type/doc-group.ts +0 -24
  141. package/src/component/widget/navigation/_type/navigation-data.ts +0 -75
  142. package/src/component/widget/navigation/_type/navigation-focus-snapshot.ts +0 -17
  143. package/src/component/widget/navigation/_type/toc-group.ts +0 -39
  144. package/src/component/widget/navigation/_wg-navigation-nav-list.css +0 -48
  145. package/src/component/widget/navigation/_wg-navigation-nav-list.tsx +0 -61
  146. package/src/component/widget/navigation/_wg-navigation-nav.css +0 -21
  147. package/src/component/widget/navigation/_wg-navigation-nav.tsx +0 -33
  148. package/src/component/widget/navigation/_wg-navigation-scroll.tsx +0 -117
  149. package/src/component/widget/navigation/_wg-navigation-toc.css +0 -91
  150. package/src/component/widget/navigation/_wg-navigation-toc.tsx +0 -114
  151. package/src/component/widget/navigation/wg-navigation.css +0 -282
  152. package/src/component/widget/navigation/wg-navigation.tsx +0 -420
  153. package/src/component/widget/prose/_constant/heading-highlight.ts +0 -4
  154. package/src/component/widget/prose/_constant/section.ts +0 -7
  155. package/src/component/widget/prose/_constant/status.ts +0 -9
  156. package/src/component/widget/prose/_function/has-block-content.ts +0 -30
  157. package/src/component/widget/prose/_function/rehype-head.ts +0 -31
  158. package/src/component/widget/prose/_function/rehype-sections/_to-section-headings.ts +0 -20
  159. package/src/component/widget/prose/_function/rehype-sections/rehype-sections.ts +0 -21
  160. package/src/component/widget/prose/_function/rehype-tables.ts +0 -22
  161. package/src/component/widget/prose/_function/remark-blocks.ts +0 -112
  162. package/src/component/widget/prose/_function/remark-flow.ts +0 -26
  163. package/src/component/widget/prose/_function/remark-links.ts +0 -33
  164. package/src/component/widget/prose/_function/remark-parts.ts +0 -26
  165. package/src/component/widget/prose/_function/remark-status.ts +0 -59
  166. package/src/component/widget/prose/_function/remark-swatch.ts +0 -16
  167. package/src/component/widget/prose/_function/remark-unknown-directives.ts +0 -25
  168. package/src/component/widget/prose/wg-prose.css +0 -484
  169. package/src/component/widget/prose/wg-prose.tsx +0 -43
  170. package/src/component/widget/shell/wg-shell.css +0 -63
  171. package/src/component/widget/shell/wg-shell.tsx +0 -88
  172. package/src/component/widget/shell-controls/wg-shell-controls.css +0 -4
  173. package/src/component/widget/shell-controls/wg-shell-controls.tsx +0 -170
  174. package/src/constant/asset.ts +0 -63
  175. package/src/constant/copy.ts +0 -133
  176. package/src/constant/doc.ts +0 -13
  177. package/src/constant/font.ts +0 -34
  178. package/src/constant/site.ts +0 -24
  179. package/src/constant/status.ts +0 -15
  180. package/src/entry/browser/browser.tsx +0 -22
  181. package/src/entry/cli/_constant/cli.ts +0 -19
  182. package/src/entry/cli/_constant/crawling.ts +0 -14
  183. package/src/entry/cli/_constant/snippet.ts +0 -21
  184. package/src/entry/cli/_function/create-app.tsx +0 -57
  185. package/src/entry/cli/_function/create-dev-app.ts +0 -87
  186. package/src/entry/cli/_function/create-processor/_rehype-assets.ts +0 -70
  187. package/src/entry/cli/_function/create-processor/_rehype-heading-ids.ts +0 -34
  188. package/src/entry/cli/_function/create-processor/_remark-report.ts +0 -15
  189. package/src/entry/cli/_function/create-processor/_remark-snippets.ts +0 -117
  190. package/src/entry/cli/_function/create-processor/_shiki-transformers.ts +0 -91
  191. package/src/entry/cli/_function/create-processor/create-processor.ts +0 -64
  192. package/src/entry/cli/_function/read-docs.ts +0 -128
  193. package/src/entry/cli/_function/read-home.ts +0 -32
  194. package/src/entry/cli/_function/to-crawling-app.ts +0 -42
  195. package/src/entry/cli/cli.test.ts +0 -804
  196. package/src/entry/cli/cli.ts +0 -206
  197. package/src/env.d.ts +0 -6
  198. package/src/page/doc/pg-doc.tsx +0 -35
  199. package/src/page/home/pg-home.tsx +0 -40
  200. package/src/store/navigation/create-navigation-stores.test.ts +0 -74
  201. package/src/store/navigation/create-navigation-stores.ts +0 -59
  202. package/src/store/navigation/navigation-state.ts +0 -36
  203. package/src/store/navigation/navigation-storage.ts +0 -9
  204. package/src/store/navigation/to-navigation-scroll-state.ts +0 -42
  205. package/src/style/base.css +0 -28
  206. package/src/style/token.css +0 -188
  207. package/src/type/doc-content.ts +0 -15
  208. package/src/type/doc-data.ts +0 -38
  209. package/src/type/doc-file-data.ts +0 -21
  210. package/src/type/doc-heading.ts +0 -17
  211. package/src/type/doc-outline.ts +0 -16
  212. package/src/type/doc-section.ts +0 -9
  213. package/src/type/doc.ts +0 -20
  214. package/src/type/group-path.ts +0 -7
  215. package/src/type/site-assets.ts +0 -25
  216. package/src/type/site-config.ts +0 -73
  217. package/src/type/vfile-data.d.ts +0 -10
  218. package/src/util/async/to-change-queue.test.ts +0 -58
  219. package/src/util/async/to-change-queue.ts +0 -43
  220. package/src/util/dom/find-hash-target.ts +0 -18
  221. package/src/util/dom/reveal-hash-target.ts +0 -15
  222. package/src/util/error/to-error-message.ts +0 -10
  223. package/src/util/file/to-asset-path.ts +0 -26
  224. package/src/util/font/to-font-css.test.ts +0 -41
  225. package/src/util/font/to-font-css.ts +0 -28
  226. package/src/util/mermaid/render-flow.js +0 -321
@@ -0,0 +1,1935 @@
1
+ import { m as e, p as t } from "./chunk-DVNvSFoz.js";
2
+ import { n } from "./chunk-BYzrzvCI.js";
3
+ import { a as r, at as i, b as a, c as o, s, y as c } from "./chunk-MFVRUoO0.js";
4
+ import { t as l } from "./chunk-DD6Df6Ic.js";
5
+ import { A as u, B as d, D as f, E as p, F as m, G as h, H as g, I as _, K as v, L as y, M as b, N as x, O as S, P as C, R as w, T, U as E, V as D, W as O, j as k, k as A, u as j, w as M, x as ee, y as te, z as ne } from "./chunk-K7Myuj2-.js";
6
+ import { t as re } from "./chunk-9kkt8lzL.js";
7
+ import "./chunk-Bok8z-Yo.js";
8
+ import "./chunk-KuPYb48V.js";
9
+ import "./chunk-_a9EZE1v.js";
10
+ import { i as ie, n as ae, o as oe, r as se, s as ce } from "./chunk-DBh1mIbK.js";
11
+ import "./chunk-DORnIAsy.js";
12
+ import { i as le, r as ue } from "./chunk-CLgRAtOz.js";
13
+ import { a as de, c as fe, i as pe, l as me } from "./chunk-DpuxlyL_.js";
14
+ import { t as he } from "./chunk-DqPZxHXa.js";
15
+ import { t as ge } from "./chunk-feYbMzBj.js";
16
+ //#region node_modules/.pnpm/es-toolkit@1.52.0/node_modules/es-toolkit/dist/compat/predicate/isArray.mjs
17
+ function _e(e) {
18
+ return Array.isArray(e);
19
+ }
20
+ //#endregion
21
+ //#region node_modules/.pnpm/es-toolkit@1.52.0/node_modules/es-toolkit/dist/compat/object/clone.mjs
22
+ function ve(e) {
23
+ if (ee(e)) return e;
24
+ let t = v(e);
25
+ if (!ye(e)) return {};
26
+ if (_e(e)) {
27
+ let t = Array.from(e);
28
+ return e.length > 0 && typeof e[0] == "string" && Object.hasOwn(e, "index") && (t.index = e.index, t.input = e.input), t;
29
+ }
30
+ if (te(e)) {
31
+ let t = e, n = t.constructor;
32
+ return new n(t.buffer, t.byteOffset, t.length);
33
+ }
34
+ if (t === "[object ArrayBuffer]") return new ArrayBuffer(e.byteLength);
35
+ if (t === "[object DataView]") {
36
+ let t = e, n = t.buffer, r = t.byteOffset, i = t.byteLength, a = new ArrayBuffer(i), o = new Uint8Array(n, r, i);
37
+ return new Uint8Array(a).set(o), new DataView(a);
38
+ }
39
+ if (t === "[object Boolean]" || t === "[object Number]" || t === "[object String]") {
40
+ let n = e.constructor, r = new n(e.valueOf());
41
+ return t === "[object String]" ? xe(r, e) : N(r, e), r;
42
+ }
43
+ if (t === "[object Date]") return new Date(Number(e));
44
+ if (t === "[object RegExp]") {
45
+ let t = e, n = new RegExp(t.source, t.flags);
46
+ return n.lastIndex = t.lastIndex, n;
47
+ }
48
+ if (t === "[object Symbol]") return Object(Symbol.prototype.valueOf.call(e));
49
+ if (t === "[object Map]") {
50
+ let t = e, n = /* @__PURE__ */ new Map();
51
+ return t.forEach((e, t) => {
52
+ n.set(t, e);
53
+ }), n;
54
+ }
55
+ if (t === "[object Set]") {
56
+ let t = e, n = /* @__PURE__ */ new Set();
57
+ return t.forEach((e) => {
58
+ n.add(e);
59
+ }), n;
60
+ }
61
+ if (t === "[object Arguments]") {
62
+ let t = e, n = {};
63
+ return N(n, t), n.length = t.length, n[Symbol.iterator] = t[Symbol.iterator], n;
64
+ }
65
+ let n = {};
66
+ return Se(n, e), N(n, e), be(n, e), n;
67
+ }
68
+ function ye(e) {
69
+ switch (v(e)) {
70
+ case M:
71
+ case p:
72
+ case T:
73
+ case S:
74
+ case f:
75
+ case A:
76
+ case u:
77
+ case k:
78
+ case C:
79
+ case b:
80
+ case x:
81
+ case m:
82
+ case _:
83
+ case y:
84
+ case w:
85
+ case ne:
86
+ case d:
87
+ case D:
88
+ case O:
89
+ case h:
90
+ case g:
91
+ case E: return !0;
92
+ default: return !1;
93
+ }
94
+ }
95
+ function N(e, t) {
96
+ for (let n in t) Object.hasOwn(t, n) && (e[n] = t[n]);
97
+ }
98
+ function be(e, t) {
99
+ let n = Object.getOwnPropertySymbols(t);
100
+ for (let r = 0; r < n.length; r++) {
101
+ let i = n[r];
102
+ Object.prototype.propertyIsEnumerable.call(t, i) && (e[i] = t[i]);
103
+ }
104
+ }
105
+ function xe(e, t) {
106
+ let n = t.valueOf().length;
107
+ for (let r in t) Object.hasOwn(t, r) && (Number.isNaN(Number(r)) || Number(r) >= n) && (e[r] = t[r]);
108
+ }
109
+ function Se(e, t) {
110
+ let n = Object.getPrototypeOf(t);
111
+ n !== null && typeof t.constructor == "function" && Object.setPrototypeOf(e, n);
112
+ }
113
+ //#endregion
114
+ //#region node_modules/.pnpm/mermaid@12.2.0/node_modules/mermaid/dist/chunks/mermaid.core/blockDiagram-RJAE7QA3.mjs
115
+ var P = (function() {
116
+ var e = /* @__PURE__ */ n(function(e, t, n, r) {
117
+ for (n ||= {}, r = e.length; r--; n[e[r]] = t);
118
+ return n;
119
+ }, "o"), t = [1, 15], r = [1, 7], i = [1, 13], a = [1, 14], o = [1, 19], s = [1, 16], c = [1, 17], l = [1, 18], u = [8, 30], d = [
120
+ 8,
121
+ 10,
122
+ 21,
123
+ 28,
124
+ 29,
125
+ 30,
126
+ 31,
127
+ 39,
128
+ 43,
129
+ 46
130
+ ], f = [1, 23], p = [1, 24], m = [
131
+ 8,
132
+ 10,
133
+ 15,
134
+ 16,
135
+ 21,
136
+ 28,
137
+ 29,
138
+ 30,
139
+ 31,
140
+ 39,
141
+ 43,
142
+ 46
143
+ ], h = [
144
+ 8,
145
+ 10,
146
+ 15,
147
+ 16,
148
+ 21,
149
+ 27,
150
+ 28,
151
+ 29,
152
+ 30,
153
+ 31,
154
+ 39,
155
+ 43,
156
+ 46
157
+ ], g = [1, 49], _ = {
158
+ trace: /* @__PURE__ */ n(function() {}, "trace"),
159
+ yy: {},
160
+ symbols_: {
161
+ error: 2,
162
+ spaceLines: 3,
163
+ SPACELINE: 4,
164
+ NL: 5,
165
+ separator: 6,
166
+ SPACE: 7,
167
+ EOF: 8,
168
+ start: 9,
169
+ BLOCK_DIAGRAM_KEY: 10,
170
+ document: 11,
171
+ stop: 12,
172
+ statement: 13,
173
+ link: 14,
174
+ LINK: 15,
175
+ START_LINK: 16,
176
+ LINK_LABEL: 17,
177
+ STR: 18,
178
+ nodeStatement: 19,
179
+ columnsStatement: 20,
180
+ SPACE_BLOCK: 21,
181
+ blockStatement: 22,
182
+ classDefStatement: 23,
183
+ cssClassStatement: 24,
184
+ styleStatement: 25,
185
+ node: 26,
186
+ SIZE: 27,
187
+ COLUMNS: 28,
188
+ "id-block": 29,
189
+ end: 30,
190
+ NODE_ID: 31,
191
+ nodeShapeNLabel: 32,
192
+ dirList: 33,
193
+ DIR: 34,
194
+ NODE_DSTART: 35,
195
+ NODE_DEND: 36,
196
+ BLOCK_ARROW_START: 37,
197
+ BLOCK_ARROW_END: 38,
198
+ classDef: 39,
199
+ CLASSDEF_ID: 40,
200
+ CLASSDEF_STYLEOPTS: 41,
201
+ DEFAULT: 42,
202
+ class: 43,
203
+ CLASSENTITY_IDS: 44,
204
+ STYLECLASS: 45,
205
+ style: 46,
206
+ STYLE_ENTITY_IDS: 47,
207
+ STYLE_DEFINITION_DATA: 48,
208
+ $accept: 0,
209
+ $end: 1
210
+ },
211
+ terminals_: {
212
+ 2: "error",
213
+ 4: "SPACELINE",
214
+ 5: "NL",
215
+ 7: "SPACE",
216
+ 8: "EOF",
217
+ 10: "BLOCK_DIAGRAM_KEY",
218
+ 15: "LINK",
219
+ 16: "START_LINK",
220
+ 17: "LINK_LABEL",
221
+ 18: "STR",
222
+ 21: "SPACE_BLOCK",
223
+ 27: "SIZE",
224
+ 28: "COLUMNS",
225
+ 29: "id-block",
226
+ 30: "end",
227
+ 31: "NODE_ID",
228
+ 34: "DIR",
229
+ 35: "NODE_DSTART",
230
+ 36: "NODE_DEND",
231
+ 37: "BLOCK_ARROW_START",
232
+ 38: "BLOCK_ARROW_END",
233
+ 39: "classDef",
234
+ 40: "CLASSDEF_ID",
235
+ 41: "CLASSDEF_STYLEOPTS",
236
+ 42: "DEFAULT",
237
+ 43: "class",
238
+ 44: "CLASSENTITY_IDS",
239
+ 45: "STYLECLASS",
240
+ 46: "style",
241
+ 47: "STYLE_ENTITY_IDS",
242
+ 48: "STYLE_DEFINITION_DATA"
243
+ },
244
+ productions_: [
245
+ 0,
246
+ [3, 1],
247
+ [3, 2],
248
+ [3, 2],
249
+ [6, 1],
250
+ [6, 1],
251
+ [6, 1],
252
+ [9, 3],
253
+ [12, 1],
254
+ [12, 1],
255
+ [12, 2],
256
+ [12, 2],
257
+ [11, 1],
258
+ [11, 2],
259
+ [14, 1],
260
+ [14, 4],
261
+ [13, 1],
262
+ [13, 1],
263
+ [13, 1],
264
+ [13, 1],
265
+ [13, 1],
266
+ [13, 1],
267
+ [13, 1],
268
+ [19, 3],
269
+ [19, 2],
270
+ [19, 1],
271
+ [20, 1],
272
+ [22, 4],
273
+ [22, 3],
274
+ [26, 1],
275
+ [26, 2],
276
+ [33, 1],
277
+ [33, 2],
278
+ [32, 3],
279
+ [32, 4],
280
+ [23, 3],
281
+ [23, 3],
282
+ [24, 3],
283
+ [25, 3]
284
+ ],
285
+ performAction: /* @__PURE__ */ n(function(e, t, n, r, i, a, o) {
286
+ var s = a.length - 1;
287
+ switch (i) {
288
+ case 4:
289
+ r.getLogger().debug("Rule: separator (NL) ");
290
+ break;
291
+ case 5:
292
+ r.getLogger().debug("Rule: separator (Space) ");
293
+ break;
294
+ case 6:
295
+ r.getLogger().debug("Rule: separator (EOF) ");
296
+ break;
297
+ case 7:
298
+ r.getLogger().debug("Rule: hierarchy: ", a[s - 1]), r.setHierarchy(a[s - 1]);
299
+ break;
300
+ case 8:
301
+ r.getLogger().debug("Stop NL ");
302
+ break;
303
+ case 9:
304
+ r.getLogger().debug("Stop EOF ");
305
+ break;
306
+ case 10:
307
+ r.getLogger().debug("Stop NL2 ");
308
+ break;
309
+ case 11:
310
+ r.getLogger().debug("Stop EOF2 ");
311
+ break;
312
+ case 12:
313
+ r.getLogger().debug("Rule: statement: ", a[s]), this.$ = typeof a[s].length == "number" ? a[s] : [a[s]];
314
+ break;
315
+ case 13:
316
+ r.getLogger().debug("Rule: statement #2: ", a[s - 1]), this.$ = [a[s - 1]].concat(a[s]);
317
+ break;
318
+ case 14:
319
+ r.getLogger().debug("Rule: link: ", a[s], e), this.$ = {
320
+ edgeTypeStr: a[s],
321
+ label: ""
322
+ };
323
+ break;
324
+ case 15:
325
+ r.getLogger().debug("Rule: LABEL link: ", a[s - 3], a[s - 1], a[s]), this.$ = {
326
+ edgeTypeStr: a[s],
327
+ label: a[s - 1]
328
+ };
329
+ break;
330
+ case 18:
331
+ let t = parseInt(a[s]), n = r.generateId();
332
+ this.$ = {
333
+ id: n,
334
+ type: "space",
335
+ label: "",
336
+ width: t,
337
+ children: []
338
+ };
339
+ break;
340
+ case 23:
341
+ r.getLogger().debug("Rule: (nodeStatement link node) ", a[s - 2], a[s - 1], a[s], " typestr: ", a[s - 1].edgeTypeStr);
342
+ let i = r.edgeStrToEdgeData(a[s - 1].edgeTypeStr), o = r.edgeStrToEdgeStartData(a[s - 1].edgeTypeStr), c = r.edgeStrToThickness(a[s - 1].edgeTypeStr), l = r.edgeStrToPattern(a[s - 1].edgeTypeStr);
343
+ this.$ = [
344
+ {
345
+ id: a[s - 2].id,
346
+ label: a[s - 2].label,
347
+ type: a[s - 2].type,
348
+ directions: a[s - 2].directions
349
+ },
350
+ {
351
+ id: a[s - 2].id + "-" + a[s].id,
352
+ start: a[s - 2].id,
353
+ end: a[s].id,
354
+ label: a[s - 1].label,
355
+ type: "edge",
356
+ thickness: c,
357
+ pattern: l,
358
+ directions: a[s].directions,
359
+ arrowTypeEnd: i,
360
+ arrowTypeStart: o
361
+ },
362
+ {
363
+ id: a[s].id,
364
+ label: a[s].label,
365
+ type: r.typeStr2Type(a[s].typeStr),
366
+ directions: a[s].directions
367
+ }
368
+ ];
369
+ break;
370
+ case 24:
371
+ r.getLogger().debug("Rule: nodeStatement (abc88 node size) ", a[s - 1], a[s]), this.$ = {
372
+ id: a[s - 1].id,
373
+ label: a[s - 1].label,
374
+ type: r.typeStr2Type(a[s - 1].typeStr),
375
+ directions: a[s - 1].directions,
376
+ widthInColumns: parseInt(a[s], 10)
377
+ };
378
+ break;
379
+ case 25:
380
+ r.getLogger().debug("Rule: nodeStatement (node) ", a[s]), this.$ = {
381
+ id: a[s].id,
382
+ label: a[s].label,
383
+ type: r.typeStr2Type(a[s].typeStr),
384
+ directions: a[s].directions,
385
+ widthInColumns: 1
386
+ };
387
+ break;
388
+ case 26:
389
+ r.getLogger().debug("APA123", this ? this : "na"), r.getLogger().debug("COLUMNS: ", a[s]), this.$ = {
390
+ type: "column-setting",
391
+ columns: a[s] === "auto" ? -1 : parseInt(a[s])
392
+ };
393
+ break;
394
+ case 27:
395
+ r.getLogger().debug("Rule: id-block statement : ", a[s - 2], a[s - 1]), r.generateId(), this.$ = {
396
+ ...a[s - 2],
397
+ type: "composite",
398
+ children: a[s - 1]
399
+ };
400
+ break;
401
+ case 28:
402
+ r.getLogger().debug("Rule: blockStatement : ", a[s - 2], a[s - 1], a[s]);
403
+ let u = r.generateId();
404
+ this.$ = {
405
+ id: u,
406
+ type: "composite",
407
+ label: "",
408
+ children: a[s - 1]
409
+ };
410
+ break;
411
+ case 29:
412
+ r.getLogger().debug("Rule: node (NODE_ID separator): ", a[s]), this.$ = { id: a[s] };
413
+ break;
414
+ case 30:
415
+ r.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ", a[s - 1], a[s]), this.$ = {
416
+ id: a[s - 1],
417
+ label: a[s].label,
418
+ typeStr: a[s].typeStr,
419
+ directions: a[s].directions
420
+ };
421
+ break;
422
+ case 31:
423
+ r.getLogger().debug("Rule: dirList: ", a[s]), this.$ = [a[s]];
424
+ break;
425
+ case 32:
426
+ r.getLogger().debug("Rule: dirList: ", a[s - 1], a[s]), this.$ = [a[s - 1]].concat(a[s]);
427
+ break;
428
+ case 33:
429
+ r.getLogger().debug("Rule: nodeShapeNLabel: ", a[s - 2], a[s - 1], a[s]), this.$ = {
430
+ typeStr: a[s - 2] + a[s],
431
+ label: a[s - 1]
432
+ };
433
+ break;
434
+ case 34:
435
+ r.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ", a[s - 3], a[s - 2], " #3:", a[s - 1], a[s]), this.$ = {
436
+ typeStr: a[s - 3] + a[s],
437
+ label: a[s - 2],
438
+ directions: a[s - 1]
439
+ };
440
+ break;
441
+ case 35:
442
+ case 36:
443
+ this.$ = {
444
+ type: "classDef",
445
+ id: a[s - 1].trim(),
446
+ css: a[s].trim()
447
+ };
448
+ break;
449
+ case 37:
450
+ this.$ = {
451
+ type: "applyClass",
452
+ id: a[s - 1].trim(),
453
+ styleClass: a[s].trim()
454
+ };
455
+ break;
456
+ case 38: this.$ = {
457
+ type: "applyStyles",
458
+ id: a[s - 1].trim(),
459
+ stylesStr: a[s].trim()
460
+ };
461
+ }
462
+ }, "anonymous"),
463
+ table: [
464
+ {
465
+ 9: 1,
466
+ 10: [1, 2]
467
+ },
468
+ { 1: [3] },
469
+ {
470
+ 10: t,
471
+ 11: 3,
472
+ 13: 4,
473
+ 19: 5,
474
+ 20: 6,
475
+ 21: r,
476
+ 22: 8,
477
+ 23: 9,
478
+ 24: 10,
479
+ 25: 11,
480
+ 26: 12,
481
+ 28: i,
482
+ 29: a,
483
+ 31: o,
484
+ 39: s,
485
+ 43: c,
486
+ 46: l
487
+ },
488
+ { 8: [1, 20] },
489
+ e(u, [2, 12], {
490
+ 13: 4,
491
+ 19: 5,
492
+ 20: 6,
493
+ 22: 8,
494
+ 23: 9,
495
+ 24: 10,
496
+ 25: 11,
497
+ 26: 12,
498
+ 11: 21,
499
+ 10: t,
500
+ 21: r,
501
+ 28: i,
502
+ 29: a,
503
+ 31: o,
504
+ 39: s,
505
+ 43: c,
506
+ 46: l
507
+ }),
508
+ e(d, [2, 16], {
509
+ 14: 22,
510
+ 15: f,
511
+ 16: p
512
+ }),
513
+ e(d, [2, 17]),
514
+ e(d, [2, 18]),
515
+ e(d, [2, 19]),
516
+ e(d, [2, 20]),
517
+ e(d, [2, 21]),
518
+ e(d, [2, 22]),
519
+ e(m, [2, 25], { 27: [1, 25] }),
520
+ e(d, [2, 26]),
521
+ {
522
+ 19: 26,
523
+ 26: 12,
524
+ 31: o
525
+ },
526
+ {
527
+ 10: t,
528
+ 11: 27,
529
+ 13: 4,
530
+ 19: 5,
531
+ 20: 6,
532
+ 21: r,
533
+ 22: 8,
534
+ 23: 9,
535
+ 24: 10,
536
+ 25: 11,
537
+ 26: 12,
538
+ 28: i,
539
+ 29: a,
540
+ 31: o,
541
+ 39: s,
542
+ 43: c,
543
+ 46: l
544
+ },
545
+ {
546
+ 40: [1, 28],
547
+ 42: [1, 29]
548
+ },
549
+ { 44: [1, 30] },
550
+ { 47: [1, 31] },
551
+ e(h, [2, 29], {
552
+ 32: 32,
553
+ 35: [1, 33],
554
+ 37: [1, 34]
555
+ }),
556
+ { 1: [2, 7] },
557
+ e(u, [2, 13]),
558
+ {
559
+ 26: 35,
560
+ 31: o
561
+ },
562
+ { 31: [2, 14] },
563
+ { 17: [1, 36] },
564
+ e(m, [2, 24]),
565
+ {
566
+ 10: t,
567
+ 11: 37,
568
+ 13: 4,
569
+ 14: 22,
570
+ 15: f,
571
+ 16: p,
572
+ 19: 5,
573
+ 20: 6,
574
+ 21: r,
575
+ 22: 8,
576
+ 23: 9,
577
+ 24: 10,
578
+ 25: 11,
579
+ 26: 12,
580
+ 28: i,
581
+ 29: a,
582
+ 31: o,
583
+ 39: s,
584
+ 43: c,
585
+ 46: l
586
+ },
587
+ { 30: [1, 38] },
588
+ { 41: [1, 39] },
589
+ { 41: [1, 40] },
590
+ { 45: [1, 41] },
591
+ { 48: [1, 42] },
592
+ e(h, [2, 30]),
593
+ { 18: [1, 43] },
594
+ { 18: [1, 44] },
595
+ e(m, [2, 23]),
596
+ { 18: [1, 45] },
597
+ { 30: [1, 46] },
598
+ e(d, [2, 28]),
599
+ e(d, [2, 35]),
600
+ e(d, [2, 36]),
601
+ e(d, [2, 37]),
602
+ e(d, [2, 38]),
603
+ { 36: [1, 47] },
604
+ {
605
+ 33: 48,
606
+ 34: g
607
+ },
608
+ { 15: [1, 50] },
609
+ e(d, [2, 27]),
610
+ e(h, [2, 33]),
611
+ { 38: [1, 51] },
612
+ {
613
+ 33: 52,
614
+ 34: g,
615
+ 38: [2, 31]
616
+ },
617
+ { 31: [2, 15] },
618
+ e(h, [2, 34]),
619
+ { 38: [2, 32] }
620
+ ],
621
+ defaultActions: {
622
+ 20: [2, 7],
623
+ 23: [2, 14],
624
+ 50: [2, 15],
625
+ 52: [2, 32]
626
+ },
627
+ parseError: /* @__PURE__ */ n(function(e, t) {
628
+ if (t.recoverable) this.trace(e);
629
+ else {
630
+ var n = Error(e);
631
+ throw n.hash = t, n;
632
+ }
633
+ }, "parseError"),
634
+ parse: /* @__PURE__ */ n(function(e) {
635
+ var t = this, r = [0], i = [], a = [null], o = [], s = this.table, c = "", l = 0, u = 0, d = 0, f = 2, p = 1, m = o.slice.call(arguments, 1), h = Object.create(this.lexer), g = { yy: {} };
636
+ for (var _ in this.yy) Object.prototype.hasOwnProperty.call(this.yy, _) && (g.yy[_] = this.yy[_]);
637
+ h.setInput(e, g.yy), g.yy.lexer = h, g.yy.parser = this, h.yylloc === void 0 && (h.yylloc = {});
638
+ var v = h.yylloc;
639
+ o.push(v);
640
+ var y = h.options && h.options.ranges;
641
+ this.parseError = typeof g.yy.parseError == "function" ? g.yy.parseError : Object.getPrototypeOf(this).parseError;
642
+ function b(e) {
643
+ r.length -= 2 * e, a.length -= e, o.length -= e;
644
+ }
645
+ n(b, "popStack");
646
+ function x() {
647
+ var e = i.pop() || h.lex() || p;
648
+ return typeof e != "number" && (e instanceof Array && (i = e, e = i.pop()), e = t.symbols_[e] || e), e;
649
+ }
650
+ n(x, "lex");
651
+ for (var S, C, w, T, E, D = {}, O, k, A, j;;) {
652
+ if (w = r[r.length - 1], this.defaultActions[w] ? T = this.defaultActions[w] : (S ??= x(), T = s[w] && s[w][S]), T === void 0 || !T.length || !T[0]) {
653
+ var M = "";
654
+ for (O in j = [], s[w]) this.terminals_[O] && O > f && j.push("'" + this.terminals_[O] + "'");
655
+ M = h.showPosition ? "Parse error on line " + (l + 1) + ":\n" + h.showPosition() + "\nExpecting " + j.join(", ") + ", got '" + (this.terminals_[S] || S) + "'" : "Parse error on line " + (l + 1) + ": Unexpected " + (S == p ? "end of input" : "'" + (this.terminals_[S] || S) + "'"), this.parseError(M, {
656
+ text: h.match,
657
+ token: this.terminals_[S] || S,
658
+ line: h.yylineno,
659
+ loc: v,
660
+ expected: j
661
+ });
662
+ }
663
+ if (T[0] instanceof Array && T.length > 1) throw Error("Parse Error: multiple actions possible at state: " + w + ", token: " + S);
664
+ switch (T[0]) {
665
+ case 1:
666
+ r.push(S), a.push(h.yytext), o.push(h.yylloc), r.push(T[1]), S = null, C ? (S = C, C = null) : (u = h.yyleng, c = h.yytext, l = h.yylineno, v = h.yylloc, d > 0 && d--);
667
+ break;
668
+ case 2:
669
+ if (k = this.productions_[T[1]][1], D.$ = a[a.length - k], D._$ = {
670
+ first_line: o[o.length - (k || 1)].first_line,
671
+ last_line: o[o.length - 1].last_line,
672
+ first_column: o[o.length - (k || 1)].first_column,
673
+ last_column: o[o.length - 1].last_column
674
+ }, y && (D._$.range = [o[o.length - (k || 1)].range[0], o[o.length - 1].range[1]]), E = this.performAction.apply(D, [
675
+ c,
676
+ u,
677
+ l,
678
+ g.yy,
679
+ T[1],
680
+ a,
681
+ o
682
+ ].concat(m)), E !== void 0) return E;
683
+ k && (r = r.slice(0, -1 * k * 2), a = a.slice(0, -1 * k), o = o.slice(0, -1 * k)), r.push(this.productions_[T[1]][0]), a.push(D.$), o.push(D._$), A = s[r[r.length - 2]][r[r.length - 1]], r.push(A);
684
+ break;
685
+ case 3: return !0;
686
+ }
687
+ }
688
+ return !0;
689
+ }, "parse")
690
+ };
691
+ _.lexer = /* @__PURE__ */ (function() {
692
+ return {
693
+ EOF: 1,
694
+ parseError: /* @__PURE__ */ n(function(e, t) {
695
+ if (this.yy.parser) this.yy.parser.parseError(e, t);
696
+ else throw Error(e);
697
+ }, "parseError"),
698
+ setInput: /* @__PURE__ */ n(function(e, t) {
699
+ return this.yy = t || this.yy || {}, this._input = e, this._more = this._backtrack = this.done = !1, this.yylineno = this.yyleng = 0, this.yytext = this.matched = this.match = "", this.conditionStack = ["INITIAL"], this.yylloc = {
700
+ first_line: 1,
701
+ first_column: 0,
702
+ last_line: 1,
703
+ last_column: 0
704
+ }, this.options.ranges && (this.yylloc.range = [0, 0]), this.offset = 0, this;
705
+ }, "setInput"),
706
+ input: /* @__PURE__ */ n(function() {
707
+ var e = this._input[0];
708
+ return this.yytext += e, this.yyleng++, this.offset++, this.match += e, this.matched += e, e.match(/(?:\r\n?|\n).*/g) ? (this.yylineno++, this.yylloc.last_line++) : this.yylloc.last_column++, this.options.ranges && this.yylloc.range[1]++, this._input = this._input.slice(1), e;
709
+ }, "input"),
710
+ unput: /* @__PURE__ */ n(function(e) {
711
+ var t = e.length, n = e.split(/(?:\r\n?|\n)/g);
712
+ this._input = e + this._input, this.yytext = this.yytext.substr(0, this.yytext.length - t), this.offset -= t;
713
+ var r = this.match.split(/(?:\r\n?|\n)/g);
714
+ this.match = this.match.substr(0, this.match.length - 1), this.matched = this.matched.substr(0, this.matched.length - 1), n.length - 1 && (this.yylineno -= n.length - 1);
715
+ var i = this.yylloc.range;
716
+ return this.yylloc = {
717
+ first_line: this.yylloc.first_line,
718
+ last_line: this.yylineno + 1,
719
+ first_column: this.yylloc.first_column,
720
+ last_column: n ? (n.length === r.length ? this.yylloc.first_column : 0) + r[r.length - n.length].length - n[0].length : this.yylloc.first_column - t
721
+ }, this.options.ranges && (this.yylloc.range = [i[0], i[0] + this.yyleng - t]), this.yyleng = this.yytext.length, this;
722
+ }, "unput"),
723
+ more: /* @__PURE__ */ n(function() {
724
+ return this._more = !0, this;
725
+ }, "more"),
726
+ reject: /* @__PURE__ */ n(function() {
727
+ if (this.options.backtrack_lexer) this._backtrack = !0;
728
+ else return this.parseError("Lexical error on line " + (this.yylineno + 1) + ". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n" + this.showPosition(), {
729
+ text: "",
730
+ token: null,
731
+ line: this.yylineno
732
+ });
733
+ return this;
734
+ }, "reject"),
735
+ less: /* @__PURE__ */ n(function(e) {
736
+ this.unput(this.match.slice(e));
737
+ }, "less"),
738
+ pastInput: /* @__PURE__ */ n(function() {
739
+ var e = this.matched.substr(0, this.matched.length - this.match.length);
740
+ return (e.length > 20 ? "..." : "") + e.substr(-20).replace(/\n/g, "");
741
+ }, "pastInput"),
742
+ upcomingInput: /* @__PURE__ */ n(function() {
743
+ var e = this.match;
744
+ return e.length < 20 && (e += this._input.substr(0, 20 - e.length)), (e.substr(0, 20) + (e.length > 20 ? "..." : "")).replace(/\n/g, "");
745
+ }, "upcomingInput"),
746
+ showPosition: /* @__PURE__ */ n(function() {
747
+ var e = this.pastInput(), t = Array(e.length + 1).join("-");
748
+ return e + this.upcomingInput() + "\n" + t + "^";
749
+ }, "showPosition"),
750
+ test_match: /* @__PURE__ */ n(function(e, t) {
751
+ var n, r, i;
752
+ if (this.options.backtrack_lexer && (i = {
753
+ yylineno: this.yylineno,
754
+ yylloc: {
755
+ first_line: this.yylloc.first_line,
756
+ last_line: this.last_line,
757
+ first_column: this.yylloc.first_column,
758
+ last_column: this.yylloc.last_column
759
+ },
760
+ yytext: this.yytext,
761
+ match: this.match,
762
+ matches: this.matches,
763
+ matched: this.matched,
764
+ yyleng: this.yyleng,
765
+ offset: this.offset,
766
+ _more: this._more,
767
+ _input: this._input,
768
+ yy: this.yy,
769
+ conditionStack: this.conditionStack.slice(0),
770
+ done: this.done
771
+ }, this.options.ranges && (i.yylloc.range = this.yylloc.range.slice(0))), r = e[0].match(/(?:\r\n?|\n).*/g), r && (this.yylineno += r.length), this.yylloc = {
772
+ first_line: this.yylloc.last_line,
773
+ last_line: this.yylineno + 1,
774
+ first_column: this.yylloc.last_column,
775
+ last_column: r ? r[r.length - 1].length - r[r.length - 1].match(/\r?\n?/)[0].length : this.yylloc.last_column + e[0].length
776
+ }, this.yytext += e[0], this.match += e[0], this.matches = e, this.yyleng = this.yytext.length, this.options.ranges && (this.yylloc.range = [this.offset, this.offset += this.yyleng]), this._more = !1, this._backtrack = !1, this._input = this._input.slice(e[0].length), this.matched += e[0], n = this.performAction.call(this, this.yy, this, t, this.conditionStack[this.conditionStack.length - 1]), this.done && this._input && (this.done = !1), n) return n;
777
+ if (this._backtrack) {
778
+ for (var a in i) this[a] = i[a];
779
+ return !1;
780
+ }
781
+ return !1;
782
+ }, "test_match"),
783
+ next: /* @__PURE__ */ n(function() {
784
+ if (this.done) return this.EOF;
785
+ this._input || (this.done = !0);
786
+ var e, t, n, r;
787
+ this._more || (this.yytext = "", this.match = "");
788
+ for (var i = this._currentRules(), a = 0; a < i.length; a++) if (n = this._input.match(this.rules[i[a]]), n && (!t || n[0].length > t[0].length)) {
789
+ if (t = n, r = a, this.options.backtrack_lexer) {
790
+ if (e = this.test_match(n, i[a]), e !== !1) return e;
791
+ if (this._backtrack) {
792
+ t = !1;
793
+ continue;
794
+ }
795
+ return !1;
796
+ }
797
+ if (!this.options.flex) break;
798
+ }
799
+ return t ? (e = this.test_match(t, i[r]), e !== !1 && e) : this._input === "" ? this.EOF : this.parseError("Lexical error on line " + (this.yylineno + 1) + ". Unrecognized text.\n" + this.showPosition(), {
800
+ text: "",
801
+ token: null,
802
+ line: this.yylineno
803
+ });
804
+ }, "next"),
805
+ lex: /* @__PURE__ */ n(function() {
806
+ return this.next() || this.lex();
807
+ }, "lex"),
808
+ begin: /* @__PURE__ */ n(function(e) {
809
+ this.conditionStack.push(e);
810
+ }, "begin"),
811
+ popState: /* @__PURE__ */ n(function() {
812
+ return this.conditionStack.length - 1 > 0 ? this.conditionStack.pop() : this.conditionStack[0];
813
+ }, "popState"),
814
+ _currentRules: /* @__PURE__ */ n(function() {
815
+ return this.conditionStack.length && this.conditionStack[this.conditionStack.length - 1] ? this.conditions[this.conditionStack[this.conditionStack.length - 1]].rules : this.conditions.INITIAL.rules;
816
+ }, "_currentRules"),
817
+ topState: /* @__PURE__ */ n(function(e) {
818
+ return e = this.conditionStack.length - 1 - Math.abs(e || 0), e >= 0 ? this.conditionStack[e] : "INITIAL";
819
+ }, "topState"),
820
+ pushState: /* @__PURE__ */ n(function(e) {
821
+ this.begin(e);
822
+ }, "pushState"),
823
+ stateStackSize: /* @__PURE__ */ n(function() {
824
+ return this.conditionStack.length;
825
+ }, "stateStackSize"),
826
+ options: {},
827
+ performAction: /* @__PURE__ */ n(function(e, t, n, r) {
828
+ switch (n) {
829
+ case 0: return e.getLogger().debug("Found block-beta"), 10;
830
+ case 1: return e.getLogger().debug("Found id-block"), 29;
831
+ case 2: return e.getLogger().debug("Found block"), 10;
832
+ case 3:
833
+ e.getLogger().debug(".", t.yytext);
834
+ break;
835
+ case 4:
836
+ e.getLogger().debug("_", t.yytext);
837
+ break;
838
+ case 5: return 5;
839
+ case 6: return t.yytext = -1, 28;
840
+ case 7: return t.yytext = t.yytext.replace(/columns\s+/, ""), e.getLogger().debug("COLUMNS (LEX)", t.yytext), 28;
841
+ case 8:
842
+ this.pushState("md_string");
843
+ break;
844
+ case 9: return "MD_STR";
845
+ case 10:
846
+ this.popState();
847
+ break;
848
+ case 11:
849
+ this.pushState("string");
850
+ break;
851
+ case 12:
852
+ e.getLogger().debug("LEX: POPPING STR:", t.yytext), this.popState();
853
+ break;
854
+ case 13: return e.getLogger().debug("LEX: STR end:", t.yytext), "STR";
855
+ case 14: return t.yytext = t.yytext.replace(/space\:/, ""), e.getLogger().debug("SPACE NUM (LEX)", t.yytext), 21;
856
+ case 15: return t.yytext = "1", e.getLogger().debug("COLUMNS (LEX)", t.yytext), 21;
857
+ case 16: return 42;
858
+ case 17: return "LINKSTYLE";
859
+ case 18: return "INTERPOLATE";
860
+ case 19: return this.pushState("CLASSDEF"), 39;
861
+ case 20: return this.popState(), this.pushState("CLASSDEFID"), "DEFAULT_CLASSDEF_ID";
862
+ case 21: return this.popState(), this.pushState("CLASSDEFID"), 40;
863
+ case 22: return this.popState(), 41;
864
+ case 23: return this.pushState("CLASS"), 43;
865
+ case 24: return this.popState(), this.pushState("CLASS_STYLE"), 44;
866
+ case 25: return this.popState(), 45;
867
+ case 26: return this.pushState("STYLE_STMNT"), 46;
868
+ case 27: return this.popState(), this.pushState("STYLE_DEFINITION"), 47;
869
+ case 28: return this.popState(), 48;
870
+ case 29: return this.pushState("acc_title"), "acc_title";
871
+ case 30: return this.popState(), "acc_title_value";
872
+ case 31: return this.pushState("acc_descr"), "acc_descr";
873
+ case 32: return this.popState(), "acc_descr_value";
874
+ case 33:
875
+ this.pushState("acc_descr_multiline");
876
+ break;
877
+ case 34:
878
+ this.popState();
879
+ break;
880
+ case 35: return "acc_descr_multiline_value";
881
+ case 36: return 30;
882
+ case 37: return this.popState(), e.getLogger().debug("Lex: (("), "NODE_DEND";
883
+ case 38: return this.popState(), e.getLogger().debug("Lex: (("), "NODE_DEND";
884
+ case 39: return this.popState(), e.getLogger().debug("Lex: ))"), "NODE_DEND";
885
+ case 40: return this.popState(), e.getLogger().debug("Lex: (("), "NODE_DEND";
886
+ case 41: return this.popState(), e.getLogger().debug("Lex: (("), "NODE_DEND";
887
+ case 42: return this.popState(), e.getLogger().debug("Lex: (-"), "NODE_DEND";
888
+ case 43: return this.popState(), e.getLogger().debug("Lex: -)"), "NODE_DEND";
889
+ case 44: return this.popState(), e.getLogger().debug("Lex: (("), "NODE_DEND";
890
+ case 45: return this.popState(), e.getLogger().debug("Lex: ]]"), "NODE_DEND";
891
+ case 46: return this.popState(), e.getLogger().debug("Lex: ("), "NODE_DEND";
892
+ case 47: return this.popState(), e.getLogger().debug("Lex: ])"), "NODE_DEND";
893
+ case 48: return this.popState(), e.getLogger().debug("Lex: /]"), "NODE_DEND";
894
+ case 49: return this.popState(), e.getLogger().debug("Lex: /]"), "NODE_DEND";
895
+ case 50: return this.popState(), e.getLogger().debug("Lex: )]"), "NODE_DEND";
896
+ case 51: return this.popState(), e.getLogger().debug("Lex: )"), "NODE_DEND";
897
+ case 52: return this.popState(), e.getLogger().debug("Lex: ]>"), "NODE_DEND";
898
+ case 53: return this.popState(), e.getLogger().debug("Lex: ]"), "NODE_DEND";
899
+ case 54: return e.getLogger().debug("Lexa: -)"), this.pushState("NODE"), 35;
900
+ case 55: return e.getLogger().debug("Lexa: (-"), this.pushState("NODE"), 35;
901
+ case 56: return e.getLogger().debug("Lexa: ))"), this.pushState("NODE"), 35;
902
+ case 57: return e.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
903
+ case 58: return e.getLogger().debug("Lex: ((("), this.pushState("NODE"), 35;
904
+ case 59: return e.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
905
+ case 60: return e.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
906
+ case 61: return e.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
907
+ case 62: return e.getLogger().debug("Lexc: >"), this.pushState("NODE"), 35;
908
+ case 63: return e.getLogger().debug("Lexa: (["), this.pushState("NODE"), 35;
909
+ case 64: return e.getLogger().debug("Lexa: )"), this.pushState("NODE"), 35;
910
+ case 65: return this.pushState("NODE"), 35;
911
+ case 66: return this.pushState("NODE"), 35;
912
+ case 67: return this.pushState("NODE"), 35;
913
+ case 68: return this.pushState("NODE"), 35;
914
+ case 69: return this.pushState("NODE"), 35;
915
+ case 70: return this.pushState("NODE"), 35;
916
+ case 71: return this.pushState("NODE"), 35;
917
+ case 72: return e.getLogger().debug("Lexa: ["), this.pushState("NODE"), 35;
918
+ case 73: return this.pushState("BLOCK_ARROW"), e.getLogger().debug("LEX ARR START"), 37;
919
+ case 74: return e.getLogger().debug("Lex: NODE_ID", t.yytext), 31;
920
+ case 75: return e.getLogger().debug("Lex: EOF", t.yytext), 8;
921
+ case 76:
922
+ this.pushState("md_string");
923
+ break;
924
+ case 77:
925
+ this.pushState("md_string");
926
+ break;
927
+ case 78: return "NODE_DESCR";
928
+ case 79:
929
+ this.popState();
930
+ break;
931
+ case 80:
932
+ e.getLogger().debug("Lex: Starting string"), this.pushState("string");
933
+ break;
934
+ case 81:
935
+ e.getLogger().debug("LEX ARR: Starting string"), this.pushState("string");
936
+ break;
937
+ case 82: return e.getLogger().debug("LEX: NODE_DESCR:", t.yytext), "NODE_DESCR";
938
+ case 83:
939
+ e.getLogger().debug("LEX POPPING"), this.popState();
940
+ break;
941
+ case 84:
942
+ e.getLogger().debug("Lex: =>BAE"), this.pushState("ARROW_DIR");
943
+ break;
944
+ case 85: return t.yytext = t.yytext.replace(/^,\s*/, ""), e.getLogger().debug("Lex (right): dir:", t.yytext), "DIR";
945
+ case 86: return t.yytext = t.yytext.replace(/^,\s*/, ""), e.getLogger().debug("Lex (left):", t.yytext), "DIR";
946
+ case 87: return t.yytext = t.yytext.replace(/^,\s*/, ""), e.getLogger().debug("Lex (x):", t.yytext), "DIR";
947
+ case 88: return t.yytext = t.yytext.replace(/^,\s*/, ""), e.getLogger().debug("Lex (y):", t.yytext), "DIR";
948
+ case 89: return t.yytext = t.yytext.replace(/^,\s*/, ""), e.getLogger().debug("Lex (up):", t.yytext), "DIR";
949
+ case 90: return t.yytext = t.yytext.replace(/^,\s*/, ""), e.getLogger().debug("Lex (down):", t.yytext), "DIR";
950
+ case 91: return t.yytext = "]>", e.getLogger().debug("Lex (ARROW_DIR end):", t.yytext), this.popState(), this.popState(), "BLOCK_ARROW_END";
951
+ case 92: return e.getLogger().debug("Lex: LINK", "#" + t.yytext + "#"), 15;
952
+ case 93: return e.getLogger().debug("Lex: LINK", t.yytext), 15;
953
+ case 94: return e.getLogger().debug("Lex: LINK", t.yytext), 15;
954
+ case 95: return e.getLogger().debug("Lex: LINK", t.yytext), 15;
955
+ case 96: return e.getLogger().debug("Lex: START_LINK", t.yytext), this.pushState("LLABEL"), 16;
956
+ case 97: return e.getLogger().debug("Lex: START_LINK", t.yytext), this.pushState("LLABEL"), 16;
957
+ case 98: return e.getLogger().debug("Lex: START_LINK", t.yytext), this.pushState("LLABEL"), 16;
958
+ case 99:
959
+ this.pushState("md_string");
960
+ break;
961
+ case 100: return e.getLogger().debug("Lex: Starting string"), this.pushState("string"), "LINK_LABEL";
962
+ case 101: return this.popState(), e.getLogger().debug("Lex: LINK", "#" + t.yytext + "#"), 15;
963
+ case 102: return this.popState(), e.getLogger().debug("Lex: LINK", t.yytext), 15;
964
+ case 103: return this.popState(), e.getLogger().debug("Lex: LINK", t.yytext), 15;
965
+ case 104: return e.getLogger().debug("Lex: COLON", t.yytext), t.yytext = t.yytext.slice(1), 27;
966
+ }
967
+ }, "anonymous"),
968
+ rules: [
969
+ /^(?:block-beta\b)/,
970
+ /^(?:block:)/,
971
+ /^(?:block\b)/,
972
+ /^(?:[\s]+)/,
973
+ /^(?:[\n]+)/,
974
+ /^(?:((\u000D\u000A)|(\u000A)))/,
975
+ /^(?:columns\s+auto\b)/,
976
+ /^(?:columns\s+[\d]+)/,
977
+ /^(?:["][`])/,
978
+ /^(?:[^`"]+)/,
979
+ /^(?:[`]["])/,
980
+ /^(?:["])/,
981
+ /^(?:["])/,
982
+ /^(?:[^"]*)/,
983
+ /^(?:space[:]\d+)/,
984
+ /^(?:space\b)/,
985
+ /^(?:default\b)/,
986
+ /^(?:linkStyle\b)/,
987
+ /^(?:interpolate\b)/,
988
+ /^(?:classDef\s+)/,
989
+ /^(?:DEFAULT\s+)/,
990
+ /^(?:\w+\s+)/,
991
+ /^(?:[^\n]*)/,
992
+ /^(?:class\s+)/,
993
+ /^(?:(\w+)+((,\s*\w+)*))/,
994
+ /^(?:[^\n]*)/,
995
+ /^(?:style\s+)/,
996
+ /^(?:(\w+)+((,\s*\w+)*))/,
997
+ /^(?:[^\n]*)/,
998
+ /^(?:accTitle\s*:\s*)/,
999
+ /^(?:(?!\n||)*[^\n]*)/,
1000
+ /^(?:accDescr\s*:\s*)/,
1001
+ /^(?:(?!\n||)*[^\n]*)/,
1002
+ /^(?:accDescr\s*\{\s*)/,
1003
+ /^(?:[\}])/,
1004
+ /^(?:[^\}]*)/,
1005
+ /^(?:end\b\s*)/,
1006
+ /^(?:\(\(\()/,
1007
+ /^(?:\)\)\))/,
1008
+ /^(?:[\)]\))/,
1009
+ /^(?:\}\})/,
1010
+ /^(?:\})/,
1011
+ /^(?:\(-)/,
1012
+ /^(?:-\))/,
1013
+ /^(?:\(\()/,
1014
+ /^(?:\]\])/,
1015
+ /^(?:\()/,
1016
+ /^(?:\]\))/,
1017
+ /^(?:\\\])/,
1018
+ /^(?:\/\])/,
1019
+ /^(?:\)\])/,
1020
+ /^(?:[\)])/,
1021
+ /^(?:\]>)/,
1022
+ /^(?:[\]])/,
1023
+ /^(?:-\))/,
1024
+ /^(?:\(-)/,
1025
+ /^(?:\)\))/,
1026
+ /^(?:\))/,
1027
+ /^(?:\(\(\()/,
1028
+ /^(?:\(\()/,
1029
+ /^(?:\{\{)/,
1030
+ /^(?:\{)/,
1031
+ /^(?:>)/,
1032
+ /^(?:\(\[)/,
1033
+ /^(?:\()/,
1034
+ /^(?:\[\[)/,
1035
+ /^(?:\[\|)/,
1036
+ /^(?:\[\()/,
1037
+ /^(?:\)\)\))/,
1038
+ /^(?:\[\\)/,
1039
+ /^(?:\[\/)/,
1040
+ /^(?:\[\\)/,
1041
+ /^(?:\[)/,
1042
+ /^(?:<\[)/,
1043
+ /^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,
1044
+ /^(?:$)/,
1045
+ /^(?:["][`])/,
1046
+ /^(?:["][`])/,
1047
+ /^(?:[^`"]+)/,
1048
+ /^(?:[`]["])/,
1049
+ /^(?:["])/,
1050
+ /^(?:["])/,
1051
+ /^(?:[^"]+)/,
1052
+ /^(?:["])/,
1053
+ /^(?:\]>\s*\()/,
1054
+ /^(?:,?\s*right\s*)/,
1055
+ /^(?:,?\s*left\s*)/,
1056
+ /^(?:,?\s*x\s*)/,
1057
+ /^(?:,?\s*y\s*)/,
1058
+ /^(?:,?\s*up\s*)/,
1059
+ /^(?:,?\s*down\s*)/,
1060
+ /^(?:\)\s*)/,
1061
+ /^(?:\s*[xo<]?--+[-xo>]\s*)/,
1062
+ /^(?:\s*[xo<]?==+[=xo>]\s*)/,
1063
+ /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,
1064
+ /^(?:\s*~~[\~]+\s*)/,
1065
+ /^(?:\s*[xo<]?--\s*)/,
1066
+ /^(?:\s*[xo<]?==\s*)/,
1067
+ /^(?:\s*[xo<]?-\.\s*)/,
1068
+ /^(?:["][`])/,
1069
+ /^(?:["])/,
1070
+ /^(?:\s*[xo<]?--+[-xo>]\s*)/,
1071
+ /^(?:\s*[xo<]?==+[=xo>]\s*)/,
1072
+ /^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,
1073
+ /^(?::\d+)/
1074
+ ],
1075
+ conditions: {
1076
+ STYLE_DEFINITION: {
1077
+ rules: [28],
1078
+ inclusive: !1
1079
+ },
1080
+ STYLE_STMNT: {
1081
+ rules: [27],
1082
+ inclusive: !1
1083
+ },
1084
+ CLASSDEFID: {
1085
+ rules: [22],
1086
+ inclusive: !1
1087
+ },
1088
+ CLASSDEF: {
1089
+ rules: [20, 21],
1090
+ inclusive: !1
1091
+ },
1092
+ CLASS_STYLE: {
1093
+ rules: [25],
1094
+ inclusive: !1
1095
+ },
1096
+ CLASS: {
1097
+ rules: [24],
1098
+ inclusive: !1
1099
+ },
1100
+ LLABEL: {
1101
+ rules: [
1102
+ 99,
1103
+ 100,
1104
+ 101,
1105
+ 102,
1106
+ 103
1107
+ ],
1108
+ inclusive: !1
1109
+ },
1110
+ ARROW_DIR: {
1111
+ rules: [
1112
+ 85,
1113
+ 86,
1114
+ 87,
1115
+ 88,
1116
+ 89,
1117
+ 90,
1118
+ 91
1119
+ ],
1120
+ inclusive: !1
1121
+ },
1122
+ BLOCK_ARROW: {
1123
+ rules: [
1124
+ 76,
1125
+ 81,
1126
+ 84
1127
+ ],
1128
+ inclusive: !1
1129
+ },
1130
+ NODE: {
1131
+ rules: [
1132
+ 37,
1133
+ 38,
1134
+ 39,
1135
+ 40,
1136
+ 41,
1137
+ 42,
1138
+ 43,
1139
+ 44,
1140
+ 45,
1141
+ 46,
1142
+ 47,
1143
+ 48,
1144
+ 49,
1145
+ 50,
1146
+ 51,
1147
+ 52,
1148
+ 53,
1149
+ 77,
1150
+ 80
1151
+ ],
1152
+ inclusive: !1
1153
+ },
1154
+ md_string: {
1155
+ rules: [
1156
+ 9,
1157
+ 10,
1158
+ 78,
1159
+ 79
1160
+ ],
1161
+ inclusive: !1
1162
+ },
1163
+ space: {
1164
+ rules: [],
1165
+ inclusive: !1
1166
+ },
1167
+ string: {
1168
+ rules: [
1169
+ 12,
1170
+ 13,
1171
+ 82,
1172
+ 83
1173
+ ],
1174
+ inclusive: !1
1175
+ },
1176
+ acc_descr_multiline: {
1177
+ rules: [34, 35],
1178
+ inclusive: !1
1179
+ },
1180
+ acc_descr: {
1181
+ rules: [32],
1182
+ inclusive: !1
1183
+ },
1184
+ acc_title: {
1185
+ rules: [30],
1186
+ inclusive: !1
1187
+ },
1188
+ INITIAL: {
1189
+ rules: [
1190
+ 0,
1191
+ 1,
1192
+ 2,
1193
+ 3,
1194
+ 4,
1195
+ 5,
1196
+ 6,
1197
+ 7,
1198
+ 8,
1199
+ 11,
1200
+ 14,
1201
+ 15,
1202
+ 16,
1203
+ 17,
1204
+ 18,
1205
+ 19,
1206
+ 23,
1207
+ 26,
1208
+ 29,
1209
+ 31,
1210
+ 33,
1211
+ 36,
1212
+ 54,
1213
+ 55,
1214
+ 56,
1215
+ 57,
1216
+ 58,
1217
+ 59,
1218
+ 60,
1219
+ 61,
1220
+ 62,
1221
+ 63,
1222
+ 64,
1223
+ 65,
1224
+ 66,
1225
+ 67,
1226
+ 68,
1227
+ 69,
1228
+ 70,
1229
+ 71,
1230
+ 72,
1231
+ 73,
1232
+ 74,
1233
+ 75,
1234
+ 92,
1235
+ 93,
1236
+ 94,
1237
+ 95,
1238
+ 96,
1239
+ 97,
1240
+ 98,
1241
+ 104
1242
+ ],
1243
+ inclusive: !0
1244
+ }
1245
+ }
1246
+ };
1247
+ })();
1248
+ function v() {
1249
+ this.yy = {};
1250
+ }
1251
+ return n(v, "Parser"), v.prototype = _, _.Parser = v, new v();
1252
+ })();
1253
+ P.parser = P;
1254
+ var Ce = P, F = /* @__PURE__ */ new Map(), I = [], L = /* @__PURE__ */ new Map(), R = "color", z = "fill", we = "bgFill", B = ",", V = /* @__PURE__ */ new Map(), H = "", Te = /* @__PURE__ */ n((e) => s.sanitizeText(e, a()), "sanitizeText"), Ee = /* @__PURE__ */ n(function(e, t = "") {
1255
+ let n = V.get(e);
1256
+ n || (n = {
1257
+ id: e,
1258
+ styles: [],
1259
+ textStyles: []
1260
+ }, V.set(e, n)), t?.split(B).forEach((e) => {
1261
+ let t = e.replace(/([^;]*);/, "$1").trim();
1262
+ if (RegExp(R).exec(e)) {
1263
+ let e = t.replace(z, we).replace(R, z);
1264
+ n.textStyles.push(e);
1265
+ }
1266
+ n.styles.push(t);
1267
+ });
1268
+ }, "addStyleClass"), De = /* @__PURE__ */ n(function(e, t = "") {
1269
+ let n = F.get(e);
1270
+ t != null && (n.styles = t.split(B));
1271
+ }, "addStyle2Node"), Oe = /* @__PURE__ */ n(function(e, t) {
1272
+ e.split(",").forEach(function(e) {
1273
+ let n = F.get(e);
1274
+ if (n === void 0) {
1275
+ let t = e.trim();
1276
+ n = {
1277
+ id: t,
1278
+ type: "na",
1279
+ children: []
1280
+ }, F.set(t, n);
1281
+ }
1282
+ n.classes || (n.classes = []), n.classes.push(t);
1283
+ });
1284
+ }, "setCssClass"), U = 0, ke = /* @__PURE__ */ n((t, n) => {
1285
+ let r = t.flat(), i = [], a = r.find((e) => e?.type === "column-setting")?.columns ?? -1;
1286
+ for (let t of r) if (typeof a == "number" && a > 0 && t.type !== "column-setting" && typeof t.widthInColumns == "number" && t.widthInColumns > a && e.warn(`Block ${t.id} width ${t.widthInColumns} exceeds configured column width ${a}`), t.label &&= Te(t.label), t.type === "classDef") Ee(t.id, t.css);
1287
+ else if (t.type === "applyClass") Oe(t.id, t?.styleClass ?? "");
1288
+ else if (t.type === "applyStyles") t?.stylesStr && De(t.id, t?.stylesStr);
1289
+ else if (t.type === "column-setting") n.columns = t.columns ?? -1;
1290
+ else if (t.type === "edge") {
1291
+ let e = (L.get(t.id) ?? 0) + 1;
1292
+ L.set(t.id, e), t.id = e + "-" + t.id, I.push(t);
1293
+ } else {
1294
+ t.label ||= t.type === "composite" ? "" : t.id;
1295
+ let e = F.get(t.id);
1296
+ if (e === void 0 ? (t.type === "composite" && (t.colorIndex = U++), F.set(t.id, t)) : (t.type !== "na" && (e.type = t.type), t.label !== t.id && (e.label = t.label)), t.children && ke(t.children, t), t.type === "space") {
1297
+ let e = t.width ?? 1;
1298
+ for (let n = 0; n < e; n++) {
1299
+ let e = ve(t);
1300
+ e.id = e.id + "-" + n, F.set(e.id, e), i.push(e);
1301
+ }
1302
+ } else e === void 0 && i.push(t);
1303
+ }
1304
+ n.children = i;
1305
+ }, "populateBlockDatabase"), W = [], G = {
1306
+ id: "root",
1307
+ type: "composite",
1308
+ children: [],
1309
+ columns: -1
1310
+ }, Ae = /* @__PURE__ */ n(() => {
1311
+ e.debug("Clear called"), r(), G = {
1312
+ id: "root",
1313
+ type: "composite",
1314
+ children: [],
1315
+ columns: -1
1316
+ }, F = /* @__PURE__ */ new Map([["root", G]]), W = [], V = /* @__PURE__ */ new Map(), I = [], L = /* @__PURE__ */ new Map(), H = "", U = 0;
1317
+ }, "clear");
1318
+ function je(t) {
1319
+ switch (e.debug("typeStr2Type", t), t) {
1320
+ case "[]": return "square";
1321
+ case "()": return e.debug("we have a round"), "round";
1322
+ case "(())": return "circle";
1323
+ case ">]": return "rect_left_inv_arrow";
1324
+ case "{}": return "diamond";
1325
+ case "{{}}": return "hexagon";
1326
+ case "([])": return "stadium";
1327
+ case "[[]]": return "subroutine";
1328
+ case "[()]": return "cylinder";
1329
+ case "((()))": return "doublecircle";
1330
+ case "[//]": return "lean_right";
1331
+ case "[\\\\]": return "lean_left";
1332
+ case "[/\\]": return "trapezoid";
1333
+ case "[\\/]": return "inv_trapezoid";
1334
+ case "<[]>": return "block_arrow";
1335
+ default: return "na";
1336
+ }
1337
+ }
1338
+ n(je, "typeStr2Type");
1339
+ function Me(t) {
1340
+ switch (e.debug("typeStr2Type", t), t) {
1341
+ case "==": return "thick";
1342
+ default: return "normal";
1343
+ }
1344
+ }
1345
+ n(Me, "edgeTypeStr2Type");
1346
+ function Ne(e) {
1347
+ switch (e.trim().slice(-1)) {
1348
+ case "x": return "arrow_cross";
1349
+ case "o": return "arrow_circle";
1350
+ case ">": return "arrow_point";
1351
+ default: return "";
1352
+ }
1353
+ }
1354
+ n(Ne, "edgeStrToEdgeData");
1355
+ function Pe(e) {
1356
+ switch (e.trim().charAt(0)) {
1357
+ case "x": return "arrow_cross";
1358
+ case "o": return "arrow_circle";
1359
+ case "<": return "arrow_point";
1360
+ default: return "arrow_open";
1361
+ }
1362
+ }
1363
+ n(Pe, "edgeStrToEdgeStartData");
1364
+ function Fe(e) {
1365
+ return e.includes("==") ? "thick" : "normal";
1366
+ }
1367
+ n(Fe, "edgeStrToThickness");
1368
+ function Ie(e) {
1369
+ return e.includes(".-") ? "dotted" : "solid";
1370
+ }
1371
+ n(Ie, "edgeStrToPattern");
1372
+ var Le = 0, Re = {
1373
+ getConfig: /* @__PURE__ */ n(() => c().block, "getConfig"),
1374
+ typeStr2Type: je,
1375
+ edgeTypeStr2Type: Me,
1376
+ edgeStrToEdgeData: Ne,
1377
+ edgeStrToEdgeStartData: Pe,
1378
+ edgeStrToThickness: Fe,
1379
+ edgeStrToPattern: Ie,
1380
+ getLogger: /* @__PURE__ */ n(() => e, "getLogger"),
1381
+ getBlocksFlat: /* @__PURE__ */ n(() => [...F.values()], "getBlocksFlat"),
1382
+ getBlocks: /* @__PURE__ */ n(() => W || [], "getBlocks"),
1383
+ getEdges: /* @__PURE__ */ n(() => I, "getEdges"),
1384
+ setHierarchy: /* @__PURE__ */ n((e) => {
1385
+ G.children = e, ke(e, G), W = G.children;
1386
+ }, "setHierarchy"),
1387
+ getBlock: /* @__PURE__ */ n((e) => F.get(e), "getBlock"),
1388
+ setBlock: /* @__PURE__ */ n((e) => {
1389
+ F.set(e.id, e);
1390
+ }, "setBlock"),
1391
+ getColumns: /* @__PURE__ */ n((e) => {
1392
+ let t = F.get(e);
1393
+ return t ? t.columns ? t.columns : t.children ? t.children.length : -1 : -1;
1394
+ }, "getColumns"),
1395
+ getClasses: /* @__PURE__ */ n(function() {
1396
+ return V;
1397
+ }, "getClasses"),
1398
+ clear: Ae,
1399
+ generateId: /* @__PURE__ */ n(() => (Le++, "id-" + Math.random().toString(36).substr(2, 12) + "-" + Le), "generateId"),
1400
+ setDiagramId: /* @__PURE__ */ n((e) => {
1401
+ H = e;
1402
+ }, "setDiagramId"),
1403
+ getDiagramId: /* @__PURE__ */ n(() => H, "getDiagramId")
1404
+ }, ze = /* @__PURE__ */ n((e) => {
1405
+ let { theme: t, bkgColorArray: n, borderColorArray: r } = e;
1406
+ if (!ie(t, r)) return "";
1407
+ let i = oe(e.look), a = se(n), o = "";
1408
+ for (let t = 0; t < ae(e.THEME_COLOR_LIMIT, r); t++) {
1409
+ let e = r[t % r.length], s = a ? `fill: ${n[t % n.length]};` : "", c = `[data-look="${i}"][data-color-id="color-${t}"]`;
1410
+ o += `
1411
+
1412
+ ${c}.node rect.composite {
1413
+ stroke: ${e};
1414
+ ${s}
1415
+ }
1416
+ `;
1417
+ }
1418
+ return o;
1419
+ }, "genColor"), K = /* @__PURE__ */ n((e, t) => {
1420
+ let n = l, r = n(e, "r"), a = n(e, "g"), o = n(e, "b");
1421
+ return i(r, a, o, t);
1422
+ }, "fade"), Be = /* @__PURE__ */ n((e) => `${ze(e)}
1423
+ .label {
1424
+ font-family: ${e.fontFamily};
1425
+ color: ${e.nodeTextColor || e.textColor};
1426
+ }
1427
+ .cluster-label text {
1428
+ fill: ${e.titleColor};
1429
+ }
1430
+ .cluster-label span {
1431
+ color: ${e.titleColor};
1432
+ }
1433
+
1434
+
1435
+
1436
+ .label text,span {
1437
+ fill: ${e.nodeTextColor || e.textColor};
1438
+ color: ${e.nodeTextColor || e.textColor};
1439
+ }
1440
+
1441
+ .node rect,
1442
+ .node circle,
1443
+ .node ellipse,
1444
+ .node polygon,
1445
+ .node path {
1446
+ fill: ${e.mainBkg};
1447
+ stroke: ${e.nodeBorder};
1448
+ /* From the theme, as every other diagram does. Pinned at 1px here, so block drew a
1449
+ thinner border than an identical flowchart node under any theme asking for more --
1450
+ the neo theme asks for 2. Nothing downstream corrected it: the neo rules set stroke
1451
+ and filter, never stroke-width. */
1452
+ stroke-width: ${e.strokeWidth ?? 1}px;
1453
+ }
1454
+ .flowchart-label text {
1455
+ text-anchor: middle;
1456
+ }
1457
+ // .flowchart-label .text-outer-tspan {
1458
+ // text-anchor: middle;
1459
+ // }
1460
+ // .flowchart-label .text-inner-tspan {
1461
+ // text-anchor: start;
1462
+ // }
1463
+
1464
+ .node .label {
1465
+ text-align: center;
1466
+ }
1467
+ .node.clickable {
1468
+ cursor: pointer;
1469
+ }
1470
+
1471
+ .arrowheadPath {
1472
+ fill: ${e.arrowheadColor};
1473
+ }
1474
+
1475
+ .edgePaths .path {
1476
+ stroke: ${e.lineColor};
1477
+ stroke-width: 2.0px;
1478
+ }
1479
+
1480
+ .flowchart-link {
1481
+ stroke: ${e.lineColor};
1482
+ fill: none;
1483
+ }
1484
+
1485
+ .edgeLabel {
1486
+ background-color: ${e.edgeLabelBackground};
1487
+ /*
1488
+ * This is for backward compatibility with existing code that didn't
1489
+ * add a \`<p>\` around edge labels.
1490
+ *
1491
+ * TODO: We should probably remove this in a future release.
1492
+ */
1493
+ p {
1494
+ margin: 0;
1495
+ padding: 0;
1496
+ display: inline;
1497
+ }
1498
+ rect {
1499
+ opacity: 0.5;
1500
+ background-color: ${e.edgeLabelBackground};
1501
+ fill: ${e.edgeLabelBackground};
1502
+ }
1503
+ text-align: center;
1504
+ }
1505
+
1506
+ /* For html labels only */
1507
+ .labelBkg {
1508
+ background-color: ${e.edgeLabelBackground};
1509
+ }
1510
+
1511
+ .node .cluster {
1512
+ // fill: ${K(e.mainBkg, .5)};
1513
+ fill: ${K(e.clusterBkg, .5)};
1514
+ stroke: ${K(e.clusterBorder, .2)};
1515
+ box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;
1516
+ stroke-width: 1px;
1517
+ }
1518
+
1519
+ .cluster text {
1520
+ fill: ${e.titleColor};
1521
+ }
1522
+
1523
+ .cluster span {
1524
+ color: ${e.titleColor};
1525
+ }
1526
+ /* .cluster div {
1527
+ color: ${e.titleColor};
1528
+ } */
1529
+
1530
+ div.mermaidTooltip {
1531
+ position: absolute;
1532
+ text-align: center;
1533
+ max-width: 200px;
1534
+ padding: 2px;
1535
+ font-family: ${e.fontFamily};
1536
+ font-size: 12px;
1537
+ background: ${e.tertiaryColor};
1538
+ border: 1px solid ${e.border2};
1539
+ border-radius: 2px;
1540
+ pointer-events: none;
1541
+ z-index: 100;
1542
+ }
1543
+
1544
+ .flowchartTitleText {
1545
+ text-anchor: middle;
1546
+ font-size: 18px;
1547
+ fill: ${e.textColor};
1548
+ }
1549
+ ${he()}
1550
+ `, "getStyles");
1551
+ function q(e, t) {
1552
+ if (e === 0 || !Number.isInteger(e)) throw Error("Columns must be an integer !== 0.");
1553
+ if (t < 0 || !Number.isInteger(t)) throw Error("Position must be a non-negative integer." + t);
1554
+ return e < 0 ? {
1555
+ px: t,
1556
+ py: 0
1557
+ } : e === 1 ? {
1558
+ px: 0,
1559
+ py: t
1560
+ } : {
1561
+ px: t % e,
1562
+ py: Math.floor(t / e)
1563
+ };
1564
+ }
1565
+ n(q, "calculateBlockPosition");
1566
+ var Ve = /* @__PURE__ */ n((t) => {
1567
+ let n = 0, r = 0;
1568
+ for (let i of t.children) {
1569
+ let { width: t, height: a, x: o, y: s } = i.size ?? {
1570
+ width: 0,
1571
+ height: 0,
1572
+ x: 0,
1573
+ y: 0
1574
+ };
1575
+ if (e.debug("getMaxChildSize abc95 child:", i.id, "width:", t, "height:", a, "x:", o, "y:", s, i.type), i.type === "space") continue;
1576
+ let c = t / (i.widthInColumns ?? 1);
1577
+ c > n && (n = c), a > r && (r = a);
1578
+ }
1579
+ return {
1580
+ width: n,
1581
+ height: r
1582
+ };
1583
+ }, "getMaxChildSize");
1584
+ function J(t, n, r = 0, i = 0, a = 8) {
1585
+ e.debug("setBlockSizes abc95 (start)", t.id, t?.size?.x, "block width =", t?.size, "siblingWidth", r), t?.size?.width || (t.size = {
1586
+ width: r,
1587
+ height: i,
1588
+ x: 0,
1589
+ y: 0
1590
+ });
1591
+ let o = 0, s = 0;
1592
+ if (t.children?.length > 0) {
1593
+ for (let e of t.children) J(e, n, 0, 0, a);
1594
+ let c = Ve(t);
1595
+ o = c.width, s = c.height, e.debug("setBlockSizes abc95 maxWidth of", t.id, ":s children is ", o, s);
1596
+ for (let n of t.children) n.size && (e.debug(`abc95 Setting size of children of ${t.id} id=${n.id} ${o} ${s} ${JSON.stringify(n.size)}`), n.size.width = o * (n.widthInColumns ?? 1) + a * ((n.widthInColumns ?? 1) - 1), n.size.height = s, n.size.x = 0, n.size.y = 0, e.debug(`abc95 updating size of ${t.id} children child:${n.id} maxWidth:${o} maxHeight:${s}`));
1597
+ for (let e of t.children) J(e, n, o, s, a);
1598
+ let l = t.columns ?? -1, u = 0;
1599
+ for (let e of t.children) u += e.widthInColumns ?? 1;
1600
+ let d = t.children.length;
1601
+ l > 0 && l < u && (d = l);
1602
+ let f = Math.ceil(u / d), p = d * (o + a) + a, m = f * (s + a) + a;
1603
+ if (p < r) {
1604
+ e.debug(`Detected to small sibling: abc95 ${t.id} siblingWidth ${r} siblingHeight ${i} width ${p}`), p = r, m = i;
1605
+ let n = (r - d * a - a) / d, c = (i - f * a - a) / f;
1606
+ e.debug("Size indata abc88", t.id, "childWidth", n, "maxWidth", o), e.debug("Size indata abc88", t.id, "childHeight", c, "maxHeight", s), e.debug("Size indata abc88 xSize", d, "padding", a);
1607
+ for (let e of t.children) e.size && (e.size.width = n, e.size.height = c, e.size.x = 0, e.size.y = 0);
1608
+ }
1609
+ if (e.debug(`abc95 (finale calc) ${t.id} xSize ${d} ySize ${f} columns ${l}${t.children.length} width=${Math.max(p, t.size?.width || 0)}`), p < (t?.size?.width || 0)) {
1610
+ p = t?.size?.width || 0;
1611
+ let n = l > 0 ? Math.min(t.children.length, l) : t.children.length;
1612
+ if (n > 0) {
1613
+ let r = (p - n * a - a) / n;
1614
+ e.debug("abc95 (growing to fit) width", t.id, p, t.size?.width, r);
1615
+ for (let e of t.children) e.size && (e.size.width = r);
1616
+ }
1617
+ }
1618
+ t.size = {
1619
+ width: p,
1620
+ height: m,
1621
+ x: 0,
1622
+ y: 0
1623
+ };
1624
+ }
1625
+ e.debug("setBlockSizes abc94 (done)", t.id, t?.size?.x, t?.size?.width, t?.size?.y, t?.size?.height);
1626
+ }
1627
+ n(J, "setBlockSizes");
1628
+ function Y(t, n, r = 8) {
1629
+ e.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${t?.size?.x} y: ${t?.size?.y} width: ${t?.size?.width}`);
1630
+ let i = t.columns ?? -1;
1631
+ if (e.debug("layoutBlocks columns abc95", t.id, "=>", i, t), t.children && t.children.length > 0) {
1632
+ let a = t?.children[0]?.size?.width ?? 0, o = t.children.length * a + (t.children.length - 1) * r;
1633
+ e.debug("widthOfChildren 88", o, "posX");
1634
+ let s = /* @__PURE__ */ new Map();
1635
+ {
1636
+ let e = 0;
1637
+ for (let n of t.children) {
1638
+ if (!n.size) continue;
1639
+ let { py: t } = q(i, e), r = s.get(t) ?? 0;
1640
+ n.size.height > r && s.set(t, n.size.height);
1641
+ let a = n?.widthInColumns ?? 1;
1642
+ i > 0 && (a = Math.min(a, i - e % i)), e += a;
1643
+ }
1644
+ }
1645
+ let c = /* @__PURE__ */ new Map();
1646
+ {
1647
+ let e = 0, t = [...s.keys()].sort((e, t) => e - t);
1648
+ for (let n of t) c.set(n, e), e += (s.get(n) ?? 0) + r;
1649
+ }
1650
+ let l = 0;
1651
+ e.debug("abc91 block?.size?.x", t.id, t?.size?.x);
1652
+ let u = t?.size?.x ? t?.size?.x + (-t?.size?.width / 2 || 0) : -r, d = 0;
1653
+ for (let a of t.children) {
1654
+ let o = t;
1655
+ if (!a.size) continue;
1656
+ let { width: f, height: p } = a.size, { px: m, py: h } = q(i, l);
1657
+ if (h != d && (d = h, u = t?.size?.x ? t?.size?.x + (-t?.size?.width / 2 || 0) : -r, e.debug("New row in layout for block", t.id, " and child ", a.id, d)), e.debug(`abc89 layout blocks (child) id: ${a.id} Pos: ${l} (px, py) ${m},${h} (${o?.size?.x},${o?.size?.y}) parent: ${o.id} width: ${f}${r}`), o.size) {
1658
+ let t = f / 2;
1659
+ a.size.x = u + r + t, e.debug(`abc91 layout blocks (calc) px, pyid:${a.id} startingPos=X${u} new startingPosX${a.size.x} ${t} padding=${r} width=${f} halfWidth=${t} => x:${a.size.x} y:${a.size.y} ${a.widthInColumns} (width * (child?.w || 1)) / 2 ${f * (a?.widthInColumns ?? 1) / 2}`), u = a.size.x + t;
1660
+ let n = c.get(h) ?? 0, i = s.get(h) ?? p;
1661
+ a.size.y = o.size.y - o.size.height / 2 + n + i / 2 + r, e.debug(`abc88 layout blocks (calc) px, pyid:${a.id}startingPosX${u}${r}${t}=>x:${a.size.x}y:${a.size.y}${a.widthInColumns}(width * (child?.w || 1)) / 2${f * (a?.widthInColumns ?? 1) / 2}`);
1662
+ }
1663
+ a.children && Y(a, n, r);
1664
+ let g = a?.widthInColumns ?? 1;
1665
+ i > 0 && (g = Math.min(g, i - l % i)), l += g, e.debug("abc88 columnsPos", a, l);
1666
+ }
1667
+ }
1668
+ e.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${t?.size?.x} y: ${t?.size?.y} width: ${t?.size?.width}`);
1669
+ }
1670
+ n(Y, "layoutBlocks");
1671
+ function X(e, { minX: t, minY: n, maxX: r, maxY: i } = {
1672
+ minX: 0,
1673
+ minY: 0,
1674
+ maxX: 0,
1675
+ maxY: 0
1676
+ }) {
1677
+ if (e.size && e.id !== "root") {
1678
+ let { x: a, y: o, width: s, height: c } = e.size;
1679
+ a - s / 2 < t && (t = a - s / 2), o - c / 2 < n && (n = o - c / 2), a + s / 2 > r && (r = a + s / 2), o + c / 2 > i && (i = o + c / 2);
1680
+ }
1681
+ if (e.children) for (let a of e.children) ({minX: t, minY: n, maxX: r, maxY: i} = X(a, {
1682
+ minX: t,
1683
+ minY: n,
1684
+ maxX: r,
1685
+ maxY: i
1686
+ }));
1687
+ return {
1688
+ minX: t,
1689
+ minY: n,
1690
+ maxX: r,
1691
+ maxY: i
1692
+ };
1693
+ }
1694
+ n(X, "findBounds");
1695
+ function He(t) {
1696
+ let n = t.getBlock("root");
1697
+ if (!n) return;
1698
+ let r = a()?.block?.padding ?? 8;
1699
+ J(n, t, 0, 0, r), Y(n, t, r), e.debug("getBlocks", JSON.stringify(n, null, 2));
1700
+ let { minX: i, minY: o, maxX: s, maxY: c } = X(n), l = c - o;
1701
+ return {
1702
+ x: i,
1703
+ y: o,
1704
+ width: s - i,
1705
+ height: l
1706
+ };
1707
+ }
1708
+ n(He, "layout");
1709
+ function Z(e, t, n = !1) {
1710
+ let r = e, i = "default";
1711
+ (r?.classes?.length || 0) > 0 && (i = (r?.classes ?? []).join(" ")), i += " flowchart-label";
1712
+ let a = (r?.classes ?? []).flatMap((e) => t.getClasses().get(e)?.styles ?? []), o = 0, s = "rect", l;
1713
+ switch (r.type) {
1714
+ case "round":
1715
+ o = 5, s = "rect";
1716
+ break;
1717
+ case "composite":
1718
+ o = 0, s = "composite", l = 0;
1719
+ break;
1720
+ case "square":
1721
+ s = "rect";
1722
+ break;
1723
+ case "diamond":
1724
+ s = "question";
1725
+ break;
1726
+ case "hexagon":
1727
+ s = "hexagon";
1728
+ break;
1729
+ case "block_arrow":
1730
+ s = "block_arrow";
1731
+ break;
1732
+ case "odd":
1733
+ s = "rect_left_inv_arrow";
1734
+ break;
1735
+ case "lean_right":
1736
+ s = "lean_right";
1737
+ break;
1738
+ case "lean_left":
1739
+ s = "lean_left";
1740
+ break;
1741
+ case "trapezoid":
1742
+ s = "trapezoid";
1743
+ break;
1744
+ case "inv_trapezoid":
1745
+ s = "inv_trapezoid";
1746
+ break;
1747
+ case "rect_left_inv_arrow":
1748
+ s = "rect_left_inv_arrow";
1749
+ break;
1750
+ case "circle":
1751
+ s = "circle";
1752
+ break;
1753
+ case "ellipse":
1754
+ s = "ellipse";
1755
+ break;
1756
+ case "stadium":
1757
+ s = "stadium";
1758
+ break;
1759
+ case "subroutine":
1760
+ s = "subroutine";
1761
+ break;
1762
+ case "cylinder":
1763
+ s = "cylinder";
1764
+ break;
1765
+ case "group":
1766
+ s = "rect";
1767
+ break;
1768
+ case "doublecircle":
1769
+ s = "doublecircle";
1770
+ break;
1771
+ default: s = "rect";
1772
+ }
1773
+ let u = j(r?.styles ?? []), d = r.label, f = r.size ?? {
1774
+ width: 0,
1775
+ height: 0,
1776
+ x: 0,
1777
+ y: 0
1778
+ }, p = t.getDiagramId();
1779
+ return {
1780
+ labelStyle: u.labelStyle,
1781
+ shape: s,
1782
+ label: d,
1783
+ labelText: d,
1784
+ rx: o,
1785
+ ry: o,
1786
+ class: i,
1787
+ cssClasses: i,
1788
+ cssStyles: r?.styles ?? [],
1789
+ cssCompiledStyles: a,
1790
+ style: u.style,
1791
+ id: r.id,
1792
+ domId: p ? `${p}-${r.id}` : r.id,
1793
+ isGroup: !1,
1794
+ directions: r.directions,
1795
+ width: f.width || void 0,
1796
+ height: f.height || void 0,
1797
+ wrappingWidth: f.width || Infinity,
1798
+ x: f.x,
1799
+ y: f.y,
1800
+ positioned: n,
1801
+ intersect: void 0,
1802
+ padding: l ?? c()?.block?.padding ?? 0,
1803
+ widthInColumns: r.widthInColumns ?? 1,
1804
+ colorIndex: r.colorIndex,
1805
+ look: c().look
1806
+ };
1807
+ }
1808
+ n(Z, "getNodeFromBlock");
1809
+ async function Ue(e, t, n) {
1810
+ let r = Z(t, n, !1);
1811
+ if (t.type === "group") return;
1812
+ let i = c(), a = await ue(e, r, { config: i }), o = a.node()?.getBBox() ?? {
1813
+ width: 0,
1814
+ height: 0
1815
+ }, s = n.getBlock(r.id);
1816
+ s.size = {
1817
+ width: o.width,
1818
+ height: o.height,
1819
+ x: 0,
1820
+ y: 0,
1821
+ node: a
1822
+ }, n.setBlock(s), a.remove();
1823
+ }
1824
+ n(Ue, "calculateBlockSize");
1825
+ async function We(e, t, n) {
1826
+ let r = Z(t, n, !0);
1827
+ if (n.getBlock(r.id).type !== "space") {
1828
+ let n = c(), i = await ue(e, r, { config: n });
1829
+ r.colorIndex !== void 0 && ce(i, r.colorIndex, n.theme, n.themeVariables?.borderColorArray), t.intersect = r?.intersect, le(r);
1830
+ }
1831
+ }
1832
+ n(We, "insertBlockPositioned");
1833
+ async function Q(e, t, n, r) {
1834
+ for (let i of t) await r(e, i, n), i.children && await Q(e, i.children, n, r);
1835
+ }
1836
+ n(Q, "performOperations");
1837
+ async function Ge(e, t, n) {
1838
+ await Q(e, t, n, Ue);
1839
+ }
1840
+ n(Ge, "calculateBlockSizes");
1841
+ async function Ke(e, t, n) {
1842
+ await Q(e, t, n, We);
1843
+ }
1844
+ n(Ke, "insertBlocks");
1845
+ async function $(e, t, n, r, i) {
1846
+ let a = new ge({
1847
+ multigraph: !0,
1848
+ compound: !0
1849
+ });
1850
+ a.setGraph({
1851
+ rankdir: "TB",
1852
+ nodesep: 10,
1853
+ ranksep: 10,
1854
+ marginx: 8,
1855
+ marginy: 8
1856
+ });
1857
+ for (let e of n) e.size && a.setNode(e.id, {
1858
+ width: e.size.width,
1859
+ height: e.size.height,
1860
+ intersect: e.intersect
1861
+ });
1862
+ for (let n of t) if (n.start && n.end) {
1863
+ let t = r.getBlock(n.start), o = r.getBlock(n.end);
1864
+ if (t?.size && o?.size) {
1865
+ let r = t.size, s = o.size, c = [
1866
+ {
1867
+ x: r.x,
1868
+ y: r.y
1869
+ },
1870
+ {
1871
+ x: r.x + (s.x - r.x) / 2,
1872
+ y: r.y + (s.y - r.y) / 2
1873
+ },
1874
+ {
1875
+ x: s.x,
1876
+ y: s.y
1877
+ }
1878
+ ], l = i ? `${i}-${n.id}` : n.id, u = `${n.thickness === "thick" ? "edge-thickness-thick" : "edge-thickness-normal"} ${n.pattern === "dotted" ? "edge-pattern-dotted" : "edge-pattern-solid"} flowchart-link LS-a1 LE-b1`;
1879
+ pe(e, {
1880
+ ...n,
1881
+ id: l,
1882
+ arrowTypeEnd: n.arrowTypeEnd,
1883
+ arrowTypeStart: n.arrowTypeStart,
1884
+ points: c,
1885
+ classes: u
1886
+ }, {}, "block", a.node(n.start), a.node(n.end), i), n.label && (await de(e, {
1887
+ ...n,
1888
+ label: n.label,
1889
+ labelStyle: "stroke: #333; stroke-width: 1.5px;fill:none;",
1890
+ arrowTypeEnd: n.arrowTypeEnd,
1891
+ arrowTypeStart: n.arrowTypeStart,
1892
+ points: c,
1893
+ classes: u
1894
+ }), me({
1895
+ ...n,
1896
+ x: c[1].x,
1897
+ y: c[1].y
1898
+ }, { originalPath: c }));
1899
+ }
1900
+ }
1901
+ }
1902
+ n($, "insertEdges");
1903
+ var qe = {
1904
+ parser: Ce,
1905
+ db: Re,
1906
+ renderer: {
1907
+ draw: /* @__PURE__ */ n(async function(n, r, i, a) {
1908
+ let { securityLevel: s, block: l } = c(), u = a.db;
1909
+ u.setDiagramId(r);
1910
+ let d;
1911
+ s === "sandbox" && (d = t("#i" + r));
1912
+ let f = t(s === "sandbox" ? d.nodes()[0].contentDocument.body : "body"), p = s === "sandbox" ? f.select(`[id="${r}"]`) : t(`[id="${r}"]`);
1913
+ re(p, c()), fe(p, [
1914
+ "point",
1915
+ "circle",
1916
+ "cross"
1917
+ ], a.type, r);
1918
+ let m = u.getBlocks(), h = u.getBlocksFlat(), g = u.getEdges(), _ = p.insert("g").attr("class", "block");
1919
+ await Ge(_, m, u);
1920
+ let v = He(u);
1921
+ await Ke(_, m, u), await $(_, g, h, u, r);
1922
+ let y = _.node()?.getBBox(), b = y && Number.isFinite(y.width) && Number.isFinite(y.height) ? y : v;
1923
+ if (b) {
1924
+ let t = Math.max(1, Math.round(.125 * (b.width / b.height))), n = b.height + t + 10, r = b.width + 10, { useMaxWidth: i } = l;
1925
+ o(p, n, r, !!i), e.debug("Here Bounds", v, b), p.attr("viewBox", `${b.x - 5} ${b.y - 5} ${b.width + 10} ${b.height + 10}`);
1926
+ }
1927
+ }, "draw"),
1928
+ getClasses: /* @__PURE__ */ n(function(e, t) {
1929
+ return t.db.getClasses();
1930
+ }, "getClasses")
1931
+ },
1932
+ styles: Be
1933
+ };
1934
+ //#endregion
1935
+ export { qe as diagram };