for-humanity 0.12.0 → 0.13.1

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 +39 -0
  2. package/README.md +16 -9
  3. package/dist/browser.js +14 -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-B-u5-jv0.js +2343 -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-cqCjpIlc.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-x7Ja5uwv.js +184 -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,89 @@
1
+ import { m as e } from "./chunk-DVNvSFoz.js";
2
+ import { n as t } from "./chunk-BYzrzvCI.js";
3
+ import "./chunk-MFVRUoO0.js";
4
+ import "./chunk-B58sEIY_.js";
5
+ import { m as n, t as r } from "./chunk-DK9KqIXj.js";
6
+ import { n as i, r as a, t as o } from "./chunk-TftHqGLg.js";
7
+ import { t as s } from "./chunk-DGVDaXjx.js";
8
+ //#region node_modules/.pnpm/mermaid@12.2.0/node_modules/mermaid/dist/chunks/mermaid.core/abnfDiagram-WEYOIA3C.mjs
9
+ var c = n().RailroadAbnf.parser.LangiumParser, l = /* @__PURE__ */ t((e) => {
10
+ let t = e.alternatives.map(u);
11
+ return t.length === 1 ? t[0] : {
12
+ type: "choice",
13
+ alternatives: t
14
+ };
15
+ }, "transformAlternation"), u = /* @__PURE__ */ t((e) => {
16
+ let t = e.elements.map(f);
17
+ return t.length === 1 ? t[0] : {
18
+ type: "sequence",
19
+ elements: t
20
+ };
21
+ }, "transformConcatenation"), d = /* @__PURE__ */ t((e) => {
22
+ if (e.includes("*")) {
23
+ let [t, n] = e.split("*");
24
+ return {
25
+ min: t ? parseInt(t, 10) : 0,
26
+ max: n ? parseInt(n, 10) : Infinity
27
+ };
28
+ }
29
+ let t = parseInt(e, 10);
30
+ return {
31
+ min: t,
32
+ max: t
33
+ };
34
+ }, "parseRepeat"), f = /* @__PURE__ */ t((e) => {
35
+ let t = p(e.primary);
36
+ if (!e.repeat) return t;
37
+ let { min: n, max: r } = d(e.repeat);
38
+ return n === 0 && r === 1 ? {
39
+ type: "optional",
40
+ element: t
41
+ } : {
42
+ type: "repetition",
43
+ element: t,
44
+ min: n,
45
+ max: r
46
+ };
47
+ }, "transformElement"), p = /* @__PURE__ */ t((e) => {
48
+ switch (e.$type) {
49
+ case "AbnfStringLiteral": return {
50
+ type: "terminal",
51
+ value: e.value
52
+ };
53
+ case "AbnfNumVal": return {
54
+ type: "terminal",
55
+ value: e.value
56
+ };
57
+ case "AbnfRuleName": return {
58
+ type: "nonterminal",
59
+ name: e.name
60
+ };
61
+ case "AbnfGroup": return l(e.element);
62
+ case "AbnfOptionalGroup": return {
63
+ type: "optional",
64
+ element: l(e.element)
65
+ };
66
+ default: throw Error(`Unsupported ABNF primary node: ${e.$type}`);
67
+ }
68
+ }, "transformPrimary"), m = /* @__PURE__ */ t((e) => ({
69
+ name: e.name,
70
+ definition: l(e.definition)
71
+ }), "transformRule"), h = /* @__PURE__ */ t((e) => {
72
+ s(e, o), e.title && o.setTitle(e.title), e.rules.map((e) => o.addRule(m(e)));
73
+ }, "populateDb"), g = {
74
+ parser: {
75
+ parse: /* @__PURE__ */ t((t) => {
76
+ o.clear(), e.debug("[ABNF Parser] Starting Langium parse");
77
+ let n = c.parse(t);
78
+ if (n.lexerErrors.length > 0 || n.parserErrors.length > 0) throw new r(n);
79
+ let i = n.value;
80
+ e.debug("[ABNF Parser] Parsed rules:", i.rules.length), h(i), e.debug("[ABNF Parser] Parse complete");
81
+ }, "parse"),
82
+ parser: { yy: o }
83
+ },
84
+ db: o,
85
+ renderer: a,
86
+ styles: i
87
+ };
88
+ //#endregion
89
+ export { g as diagram };
@@ -0,0 +1,26 @@
1
+ import { m as e } from "./chunk-DVNvSFoz.js";
2
+ import { n as t } from "./chunk-BYzrzvCI.js";
3
+ import { c as n } from "./chunk-MFVRUoO0.js";
4
+ //#region node_modules/.pnpm/mermaid@12.2.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-VQ5W62QI.mjs
5
+ var r = /* @__PURE__ */ t((t, r, o, s) => {
6
+ t.attr("class", o);
7
+ let { width: c, height: l, x: u, y: d } = i(t, r);
8
+ n(t, l, c, s);
9
+ let f = a(u, d, c, l, r);
10
+ t.attr("viewBox", f), e.debug(`viewBox configured: ${f} with padding: ${r}`);
11
+ }, "setupViewPortForSVG"), i = /* @__PURE__ */ t((e, t) => {
12
+ let n = e.node()?.getBBox() || {
13
+ width: 0,
14
+ height: 0,
15
+ x: 0,
16
+ y: 0
17
+ };
18
+ return {
19
+ width: n.width + t * 2,
20
+ height: n.height + t * 2,
21
+ x: n.x,
22
+ y: n.y
23
+ };
24
+ }, "calculateDimensionsWithPadding"), a = /* @__PURE__ */ t((e, t, n, r, i) => `${e - i} ${t - i} ${n} ${r}`, "createViewBox");
25
+ //#endregion
26
+ export { r as t };
@@ -0,0 +1,354 @@
1
+ import { m as e } from "./chunk-DVNvSFoz.js";
2
+ import { n as t } from "./chunk-BYzrzvCI.js";
3
+ import { b as n, y as r } from "./chunk-MFVRUoO0.js";
4
+ import { _ as i } from "./chunk-K7Myuj2-.js";
5
+ import { o as a } from "./chunk-DORnIAsy.js";
6
+ import { i as o, n as s, r as c, t as l } from "./chunk-CLgRAtOz.js";
7
+ import { r as u, t as d } from "./chunk-DU69_VcF.js";
8
+ import { a as f, c as p, d as m, i as h, n as g, r as _, t as ee, u as v } from "./chunk-DpuxlyL_.js";
9
+ import { t as y } from "./chunk-feYbMzBj.js";
10
+ //#region node_modules/.pnpm/mermaid@12.2.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ZCHMQSOR.mjs
11
+ function b(e, { edgePathsClass: t = "edges edgePaths" } = {}) {
12
+ let n = e.insert("g").attr("class", "root");
13
+ return {
14
+ clusters: n.insert("g").attr("class", "clusters"),
15
+ edgePaths: n.insert("g").attr("class", t),
16
+ edgeLabels: n.insert("g").attr("class", "edgeLabels"),
17
+ nodes: n.insert("g").attr("class", "nodes"),
18
+ rootGroups: n
19
+ };
20
+ }
21
+ t(b, "createLayoutElementGroups");
22
+ async function x(e, t, n) {
23
+ if (t.label) {
24
+ let { shapeSvg: r, bbox: i } = await a(e, n === void 0 ? t : {
25
+ ...t,
26
+ width: n
27
+ });
28
+ t.labelBBox = {
29
+ width: i.width,
30
+ height: i.height
31
+ }, r.remove();
32
+ } else t.labelBBox = {
33
+ width: 0,
34
+ height: 0
35
+ };
36
+ }
37
+ t(x, "measureGroupLabel");
38
+ async function S(e, t, n) {
39
+ let r = await c(e, t, n), i = r.node()?.getBBox() ?? {
40
+ width: 0,
41
+ height: 0
42
+ };
43
+ return t.width = i.width, t.height = i.height, r;
44
+ }
45
+ t(S, "insertMeasuredNode");
46
+ function C(e, t, n) {
47
+ let r = e, i = /* @__PURE__ */ new Set();
48
+ for (; r;) {
49
+ if (r.dir) return r.dir;
50
+ if (!r.parentId || i.has(r.parentId)) break;
51
+ i.add(r.parentId), r = t.get(r.parentId);
52
+ }
53
+ return n;
54
+ }
55
+ t(C, "resolveNodeDir");
56
+ async function w(e, t, r = {}) {
57
+ let i = new y({
58
+ multigraph: !0,
59
+ compound: !0
60
+ }), a = [...t.edges], o = n(), s = b(e), { edgeLabels: c, nodes: l } = s, u = /* @__PURE__ */ new Map(), d = new Map(t.nodes.map((e) => [e.id, e])), p = t.direction, m = e.node() != null;
61
+ await Promise.all(t.nodes.map(async (e) => {
62
+ if (e.isGroup) {
63
+ if (m) {
64
+ let t = r.unwrapGroupLabels && e.labelType !== "markdown";
65
+ await x(l, e, t ? Infinity : void 0);
66
+ }
67
+ i.setNode(e.id, { ...e });
68
+ } else {
69
+ if (m) {
70
+ let t = await S(l, e, {
71
+ config: o,
72
+ dir: C(e, d, p)
73
+ });
74
+ u.set(e.id, t);
75
+ }
76
+ i.setNode(e.id, { ...e });
77
+ }
78
+ }));
79
+ for (let e of a) m && _(e) && await f(c, e), i.setEdge(e.start, e.end, { ...e }, e.id), t.edges.some((t) => t.id === e.id) || t.edges.push(e);
80
+ if (globalThis.mermaidCaptureSizes) {
81
+ let { captureNodeSizes: n } = await import("./chunk-g3Pn8DkW.js");
82
+ n(e, t);
83
+ }
84
+ return {
85
+ graph: i,
86
+ groups: s,
87
+ nodeElements: u
88
+ };
89
+ }
90
+ t(w, "createGraphWithElements");
91
+ var T = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Map(), te = /* @__PURE__ */ t(() => {
92
+ E.clear(), D.clear(), T.clear();
93
+ }, "clear"), O = /* @__PURE__ */ t((t, n) => {
94
+ let r = E.get(n) || [];
95
+ return e.trace("In isDescendant", n, " ", t, " = ", r.includes(t)), r.includes(t);
96
+ }, "isDescendant"), k = /* @__PURE__ */ t((t, n) => {
97
+ let r = E.get(n) || [];
98
+ return e.info("Descendants of ", n, " is ", r), e.info("Edge is ", t), t.v === n || t.w === n ? !1 : r ? r.includes(t.v) || O(t.v, n) || O(t.w, n) || r.includes(t.w) : (e.debug("Tilt, ", n, ",not in descendants"), !1);
99
+ }, "edgeInCluster"), A = /* @__PURE__ */ t((t, n, r, i) => {
100
+ e.debug("Copying children of ", t, "root", i, "data", n.node(t), i);
101
+ let a = n.children(t) || [];
102
+ t !== i && a.push(t), e.debug("Copying (nodes) clusterId", t, "nodes", a), a.forEach((a) => {
103
+ if (n.children(a).length > 0) A(a, n, r, i);
104
+ else {
105
+ let o = n.node(a);
106
+ e.info("cp ", a, " to ", i, " with parent ", t), r.setNode(a, o), i !== n.parent(a) && (e.debug("Setting parent", a, n.parent(a)), r.setParent(a, n.parent(a))), t !== i && a !== t ? (e.debug("Setting parent", a, t), r.setParent(a, t)) : (e.info("In copy ", t, "root", i, "data", n.node(t), i), e.debug("Not Setting parent for node=", a, "cluster!==rootId", t !== i, "node!==clusterId", a !== t));
107
+ let s = n.edges(a);
108
+ e.debug("Copying Edges", s), s.forEach((a) => {
109
+ e.info("Edge", a);
110
+ let o = n.edge(a.v, a.w, a.name);
111
+ e.info("Edge data", o, i);
112
+ try {
113
+ k(a, i) ? (e.info("Copying as ", a.v, a.w, o, a.name), r.setEdge(a.v, a.w, o, a.name), e.info("newGraph edges ", r.edges(), r.edge(r.edges()[0]))) : e.info("Skipping copy of edge ", a.v, "-->", a.w, " rootId: ", i, " clusterId:", t);
114
+ } catch (t) {
115
+ e.error(t);
116
+ }
117
+ });
118
+ }
119
+ e.debug("Removing node", a), n.removeNode(a);
120
+ });
121
+ }, "copy"), j = /* @__PURE__ */ t((e, t) => {
122
+ let n = t.children(e), r = [...n];
123
+ for (let i of n) D.set(i, e), r = [...r, ...j(i, t)];
124
+ return r;
125
+ }, "extractDescendants"), M = /* @__PURE__ */ t((e, t, n) => {
126
+ let r = e.edges().filter((e) => e.v === t || e.w === t), i = e.edges().filter((e) => e.v === n || e.w === n), a = r.map((e) => ({
127
+ v: e.v === t ? n : e.v,
128
+ w: e.w === t ? t : e.w
129
+ })), o = i.map((e) => ({
130
+ v: e.v,
131
+ w: e.w
132
+ }));
133
+ return a.filter((e) => o.some((t) => e.v === t.v && e.w === t.w));
134
+ }, "findCommonEdges"), N = /* @__PURE__ */ t((t, n, r) => {
135
+ let i = n.children(t);
136
+ if (e.trace("Searching children of id ", t, i), i.length < 1) return t;
137
+ let a;
138
+ for (let e of i) {
139
+ let t = N(e, n, r), i = M(n, r, t);
140
+ if (t) {
141
+ if (i.length > 0) a = t;
142
+ else return t;
143
+ }
144
+ }
145
+ return a;
146
+ }, "findNonClusterChild"), P = /* @__PURE__ */ t((e) => !T.has(e) || !T.get(e).externalConnections ? e : T.has(e) ? T.get(e).id : e, "getAnchorId"), F = /* @__PURE__ */ t((t, n) => {
147
+ if (!t || n > 10) e.debug("Opting out, no graph ");
148
+ else {
149
+ e.debug("Opting in, graph "), t.nodes().forEach(function(n) {
150
+ t.children(n).length > 0 && (e.debug("Cluster identified", n, " Replacement id in edges: ", N(n, t, n)), E.set(n, j(n, t)), T.set(n, {
151
+ id: N(n, t, n),
152
+ clusterData: t.node(n)
153
+ }));
154
+ }), t.nodes().forEach(function(n) {
155
+ let r = t.children(n), i = t.edges();
156
+ r.length > 0 ? (e.debug("Cluster identified", n, E), i.forEach((t) => {
157
+ O(t.v, n) ^ O(t.w, n) && (e.debug("Edge: ", t, " leaves cluster ", n), e.debug("Descendants of XXX ", n, ": ", E.get(n)), T.get(n).externalConnections = !0);
158
+ })) : e.debug("Not a cluster ", n, E);
159
+ });
160
+ for (let e of T.keys()) {
161
+ let n = T.get(e).id, r = t.parent(n);
162
+ r !== e && T.has(r) && !T.get(r).externalConnections && (T.get(e).id = r);
163
+ let i = t.edges().some((t) => t.v === e);
164
+ if (n && T.get(e)?.externalConnections && i && z(t, n, e)) {
165
+ let r = B(t, e, t.parent(n));
166
+ r && (T.get(e).id = r);
167
+ }
168
+ }
169
+ t.edges().forEach(function(n) {
170
+ let r = t.edge(n);
171
+ e.debug("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(n)), e.debug("Edge " + n.v + " -> " + n.w + ": " + JSON.stringify(t.edge(n)));
172
+ let i = n.v, a = n.w;
173
+ if (e.debug("Fix XXX", T, "ids:", n.v, n.w, "Translating: ", T.get(n.v), " --- ", T.get(n.w)), T.get(n.v) || T.get(n.w)) {
174
+ if (e.debug("Fixing and trying - removing XXX", n.v, n.w, n.name), i = P(n.v), a = P(n.w), t.removeEdge(n.v, n.w, n.name), i !== n.v) {
175
+ let e = t.parent(i);
176
+ T.get(e).externalConnections = !0, r.fromCluster = n.v;
177
+ }
178
+ if (a !== n.w) {
179
+ let e = t.parent(a);
180
+ T.get(e).externalConnections = !0, r.toCluster = n.w;
181
+ }
182
+ e.debug("Fix Replacing with XXX", i, a, n.name), t.setEdge(i, a, r, n.name);
183
+ }
184
+ }), I(t, 0), e.trace(T);
185
+ }
186
+ }, "adjustClustersAndEdges"), I = /* @__PURE__ */ t((t, n) => {
187
+ if (n > 10) {
188
+ e.error("Bailing out");
189
+ return;
190
+ }
191
+ let r = t.nodes(), i = !1;
192
+ for (let e of r) {
193
+ let n = t.children(e);
194
+ i ||= n.length > 0;
195
+ }
196
+ if (!i) e.debug("Done, no node has children", t.nodes());
197
+ else {
198
+ e.debug("Nodes = ", r, n);
199
+ for (let i of r) if (e.debug("Extracting node", i, T, T.has(i) && !T.get(i).externalConnections, !t.parent(i), t.node(i), t.children("D"), " Depth ", n), !T.has(i)) e.debug("Not a cluster", i, n);
200
+ else if (!T.get(i).externalConnections && t.children(i) && t.children(i).length > 0) {
201
+ e.debug("Cluster without external connections, without a parent and with children", i, n);
202
+ let r = t.graph().rankdir === "TB" ? "LR" : "TB";
203
+ T.get(i)?.clusterData?.dir && (r = T.get(i).clusterData.dir, e.debug("Fixing dir", T.get(i).clusterData.dir, r));
204
+ let a = new y({
205
+ multigraph: !0,
206
+ compound: !0
207
+ }).setGraph({
208
+ rankdir: r,
209
+ nodesep: 50,
210
+ ranksep: 50,
211
+ marginx: 8,
212
+ marginy: 8
213
+ }).setDefaultEdgeLabel(function() {
214
+ return {};
215
+ });
216
+ A(i, t, a, i), t.setNode(i, {
217
+ clusterNode: !0,
218
+ id: i,
219
+ clusterData: T.get(i).clusterData,
220
+ label: T.get(i).label,
221
+ graph: a
222
+ });
223
+ } else e.debug("Cluster ** ", i, " **not meeting the criteria !externalConnections:", !T.get(i).externalConnections, " no parent: ", !t.parent(i), " children ", t.children(i) && t.children(i).length > 0, t.children("D"), n), e.debug(T);
224
+ r = t.nodes(), e.debug("New list of nodes", r);
225
+ for (let i of r) {
226
+ let r = t.node(i);
227
+ e.debug(" Now next level", i, r), r?.clusterNode && I(r.graph, n + 1);
228
+ }
229
+ }
230
+ }, "extractor"), L = /* @__PURE__ */ t((e, t) => {
231
+ if (t.length === 0) return [];
232
+ let n = Object.assign([], t);
233
+ return t.forEach((t) => {
234
+ let r = L(e, e.children(t));
235
+ n = [...n, ...r];
236
+ }), n;
237
+ }, "sorter"), R = /* @__PURE__ */ t((e) => L(e, e.children()), "sortNodesByHierarchy"), z = /* @__PURE__ */ t((e, t, n) => {
238
+ let r = e.parent(t);
239
+ for (; r && r !== n;) {
240
+ let t = T.get(r);
241
+ if (t && !t.externalConnections) return !0;
242
+ r = e.parent(r);
243
+ }
244
+ return !1;
245
+ }, "isNodeInExtractableCluster"), B = /* @__PURE__ */ t((e, t, n) => {
246
+ let r = e.children(t) ?? [];
247
+ for (let i of r) {
248
+ if (i === n || O(i, n)) continue;
249
+ let r = N(i, e, t);
250
+ if (r && !z(e, r, t)) return r;
251
+ }
252
+ return null;
253
+ }, "findSafeAnchorNode");
254
+ function V({ prepareLayout: e, measureLayout: n, runLayoutCore: r, paintLayout: i, afterPaint: a, paintOptions: o }) {
255
+ let s = n ?? U;
256
+ return /* @__PURE__ */ t(async function(t, n, c, l) {
257
+ let u = n.select("g");
258
+ (c?.insertMarkers ?? p)(u, t.markers, t.type, t.diagramId), H();
259
+ let d = {
260
+ element: u,
261
+ helpers: c,
262
+ options: l
263
+ };
264
+ d.preparedLayout = await e?.(t, d);
265
+ let f = await s(t, d), m = await r(t, d), h = {
266
+ ...d,
267
+ measure: f
268
+ };
269
+ i ? await i(t, h, m) : await W(t, h, o), await a?.(t, h, m);
270
+ }, "render");
271
+ }
272
+ t(V, "createCommonLayoutRenderer");
273
+ function H() {
274
+ l(), ee(), d(), te();
275
+ }
276
+ t(H, "clearLayoutRenderState");
277
+ async function U(e, { element: t }, n) {
278
+ return await w(t, e, n);
279
+ }
280
+ t(U, "defaultMeasureLayout");
281
+ async function W(e, t, n = {}) {
282
+ let { measure: r } = t, { groups: i } = r;
283
+ for (let r of n.getNodes?.(e, t) ?? e.nodes) n.skipNode?.(r, t) || await G(i, r, t, n);
284
+ let a = q(e.nodes);
285
+ for (let r of e.edges) J(r, n) || await Y(i, r, a, e, n, t);
286
+ }
287
+ t(W, "paintLayoutData");
288
+ async function G(e, t, n, r) {
289
+ t.clusterNode ? o(t) : K(t, n, r) ? await u(e.clusters, t) : o(t);
290
+ }
291
+ t(G, "paintLayoutNode");
292
+ function K(e, t, n) {
293
+ return e.isGroup === !0 && (n.isCluster?.(e, t) ?? !0);
294
+ }
295
+ t(K, "shouldPaintAsCluster");
296
+ function q(e) {
297
+ let t = /* @__PURE__ */ new Map();
298
+ for (let n of e) n?.id && t.set(n.id, n);
299
+ return t;
300
+ }
301
+ t(q, "buildNodeLookup");
302
+ function J(e, t) {
303
+ return e.isLayoutOnly || !!t.skipEdge?.(e);
304
+ }
305
+ t(J, "shouldSkipPaintEdge");
306
+ async function Y(e, t, n, r, i, a) {
307
+ let o = h(e.edgePaths, { ...t }, i.clusterDb ?? /* @__PURE__ */ new Map(), r.type, X(t.start, t, n, a, i), X(t.end, t, n, a, i), r.diagramId, Z(t, i), r.layoutAlgorithm);
308
+ _(t) && (g.has(t.id) || await f(e.edgeLabels, t), Q(t, o));
309
+ }
310
+ t(Y, "paintLayoutEdge");
311
+ function X(e, t, n, r, i) {
312
+ return i.getEdgeNode?.(e, t, r) ?? (e ? n.get(e) ?? {} : {});
313
+ }
314
+ t(X, "getRenderedNode");
315
+ function Z(e, t) {
316
+ return typeof t.skipIntersect == "function" ? t.skipIntersect(e) : t.skipIntersect ?? !1;
317
+ }
318
+ t(Z, "shouldSkipIntersect");
319
+ function Q(e, t) {
320
+ let n = t?.updatedPath ?? t?.originalPath, i = r(), { subGraphTitleTotalMargin: a } = s({ flowchart: i.flowchart ?? {} });
321
+ if (e.label) {
322
+ let n = g.get(e.id), { x: r, y: i } = v(e, t);
323
+ n.attr("transform", `translate(${r}, ${i + a / 2})`);
324
+ }
325
+ for (let [t, r] of [
326
+ ["startLeft", e.startLabelLeft],
327
+ ["startRight", e.startLabelRight],
328
+ ["endLeft", e.endLabelLeft],
329
+ ["endRight", e.endLabelRight]
330
+ ]) if (r) {
331
+ let { x: r, y: i } = $(e, t, n);
332
+ m.get(e.id)[t].attr("transform", `translate(${r}, ${i})`);
333
+ }
334
+ }
335
+ t(Q, "positionRenderedEdgeLabel");
336
+ var ne = {
337
+ startLeft: "start_left",
338
+ startRight: "start_right",
339
+ endLeft: "end_left",
340
+ endRight: "end_right"
341
+ };
342
+ function $(e, t, n) {
343
+ let r = e.terminalLabelCenters?.[t];
344
+ if (r) return { ...r };
345
+ if (!n) return {
346
+ x: e.x,
347
+ y: e.y
348
+ };
349
+ let a = t.startsWith("start") ? e.arrowTypeStart : e.arrowTypeEnd;
350
+ return i.calcTerminalLabelPosition(a ? 10 : 0, ne[t], n);
351
+ }
352
+ t($, "terminalLabelTranslate");
353
+ //#endregion
354
+ export { U as a, R as c, b as i, T as n, N as o, V as r, S as s, F as t };
@@ -0,0 +1,2 @@
1
+ import "./chunk-hM77LvCb.js";
2
+ export { m as createRailroadAbnfServices } from "./chunk-DK9KqIXj.js";