@tangle-network/sandbox-ui 2.0.16 → 2.0.18

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 (470) hide show
  1. package/README.md +2 -0
  2. package/dist/agent-stream-CBZ2fXJ2.d.ts +66 -0
  3. package/dist/code-view-BlhCS1SD.js +177 -0
  4. package/dist/globals.css +189 -150
  5. package/dist/hooks.d.ts +2 -139
  6. package/dist/hooks.js +2 -1
  7. package/dist/{index-BtR5Sc3u.d.ts → index-BnaVprN6.d.ts} +3 -66
  8. package/dist/index-D5Hig-j9.d.ts +155 -0
  9. package/dist/index.d.ts +3 -2
  10. package/dist/index.js +7 -4
  11. package/dist/{record-1OqtuwjP.js → record-Bqt1kE_Q.js} +1 -1
  12. package/dist/run/live.d.ts +10 -0
  13. package/dist/run/live.js +389 -0
  14. package/dist/run/record.js +1 -1
  15. package/dist/run.d.ts +2 -1
  16. package/dist/run.js +3 -2
  17. package/dist/runtime-viewer/AgentGraphCanvas-B74GN1o6-DC3EH_ss.js +8564 -0
  18. package/dist/runtime-viewer/abap-CJVxDCih.js +2 -0
  19. package/dist/runtime-viewer/actionscript-3-DxxSN0a_.js +2 -0
  20. package/dist/runtime-viewer/ada-Cl3FVDZo.js +2 -0
  21. package/dist/runtime-viewer/ahk-wK-qmFta.js +2 -0
  22. package/dist/runtime-viewer/ahk2-H2JA2Yl6.js +2 -0
  23. package/dist/runtime-viewer/andromeeda--b5O3zh8.js +134 -0
  24. package/dist/runtime-viewer/andromeeda-Gms6gP4X.js +3 -0
  25. package/dist/runtime-viewer/angular-html-rj1gmhWN.js +15 -0
  26. package/dist/runtime-viewer/angular-ts-Bqgem-S1.js +17 -0
  27. package/dist/runtime-viewer/apache-BUhlrTDV.js +2 -0
  28. package/dist/runtime-viewer/apex-BB9dj6FH.js +2 -0
  29. package/dist/runtime-viewer/apl-Bbo6_Uyo.js +15 -0
  30. package/dist/runtime-viewer/appendItems-Cd9l6s5M.js +709 -0
  31. package/dist/runtime-viewer/applescript-ADDjRuDN.js +2 -0
  32. package/dist/runtime-viewer/ara-qq1xXFYH.js +2 -0
  33. package/dist/runtime-viewer/asciidoc-DM4EX7__.js +2 -0
  34. package/dist/runtime-viewer/asm-BG-prohY.js +2 -0
  35. package/dist/runtime-viewer/astro-DLFBJCYZ.js +17 -0
  36. package/dist/runtime-viewer/aurora-x-9XZt7weA.js +3 -0
  37. package/dist/runtime-viewer/aurora-x-CUDrP6dl.js +148 -0
  38. package/dist/runtime-viewer/awk-CLViK1AN.js +2 -0
  39. package/dist/runtime-viewer/ayu-dark-Cn6mFqgG.js +3 -0
  40. package/dist/runtime-viewer/ayu-dark-KXkHEKeT.js +124 -0
  41. package/dist/runtime-viewer/ayu-light-CiMsj1GY.js +124 -0
  42. package/dist/runtime-viewer/ayu-light-DT1rcejT.js +3 -0
  43. package/dist/runtime-viewer/ayu-mirage-B9PABb6M.js +3 -0
  44. package/dist/runtime-viewer/ayu-mirage-D866knu2.js +124 -0
  45. package/dist/runtime-viewer/ballerina-CEQUp96R.js +2 -0
  46. package/dist/runtime-viewer/bash-CEf3P1Io.js +1 -0
  47. package/dist/runtime-viewer/bat-CZr3fv67.js +2 -0
  48. package/dist/runtime-viewer/beancount-VKRy3bBi.js +2 -0
  49. package/dist/runtime-viewer/berry-BwT4aLVg.js +2 -0
  50. package/dist/runtime-viewer/bibtex-CqljWi0V.js +2 -0
  51. package/dist/runtime-viewer/bicep-B4J9qq-Z.js +2 -0
  52. package/dist/runtime-viewer/bird2-aEHxasJz.js +2 -0
  53. package/dist/runtime-viewer/blade-CSrWCe1q.js +19 -0
  54. package/dist/runtime-viewer/bsl-BihRw6wC.js +4 -0
  55. package/dist/runtime-viewer/c-DqEbRro5.js +1 -0
  56. package/dist/runtime-viewer/c-nuWrC4_R.js +4 -0
  57. package/dist/runtime-viewer/c3-B1ecFreZ.js +2 -0
  58. package/dist/runtime-viewer/cadence-DRL7VEtm.js +2 -0
  59. package/dist/runtime-viewer/cairo-Mf356MxB.js +4 -0
  60. package/dist/runtime-viewer/catppuccin-frappe-CaZDpwbh.js +3 -0
  61. package/dist/runtime-viewer/catppuccin-frappe-D40A-eC-.js +253 -0
  62. package/dist/runtime-viewer/catppuccin-latte-BY0gIWQk.js +253 -0
  63. package/dist/runtime-viewer/catppuccin-latte-Cto1Jf_t.js +3 -0
  64. package/dist/runtime-viewer/catppuccin-macchiato-BshuwwL_.js +253 -0
  65. package/dist/runtime-viewer/catppuccin-macchiato-Da4JtJzk.js +3 -0
  66. package/dist/runtime-viewer/catppuccin-mocha-DDZ3zh14.js +253 -0
  67. package/dist/runtime-viewer/catppuccin-mocha-VxvWTjH_.js +3 -0
  68. package/dist/runtime-viewer/chapel-OTK-UUIg.js +4 -0
  69. package/dist/runtime-viewer/clarity-VQN67-z4.js +2 -0
  70. package/dist/runtime-viewer/clojure-CO3ptKNj.js +2 -0
  71. package/dist/runtime-viewer/cmake-Daw-aSZt.js +2 -0
  72. package/dist/runtime-viewer/cobol-Cf_qPd6-.js +9 -0
  73. package/dist/runtime-viewer/codeowners-RB6Ky2d_.js +2 -0
  74. package/dist/runtime-viewer/codeql-DWYIUtYc.js +2 -0
  75. package/dist/runtime-viewer/coffee-Ddb4DMEu.js +4 -0
  76. package/dist/runtime-viewer/common-lisp-Z5pdmE3i.js +2 -0
  77. package/dist/runtime-viewer/constants-BJYchxfN.js +3 -0
  78. package/dist/runtime-viewer/coq-JC5iWOqp.js +2 -0
  79. package/dist/runtime-viewer/core-CpUX80b1.js +3279 -0
  80. package/dist/runtime-viewer/cpp-ClbMDAkS.js +1 -0
  81. package/dist/runtime-viewer/cpp-DHh405em.js +15 -0
  82. package/dist/runtime-viewer/crystal-DO6lJkkC.js +17 -0
  83. package/dist/runtime-viewer/csharp-lEK6y4jq.js +2 -0
  84. package/dist/runtime-viewer/csharp-rZvb5Mvv.js +1 -0
  85. package/dist/runtime-viewer/css-CwgM346x.js +1 -0
  86. package/dist/runtime-viewer/css-D0s2ehNl.js +4 -0
  87. package/dist/runtime-viewer/csv-DDLVNpF_.js +2 -0
  88. package/dist/runtime-viewer/cue-D9icO3Iq.js +2 -0
  89. package/dist/runtime-viewer/cypher-CtaxHT1L.js +2 -0
  90. package/dist/runtime-viewer/d-D4yE5Vyh.js +2 -0
  91. package/dist/runtime-viewer/dark-plus-BrGvqa0b.js +132 -0
  92. package/dist/runtime-viewer/dark-plus-Fqa0GMhm.js +3 -0
  93. package/dist/runtime-viewer/dart-BQKGVcgZ.js +2 -0
  94. package/dist/runtime-viewer/dax-B_fglzFE.js +2 -0
  95. package/dist/runtime-viewer/desktop-D1YOnHEY.js +2 -0
  96. package/dist/runtime-viewer/diff-CiTjO3HD.js +1 -0
  97. package/dist/runtime-viewer/diff-Diuv0qGT.js +2 -0
  98. package/dist/runtime-viewer/docker-DbYJRRXH.js +4 -0
  99. package/dist/runtime-viewer/dockerfile-BFrtbjpQ.js +1 -0
  100. package/dist/runtime-viewer/dotenv-FA1qqDb1.js +2 -0
  101. package/dist/runtime-viewer/dracula-Btj3GSO9.js +3 -0
  102. package/dist/runtime-viewer/dracula-D8HPTJym.js +152 -0
  103. package/dist/runtime-viewer/dracula-soft-C8zQlEh_.js +102 -0
  104. package/dist/runtime-viewer/dracula-soft-D6LcM51i.js +3 -0
  105. package/dist/runtime-viewer/dream-maker-hpDz6By6.js +2 -0
  106. package/dist/runtime-viewer/edge-BB4FSmZo.js +11 -0
  107. package/dist/runtime-viewer/elixir-DuATaRNn.js +4 -0
  108. package/dist/runtime-viewer/elk.bundled-CqF3Dyp2.js +45979 -0
  109. package/dist/runtime-viewer/elm-82HhQ2nm.js +4 -0
  110. package/dist/runtime-viewer/emacs-lisp-C5QNYC99.js +2 -0
  111. package/dist/runtime-viewer/engine-javascript-0MH9JO7M.js +2372 -0
  112. package/dist/runtime-viewer/engine-oniguruma-7Bv9BGGj.js +237 -0
  113. package/dist/runtime-viewer/erb-YvvBNDWy.js +9 -0
  114. package/dist/runtime-viewer/erlang-X9awClOJ.js +4 -0
  115. package/dist/runtime-viewer/everforest-dark-CzXjGmbf.js +3 -0
  116. package/dist/runtime-viewer/everforest-dark-DPX_5Sj-.js +86 -0
  117. package/dist/runtime-viewer/everforest-light-BMqXq4Th.js +3 -0
  118. package/dist/runtime-viewer/everforest-light-D1PD4A7K.js +86 -0
  119. package/dist/runtime-viewer/fennel-f1xl4Q05.js +2 -0
  120. package/dist/runtime-viewer/fish-99YblEc7.js +2 -0
  121. package/dist/runtime-viewer/fluent-4LP_8ZRP.js +2 -0
  122. package/dist/runtime-viewer/formatCSSVariablePrefix-Dw8K8---.js +5 -0
  123. package/dist/runtime-viewer/fortran-fixed-form-CXgWKejO.js +4 -0
  124. package/dist/runtime-viewer/fortran-free-form-BJnwWphW.js +2 -0
  125. package/dist/runtime-viewer/fsharp-lb4HOh0M.js +4 -0
  126. package/dist/runtime-viewer/gdresource-B4QpWOUk.js +9 -0
  127. package/dist/runtime-viewer/gdscript-Dc0nUXdB.js +2 -0
  128. package/dist/runtime-viewer/gdshader-D7XodLZw.js +2 -0
  129. package/dist/runtime-viewer/genie-ufotYGgo.js +2 -0
  130. package/dist/runtime-viewer/gherkin-TDn2lJS-.js +2 -0
  131. package/dist/runtime-viewer/git-commit-Cp1Pt-h7.js +4 -0
  132. package/dist/runtime-viewer/git-rebase-CXUuGQB4.js +4 -0
  133. package/dist/runtime-viewer/github-dark-BsaUiyss.js +129 -0
  134. package/dist/runtime-viewer/github-dark-CzJ4LJRs.js +3 -0
  135. package/dist/runtime-viewer/github-dark-default-C6vmm66I.js +3 -0
  136. package/dist/runtime-viewer/github-dark-default-DHpmzBTU.js +75 -0
  137. package/dist/runtime-viewer/github-dark-dimmed-Bg7ahiYc.js +124 -0
  138. package/dist/runtime-viewer/github-dark-dimmed-CntRzgqu.js +3 -0
  139. package/dist/runtime-viewer/github-dark-high-contrast-BP5LnlnO.js +124 -0
  140. package/dist/runtime-viewer/github-dark-high-contrast-gviVHGeU.js +3 -0
  141. package/dist/runtime-viewer/github-light-2Z3gmJhd.js +3 -0
  142. package/dist/runtime-viewer/github-light-BAncjKrl.js +129 -0
  143. package/dist/runtime-viewer/github-light-default-kDVra9RT.js +124 -0
  144. package/dist/runtime-viewer/github-light-default-qgi3RC4t.js +3 -0
  145. package/dist/runtime-viewer/github-light-high-contrast-B2kY0DMu.js +124 -0
  146. package/dist/runtime-viewer/github-light-high-contrast-T0lGRgzi.js +3 -0
  147. package/dist/runtime-viewer/gleam-LV2mKtnv.js +2 -0
  148. package/dist/runtime-viewer/glimmer-js-BX9ckA-I.js +13 -0
  149. package/dist/runtime-viewer/glimmer-ts-DAfjLnWM.js +13 -0
  150. package/dist/runtime-viewer/glsl-BStsalM0.js +5 -0
  151. package/dist/runtime-viewer/gn-ChOGRsKV.js +2 -0
  152. package/dist/runtime-viewer/gnuplot-Di7UZXvs.js +2 -0
  153. package/dist/runtime-viewer/go-BrUQhiM2.js +1 -0
  154. package/dist/runtime-viewer/go-DM5FkVJr.js +2 -0
  155. package/dist/runtime-viewer/graphql-C8jzeQ3m.js +1 -0
  156. package/dist/runtime-viewer/graphql-C_WRV-qo.js +14 -0
  157. package/dist/runtime-viewer/groovy-DNa91fQJ.js +2 -0
  158. package/dist/runtime-viewer/gruvbox-dark-hard-BK-BcNOC.js +127 -0
  159. package/dist/runtime-viewer/gruvbox-dark-hard-fgme3GSG.js +3 -0
  160. package/dist/runtime-viewer/gruvbox-dark-medium-Btvv2ALk.js +127 -0
  161. package/dist/runtime-viewer/gruvbox-dark-medium-GM28AOs3.js +3 -0
  162. package/dist/runtime-viewer/gruvbox-dark-soft-D12Dlf7E.js +3 -0
  163. package/dist/runtime-viewer/gruvbox-dark-soft-ScIRFHp0.js +127 -0
  164. package/dist/runtime-viewer/gruvbox-light-hard-D0LtL2QG.js +3 -0
  165. package/dist/runtime-viewer/gruvbox-light-hard-D3d04bym.js +127 -0
  166. package/dist/runtime-viewer/gruvbox-light-medium-BUM64AiQ.js +127 -0
  167. package/dist/runtime-viewer/gruvbox-light-medium-Dbiuwhcl.js +3 -0
  168. package/dist/runtime-viewer/gruvbox-light-soft-BFyUZF8I.js +3 -0
  169. package/dist/runtime-viewer/gruvbox-light-soft-Deemyp2j.js +127 -0
  170. package/dist/runtime-viewer/hack-DrxrxETA.js +9 -0
  171. package/dist/runtime-viewer/haml-DtaFw5Wt.js +10 -0
  172. package/dist/runtime-viewer/handlebars-DdC6ISBc.js +13 -0
  173. package/dist/runtime-viewer/haskell-D6RgJWqJ.js +2 -0
  174. package/dist/runtime-viewer/haxe-CIYKU3E4.js +2 -0
  175. package/dist/runtime-viewer/hcl-B9zco17t.js +2 -0
  176. package/dist/runtime-viewer/highlights-Dcx2AVJg.js +1342 -0
  177. package/dist/runtime-viewer/hjson-sMCeQDUn.js +2 -0
  178. package/dist/runtime-viewer/hlsl-WeeDt2Wp.js +2 -0
  179. package/dist/runtime-viewer/horizon-B8n8qcHx.js +84 -0
  180. package/dist/runtime-viewer/horizon-aRqT-seq.js +3 -0
  181. package/dist/runtime-viewer/horizon-bright-DACv8zK_.js +84 -0
  182. package/dist/runtime-viewer/horizon-bright-DEevCdc_.js +3 -0
  183. package/dist/runtime-viewer/houston-CsNpjGGD.js +194 -0
  184. package/dist/runtime-viewer/houston-Dg2jxmDJ.js +3 -0
  185. package/dist/runtime-viewer/html-CPjHaxbO.js +1 -0
  186. package/dist/runtime-viewer/html-Di2iyAsX.js +10 -0
  187. package/dist/runtime-viewer/html-derivative-Rauq0RVM.js +4 -0
  188. package/dist/runtime-viewer/http-CkmWBydm.js +13 -0
  189. package/dist/runtime-viewer/hurl-BGjXa70x.js +11 -0
  190. package/dist/runtime-viewer/hxml-Bo5YTIXF.js +4 -0
  191. package/dist/runtime-viewer/hy-C-tRiv34.js +2 -0
  192. package/dist/runtime-viewer/imba-v7ELlTL6.js +2 -0
  193. package/dist/runtime-viewer/ini-DtrnrQj2.js +2 -0
  194. package/dist/runtime-viewer/java-DVlvG-lL.js +1 -0
  195. package/dist/runtime-viewer/java-DzBtATHG.js +4 -0
  196. package/dist/runtime-viewer/javascript--K52AMOb.js +4 -0
  197. package/dist/runtime-viewer/javascript-soGjNmbd.js +1 -0
  198. package/dist/runtime-viewer/jinja-CZBKZHkS.js +4 -0
  199. package/dist/runtime-viewer/jison-Bqt-LhEh.js +4 -0
  200. package/dist/runtime-viewer/json-DN-CB1kQ.js +4 -0
  201. package/dist/runtime-viewer/json-D_yoNICS.js +1 -0
  202. package/dist/runtime-viewer/json5-BdfUTtLp.js +2 -0
  203. package/dist/runtime-viewer/jsonc-ElU8pfhL.js +1 -0
  204. package/dist/runtime-viewer/jsonc-IKox2JSV.js +2 -0
  205. package/dist/runtime-viewer/jsonl-CfuX4G6U.js +2 -0
  206. package/dist/runtime-viewer/jsonnet-Yq9KcR8E.js +2 -0
  207. package/dist/runtime-viewer/jssm-BvR7SnkK.js +2 -0
  208. package/dist/runtime-viewer/jsx-D_XQMdaK.js +4 -0
  209. package/dist/runtime-viewer/jsx-snoZUiUS.js +1 -0
  210. package/dist/runtime-viewer/julia-C8lwf2tT.js +15 -0
  211. package/dist/runtime-viewer/just-CQnb5pIW.js +17 -0
  212. package/dist/runtime-viewer/kanagawa-dragon-Cx4OB0dC.js +3 -0
  213. package/dist/runtime-viewer/kanagawa-dragon-OValCvAZ.js +146 -0
  214. package/dist/runtime-viewer/kanagawa-lotus-C1sYcneT.js +146 -0
  215. package/dist/runtime-viewer/kanagawa-lotus-TwFRI7_8.js +3 -0
  216. package/dist/runtime-viewer/kanagawa-wave-BJYCyv2X.js +146 -0
  217. package/dist/runtime-viewer/kanagawa-wave-BiOn36ux.js +3 -0
  218. package/dist/runtime-viewer/kdl-D97SquIS.js +2 -0
  219. package/dist/runtime-viewer/kotlin-EmJjLeRz.js +2 -0
  220. package/dist/runtime-viewer/kotlin-LwxBtHgj.js +1 -0
  221. package/dist/runtime-viewer/kusto-DHanPw0g.js +2 -0
  222. package/dist/runtime-viewer/langs-D4STZqO4.js +1322 -0
  223. package/dist/runtime-viewer/laserwave-CV_0dg5c.js +71 -0
  224. package/dist/runtime-viewer/laserwave-PpzazpgI.js +3 -0
  225. package/dist/runtime-viewer/latest-events-iiWwpIck-BTK0vSlR.js +3657 -0
  226. package/dist/runtime-viewer/latex-Csew0MLK.js +4 -0
  227. package/dist/runtime-viewer/lean-E61_xvh-.js +2 -0
  228. package/dist/runtime-viewer/less-Bis9Y9oi.js +2 -0
  229. package/dist/runtime-viewer/lib-B7rl8i0A.js +1712 -0
  230. package/dist/runtime-viewer/light-plus-DOInvhGO.js +133 -0
  231. package/dist/runtime-viewer/light-plus-DnhX_5eg.js +3 -0
  232. package/dist/runtime-viewer/liquid-CuxywBoN.js +13 -0
  233. package/dist/runtime-viewer/llvm-DOIFdCJg.js +2 -0
  234. package/dist/runtime-viewer/loader-NcDPTN_h.js +79 -0
  235. package/dist/runtime-viewer/log-Awf6LbyY.js +2 -0
  236. package/dist/runtime-viewer/logo-Cn9nW1nw.js +2 -0
  237. package/dist/runtime-viewer/lua-BtojQCeL.js +5 -0
  238. package/dist/runtime-viewer/luau-DHSqpUrS.js +2 -0
  239. package/dist/runtime-viewer/make-CJ4tc-MS.js +2 -0
  240. package/dist/runtime-viewer/markdown-CNVZ8ok-.js +2 -0
  241. package/dist/runtime-viewer/markdown-Co5Krewy.js +1 -0
  242. package/dist/runtime-viewer/marko-CRIKirQp.js +13 -0
  243. package/dist/runtime-viewer/material-theme-D5uz9rje.js +3 -0
  244. package/dist/runtime-viewer/material-theme-darker-DbzCDLF8.js +92 -0
  245. package/dist/runtime-viewer/material-theme-darker-Dqalv5VE.js +3 -0
  246. package/dist/runtime-viewer/material-theme-lighter-CVJ0oH_V.js +3 -0
  247. package/dist/runtime-viewer/material-theme-lighter-CytgYJOd.js +92 -0
  248. package/dist/runtime-viewer/material-theme-ocean-BgKy5sU3.js +92 -0
  249. package/dist/runtime-viewer/material-theme-ocean-CRXu0cdY.js +3 -0
  250. package/dist/runtime-viewer/material-theme-palenight-C6iiJcUB.js +3 -0
  251. package/dist/runtime-viewer/material-theme-palenight-DZK7nXDy.js +92 -0
  252. package/dist/runtime-viewer/material-theme-yF3uaT0h.js +92 -0
  253. package/dist/runtime-viewer/matlab-Dn3Clolk.js +2 -0
  254. package/dist/runtime-viewer/mdc-D0bRQBcT.js +11 -0
  255. package/dist/runtime-viewer/mdx-C5T-IRbL.js +2 -0
  256. package/dist/runtime-viewer/mdx-DM8tlqVf.js +1 -0
  257. package/dist/runtime-viewer/mermaid-C4AYlmk3.js +2 -0
  258. package/dist/runtime-viewer/min-dark-BGA1sv8W.js +3 -0
  259. package/dist/runtime-viewer/min-dark-C1XOhi4b.js +109 -0
  260. package/dist/runtime-viewer/min-light-Bi5vyNSJ.js +109 -0
  261. package/dist/runtime-viewer/min-light-CYXBjZLR.js +3 -0
  262. package/dist/runtime-viewer/mipsasm-Bwfx99oh.js +2 -0
  263. package/dist/runtime-viewer/mojo-CRl08dek.js +2 -0
  264. package/dist/runtime-viewer/monokai-D9Ylqri2.js +149 -0
  265. package/dist/runtime-viewer/monokai-i6D4lZa3.js +3 -0
  266. package/dist/runtime-viewer/moonbit-CF1zF40g.js +2 -0
  267. package/dist/runtime-viewer/move-BP-e5w2W.js +2 -0
  268. package/dist/runtime-viewer/narrat-CrPIhy6S.js +2 -0
  269. package/dist/runtime-viewer/nextflow-D_hnf_jC.js +4 -0
  270. package/dist/runtime-viewer/nextflow-groovy-BLKP0md9.js +2 -0
  271. package/dist/runtime-viewer/nginx-87WOq-zh.js +4 -0
  272. package/dist/runtime-viewer/night-owl-BIeenDB2.js +175 -0
  273. package/dist/runtime-viewer/night-owl-NpADjULE.js +3 -0
  274. package/dist/runtime-viewer/night-owl-light-CPFD_YWe.js +3 -0
  275. package/dist/runtime-viewer/night-owl-light-cj7zoq2Q.js +176 -0
  276. package/dist/runtime-viewer/nim-CDdExumk.js +19 -0
  277. package/dist/runtime-viewer/nix-D_5rVnnj.js +2 -0
  278. package/dist/runtime-viewer/nord-DtfXNtHW.js +3 -0
  279. package/dist/runtime-viewer/nord-LUKuJt-q.js +115 -0
  280. package/dist/runtime-viewer/nsis-R3iO3ArE.js +2 -0
  281. package/dist/runtime-viewer/nushell-Ctp5mfhf.js +2 -0
  282. package/dist/runtime-viewer/objective-c-DPJeQfV6.js +2 -0
  283. package/dist/runtime-viewer/objective-cpp-1I3jYeMe.js +2 -0
  284. package/dist/runtime-viewer/ocaml-DOrLjeoA.js +2 -0
  285. package/dist/runtime-viewer/odin-CyrMbkLb.js +2 -0
  286. package/dist/runtime-viewer/one-dark-pro-CoHxEOhG.js +3 -0
  287. package/dist/runtime-viewer/one-dark-pro-DJGEbENq.js +111 -0
  288. package/dist/runtime-viewer/one-light-CTMiOsB9.js +137 -0
  289. package/dist/runtime-viewer/one-light-DRcvOwa6.js +3 -0
  290. package/dist/runtime-viewer/openscad-BdifjW6z.js +2 -0
  291. package/dist/runtime-viewer/org-DqaIvCPP.js +99 -0
  292. package/dist/runtime-viewer/pascal-CWF557wL.js +2 -0
  293. package/dist/runtime-viewer/perl-CNf3SVpk.js +15 -0
  294. package/dist/runtime-viewer/php-BPw4EY34.js +17 -0
  295. package/dist/runtime-viewer/php-CftiA0NJ.js +1 -0
  296. package/dist/runtime-viewer/pierre-dark-Bdb1mzqq.js +153 -0
  297. package/dist/runtime-viewer/pierre-dark-C6-jOUHM.js +3 -0
  298. package/dist/runtime-viewer/pierre-dark-protanopia-deuteranopia-DCuPErCj.js +153 -0
  299. package/dist/runtime-viewer/pierre-dark-protanopia-deuteranopia-duePIMEV.js +3 -0
  300. package/dist/runtime-viewer/pierre-dark-soft-BAcQZBxz.js +3 -0
  301. package/dist/runtime-viewer/pierre-dark-soft-BbEG7yMD.js +153 -0
  302. package/dist/runtime-viewer/pierre-dark-tritanopia-DOpkeqXJ.js +153 -0
  303. package/dist/runtime-viewer/pierre-dark-tritanopia-D_B2XvmS.js +3 -0
  304. package/dist/runtime-viewer/pierre-dark-vibrant-Cjjp0Ett.js +3 -0
  305. package/dist/runtime-viewer/pierre-dark-vibrant-wch72KIm.js +153 -0
  306. package/dist/runtime-viewer/pierre-light-BOFVfKvu.js +153 -0
  307. package/dist/runtime-viewer/pierre-light-LcifP5tb.js +3 -0
  308. package/dist/runtime-viewer/pierre-light-protanopia-deuteranopia-BQUu7m7e.js +153 -0
  309. package/dist/runtime-viewer/pierre-light-protanopia-deuteranopia-BwLihlmJ.js +3 -0
  310. package/dist/runtime-viewer/pierre-light-soft-BOBDofkU.js +153 -0
  311. package/dist/runtime-viewer/pierre-light-soft-X5R_lHC5.js +3 -0
  312. package/dist/runtime-viewer/pierre-light-tritanopia-DHKQqobW.js +153 -0
  313. package/dist/runtime-viewer/pierre-light-tritanopia-_xB326N3.js +3 -0
  314. package/dist/runtime-viewer/pierre-light-vibrant-BQ8t4eUq.js +153 -0
  315. package/dist/runtime-viewer/pierre-light-vibrant-CpysSVqa.js +3 -0
  316. package/dist/runtime-viewer/pkl-D57k4LLs.js +2 -0
  317. package/dist/runtime-viewer/plastic-B9GSmjqY.js +3 -0
  318. package/dist/runtime-viewer/plastic-BVwrkRXf.js +124 -0
  319. package/dist/runtime-viewer/plsql-CFYD0AaB.js +2 -0
  320. package/dist/runtime-viewer/po-3OOmP4Qc.js +2 -0
  321. package/dist/runtime-viewer/poimandres-BOYLUaPj.js +3 -0
  322. package/dist/runtime-viewer/poimandres-pq5u2ANt.js +111 -0
  323. package/dist/runtime-viewer/polar-B5m1_AiD.js +2 -0
  324. package/dist/runtime-viewer/postcss-DaNMuZdy.js +2 -0
  325. package/dist/runtime-viewer/powerquery-Ds3ATR9s.js +2 -0
  326. package/dist/runtime-viewer/powershell-C6Oz4_dd.js +2 -0
  327. package/dist/runtime-viewer/prisma-RRr5YdGg.js +2 -0
  328. package/dist/runtime-viewer/prolog-DSStdQTq.js +2 -0
  329. package/dist/runtime-viewer/proto-Chh6Q5CM.js +2 -0
  330. package/dist/runtime-viewer/pug-jgpaAltF.js +11 -0
  331. package/dist/runtime-viewer/puppet-BLsUK3yq.js +2 -0
  332. package/dist/runtime-viewer/purescript-B02W4seQ.js +2 -0
  333. package/dist/runtime-viewer/python-BHaXfePs.js +2 -0
  334. package/dist/runtime-viewer/python-CqjzihlT.js +1 -0
  335. package/dist/runtime-viewer/qml-LuB2sppG.js +4 -0
  336. package/dist/runtime-viewer/qmldir-COlmh4fX.js +2 -0
  337. package/dist/runtime-viewer/qss-DQUGDdeL.js +2 -0
  338. package/dist/runtime-viewer/r-DLQ-WMyZ.js +4 -0
  339. package/dist/runtime-viewer/racket-Dh3q-EfD.js +2 -0
  340. package/dist/runtime-viewer/raku-CdFQrZmh.js +2 -0
  341. package/dist/runtime-viewer/razor-DyYB-qxm.js +9 -0
  342. package/dist/runtime-viewer/rbs-jMgpabM7.js +2 -0
  343. package/dist/runtime-viewer/red-CCCMngeG.js +3 -0
  344. package/dist/runtime-viewer/red-Dab29wid.js +153 -0
  345. package/dist/runtime-viewer/reg-BY6GKaZK.js +2 -0
  346. package/dist/runtime-viewer/regexp-DGXwIvno.js +4 -0
  347. package/dist/runtime-viewer/rel-DjgjjaPM.js +2 -0
  348. package/dist/runtime-viewer/riscv-e0swiQQT.js +2 -0
  349. package/dist/runtime-viewer/rolldown-runtime-CwxnZyOB.js +22 -0
  350. package/dist/runtime-viewer/ron-Ba9vjMyp.js +2 -0
  351. package/dist/runtime-viewer/rose-pine-B-dgSkpN.js +3 -0
  352. package/dist/runtime-viewer/rose-pine-BtbnV2yy.js +123 -0
  353. package/dist/runtime-viewer/rose-pine-dawn-Bdn8gWo3.js +123 -0
  354. package/dist/runtime-viewer/rose-pine-dawn-wnKgbnkN.js +3 -0
  355. package/dist/runtime-viewer/rose-pine-moon-Bo6Tj-LK.js +3 -0
  356. package/dist/runtime-viewer/rose-pine-moon-f0wTyd2e.js +123 -0
  357. package/dist/runtime-viewer/rosmsg-33FkgZa7.js +2 -0
  358. package/dist/runtime-viewer/rst-B4Blahjm.js +21 -0
  359. package/dist/runtime-viewer/ruby-DYURXRgy.js +1 -0
  360. package/dist/runtime-viewer/ruby-ZzNzsyR7.js +29 -0
  361. package/dist/runtime-viewer/rust-CbGaYpW0.js +2 -0
  362. package/dist/runtime-viewer/rust-DesRWqWI.js +1 -0
  363. package/dist/runtime-viewer/sandbox-ui-z5RGk327.css +2 -0
  364. package/dist/runtime-viewer/sas-y9RoKb_L.js +4 -0
  365. package/dist/runtime-viewer/sass-B4OMkGSD.js +2 -0
  366. package/dist/runtime-viewer/scala--rETK160.js +2 -0
  367. package/dist/runtime-viewer/scheme-CvovbBgk.js +2 -0
  368. package/dist/runtime-viewer/scss-DcI9-N4n.js +1 -0
  369. package/dist/runtime-viewer/scss-DopO6P6Z.js +5 -0
  370. package/dist/runtime-viewer/sdbl-BibMD0HR.js +2 -0
  371. package/dist/runtime-viewer/shaderlab-TCf2V7Bu.js +4 -0
  372. package/dist/runtime-viewer/shellscript-CMmvhdtO.js +4 -0
  373. package/dist/runtime-viewer/shellsession-C-hBmRFA.js +4 -0
  374. package/dist/runtime-viewer/shiki-CKiqbkeh.js +472 -0
  375. package/dist/runtime-viewer/slack-dark-Cdsw60PX.js +71 -0
  376. package/dist/runtime-viewer/slack-dark-awEjS_Yb.js +3 -0
  377. package/dist/runtime-viewer/slack-ochin-BKdp7_AN.js +94 -0
  378. package/dist/runtime-viewer/slack-ochin-CabfdAmS.js +3 -0
  379. package/dist/runtime-viewer/smalltalk-DxjZ-YtB.js +2 -0
  380. package/dist/runtime-viewer/smithy-tPvbDXO4.js +2 -0
  381. package/dist/runtime-viewer/snazzy-light-BYOmyMID.js +80 -0
  382. package/dist/runtime-viewer/snazzy-light-DqG5DUoz.js +3 -0
  383. package/dist/runtime-viewer/solarized-dark-DW7IHQvx.js +3 -0
  384. package/dist/runtime-viewer/solarized-dark-DbW2e0tz.js +147 -0
  385. package/dist/runtime-viewer/solarized-light-CAggmb5U.js +147 -0
  386. package/dist/runtime-viewer/solarized-light-DHtUsXC-.js +3 -0
  387. package/dist/runtime-viewer/solidity-CzRNc7l4.js +2 -0
  388. package/dist/runtime-viewer/solidity-DcnQs1tt.js +1 -0
  389. package/dist/runtime-viewer/soy-Di0gqQmR.js +4 -0
  390. package/dist/runtime-viewer/sparql-9pWczk0C.js +4 -0
  391. package/dist/runtime-viewer/splunk-mpquMt_8.js +2 -0
  392. package/dist/runtime-viewer/sql-BKQgqUK-.js +4 -0
  393. package/dist/runtime-viewer/sql-CWnPlVS6.js +1 -0
  394. package/dist/runtime-viewer/ssh-config-DcnVpK-n.js +2 -0
  395. package/dist/runtime-viewer/stata-D1hxcba5.js +4 -0
  396. package/dist/runtime-viewer/stream-tokenizer-BWCJrHj9.js +97 -0
  397. package/dist/runtime-viewer/stylus-Bk8v-7oM.js +2 -0
  398. package/dist/runtime-viewer/surrealql-D20GSlYu.js +4 -0
  399. package/dist/runtime-viewer/svelte-C1MdtiIu.js +13 -0
  400. package/dist/runtime-viewer/swift-1fpvFsbf.js +2 -0
  401. package/dist/runtime-viewer/swift-DdLix5IB.js +1 -0
  402. package/dist/runtime-viewer/synthwave-84-DEoLt5E0.js +3 -0
  403. package/dist/runtime-viewer/synthwave-84-DYyyPr4g.js +397 -0
  404. package/dist/runtime-viewer/system-verilog-9E6eQ6kG.js +2 -0
  405. package/dist/runtime-viewer/systemd-CS6cln6J.js +2 -0
  406. package/dist/runtime-viewer/talonscript-COzgILOx.js +2 -0
  407. package/dist/runtime-viewer/tasl-CrL-TM3j.js +2 -0
  408. package/dist/runtime-viewer/tcl-BK--alTs.js +2 -0
  409. package/dist/runtime-viewer/templ-DKjVFvC3.js +11 -0
  410. package/dist/runtime-viewer/terraform-BKVT4lTN.js +2 -0
  411. package/dist/runtime-viewer/tex-BMGJ-FHF.js +5 -0
  412. package/dist/runtime-viewer/themes-D2drbHm6.js +235 -0
  413. package/dist/runtime-viewer/tokyo-night-BDW-4G1n.js +3 -0
  414. package/dist/runtime-viewer/tokyo-night-CnwkSle4.js +140 -0
  415. package/dist/runtime-viewer/toml-BygInOIB.js +1 -0
  416. package/dist/runtime-viewer/toml-CXAVGmfI.js +2 -0
  417. package/dist/runtime-viewer/ts-tags-BMg-6tE-.js +37 -0
  418. package/dist/runtime-viewer/tsv-r5fpGho9.js +2 -0
  419. package/dist/runtime-viewer/tsx-CdftCu0x.js +1 -0
  420. package/dist/runtime-viewer/tsx-sVSKAISV.js +4 -0
  421. package/dist/runtime-viewer/turtle-BbiQBLu0.js +2 -0
  422. package/dist/runtime-viewer/twig-09z_6B11.js +17 -0
  423. package/dist/runtime-viewer/typescript-COKJUNHB.js +4 -0
  424. package/dist/runtime-viewer/typescript-DCN8T-9u.js +1 -0
  425. package/dist/runtime-viewer/typespec-CtiCKN_c.js +2 -0
  426. package/dist/runtime-viewer/typst-D_sC_VAT.js +119 -0
  427. package/dist/runtime-viewer/unwrapDefault-CNWG9hDr.js +5 -0
  428. package/dist/runtime-viewer/v-BdhLiTpS.js +2 -0
  429. package/dist/runtime-viewer/vala-sKTZx7aP.js +2 -0
  430. package/dist/runtime-viewer/vb-BAyoHiqq.js +2 -0
  431. package/dist/runtime-viewer/verilog-DrDp-nNs.js +2 -0
  432. package/dist/runtime-viewer/vesper-BOAJeYxj.js +3 -0
  433. package/dist/runtime-viewer/vesper-DMgHxe32.js +83 -0
  434. package/dist/runtime-viewer/vhdl-D4xoRBgL.js +2 -0
  435. package/dist/runtime-viewer/viml-C41wSeLL.js +2 -0
  436. package/dist/runtime-viewer/vitesse-black-CxSugKJt.js +3 -0
  437. package/dist/runtime-viewer/vitesse-black-D8_Gc8uG.js +183 -0
  438. package/dist/runtime-viewer/vitesse-dark-Dg-H5YXt.js +183 -0
  439. package/dist/runtime-viewer/vitesse-dark-DvdlNt-O.js +3 -0
  440. package/dist/runtime-viewer/vitesse-light-BU-cJySG.js +183 -0
  441. package/dist/runtime-viewer/vitesse-light-q0_0oW1f.js +3 -0
  442. package/dist/runtime-viewer/vue-BbJX7dLK.js +20 -0
  443. package/dist/runtime-viewer/vue-html-DvOnaPby.js +4 -0
  444. package/dist/runtime-viewer/vue-vine-NYLtCzNK.js +17 -0
  445. package/dist/runtime-viewer/vyper-D4A1KnBn.js +2 -0
  446. package/dist/runtime-viewer/wasm-CVPYyV9Y.js +2 -0
  447. package/dist/runtime-viewer/wasm-DrbRUT8q.js +3 -0
  448. package/dist/runtime-viewer/wenyan-Czq8OMMr.js +2 -0
  449. package/dist/runtime-viewer/wgsl-C_l-ZpBu.js +2 -0
  450. package/dist/runtime-viewer/wikitext-B7epQZx2.js +2 -0
  451. package/dist/runtime-viewer/wit-DswQpcNx.js +2 -0
  452. package/dist/runtime-viewer/wolfram-CSEjVwta.js +2 -0
  453. package/dist/runtime-viewer/xml-CBKvpQFb.js +1 -0
  454. package/dist/runtime-viewer/xml-Ct7jrUZw.js +5 -0
  455. package/dist/runtime-viewer/xsl-DovPFRzJ.js +4 -0
  456. package/dist/runtime-viewer/yaml-BfN4AWuy.js +4 -0
  457. package/dist/runtime-viewer/yaml-DWRq8wls.js +1 -0
  458. package/dist/runtime-viewer/zenscript-YvYHF5y3.js +2 -0
  459. package/dist/runtime-viewer/zig-BgXWauKx.js +2 -0
  460. package/dist/styles.css +192 -150
  461. package/dist/tailwind.css +156 -150
  462. package/dist/{run-C8HeXGk3.js → trace-workspace-C8dHRBDV.js} +2 -3
  463. package/dist/use-document-D6Z9oFLm.js +120 -0
  464. package/dist/{workbench-BozOdGCX.js → workbench-Z9wbei53.js} +4 -172
  465. package/dist/workbench.js +2 -1
  466. package/dist/{workspace-CJnBqCqj.js → workspace-CzikYt_y.js} +5 -364
  467. package/dist/workspace-files-pane-DB9Nvwh4.js +367 -0
  468. package/dist/workspace-viewer.js +44403 -0
  469. package/dist/workspace.js +2 -1
  470. package/package.json +9 -4
@@ -0,0 +1,3279 @@
1
+ import { t as e } from "./lib-B7rl8i0A.js";
2
+ // node_modules/.pnpm/@shikijs+vscode-textmate@10.1.0/node_modules/@shikijs/vscode-textmate/dist/index.js
3
+ function t(e) {
4
+ return n(e);
5
+ }
6
+ function n(e) {
7
+ return Array.isArray(e) ? r(e) : e instanceof RegExp ? e : typeof e == "object" ? i(e) : e;
8
+ }
9
+ function r(e) {
10
+ let t = [];
11
+ for (let r = 0, i = e.length; r < i; r++) t[r] = n(e[r]);
12
+ return t;
13
+ }
14
+ function i(e) {
15
+ let t = {};
16
+ for (let r in e) t[r] = n(e[r]);
17
+ return t;
18
+ }
19
+ function a(e, ...t) {
20
+ return t.forEach((t) => {
21
+ for (let n in t) e[n] = t[n];
22
+ }), e;
23
+ }
24
+ function o(e) {
25
+ let t = ~e.lastIndexOf("/") || ~e.lastIndexOf("\\");
26
+ return t === 0 ? e : ~t === e.length - 1 ? o(e.substring(0, e.length - 1)) : e.substr(~t + 1);
27
+ }
28
+ var s = /\$(\d+)|\${(\d+):\/(downcase|upcase)}/g, c = class {
29
+ static hasCaptures(e) {
30
+ return e !== null && (s.lastIndex = 0, s.test(e));
31
+ }
32
+ static replaceCaptures(e, t, n) {
33
+ return e.replace(s, (e, r, i, a) => {
34
+ let o = n[parseInt(r || i, 10)];
35
+ if (o) {
36
+ let e = t.substring(o.start, o.end);
37
+ for (; e[0] === ".";) e = e.substring(1);
38
+ switch (a) {
39
+ case "downcase": return e.toLowerCase();
40
+ case "upcase": return e.toUpperCase();
41
+ default: return e;
42
+ }
43
+ } else return e;
44
+ });
45
+ }
46
+ };
47
+ function l(e, t) {
48
+ return e < t ? -1 : +(e > t);
49
+ }
50
+ function u(e, t) {
51
+ if (e === null && t === null) return 0;
52
+ if (!e) return -1;
53
+ if (!t) return 1;
54
+ let n = e.length, r = t.length;
55
+ if (n === r) {
56
+ for (let r = 0; r < n; r++) {
57
+ let n = l(e[r], t[r]);
58
+ if (n !== 0) return n;
59
+ }
60
+ return 0;
61
+ }
62
+ return n - r;
63
+ }
64
+ function d(e) {
65
+ return !!(/^#[0-9a-f]{6}$/i.test(e) || /^#[0-9a-f]{8}$/i.test(e) || /^#[0-9a-f]{3}$/i.test(e) || /^#[0-9a-f]{4}$/i.test(e));
66
+ }
67
+ function f(e) {
68
+ return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g, "\\$&");
69
+ }
70
+ var p = class {
71
+ constructor(e) {
72
+ this.fn = e;
73
+ }
74
+ fn;
75
+ cache = /* @__PURE__ */ new Map();
76
+ get(e) {
77
+ if (this.cache.has(e)) return this.cache.get(e);
78
+ let t = this.fn(e);
79
+ return this.cache.set(e, t), t;
80
+ }
81
+ }, m = class {
82
+ constructor(e, t, n) {
83
+ this._colorMap = e, this._defaults = t, this._root = n;
84
+ }
85
+ _colorMap;
86
+ _defaults;
87
+ _root;
88
+ static createFromRawTheme(e, t) {
89
+ return this.createFromParsedTheme(ee(e), t);
90
+ }
91
+ static createFromParsedTheme(e, t) {
92
+ return ne(e, t);
93
+ }
94
+ _cachedMatchRoot = new p((e) => this._root.match(e));
95
+ getColorMap() {
96
+ return this._colorMap.getColorMap();
97
+ }
98
+ getDefaults() {
99
+ return this._defaults;
100
+ }
101
+ match(e) {
102
+ if (e === null) return this._defaults;
103
+ let t = e.scopeName, n = this._cachedMatchRoot.get(t).find((t) => g(e.parent, t.parentScopes));
104
+ return n ? new v(n.fontStyle, n.foreground, n.background) : null;
105
+ }
106
+ }, h = class e {
107
+ constructor(e, t) {
108
+ this.parent = e, this.scopeName = t;
109
+ }
110
+ parent;
111
+ scopeName;
112
+ static push(t, n) {
113
+ for (let r of n) t = new e(t, r);
114
+ return t;
115
+ }
116
+ static from(...t) {
117
+ let n = null;
118
+ for (let r = 0; r < t.length; r++) n = new e(n, t[r]);
119
+ return n;
120
+ }
121
+ push(t) {
122
+ return new e(this, t);
123
+ }
124
+ getSegments() {
125
+ let e = this, t = [];
126
+ for (; e;) t.push(e.scopeName), e = e.parent;
127
+ return t.reverse(), t;
128
+ }
129
+ toString() {
130
+ return this.getSegments().join(" ");
131
+ }
132
+ extends(e) {
133
+ return this === e || this.parent !== null && this.parent.extends(e);
134
+ }
135
+ getExtensionIfDefined(e) {
136
+ let t = [], n = this;
137
+ for (; n && n !== e;) t.push(n.scopeName), n = n.parent;
138
+ return n === e ? t.reverse() : void 0;
139
+ }
140
+ };
141
+ function g(e, t) {
142
+ if (t.length === 0) return !0;
143
+ for (let n = 0; n < t.length; n++) {
144
+ let r = t[n], i = !1;
145
+ if (r === ">") {
146
+ if (n === t.length - 1) return !1;
147
+ r = t[++n], i = !0;
148
+ }
149
+ for (; e && !_(e.scopeName, r);) {
150
+ if (i) return !1;
151
+ e = e.parent;
152
+ }
153
+ if (!e) return !1;
154
+ e = e.parent;
155
+ }
156
+ return !0;
157
+ }
158
+ function _(e, t) {
159
+ return t === e || e.startsWith(t) && e[t.length] === ".";
160
+ }
161
+ var v = class {
162
+ constructor(e, t, n) {
163
+ this.fontStyle = e, this.foregroundId = t, this.backgroundId = n;
164
+ }
165
+ fontStyle;
166
+ foregroundId;
167
+ backgroundId;
168
+ };
169
+ function ee(e) {
170
+ if (!e || !e.settings || !Array.isArray(e.settings)) return [];
171
+ let t = e.settings, n = [], r = 0;
172
+ for (let e = 0, i = t.length; e < i; e++) {
173
+ let i = t[e];
174
+ if (!i.settings) continue;
175
+ let a;
176
+ if (typeof i.scope == "string") {
177
+ let e = i.scope;
178
+ e = e.replace(/^[,]+/, ""), e = e.replace(/[,]+$/, ""), a = e.split(",");
179
+ } else a = Array.isArray(i.scope) ? i.scope : [""];
180
+ let o = -1;
181
+ if (typeof i.settings.fontStyle == "string") {
182
+ o = 0;
183
+ let e = i.settings.fontStyle.split(" ");
184
+ for (let t = 0, n = e.length; t < n; t++) switch (e[t]) {
185
+ case "italic":
186
+ o |= 1;
187
+ break;
188
+ case "bold":
189
+ o |= 2;
190
+ break;
191
+ case "underline":
192
+ o |= 4;
193
+ break;
194
+ case "strikethrough": o |= 8;
195
+ }
196
+ }
197
+ let s = null;
198
+ typeof i.settings.foreground == "string" && d(i.settings.foreground) && (s = i.settings.foreground);
199
+ let c = null;
200
+ typeof i.settings.background == "string" && d(i.settings.background) && (c = i.settings.background);
201
+ for (let t = 0, i = a.length; t < i; t++) {
202
+ let i = a[t].trim().split(" "), l = i[i.length - 1], u = null;
203
+ i.length > 1 && (u = i.slice(0, i.length - 1), u.reverse()), n[r++] = new te(l, u, e, o, s, c);
204
+ }
205
+ }
206
+ return n;
207
+ }
208
+ var te = class {
209
+ constructor(e, t, n, r, i, a) {
210
+ this.scope = e, this.parentScopes = t, this.index = n, this.fontStyle = r, this.foreground = i, this.background = a;
211
+ }
212
+ scope;
213
+ parentScopes;
214
+ index;
215
+ fontStyle;
216
+ foreground;
217
+ background;
218
+ }, y = /* @__PURE__ */ ((e) => (e[e.NotSet = -1] = "NotSet", e[e.None = 0] = "None", e[e.Italic = 1] = "Italic", e[e.Bold = 2] = "Bold", e[e.Underline = 4] = "Underline", e[e.Strikethrough = 8] = "Strikethrough", e))(y || {});
219
+ function ne(e, t) {
220
+ e.sort((e, t) => {
221
+ let n = l(e.scope, t.scope);
222
+ return n !== 0 || (n = u(e.parentScopes, t.parentScopes), n !== 0) ? n : e.index - t.index;
223
+ });
224
+ let n = 0, r = "#000000", i = "#ffffff";
225
+ for (; e.length >= 1 && e[0].scope === "";) {
226
+ let t = e.shift();
227
+ t.fontStyle !== -1 && (n = t.fontStyle), t.foreground !== null && (r = t.foreground), t.background !== null && (i = t.background);
228
+ }
229
+ let a = new re(t), o = new v(n, a.getId(r), a.getId(i)), s = new ae(new b(0, null, -1, 0, 0), []);
230
+ for (let t = 0, n = e.length; t < n; t++) {
231
+ let n = e[t];
232
+ s.insert(0, n.scope, n.parentScopes, n.fontStyle, a.getId(n.foreground), a.getId(n.background));
233
+ }
234
+ return new m(a, o, s);
235
+ }
236
+ var re = class {
237
+ _isFrozen;
238
+ _lastColorId;
239
+ _id2color;
240
+ _color2id;
241
+ constructor(e) {
242
+ if (this._lastColorId = 0, this._id2color = [], this._color2id = /* @__PURE__ */ Object.create(null), Array.isArray(e)) {
243
+ this._isFrozen = !0;
244
+ for (let t = 0, n = e.length; t < n; t++) this._color2id[e[t]] = t, this._id2color[t] = e[t];
245
+ } else this._isFrozen = !1;
246
+ }
247
+ getId(e) {
248
+ if (e === null) return 0;
249
+ e = e.toUpperCase();
250
+ let t = this._color2id[e];
251
+ if (t) return t;
252
+ if (this._isFrozen) throw Error(`Missing color in color map - ${e}`);
253
+ return t = ++this._lastColorId, this._color2id[e] = t, this._id2color[t] = e, t;
254
+ }
255
+ getColorMap() {
256
+ return this._id2color.slice(0);
257
+ }
258
+ }, ie = Object.freeze([]), b = class e {
259
+ scopeDepth;
260
+ parentScopes;
261
+ fontStyle;
262
+ foreground;
263
+ background;
264
+ constructor(e, t, n, r, i) {
265
+ this.scopeDepth = e, this.parentScopes = t || ie, this.fontStyle = n, this.foreground = r, this.background = i;
266
+ }
267
+ clone() {
268
+ return new e(this.scopeDepth, this.parentScopes, this.fontStyle, this.foreground, this.background);
269
+ }
270
+ static cloneArr(e) {
271
+ let t = [];
272
+ for (let n = 0, r = e.length; n < r; n++) t[n] = e[n].clone();
273
+ return t;
274
+ }
275
+ acceptOverwrite(e, t, n, r) {
276
+ this.scopeDepth > e ? console.log("how did this happen?") : this.scopeDepth = e, t !== -1 && (this.fontStyle = t), n !== 0 && (this.foreground = n), r !== 0 && (this.background = r);
277
+ }
278
+ }, ae = class e {
279
+ constructor(e, t = [], n = {}) {
280
+ this._mainRule = e, this._children = n, this._rulesWithParentScopes = t;
281
+ }
282
+ _mainRule;
283
+ _children;
284
+ _rulesWithParentScopes;
285
+ static _cmpBySpecificity(e, t) {
286
+ if (e.scopeDepth !== t.scopeDepth) return t.scopeDepth - e.scopeDepth;
287
+ let n = 0, r = 0;
288
+ for (; e.parentScopes[n] === ">" && n++, t.parentScopes[r] === ">" && r++, !(n >= e.parentScopes.length || r >= t.parentScopes.length);) {
289
+ let i = t.parentScopes[r].length - e.parentScopes[n].length;
290
+ if (i !== 0) return i;
291
+ n++, r++;
292
+ }
293
+ return t.parentScopes.length - e.parentScopes.length;
294
+ }
295
+ match(t) {
296
+ if (t !== "") {
297
+ let e = t.indexOf("."), n, r;
298
+ if (e === -1 ? (n = t, r = "") : (n = t.substring(0, e), r = t.substring(e + 1)), this._children.hasOwnProperty(n)) return this._children[n].match(r);
299
+ }
300
+ let n = this._rulesWithParentScopes.concat(this._mainRule);
301
+ return n.sort(e._cmpBySpecificity), n;
302
+ }
303
+ insert(t, n, r, i, a, o) {
304
+ if (n === "") {
305
+ this._doInsertHere(t, r, i, a, o);
306
+ return;
307
+ }
308
+ let s = n.indexOf("."), c, l;
309
+ s === -1 ? (c = n, l = "") : (c = n.substring(0, s), l = n.substring(s + 1));
310
+ let u;
311
+ this._children.hasOwnProperty(c) ? u = this._children[c] : (u = new e(this._mainRule.clone(), b.cloneArr(this._rulesWithParentScopes)), this._children[c] = u), u.insert(t + 1, l, r, i, a, o);
312
+ }
313
+ _doInsertHere(e, t, n, r, i) {
314
+ if (t === null) this._mainRule.acceptOverwrite(e, n, r, i);
315
+ else {
316
+ for (let a = 0, o = this._rulesWithParentScopes.length; a < o; a++) {
317
+ let o = this._rulesWithParentScopes[a];
318
+ if (u(o.parentScopes, t) === 0) {
319
+ o.acceptOverwrite(e, n, r, i);
320
+ return;
321
+ }
322
+ }
323
+ n === -1 && (n = this._mainRule.fontStyle), r === 0 && (r = this._mainRule.foreground), i === 0 && (i = this._mainRule.background), this._rulesWithParentScopes.push(new b(e, t, n, r, i));
324
+ }
325
+ }
326
+ }, x = class e {
327
+ static toBinaryStr(e) {
328
+ return e.toString(2).padStart(32, "0");
329
+ }
330
+ static print(t) {
331
+ let n = e.getLanguageId(t), r = e.getTokenType(t), i = e.getFontStyle(t), a = e.getForeground(t), o = e.getBackground(t);
332
+ console.log({
333
+ languageId: n,
334
+ tokenType: r,
335
+ fontStyle: i,
336
+ foreground: a,
337
+ background: o
338
+ });
339
+ }
340
+ static getLanguageId(e) {
341
+ return (e & 255) >>> 0;
342
+ }
343
+ static getTokenType(e) {
344
+ return (e & 768) >>> 8;
345
+ }
346
+ static containsBalancedBrackets(e) {
347
+ return !!(e & 1024);
348
+ }
349
+ static getFontStyle(e) {
350
+ return (e & 30720) >>> 11;
351
+ }
352
+ static getForeground(e) {
353
+ return (e & 16744448) >>> 15;
354
+ }
355
+ static getBackground(e) {
356
+ return (e & 4278190080) >>> 24;
357
+ }
358
+ static set(t, n, r, i, a, o, s) {
359
+ let c = e.getLanguageId(t), l = e.getTokenType(t), u = +!!e.containsBalancedBrackets(t), d = e.getFontStyle(t), f = e.getForeground(t), p = e.getBackground(t);
360
+ return n !== 0 && (c = n), r !== 8 && (l = se(r)), i !== null && (u = +!!i), a !== -1 && (d = a), o !== 0 && (f = o), s !== 0 && (p = s), (c | 0 | l << 8 | u << 10 | d << 11 | f << 15 | p << 24) >>> 0;
361
+ }
362
+ };
363
+ function oe(e) {
364
+ return e;
365
+ }
366
+ function se(e) {
367
+ return e;
368
+ }
369
+ function S(e, t) {
370
+ let n = [], r = le(e), i = r.next();
371
+ for (; i !== null;) {
372
+ let e = 0;
373
+ if (i.length === 2 && i.charAt(1) === ":") {
374
+ switch (i.charAt(0)) {
375
+ case "R":
376
+ e = 1;
377
+ break;
378
+ case "L":
379
+ e = -1;
380
+ break;
381
+ default: console.log(`Unknown priority ${i} in scope selector`);
382
+ }
383
+ i = r.next();
384
+ }
385
+ let t = o();
386
+ if (n.push({
387
+ matcher: t,
388
+ priority: e
389
+ }), i !== ",") break;
390
+ i = r.next();
391
+ }
392
+ return n;
393
+ function a() {
394
+ if (i === "-") {
395
+ i = r.next();
396
+ let e = a();
397
+ return (t) => !!e && !e(t);
398
+ }
399
+ if (i === "(") {
400
+ i = r.next();
401
+ let e = s();
402
+ return i === ")" && (i = r.next()), e;
403
+ }
404
+ if (ce(i)) {
405
+ let e = [];
406
+ do
407
+ e.push(i), i = r.next();
408
+ while (ce(i));
409
+ return (n) => t(e, n);
410
+ }
411
+ return null;
412
+ }
413
+ function o() {
414
+ let e = [], t = a();
415
+ for (; t;) e.push(t), t = a();
416
+ return (t) => e.every((e) => e(t));
417
+ }
418
+ function s() {
419
+ let e = [], t = o();
420
+ for (; t && (e.push(t), i === "|" || i === ",");) {
421
+ do
422
+ i = r.next();
423
+ while (i === "|" || i === ",");
424
+ t = o();
425
+ }
426
+ return (t) => e.some((e) => e(t));
427
+ }
428
+ }
429
+ function ce(e) {
430
+ return !!e && !!e.match(/[\w\.:]+/);
431
+ }
432
+ function le(e) {
433
+ let t = /([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g, n = t.exec(e);
434
+ return { next: () => {
435
+ if (!n) return null;
436
+ let r = n[0];
437
+ return n = t.exec(e), r;
438
+ } };
439
+ }
440
+ function ue(e) {
441
+ typeof e.dispose == "function" && e.dispose();
442
+ }
443
+ var C = class {
444
+ constructor(e) {
445
+ this.scopeName = e;
446
+ }
447
+ scopeName;
448
+ toKey() {
449
+ return this.scopeName;
450
+ }
451
+ }, de = class {
452
+ constructor(e, t) {
453
+ this.scopeName = e, this.ruleName = t;
454
+ }
455
+ scopeName;
456
+ ruleName;
457
+ toKey() {
458
+ return `${this.scopeName}#${this.ruleName}`;
459
+ }
460
+ }, fe = class {
461
+ _references = [];
462
+ _seenReferenceKeys = /* @__PURE__ */ new Set();
463
+ get references() {
464
+ return this._references;
465
+ }
466
+ visitedRule = /* @__PURE__ */ new Set();
467
+ add(e) {
468
+ let t = e.toKey();
469
+ this._seenReferenceKeys.has(t) || (this._seenReferenceKeys.add(t), this._references.push(e));
470
+ }
471
+ }, pe = class {
472
+ constructor(e, t) {
473
+ this.repo = e, this.initialScopeName = t, this.seenFullScopeRequests.add(this.initialScopeName), this.Q = [new C(this.initialScopeName)];
474
+ }
475
+ repo;
476
+ initialScopeName;
477
+ seenFullScopeRequests = /* @__PURE__ */ new Set();
478
+ seenPartialScopeRequests = /* @__PURE__ */ new Set();
479
+ Q;
480
+ processQueue() {
481
+ let e = this.Q;
482
+ this.Q = [];
483
+ let t = new fe();
484
+ for (let n of e) me(n, this.initialScopeName, this.repo, t);
485
+ for (let e of t.references) if (e instanceof C) {
486
+ if (this.seenFullScopeRequests.has(e.scopeName)) continue;
487
+ this.seenFullScopeRequests.add(e.scopeName), this.Q.push(e);
488
+ } else {
489
+ if (this.seenFullScopeRequests.has(e.scopeName) || this.seenPartialScopeRequests.has(e.toKey())) continue;
490
+ this.seenPartialScopeRequests.add(e.toKey()), this.Q.push(e);
491
+ }
492
+ }
493
+ };
494
+ function me(e, t, n, r) {
495
+ let i = n.lookup(e.scopeName);
496
+ if (!i) {
497
+ if (e.scopeName === t) throw Error(`No grammar provided for <${t}>`);
498
+ return;
499
+ }
500
+ let a = n.lookup(t);
501
+ e instanceof C ? w({
502
+ baseGrammar: a,
503
+ selfGrammar: i
504
+ }, r) : he(e.ruleName, {
505
+ baseGrammar: a,
506
+ selfGrammar: i,
507
+ repository: i.repository
508
+ }, r);
509
+ let o = n.injections(e.scopeName);
510
+ if (o) for (let e of o) r.add(new C(e));
511
+ }
512
+ function he(e, t, n) {
513
+ if (t.repository && t.repository[e]) {
514
+ let r = t.repository[e];
515
+ T([r], t, n);
516
+ }
517
+ }
518
+ function w(e, t) {
519
+ e.selfGrammar.patterns && Array.isArray(e.selfGrammar.patterns) && T(e.selfGrammar.patterns, {
520
+ ...e,
521
+ repository: e.selfGrammar.repository
522
+ }, t), e.selfGrammar.injections && T(Object.values(e.selfGrammar.injections), {
523
+ ...e,
524
+ repository: e.selfGrammar.repository
525
+ }, t);
526
+ }
527
+ function T(e, t, n) {
528
+ for (let r of e) {
529
+ if (n.visitedRule.has(r)) continue;
530
+ n.visitedRule.add(r);
531
+ let e = r.repository ? a({}, t.repository, r.repository) : t.repository;
532
+ Array.isArray(r.patterns) && T(r.patterns, {
533
+ ...t,
534
+ repository: e
535
+ }, n);
536
+ let i = r.include;
537
+ if (!i) continue;
538
+ let o = xe(i);
539
+ switch (o.kind) {
540
+ case 0:
541
+ w({
542
+ ...t,
543
+ selfGrammar: t.baseGrammar
544
+ }, n);
545
+ break;
546
+ case 1:
547
+ w(t, n);
548
+ break;
549
+ case 2:
550
+ he(o.ruleName, {
551
+ ...t,
552
+ repository: e
553
+ }, n);
554
+ break;
555
+ case 3:
556
+ case 4:
557
+ let r = o.scopeName === t.selfGrammar.scopeName ? t.selfGrammar : o.scopeName === t.baseGrammar.scopeName ? t.baseGrammar : void 0;
558
+ if (r) {
559
+ let i = {
560
+ baseGrammar: t.baseGrammar,
561
+ selfGrammar: r,
562
+ repository: e
563
+ };
564
+ o.kind === 4 ? he(o.ruleName, i, n) : w(i, n);
565
+ } else o.kind === 4 ? n.add(new de(o.scopeName, o.ruleName)) : n.add(new C(o.scopeName));
566
+ }
567
+ }
568
+ }
569
+ var ge = class {
570
+ kind = 0;
571
+ }, _e = class {
572
+ kind = 1;
573
+ }, ve = class {
574
+ constructor(e) {
575
+ this.ruleName = e;
576
+ }
577
+ ruleName;
578
+ kind = 2;
579
+ }, ye = class {
580
+ constructor(e) {
581
+ this.scopeName = e;
582
+ }
583
+ scopeName;
584
+ kind = 3;
585
+ }, be = class {
586
+ constructor(e, t) {
587
+ this.scopeName = e, this.ruleName = t;
588
+ }
589
+ scopeName;
590
+ ruleName;
591
+ kind = 4;
592
+ };
593
+ function xe(e) {
594
+ if (e === "$base") return new ge();
595
+ if (e === "$self") return new _e();
596
+ let t = e.indexOf("#");
597
+ return t === -1 ? new ye(e) : t === 0 ? new ve(e.substring(1)) : new be(e.substring(0, t), e.substring(t + 1));
598
+ }
599
+ var Se = /\\(\d+)/, Ce = /\\(\d+)/g, we = -1, Te = -2;
600
+ function Ee(e) {
601
+ return e;
602
+ }
603
+ function De(e) {
604
+ return e;
605
+ }
606
+ var E = class {
607
+ $location;
608
+ id;
609
+ _nameIsCapturing;
610
+ _name;
611
+ _contentNameIsCapturing;
612
+ _contentName;
613
+ constructor(e, t, n, r) {
614
+ this.$location = e, this.id = t, this._name = n || null, this._nameIsCapturing = c.hasCaptures(this._name), this._contentName = r || null, this._contentNameIsCapturing = c.hasCaptures(this._contentName);
615
+ }
616
+ get debugName() {
617
+ let e = this.$location ? `${o(this.$location.filename)}:${this.$location.line}` : "unknown";
618
+ return `${this.constructor.name}#${this.id} @ ${e}`;
619
+ }
620
+ getName(e, t) {
621
+ return !this._nameIsCapturing || this._name === null || e === null || t === null ? this._name : c.replaceCaptures(this._name, e, t);
622
+ }
623
+ getContentName(e, t) {
624
+ return !this._contentNameIsCapturing || this._contentName === null ? this._contentName : c.replaceCaptures(this._contentName, e, t);
625
+ }
626
+ }, Oe = class extends E {
627
+ retokenizeCapturedWithRuleId;
628
+ constructor(e, t, n, r, i) {
629
+ super(e, t, n, r), this.retokenizeCapturedWithRuleId = i;
630
+ }
631
+ dispose() {}
632
+ collectPatterns(e, t) {
633
+ throw Error("Not supported!");
634
+ }
635
+ compile(e, t) {
636
+ throw Error("Not supported!");
637
+ }
638
+ compileAG(e, t, n, r) {
639
+ throw Error("Not supported!");
640
+ }
641
+ }, ke = class extends E {
642
+ _match;
643
+ captures;
644
+ _cachedCompiledPatterns;
645
+ constructor(e, t, n, r, i) {
646
+ super(e, t, n, null), this._match = new O(r, this.id), this.captures = i, this._cachedCompiledPatterns = null;
647
+ }
648
+ dispose() {
649
+ this._cachedCompiledPatterns &&= (this._cachedCompiledPatterns.dispose(), null);
650
+ }
651
+ get debugMatchRegExp() {
652
+ return `${this._match.source}`;
653
+ }
654
+ collectPatterns(e, t) {
655
+ t.push(this._match);
656
+ }
657
+ compile(e, t) {
658
+ return this._getCachedCompiledPatterns(e).compile(e);
659
+ }
660
+ compileAG(e, t, n, r) {
661
+ return this._getCachedCompiledPatterns(e).compileAG(e, n, r);
662
+ }
663
+ _getCachedCompiledPatterns(e) {
664
+ return this._cachedCompiledPatterns || (this._cachedCompiledPatterns = new k(), this.collectPatterns(e, this._cachedCompiledPatterns)), this._cachedCompiledPatterns;
665
+ }
666
+ }, Ae = class extends E {
667
+ hasMissingPatterns;
668
+ patterns;
669
+ _cachedCompiledPatterns;
670
+ constructor(e, t, n, r, i) {
671
+ super(e, t, n, r), this.patterns = i.patterns, this.hasMissingPatterns = i.hasMissingPatterns, this._cachedCompiledPatterns = null;
672
+ }
673
+ dispose() {
674
+ this._cachedCompiledPatterns &&= (this._cachedCompiledPatterns.dispose(), null);
675
+ }
676
+ collectPatterns(e, t) {
677
+ for (let n of this.patterns) e.getRule(n).collectPatterns(e, t);
678
+ }
679
+ compile(e, t) {
680
+ return this._getCachedCompiledPatterns(e).compile(e);
681
+ }
682
+ compileAG(e, t, n, r) {
683
+ return this._getCachedCompiledPatterns(e).compileAG(e, n, r);
684
+ }
685
+ _getCachedCompiledPatterns(e) {
686
+ return this._cachedCompiledPatterns || (this._cachedCompiledPatterns = new k(), this.collectPatterns(e, this._cachedCompiledPatterns)), this._cachedCompiledPatterns;
687
+ }
688
+ }, je = class extends E {
689
+ _begin;
690
+ beginCaptures;
691
+ _end;
692
+ endHasBackReferences;
693
+ endCaptures;
694
+ applyEndPatternLast;
695
+ hasMissingPatterns;
696
+ patterns;
697
+ _cachedCompiledPatterns;
698
+ constructor(e, t, n, r, i, a, o, s, c, l) {
699
+ super(e, t, n, r), this._begin = new O(i, this.id), this.beginCaptures = a, this._end = new O(o || "￿", -1), this.endHasBackReferences = this._end.hasBackReferences, this.endCaptures = s, this.applyEndPatternLast = c || !1, this.patterns = l.patterns, this.hasMissingPatterns = l.hasMissingPatterns, this._cachedCompiledPatterns = null;
700
+ }
701
+ dispose() {
702
+ this._cachedCompiledPatterns &&= (this._cachedCompiledPatterns.dispose(), null);
703
+ }
704
+ get debugBeginRegExp() {
705
+ return `${this._begin.source}`;
706
+ }
707
+ get debugEndRegExp() {
708
+ return `${this._end.source}`;
709
+ }
710
+ getEndWithResolvedBackReferences(e, t) {
711
+ return this._end.resolveBackReferences(e, t);
712
+ }
713
+ collectPatterns(e, t) {
714
+ t.push(this._begin);
715
+ }
716
+ compile(e, t) {
717
+ return this._getCachedCompiledPatterns(e, t).compile(e);
718
+ }
719
+ compileAG(e, t, n, r) {
720
+ return this._getCachedCompiledPatterns(e, t).compileAG(e, n, r);
721
+ }
722
+ _getCachedCompiledPatterns(e, t) {
723
+ if (!this._cachedCompiledPatterns) {
724
+ this._cachedCompiledPatterns = new k();
725
+ for (let t of this.patterns) e.getRule(t).collectPatterns(e, this._cachedCompiledPatterns);
726
+ this.applyEndPatternLast ? this._cachedCompiledPatterns.push(this._end.hasBackReferences ? this._end.clone() : this._end) : this._cachedCompiledPatterns.unshift(this._end.hasBackReferences ? this._end.clone() : this._end);
727
+ }
728
+ return this._end.hasBackReferences && (this.applyEndPatternLast ? this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length() - 1, t) : this._cachedCompiledPatterns.setSource(0, t)), this._cachedCompiledPatterns;
729
+ }
730
+ }, D = class extends E {
731
+ _begin;
732
+ beginCaptures;
733
+ whileCaptures;
734
+ _while;
735
+ whileHasBackReferences;
736
+ hasMissingPatterns;
737
+ patterns;
738
+ _cachedCompiledPatterns;
739
+ _cachedCompiledWhilePatterns;
740
+ constructor(e, t, n, r, i, a, o, s, c) {
741
+ super(e, t, n, r), this._begin = new O(i, this.id), this.beginCaptures = a, this.whileCaptures = s, this._while = new O(o, Te), this.whileHasBackReferences = this._while.hasBackReferences, this.patterns = c.patterns, this.hasMissingPatterns = c.hasMissingPatterns, this._cachedCompiledPatterns = null, this._cachedCompiledWhilePatterns = null;
742
+ }
743
+ dispose() {
744
+ this._cachedCompiledPatterns &&= (this._cachedCompiledPatterns.dispose(), null), this._cachedCompiledWhilePatterns &&= (this._cachedCompiledWhilePatterns.dispose(), null);
745
+ }
746
+ get debugBeginRegExp() {
747
+ return `${this._begin.source}`;
748
+ }
749
+ get debugWhileRegExp() {
750
+ return `${this._while.source}`;
751
+ }
752
+ getWhileWithResolvedBackReferences(e, t) {
753
+ return this._while.resolveBackReferences(e, t);
754
+ }
755
+ collectPatterns(e, t) {
756
+ t.push(this._begin);
757
+ }
758
+ compile(e, t) {
759
+ return this._getCachedCompiledPatterns(e).compile(e);
760
+ }
761
+ compileAG(e, t, n, r) {
762
+ return this._getCachedCompiledPatterns(e).compileAG(e, n, r);
763
+ }
764
+ _getCachedCompiledPatterns(e) {
765
+ if (!this._cachedCompiledPatterns) {
766
+ this._cachedCompiledPatterns = new k();
767
+ for (let t of this.patterns) e.getRule(t).collectPatterns(e, this._cachedCompiledPatterns);
768
+ }
769
+ return this._cachedCompiledPatterns;
770
+ }
771
+ compileWhile(e, t) {
772
+ return this._getCachedCompiledWhilePatterns(e, t).compile(e);
773
+ }
774
+ compileWhileAG(e, t, n, r) {
775
+ return this._getCachedCompiledWhilePatterns(e, t).compileAG(e, n, r);
776
+ }
777
+ _getCachedCompiledWhilePatterns(e, t) {
778
+ return this._cachedCompiledWhilePatterns || (this._cachedCompiledWhilePatterns = new k(), this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences ? this._while.clone() : this._while)), this._while.hasBackReferences && this._cachedCompiledWhilePatterns.setSource(0, t || "￿"), this._cachedCompiledWhilePatterns;
779
+ }
780
+ }, Me = class e {
781
+ static createCaptureRule(e, t, n, r, i) {
782
+ return e.registerRule((e) => new Oe(t, e, n, r, i));
783
+ }
784
+ static getCompiledRuleId(t, n, r) {
785
+ return t.id || n.registerRule((i) => {
786
+ if (t.id = i, t.match) return new ke(t.$vscodeTextmateLocation, t.id, t.name, t.match, e._compileCaptures(t.captures, n, r));
787
+ if (t.begin === void 0) {
788
+ t.repository && (r = a({}, r, t.repository));
789
+ let i = t.patterns;
790
+ return i === void 0 && t.include && (i = [{ include: t.include }]), new Ae(t.$vscodeTextmateLocation, t.id, t.name, t.contentName, e._compilePatterns(i, n, r));
791
+ }
792
+ return t.while ? new D(t.$vscodeTextmateLocation, t.id, t.name, t.contentName, t.begin, e._compileCaptures(t.beginCaptures || t.captures, n, r), t.while, e._compileCaptures(t.whileCaptures || t.captures, n, r), e._compilePatterns(t.patterns, n, r)) : new je(t.$vscodeTextmateLocation, t.id, t.name, t.contentName, t.begin, e._compileCaptures(t.beginCaptures || t.captures, n, r), t.end, e._compileCaptures(t.endCaptures || t.captures, n, r), t.applyEndPatternLast, e._compilePatterns(t.patterns, n, r));
793
+ }), t.id;
794
+ }
795
+ static _compileCaptures(t, n, r) {
796
+ let i = [];
797
+ if (t) {
798
+ let a = 0;
799
+ for (let e in t) {
800
+ if (e === "$vscodeTextmateLocation") continue;
801
+ let t = parseInt(e, 10);
802
+ t > a && (a = t);
803
+ }
804
+ for (let e = 0; e <= a; e++) i[e] = null;
805
+ for (let a in t) {
806
+ if (a === "$vscodeTextmateLocation") continue;
807
+ let o = parseInt(a, 10), s = 0;
808
+ t[a].patterns && (s = e.getCompiledRuleId(t[a], n, r)), i[o] = e.createCaptureRule(n, t[a].$vscodeTextmateLocation, t[a].name, t[a].contentName, s);
809
+ }
810
+ }
811
+ return i;
812
+ }
813
+ static _compilePatterns(t, n, r) {
814
+ let i = [];
815
+ if (t) for (let a = 0, o = t.length; a < o; a++) {
816
+ let o = t[a], s = -1;
817
+ if (o.include) {
818
+ let t = xe(o.include);
819
+ switch (t.kind) {
820
+ case 0:
821
+ case 1:
822
+ s = e.getCompiledRuleId(r[o.include], n, r);
823
+ break;
824
+ case 2:
825
+ let i = r[t.ruleName];
826
+ i && (s = e.getCompiledRuleId(i, n, r));
827
+ break;
828
+ case 3:
829
+ case 4:
830
+ let a = t.scopeName, c = t.kind === 4 ? t.ruleName : null, l = n.getExternalGrammar(a, r);
831
+ if (l) {
832
+ if (c) {
833
+ let t = l.repository[c];
834
+ t && (s = e.getCompiledRuleId(t, n, l.repository));
835
+ } else s = e.getCompiledRuleId(l.repository.$self, n, l.repository);
836
+ }
837
+ }
838
+ } else s = e.getCompiledRuleId(o, n, r);
839
+ if (s !== -1) {
840
+ let e = n.getRule(s), t = !1;
841
+ if ((e instanceof Ae || e instanceof je || e instanceof D) && e.hasMissingPatterns && e.patterns.length === 0 && (t = !0), t) continue;
842
+ i.push(s);
843
+ }
844
+ }
845
+ return {
846
+ patterns: i,
847
+ hasMissingPatterns: (t ? t.length : 0) !== i.length
848
+ };
849
+ }
850
+ }, O = class e {
851
+ source;
852
+ ruleId;
853
+ hasAnchor;
854
+ hasBackReferences;
855
+ _anchorCache;
856
+ constructor(e, t) {
857
+ if (e && typeof e == "string") {
858
+ let t = e.length, n = 0, r = [], i = !1;
859
+ for (let a = 0; a < t; a++) if (e.charAt(a) === "\\" && a + 1 < t) {
860
+ let t = e.charAt(a + 1);
861
+ t === "z" ? (r.push(e.substring(n, a)), r.push("$(?!\\n)(?<!\\n)"), n = a + 2) : (t === "A" || t === "G") && (i = !0), a++;
862
+ }
863
+ this.hasAnchor = i, n === 0 ? this.source = e : (r.push(e.substring(n, t)), this.source = r.join(""));
864
+ } else this.hasAnchor = !1, this.source = e;
865
+ this._anchorCache = this.hasAnchor ? this._buildAnchorCache() : null, this.ruleId = t, this.hasBackReferences = typeof this.source == "string" && Se.test(this.source);
866
+ }
867
+ clone() {
868
+ return new e(this.source, this.ruleId);
869
+ }
870
+ setSource(e) {
871
+ this.source !== e && (this.source = e, this.hasAnchor && (this._anchorCache = this._buildAnchorCache()));
872
+ }
873
+ resolveBackReferences(e, t) {
874
+ if (typeof this.source != "string") throw Error("This method should only be called if the source is a string");
875
+ let n = t.map((t) => e.substring(t.start, t.end));
876
+ return Ce.lastIndex = 0, this.source.replace(Ce, (e, t) => f(n[parseInt(t, 10)] || ""));
877
+ }
878
+ _buildAnchorCache() {
879
+ if (typeof this.source != "string") throw Error("This method should only be called if the source is a string");
880
+ let e = [], t = [], n = [], r = [], i, a, o, s;
881
+ for (i = 0, a = this.source.length; i < a; i++) o = this.source.charAt(i), e[i] = o, t[i] = o, n[i] = o, r[i] = o, o === "\\" && i + 1 < a && (s = this.source.charAt(i + 1), s === "A" ? (e[i + 1] = "￿", t[i + 1] = "￿", n[i + 1] = "A", r[i + 1] = "A") : s === "G" ? (e[i + 1] = "￿", t[i + 1] = "G", n[i + 1] = "￿", r[i + 1] = "G") : (e[i + 1] = s, t[i + 1] = s, n[i + 1] = s, r[i + 1] = s), i++);
882
+ return {
883
+ A0_G0: e.join(""),
884
+ A0_G1: t.join(""),
885
+ A1_G0: n.join(""),
886
+ A1_G1: r.join("")
887
+ };
888
+ }
889
+ resolveAnchors(e, t) {
890
+ return !this.hasAnchor || !this._anchorCache || typeof this.source != "string" ? this.source : e ? t ? this._anchorCache.A1_G1 : this._anchorCache.A1_G0 : t ? this._anchorCache.A0_G1 : this._anchorCache.A0_G0;
891
+ }
892
+ }, k = class {
893
+ _items;
894
+ _hasAnchors;
895
+ _cached;
896
+ _anchorCache;
897
+ constructor() {
898
+ this._items = [], this._hasAnchors = !1, this._cached = null, this._anchorCache = {
899
+ A0_G0: null,
900
+ A0_G1: null,
901
+ A1_G0: null,
902
+ A1_G1: null
903
+ };
904
+ }
905
+ dispose() {
906
+ this._disposeCaches();
907
+ }
908
+ _disposeCaches() {
909
+ this._cached &&= (this._cached.dispose(), null), this._anchorCache.A0_G0 && (this._anchorCache.A0_G0.dispose(), this._anchorCache.A0_G0 = null), this._anchorCache.A0_G1 && (this._anchorCache.A0_G1.dispose(), this._anchorCache.A0_G1 = null), this._anchorCache.A1_G0 && (this._anchorCache.A1_G0.dispose(), this._anchorCache.A1_G0 = null), this._anchorCache.A1_G1 && (this._anchorCache.A1_G1.dispose(), this._anchorCache.A1_G1 = null);
910
+ }
911
+ push(e) {
912
+ this._items.push(e), this._hasAnchors = this._hasAnchors || e.hasAnchor;
913
+ }
914
+ unshift(e) {
915
+ this._items.unshift(e), this._hasAnchors = this._hasAnchors || e.hasAnchor;
916
+ }
917
+ length() {
918
+ return this._items.length;
919
+ }
920
+ setSource(e, t) {
921
+ this._items[e].source !== t && (this._disposeCaches(), this._items[e].setSource(t));
922
+ }
923
+ compile(e) {
924
+ if (!this._cached) {
925
+ let t = this._items.map((e) => e.source);
926
+ this._cached = new Ne(e, t, this._items.map((e) => e.ruleId));
927
+ }
928
+ return this._cached;
929
+ }
930
+ compileAG(e, t, n) {
931
+ return this._hasAnchors ? t ? n ? (this._anchorCache.A1_G1 || (this._anchorCache.A1_G1 = this._resolveAnchors(e, t, n)), this._anchorCache.A1_G1) : (this._anchorCache.A1_G0 || (this._anchorCache.A1_G0 = this._resolveAnchors(e, t, n)), this._anchorCache.A1_G0) : n ? (this._anchorCache.A0_G1 || (this._anchorCache.A0_G1 = this._resolveAnchors(e, t, n)), this._anchorCache.A0_G1) : (this._anchorCache.A0_G0 || (this._anchorCache.A0_G0 = this._resolveAnchors(e, t, n)), this._anchorCache.A0_G0) : this.compile(e);
932
+ }
933
+ _resolveAnchors(e, t, n) {
934
+ return new Ne(e, this._items.map((e) => e.resolveAnchors(t, n)), this._items.map((e) => e.ruleId));
935
+ }
936
+ }, Ne = class {
937
+ constructor(e, t, n) {
938
+ this.regExps = t, this.rules = n, this.scanner = e.createOnigScanner(t);
939
+ }
940
+ regExps;
941
+ rules;
942
+ scanner;
943
+ dispose() {
944
+ typeof this.scanner.dispose == "function" && this.scanner.dispose();
945
+ }
946
+ toString() {
947
+ let e = [];
948
+ for (let t = 0, n = this.rules.length; t < n; t++) e.push(" - " + this.rules[t] + ": " + this.regExps[t]);
949
+ return e.join("\n");
950
+ }
951
+ findNextMatchSync(e, t, n) {
952
+ let r = this.scanner.findNextMatchSync(e, t, n);
953
+ return r ? {
954
+ ruleId: this.rules[r.index],
955
+ captureIndices: r.captureIndices
956
+ } : null;
957
+ }
958
+ }, Pe = class {
959
+ constructor(e, t) {
960
+ this.languageId = e, this.tokenType = t;
961
+ }
962
+ languageId;
963
+ tokenType;
964
+ }, Fe = class e {
965
+ _defaultAttributes;
966
+ _embeddedLanguagesMatcher;
967
+ constructor(e, t) {
968
+ this._defaultAttributes = new Pe(e, 8), this._embeddedLanguagesMatcher = new Ie(Object.entries(t || {}));
969
+ }
970
+ getDefaultAttributes() {
971
+ return this._defaultAttributes;
972
+ }
973
+ getBasicScopeAttributes(t) {
974
+ return t === null ? e._NULL_SCOPE_METADATA : this._getBasicScopeAttributes.get(t);
975
+ }
976
+ static _NULL_SCOPE_METADATA = new Pe(0, 0);
977
+ _getBasicScopeAttributes = new p((e) => new Pe(this._scopeToLanguage(e), this._toStandardTokenType(e)));
978
+ _scopeToLanguage(e) {
979
+ return this._embeddedLanguagesMatcher.match(e) || 0;
980
+ }
981
+ _toStandardTokenType(t) {
982
+ let n = t.match(e.STANDARD_TOKEN_TYPE_REGEXP);
983
+ if (!n) return 8;
984
+ switch (n[1]) {
985
+ case "comment": return 1;
986
+ case "string": return 2;
987
+ case "regex": return 3;
988
+ case "meta.embedded": return 0;
989
+ }
990
+ throw Error("Unexpected match for standard token type!");
991
+ }
992
+ static STANDARD_TOKEN_TYPE_REGEXP = /\b(comment|string|regex|meta\.embedded)\b/;
993
+ }, Ie = class {
994
+ values;
995
+ scopesRegExp;
996
+ constructor(e) {
997
+ if (e.length === 0) this.values = null, this.scopesRegExp = null;
998
+ else {
999
+ this.values = new Map(e);
1000
+ let t = e.map(([e, t]) => f(e));
1001
+ t.sort(), t.reverse(), this.scopesRegExp = RegExp(`^((${t.join(")|(")}))($|\\.)`, "");
1002
+ }
1003
+ }
1004
+ match(e) {
1005
+ if (!this.scopesRegExp) return;
1006
+ let t = e.match(this.scopesRegExp);
1007
+ if (t) return this.values.get(t[1]);
1008
+ }
1009
+ };
1010
+ typeof process < "u" && process.env.VSCODE_TEXTMATE_DEBUG;
1011
+ var Le = class {
1012
+ constructor(e, t) {
1013
+ this.stack = e, this.stoppedEarly = t;
1014
+ }
1015
+ stack;
1016
+ stoppedEarly;
1017
+ };
1018
+ function Re(e, t, n, r, i, a, o, s) {
1019
+ let c = t.content.length, l = !1, u = -1;
1020
+ if (o) {
1021
+ let o = ze(e, t, n, r, i, a);
1022
+ i = o.stack, r = o.linePos, n = o.isFirstLine, u = o.anchorPosition;
1023
+ }
1024
+ let d = Date.now();
1025
+ for (; !l;) {
1026
+ if (s !== 0 && Date.now() - d > s) return new Le(i, !0);
1027
+ f();
1028
+ }
1029
+ return new Le(i, !1);
1030
+ function f() {
1031
+ let o = Be(e, t, n, r, i, u);
1032
+ if (!o) {
1033
+ a.produce(i, c), l = !0;
1034
+ return;
1035
+ }
1036
+ let s = o.captureIndices, d = o.matchedRuleId, f = s && s.length > 0 ? s[0].end > r : !1;
1037
+ if (d === we) {
1038
+ let o = i.getRule(e);
1039
+ a.produce(i, s[0].start), i = i.withContentNameScopesList(i.nameScopesList), A(e, t, n, i, a, o.endCaptures, s), a.produce(i, s[0].end);
1040
+ let d = i;
1041
+ if (i = i.parent, u = d.getAnchorPos(), !f && d.getEnterPos() === r) {
1042
+ i = d, a.produce(i, c), l = !0;
1043
+ return;
1044
+ }
1045
+ } else {
1046
+ let o = e.getRule(d);
1047
+ a.produce(i, s[0].start);
1048
+ let p = i, m = o.getName(t.content, s), h = i.contentNameScopesList.pushAttributed(m, e);
1049
+ if (i = i.push(d, r, u, s[0].end === c, null, h, h), o instanceof je) {
1050
+ let r = o;
1051
+ A(e, t, n, i, a, r.beginCaptures, s), a.produce(i, s[0].end), u = s[0].end;
1052
+ let d = r.getContentName(t.content, s), m = h.pushAttributed(d, e);
1053
+ if (i = i.withContentNameScopesList(m), r.endHasBackReferences && (i = i.withEndRule(r.getEndWithResolvedBackReferences(t.content, s))), !f && p.hasSameRuleAs(i)) {
1054
+ i = i.pop(), a.produce(i, c), l = !0;
1055
+ return;
1056
+ }
1057
+ } else if (o instanceof D) {
1058
+ let r = o;
1059
+ A(e, t, n, i, a, r.beginCaptures, s), a.produce(i, s[0].end), u = s[0].end;
1060
+ let d = r.getContentName(t.content, s), m = h.pushAttributed(d, e);
1061
+ if (i = i.withContentNameScopesList(m), r.whileHasBackReferences && (i = i.withEndRule(r.getWhileWithResolvedBackReferences(t.content, s))), !f && p.hasSameRuleAs(i)) {
1062
+ i = i.pop(), a.produce(i, c), l = !0;
1063
+ return;
1064
+ }
1065
+ } else if (A(e, t, n, i, a, o.captures, s), a.produce(i, s[0].end), i = i.pop(), !f) {
1066
+ i = i.safePop(), a.produce(i, c), l = !0;
1067
+ return;
1068
+ }
1069
+ }
1070
+ s[0].end > r && (r = s[0].end, n = !1);
1071
+ }
1072
+ }
1073
+ function ze(e, t, n, r, i, a) {
1074
+ let o = i.beginRuleCapturedEOL ? 0 : -1, s = [];
1075
+ for (let t = i; t; t = t.pop()) {
1076
+ let n = t.getRule(e);
1077
+ n instanceof D && s.push({
1078
+ rule: n,
1079
+ stack: t
1080
+ });
1081
+ }
1082
+ for (let c = s.pop(); c; c = s.pop()) {
1083
+ let { ruleScanner: s, findOptions: l } = We(c.rule, e, c.stack.endRule, n, r === o), u = s.findNextMatchSync(t, r, l);
1084
+ if (u) {
1085
+ if (u.ruleId !== Te) {
1086
+ i = c.stack.pop();
1087
+ break;
1088
+ }
1089
+ u.captureIndices && u.captureIndices.length && (a.produce(c.stack, u.captureIndices[0].start), A(e, t, n, c.stack, a, c.rule.whileCaptures, u.captureIndices), a.produce(c.stack, u.captureIndices[0].end), o = u.captureIndices[0].end, u.captureIndices[0].end > r && (r = u.captureIndices[0].end, n = !1));
1090
+ } else {
1091
+ i = c.stack.pop();
1092
+ break;
1093
+ }
1094
+ }
1095
+ return {
1096
+ stack: i,
1097
+ linePos: r,
1098
+ anchorPosition: o,
1099
+ isFirstLine: n
1100
+ };
1101
+ }
1102
+ function Be(e, t, n, r, i, a) {
1103
+ let o = Ve(e, t, n, r, i, a), s = e.getInjections();
1104
+ if (s.length === 0) return o;
1105
+ let c = He(s, e, t, n, r, i, a);
1106
+ if (!c) return o;
1107
+ if (!o) return c;
1108
+ let l = o.captureIndices[0].start, u = c.captureIndices[0].start;
1109
+ return u < l || c.priorityMatch && u === l ? c : o;
1110
+ }
1111
+ function Ve(e, t, n, r, i, a) {
1112
+ let { ruleScanner: o, findOptions: s } = Ue(i.getRule(e), e, i.endRule, n, r === a), c = o.findNextMatchSync(t, r, s);
1113
+ return c ? {
1114
+ captureIndices: c.captureIndices,
1115
+ matchedRuleId: c.ruleId
1116
+ } : null;
1117
+ }
1118
+ function He(e, t, n, r, i, a, o) {
1119
+ let s = Number.MAX_VALUE, c = null, l, u = 0, d = a.contentNameScopesList.getScopeNames();
1120
+ for (let a = 0, f = e.length; a < f; a++) {
1121
+ let f = e[a];
1122
+ if (!f.matcher(d)) continue;
1123
+ let { ruleScanner: p, findOptions: m } = Ue(t.getRule(f.ruleId), t, null, r, i === o), h = p.findNextMatchSync(n, i, m);
1124
+ if (!h) continue;
1125
+ let g = h.captureIndices[0].start;
1126
+ if (!(g >= s) && (s = g, c = h.captureIndices, l = h.ruleId, u = f.priority, s === i)) break;
1127
+ }
1128
+ return c ? {
1129
+ priorityMatch: u === -1,
1130
+ captureIndices: c,
1131
+ matchedRuleId: l
1132
+ } : null;
1133
+ }
1134
+ function Ue(e, t, n, r, i) {
1135
+ return {
1136
+ ruleScanner: e.compileAG(t, n, r, i),
1137
+ findOptions: 0
1138
+ };
1139
+ }
1140
+ function We(e, t, n, r, i) {
1141
+ return {
1142
+ ruleScanner: e.compileWhileAG(t, n, r, i),
1143
+ findOptions: 0
1144
+ };
1145
+ }
1146
+ function A(e, t, n, r, i, a, o) {
1147
+ if (a.length === 0) return;
1148
+ let s = t.content, c = Math.min(a.length, o.length), l = [], u = o[0].end;
1149
+ for (let t = 0; t < c; t++) {
1150
+ let c = a[t];
1151
+ if (c === null) continue;
1152
+ let d = o[t];
1153
+ if (d.length === 0) continue;
1154
+ if (d.start > u) break;
1155
+ for (; l.length > 0 && l[l.length - 1].endPos <= d.start;) i.produceFromScopes(l[l.length - 1].scopes, l[l.length - 1].endPos), l.pop();
1156
+ if (l.length > 0 ? i.produceFromScopes(l[l.length - 1].scopes, d.start) : i.produce(r, d.start), c.retokenizeCapturedWithRuleId) {
1157
+ let t = c.getName(s, o), a = r.contentNameScopesList.pushAttributed(t, e), l = c.getContentName(s, o), u = a.pushAttributed(l, e), f = r.push(c.retokenizeCapturedWithRuleId, d.start, -1, !1, null, a, u), p = e.createOnigString(s.substring(0, d.end));
1158
+ Re(e, p, n && d.start === 0, d.start, f, i, !1, 0), ue(p);
1159
+ continue;
1160
+ }
1161
+ let f = c.getName(s, o);
1162
+ if (f !== null) {
1163
+ let t = (l.length > 0 ? l[l.length - 1].scopes : r.contentNameScopesList).pushAttributed(f, e);
1164
+ l.push(new Ge(t, d.end));
1165
+ }
1166
+ }
1167
+ for (; l.length > 0;) i.produceFromScopes(l[l.length - 1].scopes, l[l.length - 1].endPos), l.pop();
1168
+ }
1169
+ var Ge = class {
1170
+ scopes;
1171
+ endPos;
1172
+ constructor(e, t) {
1173
+ this.scopes = e, this.endPos = t;
1174
+ }
1175
+ };
1176
+ function Ke(e, t, n, r, i, a, o, s) {
1177
+ return new Ye(e, t, n, r, i, a, o, s);
1178
+ }
1179
+ function qe(e, t, n, r, i) {
1180
+ let a = S(t, j), o = Me.getCompiledRuleId(n, r, i.repository);
1181
+ for (let n of a) e.push({
1182
+ debugSelector: t,
1183
+ matcher: n.matcher,
1184
+ ruleId: o,
1185
+ grammar: i,
1186
+ priority: n.priority
1187
+ });
1188
+ }
1189
+ function j(e, t) {
1190
+ if (t.length < e.length) return !1;
1191
+ let n = 0;
1192
+ return e.every((e) => {
1193
+ for (let r = n; r < t.length; r++) if (Je(t[r], e)) return n = r + 1, !0;
1194
+ return !1;
1195
+ });
1196
+ }
1197
+ function Je(e, t) {
1198
+ if (!e) return !1;
1199
+ if (e === t) return !0;
1200
+ let n = t.length;
1201
+ return e.length > n && e.substr(0, n) === t && e[n] === ".";
1202
+ }
1203
+ var Ye = class {
1204
+ constructor(e, t, n, r, i, a, o, s) {
1205
+ if (this._rootScopeName = e, this.balancedBracketSelectors = a, this._onigLib = s, this._basicScopeAttributesProvider = new Fe(n, r), this._rootId = -1, this._lastRuleId = 0, this._ruleId2desc = [null], this._includedGrammars = {}, this._grammarRepository = o, this._grammar = Xe(t, null), this._injections = null, this._tokenTypeMatchers = [], i) for (let e of Object.keys(i)) {
1206
+ let t = S(e, j);
1207
+ for (let n of t) this._tokenTypeMatchers.push({
1208
+ matcher: n.matcher,
1209
+ type: i[e]
1210
+ });
1211
+ }
1212
+ }
1213
+ _rootScopeName;
1214
+ balancedBracketSelectors;
1215
+ _onigLib;
1216
+ _rootId;
1217
+ _lastRuleId;
1218
+ _ruleId2desc;
1219
+ _includedGrammars;
1220
+ _grammarRepository;
1221
+ _grammar;
1222
+ _injections;
1223
+ _basicScopeAttributesProvider;
1224
+ _tokenTypeMatchers;
1225
+ get themeProvider() {
1226
+ return this._grammarRepository;
1227
+ }
1228
+ dispose() {
1229
+ for (let e of this._ruleId2desc) e && e.dispose();
1230
+ }
1231
+ createOnigScanner(e) {
1232
+ return this._onigLib.createOnigScanner(e);
1233
+ }
1234
+ createOnigString(e) {
1235
+ return this._onigLib.createOnigString(e);
1236
+ }
1237
+ getMetadataForScope(e) {
1238
+ return this._basicScopeAttributesProvider.getBasicScopeAttributes(e);
1239
+ }
1240
+ _collectInjections() {
1241
+ let e = {
1242
+ lookup: (e) => e === this._rootScopeName ? this._grammar : this.getExternalGrammar(e),
1243
+ injections: (e) => this._grammarRepository.injections(e)
1244
+ }, t = [], n = this._rootScopeName, r = e.lookup(n);
1245
+ if (r) {
1246
+ let e = r.injections;
1247
+ if (e) for (let n in e) qe(t, n, e[n], this, r);
1248
+ let i = this._grammarRepository.injections(n);
1249
+ i && i.forEach((e) => {
1250
+ let n = this.getExternalGrammar(e);
1251
+ if (n) {
1252
+ let e = n.injectionSelector;
1253
+ e && qe(t, e, n, this, n);
1254
+ }
1255
+ });
1256
+ }
1257
+ return t.sort((e, t) => e.priority - t.priority), t;
1258
+ }
1259
+ getInjections() {
1260
+ return this._injections === null && (this._injections = this._collectInjections()), this._injections;
1261
+ }
1262
+ registerRule(e) {
1263
+ let t = ++this._lastRuleId, n = e(Ee(t));
1264
+ return this._ruleId2desc[t] = n, n;
1265
+ }
1266
+ getRule(e) {
1267
+ return this._ruleId2desc[De(e)];
1268
+ }
1269
+ getExternalGrammar(e, t) {
1270
+ if (this._includedGrammars[e]) return this._includedGrammars[e];
1271
+ if (this._grammarRepository) {
1272
+ let n = this._grammarRepository.lookup(e);
1273
+ if (n) return this._includedGrammars[e] = Xe(n, t && t.$base), this._includedGrammars[e];
1274
+ }
1275
+ }
1276
+ tokenizeLine(e, t, n = 0) {
1277
+ let r = this._tokenize(e, t, !1, n);
1278
+ return {
1279
+ tokens: r.lineTokens.getResult(r.ruleStack, r.lineLength),
1280
+ ruleStack: r.ruleStack,
1281
+ stoppedEarly: r.stoppedEarly
1282
+ };
1283
+ }
1284
+ tokenizeLine2(e, t, n = 0) {
1285
+ let r = this._tokenize(e, t, !0, n);
1286
+ return {
1287
+ tokens: r.lineTokens.getBinaryResult(r.ruleStack, r.lineLength),
1288
+ ruleStack: r.ruleStack,
1289
+ stoppedEarly: r.stoppedEarly
1290
+ };
1291
+ }
1292
+ _tokenize(e, t, n, r) {
1293
+ this._rootId === -1 && (this._rootId = Me.getCompiledRuleId(this._grammar.repository.$self, this, this._grammar.repository), this.getInjections());
1294
+ let i;
1295
+ if (!t || t === Ze.NULL) {
1296
+ i = !0;
1297
+ let e = this._basicScopeAttributesProvider.getDefaultAttributes(), n = this.themeProvider.getDefaults(), r = x.set(0, e.languageId, e.tokenType, null, n.fontStyle, n.foregroundId, n.backgroundId), a = this.getRule(this._rootId).getName(null, null), o;
1298
+ o = a ? M.createRootAndLookUpScopeName(a, r, this) : M.createRoot("unknown", r), t = new Ze(null, this._rootId, -1, -1, !1, null, o, o);
1299
+ } else i = !1, t.reset();
1300
+ e += "\n";
1301
+ let a = this.createOnigString(e), o = a.content.length, s = new $e(n, e, this._tokenTypeMatchers, this.balancedBracketSelectors), c = Re(this, a, i, 0, t, s, !0, r);
1302
+ return ue(a), {
1303
+ lineLength: o,
1304
+ lineTokens: s,
1305
+ ruleStack: c.stack,
1306
+ stoppedEarly: c.stoppedEarly
1307
+ };
1308
+ }
1309
+ };
1310
+ function Xe(e, n) {
1311
+ return e = t(e), e.repository = e.repository || {}, e.repository.$self = {
1312
+ $vscodeTextmateLocation: e.$vscodeTextmateLocation,
1313
+ patterns: e.patterns,
1314
+ name: e.scopeName
1315
+ }, e.repository.$base = n || e.repository.$self, e;
1316
+ }
1317
+ var M = class e {
1318
+ constructor(e, t, n) {
1319
+ this.parent = e, this.scopePath = t, this.tokenAttributes = n;
1320
+ }
1321
+ parent;
1322
+ scopePath;
1323
+ tokenAttributes;
1324
+ static fromExtension(t, n) {
1325
+ let r = t, i = t?.scopePath ?? null;
1326
+ for (let t of n) i = h.push(i, t.scopeNames), r = new e(r, i, t.encodedTokenAttributes);
1327
+ return r;
1328
+ }
1329
+ static createRoot(t, n) {
1330
+ return new e(null, new h(null, t), n);
1331
+ }
1332
+ static createRootAndLookUpScopeName(t, n, r) {
1333
+ let i = r.getMetadataForScope(t), a = new h(null, t), o = r.themeProvider.themeMatch(a), s = e.mergeAttributes(n, i, o);
1334
+ return new e(null, a, s);
1335
+ }
1336
+ get scopeName() {
1337
+ return this.scopePath.scopeName;
1338
+ }
1339
+ toString() {
1340
+ return this.getScopeNames().join(" ");
1341
+ }
1342
+ equals(t) {
1343
+ return e.equals(this, t);
1344
+ }
1345
+ static equals(e, t) {
1346
+ do {
1347
+ if (e === t || !e && !t) return !0;
1348
+ if (!e || !t || e.scopeName !== t.scopeName || e.tokenAttributes !== t.tokenAttributes) return !1;
1349
+ e = e.parent, t = t.parent;
1350
+ } while (1);
1351
+ }
1352
+ static mergeAttributes(e, t, n) {
1353
+ let r = -1, i = 0, a = 0;
1354
+ return n !== null && (r = n.fontStyle, i = n.foregroundId, a = n.backgroundId), x.set(e, t.languageId, t.tokenType, null, r, i, a);
1355
+ }
1356
+ pushAttributed(t, n) {
1357
+ if (t === null) return this;
1358
+ if (t.indexOf(" ") === -1) return e._pushAttributed(this, t, n);
1359
+ let r = t.split(/ /g), i = this;
1360
+ for (let t of r) i = e._pushAttributed(i, t, n);
1361
+ return i;
1362
+ }
1363
+ static _pushAttributed(t, n, r) {
1364
+ let i = r.getMetadataForScope(n), a = t.scopePath.push(n), o = r.themeProvider.themeMatch(a), s = e.mergeAttributes(t.tokenAttributes, i, o);
1365
+ return new e(t, a, s);
1366
+ }
1367
+ getScopeNames() {
1368
+ return this.scopePath.getSegments();
1369
+ }
1370
+ getExtensionIfDefined(e) {
1371
+ let t = [], n = this;
1372
+ for (; n && n !== e;) t.push({
1373
+ encodedTokenAttributes: n.tokenAttributes,
1374
+ scopeNames: n.scopePath.getExtensionIfDefined(n.parent?.scopePath ?? null)
1375
+ }), n = n.parent;
1376
+ return n === e ? t.reverse() : void 0;
1377
+ }
1378
+ }, Ze = class e {
1379
+ constructor(e, t, n, r, i, a, o, s) {
1380
+ this.parent = e, this.ruleId = t, this.beginRuleCapturedEOL = i, this.endRule = a, this.nameScopesList = o, this.contentNameScopesList = s, this.depth = this.parent ? this.parent.depth + 1 : 1, this._enterPos = n, this._anchorPos = r;
1381
+ }
1382
+ parent;
1383
+ ruleId;
1384
+ beginRuleCapturedEOL;
1385
+ endRule;
1386
+ nameScopesList;
1387
+ contentNameScopesList;
1388
+ _stackElementBrand = void 0;
1389
+ static NULL = new e(null, 0, 0, 0, !1, null, null, null);
1390
+ _enterPos;
1391
+ _anchorPos;
1392
+ depth;
1393
+ equals(t) {
1394
+ return t !== null && e._equals(this, t);
1395
+ }
1396
+ static _equals(e, t) {
1397
+ return e === t ? !0 : this._structuralEquals(e, t) ? M.equals(e.contentNameScopesList, t.contentNameScopesList) : !1;
1398
+ }
1399
+ static _structuralEquals(e, t) {
1400
+ do {
1401
+ if (e === t || !e && !t) return !0;
1402
+ if (!e || !t || e.depth !== t.depth || e.ruleId !== t.ruleId || e.endRule !== t.endRule) return !1;
1403
+ e = e.parent, t = t.parent;
1404
+ } while (1);
1405
+ }
1406
+ clone() {
1407
+ return this;
1408
+ }
1409
+ static _reset(e) {
1410
+ for (; e;) e._enterPos = -1, e._anchorPos = -1, e = e.parent;
1411
+ }
1412
+ reset() {
1413
+ e._reset(this);
1414
+ }
1415
+ pop() {
1416
+ return this.parent;
1417
+ }
1418
+ safePop() {
1419
+ return this.parent ? this.parent : this;
1420
+ }
1421
+ push(t, n, r, i, a, o, s) {
1422
+ return new e(this, t, n, r, i, a, o, s);
1423
+ }
1424
+ getEnterPos() {
1425
+ return this._enterPos;
1426
+ }
1427
+ getAnchorPos() {
1428
+ return this._anchorPos;
1429
+ }
1430
+ getRule(e) {
1431
+ return e.getRule(this.ruleId);
1432
+ }
1433
+ toString() {
1434
+ let e = [];
1435
+ return this._writeString(e, 0), "[" + e.join(",") + "]";
1436
+ }
1437
+ _writeString(e, t) {
1438
+ return this.parent && (t = this.parent._writeString(e, t)), e[t++] = `(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`, t;
1439
+ }
1440
+ withContentNameScopesList(e) {
1441
+ return this.contentNameScopesList === e ? this : this.parent.push(this.ruleId, this._enterPos, this._anchorPos, this.beginRuleCapturedEOL, this.endRule, this.nameScopesList, e);
1442
+ }
1443
+ withEndRule(t) {
1444
+ return this.endRule === t ? this : new e(this.parent, this.ruleId, this._enterPos, this._anchorPos, this.beginRuleCapturedEOL, t, this.nameScopesList, this.contentNameScopesList);
1445
+ }
1446
+ hasSameRuleAs(e) {
1447
+ let t = this;
1448
+ for (; t && t._enterPos === e._enterPos;) {
1449
+ if (t.ruleId === e.ruleId) return !0;
1450
+ t = t.parent;
1451
+ }
1452
+ return !1;
1453
+ }
1454
+ toStateStackFrame() {
1455
+ return {
1456
+ ruleId: De(this.ruleId),
1457
+ beginRuleCapturedEOL: this.beginRuleCapturedEOL,
1458
+ endRule: this.endRule,
1459
+ nameScopesList: this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList ?? null) ?? [],
1460
+ contentNameScopesList: this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList) ?? []
1461
+ };
1462
+ }
1463
+ static pushFrame(t, n) {
1464
+ let r = M.fromExtension(t?.nameScopesList ?? null, n.nameScopesList);
1465
+ return new e(t, Ee(n.ruleId), n.enterPos ?? -1, n.anchorPos ?? -1, n.beginRuleCapturedEOL, n.endRule, r, M.fromExtension(r, n.contentNameScopesList));
1466
+ }
1467
+ }, Qe = class {
1468
+ balancedBracketScopes;
1469
+ unbalancedBracketScopes;
1470
+ allowAny = !1;
1471
+ constructor(e, t) {
1472
+ this.balancedBracketScopes = e.flatMap((e) => e === "*" ? (this.allowAny = !0, []) : S(e, j).map((e) => e.matcher)), this.unbalancedBracketScopes = t.flatMap((e) => S(e, j).map((e) => e.matcher));
1473
+ }
1474
+ get matchesAlways() {
1475
+ return this.allowAny && this.unbalancedBracketScopes.length === 0;
1476
+ }
1477
+ get matchesNever() {
1478
+ return this.balancedBracketScopes.length === 0 && !this.allowAny;
1479
+ }
1480
+ match(e) {
1481
+ for (let t of this.unbalancedBracketScopes) if (t(e)) return !1;
1482
+ for (let t of this.balancedBracketScopes) if (t(e)) return !0;
1483
+ return this.allowAny;
1484
+ }
1485
+ }, $e = class {
1486
+ constructor(e, t, n, r) {
1487
+ this.balancedBracketSelectors = r, this._emitBinaryTokens = e, this._tokenTypeOverrides = n, this._lineText = null, this._tokens = [], this._binaryTokens = [], this._lastTokenEndIndex = 0;
1488
+ }
1489
+ balancedBracketSelectors;
1490
+ _emitBinaryTokens;
1491
+ _lineText;
1492
+ _tokens;
1493
+ _binaryTokens;
1494
+ _lastTokenEndIndex;
1495
+ _tokenTypeOverrides;
1496
+ produce(e, t) {
1497
+ this.produceFromScopes(e.contentNameScopesList, t);
1498
+ }
1499
+ produceFromScopes(e, t) {
1500
+ if (this._lastTokenEndIndex >= t) return;
1501
+ if (this._emitBinaryTokens) {
1502
+ let n = e?.tokenAttributes ?? 0, r = !1;
1503
+ if (this.balancedBracketSelectors?.matchesAlways && (r = !0), this._tokenTypeOverrides.length > 0 || this.balancedBracketSelectors && !this.balancedBracketSelectors.matchesAlways && !this.balancedBracketSelectors.matchesNever) {
1504
+ let t = e?.getScopeNames() ?? [];
1505
+ for (let e of this._tokenTypeOverrides) e.matcher(t) && (n = x.set(n, 0, oe(e.type), null, -1, 0, 0));
1506
+ this.balancedBracketSelectors && (r = this.balancedBracketSelectors.match(t));
1507
+ }
1508
+ if (r && (n = x.set(n, 0, 8, r, -1, 0, 0)), this._binaryTokens.length > 0 && this._binaryTokens[this._binaryTokens.length - 1] === n) {
1509
+ this._lastTokenEndIndex = t;
1510
+ return;
1511
+ }
1512
+ this._binaryTokens.push(this._lastTokenEndIndex), this._binaryTokens.push(n), this._lastTokenEndIndex = t;
1513
+ return;
1514
+ }
1515
+ let n = e?.getScopeNames() ?? [];
1516
+ this._tokens.push({
1517
+ startIndex: this._lastTokenEndIndex,
1518
+ endIndex: t,
1519
+ scopes: n
1520
+ }), this._lastTokenEndIndex = t;
1521
+ }
1522
+ getResult(e, t) {
1523
+ return this._tokens.length > 0 && this._tokens[this._tokens.length - 1].startIndex === t - 1 && this._tokens.pop(), this._tokens.length === 0 && (this._lastTokenEndIndex = -1, this.produce(e, t), this._tokens[this._tokens.length - 1].startIndex = 0), this._tokens;
1524
+ }
1525
+ getBinaryResult(e, t) {
1526
+ this._binaryTokens.length > 0 && this._binaryTokens[this._binaryTokens.length - 2] === t - 1 && (this._binaryTokens.pop(), this._binaryTokens.pop()), this._binaryTokens.length === 0 && (this._lastTokenEndIndex = -1, this.produce(e, t), this._binaryTokens[this._binaryTokens.length - 2] = 0);
1527
+ let n = new Uint32Array(this._binaryTokens.length);
1528
+ for (let e = 0, t = this._binaryTokens.length; e < t; e++) n[e] = this._binaryTokens[e];
1529
+ return n;
1530
+ }
1531
+ }, et = class {
1532
+ constructor(e, t) {
1533
+ this._onigLib = t, this._theme = e;
1534
+ }
1535
+ _onigLib;
1536
+ _grammars = /* @__PURE__ */ new Map();
1537
+ _rawGrammars = /* @__PURE__ */ new Map();
1538
+ _injectionGrammars = /* @__PURE__ */ new Map();
1539
+ _theme;
1540
+ dispose() {
1541
+ for (let e of this._grammars.values()) e.dispose();
1542
+ }
1543
+ setTheme(e) {
1544
+ this._theme = e;
1545
+ }
1546
+ getColorMap() {
1547
+ return this._theme.getColorMap();
1548
+ }
1549
+ addGrammar(e, t) {
1550
+ this._rawGrammars.set(e.scopeName, e), t && this._injectionGrammars.set(e.scopeName, t);
1551
+ }
1552
+ lookup(e) {
1553
+ return this._rawGrammars.get(e);
1554
+ }
1555
+ injections(e) {
1556
+ return this._injectionGrammars.get(e);
1557
+ }
1558
+ getDefaults() {
1559
+ return this._theme.getDefaults();
1560
+ }
1561
+ themeMatch(e) {
1562
+ return this._theme.match(e);
1563
+ }
1564
+ grammarForScopeName(e, t, n, r, i) {
1565
+ if (!this._grammars.has(e)) {
1566
+ let a = this._rawGrammars.get(e);
1567
+ if (!a) return null;
1568
+ this._grammars.set(e, Ke(e, a, t, n, r, i, this, this._onigLib));
1569
+ }
1570
+ return this._grammars.get(e);
1571
+ }
1572
+ }, tt = class {
1573
+ _options;
1574
+ _syncRegistry;
1575
+ _ensureGrammarCache;
1576
+ constructor(e) {
1577
+ this._options = e, this._syncRegistry = new et(m.createFromRawTheme(e.theme, e.colorMap), e.onigLib), this._ensureGrammarCache = /* @__PURE__ */ new Map();
1578
+ }
1579
+ dispose() {
1580
+ this._syncRegistry.dispose();
1581
+ }
1582
+ setTheme(e, t) {
1583
+ this._syncRegistry.setTheme(m.createFromRawTheme(e, t));
1584
+ }
1585
+ getColorMap() {
1586
+ return this._syncRegistry.getColorMap();
1587
+ }
1588
+ loadGrammarWithEmbeddedLanguages(e, t, n) {
1589
+ return this.loadGrammarWithConfiguration(e, t, { embeddedLanguages: n });
1590
+ }
1591
+ loadGrammarWithConfiguration(e, t, n) {
1592
+ return this._loadGrammar(e, t, n.embeddedLanguages, n.tokenTypes, new Qe(n.balancedBracketSelectors || [], n.unbalancedBracketSelectors || []));
1593
+ }
1594
+ loadGrammar(e) {
1595
+ return this._loadGrammar(e, 0, null, null, null);
1596
+ }
1597
+ _loadGrammar(e, t, n, r, i) {
1598
+ let a = new pe(this._syncRegistry, e);
1599
+ for (; a.Q.length > 0;) a.Q.map((e) => this._loadSingleGrammar(e.scopeName)), a.processQueue();
1600
+ return this._grammarForScopeName(e, t, n, r, i);
1601
+ }
1602
+ _loadSingleGrammar(e) {
1603
+ this._ensureGrammarCache.has(e) || (this._doLoadSingleGrammar(e), this._ensureGrammarCache.set(e, !0));
1604
+ }
1605
+ _doLoadSingleGrammar(e) {
1606
+ let t = this._options.loadGrammar(e);
1607
+ if (t) {
1608
+ let n = typeof this._options.getInjections == "function" ? this._options.getInjections(e) : void 0;
1609
+ this._syncRegistry.addGrammar(t, n);
1610
+ }
1611
+ }
1612
+ addGrammar(e, t = [], n = 0, r = null) {
1613
+ return this._syncRegistry.addGrammar(e, t), this._grammarForScopeName(e.scopeName, n, r);
1614
+ }
1615
+ _grammarForScopeName(e, t = 0, n = null, r = null, i = null) {
1616
+ return this._syncRegistry.grammarForScopeName(e, t, n, r, i);
1617
+ }
1618
+ }, N = Ze.NULL, P = class extends Error {
1619
+ constructor(e) {
1620
+ super(e), this.name = "ShikiError";
1621
+ }
1622
+ };
1623
+ // node_modules/.pnpm/@shikijs+primitive@4.5.0/node_modules/@shikijs/primitive/dist/index.mjs
1624
+ function F(e, t) {
1625
+ let n = typeof e == "string" ? {} : { ...e.colorReplacements }, r = typeof e == "string" ? e : e.name;
1626
+ for (let [e, i] of Object.entries(t?.colorReplacements || {})) typeof i == "string" ? n[e] = i : e === r && Object.assign(n, i);
1627
+ return n;
1628
+ }
1629
+ function I(e, t) {
1630
+ return e && (t?.[e?.toLowerCase()] || e);
1631
+ }
1632
+ function nt(e) {
1633
+ return Array.isArray(e) ? e : [e];
1634
+ }
1635
+ async function rt(e) {
1636
+ return Promise.resolve(typeof e == "function" ? e() : e).then((e) => e.default || e);
1637
+ }
1638
+ function L(e) {
1639
+ return !e || [
1640
+ "plaintext",
1641
+ "txt",
1642
+ "text",
1643
+ "plain"
1644
+ ].includes(e);
1645
+ }
1646
+ function it(e) {
1647
+ return e === "ansi" || L(e);
1648
+ }
1649
+ function R(e) {
1650
+ return e === "none";
1651
+ }
1652
+ function at(e) {
1653
+ return R(e);
1654
+ }
1655
+ var ot = /(\r?\n)/g;
1656
+ function z(e, t = !1) {
1657
+ if (e.length === 0) return [["", 0]];
1658
+ let n = e.split(ot), r = 0, i = [];
1659
+ for (let e = 0; e < n.length; e += 2) {
1660
+ let a = t ? n[e] + (n[e + 1] || "") : n[e];
1661
+ i.push([a, r]), r += n[e].length, r += n[e + 1]?.length || 0;
1662
+ }
1663
+ return i;
1664
+ }
1665
+ var st = {
1666
+ light: "#333333",
1667
+ dark: "#bbbbbb"
1668
+ }, ct = {
1669
+ light: "#fffffe",
1670
+ dark: "#1e1e1e"
1671
+ }, lt = "__shiki_resolved";
1672
+ function B(e) {
1673
+ if (e?.[lt]) return e;
1674
+ let t = { ...e };
1675
+ t.tokenColors && !t.settings && (t.settings = t.tokenColors, delete t.tokenColors), t.type ||= "dark", t.colorReplacements = { ...t.colorReplacements }, t.settings ||= [];
1676
+ let { bg: n, fg: r } = t;
1677
+ if (!n || !r) {
1678
+ let e = t.settings ? t.settings.find((e) => !e.name && !e.scope) : void 0;
1679
+ e?.settings?.foreground && (r = e.settings.foreground), e?.settings?.background && (n = e.settings.background), !r && t?.colors?.["editor.foreground"] && (r = t.colors["editor.foreground"]), !n && t?.colors?.["editor.background"] && (n = t.colors["editor.background"]), r ||= t.type === "light" ? st.light : st.dark, n ||= t.type === "light" ? ct.light : ct.dark, t.fg = r, t.bg = n;
1680
+ }
1681
+ t.settings[0] && t.settings[0].settings && !t.settings[0].scope || t.settings.unshift({ settings: {
1682
+ foreground: t.fg,
1683
+ background: t.bg
1684
+ } });
1685
+ let i = 0, a = /* @__PURE__ */ new Map();
1686
+ function o(e) {
1687
+ if (a.has(e)) return a.get(e);
1688
+ i += 1;
1689
+ let n = `#${i.toString(16).padStart(8, "0").toLowerCase()}`;
1690
+ return t.colorReplacements?.[`#${n}`] ? o(e) : (a.set(e, n), n);
1691
+ }
1692
+ t.settings = t.settings.map((e) => {
1693
+ let n = e.settings?.foreground && !e.settings.foreground.startsWith("#"), r = e.settings?.background && !e.settings.background.startsWith("#");
1694
+ if (!n && !r) return e;
1695
+ let i = {
1696
+ ...e,
1697
+ settings: { ...e.settings }
1698
+ };
1699
+ if (n) {
1700
+ let n = o(e.settings.foreground);
1701
+ t.colorReplacements[n] = e.settings.foreground, i.settings.foreground = n;
1702
+ }
1703
+ if (r) {
1704
+ let n = o(e.settings.background);
1705
+ t.colorReplacements[n] = e.settings.background, i.settings.background = n;
1706
+ }
1707
+ return i;
1708
+ });
1709
+ for (let e of Object.keys(t.colors || {})) if ((e === "editor.foreground" || e === "editor.background" || e.startsWith("terminal.ansi")) && !t.colors[e]?.startsWith("#")) {
1710
+ let n = o(t.colors[e]);
1711
+ t.colorReplacements[n] = t.colors[e], t.colors[e] = n;
1712
+ }
1713
+ return Object.defineProperty(t, lt, {
1714
+ enumerable: !1,
1715
+ writable: !1,
1716
+ value: !0
1717
+ }), t;
1718
+ }
1719
+ async function ut(e) {
1720
+ return [...new Set((await Promise.all(e.filter((e) => !it(e)).map(async (e) => await rt(e).then((e) => Array.isArray(e) ? e : [e])))).flat())];
1721
+ }
1722
+ async function dt(e) {
1723
+ return (await Promise.all(e.map(async (e) => at(e) ? null : B(await rt(e))))).filter((e) => !!e);
1724
+ }
1725
+ function ft(e, t) {
1726
+ if (!t) return e;
1727
+ if (t[e]) {
1728
+ let n = /* @__PURE__ */ new Set([e]);
1729
+ for (; t[e];) {
1730
+ if (e = t[e], n.has(e)) throw new P(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);
1731
+ n.add(e);
1732
+ }
1733
+ }
1734
+ return e;
1735
+ }
1736
+ var pt = class extends tt {
1737
+ _resolver;
1738
+ _themes;
1739
+ _langs;
1740
+ _alias;
1741
+ _resolvedThemes = /* @__PURE__ */ new Map();
1742
+ _resolvedGrammars = /* @__PURE__ */ new Map();
1743
+ _langMap = /* @__PURE__ */ new Map();
1744
+ _langGraph = /* @__PURE__ */ new Map();
1745
+ _textmateThemeCache = /* @__PURE__ */ new WeakMap();
1746
+ _loadedThemesCache = null;
1747
+ _loadedLanguagesCache = null;
1748
+ constructor(e, t, n, r = {}) {
1749
+ super(e), this._resolver = e, this._themes = t, this._langs = n, this._alias = r, this._themes.map((e) => this.loadTheme(e)), this.loadLanguages(this._langs);
1750
+ }
1751
+ getTheme(e) {
1752
+ return typeof e == "string" ? this._resolvedThemes.get(e) : this.loadTheme(e);
1753
+ }
1754
+ loadTheme(e) {
1755
+ let t = B(e);
1756
+ return t.name && (this._resolvedThemes.set(t.name, t), this._loadedThemesCache = null), t;
1757
+ }
1758
+ getLoadedThemes() {
1759
+ return this._loadedThemesCache ||= [...this._resolvedThemes.keys()], this._loadedThemesCache;
1760
+ }
1761
+ setTheme(e) {
1762
+ let t = this._textmateThemeCache.get(e);
1763
+ t || (t = m.createFromRawTheme(e), this._textmateThemeCache.set(e, t)), this._syncRegistry.setTheme(t);
1764
+ }
1765
+ getGrammar(e) {
1766
+ return e = ft(e, this._alias), this._resolvedGrammars.get(e);
1767
+ }
1768
+ loadLanguage(e) {
1769
+ if (this.getGrammar(e.name)) return;
1770
+ let t = new Set([...this._langMap.values()].filter((t) => t.embeddedLangsLazy?.includes(e.name)));
1771
+ this._resolver.addLanguage(e);
1772
+ let n = {
1773
+ balancedBracketSelectors: e.balancedBracketSelectors || ["*"],
1774
+ unbalancedBracketSelectors: e.unbalancedBracketSelectors || []
1775
+ };
1776
+ this._syncRegistry._rawGrammars.set(e.scopeName, e);
1777
+ let r = this.loadGrammarWithConfiguration(e.scopeName, 1, n);
1778
+ if (r.name = e.name, this._resolvedGrammars.set(e.name, r), e.aliases && e.aliases.forEach((t) => {
1779
+ this._alias[t] = e.name;
1780
+ }), this._loadedLanguagesCache = null, t.size) for (let e of t) this._syncRegistry?._grammars?.get(e.scopeName)?.dispose(), this._resolvedGrammars.delete(e.name), this._loadedLanguagesCache = null, this._syncRegistry?._injectionGrammars?.delete(e.scopeName), this._syncRegistry?._grammars?.delete(e.scopeName), this.loadLanguage(this._langMap.get(e.name));
1781
+ }
1782
+ dispose() {
1783
+ super.dispose(), this._resolvedThemes.clear(), this._resolvedGrammars.clear(), this._langMap.clear(), this._langGraph.clear(), this._loadedThemesCache = null;
1784
+ }
1785
+ loadLanguages(e) {
1786
+ for (let t of e) this.resolveEmbeddedLanguages(t);
1787
+ let t = [...this._langGraph.entries()], n = t.filter(([e, t]) => !t);
1788
+ if (n.length) {
1789
+ let e = t.filter(([e, t]) => t ? (t.embeddedLanguages || t.embeddedLangs)?.some((e) => n.map(([e]) => e).includes(e)) : !1).filter((e) => !n.includes(e));
1790
+ throw new P(`Missing languages ${n.map(([e]) => `\`${e}\``).join(", ")}, required by ${e.map(([e]) => `\`${e}\``).join(", ")}`);
1791
+ }
1792
+ for (let [e, n] of t) this._resolver.addLanguage(n);
1793
+ for (let [e, n] of t) this.loadLanguage(n);
1794
+ }
1795
+ getLoadedLanguages() {
1796
+ return this._loadedLanguagesCache ||= [.../* @__PURE__ */ new Set([...this._resolvedGrammars.keys(), ...Object.keys(this._alias)])], this._loadedLanguagesCache;
1797
+ }
1798
+ resolveEmbeddedLanguages(e) {
1799
+ this._langMap.set(e.name, e), this._langGraph.set(e.name, e);
1800
+ let t = e.embeddedLanguages ?? e.embeddedLangs;
1801
+ if (t) for (let e of t) this._langGraph.set(e, this._langMap.get(e));
1802
+ }
1803
+ }, mt = class {
1804
+ _langs = /* @__PURE__ */ new Map();
1805
+ _scopeToLang = /* @__PURE__ */ new Map();
1806
+ _injections = /* @__PURE__ */ new Map();
1807
+ _onigLib;
1808
+ constructor(e, t) {
1809
+ this._onigLib = {
1810
+ createOnigScanner: (t) => e.createScanner(t),
1811
+ createOnigString: (t) => e.createString(t)
1812
+ }, t.forEach((e) => this.addLanguage(e));
1813
+ }
1814
+ get onigLib() {
1815
+ return this._onigLib;
1816
+ }
1817
+ getLangRegistration(e) {
1818
+ return this._langs.get(e);
1819
+ }
1820
+ loadGrammar(e) {
1821
+ return this._scopeToLang.get(e);
1822
+ }
1823
+ addLanguage(e) {
1824
+ this._langs.set(e.name, e), e.aliases && e.aliases.forEach((t) => {
1825
+ this._langs.set(t, e);
1826
+ }), this._scopeToLang.set(e.scopeName, e), e.injectTo && e.injectTo.forEach((t) => {
1827
+ this._injections.get(t) || this._injections.set(t, []), this._injections.get(t).includes(e.scopeName) || this._injections.get(t).push(e.scopeName);
1828
+ });
1829
+ }
1830
+ getInjections(e) {
1831
+ let t = e.split("."), n = [];
1832
+ for (let e = 1; e <= t.length; e++) {
1833
+ let r = t.slice(0, e).join(".");
1834
+ n = [...n, ...this._injections.get(r) || []];
1835
+ }
1836
+ return n;
1837
+ }
1838
+ }, V = 0;
1839
+ function H(e) {
1840
+ V += 1, e.warnings !== !1 && V >= 10 && V % 10 == 0 && console.warn(`[Shiki] ${V} instances have been created. Shiki is supposed to be used as a singleton, consider refactoring your code to cache your highlighter instance; Or call \`highlighter.dispose()\` to release unused instances.`);
1841
+ let t = !1;
1842
+ if (!e.engine) throw new P("`engine` option is required for synchronous mode");
1843
+ let n = (e.langs || []).flat(1), r = (e.themes || []).flat(1).map(B), i = new pt(new mt(e.engine, n), r, n, e.langAlias), a;
1844
+ function o(t) {
1845
+ return ft(t, e.langAlias);
1846
+ }
1847
+ function s(e) {
1848
+ g();
1849
+ let t = i.getGrammar(typeof e == "string" ? e : e.name);
1850
+ if (!t) throw new P(`Language \`${e}\` not found, you may need to load it first`);
1851
+ return t;
1852
+ }
1853
+ function c(e) {
1854
+ if (e === "none") return {
1855
+ bg: "",
1856
+ fg: "",
1857
+ name: "none",
1858
+ settings: [],
1859
+ type: "dark"
1860
+ };
1861
+ g();
1862
+ let t = i.getTheme(e);
1863
+ if (!t) throw new P(`Theme \`${e}\` not found, you may need to load it first`);
1864
+ return t;
1865
+ }
1866
+ function l(e) {
1867
+ g();
1868
+ let t = c(e);
1869
+ return a !== e && (i.setTheme(t), a = e), {
1870
+ theme: t,
1871
+ colorMap: i.getColorMap()
1872
+ };
1873
+ }
1874
+ function u() {
1875
+ return g(), i.getLoadedThemes();
1876
+ }
1877
+ function d() {
1878
+ return g(), i.getLoadedLanguages();
1879
+ }
1880
+ function f(...e) {
1881
+ g(), i.loadLanguages(e.flat(1));
1882
+ }
1883
+ async function p(...e) {
1884
+ return f(await ut(e));
1885
+ }
1886
+ function m(...e) {
1887
+ g();
1888
+ for (let t of e.flat(1)) i.loadTheme(t);
1889
+ }
1890
+ async function h(...e) {
1891
+ return g(), m(await dt(e));
1892
+ }
1893
+ function g() {
1894
+ if (t) throw new P("Shiki instance has been disposed");
1895
+ }
1896
+ function _() {
1897
+ t || (t = !0, i.dispose(), --V);
1898
+ }
1899
+ return {
1900
+ setTheme: l,
1901
+ getTheme: c,
1902
+ getLanguage: s,
1903
+ getLoadedThemes: u,
1904
+ getLoadedLanguages: d,
1905
+ resolveLangAlias: o,
1906
+ loadLanguage: p,
1907
+ loadLanguageSync: f,
1908
+ loadTheme: h,
1909
+ loadThemeSync: m,
1910
+ dispose: _,
1911
+ [Symbol.dispose]: _
1912
+ };
1913
+ }
1914
+ var ht = H;
1915
+ async function gt(e) {
1916
+ e.engine || console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");
1917
+ let [t, n, r] = await Promise.all([
1918
+ dt(e.themes || []),
1919
+ ut(e.langs || []),
1920
+ e.engine
1921
+ ]);
1922
+ return H({
1923
+ ...e,
1924
+ themes: t,
1925
+ langs: n,
1926
+ engine: r
1927
+ });
1928
+ }
1929
+ var _t = gt, vt = /* @__PURE__ */ new WeakMap();
1930
+ function U(e, t) {
1931
+ vt.set(e, t);
1932
+ }
1933
+ function W(e) {
1934
+ return vt.get(e);
1935
+ }
1936
+ var G = class e {
1937
+ _stacks = {};
1938
+ lang;
1939
+ get themes() {
1940
+ return Object.keys(this._stacks);
1941
+ }
1942
+ get theme() {
1943
+ return this.themes[0];
1944
+ }
1945
+ get _stack() {
1946
+ return this._stacks[this.theme];
1947
+ }
1948
+ static initial(t, n) {
1949
+ return new e(Object.fromEntries(nt(n).map((e) => [e, N])), t);
1950
+ }
1951
+ constructor(...e) {
1952
+ if (e.length === 2) {
1953
+ let [t, n] = e;
1954
+ this.lang = n, this._stacks = t;
1955
+ } else {
1956
+ let [t, n, r] = e;
1957
+ this.lang = n, this._stacks = { [r]: t };
1958
+ }
1959
+ }
1960
+ getInternalStack(e = this.theme) {
1961
+ return this._stacks[e];
1962
+ }
1963
+ getScopes(e = this.theme) {
1964
+ return yt(this._stacks[e]);
1965
+ }
1966
+ toJSON() {
1967
+ return {
1968
+ lang: this.lang,
1969
+ theme: this.theme,
1970
+ themes: this.themes,
1971
+ scopes: this.getScopes()
1972
+ };
1973
+ }
1974
+ };
1975
+ function yt(e) {
1976
+ let t = [], n = /* @__PURE__ */ new Set();
1977
+ function r(e) {
1978
+ if (n.has(e)) return;
1979
+ n.add(e);
1980
+ let i = e?.nameScopesList?.scopeName;
1981
+ i && t.push(i), e.parent && r(e.parent);
1982
+ }
1983
+ return r(e), t;
1984
+ }
1985
+ function bt(e, t) {
1986
+ if (!(e instanceof G)) throw new P("Invalid grammar state");
1987
+ return e.getInternalStack(t);
1988
+ }
1989
+ var xt = /,/, St = / /;
1990
+ function Ct(e, t, n = {}) {
1991
+ let { theme: r = e.getLoadedThemes()[0] } = n;
1992
+ if (L(e.resolveLangAlias(n.lang || "text")) || R(r)) return z(t).map((e) => [{
1993
+ content: e[0],
1994
+ offset: e[1]
1995
+ }]);
1996
+ let { theme: i, colorMap: a } = e.setTheme(r), o = e.getLanguage(n.lang || "text");
1997
+ if (n.grammarState) {
1998
+ if (n.grammarState.lang !== o.name) throw new P(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${o.name}"`);
1999
+ if (!n.grammarState.themes.includes(i.name)) throw new P(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`);
2000
+ }
2001
+ return Tt(t, o, i, a, n);
2002
+ }
2003
+ function wt(...e) {
2004
+ if (e.length === 2) return W(e[1]);
2005
+ let [t, n, r = {}] = e, { lang: i = "text", theme: a = t.getLoadedThemes()[0] } = r;
2006
+ if (L(i) || R(a)) throw new P("Plain language does not have grammar state");
2007
+ if (i === "ansi") throw new P("ANSI language does not have grammar state");
2008
+ let { theme: o, colorMap: s } = t.setTheme(a), c = t.getLanguage(i);
2009
+ return new G(Et(n, c, o, s, r).stateStack, c.name, o.name);
2010
+ }
2011
+ function Tt(e, t, n, r, i) {
2012
+ let a = Et(e, t, n, r, i), o = new G(a.stateStack, t.name, n.name);
2013
+ return U(a.tokens, o), a.tokens;
2014
+ }
2015
+ function Et(e, t, n, r, i) {
2016
+ let a = F(n, i), { tokenizeMaxLineLength: o = 0, tokenizeTimeLimit: s = 500, includeExplanation: c = !1 } = i, l = z(e), u = i.grammarState ? bt(i.grammarState, n.name) ?? N : i.grammarContextCode == null ? N : Et(i.grammarContextCode, t, n, r, {
2017
+ ...i,
2018
+ grammarState: void 0,
2019
+ grammarContextCode: void 0
2020
+ }).stateStack, d = [], f = [];
2021
+ for (let e = 0, i = l.length; e < i; e++) {
2022
+ let [i, p] = l[e];
2023
+ if (i === "") {
2024
+ d = [], f.push([]);
2025
+ continue;
2026
+ }
2027
+ if (o > 0 && i.length >= o) {
2028
+ d = [], f.push([{
2029
+ content: i,
2030
+ offset: p,
2031
+ color: "",
2032
+ fontStyle: 0
2033
+ }]);
2034
+ continue;
2035
+ }
2036
+ let m, h, g;
2037
+ c && c !== "tokenType" && (m = t.tokenizeLine(i, u, s), h = m.tokens, g = 0);
2038
+ let _ = t.tokenizeLine2(i, u, s), v = _.tokens.length / 2;
2039
+ for (let e = 0; e < v; e++) {
2040
+ let t = _.tokens[2 * e], o = e + 1 < v ? _.tokens[2 * e + 2] : i.length;
2041
+ if (t === o) continue;
2042
+ let s = _.tokens[2 * e + 1], l = I(r[x.getForeground(s)], a), u = x.getFontStyle(s), f = {
2043
+ content: i.substring(t, o),
2044
+ offset: p + t,
2045
+ color: l,
2046
+ fontStyle: u
2047
+ };
2048
+ if (c === "tokenType") f.type = x.getTokenType(s);
2049
+ else if (c) {
2050
+ let e = [];
2051
+ if (c !== "scopeName") for (let t of n.settings) {
2052
+ let n;
2053
+ switch (typeof t.scope) {
2054
+ case "string":
2055
+ n = t.scope.split(xt).map((e) => e.trim());
2056
+ break;
2057
+ case "object":
2058
+ n = t.scope;
2059
+ break;
2060
+ default: continue;
2061
+ }
2062
+ e.push({
2063
+ settings: t,
2064
+ selectors: n.map((e) => e.split(St))
2065
+ });
2066
+ }
2067
+ f.explanation = [];
2068
+ let r = 0;
2069
+ for (; t + r < o;) {
2070
+ let t = h[g], n = i.substring(t.startIndex, t.endIndex);
2071
+ r += n.length, f.explanation.push({
2072
+ content: n,
2073
+ scopes: c === "scopeName" ? Dt(t.scopes) : Ot(e, t.scopes)
2074
+ }), g += 1;
2075
+ }
2076
+ }
2077
+ d.push(f);
2078
+ }
2079
+ f.push(d), d = [], u = _.ruleStack;
2080
+ }
2081
+ return {
2082
+ tokens: f,
2083
+ stateStack: u
2084
+ };
2085
+ }
2086
+ function Dt(e) {
2087
+ return e.map((e) => ({ scopeName: e }));
2088
+ }
2089
+ function Ot(e, t) {
2090
+ let n = [];
2091
+ for (let r = 0, i = t.length; r < i; r++) {
2092
+ let i = t[r];
2093
+ n[r] = {
2094
+ scopeName: i,
2095
+ themeMatches: jt(e, i, t.slice(0, r))
2096
+ };
2097
+ }
2098
+ return n;
2099
+ }
2100
+ function kt(e, t) {
2101
+ return e === t || t.substring(0, e.length) === e && t[e.length] === ".";
2102
+ }
2103
+ function At(e, t, n) {
2104
+ if (!kt(e.at(-1), t)) return !1;
2105
+ let r = e.length - 2, i = n.length - 1;
2106
+ for (; r >= 0 && i >= 0;) kt(e[r], n[i]) && --r, --i;
2107
+ return r === -1;
2108
+ }
2109
+ function jt(e, t, n) {
2110
+ let r = [];
2111
+ for (let { selectors: i, settings: a } of e) for (let e of i) if (At(e, t, n)) {
2112
+ r.push(a);
2113
+ break;
2114
+ }
2115
+ return r;
2116
+ }
2117
+ function K(e, t, n, r = Ct) {
2118
+ let i = Object.entries(n.themes).filter((e) => e[1]).map((e) => ({
2119
+ color: e[0],
2120
+ theme: e[1]
2121
+ })), a = i.map((i) => {
2122
+ let a = r(e, t, {
2123
+ ...n,
2124
+ theme: i.theme
2125
+ });
2126
+ return {
2127
+ tokens: a,
2128
+ state: W(a),
2129
+ theme: typeof i.theme == "string" ? i.theme : i.theme.name
2130
+ };
2131
+ }), o = Mt(...a.map((e) => e.tokens)), s = o[0].map((e, t) => e.map((e, r) => {
2132
+ let a = {
2133
+ content: e.content,
2134
+ variants: {},
2135
+ offset: e.offset
2136
+ };
2137
+ return "includeExplanation" in n && n.includeExplanation && (a.explanation = e.explanation), o.forEach((e, n) => {
2138
+ let { content: o, explanation: s, offset: c, ...l } = e[t][r];
2139
+ a.variants[i[n].color] = l;
2140
+ }), a;
2141
+ })), c = a[0].state ? new G(Object.fromEntries(a.map((e) => [e.theme, e.state?.getInternalStack(e.theme)])), a[0].state.lang) : void 0;
2142
+ return c && U(s, c), s;
2143
+ }
2144
+ function Mt(...e) {
2145
+ let t = e.map(() => []), n = e.length;
2146
+ for (let r = 0; r < e[0].length; r++) {
2147
+ let i = e.map((e) => e[r]), a = t.map(() => []);
2148
+ t.forEach((e, t) => e.push(a[t]));
2149
+ let o = i.map(() => 0), s = i.map((e) => e[0]);
2150
+ for (; s.every((e) => e);) {
2151
+ let e = Math.min(...s.map((e) => e.content.length));
2152
+ for (let t = 0; t < n; t++) {
2153
+ let n = s[t];
2154
+ n.content.length === e ? (a[t].push(n), o[t] += 1, s[t] = i[t][o[t]]) : (a[t].push({
2155
+ ...n,
2156
+ content: n.content.slice(0, e)
2157
+ }), s[t] = {
2158
+ ...n,
2159
+ content: n.content.slice(e),
2160
+ offset: n.offset + e
2161
+ });
2162
+ }
2163
+ }
2164
+ }
2165
+ return t;
2166
+ }
2167
+ // node_modules/.pnpm/@shikijs+core@4.5.0/node_modules/@shikijs/core/dist/index.mjs
2168
+ var Nt = /\s+/g;
2169
+ function Pt(e, t) {
2170
+ if (!t) return e;
2171
+ e.properties ||= {}, e.properties.class ||= [], typeof e.properties.class == "string" && (e.properties.class = e.properties.class.split(Nt)), Array.isArray(e.properties.class) || (e.properties.class = []);
2172
+ let n = Array.isArray(t) ? t : t.split(Nt);
2173
+ for (let t of n) t && !e.properties.class.includes(t) && e.properties.class.push(t);
2174
+ return e;
2175
+ }
2176
+ var Ft = /:?lang=["']([^"']+)["']/g, It = /(?:```|~~~)([\w-]+)/g, Lt = /\\begin\{([\w-]+)\}/g, Rt = /<script\s+(?:type|lang)=["']([^"']+)["']/gi, zt = /^\s*---\r?\n[\s\S]*?\r?\n---(?:\r?\n|\s*$)/;
2177
+ function Bt(e) {
2178
+ let t = z(e, !0).map(([e]) => e);
2179
+ function n(n) {
2180
+ if (n === e.length) return {
2181
+ line: t.length - 1,
2182
+ character: t.at(-1).length
2183
+ };
2184
+ let r = n, i = 0;
2185
+ for (let e of t) {
2186
+ if (r < e.length) break;
2187
+ r -= e.length, i++;
2188
+ }
2189
+ return {
2190
+ line: i,
2191
+ character: r
2192
+ };
2193
+ }
2194
+ function r(e, n) {
2195
+ let r = 0;
2196
+ for (let n = 0; n < e; n++) r += t[n].length;
2197
+ return r += n, r;
2198
+ }
2199
+ return {
2200
+ lines: t,
2201
+ indexToPos: n,
2202
+ posToIndex: r
2203
+ };
2204
+ }
2205
+ function Vt(e, t, n) {
2206
+ let r = /* @__PURE__ */ new Set();
2207
+ for (let t of e.matchAll(Ft)) {
2208
+ let e = t[1].toLowerCase().trim();
2209
+ e && r.add(e);
2210
+ }
2211
+ for (let t of e.matchAll(It)) {
2212
+ let e = t[1].toLowerCase().trim();
2213
+ e && r.add(e);
2214
+ }
2215
+ for (let t of e.matchAll(Lt)) {
2216
+ let e = t[1].toLowerCase().trim();
2217
+ e && r.add(e);
2218
+ }
2219
+ for (let t of e.matchAll(Rt)) {
2220
+ let e = t[1].toLowerCase().trim(), n = e.includes("/") ? e.split("/").pop() : e;
2221
+ n && r.add(n);
2222
+ }
2223
+ if (zt.test(e) && r.add("yaml"), !n) return [...r];
2224
+ let i = n.getBundledLanguages();
2225
+ return [...r].filter((e) => e && i[e]);
2226
+ }
2227
+ var Ht = ["color", "background-color"];
2228
+ function Ut(e, t) {
2229
+ let n = 0, r = [];
2230
+ for (let i of t) i > n && r.push({
2231
+ ...e,
2232
+ content: e.content.slice(n, i),
2233
+ offset: e.offset + n
2234
+ }), n = i;
2235
+ return n < e.content.length && r.push({
2236
+ ...e,
2237
+ content: e.content.slice(n),
2238
+ offset: e.offset + n
2239
+ }), r;
2240
+ }
2241
+ function Wt(e, t) {
2242
+ let n = 0, r = e.length;
2243
+ for (; n < r;) {
2244
+ let i = n + (r - n >> 1);
2245
+ e[i] <= t ? n = i + 1 : r = i;
2246
+ }
2247
+ return n;
2248
+ }
2249
+ function Gt(e, t) {
2250
+ let n = [...t instanceof Set ? t : new Set(t)].sort((e, t) => e - t);
2251
+ return n.length ? e.map((e) => e.flatMap((e) => {
2252
+ let t = e.offset + e.content.length, r = Wt(n, e.offset), i = r;
2253
+ for (; i < n.length && n[i] < t;) i++;
2254
+ if (r === i) return e;
2255
+ let a = n.slice(r, i);
2256
+ for (let t = 0; t < a.length; t++) a[t] -= e.offset;
2257
+ return Ut(e, a);
2258
+ })) : e;
2259
+ }
2260
+ function Kt(e, t, n, r, i = "css-vars") {
2261
+ let a = {
2262
+ content: e.content,
2263
+ explanation: e.explanation,
2264
+ offset: e.offset
2265
+ }, o = t.map((t) => q(e.variants[t])), s = new Set(o.flatMap((e) => Object.keys(e))), c = {}, l = (e, r) => {
2266
+ let i = r === "color" ? "" : r === "background-color" ? "-bg" : `-${r}`;
2267
+ return n + t[e] + (r === "color" ? "" : i);
2268
+ };
2269
+ return o.forEach((e, n) => {
2270
+ for (let a of s) {
2271
+ let s = e[a] || "inherit";
2272
+ if (n === 0 && r && Ht.includes(a)) {
2273
+ if (r === "light-dark()" && o.length > 1) {
2274
+ let e = t.findIndex((e) => e === "light"), r = t.findIndex((e) => e === "dark");
2275
+ if (e === -1 || r === -1) throw new P("When using `defaultColor: \"light-dark()\"`, you must provide both `light` and `dark` themes");
2276
+ let u = o[e][a] || "inherit", d = o[r][a] || "inherit";
2277
+ c[a] = `light-dark(${u}, ${d})`, i === "css-vars" && (c[l(n, a)] = s);
2278
+ } else c[a] = s;
2279
+ } else i === "css-vars" && (c[l(n, a)] = s);
2280
+ }
2281
+ }), a.htmlStyle = c, a;
2282
+ }
2283
+ function q(e) {
2284
+ let t = {};
2285
+ if (e.color && (t.color = e.color), e.bgColor && (t["background-color"] = e.bgColor), e.fontStyle) {
2286
+ e.fontStyle & y.Italic && (t["font-style"] = "italic"), e.fontStyle & y.Bold && (t["font-weight"] = "bold");
2287
+ let n = [];
2288
+ e.fontStyle & y.Underline && n.push("underline"), e.fontStyle & y.Strikethrough && n.push("line-through"), n.length && (t["text-decoration"] = n.join(" "));
2289
+ }
2290
+ return t;
2291
+ }
2292
+ function J(e) {
2293
+ return typeof e == "string" ? e : Object.entries(e).map(([e, t]) => `${e}:${t}`).join(";");
2294
+ }
2295
+ function qt() {
2296
+ let e = /* @__PURE__ */ new WeakMap();
2297
+ function t(t) {
2298
+ if (!e.has(t.meta)) {
2299
+ let n = Bt(t.source);
2300
+ function r(e) {
2301
+ if (typeof e == "number") {
2302
+ if (e < 0 || e > t.source.length) throw new P(`Invalid decoration offset: ${e}. Code length: ${t.source.length}`);
2303
+ return {
2304
+ ...n.indexToPos(e),
2305
+ offset: e
2306
+ };
2307
+ }
2308
+ {
2309
+ let t = n.lines[e.line];
2310
+ if (t === void 0) throw new P(`Invalid decoration position ${JSON.stringify(e)}. Lines length: ${n.lines.length}`);
2311
+ let r = e.character;
2312
+ if (r < 0 && (r = t.length + r), r < 0 || r > t.length) throw new P(`Invalid decoration position ${JSON.stringify(e)}. Line ${e.line} length: ${t.length}`);
2313
+ return {
2314
+ ...e,
2315
+ character: r,
2316
+ offset: n.posToIndex(e.line, r)
2317
+ };
2318
+ }
2319
+ }
2320
+ let i = (t.options.decorations || []).map((e) => ({
2321
+ ...e,
2322
+ start: r(e.start),
2323
+ end: r(e.end)
2324
+ }));
2325
+ Jt(i), e.set(t.meta, {
2326
+ decorations: i,
2327
+ converter: n,
2328
+ source: t.source
2329
+ });
2330
+ }
2331
+ return e.get(t.meta);
2332
+ }
2333
+ return {
2334
+ name: "shiki:decorations",
2335
+ tokens(e) {
2336
+ if (this.options.decorations?.length) return Gt(e, t(this).decorations.flatMap((e) => [e.start.offset, e.end.offset]));
2337
+ },
2338
+ code(e) {
2339
+ if (!this.options.decorations?.length) return;
2340
+ let n = t(this), r = [...e.children].filter((e) => e.type === "element" && e.tagName === "span");
2341
+ if (r.length !== n.converter.lines.length) throw new P(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);
2342
+ function i(e, t, n, i) {
2343
+ let a = r[e], s = "", c = -1, l = -1;
2344
+ if (t === 0 && (c = 0), n === 0 && (l = 0), n === Infinity && (l = a.children.length), c === -1 || l === -1) for (let e = 0; e < a.children.length; e++) s += Yt(a.children[e]), c === -1 && s.length === t && (c = e + 1), l === -1 && s.length === n && (l = e + 1);
2345
+ if (c === -1) throw new P(`Failed to find start index for decoration ${JSON.stringify(i.start)}`);
2346
+ if (l === -1) throw new P(`Failed to find end index for decoration ${JSON.stringify(i.end)}`);
2347
+ let u = a.children.slice(c, l);
2348
+ if (!i.alwaysWrap && u.length === a.children.length) o(a, i, "line");
2349
+ else if (!i.alwaysWrap && u.length === 1 && u[0].type === "element") o(u[0], i, "token");
2350
+ else {
2351
+ let e = {
2352
+ type: "element",
2353
+ tagName: "span",
2354
+ properties: {},
2355
+ children: u
2356
+ };
2357
+ o(e, i, "wrapper"), a.children.splice(c, u.length, e);
2358
+ }
2359
+ }
2360
+ function a(e, t) {
2361
+ r[e] = o(r[e], t, "line");
2362
+ }
2363
+ function o(e, t, n) {
2364
+ let r = t.properties || {}, i = t.transform || ((e) => e);
2365
+ return e.tagName = t.tagName || "span", e.properties = {
2366
+ ...e.properties,
2367
+ ...r,
2368
+ class: e.properties.class
2369
+ }, t.properties?.class && Pt(e, t.properties.class), e = i(e, n) || e, e;
2370
+ }
2371
+ let s = [], c = n.decorations.sort((e, t) => t.start.offset - e.start.offset || e.end.offset - t.end.offset);
2372
+ for (let e of c) {
2373
+ let { start: t, end: n } = e;
2374
+ if (t.line === n.line) i(t.line, t.character, n.character, e);
2375
+ else if (t.line < n.line) {
2376
+ i(t.line, t.character, Infinity, e);
2377
+ for (let r = t.line + 1; r < n.line; r++) s.unshift(() => a(r, e));
2378
+ i(n.line, 0, n.character, e);
2379
+ }
2380
+ }
2381
+ s.forEach((e) => e());
2382
+ }
2383
+ };
2384
+ }
2385
+ function Jt(e) {
2386
+ for (let t = 0; t < e.length; t++) {
2387
+ let n = e[t];
2388
+ if (n.start.offset > n.end.offset) throw new P(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);
2389
+ for (let r = t + 1; r < e.length; r++) {
2390
+ let t = e[r], i = n.start.offset <= t.start.offset && t.start.offset < n.end.offset, a = n.start.offset < t.end.offset && t.end.offset <= n.end.offset, o = t.start.offset <= n.start.offset && n.start.offset < t.end.offset, s = t.start.offset < n.end.offset && n.end.offset <= t.end.offset;
2391
+ if (i || a || o || s) {
2392
+ if (i && a || o && s || o && n.start.offset === n.end.offset || a && t.start.offset === t.end.offset) continue;
2393
+ throw new P(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(t.start)} intersect.`);
2394
+ }
2395
+ }
2396
+ }
2397
+ }
2398
+ function Yt(e) {
2399
+ return e.type === "text" ? e.value : e.type === "element" ? e.children.map(Yt).join("") : "";
2400
+ }
2401
+ var Xt = [/* @__PURE__ */ qt()];
2402
+ function Y(e) {
2403
+ let t = Zt(e.transformers || []);
2404
+ return [
2405
+ ...t.pre,
2406
+ ...t.normal,
2407
+ ...t.post,
2408
+ ...Xt
2409
+ ];
2410
+ }
2411
+ function Zt(e) {
2412
+ let t = [], n = [], r = [];
2413
+ for (let i of e) switch (i.enforce) {
2414
+ case "pre":
2415
+ t.push(i);
2416
+ break;
2417
+ case "post":
2418
+ n.push(i);
2419
+ break;
2420
+ default: r.push(i);
2421
+ }
2422
+ return {
2423
+ pre: t,
2424
+ post: n,
2425
+ normal: r
2426
+ };
2427
+ }
2428
+ var X = [
2429
+ "black",
2430
+ "red",
2431
+ "green",
2432
+ "yellow",
2433
+ "blue",
2434
+ "magenta",
2435
+ "cyan",
2436
+ "white",
2437
+ "brightBlack",
2438
+ "brightRed",
2439
+ "brightGreen",
2440
+ "brightYellow",
2441
+ "brightBlue",
2442
+ "brightMagenta",
2443
+ "brightCyan",
2444
+ "brightWhite"
2445
+ ], Qt = {
2446
+ 1: "bold",
2447
+ 2: "dim",
2448
+ 3: "italic",
2449
+ 4: "underline",
2450
+ 7: "reverse",
2451
+ 8: "hidden",
2452
+ 9: "strikethrough"
2453
+ };
2454
+ function $t(e, t) {
2455
+ let n = e.indexOf("\x1B", t);
2456
+ if (n !== -1 && e[n + 1] === "[") {
2457
+ let t = e.indexOf("m", n);
2458
+ if (t !== -1) return {
2459
+ sequence: e.substring(n + 2, t).split(";"),
2460
+ startPosition: n,
2461
+ position: t + 1
2462
+ };
2463
+ }
2464
+ return { position: e.length };
2465
+ }
2466
+ function en(e) {
2467
+ let t = e.shift();
2468
+ if (t === "2") {
2469
+ let t = e.splice(0, 3).map((e) => Number.parseInt(e));
2470
+ return t.length !== 3 || t.some((e) => Number.isNaN(e)) ? void 0 : {
2471
+ type: "rgb",
2472
+ rgb: t
2473
+ };
2474
+ }
2475
+ if (t === "5") {
2476
+ let t = e.shift();
2477
+ if (t) return {
2478
+ type: "table",
2479
+ index: Number(t)
2480
+ };
2481
+ }
2482
+ }
2483
+ function tn(e) {
2484
+ let t = [];
2485
+ for (; e.length > 0;) {
2486
+ let n = e.shift();
2487
+ if (!n) continue;
2488
+ let r = Number.parseInt(n);
2489
+ if (!Number.isNaN(r)) {
2490
+ if (r === 0) t.push({ type: "resetAll" });
2491
+ else if (r <= 9) Qt[r] && t.push({
2492
+ type: "setDecoration",
2493
+ value: Qt[r]
2494
+ });
2495
+ else if (r <= 29) {
2496
+ let e = Qt[r - 20];
2497
+ e && (t.push({
2498
+ type: "resetDecoration",
2499
+ value: e
2500
+ }), e === "dim" && t.push({
2501
+ type: "resetDecoration",
2502
+ value: "bold"
2503
+ }));
2504
+ } else if (r <= 37) t.push({
2505
+ type: "setForegroundColor",
2506
+ value: {
2507
+ type: "named",
2508
+ name: X[r - 30]
2509
+ }
2510
+ });
2511
+ else if (r === 38) {
2512
+ let n = en(e);
2513
+ n && t.push({
2514
+ type: "setForegroundColor",
2515
+ value: n
2516
+ });
2517
+ } else if (r === 39) t.push({ type: "resetForegroundColor" });
2518
+ else if (r <= 47) t.push({
2519
+ type: "setBackgroundColor",
2520
+ value: {
2521
+ type: "named",
2522
+ name: X[r - 40]
2523
+ }
2524
+ });
2525
+ else if (r === 48) {
2526
+ let n = en(e);
2527
+ n && t.push({
2528
+ type: "setBackgroundColor",
2529
+ value: n
2530
+ });
2531
+ } else r === 49 ? t.push({ type: "resetBackgroundColor" }) : r === 53 ? t.push({
2532
+ type: "setDecoration",
2533
+ value: "overline"
2534
+ }) : r === 55 ? t.push({
2535
+ type: "resetDecoration",
2536
+ value: "overline"
2537
+ }) : r >= 90 && r <= 97 ? t.push({
2538
+ type: "setForegroundColor",
2539
+ value: {
2540
+ type: "named",
2541
+ name: X[r - 90 + 8]
2542
+ }
2543
+ }) : r >= 100 && r <= 107 && t.push({
2544
+ type: "setBackgroundColor",
2545
+ value: {
2546
+ type: "named",
2547
+ name: X[r - 100 + 8]
2548
+ }
2549
+ });
2550
+ }
2551
+ }
2552
+ return t;
2553
+ }
2554
+ function nn() {
2555
+ let e = null, t = null, n = /* @__PURE__ */ new Set();
2556
+ return { parse(r) {
2557
+ let i = [], a = 0;
2558
+ do {
2559
+ let o = $t(r, a), s = o.sequence ? r.substring(a, o.startPosition) : r.substring(a);
2560
+ if (s.length > 0 && i.push({
2561
+ value: s,
2562
+ foreground: e,
2563
+ background: t,
2564
+ decorations: new Set(n)
2565
+ }), o.sequence) {
2566
+ let r = tn(o.sequence);
2567
+ for (let i of r) i.type === "resetAll" ? (e = null, t = null, n.clear()) : i.type === "resetForegroundColor" ? e = null : i.type === "resetBackgroundColor" ? t = null : i.type === "resetDecoration" && n.delete(i.value);
2568
+ for (let i of r) i.type === "setForegroundColor" ? e = i.value : i.type === "setBackgroundColor" ? t = i.value : i.type === "setDecoration" && n.add(i.value);
2569
+ }
2570
+ a = o.position;
2571
+ } while (a < r.length);
2572
+ return i;
2573
+ } };
2574
+ }
2575
+ var rn = {
2576
+ black: "#000000",
2577
+ red: "#bb0000",
2578
+ green: "#00bb00",
2579
+ yellow: "#bbbb00",
2580
+ blue: "#0000bb",
2581
+ magenta: "#ff00ff",
2582
+ cyan: "#00bbbb",
2583
+ white: "#eeeeee",
2584
+ brightBlack: "#555555",
2585
+ brightRed: "#ff5555",
2586
+ brightGreen: "#00ff00",
2587
+ brightYellow: "#ffff55",
2588
+ brightBlue: "#5555ff",
2589
+ brightMagenta: "#ff55ff",
2590
+ brightCyan: "#55ffff",
2591
+ brightWhite: "#ffffff"
2592
+ };
2593
+ function an(e = rn) {
2594
+ function t(t) {
2595
+ return e[t];
2596
+ }
2597
+ function n(e) {
2598
+ return `#${e.map((e) => Math.max(0, Math.min(e, 255)).toString(16).padStart(2, "0")).join("")}`;
2599
+ }
2600
+ let r;
2601
+ function i() {
2602
+ if (r) return r;
2603
+ r = [];
2604
+ for (let e = 0; e < X.length; e++) r.push(t(X[e]));
2605
+ let e = [
2606
+ 0,
2607
+ 95,
2608
+ 135,
2609
+ 175,
2610
+ 215,
2611
+ 255
2612
+ ];
2613
+ for (let t = 0; t < 6; t++) for (let i = 0; i < 6; i++) for (let a = 0; a < 6; a++) r.push(n([
2614
+ e[t],
2615
+ e[i],
2616
+ e[a]
2617
+ ]));
2618
+ let i = 8;
2619
+ for (let e = 0; e < 24; e++, i += 10) r.push(n([
2620
+ i,
2621
+ i,
2622
+ i
2623
+ ]));
2624
+ return r;
2625
+ }
2626
+ function a(e) {
2627
+ return i()[e];
2628
+ }
2629
+ function o(e) {
2630
+ switch (e.type) {
2631
+ case "named": return t(e.name);
2632
+ case "rgb": return n(e.rgb);
2633
+ case "table": return a(e.index);
2634
+ }
2635
+ }
2636
+ return { value: o };
2637
+ }
2638
+ var on = /#([0-9a-f]{3,8})/i, sn = /var\((--[\w-]+-ansi-[\w-]+)\)/, cn = {
2639
+ black: "#000000",
2640
+ red: "#cd3131",
2641
+ green: "#0DBC79",
2642
+ yellow: "#E5E510",
2643
+ blue: "#2472C8",
2644
+ magenta: "#BC3FBC",
2645
+ cyan: "#11A8CD",
2646
+ white: "#E5E5E5",
2647
+ brightBlack: "#666666",
2648
+ brightRed: "#F14C4C",
2649
+ brightGreen: "#23D18B",
2650
+ brightYellow: "#F5F543",
2651
+ brightBlue: "#3B8EEA",
2652
+ brightMagenta: "#D670D6",
2653
+ brightCyan: "#29B8DB",
2654
+ brightWhite: "#FFFFFF"
2655
+ };
2656
+ function ln(e, t, n) {
2657
+ let r = F(e, n), i = z(t), a = an(Object.fromEntries(X.map((t) => {
2658
+ let n = `terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`;
2659
+ return [t, e.colors?.[n] || cn[t]];
2660
+ }))), o = nn();
2661
+ return i.map((t) => o.parse(t[0]).map((n) => {
2662
+ let i, o;
2663
+ n.decorations.has("reverse") ? (i = n.background ? a.value(n.background) : e.bg, o = n.foreground ? a.value(n.foreground) : e.fg) : (i = n.foreground ? a.value(n.foreground) : e.fg, o = n.background ? a.value(n.background) : void 0), i = I(i, r), o = I(o, r), n.decorations.has("dim") && (i = un(i));
2664
+ let s = y.None;
2665
+ return n.decorations.has("bold") && (s |= y.Bold), n.decorations.has("italic") && (s |= y.Italic), n.decorations.has("underline") && (s |= y.Underline), n.decorations.has("strikethrough") && (s |= y.Strikethrough), {
2666
+ content: n.value,
2667
+ offset: t[1],
2668
+ color: i,
2669
+ bgColor: o,
2670
+ fontStyle: s
2671
+ };
2672
+ }));
2673
+ }
2674
+ function un(e) {
2675
+ let t = e.match(on);
2676
+ if (t) {
2677
+ let e = t[1];
2678
+ if (e.length === 8) {
2679
+ let t = Math.round(Number.parseInt(e.slice(6, 8), 16) / 2).toString(16).padStart(2, "0");
2680
+ return `#${e.slice(0, 6)}${t}`;
2681
+ }
2682
+ if (e.length === 6) return `#${e}80`;
2683
+ if (e.length === 4) {
2684
+ let t = e[0], n = e[1], r = e[2], i = e[3];
2685
+ return `#${t}${t}${n}${n}${r}${r}${Math.round(Number.parseInt(`${i}${i}`, 16) / 2).toString(16).padStart(2, "0")}`;
2686
+ }
2687
+ if (e.length === 3) {
2688
+ let t = e[0], n = e[1], r = e[2];
2689
+ return `#${t}${t}${n}${n}${r}${r}80`;
2690
+ }
2691
+ }
2692
+ let n = e.match(sn);
2693
+ return n ? `var(${n[1]}-dim)` : e;
2694
+ }
2695
+ function Z(e, t, n = {}) {
2696
+ let r = e.resolveLangAlias(n.lang || "text"), { theme: i = e.getLoadedThemes()[0] } = n;
2697
+ if (!L(r) && !R(i) && r === "ansi") {
2698
+ let { theme: r } = e.setTheme(i);
2699
+ return ln(r, t, n);
2700
+ }
2701
+ return Ct(e, t, n);
2702
+ }
2703
+ function Q(e, t, n) {
2704
+ let r, i, a, o, s, c;
2705
+ if ("themes" in n) {
2706
+ let { defaultColor: l = "light", cssVariablePrefix: u = "--shiki-", colorsRendering: d = "css-vars" } = n, f = Object.entries(n.themes).filter((e) => e[1]).map((e) => ({
2707
+ color: e[0],
2708
+ theme: e[1]
2709
+ })).sort((e, t) => e.color === l ? -1 : +(t.color === l));
2710
+ if (f.length === 0) throw new P("`themes` option must not be empty");
2711
+ let p = K(e, t, n, Z);
2712
+ if (c = W(p), l && l !== "light-dark()" && !f.some((e) => e.color === l)) throw new P(`\`themes\` option must contain the defaultColor key \`${l}\``);
2713
+ let m = f.map((t) => e.getTheme(t.theme)), h = f.map((e) => e.color);
2714
+ a = p.map((e) => e.map((e) => Kt(e, h, u, l, d))), c && U(a, c);
2715
+ let g = f.map((e) => F(e.theme, n));
2716
+ i = dn(f, m, g, u, l, "fg", d), r = dn(f, m, g, u, l, "bg", d), o = `shiki-themes ${m.map((e) => e.name).join(" ")}`, s = l ? void 0 : [i, r].join(";");
2717
+ } else if ("theme" in n) {
2718
+ let s = F(n.theme, n);
2719
+ a = Z(e, t, n);
2720
+ let l = e.getTheme(n.theme);
2721
+ r = I(l.bg, s), i = I(l.fg, s), o = l.name, c = W(a);
2722
+ } else throw new P("Invalid options, either `theme` or `themes` must be provided");
2723
+ return {
2724
+ tokens: a,
2725
+ fg: i,
2726
+ bg: r,
2727
+ themeName: o,
2728
+ rootStyle: s,
2729
+ grammarState: c
2730
+ };
2731
+ }
2732
+ function dn(e, t, n, r, i, a, o) {
2733
+ return e.map((s, c) => {
2734
+ let l = I(t[c][a], n[c]) || "inherit", u = `${r + s.color}${a === "bg" ? "-bg" : ""}:${l}`;
2735
+ if (c === 0 && i) {
2736
+ if (i === "light-dark()" && e.length > 1) {
2737
+ let r = e.findIndex((e) => e.color === "light"), i = e.findIndex((e) => e.color === "dark");
2738
+ if (r === -1 || i === -1) throw new P("When using `defaultColor: \"light-dark()\"`, you must provide both `light` and `dark` themes");
2739
+ return `light-dark(${I(t[r][a], n[r]) || "inherit"}, ${I(t[i][a], n[i]) || "inherit"});${u}`;
2740
+ }
2741
+ return l;
2742
+ }
2743
+ return o === "css-vars" ? u : null;
2744
+ }).filter((e) => !!e).join(";");
2745
+ }
2746
+ var fn = /^\s+$/, pn = /^(\s*)(.*?)(\s*)$/;
2747
+ function $(e, t, n, r = {
2748
+ meta: {},
2749
+ options: n,
2750
+ codeToHast: (t, n) => $(e, t, n),
2751
+ codeToTokens: (t, n) => Q(e, t, n)
2752
+ }) {
2753
+ let i = t;
2754
+ for (let e of Y(n)) i = e.preprocess?.call(r, i, n) || i;
2755
+ let { tokens: a, fg: o, bg: s, themeName: c, rootStyle: l, grammarState: u } = Q(e, i, n), { mergeWhitespaces: d = !0, mergeSameStyleTokens: f = !1 } = n;
2756
+ d === !0 ? a = hn(a) : d === "never" && (a = gn(a)), f && (a = _n(a));
2757
+ let p = {
2758
+ ...r,
2759
+ get source() {
2760
+ return i;
2761
+ }
2762
+ };
2763
+ for (let e of Y(n)) a = e.tokens?.call(p, a) || a;
2764
+ return mn(a, {
2765
+ ...n,
2766
+ fg: o,
2767
+ bg: s,
2768
+ themeName: c,
2769
+ rootStyle: n.rootStyle === !1 ? !1 : n.rootStyle ?? l
2770
+ }, p, u);
2771
+ }
2772
+ function mn(e, t, n, r = W(e)) {
2773
+ let i = Y(t), a = [], o = {
2774
+ type: "root",
2775
+ children: []
2776
+ }, { structure: s = "classic", tabindex: c = "0" } = t, l = { class: `shiki ${t.themeName || ""}` };
2777
+ t.rootStyle !== !1 && (l.style = t.rootStyle == null ? `background-color:${t.bg};color:${t.fg}` : t.rootStyle), c !== !1 && c != null && (l.tabindex = c.toString());
2778
+ for (let [e, n] of Object.entries(t.meta || {})) e.startsWith("_") || (l[e] = n);
2779
+ let u = {
2780
+ type: "element",
2781
+ tagName: "pre",
2782
+ properties: l,
2783
+ children: [],
2784
+ data: t.data
2785
+ }, d = {
2786
+ type: "element",
2787
+ tagName: "code",
2788
+ properties: {},
2789
+ children: a
2790
+ }, f = [], p = {
2791
+ ...n,
2792
+ structure: s,
2793
+ addClassToHast: Pt,
2794
+ get source() {
2795
+ return n.source;
2796
+ },
2797
+ get tokens() {
2798
+ return e;
2799
+ },
2800
+ get options() {
2801
+ return t;
2802
+ },
2803
+ get root() {
2804
+ return o;
2805
+ },
2806
+ get pre() {
2807
+ return u;
2808
+ },
2809
+ get code() {
2810
+ return d;
2811
+ },
2812
+ get lines() {
2813
+ return f;
2814
+ }
2815
+ };
2816
+ if (e.forEach((e, t) => {
2817
+ t && (s === "inline" ? o.children.push({
2818
+ type: "element",
2819
+ tagName: "br",
2820
+ properties: {},
2821
+ children: []
2822
+ }) : s === "classic" && a.push({
2823
+ type: "text",
2824
+ value: "\n"
2825
+ }));
2826
+ let n = {
2827
+ type: "element",
2828
+ tagName: "span",
2829
+ properties: { class: "line" },
2830
+ children: []
2831
+ }, r = 0;
2832
+ for (let a of e) {
2833
+ let e = {
2834
+ type: "element",
2835
+ tagName: "span",
2836
+ properties: { ...a.htmlAttrs },
2837
+ children: [{
2838
+ type: "text",
2839
+ value: a.content
2840
+ }]
2841
+ }, c = J(a.htmlStyle || q(a));
2842
+ c && (e.properties.style = c);
2843
+ for (let o of i) e = o?.span?.call(p, e, t + 1, r, n, a) || e;
2844
+ s === "inline" ? o.children.push(e) : s === "classic" && n.children.push(e), r += a.content.length;
2845
+ }
2846
+ if (s === "classic") {
2847
+ for (let e of i) n = e?.line?.call(p, n, t + 1) || n;
2848
+ f.push(n), a.push(n);
2849
+ } else s === "inline" && f.push(n);
2850
+ }), s === "classic") {
2851
+ for (let e of i) d = e?.code?.call(p, d) || d;
2852
+ u.children.push(d);
2853
+ for (let e of i) u = e?.pre?.call(p, u) || u;
2854
+ o.children.push(u);
2855
+ } else if (s === "inline") {
2856
+ let e = [], t = {
2857
+ type: "element",
2858
+ tagName: "span",
2859
+ properties: { class: "line" },
2860
+ children: []
2861
+ };
2862
+ for (let n of o.children) n.type === "element" && n.tagName === "br" ? (e.push(t), t = {
2863
+ type: "element",
2864
+ tagName: "span",
2865
+ properties: { class: "line" },
2866
+ children: []
2867
+ }) : (n.type === "element" || n.type === "text") && t.children.push(n);
2868
+ e.push(t);
2869
+ let n = {
2870
+ type: "element",
2871
+ tagName: "code",
2872
+ properties: {},
2873
+ children: e
2874
+ };
2875
+ for (let e of i) n = e?.code?.call(p, n) || n;
2876
+ o.children = [];
2877
+ for (let e = 0; e < n.children.length; e++) {
2878
+ e > 0 && o.children.push({
2879
+ type: "element",
2880
+ tagName: "br",
2881
+ properties: {},
2882
+ children: []
2883
+ });
2884
+ let t = n.children[e];
2885
+ t.type === "element" && o.children.push(...t.children);
2886
+ }
2887
+ }
2888
+ let m = o;
2889
+ for (let e of i) m = e?.root?.call(p, m) || m;
2890
+ return r && U(m, r), m;
2891
+ }
2892
+ function hn(e) {
2893
+ return e.map((e) => {
2894
+ let t = [], n = "", r;
2895
+ return e.forEach((i, a) => {
2896
+ let o = !(i.fontStyle && (i.fontStyle & y.Underline || i.fontStyle & y.Strikethrough));
2897
+ o && fn.test(i.content) && e[a + 1] ? (r === void 0 && (r = i.offset), n += i.content) : n ? (o ? t.push({
2898
+ ...i,
2899
+ offset: r,
2900
+ content: n + i.content
2901
+ }) : t.push({
2902
+ content: n,
2903
+ offset: r
2904
+ }, i), r = void 0, n = "") : t.push(i);
2905
+ }), t;
2906
+ });
2907
+ }
2908
+ function gn(e) {
2909
+ return e.map((e) => e.flatMap((e) => {
2910
+ if (fn.test(e.content)) return e;
2911
+ let t = e.content.match(pn);
2912
+ if (!t) return e;
2913
+ let [, n, r, i] = t;
2914
+ if (!n && !i) return e;
2915
+ let a = [{
2916
+ ...e,
2917
+ offset: e.offset + n.length,
2918
+ content: r
2919
+ }];
2920
+ return n && a.unshift({
2921
+ content: n,
2922
+ offset: e.offset
2923
+ }), i && a.push({
2924
+ content: i,
2925
+ offset: e.offset + n.length + r.length
2926
+ }), a;
2927
+ }));
2928
+ }
2929
+ function _n(e) {
2930
+ return e.map((e) => {
2931
+ let t = [];
2932
+ for (let n of e) {
2933
+ if (t.length === 0) {
2934
+ t.push({ ...n });
2935
+ continue;
2936
+ }
2937
+ let e = t.at(-1), r = J(e.htmlStyle || q(e)), i = J(n.htmlStyle || q(n)), a = e.fontStyle && (e.fontStyle & y.Underline || e.fontStyle & y.Strikethrough), o = n.fontStyle && (n.fontStyle & y.Underline || n.fontStyle & y.Strikethrough);
2938
+ !a && !o && r === i ? e.content += n.content : t.push({ ...n });
2939
+ }
2940
+ return t;
2941
+ });
2942
+ }
2943
+ var vn = e;
2944
+ function yn(e, t, n) {
2945
+ let r = {
2946
+ meta: {},
2947
+ options: n,
2948
+ codeToHast: (t, n) => $(e, t, n),
2949
+ codeToTokens: (t, n) => Q(e, t, n)
2950
+ }, i = vn($(e, t, n, r));
2951
+ for (let e of Y(n)) i = e.postprocess?.call(r, i, n) || i;
2952
+ return i;
2953
+ }
2954
+ async function bn(e) {
2955
+ let t = await gt(e);
2956
+ return {
2957
+ getLastGrammarState: (...e) => wt(t, ...e),
2958
+ codeToTokensBase: (e, n) => Z(t, e, n),
2959
+ codeToTokensWithThemes: (e, n) => K(t, e, n),
2960
+ codeToTokens: (e, n) => Q(t, e, n),
2961
+ codeToHast: (e, n) => $(t, e, n),
2962
+ codeToHtml: (e, n) => yn(t, e, n),
2963
+ getBundledLanguages: () => ({}),
2964
+ getBundledThemes: () => ({}),
2965
+ ...t,
2966
+ getInternalContext: () => t
2967
+ };
2968
+ }
2969
+ function xn(e) {
2970
+ let t = H(e);
2971
+ return {
2972
+ getLastGrammarState: (...e) => wt(t, ...e),
2973
+ codeToTokensBase: (e, n) => Z(t, e, n),
2974
+ codeToTokensWithThemes: (e, n) => K(t, e, n),
2975
+ codeToTokens: (e, n) => Q(t, e, n),
2976
+ codeToHast: (e, n) => $(t, e, n),
2977
+ codeToHtml: (e, n) => yn(t, e, n),
2978
+ getBundledLanguages: () => ({}),
2979
+ getBundledThemes: () => ({}),
2980
+ ...t,
2981
+ getInternalContext: () => t
2982
+ };
2983
+ }
2984
+ function Sn(e) {
2985
+ let t;
2986
+ async function n(n) {
2987
+ if (t) {
2988
+ let e = await t;
2989
+ return await Promise.all([e.loadTheme(...n.themes || []), e.loadLanguage(...n.langs || [])]), e;
2990
+ }
2991
+ return t = e({
2992
+ ...n,
2993
+ themes: n.themes || [],
2994
+ langs: n.langs || []
2995
+ }), t;
2996
+ }
2997
+ return n;
2998
+ }
2999
+ var Cn = /* @__PURE__ */ Sn(bn);
3000
+ function wn(e) {
3001
+ let t = e.langs, n = e.themes, r = e.engine;
3002
+ async function i(e) {
3003
+ function i(n) {
3004
+ if (typeof n == "string") {
3005
+ if (n = e.langAlias?.[n] || n, it(n)) return [];
3006
+ let r = t[n];
3007
+ if (!r) throw new P(`Language \`${n}\` is not included in this bundle. You may want to load it from external source.`);
3008
+ return r;
3009
+ }
3010
+ return n;
3011
+ }
3012
+ function a(e) {
3013
+ if (at(e)) return "none";
3014
+ if (typeof e == "string") {
3015
+ let t = n[e];
3016
+ if (!t) throw new P(`Theme \`${e}\` is not included in this bundle. You may want to load it from external source.`);
3017
+ return t;
3018
+ }
3019
+ return e;
3020
+ }
3021
+ let o = (e.themes ?? []).map((e) => a(e)), s = (e.langs ?? []).map((e) => i(e)), c = await bn({
3022
+ engine: e.engine ?? r(),
3023
+ ...e,
3024
+ themes: o,
3025
+ langs: s
3026
+ });
3027
+ return {
3028
+ ...c,
3029
+ loadLanguage(...e) {
3030
+ return c.loadLanguage(...e.map(i));
3031
+ },
3032
+ loadTheme(...e) {
3033
+ return c.loadTheme(...e.map(a));
3034
+ },
3035
+ getBundledLanguages() {
3036
+ return t;
3037
+ },
3038
+ getBundledThemes() {
3039
+ return n;
3040
+ }
3041
+ };
3042
+ }
3043
+ return i;
3044
+ }
3045
+ function Tn(e) {
3046
+ let t;
3047
+ async function n(n = {}) {
3048
+ if (t) {
3049
+ let e = await t;
3050
+ return await Promise.all([e.loadTheme(...n.themes || []), e.loadLanguage(...n.langs || [])]), e;
3051
+ }
3052
+ {
3053
+ t = e({
3054
+ ...n,
3055
+ themes: [],
3056
+ langs: []
3057
+ });
3058
+ let r = await t;
3059
+ return await Promise.all([r.loadTheme(...n.themes || []), r.loadLanguage(...n.langs || [])]), r;
3060
+ }
3061
+ }
3062
+ return n;
3063
+ }
3064
+ function En(e, t) {
3065
+ let n = Tn(e);
3066
+ async function r(e, r) {
3067
+ let i = await n({
3068
+ langs: [r.lang],
3069
+ themes: "theme" in r ? [r.theme] : Object.values(r.themes)
3070
+ }), a = await t?.guessEmbeddedLanguages?.(e, r.lang, i);
3071
+ return a && await i.loadLanguage(...a), i;
3072
+ }
3073
+ return {
3074
+ getSingletonHighlighter(e) {
3075
+ return n(e);
3076
+ },
3077
+ async codeToHtml(e, t) {
3078
+ return (await r(e, t)).codeToHtml(e, t);
3079
+ },
3080
+ async codeToHast(e, t) {
3081
+ return (await r(e, t)).codeToHast(e, t);
3082
+ },
3083
+ async codeToTokens(e, t) {
3084
+ return (await r(e, t)).codeToTokens(e, t);
3085
+ },
3086
+ async codeToTokensBase(e, t) {
3087
+ return (await r(e, t)).codeToTokensBase(e, t);
3088
+ },
3089
+ async codeToTokensWithThemes(e, t) {
3090
+ return (await r(e, t)).codeToTokensWithThemes(e, t);
3091
+ },
3092
+ async getLastGrammarState(e, t) {
3093
+ return (await n({
3094
+ langs: [t.lang],
3095
+ themes: [t.theme]
3096
+ })).getLastGrammarState(e, t);
3097
+ }
3098
+ };
3099
+ }
3100
+ function Dn(e = {}) {
3101
+ let { name: t = "css-variables", variablePrefix: n = "--shiki-", fontStyle: r = !0 } = e, i = (t) => e.variableDefaults?.[t] ? `var(${n}${t}, ${e.variableDefaults[t]})` : `var(${n}${t})`, a = {
3102
+ name: t,
3103
+ type: "dark",
3104
+ colors: {
3105
+ "editor.foreground": i("foreground"),
3106
+ "editor.background": i("background"),
3107
+ "terminal.ansiBlack": i("ansi-black"),
3108
+ "terminal.ansiRed": i("ansi-red"),
3109
+ "terminal.ansiGreen": i("ansi-green"),
3110
+ "terminal.ansiYellow": i("ansi-yellow"),
3111
+ "terminal.ansiBlue": i("ansi-blue"),
3112
+ "terminal.ansiMagenta": i("ansi-magenta"),
3113
+ "terminal.ansiCyan": i("ansi-cyan"),
3114
+ "terminal.ansiWhite": i("ansi-white"),
3115
+ "terminal.ansiBrightBlack": i("ansi-bright-black"),
3116
+ "terminal.ansiBrightRed": i("ansi-bright-red"),
3117
+ "terminal.ansiBrightGreen": i("ansi-bright-green"),
3118
+ "terminal.ansiBrightYellow": i("ansi-bright-yellow"),
3119
+ "terminal.ansiBrightBlue": i("ansi-bright-blue"),
3120
+ "terminal.ansiBrightMagenta": i("ansi-bright-magenta"),
3121
+ "terminal.ansiBrightCyan": i("ansi-bright-cyan"),
3122
+ "terminal.ansiBrightWhite": i("ansi-bright-white")
3123
+ },
3124
+ tokenColors: [
3125
+ {
3126
+ scope: [
3127
+ "keyword.operator.accessor",
3128
+ "meta.group.braces.round.function.arguments",
3129
+ "meta.template.expression",
3130
+ "markup.fenced_code meta.embedded.block"
3131
+ ],
3132
+ settings: { foreground: i("foreground") }
3133
+ },
3134
+ {
3135
+ scope: "emphasis",
3136
+ settings: { fontStyle: "italic" }
3137
+ },
3138
+ {
3139
+ scope: [
3140
+ "strong",
3141
+ "markup.heading.markdown",
3142
+ "markup.bold.markdown"
3143
+ ],
3144
+ settings: { fontStyle: "bold" }
3145
+ },
3146
+ {
3147
+ scope: ["markup.italic.markdown"],
3148
+ settings: { fontStyle: "italic" }
3149
+ },
3150
+ {
3151
+ scope: "meta.link.inline.markdown",
3152
+ settings: {
3153
+ fontStyle: "underline",
3154
+ foreground: i("token-link")
3155
+ }
3156
+ },
3157
+ {
3158
+ scope: [
3159
+ "string",
3160
+ "markup.fenced_code",
3161
+ "markup.inline"
3162
+ ],
3163
+ settings: { foreground: i("token-string") }
3164
+ },
3165
+ {
3166
+ scope: ["comment", "string.quoted.docstring.multi"],
3167
+ settings: { foreground: i("token-comment") }
3168
+ },
3169
+ {
3170
+ scope: [
3171
+ "constant.numeric",
3172
+ "constant.language",
3173
+ "constant.other.placeholder",
3174
+ "constant.character.format.placeholder",
3175
+ "variable.language.this",
3176
+ "variable.other.object",
3177
+ "variable.other.class",
3178
+ "variable.other.constant",
3179
+ "meta.property-name",
3180
+ "meta.property-value",
3181
+ "support"
3182
+ ],
3183
+ settings: { foreground: i("token-constant") }
3184
+ },
3185
+ {
3186
+ scope: [
3187
+ "keyword",
3188
+ "storage.modifier",
3189
+ "storage.type",
3190
+ "storage.control.clojure",
3191
+ "entity.name.function.clojure",
3192
+ "entity.name.tag.yaml",
3193
+ "support.function.node",
3194
+ "support.type.property-name.json",
3195
+ "punctuation.separator.key-value",
3196
+ "punctuation.definition.template-expression"
3197
+ ],
3198
+ settings: { foreground: i("token-keyword") }
3199
+ },
3200
+ {
3201
+ scope: "variable.parameter.function",
3202
+ settings: { foreground: i("token-parameter") }
3203
+ },
3204
+ {
3205
+ scope: [
3206
+ "support.function",
3207
+ "entity.name.type",
3208
+ "entity.other.inherited-class",
3209
+ "meta.function-call",
3210
+ "meta.instance.constructor",
3211
+ "entity.other.attribute-name",
3212
+ "entity.name.function",
3213
+ "constant.keyword.clojure"
3214
+ ],
3215
+ settings: { foreground: i("token-function") }
3216
+ },
3217
+ {
3218
+ scope: [
3219
+ "entity.name.tag",
3220
+ "string.quoted",
3221
+ "string.regexp",
3222
+ "string.interpolated",
3223
+ "string.template",
3224
+ "string.unquoted.plain.out.yaml",
3225
+ "keyword.other.template"
3226
+ ],
3227
+ settings: { foreground: i("token-string-expression") }
3228
+ },
3229
+ {
3230
+ scope: [
3231
+ "punctuation.definition.arguments",
3232
+ "punctuation.definition.dict",
3233
+ "punctuation.separator",
3234
+ "meta.function-call.arguments"
3235
+ ],
3236
+ settings: { foreground: i("token-punctuation") }
3237
+ },
3238
+ {
3239
+ scope: ["markup.underline.link", "punctuation.definition.metadata.markdown"],
3240
+ settings: { foreground: i("token-link") }
3241
+ },
3242
+ {
3243
+ scope: ["beginning.punctuation.definition.list.markdown"],
3244
+ settings: { foreground: i("token-string") }
3245
+ },
3246
+ {
3247
+ scope: [
3248
+ "punctuation.definition.string.begin.markdown",
3249
+ "punctuation.definition.string.end.markdown",
3250
+ "string.other.link.title.markdown",
3251
+ "string.other.link.description.markdown"
3252
+ ],
3253
+ settings: { foreground: i("token-keyword") }
3254
+ },
3255
+ {
3256
+ scope: [
3257
+ "markup.inserted",
3258
+ "meta.diff.header.to-file",
3259
+ "punctuation.definition.inserted"
3260
+ ],
3261
+ settings: { foreground: i("token-inserted") }
3262
+ },
3263
+ {
3264
+ scope: [
3265
+ "markup.deleted",
3266
+ "meta.diff.header.from-file",
3267
+ "punctuation.definition.deleted"
3268
+ ],
3269
+ settings: { foreground: i("token-deleted") }
3270
+ },
3271
+ {
3272
+ scope: ["markup.changed", "punctuation.definition.changed"],
3273
+ settings: { foreground: i("token-changed") }
3274
+ }
3275
+ ]
3276
+ };
3277
+ return r || (a.tokenColors = a.tokenColors?.map((e) => (e.settings?.fontStyle && delete e.settings.fontStyle, e))), a;
3278
+ }
3279
+ export { P as ShikiError, Pt as addClassToHast, I as applyColorReplacements, $ as codeToHast, yn as codeToHtml, Q as codeToTokens, Z as codeToTokensBase, K as codeToTokensWithThemes, wn as createBundledHighlighter, Dn as createCssVariablesTheme, bn as createHighlighterCore, xn as createHighlighterCoreSync, Bt as createPositionConverter, _t as createShikiInternal, ht as createShikiInternalSync, H as createShikiPrimitive, gt as createShikiPrimitiveAsync, En as createSingletonShorthands, Kt as flatTokenVariants, wt as getLastGrammarState, Cn as getSingletonHighlighterCore, q as getTokenStyleObject, Vt as guessEmbeddedLanguages, vn as hastToHtml, R as isNoneTheme, L as isPlainLang, it as isSpecialLang, at as isSpecialTheme, Tn as makeSingletonHighlighter, Sn as makeSingletonHighlighterCore, N as n, rt as normalizeGetter, B as normalizeTheme, F as resolveColorReplacements, z as splitLines, Ut as splitToken, Gt as splitTokens, J as stringifyTokenStyle, x as t, nt as toArray, ln as tokenizeAnsiWithTheme, Tt as tokenizeWithTheme, mn as tokensToHast, qt as transformerDecorations };