rdstudio 0.2.0__py3-none-any.whl

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 (251) hide show
  1. rdstudio/__init__.py +3 -0
  2. rdstudio/_node/rdstudio.mjs +59351 -0
  3. rdstudio/brief.py +46 -0
  4. rdstudio/build.py +218 -0
  5. rdstudio/classify.py +131 -0
  6. rdstudio/cli.py +369 -0
  7. rdstudio/config.py +115 -0
  8. rdstudio/gitlog.py +92 -0
  9. rdstudio/launcher.py +63 -0
  10. rdstudio/learner.py +187 -0
  11. rdstudio/mcp_server.py +313 -0
  12. rdstudio/okf.py +775 -0
  13. rdstudio/procedures.py +233 -0
  14. rdstudio/references.py +228 -0
  15. rdstudio/reports.py +75 -0
  16. rdstudio/scaffold.py +227 -0
  17. rdstudio/scopes.py +162 -0
  18. rdstudio/search.py +149 -0
  19. rdstudio/serve.py +214 -0
  20. rdstudio/store.py +161 -0
  21. rdstudio/templates/agents/critic.md +20 -0
  22. rdstudio/templates/agents/librarian.md +21 -0
  23. rdstudio/templates/agents/searcher.md +21 -0
  24. rdstudio/templates/agents_section.md +31 -0
  25. rdstudio/templates/claude_section.md +3 -0
  26. rdstudio/templates/knowledge/overview.md +20 -0
  27. rdstudio/templates/knowledge/tasks/bootstrap-knowledge-base.md +45 -0
  28. rdstudio/templates/skills/decision/SKILL.md +47 -0
  29. rdstudio/templates/skills/handoff/SKILL.md +18 -0
  30. rdstudio/templates/skills/ingest-ref/SKILL.md +32 -0
  31. rdstudio/templates/skills/lint-okf/SKILL.md +15 -0
  32. rdstudio/templates/skills/promote/SKILL.md +25 -0
  33. rdstudio/templates/skills/question/SKILL.md +33 -0
  34. rdstudio/templates/skills/record-okf/SKILL.md +61 -0
  35. rdstudio/templates/skills/report/SKILL.md +46 -0
  36. rdstudio/templates/skills/report/template.html +74 -0
  37. rdstudio/templates/skills/search-okf/SKILL.md +36 -0
  38. rdstudio/templates/skills/task/SKILL.md +51 -0
  39. rdstudio/web/app.js +140 -0
  40. rdstudio/web/fonts.css +48 -0
  41. rdstudio/web/icon-192.png +0 -0
  42. rdstudio/web/icon-512.png +0 -0
  43. rdstudio/web/index.html +109 -0
  44. rdstudio/web/js/data.js +125 -0
  45. rdstudio/web/js/diagrams.js +116 -0
  46. rdstudio/web/js/graph.js +396 -0
  47. rdstudio/web/js/knowledge.js +212 -0
  48. rdstudio/web/js/layout-worker.js +15 -0
  49. rdstudio/web/js/layout.js +226 -0
  50. rdstudio/web/js/learn.js +83 -0
  51. rdstudio/web/js/map.js +1293 -0
  52. rdstudio/web/js/markdown.js +173 -0
  53. rdstudio/web/js/pages.js +219 -0
  54. rdstudio/web/js/procedures.js +262 -0
  55. rdstudio/web/js/settings.js +95 -0
  56. rdstudio/web/js/util.js +99 -0
  57. rdstudio/web/report.css +35 -0
  58. rdstudio/web/report.js +104 -0
  59. rdstudio/web/style.css +566 -0
  60. rdstudio/web/sw.js +166 -0
  61. rdstudio/web/themes/cyber.css +139 -0
  62. rdstudio/web/themes/map.css +133 -0
  63. rdstudio/web/themes/notebook.css +134 -0
  64. rdstudio/web/themes/space.css +135 -0
  65. rdstudio/web/themes/studio.css +110 -0
  66. rdstudio/web/vendor/d3.min.js +2 -0
  67. rdstudio/web/vendor/fonts/atkinson-hyperlegible-next-latin-ext-wght-italic.woff2 +0 -0
  68. rdstudio/web/vendor/fonts/atkinson-hyperlegible-next-latin-ext-wght-normal.woff2 +0 -0
  69. rdstudio/web/vendor/fonts/atkinson-hyperlegible-next-latin-wght-italic.woff2 +0 -0
  70. rdstudio/web/vendor/fonts/atkinson-hyperlegible-next-latin-wght-normal.woff2 +0 -0
  71. rdstudio/web/vendor/fonts/caveat-latin-wght-normal.woff2 +0 -0
  72. rdstudio/web/vendor/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
  73. rdstudio/web/vendor/fonts/ibm-plex-mono-latin-600-normal.woff2 +0 -0
  74. rdstudio/web/vendor/fonts/ibm-plex-sans-latin-wght-italic.woff2 +0 -0
  75. rdstudio/web/vendor/fonts/ibm-plex-sans-latin-wght-normal.woff2 +0 -0
  76. rdstudio/web/vendor/fonts/inter-latin-opsz-italic.woff2 +0 -0
  77. rdstudio/web/vendor/fonts/inter-latin-opsz-normal.woff2 +0 -0
  78. rdstudio/web/vendor/fonts/jetbrains-mono-latin-wght-italic.woff2 +0 -0
  79. rdstudio/web/vendor/fonts/jetbrains-mono-latin-wght-normal.woff2 +0 -0
  80. rdstudio/web/vendor/fonts/literata-latin-ext-opsz-italic.woff2 +0 -0
  81. rdstudio/web/vendor/fonts/literata-latin-ext-opsz-normal.woff2 +0 -0
  82. rdstudio/web/vendor/fonts/literata-latin-opsz-italic.woff2 +0 -0
  83. rdstudio/web/vendor/fonts/literata-latin-opsz-normal.woff2 +0 -0
  84. rdstudio/web/vendor/fonts/source-sans-3-latin-wght-italic.woff2 +0 -0
  85. rdstudio/web/vendor/fonts/source-sans-3-latin-wght-normal.woff2 +0 -0
  86. rdstudio/web/vendor/fonts/source-serif-4-latin-opsz-italic.woff2 +0 -0
  87. rdstudio/web/vendor/fonts/source-serif-4-latin-opsz-normal.woff2 +0 -0
  88. rdstudio/web/vendor/hljs/github-dark.min.css +10 -0
  89. rdstudio/web/vendor/hljs/github.min.css +10 -0
  90. rdstudio/web/vendor/hljs/highlight.min.js +1262 -0
  91. rdstudio/web/vendor/hljs/julia.min.js +18 -0
  92. rdstudio/web/vendor/hljs/latex.min.js +33 -0
  93. rdstudio/web/vendor/hljs/matlab.min.js +15 -0
  94. rdstudio/web/vendor/katex/auto-render.min.js +1 -0
  95. rdstudio/web/vendor/katex/fonts/KaTeX_AMS-Regular.woff2 +0 -0
  96. rdstudio/web/vendor/katex/fonts/KaTeX_Caligraphic-Bold.woff2 +0 -0
  97. rdstudio/web/vendor/katex/fonts/KaTeX_Caligraphic-Regular.woff2 +0 -0
  98. rdstudio/web/vendor/katex/fonts/KaTeX_Fraktur-Bold.woff2 +0 -0
  99. rdstudio/web/vendor/katex/fonts/KaTeX_Fraktur-Regular.woff2 +0 -0
  100. rdstudio/web/vendor/katex/fonts/KaTeX_Main-Bold.woff2 +0 -0
  101. rdstudio/web/vendor/katex/fonts/KaTeX_Main-BoldItalic.woff2 +0 -0
  102. rdstudio/web/vendor/katex/fonts/KaTeX_Main-Italic.woff2 +0 -0
  103. rdstudio/web/vendor/katex/fonts/KaTeX_Main-Regular.woff2 +0 -0
  104. rdstudio/web/vendor/katex/fonts/KaTeX_Math-BoldItalic.woff2 +0 -0
  105. rdstudio/web/vendor/katex/fonts/KaTeX_Math-Italic.woff2 +0 -0
  106. rdstudio/web/vendor/katex/fonts/KaTeX_SansSerif-Bold.woff2 +0 -0
  107. rdstudio/web/vendor/katex/fonts/KaTeX_SansSerif-Italic.woff2 +0 -0
  108. rdstudio/web/vendor/katex/fonts/KaTeX_SansSerif-Regular.woff2 +0 -0
  109. rdstudio/web/vendor/katex/fonts/KaTeX_Script-Regular.woff2 +0 -0
  110. rdstudio/web/vendor/katex/fonts/KaTeX_Size1-Regular.woff2 +0 -0
  111. rdstudio/web/vendor/katex/fonts/KaTeX_Size2-Regular.woff2 +0 -0
  112. rdstudio/web/vendor/katex/fonts/KaTeX_Size3-Regular.woff2 +0 -0
  113. rdstudio/web/vendor/katex/fonts/KaTeX_Size4-Regular.woff2 +0 -0
  114. rdstudio/web/vendor/katex/fonts/KaTeX_Typewriter-Regular.woff2 +0 -0
  115. rdstudio/web/vendor/katex/katex.min.css +1 -0
  116. rdstudio/web/vendor/katex/katex.min.js +1 -0
  117. rdstudio/web/vendor/licenses/atkinson-hyperlegible-next-OFL.txt +93 -0
  118. rdstudio/web/vendor/licenses/caveat-OFL.txt +93 -0
  119. rdstudio/web/vendor/licenses/d3-7.9.0.txt +13 -0
  120. rdstudio/web/vendor/licenses/highlightjs-cdn-assets-11.12.0.txt +29 -0
  121. rdstudio/web/vendor/licenses/ibm-plex-mono-OFL.txt +93 -0
  122. rdstudio/web/vendor/licenses/ibm-plex-sans-OFL.txt +93 -0
  123. rdstudio/web/vendor/licenses/inter-OFL.txt +93 -0
  124. rdstudio/web/vendor/licenses/jetbrains-mono-OFL.txt +93 -0
  125. rdstudio/web/vendor/licenses/katex-0.18.7.txt +21 -0
  126. rdstudio/web/vendor/licenses/literata-OFL.txt +93 -0
  127. rdstudio/web/vendor/licenses/markdown-it-15.0.2.txt +22 -0
  128. rdstudio/web/vendor/licenses/markdown-it-footnote-4.0.0.txt +22 -0
  129. rdstudio/web/vendor/licenses/markdown-it-texmath-1.0.0.txt +21 -0
  130. rdstudio/web/vendor/licenses/mermaid-12.0.0.txt +21 -0
  131. rdstudio/web/vendor/licenses/source-sans-3-OFL.txt +93 -0
  132. rdstudio/web/vendor/licenses/source-serif-4-OFL.txt +93 -0
  133. rdstudio/web/vendor/licenses/vega-6.4.0.txt +27 -0
  134. rdstudio/web/vendor/licenses/vega-embed-7.2.0.txt +27 -0
  135. rdstudio/web/vendor/licenses/vega-lite-6.4.3.txt +27 -0
  136. rdstudio/web/vendor/markdown-it-footnote.min.js +2 -0
  137. rdstudio/web/vendor/markdown-it.min.js +14 -0
  138. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/abnfDiagram-DGLNOSUI.mjs +1 -0
  139. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/architecture-7GRP2DOG-HF4J73XS.mjs +1 -0
  140. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/architectureDiagram-IU6H5EVY.mjs +36 -0
  141. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/blockDiagram-FSX6DT2V.mjs +140 -0
  142. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/c4Diagram-YNRVYILN.mjs +38 -0
  143. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-22SYA5HA.mjs +1 -0
  144. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-2FTYKNOQ.mjs +1 -0
  145. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-36VM3LGA.mjs +1 -0
  146. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-3SEI7E7V.mjs +1 -0
  147. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-3T2MNPEU.mjs +1 -0
  148. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-44AU3KAP.mjs +174 -0
  149. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-4MZOTL6B.mjs +1 -0
  150. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-52IMQVNL.mjs +1 -0
  151. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-5NYYYZGL.mjs +1 -0
  152. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-BOZ75642.mjs +15 -0
  153. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-CVBX6EWK.mjs +1 -0
  154. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-D36F7FYG.mjs +14 -0
  155. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-DEGLBX6O.mjs +213 -0
  156. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-F6PIGZHG.mjs +1 -0
  157. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-FE53TMRB.mjs +133 -0
  158. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-FNR2RGIF.mjs +1 -0
  159. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-GDOATIN3.mjs +32 -0
  160. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-H7BX327W.mjs +2 -0
  161. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-HI3EPXIC.mjs +2 -0
  162. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-JCBDXJ5W.mjs +1 -0
  163. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-JGXDHUYS.mjs +1 -0
  164. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-L2B47AAZ.mjs +1 -0
  165. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-LIEGGFIX.mjs +1 -0
  166. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-LLWYPJEZ.mjs +1 -0
  167. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-MFYRHTYG.mjs +1 -0
  168. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-MIE3LDYP.mjs +1 -0
  169. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-MLQVGYRW.mjs +1 -0
  170. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-MNT3HHAC.mjs +1 -0
  171. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-NRRTYJAG.mjs +1 -0
  172. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-OCMJQKYE.mjs +10 -0
  173. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-PKJCTQEK.mjs +339 -0
  174. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-QADHU5CF.mjs +2 -0
  175. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-QVIEFLGF.mjs +1 -0
  176. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-QX7LGXZU.mjs +1 -0
  177. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-R2KH53MI.mjs +1 -0
  178. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-RXM7Z7NK.mjs +2 -0
  179. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-S4TE5DX6.mjs +1 -0
  180. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-SDIBIOXT.mjs +1 -0
  181. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-TDFULVG6.mjs +1 -0
  182. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-TECWHJ6D.mjs +62 -0
  183. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-TINYC7RT.mjs +70 -0
  184. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-V3KJR4XU.mjs +1 -0
  185. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-VTMXW4ES.mjs +1 -0
  186. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-Y5NT6LW5.mjs +88 -0
  187. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-Y5O5OPKC.mjs +3 -0
  188. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-YZG4BXY6.mjs +1 -0
  189. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/chunk-ZZ52EIBP.mjs +1 -0
  190. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/classDiagram-v2-VV4INRHB.mjs +217 -0
  191. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/cose-bilkent-MSIMRU2B.mjs +1 -0
  192. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/cynefin-OW5HDTMX-KMPDV6GS.mjs +1 -0
  193. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/cynefinDiagram-KTGLXFXK.mjs +62 -0
  194. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/dagre-QJJCSHY4.mjs +4 -0
  195. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/diagram-2ZIM67RP.mjs +3 -0
  196. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/diagram-FYHH5O6R.mjs +24 -0
  197. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/diagram-LYLDACMS.mjs +200 -0
  198. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/diagram-TYT3HRBC.mjs +24 -0
  199. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/diagram-XVIN6YVD.mjs +30 -0
  200. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/diagram-ZO2NLLYC.mjs +41 -0
  201. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/ebnfDiagram-TU3FGH35.mjs +1 -0
  202. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/elk-GHAXNSLK.mjs +27 -0
  203. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/erDiagram-XID3VV23.mjs +99 -0
  204. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/eventmodeling-NTZA5JFV-P5QJSWSK.mjs +1 -0
  205. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/flowDiagram-WPHQAKTU.mjs +1 -0
  206. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/ganttDiagram-QACGSKG6.mjs +292 -0
  207. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/gitGraph-4MIJSDKK-V5NEQQYP.mjs +1 -0
  208. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/gitGraphDiagram-EB76O4HC.mjs +106 -0
  209. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/info-A6RAGUB7-IGBHH2L7.mjs +1 -0
  210. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/infoDiagram-343ZKIDN.mjs +2 -0
  211. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/ishikawaDiagram-UEEU5D75.mjs +70 -0
  212. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/journeyDiagram-4QTZOVLF.mjs +139 -0
  213. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/kanban-definition-VEJL4RG2.mjs +89 -0
  214. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/katex-QVRI4OIV.mjs +257 -0
  215. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/mindmap-definition-C5K5ZT7T.mjs +96 -0
  216. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/packet-AYTQ26CC-PJTKDECJ.mjs +1 -0
  217. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/pegDiagram-FHIILVJB.mjs +1 -0
  218. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/pie-WAS4IAKB-U3JFQXZN.mjs +1 -0
  219. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/pieDiagram-S76BU6V7.mjs +39 -0
  220. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/quadrantDiagram-HZBLWUZE.mjs +7 -0
  221. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/radar-RG4KPBEZ-7T2UW32D.mjs +1 -0
  222. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/railroad-74A4TZTK-DZY7ARDL.mjs +1 -0
  223. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/railroad-abnf-HS5TGJTU-LWS535ZK.mjs +1 -0
  224. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/railroad-ebnf-LZEXJU2U-EA3S4ZFM.mjs +1 -0
  225. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/railroad-peg-WCYAUIDC-DUKZONPX.mjs +1 -0
  226. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/railroadDiagram-R6RP3MQ2.mjs +1 -0
  227. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/requirementDiagram-SGBABQV6.mjs +84 -0
  228. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/sankeyDiagram-IM6M5BOW.mjs +40 -0
  229. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/sequenceDiagram-FGJOIFJ2.mjs +169 -0
  230. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/sizeCapture-ERV5D3W5.mjs +1 -0
  231. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/stateDiagram-v2-6KDGCZ5J.mjs +291 -0
  232. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/swimlanes-OJBUSBEF.mjs +1 -0
  233. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/swimlanesDiagram-LNXYTHDW.mjs +8 -0
  234. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/timeline-definition-7G6YQRTY.mjs +120 -0
  235. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/treeView-Q6P3EWNA-AABPVERA.mjs +1 -0
  236. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/treemap-WGGIJYW6-F2JSY3V3.mjs +1 -0
  237. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/usecaseDiagram-6Y6TMLBO.mjs +383 -0
  238. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/vennDiagram-6RODYPCK.mjs +34 -0
  239. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/wardley-WFR3VGLG-EIT5NWVN.mjs +1 -0
  240. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/wardleyDiagram-RFZKLAPA.mjs +78 -0
  241. rdstudio/web/vendor/mermaid/chunks/mermaid.esm.min/xychartDiagram-TWWI2QJZ.mjs +7 -0
  242. rdstudio/web/vendor/mermaid/mermaid.esm.min.mjs +14 -0
  243. rdstudio/web/vendor/texmath.js +368 -0
  244. rdstudio/web/vendor/vega/vega-embed.min.js +7 -0
  245. rdstudio/web/vendor/vega/vega-lite.min.js +2 -0
  246. rdstudio/web/vendor/vega/vega.min.js +1 -0
  247. rdstudio-0.2.0.dist-info/METADATA +201 -0
  248. rdstudio-0.2.0.dist-info/RECORD +251 -0
  249. rdstudio-0.2.0.dist-info/WHEEL +4 -0
  250. rdstudio-0.2.0.dist-info/entry_points.txt +3 -0
  251. rdstudio-0.2.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,70 @@
1
+ import{c as ue,d as de}from"./chunk-TDFULVG6.mjs";import{r as Z}from"./chunk-QADHU5CF.mjs";import{B as G,E as O,G as pe,H as he,u as ce}from"./chunk-FE53TMRB.mjs";import{b as _,h as R}from"./chunk-L2B47AAZ.mjs";import{a as h}from"./chunk-QVIEFLGF.mjs";function ge(n){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];var s=Array.from(typeof n=="string"?[n]:n);s[s.length-1]=s[s.length-1].replace(/\r?\n([\t ]*)$/,"");var t=s.reduce(function(l,o){var c=o.match(/\n([\t ]+|(?!\s).)/g);return c?l.concat(c.map(function(p){var u,d;return(d=(u=p.match(/[\t ]/g))===null||u===void 0?void 0:u.length)!==null&&d!==void 0?d:0})):l},[]);if(t.length){var a=new RegExp(`
2
+ [ ]{`+Math.min.apply(Math,t)+"}","g");s=s.map(function(l){return l.replace(a,`
3
+ `)})}s[0]=s[0].replace(/^\r?\n/,"");var i=s[0];return e.forEach(function(l,o){var c=i.match(/(?:^|\n)( *)$/),p=c?c[1]:"",u=l;typeof l=="string"&&l.includes(`
4
+ `)&&(u=String(l).split(`
5
+ `).map(function(d,m){return m===0?d:""+p+d}).join(`
6
+ `)),i+=u+s[o+1]}),i}h(ge,"dedent");var qt=typeof performance<"u"&&typeof performance.now=="function";globalThis.injected??={includeLargeFeatures:!0,profiling:!1,version:"0.0.0"};function V(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}h(V,"L");var $=V();function we(n){$=n}h(we,"G");var P={exec:h(()=>null,"exec")};function k(n,e=""){let r=typeof n=="string"?n:n.source,s={replace:h((t,a)=>{let i=typeof a=="string"?a:a.source;return i=i.replace(b.caret,"$1"),r=r.replace(t,i),s},"replace"),getRegex:h(()=>new RegExp(r,e),"getRegex")};return s}h(k,"h");var b={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:h(n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),"listItemRegex"),nextBulletRegex:h(n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),"nextBulletRegex"),hrRegex:h(n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),"hrRegex"),fencesBeginRegex:h(n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),"fencesBeginRegex"),headingBeginRegex:h(n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),"headingBeginRegex"),htmlBeginRegex:h(n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i"),"htmlBeginRegex")},Ne=/^(?:[ \t]*(?:\n|$))+/,Qe=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ve=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,E=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ue=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,U=/(?:[*+-]|\d{1,9}[.)])/,ye=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Se=k(ye).replace(/bull/g,U).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Xe=k(ye).replace(/bull/g,U).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),X=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Ke=/^[^\n]+/,K=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ye=k(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",K).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Je=k(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,U).getRegex(),q="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Y=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,et=k("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Y).replace("tag",q).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Te=k(X).replace("hr",E).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",q).getRegex(),tt=k(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Te).getRegex(),J={blockquote:tt,code:Qe,def:Ye,fences:Ve,heading:Ue,hr:E,html:et,lheading:Se,list:Je,newline:Ne,paragraph:Te,table:P,text:Ke},fe=k("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",E).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",q).getRegex(),nt={...J,lheading:Xe,table:fe,paragraph:k(X).replace("hr",E).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",fe).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",q).getRegex()},rt={...J,html:k(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Y).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:P,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:k(X).replace("hr",E).replace("heading",` *#{1,6} *[^
7
+ ]`).replace("lheading",Se).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},st=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,it=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,$e=/^( {2,}|\\)\n(?!\s*$)/,lt=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,W=/[\p{P}\p{S}]/u,ee=/[\s\p{P}\p{S}]/u,Re=/[^\s\p{P}\p{S}]/u,at=k(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,ee).getRegex(),ve=/(?!~)[\p{P}\p{S}]/u,ot=/(?!~)[\s\p{P}\p{S}]/u,ct=/(?:[^\s\p{P}\p{S}]|~)/u,pt=/\[[^\[\]]*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)|`[^`]*?`|<(?! )[^<>]*?>/g,ze=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,ht=k(ze,"u").replace(/punct/g,W).getRegex(),ut=k(ze,"u").replace(/punct/g,ve).getRegex(),Le="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",dt=k(Le,"gu").replace(/notPunctSpace/g,Re).replace(/punctSpace/g,ee).replace(/punct/g,W).getRegex(),gt=k(Le,"gu").replace(/notPunctSpace/g,ct).replace(/punctSpace/g,ot).replace(/punct/g,ve).getRegex(),ft=k("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Re).replace(/punctSpace/g,ee).replace(/punct/g,W).getRegex(),kt=k(/\\(punct)/,"gu").replace(/punct/g,W).getRegex(),mt=k(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),xt=k(Y).replace("(?:-->|$)","-->").getRegex(),bt=k("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",xt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),C=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`[^`]*`|[^\[\]\\`])*?/,wt=k(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",C).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Me=k(/^!?\[(label)\]\[(ref)\]/).replace("label",C).replace("ref",K).getRegex(),Ae=k(/^!?\[(ref)\](?:\[\])?/).replace("ref",K).getRegex(),yt=k("reflink|nolink(?!\\()","g").replace("reflink",Me).replace("nolink",Ae).getRegex(),te={_backpedal:P,anyPunctuation:kt,autolink:mt,blockSkip:pt,br:$e,code:it,del:P,emStrongLDelim:ht,emStrongRDelimAst:dt,emStrongRDelimUnd:ft,escape:st,link:wt,nolink:Ae,punctuation:at,reflink:Me,reflinkSearch:yt,tag:bt,text:lt,url:P},St={...te,link:k(/^!?\[(label)\]\((.*?)\)/).replace("label",C).getRegex(),reflink:k(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",C).getRegex()},H={...te,emStrongRDelimAst:gt,emStrongLDelim:ut,url:k(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Tt={...H,br:k($e).replace("{2,}","*").getRegex(),text:k(H.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},I={normal:J,gfm:nt,pedantic:rt},L={normal:te,gfm:H,breaks:Tt,pedantic:St},$t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ke=h(n=>$t[n],"ke");function w(n,e){if(e){if(b.escapeTest.test(n))return n.replace(b.escapeReplace,ke)}else if(b.escapeTestNoEncode.test(n))return n.replace(b.escapeReplaceNoEncode,ke);return n}h(w,"w");function me(n){try{n=encodeURI(n).replace(b.percentDecode,"%")}catch{return null}return n}h(me,"J");function xe(n,e){let r=n.replace(b.findPipe,(a,i,l)=>{let o=!1,c=i;for(;--c>=0&&l[c]==="\\";)o=!o;return o?"|":" |"}),s=r.split(b.splitPipe),t=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;t<s.length;t++)s[t]=s[t].trim().replace(b.slashPipe,"|");return s}h(xe,"V");function M(n,e,r){let s=n.length;if(s===0)return"";let t=0;for(;t<s;){let a=n.charAt(s-t-1);if(a===e&&!r)t++;else if(a!==e&&r)t++;else break}return n.slice(0,s-t)}h(M,"z");function Rt(n,e){if(n.indexOf(e[1])===-1)return-1;let r=0;for(let s=0;s<n.length;s++)if(n[s]==="\\")s++;else if(n[s]===e[0])r++;else if(n[s]===e[1]&&(r--,r<0))return s;return r>0?-2:-1}h(Rt,"ge");function be(n,e,r,s,t){let a=e.href,i=e.title||null,l=n[1].replace(t.other.outputLinkReplace,"$1");s.state.inLink=!0;let o={type:n[0].charAt(0)==="!"?"image":"link",raw:r,href:a,title:i,text:l,tokens:s.inlineTokens(l)};return s.state.inLink=!1,o}h(be,"fe");function vt(n,e,r){let s=n.match(r.other.indentCodeCompensation);if(s===null)return e;let t=s[1];return e.split(`
8
+ `).map(a=>{let i=a.match(r.other.beginningSpace);if(i===null)return a;let[l]=i;return l.length>=t.length?a.slice(t.length):a}).join(`
9
+ `)}h(vt,"Je");var B=class{static{h(this,"y")}options;rules;lexer;constructor(n){this.options=n||$}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let r=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?r:M(r,`
10
+ `)}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let r=e[0],s=vt(r,e[3]||"",this.rules);return{type:"code",raw:r,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(n){let e=this.rules.block.heading.exec(n);if(e){let r=e[2].trim();if(this.rules.other.endingHash.test(r)){let s=M(r,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(r=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(n){let e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:M(e[0],`
11
+ `)}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let r=M(e[0],`
12
+ `).split(`
13
+ `),s="",t="",a=[];for(;r.length>0;){let i=!1,l=[],o;for(o=0;o<r.length;o++)if(this.rules.other.blockquoteStart.test(r[o]))l.push(r[o]),i=!0;else if(!i)l.push(r[o]);else break;r=r.slice(o);let c=l.join(`
14
+ `),p=c.replace(this.rules.other.blockquoteSetextReplace,`
15
+ $1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
16
+ ${c}`:c,t=t?`${t}
17
+ ${p}`:p;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,a,!0),this.lexer.state.top=u,r.length===0)break;let d=a.at(-1);if(d?.type==="code")break;if(d?.type==="blockquote"){let m=d,g=m.raw+`
18
+ `+r.join(`
19
+ `),x=this.blockquote(g);a[a.length-1]=x,s=s.substring(0,s.length-m.raw.length)+x.raw,t=t.substring(0,t.length-m.text.length)+x.text;break}else if(d?.type==="list"){let m=d,g=m.raw+`
20
+ `+r.join(`
21
+ `),x=this.list(g);a[a.length-1]=x,s=s.substring(0,s.length-d.raw.length)+x.raw,t=t.substring(0,t.length-m.raw.length)+x.raw,r=g.substring(a.at(-1).raw.length).split(`
22
+ `);continue}}return{type:"blockquote",raw:s,tokens:a,text:t}}}list(n){let e=this.rules.block.list.exec(n);if(e){let r=e[1].trim(),s=r.length>1,t={type:"list",raw:"",ordered:s,start:s?+r.slice(0,-1):"",loose:!1,items:[]};r=s?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=s?r:"[*+-]");let a=this.rules.other.listItemRegex(r),i=!1;for(;n;){let o=!1,c="",p="";if(!(e=a.exec(n))||this.rules.block.hr.test(n))break;c=e[0],n=n.substring(c.length);let u=e[2].split(`
23
+ `,1)[0].replace(this.rules.other.listReplaceTabs,D=>" ".repeat(3*D.length)),d=n.split(`
24
+ `,1)[0],m=!u.trim(),g=0;if(this.options.pedantic?(g=2,p=u.trimStart()):m?g=e[1].length+1:(g=e[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,p=u.slice(g),g+=e[1].length),m&&this.rules.other.blankLine.test(d)&&(c+=d+`
25
+ `,n=n.substring(d.length+1),o=!0),!o){let D=this.rules.other.nextBulletRegex(g),le=this.rules.other.hrRegex(g),ae=this.rules.other.fencesBeginRegex(g),oe=this.rules.other.headingBeginRegex(g),He=this.rules.other.htmlBeginRegex(g);for(;n;){let F=n.split(`
26
+ `,1)[0],z;if(d=F,this.options.pedantic?(d=d.replace(this.rules.other.listReplaceNesting," "),z=d):z=d.replace(this.rules.other.tabCharGlobal," "),ae.test(d)||oe.test(d)||He.test(d)||D.test(d)||le.test(d))break;if(z.search(this.rules.other.nonSpaceChar)>=g||!d.trim())p+=`
27
+ `+z.slice(g);else{if(m||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||ae.test(u)||oe.test(u)||le.test(u))break;p+=`
28
+ `+d}!m&&!d.trim()&&(m=!0),c+=F+`
29
+ `,n=n.substring(F.length+1),u=z.slice(g)}}t.loose||(i?t.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(i=!0));let x=null,v;this.options.gfm&&(x=this.rules.other.listIsTask.exec(p),x&&(v=x[0]!=="[ ] ",p=p.replace(this.rules.other.listReplaceTask,""))),t.items.push({type:"list_item",raw:c,task:!!x,checked:v,loose:!1,text:p,tokens:[]}),t.raw+=c}let l=t.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;t.raw=t.raw.trimEnd();for(let o=0;o<t.items.length;o++)if(this.lexer.state.top=!1,t.items[o].tokens=this.lexer.blockTokens(t.items[o].text,[]),!t.loose){let c=t.items[o].tokens.filter(u=>u.type==="space"),p=c.length>0&&c.some(u=>this.rules.other.anyLine.test(u.raw));t.loose=p}if(t.loose)for(let o=0;o<t.items.length;o++)t.items[o].loose=!0;return t}}html(n){let e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(n){let e=this.rules.block.def.exec(n);if(e){let r=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",t=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:e[0],href:s,title:t}}}table(n){let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=xe(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),t=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
30
+ `):[],a={type:"table",raw:e[0],header:[],align:[],rows:[]};if(r.length===s.length){for(let i of s)this.rules.other.tableAlignRight.test(i)?a.align.push("right"):this.rules.other.tableAlignCenter.test(i)?a.align.push("center"):this.rules.other.tableAlignLeft.test(i)?a.align.push("left"):a.align.push(null);for(let i=0;i<r.length;i++)a.header.push({text:r[i],tokens:this.lexer.inline(r[i]),header:!0,align:a.align[i]});for(let i of t)a.rows.push(xe(i,a.header.length).map((l,o)=>({text:l,tokens:this.lexer.inline(l),header:!1,align:a.align[o]})));return a}}lheading(n){let e=this.rules.block.lheading.exec(n);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(n){let e=this.rules.block.paragraph.exec(n);if(e){let r=e[1].charAt(e[1].length-1)===`
31
+ `?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){let e=this.rules.inline.link.exec(n);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let a=M(r.slice(0,-1),"\\");if((r.length-a.length)%2===0)return}else{let a=Rt(e[2],"()");if(a===-2)return;if(a>-1){let i=(e[0].indexOf("!")===0?5:4)+e[1].length+a;e[2]=e[2].substring(0,a),e[0]=e[0].substring(0,i).trim(),e[3]=""}}let s=e[2],t="";if(this.options.pedantic){let a=this.rules.other.pedanticHrefTitle.exec(s);a&&(s=a[1],t=a[3])}else t=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?s=s.slice(1):s=s.slice(1,-1)),be(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:t&&t.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let r;if((r=this.rules.inline.reflink.exec(n))||(r=this.rules.inline.nolink.exec(n))){let s=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),t=e[s.toLowerCase()];if(!t){let a=r[0].charAt(0);return{type:"text",raw:a,text:a}}return be(r,t,r[0],this.lexer,this.rules)}}emStrong(n,e,r=""){let s=this.rules.inline.emStrongLDelim.exec(n);if(!(!s||s[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!r||this.rules.inline.punctuation.exec(r))){let t=[...s[0]].length-1,a,i,l=t,o=0,c=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*n.length+t);(s=c.exec(e))!=null;){if(a=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!a)continue;if(i=[...a].length,s[3]||s[4]){l+=i;continue}else if((s[5]||s[6])&&t%3&&!((t+i)%3)){o+=i;continue}if(l-=i,l>0)continue;i=Math.min(i,i+l+o);let p=[...s[0]][0].length,u=n.slice(0,t+s.index+p+i);if(Math.min(t,i)%2){let m=u.slice(1,-1);return{type:"em",raw:u,text:m,tokens:this.lexer.inlineTokens(m)}}let d=u.slice(2,-2);return{type:"strong",raw:u,text:d,tokens:this.lexer.inlineTokens(d)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(r),t=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return s&&t&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n){let e=this.rules.inline.del.exec(n);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(n){let e=this.rules.inline.autolink.exec(n);if(e){let r,s;return e[2]==="@"?(r=e[1],s="mailto:"+r):(r=e[1],s=r),{type:"link",raw:e[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}url(n){let e;if(e=this.rules.inline.url.exec(n)){let r,s;if(e[2]==="@")r=e[0],s="mailto:"+r;else{let t;do t=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(t!==e[0]);r=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(n){let e=this.rules.inline.text.exec(n);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},y=class N{static{h(this,"l")}tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||$,this.options.tokenizer=this.options.tokenizer||new B,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:b,block:I.normal,inline:L.normal};this.options.pedantic?(r.block=I.pedantic,r.inline=L.pedantic):this.options.gfm&&(r.block=I.gfm,this.options.breaks?r.inline=L.breaks:r.inline=L.gfm),this.tokenizer.rules=r}static get rules(){return{block:I,inline:L}}static lex(e,r){return new N(r).lex(e)}static lexInline(e,r){return new N(r).inlineTokens(e)}lex(e){e=e.replace(b.carriageReturn,`
32
+ `),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let s=this.inlineQueue[r];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],s=!1){for(this.options.pedantic&&(e=e.replace(b.tabCharGlobal," ").replace(b.spaceLine,""));e;){let t;if(this.options.extensions?.block?.some(i=>(t=i.call({lexer:this},e,r))?(e=e.substring(t.raw.length),r.push(t),!0):!1))continue;if(t=this.tokenizer.space(e)){e=e.substring(t.raw.length);let i=r.at(-1);t.raw.length===1&&i!==void 0?i.raw+=`
33
+ `:r.push(t);continue}if(t=this.tokenizer.code(e)){e=e.substring(t.raw.length);let i=r.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
34
+ `)?"":`
35
+ `)+t.raw,i.text+=`
36
+ `+t.text,this.inlineQueue.at(-1).src=i.text):r.push(t);continue}if(t=this.tokenizer.fences(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.heading(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.hr(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.blockquote(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.list(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.html(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.def(e)){e=e.substring(t.raw.length);let i=r.at(-1);i?.type==="paragraph"||i?.type==="text"?(i.raw+=(i.raw.endsWith(`
37
+ `)?"":`
38
+ `)+t.raw,i.text+=`
39
+ `+t.raw,this.inlineQueue.at(-1).src=i.text):this.tokens.links[t.tag]||(this.tokens.links[t.tag]={href:t.href,title:t.title},r.push(t));continue}if(t=this.tokenizer.table(e)){e=e.substring(t.raw.length),r.push(t);continue}if(t=this.tokenizer.lheading(e)){e=e.substring(t.raw.length),r.push(t);continue}let a=e;if(this.options.extensions?.startBlock){let i=1/0,l=e.slice(1),o;this.options.extensions.startBlock.forEach(c=>{o=c.call({lexer:this},l),typeof o=="number"&&o>=0&&(i=Math.min(i,o))}),i<1/0&&i>=0&&(a=e.substring(0,i+1))}if(this.state.top&&(t=this.tokenizer.paragraph(a))){let i=r.at(-1);s&&i?.type==="paragraph"?(i.raw+=(i.raw.endsWith(`
40
+ `)?"":`
41
+ `)+t.raw,i.text+=`
42
+ `+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):r.push(t),s=a.length!==e.length,e=e.substring(t.raw.length);continue}if(t=this.tokenizer.text(e)){e=e.substring(t.raw.length);let i=r.at(-1);i?.type==="text"?(i.raw+=(i.raw.endsWith(`
43
+ `)?"":`
44
+ `)+t.raw,i.text+=`
45
+ `+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=i.text):r.push(t);continue}if(e){let i="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(i);break}else throw new Error(i)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){let s=e,t=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(t=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)l.includes(t[0].slice(t[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(t=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,t.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(t=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let a=!1,i="";for(;e;){a||(i=""),a=!1;let l;if(this.options.extensions?.inline?.some(c=>(l=c.call({lexer:this},e,r))?(e=e.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let c=r.at(-1);l.type==="text"&&c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):r.push(l);continue}if(l=this.tokenizer.emStrong(e,s,i)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.del(e)){e=e.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),r.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),r.push(l);continue}let o=e;if(this.options.extensions?.startInline){let c=1/0,p=e.slice(1),u;this.options.extensions.startInline.forEach(d=>{u=d.call({lexer:this},p),typeof u=="number"&&u>=0&&(c=Math.min(c,u))}),c<1/0&&c>=0&&(o=e.substring(0,c+1))}if(l=this.tokenizer.inlineText(o)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(i=l.raw.slice(-1)),a=!0;let c=r.at(-1);c?.type==="text"?(c.raw+=l.raw,c.text+=l.text):r.push(l);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return r}},j=class{static{h(this,"P")}options;parser;constructor(n){this.options=n||$}space(n){return""}code({text:n,lang:e,escaped:r}){let s=(e||"").match(b.notSpaceStart)?.[0],t=n.replace(b.endingNewline,"")+`
46
+ `;return s?'<pre><code class="language-'+w(s)+'">'+(r?t:w(t,!0))+`</code></pre>
47
+ `:"<pre><code>"+(r?t:w(t,!0))+`</code></pre>
48
+ `}blockquote({tokens:n}){return`<blockquote>
49
+ ${this.parser.parse(n)}</blockquote>
50
+ `}html({text:n}){return n}def(n){return""}heading({tokens:n,depth:e}){return`<h${e}>${this.parser.parseInline(n)}</h${e}>
51
+ `}hr(n){return`<hr>
52
+ `}list(n){let e=n.ordered,r=n.start,s="";for(let i=0;i<n.items.length;i++){let l=n.items[i];s+=this.listitem(l)}let t=e?"ol":"ul",a=e&&r!==1?' start="'+r+'"':"";return"<"+t+a+`>
53
+ `+s+"</"+t+`>
54
+ `}listitem(n){let e="";if(n.task){let r=this.checkbox({checked:!!n.checked});n.loose?n.tokens[0]?.type==="paragraph"?(n.tokens[0].text=r+" "+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&n.tokens[0].tokens[0].type==="text"&&(n.tokens[0].tokens[0].text=r+" "+w(n.tokens[0].tokens[0].text),n.tokens[0].tokens[0].escaped=!0)):n.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):e+=r+" "}return e+=this.parser.parse(n.tokens,!!n.loose),`<li>${e}</li>
55
+ `}checkbox({checked:n}){return"<input "+(n?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:n}){return`<p>${this.parser.parseInline(n)}</p>
56
+ `}table(n){let e="",r="";for(let t=0;t<n.header.length;t++)r+=this.tablecell(n.header[t]);e+=this.tablerow({text:r});let s="";for(let t=0;t<n.rows.length;t++){let a=n.rows[t];r="";for(let i=0;i<a.length;i++)r+=this.tablecell(a[i]);s+=this.tablerow({text:r})}return s&&(s=`<tbody>${s}</tbody>`),`<table>
57
+ <thead>
58
+ `+e+`</thead>
59
+ `+s+`</table>
60
+ `}tablerow({text:n}){return`<tr>
61
+ ${n}</tr>
62
+ `}tablecell(n){let e=this.parser.parseInline(n.tokens),r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+e+`</${r}>
63
+ `}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${w(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:r}){let s=this.parser.parseInline(r),t=me(n);if(t===null)return s;n=t;let a='<a href="'+n+'"';return e&&(a+=' title="'+w(e)+'"'),a+=">"+s+"</a>",a}image({href:n,title:e,text:r,tokens:s}){s&&(r=this.parser.parseInline(s,this.parser.textRenderer));let t=me(n);if(t===null)return w(r);n=t;let a=`<img src="${n}" alt="${r}"`;return e&&(a+=` title="${w(e)}"`),a+=">",a}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:w(n.text)}},ne=class{static{h(this,"$")}strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}},S=class Q{static{h(this,"l")}options;renderer;textRenderer;constructor(e){this.options=e||$,this.options.renderer=this.options.renderer||new j,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new ne}static parse(e,r){return new Q(r).parse(e)}static parseInline(e,r){return new Q(r).parseInline(e)}parse(e,r=!0){let s="";for(let t=0;t<e.length;t++){let a=e[t];if(this.options.extensions?.renderers?.[a.type]){let l=a,o=this.options.extensions.renderers[l.type].call({parser:this},l);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(l.type)){s+=o||"";continue}}let i=a;switch(i.type){case"space":{s+=this.renderer.space(i);continue}case"hr":{s+=this.renderer.hr(i);continue}case"heading":{s+=this.renderer.heading(i);continue}case"code":{s+=this.renderer.code(i);continue}case"table":{s+=this.renderer.table(i);continue}case"blockquote":{s+=this.renderer.blockquote(i);continue}case"list":{s+=this.renderer.list(i);continue}case"html":{s+=this.renderer.html(i);continue}case"def":{s+=this.renderer.def(i);continue}case"paragraph":{s+=this.renderer.paragraph(i);continue}case"text":{let l=i,o=this.renderer.text(l);for(;t+1<e.length&&e[t+1].type==="text";)l=e[++t],o+=`
64
+ `+this.renderer.text(l);r?s+=this.renderer.paragraph({type:"paragraph",raw:o,text:o,tokens:[{type:"text",raw:o,text:o,escaped:!0}]}):s+=o;continue}default:{let l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return s}parseInline(e,r=this.renderer){let s="";for(let t=0;t<e.length;t++){let a=e[t];if(this.options.extensions?.renderers?.[a.type]){let l=this.options.extensions.renderers[a.type].call({parser:this},a);if(l!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){s+=l||"";continue}}let i=a;switch(i.type){case"escape":{s+=r.text(i);break}case"html":{s+=r.html(i);break}case"link":{s+=r.link(i);break}case"image":{s+=r.image(i);break}case"strong":{s+=r.strong(i);break}case"em":{s+=r.em(i);break}case"codespan":{s+=r.codespan(i);break}case"br":{s+=r.br(i);break}case"del":{s+=r.del(i);break}case"text":{s+=r.text(i);break}default:{let l='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(l),"";throw new Error(l)}}}return s}},A=class{static{h(this,"S")}options;block;constructor(n){this.options=n||$}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return this.block?y.lex:y.lexInline}provideParser(){return this.block?S.parse:S.parseInline}},zt=class{static{h(this,"B")}defaults=V();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=S;Renderer=j;TextRenderer=ne;Lexer=y;Tokenizer=B;Hooks=A;constructor(...n){this.use(...n)}walkTokens(n,e){let r=[];for(let s of n)switch(r=r.concat(e.call(this,s)),s.type){case"table":{let t=s;for(let a of t.header)r=r.concat(this.walkTokens(a.tokens,e));for(let a of t.rows)for(let i of a)r=r.concat(this.walkTokens(i.tokens,e));break}case"list":{let t=s;r=r.concat(this.walkTokens(t.items,e));break}default:{let t=s;this.defaults.extensions?.childTokens?.[t.type]?this.defaults.extensions.childTokens[t.type].forEach(a=>{let i=t[a].flat(1/0);r=r.concat(this.walkTokens(i,e))}):t.tokens&&(r=r.concat(this.walkTokens(t.tokens,e)))}}return r}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(r=>{let s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach(t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){let a=e.renderers[t.name];a?e.renderers[t.name]=function(...i){let l=t.renderer.apply(this,i);return l===!1&&(l=a.apply(this,i)),l}:e.renderers[t.name]=t.renderer}if("tokenizer"in t){if(!t.level||t.level!=="block"&&t.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let a=e[t.level];a?a.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&(t.level==="block"?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:t.level==="inline"&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)}),s.extensions=e),r.renderer){let t=this.defaults.renderer||new j(this.defaults);for(let a in r.renderer){if(!(a in t))throw new Error(`renderer '${a}' does not exist`);if(["options","parser"].includes(a))continue;let i=a,l=r.renderer[i],o=t[i];t[i]=(...c)=>{let p=l.apply(t,c);return p===!1&&(p=o.apply(t,c)),p||""}}s.renderer=t}if(r.tokenizer){let t=this.defaults.tokenizer||new B(this.defaults);for(let a in r.tokenizer){if(!(a in t))throw new Error(`tokenizer '${a}' does not exist`);if(["options","rules","lexer"].includes(a))continue;let i=a,l=r.tokenizer[i],o=t[i];t[i]=(...c)=>{let p=l.apply(t,c);return p===!1&&(p=o.apply(t,c)),p}}s.tokenizer=t}if(r.hooks){let t=this.defaults.hooks||new A;for(let a in r.hooks){if(!(a in t))throw new Error(`hook '${a}' does not exist`);if(["options","block"].includes(a))continue;let i=a,l=r.hooks[i],o=t[i];A.passThroughHooks.has(a)?t[i]=c=>{if(this.defaults.async&&A.passThroughHooksRespectAsync.has(a))return Promise.resolve(l.call(t,c)).then(u=>o.call(t,u));let p=l.call(t,c);return o.call(t,p)}:t[i]=(...c)=>{let p=l.apply(t,c);return p===!1&&(p=o.apply(t,c)),p}}s.hooks=t}if(r.walkTokens){let t=this.defaults.walkTokens,a=r.walkTokens;s.walkTokens=function(i){let l=[];return l.push(a.call(this,i)),t&&(l=l.concat(t.call(this,i))),l}}this.defaults={...this.defaults,...s}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return y.lex(n,e??this.defaults)}parser(n,e){return S.parse(n,e??this.defaults)}parseMarkdown(n){return(e,r)=>{let s={...r},t={...this.defaults,...s},a=this.onError(!!t.silent,!!t.async);if(this.defaults.async===!0&&s.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));t.hooks&&(t.hooks.options=t,t.hooks.block=n);let i=t.hooks?t.hooks.provideLexer():n?y.lex:y.lexInline,l=t.hooks?t.hooks.provideParser():n?S.parse:S.parseInline;if(t.async)return Promise.resolve(t.hooks?t.hooks.preprocess(e):e).then(o=>i(o,t)).then(o=>t.hooks?t.hooks.processAllTokens(o):o).then(o=>t.walkTokens?Promise.all(this.walkTokens(o,t.walkTokens)).then(()=>o):o).then(o=>l(o,t)).then(o=>t.hooks?t.hooks.postprocess(o):o).catch(a);try{t.hooks&&(e=t.hooks.preprocess(e));let o=i(e,t);t.hooks&&(o=t.hooks.processAllTokens(o)),t.walkTokens&&this.walkTokens(o,t.walkTokens);let c=l(o,t);return t.hooks&&(c=t.hooks.postprocess(c)),c}catch(o){return a(o)}}}onError(n,e){return r=>{if(r.message+=`
65
+ Please report this to https://github.com/markedjs/marked.`,n){let s="<p>An error occurred:</p><pre>"+w(r.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(r);throw r}}},T=new zt;function f(n,e){return T.parse(n,e)}h(f,"d");f.options=f.setOptions=function(n){return T.setOptions(n),f.defaults=T.defaults,we(f.defaults),f};f.getDefaults=V;f.defaults=$;f.use=function(...n){return T.use(...n),f.defaults=T.defaults,we(f.defaults),f};f.walkTokens=function(n,e){return T.walkTokens(n,e)};f.parseInline=T.parseInline;f.Parser=S;f.parser=S.parse;f.Renderer=j;f.TextRenderer=ne;f.Lexer=y;f.lexer=y.lex;f.Tokenizer=B;f.Hooks=A;f.parse=f;var Ft=f.options,Gt=f.setOptions,Ot=f.use,Zt=f.walkTokens,Ht=f.parseInline;var Nt=S.parse,Qt=y.lex;function Lt(n,{markdownAutoWrap:e}){let s=n.replace(/<br\/>/g,`
66
+ `).replace(/\n{2,}/g,`
67
+ `);return ge(s)}h(Lt,"preprocessMarkdown");function Pe(n){return n.split(/\\n|\n|<br\s*\/?>/gi).map(e=>e.trim().match(/<[^>]+>|[^\s<>]+/g)?.map(r=>({content:r,type:"normal"}))??[])}h(Pe,"nonMarkdownToLines");function Ee(n,e={}){let r=Lt(n,e),s=f.lexer(r),t=[[]],a=0;function i(l,o="normal"){l.type==="text"?l.text.split(`
68
+ `).forEach((p,u)=>{u!==0&&(a++,t.push([])),p.split(" ").forEach(d=>{d=d.replace(/&#39;/g,"'"),d&&t[a].push({content:d,type:o})})}):l.type==="strong"||l.type==="em"?l.tokens.forEach(c=>{i(c,l.type)}):l.type==="html"&&t[a].push({content:l.text,type:"normal"})}return h(i,"processNode"),s.forEach(l=>{l.type==="paragraph"?l.tokens?.forEach(o=>{i(o)}):l.type==="html"?t[a].push({content:l.text,type:"normal"}):t[a].push({content:l.raw,type:"normal"})}),t}h(Ee,"markdownToLines");function _e(n){return n?`<p>${n.replace(/\\n|\n/g,"<br />")}</p>`:""}h(_e,"nonMarkdownToHTML");function Ie(n,{markdownAutoWrap:e}={}){let r=f.lexer(n);function s(t){return t.type==="text"?e===!1?t.text.replace(/\n */g,"<br/>").replace(/ /g,"&nbsp;"):t.text.replace(/\n */g,"<br/>"):t.type==="strong"?`<strong>${t.tokens?.map(s).join("")}</strong>`:t.type==="em"?`<em>${t.tokens?.map(s).join("")}</em>`:t.type==="paragraph"?`<p>${t.tokens?.map(s).join("")}</p>`:t.type==="space"?"":t.type==="html"?`${t.text}`:t.type==="escape"?t.text:(_.warn(`Unsupported markdown: ${t.type}`),t.raw)}return h(s,"output"),r.map(s).join("")}h(Ie,"markdownToHTML");var Ce=(function(n){"use strict";var e=function(){},r=n.requestAnimationFrame||n.webkitRequestAnimationFrame||n.mozRequestAnimationFrame||n.msRequestAnimationFrame||function(c){return setTimeout(c,16)};function s(){var c=this;c.reads=[],c.writes=[],c.raf=r.bind(n),e("initialized",c)}h(s,"FastDom"),s.prototype={constructor:s,runTasks:h(function(c){e("run tasks");for(var p;p=c.shift();)p()},"runTasks"),measure:h(function(c,p){e("measure");var u=p?c.bind(p):c;return this.reads.push(u),t(this),u},"measure"),mutate:h(function(c,p){e("mutate");var u=p?c.bind(p):c;return this.writes.push(u),t(this),u},"mutate"),clear:h(function(c){return e("clear",c),i(this.reads,c)||i(this.writes,c)},"clear"),extend:h(function(c){if(e("extend",c),typeof c!="object")throw new Error("expected object");var p=Object.create(this);return l(p,c),p.fastdom=this,p.initialize&&p.initialize(),p},"extend"),catch:null};function t(c){c.scheduled||(c.scheduled=!0,c.raf(a.bind(null,c)),e("flush scheduled"))}h(t,"scheduleFlush");function a(c){e("flush");var p=c.writes,u=c.reads,d;try{e("flushing reads",u.length),c.runTasks(u),e("flushing writes",p.length),c.runTasks(p)}catch(m){d=m}if(c.scheduled=!1,(u.length||p.length)&&t(c),d)if(e("task errored",d.message),c.catch)c.catch(d);else throw d}h(a,"flush");function i(c,p){var u=c.indexOf(p);return!!~u&&!!c.splice(u,1)}h(i,"remove");function l(c,p){for(var u in p)p.hasOwnProperty(u)&&(c[u]=p[u])}h(l,"mixin");var o=n.fastdom=n.fastdom||new s;return o})(typeof window<"u"?window:globalThis);var je={initialize:h(function(){this._tasks=new Map},"initialize"),mutate:h(function(n,e){return Be(this,"mutate",n,e)},"mutate"),measure:h(function(n,e){return Be(this,"measure",n,e)},"measure"),clear:h(function(n){var e=this._tasks,r=e.get(n);this.fastdom.clear(r),e.delete(n)},"clear")};function Be(n,e,r,s){var t=n._tasks,a=n.fastdom,i,l=new Promise(function(o,c){i=a[e](function(){t.delete(l);try{o(s?r.call(s):r())}catch(p){c(p)}},s)});return t.set(l,i),l}h(Be,"create");var{initialize:cn,mutate:pn,measure:hn,clear:un}=je,qe=je;var Mt=Ce.extend({raf(n){typeof queueMicrotask=="function"?queueMicrotask(n):setTimeout(n,0)}}).extend(qe),We=Mt;function At(n){return Intl.Segmenter?[...new Intl.Segmenter().segment(n)].map(e=>e.segment):[...n]}h(At,"splitTextToChars");function Pt(n,e){let r=At(e.content);return De(n,[],r,e.type)}h(Pt,"splitWordToFitWidth");function De(n,e,r,s){if(r.length===0)return[{content:e.join(""),type:s},{content:"",type:s}];let[t,...a]=r,i=[...e,t];return n([{content:i.join(""),type:s}])?De(n,i,a,s):(e.length===0&&t&&(e.push(t),r.shift()),[{content:e.join(""),type:s},{content:r.join(""),type:s}])}h(De,"splitWordToFitWidthRecursion");function Fe(n,e){if(n.some(({content:r})=>r.includes(`
69
+ `)))throw new Error("splitLineToFitWidth does not support newlines in the line");return re(n,e)}h(Fe,"splitLineToFitWidth");function re(n,e,r=[],s=[]){if(n.length===0)return s.length>0&&r.push(s),r.length>0?r:[];let t="";n[0].content===" "&&(t=" ",n.shift());let a=n.shift()??{content:" ",type:"normal"},i=[...s];if(t!==""&&i.push({content:t,type:"normal"}),i.push(a),e(i))return re(n,e,r,i);if(s.length>0)r.push(s),n.unshift(a);else if(a.content){let[l,o]=Pt(e,a);r.push([l]),o.content&&n.unshift(o)}return re(n,e,r)}h(re,"splitLineToFitWidthRecursion");function Ge(n,e){e&&n.attr("style",e)}h(Ge,"applyStyle");var Oe=16384;async function Et(n,e,r,s,t=!1,a=ce(),i=0){let l=n.append("foreignObject");l.attr("width",`${Math.min(10*r,Oe)}px`),l.attr("height",`${Math.min(10*r,Oe)}px`);let o=l.append("xhtml:div"),c=O(e.label)?await pe(e.label.replace(he.lineBreakRegex,`
70
+ `),a):G(e.label,a),p=e.isNode?"nodeLabel":"edgeLabel",u=o.append("span");u.html(c),Ge(u,e.labelStyle),u.attr("class",`${p} ${s}`),Ge(o,e.labelStyle),o.style("display","table-cell"),o.style("white-space","nowrap"),o.style("line-height","1.5"),r!==Number.POSITIVE_INFINITY&&(o.style("max-width",r+"px"),o.style("text-align","center")),o.attr("xmlns","http://www.w3.org/1999/xhtml"),t&&o.attr("class","labelBkg");let d=await We.measure(()=>o.node().getBoundingClientRect());return d.width===r?(o.style("display","table"),o.style("white-space","break-spaces"),o.style("width",r+"px")):d.width<i&&(o.style("display","table"),o.style("width",i+"px"),o.style("text-align","center")),l.node()}h(Et,"addHtmlSpan");function se(n,e,r,s=!1){let t=n.append("tspan").attr("class","text-outer-tspan").attr("x",0).attr("y",e*r-.1+"em").attr("dy",r+"em");return s&&t.attr("text-anchor","middle"),t}h(se,"createTspan");function _t(n,e,r){let s=n.append("text"),t=se(s,1,e);ie(t,r);let a=t.node().getComputedTextLength();return s.remove(),a}h(_t,"computeWidthOfText");function Pn(n,e,r){let s=n.append("text"),t=se(s,1,e);ie(t,[{content:r,type:"normal"}]);let a=t.node()?.getBoundingClientRect();return a&&s.remove(),a}h(Pn,"computeDimensionOfText");function It(n,e,r,s=!1,t=!1){let i=e.append("g"),l=i.insert("rect").attr("class","background").attr("style","stroke: none"),o=i.append("text").attr("y","-10.1");t&&o.attr("text-anchor","middle");let c=0;for(let p of r){let u=h(m=>_t(i,1.1,m)<=n,"checkWidth"),d=u(p)?[p]:Fe(p,u);for(let m of d){let g=se(o,c,1.1,t);ie(g,m),c++}}if(s){let p=o.node().getBBox(),u=2;return l.attr("x",p.x-u).attr("y",p.y-u).attr("width",p.width+2*u).attr("height",p.height+2*u),i.node()}else return o.node()}h(It,"createFormattedText");function Ze(n){let e=/&(amp|lt|gt);/g;return n.replace(e,(r,s)=>{switch(s){case"amp":return"&";case"lt":return"<";case"gt":return">";default:return r}})}h(Ze,"decodeHTMLEntities");function ie(n,e){n.text(""),e.forEach((r,s)=>{let t=n.append("tspan").attr("font-style",r.type==="em"?"italic":"normal").attr("class","text-inner-tspan").attr("font-weight",r.type==="strong"?"bold":"normal");s===0?t.text(Ze(r.content)):t.text(" "+Ze(r.content))})}h(ie,"updateTextContentAndStyles");async function Ct(n,e={}){let r=[];n.replace(/(fa[bklrs]?):fa-([\w-]+)/g,(t,a,i)=>(r.push((async()=>{let l=`${a}:${i}`;return await ue(l)?await de(l,void 0,{class:"label-icon"}):`<i class='${G(t,e).replace(":"," ")}'></i>`})()),t));let s=await Promise.all(r);return n.replace(/(fa[bklrs]?):fa-([\w-]+)/g,()=>s.shift()??"")}h(Ct,"replaceIconSubstring");var En=h(async(n,e="",{style:r="",isTitle:s=!1,classes:t="",useHtmlLabels:a=!0,markdown:i=!0,isNode:l=!0,width:o=200,minWidth:c=0,addSvgBackground:p=!1}={},u)=>{if(_.debug("XYZ createText",e,r,s,t,a,l,"addSvgBackground: ",p),a){let d=i?Ie(e,u):_e(e),m=await Ct(Z(d),u),g=e.replace(/\\\\/g,"\\"),x={isNode:l,label:O(e)?g:m,labelStyle:r.replace("fill:","color:")};return await Et(n,x,o,t,p,u,c)}else{let d=Z(e.replace(/<br\s*\/?>/g,"<br/>")),m=i?Ee(d.replace("<br>","<br/>"),u):Pe(d),g=It(o,n,m,e?p:!1,!l);if(l){/stroke:/.exec(r)&&(r=r.replace("stroke:","lineColor:"));let x=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");R(g).attr("style",x)}else{let x=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/background:/g,"fill:");R(g).select("rect").attr("style",x.replace(/background:/g,"fill:"));let v=r.replace(/stroke:[^;]+;?/g,"").replace(/stroke-width:[^;]+;?/g,"").replace(/fill:[^;]+;?/g,"").replace(/color:/g,"fill:");R(g).select("text").attr("style",v)}return s?R(g).selectAll("tspan.text-outer-tspan").classed("title-row",!0):R(g).selectAll("tspan.text-outer-tspan").classed("row",!0),g}},"createText");export{ge as a,Ee as b,We as c,Pn as d,En as e};
@@ -0,0 +1 @@
1
+ import{a as r}from"./chunk-QVIEFLGF.mjs";function c(i,e){i.accDescr&&e.setAccDescription?.(i.accDescr),i.accTitle&&e.setAccTitle?.(i.accTitle),i.title&&e.setDiagramTitle?.(i.title)}r(c,"populateCommonDb");export{c as a};
@@ -0,0 +1 @@
1
+ import{a as R}from"./chunk-OCMJQKYE.mjs";import{a as m}from"./chunk-QVIEFLGF.mjs";var C=5,I=1e-5,B=2,G=.6,$=1e-6;function w(t){let e=[];for(let s=0;s<t.length-1;s++)e.push({a:t[s],b:t[s+1]});return e}m(w,"buildSegmentList");function J(t,e,s,c){let r=e.x-t.x,o=e.y-t.y,u=c.x-s.x,d=c.y-s.y,a=r*d-o*u;if(a===0)return null;let n=s.x-t.x,i=s.y-t.y,g=(n*d-i*u)/a,l=(n*o-i*r)/a;return g<=$||g>=1-$||l<=$||l>=1-$?null:{point:{x:t.x+g*r,y:t.y+g*o},tA:g,tB:l}}m(J,"segmentIntersection");function j(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}m(j,"isHorizontalSeg");function N(t,e,s){if(t.curve!=="rounded")return!1;let c=t.points,r=c[e],o=c[e+1];if(!r||!o)return!1;let u=Math.hypot(o.x-r.x,o.y-r.y),d=s*u,a=e>0?O(c[e-1],r,o,C):null;if(a&&d<a.cutLen)return!0;let n=e+2<c.length?O(r,o,c[e+2],C):null;return n!==null&&u-d<n.cutLen}m(N,"crossingSitsInRoundedCorner");function D(t){let e=[];for(let s=0;s<t.length;s++){let c=t[s],r=w(c.points);for(let o=s+1;o<t.length;o++){let u=t[o],d=w(u.points);for(let[a,n]of r.entries())for(let[i,g]of d.entries()){let l=J(n.a,n.b,g.a,g.b);if(!l||N(c,a,l.tA)||N(u,i,l.tB))continue;let y=j(n),M=j(g);(y!==M?y:!1)?e.push({jumpEdgeId:c.id,otherEdgeId:u.id,segIndex:a,t:l.tA,point:l.point}):e.push({jumpEdgeId:u.id,otherEdgeId:c.id,segIndex:i,t:l.tB,point:l.point})}}}return e}m(D,"findEdgeIntersections");function E(t){let e=Math.round(t*1e3)/1e3;return Number.isInteger(e)?`${e}`:`${e}`}m(E,"fmt");function P(t){return`${E(t.x)},${E(t.y)}`}m(P,"pointToString");function T(t){let e=t.b.x-t.a.x,s=t.b.y-t.a.y;return Math.abs(e)>=Math.abs(s)?e>=0?1:0:s>=0?1:0}m(T,"getArcSweepFlag");function k(t,e){if(t.length<2)return t.map(o=>({...o}));let s=t.map(o=>({...o})),c=e.arrowTypeStart&&R[e.arrowTypeStart];if(c){let o=t[0],u=t[1],d=Math.atan2(u.y-o.y,u.x-o.x);s[0].x=o.x+c*Math.cos(d),s[0].y=o.y+c*Math.sin(d)}let r=e.arrowTypeEnd&&R[e.arrowTypeEnd];if(r){let o=t.length,u=t[o-2],d=t[o-1],a=Math.atan2(d.y-u.y,d.x-u.x);s[o-1].x=d.x-r*Math.cos(a),s[o-1].y=d.y-r*Math.sin(a)}return s}m(k,"applyMarkerOffsets");function X(t,e,s,c,r){let o=t.point.x,u=t.point.y,d={x:o-e*t.r,y:u-s*t.r},a={x:o+e*t.r,y:u+s*t.r},n=[`L${P(d)}`];return r==="arc"?n.push(`A${E(t.r)},${E(t.r)} 0 0 ${c} ${P(a)}`):n.push(`M${P(a)}`),n}m(X,"emitJump");function O(t,e,s,c){let r=e.x-t.x,o=e.y-t.y,u=s.x-e.x,d=s.y-e.y,a=Math.hypot(r,o),n=Math.hypot(u,d);if(a<I||n<I)return null;let i=r/a,g=o/a,l=u/n,y=d/n,M=i*l+g*y,x=Math.max(-1,Math.min(1,M)),b=Math.acos(x);if(b<I||Math.abs(Math.PI-b)<I)return null;let p=Math.min(c/Math.sin(b/2),a/2,n/2);return{startX:e.x-i*p,startY:e.y-g*p,endX:e.x+l*p,endY:e.y+y*p,ctrlX:e.x,ctrlY:e.y,cutLen:p}}m(O,"computeRoundedCorner");function Y(t,e,s){let c=t.points;if(c.length<2)return"";let r=k(c,t),o=t.curve==="rounded",u=w(r),d=new Map;for(let n of e){let i=u[n.segIndex];if(!i)continue;let g=Math.hypot(i.b.x-i.a.x,i.b.y-i.a.y),l=d.get(n.segIndex)??[];l.push({t:n.t,point:n.point,d:n.t*g,r:s.jumpRadius}),d.set(n.segIndex,l)}let a=[`M${P(r[0])}`];for(let n=0;n<u.length;n++){let i=u[n],g=Math.hypot(i.b.x-i.a.x,i.b.y-i.a.y),l=g===0?0:(i.b.x-i.a.x)/g,y=g===0?0:(i.b.y-i.a.y)/g,M=T(i),x=0;if(o&&n>0){let f=O(r[n-1],r[n],r[n+1]??r[n],C);f&&(x=f.cutLen)}let b=g,p=null;o&&n<u.length-1&&(p=O(r[n],r[n+1],r[n+2]??r[n+1],C),p&&(b=g-p.cutLen));let L=s.jumpRadius*G,h=[...d.get(n)??[]].sort((f,S)=>f.t-S.t).filter(f=>{let S=Math.min(f.d-x,b-f.d)-B;return f.r=Math.min(f.r,S),f.r>=L});for(let f=0;f<h.length-1;f++){let S=h[f+1].d-h[f].d;if(h[f].r+h[f+1].r>S){let A=S/2;h[f].r=Math.min(h[f].r,A),h[f+1].r=Math.min(h[f+1].r,A)}}for(let f of h)f.r<L||a.push(...X(f,l,y,M,s.jumpStyle));o&&p?(a.push(`L${E(p.startX)},${E(p.startY)}`),a.push(`Q${E(p.ctrlX)},${E(p.ctrlY)} ${E(p.endX)},${E(p.endY)}`)):a.push(`L${P(i.b)}`)}return a.join(" ")}m(Y,"rewriteEdgePath");function _(t){return/^[\d\s+,.LMelm-]*$/.test(t)}m(_,"isStraightPath");function U(t){return t?t==="linear"||t==="rounded"||t==="step"||t==="stepBefore"||t==="stepAfter":!0}m(U,"curveSupportsLineHops");function v(t){if(!t)return null;try{let e=typeof atob=="function"?atob(t):Buffer.from(t,"base64").toString(),s=JSON.parse(e);if(!Array.isArray(s))return null;let c=[];for(let r of s)r&&typeof r.x=="number"&&typeof r.y=="number"&&c.push({x:r.x,y:r.y});return c.length>=2?c:null}catch{return null}}m(v,"decodeDataPoints");function V(t,e,s){if(!s.enabled)return;let c=t.node();if(!c)return;let r=new Map;for(let n of e)r.set(n.id,n);let o=new Map;for(let n of c.querySelectorAll("path[data-id]")){let i=n.getAttribute("data-id");i!==null&&!o.has(i)&&o.set(i,n)}let u=[];for(let n of e){let i=o.get(n.id);if(!i)continue;let l=v(i.getAttribute("data-points"))??n.points;u.push({...n,points:l})}let d=D(u);if(d.length===0)return;let a=new Map;for(let n of d){let i=a.get(n.jumpEdgeId)??[];i.push(n),a.set(n.jumpEdgeId,i)}for(let n of u){let i=a.get(n.id);if(!i||i.length===0)continue;let l=r.get(n.id)?.curve;if(l!==void 0&&!U(l))continue;let y=o.get(n.id);if(!y)continue;if(l===void 0){let h=y.getAttribute("d")??"";if(!_(h))continue}let M=y.getAttribute("style")??"",x=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(M),b=x?Number.parseFloat(x[1]):null,p=x?Number.parseFloat(x[2]):null,L=Y(n,i,s);if(y.setAttribute("d",L),b!==null&&p!==null&&typeof y.getTotalLength=="function"){let h=y.getTotalLength(),f=Math.max(0,h-b-p),S=`0 ${b} ${f} ${p}`,A=M.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${S};`).replace(/;\s*;+/g,";");y.setAttribute("style",A)}}}m(V,"applyLineJumpsToSvg");export{V as a};
@@ -0,0 +1,88 @@
1
+ import{a as Y}from"./chunk-S4TE5DX6.mjs";import{$ as _,B,P as W,T as P,h as I,u as v}from"./chunk-FE53TMRB.mjs";import{b as R}from"./chunk-L2B47AAZ.mjs";import{a as c}from"./chunk-QVIEFLGF.mjs";var z="",G="",D="",O=[],$=new Map,w=c(e=>B(e,_()),"sanitizeText"),b=c(e=>{switch(e.type){case"terminal":return{...e,value:w(e.value)};case"nonterminal":return{...e,name:w(e.name)};case"sequence":return{...e,elements:e.elements.map(b)};case"choice":return{...e,alternatives:e.alternatives.map(b)};case"optional":return{...e,element:b(e.element)};case"repetition":return{...e,element:b(e.element),separator:e.separator?b(e.separator):void 0};case"special":return{...e,text:w(e.text)}}},"sanitizeAstNode"),K=c(()=>{z="",G="",D="",O.length=0,$.clear(),P(),R.debug("[Railroad] Database cleared")},"clear"),q=c(e=>{z=w(e),R.debug("[Railroad] Title set:",e)},"setTitle"),L=c(()=>z,"getTitle"),J=c(e=>{let i={...e,name:w(e.name),definition:b(e.definition),comment:e.comment?w(e.comment):void 0};R.debug("[Railroad] Adding rule:",i.name),$.has(i.name)&&R.warn(`[Railroad] Rule '${i.name}' is already defined. Overwriting.`),O.push(i),$.set(i.name,i)},"addRule"),Q=c(()=>O,"getRules"),Z=c(e=>$.get(e),"getRule"),ee=c(e=>{G=w(e).replace(/^\s+/g,""),R.debug("[Railroad] Accessibility title set:",e)},"setAccTitle"),te=c(()=>G,"getAccTitle"),re=c(e=>{D=w(e).replace(/\n\s+/g,`
2
+ `),R.debug("[Railroad] Accessibility description set:",e)},"setAccDescription"),ie=c(()=>D,"getAccDescription"),ne=q,oe=L,V={clear:K,setTitle:q,getTitle:L,addRule:J,getRules:Q,getRule:Z,setAccTitle:ee,getAccTitle:te,setAccDescription:re,getAccDescription:ie,setDiagramTitle:ne,getDiagramTitle:oe};var f={compactMode:!1,padding:10,verticalSeparation:8,horizontalSeparation:10,arcRadius:10,fontSize:14,fontFamily:"monospace",terminalFill:"#FFFFC0",terminalStroke:"#000000",terminalTextColor:"#000000",nonTerminalFill:"#FFFFFF",nonTerminalStroke:"#000000",nonTerminalTextColor:"#000000",lineColor:"#000000",strokeWidth:2,markerFill:"#000000",commentFill:"#E8E8E8",commentStroke:"#888888",commentTextColor:"#666666",specialFill:"#F0E0FF",specialStroke:"#8800CC",ruleNameColor:"#000066",showMarkers:!0,markerRadius:5};var ae=/^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$|^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch)\([\d\s%+,./-]+\)$|^[a-z]+$/i,le=/^[\w "',.-]+$/,se=new Set(["compactMode","padding","verticalSeparation","horizontalSeparation","arcRadius","fontSize","fontFamily","terminalFill","terminalStroke","terminalTextColor","nonTerminalFill","nonTerminalStroke","nonTerminalTextColor","lineColor","strokeWidth","markerFill","commentFill","commentStroke","commentTextColor","specialFill","specialStroke","ruleNameColor","showMarkers","markerRadius"]),X=c(e=>e?Object.keys(e).every(i=>i==="railroad"||se.has(i)):!1,"isRailroadStyleOptions"),de=c(e=>e?"railroad"in e&&e.railroad?e.railroad:X(e)?e:{}:{},"extractRailroadOverrides"),me=c(e=>{if(!e||X(e))return{};let{railroad:i,svgId:o,theme:n,look:t,...r}=e;return r},"extractThemeOverrides"),p=c((e,i)=>{if(typeof e!="string")return i;let o=e.trim();return ae.test(o)?o:i},"sanitizeColorValue"),j=c((e,i)=>{if(typeof e!="string")return i;let o=e.trim();return le.test(o)?o:i},"sanitizeFontFamilyValue"),C=c((e,i)=>{let o=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(o)&&o>=0?o:i},"sanitizeNumberValue"),ce=c(e=>{let i=typeof e=="number"?e:typeof e=="string"?Number.parseFloat(e):Number.NaN;return Number.isFinite(i)&&i>0?i:void 0},"parseThemeFontSize"),pe=c(e=>{let i=j(e.fontFamily,f.fontFamily),o=ce(e.fontSize)??f.fontSize;return{...f,fontFamily:i,fontSize:o,terminalFill:p(e.secondBkg??e.secondaryColor,f.terminalFill),terminalStroke:p(e.secondaryBorderColor??e.lineColor,f.terminalStroke),terminalTextColor:p(e.secondaryTextColor??e.textColor,f.terminalTextColor),nonTerminalFill:p(e.mainBkg??e.background,f.nonTerminalFill),nonTerminalStroke:p(e.primaryBorderColor??e.lineColor,f.nonTerminalStroke),nonTerminalTextColor:p(e.primaryTextColor??e.textColor,f.nonTerminalTextColor),lineColor:p(e.lineColor,f.lineColor),markerFill:p(e.lineColor,f.markerFill),commentFill:p(e.labelBackground??e.tertiaryColor,f.commentFill),commentStroke:p(e.tertiaryBorderColor??e.lineColor,f.commentStroke),commentTextColor:p(e.tertiaryTextColor??e.textColor,f.commentTextColor),specialFill:p(e.tertiaryColor??e.secondaryColor,f.specialFill),specialStroke:p(e.tertiaryBorderColor??e.secondaryBorderColor,f.specialStroke),ruleNameColor:p(e.titleColor??e.textColor,f.ruleNameColor)}},"buildThemeDefaults"),N=c(e=>{let i=v(),o={...I(),...i.themeVariables??{},...me(e)},n=pe(o),t={...i.railroad??{},...de(e)};return{compactMode:t.compactMode??n.compactMode,padding:C(t.padding,n.padding),verticalSeparation:C(t.verticalSeparation,n.verticalSeparation),horizontalSeparation:C(t.horizontalSeparation,n.horizontalSeparation),arcRadius:C(t.arcRadius,n.arcRadius),fontSize:C(t.fontSize,n.fontSize),fontFamily:j(t.fontFamily,n.fontFamily),terminalFill:p(t.terminalFill,n.terminalFill),terminalStroke:p(t.terminalStroke,n.terminalStroke),terminalTextColor:p(t.terminalTextColor,n.terminalTextColor),nonTerminalFill:p(t.nonTerminalFill,n.nonTerminalFill),nonTerminalStroke:p(t.nonTerminalStroke,n.nonTerminalStroke),nonTerminalTextColor:p(t.nonTerminalTextColor,n.nonTerminalTextColor),lineColor:p(t.lineColor,n.lineColor),strokeWidth:C(t.strokeWidth,n.strokeWidth),markerFill:p(t.markerFill,n.markerFill),commentFill:p(t.commentFill,n.commentFill),commentStroke:p(t.commentStroke,n.commentStroke),commentTextColor:p(t.commentTextColor,n.commentTextColor),specialFill:p(t.specialFill,n.specialFill),specialStroke:p(t.specialStroke,n.specialStroke),ruleNameColor:p(t.ruleNameColor,n.ruleNameColor),showMarkers:t.showMarkers??n.showMarkers,markerRadius:C(t.markerRadius,n.markerRadius)}},"buildRailroadStyleOptions"),Ce=c(e=>{let{fontFamily:i,fontSize:o,terminalFill:n,terminalStroke:t,terminalTextColor:r,nonTerminalFill:a,nonTerminalStroke:g,nonTerminalTextColor:l,lineColor:s,strokeWidth:u,markerFill:h,commentFill:m,commentStroke:x,commentTextColor:d,specialFill:T,specialStroke:F,ruleNameColor:k}=N(e);return`
3
+ .railroad-diagram {
4
+ font-family: ${i};
5
+ font-size: ${o}px;
6
+ }
7
+
8
+ .railroad-terminal rect {
9
+ fill: ${n};
10
+ stroke: ${t};
11
+ stroke-width: ${u}px;
12
+ }
13
+
14
+ .railroad-terminal text {
15
+ fill: ${r};
16
+ font-family: ${i};
17
+ font-size: ${o}px;
18
+ text-anchor: middle;
19
+ dominant-baseline: middle;
20
+ }
21
+
22
+ .railroad-nonterminal rect {
23
+ fill: ${a};
24
+ stroke: ${g};
25
+ stroke-width: ${u}px;
26
+ }
27
+
28
+ .railroad-nonterminal text {
29
+ fill: ${l};
30
+ font-family: ${i};
31
+ font-size: ${o}px;
32
+ text-anchor: middle;
33
+ dominant-baseline: middle;
34
+ }
35
+
36
+ .railroad-line {
37
+ stroke: ${s};
38
+ stroke-width: ${u}px;
39
+ fill: none;
40
+ }
41
+
42
+ .railroad-start circle,
43
+ .railroad-end circle {
44
+ fill: ${h};
45
+ }
46
+
47
+ .railroad-comment ellipse {
48
+ fill: ${m};
49
+ stroke: ${x};
50
+ stroke-width: ${u}px;
51
+ }
52
+
53
+ .railroad-comment text {
54
+ fill: ${d};
55
+ font-style: italic;
56
+ font-family: ${i};
57
+ font-size: ${o}px;
58
+ text-anchor: middle;
59
+ dominant-baseline: middle;
60
+ }
61
+
62
+ .railroad-special rect {
63
+ fill: ${T};
64
+ stroke: ${F};
65
+ stroke-width: ${u}px;
66
+ stroke-dasharray: 5,3;
67
+ }
68
+
69
+ .railroad-special text {
70
+ fill: ${l};
71
+ font-family: ${i};
72
+ font-size: ${o}px;
73
+ text-anchor: middle;
74
+ dominant-baseline: middle;
75
+ }
76
+
77
+ .railroad-rule-name {
78
+ font-weight: bold;
79
+ fill: ${k};
80
+ font-family: ${i};
81
+ font-size: ${o}px;
82
+ }
83
+
84
+ .railroad-group {
85
+ /* Grouping container, no specific styles */
86
+ }
87
+ `},"getStyles");var S=class{constructor(){this.d=""}static{c(this,"PathBuilder")}moveTo(i,o){return this.d+=`M ${i} ${o} `,this}lineTo(i,o){return this.d+=`L ${i} ${o} `,this}horizontalTo(i){return this.d+=`H ${i} `,this}verticalTo(i){return this.d+=`V ${i} `,this}arcTo(i,o,n,t,r,a,g){return this.d+=`A ${i} ${o} ${n} ${t?1:0} ${r?1:0} ${a} ${g} `,this}build(){return this.d.trim()}},M=class{constructor(i,o=N()){this.textCache=new Map;this.svg=i,this.config=o}static{c(this,"RailroadRenderer")}measureText(i){if(this.textCache.has(i))return this.textCache.get(i);let o=this.svg.append("text").attr("font-family",this.config.fontFamily).attr("font-size",this.config.fontSize).text(i),n=o.node().getBBox(),t={width:n.width,height:n.height};return o.remove(),this.textCache.set(i,t),t}renderTerminal(i,o){let n=this.measureText(o),t=n.width+this.config.padding*2,r=n.height+this.config.padding*2,a=i.append("g").attr("class","railroad-terminal");return a.append("rect").attr("x",0).attr("y",0).attr("width",t).attr("height",r).attr("rx",10).attr("ry",10),a.append("text").attr("x",t/2).attr("y",r/2).text(o),{element:a.node(),dimensions:{width:t,height:r,up:r/2,down:r/2}}}renderNonTerminal(i,o){let n=this.measureText(o),t=n.width+this.config.padding*2,r=n.height+this.config.padding*2,a=i.append("g").attr("class","railroad-nonterminal");return a.append("rect").attr("x",0).attr("y",0).attr("width",t).attr("height",r),a.append("text").attr("x",t/2).attr("y",r/2).text(o),{element:a.node(),dimensions:{width:t,height:r,up:r/2,down:r/2}}}renderSequence(i,o){let n=o.map(s=>this.renderExpression(i,s)),t=0,r=0,a=0;for(let s of n)t+=s.dimensions.width,r=Math.max(r,s.dimensions.up),a=Math.max(a,s.dimensions.down);t+=(n.length-1)*this.config.horizontalSeparation;let g=i.append("g").attr("class","railroad-sequence"),l=0;for(let s=0;s<n.length;s++){let u=n[s],h=r-u.dimensions.up;if(g.node().appendChild(u.element).setAttribute("transform",`translate(${l}, ${h})`),s<n.length-1){let x=l+u.dimensions.width,d=x+this.config.horizontalSeparation,T=r;g.append("path").attr("class","railroad-line").attr("d",new S().moveTo(x,T).lineTo(d,T).build())}l+=u.dimensions.width+this.config.horizontalSeparation}return{element:g.node(),dimensions:{width:t,height:r+a,up:r,down:a}}}renderChoice(i,o){let n=o.map(m=>this.renderExpression(i,m)),t=0,r=0;for(let m of n)t=Math.max(t,m.dimensions.width),r+=m.dimensions.height;r+=(n.length-1)*this.config.verticalSeparation;let a=this.config.arcRadius,g=a*4,l=t+g,s=i.append("g").attr("class","railroad-choice"),u=0,h=r/2;for(let m of n){let x=u,d=x+m.dimensions.up,T=a*2+(t-m.dimensions.width)/2;s.node().appendChild(m.element).setAttribute("transform",`translate(${T}, ${x})`);let k=new S,y=d>h;d===h?k.moveTo(0,h).lineTo(T,d):k.moveTo(0,h).arcTo(a,a,0,!1,y,a,h+(y?a:-a)).lineTo(a,d-(y?a:-a)).arcTo(a,a,0,!1,!y,a*2,d).lineTo(T,d),s.append("path").attr("class","railroad-line").attr("d",k.build());let A=new S,E=T+m.dimensions.width,U=l-a*2;d===h?A.moveTo(E,d).lineTo(l,h):A.moveTo(E,d).lineTo(U,d).arcTo(a,a,0,!1,!y,l-a,d+(y?-a:a)).lineTo(l-a,h+(y?a:-a)).arcTo(a,a,0,!1,y,l,h),s.append("path").attr("class","railroad-line").attr("d",A.build()),u+=m.dimensions.height+this.config.verticalSeparation}return{element:s.node(),dimensions:{width:l,height:r,up:h,down:r-h}}}renderOptional(i,o){let n=this.renderExpression(i,o),t=this.config.arcRadius,r=t*2,a=n.dimensions.width+t*4,g=n.dimensions.height+r,l=i.append("g").attr("class","railroad-optional"),s=t*2,u=r;l.node().appendChild(n.element).setAttribute("transform",`translate(${s}, ${u})`);let m=u+n.dimensions.up,x=new S().moveTo(0,m).lineTo(t*2,m);l.append("path").attr("class","railroad-line").attr("d",x.build());let d=new S().moveTo(s+n.dimensions.width,m).lineTo(a,m);l.append("path").attr("class","railroad-line").attr("d",d.build());let T=new S().moveTo(0,m).arcTo(t,t,0,!1,!1,t,m-t).lineTo(t,t).arcTo(t,t,0,!1,!0,t*2,0).lineTo(a-t*2,0).arcTo(t,t,0,!1,!0,a-t,t).lineTo(a-t,m-t).arcTo(t,t,0,!1,!1,a,m);return l.append("path").attr("class","railroad-line").attr("d",T.build()),{element:l.node(),dimensions:{width:a,height:g,up:m,down:g-m}}}renderRepetition(i,o,n){let t=this.renderExpression(i,o),r=this.config.arcRadius,a=r*2,g=t.dimensions.width+r*4,l=n===0,s=t.dimensions.height+a+(l?a:0),u=i.append("g").attr("class","railroad-repetition"),h=r*2,m=l?a:0;u.node().appendChild(t.element).setAttribute("transform",`translate(${h}, ${m})`);let d=m+t.dimensions.up;u.append("path").attr("class","railroad-line").attr("d",new S().moveTo(0,d).lineTo(r*2,d).build()),u.append("path").attr("class","railroad-line").attr("d",new S().moveTo(h+t.dimensions.width,d).lineTo(g,d).build());let T=m+t.dimensions.height+r,F=new S().moveTo(h+t.dimensions.width,d).arcTo(r,r,0,!1,!0,h+t.dimensions.width+r,d+r).lineTo(h+t.dimensions.width+r,T).arcTo(r,r,0,!1,!0,h+t.dimensions.width,T+r).lineTo(r*2,T+r).arcTo(r,r,0,!1,!0,r,T).lineTo(r,d+r).arcTo(r,r,0,!1,!0,r*2,d);if(u.append("path").attr("class","railroad-line").attr("d",F.build()),l){let k=new S().moveTo(0,d).arcTo(r,r,0,!1,!1,r,d-r).lineTo(r,r).arcTo(r,r,0,!1,!0,r*2,0).lineTo(g-r*2,0).arcTo(r,r,0,!1,!0,g-r,r).lineTo(g-r,d-r).arcTo(r,r,0,!1,!1,g,d);u.append("path").attr("class","railroad-line").attr("d",k.build())}return{element:u.node(),dimensions:{width:g,height:s,up:d,down:s-d}}}renderSpecial(i,o){let n=this.measureText("? "+o+" ?"),t=n.width+this.config.padding*2,r=n.height+this.config.padding*2,a=i.append("g").attr("class","railroad-special");return a.append("rect").attr("x",0).attr("y",0).attr("width",t).attr("height",r),a.append("text").attr("x",t/2).attr("y",r/2).text("? "+o+" ?"),{element:a.node(),dimensions:{width:t,height:r,up:r/2,down:r/2}}}renderExpression(i,o){switch(o.type){case"terminal":return this.renderTerminal(i,o.value);case"nonterminal":return this.renderNonTerminal(i,o.name);case"sequence":return this.renderSequence(i,o.elements);case"choice":return this.renderChoice(i,o.alternatives);case"optional":return this.renderOptional(i,o.element);case"repetition":return this.renderRepetition(i,o.element,o.min);case"special":return this.renderSpecial(i,o.text);default:throw new Error(`Unknown node type: ${o.type}`)}}renderRule(i,o){let n=this.svg.append("g").attr("class","railroad-rule").attr("transform",`translate(0, ${o})`),t=i.name+" =",r=this.measureText(t).width+20,a=r+20,g=n.append("g"),l=this.renderExpression(g,i.definition),s=Math.max(20,l.dimensions.up),u=s-l.dimensions.up;return g.attr("transform",`translate(${a}, ${u})`),n.append("g").attr("class","railroad-rule-name-group").append("text").attr("class","railroad-rule-name").attr("x",0).attr("y",s).text(t),n.append("g").attr("class","railroad-start").append("circle").attr("cx",r).attr("cy",s).attr("r",this.config.markerRadius),n.append("g").attr("class","railroad-end").append("circle").attr("cx",a+l.dimensions.width+10).attr("cy",s).attr("r",this.config.markerRadius),n.append("path").attr("class","railroad-line").attr("d",new S().moveTo(r+this.config.markerRadius,s).lineTo(a,s).build()),n.append("path").attr("class","railroad-line").attr("d",new S().moveTo(a+l.dimensions.width,s).lineTo(a+l.dimensions.width+10-this.config.markerRadius,s).build()),{height:Math.max(40,u+l.dimensions.height+this.config.padding*2),width:a+l.dimensions.width+10+this.config.markerRadius}}renderDiagram(i){let o=this.config.padding,n=0;for(let t of i){let r=this.renderRule(t,o);o+=r.height+this.config.verticalSeparation,n=Math.max(n,r.width)}return{width:n+this.config.padding*2,height:o+this.config.padding}}},H=c((e,i,o)=>{W(e,i.height,i.width,o),e.attr("viewBox",`0 0 ${i.width} ${i.height}`)},"configureRailroadSvgSize"),ue=c((e,i,o)=>{R.debug(`[Railroad] Rendering diagram
88
+ `+e);try{let n=Y(i);n.attr("class","railroad-diagram");let r=v().railroad?.useMaxWidth??!0,a=V.getRules();if(R.debug(`[Railroad] Rendering ${a.length} rules`),a.length===0){R.warn("[Railroad] No rules to render"),H(n,{height:100,width:200},r);return}let l=new M(n,N()).renderDiagram(a);H(n,l,r),R.debug("[Railroad] Render complete")}catch(n){throw R.error("[Railroad] Render error:",n),n}},"draw"),De={draw:ue};export{V as a,Ce as b,De as c};
@@ -0,0 +1,3 @@
1
+ import{a}from"./chunk-44AU3KAP.mjs";import{a as c}from"./chunk-QVIEFLGF.mjs";var i={},d={info:a(async()=>{let{createInfoServices:e}=await import("./info-A6RAGUB7-IGBHH2L7.mjs"),r=e().Info.parser.LangiumParser;i.info=r},"info"),packet:a(async()=>{let{createPacketServices:e}=await import("./packet-AYTQ26CC-PJTKDECJ.mjs"),r=e().Packet.parser.LangiumParser;i.packet=r},"packet"),pie:a(async()=>{let{createPieServices:e}=await import("./pie-WAS4IAKB-U3JFQXZN.mjs"),r=e().Pie.parser.LangiumParser;i.pie=r},"pie"),treeView:a(async()=>{let{createTreeViewServices:e}=await import("./treeView-Q6P3EWNA-AABPVERA.mjs"),r=e().TreeView.parser.LangiumParser;i.treeView=r},"treeView"),architecture:a(async()=>{let{createArchitectureServices:e}=await import("./architecture-7GRP2DOG-HF4J73XS.mjs"),r=e().Architecture.parser.LangiumParser;i.architecture=r},"architecture"),gitGraph:a(async()=>{let{createGitGraphServices:e}=await import("./gitGraph-4MIJSDKK-V5NEQQYP.mjs"),r=e().GitGraph.parser.LangiumParser;i.gitGraph=r},"gitGraph"),eventmodeling:a(async()=>{let{createEventModelingServices:e}=await import("./eventmodeling-NTZA5JFV-P5QJSWSK.mjs"),r=e().EventModel.parser.LangiumParser;i.eventmodeling=r},"eventmodeling"),radar:a(async()=>{let{createRadarServices:e}=await import("./radar-RG4KPBEZ-7T2UW32D.mjs"),r=e().Radar.parser.LangiumParser;i.radar=r},"radar"),railroad:a(async()=>{let{createRailroadServices:e}=await import("./railroad-74A4TZTK-DZY7ARDL.mjs"),r=e().Railroad.parser.LangiumParser;i.railroad=r},"railroad"),railroadEbnf:a(async()=>{let{createRailroadEbnfServices:e}=await import("./railroad-ebnf-LZEXJU2U-EA3S4ZFM.mjs"),r=e().RailroadEbnf.parser.LangiumParser;i.railroadEbnf=r},"railroadEbnf"),railroadAbnf:a(async()=>{let{createRailroadAbnfServices:e}=await import("./railroad-abnf-HS5TGJTU-LWS535ZK.mjs"),r=e().RailroadAbnf.parser.LangiumParser;i.railroadAbnf=r},"railroadAbnf"),railroadPeg:a(async()=>{let{createRailroadPegServices:e}=await import("./railroad-peg-WCYAUIDC-DUKZONPX.mjs"),r=e().RailroadPeg.parser.LangiumParser;i.railroadPeg=r},"railroadPeg"),treemap:a(async()=>{let{createTreemapServices:e}=await import("./treemap-WGGIJYW6-F2JSY3V3.mjs"),r=e().Treemap.parser.LangiumParser;i.treemap=r},"treemap"),wardley:a(async()=>{let{createWardleyServices:e}=await import("./wardley-WFR3VGLG-EIT5NWVN.mjs"),r=e().Wardley.parser.LangiumParser;i.wardley=r},"wardley"),cynefin:a(async()=>{let{createCynefinServices:e}=await import("./cynefin-OW5HDTMX-KMPDV6GS.mjs"),r=e().Cynefin.parser.LangiumParser;i.cynefin=r},"cynefin")};async function l(e,r){let n=d[e];if(!n)throw new Error(`Unknown diagram type: ${e}`);i[e]||await n();let t=i[e].parse(r);if(t.lexerErrors.length>0||t.parserErrors.length>0)throw new m(t);return t.value}c(l,"parse");a(l,"parse");var m=class extends Error{static{c(this,"MermaidParseError")}constructor(e){let r=e.lexerErrors.map(o=>{let t=o.line!==void 0&&!isNaN(o.line)?o.line:"?",s=o.column!==void 0&&!isNaN(o.column)?o.column:"?";return`Lexer error on line ${t}, column ${s}: ${o.message}`}).join(`
2
+ `),n=e.parserErrors.map(o=>{let t=o.token.startLine!==void 0&&!isNaN(o.token.startLine)?o.token.startLine:"?",s=o.token.startColumn!==void 0&&!isNaN(o.token.startColumn)?o.token.startColumn:"?";return`Parse error on line ${t}, column ${s}: ${o.message}`}).join(`
3
+ `);super(`Parsing failed: ${r} ${n}`),this.result=e}static{a(this,"MermaidParseError")}};export{l as a,m as b};
@@ -0,0 +1 @@
1
+ import{a as e,b as o,c as n,d as a,e as u,g as d,k as l,x as s,y as G}from"./chunk-44AU3KAP.mjs";import{a as t}from"./chunk-QVIEFLGF.mjs";var p=class extends G{static{t(this,"GitGraphTokenBuilder")}static{e(this,"GitGraphTokenBuilder")}constructor(){super(["gitGraph"])}},h={parser:{TokenBuilder:e(()=>new p,"TokenBuilder"),ValueConverter:e(()=>new s,"ValueConverter")}};function m(c=u){let r=a(n(c),d),i=a(o({shared:r}),l,h);return r.ServiceRegistry.register(i),{shared:r,GitGraph:i}}t(m,"createGitGraphServices");e(m,"createGitGraphServices");export{h as a,m as b};
@@ -0,0 +1 @@
1
+ import{a as n,c as R}from"./chunk-QVIEFLGF.mjs";var g=R(e=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.BLANK_URL=e.relativeFirstCharacters=e.whitespaceEscapeCharsRegex=e.urlSchemeRegex=e.ctrlCharactersRegex=e.htmlCtrlEntityRegex=e.htmlEntitiesRegex=e.invalidProtocolRegex=void 0;e.invalidProtocolRegex=/^([^\w]*)(javascript|data|vbscript)/im;e.htmlEntitiesRegex=/&#(\w+)(^\w|;)?/g;e.htmlCtrlEntityRegex=/&(newline|tab);/gi;e.ctrlCharactersRegex=/[\u0000-\u001F\u007F-\u009F\u2000-\u200D\uFEFF]/gim;e.urlSchemeRegex=/^.+(:|&colon;)/gim;e.whitespaceEscapeCharsRegex=/(\\|%5[cC])((%(6[eE]|72|74))|[nrt])/g;e.relativeFirstCharacters=[".","/"];e.BLANK_URL="about:blank"});var f=R(h=>{"use strict";Object.defineProperty(h,"__esModule",{value:!0});h.sanitizeUrl=v;var t=g();function x(r){return t.relativeFirstCharacters.indexOf(r[0])>-1}n(x,"isRelativeUrlWithoutProtocol");function C(r){var c=r.replace(t.ctrlCharactersRegex,"");return c.replace(t.htmlEntitiesRegex,function(a,i){return String.fromCharCode(i)})}n(C,"decodeHtmlCharacters");function p(r){return URL.canParse(r)}n(p,"isValidUrl");function d(r){try{return decodeURIComponent(r)}catch{return r}}n(d,"decodeURI");function v(r){if(!r)return t.BLANK_URL;var c,a=d(r.trim());do a=C(a).replace(t.htmlCtrlEntityRegex,"").replace(t.ctrlCharactersRegex,"").replace(t.whitespaceEscapeCharsRegex,"").trim(),a=d(a),c=a.match(t.ctrlCharactersRegex)||a.match(t.htmlEntitiesRegex)||a.match(t.htmlCtrlEntityRegex)||a.match(t.whitespaceEscapeCharsRegex);while(c&&c.length>0);var i=a;if(!i)return t.BLANK_URL;if(x(i))return i;var u=i.trimStart(),m=u.match(t.urlSchemeRegex);if(!m)return i;var l=m[0].toLowerCase().trim();if(t.invalidProtocolRegex.test(l))return t.BLANK_URL;var s=u.replace(/\\/g,"/");if(l==="mailto:"||l.includes("://"))return s;if(l==="http:"||l==="https:"){if(!p(s))return t.BLANK_URL;var o=new URL(s);return o.protocol=o.protocol.toLowerCase(),o.hostname=o.hostname.toLowerCase(),o.toString()}return s}n(v,"sanitizeUrl")});export{f as a};