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,61 @@
1
+ import { p as e } from "./chunk-DVNvSFoz.js";
2
+ import { n as t } from "./chunk-BYzrzvCI.js";
3
+ import { A as n } from "./chunk-MFVRUoO0.js";
4
+ import { t as r } from "./chunk-xIbz3oFK.js";
5
+ //#region node_modules/.pnpm/mermaid@12.2.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-55XCU76K.mjs
6
+ var i = r(), a = /* @__PURE__ */ t((e, t) => {
7
+ let n = e.append("rect");
8
+ if (n.attr("x", t.x), n.attr("y", t.y), n.attr("fill", t.fill), n.attr("stroke", t.stroke), n.attr("width", t.width), n.attr("height", t.height), t.name && n.attr("name", t.name), t.rx && n.attr("rx", t.rx), t.ry && n.attr("ry", t.ry), t.attrs !== void 0) for (let e in t.attrs) n.attr(e, t.attrs[e]);
9
+ return t.class && n.attr("class", t.class), n;
10
+ }, "drawRect"), o = /* @__PURE__ */ t((e, t) => {
11
+ a(e, {
12
+ x: t.startx,
13
+ y: t.starty,
14
+ width: t.stopx - t.startx,
15
+ height: t.stopy - t.starty,
16
+ fill: t.fill,
17
+ stroke: t.stroke,
18
+ class: "rect"
19
+ }).lower();
20
+ }, "drawBackgroundRect"), s = /* @__PURE__ */ t((e, t) => {
21
+ let r = t.text.replace(n, " "), i = e.append("text");
22
+ i.attr("x", t.x), i.attr("y", t.y), i.attr("class", "legend"), i.style("text-anchor", t.anchor), t.class && i.attr("class", t.class);
23
+ let a = i.append("tspan");
24
+ return a.attr("x", t.x + t.textMargin * 2), a.text(r), i;
25
+ }, "drawText"), c = /* @__PURE__ */ t((e, t, n, r) => {
26
+ let a = e.append("image");
27
+ a.attr("x", t), a.attr("y", n);
28
+ let o = (0, i.sanitizeUrl)(r);
29
+ a.attr("xlink:href", o);
30
+ }, "drawImage"), l = /* @__PURE__ */ t((e, t, n, r) => {
31
+ let a = e.append("use");
32
+ a.attr("x", t), a.attr("y", n);
33
+ let o = (0, i.sanitizeUrl)(r);
34
+ a.attr("xlink:href", `#${o}`);
35
+ }, "drawEmbeddedImage"), u = /* @__PURE__ */ t(() => ({
36
+ x: 0,
37
+ y: 0,
38
+ width: 100,
39
+ height: 100,
40
+ fill: "#EDF2AE",
41
+ stroke: "#666",
42
+ anchor: "start",
43
+ rx: 0,
44
+ ry: 0
45
+ }), "getNoteRect"), d = /* @__PURE__ */ t(() => ({
46
+ x: 0,
47
+ y: 0,
48
+ width: 100,
49
+ height: 100,
50
+ "text-anchor": "start",
51
+ style: "#666",
52
+ textMargin: 0,
53
+ rx: 0,
54
+ ry: 0,
55
+ tspan: !0
56
+ }), "getTextObj"), f = /* @__PURE__ */ t(() => {
57
+ let t = e(".mermaidTooltip");
58
+ return t.empty() && (t = e("body").append("div").attr("class", "mermaidTooltip").style("opacity", 0).style("position", "absolute").style("text-align", "center").style("max-width", "200px").style("padding", "2px").style("font-size", "12px").style("background", "#ffffde").style("border", "1px solid #333").style("border-radius", "2px").style("pointer-events", "none").style("z-index", "100")), t;
59
+ }, "createTooltip");
60
+ //#endregion
61
+ export { a, d as c, c as i, o as n, s as o, l as r, u as s, f as t };
@@ -0,0 +1,15 @@
1
+ import { n as e } from "./chunk-BYzrzvCI.js";
2
+ //#region node_modules/.pnpm/mermaid@12.2.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-2Q5K7J3B.mjs
3
+ var t = class {
4
+ constructor(e) {
5
+ this.init = e, this.records = this.init();
6
+ }
7
+ static {
8
+ e(this, "ImperativeState");
9
+ }
10
+ reset() {
11
+ this.records = this.init();
12
+ }
13
+ };
14
+ //#endregion
15
+ export { t };
@@ -0,0 +1,37 @@
1
+ import { m as e } from "./chunk-DVNvSFoz.js";
2
+ import { n as t } from "./chunk-BYzrzvCI.js";
3
+ import { d as n } from "./chunk-K7Myuj2-.js";
4
+ import { s as r } from "./chunk-DORnIAsy.js";
5
+ //#region node_modules/.pnpm/mermaid@12.2.0/node_modules/mermaid/dist/chunks/mermaid.core/chunk-ZAUX2LTX.mjs
6
+ var i = /* @__PURE__ */ t(({ flowchart: e }) => {
7
+ let t = e?.subGraphTitleMargin?.top ?? 0, n = e?.subGraphTitleMargin?.bottom ?? 0;
8
+ return {
9
+ subGraphTitleTopMargin: t,
10
+ subGraphTitleBottomMargin: n,
11
+ subGraphTitleTotalMargin: t + n
12
+ };
13
+ }, "getSubGraphTitleMargins"), a = /* @__PURE__ */ new Map();
14
+ async function o(e, t, i) {
15
+ let o, s;
16
+ t.shape === "rect" && (t.shape = t.rx && t.ry ? "roundedRect" : "squareRect");
17
+ let c = t.shape ? r[t.shape] : void 0;
18
+ if (!c) throw Error(`No such shape: ${t.shape}. Please check your syntax.`);
19
+ if (t.link) {
20
+ let n;
21
+ i.config.securityLevel === "sandbox" ? n = "_top" : t.linkTarget && (n = t.linkTarget || "_blank"), o = e.insert("svg:a").attr("xlink:href", t.link).attr("target", n ?? null), s = await c(o, t, i);
22
+ } else s = await c(e, t, i), o = s;
23
+ return o.attr("data-look", n(t.look)), t.tooltip && s.attr("title", t.tooltip), a.set(t.id, o), t.haveCallback && o.attr("class", o.attr("class") + " clickable"), o;
24
+ }
25
+ t(o, "insertNode");
26
+ var s = /* @__PURE__ */ t((e, t) => {
27
+ a.set(t.id, e);
28
+ }, "setNodeElem"), c = /* @__PURE__ */ t(() => {
29
+ a.clear();
30
+ }, "clear"), l = /* @__PURE__ */ t((t) => {
31
+ let n = a.get(t.id);
32
+ e.trace("Transforming node", t.diff, t, "translate(" + (t.x - t.width / 2 - 5) + ", " + t.width / 2 + ")");
33
+ let r = t.diff || 0;
34
+ return t.clusterNode ? n.attr("transform", "translate(" + (t.x + r - t.width / 2) + ", " + (t.y - t.height / 2 - 8) + ")") : n.attr("transform", "translate(" + t.x + ", " + t.y + ")"), r;
35
+ }, "positionNode");
36
+ //#endregion
37
+ export { s as a, l as i, i as n, o as r, c as t };
@@ -0,0 +1,134 @@
1
+ import { m as e } from "./chunk-DVNvSFoz.js";
2
+ import { n as t } from "./chunk-BYzrzvCI.js";
3
+ import { C as n, H as r, U as i, _ as a, a as o, c as s, f as c, q as l, v as u, y as d } from "./chunk-MFVRUoO0.js";
4
+ import { i as f } from "./chunk-K7Myuj2-.js";
5
+ import { t as p } from "./chunk-B58sEIY_.js";
6
+ import { n as m } from "./chunk-DK9KqIXj.js";
7
+ import { t as h } from "./chunk-DGVDaXjx.js";
8
+ //#region node_modules/.pnpm/mermaid@12.2.0/node_modules/mermaid/dist/chunks/mermaid.core/diagram-I5XIIV2D.mjs
9
+ var g = c.packet, _ = class {
10
+ constructor() {
11
+ this.packet = [], this.setAccTitle = i, this.getAccTitle = u, this.setDiagramTitle = l, this.getDiagramTitle = n, this.getAccDescription = a, this.setAccDescription = r;
12
+ }
13
+ static {
14
+ t(this, "PacketDB");
15
+ }
16
+ getConfig() {
17
+ let e = f({
18
+ ...g,
19
+ ...d().packet
20
+ });
21
+ return e.showBits && (e.paddingY += 10), e;
22
+ }
23
+ getPacket() {
24
+ return this.packet;
25
+ }
26
+ pushWord(e) {
27
+ e.length > 0 && this.packet.push(e);
28
+ }
29
+ clear() {
30
+ o(), this.packet = [];
31
+ }
32
+ }, v = 1e4, y = /* @__PURE__ */ t((t, n) => {
33
+ h(t, n);
34
+ let r = -1, i = [], a = 1, { bitsPerRow: o } = n.getConfig();
35
+ for (let { start: s, end: c, bits: l, label: u } of t.blocks) {
36
+ if (s !== void 0 && c !== void 0 && c < s) throw Error(`Packet block ${s} - ${c} is invalid. End must be greater than start.`);
37
+ if (s ??= r + 1, s !== r + 1) throw Error(`Packet block ${s} - ${c ?? s} is not contiguous. It should start from ${r + 1}.`);
38
+ if (l === 0) throw Error(`Packet block ${s} is invalid. Cannot have a zero bit field.`);
39
+ for (c ??= s + (l ?? 1) - 1, l ??= c - s + 1, r = c, e.debug(`Packet block ${s} - ${r} with label ${u}`); i.length <= o + 1 && n.getPacket().length < v;) {
40
+ let [e, t] = b({
41
+ start: s,
42
+ end: c,
43
+ bits: l,
44
+ label: u
45
+ }, a, o);
46
+ if (i.push(e), e.end + 1 === a * o && (n.pushWord(i), i = [], a++), !t) break;
47
+ ({start: s, end: c, bits: l, label: u} = t);
48
+ }
49
+ }
50
+ n.pushWord(i);
51
+ }, "populate"), b = /* @__PURE__ */ t((e, t, n) => {
52
+ if (e.start === void 0) throw Error("start should have been set during first phase");
53
+ if (e.end === void 0) throw Error("end should have been set during first phase");
54
+ if (e.start > e.end) throw Error(`Block start ${e.start} is greater than block end ${e.end}.`);
55
+ if (e.end + 1 <= t * n) return [e, void 0];
56
+ let r = t * n - 1, i = t * n;
57
+ return [{
58
+ start: e.start,
59
+ end: r,
60
+ label: e.label,
61
+ bits: r - e.start
62
+ }, {
63
+ start: i,
64
+ end: e.end,
65
+ label: e.label,
66
+ bits: e.end - i
67
+ }];
68
+ }, "getNextFittingBlock"), x = {
69
+ parser: { yy: void 0 },
70
+ parse: /* @__PURE__ */ t(async (t) => {
71
+ let n = await m("packet", t), r = x.parser?.yy;
72
+ if (!(r instanceof _)) throw Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");
73
+ e.debug(n), y(n, r);
74
+ }, "parse")
75
+ }, S = /* @__PURE__ */ t((e, t, n, r) => {
76
+ let i = r.db, a = i.getConfig(), { rowHeight: o, paddingY: c, bitWidth: l, bitsPerRow: u } = a, d = i.getPacket(), f = i.getDiagramTitle(), m = o + c, h = m * (d.length + 1) - (f ? 0 : o), g = l * u + 2, _ = p(t);
77
+ _.attr("viewBox", `0 0 ${g} ${h}`), s(_, h, g, a.useMaxWidth);
78
+ for (let [e, t] of d.entries()) C(_, t, e, a);
79
+ _.append("text").text(f).attr("x", g / 2).attr("y", h - m / 2).attr("dominant-baseline", "middle").attr("text-anchor", "middle").attr("class", "packetTitle");
80
+ }, "draw"), C = /* @__PURE__ */ t((e, t, n, { rowHeight: r, paddingX: i, paddingY: a, bitWidth: o, bitsPerRow: s, showBits: c, bitOrder: l }) => {
81
+ let u = e.append("g"), d = n * (r + a) + a, f = l === "descending";
82
+ for (let e of t) {
83
+ let t = e.end - e.start + 1, n = e.start % s, a = (f ? s - n - t : n) * o + 1, l = t * o - i;
84
+ if (u.append("rect").attr("x", a).attr("y", d).attr("width", l).attr("height", r).attr("class", "packetBlock"), u.append("text").attr("x", a + l / 2).attr("y", d + r / 2).attr("class", "packetLabel").attr("dominant-baseline", "middle").attr("text-anchor", "middle").text(e.label), !c) continue;
85
+ let [p, m] = f ? [e.end, e.start] : [e.start, e.end], h = t === 1, g = d - 2;
86
+ u.append("text").attr("x", a + (h ? l / 2 : 0)).attr("y", g).attr("class", "packetByte start").attr("dominant-baseline", "auto").attr("text-anchor", h ? "middle" : "start").text(p), h || u.append("text").attr("x", a + l).attr("y", g).attr("class", "packetByte end").attr("dominant-baseline", "auto").attr("text-anchor", "end").text(m);
87
+ }
88
+ }, "drawWord"), w = { draw: S }, T = {
89
+ byteFontSize: "10px",
90
+ startByteColor: "black",
91
+ endByteColor: "black",
92
+ labelColor: "black",
93
+ labelFontSize: "12px",
94
+ titleColor: "black",
95
+ titleFontSize: "14px",
96
+ blockStrokeColor: "black",
97
+ blockStrokeWidth: "1",
98
+ blockFillColor: "#efefef"
99
+ }, E = {
100
+ parser: x,
101
+ get db() {
102
+ return new _();
103
+ },
104
+ renderer: w,
105
+ styles: /* @__PURE__ */ t(({ packet: e } = {}) => {
106
+ let t = f(T, e);
107
+ return `
108
+ .packetByte {
109
+ font-size: ${t.byteFontSize};
110
+ }
111
+ .packetByte.start {
112
+ fill: ${t.startByteColor};
113
+ }
114
+ .packetByte.end {
115
+ fill: ${t.endByteColor};
116
+ }
117
+ .packetLabel {
118
+ fill: ${t.labelColor};
119
+ font-size: ${t.labelFontSize};
120
+ }
121
+ .packetTitle {
122
+ fill: ${t.titleColor};
123
+ font-size: ${t.titleFontSize};
124
+ }
125
+ .packetBlock {
126
+ stroke: ${t.blockStrokeColor};
127
+ stroke-width: ${t.blockStrokeWidth};
128
+ fill: ${t.blockFillColor};
129
+ }
130
+ `;
131
+ }, "styles")
132
+ };
133
+ //#endregion
134
+ export { E as diagram };
@@ -0,0 +1,2 @@
1
+ import "./chunk-hM77LvCb.js";
2
+ export { M as createArchitectureServices } from "./chunk-DK9KqIXj.js";
@@ -0,0 +1,2 @@
1
+ import "./chunk-hM77LvCb.js";
2
+ export { u as createRailroadPegServices } from "./chunk-DK9KqIXj.js";