preview-artifact 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (285) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +190 -0
  3. package/bin/preview-artifact.js +125 -0
  4. package/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  5. package/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  6. package/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  7. package/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  8. package/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  9. package/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  10. package/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  11. package/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  12. package/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  13. package/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  14. package/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  15. package/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  16. package/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  17. package/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  18. package/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  19. package/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  20. package/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  21. package/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  22. package/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  23. package/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  24. package/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  25. package/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  26. package/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  27. package/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  28. package/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  29. package/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  30. package/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  31. package/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  32. package/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  33. package/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  34. package/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  35. package/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  36. package/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  37. package/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  38. package/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  39. package/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  40. package/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  41. package/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  42. package/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  43. package/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  44. package/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  45. package/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  46. package/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  47. package/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  48. package/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  49. package/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  50. package/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  51. package/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  52. package/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  53. package/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  54. package/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  55. package/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  56. package/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  57. package/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  58. package/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  59. package/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  60. package/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  61. package/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  62. package/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  63. package/dist/assets/apl-CnwPGSsG.js +1 -0
  64. package/dist/assets/arc-CJ3_-PAT.js +1 -0
  65. package/dist/assets/architecture-7EHR7CIX-Z0xF5NqR.js +1 -0
  66. package/dist/assets/architectureDiagram-3BPJPVTR--rREWXNq.js +36 -0
  67. package/dist/assets/asciiarmor-qTkVPQu6.js +1 -0
  68. package/dist/assets/asn1-Dr8qZg38.js +1 -0
  69. package/dist/assets/asterisk-Bja0s6e1.js +1 -0
  70. package/dist/assets/blockDiagram-GPEHLZMM-BV1c1Mfq.js +132 -0
  71. package/dist/assets/brainfuck-D5EjA2JK.js +1 -0
  72. package/dist/assets/c4Diagram-AAUBKEIU-Bc6XHTqW.js +10 -0
  73. package/dist/assets/channel-Bj7QtUIY.js +1 -0
  74. package/dist/assets/chunk-2J33WTMH-eTp7ioqm.js +1 -0
  75. package/dist/assets/chunk-4BX2VUAB-DeAmcro3.js +1 -0
  76. package/dist/assets/chunk-55IACEB6-fvzFs169.js +1 -0
  77. package/dist/assets/chunk-727SXJPM-BWnGyv0z.js +206 -0
  78. package/dist/assets/chunk-AQP2D5EJ-DpWR_SeI.js +231 -0
  79. package/dist/assets/chunk-FMBD7UC4-DMyBW8iC.js +15 -0
  80. package/dist/assets/chunk-ND2GUHAM-BWO3mIks.js +1 -0
  81. package/dist/assets/chunk-QZHKN3VN-BZ-TNixB.js +1 -0
  82. package/dist/assets/classDiagram-4FO5ZUOK-DfFXNbKt.js +1 -0
  83. package/dist/assets/classDiagram-v2-Q7XG4LA2-DfFXNbKt.js +1 -0
  84. package/dist/assets/clike-DHH8Ad3s.js +1 -0
  85. package/dist/assets/clojure-BflJGmDX.js +1 -0
  86. package/dist/assets/cmake-CyVbuzPu.js +1 -0
  87. package/dist/assets/cobol-B_OZ4V-R.js +1 -0
  88. package/dist/assets/coffeescript-B2pKbFk8.js +1 -0
  89. package/dist/assets/commonlisp-CcllspGY.js +1 -0
  90. package/dist/assets/cose-bilkent-S5V4N54A-C0oZ9Wdh.js +1 -0
  91. package/dist/assets/crystal-M5-qzICs.js +1 -0
  92. package/dist/assets/css-CYpP4FRV.js +1 -0
  93. package/dist/assets/cypher-p9eYesGn.js +1 -0
  94. package/dist/assets/cytoscape.esm-FqbQrHcz.js +321 -0
  95. package/dist/assets/d-BhMjBjQP.js +1 -0
  96. package/dist/assets/dagre-BM42HDAG-8yabnAvH.js +4 -0
  97. package/dist/assets/dagre-DjzBNxbY.js +1 -0
  98. package/dist/assets/defaultLocale-C8Fc0cco.js +1 -0
  99. package/dist/assets/diagram-2AECGRRQ-8ounJ_ea.js +43 -0
  100. package/dist/assets/diagram-5GNKFQAL-Dis8fSWn.js +10 -0
  101. package/dist/assets/diagram-KO2AKTUF-C6EHdpm4.js +3 -0
  102. package/dist/assets/diagram-LMA3HP47-DNFfc6f_.js +24 -0
  103. package/dist/assets/diagram-OG6HWLK6-T3xi-usC.js +24 -0
  104. package/dist/assets/diff-ChtP43wD.js +1 -0
  105. package/dist/assets/dist-3LHbYvzB.js +1 -0
  106. package/dist/assets/dist-BBZDeMcg.js +1 -0
  107. package/dist/assets/dist-BQ3j-7m-.js +6 -0
  108. package/dist/assets/dist-BaQ073UB.js +1 -0
  109. package/dist/assets/dist-Bat5IVRd.js +1 -0
  110. package/dist/assets/dist-BzXJV1j0.js +23 -0
  111. package/dist/assets/dist-C4F0WDhe.js +1 -0
  112. package/dist/assets/dist-CEGhJ1xl.js +1 -0
  113. package/dist/assets/dist-CF78u7GS.js +1 -0
  114. package/dist/assets/dist-CMxhtH1e.js +1 -0
  115. package/dist/assets/dist-CN0qWAiT.js +1 -0
  116. package/dist/assets/dist-CO6gjtrq.js +11 -0
  117. package/dist/assets/dist-CwfCEqoZ.js +1 -0
  118. package/dist/assets/dist-CxkjL8u9.js +1 -0
  119. package/dist/assets/dist-D3Gxtn_g.js +2 -0
  120. package/dist/assets/dist-D9o03QzN.js +1 -0
  121. package/dist/assets/dist-DUVOpSfr.js +1 -0
  122. package/dist/assets/dist-DVp3z0N1.js +9 -0
  123. package/dist/assets/dist-DbgoG8p0.js +1 -0
  124. package/dist/assets/dist-Dx7RIjDF.js +1 -0
  125. package/dist/assets/dist-hHJOGFR3.js +1 -0
  126. package/dist/assets/dist-r1yFQKfc.js +1 -0
  127. package/dist/assets/dockerfile-BLkNEvjs.js +1 -0
  128. package/dist/assets/dtd-DTF72YNO.js +1 -0
  129. package/dist/assets/dylan-C6jEEEk-.js +1 -0
  130. package/dist/assets/ebnf-D4c0_ac3.js +1 -0
  131. package/dist/assets/ecl-BSZaIHnp.js +1 -0
  132. package/dist/assets/eiffel-BEjRio4Q.js +1 -0
  133. package/dist/assets/elm-Cshzl8qu.js +1 -0
  134. package/dist/assets/erDiagram-TEJ5UH35-DmLQldz3.js +85 -0
  135. package/dist/assets/erlang-DaB2Rkuy.js +1 -0
  136. package/dist/assets/eventmodeling-FCH6USID-CjbfWKFY.js +1 -0
  137. package/dist/assets/factor-D7LVTn2l.js +1 -0
  138. package/dist/assets/fcl-ClOhbFR7.js +1 -0
  139. package/dist/assets/flowDiagram-I6XJVG4X-DVUVTV7y.js +162 -0
  140. package/dist/assets/forth-Cezjo90N.js +1 -0
  141. package/dist/assets/fortran-Bt6PBEDR.js +1 -0
  142. package/dist/assets/ganttDiagram-6RSMTGT7-B29Uh60s.js +292 -0
  143. package/dist/assets/gas-BHEdbvp9.js +1 -0
  144. package/dist/assets/gherkin-oBAE_ms0.js +1 -0
  145. package/dist/assets/gitGraph-WXDBUCRP-UjXKP53I.js +1 -0
  146. package/dist/assets/gitGraphDiagram-PVQCEYII-smrXHnBr.js +106 -0
  147. package/dist/assets/graphlib-DpLcPBYV.js +1 -0
  148. package/dist/assets/groovy-BC3IOsC8.js +1 -0
  149. package/dist/assets/haskell-BRsoo5mP.js +1 -0
  150. package/dist/assets/haxe-DIz0ZZqd.js +1 -0
  151. package/dist/assets/http-CLVgA2GD.js +1 -0
  152. package/dist/assets/idl-BUZw3wgd.js +1 -0
  153. package/dist/assets/index-Czi2sVlL.js +1910 -0
  154. package/dist/assets/index-nBHjSfNd.css +1 -0
  155. package/dist/assets/info-J43DQDTF-D0rV5uTf.js +1 -0
  156. package/dist/assets/infoDiagram-5YYISTIA-B1Gf8Uv-.js +2 -0
  157. package/dist/assets/init-D6jRqBbL.js +1 -0
  158. package/dist/assets/ishikawaDiagram-YF4QCWOH-D02jcukO.js +70 -0
  159. package/dist/assets/javascript-9Tg8ixDm.js +1 -0
  160. package/dist/assets/journeyDiagram-JHISSGLW-B2VXi2OP.js +139 -0
  161. package/dist/assets/julia-CQfgDRfP.js +1 -0
  162. package/dist/assets/kanban-definition-UN3LZRKU-2-V_ZAd5.js +89 -0
  163. package/dist/assets/katex-Vhh-h91d.js +257 -0
  164. package/dist/assets/linear-BEHGKHxt.js +1 -0
  165. package/dist/assets/livescript-BXxG0Yva.js +1 -0
  166. package/dist/assets/lua-CiA1ziua.js +1 -0
  167. package/dist/assets/mathematica-u8YMmbU0.js +1 -0
  168. package/dist/assets/mbox-BEMVcqjs.js +1 -0
  169. package/dist/assets/mermaid-parser.core-DedvXRIg.js +161 -0
  170. package/dist/assets/mindmap-definition-RKZ34NQL-CmE26Ash.js +96 -0
  171. package/dist/assets/mirc-C9zpzAZU.js +1 -0
  172. package/dist/assets/mllike-B45xgp2S.js +1 -0
  173. package/dist/assets/modelica-CqHI_q-D.js +1 -0
  174. package/dist/assets/mscgen-qgSLujhx.js +1 -0
  175. package/dist/assets/mumps-CW_TBmxz.js +1 -0
  176. package/dist/assets/nginx-BMaDbqW3.js +1 -0
  177. package/dist/assets/nsis-AQ_alPln.js +1 -0
  178. package/dist/assets/ntriples-d28e9m0E.js +1 -0
  179. package/dist/assets/octave-D2Q8cUp1.js +1 -0
  180. package/dist/assets/ordinal-hYBb2elL.js +1 -0
  181. package/dist/assets/oz-BwTct_5T.js +1 -0
  182. package/dist/assets/packet-YPE3B663-BgNtBtap.js +1 -0
  183. package/dist/assets/pascal-Dp_KdFgX.js +1 -0
  184. package/dist/assets/perl-CdEHsPfU.js +1 -0
  185. package/dist/assets/pie-LRSECV5Y-BtNYo6fY.js +1 -0
  186. package/dist/assets/pieDiagram-4H26LBE5-DA8Tc6HA.js +30 -0
  187. package/dist/assets/pig-AF4Hwhju.js +1 -0
  188. package/dist/assets/playfair-display-cyrillic-600-normal-DbWAkkgN.woff +0 -0
  189. package/dist/assets/playfair-display-cyrillic-600-normal-oLY6jnZ7.woff2 +0 -0
  190. package/dist/assets/playfair-display-cyrillic-700-normal-Dk1mTcxf.woff +0 -0
  191. package/dist/assets/playfair-display-cyrillic-700-normal-Dw3uKy19.woff2 +0 -0
  192. package/dist/assets/playfair-display-latin-600-normal-CZLGqjJe.woff2 +0 -0
  193. package/dist/assets/playfair-display-latin-600-normal-CxxueQ0Z.woff +0 -0
  194. package/dist/assets/playfair-display-latin-700-normal-Bc_1Q1cG.woff +0 -0
  195. package/dist/assets/playfair-display-latin-700-normal-CuDiGg7c.woff2 +0 -0
  196. package/dist/assets/playfair-display-latin-ext-600-normal-BumBfC1v.woff +0 -0
  197. package/dist/assets/playfair-display-latin-ext-600-normal-CEjQclLc.woff2 +0 -0
  198. package/dist/assets/playfair-display-latin-ext-700-normal-C58ejOkc.woff2 +0 -0
  199. package/dist/assets/playfair-display-latin-ext-700-normal-D5HUU8GT.woff +0 -0
  200. package/dist/assets/playfair-display-vietnamese-600-normal-BPJkAZPN.woff +0 -0
  201. package/dist/assets/playfair-display-vietnamese-600-normal-ICsRR-qJ.woff2 +0 -0
  202. package/dist/assets/playfair-display-vietnamese-700-normal-CaKJSIny.woff2 +0 -0
  203. package/dist/assets/playfair-display-vietnamese-700-normal-Cr1rw0mr.woff +0 -0
  204. package/dist/assets/powershell-CzG71I4L.js +1 -0
  205. package/dist/assets/properties-C357ku5U.js +1 -0
  206. package/dist/assets/protobuf-D1ij_kNL.js +1 -0
  207. package/dist/assets/pug-Bugr-47h.js +1 -0
  208. package/dist/assets/puppet-B4hC2X4m.js +1 -0
  209. package/dist/assets/python-BqYw9LYJ.js +1 -0
  210. package/dist/assets/q-B9NhS7L_.js +1 -0
  211. package/dist/assets/quadrantDiagram-W4KKPZXB-Kkoca0z9.js +7 -0
  212. package/dist/assets/r-DADKenSm.js +1 -0
  213. package/dist/assets/radar-GUYGQ44K-CT8UiwEf.js +1 -0
  214. package/dist/assets/requirementDiagram-4Y6WPE33-lfBTeFxy.js +84 -0
  215. package/dist/assets/rpm-gpDK5sbt.js +1 -0
  216. package/dist/assets/ruby-DsYpTuWg.js +1 -0
  217. package/dist/assets/sankeyDiagram-5OEKKPKP-I9io9g_r.js +40 -0
  218. package/dist/assets/sas-C2OyD2Y6.js +1 -0
  219. package/dist/assets/scheme-CyDdOh7e.js +1 -0
  220. package/dist/assets/sequenceDiagram-3UESZ5HK-DctmO3Ji.js +162 -0
  221. package/dist/assets/shell-Du5Qg9im.js +1 -0
  222. package/dist/assets/sieve-BAxa3IjF.js +1 -0
  223. package/dist/assets/simple-mode-DRpGK0lJ.js +1 -0
  224. package/dist/assets/smalltalk-BLp5-jwC.js +1 -0
  225. package/dist/assets/solr-BBopId9w.js +1 -0
  226. package/dist/assets/source-serif-4-cyrillic-400-normal-B8Z6Jvzv.woff +0 -0
  227. package/dist/assets/source-serif-4-cyrillic-400-normal-C44pakCn.woff2 +0 -0
  228. package/dist/assets/source-serif-4-cyrillic-600-normal-BDP5YDHD.woff2 +0 -0
  229. package/dist/assets/source-serif-4-cyrillic-600-normal-DFnC3vAY.woff +0 -0
  230. package/dist/assets/source-serif-4-cyrillic-ext-400-normal-CWV284fw.woff2 +0 -0
  231. package/dist/assets/source-serif-4-cyrillic-ext-400-normal-DLkyKLvH.woff +0 -0
  232. package/dist/assets/source-serif-4-cyrillic-ext-600-normal-D_E8FDgP.woff2 +0 -0
  233. package/dist/assets/source-serif-4-cyrillic-ext-600-normal-DiT2IGQm.woff +0 -0
  234. package/dist/assets/source-serif-4-greek-400-normal-BccYJ-vZ.woff +0 -0
  235. package/dist/assets/source-serif-4-greek-400-normal-Cw5-AHNN.woff2 +0 -0
  236. package/dist/assets/source-serif-4-greek-600-normal-DdRkKr-1.woff2 +0 -0
  237. package/dist/assets/source-serif-4-greek-600-normal-DhXQw1Kl.woff +0 -0
  238. package/dist/assets/source-serif-4-latin-400-normal-DJ5YJwmz.woff2 +0 -0
  239. package/dist/assets/source-serif-4-latin-400-normal-Dn3IlU-Z.woff +0 -0
  240. package/dist/assets/source-serif-4-latin-600-normal-DMD1h6_f.woff +0 -0
  241. package/dist/assets/source-serif-4-latin-600-normal-DouSKlru.woff2 +0 -0
  242. package/dist/assets/source-serif-4-latin-ext-400-normal-CEpydyUl.woff +0 -0
  243. package/dist/assets/source-serif-4-latin-ext-400-normal-Cp7z-ARB.woff2 +0 -0
  244. package/dist/assets/source-serif-4-latin-ext-600-normal-0sIUyHMO.woff2 +0 -0
  245. package/dist/assets/source-serif-4-latin-ext-600-normal-C6NNqpJh.woff +0 -0
  246. package/dist/assets/source-serif-4-vietnamese-400-normal-BbG3LG1A.woff2 +0 -0
  247. package/dist/assets/source-serif-4-vietnamese-400-normal-DR1UuFon.woff +0 -0
  248. package/dist/assets/source-serif-4-vietnamese-600-normal-B0WJbuqT.woff +0 -0
  249. package/dist/assets/source-serif-4-vietnamese-600-normal-CznyfUKR.woff2 +0 -0
  250. package/dist/assets/sparql-Dz-mlCAC.js +1 -0
  251. package/dist/assets/spreadsheet-CTIncYxj.js +1 -0
  252. package/dist/assets/sql-DcCJ9jop.js +1 -0
  253. package/dist/assets/stateDiagram-AJRCARHV-C5Nx7EBG.js +1 -0
  254. package/dist/assets/stateDiagram-v2-BHNVJYJU-MxkuKT7f.js +1 -0
  255. package/dist/assets/stex-sDrdk2BW.js +1 -0
  256. package/dist/assets/stylus-DLLZ8dgm.js +1 -0
  257. package/dist/assets/swift-DKB6_1j6.js +1 -0
  258. package/dist/assets/tcl-BGfruO1u.js +1 -0
  259. package/dist/assets/textile-DWBqthVk.js +1 -0
  260. package/dist/assets/tiddlywiki-VlUiK86J.js +1 -0
  261. package/dist/assets/tiki-CxVlf5KZ.js +1 -0
  262. package/dist/assets/timeline-definition-PNZ67QCA-Dg9cWzqH.js +120 -0
  263. package/dist/assets/toml-LvoKBwCs.js +1 -0
  264. package/dist/assets/treeView-BLDUP644-DwODQHAM.js +1 -0
  265. package/dist/assets/treemap-LRROVOQU-D1GWl9XK.js +1 -0
  266. package/dist/assets/troff-C2dAgh7P.js +1 -0
  267. package/dist/assets/ttcn-BePYh-hG.js +1 -0
  268. package/dist/assets/ttcn-cfg-CY0aot7Q.js +1 -0
  269. package/dist/assets/turtle-BDLWE2cD.js +1 -0
  270. package/dist/assets/vb-BthdM_4N.js +1 -0
  271. package/dist/assets/vbscript-D9f6rSsU.js +1 -0
  272. package/dist/assets/velocity-CqftRsjg.js +1 -0
  273. package/dist/assets/vennDiagram-CIIHVFJN-Cq75Ue3t.js +34 -0
  274. package/dist/assets/verilog-D-x6ne0Z.js +1 -0
  275. package/dist/assets/vhdl-CMrOq2q1.js +1 -0
  276. package/dist/assets/wardley-L42UT6IY-C--1EU_5.js +1 -0
  277. package/dist/assets/wardleyDiagram-YWT4CUSO-DDjtFIKf.js +78 -0
  278. package/dist/assets/webidl-D5jiJvOU.js +1 -0
  279. package/dist/assets/xquery-fj_R-kMw.js +1 -0
  280. package/dist/assets/xychartDiagram-2RQKCTM6-xtq4jnQX.js +7 -0
  281. package/dist/assets/yacas-CXXgtw0p.js +1 -0
  282. package/dist/assets/z80-CL1naaMV.js +1 -0
  283. package/dist/index.html +13 -0
  284. package/package.json +76 -0
  285. package/server/index.mjs +224 -0
@@ -0,0 +1 @@
1
+ function e(e){for(var t={},n=e.split(` `),r=0;r<n.length;++r)t[n[r]]=!0;return t}var t=`body catch class do else enum for foreach foreach_reverse if in interface mixin out scope struct switch try union unittest version while with`,n={keywords:e(`abstract alias align asm assert auto break case cast cdouble cent cfloat const continue debug default delegate delete deprecated export extern final finally function goto immutable import inout invariant is lazy macro module new nothrow override package pragma private protected public pure ref return shared short static super synchronized template this throw typedef typeid typeof volatile __FILE__ __LINE__ __gshared __traits __vector __parameters `+t),blockKeywords:e(t),builtin:e(`bool byte char creal dchar double float idouble ifloat int ireal long real short ubyte ucent uint ulong ushort wchar wstring void size_t sizediff_t`),atoms:e(`exit failure success true false null`),hooks:{"@":function(e,t){return e.eatWhile(/[\w\$_]/),`meta`}}},r=n.statementIndentUnit,i=n.keywords,a=n.builtin,o=n.blockKeywords,s=n.atoms,c=n.hooks,l=n.multiLineStrings,u=/[+\-*&%=<>!?|\/]/,d;function f(e,t){var n=e.next();if(c[n]){var r=c[n](e,t);if(r!==!1)return r}if(n==`"`||n==`'`||n=="`")return t.tokenize=p(n),t.tokenize(e,t);if(/[\[\]{}\(\),;\:\.]/.test(n))return d=n,null;if(/\d/.test(n))return e.eatWhile(/[\w\.]/),`number`;if(n==`/`){if(e.eat(`+`))return t.tokenize=h,h(e,t);if(e.eat(`*`))return t.tokenize=m,m(e,t);if(e.eat(`/`))return e.skipToEnd(),`comment`}if(u.test(n))return e.eatWhile(u),`operator`;e.eatWhile(/[\w\$_\xa1-\uffff]/);var l=e.current();return i.propertyIsEnumerable(l)?(o.propertyIsEnumerable(l)&&(d=`newstatement`),`keyword`):a.propertyIsEnumerable(l)?(o.propertyIsEnumerable(l)&&(d=`newstatement`),`builtin`):s.propertyIsEnumerable(l)?`atom`:`variable`}function p(e){return function(t,n){for(var r=!1,i,a=!1;(i=t.next())!=null;){if(i==e&&!r){a=!0;break}r=!r&&i==`\\`}return(a||!(r||l))&&(n.tokenize=null),`string`}}function m(e,t){for(var n=!1,r;r=e.next();){if(r==`/`&&n){t.tokenize=null;break}n=r==`*`}return`comment`}function h(e,t){for(var n=!1,r;r=e.next();){if(r==`/`&&n){t.tokenize=null;break}n=r==`+`}return`comment`}function g(e,t,n,r,i){this.indented=e,this.column=t,this.type=n,this.align=r,this.prev=i}function _(e,t,n){var r=e.indented;return e.context&&e.context.type==`statement`&&(r=e.context.indented),e.context=new g(r,t,n,null,e.context)}function v(e){var t=e.context.type;return(t==`)`||t==`]`||t==`}`)&&(e.indented=e.context.indented),e.context=e.context.prev}var y={name:`d`,startState:function(e){return{tokenize:null,context:new g(-e,0,`top`,!1),indented:0,startOfLine:!0}},token:function(e,t){var n=t.context;if(e.sol()&&(n.align??=!1,t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return null;d=null;var r=(t.tokenize||f)(e,t);if(r==`comment`||r==`meta`)return r;if(n.align??=!0,(d==`;`||d==`:`||d==`,`)&&n.type==`statement`)v(t);else if(d==`{`)_(t,e.column(),`}`);else if(d==`[`)_(t,e.column(),`]`);else if(d==`(`)_(t,e.column(),`)`);else if(d==`}`){for(;n.type==`statement`;)n=v(t);for(n.type==`}`&&(n=v(t));n.type==`statement`;)n=v(t)}else d==n.type?v(t):((n.type==`}`||n.type==`top`)&&d!=`;`||n.type==`statement`&&d==`newstatement`)&&_(t,e.column(),`statement`);return t.startOfLine=!1,r},indent:function(e,t,n){if(e.tokenize!=f&&e.tokenize!=null)return null;var i=e.context,a=t&&t.charAt(0);i.type==`statement`&&a==`}`&&(i=i.prev);var o=a==i.type;return i.type==`statement`?i.indented+(a==`{`?0:r||n.unit):i.align?i.column+ +!o:i.indented+(o?0:n.unit)},languageData:{indentOnInput:/^\s*[{}]$/,commentTokens:{line:`//`,block:{open:`/*`,close:`*/`}}}};export{y as d};
@@ -0,0 +1,4 @@
1
+ import{r as e,t}from"./graphlib-DpLcPBYV.js";import{n,r,t as i}from"./dagre-DjzBNxbY.js";import{On as a,T as o,a as s,c,d as l,h as u,i as d,kn as f,l as p,m,o as h,p as g,r as _,rn as v,s as y,u as b}from"./index-Czi2sVlL.js";var x=4;function S(e){return r(e,x)}function C(t){var n={options:{directed:t.isDirected(),multigraph:t.isMultigraph(),compound:t.isCompound()},nodes:w(t),edges:T(t)};return e(t.graph())||(n.value=S(t.graph())),n}function w(t){return n(t.nodes(),function(n){var r=t.node(n),i=t.parent(n),a={v:n};return e(r)||(a.value=r),e(i)||(a.parent=i),a})}function T(t){return n(t.edges(),function(n){var r=t.edge(n),i={v:n.v,w:n.w};return e(n.name)||(i.name=n.name),e(r)||(i.value=r),i})}var E=new Map,D=new Map,O=new Map,k=a(()=>{D.clear(),O.clear(),E.clear()},`clear`),A=a((e,t)=>{let n=D.get(t)||[];return f.trace(`In isDescendant`,t,` `,e,` = `,n.includes(e)),n.includes(e)},`isDescendant`),j=a((e,t)=>{let n=D.get(t)||[];return f.info(`Descendants of `,t,` is `,n),f.info(`Edge is `,e),e.v===t||e.w===t?!1:n?n.includes(e.v)||A(e.v,t)||A(e.w,t)||n.includes(e.w):(f.debug(`Tilt, `,t,`,not in descendants`),!1)},`edgeInCluster`),M=a((e,t,n,r)=>{f.warn(`Copying children of `,e,`root`,r,`data`,t.node(e),r);let i=t.children(e)||[];e!==r&&i.push(e),f.warn(`Copying (nodes) clusterId`,e,`nodes`,i),i.forEach(i=>{if(t.children(i).length>0)M(i,t,n,r);else{let a=t.node(i);f.info(`cp `,i,` to `,r,` with parent `,e),n.setNode(i,a),r!==t.parent(i)&&(f.warn(`Setting parent`,i,t.parent(i)),n.setParent(i,t.parent(i))),e!==r&&i!==e?(f.debug(`Setting parent`,i,e),n.setParent(i,e)):(f.info(`In copy `,e,`root`,r,`data`,t.node(e),r),f.debug(`Not Setting parent for node=`,i,`cluster!==rootId`,e!==r,`node!==clusterId`,i!==e));let o=t.edges(i);f.debug(`Copying Edges`,o),o.forEach(i=>{f.info(`Edge`,i);let a=t.edge(i.v,i.w,i.name);f.info(`Edge data`,a,r);try{j(i,r)?(f.info(`Copying as `,i.v,i.w,a,i.name),n.setEdge(i.v,i.w,a,i.name),f.info(`newGraph edges `,n.edges(),n.edge(n.edges()[0]))):f.info(`Skipping copy of edge `,i.v,`-->`,i.w,` rootId: `,r,` clusterId:`,e)}catch(e){f.error(e)}})}f.debug(`Removing node`,i),t.removeNode(i)})},`copy`),N=a((e,t)=>{let n=t.children(e),r=[...n];for(let i of n)O.set(i,e),r=[...r,...N(i,t)];return r},`extractDescendants`),P=a((e,t,n)=>{let r=e.edges().filter(e=>e.v===t||e.w===t),i=e.edges().filter(e=>e.v===n||e.w===n),a=r.map(e=>({v:e.v===t?n:e.v,w:e.w===t?t:e.w})),o=i.map(e=>({v:e.v,w:e.w}));return a.filter(e=>o.some(t=>e.v===t.v&&e.w===t.w))},`findCommonEdges`),F=a((e,t,n)=>{let r=t.children(e);if(f.trace(`Searching children of id `,e,r),r.length<1)return e;let i;for(let e of r){let r=F(e,t,n),a=P(t,n,r);if(r)if(a.length>0)i=r;else return r}return i},`findNonClusterChild`),I=a(e=>!E.has(e)||!E.get(e).externalConnections?e:E.has(e)?E.get(e).id:e,`getAnchorId`),L=a((e,t)=>{if(!e||t>10){f.debug(`Opting out, no graph `);return}else f.debug(`Opting in, graph `);e.nodes().forEach(function(t){e.children(t).length>0&&(f.warn(`Cluster identified`,t,` Replacement id in edges: `,F(t,e,t)),D.set(t,N(t,e)),E.set(t,{id:F(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){let n=e.children(t),r=e.edges();n.length>0?(f.debug(`Cluster identified`,t,D),r.forEach(e=>{A(e.v,t)^A(e.w,t)&&(f.warn(`Edge: `,e,` leaves cluster `,t),f.warn(`Descendants of XXX `,t,`: `,D.get(t)),E.get(t).externalConnections=!0)})):f.debug(`Not a cluster `,t,D)});for(let t of E.keys()){let n=E.get(t).id,r=e.parent(n);r!==t&&E.has(r)&&!E.get(r).externalConnections&&(E.get(t).id=r)}e.edges().forEach(function(t){let n=e.edge(t);f.warn(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(t)),f.warn(`Edge `+t.v+` -> `+t.w+`: `+JSON.stringify(e.edge(t)));let r=t.v,i=t.w;if(f.warn(`Fix XXX`,E,`ids:`,t.v,t.w,`Translating: `,E.get(t.v),` --- `,E.get(t.w)),E.get(t.v)||E.get(t.w)){if(f.warn(`Fixing and trying - removing XXX`,t.v,t.w,t.name),r=I(t.v),i=I(t.w),e.removeEdge(t.v,t.w,t.name),r!==t.v){let i=e.parent(r);E.get(i).externalConnections=!0,n.fromCluster=t.v}if(i!==t.w){let r=e.parent(i);E.get(r).externalConnections=!0,n.toCluster=t.w}f.warn(`Fix Replacing with XXX`,r,i,t.name),e.setEdge(r,i,n,t.name)}}),f.warn(`Adjusted Graph`,C(e)),R(e,0),f.trace(E)},`adjustClustersAndEdges`),R=a((e,n)=>{if(f.warn(`extractor - `,n,C(e),e.children(`D`)),n>10){f.error(`Bailing out`);return}let r=e.nodes(),i=!1;for(let t of r){let n=e.children(t);i||=n.length>0}if(!i){f.debug(`Done, no node has children`,e.nodes());return}f.debug(`Nodes = `,r,n);for(let i of r)if(f.debug(`Extracting node`,i,E,E.has(i)&&!E.get(i).externalConnections,!e.parent(i),e.node(i),e.children(`D`),` Depth `,n),!E.has(i))f.debug(`Not a cluster`,i,n);else if(!E.get(i).externalConnections&&e.children(i)&&e.children(i).length>0){f.warn(`Cluster without external connections, without a parent and with children`,i,n);let r=e.graph().rankdir===`TB`?`LR`:`TB`;E.get(i)?.clusterData?.dir&&(r=E.get(i).clusterData.dir,f.warn(`Fixing dir`,E.get(i).clusterData.dir,r));let a=new t({multigraph:!0,compound:!0}).setGraph({rankdir:r,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});f.warn(`Old graph before copy`,C(e)),M(i,e,a,i),e.setNode(i,{clusterNode:!0,id:i,clusterData:E.get(i).clusterData,label:E.get(i).label,graph:a}),f.warn(`New graph after copy node: (`,i,`)`,C(a)),f.debug(`Old graph after copy`,C(e))}else f.warn(`Cluster ** `,i,` **not meeting the criteria !externalConnections:`,!E.get(i).externalConnections,` no parent: `,!e.parent(i),` children `,e.children(i)&&e.children(i).length>0,e.children(`D`),n),f.debug(E);r=e.nodes(),f.warn(`New list of nodes`,r);for(let t of r){let r=e.node(t);f.warn(` Now next level`,t,r),r?.clusterNode&&R(r.graph,n+1)}},`extractor`),z=a((e,t)=>{if(t.length===0)return[];let n=Object.assign([],t);return t.forEach(t=>{let r=z(e,e.children(t));n=[...n,...r]}),n},`sorter`),B=a(e=>z(e,e.children()),`sortNodesByHierarchy`),V=a(async(e,t,n,r,c,p)=>{f.warn(`Graph in recursive render:XAX`,C(t),c);let h=t.graph().rankdir;f.trace(`Dir in recursive render - dir:`,h);let _=e.insert(`g`).attr(`class`,`root`);t.nodes()?f.info(`Recursive render XXX`,t.nodes()):f.info(`No nodes found for`,t),t.edges().length>0&&f.info(`Recursive edges`,t.edge(t.edges()[0]));let v=_.insert(`g`).attr(`class`,`clusters`),x=_.insert(`g`).attr(`class`,`edgePaths`),S=_.insert(`g`).attr(`class`,`edgeLabels`),w=_.insert(`g`).attr(`class`,`nodes`);await Promise.all(t.nodes().map(async function(e){let i=t.node(e);if(c!==void 0){let n=JSON.parse(JSON.stringify(c.clusterData));f.trace(`Setting data for parent cluster XXX
2
+ Node.id = `,e,`
3
+ data=`,n.height,`
4
+ Parent cluster`,c.height),t.setNode(c.id,n),t.parent(e)||(f.trace(`Setting parent`,e,c.id),t.setParent(e,c.id,n))}if(f.info(`(Insert) Node XXX`+e+`: `+JSON.stringify(t.node(e))),i?.clusterNode){f.info(`Cluster identified XBX`,e,i.width,t.node(e));let{ranksep:a,nodesep:o}=t.graph();i.graph.setGraph({...i.graph.graph(),ranksep:a+25,nodesep:o});let s=await V(w,i.graph,n,r,t.node(e),p),c=s.elem;u(i,c),i.diff=s.diff||0,f.info(`New compound node after recursive render XAX`,e,`width`,i.width,`height`,i.height),m(c,i)}else t.children(e).length>0?(f.trace(`Cluster - the non recursive path XBX`,e,i.id,i,i.width,`Graph:`,t),f.trace(F(i.id,t)),E.set(i.id,{id:F(i.id,t),node:i})):(f.trace(`Node - the non recursive path XAX`,e,w,t.node(e),h),await l(w,t.node(e),{config:p,dir:h}))})),await a(async()=>{let e=t.edges().map(async function(e){let n=t.edge(e.v,e.w,e.name);f.info(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(e)),f.info(`Edge `+e.v+` -> `+e.w+`: `,e,` `,JSON.stringify(t.edge(e))),f.info(`Fix`,E,`ids:`,e.v,e.w,`Translating: `,E.get(e.v),E.get(e.w)),await s(S,n)});await Promise.all(e)},`processEdges`)(),f.info(`Graph before layout:`,JSON.stringify(C(t))),f.info(`############################################# XXX`),f.info(`### Layout ### XXX`),f.info(`############################################# XXX`),i(t),f.info(`Graph after layout:`,JSON.stringify(C(t)));let T=0,{subGraphTitleTotalMargin:D}=o(p);return await Promise.all(B(t).map(async function(e){let n=t.node(e);if(f.info(`Position XBX => `+e+`: (`+n.x,`,`+n.y,`) width: `,n.width,` height: `,n.height),n?.clusterNode)n.y+=D,f.info(`A tainted cluster node XBX1`,e,n.id,n.width,n.height,n.x,n.y,t.parent(e)),E.get(n.id).node=n,g(n);else if(t.children(e).length>0){f.info(`A pure cluster node XBX1`,e,n.id,n.x,n.y,n.width,n.height,t.parent(e)),n.height+=D,t.node(n.parentId);let r=n?.padding/2||0,i=n?.labelBBox?.height||0,a=i-r||0;f.debug(`OffsetY`,a,`labelHeight`,i,`halfPadding`,r),await b(v,n),E.get(n.id).node=n}else{let e=t.node(n.parentId);n.y+=D/2,f.info(`A regular node XBX1 - using the padding`,n.id,`parent`,n.parentId,n.width,n.height,n.x,n.y,`offsetY`,n.offsetY,`parent`,e,e?.offsetY,n),g(n)}})),t.edges().forEach(function(e){let i=t.edge(e);f.info(`Edge `+e.v+` -> `+e.w+`: `+JSON.stringify(i),i),i.points.forEach(e=>e.y+=D/2),y(i,d(x,i,E,n,t.node(e.v),t.node(e.w),r))}),t.nodes().forEach(function(e){let n=t.node(e);f.info(e,n.type,n.diff),n.isGroup&&(T=n.diff)}),f.warn(`Returning from recursive render XAX`,_,T),{elem:_,diff:T}},`recursiveRender`),H=a(async(e,n)=>{let r=new t({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.config?.flowchart?.nodeSpacing||e.nodeSpacing,ranksep:e.config?.rankSpacing||e.config?.flowchart?.rankSpacing||e.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}}),i=n.select(`g`);h(i,e.markers,e.type,e.diagramId),p(),_(),c(),k(),e.nodes.forEach(e=>{r.setNode(e.id,{...e}),e.parentId&&r.setParent(e.id,e.parentId)}),f.debug(`Edges:`,e.edges),e.edges.forEach(e=>{if(e.start===e.end){let t=e.start,n=t+`---`+t+`---1`,i=t+`---`+t+`---2`,a=r.node(t);r.setNode(n,{domId:n,id:n,parentId:a.parentId,labelStyle:``,label:``,padding:0,shape:`labelRect`,style:``,width:10,height:10}),r.setParent(n,a.parentId),r.setNode(i,{domId:i,id:i,parentId:a.parentId,labelStyle:``,padding:0,shape:`labelRect`,label:``,style:``,width:10,height:10}),r.setParent(i,a.parentId);let o=structuredClone(e),s=structuredClone(e),c=structuredClone(e);o.label=``,o.arrowTypeEnd=`none`,o.endLabelLeft=``,o.endLabelRight=``,o.startLabelLeft=``,o.id=t+`-cyclic-special-1`,s.startLabelRight=``,s.startLabelLeft=``,s.endLabelLeft=``,s.endLabelRight=``,s.arrowTypeStart=`none`,s.arrowTypeEnd=`none`,s.id=t+`-cyclic-special-mid`,c.label=``,c.startLabelRight=``,c.startLabelLeft=``,c.arrowTypeStart=`none`,a.isGroup&&(o.fromCluster=t,c.toCluster=t),c.id=t+`-cyclic-special-2`,c.arrowTypeStart=`none`,r.setEdge(t,n,o,t+`-cyclic-special-0`),r.setEdge(n,i,s,t+`-cyclic-special-1`),r.setEdge(i,t,c,t+`-cyc<lic-special-2`)}else r.setEdge(e.start,e.end,{...e},e.id)}),f.warn(`Graph at first:`,JSON.stringify(C(r))),L(r),f.warn(`Graph after XAX:`,JSON.stringify(C(r)));let a=v();await V(i,r,e.type,e.diagramId,void 0,a)},`render`);export{H as render};
@@ -0,0 +1 @@
1
+ import{C as e,D as t,E as n,O as r,S as i,T as a,_ as o,a as s,b as c,c as l,d as u,f as d,g as f,h as p,i as m,k as h,l as g,m as _,n as v,o as y,p as ee,r as b,s as te,t as x,u as S,v as ne,w as re,x as ie,y as ae}from"./graphlib-DpLcPBYV.js";import{$r as oe,Cr as se,Dr as ce,Gr as le,Hr as C,Ir as w,Jr as T,Kr as ue,Lr as E,Mr as D,Or as de,Qr as fe,Rr as pe,Sr as me,Tr as he,Ur as O,Vr as ge,Xr as _e,Yr as ve,Zr as ye,ai as be,ci as k,di as xe,ei as Se,ii as Ce,kr as we,li as Te,oi as Ee,qr as A,si as j,ui as De,wr as Oe,xr as ke,yr as Ae}from"./index-Czi2sVlL.js";var je=1/0,Me=17976931348623157e292;function M(e){return e?(e=be(e),e===je||e===-je?(e<0?-1:1)*Me:e===e?e:0):e===0?e:0}function Ne(e){var t=M(e),n=t%1;return t===t?n?t-n:t:0}function N(e){return e!=null&&e.length?ae(e,1):[]}function Pe(e){return fe(ue(e,void 0,N),e+``)}var Fe=RegExp(`[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\ufe0e\\ufe0f]`);function Ie(e){return Fe.test(e)}function Le(e,t){return e&&A(t,a(t),e)}function Re(e,t){return e&&A(t,D(t),e)}function ze(e,t){return A(e,o(e),t)}var Be=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)c(t,o(e)),e=we(e);return t}:ne;function Ve(e,t){return A(e,Be(e),t)}function He(e){return f(e,D,Be)}var Ue=Object.prototype.hasOwnProperty;function We(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]==`string`&&Ue.call(e,`index`)&&(n.index=e.index,n.input=e.input),n}function Ge(e,t){var n=t?he(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var Ke=/\w*$/;function qe(e){var t=new e.constructor(e.source,Ke.exec(e));return t.lastIndex=e.lastIndex,t}var Je=xe?xe.prototype:void 0,Ye=Je?Je.valueOf:void 0;function Xe(e){return Ye?Object(Ye.call(e)):{}}var Ze=`[object Boolean]`,Qe=`[object Date]`,$e=`[object Map]`,et=`[object Number]`,tt=`[object RegExp]`,nt=`[object Set]`,rt=`[object String]`,it=`[object Symbol]`,at=`[object ArrayBuffer]`,ot=`[object DataView]`,st=`[object Float32Array]`,ct=`[object Float64Array]`,lt=`[object Int8Array]`,ut=`[object Int16Array]`,dt=`[object Int32Array]`,ft=`[object Uint8Array]`,pt=`[object Uint8ClampedArray]`,mt=`[object Uint16Array]`,ht=`[object Uint32Array]`;function gt(e,t,n){var r=e.constructor;switch(t){case at:return he(e);case Ze:case Qe:return new r(+e);case ot:return Ge(e,n);case st:case ct:case lt:case ut:case dt:case ft:case pt:case mt:case ht:return Oe(e,n);case $e:return new r;case et:case rt:return new r(e);case tt:return qe(e);case nt:return new r;case it:return Xe(e)}}var _t=`[object Map]`;function vt(e){return Te(e)&&_(e)==_t}var yt=w&&w.isMap,bt=yt?E(yt):vt,xt=`[object Set]`;function St(e){return Te(e)&&_(e)==xt}var Ct=w&&w.isSet,wt=Ct?E(Ct):St,Tt=1,Et=2,Dt=4,Ot=`[object Arguments]`,kt=`[object Array]`,At=`[object Boolean]`,jt=`[object Date]`,Mt=`[object Error]`,Nt=`[object Function]`,Pt=`[object GeneratorFunction]`,Ft=`[object Map]`,It=`[object Number]`,Lt=`[object Object]`,Rt=`[object RegExp]`,zt=`[object Set]`,Bt=`[object String]`,Vt=`[object Symbol]`,Ht=`[object WeakMap]`,Ut=`[object ArrayBuffer]`,Wt=`[object DataView]`,Gt=`[object Float32Array]`,Kt=`[object Float64Array]`,qt=`[object Int8Array]`,Jt=`[object Int16Array]`,Yt=`[object Int32Array]`,Xt=`[object Uint8Array]`,Zt=`[object Uint8ClampedArray]`,Qt=`[object Uint16Array]`,$t=`[object Uint32Array]`,P={};P[Ot]=P[kt]=P[Ut]=P[Wt]=P[At]=P[jt]=P[Gt]=P[Kt]=P[qt]=P[Jt]=P[Yt]=P[Ft]=P[It]=P[Lt]=P[Rt]=P[zt]=P[Bt]=P[Vt]=P[Xt]=P[Zt]=P[Qt]=P[$t]=!0,P[Mt]=P[Nt]=P[Ht]=!1;function F(e,t,n,i,o,s){var c,l=t&Tt,u=t&Et,d=t&Dt;if(n&&(c=o?n(e,i,o,s):n(e)),c!==void 0)return c;if(!Ee(e))return e;var f=j(e);if(f){if(c=We(e),!l)return Se(e,c)}else{var m=_(e),h=m==Nt||m==Pt;if(pe(e))return ce(e,l);if(m==Lt||m==Ot||h&&!o){if(c=u||h?{}:se(e),!l)return u?Ve(e,Re(c,e)):ze(e,Le(c,e))}else{if(!P[m])return o?e:{};c=gt(e,m,l)}}s||=new de;var g=s.get(e);if(g)return g;s.set(e,c),wt(e)?e.forEach(function(r){c.add(F(r,t,n,r,e,s))}):bt(e)&&e.forEach(function(r,i){c.set(i,F(r,t,n,i,e,s))});var v=f?void 0:(d?u?He:p:u?D:a)(e);return r(v||e,function(r,i){v&&(i=r,r=e[i]),T(c,i,F(r,t,n,i,e,s))}),c}var en=1,tn=4;function nn(e){return F(e,en|tn)}var rn=Object.prototype,an=rn.hasOwnProperty,on=le(function(e,t){e=Object(e);var n=-1,r=t.length,i=r>2?t[2]:void 0;for(i&&C(t[0],t[1],i)&&(r=1);++n<r;)for(var a=t[n],o=D(a),s=-1,c=o.length;++s<c;){var l=o[s],u=e[l];(u===void 0||ve(u,rn[l])&&!an.call(e,l))&&(e[l]=a[l])}return e});function I(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}function sn(e){return function(t,n,r){var i=Object(t);if(!O(t)){var o=S(n,3);t=a(t),n=function(e){return o(i[e],e,i)}}var s=e(t,n,r);return s>-1?i[o?t[s]:s]:void 0}}var cn=Math.max;function ln(e,n,r){var i=e==null?0:e.length;if(!i)return-1;var a=r==null?0:Ne(r);return a<0&&(a=cn(i+a,0)),t(e,S(n,3),a)}var L=sn(ln);function un(e,t){var n=-1,r=O(e)?Array(e.length):[];return l(e,function(e,i,a){r[++n]=t(e,i,a)}),r}function R(e,t){return(j(e)?h:un)(e,S(t,3))}function dn(e,t){return e==null?e:me(e,te(t),D)}function fn(e,t){return e&&g(e,te(t))}function pn(e,t){return e>t}var mn=Object.prototype.hasOwnProperty;function hn(e,t){return e!=null&&mn.call(e,t)}function gn(e,t){return e!=null&&ee(e,t,hn)}var _n=`[object String]`;function vn(e){return typeof e==`string`||!j(e)&&Te(e)&&De(e)==_n}function yn(e,t){return e<t}function z(e,t){var n={};return t=S(t,3),g(e,function(e,r,i){_e(n,r,t(e,r,i))}),n}function B(e,t,n){for(var r=-1,i=e.length;++r<i;){var a=e[r],o=t(a);if(o!=null&&(s===void 0?o===o&&!k(o):n(o,s)))var s=o,c=a}return c}function V(e){return e&&e.length?B(e,Ce,pn):void 0}var H=ge(function(e,t,n){Ae(e,t,n)});function U(e){return e&&e.length?B(e,Ce,yn):void 0}function W(e,t){return e&&e.length?B(e,S(t,2),yn):void 0}function bn(t,n,r,a){if(!Ee(t))return t;n=e(n,t);for(var o=-1,s=n.length,c=s-1,l=t;l!=null&&++o<s;){var u=i(n[o]),d=r;if(u===`__proto__`||u===`constructor`||u===`prototype`)return t;if(o!=c){var f=l[u];d=a?a(f,u,l):void 0,d===void 0&&(d=Ee(f)?f:ye(n[o+1])?[]:{})}T(l,u,d),l=l[u]}return t}function xn(t,n,r){for(var i=-1,a=n.length,o={};++i<a;){var s=n[i],c=ie(t,s);r(c,s)&&bn(o,e(s,t),c)}return o}function Sn(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}function Cn(e,t){if(e!==t){var n=e!==void 0,r=e===null,i=e===e,a=k(e),o=t!==void 0,s=t===null,c=t===t,l=k(t);if(!s&&!l&&!a&&e>t||a&&o&&c&&!s&&!l||r&&o&&c||!n&&c||!i)return 1;if(!r&&!a&&!l&&e<t||l&&n&&i&&!r&&!a||s&&n&&i||!o&&i||!c)return-1}return 0}function wn(e,t,n){for(var r=-1,i=e.criteria,a=t.criteria,o=i.length,s=n.length;++r<o;){var c=Cn(i[r],a[r]);if(c)return r>=s?c:c*(n[r]==`desc`?-1:1)}return e.index-t.index}function Tn(e,t,n){t=t.length?h(t,function(e){return j(e)?function(t){return ie(t,e.length===1?e[0]:e)}:e}):[Ce];var r=-1;return t=h(t,E(S)),Sn(un(e,function(e,n,i){return{criteria:h(t,function(t){return t(e)}),index:++r,value:e}}),function(e,t){return wn(e,t,n)})}var En=u(`length`),Dn=`\\ud800-\\udfff`,On=`\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff`,kn=`\\ufe0e\\ufe0f`,An=`[`+Dn+`]`,jn=`[`+On+`]`,Mn=`\\ud83c[\\udffb-\\udfff]`,Nn=`(?:`+jn+`|`+Mn+`)`,Pn=`[^`+Dn+`]`,Fn=`(?:\\ud83c[\\udde6-\\uddff]){2}`,In=`[\\ud800-\\udbff][\\udc00-\\udfff]`,Ln=`\\u200d`,Rn=Nn+`?`,zn=`[`+kn+`]?`,Bn=`(?:`+Ln+`(?:`+[Pn,Fn,In].join(`|`)+`)`+zn+Rn+`)*`,Vn=zn+Rn+Bn,Hn=`(?:`+[Pn+jn+`?`,jn,Fn,In,An].join(`|`)+`)`,Un=RegExp(Mn+`(?=`+Mn+`)|`+Hn+Vn,`g`);function Wn(e){for(var t=Un.lastIndex=0;Un.test(e);)++t;return t}function Gn(e){return Ie(e)?Wn(e):En(e)}function Kn(e,t){return xn(e,t,function(t,n){return d(e,n)})}var G=Pe(function(e,t){return e==null?{}:Kn(e,t)}),qn=Math.ceil,Jn=Math.max;function Yn(e,t,n,r){for(var i=-1,a=Jn(qn((t-e)/(n||1)),0),o=Array(a);a--;)o[r?a:++i]=e,e+=n;return o}function Xn(e){return function(t,n,r){return r&&typeof r!=`number`&&C(t,n,r)&&(n=r=void 0),t=M(t),n===void 0?(n=t,t=0):n=M(n),r=r===void 0?t<n?1:-1:M(r),Yn(t,n,r,e)}}var K=Xn(),Zn=`[object Map]`,Qn=`[object Set]`;function $n(e){if(e==null)return 0;if(O(e))return vn(e)?Gn(e):e.length;var t=_(e);return t==Zn||t==Qn?e.size:n(e).length}var q=le(function(e,t){if(e==null)return[];var n=t.length;return n>1&&C(e,t[0],t[1])?t=[]:n>2&&C(t[0],t[1],t[2])&&(t=[t[0]]),Tn(e,ae(t,1),[])}),er=0;function tr(e){var t=++er;return re(e)+t}function nr(e,t,n){for(var r=-1,i=e.length,a=t.length,o={};++r<i;){var s=r<a?t[r]:void 0;n(o,e[r],s)}return o}function rr(e,t){return nr(e||[],t||[],T)}var ir=class{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,t=e._prev;if(t!==e)return ar(t),t}enqueue(e){var t=this._sentinel;e._prev&&e._next&&ar(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){for(var e=[],t=this._sentinel,n=t._prev;n!==t;)e.push(JSON.stringify(n,or)),n=n._prev;return`[`+e.join(`, `)+`]`}};function ar(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function or(e,t){if(e!==`_next`&&e!==`_prev`)return t}var sr=oe(1);function cr(e,t){if(e.nodeCount()<=1)return[];var n=dr(e,t||sr);return N(R(lr(n.graph,n.buckets,n.zeroIdx),function(t){return e.outEdges(t.v,t.w)}))}function lr(e,t,n){for(var r=[],i=t[t.length-1],a=t[0],o;e.nodeCount();){for(;o=a.dequeue();)ur(e,t,n,o);for(;o=i.dequeue();)ur(e,t,n,o);if(e.nodeCount()){for(var s=t.length-2;s>0;--s)if(o=t[s].dequeue(),o){r=r.concat(ur(e,t,n,o,!0));break}}}return r}function ur(e,t,n,r,i){var a=i?[]:void 0;return y(e.inEdges(r.v),function(r){var o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,fr(t,n,s)}),y(e.outEdges(r.v),function(r){var i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,fr(t,n,o)}),e.removeNode(r.v),a}function dr(e,t){var n=new x,r=0,i=0;y(e.nodes(),function(e){n.setNode(e,{v:e,in:0,out:0})}),y(e.edges(),function(e){var a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s),i=Math.max(i,n.node(e.v).out+=o),r=Math.max(r,n.node(e.w).in+=o)});var a=K(i+r+3).map(function(){return new ir}),o=r+1;return y(n.nodes(),function(e){fr(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function fr(e,t,n){n.out?n.in?e[n.out-n.in+t].enqueue(n):e[e.length-1].enqueue(n):e[0].enqueue(n)}function pr(e){y(e.graph().acyclicer===`greedy`?cr(e,t(e)):mr(e),function(t){var n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,tr(`rev`))});function t(e){return function(t){return e.edge(t).weight}}}function mr(e){var t=[],n={},r={};function i(a){Object.prototype.hasOwnProperty.call(r,a)||(r[a]=!0,n[a]=!0,y(e.outEdges(a),function(e){Object.prototype.hasOwnProperty.call(n,e.w)?t.push(e):i(e.w)}),delete n[a])}return y(e.nodes(),i),t}function hr(e){y(e.edges(),function(t){var n=e.edge(t);if(n.reversed){e.removeEdge(t);var r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function J(e,t,n,r){var i;do i=tr(r);while(e.hasNode(i));return n.dummy=t,e.setNode(i,n),i}function gr(e){var t=new x().setGraph(e.graph());return y(e.nodes(),function(n){t.setNode(n,e.node(n))}),y(e.edges(),function(n){var r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function _r(e){var t=new x({multigraph:e.isMultigraph()}).setGraph(e.graph());return y(e.nodes(),function(n){e.children(n).length||t.setNode(n,e.node(n))}),y(e.edges(),function(n){t.setEdge(n,e.edge(n))}),t}function vr(e,t){var n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);var c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function Y(e){var t=R(K(Sr(e)+1),function(){return[]});return y(e.nodes(),function(n){var r=e.node(n),i=r.rank;b(i)||(t[i][r.order]=n)}),t}function yr(e){var t=U(R(e.nodes(),function(t){return e.node(t).rank}));y(e.nodes(),function(n){var r=e.node(n);gn(r,`rank`)&&(r.rank-=t)})}function br(e){var t=U(R(e.nodes(),function(t){return e.node(t).rank})),n=[];y(e.nodes(),function(r){var i=e.node(r).rank-t;n[i]||(n[i]=[]),n[i].push(r)});var r=0,i=e.graph().nodeRankFactor;y(n,function(t,n){b(t)&&n%i!==0?--r:r&&y(t,function(t){e.node(t).rank+=r})})}function xr(e,t,n,r){var i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),J(e,`border`,i,t)}function Sr(e){return V(R(e.nodes(),function(t){var n=e.node(t).rank;if(!b(n))return n}))}function Cr(e,t){var n={lhs:[],rhs:[]};return y(e,function(e){t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function wr(e,t){var n=ke();try{return t()}finally{console.log(e+` time: `+(ke()-n)+`ms`)}}function Tr(e,t){return t()}function Er(e){function t(n){var r=e.children(n),i=e.node(n);if(r.length&&y(r,t),Object.prototype.hasOwnProperty.call(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(var a=i.minRank,o=i.maxRank+1;a<o;++a)Dr(e,`borderLeft`,`_bl`,n,i,a),Dr(e,`borderRight`,`_br`,n,i,a)}}y(e.children(),t)}function Dr(e,t,n,r,i,a){var o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=J(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function Or(e){var t=e.graph().rankdir.toLowerCase();(t===`lr`||t===`rl`)&&Ar(e)}function kr(e){var t=e.graph().rankdir.toLowerCase();(t===`bt`||t===`rl`)&&Mr(e),(t===`lr`||t===`rl`)&&(Pr(e),Ar(e))}function Ar(e){y(e.nodes(),function(t){jr(e.node(t))}),y(e.edges(),function(t){jr(e.edge(t))})}function jr(e){var t=e.width;e.width=e.height,e.height=t}function Mr(e){y(e.nodes(),function(t){Nr(e.node(t))}),y(e.edges(),function(t){var n=e.edge(t);y(n.points,Nr),Object.prototype.hasOwnProperty.call(n,`y`)&&Nr(n)})}function Nr(e){e.y=-e.y}function Pr(e){y(e.nodes(),function(t){Fr(e.node(t))}),y(e.edges(),function(t){var n=e.edge(t);y(n.points,Fr),Object.prototype.hasOwnProperty.call(n,`x`)&&Fr(n)})}function Fr(e){var t=e.x;e.x=e.y,e.y=t}function Ir(e){e.graph().dummyChains=[],y(e.edges(),function(t){Lr(e,t)})}function Lr(e,t){var n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a!==r+1){e.removeEdge(t);var l=void 0,u,d;for(d=0,++r;r<a;++d,++r)s.points=[],l={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},u=J(e,`edge`,l,`_d`),r===c&&(l.width=s.width,l.height=s.height,l.dummy=`edge-label`,l.labelpos=s.labelpos),e.setEdge(n,u,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(u),n=u;e.setEdge(n,i,{weight:s.weight},o)}}function Rr(e){y(e.graph().dummyChains,function(t){var n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function zr(e){var t={};function n(r){var i=e.node(r);if(Object.prototype.hasOwnProperty.call(t,r))return i.rank;t[r]=!0;var a=U(R(e.outEdges(r),function(t){return n(t.w)-e.edge(t).minlen}));return(a===1/0||a==null)&&(a=0),i.rank=a}y(e.sources(),n)}function X(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}function Br(e){var t=new x({directed:!1}),n=e.nodes()[0],r=e.nodeCount();t.setNode(n,{});for(var i,a;Vr(t,e)<r;)i=Hr(t,e),a=t.hasNode(i.v)?X(e,i):-X(e,i),Ur(t,e,a);return t}function Vr(e,t){function n(r){y(t.nodeEdges(r),function(i){var a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!X(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return y(e.nodes(),n),e.nodeCount()}function Hr(e,t){return W(t.edges(),function(n){if(e.hasNode(n.v)!==e.hasNode(n.w))return X(t,n)})}function Ur(e,t,n){y(e.nodes(),function(e){t.node(e).rank+=n})}oe(1),oe(1),Wr.CycleException=Z;function Wr(e){var t={},n={},r=[];function i(a){if(Object.prototype.hasOwnProperty.call(n,a))throw new Z;Object.prototype.hasOwnProperty.call(t,a)||(n[a]=!0,t[a]=!0,y(e.predecessors(a),i),delete n[a],r.push(a))}if(y(e.sinks(),i),$n(t)!==e.nodeCount())throw new Z;return r}function Z(){}Z.prototype=Error();function Gr(e,t,n){j(t)||(t=[t]);var r=(e.isDirected()?e.successors:e.neighbors).bind(e),i=[],a={};return y(t,function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);Kr(e,t,n===`post`,a,r,i)}),i}function Kr(e,t,n,r,i,a){Object.prototype.hasOwnProperty.call(r,t)||(r[t]=!0,n||a.push(t),y(i(t),function(t){Kr(e,t,n,r,i,a)}),n&&a.push(t))}function qr(e,t){return Gr(e,t,`post`)}function Jr(e,t){return Gr(e,t,`pre`)}Q.initLowLimValues=Qr,Q.initCutValues=Yr,Q.calcCutValue=Zr,Q.leaveEdge=ei,Q.enterEdge=ti,Q.exchangeEdges=ni;function Q(e){e=gr(e),zr(e);var t=Br(e);Qr(t),Yr(t,e);for(var n,r;n=ei(t);)r=ti(t,e,n),ni(t,e,n,r)}function Yr(e,t){var n=qr(e,e.nodes());n=n.slice(0,n.length-1),y(n,function(n){Xr(e,t,n)})}function Xr(e,t,n){var r=e.node(n).parent;e.edge(n,r).cutvalue=Zr(e,t,n)}function Zr(e,t,n){var r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;return a||=(i=!1,t.edge(r,n)),o=a.weight,y(t.nodeEdges(n),function(a){var s=a.v===n,c=s?a.w:a.v;if(c!==r){var l=s===i,u=t.edge(a).weight;if(o+=l?u:-u,ii(e,n,c)){var d=e.edge(n,c).cutvalue;o+=l?-d:d}}}),o}function Qr(e,t){arguments.length<2&&(t=e.nodes()[0]),$r(e,{},1,t)}function $r(e,t,n,r,i){var a=n,o=e.node(r);return t[r]=!0,y(e.neighbors(r),function(i){Object.prototype.hasOwnProperty.call(t,i)||(n=$r(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function ei(e){return L(e.edges(),function(t){return e.edge(t).cutvalue<0})}function ti(e,t,n){var r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);var a=e.node(r),o=e.node(i),c=a,l=!1;return a.lim>o.lim&&(c=o,l=!0),W(s(t.edges(),function(t){return l===ai(e,e.node(t.v),c)&&l!==ai(e,e.node(t.w),c)}),function(e){return X(t,e)})}function ni(e,t,n,r){var i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),Qr(e),Yr(e,t),ri(e,t)}function ri(e,t){var n=Jr(e,L(e.nodes(),function(e){return!t.node(e).parent}));n=n.slice(1),y(n,function(n){var r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function ii(e,t,n){return e.hasEdge(t,n)}function ai(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}function oi(e){switch(e.graph().ranker){case`network-simplex`:li(e);break;case`tight-tree`:ci(e);break;case`longest-path`:si(e);break;default:li(e)}}var si=zr;function ci(e){zr(e),Br(e)}function li(e){Q(e)}function ui(e){var t=J(e,`root`,{},`_root`),n=fi(e),r=V(m(n))-1,i=2*r+1;e.graph().nestingRoot=t,y(e.edges(),function(t){e.edge(t).minlen*=i});var a=pi(e)+1;y(e.children(),function(o){di(e,t,i,a,r,n,o)}),e.graph().nodeRankFactor=i}function di(e,t,n,r,i,a,o){var s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}var c=xr(e,`_bt`),l=xr(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,y(s,function(s){di(e,t,n,r,i,a,s);var u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-a[o]+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+a[o]})}function fi(e){var t={};function n(r,i){var a=e.children(r);a&&a.length&&y(a,function(e){n(e,i+1)}),t[r]=i}return y(e.children(),function(e){n(e,1)}),t}function pi(e){return v(e.edges(),function(t,n){return t+e.edge(n).weight},0)}function mi(e){var t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,y(e.edges(),function(t){e.edge(t).nestingEdge&&e.removeEdge(t)})}function hi(e,t,n){var r={},i;y(n,function(n){for(var a=e.parent(n),o,s;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function gi(e,t,n){var r=_i(e),i=new x({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(t){return e.node(t)});return y(e.nodes(),function(a){var o=e.node(a),s=e.parent(a);(o.rank===t||o.minRank<=t&&t<=o.maxRank)&&(i.setNode(a),i.setParent(a,s||r),y(e[n](a),function(t){var n=t.v===a?t.w:t.v,r=i.edge(n,a),o=b(r)?0:r.weight;i.setEdge(n,a,{weight:e.edge(t).weight+o})}),Object.prototype.hasOwnProperty.call(o,`minRank`)&&i.setNode(a,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]}))}),i}function _i(e){for(var t;e.hasNode(t=tr(`_root`)););return t}function vi(e,t){for(var n=0,r=1;r<t.length;++r)n+=yi(e,t[r-1],t[r]);return n}function yi(e,t,n){for(var r=rr(n,R(n,function(e,t){return t})),i=N(R(t,function(t){return q(R(e.outEdges(t),function(t){return{pos:r[t.w],weight:e.edge(t).weight}}),`pos`)})),a=1;a<n.length;)a<<=1;var o=2*a-1;--a;var s=R(Array(o),function(){return 0}),c=0;return y(i.forEach(function(e){var t=e.pos+a;s[t]+=e.weight;for(var n=0;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n})),c}function bi(e){var t={},n=s(e.nodes(),function(t){return!e.children(t).length}),r=R(K(V(R(n,function(t){return e.node(t).rank}))+1),function(){return[]});function i(n){gn(t,n)||(t[n]=!0,r[e.node(n).rank].push(n),y(e.successors(n),i))}return y(q(n,function(t){return e.node(t).rank}),i),r}function xi(e,t){return R(t,function(t){var n=e.inEdges(t);if(n.length){var r=v(n,function(t,n){var r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}else return{v:t}})}function Si(e,t){var n={};return y(e,function(e,t){var r=n[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:t};b(e.barycenter)||(r.barycenter=e.barycenter,r.weight=e.weight)}),y(t.edges(),function(e){var t=n[e.v],r=n[e.w];!b(t)&&!b(r)&&(r.indegree++,t.out.push(n[e.w]))}),Ci(s(n,function(e){return!e.indegree}))}function Ci(e){var t=[];function n(e){return function(t){t.merged||(b(t.barycenter)||b(e.barycenter)||t.barycenter>=e.barycenter)&&wi(e,t)}}function r(t){return function(n){n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){var i=e.pop();t.push(i),y(i.in.reverse(),n(i)),y(i.out,r(i))}return R(s(t,function(e){return!e.merged}),function(e){return G(e,[`vs`,`i`,`barycenter`,`weight`])})}function wi(e,t){var n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function Ti(e,t){var n=Cr(e,function(e){return Object.prototype.hasOwnProperty.call(e,`barycenter`)}),r=n.lhs,i=q(n.rhs,function(e){return-e.i}),a=[],o=0,s=0,c=0;r.sort(Di(!!t)),c=Ei(a,i,c),y(r,function(e){c+=e.vs.length,a.push(e.vs),o+=e.barycenter*e.weight,s+=e.weight,c=Ei(a,i,c)});var l={vs:N(a)};return s&&(l.barycenter=o/s,l.weight=s),l}function Ei(e,t,n){for(var r;t.length&&(r=I(t)).i<=n;)t.pop(),e.push(r.vs),n++;return n}function Di(e){return function(t,n){return t.barycenter<n.barycenter?-1:t.barycenter>n.barycenter?1:e?n.i-t.i:t.i-n.i}}function Oi(e,t,n,r){var i=e.children(t),a=e.node(t),o=a?a.borderLeft:void 0,c=a?a.borderRight:void 0,l={};o&&(i=s(i,function(e){return e!==o&&e!==c}));var u=xi(e,i);y(u,function(t){if(e.children(t.v).length){var i=Oi(e,t.v,n,r);l[t.v]=i,Object.prototype.hasOwnProperty.call(i,`barycenter`)&&Ai(t,i)}});var d=Si(u,n);ki(d,l);var f=Ti(d,r);if(o&&(f.vs=N([o,f.vs,c]),e.predecessors(o).length)){var p=e.node(e.predecessors(o)[0]),m=e.node(e.predecessors(c)[0]);Object.prototype.hasOwnProperty.call(f,`barycenter`)||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+p.order+m.order)/(f.weight+2),f.weight+=2}return f}function ki(e,t){y(e,function(e){e.vs=N(e.vs.map(function(e){return t[e]?t[e].vs:e}))})}function Ai(e,t){b(e.barycenter)?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function ji(e){var t=Sr(e),n=Mi(e,K(1,t+1),`inEdges`),r=Mi(e,K(t-1,-1,-1),`outEdges`),i=bi(e);Pi(e,i);for(var a=1/0,o,s=0,c=0;c<4;++s,++c){Ni(s%2?n:r,s%4>=2),i=Y(e);var l=vi(e,i);l<a&&(c=0,o=nn(i),a=l)}Pi(e,o)}function Mi(e,t,n){return R(t,function(t){return gi(e,t,n)})}function Ni(e,t){var n=new x;y(e,function(e){var r=e.graph().root,i=Oi(e,r,n,t);y(i.vs,function(t,n){e.node(t).order=n}),hi(e,n,i.vs)})}function Pi(e,t){y(t,function(t){y(t,function(t,n){e.node(t).order=n})})}function Fi(e){var t=Li(e);y(e.graph().dummyChains,function(n){for(var r=e.node(n),i=r.edgeObj,a=Ii(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(l=o[c+1]).minRank<=r.rank;)c++;l=o[c]}e.setParent(n,l),n=e.successors(n)[0]}})}function Ii(e,t,n,r){var i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c=n,l;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));for(l=c,c=r;(c=e.parent(c))!==l;)a.push(c);return{path:i.concat(a.reverse()),lca:l}}function Li(e){var t={},n=0;function r(i){var a=n;y(e.children(i),r),t[i]={low:a,lim:n++}}return y(e.children(),r),t}function Ri(e,t){var n={};function r(t,r){var i=0,a=0,o=t.length,s=I(r);return y(r,function(t,c){var l=Bi(e,t),u=l?e.node(l).order:o;(l||t===s)&&(y(r.slice(a,c+1),function(t){y(e.predecessors(t),function(r){var a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&Vi(n,r,t)})}),a=c+1,i=u)}),r}return v(t,r),n}function zi(e,t){var n={};function r(t,r,i,a,o){var s;y(K(r,i),function(r){s=t[r],e.node(s).dummy&&y(e.predecessors(s),function(t){var r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&Vi(n,t,s)})})}function i(t,n){var i=-1,a,o=0;return y(n,function(s,c){if(e.node(s).dummy===`border`){var l=e.predecessors(s);l.length&&(a=e.node(l[0]).order,r(n,o,c,i,a),o=c,i=a)}r(n,o,n.length,a,t.length)}),n}return v(t,i),n}function Bi(e,t){if(e.node(t).dummy)return L(e.predecessors(t),function(t){return e.node(t).dummy})}function Vi(e,t,n){if(t>n){var r=t;t=n,n=r}Object.prototype.hasOwnProperty.call(e,t)||Object.defineProperty(e,t,{enumerable:!0,configurable:!0,value:{},writable:!0});var i=e[t];Object.defineProperty(i,n,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Hi(e,t,n){if(t>n){var r=t;t=n,n=r}return!!e[t]&&Object.prototype.hasOwnProperty.call(e[t],n)}function Ui(e,t,n,r){var i={},a={},o={};return y(t,function(e){y(e,function(e,t){i[e]=e,a[e]=e,o[e]=t})}),y(t,function(e){var t=-1;y(e,function(e){var s=r(e);if(s.length){s=q(s,function(e){return o[e]});for(var c=(s.length-1)/2,l=Math.floor(c),u=Math.ceil(c);l<=u;++l){var d=s[l];a[e]===e&&t<o[d]&&!Hi(n,e,d)&&(a[d]=e,a[e]=i[e]=i[d],t=o[d])}}})}),{root:i,align:a}}function Wi(e,t,n,r,i){var a={},o=Gi(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){for(var n=o.nodes(),r=n.pop(),i={};r;)i[r]?e(r):(i[r]=!0,n.push(r),n=n.concat(t(r))),r=n.pop()}function l(e){a[e]=o.inEdges(e).reduce(function(e,t){return Math.max(e,a[t.v]+o.edge(t))},0)}function u(t){var n=o.outEdges(t).reduce(function(e,t){return Math.min(e,a[t.w]-o.edge(t))},1/0),r=e.node(t);n!==1/0&&r.borderType!==s&&(a[t]=Math.max(a[t],n))}return c(l,o.predecessors.bind(o)),c(u,o.successors.bind(o)),y(r,function(e){a[e]=a[n[e]]}),a}function Gi(e,t,n,r){var i=new x,a=e.graph(),o=Xi(a.nodesep,a.edgesep,r);return y(t,function(t){var r;y(t,function(t){var a=n[t];if(i.setNode(a),r){var s=n[r],c=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),c||0))}r=t})}),i}function Ki(e,t){return W(m(t),function(t){var n=-1/0,r=1/0;return dn(t,function(t,i){var a=Zi(e,i)/2;n=Math.max(t+a,n),r=Math.min(t-a,r)}),n-r})}function qi(e,t){var n=m(t),r=U(n),i=V(n);y([`u`,`d`],function(n){y([`l`,`r`],function(a){var o=n+a,s=e[o],c;if(s!==t){var l=m(s);c=a===`l`?r-U(l):i-V(l),c&&(e[o]=z(s,function(e){return e+c}))}})})}function Ji(e,t){return z(e.ul,function(n,r){if(t)return e[t.toLowerCase()][r];var i=q(R(e,r));return(i[1]+i[2])/2})}function Yi(e){var t=Y(e),n=H(Ri(e,t),zi(e,t)),r={},i;return y([`u`,`d`],function(a){i=a===`u`?t:m(t).reverse(),y([`l`,`r`],function(t){t===`r`&&(i=R(i,function(e){return m(e).reverse()}));var o=(a===`u`?e.predecessors:e.successors).bind(e),s=Ui(e,i,n,o),c=Wi(e,i,s.root,s.align,t===`r`);t===`r`&&(c=z(c,function(e){return-e})),r[a+t]=c})}),qi(r,Ki(e,r)),Ji(r,e.graph().align)}function Xi(e,t,n){return function(r,i,a){var o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.prototype.hasOwnProperty.call(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2;break}if(l&&(c+=n?l:-l),l=0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.prototype.hasOwnProperty.call(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2;break}return l&&(c+=n?l:-l),l=0,c}}function Zi(e,t){return e.node(t).width}function Qi(e){e=_r(e),$i(e),fn(Yi(e),function(t,n){e.node(n).x=t})}function $i(e){var t=Y(e),n=e.graph().ranksep,r=0;y(t,function(t){var i=V(R(t,function(t){return e.node(t).height}));y(t,function(t){e.node(t).y=r+i/2}),r+=i+n})}function ea(e,t){var n=t&&t.debugTiming?wr:Tr;n(`layout`,()=>{var t=n(` buildLayoutGraph`,()=>da(e));n(` runLayout`,()=>ta(t,n)),n(` updateInputGraph`,()=>na(e,t))})}function ta(e,t){t(` makeSpaceForEdgeLabels`,()=>fa(e)),t(` removeSelfEdges`,()=>xa(e)),t(` acyclic`,()=>pr(e)),t(` nestingGraph.run`,()=>ui(e)),t(` rank`,()=>oi(_r(e))),t(` injectEdgeLabelProxies`,()=>pa(e)),t(` removeEmptyRanks`,()=>br(e)),t(` nestingGraph.cleanup`,()=>mi(e)),t(` normalizeRanks`,()=>yr(e)),t(` assignRankMinMax`,()=>ma(e)),t(` removeEdgeLabelProxies`,()=>ha(e)),t(` normalize.run`,()=>Ir(e)),t(` parentDummyChains`,()=>Fi(e)),t(` addBorderSegments`,()=>Er(e)),t(` order`,()=>ji(e)),t(` insertSelfEdges`,()=>Sa(e)),t(` adjustCoordinateSystem`,()=>Or(e)),t(` position`,()=>Qi(e)),t(` positionSelfEdges`,()=>Ca(e)),t(` removeBorderNodes`,()=>ba(e)),t(` normalize.undo`,()=>Rr(e)),t(` fixupEdgeLabelCoords`,()=>va(e)),t(` undoCoordinateSystem`,()=>kr(e)),t(` translateGraph`,()=>ga(e)),t(` assignNodeIntersects`,()=>_a(e)),t(` reversePoints`,()=>ya(e)),t(` acyclic.undo`,()=>hr(e))}function na(e,t){y(e.nodes(),function(n){var r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,t.children(n).length&&(r.width=i.width,r.height=i.height))}),y(e.edges(),function(n){var r=e.edge(n),i=t.edge(n);r.points=i.points,Object.prototype.hasOwnProperty.call(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var ra=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],ia={ranksep:50,edgesep:20,nodesep:50,rankdir:`tb`},aa=[`acyclicer`,`ranker`,`rankdir`,`align`],oa=[`width`,`height`],sa={width:0,height:0},ca=[`minlen`,`weight`,`width`,`height`,`labeloffset`],la={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},ua=[`labelpos`];function da(e){var t=new x({multigraph:!0,compound:!0}),n=$(e.graph());return t.setGraph(H({},ia,wa(n,ra),G(n,aa))),y(e.nodes(),function(n){var r=$(e.node(n));t.setNode(n,on(wa(r,oa),sa)),t.setParent(n,e.parent(n))}),y(e.edges(),function(n){var r=$(e.edge(n));t.setEdge(n,H({},la,wa(r,ca),G(r,ua)))}),t}function fa(e){var t=e.graph();t.ranksep/=2,y(e.edges(),function(n){var r=e.edge(n);r.minlen*=2,r.labelpos.toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function pa(e){y(e.edges(),function(t){var n=e.edge(t);if(n.width&&n.height){var r=e.node(t.v);J(e,`edge-proxy`,{rank:(e.node(t.w).rank-r.rank)/2+r.rank,e:t},`_ep`)}})}function ma(e){var t=0;y(e.nodes(),function(n){var r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=V(t,r.maxRank))}),e.graph().maxRank=t}function ha(e){y(e.nodes(),function(t){var n=e.node(t);n.dummy===`edge-proxy`&&(e.edge(n.e).labelRank=n.rank,e.removeNode(t))})}function ga(e){var t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){var a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}y(e.nodes(),function(t){c(e.node(t))}),y(e.edges(),function(t){var n=e.edge(t);Object.prototype.hasOwnProperty.call(n,`x`)&&c(n)}),t-=o,r-=s,y(e.nodes(),function(n){var i=e.node(n);i.x-=t,i.y-=r}),y(e.edges(),function(n){var i=e.edge(n);y(i.points,function(e){e.x-=t,e.y-=r}),Object.prototype.hasOwnProperty.call(i,`x`)&&(i.x-=t),Object.prototype.hasOwnProperty.call(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function _a(e){y(e.edges(),function(t){var n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(vr(r,a)),n.points.push(vr(i,o))})}function va(e){y(e.edges(),function(t){var n=e.edge(t);if(Object.prototype.hasOwnProperty.call(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset;break}})}function ya(e){y(e.edges(),function(t){var n=e.edge(t);n.reversed&&n.points.reverse()})}function ba(e){y(e.nodes(),function(t){if(e.children(t).length){var n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(I(n.borderLeft)),o=e.node(I(n.borderRight));n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),y(e.nodes(),function(t){e.node(t).dummy===`border`&&e.removeNode(t)})}function xa(e){y(e.edges(),function(t){if(t.v===t.w){var n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function Sa(e){y(Y(e),function(t){var n=0;y(t,function(t,r){var i=e.node(t);i.order=r+n,y(i.selfEdges,function(t){J(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,label:t.label},`_se`)}),delete i.selfEdges})})}function Ca(e){y(e.nodes(),function(t){var n=e.node(t);if(n.dummy===`selfedge`){var r=e.node(n.e.v),i=r.x+r.width/2,a=r.y,o=n.x-i,s=r.height/2;e.setEdge(n.e,n.label),e.removeNode(t),n.label.points=[{x:i+2*o/3,y:a-s},{x:i+5*o/6,y:a-s},{x:i+o,y:a},{x:i+5*o/6,y:a+s},{x:i+2*o/3,y:a+s}],n.label.x=n.x,n.label.y=n.y}})}function wa(e,t){return z(G(e,t),Number)}function $(e){var t={};return y(e,function(e,n){t[n.toLowerCase()]=e}),t}export{R as n,F as r,ea as t};
@@ -0,0 +1 @@
1
+ function e(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString(`en`).replace(/,/g,``):e.toString(10)}function t(e,t){if(!isFinite(e)||e===0)return null;var n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf(`e`),r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function n(e){return e=t(Math.abs(e)),e?e[1]:NaN}function r(e,t){return function(n,r){for(var i=n.length,a=[],o=0,s=e[0],c=0;i>0&&s>0&&(c+s+1>r&&(s=Math.max(1,r-c)),a.push(n.substring(i-=s,i+s)),!((c+=s+1)>r));)s=e[o=(o+1)%e.length];return a.reverse().join(t)}}function i(e){return function(t){return t.replace(/[0-9]/g,function(t){return e[+t]})}}var a=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function o(e){if(!(t=a.exec(e)))throw Error(`invalid format: `+e);var t;return new s({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}o.prototype=s.prototype;function s(e){this.fill=e.fill===void 0?` `:e.fill+``,this.align=e.align===void 0?`>`:e.align+``,this.sign=e.sign===void 0?`-`:e.sign+``,this.symbol=e.symbol===void 0?``:e.symbol+``,this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?``:e.type+``}s.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?`0`:``)+(this.width===void 0?``:Math.max(1,this.width|0))+(this.comma?`,`:``)+(this.precision===void 0?``:`.`+Math.max(0,this.precision|0))+(this.trim?`~`:``)+this.type};function c(e){out:for(var t=e.length,n=1,r=-1,i;n<t;++n)switch(e[n]){case`.`:r=i=n;break;case`0`:r===0&&(r=n),i=n;break;default:if(!+e[n])break out;r>0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(i+1):e}var l;function u(e,n){var r=t(e,n);if(!r)return l=void 0,e.toPrecision(n);var i=r[0],a=r[1],o=a-(l=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,s=i.length;return o===s?i:o>s?i+Array(o-s+1).join(`0`):o>0?i.slice(0,o)+`.`+i.slice(o):`0.`+Array(1-o).join(`0`)+t(e,Math.max(0,n+o-1))[0]}function d(e,n){var r=t(e,n);if(!r)return e+``;var i=r[0],a=r[1];return a<0?`0.`+Array(-a).join(`0`)+i:i.length>a+1?i.slice(0,a+1)+`.`+i.slice(a+1):i+Array(a-i.length+2).join(`0`)}var f={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+``,d:e,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>d(e*100,t),r:d,s:u,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function p(e){return e}var m=Array.prototype.map,h=[`y`,`z`,`a`,`f`,`p`,`n`,`µ`,`m`,``,`k`,`M`,`G`,`T`,`P`,`E`,`Z`,`Y`];function g(e){var t=e.grouping===void 0||e.thousands===void 0?p:r(m.call(e.grouping,Number),e.thousands+``),a=e.currency===void 0?``:e.currency[0]+``,s=e.currency===void 0?``:e.currency[1]+``,u=e.decimal===void 0?`.`:e.decimal+``,d=e.numerals===void 0?p:i(m.call(e.numerals,String)),g=e.percent===void 0?`%`:e.percent+``,_=e.minus===void 0?`−`:e.minus+``,v=e.nan===void 0?`NaN`:e.nan+``;function y(e,n){e=o(e);var r=e.fill,i=e.align,p=e.sign,m=e.symbol,y=e.zero,b=e.width,x=e.comma,S=e.precision,C=e.trim,w=e.type;w===`n`?(x=!0,w=`g`):f[w]||(S===void 0&&(S=12),C=!0,w=`g`),(y||r===`0`&&i===`=`)&&(y=!0,r=`0`,i=`=`);var T=(n&&n.prefix!==void 0?n.prefix:``)+(m===`$`?a:m===`#`&&/[boxX]/.test(w)?`0`+w.toLowerCase():``),E=(m===`$`?s:/[%p]/.test(w)?g:``)+(n&&n.suffix!==void 0?n.suffix:``),D=f[w],O=/[defgprs%]/.test(w);S=S===void 0?6:/[gprs]/.test(w)?Math.max(1,Math.min(21,S)):Math.max(0,Math.min(20,S));function k(e){var n=T,a=E,o,s,f;if(w===`c`)a=D(e)+a,e=``;else{e=+e;var m=e<0||1/e<0;if(e=isNaN(e)?v:D(Math.abs(e),S),C&&(e=c(e)),m&&+e==0&&p!==`+`&&(m=!1),n=(m?p===`(`?p:_:p===`-`||p===`(`?``:p)+n,a=(w===`s`&&!isNaN(e)&&l!==void 0?h[8+l/3]:``)+a+(m&&p===`(`?`)`:``),O){for(o=-1,s=e.length;++o<s;)if(f=e.charCodeAt(o),48>f||f>57){a=(f===46?u+e.slice(o+1):e.slice(o))+a,e=e.slice(0,o);break}}}x&&!y&&(e=t(e,1/0));var g=n.length+e.length+a.length,k=g<b?Array(b-g+1).join(r):``;switch(x&&y&&(e=t(k+e,k.length?b-a.length:1/0),k=``),i){case`<`:e=n+e+a+k;break;case`=`:e=n+k+e+a;break;case`^`:e=k.slice(0,g=k.length>>1)+n+e+a+k.slice(g);break;default:e=k+n+e+a;break}return d(e)}return k.toString=function(){return e+``},k}function b(e,t){var r=Math.max(-8,Math.min(8,Math.floor(n(t)/3)))*3,i=10**-r,a=y((e=o(e),e.type=`f`,e),{suffix:h[8+r/3]});return function(e){return a(i*e)}}return{format:y,formatPrefix:b}}var _,v,y;b({thousands:`,`,grouping:[3],currency:[`$`,``]});function b(e){return _=g(e),v=_.format,y=_.formatPrefix,_}export{n as i,y as n,o as r,v as t};
@@ -0,0 +1,43 @@
1
+ import{$t as e,Jt as t,On as n,Zt as r,_n as i,en as a,hn as o,in as s,k as c,kn as l,mn as u,mt as d,nn as f,on as p,tn as m}from"./index-Czi2sVlL.js";import{t as h}from"./mermaid-parser.core-DedvXRIg.js";import{t as g}from"./chunk-4BX2VUAB-DeAmcro3.js";var _={showLegend:!0,ticks:5,max:null,min:0,graticule:`circle`},v={axes:[],curves:[],options:_},y=structuredClone(v),b=e.radar,x=n(()=>c({...b,...f().radar}),`getConfig`),S=n(()=>y.axes,`getAxes`),C=n(()=>y.curves,`getCurves`),w=n(()=>y.options,`getOptions`),T=n(e=>{y.axes=e.map(e=>({name:e.name,label:e.label??e.name}))},`setAxes`),E=n(e=>{y.curves=e.map(e=>({name:e.name,label:e.label??e.name,entries:D(e.entries)}))},`setCurves`),D=n(e=>{if(e[0].axis==null)return e.map(e=>e.value);let t=S();if(t.length===0)throw Error(`Axes must be populated before curves for reference entries`);return t.map(t=>{let n=e.find(e=>e.axis?.$refText===t.name);if(n===void 0)throw Error(`Missing entry for axis `+t.label);return n.value})},`computeCurveEntries`),O={getAxes:S,getCurves:C,getOptions:w,setAxes:T,setCurves:E,setOptions:n(e=>{let t=e.reduce((e,t)=>(e[t.name]=t,e),{});y.options={showLegend:t.showLegend?.value??_.showLegend,ticks:t.ticks?.value??_.ticks,max:t.max?.value??_.max,min:t.min?.value??_.min,graticule:t.graticule?.value??_.graticule}},`setOptions`),getConfig:x,clear:n(()=>{t(),y=structuredClone(v)},`clear`),setAccTitle:o,getAccTitle:m,setDiagramTitle:i,getDiagramTitle:s,getAccDescription:a,setAccDescription:u},k=n(e=>{g(e,O);let{axes:t,curves:n,options:r}=e;O.setAxes(t),O.setCurves(n),O.setOptions(r)},`populate`),A={parse:n(async e=>{let t=await h(`radar`,e);l.debug(t),k(t)},`parse`)},j=n((e,t,n,r)=>{let i=r.db,a=i.getAxes(),o=i.getCurves(),s=i.getOptions(),c=i.getConfig(),l=i.getDiagramTitle(),u=M(d(t),c),f=s.max??Math.max(...o.map(e=>Math.max(...e.entries))),p=s.min,m=Math.min(c.width,c.height)/2;N(u,a,m,s.ticks,s.graticule),P(u,a,m,c),F(u,a,o,p,f,s.graticule,c),R(u,o,s.showLegend,c),u.append(`text`).attr(`class`,`radarTitle`).text(l).attr(`x`,0).attr(`y`,-c.height/2-c.marginTop)},`draw`),M=n((e,t)=>{let n=t.width+t.marginLeft+t.marginRight,i=t.height+t.marginTop+t.marginBottom,a={x:t.marginLeft+t.width/2,y:t.marginTop+t.height/2};return r(e,i,n,t.useMaxWidth??!0),e.attr(`viewBox`,`0 0 ${n} ${i}`),e.append(`g`).attr(`transform`,`translate(${a.x}, ${a.y})`)},`drawFrame`),N=n((e,t,n,r,i)=>{if(i===`circle`)for(let t=0;t<r;t++){let i=n*(t+1)/r;e.append(`circle`).attr(`r`,i).attr(`class`,`radarGraticule`)}else if(i===`polygon`){let i=t.length;for(let a=0;a<r;a++){let o=n*(a+1)/r,s=t.map((e,t)=>{let n=2*t*Math.PI/i-Math.PI/2;return`${o*Math.cos(n)},${o*Math.sin(n)}`}).join(` `);e.append(`polygon`).attr(`points`,s).attr(`class`,`radarGraticule`)}}},`drawGraticule`),P=n((e,t,n,r)=>{let i=t.length;for(let a=0;a<i;a++){let o=t[a].label,s=2*a*Math.PI/i-Math.PI/2;e.append(`line`).attr(`x1`,0).attr(`y1`,0).attr(`x2`,n*r.axisScaleFactor*Math.cos(s)).attr(`y2`,n*r.axisScaleFactor*Math.sin(s)).attr(`class`,`radarAxisLine`),e.append(`text`).text(o).attr(`x`,n*r.axisLabelFactor*Math.cos(s)).attr(`y`,n*r.axisLabelFactor*Math.sin(s)).attr(`class`,`radarAxisLabel`)}},`drawAxes`);function F(e,t,n,r,i,a,o){let s=t.length,c=Math.min(o.width,o.height)/2;n.forEach((t,n)=>{if(t.entries.length!==s)return;let l=t.entries.map((e,t)=>{let n=2*Math.PI*t/s-Math.PI/2,a=I(e,r,i,c);return{x:a*Math.cos(n),y:a*Math.sin(n)}});a===`circle`?e.append(`path`).attr(`d`,L(l,o.curveTension)).attr(`class`,`radarCurve-${n}`):a===`polygon`&&e.append(`polygon`).attr(`points`,l.map(e=>`${e.x},${e.y}`).join(` `)).attr(`class`,`radarCurve-${n}`)})}n(F,`drawCurves`);function I(e,t,n,r){return r*(Math.min(Math.max(e,t),n)-t)/(n-t)}n(I,`relativeRadius`);function L(e,t){let n=e.length,r=`M${e[0].x},${e[0].y}`;for(let i=0;i<n;i++){let a=e[(i-1+n)%n],o=e[i],s=e[(i+1)%n],c=e[(i+2)%n],l={x:o.x+(s.x-a.x)*t,y:o.y+(s.y-a.y)*t},u={x:s.x-(c.x-o.x)*t,y:s.y-(c.y-o.y)*t};r+=` C${l.x},${l.y} ${u.x},${u.y} ${s.x},${s.y}`}return`${r} Z`}n(L,`closedRoundCurve`);function R(e,t,n,r){if(!n)return;let i=(r.width/2+r.marginRight)*3/4,a=-(r.height/2+r.marginTop)*3/4;t.forEach((t,n)=>{let r=e.append(`g`).attr(`transform`,`translate(${i}, ${a+n*20})`);r.append(`rect`).attr(`width`,12).attr(`height`,12).attr(`class`,`radarLegendBox-${n}`),r.append(`text`).attr(`x`,16).attr(`y`,0).attr(`class`,`radarLegendText`).text(t.label)})}n(R,`drawLegend`);var z={draw:j},B=n((e,t)=>{let n=``;for(let r=0;r<e.THEME_COLOR_LIMIT;r++){let i=e[`cScale${r}`];n+=`
2
+ .radarCurve-${r} {
3
+ color: ${i};
4
+ fill: ${i};
5
+ fill-opacity: ${t.curveOpacity};
6
+ stroke: ${i};
7
+ stroke-width: ${t.curveStrokeWidth};
8
+ }
9
+ .radarLegendBox-${r} {
10
+ fill: ${i};
11
+ fill-opacity: ${t.curveOpacity};
12
+ stroke: ${i};
13
+ }
14
+ `}return n},`genIndexStyles`),V=n(e=>{let t=c(p(),f().themeVariables);return{themeVariables:t,radarOptions:c(t.radar,e)}},`buildRadarStyleOptions`),H={parser:A,db:O,renderer:z,styles:n(({radar:e}={})=>{let{themeVariables:t,radarOptions:n}=V(e);return`
15
+ .radarTitle {
16
+ font-size: ${t.fontSize};
17
+ color: ${t.titleColor};
18
+ dominant-baseline: hanging;
19
+ text-anchor: middle;
20
+ }
21
+ .radarAxisLine {
22
+ stroke: ${n.axisColor};
23
+ stroke-width: ${n.axisStrokeWidth};
24
+ }
25
+ .radarAxisLabel {
26
+ dominant-baseline: middle;
27
+ text-anchor: middle;
28
+ font-size: ${n.axisLabelFontSize}px;
29
+ color: ${n.axisColor};
30
+ }
31
+ .radarGraticule {
32
+ fill: ${n.graticuleColor};
33
+ fill-opacity: ${n.graticuleOpacity};
34
+ stroke: ${n.graticuleColor};
35
+ stroke-width: ${n.graticuleStrokeWidth};
36
+ }
37
+ .radarLegendText {
38
+ text-anchor: start;
39
+ font-size: ${n.legendFontSize}px;
40
+ dominant-baseline: hanging;
41
+ }
42
+ ${B(t,n)}
43
+ `},`styles`)};export{H as diagram};
@@ -0,0 +1,10 @@
1
+ import{$t as e,Jt as t,On as n,Zt as r,_n as i,en as a,hn as o,in as s,k as c,kn as l,mn as u,mt as d,nn as f,tn as p}from"./index-Czi2sVlL.js";import{t as m}from"./mermaid-parser.core-DedvXRIg.js";import{t as h}from"./chunk-4BX2VUAB-DeAmcro3.js";import{t as g}from"./chunk-QZHKN3VN-BZ-TNixB.js";var _=new g(()=>({cnt:1,stack:[{id:0,level:-1,name:`/`,children:[]}]})),v=n(()=>{_.reset(),t()},`clear`),y=n(()=>_.records.stack[0],`getRoot`),b=n(()=>_.records.cnt,`getCount`),x=e.treeView,S={clear:v,addNode:n((e,t)=>{for(;e<=_.records.stack[_.records.stack.length-1].level;)_.records.stack.pop();let n={id:_.records.cnt++,level:e,name:t,children:[]};_.records.stack[_.records.stack.length-1].children.push(n),_.records.stack.push(n)},`addNode`),getRoot:y,getCount:b,getConfig:n(()=>c(x,f().treeView),`getConfig`),getAccTitle:p,getAccDescription:a,getDiagramTitle:s,setAccDescription:u,setAccTitle:o,setDiagramTitle:i},C=n(e=>{h(e,S),e.nodes.map(e=>S.addNode(e.indent?parseInt(e.indent):0,e.name))},`populate`),w={parse:n(async e=>{let t=await m(`treeView`,e);l.debug(t),C(t)},`parse`)},T=n((e,t,n,r,i)=>{let a=r.append(`text`).text(n.name).attr(`dominant-baseline`,`middle`).attr(`class`,`treeView-node-label`),{height:o,width:s}=a.node().getBBox(),c=o+i.paddingY*2,l=s+i.paddingX*2;a.attr(`x`,e+i.paddingX),a.attr(`y`,t+c/2),n.BBox={x:e,y:t,width:l,height:c}},`positionLabel`),E=n((e,t,n,r,i,a)=>e.append(`line`).attr(`x1`,t).attr(`y1`,n).attr(`x2`,r).attr(`y2`,i).attr(`stroke-width`,a).attr(`class`,`treeView-node-line`),`positionLine`),D=n((e,t,r)=>{let i=0,a=0,o=n((e,t,n,r)=>{let o=r*(n.rowIndent+n.paddingX);T(o,i,t,e,n);let{height:s,width:c}=t.BBox;E(e,o-n.rowIndent,i+s/2,o,i+s/2,n.lineThickness),a=Math.max(a,o+c),i+=s},`drawNode`),s=n((t,n=0)=>{o(e,t,r,n),t.children.forEach(e=>{s(e,n+1)});let{x:i,y:a,height:c}=t.BBox;if(t.children.length){let{y:n,height:o}=t.children[t.children.length-1].BBox;E(e,i+r.paddingX,a+c,i+r.paddingX,n+o/2+r.lineThickness/2,r.lineThickness)}},`processNode`);return s(t),{totalHeight:i,totalWidth:a}},`drawTree`),O={draw:n((e,t,n,i)=>{l.debug(`Rendering treeView diagram
2
+ `+e);let a=i.db,o=a.getRoot(),s=a.getConfig(),c=d(t),u=c.append(`g`);u.attr(`class`,`tree-view`);let{totalHeight:f,totalWidth:p}=D(u,o,s);c.attr(`viewBox`,`-${s.lineThickness/2} 0 ${p} ${f}`),r(c,f,p,s.useMaxWidth)},`draw`)},k={labelFontSize:`16px`,labelColor:`black`,lineColor:`black`},A={db:S,renderer:O,parser:w,styles:n(({treeView:e})=>{let{labelFontSize:t,labelColor:n,lineColor:r}=c(k,e);return`
3
+ .treeView-node-label {
4
+ font-size: ${t};
5
+ fill: ${n};
6
+ }
7
+ .treeView-node-line {
8
+ stroke: ${r};
9
+ }
10
+ `},`styles`)};export{A as diagram};
@@ -0,0 +1,3 @@
1
+ import{$t as e,E as t,Gt as n,Jt as r,L as i,On as a,_n as o,en as s,hn as c,in as l,k as u,kn as d,mn as f,nn as p,pn as m,rn as h,tn as g,yn as _}from"./index-Czi2sVlL.js";import{S as ee,t as te}from"./mermaid-parser.core-DedvXRIg.js";import{t as ne}from"./chunk-4BX2VUAB-DeAmcro3.js";var v=`position frame`,y=`frame positioned`,b=`position relation`,x=`relation positioned`,re=a(function(e){d.debug(`options str`,e)},`setOptions`),ie=a(function(){return{}},`getOptions`),ae=a(function(){S(),r()},`clear`);function S(){C={}}a(S,`reset`);var oe=e.eventmodeling,se=a(()=>u({...oe,...p().eventmodeling}),`getConfig`),C={};function w(){let e=ce,{ast:t}=C,n=D();if(!t)throw Error(`No data for EventModel`);return t.frames.forEach((r,i)=>{let a=P(r,t.dataEntities,n);e=J(e,{$kind:v,index:i,frame:r,textProps:a});let o;V(r)?(d.debug(`source frame`,r.sourceFrames),o=t.frames.filter(e=>r.sourceFrames.some(t=>t.$refText===e.name)),o.forEach(t=>{e=J(e,{$kind:b,index:i,frame:r,sourceFrame:t})})):e=J(e,{$kind:b,index:i,frame:r})}),e={...e,sortedSwimlanesArray:R(e.swimlanes)},e}a(w,`getState`);function T(e){C.ast=e}a(T,`setAst`);var E={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:`bold`,boxTextPadding:10,swimlaneTextFontWeight:`bold`,labelUiAutomation:`UI/Automation`,labelUiAutomationPrefix:`UI/A: `,labelCommandReadModel:`Command/Read Model`,labelCommandReadModelPrefix:`C/RM: `,labelEvents:`Events`,labelEventsPrefix:`Stream: `};function D(){return E}a(D,`getDiagramProps`);var ce={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function O(e){let t=e.split(`.`);if(t.length===2)return t[0]}a(O,`extractNamespace`);function k(e){let t=e.split(`.`);return t.length===2?t[1]:e}a(k,`extractName`);function A(e,t){if(!(!t||t.length===0))return Object.values(e).find(e=>e.namespace===t)}a(A,`findSwimlaneByNamespace`);function j(e,t,n){return Math.max(t,...Object.keys(e).filter(e=>{let r=Number.parseInt(e);return r>t&&r<n}).map(e=>Number.parseInt(e)))+1}a(j,`findNextAvailableIndex`);function M(e,t){let n=O(e.entityIdentifier),r=A(t,n);switch(e.modelEntityType){case`ui`:case`pcr`:case`processor`:return r?{index:r.index,label:r.namespace||E.labelUiAutomation}:n?{index:j(t,0,100),label:E.labelUiAutomationPrefix+n}:{index:0,label:E.labelUiAutomation};case`rmo`:case`readmodel`:case`cmd`:case`command`:return r?{index:r.index,label:r.namespace||E.labelCommandReadModel}:n?{index:j(t,100,200),label:E.labelCommandReadModelPrefix+n}:{index:100,label:E.labelCommandReadModel};default:return r?{index:r.index,label:r.namespace||E.labelEvents}:n?{index:j(t,200,300),label:E.labelEventsPrefix+n}:{index:200,label:E.labelEvents}}}a(M,`calculateSwimlaneProps`);function N(e){let{themeVariables:t}=p();switch(e.modelEntityType){case`ui`:return{fill:t.emUiFill??`white`,stroke:t.emUiStroke??`#dbdada`};case`pcr`:case`processor`:return{fill:t.emProcessorFill??`#edb3f6`,stroke:t.emProcessorStroke??`#b88cbf`};case`rmo`:case`readmodel`:return{fill:t.emReadModelFill??`#d3f1a2`,stroke:t.emReadModelStroke??`#a3b732`};case`cmd`:case`command`:return{fill:t.emCommandFill??`#bcd6fe`,stroke:t.emCommandStroke??`#679ac3`};case`evt`:case`event`:return{fill:t.emEventFill??`#ffb778`,stroke:t.emEventStroke??`#c19a0f`};default:return{fill:`red`,stroke:`black`}}}a(N,`calculateEntityVisualProps`);function P(e,n,r){let a=p(),o=m(k(e.entityIdentifier)??``,a),s,c={fontSize:16,fontWeight:700,fontFamily:`"trebuchet ms", verdana, arial, sans-serif`,joinWith:`<br/>`},l=`<b>${i(o,r.textMaxWidth,c)}</b>`;if(e.dataInlineValue&&(s=e.dataInlineValue,s=s.substring(s.indexOf(`{`)+1),s=s.substring(0,s.lastIndexOf(`}`)-1),s=m(s,a),s=i(s,r.textMaxWidth,c),s=s.replaceAll(` `,`&nbsp;`)),e.dataReference){let t=n.find(t=>t.name===e.dataReference?.$refText);t&&(s=t.dataBlockValue,s=s.substring(s.indexOf(`{
2
+ `)+2),s=s.substring(0,s.lastIndexOf(`}`)-1),s=m(s,a),s=i(s,r.textMaxWidth,c),s=s.replaceAll(` `,`&nbsp;`),s+=`<br/>`)}let u=s!==void 0;u&&(l+=`<br/><br/><code style="text-align: left; display: block;max-width:${r.textMaxWidth}px">${s}</code>`);let f={fontSize:c.fontSize,fontWeight:c.fontWeight,fontFamily:c.fontFamily},h=t(l,f),g=u?h.width/3:h.width,_={content:l,width:g,height:h.height};return d.debug(`[${e.name}] ${e.entityIdentifier} text`,_),_}a(P,`calculateTextProps`);function F(e,t){let n=t,r=N(n.frame),i={width:n.textProps.width+2*E.boxTextPadding,height:n.textProps.height+2*E.boxTextPadding};return[{$kind:y,frame:n.frame,index:n.index,visual:r,dimension:i,textProps:n.textProps}]}a(F,`decidePositionFrame`);function I(e,t,n){return t===void 0?E.contentStartX:t.index===e.index&&e.r?e.r+E.boxPadding:n===void 0?E.contentStartX:n.r-E.boxOverlap+E.boxPadding}a(I,`calculateX`);function L(e,t){let n=[...e.map(e=>e.r),t];return Math.max(...n)}a(L,`calculateMaxRight`);function R(e){return Object.values(e).sort((e,t)=>e.index-t.index)}a(R,`sortedSwimlanesArray`);function z(e,t){let n=t,r=M(n.frame,e.swimlanes),i;i=r.index in e.swimlanes?e.swimlanes[r.index]:{index:r.index,label:r.label,r:0,y:r.index*E.swimlaneMinHeight+E.swimlaneGap,height:E.swimlaneMinHeight,maxHeight:E.swimlaneMinHeight};let a=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,o=e.previousSwimlaneNumber===void 0?void 0:e.swimlanes[e.previousSwimlaneNumber],s={width:Math.max(E.boxMinWidth,Math.min(E.boxMaxWidth,n.dimension.width))+2*E.boxPadding,height:Math.max(E.boxMinHeight,Math.min(E.boxMaxHeight,n.dimension.height))+2*E.boxPadding},c=I(i,o,a),l=c+s.width+E.boxPadding,u=L(Object.values(e.swimlanes),l);i.r=c+s.width,i.maxHeight=Math.max(i.maxHeight,s.height),i.height=Math.max(E.swimlaneMinHeight,i.maxHeight)+2*E.swimlanePadding;let d={x:c,y:E.swimlanePadding+i.y,r:l,dimension:s,leftSibling:!1,swimlane:i,visual:n.visual,text:n.textProps.content,frame:n.frame,index:n.index},f={...e,boxes:[...e.boxes,d],swimlanes:{...e.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:r.index,previousFrame:n.frame,maxR:u},p=R(f.swimlanes);p.length>0&&(p[0].y=0);for(let e=1;e<p.length;e++){let t=p[e],n=p[e-1];t.y=n.y+n.height+E.swimlaneGap}return f}a(z,`evolveFramePositioned`);function B(e,t){return e===0&&t.sourceFrames.length===0}a(B,`isFirstFrame`);function V(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}a(V,`hasSourceFrame`);function H(e,t){if(t!=null)return e.find(e=>e.frame.name===t.name)}a(H,`findBoxByFrame`);function U(e,t,n){if(!(n<0))for(let r=n;r>=0;r--){let n=e[r];if(n.swimlane.index!==t)return n}}a(U,`findBoxByLineIndex`);function W(e,t){let n=t;if(ee(n.frame)||B(n.index,n.frame))return[];let r=H(e.boxes,n.frame);if(r===void 0)throw Error(`Target box not found for frame ${n.frame.name}`);let i;return i=n.sourceFrame?H(e.boxes,n.sourceFrame):U(e.boxes,r.swimlane.index,n.index-1),i===void 0?[]:[{$kind:x,frame:n.frame,index:n.index,sourceBox:i,targetBox:r}]}a(W,`decidePositionRelation`);function G(e,t){let n=t,r={visual:{fill:`none`,stroke:`#000`},source:{x:n.sourceBox.x,y:n.sourceBox.y},target:{x:n.targetBox.x,y:n.targetBox.y},sourceBox:n.sourceBox,targetBox:n.targetBox};return{...e,relations:[...e.relations,r]}}a(G,`evolveRelationPositioned`);var le={[v]:F,[b]:W},ue={[y]:z,[x]:G};function K(e,t){let n=le[t.$kind];if(n==null)return[];let r=n(e,t);return d.debug(`decided events`,r),r}a(K,`decide`);function q(e,t){let n=t.reduce((e,t)=>{let n=ue[t.$kind];return n==null?e:n(e,t)},e);return d.debug(`evolve events`,{state:e,newState:n,events:t}),n}a(q,`evolve`);function J(e,t){return q(e,K(e,t))}a(J,`dispatch`);var Y={getConfig:se,setOptions:re,getOptions:ie,clear:ae,setAccTitle:c,getAccTitle:g,getAccDescription:s,setAccDescription:f,setDiagramTitle:o,getDiagramTitle:l,setAst:T,getDiagramProps:D,getState:w},de={parse:a(async e=>{let t=await te(`eventmodeling`,e);d.debug(t),Y.setAst(t),ne(t,Y)},`parse`)},fe=h()?.eventmodeling;function X(e,t){return n=>{let r=n.swimlane.y+t.swimlanePadding,i=e.append(`g`).attr(`class`,`em-box`);i.append(`rect`).attr(`x`,n.x).attr(`y`,r).attr(`rx`,`3`).attr(`width`,n.dimension.width).attr(`height`,n.dimension.height).attr(`stroke`,n.visual.stroke).attr(`fill`,n.visual.fill),i.append(`foreignObject`).attr(`x`,n.x+t.boxPadding).attr(`y`,r+10).attr(`width`,n.dimension.width-2*t.boxPadding).attr(`height`,n.dimension.height-2*t.boxPadding).append(`xhtml:div`).style(`display`,`table`).style(`height`,`100%`).style(`width`,`100%`).append(`span`).style(`display`,`table-cell`).style(`text-align`,`center`).style(`vertical-align`,`middle`).html(n.text)}}a(X,`renderD3Box`);function Z(e,t){return e>t}a(Z,`dirUpwards`);function Q(e,t,n,r){return i=>{let a=i.sourceBox.swimlane.y+t.swimlanePadding,o=i.targetBox.swimlane.y+t.swimlanePadding,s=Z(a,o),c=i.sourceBox.x+i.sourceBox.dimension.width*2/3,l=i.targetBox.x+i.targetBox.dimension.width/3,u,f;d.debug(`rendering relation up=${s} for `,{sourceBox:i.sourceBox,targetBox:i.targetBox}),s?(u=a,f=o+i.targetBox.dimension.height):(u=a+i.sourceBox.dimension.height,f=o);let p=r.emRelationStroke??i.visual.stroke;e.append(`path`).attr(`class`,`em-relation`).attr(`fill`,i.visual.fill).attr(`stroke`,p).attr(`stroke-width`,`1`).attr(`marker-end`,`url(#${n})`).attr(`d`,`M${c} ${u} L${l} ${f}`)}}a(Q,`renderD3Relation`);function $(e,t,n,r){return i=>{let a=e.append(`g`).attr(`class`,`em-swimlane`),o=r.emSwimlaneBackgroundOdd??`rgb(250,250,250)`,s=r.emSwimlaneBackgroundStroke??`rgb(240,240,240)`;a.append(`rect`).attr(`x`,0).attr(`y`,i.y).attr(`rx`,`3`).attr(`width`,t+n.swimlanePadding).attr(`height`,i.height).attr(`fill`,o).attr(`stroke`,s),a.append(`text`).attr(`font-weight`,n.swimlaneTextFontWeight).attr(`x`,30).attr(`y`,i.y+30).text(i.label)}}a($,`renderD3Swimlane`);var pe={parser:de,db:Y,renderer:{draw:a(function(e,t,r,i){if(d.debug(`in eventmodeling renderer`,e+`
3
+ `,`id:`,t,r),!fe)throw Error(`EventModeling config not found`);let a=i.db,{themeVariables:o,eventmodeling:s}=h(),c=n(`[id="${t}"]`),l=a.getDiagramProps(),u=a.getState(),f=`em-arrowhead-${t}`,p=o.emArrowhead??`#000000`;u.sortedSwimlanesArray.forEach($(c,u.maxR,l,o)),u.boxes.forEach(X(c,l)),u.relations.forEach(Q(c,l,f,o)),c.append(`defs`).append(`marker`).attr(`id`,f).attr(`markerWidth`,`10`).attr(`markerHeight`,`7`).attr(`refX`,`10`).attr(`refY`,`3.5`).attr(`orient`,`auto`).append(`polygon`).attr(`points`,`0 0, 10 3.5, 0 7`).attr(`fill`,p),_(void 0,c,s?.padding??30,s?.useMaxWidth)},`draw`)},styles:a(e=>``,`getStyles`)};export{pe as diagram};
@@ -0,0 +1,24 @@
1
+ import{$t as e,Jt as t,On as n,Zt as r,_n as i,en as a,hn as o,in as s,k as c,kn as l,mn as u,mt as d,nn as f,tn as p}from"./index-Czi2sVlL.js";import{t as m}from"./mermaid-parser.core-DedvXRIg.js";import{t as h}from"./chunk-4BX2VUAB-DeAmcro3.js";var g=e.packet,_=class{constructor(){this.packet=[],this.setAccTitle=o,this.getAccTitle=p,this.setDiagramTitle=i,this.getDiagramTitle=s,this.getAccDescription=a,this.setAccDescription=u}static{n(this,`PacketDB`)}getConfig(){let e=c({...g,...f().packet});return e.showBits&&(e.paddingY+=10),e}getPacket(){return this.packet}pushWord(e){e.length>0&&this.packet.push(e)}clear(){t(),this.packet=[]}},v=1e4,y=n((e,t)=>{h(e,t);let n=-1,r=[],i=1,{bitsPerRow:a}=t.getConfig();for(let{start:o,end:s,bits:c,label:u}of e.blocks){if(o!==void 0&&s!==void 0&&s<o)throw Error(`Packet block ${o} - ${s} is invalid. End must be greater than start.`);if(o??=n+1,o!==n+1)throw Error(`Packet block ${o} - ${s??o} is not contiguous. It should start from ${n+1}.`);if(c===0)throw Error(`Packet block ${o} is invalid. Cannot have a zero bit field.`);for(s??=o+(c??1)-1,c??=s-o+1,n=s,l.debug(`Packet block ${o} - ${n} with label ${u}`);r.length<=a+1&&t.getPacket().length<v;){let[e,n]=b({start:o,end:s,bits:c,label:u},i,a);if(r.push(e),e.end+1===i*a&&(t.pushWord(r),r=[],i++),!n)break;({start:o,end:s,bits:c,label:u}=n)}}t.pushWord(r)},`populate`),b=n((e,t,n)=>{if(e.start===void 0)throw Error(`start should have been set during first phase`);if(e.end===void 0)throw Error(`end should have been set during first phase`);if(e.start>e.end)throw Error(`Block start ${e.start} is greater than block end ${e.end}.`);if(e.end+1<=t*n)return[e,void 0];let r=t*n-1,i=t*n;return[{start:e.start,end:r,label:e.label,bits:r-e.start},{start:i,end:e.end,label:e.label,bits:e.end-i}]},`getNextFittingBlock`),x={parser:{yy:void 0},parse:n(async e=>{let t=await m(`packet`,e),n=x.parser?.yy;if(!(n instanceof _))throw Error(`parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);l.debug(t),y(t,n)},`parse`)},S=n((e,t,n,i)=>{let a=i.db,o=a.getConfig(),{rowHeight:s,paddingY:c,bitWidth:l,bitsPerRow:u}=o,f=a.getPacket(),p=a.getDiagramTitle(),m=s+c,h=m*(f.length+1)-(p?0:s),g=l*u+2,_=d(t);_.attr(`viewBox`,`0 0 ${g} ${h}`),r(_,h,g,o.useMaxWidth);for(let[e,t]of f.entries())C(_,t,e,o);_.append(`text`).text(p).attr(`x`,g/2).attr(`y`,h-m/2).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).attr(`class`,`packetTitle`)},`draw`),C=n((e,t,n,{rowHeight:r,paddingX:i,paddingY:a,bitWidth:o,bitsPerRow:s,showBits:c})=>{let l=e.append(`g`),u=n*(r+a)+a;for(let e of t){let t=e.start%s*o+1,n=(e.end-e.start+1)*o-i;if(l.append(`rect`).attr(`x`,t).attr(`y`,u).attr(`width`,n).attr(`height`,r).attr(`class`,`packetBlock`),l.append(`text`).attr(`x`,t+n/2).attr(`y`,u+r/2).attr(`class`,`packetLabel`).attr(`dominant-baseline`,`middle`).attr(`text-anchor`,`middle`).text(e.label),!c)continue;let a=e.end===e.start,d=u-2;l.append(`text`).attr(`x`,t+(a?n/2:0)).attr(`y`,d).attr(`class`,`packetByte start`).attr(`dominant-baseline`,`auto`).attr(`text-anchor`,a?`middle`:`start`).text(e.start),a||l.append(`text`).attr(`x`,t+n).attr(`y`,d).attr(`class`,`packetByte end`).attr(`dominant-baseline`,`auto`).attr(`text-anchor`,`end`).text(e.end)}},`drawWord`),w={draw:S},T={byteFontSize:`10px`,startByteColor:`black`,endByteColor:`black`,labelColor:`black`,labelFontSize:`12px`,titleColor:`black`,titleFontSize:`14px`,blockStrokeColor:`black`,blockStrokeWidth:`1`,blockFillColor:`#efefef`},E={parser:x,get db(){return new _},renderer:w,styles:n(({packet:e}={})=>{let t=c(T,e);return`
2
+ .packetByte {
3
+ font-size: ${t.byteFontSize};
4
+ }
5
+ .packetByte.start {
6
+ fill: ${t.startByteColor};
7
+ }
8
+ .packetByte.end {
9
+ fill: ${t.endByteColor};
10
+ }
11
+ .packetLabel {
12
+ fill: ${t.labelColor};
13
+ font-size: ${t.labelFontSize};
14
+ }
15
+ .packetTitle {
16
+ fill: ${t.titleColor};
17
+ font-size: ${t.titleFontSize};
18
+ }
19
+ .packetBlock {
20
+ stroke: ${t.blockStrokeColor};
21
+ stroke-width: ${t.blockStrokeWidth};
22
+ fill: ${t.blockFillColor};
23
+ }
24
+ `},`styles`)};export{E as diagram};
@@ -0,0 +1,24 @@
1
+ import{t as e}from"./ordinal-hYBb2elL.js";import{t}from"./defaultLocale-C8Fc0cco.js";import{$t as n,C as r,Gt as i,Jt as a,On as o,S as s,Zt as c,_n as l,en as u,hn as d,in as f,k as p,kn as m,mn as h,mt as g,nn as _,on as v,tn as y}from"./index-Czi2sVlL.js";import{t as b}from"./mermaid-parser.core-DedvXRIg.js";import{t as x}from"./chunk-4BX2VUAB-DeAmcro3.js";import{t as S}from"./chunk-2J33WTMH-eTp7ioqm.js";function C(e){var t=0,n=e.children,r=n&&n.length;if(!r)t=1;else for(;--r>=0;)t+=n[r].value;e.value=t}function w(){return this.eachAfter(C)}function T(e,t){let n=-1;for(let r of this)e.call(t,r,++n,this);return this}function E(e,t){for(var n=this,r=[n],i,a,o=-1;n=r.pop();)if(e.call(t,n,++o,this),i=n.children)for(a=i.length-1;a>=0;--a)r.push(i[a]);return this}function D(e,t){for(var n=this,r=[n],i=[],a,o,s,c=-1;n=r.pop();)if(i.push(n),a=n.children)for(o=0,s=a.length;o<s;++o)r.push(a[o]);for(;n=i.pop();)e.call(t,n,++c,this);return this}function O(e,t){let n=-1;for(let r of this)if(e.call(t,r,++n,this))return r}function k(e){return this.eachAfter(function(t){for(var n=+e(t.data)||0,r=t.children,i=r&&r.length;--i>=0;)n+=r[i].value;t.value=n})}function A(e){return this.eachBefore(function(t){t.children&&t.children.sort(e)})}function j(e){for(var t=this,n=M(t,e),r=[t];t!==n;)t=t.parent,r.push(t);for(var i=r.length;e!==n;)r.splice(i,0,e),e=e.parent;return r}function M(e,t){if(e===t)return e;var n=e.ancestors(),r=t.ancestors(),i=null;for(e=n.pop(),t=r.pop();e===t;)i=e,e=n.pop(),t=r.pop();return i}function N(){for(var e=this,t=[e];e=e.parent;)t.push(e);return t}function P(){return Array.from(this)}function F(){var e=[];return this.eachBefore(function(t){t.children||e.push(t)}),e}function I(){var e=this,t=[];return e.each(function(n){n!==e&&t.push({source:n.parent,target:n})}),t}function*L(){var e=this,t,n=[e],r,i,a;do for(t=n.reverse(),n=[];e=t.pop();)if(yield e,r=e.children)for(i=0,a=r.length;i<a;++i)n.push(r[i]);while(n.length)}function R(e,t){e instanceof Map?(e=[void 0,e],t===void 0&&(t=V)):t===void 0&&(t=B);for(var n=new W(e),r,i=[n],a,o,s,c;r=i.pop();)if((o=t(r.data))&&(c=(o=Array.from(o)).length))for(r.children=o,s=c-1;s>=0;--s)i.push(a=o[s]=new W(o[s])),a.parent=r,a.depth=r.depth+1;return n.eachBefore(U)}function z(){return R(this).eachBefore(H)}function B(e){return e.children}function V(e){return Array.isArray(e)?e[1]:null}function H(e){e.data.value!==void 0&&(e.value=e.data.value),e.data=e.data.data}function U(e){var t=0;do e.height=t;while((e=e.parent)&&e.height<++t)}function W(e){this.data=e,this.depth=this.height=0,this.parent=null}W.prototype=R.prototype={constructor:W,count:w,each:T,eachAfter:D,eachBefore:E,find:O,sum:k,sort:A,path:j,ancestors:N,descendants:P,leaves:F,links:I,copy:z,[Symbol.iterator]:L};function G(e){if(typeof e!=`function`)throw Error();return e}function K(){return 0}function q(e){return function(){return e}}function J(e){e.x0=Math.round(e.x0),e.y0=Math.round(e.y0),e.x1=Math.round(e.x1),e.y1=Math.round(e.y1)}function ee(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(r-t)/e.value;++s<c;)o=a[s],o.y0=n,o.y1=i,o.x0=t,o.x1=t+=o.value*l}function te(e,t,n,r,i){for(var a=e.children,o,s=-1,c=a.length,l=e.value&&(i-n)/e.value;++s<c;)o=a[s],o.x0=t,o.x1=r,o.y0=n,o.y1=n+=o.value*l}var ne=(1+Math.sqrt(5))/2;function re(e,t,n,r,i,a){for(var o=[],s=t.children,c,l,u=0,d=0,f=s.length,p,m,h=t.value,g,_,v,y,b,x,S;u<f;){p=i-n,m=a-r;do g=s[d++].value;while(!g&&d<f);for(_=v=g,x=Math.max(m/p,p/m)/(h*e),S=g*g*x,b=Math.max(v/S,S/_);d<f;++d){if(g+=l=s[d].value,l<_&&(_=l),l>v&&(v=l),S=g*g*x,y=Math.max(v/S,S/_),y>b){g-=l;break}b=y}o.push(c={value:g,dice:p<m,children:s.slice(u,d)}),c.dice?ee(c,n,r,i,h?r+=m*g/h:a):te(c,n,r,h?n+=p*g/h:i,a),h-=g,u=d}return o}var ie=(function e(t){function n(e,n,r,i,a){re(t,e,n,r,i,a)}return n.ratio=function(t){return e((t=+t)>1?t:1)},n})(ne);function ae(){var e=ie,t=!1,n=1,r=1,i=[0],a=K,o=K,s=K,c=K,l=K;function u(e){return e.x0=e.y0=0,e.x1=n,e.y1=r,e.eachBefore(d),i=[0],t&&e.eachBefore(J),e}function d(t){var n=i[t.depth],r=t.x0+n,u=t.y0+n,d=t.x1-n,f=t.y1-n;d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),t.x0=r,t.y0=u,t.x1=d,t.y1=f,t.children&&(n=i[t.depth+1]=a(t)/2,r+=l(t)-n,u+=o(t)-n,d-=s(t)-n,f-=c(t)-n,d<r&&(r=d=(r+d)/2),f<u&&(u=f=(u+f)/2),e(t,r,u,d,f))}return u.round=function(e){return arguments.length?(t=!!e,u):t},u.size=function(e){return arguments.length?(n=+e[0],r=+e[1],u):[n,r]},u.tile=function(t){return arguments.length?(e=G(t),u):e},u.padding=function(e){return arguments.length?u.paddingInner(e).paddingOuter(e):u.paddingInner()},u.paddingInner=function(e){return arguments.length?(a=typeof e==`function`?e:q(+e),u):a},u.paddingOuter=function(e){return arguments.length?u.paddingTop(e).paddingRight(e).paddingBottom(e).paddingLeft(e):u.paddingTop()},u.paddingTop=function(e){return arguments.length?(o=typeof e==`function`?e:q(+e),u):o},u.paddingRight=function(e){return arguments.length?(s=typeof e==`function`?e:q(+e),u):s},u.paddingBottom=function(e){return arguments.length?(c=typeof e==`function`?e:q(+e),u):c},u.paddingLeft=function(e){return arguments.length?(l=typeof e==`function`?e:q(+e),u):l},u}var Y=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=d,this.getAccTitle=y,this.setDiagramTitle=l,this.getDiagramTitle=f,this.getAccDescription=u,this.setAccDescription=h}static{o(this,`TreeMapDB`)}getNodes(){return this.nodes}getConfig(){let e=n,t=_();return p({...e.treemap,...t.treemap??{}})}addNode(e,t){this.nodes.push(e),this.levels.set(e,t),t===0&&(this.outerNodes.push(e),this.root??=e)}getRoot(){return{name:``,children:this.outerNodes}}addClass(e,t){let n=this.classes.get(e)??{id:e,styles:[],textStyles:[]},r=t.replace(/\\,/g,`§§§`).replace(/,/g,`;`).replace(/§§§/g,`,`).split(`;`);r&&r.forEach(e=>{s(e)&&(n?.textStyles?n.textStyles.push(e):n.textStyles=[e]),n?.styles?n.styles.push(e):n.styles=[e]}),this.classes.set(e,n)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){a(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function X(e){if(!e.length)return[];let t=[],n=[];return e.forEach(e=>{let r={name:e.name,children:e.type===`Leaf`?void 0:[]};for(r.classSelector=e?.classSelector,e?.cssCompiledStyles&&(r.cssCompiledStyles=e.cssCompiledStyles),e.type===`Leaf`&&e.value!==void 0&&(r.value=e.value);n.length>0&&n[n.length-1].level>=e.level;)n.pop();if(n.length===0)t.push(r);else{let e=n[n.length-1].node;e.children?e.children.push(r):e.children=[r]}e.type!==`Leaf`&&n.push({node:r,level:e.level})}),t}o(X,`buildHierarchy`);var oe=o((e,t)=>{x(e,t);let n=[];for(let n of e.TreemapRows??[])n.$type===`ClassDefStatement`&&t.addClass(n.className??``,n.styleText??``);for(let r of e.TreemapRows??[]){let e=r.item;if(!e)continue;let i=r.indent?parseInt(r.indent):0,a=se(e),o=e.classSelector?t.getStylesForClass(e.classSelector):[],s=o.length>0?o:void 0,c={level:i,name:a,type:e.$type,value:e.value,classSelector:e.classSelector,cssCompiledStyles:s};n.push(c)}let r=X(n),i=o((e,n)=>{for(let r of e)t.addNode(r,n),r.children&&r.children.length>0&&i(r.children,n+1)},`addNodesRecursively`);i(r,0)},`populate`),se=o(e=>e.name?String(e.name):``,`getItemName`),Z={parser:{yy:void 0},parse:o(async e=>{try{let t=await b(`treemap`,e);m.debug(`Treemap AST:`,t);let n=Z.parser?.yy;if(!(n instanceof Y))throw Error(`parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.`);oe(t,n)}catch(e){throw m.error(`Error parsing treemap:`,e),e}},`parse`)},ce=10,Q=10,$=25,le={draw:o((n,a,s,l)=>{let u=l.db,d=u.getConfig(),f=d.padding??ce,p=u.getDiagramTitle(),h=u.getRoot(),{themeVariables:v}=_();if(!h)return;let y=p?30:0,b=g(a),x=d.nodeWidth?d.nodeWidth*Q:960,C=d.nodeHeight?d.nodeHeight*Q:500,w=x,T=C+y;b.attr(`viewBox`,`0 0 ${w} ${T}`),c(b,T,w,d.useMaxWidth);let E;try{let e=d.valueFormat||`,`;if(e===`$0,0`)E=o(e=>`$`+t(`,`)(e),`valueFormat`);else if(e.startsWith(`$`)&&e.includes(`,`)){let n=/\.\d+/.exec(e),r=n?n[0]:``;E=o(e=>`$`+t(`,`+r)(e),`valueFormat`)}else if(e.startsWith(`$`)){let n=e.substring(1);E=o(e=>`$`+t(n||``)(e),`valueFormat`)}else E=t(e)}catch(e){m.error(`Error creating format function:`,e),E=t(`,`)}let D=e().range([`transparent`,v.cScale0,v.cScale1,v.cScale2,v.cScale3,v.cScale4,v.cScale5,v.cScale6,v.cScale7,v.cScale8,v.cScale9,v.cScale10,v.cScale11]),O=e().range([`transparent`,v.cScalePeer0,v.cScalePeer1,v.cScalePeer2,v.cScalePeer3,v.cScalePeer4,v.cScalePeer5,v.cScalePeer6,v.cScalePeer7,v.cScalePeer8,v.cScalePeer9,v.cScalePeer10,v.cScalePeer11]),k=e().range([v.cScaleLabel0,v.cScaleLabel1,v.cScaleLabel2,v.cScaleLabel3,v.cScaleLabel4,v.cScaleLabel5,v.cScaleLabel6,v.cScaleLabel7,v.cScaleLabel8,v.cScaleLabel9,v.cScaleLabel10,v.cScaleLabel11]);p&&b.append(`text`).attr(`x`,w/2).attr(`y`,y/2).attr(`class`,`treemapTitle`).attr(`text-anchor`,`middle`).attr(`dominant-baseline`,`middle`).text(p);let A=b.append(`g`).attr(`transform`,`translate(0, ${y})`).attr(`class`,`treemapContainer`),j=R(h).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),M=ae().size([x,C]).paddingTop(e=>e.children&&e.children.length>0?$+Q:0).paddingInner(f).paddingLeft(e=>e.children&&e.children.length>0?Q:0).paddingRight(e=>e.children&&e.children.length>0?Q:0).paddingBottom(e=>e.children&&e.children.length>0?Q:0).round(!0)(j),N=M.descendants().filter(e=>e.children&&e.children.length>0),P=A.selectAll(`.treemapSection`).data(N).enter().append(`g`).attr(`class`,`treemapSection`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);P.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,$).attr(`class`,`treemapSectionHeader`).attr(`fill`,`none`).attr(`fill-opacity`,.6).attr(`stroke-width`,.6).attr(`style`,e=>e.depth===0?`display: none;`:``),P.append(`clipPath`).attr(`id`,(e,t)=>`clip-section-${a}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-12)).attr(`height`,$),P.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,(e,t)=>`treemapSection section${t}`).attr(`fill`,e=>D(e.data.name)).attr(`fill-opacity`,.6).attr(`stroke`,e=>O(e.data.name)).attr(`stroke-width`,2).attr(`stroke-opacity`,.4).attr(`style`,e=>{if(e.depth===0)return`display: none;`;let t=r({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+`;`+t.borderStyles.join(`;`)}),P.append(`text`).attr(`class`,`treemapSectionLabel`).attr(`x`,6).attr(`y`,$/2).attr(`dominant-baseline`,`middle`).text(e=>e.depth===0?``:e.data.name).attr(`font-weight`,`bold`).attr(`style`,e=>e.depth===0?`display: none;`:`dominant-baseline: middle; font-size: 12px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+r({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).each(function(e){if(e.depth===0)return;let t=i(this),n=e.data.name;t.text(n);let r=e.x1-e.x0,a;a=d.showValues!==!1&&e.value?r-10-30-10-6:r-6-6;let o=Math.max(15,a),s=t.node();if(s.getComputedTextLength()>o){let e=n;for(;e.length>0;){if(e=n.substring(0,e.length-1),e.length===0){t.text(`...`),s.getComputedTextLength()>o&&t.text(``);break}if(t.text(e+`...`),s.getComputedTextLength()<=o)break}}}),d.showValues!==!1&&P.append(`text`).attr(`class`,`treemapSectionValue`).attr(`x`,e=>e.x1-e.x0-10).attr(`y`,$/2).attr(`text-anchor`,`end`).attr(`dominant-baseline`,`middle`).text(e=>e.value?E(e.value):``).attr(`font-style`,`italic`).attr(`style`,e=>e.depth===0?`display: none;`:`text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:`+k(e.data.name)+`; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;`+r({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`));let F=M.leaves(),I=A.selectAll(`.treemapLeafGroup`).data(F).enter().append(`g`).attr(`class`,(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:``}x`).attr(`transform`,e=>`translate(${e.x0},${e.y0})`);I.append(`rect`).attr(`width`,e=>e.x1-e.x0).attr(`height`,e=>e.y1-e.y0).attr(`class`,`treemapLeaf`).attr(`fill`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`style`,e=>r({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr(`fill-opacity`,.3).attr(`stroke`,e=>e.parent?D(e.parent.data.name):D(e.data.name)).attr(`stroke-width`,3),I.append(`clipPath`).attr(`id`,(e,t)=>`clip-${a}-${t}`).append(`rect`).attr(`width`,e=>Math.max(0,e.x1-e.x0-4)).attr(`height`,e=>Math.max(0,e.y1-e.y0-4)),I.append(`text`).attr(`class`,`treemapLabel`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,e=>(e.y1-e.y0)/2).attr(`style`,e=>`text-anchor: middle; dominant-baseline: middle; font-size: 38px;fill:`+k(e.data.name)+`;`+r({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${a}-${t})`).text(e=>e.data.name).each(function(e){let t=i(this),n=e.x1-e.x0,r=e.y1-e.y0,a=t.node(),o=n-8,s=r-8;if(o<10||s<10){t.style(`display`,`none`);return}let c=parseInt(t.style(`font-size`),10),l=.6;for(;a.getComputedTextLength()>o&&c>8;)c--,t.style(`font-size`,`${c}px`);let u=Math.max(6,Math.min(28,Math.round(c*l))),d=c+2+u;for(;d>s&&c>8&&(c--,u=Math.max(6,Math.min(28,Math.round(c*l))),!(u<6&&c===8));)t.style(`font-size`,`${c}px`),d=c+2+u;t.style(`font-size`,`${c}px`),(a.getComputedTextLength()>o||c<8||s<c)&&t.style(`display`,`none`)}),d.showValues!==!1&&I.append(`text`).attr(`class`,`treemapValue`).attr(`x`,e=>(e.x1-e.x0)/2).attr(`y`,function(e){return(e.y1-e.y0)/2}).attr(`style`,e=>`text-anchor: middle; dominant-baseline: hanging; font-size: 28px;fill:`+k(e.data.name)+`;`+r({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace(`color:`,`fill:`)).attr(`clip-path`,(e,t)=>`url(#clip-${a}-${t})`).text(e=>e.value?E(e.value):``).each(function(e){let t=i(this),n=this.parentNode;if(!n){t.style(`display`,`none`);return}let r=i(n).select(`.treemapLabel`);if(r.empty()||r.style(`display`)===`none`){t.style(`display`,`none`);return}let a=parseFloat(r.style(`font-size`)),o=Math.max(6,Math.min(28,Math.round(a*.6)));t.style(`font-size`,`${o}px`);let s=(e.y1-e.y0)/2+a/2+2;t.attr(`y`,s);let c=e.x1-e.x0,l=e.y1-e.y0-4,u=c-8;t.node().getComputedTextLength()>u||s+o>l||o<6?t.style(`display`,`none`):t.style(`display`,null)}),S(b,d.diagramPadding??8,`flowchart`,d?.useMaxWidth||!1)},`draw`),getClasses:o(function(e,t){return t.db.getClasses()},`getClasses`)},ue={sectionStrokeColor:`black`,sectionStrokeWidth:`1`,sectionFillColor:`#efefef`,leafStrokeColor:`black`,leafStrokeWidth:`1`,leafFillColor:`#efefef`,labelFontSize:`12px`,valueFontSize:`10px`,titleFontSize:`14px`},de={parser:Z,get db(){return new Y},renderer:le,styles:o(({treemap:e}={})=>{let t=p(v(),_().themeVariables),n=p(ue,e),r=n.titleColor??t.titleColor,i=n.labelColor??t.textColor,a=n.valueColor??t.textColor;return`
2
+ .treemapNode.section {
3
+ stroke: ${n.sectionStrokeColor};
4
+ stroke-width: ${n.sectionStrokeWidth};
5
+ fill: ${n.sectionFillColor};
6
+ }
7
+ .treemapNode.leaf {
8
+ stroke: ${n.leafStrokeColor};
9
+ stroke-width: ${n.leafStrokeWidth};
10
+ fill: ${n.leafFillColor};
11
+ }
12
+ .treemapLabel {
13
+ fill: ${i};
14
+ font-size: ${n.labelFontSize};
15
+ }
16
+ .treemapValue {
17
+ fill: ${a};
18
+ font-size: ${n.valueFontSize};
19
+ }
20
+ .treemapTitle {
21
+ fill: ${r};
22
+ font-size: ${n.titleFontSize};
23
+ }
24
+ `},`getStyles`)};export{de as diagram};
@@ -0,0 +1 @@
1
+ var e={"+":`inserted`,"-":`deleted`,"@":`meta`},t={name:`diff`,token:function(t){var n=t.string.search(/[\t ]+?$/);if(!t.sol()||n===0)return t.skipToEnd(),(`error `+(e[t.string.charAt(0)]||``)).replace(/ $/,``);var r=e[t.peek()]||t.skipToEnd();return n===-1?t.skipToEnd():t.pos=n,r}};export{t as diff};
@@ -0,0 +1 @@
1
+ import{_r as e,dr as t,fr as n,gr as r,mr as i,pr as a,ur as o}from"./index-Czi2sVlL.js";var s=class e{constructor(e,t,n,r,i,a,o,s,c,l=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=r,this.pos=i,this.score=a,this.buffer=o,this.bufferBase=s,this.curContext=c,this.lookAhead=l,this.parent=u}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?`!`+this.score:``}`}static start(t,n,r=0){let i=t.parser.context;return new e(t,[],n,r,r,0,[],0,i?new c(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){let t=e>>19,n=e&65535,{parser:r}=this.p,i=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=r.dynamicPrecedence(n);if(a&&(this.score+=a),t==0){n<r.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(r.getGoto(this.state,n,!0),this.reducePos),n<r.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,i?8:4,!0),this.reduceContext(n,this.reducePos);return}let o=this.stack.length-(t-1)*3-(e&262144?6:0),s=o?this.stack[o-2]:this.p.ranges[0].from;n<r.minRepeatTerm&&s==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let c=this.reducePos-s;c>=2e3&&!this.p.parser.nodeSet.types[n]?.isAnonymous&&(s==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=c):this.p.lastBigReductionSize<c&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=s,this.p.lastBigReductionSize=c));let l=o?this.stack[o-1]:0,u=this.bufferBase+this.buffer.length-l;if(n<r.minRepeatTerm||e&131072){let e=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,s,e,u+4,!0)}if(e&262144)this.state=this.stack[o];else{let e=this.stack[o-3];this.state=r.getGoto(e,n,!0)}for(;this.stack.length>o;)this.stack.pop();this.reduceContext(n,s)}storeNode(e,t,n,r=4,i=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let e=this.buffer.length;if(e>0&&this.buffer[e-4]==0&&this.buffer[e-1]>-1){if(t==n)return;if(this.buffer[e-2]>=t){this.buffer[e-2]=n;return}}}if(!i||this.pos==n)this.buffer.push(e,t,n,r);else{let i=this.buffer.length;if(i>0&&(this.buffer[i-4]!=0||this.buffer[i-1]<0)){let e=!1;for(let t=i;t>0&&this.buffer[t-2]>n;t-=4)if(this.buffer[t-1]>=0){e=!0;break}if(e)for(;i>0&&this.buffer[i-2]>n;)this.buffer[i]=this.buffer[i-4],this.buffer[i+1]=this.buffer[i-3],this.buffer[i+2]=this.buffer[i-2],this.buffer[i+3]=this.buffer[i-1],i-=4,r>4&&(r-=4)}this.buffer[i]=e,this.buffer[i+1]=t,this.buffer[i+2]=n,this.buffer[i+3]=r}}shift(e,t,n,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,r,4);else{let i=e,{parser:a}=this.p;this.pos=r;let o=a.stateFlag(i,1);!o&&(r>n||t<=a.maxNode)&&(this.reducePos=r),this.pushState(i,o?n:Math.min(n,this.reducePos)),this.shiftContext(t,n),t<=a.maxNode&&this.buffer.push(t,n,r,4)}}apply(e,t,n,r){e&65536?this.reduce(e):this.shift(e,t,n,r)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(n,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let t=this,n=t.buffer.length;for(n&&t.buffer[n-4]==0&&(n-=4);n>0&&t.buffer[n-2]>t.reducePos;)n-=4;let r=t.buffer.slice(n),i=t.bufferBase+n;for(;t&&i==t.bufferBase;)t=t.parent;return new e(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,t)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new l(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if(!(n&65536))return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let n=[];for(let r=0,i;r<t.length;r+=2)(i=t[r+1])!=this.state&&this.p.parser.hasAction(i,e)&&n.push(t[r],i);if(this.stack.length<120)for(let e=0;n.length<8&&e<t.length;e+=2){let r=t[e+1];n.some((e,t)=>t&1&&e==r)||n.push(t[e],r)}t=n}let n=[];for(let e=0;e<t.length&&n.length<4;e+=2){let r=t[e+1];if(r==this.state)continue;let i=this.split();i.pushState(r,this.pos),i.storeNode(0,i.pos,i.pos,4,!0),i.shiftContext(t[e],this.pos),i.reducePos=this.pos,i.score-=200,n.push(i)}return n}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if(!(t&65536))return!1;if(!e.validAction(this.state,t)){let n=t>>19,r=t&65535,i=this.stack.length-n*3;if(i<0||e.getGoto(this.stack[i],r,!1)<0){let e=this.findForcedReduction();if(e==null)return!1;t=e}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(r,i)=>{if(!t.includes(r))return t.push(r),e.allActions(r,t=>{if(!(t&393216))if(t&65536){let n=(t>>19)-i;if(n>1){let r=t&65535,i=this.stack.length-n*3;if(i>=0&&e.getGoto(this.stack[i],r,!1)>=0)return n<<19|65536|r}}else{let e=n(t,i+1);if(e!=null)return e}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new c(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},c=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},l=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}},u=class e{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(t,n=t.bufferBase+t.buffer.length){return new e(t,n,n-t.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new e(this.stack,this.pos,this.index)}};function d(e,t=Uint16Array){if(typeof e!=`string`)return e;let n=null;for(let r=0,i=0;r<e.length;){let a=0;for(;;){let t=e.charCodeAt(r++),n=!1;if(t==126){a=65535;break}t>=92&&t--,t>=34&&t--;let i=t-32;if(i>=46&&(i-=46,n=!0),a+=i,n)break;a*=46}n?n[i++]=a:n=new t(a)}return n}var f=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},p=new f,m=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk=``,this.chunkOff=0,this.chunk2=``,this.chunk2Pos=0,this.next=-1,this.token=p,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,r=this.rangeIndex,i=this.pos+e;for(;i<n.from;){if(!r)return null;let e=this.ranges[--r];i-=n.from-e.to,n=e}for(;t<0?i>n.to:i>=n.to;){if(r==this.ranges.length-1)return null;let e=this.ranges[++r];i+=e.from-n.to,n=e}return i}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,r;if(t>=0&&t<this.chunk.length)n=this.pos+e,r=this.chunk.charCodeAt(t);else{let t=this.resolveOffset(e,1);if(t==null)return-1;if(n=t,n>=this.chunk2Pos&&n<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(n-this.chunk2Pos);else{let e=this.rangeIndex,t=this.range;for(;t.to<=n;)t=this.ranges[++e];this.chunk2=this.input.chunk(this.chunk2Pos=n),n+this.chunk2.length>t.to&&(this.chunk2=this.chunk2.slice(0,t.to-n)),r=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),r}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n<this.token.start)throw RangeError(`Token end out of bounds`);this.token.value=e,this.token.end=n}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk=``,this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=p,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk=``,this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n=``;for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(n+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return n}},h=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;v(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};h.prototype.contextual=h.prototype.fallback=h.prototype.extend=!1;var g=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e==`string`?d(e):e}token(e,t){let n=e.pos,r=0;for(;;){let n=e.next<0,i=e.resolveOffset(1,1);if(v(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(n||r++,i==null)break;e.reset(i,e.token)}r&&(e.reset(n,e.token),e.acceptToken(this.elseToken,r))}};g.prototype.contextual=h.prototype.fallback=h.prototype.extend=!1;var _=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function v(e,t,n,r,i,a){let o=0,s=1<<r,{dialect:c}=n.p.parser;scan:for(;(s&e[o])!=0;){let n=e[o+1];for(let r=o+3;r<n;r+=2)if((e[r+1]&s)>0){let n=e[r];if(c.allows(n)&&(t.token.value==-1||t.token.value==n||b(n,t.token.value,i,a))){t.acceptToken(n);break}}let r=t.next,l=0,u=e[o+2];if(t.next<0&&u>l&&e[n+u*3-3]==65535){o=e[n+u*3-1];continue scan}for(;l<u;){let i=l+u>>1,a=n+i+(i<<1),s=e[a],c=e[a+1]||65536;if(r<s)u=i;else if(r>=c)l=i+1;else{o=e[a+2],t.advance();continue scan}}break}}function y(e,t,n){for(let r=t,i;(i=e[r])!=65535;r++)if(i==n)return r-t;return-1}function b(e,t,n,r){let i=y(n,r,t);return i<0||y(n,r,e)<i}var x=typeof process<`u`&&/\bparse\b/.test({}.LOG),S=null;function C(e,n,r){let i=e.cursor(t.IncludeAnonymous);for(i.moveTo(n);;)if(!(r<0?i.childBefore(n):i.childAfter(n)))for(;;){if((r<0?i.to<n:i.from>n)&&!i.type.isError)return r<0?Math.max(0,Math.min(i.to-1,n-25)):Math.min(e.length,Math.max(i.from+1,n+25));if(r<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return r<0?0:e.length}}var w=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?C(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?C(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(t<this.nextStart)return null;for(;this.fragment&&this.safeTo<=t;)this.nextFragment();if(!this.fragment)return null;for(;;){let r=this.trees.length-1;if(r<0)return this.nextFragment(),null;let i=this.trees[r],a=this.index[r];if(a==i.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let o=i.children[a],s=this.start[r]+i.positions[a];if(s>t)return this.nextStart=s,null;if(o instanceof e){if(s==t){if(s<this.safeFrom)return null;let e=s+o.length;if(e<=this.safeTo){let t=o.prop(n.lookAhead);if(!t||e+t<this.fragment.to)return o}}this.index[r]++,s+o.length>=Math.max(this.safeFrom,t)&&(this.trees.push(o),this.start.push(s),this.index.push(0))}else this.index[r]++,this.nextStart=s+o.length}}},T=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(e=>new f)}getActions(e){let t=0,n=null,{parser:r}=e.p,{tokenizers:i}=r,a=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,s=0;for(let r=0;r<i.length;r++){if(!(1<<r&a))continue;let c=i[r],l=this.tokens[r];if(!(n&&!c.fallback)&&((c.contextual||l.start!=e.pos||l.mask!=a||l.context!=o)&&(this.updateCachedToken(l,c,e),l.mask=a,l.context=o),l.lookAhead>l.end+25&&(s=Math.max(l.lookAhead,s)),l.value!=0)){let r=t;if(l.extended>-1&&(t=this.addActions(e,l.extended,l.end,t)),t=this.addActions(e,l.value,l.end,t),!c.extend&&(n=l,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return s&&e.setLookAhead(s),!n&&e.pos==this.stream.end&&(n=new f,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new f,{pos:n,p:r}=e;return t.start=n,t.end=Math.min(n+1,r.stream.end),t.value=n==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,n){let r=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(r,e),n),e.value>-1){let{parser:t}=n.p;for(let r=0;r<t.specialized.length;r++)if(t.specialized[r]==e.value){let i=t.specializers[r](this.stream.read(e.start,e.end),n);if(i>=0&&n.p.parser.dialect.allows(i>>1)){i&1?e.extended=i>>1:e.value=i>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,n,r){for(let t=0;t<r;t+=3)if(this.actions[t]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=n,r}addActions(e,t,n,r){let{state:i}=e,{parser:a}=e.p,{data:o}=a;for(let e=0;e<2;e++)for(let s=a.stateSlot(i,e?2:1);;s+=3){if(o[s]==65535)if(o[s+1]==1)s=M(o,s+2);else{r==0&&o[s+1]==2&&(r=this.putAction(M(o,s+2),t,n,r));break}o[s]==t&&(r=this.putAction(M(o,s+1),t,n,r))}return r}},E=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new m(t,r),this.tokens=new T(e,this.stream),this.topTerm=e.top[1];let{from:i}=r[0];this.stacks=[s.start(this,e.top[0],i)],this.fragments=n.length&&this.stream.end-i>e.bufferLength*4?new w(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],r,i;if(this.bigReductionCount>300&&e.length==1){let[t]=e;for(;t.forceReduce()&&t.stack.length&&t.stack[t.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let o=e[a];for(;;){if(this.tokens.mainToken=null,o.pos>t)n.push(o);else if(this.advanceStack(o,n,e))continue;else{r||(r=[],i=[]),r.push(o);let e=this.tokens.getMainToken(o);i.push(e.value,e.end)}break}}if(!n.length){let e=r&&N(r);if(e)return x&&console.log(`Finish with `+this.stackID(e)),this.stackToTree(e);if(this.parser.strict)throw x&&r&&console.log(`Stuck with token `+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):`none`)),SyntaxError(`No parse at `+t);this.recovering||=5}if(this.recovering&&r){let e=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,i,n);if(e)return x&&console.log(`Force-finish `+this.stackID(e)),this.stackToTree(e.forceAll())}if(this.recovering){let e=this.recovering==1?1:this.recovering*3;if(n.length>e)for(n.sort((e,t)=>t.score-e.score);n.length>e;)n.pop();n.some(e=>e.reducePos>t)&&this.recovering--}else if(n.length>1){outer:for(let e=0;e<n.length-1;e++){let t=n[e];for(let r=e+1;r<n.length;r++){let i=n[r];if(t.sameState(i)||t.buffer.length>500&&i.buffer.length>500)if((t.score-i.score||t.buffer.length-i.buffer.length)>0)n.splice(r--,1);else{n.splice(e--,1);continue outer}}}n.length>12&&(n.sort((e,t)=>t.score-e.score),n.splice(12,n.length-12))}this.minStackPos=n[0].pos;for(let e=1;e<n.length;e++)n[e].pos<this.minStackPos&&(this.minStackPos=n[e].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}advanceStack(t,r,i){let a=t.pos,{parser:o}=this,s=x?this.stackID(t)+` -> `:``;if(this.stoppedAt!=null&&a>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let r=t.curContext&&t.curContext.tracker.strict,i=r?t.curContext.hash:0;for(let c=this.fragments.nodeAt(a);c;){let a=this.parser.nodeSet.types[c.type.id]==c.type?o.getGoto(t.state,c.type.id):-1;if(a>-1&&c.length&&(!r||(c.prop(n.contextHash)||0)==i))return t.useNode(c,a),x&&console.log(s+this.stackID(t)+` (via reuse of ${o.getName(c.type.id)})`),!0;if(!(c instanceof e)||c.children.length==0||c.positions[0]>0)break;let l=c.children[0];if(l instanceof e&&c.positions[0]==0)c=l;else break}}let c=o.stateSlot(t.state,4);if(c>0)return t.reduce(c),x&&console.log(s+this.stackID(t)+` (via always-reduce ${o.getName(c&65535)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let l=this.tokens.getActions(t);for(let e=0;e<l.length;){let n=l[e++],c=l[e++],u=l[e++],d=e==l.length||!i,f=d?t:t.split(),p=this.tokens.mainToken;if(f.apply(n,c,p?p.start:f.pos,u),x&&console.log(s+this.stackID(f)+` (via ${n&65536?`reduce of ${o.getName(n&65535)}`:`shift`} for ${o.getName(c)} @ ${a}${f==t?``:`, split`})`),d)return!0;f.pos>a?r.push(f):i.push(f)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return D(e,t),!0}}runRecovery(e,t,n){let r=null,i=!1;for(let a=0;a<e.length;a++){let o=e[a],s=t[a<<1],c=t[(a<<1)+1],l=x?this.stackID(o)+` -> `:``;if(o.deadEnd&&(i||(i=!0,o.restart(),x&&console.log(l+this.stackID(o)+` (restarted)`),this.advanceFully(o,n))))continue;let u=o.split(),d=l;for(let e=0;e<10&&u.forceReduce()&&(x&&console.log(d+this.stackID(u)+` (via force-reduce)`),!this.advanceFully(u,n));e++)x&&(d=this.stackID(u)+` -> `);for(let e of o.recoverByInsert(s))x&&console.log(l+this.stackID(e)+` (via recover-insert)`),this.advanceFully(e,n);this.stream.end>o.pos?(c==o.pos&&(c++,s=0),o.recoverByDelete(s,c),x&&console.log(l+this.stackID(o)+` (via recover-delete ${this.parser.getName(s)})`),D(o,n)):(!r||r.score<u.score)&&(r=u)}return r}stackToTree(t){return t.close(),e.build({buffer:u.create(t),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:t.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(S||=new WeakMap).get(e);return t||S.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}};function D(e,t){for(let n=0;n<t.length;n++){let r=t[n];if(r.pos==e.pos&&r.sameState(e)){t[n].score<e.score&&(t[n]=e);return}}t.push(e)}var O=class{constructor(e,t,n){this.source=e,this.flags=t,this.disabled=n}allows(e){return!this.disabled||this.disabled[e]==0}},k=e=>e,A=class{constructor(e){this.start=e.start,this.shift=e.shift||k,this.reduce=e.reduce||k,this.reuse=e.reuse||k,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},j=class e extends r{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(` `);this.minRepeatTerm=t.length;for(let n=0;n<e.repeatNodeCount;n++)t.push(``);let r=Object.keys(e.topRules).map(t=>e.topRules[t][1]),s=[];for(let e=0;e<t.length;e++)s.push([]);function c(e,t,n){s[e].push([t,t.deserialize(String(n))])}if(e.nodeProps)for(let t of e.nodeProps){let e=t[0];typeof e==`string`&&(e=n[e]);for(let n=1;n<t.length;){let r=t[n++];if(r>=0)c(r,e,t[n++]);else{let i=t[n+-r];for(let a=-r;a>0;a--)c(t[n++],e,i);n++}}}this.nodeSet=new a(t.map((t,n)=>i.define({name:n>=this.minRepeatTerm?void 0:t,id:n,props:s[n],top:r.indexOf(n)>-1,error:n==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(n)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=o;let l=d(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let e=0;e<this.specializerSpecs.length;e++)this.specialized[e]=this.specializerSpecs[e].term;this.specializers=this.specializerSpecs.map(P),this.states=d(e.states,Uint32Array),this.data=d(e.stateData),this.goto=d(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(e=>typeof e==`number`?new h(l,e):e),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let r=new E(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}getGoto(e,t,n=!1){let r=this.goto;if(t>=r[0])return-1;for(let i=r[t+1];;){let t=r[i++],a=t&1,o=r[i++];if(a&&n)return o;for(let n=i+(t>>1);i<n;i++)if(r[i]==e)return o;if(a)return-1}}hasAction(e,t){let n=this.data;for(let r=0;r<2;r++)for(let i=this.stateSlot(e,r?2:1),a;;i+=3){if((a=n[i])==65535)if(n[i+1]==1)a=n[i=M(n,i+2)];else if(n[i+1]==2)return M(n,i+2);else break;if(a==t||a==0)return M(n,i+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,e=>e==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),r=n?t(n):void 0;for(let n=this.stateSlot(e,1);r==null;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=M(this.data,n+2);else break;r=t(M(this.data,n+1))}return r}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=M(this.data,n+2);else break;if(!(this.data[n+2]&1)){let e=this.data[n+1];t.some((t,n)=>n&1&&t==e)||t.push(this.data[n],e)}}return t}configure(t){let n=Object.assign(Object.create(e.prototype),this);if(t.props&&(n.nodeSet=this.nodeSet.extend(...t.props)),t.top){let e=this.topRules[t.top];if(!e)throw RangeError(`Invalid top rule name ${t.top}`);n.top=e}return t.tokenizers&&(n.tokenizers=this.tokenizers.map(e=>{let n=t.tokenizers.find(t=>t.from==e);return n?n.to:e})),t.specializers&&(n.specializers=this.specializers.slice(),n.specializerSpecs=this.specializerSpecs.map((e,r)=>{let i=t.specializers.find(t=>t.from==e.external);if(!i)return e;let a=Object.assign(Object.assign({},e),{external:i.to});return n.specializers[r]=P(a),a})),t.contextTracker&&(n.context=t.contextTracker),t.dialect&&(n.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(n.strict=t.strict),t.wrap&&(n.wrappers=n.wrappers.concat(t.wrap)),t.bufferLength!=null&&(n.bufferLength=t.bufferLength),n}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(` `)){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let r=null;for(let e=0;e<t.length;e++)if(!n[e])for(let n=this.dialects[t[e]],i;(i=this.data[n++])!=65535;)(r||=new Uint8Array(this.maxTerm+1))[i]=1;return new O(e,n,r)}static deserialize(t){return new e(t)}};function M(e,t){return e[t]|e[t+1]<<16}function N(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||e!=null&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.score<n.score)&&(t=n)}return t}function P(e){if(e.external){let t=+!!e.extend;return(n,r)=>e.external(n,r)<<1|t}return e.get}export{g as i,_ as n,j as r,A as t};
@@ -0,0 +1 @@
1
+ import{Bn as e,Jn as t,Ln as n,Un as r,Xn as i,nr as a,qn as o,rr as s}from"./index-Czi2sVlL.js";import{n as c,r as l,t as u}from"./dist-3LHbYvzB.js";import{r as d}from"./dist-BaQ073UB.js";var f=168,p=169,m=170,h=1,g=2,_=3,ee=171,te=172,v=4,y=173,b=5,x=174,S=175,C=176,w=177,T=6,E=7,ne=8,D=9,O=0,k=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],re=58,A=40,j=95,M=91,N=45,P=46,F=35,I=37,L=123,R=125,z=47,B=42,V=10,H=61,U=43,W=38;function G(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function K(e){return e>=48&&e<=57}function q(e){let t;return e.next==z&&((t=e.peek(1))==z||t==B)}var J=new c((e,t)=>{if(t.dialectEnabled(O)){let n;if(e.next<0&&t.canShift(C))e.acceptToken(C);else if(((n=e.peek(-1))==V||n<0)&&t.canShift(S)){let t=0;for(;e.next!=V&&k.includes(e.next);)e.advance(),t++;e.next==V||q(e)?e.acceptToken(S,-t):t&&e.acceptToken(w)}else if(e.next==V)e.acceptToken(x,1);else if(k.includes(e.next)){for(e.advance();e.next!=V&&k.includes(e.next);)e.advance();e.acceptToken(w)}}else{let t=0;for(;k.includes(e.next);)e.advance(),t++;t&&e.acceptToken(w)}},{contextual:!0}),Y=new c((e,t)=>{if(q(e)){if(e.advance(),t.dialectEnabled(O)){let t=-1;for(let n=1;;n++){let r=e.peek(-n-1);if(r==V||r<0){t=n+1;break}else if(!k.includes(r))break}if(t>-1){let n=e.next==B,r=0;for(e.advance();e.next>=0;)if(e.next==V){e.advance();let n=0;for(;e.next!=V&&k.includes(e.next);)n++,e.advance();if(n<t){r=-n-1;break}}else if(n&&e.next==B&&e.peek(1)==z){r=2;break}else e.advance();e.acceptToken(n?E:T,r);return}}if(e.next==z){for(;e.next!=V&&e.next>=0;)e.advance();e.acceptToken(T)}else{for(e.advance();e.next>=0;){let{next:t}=e;if(e.advance(),t==B&&e.next==z){e.advance();break}}e.acceptToken(E)}}}),X=new c((e,t)=>{(e.next==U||e.next==H)&&t.dialectEnabled(O)&&e.acceptToken(e.next==H?ne:D,1)}),ie=new c((e,t)=>{if(!t.dialectEnabled(O))return;let n=t.context.depth;if(e.next<0&&n){e.acceptToken(p);return}if(e.peek(-1)==V){let t=0;for(;e.next!=V&&k.includes(e.next);)e.advance(),t++;t!=n&&e.next!=V&&!q(e)&&(t<n?e.acceptToken(p,-t):e.acceptToken(f))}}),ae=new c((e,t)=>{for(let n=!1,r=0,i=0;;i++){let{next:a}=e;if(G(a)||a==N||a==j||n&&K(a))!n&&(a!=N||i>0)&&(n=!0),r===i&&a==N&&r++,e.advance();else if(a==F&&e.peek(1)==L){e.acceptToken(b,2);break}else{n&&e.acceptToken(r==2&&t.canShift(v)?v:t.canShift(y)?y:a==A?ee:te);break}}}),oe=new c(e=>{if(e.next==R){for(e.advance();G(e.next)||e.next==N||e.next==j||K(e.next);)e.advance();e.next==F&&e.peek(1)==L?e.acceptToken(g,2):e.acceptToken(h)}}),se=new c(e=>{if(k.includes(e.peek(-1))){let{next:t}=e;(G(t)||t==j||t==F||t==P||t==M||t==re&&G(e.peek(1))||t==N||t==W||t==B)&&e.acceptToken(m)}}),ce=new c(e=>{if(!k.includes(e.peek(-1))){let{next:t}=e;if(t==I&&(e.advance(),e.acceptToken(_)),G(t)){do e.advance();while(G(e.next)||K(e.next));e.acceptToken(_)}}});function Z(e,t){this.parent=e,this.depth=t,this.hash=(e?e.hash+e.hash<<8:0)+t+(t<<4)}var le=new u({start:new Z(null,0),shift(e,t,n,r){return t==f?new Z(e,n.pos-r.pos):t==p?e.parent:e},hash(e){return e.hash}}),ue=a({"AtKeyword import charset namespace keyframes media supports include mixin use forward extend at-root":s.definitionKeyword,"Keyword selector":s.keyword,ControlKeyword:s.controlKeyword,NamespaceName:s.namespace,KeyframeName:s.labelName,KeyframeRangeName:s.operatorKeyword,TagName:s.tagName,"ClassName Suffix":s.className,PseudoClassName:s.constant(s.className),IdName:s.labelName,"FeatureName PropertyName":s.propertyName,AttributeName:s.attributeName,NumberLiteral:s.number,KeywordQuery:s.keyword,UnaryQueryOp:s.operatorKeyword,"CallTag ValueName":s.atom,VariableName:s.variableName,SassVariableName:s.special(s.variableName),Callee:s.operatorKeyword,Unit:s.unit,"UniversalSelector NestingSelector IndentedMixin IndentedInclude":s.definitionOperator,MatchOp:s.compareOperator,"ChildOp SiblingOp, LogicOp":s.logicOperator,BinOp:s.arithmeticOperator,"Important Global Default":s.modifier,Comment:s.blockComment,LineComment:s.lineComment,ColorLiteral:s.color,"ParenthesizedContent StringLiteral":s.string,"InterpolationStart InterpolationContinue InterpolationEnd":s.meta,': "..."':s.punctuation,"PseudoOp #":s.derefOperator,"; ,":s.separator,"( )":s.paren,"[ ]":s.squareBracket,"{ }":s.brace}),de={__proto__:null,not:62,using:197,as:207,with:211,without:211,hide:225,show:225,if:263,from:269,to:271,through:273,in:279},fe={__proto__:null,url:82,"url-prefix":82,domain:82,regexp:82,lang:104,"nth-child":104,"nth-last-child":104,"nth-of-type":104,"nth-last-of-type":104,dir:104,"host-context":104},pe={__proto__:null,"@import":162,"@include":194,"@mixin":200,"@function":200,"@use":204,"@extend":214,"@at-root":218,"@forward":222,"@media":228,"@charset":232,"@namesp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cQ%R#RR&o%RQ$u#OS&e$u(jR(j'sQ'r&gR(i'rQ&w%YR'|&wQ'z&vR(p'zQ&y%^R(O&yQ%a#eR&}%aR|QSoOq]wPx!f#l$_%f`XOPqx!f#l$_%fQ!zeQ!{fQ$W!aQ$X!bQ$Y!cQ$Z!dQ&O$`Q&p%TR(['ZQ!SVQ!uaQ!vbQ!wcQ!xdQ#OgQ#WiQ#crQ#guQ#hvS#q!Q$dQ#x!TQ$e!tQ%l#sQ%m#tQ%n#ul%u$O$a%v&Q&j'S'V'^'t(U(Y(^(w)UQ&S$cS&W$e&YQ&g$wQ&{%_Q'O%bQ'X%{Q'f&XQ(`'bQ(h'qQ(t(QR(u(SR%x$OR&R$aR&P$`QzPQ$^!fR%}$_X#ly#j#m%eQ#VhQ#_mQ$h!uR&^$iW#Rhm!u$iQ#^lQ$|#QQ%S#SQ&m%PQ&n%QQ'p&dR(f'oQ%O#QQ'v&kR)R(nQ#apQ$k!vQ$n!xQ$q!zQ$v#OQ%V#WQ%W#YQ%]#_Q%d#hQ&]$hQ&f$uQ&q%XQ'k&^Q'l&_S'm&`&bQ(k'sQ(}(eR)Q(jR&h$wR#ft",nodeNames:`⚠ InterpolationEnd InterpolationContinue Unit VariableName InterpolationStart LineComment Comment IndentedMixin IndentedInclude StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector SuffixedSelector Suffix Interpolation SassVariableName ValueName ) ( ParenthesizedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp LogicOp UnaryExpression LogicOp NamespacedValue . CallExpression Callee ArgList : ... , CallLiteral CallTag ParenthesizedContent ] [ LineNames LineName ClassSelector ClassName PseudoClassSelector :: PseudoClassName PseudoClassName ArgList PseudoClassName ArgList IdSelector # IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp PlaceholderSelector ClassName Block { Declaration PropertyName Map Important Global Default ; } ImportStatement AtKeyword import Layer layer LayerName KeywordQuery FeatureQuery FeatureName BinaryQuery ComparisonQuery CompareOp UnaryQuery LogicOp ParenthesizedQuery SelectorQuery selector IncludeStatement include Keyword MixinStatement mixin UseStatement use Keyword Star Keyword ExtendStatement extend RootStatement at-root ForwardStatement forward Keyword MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports IfStatement ControlKeyword ControlKeyword Keyword ForStatement ControlKeyword Keyword Keyword Keyword EachStatement ControlKeyword Keyword WhileStatement ControlKeyword OutputStatement ControlKeyword AtRule Styles`,maxTerm:196,context:le,nodeProps:[[`openedBy`,1,`InterpolationStart`,5,`InterpolationEnd`,21,`(`,43,`[`,78,`{`],[`isolate`,-3,6,7,26,``],[`closedBy`,22,`)`,44,`]`,70,`}`]],propSources:[ue],skippedNodes:[0,6,7,146],repeatNodeCount:21,tokenData:"!$Q~RyOq#rqr$jrs0jst2^tu8{uv;hvw;{wx<^xy={yz>^z{>c{|>||}Co}!ODQ!O!PDo!P!QFY!Q![Fk![!]Gf!]!^Hb!^!_Hs!_!`Is!`!aJ^!a!b#r!b!cKa!c!}#r!}#OMn#O#P#r#P#QNP#Q#RNb#R#T#r#T#UNw#U#c#r#c#d!!Y#d#o#r#o#p!!o#p#qNb#q#r!#Q#r#s!#c#s;'S#r;'S;=`!#z<%lO#rW#uSOy$Rz;'S$R;'S;=`$d<%lO$RW$WSzWOy$Rz;'S$R;'S;=`$d<%lO$RW$gP;=`<%l$RY$m[Oy$Rz!_$R!_!`%c!`#W$R#W#X%v#X#Z$R#Z#[)Z#[#]$R#]#^,V#^;'S$R;'S;=`$d<%lO$RY%jSzWlQOy$Rz;'S$R;'S;=`$d<%lO$RY%{UzWOy$Rz#X$R#X#Y&_#Y;'S$R;'S;=`$d<%lO$RY&dUzWOy$Rz#Y$R#Y#Z&v#Z;'S$R;'S;=`$d<%lO$RY&{UzWOy$Rz#T$R#T#U'_#U;'S$R;'S;=`$d<%lO$RY'dUzWOy$Rz#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lO$RXKTS!aPzWOy$Rz;'S$R;'S;=`$d<%lO$RXKdYOy$Rz}$R}!OLS!O!c$R!c!}Lq!}#T$R#T#oLq#o;'S$R;'S;=`$d<%lO$RXLXWzWOy$Rz!c$R!c!}Lq!}#T$R#T#oLq#o;'S$R;'S;=`$d<%lO$RXLx[!rPzWOy$Rz}$R}!OLq!O!Q$R!Q![Lq![!c$R!c!}Lq!}#T$R#T#oLq#o;'S$R;'S;=`$d<%lO$RZMsS|ROy$Rz;'S$R;'S;=`$d<%lO$R_NUS{VOy$Rz;'S$R;'S;=`$d<%lO$R[NeUOy$Rz!_$R!_!`;T!`;'S$R;'S;=`$d<%lO$RkNzUOy$Rz#b$R#b#c! ^#c;'S$R;'S;=`$d<%lO$Rk! cUzWOy$Rz#W$R#W#X! u#X;'S$R;'S;=`$d<%lO$Rk! |SmczWOy$Rz;'S$R;'S;=`$d<%lO$Rk!!]UOy$Rz#f$R#f#g! u#g;'S$R;'S;=`$d<%lO$RZ!!tS!hROy$Rz;'S$R;'S;=`$d<%lO$RZ!#VS!pROy$Rz;'S$R;'S;=`$d<%lO$R]!#hU!dPOy$Rz!_$R!_!`;T!`;'S$R;'S;=`$d<%lO$RW!#}P;=`<%l#r",tokenizers:[ie,se,oe,ce,ae,J,Y,X,0,1,2,3,4],topRules:{StyleSheet:[0,10],Styles:[1,145]},dialects:{indented:0},specialized:[{term:172,get:e=>de[e]||-1},{term:171,get:e=>fe[e]||-1},{term:80,get:e=>pe[e]||-1},{term:173,get:e=>me[e]||-1}],tokenPrec:3217}),$=n.define({name:`sass`,parser:Q.configure({props:[t.add({Block:o,Comment(e,t){return{from:e.from+2,to:t.sliceDoc(e.to-2,e.to)==`*/`?e.to-2:e.to}}}),i.add({Declaration:r()})]}),languageData:{commentTokens:{block:{open:`/*`,close:`*/`},line:`//`},indentOnInput:/^\s*\}$/,wordChars:`$-`}}),he=$.configure({dialect:`indented`,props:[i.add({"Block RuleSet":e=>e.baseIndent+e.unit}),t.add({Block:e=>({from:e.from,to:e.to})})]}),ge=d(e=>e.name==`VariableName`||e.name==`SassVariableName`);function _e(t){return new e(t?.indented?he:$,$.data.of({autocomplete:ge}))}export{_e as sass};
@@ -0,0 +1,6 @@
1
+ import{Bn as e,Jn as t,Qn as n,Rn as r,Vn as i,Wn as a,Xn as o,Yn as s,Zn as c,_r as l,ar as u,cr as d,er as f,fr as p,gr as m,ir as h,jn as ee,lr as g,mr as _,nr as te,or as v,pr as ne,rr as y,sr as re,tr as ie,vr as ae,zn as oe}from"./index-Czi2sVlL.js";import{html as se,htmlCompletionSource as ce}from"./dist-C4F0WDhe.js";var le=class e{static create(t,n,r,i,a){return new e(t,n,r,i+(i<<8)+t+(n<<4)|0,a,[],[])}constructor(e,t,n,r,i,a,o){this.type=e,this.value=t,this.from=n,this.hash=r,this.end=i,this.children=a,this.positions=o,this.hashProp=[[p.contextHash,r]]}addChild(e,t){e.prop(p.contextHash)!=this.hash&&(e=new l(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;return n>=0&&(t=Math.max(t,this.positions[n]+this.children[n].length+this.from)),new l(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new l(_.none,e,t,n,this.hashProp)})}},b;(function(e){e[e.Document=1]=`Document`,e[e.CodeBlock=2]=`CodeBlock`,e[e.FencedCode=3]=`FencedCode`,e[e.Blockquote=4]=`Blockquote`,e[e.HorizontalRule=5]=`HorizontalRule`,e[e.BulletList=6]=`BulletList`,e[e.OrderedList=7]=`OrderedList`,e[e.ListItem=8]=`ListItem`,e[e.ATXHeading1=9]=`ATXHeading1`,e[e.ATXHeading2=10]=`ATXHeading2`,e[e.ATXHeading3=11]=`ATXHeading3`,e[e.ATXHeading4=12]=`ATXHeading4`,e[e.ATXHeading5=13]=`ATXHeading5`,e[e.ATXHeading6=14]=`ATXHeading6`,e[e.SetextHeading1=15]=`SetextHeading1`,e[e.SetextHeading2=16]=`SetextHeading2`,e[e.HTMLBlock=17]=`HTMLBlock`,e[e.LinkReference=18]=`LinkReference`,e[e.Paragraph=19]=`Paragraph`,e[e.CommentBlock=20]=`CommentBlock`,e[e.ProcessingInstructionBlock=21]=`ProcessingInstructionBlock`,e[e.Escape=22]=`Escape`,e[e.Entity=23]=`Entity`,e[e.HardBreak=24]=`HardBreak`,e[e.Emphasis=25]=`Emphasis`,e[e.StrongEmphasis=26]=`StrongEmphasis`,e[e.Link=27]=`Link`,e[e.Image=28]=`Image`,e[e.InlineCode=29]=`InlineCode`,e[e.HTMLTag=30]=`HTMLTag`,e[e.Comment=31]=`Comment`,e[e.ProcessingInstruction=32]=`ProcessingInstruction`,e[e.Autolink=33]=`Autolink`,e[e.HeaderMark=34]=`HeaderMark`,e[e.QuoteMark=35]=`QuoteMark`,e[e.ListMark=36]=`ListMark`,e[e.LinkMark=37]=`LinkMark`,e[e.EmphasisMark=38]=`EmphasisMark`,e[e.CodeMark=39]=`CodeMark`,e[e.CodeText=40]=`CodeText`,e[e.CodeInfo=41]=`CodeInfo`,e[e.LinkTitle=42]=`LinkTitle`,e[e.LinkLabel=43]=`LinkLabel`,e[e.URL=44]=`URL`})(b||={});var ue=class{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}},de=class{constructor(){this.text=``,this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return S(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r<e;r++)n+=this.text.charCodeAt(r)==9?4-n%4:1;return n}findColumn(e){let t=0;for(let n=0;t<this.text.length&&n<e;t++)n+=this.text.charCodeAt(t)==9?4-n%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e=``;for(let t=0;t<this.basePos;t++)e+=` `;return e+this.text.slice(this.basePos)}};function fe(e,t,n){if(n.pos==n.text.length||e!=t.block&&n.indent>=t.stack[n.depth+1].value+n.baseIndent)return!0;if(n.indent>=n.baseIndent+4)return!1;let r=(e.type==b.OrderedList?T:w)(n,t,!1);return r>0&&(e.type!=b.BulletList||C(n,t,!1)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}var pe={[b.Blockquote](e,t,n){return n.next==62?(n.markers.push(I(b.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1)),n.moveBase(n.pos+(x(n.text.charCodeAt(n.pos+1))?2:1)),e.end=t.lineStart+n.text.length,!0):!1},[b.ListItem](e,t,n){return n.indent<n.baseIndent+e.value&&n.next>-1?!1:(n.moveBaseColumn(n.baseIndent+e.value),!0)},[b.OrderedList]:fe,[b.BulletList]:fe,[b.Document](){return!0}};function x(e){return e==32||e==9||e==10||e==13}function S(e,t=0){for(;t<e.length&&x(e.charCodeAt(t));)t++;return t}function me(e,t,n){for(;t>n&&x(e.charCodeAt(t-1));)t--;return t}function he(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;if(t<e.pos+3)return-1;if(e.next==96){for(let n=t;n<e.text.length;n++)if(e.text.charCodeAt(n)==96)return-1}return t}function ge(e){return e.next==62?e.text.charCodeAt(e.pos+1)==32?2:1:-1}function C(e,t,n){if(e.next!=42&&e.next!=45&&e.next!=95)return-1;let r=1;for(let t=e.pos+1;t<e.text.length;t++){let n=e.text.charCodeAt(t);if(n==e.next)r++;else if(!x(n))return-1}return n&&e.next==45&&ye(e)>-1&&e.depth==t.stack.length&&t.parser.leafBlockParsers.indexOf(Ee.SetextHeading)>-1||r<3?-1:1}function _e(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return!0;return!1}function w(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||x(e.text.charCodeAt(e.pos+1)))&&(!n||_e(t,b.BulletList)||e.skipSpace(e.pos+2)<e.text.length)?1:-1}function T(e,t,n){let r=e.pos,i=e.next;for(;i>=48&&i<=57;){if(r++,r==e.text.length)return-1;i=e.text.charCodeAt(r)}return r==e.pos||r>e.pos+9||i!=46&&i!=41||r<e.text.length-1&&!x(e.text.charCodeAt(r+1))||n&&!_e(t,b.OrderedList)&&(e.skipSpace(r+1)==e.text.length||r>e.pos+1||e.next!=49)?-1:r+1-e.pos}function ve(e){if(e.next!=35)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==35;)t++;if(t<e.text.length&&e.text.charCodeAt(t)!=32)return-1;let n=t-e.pos;return n>6?-1:n}function ye(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;for(;t<e.text.length&&e.text.charCodeAt(t)==e.next;)t++;let n=t;for(;t<e.text.length&&x(e.text.charCodeAt(t));)t++;return t==e.text.length?n:-1}var E=/^[ \t]*$/,be=/-->/,xe=/\?>/,D=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,be],[/^\s*<\?/,xe],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?: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|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,E],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,E]];function Se(e,t,n){if(e.next!=60)return-1;let r=e.text.slice(e.pos);for(let e=0,t=D.length-+!!n;e<t;e++)if(D[e][0].test(r))return e;return-1}function Ce(e,t){let n=e.countIndent(t,e.pos,e.indent),r=e.countIndent(e.skipSpace(t),t,n);return r>=n+5?n+1:r}function O(e,t,n){let r=e.length-1;r>=0&&e[r].to==t&&e[r].type==b.CodeText?e[r].to=n:e.push(I(b.CodeText,t,n))}var k={LinkReference:void 0,IndentedCode(e,t){let n=t.baseIndent+4;if(t.indent<n)return!1;let r=t.findColumn(n),i=e.lineStart+r,a=e.lineStart+t.text.length,o=[],s=[];for(O(o,i,a);e.nextLine()&&t.depth>=e.stack.length;)if(t.pos==t.text.length){O(s,e.lineStart-1,e.lineStart);for(let e of t.markers)s.push(e)}else if(t.indent<n)break;else{if(s.length){for(let e of s)e.type==b.CodeText?O(o,e.from,e.to):o.push(e);s=[]}O(o,e.lineStart-1,e.lineStart);for(let e of t.markers)o.push(e);a=e.lineStart+t.text.length;let n=e.lineStart+t.findColumn(t.baseIndent+4);n<a&&O(o,n,a)}return s.length&&(s=s.filter(e=>e.type!=b.CodeText),s.length&&(t.markers=s.concat(t.markers))),e.addNode(e.buffer.writeElements(o,-i).finish(b.CodeBlock,a-i),i),!0},FencedCode(e,t){let n=he(t);if(n<0)return!1;let r=e.lineStart+t.pos,i=t.next,a=n-t.pos,o=t.skipSpace(n),s=me(t.text,t.text.length,o),c=[I(b.CodeMark,r,r+a)];o<s&&c.push(I(b.CodeInfo,e.lineStart+o,e.lineStart+s));for(let n=!0,r=!0,o=!1;e.nextLine()&&t.depth>=e.stack.length;n=!1){let s=t.pos;if(t.indent-t.baseIndent<4)for(;s<t.text.length&&t.text.charCodeAt(s)==i;)s++;if(s-t.pos>=a&&t.skipSpace(s)==t.text.length){for(let e of t.markers)c.push(e);r&&o&&O(c,e.lineStart-1,e.lineStart),c.push(I(b.CodeMark,e.lineStart+t.pos,e.lineStart+s)),e.nextLine();break}else{o=!0,n||(O(c,e.lineStart-1,e.lineStart),r=!1);for(let e of t.markers)c.push(e);let i=e.lineStart+t.basePos,a=e.lineStart+t.text.length;i<a&&(O(c,i,a),r=!1)}}return e.addNode(e.buffer.writeElements(c,-r).finish(b.FencedCode,e.prevLineEnd()-r),r),!0},Blockquote(e,t){let n=ge(t);return n<0?!1:(e.startContext(b.Blockquote,t.pos),e.addNode(b.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1),t.moveBase(t.pos+n),null)},HorizontalRule(e,t){if(C(t,e,!1)<0)return!1;let n=e.lineStart+t.pos;return e.nextLine(),e.addNode(b.HorizontalRule,n),!0},BulletList(e,t){let n=w(t,e,!1);if(n<0)return!1;e.block.type!=b.BulletList&&e.startContext(b.BulletList,t.basePos,t.next);let r=Ce(t,t.pos+1);return e.startContext(b.ListItem,t.basePos,r-t.baseIndent),e.addNode(b.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},OrderedList(e,t){let n=T(t,e,!1);if(n<0)return!1;e.block.type!=b.OrderedList&&e.startContext(b.OrderedList,t.basePos,t.text.charCodeAt(t.pos+n-1));let r=Ce(t,t.pos+n);return e.startContext(b.ListItem,t.basePos,r-t.baseIndent),e.addNode(b.ListMark,e.lineStart+t.pos,e.lineStart+t.pos+n),t.moveBaseColumn(r),null},ATXHeading(e,t){let n=ve(t);if(n<0)return!1;let r=t.pos,i=e.lineStart+r,a=me(t.text,t.text.length,r),o=a;for(;o>r&&t.text.charCodeAt(o-1)==t.next;)o--;(o==a||o==r||!x(t.text.charCodeAt(o-1)))&&(o=t.text.length);let s=e.buffer.write(b.HeaderMark,0,n).writeElements(e.parser.parseInline(t.text.slice(r+n+1,o),i+n+1),-i);o<t.text.length&&s.write(b.HeaderMark,o-r,a-r);let c=s.finish(b.ATXHeading1-1+n,t.text.length-r);return e.nextLine(),e.addNode(c,i),!0},HTMLBlock(e,t){let n=Se(t,e,!1);if(n<0)return!1;let r=e.lineStart+t.pos,i=D[n][1],a=[],o=i!=E;for(;!i.test(t.text)&&e.nextLine();){if(t.depth<e.stack.length){o=!1;break}for(let e of t.markers)a.push(e)}o&&e.nextLine();let s=i==be?b.CommentBlock:i==xe?b.ProcessingInstructionBlock:b.HTMLBlock,c=e.prevLineEnd();return e.addNode(e.buffer.writeElements(a,-r).finish(s,c-r),r),!0},SetextHeading:void 0},we=class{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,n){if(this.stage==-1)return!1;let r=n.content+`
2
+ `+t.scrub(),i=this.advance(r);return i>-1&&i<r.length?this.complete(e,n,i):!1}finish(e,t){return(this.stage==2||this.stage==3)&&S(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,n){return e.addLeafElement(t,I(b.LinkReference,this.start,this.start+n,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;)if(this.stage==-1)return-1;else if(this.stage==0){if(!this.nextStage(Ve(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(I(b.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(ze(e,S(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=S(e,this.pos),n=0;if(t>this.pos){let r=Be(e,t,this.start);if(r){let t=A(e,r.to-this.start);t>0&&(this.nextStage(r),n=t)}}return n||=A(e,this.pos),n>0&&n<e.length?n:-1}else return A(e,this.pos)}};function A(e,t){for(;t<e.length;t++){let n=e.charCodeAt(t);if(n==10)break;if(!x(n))return-1}return t}var Te=class{nextLine(e,t,n){let r=t.depth<e.stack.length?-1:ye(t),i=t.next;if(r<0)return!1;let a=I(b.HeaderMark,e.lineStart+t.pos,e.lineStart+r);return e.nextLine(),e.addLeafElement(n,I(i==61?b.SetextHeading1:b.SetextHeading2,n.start,e.prevLineEnd(),[...e.parser.parseInline(n.content,n.start),a])),!0}finish(){return!1}},Ee={LinkReference(e,t){return t.content.charCodeAt(0)==91?new we(t):null},SetextHeading(){return new Te}},De=[(e,t)=>ve(t)>=0,(e,t)=>he(t)>=0,(e,t)=>ge(t)>=0,(e,t)=>w(t,e,!0)>=0,(e,t)=>T(t,e,!0)>=0,(e,t)=>C(t,e,!0)>=0,(e,t)=>Se(t,e,!0)>=0],Oe={text:``,end:0},ke=class{constructor(e,t,n,r){this.parser=e,this.input=t,this.ranges=r,this.line=new de,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=r[r.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=r[0].from,this.block=le.create(b.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=n.length?new Ue(n,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let t=0;;){let n=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;t<e.markers.length&&(!n||e.markers[t].from<n.end);){let n=e.markers[t++];this.addNode(n.type,n.from,n.to)}if(!n)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;start:for(;;){for(let t of this.parser.blockParsers)if(t){let n=t(this,e);if(n!=0){if(n==1)return null;e.forward();continue start}}break}let t=new ue(this.lineStart+e.pos,e.text.slice(e.pos));for(let e of this.parser.leafBlockParsers)if(e){let n=e(this,t);n&&t.parsers.push(n)}lines:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let n of this.parser.endLeafBlock)if(n(this,e,t))break lines}for(let n of t.parsers)if(n.nextLine(this,e,t))return null;t.content+=`
3
+ `+e.scrub();for(let n of e.markers)t.marks.push(n)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw RangeError(`Can't move stoppedAt forward`);this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=We(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=Oe;if(t.end=e,e>=this.to)t.text=``;else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let e=this.absoluteLineStart,n=this.rangeI;for(;this.ranges[n].to<t.end;){n++;let r=this.ranges[n].from,i=this.lineChunkAt(r);t.end=r+i.length,t.text=t.text.slice(0,this.ranges[n-1].to-e)+i,e=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:n}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=n,e.reset(t);e.depth<this.stack.length;e.depth++){let t=this.stack[e.depth],n=this.parser.skipContextMarkup[t.type];if(!n)throw Error(`Unhandled block context `+b[t.type]);let r=this.line.markers.length;if(!n(t,this,e)){this.line.markers.length>r&&(t.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),n;if(this.input.lineChunks)n=t==`
4
+ `?``:t;else{let e=t.indexOf(`
5
+ `);n=e<0?t:t.slice(0,e)}return e+n.length>this.to?n.slice(0,this.to-e):n}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,n=0){this.block=le.create(e,n,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,n=0){this.startContext(this.parser.getNodeType(e),t,n)}addNode(e,t,n){typeof e==`number`&&(e=new l(this.parser.nodeSet.types[e],P,P,(n??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(U(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?Ae(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let t of e.parsers)if(t.finish(this,e))return;let t=U(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(b.Paragraph,e.content.length),e.start)}elt(e,t,n,r){return typeof e==`string`?I(this.parser.getNodeType(e),t,n,r):new Pe(e,t)}get buffer(){return new Ne(this.parser.nodeSet)}};function Ae(e,t,n,r,i){let a=e[t].to,o=[],s=[],c=n.from+r;function u(n,i){for(;i?n>=a:n>a;){let i=e[t+1].from-a;r+=i,n+=i,t++,a=e[t].to}}for(let l=n.firstChild;l;l=l.nextSibling){u(l.from+r,!0);let n=l.from+r,d,f=i.get(l.tree);f?d=f:l.to+r>a?(d=Ae(e,t,l,r,i),u(l.to+r,!1)):d=l.toTree(),o.push(d),s.push(n-c)}return u(n.to+r,!1),new l(n.type,o,s,n.to+r-c,n.tree?n.tree.propValues:void 0)}var je=class e extends m{constructor(e,t,n,r,i,a,o,s,c){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=n,this.blockNames=r,this.endLeafBlock=i,this.skipContextMarkup=a,this.inlineParsers=o,this.inlineNames=s,this.wrappers=c,this.nodeTypes=Object.create(null);for(let t of e.types)this.nodeTypes[t.name]=t.id}createParse(e,t,n){let r=new ke(this,e,t,n);for(let i of this.wrappers)r=i(r,e,t,n);return r}configure(t){let n=M(t);if(!n)return this;let{nodeSet:r,skipContextMarkup:i}=this,a=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),s=this.blockNames.slice(),c=this.inlineParsers.slice(),l=this.inlineNames.slice(),u=this.endLeafBlock.slice(),d=this.wrappers;if(j(n.defineNodes)){i=Object.assign({},i);let e=r.types.slice(),t;for(let r of n.defineNodes){let{name:n,block:a,composite:o,style:s}=typeof r==`string`?{name:r}:r;if(e.some(e=>e.name==n))continue;o&&(i[e.length]=(e,t,n)=>o(t,n,e.value));let c=e.length,l=o?[`Block`,`BlockContext`]:a?c>=b.ATXHeading1&&c<=b.SetextHeading2?[`Block`,`LeafBlock`,`Heading`]:[`Block`,`LeafBlock`]:void 0;e.push(_.define({id:c,name:n,props:l&&[[p.group,l]]})),s&&(t||={},Array.isArray(s)||s instanceof ie?t[n]=s:Object.assign(t,s))}r=new ne(e),t&&(r=r.extend(te(t)))}if(j(n.props)&&(r=r.extend(...n.props)),j(n.remove))for(let e of n.remove){let t=this.blockNames.indexOf(e),n=this.inlineNames.indexOf(e);t>-1&&(a[t]=o[t]=void 0),n>-1&&(c[n]=void 0)}if(j(n.parseBlock))for(let e of n.parseBlock){let t=s.indexOf(e.name);if(t>-1)a[t]=e.parse,o[t]=e.leaf;else{let t=e.before?N(s,e.before):e.after?N(s,e.after)+1:s.length-1;a.splice(t,0,e.parse),o.splice(t,0,e.leaf),s.splice(t,0,e.name)}e.endLeaf&&u.push(e.endLeaf)}if(j(n.parseInline))for(let e of n.parseInline){let t=l.indexOf(e.name);if(t>-1)c[t]=e.parse;else{let t=e.before?N(l,e.before):e.after?N(l,e.after)+1:l.length-1;c.splice(t,0,e.parse),l.splice(t,0,e.name)}}return n.wrap&&(d=d.concat(n.wrap)),new e(r,a,o,s,u,i,c,l,d)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let n=new H(this,e,t);outer:for(let e=t;e<n.end;){let t=n.char(e);for(let r of this.inlineParsers)if(r){let i=r(n,t,e);if(i>=0){e=i;continue outer}}e++}return n.resolveMarkers(0)}};function j(e){return e!=null&&e.length>0}function M(e){if(!Array.isArray(e))return e;if(e.length==0)return null;let t=M(e[0]);if(e.length==1)return t;let n=M(e.slice(1));if(!n||!t)return t||n;let r=(e,t)=>(e||P).concat(t||P),i=t.wrap,a=n.wrap;return{props:r(t.props,n.props),defineNodes:r(t.defineNodes,n.defineNodes),parseBlock:r(t.parseBlock,n.parseBlock),parseInline:r(t.parseInline,n.parseInline),remove:r(t.remove,n.remove),wrap:i?a?(e,t,n,r)=>i(a(e,t,n,r),t,n,r):i:a}}function N(e,t){let n=e.indexOf(t);if(n<0)throw RangeError(`Position specified relative to unknown parser ${t}`);return n}var Me=[_.none];for(let e=1,t;t=b[e];e++)Me[e]=_.define({id:e,name:t,props:e>=b.Escape?[]:[[p.group,e in pe?[`Block`,`BlockContext`]:[`Block`,`LeafBlock`]]],top:t==`Document`});var P=[],Ne=class{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,n,r=0){return this.content.push(e,t,n,4+r*4),this}writeElements(e,t=0){for(let n of e)n.writeTo(this,t);return this}finish(e,t){return l.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}},F=class{constructor(e,t,n,r=P){this.type=e,this.from=t,this.to=n,this.children=r}writeTo(e,t){let n=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-n)}toTree(e){return new Ne(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}},Pe=class{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return P}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}};function I(e,t,n,r){return new F(e,t,n,r)}var Fe={resolve:`Emphasis`,mark:`EmphasisMark`},Ie={resolve:`Emphasis`,mark:`EmphasisMark`},L={},R={},z=class{constructor(e,t,n,r){this.type=e,this.from=t,this.to=n,this.side=r}},Le=`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~`,B=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{B=RegExp(`[\\p{S}|\\p{P}]`,`u`)}catch{}var V={Escape(e,t,n){if(t!=92||n==e.end-1)return-1;let r=e.char(n+1);for(let t=0;t<32;t++)if(Le.charCodeAt(t)==r)return e.append(I(b.Escape,n,n+2));return-1},Entity(e,t,n){if(t!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(e.slice(n+1,n+31));return r?e.append(I(b.Entity,n,n+1+r[0].length)):-1},InlineCode(e,t,n){if(t!=96||n&&e.char(n-1)==96)return-1;let r=n+1;for(;r<e.end&&e.char(r)==96;)r++;let i=r-n,a=0;for(;r<e.end;r++)if(e.char(r)==96){if(a++,a==i&&e.char(r+1)!=96)return e.append(I(b.InlineCode,n,r+1,[I(b.CodeMark,n,n+i),I(b.CodeMark,r+1-i,r+1)]))}else a=0;return-1},HTMLTag(e,t,n){if(t!=60||n==e.end-1)return-1;let r=e.slice(n+1,e.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(i)return e.append(I(b.Autolink,n,n+1+i[0].length,[I(b.LinkMark,n,n+1),I(b.URL,n+1,n+i[0].length),I(b.LinkMark,n+i[0].length,n+1+i[0].length)]));let a=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(a)return e.append(I(b.Comment,n,n+1+a[0].length));let o=/^\?[^]*?\?>/.exec(r);if(o)return e.append(I(b.ProcessingInstruction,n,n+1+o[0].length));let s=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return s?e.append(I(b.HTMLTag,n,n+1+s[0].length)):-1},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let r=n+1;for(;e.char(r)==t;)r++;let i=e.slice(n-1,n),a=e.slice(r,r+1),o=B.test(i),s=B.test(a),c=/\s|^$/.test(i),l=/\s|^$/.test(a),u=!l&&(!s||c||o),d=!c&&(!o||l||s),f=u&&(t==42||!d||o),p=d&&(t==42||!u||s);return e.append(new z(t==95?Fe:Ie,n,r,!!f|(p?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(I(b.HardBreak,n,n+2));if(t==32){let t=n+1;for(;e.char(t)==32;)t++;if(e.char(t)==10&&t>=n+2)return e.append(I(b.HardBreak,n,t+1))}return-1},Link(e,t,n){return t==91?e.append(new z(L,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new z(R,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let t=e.parts.length-1;t>=0;t--){let r=e.parts[t];if(r instanceof z&&(r.type==L||r.type==R)){if(!r.side||e.skipSpace(r.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2)))return e.parts[t]=null,-1;let i=e.takeContent(t),a=e.parts[t]=Re(e,i,r.type==L?b.Link:b.Image,r.from,n+1);if(r.type==L)for(let n=0;n<t;n++){let t=e.parts[n];t instanceof z&&t.type==L&&(t.side=0)}return a.to}}return-1}};function Re(e,t,n,r,i){let{text:a}=e,o=e.char(i),s=i;if(t.unshift(I(b.LinkMark,r,r+(n==b.Image?2:1))),t.push(I(b.LinkMark,i-1,i)),o==40){let n=e.skipSpace(i+1),r=ze(a,n-e.offset,e.offset),o;r&&(n=e.skipSpace(r.to),n!=r.to&&(o=Be(a,n-e.offset,e.offset),o&&(n=e.skipSpace(o.to)))),e.char(n)==41&&(t.push(I(b.LinkMark,i,i+1)),s=n+1,r&&t.push(r),o&&t.push(o),t.push(I(b.LinkMark,n,s)))}else if(o==91){let n=Ve(a,i-e.offset,e.offset,!1);n&&(t.push(n),s=n.to)}return I(n,r,s,t)}function ze(e,t,n){if(e.charCodeAt(t)==60){for(let r=t+1;r<e.length;r++){let i=e.charCodeAt(r);if(i==62)return I(b.URL,t+n,r+1+n);if(i==60||i==10)return!1}return null}else{let r=0,i=t;for(let t=!1;i<e.length;i++){let n=e.charCodeAt(i);if(x(n))break;if(t)t=!1;else if(n==40)r++;else if(n==41){if(!r)break;r--}else n==92&&(t=!0)}return i>t?I(b.URL,t+n,i+n):i==e.length?null:!1}}function Be(e,t,n){let r=e.charCodeAt(t);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let r=t+1,a=!1;r<e.length;r++){let o=e.charCodeAt(r);if(a)a=!1;else if(o==i)return I(b.LinkTitle,t+n,r+1+n);else o==92&&(a=!0)}return null}function Ve(e,t,n,r){for(let i=!1,a=t+1,o=Math.min(e.length,a+999);a<o;a++){let o=e.charCodeAt(a);if(i)i=!1;else if(o==93)return r?!1:I(b.LinkLabel,t+n,a+1+n);else{if(r&&!x(o)&&(r=!1),o==91)return!1;o==92&&(i=!0)}}return null}var H=class{constructor(e,t,n){this.parser=e,this.text=t,this.offset=n,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,n,r,i){return this.append(new z(e,t,n,!!r|(i?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof z&&(t.type==L||t.type==R))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let t=e;t<this.parts.length;t++){let n=this.parts[t];if(!(n instanceof z&&n.type.resolve&&n.side&2))continue;let r=n.type==Fe||n.type==Ie,i=n.to-n.from,a,o=t-1;for(;o>=e;o--){let e=this.parts[o];if(e instanceof z&&e.side&1&&e.type==n.type&&!(r&&(n.side&1||e.side&2)&&(e.to-e.from+i)%3==0&&((e.to-e.from)%3||i%3))){a=e;break}}if(!a)continue;let s=n.type.resolve,c=[],l=a.from,u=n.to;if(r){let e=Math.min(2,a.to-a.from,i);l=a.to-e,u=n.from+e,s=e==1?`Emphasis`:`StrongEmphasis`}a.type.mark&&c.push(this.elt(a.type.mark,l,a.to));for(let e=o+1;e<t;e++)this.parts[e]instanceof F&&c.push(this.parts[e]),this.parts[e]=null;n.type.mark&&c.push(this.elt(n.type.mark,n.from,u));let d=this.elt(s,l,u,c);this.parts[o]=r&&a.from!=l?new z(a.type,a.from,l,a.side):null,(this.parts[t]=r&&n.to!=u?new z(n.type,u,n.to,n.side):null)?this.parts.splice(t,0,d):this.parts[t]=d}let t=[];for(let n=e;n<this.parts.length;n++){let e=this.parts[n];e instanceof F&&t.push(e)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let n=this.parts[t];if(n instanceof z&&n.type==e&&n.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof z?t:null}skipSpace(e){return S(this.text,e-this.offset)+this.offset}elt(e,t,n,r){return typeof e==`string`?I(this.parser.getNodeType(e),t,n,r):new Pe(e,t)}};H.linkStart=L,H.imageStart=R;function U(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),r=0;for(let e of t){for(;r<n.length&&n[r].to<e.to;)r++;if(r<n.length&&n[r].from<e.from){let t=n[r];t instanceof F&&(n[r]=new F(t.type,t.from,t.to,U(t.children,[e])))}else n.splice(r++,0,e)}return n}var He=[b.CodeBlock,b.ListItem,b.OrderedList,b.BulletList],Ue=class{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let e=this.fragment.to;for(;e>0&&this.input.read(e-1,e)!=`
6
+ `;)e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;n||(n=this.cursor=this.fragment.tree.cursor(),n.firstChild());let r=e+this.fragment.offset;for(;n.to<=r;)if(!n.parent())return!1;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(p.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-+!!this.fragment.openEnd,i=e.absoluteLineStart,a=i,o=e.block.children.length,s=a,c=o;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let i=We(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to)e.addNode(t.tree,i);else{let n=new l(e.parser.nodeSet.types[b.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree),e.addNode(n,i)}if(t.type.is(`Block`)&&(He.indexOf(t.type.id)<0?(a=t.to-n,o=e.block.children.length):(a=s,o=c),s=t.to-n,c=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>o;)e.block.children.pop(),e.block.positions.pop();return a-i}};function We(e,t){let n=e;for(let r=1;r<t.length;r++){let i=t[r-1].to,a=t[r].from;i<e&&(n-=a-i)}return n}var Ge=te({"Blockquote/...":y.quote,HorizontalRule:y.contentSeparator,"ATXHeading1/... SetextHeading1/...":y.heading1,"ATXHeading2/... SetextHeading2/...":y.heading2,"ATXHeading3/...":y.heading3,"ATXHeading4/...":y.heading4,"ATXHeading5/...":y.heading5,"ATXHeading6/...":y.heading6,"Comment CommentBlock":y.comment,Escape:y.escape,Entity:y.character,"Emphasis/...":y.emphasis,"StrongEmphasis/...":y.strong,"Link/... Image/...":y.link,"OrderedList/... BulletList/...":y.list,"BlockQuote/...":y.quote,"InlineCode CodeText":y.monospace,"URL Autolink":y.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":y.processingInstruction,"CodeInfo LinkLabel":y.labelName,LinkTitle:y.string,Paragraph:y.content}),Ke=new je(new ne(Me).extend(Ge),Object.keys(k).map(e=>k[e]),Object.keys(k).map(e=>Ee[e]),Object.keys(k),De,pe,Object.keys(V).map(e=>V[e]),Object.keys(V),[]);function qe(e,t,n){let r=[];for(let i=e.firstChild,a=t;;i=i.nextSibling){let e=i?i.from:n;if(e>a&&r.push({from:a,to:e}),!i)break;a=i.to}return r}function Je(e){let{codeParser:t,htmlParser:n}=e;return{wrap:ae((e,r)=>{let i=e.type.id;if(t&&(i==b.CodeBlock||i==b.FencedCode)){let n=``;if(i==b.FencedCode){let t=e.node.getChild(b.CodeInfo);t&&(n=r.read(t.from,t.to))}let a=t(n);if(a)return{parser:a,overlay:e=>e.type.id==b.CodeText,bracketed:i==b.FencedCode}}else if(n&&(i==b.HTMLBlock||i==b.HTMLTag||i==b.CommentBlock))return{parser:n,overlay:qe(e.node,e.from,e.to)};return null})}}var Ye={resolve:`Strikethrough`,mark:`StrikethroughMark`},Xe={defineNodes:[{name:`Strikethrough`,style:{"Strikethrough/...":y.strikethrough}},{name:`StrikethroughMark`,style:y.processingInstruction}],parseInline:[{name:`Strikethrough`,parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let r=e.slice(n-1,n),i=e.slice(n+2,n+3),a=/\s|^$/.test(r),o=/\s|^$/.test(i),s=B.test(r),c=B.test(i);return e.addDelimiter(Ye,n,n+2,!o&&(!c||a||s),!a&&(!s||o||c))},after:`Emphasis`}]};function W(e,t,n=0,r,i=0){let a=0,o=!0,s=-1,c=-1,l=!1,u=()=>{r.push(e.elt(`TableCell`,i+s,i+c,e.parser.parseInline(t.slice(s,c),i+s)))};for(let d=n;d<t.length;d++){let n=t.charCodeAt(d);n==124&&!l?((!o||s>-1)&&a++,o=!1,r&&(s>-1&&u(),r.push(e.elt(`TableDelimiter`,d+i,d+i+1))),s=c=-1):(l||n!=32&&n!=9)&&(s<0&&(s=d),c=d+1),l=!l&&n==92}return s>-1&&(a++,r&&u()),a}function Ze(e,t){for(let n=t;n<e.length;n++){let t=e.charCodeAt(n);if(t==124)return!0;t==92&&n++}return!1}var Qe=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/,$e=class{constructor(){this.rows=null}nextLine(e,t,n){if(this.rows==null){this.rows=!1;let r;if((t.next==45||t.next==58||t.next==124)&&Qe.test(r=t.text.slice(t.pos))){let i=[];W(e,n.content,0,i,n.start)==W(e,r,0)&&(this.rows=[e.elt(`TableHeader`,n.start,n.start+n.content.length,i),e.elt(`TableDelimiter`,e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let n=[];W(e,t.text,t.pos,n,e.lineStart),this.rows.push(e.elt(`TableRow`,e.lineStart+t.pos,e.lineStart+t.text.length,n))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt(`Table`,t.start,t.start+t.content.length,this.rows)),!0):!1}},et={defineNodes:[{name:`Table`,block:!0},{name:`TableHeader`,style:{"TableHeader/...":y.heading}},`TableRow`,{name:`TableCell`,style:y.content},{name:`TableDelimiter`,style:y.processingInstruction}],parseBlock:[{name:`Table`,leaf(e,t){return Ze(t.content,0)?new $e:null},endLeaf(e,t,n){if(n.parsers.some(e=>e instanceof $e)||!Ze(t.text,t.basePos))return!1;let r=e.peekLine();return Qe.test(r)&&W(e,t.text,t.basePos)==W(e,r,t.basePos)},before:`SetextHeading`}]},tt=class{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt(`Task`,t.start,t.start+t.content.length,[e.elt(`TaskMarker`,t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}},nt={defineNodes:[{name:`Task`,block:!0,style:y.list},{name:`TaskMarker`,style:y.atom}],parseBlock:[{name:`TaskList`,leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name==`ListItem`?new tt:null},after:`SetextHeading`}]},rt=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,it=/[\w-]+(\.[\w-]+)+(:\d+)?(\/[^\s<]*)?/gy,at=/[\w-]+\.[\w-]+($|[/:])/,ot=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,st=/\/[a-zA-Z\d@.]+/gy;function ct(e,t,n,r){let i=0;for(let a=t;a<n;a++)e[a]==r&&i++;return i}function lt(e,t){it.lastIndex=t;let n=it.exec(e);if(!n||at.exec(n[0])[0].indexOf(`_`)>-1)return-1;let r=t+n[0].length;for(;;){let n=e[r-1],i;if(/[?!.,:*_~]/.test(n)||n==`)`&&ct(e,t,r,`)`)>ct(e,t,r,`(`))r--;else if(n==`;`&&(i=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))r=t+i.index;else break}return r}function ut(e,t){ot.lastIndex=t;let n=ot.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return r==`_`||r==`-`?-1:t+n[0].length-+(r==`.`)}var dt=[et,nt,Xe,{parseInline:[{name:`Autolink`,parse(e,t,n){let r=n-e.offset;if(r&&/\w/.test(e.text[r-1]))return-1;rt.lastIndex=r;let i=rt.exec(e.text),a=-1;return!i||(i[1]||i[2]?(a=lt(e.text,r+i[0].length),a>-1&&e.hasOpenLink&&(a=r+/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r,a))[0].length)):i[3]?a=ut(e.text,r):(a=ut(e.text,r+i[0].length),a>-1&&i[0]==`xmpp:`&&(st.lastIndex=a,i=st.exec(e.text),i&&(a=i.index+i[0].length))),a<0)?-1:(e.addElement(e.elt(`URL`,n,a+e.offset)),a+e.offset)}}]}];function ft(e,t,n){return(r,i,a)=>{if(i!=e||r.char(a+1)==e)return-1;let o=[r.elt(n,a,a+1)];for(let i=a+1;i<r.end;i++){let s=r.char(i);if(s==e)return r.addElement(r.elt(t,a,i+1,o.concat(r.elt(n,i,i+1))));if(s==92&&o.push(r.elt(`Escape`,i,i+++2)),x(s))break}return-1}}var pt={defineNodes:[{name:`Superscript`,style:y.special(y.content)},{name:`SuperscriptMark`,style:y.processingInstruction}],parseInline:[{name:`Superscript`,parse:ft(94,`Superscript`,`SuperscriptMark`)}]},mt={defineNodes:[{name:`Subscript`,style:y.special(y.content)},{name:`SubscriptMark`,style:y.processingInstruction}],parseInline:[{name:`Subscript`,parse:ft(126,`Subscript`,`SubscriptMark`)}]},ht={defineNodes:[{name:`Emoji`,style:y.character}],parseInline:[{name:`Emoji`,parse(e,t,n){let r;return t!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(e.slice(n+1,e.end)))?-1:e.addElement(e.elt(`Emoji`,n,n+1+r[0].length))}}]},gt=a({commentTokens:{block:{open:`<!--`,close:`-->`}}}),_t=new p,vt=Ke.configure({props:[t.add(e=>!e.is(`Block`)||e.is(`Document`)||G(e)!=null||yt(e)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),_t.add(G),o.add({Document:()=>null}),n.add({Document:gt})]});function G(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:void 0}function yt(e){return e.name==`OrderedList`||e.name==`BulletList`}function bt(e,t){let n=e;for(;;){let e=n.nextSibling,r;if(!e||(r=G(e.type))!=null&&r<=t)break;n=e}return n.to}var xt=s.of((e,t,n)=>{for(let r=f(e).resolveInner(n,-1);r&&!(r.from<t);r=r.parent){let e=r.type.prop(_t);if(e==null)continue;let t=bt(r,e);if(t>n)return{from:n,to:t}}return null});function K(e){return new r(gt,e,[],`markdown`)}var St=K(vt),q=K(vt.configure([dt,mt,pt,ht,{props:[t.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]));function Ct(e,t){return n=>{if(n&&e){let t=null;if(n=/\S*/.exec(n)[0],t=typeof e==`function`?e(n):oe.matchLanguageName(e,n,!0),t instanceof oe)return t.support?t.support.language.parser:i.getSkippingParser(t.load());if(t)return t.parser}return t?t.parser:null}}var J=class{constructor(e,t,n,r,i,a,o){this.node=e,this.from=t,this.to=n,this.spaceBefore=r,this.spaceAfter=i,this.type=a,this.item=o}blank(e,t=!0){let n=this.spaceBefore+(this.node.name==`Blockquote`?`>`:``);if(e!=null){for(;n.length<e;)n+=` `;return n}else{for(let e=this.to-this.from-n.length-this.spaceAfter.length;e>0;e--)n+=` `;return n+(t?this.spaceAfter:``)}}marker(e,t){let n=this.node.name==`OrderedList`?String(+wt(this.item,e)[2]+t):``;return this.spaceBefore+n+this.type+this.spaceAfter}};function Y(e,t){let n=[],r=[];for(let t=e;t;t=t.parent){if(t.name==`FencedCode`)return r;(t.name==`ListItem`||t.name==`Blockquote`)&&n.push(t)}for(let e=n.length-1;e>=0;e--){let i=n[e],a,o=t.lineAt(i.from),s=i.from-o.from;if(i.name==`Blockquote`&&(a=/^ *>( ?)/.exec(o.text.slice(s))))r.push(new J(i,s,s+a[0].length,``,a[1],`>`,null));else if(i.name==`ListItem`&&i.parent.name==`OrderedList`&&(a=/^( *)\d+([.)])( *)/.exec(o.text.slice(s)))){let e=a[3],t=a[0].length;e.length>=4&&(e=e.slice(0,e.length-4),t-=4),r.push(new J(i.parent,s,s+t,a[1],e,a[2],i))}else if(i.name==`ListItem`&&i.parent.name==`BulletList`&&(a=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(o.text.slice(s)))){let e=a[4],t=a[0].length;e.length>4&&(e=e.slice(0,e.length-4),t-=4);let n=a[2];a[3]&&(n+=a[3].replace(/[xX]/,` `)),r.push(new J(i.parent,s,s+t,a[1],e,n,i))}}return r}function wt(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function X(e,t,n,r=0){for(let i=-1,a=e;;){if(a.name==`ListItem`){let e=wt(a,t),o=+e[2];if(i>=0){if(o!=i+1)return;n.push({from:a.from+e[1].length,to:a.from+e[0].length,insert:String(i+2+r)})}i=o}let e=a.nextSibling;if(!e)break;a=e}}function Z(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(c)!=` `)return e;let r=g(e,4,n),i=``;for(let e=r;e>0;)e>=4?(i+=` `,e-=4):(i+=` `,e--);return i+e.slice(n)}var Tt=((e={})=>({state:t,dispatch:n})=>{let r=f(t),{doc:i}=t,a=null,o=t.changeByRange(n=>{if(!n.empty||!q.isActiveAt(t,n.from,-1)&&!q.isActiveAt(t,n.from,1))return a={range:n};let o=n.from,s=i.lineAt(o),c=Y(r.resolveInner(o,-1),i);for(;c.length&&c[c.length-1].from>o-s.from;)c.pop();if(!c.length)return a={range:n};let l=c[c.length-1];if(l.to-l.spaceAfter.length>o-s.from)return a={range:n};let u=o>=l.to-l.spaceAfter.length&&!/\S/.test(s.text.slice(l.to));if(l.item&&u){let n=l.node.firstChild,r=l.node.getChild(`ListItem`,`ListItem`);if(n.to>=o||r&&r.to<o||s.from>0&&!/[^\s>]/.test(i.lineAt(s.from-1).text)||e.nonTightLists===!1){let e=c.length>1?c[c.length-2]:null,t,n=``;e&&e.item?(t=s.from+e.from,n=e.marker(i,1)):t=s.from+(e?e.to:0);let r=[{from:t,to:o,insert:n}];return l.node.name==`OrderedList`&&X(l.item,i,r,-2),e&&e.node.name==`OrderedList`&&X(e.item,i,r),{range:v.cursor(t+n.length),changes:r}}else{let e=Ot(c,t,s);return{range:v.cursor(o+e.length+1),changes:{from:s.from,insert:e+t.lineBreak}}}}if(l.node.name==`Blockquote`&&u&&s.from){let e=i.lineAt(s.from-1),r=/>\s*$/.exec(e.text);if(r&&r.index==l.from){let i=t.changes([{from:e.from+r.index,to:e.to},{from:s.from+l.from,to:s.to}]);return{range:n.map(i),changes:i}}}let d=[];l.node.name==`OrderedList`&&X(l.item,i,d);let f=l.item&&l.item.from<s.from,p=``;if(!f||/^[\s\d.)\-+*>]*/.exec(s.text)[0].length>=l.to)for(let e=0,t=c.length-1;e<=t;e++)p+=e==t&&!f?c[e].marker(i,1):c[e].blank(e<t?g(s.text,4,c[e+1].from)-p.length:null);let m=o;for(;m>s.from&&/\s/.test(s.text.charAt(m-s.from-1));)m--;return p=Z(p,t),Dt(l.node,t.doc)&&(p=Ot(c,t,s)+t.lineBreak+p),d.push({from:m,to:o,insert:t.lineBreak+p}),{range:v.cursor(m+p.length+1),changes:d}});return a?!1:(n(t.update(o,{scrollIntoView:!0,userEvent:`input`})),!0)})();function Et(e){return e.name==`QuoteMark`||e.name==`ListMark`}function Dt(e,t){if(e.name!=`OrderedList`&&e.name!=`BulletList`)return!1;let n=e.firstChild,r=e.getChild(`ListItem`,`ListItem`);if(!r)return!1;let i=t.lineAt(n.to),a=t.lineAt(r.from),o=/^[\s>]*$/.test(i.text);return i.number+ +!o<a.number}function Ot(e,t,n){let r=``;for(let t=0,i=e.length-2;t<=i;t++)r+=e[t].blank(t<i?g(n.text,4,e[t+1].from)-r.length:null,t<i);return Z(r,t)}function kt(e,t){let n=e.resolveInner(t,-1),r=t;Et(n)&&(r=n.from,n=n.parent);for(let e;e=n.childBefore(r);)if(Et(e))r=e.from;else if(e.name==`OrderedList`||e.name==`BulletList`)n=e.lastChild,r=n.to;else break;return n}var At=[{key:`Enter`,run:Tt},{key:`Backspace`,run:({state:e,dispatch:t})=>{let n=f(e),r=null,i=e.changeByRange(t=>{let i=t.from,{doc:a}=e;if(t.empty&&q.isActiveAt(e,t.from)){let t=a.lineAt(i),r=Y(kt(n,i),a);if(r.length){let n=r[r.length-1],a=n.to-n.spaceAfter.length+ +!!n.spaceAfter;if(i-t.from>a&&!/\S/.test(t.text.slice(a,i-t.from)))return{range:v.cursor(t.from+a),changes:{from:t.from+a,to:i}};if(i-t.from==a&&(!n.item||t.from<=n.item.from||!/\S/.test(t.text.slice(0,n.to)))){let r=t.from+n.from;if(n.item&&n.node.from<n.item.from&&/\S/.test(t.text.slice(n.from,n.to))){let i=n.blank(g(t.text,4,n.to)-g(t.text,4,n.from));return r==t.from&&(i=Z(i,e)),{range:v.cursor(r+i.length),changes:{from:r,to:t.from+n.to,insert:i}}}if(r<i)return{range:v.cursor(r),changes:{from:r,to:i}}}}}return r={range:t}});return r?!1:(t(e.update(i,{scrollIntoView:!0,userEvent:`delete`})),!0)}}],Q=se({matchClosingTags:!1});function jt(t={}){let{codeLanguages:n,defaultCodeLanguage:r,addKeymap:i=!0,base:{parser:a}=St,completeHTMLTags:o=!0,pasteURLAsLink:s=!0,htmlTagLanguage:c=Q}=t;if(!(a instanceof je))throw RangeError("Base parser provided to `markdown` should be a Markdown parser");let l=t.extensions?[t.extensions]:[],f=[c.support,xt],p;s&&f.push(Ft),r instanceof e?(f.push(r.support),p=r.language):r&&(p=r);let m=n||p?Ct(n,p):void 0;l.push(Je({codeParser:m,htmlParser:c.language.parser})),i&&f.push(d.high(u.of(At)));let h=K(a.configure(l));return o&&f.push(h.data.of({autocomplete:Mt})),new e(h,f)}function Mt(e){let{state:t,pos:n}=e,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(t.sliceDoc(n-25,n));if(!r)return null;let i=f(t).resolveInner(n,-1);for(;i&&!i.type.isTop;){if(i.name==`CodeBlock`||i.name==`FencedCode`||i.name==`ProcessingInstructionBlock`||i.name==`CommentBlock`||i.name==`Link`||i.name==`Image`)return null;i=i.parent}return{from:n-r[0].length,to:n,options:Nt(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}var $=null;function Nt(){if($)return $;let e=ce(new ee(re.create({extensions:Q}),0,!0));return $=e?e.options:[]}var Pt=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,Ft=h.domEventHandlers({paste:(e,t)=>{let{main:n}=t.state.selection;if(n.empty)return!1;let r=e.clipboardData?.getData(`text/plain`);if(!r||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(r)||(/^www\./.test(r)&&(r=`https://`+r),!q.isActiveAt(t.state,n.from,1)))return!1;let i=f(t.state),a=!1;return i.iterate({from:n.from,to:n.to,enter:e=>{(e.from>n.from||Pt.test(e.name))&&(a=!0)},leave:e=>{e.to<n.to&&(a=!0)}}),a?!1:(t.dispatch({changes:[{from:n.from,insert:`[`},{from:n.to,insert:`](${r})`}],userEvent:`input.paste`,scrollIntoView:!0}),!0)}});export{jt as markdown};