@vantran-se/openchamber-web 1.23.0 → 1.24.3

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 (362) hide show
  1. package/bin/cli.test.js +29 -6
  2. package/bin/lib/cli-http.js +5 -1
  3. package/bin/lib/commands-status.js +5 -0
  4. package/dist/assets/{CodeMirrorCommentWidgets-DFg2wnpo.js → CodeMirrorCommentWidgets-BjJHrzmU.js} +1 -1
  5. package/dist/assets/DiffView-COVQhWGd.js +4 -0
  6. package/dist/assets/FilesView-B1V5JxFX.js +13 -0
  7. package/dist/assets/GitView-CDOJy5Ay.js +6 -0
  8. package/dist/assets/GuestAttachDialog-D3S0Rjic.js +1 -0
  9. package/dist/assets/{JsonTreeView-BKdsjg5B.js → JsonTreeView-D0C9nU7K.js} +1 -1
  10. package/dist/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  11. package/dist/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  12. package/dist/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  13. package/dist/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  14. package/dist/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  15. package/dist/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  16. package/dist/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  17. package/dist/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  18. package/dist/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  19. package/dist/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  20. package/dist/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  21. package/dist/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  22. package/dist/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  23. package/dist/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  24. package/dist/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  25. package/dist/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  26. package/dist/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  27. package/dist/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  28. package/dist/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  29. package/dist/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  30. package/dist/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  31. package/dist/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  32. package/dist/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  33. package/dist/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  34. package/dist/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  35. package/dist/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  36. package/dist/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  37. package/dist/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  38. package/dist/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  39. package/dist/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  40. package/dist/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  41. package/dist/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  42. package/dist/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  43. package/dist/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  44. package/dist/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  45. package/dist/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  46. package/dist/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  47. package/dist/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  48. package/dist/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  49. package/dist/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  50. package/dist/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  51. package/dist/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  52. package/dist/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  53. package/dist/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  54. package/dist/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  55. package/dist/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  56. package/dist/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  57. package/dist/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  58. package/dist/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  59. package/dist/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  60. package/dist/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  61. package/dist/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  62. package/dist/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  63. package/dist/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  64. package/dist/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  65. package/dist/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  66. package/dist/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  67. package/dist/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  68. package/dist/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  69. package/dist/assets/LinearIssuesView-D7FKg1XJ.js +1 -0
  70. package/dist/assets/{MarkdownImageGallery-_5gEVr0X.js → MarkdownImageGallery-BrFjAVEf.js} +1 -1
  71. package/dist/assets/MarkdownRendererImpl-DWepTafh.js +12 -0
  72. package/dist/assets/{OnboardingScreen-DdP4_nuc.js → OnboardingScreen-Dyxxiqdt.js} +1 -1
  73. package/dist/assets/{PatchDiff-am3SAss2.js → PatchDiff-DnEhjXcC.js} +1 -1
  74. package/dist/assets/PierreDiffViewer-DyxZVVVR.js +210 -0
  75. package/dist/assets/{PlanView-BoJxdRZe.js → PlanView-LW2z_EAP.js} +4 -4
  76. package/dist/assets/PluginPane-B4tKno2h.js +3 -0
  77. package/dist/assets/SettingsView-DEaMulN9.js +29 -0
  78. package/dist/assets/{SettingsWindow-DVTdDSol.js → SettingsWindow-FLDJXOgQ.js} +1 -1
  79. package/dist/assets/SubmoduleDiffSummary-CvVwD-Vi.js +1 -0
  80. package/dist/assets/ToolOutputDialog-BiP0x2Rw.js +15 -0
  81. package/dist/assets/{ToolPartDiffPreview-C7WLk5i9.js → ToolPartDiffPreview-CkR4msKP.js} +2 -2
  82. package/dist/assets/{VirtualizedFileDiff-DcdgkH-x.js → VirtualizedFileDiff-0pyr_mHY.js} +4 -4
  83. package/dist/assets/WalkthroughView-yNj4nOP5.js +4 -0
  84. package/dist/assets/appThemeRegistry-BuUKhbYQ.js +1 -0
  85. package/dist/assets/commitAndPush-DvJKa3Ks.js +1 -0
  86. package/dist/assets/{computeVirtualFileMetrics-C8byMnRh.js → computeVirtualFileMetrics-DxTBMuu-.js} +2 -2
  87. package/dist/assets/de-DgxgFyGG.js +10 -0
  88. package/dist/assets/es-BFsZj5F_.js +16 -0
  89. package/dist/assets/fr-jdZ5KKQi.js +14 -0
  90. package/dist/assets/{index-BB7ryz8y.js → index-CKHjPKbq.js} +1 -1
  91. package/dist/assets/index-Cbci4i1W.js +40 -0
  92. package/dist/assets/index-DqaMWNrC.css +1 -0
  93. package/dist/assets/{isDiffPlainText-45ujMPGb.js → isDiffPlainText-D7FkBMP6.js} +1 -1
  94. package/dist/assets/{isFilePlainText-Cc4KFSYi.js → isFilePlainText-CL2vsrIZ.js} +1 -1
  95. package/dist/assets/ja-C5kKrhO4.js +16 -0
  96. package/dist/assets/ko-DXDTT_0O.js +16 -0
  97. package/dist/assets/main-CZALtVek.js +896 -0
  98. package/dist/assets/main-CgXMBNvG.js +2 -0
  99. package/dist/assets/{markdown-shiki.worker-D5fBU-lw.js → markdown-shiki.worker-CahLvHIq.js} +5 -5
  100. package/dist/assets/markdownCore-Dh7WEsdM.js +5 -0
  101. package/dist/assets/miniChat-CwTmDixi.js +2 -0
  102. package/dist/assets/mobile-CLf2vCtO.js +2 -0
  103. package/dist/assets/patchFileDiff-Bsba8KFp.js +13 -0
  104. package/dist/assets/pl-D-7x4Y8Q.js +16 -0
  105. package/dist/assets/pt-BR-CSBZrHa8.js +16 -0
  106. package/dist/assets/renderElectronMiniChatApp-C5gAFBk0.js +2 -0
  107. package/dist/assets/renderMobileApp-V4hYd32H.js +25 -0
  108. package/dist/assets/runtimeEndpointReset-DhlHCn-2.js +25 -0
  109. package/dist/assets/scheduledTasksApi-DzjbLd8P.js +1 -0
  110. package/dist/assets/shikiHighlight-8_3csmr6.js +1 -0
  111. package/dist/assets/surface-B6n7wJtt.js +1 -0
  112. package/dist/assets/textMateThemeFromAppTheme-CHo2fCgW.js +1 -0
  113. package/dist/assets/tr-Dr-oJ22L.js +7 -0
  114. package/dist/assets/uk-9Nx83UcI.js +16 -0
  115. package/dist/assets/useAppFontEffects-khZXpFL_.js +7333 -0
  116. package/dist/assets/useInlineCommentController-DkQ_gqpn.js +2 -0
  117. package/dist/assets/useRootScrollLock-DdvHf9Pt.js +2 -0
  118. package/dist/assets/{vendor-base-ui-DdV8vhHn.js → vendor-base-ui-CsXYnR5c.js} +1 -1
  119. package/dist/assets/{vendor-codemirror-language-data-DzlSIu_W.js → vendor-codemirror-language-data-CdzUmUyZ.js} +2 -2
  120. package/dist/assets/vendor-framer-motion-Bq3iTZ6r.js +1 -0
  121. package/dist/assets/vendor-katex-Cp579UoJ.css +1 -0
  122. package/dist/assets/{vendor-motion-dom-D_o3BTI3.js → vendor-motion-dom-DcCgeG69.js} +1 -1
  123. package/dist/assets/{vendor-remixicon-react-Dil0zKKT.js → vendor-remixicon-react-BDmGmFCA.js} +1 -1
  124. package/dist/assets/vendor-strip-json-comments-5dJlOkP1.js +4 -0
  125. package/dist/assets/{vendor-tanstack-react-virtual-g05Cx3z9.js → vendor-tanstack-react-virtual-ClYN8CzB.js} +1 -1
  126. package/dist/assets/{vendor-tanstack-virtual-core-Dubg10g5.js → vendor-tanstack-virtual-core-BewVQryB.js} +1 -1
  127. package/dist/assets/vendor-zod-CgAdXWZO.js +39 -0
  128. package/dist/assets/{web-components-CdGfR2XJ.js → web-components-B8IcVQAA.js} +2 -2
  129. package/dist/assets/zh-CN-Bxy_Hj3r.js +16 -0
  130. package/dist/assets/zh-TW-0BB4gpHM.js +16 -0
  131. package/dist/index.html +6 -4
  132. package/dist/mini-chat.html +6 -4
  133. package/dist/mobile.html +6 -4
  134. package/package.json +12 -9
  135. package/server/built-in-extensions/registry.json +4 -0
  136. package/server/index.d.ts +2 -0
  137. package/server/index.js +47 -23
  138. package/server/lib/agent-memory/runtime.js +7 -2
  139. package/server/lib/agent-memory/runtime.test.js +22 -0
  140. package/server/lib/agent-tool/DOCUMENTATION.md +17 -4
  141. package/server/lib/agent-tool/runtime.js +62 -15
  142. package/server/lib/agent-tool/runtime.test.js +88 -2
  143. package/server/lib/changelog/update-notes.js +2 -1
  144. package/server/lib/changelog/update-notes.test.js +19 -0
  145. package/server/lib/event-stream/DOCUMENTATION.md +26 -0
  146. package/server/lib/event-stream/delta-coalescer.js +0 -0
  147. package/server/lib/event-stream/delta-coalescer.test.js +292 -0
  148. package/server/lib/event-stream/global-hub.js +68 -13
  149. package/server/lib/event-stream/global-hub.test.js +182 -0
  150. package/server/lib/event-stream/global-ws-bridge.js +16 -18
  151. package/server/lib/event-stream/index.js +4 -0
  152. package/server/lib/event-stream/protocol.js +21 -7
  153. package/server/lib/event-stream/runtime.js +9 -6
  154. package/server/lib/event-stream/runtime.test.js +60 -0
  155. package/server/lib/fs/DOCUMENTATION.md +10 -1
  156. package/server/lib/fs/git-process.test.js +77 -0
  157. package/server/lib/fs/routes.js +58 -5
  158. package/server/lib/fs/routes.test.js +116 -0
  159. package/server/lib/fs/search.js +2 -1
  160. package/server/lib/git/DOCUMENTATION.md +30 -6
  161. package/server/lib/git/routes.js +37 -11
  162. package/server/lib/git/routes.test.js +78 -0
  163. package/server/lib/git/serial-refresh.js +93 -0
  164. package/server/lib/git/serial-refresh.test.js +112 -0
  165. package/server/lib/git/service.js +588 -74
  166. package/server/lib/git/service.test.js +492 -0
  167. package/server/lib/github/DOCUMENTATION.md +5 -0
  168. package/server/lib/github/pr-status.js +5 -5
  169. package/server/lib/github/pr-status.test.js +1 -1
  170. package/server/lib/github/routes.js +6 -6
  171. package/server/lib/guests/DOCUMENTATION.md +68 -0
  172. package/server/lib/guests/auth-store.js +184 -0
  173. package/server/lib/guests/auth-store.test.js +112 -0
  174. package/server/lib/guests/background.test.js +83 -0
  175. package/server/lib/guests/builtins.js +34 -0
  176. package/server/lib/guests/builtins.test.js +174 -0
  177. package/server/lib/guests/catalog.js +477 -0
  178. package/server/lib/guests/catalog.test.js +390 -0
  179. package/server/lib/guests/clone.js +297 -0
  180. package/server/lib/guests/extract-zip.js +136 -0
  181. package/server/lib/guests/extract-zip.test.js +109 -0
  182. package/server/lib/guests/files.js +308 -0
  183. package/server/lib/guests/files.test.js +262 -0
  184. package/server/lib/guests/grant-scope.js +81 -0
  185. package/server/lib/guests/grant-scope.test.js +75 -0
  186. package/server/lib/guests/host-session.js +73 -0
  187. package/server/lib/guests/host-session.test.js +30 -0
  188. package/server/lib/guests/html-styles.js +6 -0
  189. package/server/lib/guests/html-styles.test.js +45 -0
  190. package/server/lib/guests/html-tokens.js +73 -0
  191. package/server/lib/guests/html-tokens.test.js +53 -0
  192. package/server/lib/guests/install.js +406 -0
  193. package/server/lib/guests/install.test.js +338 -0
  194. package/server/lib/guests/oauth.js +501 -0
  195. package/server/lib/guests/oauth.test.js +481 -0
  196. package/server/lib/guests/persist.js +336 -0
  197. package/server/lib/guests/persist.test.js +288 -0
  198. package/server/lib/guests/request.js +112 -0
  199. package/server/lib/guests/request.test.js +206 -0
  200. package/server/lib/guests/routes.js +838 -0
  201. package/server/lib/guests/service.js +538 -0
  202. package/server/lib/guests/service.test.js +277 -0
  203. package/server/lib/guests/sockets.js +129 -0
  204. package/server/lib/guests/sockets.test.js +110 -0
  205. package/server/lib/guests/ssh-install.test.js +188 -0
  206. package/server/lib/guests/storage.js +68 -0
  207. package/server/lib/guests/storage.test.js +59 -0
  208. package/server/lib/guests/updates.js +294 -0
  209. package/server/lib/guests/updates.test.js +334 -0
  210. package/server/lib/guests/upload.js +50 -0
  211. package/server/lib/guests/upload.test.js +131 -0
  212. package/server/lib/linear/DOCUMENTATION.md +1 -1
  213. package/server/lib/message-queue/DOCUMENTATION.md +17 -1
  214. package/server/lib/message-queue/runtime.js +34 -1
  215. package/server/lib/message-queue/runtime.test.js +83 -6
  216. package/server/lib/notifications/DOCUMENTATION.md +1 -1
  217. package/server/lib/notifications/emitter-runtime.js +4 -3
  218. package/server/lib/notifications/routes.js +5 -0
  219. package/server/lib/openchamber-control/DOCUMENTATION.md +6 -0
  220. package/server/lib/openchamber-sessions/routes.js +62 -29
  221. package/server/lib/openchamber-sessions/routes.test.js +96 -0
  222. package/server/lib/opencode/DOCUMENTATION.md +73 -5
  223. package/server/lib/opencode/bootstrap-runtime.js +1 -0
  224. package/server/lib/opencode/core-routes.js +39 -1
  225. package/server/lib/opencode/env-runtime.js +5 -1
  226. package/server/lib/opencode/env-runtime.test.js +72 -0
  227. package/server/lib/opencode/feature-routes-runtime.js +30 -1
  228. package/server/lib/opencode/lifecycle-process.test.js +84 -0
  229. package/server/lib/opencode/lifecycle.js +58 -70
  230. package/server/lib/opencode/lifecycle.test.js +29 -0
  231. package/server/lib/opencode/managed-plugin-config.js +1 -1
  232. package/server/lib/opencode/openchamber-routes.js +72 -14
  233. package/server/lib/opencode/openchamber-routes.test.js +71 -3
  234. package/server/lib/opencode/proxy.js +33 -0
  235. package/server/lib/opencode/session-runtime.js +68 -0
  236. package/server/lib/opencode/session-runtime.test.js +43 -0
  237. package/server/lib/opencode/settings-helpers.js +11 -0
  238. package/server/lib/opencode/settings-helpers.test.js +24 -2
  239. package/server/lib/opencode/settings-normalization-runtime.js +2 -0
  240. package/server/lib/opencode/settings-normalization-runtime.test.js +13 -0
  241. package/server/lib/opencode/settings-registry.json +18 -0
  242. package/server/lib/opencode/settings-runtime.js +36 -9
  243. package/server/lib/opencode/settings-runtime.test.js +158 -2
  244. package/server/lib/opencode/shutdown-runtime.js +3 -0
  245. package/server/lib/opencode/shutdown-runtime.test.js +24 -0
  246. package/server/lib/opencode/theme-archive.js +53 -0
  247. package/server/lib/opencode/theme-catalog.js +171 -0
  248. package/server/lib/opencode/theme-catalog.test.js +125 -0
  249. package/server/lib/opencode/theme-import.test.js +144 -0
  250. package/server/lib/opencode/theme-runtime.js +100 -28
  251. package/server/lib/opencode/theme-runtime.test.js +15 -0
  252. package/server/lib/permission-auto-accept/DOCUMENTATION.md +8 -0
  253. package/server/lib/permission-auto-accept/runtime.js +13 -0
  254. package/server/lib/permission-auto-accept/runtime.test.js +37 -1
  255. package/server/lib/project-context/DOCUMENTATION.md +13 -3
  256. package/server/lib/project-context/runtime.js +8 -2
  257. package/server/lib/project-context/runtime.test.js +54 -0
  258. package/server/lib/projects/DOCUMENTATION.md +2 -1
  259. package/server/lib/projects/project-config.js +40 -11
  260. package/server/lib/projects/project-config.test.js +97 -0
  261. package/server/lib/projects/project-id.js +26 -0
  262. package/server/lib/quota/DOCUMENTATION.md +0 -1
  263. package/server/lib/quota/providers/index.js +0 -7
  264. package/server/lib/realtime-proxy-terminal.test.js +150 -0
  265. package/server/lib/realtime-proxy.js +2 -0
  266. package/server/lib/relay/DOCUMENTATION.md +20 -0
  267. package/server/lib/relay/host-client.js +7 -0
  268. package/server/lib/relay/host-client.test.js +14 -0
  269. package/server/lib/routing/DOCUMENTATION.md +83 -0
  270. package/server/lib/routing/defaults.js +98 -0
  271. package/server/lib/routing/feature-flag.js +11 -0
  272. package/server/lib/routing/history.js +34 -0
  273. package/server/lib/routing/jev.js +98 -0
  274. package/server/lib/routing/routes.http.test.js +100 -0
  275. package/server/lib/routing/routes.js +81 -0
  276. package/server/lib/routing/runtime.js +217 -0
  277. package/server/lib/routing/runtime.test.js +188 -0
  278. package/server/lib/routing/store.js +249 -0
  279. package/server/lib/routing/store.test.js +96 -0
  280. package/server/lib/scheduled-tasks/DOCUMENTATION.md +9 -1
  281. package/server/lib/scheduled-tasks/issue-2710-double-execution.test.js +28 -0
  282. package/server/lib/scheduled-tasks/runtime.js +14 -4
  283. package/server/lib/scheduled-tasks/runtime.test.js +67 -0
  284. package/server/lib/security/request-security.js +9 -5
  285. package/server/lib/security/request-security.test.js +37 -0
  286. package/server/lib/session-assist/DOCUMENTATION.md +131 -66
  287. package/server/lib/session-assist/context.js +127 -0
  288. package/server/lib/session-assist/context.test.js +132 -0
  289. package/server/lib/session-assist/prompt.js +54 -0
  290. package/server/lib/session-assist/runtime.js +111 -257
  291. package/server/lib/session-assist/runtime.test.js +203 -0
  292. package/server/lib/small-model/DOCUMENTATION.md +14 -2
  293. package/server/lib/small-model/call.js +37 -6
  294. package/server/lib/small-model/call.test.js +182 -0
  295. package/server/lib/terminal/DOCUMENTATION.md +23 -2
  296. package/server/lib/terminal/runtime.js +27 -5
  297. package/server/lib/terminal/runtime.test.js +67 -0
  298. package/server/lib/terminal/shutdown.js +106 -0
  299. package/server/lib/terminal/shutdown.test.js +84 -0
  300. package/server/lib/tts/service.test.js +78 -0
  301. package/server/lib/ui-auth/DOCUMENTATION.md +8 -0
  302. package/server/lib/ui-auth/session-cookie.js +51 -0
  303. package/server/lib/ui-auth/session-cookie.test.js +46 -0
  304. package/server/lib/ui-auth/ui-auth.js +56 -17
  305. package/server/lib/ui-auth/ui-auth.test.js +96 -0
  306. package/server/lib/walkthrough/DOCUMENTATION.md +15 -5
  307. package/server/lib/walkthrough/pr-source.test.js +21 -0
  308. package/server/lib/walkthrough/pull-request.js +7 -4
  309. package/server/lib/walkthrough/pull-request.test.js +16 -0
  310. package/server/lib/walkthrough/routes.js +19 -0
  311. package/server/lib/walkthrough/routes.test.js +26 -0
  312. package/server/lib/walkthrough/sources.js +13 -2
  313. package/server/opencode-worktree-readiness.test.js +130 -0
  314. package/dist/assets/DiffView-3Dn4QHbu.js +0 -4
  315. package/dist/assets/DirtyBranchSwitchDialog-CwOerqVi.js +0 -1
  316. package/dist/assets/FilesView-BdTOpew9.js +0 -17
  317. package/dist/assets/GitView-Dqf9vHJh.js +0 -6
  318. package/dist/assets/LinearIssuesView-CmbeL7I6.js +0 -1
  319. package/dist/assets/MarkdownRendererImpl-wVZlx4dd.js +0 -12
  320. package/dist/assets/PierreDiffViewer-DCsydlKs.js +0 -161
  321. package/dist/assets/SettingsView-CcM8pF5O.js +0 -28
  322. package/dist/assets/ToolOutputDialog-BgfTbDZ4.js +0 -15
  323. package/dist/assets/WalkthroughView-BEVUDxuw.js +0 -4
  324. package/dist/assets/appThemeRegistry-BK0dHKa6.js +0 -1
  325. package/dist/assets/de-C8jV7J9y.js +0 -10
  326. package/dist/assets/es-BI6J1M5R.js +0 -16
  327. package/dist/assets/fr-D6oDFt7E.js +0 -14
  328. package/dist/assets/index-BqhiCmYS.js +0 -39
  329. package/dist/assets/index-FqSOBz0J.css +0 -1
  330. package/dist/assets/ja-C_4i5EQu.js +0 -16
  331. package/dist/assets/ko-BFbOTpbq.js +0 -16
  332. package/dist/assets/main-C9ETLKFc.js +0 -2
  333. package/dist/assets/main-CJmb2dF8.js +0 -930
  334. package/dist/assets/markdownCore-DVuZpnli.js +0 -5
  335. package/dist/assets/miniChat-B4Ytoq2n.js +0 -2
  336. package/dist/assets/mobile-BUT6-lo1.js +0 -2
  337. package/dist/assets/patchFileDiff-8j1apICU.js +0 -13
  338. package/dist/assets/pl-COFvT56l.js +0 -16
  339. package/dist/assets/pt-BR-DtVOO2Lj.js +0 -16
  340. package/dist/assets/registerCustomTheme-BBXUCRnG.js +0 -1
  341. package/dist/assets/renderElectronMiniChatApp-B6vUG-vF.js +0 -2
  342. package/dist/assets/renderMobileApp-BNgHraq6.js +0 -25
  343. package/dist/assets/runtimeEndpointReset-B8LYpWvr.js +0 -17
  344. package/dist/assets/scheduledTasksApi-GC4epIYA.js +0 -1
  345. package/dist/assets/shikiHighlight-BJISeZsQ.js +0 -1
  346. package/dist/assets/surface-BvRzS58U.js +0 -1
  347. package/dist/assets/tr-B8Q0Go2l.js +0 -7
  348. package/dist/assets/uk-Dk4a-Fn-.js +0 -16
  349. package/dist/assets/useAppFontEffects-DpFNefUA.js +0 -7284
  350. package/dist/assets/useGitComparison-Dfxaqd0s.js +0 -1
  351. package/dist/assets/useInlineCommentController-CscsE4t-.js +0 -2
  352. package/dist/assets/useRootScrollLock-BaCvuRlT.js +0 -1
  353. package/dist/assets/vendor-framer-motion-livSKyyV.js +0 -1
  354. package/dist/assets/vendor-zod-BPAANqvH.js +0 -39
  355. package/dist/assets/zh-CN-B_BXxG1Q.js +0 -16
  356. package/dist/assets/zh-TW-DLrl1SPZ.js +0 -16
  357. package/server/lib/mcp-reconnect/DOCUMENTATION.md +0 -55
  358. package/server/lib/mcp-reconnect/runtime.js +0 -122
  359. package/server/lib/mcp-reconnect/runtime.test.js +0 -140
  360. package/server/lib/quota/providers/crof.js +0 -96
  361. package/server/lib/quota/providers/crof.test.js +0 -98
  362. /package/dist/assets/{vendor-katex-k3Ppq1Ha.js → vendor-katex-CHD9BdDO.js} +0 -0
@@ -1,6 +1,6 @@
1
- let R=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Ln(t){return Xe(t)}function Xe(t){return Array.isArray(t)?xn(t):t instanceof RegExp?t:typeof t=="object"?Tn(t):t}function xn(t){let e=[];for(let n=0,r=t.length;n<r;n++)e[n]=Xe(t[n]);return e}function Tn(t){let e={};for(let n in t)e[n]=Xe(t[n]);return e}function Dt(t,...e){return e.forEach(n=>{for(let r in n)t[r]=n[r]}),t}function Gt(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?Gt(t.substring(0,t.length-1)):t.substr(~e+1)}var Pe=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,le=class{static hasCaptures(t){return t===null?!1:(Pe.lastIndex=0,Pe.test(t))}static replaceCaptures(t,e,n){return t.replace(Pe,(r,i,o,s)=>{let l=n[parseInt(i||o,10)];if(l){let a=e.substring(l.start,l.end);for(;a[0]===".";)a=a.substring(1);switch(s){case"downcase":return a.toLowerCase();case"upcase":return a.toUpperCase();default:return a}}else return r})}};function jt(t,e){return t<e?-1:t>e?1:0}function $t(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,r=e.length;if(n===r){for(let i=0;i<n;i++){let o=jt(t[i],e[i]);if(o!==0)return o}return 0}return n-r}function dt(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function Ut(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Ht=class{constructor(t){this.fn=t}cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},de=class{constructor(t,e,n){this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(En(t),e)}static createFromParsedTheme(t,e){return On(t,e)}_cachedMatchRoot=new Ht(t=>this._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,r=this._cachedMatchRoot.get(e).find(i=>An(t.parent,i.parentScopes));return r?new Ft(r.fontStyle,r.foreground,r.background):null}},Ee=class me{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const r of n)e=new me(e,r);return e}static from(...e){let n=null;for(let r=0;r<e.length;r++)n=new me(n,e[r]);return n}push(e){return new me(this,e)}getSegments(){let e=this;const n=[];for(;e;)n.push(e.scopeName),e=e.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const n=[];let r=this;for(;r&&r!==e;)n.push(r.scopeName),r=r.parent;return r===e?n.reverse():void 0}};function An(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let r=e[n],i=!1;if(r===">"){if(n===e.length-1)return!1;r=e[++n],i=!0}for(;t&&!Pn(t.scopeName,r);){if(i)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function Pn(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var Ft=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function En(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],r=0;for(let i=0,o=e.length;i<o;i++){let s=e[i];if(!s.settings)continue;let l;if(typeof s.scope=="string"){let p=s.scope;p=p.replace(/^[,]+/,""),p=p.replace(/[,]+$/,""),l=p.split(",")}else Array.isArray(s.scope)?l=s.scope:l=[""];let a=-1;if(typeof s.settings.fontStyle=="string"){a=0;let p=s.settings.fontStyle.split(" ");for(let d=0,m=p.length;d<m;d++)switch(p[d]){case"italic":a=a|1;break;case"bold":a=a|2;break;case"underline":a=a|4;break;case"strikethrough":a=a|8;break}}let c=null;typeof s.settings.foreground=="string"&&dt(s.settings.foreground)&&(c=s.settings.foreground);let u=null;typeof s.settings.background=="string"&&dt(s.settings.background)&&(u=s.settings.background);for(let p=0,d=l.length;p<d;p++){let h=l[p].trim().split(" "),_=h[h.length-1],S=null;h.length>1&&(S=h.slice(0,h.length-1),S.reverse()),n[r++]=new In(_,S,i,a,c,u)}}return n}var In=class{constructor(t,e,n,r,i,o){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=r,this.foreground=i,this.background=o}},P=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(P||{});function On(t,e){t.sort((a,c)=>{let u=jt(a.scope,c.scope);return u!==0||(u=$t(a.parentScopes,c.parentScopes),u!==0)?u:a.index-c.index});let n=0,r="#000000",i="#ffffff";for(;t.length>=1&&t[0].scope==="";){let a=t.shift();a.fontStyle!==-1&&(n=a.fontStyle),a.foreground!==null&&(r=a.foreground),a.background!==null&&(i=a.background)}let o=new Mn(e),s=new Ft(n,o.getId(r),o.getId(i)),l=new Dn(new je(0,null,-1,0,0),[]);for(let a=0,c=t.length;a<c;a++){let u=t[a];l.insert(0,u.scope,u.parentScopes,u.fontStyle,o.getId(u.foreground),o.getId(u.background))}return new de(o,s,l)}var Mn=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,n=t.length;e<n;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},Bn=Object.freeze([]),je=class Wt{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,n,r,i,o){this.scopeDepth=e,this.parentScopes=n||Bn,this.fontStyle=r,this.foreground=i,this.background=o}clone(){return new Wt(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let r=0,i=e.length;r<i;r++)n[r]=e[r].clone();return n}acceptOverwrite(e,n,r,i){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),i!==0&&(this.background=i)}},Dn=class $e{constructor(e,n=[],r={}){this._mainRule=e,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let r=0,i=0;for(;e.parentScopes[r]===">"&&r++,n.parentScopes[i]===">"&&i++,!(r>=e.parentScopes.length||i>=n.parentScopes.length);){const o=n.parentScopes[i].length-e.parentScopes[r].length;if(o!==0)return o;r++,i++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r=e.indexOf("."),i,o;if(r===-1?(i=e,o=""):(i=e.substring(0,r),o=e.substring(r+1)),this._children.hasOwnProperty(i))return this._children[i].match(o)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort($e._cmpBySpecificity),n}insert(e,n,r,i,o,s){if(n===""){this._doInsertHere(e,r,i,o,s);return}let l=n.indexOf("."),a,c;l===-1?(a=n,c=""):(a=n.substring(0,l),c=n.substring(l+1));let u;this._children.hasOwnProperty(a)?u=this._children[a]:(u=new $e(this._mainRule.clone(),je.cloneArr(this._rulesWithParentScopes)),this._children[a]=u),u.insert(e+1,c,r,i,o,s)}_doInsertHere(e,n,r,i,o){if(n===null){this._mainRule.acceptOverwrite(e,r,i,o);return}for(let s=0,l=this._rulesWithParentScopes.length;s<l;s++){let a=this._rulesWithParentScopes[s];if($t(a.parentScopes,n)===0){a.acceptOverwrite(e,r,i,o);return}}r===-1&&(r=this._mainRule.fontStyle),i===0&&(i=this._mainRule.foreground),o===0&&(o=this._mainRule.background),this._rulesWithParentScopes.push(new je(e,n,r,i,o))}},Y=class M{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const n=M.getLanguageId(e),r=M.getTokenType(e),i=M.getFontStyle(e),o=M.getForeground(e),s=M.getBackground(e);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:o,background:s})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,r,i,o,s,l){let a=M.getLanguageId(e),c=M.getTokenType(e),u=M.containsBalancedBrackets(e)?1:0,p=M.getFontStyle(e),d=M.getForeground(e),m=M.getBackground(e);return n!==0&&(a=n),r!==8&&(c=r),i!==null&&(u=i?1:0),o!==-1&&(p=o),s!==0&&(d=s),l!==0&&(m=l),(a<<0|c<<8|u<<10|p<<11|d<<15|m<<24)>>>0}};function fe(t,e){const n=[],r=Gn(t);let i=r.next();for(;i!==null;){let a=0;if(i.length===2&&i.charAt(1)===":"){switch(i.charAt(0)){case"R":a=1;break;case"L":a=-1;break;default:console.log(`Unknown priority ${i} in scope selector`)}i=r.next()}let c=s();if(n.push({matcher:c,priority:a}),i!==",")break;i=r.next()}return n;function o(){if(i==="-"){i=r.next();const a=o();return c=>!!a&&!a(c)}if(i==="("){i=r.next();const a=l();return i===")"&&(i=r.next()),a}if(ft(i)){const a=[];do a.push(i),i=r.next();while(ft(i));return c=>e(a,c)}return null}function s(){const a=[];let c=o();for(;c;)a.push(c),c=o();return u=>a.every(p=>p(u))}function l(){const a=[];let c=s();for(;c&&(a.push(c),i==="|"||i===",");){do i=r.next();while(i==="|"||i===",");c=s()}return u=>a.some(p=>p(u))}}function ft(t){return!!t&&!!t.match(/[\w\.:]+/)}function Gn(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const r=n[0];return n=e.exec(t),r}}}function zt(t){typeof t.dispose=="function"&&t.dispose()}var ne=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},jn=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},$n=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},Un=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new ne(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const t=this.Q;this.Q=[];const e=new $n;for(const n of t)Hn(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof ne){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function Hn(t,e,n,r){const i=n.lookup(t.scopeName);if(!i){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const o=n.lookup(e);t instanceof ne?he({baseGrammar:o,selfGrammar:i},r):Ue(t.ruleName,{baseGrammar:o,selfGrammar:i,repository:i.repository},r);const s=n.injections(t.scopeName);if(s)for(const l of s)r.add(new ne(l))}function Ue(t,e,n){if(e.repository&&e.repository[t]){const r=e.repository[t];ge([r],e,n)}}function he(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&ge(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&ge(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function ge(t,e,n){for(const r of t){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const i=r.repository?Dt({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&ge(r.patterns,{...e,repository:i},n);const o=r.include;if(!o)continue;const s=qt(o);switch(s.kind){case 0:he({...e,selfGrammar:e.baseGrammar},n);break;case 1:he(e,n);break;case 2:Ue(s.ruleName,{...e,repository:i},n);break;case 3:case 4:const l=s.scopeName===e.selfGrammar.scopeName?e.selfGrammar:s.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(l){const a={baseGrammar:e.baseGrammar,selfGrammar:l,repository:i};s.kind===4?Ue(s.ruleName,a,n):he(a,n)}else s.kind===4?n.add(new jn(s.scopeName,s.ruleName)):n.add(new ne(s.scopeName));break}}}var Fn=class{kind=0},Wn=class{kind=1},zn=class{constructor(t){this.ruleName=t}kind=2},qn=class{constructor(t){this.scopeName=t}kind=3},Vn=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function qt(t){if(t==="$base")return new Fn;if(t==="$self")return new Wn;const e=t.indexOf("#");if(e===-1)return new qn(t);if(e===0)return new zn(t.substring(1));{const n=t.substring(0,e),r=t.substring(e+1);return new Vn(n,r)}}var Kn=/\\(\d+)/,gt=/\\(\d+)/g,Yn=-1,Vt=-2;var se=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,n,r){this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=le.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=le.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${Gt(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:le.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:le.replaceCaptures(this._contentName,t,e)}},Jn=class extends se{retokenizeCapturedWithRuleId;constructor(t,e,n,r,i){super(t,e,n,r),this.retokenizeCapturedWithRuleId=i}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,n,r){throw new Error("Not supported!")}},Xn=class extends se{_match;captures;_cachedCompiledPatterns;constructor(t,e,n,r,i){super(t,e,n,null),this._match=new re(r,this.id),this.captures=i,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ie,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},yt=class extends se{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,r,i){super(t,e,n,r),this.patterns=i.patterns,this.hasMissingPatterns=i.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,e){for(const n of this.patterns)t.getRule(n).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new ie,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},He=class extends se{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,r,i,o,s,l,a,c){super(t,e,n,r),this._begin=new re(i,this.id),this.beginCaptures=o,this._end=new re(s||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=l,this.applyEndPatternLast=a||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t,e).compileAG(t,n,r)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ie;for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,e):this._cachedCompiledPatterns.setSource(0,e)),this._cachedCompiledPatterns}},ye=class extends se{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,n,r,i,o,s,l,a){super(t,e,n,r),this._begin=new re(i,this.id),this.beginCaptures=o,this.whileCaptures=l,this._while=new re(s,Vt),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=a.patterns,this.hasMissingPatterns=a.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new ie;for(const e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,n,r){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,n,r)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new ie,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||"￿"),this._cachedCompiledWhilePatterns}},Kt=class A{static createCaptureRule(e,n,r,i,o){return e.registerRule(s=>new Jn(n,s,r,i,o))}static getCompiledRuleId(e,n,r){return e.id||n.registerRule(i=>{if(e.id=i,e.match)return new Xn(e.$vscodeTextmateLocation,e.id,e.name,e.match,A._compileCaptures(e.captures,n,r));if(typeof e.begin>"u"){e.repository&&(r=Dt({},r,e.repository));let o=e.patterns;return typeof o>"u"&&e.include&&(o=[{include:e.include}]),new yt(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,A._compilePatterns(o,n,r))}return e.while?new ye(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,A._compileCaptures(e.beginCaptures||e.captures,n,r),e.while,A._compileCaptures(e.whileCaptures||e.captures,n,r),A._compilePatterns(e.patterns,n,r)):new He(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,A._compileCaptures(e.beginCaptures||e.captures,n,r),e.end,A._compileCaptures(e.endCaptures||e.captures,n,r),e.applyEndPatternLast,A._compilePatterns(e.patterns,n,r))}),e.id}static _compileCaptures(e,n,r){let i=[];if(e){let o=0;for(const s in e){if(s==="$vscodeTextmateLocation")continue;const l=parseInt(s,10);l>o&&(o=l)}for(let s=0;s<=o;s++)i[s]=null;for(const s in e){if(s==="$vscodeTextmateLocation")continue;const l=parseInt(s,10);let a=0;e[s].patterns&&(a=A.getCompiledRuleId(e[s],n,r)),i[l]=A.createCaptureRule(n,e[s].$vscodeTextmateLocation,e[s].name,e[s].contentName,a)}}return i}static _compilePatterns(e,n,r){let i=[];if(e)for(let o=0,s=e.length;o<s;o++){const l=e[o];let a=-1;if(l.include){const c=qt(l.include);switch(c.kind){case 0:case 1:a=A.getCompiledRuleId(r[l.include],n,r);break;case 2:let u=r[c.ruleName];u&&(a=A.getCompiledRuleId(u,n,r));break;case 3:case 4:const p=c.scopeName,d=c.kind===4?c.ruleName:null,m=n.getExternalGrammar(p,r);if(m)if(d){let h=m.repository[d];h&&(a=A.getCompiledRuleId(h,n,m.repository))}else a=A.getCompiledRuleId(m.repository.$self,n,m.repository);break}}else a=A.getCompiledRuleId(l,n,r);if(a!==-1){const c=n.getRule(a);let u=!1;if((c instanceof yt||c instanceof He||c instanceof ye)&&c.hasMissingPatterns&&c.patterns.length===0&&(u=!0),u)continue;i.push(a)}}return{patterns:i,hasMissingPatterns:(e?e.length:0)!==i.length}}},re=class Yt{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,n){if(e&&typeof e=="string"){const r=e.length;let i=0,o=[],s=!1;for(let l=0;l<r;l++)if(e.charAt(l)==="\\"&&l+1<r){const c=e.charAt(l+1);c==="z"?(o.push(e.substring(i,l)),o.push("$(?!\\n)(?<!\\n)"),i=l+2):(c==="A"||c==="G")&&(s=!0),l++}this.hasAnchor=s,i===0?this.source=e:(o.push(e.substring(i,r)),this.source=o.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=Kn.test(this.source):this.hasBackReferences=!1}clone(){return new Yt(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(i=>e.substring(i.start,i.end));return gt.lastIndex=0,this.source.replace(gt,(i,o)=>Ut(r[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],n=[],r=[],i=[],o,s,l,a;for(o=0,s=this.source.length;o<s;o++)l=this.source.charAt(o),e[o]=l,n[o]=l,r[o]=l,i[o]=l,l==="\\"&&o+1<s&&(a=this.source.charAt(o+1),a==="A"?(e[o+1]="￿",n[o+1]="￿",r[o+1]="A",i[o+1]="A"):a==="G"?(e[o+1]="￿",n[o+1]="G",r[o+1]="￿",i[o+1]="G"):(e[o+1]=a,n[o+1]=a,r[o+1]=a,i[o+1]=a),o++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:i.join("")}}resolveAnchors(e,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},ie=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=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)}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(n=>n.source);this._cached=new _t(t,e,this._items.map(n=>n.ruleId))}return this._cached}compileAG(t,e,n){return this._hasAnchors?e?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,n){let r=this._items.map(i=>i.resolveAnchors(e,n));return new _t(t,r,this._items.map(i=>i.ruleId))}},_t=class{constructor(t,e,n){this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,n=this.rules.length;e<n;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
2
- `)}findNextMatchSync(t,e,n){const r=this.scanner.findNextMatchSync(t,e,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Ie=class{constructor(t,e){this.languageId=t,this.tokenType=e}},Qn=class Fe{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,n){this._defaultAttributes=new Ie(e,8),this._embeddedLanguagesMatcher=new Zn(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?Fe._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}static _NULL_SCOPE_METADATA=new Ie(0,0);_getBasicScopeAttributes=new Ht(e=>{const n=this._scopeToLanguage(e),r=this._toStandardTokenType(e);return new Ie(n,r)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const n=e.match(Fe.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},Zn=class{values;scopesRegExp;constructor(t){if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);const e=t.map(([n,r])=>Ut(n));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;const e=t.match(this.scopesRegExp);if(e)return this.values.get(e[1])}},bt=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function Jt(t,e,n,r,i,o,s,l){const a=e.content.length;let c=!1,u=-1;if(s){const m=er(t,e,n,r,i,o);i=m.stack,r=m.linePos,n=m.isFirstLine,u=m.anchorPosition}const p=Date.now();for(;!c;){if(l!==0&&Date.now()-p>l)return new bt(i,!0);d()}return new bt(i,!1);function d(){const m=tr(t,e,n,r,i,u);if(!m){o.produce(i,a),c=!0;return}const h=m.captureIndices,_=m.matchedRuleId,S=h&&h.length>0?h[0].end>r:!1;if(_===Yn){const y=i.getRule(t);o.produce(i,h[0].start),i=i.withContentNameScopesList(i.nameScopesList),ee(t,e,n,i,o,y.endCaptures,h),o.produce(i,h[0].end);const b=i;if(i=i.parent,u=b.getAnchorPos(),!S&&b.getEnterPos()===r){i=b,o.produce(i,a),c=!0;return}}else{const y=t.getRule(_);o.produce(i,h[0].start);const b=i,g=y.getName(e.content,h),w=i.contentNameScopesList.pushAttributed(g,t);if(i=i.push(_,r,u,h[0].end===a,null,w,w),y instanceof He){const v=y;ee(t,e,n,i,o,v.beginCaptures,h),o.produce(i,h[0].end),u=h[0].end;const I=v.getContentName(e.content,h),$=w.pushAttributed(I,t);if(i=i.withContentNameScopesList($),v.endHasBackReferences&&(i=i.withEndRule(v.getEndWithResolvedBackReferences(e.content,h))),!S&&b.hasSameRuleAs(i)){i=i.pop(),o.produce(i,a),c=!0;return}}else if(y instanceof ye){const v=y;ee(t,e,n,i,o,v.beginCaptures,h),o.produce(i,h[0].end),u=h[0].end;const I=v.getContentName(e.content,h),$=w.pushAttributed(I,t);if(i=i.withContentNameScopesList($),v.whileHasBackReferences&&(i=i.withEndRule(v.getWhileWithResolvedBackReferences(e.content,h))),!S&&b.hasSameRuleAs(i)){i=i.pop(),o.produce(i,a),c=!0;return}}else if(ee(t,e,n,i,o,y.captures,h),o.produce(i,h[0].end),i=i.pop(),!S){i=i.safePop(),o.produce(i,a),c=!0;return}}h[0].end>r&&(r=h[0].end,n=!1)}}function er(t,e,n,r,i,o){let s=i.beginRuleCapturedEOL?0:-1;const l=[];for(let a=i;a;a=a.pop()){const c=a.getRule(t);c instanceof ye&&l.push({rule:c,stack:a})}for(let a=l.pop();a;a=l.pop()){const{ruleScanner:c,findOptions:u}=ir(a.rule,t,a.stack.endRule,n,r===s),p=c.findNextMatchSync(e,r,u);if(p){if(p.ruleId!==Vt){i=a.stack.pop();break}p.captureIndices&&p.captureIndices.length&&(o.produce(a.stack,p.captureIndices[0].start),ee(t,e,n,a.stack,o,a.rule.whileCaptures,p.captureIndices),o.produce(a.stack,p.captureIndices[0].end),s=p.captureIndices[0].end,p.captureIndices[0].end>r&&(r=p.captureIndices[0].end,n=!1))}else{i=a.stack.pop();break}}return{stack:i,linePos:r,anchorPosition:s,isFirstLine:n}}function tr(t,e,n,r,i,o){const s=nr(t,e,n,r,i,o),l=t.getInjections();if(l.length===0)return s;const a=rr(l,t,e,n,r,i,o);if(!a)return s;if(!s)return a;const c=s.captureIndices[0].start,u=a.captureIndices[0].start;return u<c||a.priorityMatch&&u===c?a:s}function nr(t,e,n,r,i,o){const s=i.getRule(t),{ruleScanner:l,findOptions:a}=Xt(s,t,i.endRule,n,r===o),c=l.findNextMatchSync(e,r,a);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function rr(t,e,n,r,i,o,s){let l=Number.MAX_VALUE,a=null,c,u=0;const p=o.contentNameScopesList.getScopeNames();for(let d=0,m=t.length;d<m;d++){const h=t[d];if(!h.matcher(p))continue;const _=e.getRule(h.ruleId),{ruleScanner:S,findOptions:y}=Xt(_,e,null,r,i===s),b=S.findNextMatchSync(n,i,y);if(!b)continue;const g=b.captureIndices[0].start;if(!(g>=l)&&(l=g,a=b.captureIndices,c=b.ruleId,u=h.priority,l===i))break}return a?{priorityMatch:u===-1,captureIndices:a,matchedRuleId:c}:null}function Xt(t,e,n,r,i){return{ruleScanner:t.compileAG(e,n,r,i),findOptions:0}}function ir(t,e,n,r,i){return{ruleScanner:t.compileWhileAG(e,n,r,i),findOptions:0}}function ee(t,e,n,r,i,o,s){if(o.length===0)return;const l=e.content,a=Math.min(o.length,s.length),c=[],u=s[0].end;for(let p=0;p<a;p++){const d=o[p];if(d===null)continue;const m=s[p];if(m.length===0)continue;if(m.start>u)break;for(;c.length>0&&c[c.length-1].endPos<=m.start;)i.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?i.produceFromScopes(c[c.length-1].scopes,m.start):i.produce(r,m.start),d.retokenizeCapturedWithRuleId){const _=d.getName(l,s),S=r.contentNameScopesList.pushAttributed(_,t),y=d.getContentName(l,s),b=S.pushAttributed(y,t),g=r.push(d.retokenizeCapturedWithRuleId,m.start,-1,!1,null,S,b),w=t.createOnigString(l.substring(0,m.end));Jt(t,w,n&&m.start===0,m.start,g,i,!1,0),zt(w);continue}const h=d.getName(l,s);if(h!==null){const S=(c.length>0?c[c.length-1].scopes:r.contentNameScopesList).pushAttributed(h,t);c.push(new or(S,m.end))}}for(;c.length>0;)i.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var or=class{scopes;endPos;constructor(t,e){this.scopes=t,this.endPos=e}};function sr(t,e,n,r,i,o,s,l){return new lr(t,e,n,r,i,o,s,l)}function St(t,e,n,r,i){const o=fe(e,_e),s=Kt.getCompiledRuleId(n,r,i.repository);for(const l of o)t.push({debugSelector:e,matcher:l.matcher,ruleId:s,grammar:i,priority:l.priority})}function _e(t,e){if(e.length<t.length)return!1;let n=0;return t.every(r=>{for(let i=n;i<e.length;i++)if(ar(e[i],r))return n=i+1,!0;return!1})}function ar(t,e){if(!t)return!1;if(t===e)return!0;const n=e.length;return t.length>n&&t.substr(0,n)===e&&t[n]==="."}var lr=class{constructor(t,e,n,r,i,o,s,l){if(this._rootScopeName=t,this.balancedBracketSelectors=o,this._onigLib=l,this._basicScopeAttributesProvider=new Qn(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=kt(e,null),this._injections=null,this._tokenTypeMatchers=[],i)for(const a of Object.keys(i)){const c=fe(a,_e);for(const u of c)this._tokenTypeMatchers.push({matcher:u.matcher,type:i[a]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const t of this._ruleId2desc)t&&t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){const t={lookup:i=>i===this._rootScopeName?this._grammar:this.getExternalGrammar(i),injections:i=>this._grammarRepository.injections(i)},e=[],n=this._rootScopeName,r=t.lookup(n);if(r){const i=r.injections;if(i)for(let s in i)St(e,s,i[s],this,r);const o=this._grammarRepository.injections(n);o&&o.forEach(s=>{const l=this.getExternalGrammar(s);if(l){const a=l.injectionSelector;a&&St(e,a,l,this,l)}})}return e.sort((i,o)=>i.priority-o.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(t){const e=++this._lastRuleId,n=t(e);return this._ruleId2desc[e]=n,n}getRule(t){return this._ruleId2desc[t]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];if(this._grammarRepository){const n=this._grammarRepository.lookup(t);if(n)return this._includedGrammars[t]=kt(n,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,n=0){const r=this._tokenize(t,e,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(t,e,n=0){const r=this._tokenize(t,e,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(t,e,n,r){this._rootId===-1&&(this._rootId=Kt.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let i;if(!e||e===We.NULL){i=!0;const c=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),p=Y.set(0,c.languageId,c.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),d=this.getRule(this._rootId).getName(null,null);let m;d?m=te.createRootAndLookUpScopeName(d,p,this):m=te.createRoot("unknown",p),e=new We(null,this._rootId,-1,-1,!1,null,m,m)}else i=!1,e.reset();t=t+`
3
- `;const o=this.createOnigString(t),s=o.content.length,l=new ur(n,t,this._tokenTypeMatchers,this.balancedBracketSelectors),a=Jt(this,o,i,0,e,l,!0,r);return zt(o),{lineLength:s,lineTokens:l,ruleStack:a.stack,stoppedEarly:a.stoppedEarly}}};function kt(t,e){return t=Ln(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var te=class B{constructor(e,n,r){this.parent=e,this.scopePath=n,this.tokenAttributes=r}static fromExtension(e,n){let r=e,i=e?.scopePath??null;for(const o of n)i=Ee.push(i,o.scopeNames),r=new B(r,i,o.encodedTokenAttributes);return r}static createRoot(e,n){return new B(null,new Ee(null,e),n)}static createRootAndLookUpScopeName(e,n,r){const i=r.getMetadataForScope(e),o=new Ee(null,e),s=r.themeProvider.themeMatch(o),l=B.mergeAttributes(n,i,s);return new B(null,o,l)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return B.equals(this,e)}static equals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.scopeName!==n.scopeName||e.tokenAttributes!==n.tokenAttributes)return!1;e=e.parent,n=n.parent}while(!0)}static mergeAttributes(e,n,r){let i=-1,o=0,s=0;return r!==null&&(i=r.fontStyle,o=r.foregroundId,s=r.backgroundId),Y.set(e,n.languageId,n.tokenType,null,i,o,s)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return B._pushAttributed(this,e,n);const r=e.split(/ /g);let i=this;for(const o of r)i=B._pushAttributed(i,o,n);return i}static _pushAttributed(e,n,r){const i=r.getMetadataForScope(n),o=e.scopePath.push(n),s=r.themeProvider.themeMatch(o),l=B.mergeAttributes(e.tokenAttributes,i,s);return new B(e,o,l)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const n=[];let r=this;for(;r&&r!==e;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===e?n.reverse():void 0}},We=class U{constructor(e,n,r,i,o,s,l,a){this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=o,this.endRule=s,this.nameScopesList=l,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=i}_stackElementBrand=void 0;static NULL=new U(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(e){return e===null?!1:U._equals(this,e)}static _equals(e,n){return e===n?!0:this._structuralEquals(e,n)?te.equals(e.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.depth!==n.depth||e.ruleId!==n.ruleId||e.endRule!==n.endRule)return!1;e=e.parent,n=n.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){U._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,r,i,o,s,l){return new U(this,e,n,r,i,o,s,l)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,n){return this.parent&&(n=this.parent._writeString(e,n)),e[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new U(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let n=this;for(;n&&n._enterPos===e._enterPos;){if(n.ruleId===e.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(e,n){const r=te.fromExtension(e?.nameScopesList??null,n.nameScopesList);return new U(e,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,te.fromExtension(r,n.contentNameScopesList))}},cr=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(t,e){this.balancedBracketScopes=t.flatMap(n=>n==="*"?(this.allowAny=!0,[]):fe(n,_e).map(r=>r.matcher)),this.unbalancedBracketScopes=e.flatMap(n=>fe(n,_e).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(const e of this.unbalancedBracketScopes)if(e(t))return!1;for(const e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},ur=class{constructor(t,e,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=t,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let r=t?.tokenAttributes??0,i=!1;if(this.balancedBracketSelectors?.matchesAlways&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const o=t?.getScopeNames()??[];for(const s of this._tokenTypeOverrides)s.matcher(o)&&(r=Y.set(r,0,s.type,null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(o))}if(i&&(r=Y.set(r,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=e;return}const n=t?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:n}),this._lastTokenEndIndex=e}getResult(t,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,i=this._binaryTokens.length;r<i;r++)n[r]=this._binaryTokens[r];return n}},pr=class{constructor(t,e){this._onigLib=e,this._theme=t}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const t of this._grammars.values())t.dispose()}setTheme(t){this._theme=t}getColorMap(){return this._theme.getColorMap()}addGrammar(t,e){this._rawGrammars.set(t.scopeName,t),e&&this._injectionGrammars.set(t.scopeName,e)}lookup(t){return this._rawGrammars.get(t)}injections(t){return this._injectionGrammars.get(t)}getDefaults(){return this._theme.getDefaults()}themeMatch(t){return this._theme.match(t)}grammarForScopeName(t,e,n,r,i){if(!this._grammars.has(t)){let o=this._rawGrammars.get(t);if(!o)return null;this._grammars.set(t,sr(t,o,e,n,r,i,this,this._onigLib))}return this._grammars.get(t)}},mr=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new pr(de.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,n){this._syncRegistry.setTheme(de.createFromRawTheme(e,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,n,r){return this.loadGrammarWithConfiguration(e,n,{embeddedLanguages:r})}loadGrammarWithConfiguration(e,n,r){return this._loadGrammar(e,n,r.embeddedLanguages,r.tokenTypes,new cr(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,n,r,i,o){const s=new Un(this._syncRegistry,e);for(;s.Q.length>0;)s.Q.map(l=>this._loadSingleGrammar(l.scopeName)),s.processQueue();return this._grammarForScopeName(e,n,r,i,o)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const n=this._options.loadGrammar(e);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(e,n=[],r=0,i=null){return this._syncRegistry.addGrammar(e,n),this._grammarForScopeName(e.scopeName,r,i)}_grammarForScopeName(e,n=0,r=null,i=null,o=null){return this._syncRegistry.grammarForScopeName(e,n,r,i,o)}},ze=We.NULL;const hr=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class ae{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}ae.prototype.normal={};ae.prototype.property={};ae.prototype.space=void 0;function Qt(t,e){const n={},r={};for(const i of t)Object.assign(n,i.property),Object.assign(r,i.normal);return new ae(n,r,e)}function qe(t){return t.toLowerCase()}class E{constructor(e,n){this.attribute=n,this.property=e}}E.prototype.attribute="";E.prototype.booleanish=!1;E.prototype.boolean=!1;E.prototype.commaOrSpaceSeparated=!1;E.prototype.commaSeparated=!1;E.prototype.defined=!1;E.prototype.mustUseProperty=!1;E.prototype.number=!1;E.prototype.overloadedBoolean=!1;E.prototype.property="";E.prototype.spaceSeparated=!1;E.prototype.space=void 0;let dr=0;const k=F(),N=F(),Ve=F(),f=F(),C=F(),V=F(),O=F();function F(){return 2**++dr}var Ke=Object.freeze({__proto__:null,boolean:k,booleanish:N,commaOrSpaceSeparated:O,commaSeparated:V,number:f,overloadedBoolean:Ve,spaceSeparated:C});const Oe=Object.keys(Ke);class Qe extends E{constructor(e,n,r,i){let o=-1;if(super(e,n),wt(this,"space",i),typeof r=="number")for(;++o<Oe.length;){const s=Oe[o];wt(this,Oe[o],(r&Ke[s])===Ke[s])}}}Qe.prototype.defined=!0;function wt(t,e,n){n&&(t[e]=n)}function X(t){const e={},n={};for(const[r,i]of Object.entries(t.properties)){const o=new Qe(r,t.transform(t.attributes||{},r),i,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),e[r]=o,n[qe(r)]=r,n[qe(o.attribute)]=r}return new ae(e,n,t.space)}const Zt=X({properties:{ariaActiveDescendant:null,ariaAtomic:N,ariaAutoComplete:null,ariaBusy:N,ariaChecked:N,ariaColCount:f,ariaColIndex:f,ariaColSpan:f,ariaControls:C,ariaCurrent:null,ariaDescribedBy:C,ariaDetails:null,ariaDisabled:N,ariaDropEffect:C,ariaErrorMessage:null,ariaExpanded:N,ariaFlowTo:C,ariaGrabbed:N,ariaHasPopup:null,ariaHidden:N,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:C,ariaLevel:f,ariaLive:null,ariaModal:N,ariaMultiLine:N,ariaMultiSelectable:N,ariaOrientation:null,ariaOwns:C,ariaPlaceholder:null,ariaPosInSet:f,ariaPressed:N,ariaReadOnly:N,ariaRelevant:null,ariaRequired:N,ariaRoleDescription:C,ariaRowCount:f,ariaRowIndex:f,ariaRowSpan:f,ariaSelected:N,ariaSetSize:f,ariaSort:null,ariaValueMax:f,ariaValueMin:f,ariaValueNow:f,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function en(t,e){return e in t?t[e]:e}function tn(t,e){return en(t,e.toLowerCase())}const fr=X({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:V,acceptCharset:C,accessKey:C,action:null,allow:null,allowFullScreen:k,allowPaymentRequest:k,allowUserMedia:k,alt:null,as:null,async:k,autoCapitalize:null,autoComplete:C,autoFocus:k,autoPlay:k,blocking:C,capture:null,charSet:null,checked:k,cite:null,className:C,cols:f,colSpan:null,content:null,contentEditable:N,controls:k,controlsList:C,coords:f|V,crossOrigin:null,data:null,dateTime:null,decoding:null,default:k,defer:k,dir:null,dirName:null,disabled:k,download:Ve,draggable:N,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:k,formTarget:null,headers:C,height:f,hidden:Ve,high:f,href:null,hrefLang:null,htmlFor:C,httpEquiv:C,id:null,imageSizes:null,imageSrcSet:null,inert:k,inputMode:null,integrity:null,is:null,isMap:k,itemId:null,itemProp:C,itemRef:C,itemScope:k,itemType:C,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:k,low:f,manifest:null,max:null,maxLength:f,media:null,method:null,min:null,minLength:f,multiple:k,muted:k,name:null,nonce:null,noModule:k,noValidate:k,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:k,optimum:f,pattern:null,ping:C,placeholder:null,playsInline:k,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:k,referrerPolicy:null,rel:C,required:k,reversed:k,rows:f,rowSpan:f,sandbox:C,scope:null,scoped:k,seamless:k,selected:k,shadowRootClonable:k,shadowRootDelegatesFocus:k,shadowRootMode:null,shape:null,size:f,sizes:null,slot:null,span:f,spellCheck:N,src:null,srcDoc:null,srcLang:null,srcSet:null,start:f,step:null,style:null,tabIndex:f,target:null,title:null,translate:null,type:null,typeMustMatch:k,useMap:null,value:N,width:f,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:C,axis:null,background:null,bgColor:null,border:f,borderColor:null,bottomMargin:f,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:k,declare:k,event:null,face:null,frame:null,frameBorder:null,hSpace:f,leftMargin:f,link:null,longDesc:null,lowSrc:null,marginHeight:f,marginWidth:f,noResize:k,noHref:k,noShade:k,noWrap:k,object:null,profile:null,prompt:null,rev:null,rightMargin:f,rules:null,scheme:null,scrolling:N,standby:null,summary:null,text:null,topMargin:f,valueType:null,version:null,vAlign:null,vLink:null,vSpace:f,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:k,disableRemotePlayback:k,prefix:null,property:null,results:f,security:null,unselectable:null},space:"html",transform:tn}),gr=X({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:O,accentHeight:f,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:f,amplitude:f,arabicForm:null,ascent:f,attributeName:null,attributeType:null,azimuth:f,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:f,by:null,calcMode:null,capHeight:f,className:C,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:f,diffuseConstant:f,direction:null,display:null,dur:null,divisor:f,dominantBaseline:null,download:k,dx:null,dy:null,edgeMode:null,editable:null,elevation:f,enableBackground:null,end:null,event:null,exponent:f,externalResourcesRequired:null,fill:null,fillOpacity:f,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:V,g2:V,glyphName:V,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:f,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:f,horizOriginX:f,horizOriginY:f,id:null,ideographic:f,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:f,k:f,k1:f,k2:f,k3:f,k4:f,kernelMatrix:O,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:f,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:f,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:f,overlineThickness:f,paintOrder:null,panose1:null,path:null,pathLength:f,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:C,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:f,pointsAtY:f,pointsAtZ:f,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:O,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:O,rev:O,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:O,requiredFeatures:O,requiredFonts:O,requiredFormats:O,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:f,specularExponent:f,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:f,strikethroughThickness:f,string:null,stroke:null,strokeDashArray:O,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:f,strokeOpacity:f,strokeWidth:null,style:null,surfaceScale:f,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:O,tabIndex:f,tableValues:null,target:null,targetX:f,targetY:f,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:O,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:f,underlineThickness:f,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:f,values:null,vAlphabetic:f,vMathematical:f,vectorEffect:null,vHanging:f,vIdeographic:f,version:null,vertAdvY:f,vertOriginX:f,vertOriginY:f,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:f,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:en}),nn=X({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),rn=X({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:tn}),on=X({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),yr=/[A-Z]/g,Ct=/-[a-z]/g,_r=/^data[-\w.:]+$/i;function br(t,e){const n=qe(e);let r=e,i=E;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&_r.test(e)){if(e.charAt(4)==="-"){const o=e.slice(5).replace(Ct,kr);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=e.slice(4);if(!Ct.test(o)){let s=o.replace(yr,Sr);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}i=Qe}return new i(r,e)}function Sr(t){return"-"+t.toLowerCase()}function kr(t){return t.charAt(1).toUpperCase()}const wr=Qt([Zt,fr,nn,rn,on],"html"),sn=Qt([Zt,gr,nn,rn,on],"svg"),vt={}.hasOwnProperty;function Cr(t,e){const n=e||{};function r(i,...o){let s=r.invalid;const l=r.handlers;if(i&&vt.call(i,t)){const a=String(i[t]);s=vt.call(l,a)?l[a]:r.unknown}if(s)return s.call(this,i,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const vr=/["&'<>`]/g,Nr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Rr=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Lr=/[|\\{}()[\]^$+*?.]/g,Nt=new WeakMap;function xr(t,e){if(t=t.replace(e.subset?Tr(e.subset):vr,r),e.subset||e.escapeOnly)return t;return t.replace(Nr,n).replace(Rr,r);function n(i,o,s){return e.format((i.charCodeAt(0)-55296)*1024+i.charCodeAt(1)-56320+65536,s.charCodeAt(o+2),e)}function r(i,o,s){return e.format(i.charCodeAt(0),s.charCodeAt(o+1),e)}}function Tr(t){let e=Nt.get(t);return e||(e=Ar(t),Nt.set(t,e)),e}function Ar(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace(Lr,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const Pr=/[\dA-Fa-f]/;function Er(t,e,n){const r="&#x"+t.toString(16).toUpperCase();return n&&e&&!Pr.test(String.fromCharCode(e))?r:r+";"}const Ir=/\d/;function Or(t,e,n){const r="&#"+String(t);return n&&e&&!Ir.test(String.fromCharCode(e))?r:r+";"}const Mr=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Me={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Br=["cent","copy","divide","gt","lt","not","para","times"],an={}.hasOwnProperty,Ye={};let ce;for(ce in Me)an.call(Me,ce)&&(Ye[Me[ce]]=ce);const Dr=/[^\dA-Za-z]/;function Gr(t,e,n,r){const i=String.fromCharCode(t);if(an.call(Ye,i)){const o=Ye[i],s="&"+o;return n&&Mr.includes(o)&&!Br.includes(o)&&(!r||e&&e!==61&&Dr.test(String.fromCharCode(e)))?s:s+";"}return""}function jr(t,e,n){let r=Er(t,e,n.omitOptionalSemicolons),i;if((n.useNamedReferences||n.useShortestReferences)&&(i=Gr(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!i)&&n.useShortestReferences){const o=Or(t,e,n.omitOptionalSemicolons);o.length<r.length&&(r=o)}return i&&(!n.useShortestReferences||i.length<r.length)?i:r}function K(t,e){return xr(t,Object.assign({format:jr},e))}const $r=/^>|^->|<!--|-->|--!>|<!-$/g,Ur=[">"],Hr=["<",">"];function Fr(t,e,n,r){return r.settings.bogusComments?"<?"+K(t.value,Object.assign({},r.settings.characterReferences,{subset:Ur}))+">":"<!--"+t.value.replace($r,i)+"-->";function i(o){return K(o,Object.assign({},r.settings.characterReferences,{subset:Hr}))}}function Wr(t,e,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function Rt(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,i=n.indexOf(e);for(;i!==-1;)r++,i=n.indexOf(e,i+e.length);return r}function zr(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function qr(t){return t.join(" ").trim()}const Vr=/[ \t\n\f\r]/g;function Ze(t){return typeof t=="object"?t.type==="text"?Lt(t.value):!1:Lt(t)}function Lt(t){return t.replace(Vr,"")===""}const x=cn(1),ln=cn(-1),Kr=[];function cn(t){return e;function e(n,r,i){const o=n?n.children:Kr;let s=(r||0)+t,l=o[s];if(!i)for(;l&&Ze(l);)s+=t,l=o[s];return l}}const Yr={}.hasOwnProperty;function un(t){return e;function e(n,r,i){return Yr.call(t,n.tagName)&&t[n.tagName](n,r,i)}}const et=un({body:Xr,caption:Be,colgroup:Be,dd:ti,dt:ei,head:Be,html:Jr,li:Zr,optgroup:ni,option:ri,p:Qr,rp:xt,rt:xt,tbody:oi,td:Tt,tfoot:si,th:Tt,thead:ii,tr:ai});function Be(t,e,n){const r=x(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&Ze(r.value.charAt(0)))}function Jr(t,e,n){const r=x(n,e);return!r||r.type!=="comment"}function Xr(t,e,n){const r=x(n,e);return!r||r.type!=="comment"}function Qr(t,e,n){const r=x(n,e);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function Zr(t,e,n){const r=x(n,e);return!r||r.type==="element"&&r.tagName==="li"}function ei(t,e,n){const r=x(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function ti(t,e,n){const r=x(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function xt(t,e,n){const r=x(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function ni(t,e,n){const r=x(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function ri(t,e,n){const r=x(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function ii(t,e,n){const r=x(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function oi(t,e,n){const r=x(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function si(t,e,n){return!x(n,e)}function ai(t,e,n){const r=x(n,e);return!r||r.type==="element"&&r.tagName==="tr"}function Tt(t,e,n){const r=x(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const li=un({body:pi,colgroup:mi,head:ui,html:ci,tbody:hi});function ci(t){const e=x(t,-1);return!e||e.type!=="comment"}function ui(t){const e=new Set;for(const r of t.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(e.has(r.tagName))return!1;e.add(r.tagName)}const n=t.children[0];return!n||n.type==="element"}function pi(t){const e=x(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&Ze(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function mi(t,e,n){const r=ln(n,e),i=x(t,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&et(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="col")}function hi(t,e,n){const r=ln(n,e),i=x(t,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&et(r,n.children.indexOf(r),n)?!1:!!(i&&i.type==="element"&&i.tagName==="tr")}const ue={name:[[`
1
+ let R=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Tn(t){return Qe(t)}function Qe(t){return Array.isArray(t)?An(t):t instanceof RegExp?t:typeof t=="object"?Pn(t):t}function An(t){let e=[];for(let n=0,r=t.length;n<r;n++)e[n]=Qe(t[n]);return e}function Pn(t){let e={};for(let n in t)e[n]=Qe(t[n]);return e}function Gt(t,...e){return e.forEach(n=>{for(let r in n)t[r]=n[r]}),t}function jt(t){const e=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return e===0?t:~e===t.length-1?jt(t.substring(0,t.length-1)):t.substr(~e+1)}var Ee=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,le=class{static hasCaptures(t){return t===null?!1:(Ee.lastIndex=0,Ee.test(t))}static replaceCaptures(t,e,n){return t.replace(Ee,(r,o,i,s)=>{let l=n[parseInt(o||i,10)];if(l){let a=e.substring(l.start,l.end);for(;a[0]===".";)a=a.substring(1);switch(s){case"downcase":return a.toLowerCase();case"upcase":return a.toUpperCase();default:return a}}else return r})}};function $t(t,e){return t<e?-1:t>e?1:0}function Ut(t,e){if(t===null&&e===null)return 0;if(!t)return-1;if(!e)return 1;let n=t.length,r=e.length;if(n===r){for(let o=0;o<n;o++){let i=$t(t[o],e[o]);if(i!==0)return i}return 0}return n-r}function ft(t){return!!(/^#[0-9a-f]{6}$/i.test(t)||/^#[0-9a-f]{8}$/i.test(t)||/^#[0-9a-f]{3}$/i.test(t)||/^#[0-9a-f]{4}$/i.test(t))}function Ht(t){return t.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Ft=class{constructor(t){this.fn=t}cache=new Map;get(t){if(this.cache.has(t))return this.cache.get(t);const e=this.fn(t);return this.cache.set(t,e),e}},fe=class{constructor(t,e,n){this._colorMap=t,this._defaults=e,this._root=n}static createFromRawTheme(t,e){return this.createFromParsedTheme(On(t),e)}static createFromParsedTheme(t,e){return Bn(t,e)}_cachedMatchRoot=new Ft(t=>this._root.match(t));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(t){if(t===null)return this._defaults;const e=t.scopeName,r=this._cachedMatchRoot.get(e).find(o=>En(t.parent,o.parentScopes));return r?new Wt(r.fontStyle,r.foreground,r.background):null}},Ie=class me{constructor(e,n){this.parent=e,this.scopeName=n}static push(e,n){for(const r of n)e=new me(e,r);return e}static from(...e){let n=null;for(let r=0;r<e.length;r++)n=new me(n,e[r]);return n}push(e){return new me(this,e)}getSegments(){let e=this;const n=[];for(;e;)n.push(e.scopeName),e=e.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(e){return this===e?!0:this.parent===null?!1:this.parent.extends(e)}getExtensionIfDefined(e){const n=[];let r=this;for(;r&&r!==e;)n.push(r.scopeName),r=r.parent;return r===e?n.reverse():void 0}};function En(t,e){if(e.length===0)return!0;for(let n=0;n<e.length;n++){let r=e[n],o=!1;if(r===">"){if(n===e.length-1)return!1;r=e[++n],o=!0}for(;t&&!In(t.scopeName,r);){if(o)return!1;t=t.parent}if(!t)return!1;t=t.parent}return!0}function In(t,e){return e===t||t.startsWith(e)&&t[e.length]==="."}var Wt=class{constructor(t,e,n){this.fontStyle=t,this.foregroundId=e,this.backgroundId=n}};function On(t){if(!t)return[];if(!t.settings||!Array.isArray(t.settings))return[];let e=t.settings,n=[],r=0;for(let o=0,i=e.length;o<i;o++){let s=e[o];if(!s.settings)continue;let l;if(typeof s.scope=="string"){let p=s.scope;p=p.replace(/^[,]+/,""),p=p.replace(/[,]+$/,""),l=p.split(",")}else Array.isArray(s.scope)?l=s.scope:l=[""];let a=-1;if(typeof s.settings.fontStyle=="string"){a=0;let p=s.settings.fontStyle.split(" ");for(let d=0,m=p.length;d<m;d++)switch(p[d]){case"italic":a=a|1;break;case"bold":a=a|2;break;case"underline":a=a|4;break;case"strikethrough":a=a|8;break}}let c=null;typeof s.settings.foreground=="string"&&ft(s.settings.foreground)&&(c=s.settings.foreground);let u=null;typeof s.settings.background=="string"&&ft(s.settings.background)&&(u=s.settings.background);for(let p=0,d=l.length;p<d;p++){let h=l[p].trim().split(" "),b=h[h.length-1],S=null;h.length>1&&(S=h.slice(0,h.length-1),S.reverse()),n[r++]=new Mn(b,S,o,a,c,u)}}return n}var Mn=class{constructor(t,e,n,r,o,i){this.scope=t,this.parentScopes=e,this.index=n,this.fontStyle=r,this.foreground=o,this.background=i}},P=(t=>(t[t.NotSet=-1]="NotSet",t[t.None=0]="None",t[t.Italic=1]="Italic",t[t.Bold=2]="Bold",t[t.Underline=4]="Underline",t[t.Strikethrough=8]="Strikethrough",t))(P||{});function Bn(t,e){t.sort((a,c)=>{let u=$t(a.scope,c.scope);return u!==0||(u=Ut(a.parentScopes,c.parentScopes),u!==0)?u:a.index-c.index});let n=0,r="#000000",o="#ffffff";for(;t.length>=1&&t[0].scope==="";){let a=t.shift();a.fontStyle!==-1&&(n=a.fontStyle),a.foreground!==null&&(r=a.foreground),a.background!==null&&(o=a.background)}let i=new Dn(e),s=new Wt(n,i.getId(r),i.getId(o)),l=new jn(new $e(0,null,-1,0,0),[]);for(let a=0,c=t.length;a<c;a++){let u=t[a];l.insert(0,u.scope,u.parentScopes,u.fontStyle,i.getId(u.foreground),i.getId(u.background))}return new fe(i,s,l)}var Dn=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(t){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(t)){this._isFrozen=!0;for(let e=0,n=t.length;e<n;e++)this._color2id[t[e]]=e,this._id2color[e]=t[e]}else this._isFrozen=!1}getId(t){if(t===null)return 0;t=t.toUpperCase();let e=this._color2id[t];if(e)return e;if(this._isFrozen)throw new Error(`Missing color in color map - ${t}`);return e=++this._lastColorId,this._color2id[t]=e,this._id2color[e]=t,e}getColorMap(){return this._id2color.slice(0)}},Gn=Object.freeze([]),$e=class zt{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(e,n,r,o,i){this.scopeDepth=e,this.parentScopes=n||Gn,this.fontStyle=r,this.foreground=o,this.background=i}clone(){return new zt(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(e){let n=[];for(let r=0,o=e.length;r<o;r++)n[r]=e[r].clone();return n}acceptOverwrite(e,n,r,o){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),o!==0&&(this.background=o)}},jn=class Ue{constructor(e,n=[],r={}){this._mainRule=e,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(e,n){if(e.scopeDepth!==n.scopeDepth)return n.scopeDepth-e.scopeDepth;let r=0,o=0;for(;e.parentScopes[r]===">"&&r++,n.parentScopes[o]===">"&&o++,!(r>=e.parentScopes.length||o>=n.parentScopes.length);){const i=n.parentScopes[o].length-e.parentScopes[r].length;if(i!==0)return i;r++,o++}return n.parentScopes.length-e.parentScopes.length}match(e){if(e!==""){let r=e.indexOf("."),o,i;if(r===-1?(o=e,i=""):(o=e.substring(0,r),i=e.substring(r+1)),this._children.hasOwnProperty(o))return this._children[o].match(i)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Ue._cmpBySpecificity),n}insert(e,n,r,o,i,s){if(n===""){this._doInsertHere(e,r,o,i,s);return}let l=n.indexOf("."),a,c;l===-1?(a=n,c=""):(a=n.substring(0,l),c=n.substring(l+1));let u;this._children.hasOwnProperty(a)?u=this._children[a]:(u=new Ue(this._mainRule.clone(),$e.cloneArr(this._rulesWithParentScopes)),this._children[a]=u),u.insert(e+1,c,r,o,i,s)}_doInsertHere(e,n,r,o,i){if(n===null){this._mainRule.acceptOverwrite(e,r,o,i);return}for(let s=0,l=this._rulesWithParentScopes.length;s<l;s++){let a=this._rulesWithParentScopes[s];if(Ut(a.parentScopes,n)===0){a.acceptOverwrite(e,r,o,i);return}}r===-1&&(r=this._mainRule.fontStyle),o===0&&(o=this._mainRule.foreground),i===0&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new $e(e,n,r,o,i))}},Y=class M{static toBinaryStr(e){return e.toString(2).padStart(32,"0")}static print(e){const n=M.getLanguageId(e),r=M.getTokenType(e),o=M.getFontStyle(e),i=M.getForeground(e),s=M.getBackground(e);console.log({languageId:n,tokenType:r,fontStyle:o,foreground:i,background:s})}static getLanguageId(e){return(e&255)>>>0}static getTokenType(e){return(e&768)>>>8}static containsBalancedBrackets(e){return(e&1024)!==0}static getFontStyle(e){return(e&30720)>>>11}static getForeground(e){return(e&16744448)>>>15}static getBackground(e){return(e&4278190080)>>>24}static set(e,n,r,o,i,s,l){let a=M.getLanguageId(e),c=M.getTokenType(e),u=M.containsBalancedBrackets(e)?1:0,p=M.getFontStyle(e),d=M.getForeground(e),m=M.getBackground(e);return n!==0&&(a=n),r!==8&&(c=r),o!==null&&(u=o?1:0),i!==-1&&(p=i),s!==0&&(d=s),l!==0&&(m=l),(a<<0|c<<8|u<<10|p<<11|d<<15|m<<24)>>>0}};function ge(t,e){const n=[],r=$n(t);let o=r.next();for(;o!==null;){let a=0;if(o.length===2&&o.charAt(1)===":"){switch(o.charAt(0)){case"R":a=1;break;case"L":a=-1;break;default:console.log(`Unknown priority ${o} in scope selector`)}o=r.next()}let c=s();if(n.push({matcher:c,priority:a}),o!==",")break;o=r.next()}return n;function i(){if(o==="-"){o=r.next();const a=i();return c=>!!a&&!a(c)}if(o==="("){o=r.next();const a=l();return o===")"&&(o=r.next()),a}if(gt(o)){const a=[];do a.push(o),o=r.next();while(gt(o));return c=>e(a,c)}return null}function s(){const a=[];let c=i();for(;c;)a.push(c),c=i();return u=>a.every(p=>p(u))}function l(){const a=[];let c=s();for(;c&&(a.push(c),o==="|"||o===",");){do o=r.next();while(o==="|"||o===",");c=s()}return u=>a.some(p=>p(u))}}function gt(t){return!!t&&!!t.match(/[\w\.:]+/)}function $n(t){let e=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=e.exec(t);return{next:()=>{if(!n)return null;const r=n[0];return n=e.exec(t),r}}}function qt(t){typeof t.dispose=="function"&&t.dispose()}var ne=class{constructor(t){this.scopeName=t}toKey(){return this.scopeName}},Un=class{constructor(t,e){this.scopeName=t,this.ruleName=e}toKey(){return`${this.scopeName}#${this.ruleName}`}},Hn=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(t){const e=t.toKey();this._seenReferenceKeys.has(e)||(this._seenReferenceKeys.add(e),this._references.push(t))}},Fn=class{constructor(t,e){this.repo=t,this.initialScopeName=e,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new ne(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const t=this.Q;this.Q=[];const e=new Hn;for(const n of t)Wn(n,this.initialScopeName,this.repo,e);for(const n of e.references)if(n instanceof ne){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function Wn(t,e,n,r){const o=n.lookup(t.scopeName);if(!o){if(t.scopeName===e)throw new Error(`No grammar provided for <${e}>`);return}const i=n.lookup(e);t instanceof ne?he({baseGrammar:i,selfGrammar:o},r):He(t.ruleName,{baseGrammar:i,selfGrammar:o,repository:o.repository},r);const s=n.injections(t.scopeName);if(s)for(const l of s)r.add(new ne(l))}function He(t,e,n){if(e.repository&&e.repository[t]){const r=e.repository[t];ye([r],e,n)}}function he(t,e){t.selfGrammar.patterns&&Array.isArray(t.selfGrammar.patterns)&&ye(t.selfGrammar.patterns,{...t,repository:t.selfGrammar.repository},e),t.selfGrammar.injections&&ye(Object.values(t.selfGrammar.injections),{...t,repository:t.selfGrammar.repository},e)}function ye(t,e,n){for(const r of t){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const o=r.repository?Gt({},e.repository,r.repository):e.repository;Array.isArray(r.patterns)&&ye(r.patterns,{...e,repository:o},n);const i=r.include;if(!i)continue;const s=Vt(i);switch(s.kind){case 0:he({...e,selfGrammar:e.baseGrammar},n);break;case 1:he(e,n);break;case 2:He(s.ruleName,{...e,repository:o},n);break;case 3:case 4:const l=s.scopeName===e.selfGrammar.scopeName?e.selfGrammar:s.scopeName===e.baseGrammar.scopeName?e.baseGrammar:void 0;if(l){const a={baseGrammar:e.baseGrammar,selfGrammar:l,repository:o};s.kind===4?He(s.ruleName,a,n):he(a,n)}else s.kind===4?n.add(new Un(s.scopeName,s.ruleName)):n.add(new ne(s.scopeName));break}}}var zn=class{kind=0},qn=class{kind=1},Vn=class{constructor(t){this.ruleName=t}kind=2},Kn=class{constructor(t){this.scopeName=t}kind=3},Yn=class{constructor(t,e){this.scopeName=t,this.ruleName=e}kind=4};function Vt(t){if(t==="$base")return new zn;if(t==="$self")return new qn;const e=t.indexOf("#");if(e===-1)return new Kn(t);if(e===0)return new Vn(t.substring(1));{const n=t.substring(0,e),r=t.substring(e+1);return new Yn(n,r)}}var Jn=/\\(\d+)/,yt=/\\(\d+)/g,Xn=-1,Kt=-2;var se=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(t,e,n,r){this.$location=t,this.id=e,this._name=n||null,this._nameIsCapturing=le.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=le.hasCaptures(this._contentName)}get debugName(){const t=this.$location?`${jt(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${t}`}getName(t,e){return!this._nameIsCapturing||this._name===null||t===null||e===null?this._name:le.replaceCaptures(this._name,t,e)}getContentName(t,e){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:le.replaceCaptures(this._contentName,t,e)}},Qn=class extends se{retokenizeCapturedWithRuleId;constructor(t,e,n,r,o){super(t,e,n,r),this.retokenizeCapturedWithRuleId=o}dispose(){}collectPatterns(t,e){throw new Error("Not supported!")}compile(t,e){throw new Error("Not supported!")}compileAG(t,e,n,r){throw new Error("Not supported!")}},Zn=class extends se{_match;captures;_cachedCompiledPatterns;constructor(t,e,n,r,o){super(t,e,n,null),this._match=new re(r,this.id),this.captures=o,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(t,e){e.push(this._match)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new oe,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},bt=class extends se{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,r,o){super(t,e,n,r),this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(t,e){for(const n of this.patterns)t.getRule(n).collectPatterns(t,e)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new oe,this.collectPatterns(t,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Fe=class extends se{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(t,e,n,r,o,i,s,l,a,c){super(t,e,n,r),this._begin=new re(o,this.id),this.beginCaptures=i,this._end=new re(s||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=l,this.applyEndPatternLast=a||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(t,e){return this._end.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t,e).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t,e).compileAG(t,n,r)}_getCachedCompiledPatterns(t,e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new oe;for(const n of this.patterns)t.getRule(n).collectPatterns(t,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,e):this._cachedCompiledPatterns.setSource(0,e)),this._cachedCompiledPatterns}},be=class extends se{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(t,e,n,r,o,i,s,l,a){super(t,e,n,r),this._begin=new re(o,this.id),this.beginCaptures=i,this.whileCaptures=l,this._while=new re(s,Kt),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=a.patterns,this.hasMissingPatterns=a.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(t,e){return this._while.resolveBackReferences(t,e)}collectPatterns(t,e){e.push(this._begin)}compile(t,e){return this._getCachedCompiledPatterns(t).compile(t)}compileAG(t,e,n,r){return this._getCachedCompiledPatterns(t).compileAG(t,n,r)}_getCachedCompiledPatterns(t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new oe;for(const e of this.patterns)t.getRule(e).collectPatterns(t,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(t,e){return this._getCachedCompiledWhilePatterns(t,e).compile(t)}compileWhileAG(t,e,n,r){return this._getCachedCompiledWhilePatterns(t,e).compileAG(t,n,r)}_getCachedCompiledWhilePatterns(t,e){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new oe,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,e||"￿"),this._cachedCompiledWhilePatterns}},Yt=class A{static createCaptureRule(e,n,r,o,i){return e.registerRule(s=>new Qn(n,s,r,o,i))}static getCompiledRuleId(e,n,r){return e.id||n.registerRule(o=>{if(e.id=o,e.match)return new Zn(e.$vscodeTextmateLocation,e.id,e.name,e.match,A._compileCaptures(e.captures,n,r));if(typeof e.begin>"u"){e.repository&&(r=Gt({},r,e.repository));let i=e.patterns;return typeof i>"u"&&e.include&&(i=[{include:e.include}]),new bt(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,A._compilePatterns(i,n,r))}return e.while?new be(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,A._compileCaptures(e.beginCaptures||e.captures,n,r),e.while,A._compileCaptures(e.whileCaptures||e.captures,n,r),A._compilePatterns(e.patterns,n,r)):new Fe(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,A._compileCaptures(e.beginCaptures||e.captures,n,r),e.end,A._compileCaptures(e.endCaptures||e.captures,n,r),e.applyEndPatternLast,A._compilePatterns(e.patterns,n,r))}),e.id}static _compileCaptures(e,n,r){let o=[];if(e){let i=0;for(const s in e){if(s==="$vscodeTextmateLocation")continue;const l=parseInt(s,10);l>i&&(i=l)}for(let s=0;s<=i;s++)o[s]=null;for(const s in e){if(s==="$vscodeTextmateLocation")continue;const l=parseInt(s,10);let a=0;e[s].patterns&&(a=A.getCompiledRuleId(e[s],n,r)),o[l]=A.createCaptureRule(n,e[s].$vscodeTextmateLocation,e[s].name,e[s].contentName,a)}}return o}static _compilePatterns(e,n,r){let o=[];if(e)for(let i=0,s=e.length;i<s;i++){const l=e[i];let a=-1;if(l.include){const c=Vt(l.include);switch(c.kind){case 0:case 1:a=A.getCompiledRuleId(r[l.include],n,r);break;case 2:let u=r[c.ruleName];u&&(a=A.getCompiledRuleId(u,n,r));break;case 3:case 4:const p=c.scopeName,d=c.kind===4?c.ruleName:null,m=n.getExternalGrammar(p,r);if(m)if(d){let h=m.repository[d];h&&(a=A.getCompiledRuleId(h,n,m.repository))}else a=A.getCompiledRuleId(m.repository.$self,n,m.repository);break}}else a=A.getCompiledRuleId(l,n,r);if(a!==-1){const c=n.getRule(a);let u=!1;if((c instanceof bt||c instanceof Fe||c instanceof be)&&c.hasMissingPatterns&&c.patterns.length===0&&(u=!0),u)continue;o.push(a)}}return{patterns:o,hasMissingPatterns:(e?e.length:0)!==o.length}}},re=class Jt{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(e,n){if(e&&typeof e=="string"){const r=e.length;let o=0,i=[],s=!1;for(let l=0;l<r;l++)if(e.charAt(l)==="\\"&&l+1<r){const c=e.charAt(l+1);c==="z"?(i.push(e.substring(o,l)),i.push("$(?!\\n)(?<!\\n)"),o=l+2):(c==="A"||c==="G")&&(s=!0),l++}this.hasAnchor=s,o===0?this.source=e:(i.push(e.substring(o,r)),this.source=i.join(""))}else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=Jn.test(this.source):this.hasBackReferences=!1}clone(){return new Jt(this.source,this.ruleId)}setSource(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(e,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let r=n.map(o=>e.substring(o.start,o.end));return yt.lastIndex=0,this.source.replace(yt,(o,i)=>Ht(r[parseInt(i,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let e=[],n=[],r=[],o=[],i,s,l,a;for(i=0,s=this.source.length;i<s;i++)l=this.source.charAt(i),e[i]=l,n[i]=l,r[i]=l,o[i]=l,l==="\\"&&i+1<s&&(a=this.source.charAt(i+1),a==="A"?(e[i+1]="￿",n[i+1]="￿",r[i+1]="A",o[i+1]="A"):a==="G"?(e[i+1]="￿",n[i+1]="G",r[i+1]="￿",o[i+1]="G"):(e[i+1]=a,n[i+1]=a,r[i+1]=a,o[i+1]=a),i++);return{A0_G0:e.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:o.join("")}}resolveAnchors(e,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:e?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},oe=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=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)}push(t){this._items.push(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}unshift(t){this._items.unshift(t),this._hasAnchors=this._hasAnchors||t.hasAnchor}length(){return this._items.length}setSource(t,e){this._items[t].source!==e&&(this._disposeCaches(),this._items[t].setSource(e))}compile(t){if(!this._cached){let e=this._items.map(n=>n.source);this._cached=new _t(t,e,this._items.map(n=>n.ruleId))}return this._cached}compileAG(t,e,n){return this._hasAnchors?e?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(t,e,n)),this._anchorCache.A0_G0):this.compile(t)}_resolveAnchors(t,e,n){let r=this._items.map(o=>o.resolveAnchors(e,n));return new _t(t,r,this._items.map(o=>o.ruleId))}},_t=class{constructor(t,e,n){this.regExps=e,this.rules=n,this.scanner=t.createOnigScanner(e)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const t=[];for(let e=0,n=this.rules.length;e<n;e++)t.push(" - "+this.rules[e]+": "+this.regExps[e]);return t.join(`
2
+ `)}findNextMatchSync(t,e,n){const r=this.scanner.findNextMatchSync(t,e,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Oe=class{constructor(t,e){this.languageId=t,this.tokenType=e}},er=class We{_defaultAttributes;_embeddedLanguagesMatcher;constructor(e,n){this._defaultAttributes=new Oe(e,8),this._embeddedLanguagesMatcher=new tr(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return e===null?We._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}static _NULL_SCOPE_METADATA=new Oe(0,0);_getBasicScopeAttributes=new Ft(e=>{const n=this._scopeToLanguage(e),r=this._toStandardTokenType(e);return new Oe(n,r)});_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const n=e.match(We.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},tr=class{values;scopesRegExp;constructor(t){if(t.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(t);const e=t.map(([n,r])=>Ht(n));e.sort(),e.reverse(),this.scopesRegExp=new RegExp(`^((${e.join(")|(")}))($|\\.)`,"")}}match(t){if(!this.scopesRegExp)return;const e=t.match(this.scopesRegExp);if(e)return this.values.get(e[1])}},St=class{constructor(t,e){this.stack=t,this.stoppedEarly=e}};function Xt(t,e,n,r,o,i,s,l){const a=e.content.length;let c=!1,u=-1;if(s){const m=nr(t,e,n,r,o,i);o=m.stack,r=m.linePos,n=m.isFirstLine,u=m.anchorPosition}const p=Date.now();for(;!c;){if(l!==0&&Date.now()-p>l)return new St(o,!0);d()}return new St(o,!1);function d(){const m=rr(t,e,n,r,o,u);if(!m){i.produce(o,a),c=!0;return}const h=m.captureIndices,b=m.matchedRuleId,S=h&&h.length>0?h[0].end>r:!1;if(b===Xn){const y=o.getRule(t);i.produce(o,h[0].start),o=o.withContentNameScopesList(o.nameScopesList),ee(t,e,n,o,i,y.endCaptures,h),i.produce(o,h[0].end);const _=o;if(o=o.parent,u=_.getAnchorPos(),!S&&_.getEnterPos()===r){o=_,i.produce(o,a),c=!0;return}}else{const y=t.getRule(b);i.produce(o,h[0].start);const _=o,g=y.getName(e.content,h),w=o.contentNameScopesList.pushAttributed(g,t);if(o=o.push(b,r,u,h[0].end===a,null,w,w),y instanceof Fe){const C=y;ee(t,e,n,o,i,C.beginCaptures,h),i.produce(o,h[0].end),u=h[0].end;const I=C.getContentName(e.content,h),$=w.pushAttributed(I,t);if(o=o.withContentNameScopesList($),C.endHasBackReferences&&(o=o.withEndRule(C.getEndWithResolvedBackReferences(e.content,h))),!S&&_.hasSameRuleAs(o)){o=o.pop(),i.produce(o,a),c=!0;return}}else if(y instanceof be){const C=y;ee(t,e,n,o,i,C.beginCaptures,h),i.produce(o,h[0].end),u=h[0].end;const I=C.getContentName(e.content,h),$=w.pushAttributed(I,t);if(o=o.withContentNameScopesList($),C.whileHasBackReferences&&(o=o.withEndRule(C.getWhileWithResolvedBackReferences(e.content,h))),!S&&_.hasSameRuleAs(o)){o=o.pop(),i.produce(o,a),c=!0;return}}else if(ee(t,e,n,o,i,y.captures,h),i.produce(o,h[0].end),o=o.pop(),!S){o=o.safePop(),i.produce(o,a),c=!0;return}}h[0].end>r&&(r=h[0].end,n=!1)}}function nr(t,e,n,r,o,i){let s=o.beginRuleCapturedEOL?0:-1;const l=[];for(let a=o;a;a=a.pop()){const c=a.getRule(t);c instanceof be&&l.push({rule:c,stack:a})}for(let a=l.pop();a;a=l.pop()){const{ruleScanner:c,findOptions:u}=sr(a.rule,t,a.stack.endRule,n,r===s),p=c.findNextMatchSync(e,r,u);if(p){if(p.ruleId!==Kt){o=a.stack.pop();break}p.captureIndices&&p.captureIndices.length&&(i.produce(a.stack,p.captureIndices[0].start),ee(t,e,n,a.stack,i,a.rule.whileCaptures,p.captureIndices),i.produce(a.stack,p.captureIndices[0].end),s=p.captureIndices[0].end,p.captureIndices[0].end>r&&(r=p.captureIndices[0].end,n=!1))}else{o=a.stack.pop();break}}return{stack:o,linePos:r,anchorPosition:s,isFirstLine:n}}function rr(t,e,n,r,o,i){const s=or(t,e,n,r,o,i),l=t.getInjections();if(l.length===0)return s;const a=ir(l,t,e,n,r,o,i);if(!a)return s;if(!s)return a;const c=s.captureIndices[0].start,u=a.captureIndices[0].start;return u<c||a.priorityMatch&&u===c?a:s}function or(t,e,n,r,o,i){const s=o.getRule(t),{ruleScanner:l,findOptions:a}=Qt(s,t,o.endRule,n,r===i),c=l.findNextMatchSync(e,r,a);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function ir(t,e,n,r,o,i,s){let l=Number.MAX_VALUE,a=null,c,u=0;const p=i.contentNameScopesList.getScopeNames();for(let d=0,m=t.length;d<m;d++){const h=t[d];if(!h.matcher(p))continue;const b=e.getRule(h.ruleId),{ruleScanner:S,findOptions:y}=Qt(b,e,null,r,o===s),_=S.findNextMatchSync(n,o,y);if(!_)continue;const g=_.captureIndices[0].start;if(!(g>=l)&&(l=g,a=_.captureIndices,c=_.ruleId,u=h.priority,l===o))break}return a?{priorityMatch:u===-1,captureIndices:a,matchedRuleId:c}:null}function Qt(t,e,n,r,o){return{ruleScanner:t.compileAG(e,n,r,o),findOptions:0}}function sr(t,e,n,r,o){return{ruleScanner:t.compileWhileAG(e,n,r,o),findOptions:0}}function ee(t,e,n,r,o,i,s){if(i.length===0)return;const l=e.content,a=Math.min(i.length,s.length),c=[],u=s[0].end;for(let p=0;p<a;p++){const d=i[p];if(d===null)continue;const m=s[p];if(m.length===0)continue;if(m.start>u)break;for(;c.length>0&&c[c.length-1].endPos<=m.start;)o.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?o.produceFromScopes(c[c.length-1].scopes,m.start):o.produce(r,m.start),d.retokenizeCapturedWithRuleId){const b=d.getName(l,s),S=r.contentNameScopesList.pushAttributed(b,t),y=d.getContentName(l,s),_=S.pushAttributed(y,t),g=r.push(d.retokenizeCapturedWithRuleId,m.start,-1,!1,null,S,_),w=t.createOnigString(l.substring(0,m.end));Xt(t,w,n&&m.start===0,m.start,g,o,!1,0),qt(w);continue}const h=d.getName(l,s);if(h!==null){const S=(c.length>0?c[c.length-1].scopes:r.contentNameScopesList).pushAttributed(h,t);c.push(new ar(S,m.end))}}for(;c.length>0;)o.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var ar=class{scopes;endPos;constructor(t,e){this.scopes=t,this.endPos=e}};function lr(t,e,n,r,o,i,s,l){return new ur(t,e,n,r,o,i,s,l)}function kt(t,e,n,r,o){const i=ge(e,_e),s=Yt.getCompiledRuleId(n,r,o.repository);for(const l of i)t.push({debugSelector:e,matcher:l.matcher,ruleId:s,grammar:o,priority:l.priority})}function _e(t,e){if(e.length<t.length)return!1;let n=0;return t.every(r=>{for(let o=n;o<e.length;o++)if(cr(e[o],r))return n=o+1,!0;return!1})}function cr(t,e){if(!t)return!1;if(t===e)return!0;const n=e.length;return t.length>n&&t.substr(0,n)===e&&t[n]==="."}var ur=class{constructor(t,e,n,r,o,i,s,l){if(this._rootScopeName=t,this.balancedBracketSelectors=i,this._onigLib=l,this._basicScopeAttributesProvider=new er(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=wt(e,null),this._injections=null,this._tokenTypeMatchers=[],o)for(const a of Object.keys(o)){const c=ge(a,_e);for(const u of c)this._tokenTypeMatchers.push({matcher:u.matcher,type:o[a]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const t of this._ruleId2desc)t&&t.dispose()}createOnigScanner(t){return this._onigLib.createOnigScanner(t)}createOnigString(t){return this._onigLib.createOnigString(t)}getMetadataForScope(t){return this._basicScopeAttributesProvider.getBasicScopeAttributes(t)}_collectInjections(){const t={lookup:o=>o===this._rootScopeName?this._grammar:this.getExternalGrammar(o),injections:o=>this._grammarRepository.injections(o)},e=[],n=this._rootScopeName,r=t.lookup(n);if(r){const o=r.injections;if(o)for(let s in o)kt(e,s,o[s],this,r);const i=this._grammarRepository.injections(n);i&&i.forEach(s=>{const l=this.getExternalGrammar(s);if(l){const a=l.injectionSelector;a&&kt(e,a,l,this,l)}})}return e.sort((o,i)=>o.priority-i.priority),e}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(t){const e=++this._lastRuleId,n=t(e);return this._ruleId2desc[e]=n,n}getRule(t){return this._ruleId2desc[t]}getExternalGrammar(t,e){if(this._includedGrammars[t])return this._includedGrammars[t];if(this._grammarRepository){const n=this._grammarRepository.lookup(t);if(n)return this._includedGrammars[t]=wt(n,e&&e.$base),this._includedGrammars[t]}}tokenizeLine(t,e,n=0){const r=this._tokenize(t,e,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(t,e,n=0){const r=this._tokenize(t,e,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(t,e,n,r){this._rootId===-1&&(this._rootId=Yt.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let o;if(!e||e===ze.NULL){o=!0;const c=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),p=Y.set(0,c.languageId,c.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),d=this.getRule(this._rootId).getName(null,null);let m;d?m=te.createRootAndLookUpScopeName(d,p,this):m=te.createRoot("unknown",p),e=new ze(null,this._rootId,-1,-1,!1,null,m,m)}else o=!1,e.reset();t=t+`
3
+ `;const i=this.createOnigString(t),s=i.content.length,l=new mr(n,t,this._tokenTypeMatchers,this.balancedBracketSelectors),a=Xt(this,i,o,0,e,l,!0,r);return qt(i),{lineLength:s,lineTokens:l,ruleStack:a.stack,stoppedEarly:a.stoppedEarly}}};function wt(t,e){return t=Tn(t),t.repository=t.repository||{},t.repository.$self={$vscodeTextmateLocation:t.$vscodeTextmateLocation,patterns:t.patterns,name:t.scopeName},t.repository.$base=e||t.repository.$self,t}var te=class B{constructor(e,n,r){this.parent=e,this.scopePath=n,this.tokenAttributes=r}static fromExtension(e,n){let r=e,o=e?.scopePath??null;for(const i of n)o=Ie.push(o,i.scopeNames),r=new B(r,o,i.encodedTokenAttributes);return r}static createRoot(e,n){return new B(null,new Ie(null,e),n)}static createRootAndLookUpScopeName(e,n,r){const o=r.getMetadataForScope(e),i=new Ie(null,e),s=r.themeProvider.themeMatch(i),l=B.mergeAttributes(n,o,s);return new B(null,i,l)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(e){return B.equals(this,e)}static equals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.scopeName!==n.scopeName||e.tokenAttributes!==n.tokenAttributes)return!1;e=e.parent,n=n.parent}while(!0)}static mergeAttributes(e,n,r){let o=-1,i=0,s=0;return r!==null&&(o=r.fontStyle,i=r.foregroundId,s=r.backgroundId),Y.set(e,n.languageId,n.tokenType,null,o,i,s)}pushAttributed(e,n){if(e===null)return this;if(e.indexOf(" ")===-1)return B._pushAttributed(this,e,n);const r=e.split(/ /g);let o=this;for(const i of r)o=B._pushAttributed(o,i,n);return o}static _pushAttributed(e,n,r){const o=r.getMetadataForScope(n),i=e.scopePath.push(n),s=r.themeProvider.themeMatch(i),l=B.mergeAttributes(e.tokenAttributes,o,s);return new B(e,i,l)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(e){const n=[];let r=this;for(;r&&r!==e;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===e?n.reverse():void 0}},ze=class U{constructor(e,n,r,o,i,s,l,a){this.parent=e,this.ruleId=n,this.beginRuleCapturedEOL=i,this.endRule=s,this.nameScopesList=l,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=o}_stackElementBrand=void 0;static NULL=new U(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(e){return e===null?!1:U._equals(this,e)}static _equals(e,n){return e===n?!0:this._structuralEquals(e,n)?te.equals(e.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(e,n){do{if(e===n||!e&&!n)return!0;if(!e||!n||e.depth!==n.depth||e.ruleId!==n.ruleId||e.endRule!==n.endRule)return!1;e=e.parent,n=n.parent}while(!0)}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){U._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,n,r,o,i,s,l){return new U(this,e,n,r,o,i,s,l)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,n){return this.parent&&(n=this.parent._writeString(e,n)),e[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new U(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let n=this;for(;n&&n._enterPos===e._enterPos;){if(n.ruleId===e.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(e,n){const r=te.fromExtension(e?.nameScopesList??null,n.nameScopesList);return new U(e,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,te.fromExtension(r,n.contentNameScopesList))}},pr=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(t,e){this.balancedBracketScopes=t.flatMap(n=>n==="*"?(this.allowAny=!0,[]):ge(n,_e).map(r=>r.matcher)),this.unbalancedBracketScopes=e.flatMap(n=>ge(n,_e).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(t){for(const e of this.unbalancedBracketScopes)if(e(t))return!1;for(const e of this.balancedBracketScopes)if(e(t))return!0;return this.allowAny}},mr=class{constructor(t,e,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=t,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(t,e){this.produceFromScopes(t.contentNameScopesList,e)}produceFromScopes(t,e){if(this._lastTokenEndIndex>=e)return;if(this._emitBinaryTokens){let r=t?.tokenAttributes??0,o=!1;if(this.balancedBracketSelectors?.matchesAlways&&(o=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const i=t?.getScopeNames()??[];for(const s of this._tokenTypeOverrides)s.matcher(i)&&(r=Y.set(r,0,s.type,null,-1,0,0));this.balancedBracketSelectors&&(o=this.balancedBracketSelectors.match(i))}if(o&&(r=Y.set(r,0,8,o,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=e;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=e;return}const n=t?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:e,scopes:n}),this._lastTokenEndIndex=e}getResult(t,e){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===e-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(t,e){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===e-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(t,e),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,o=this._binaryTokens.length;r<o;r++)n[r]=this._binaryTokens[r];return n}},hr=class{constructor(t,e){this._onigLib=e,this._theme=t}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const t of this._grammars.values())t.dispose()}setTheme(t){this._theme=t}getColorMap(){return this._theme.getColorMap()}addGrammar(t,e){this._rawGrammars.set(t.scopeName,t),e&&this._injectionGrammars.set(t.scopeName,e)}lookup(t){return this._rawGrammars.get(t)}injections(t){return this._injectionGrammars.get(t)}getDefaults(){return this._theme.getDefaults()}themeMatch(t){return this._theme.match(t)}grammarForScopeName(t,e,n,r,o){if(!this._grammars.has(t)){let i=this._rawGrammars.get(t);if(!i)return null;this._grammars.set(t,lr(t,i,e,n,r,o,this,this._onigLib))}return this._grammars.get(t)}},dr=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new hr(fe.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,n){this._syncRegistry.setTheme(fe.createFromRawTheme(e,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,n,r){return this.loadGrammarWithConfiguration(e,n,{embeddedLanguages:r})}loadGrammarWithConfiguration(e,n,r){return this._loadGrammar(e,n,r.embeddedLanguages,r.tokenTypes,new pr(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,n,r,o,i){const s=new Fn(this._syncRegistry,e);for(;s.Q.length>0;)s.Q.map(l=>this._loadSingleGrammar(l.scopeName)),s.processQueue();return this._grammarForScopeName(e,n,r,o,i)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){const n=this._options.loadGrammar(e);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(e,n=[],r=0,o=null){return this._syncRegistry.addGrammar(e,n),this._grammarForScopeName(e.scopeName,r,o)}_grammarForScopeName(e,n=0,r=null,o=null,i=null){return this._syncRegistry.grammarForScopeName(e,n,r,o,i)}},qe=ze.NULL;const fr=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class ae{constructor(e,n,r){this.normal=n,this.property=e,r&&(this.space=r)}}ae.prototype.normal={};ae.prototype.property={};ae.prototype.space=void 0;function Zt(t,e){const n={},r={};for(const o of t)Object.assign(n,o.property),Object.assign(r,o.normal);return new ae(n,r,e)}function Ve(t){return t.toLowerCase()}class E{constructor(e,n){this.attribute=n,this.property=e}}E.prototype.attribute="";E.prototype.booleanish=!1;E.prototype.boolean=!1;E.prototype.commaOrSpaceSeparated=!1;E.prototype.commaSeparated=!1;E.prototype.defined=!1;E.prototype.mustUseProperty=!1;E.prototype.number=!1;E.prototype.overloadedBoolean=!1;E.prototype.property="";E.prototype.spaceSeparated=!1;E.prototype.space=void 0;let gr=0;const k=F(),N=F(),Ke=F(),f=F(),v=F(),V=F(),O=F();function F(){return 2**++gr}var Ye=Object.freeze({__proto__:null,boolean:k,booleanish:N,commaOrSpaceSeparated:O,commaSeparated:V,number:f,overloadedBoolean:Ke,spaceSeparated:v});const Me=Object.keys(Ye);class Ze extends E{constructor(e,n,r,o){let i=-1;if(super(e,n),vt(this,"space",o),typeof r=="number")for(;++i<Me.length;){const s=Me[i];vt(this,Me[i],(r&Ye[s])===Ye[s])}}}Ze.prototype.defined=!0;function vt(t,e,n){n&&(t[e]=n)}function X(t){const e={},n={};for(const[r,o]of Object.entries(t.properties)){const i=new Ze(r,t.transform(t.attributes||{},r),o,t.space);t.mustUseProperty&&t.mustUseProperty.includes(r)&&(i.mustUseProperty=!0),e[r]=i,n[Ve(r)]=r,n[Ve(i.attribute)]=r}return new ae(e,n,t.space)}const en=X({properties:{ariaActiveDescendant:null,ariaAtomic:N,ariaAutoComplete:null,ariaBusy:N,ariaChecked:N,ariaColCount:f,ariaColIndex:f,ariaColSpan:f,ariaControls:v,ariaCurrent:null,ariaDescribedBy:v,ariaDetails:null,ariaDisabled:N,ariaDropEffect:v,ariaErrorMessage:null,ariaExpanded:N,ariaFlowTo:v,ariaGrabbed:N,ariaHasPopup:null,ariaHidden:N,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:v,ariaLevel:f,ariaLive:null,ariaModal:N,ariaMultiLine:N,ariaMultiSelectable:N,ariaOrientation:null,ariaOwns:v,ariaPlaceholder:null,ariaPosInSet:f,ariaPressed:N,ariaReadOnly:N,ariaRelevant:null,ariaRequired:N,ariaRoleDescription:v,ariaRowCount:f,ariaRowIndex:f,ariaRowSpan:f,ariaSelected:N,ariaSetSize:f,ariaSort:null,ariaValueMax:f,ariaValueMin:f,ariaValueNow:f,ariaValueText:null,role:null},transform(t,e){return e==="role"?e:"aria-"+e.slice(4).toLowerCase()}});function tn(t,e){return e in t?t[e]:e}function nn(t,e){return tn(t,e.toLowerCase())}const yr=X({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:V,acceptCharset:v,accessKey:v,action:null,allow:null,allowFullScreen:k,allowPaymentRequest:k,allowUserMedia:k,alt:null,as:null,async:k,autoCapitalize:null,autoComplete:v,autoFocus:k,autoPlay:k,blocking:v,capture:null,charSet:null,checked:k,cite:null,className:v,cols:f,colSpan:null,content:null,contentEditable:N,controls:k,controlsList:v,coords:f|V,crossOrigin:null,data:null,dateTime:null,decoding:null,default:k,defer:k,dir:null,dirName:null,disabled:k,download:Ke,draggable:N,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:k,formTarget:null,headers:v,height:f,hidden:Ke,high:f,href:null,hrefLang:null,htmlFor:v,httpEquiv:v,id:null,imageSizes:null,imageSrcSet:null,inert:k,inputMode:null,integrity:null,is:null,isMap:k,itemId:null,itemProp:v,itemRef:v,itemScope:k,itemType:v,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:k,low:f,manifest:null,max:null,maxLength:f,media:null,method:null,min:null,minLength:f,multiple:k,muted:k,name:null,nonce:null,noModule:k,noValidate:k,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:k,optimum:f,pattern:null,ping:v,placeholder:null,playsInline:k,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:k,referrerPolicy:null,rel:v,required:k,reversed:k,rows:f,rowSpan:f,sandbox:v,scope:null,scoped:k,seamless:k,selected:k,shadowRootClonable:k,shadowRootDelegatesFocus:k,shadowRootMode:null,shape:null,size:f,sizes:null,slot:null,span:f,spellCheck:N,src:null,srcDoc:null,srcLang:null,srcSet:null,start:f,step:null,style:null,tabIndex:f,target:null,title:null,translate:null,type:null,typeMustMatch:k,useMap:null,value:N,width:f,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:v,axis:null,background:null,bgColor:null,border:f,borderColor:null,bottomMargin:f,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:k,declare:k,event:null,face:null,frame:null,frameBorder:null,hSpace:f,leftMargin:f,link:null,longDesc:null,lowSrc:null,marginHeight:f,marginWidth:f,noResize:k,noHref:k,noShade:k,noWrap:k,object:null,profile:null,prompt:null,rev:null,rightMargin:f,rules:null,scheme:null,scrolling:N,standby:null,summary:null,text:null,topMargin:f,valueType:null,version:null,vAlign:null,vLink:null,vSpace:f,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:k,disableRemotePlayback:k,prefix:null,property:null,results:f,security:null,unselectable:null},space:"html",transform:nn}),br=X({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:O,accentHeight:f,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:f,amplitude:f,arabicForm:null,ascent:f,attributeName:null,attributeType:null,azimuth:f,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:f,by:null,calcMode:null,capHeight:f,className:v,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:f,diffuseConstant:f,direction:null,display:null,dur:null,divisor:f,dominantBaseline:null,download:k,dx:null,dy:null,edgeMode:null,editable:null,elevation:f,enableBackground:null,end:null,event:null,exponent:f,externalResourcesRequired:null,fill:null,fillOpacity:f,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:V,g2:V,glyphName:V,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:f,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:f,horizOriginX:f,horizOriginY:f,id:null,ideographic:f,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:f,k:f,k1:f,k2:f,k3:f,k4:f,kernelMatrix:O,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:f,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:f,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:f,overlineThickness:f,paintOrder:null,panose1:null,path:null,pathLength:f,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:v,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:f,pointsAtY:f,pointsAtZ:f,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:O,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:O,rev:O,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:O,requiredFeatures:O,requiredFonts:O,requiredFormats:O,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:f,specularExponent:f,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:f,strikethroughThickness:f,string:null,stroke:null,strokeDashArray:O,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:f,strokeOpacity:f,strokeWidth:null,style:null,surfaceScale:f,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:O,tabIndex:f,tableValues:null,target:null,targetX:f,targetY:f,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:O,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:f,underlineThickness:f,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:f,values:null,vAlphabetic:f,vMathematical:f,vectorEffect:null,vHanging:f,vIdeographic:f,version:null,vertAdvY:f,vertOriginX:f,vertOriginY:f,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:f,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:tn}),rn=X({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(t,e){return"xlink:"+e.slice(5).toLowerCase()}}),on=X({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:nn}),sn=X({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(t,e){return"xml:"+e.slice(3).toLowerCase()}}),_r=/[A-Z]/g,Ct=/-[a-z]/g,Sr=/^data[-\w.:]+$/i;function kr(t,e){const n=Ve(e);let r=e,o=E;if(n in t.normal)return t.property[t.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Sr.test(e)){if(e.charAt(4)==="-"){const i=e.slice(5).replace(Ct,vr);r="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=e.slice(4);if(!Ct.test(i)){let s=i.replace(_r,wr);s.charAt(0)!=="-"&&(s="-"+s),e="data"+s}}o=Ze}return new o(r,e)}function wr(t){return"-"+t.toLowerCase()}function vr(t){return t.charAt(1).toUpperCase()}const Cr=Zt([en,yr,rn,on,sn],"html"),an=Zt([en,br,rn,on,sn],"svg"),Nt={}.hasOwnProperty;function Nr(t,e){const n=e||{};function r(o,...i){let s=r.invalid;const l=r.handlers;if(o&&Nt.call(o,t)){const a=String(o[t]);s=Nt.call(l,a)?l[a]:r.unknown}if(s)return s.call(this,o,...i)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Rr=/["&'<>`]/g,xr=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Lr=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Tr=/[|\\{}()[\]^$+*?.]/g,Rt=new WeakMap;function Ar(t,e){if(t=t.replace(e.subset?Pr(e.subset):Rr,r),e.subset||e.escapeOnly)return t;return t.replace(xr,n).replace(Lr,r);function n(o,i,s){return e.format((o.charCodeAt(0)-55296)*1024+o.charCodeAt(1)-56320+65536,s.charCodeAt(i+2),e)}function r(o,i,s){return e.format(o.charCodeAt(0),s.charCodeAt(i+1),e)}}function Pr(t){let e=Rt.get(t);return e||(e=Er(t),Rt.set(t,e)),e}function Er(t){const e=[];let n=-1;for(;++n<t.length;)e.push(t[n].replace(Tr,"\\$&"));return new RegExp("(?:"+e.join("|")+")","g")}const Ir=/[\dA-Fa-f]/;function Or(t,e,n){const r="&#x"+t.toString(16).toUpperCase();return n&&e&&!Ir.test(String.fromCharCode(e))?r:r+";"}const Mr=/\d/;function Br(t,e,n){const r="&#"+String(t);return n&&e&&!Mr.test(String.fromCharCode(e))?r:r+";"}const Dr=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Be={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},Gr=["cent","copy","divide","gt","lt","not","para","times"],ln={}.hasOwnProperty,Je={};let ce;for(ce in Be)ln.call(Be,ce)&&(Je[Be[ce]]=ce);const jr=/[^\dA-Za-z]/;function $r(t,e,n,r){const o=String.fromCharCode(t);if(ln.call(Je,o)){const i=Je[o],s="&"+i;return n&&Dr.includes(i)&&!Gr.includes(i)&&(!r||e&&e!==61&&jr.test(String.fromCharCode(e)))?s:s+";"}return""}function Ur(t,e,n){let r=Or(t,e,n.omitOptionalSemicolons),o;if((n.useNamedReferences||n.useShortestReferences)&&(o=$r(t,e,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!o)&&n.useShortestReferences){const i=Br(t,e,n.omitOptionalSemicolons);i.length<r.length&&(r=i)}return o&&(!n.useShortestReferences||o.length<r.length)?o:r}function K(t,e){return Ar(t,Object.assign({format:Ur},e))}const Hr=/^>|^->|<!--|-->|--!>|<!-$/g,Fr=[">"],Wr=["<",">"];function zr(t,e,n,r){return r.settings.bogusComments?"<?"+K(t.value,Object.assign({},r.settings.characterReferences,{subset:Fr}))+">":"<!--"+t.value.replace(Hr,o)+"-->";function o(i){return K(i,Object.assign({},r.settings.characterReferences,{subset:Wr}))}}function qr(t,e,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function xt(t,e){const n=String(t);if(typeof e!="string")throw new TypeError("Expected character");let r=0,o=n.indexOf(e);for(;o!==-1;)r++,o=n.indexOf(e,o+e.length);return r}function Vr(t,e){const n=e||{};return(t[t.length-1]===""?[...t,""]:t).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Kr(t){return t.join(" ").trim()}const Yr=/[ \t\n\f\r]/g;function et(t){return typeof t=="object"?t.type==="text"?Lt(t.value):!1:Lt(t)}function Lt(t){return t.replace(Yr,"")===""}const L=un(1),cn=un(-1),Jr=[];function un(t){return e;function e(n,r,o){const i=n?n.children:Jr;let s=(r||0)+t,l=i[s];if(!o)for(;l&&et(l);)s+=t,l=i[s];return l}}const Xr={}.hasOwnProperty;function pn(t){return e;function e(n,r,o){return Xr.call(t,n.tagName)&&t[n.tagName](n,r,o)}}const tt=pn({body:Zr,caption:De,colgroup:De,dd:ro,dt:no,head:De,html:Qr,li:to,optgroup:oo,option:io,p:eo,rp:Tt,rt:Tt,tbody:ao,td:At,tfoot:lo,th:At,thead:so,tr:co});function De(t,e,n){const r=L(n,e,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&et(r.value.charAt(0)))}function Qr(t,e,n){const r=L(n,e);return!r||r.type!=="comment"}function Zr(t,e,n){const r=L(n,e);return!r||r.type!=="comment"}function eo(t,e,n){const r=L(n,e);return r?r.type==="element"&&(r.tagName==="address"||r.tagName==="article"||r.tagName==="aside"||r.tagName==="blockquote"||r.tagName==="details"||r.tagName==="div"||r.tagName==="dl"||r.tagName==="fieldset"||r.tagName==="figcaption"||r.tagName==="figure"||r.tagName==="footer"||r.tagName==="form"||r.tagName==="h1"||r.tagName==="h2"||r.tagName==="h3"||r.tagName==="h4"||r.tagName==="h5"||r.tagName==="h6"||r.tagName==="header"||r.tagName==="hgroup"||r.tagName==="hr"||r.tagName==="main"||r.tagName==="menu"||r.tagName==="nav"||r.tagName==="ol"||r.tagName==="p"||r.tagName==="pre"||r.tagName==="section"||r.tagName==="table"||r.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function to(t,e,n){const r=L(n,e);return!r||r.type==="element"&&r.tagName==="li"}function no(t,e,n){const r=L(n,e);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function ro(t,e,n){const r=L(n,e);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function Tt(t,e,n){const r=L(n,e);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function oo(t,e,n){const r=L(n,e);return!r||r.type==="element"&&r.tagName==="optgroup"}function io(t,e,n){const r=L(n,e);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function so(t,e,n){const r=L(n,e);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function ao(t,e,n){const r=L(n,e);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function lo(t,e,n){return!L(n,e)}function co(t,e,n){const r=L(n,e);return!r||r.type==="element"&&r.tagName==="tr"}function At(t,e,n){const r=L(n,e);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const uo=pn({body:ho,colgroup:fo,head:mo,html:po,tbody:go});function po(t){const e=L(t,-1);return!e||e.type!=="comment"}function mo(t){const e=new Set;for(const r of t.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(e.has(r.tagName))return!1;e.add(r.tagName)}const n=t.children[0];return!n||n.type==="element"}function ho(t){const e=L(t,-1,!0);return!e||e.type!=="comment"&&!(e.type==="text"&&et(e.value.charAt(0)))&&!(e.type==="element"&&(e.tagName==="meta"||e.tagName==="link"||e.tagName==="script"||e.tagName==="style"||e.tagName==="template"))}function fo(t,e,n){const r=cn(n,e),o=L(t,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&tt(r,n.children.indexOf(r),n)?!1:!!(o&&o.type==="element"&&o.tagName==="col")}function go(t,e,n){const r=cn(n,e),o=L(t,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&tt(r,n.children.indexOf(r),n)?!1:!!(o&&o.type==="element"&&o.tagName==="tr")}const ue={name:[[`
4
4
  \f\r &/=>`.split(""),`
5
5
  \f\r "&'/=>\``.split("")],[`\0
6
6
  \f\r "&'/<=>`.split(""),`\0
@@ -8,5 +8,5 @@ let R=class extends Error{constructor(e){super(e),this.name="ShikiError"}};funct
8
8
  \f\r &>`.split(""),`\0
9
9
  \f\r "&'<=>\``.split("")],[`\0
10
10
  \f\r "&'<=>\``.split(""),`\0
11
- \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function di(t,e,n,r){const i=r.schema,o=i.space==="svg"?!1:r.settings.omitOptionalTags;let s=i.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(t.tagName.toLowerCase());const l=[];let a;i.space==="html"&&t.tagName==="svg"&&(r.schema=sn);const c=fi(r,t.properties),u=r.all(i.space==="html"&&t.tagName==="template"?t.content:t);return r.schema=i,u&&(s=!1),(c||!o||!li(t,e,n))&&(l.push("<",t.tagName,c?" "+c:""),s&&(i.space==="svg"||r.settings.closeSelfClosing)&&(a=c.charAt(c.length-1),(!r.settings.tightSelfClosing||a==="/"||a&&a!=='"'&&a!=="'")&&l.push(" "),l.push("/")),l.push(">")),l.push(u),!s&&(!o||!et(t,e,n))&&l.push("</"+t.tagName+">"),l.join("")}function fi(t,e){const n=[];let r=-1,i;if(e){for(i in e)if(e[i]!==null&&e[i]!==void 0){const o=gi(t,i,e[i]);o&&n.push(o)}}for(;++r<n.length;){const o=t.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&o!=='"'&&o!=="'"&&(n[r]+=" ")}return n.join("")}function gi(t,e,n){const r=br(t.schema,e),i=t.settings.allowParseErrors&&t.schema.space==="html"?0:1,o=t.settings.allowDangerousCharacters?0:1;let s=t.quote,l;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const a=K(r.attribute,Object.assign({},t.settings.characterReferences,{subset:ue.name[i][o]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?zr:qr)(n,{padLeft:!t.settings.tightCommaSeparatedLists}):String(n),t.settings.collapseEmptyAttributes&&!n)?a:(t.settings.preferUnquoted&&(l=K(n,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:ue.unquoted[i][o]}))),l!==n&&(t.settings.quoteSmart&&Rt(n,s)>Rt(n,t.alternative)&&(s=t.alternative),l=s+K(n,Object.assign({},t.settings.characterReferences,{subset:(s==="'"?ue.single:ue.double)[i][o],attribute:!0}))+s),a+(l&&"="+l))}const yi=["<","&"];function pn(t,e,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:K(t.value,Object.assign({},r.settings.characterReferences,{subset:yi}))}function _i(t,e,n,r){return r.settings.allowDangerousHtml?t.value:pn(t,e,n,r)}function bi(t,e,n,r){return r.all(t)}const Si=Cr("type",{invalid:ki,unknown:wi,handlers:{comment:Fr,doctype:Wr,element:di,raw:_i,root:bi,text:pn}});function ki(t){throw new Error("Expected node, not `"+t+"`")}function wi(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const Ci={},vi={},Ni=[];function Ri(t,e){const n=e||Ci,r=n.quote||'"',i=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Li,all:xi,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||hr,characterReferences:n.characterReferences||vi,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?sn:wr,quote:r,alternative:i}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function Li(t,e,n){return Si(t,e,n,this)}function xi(t){const e=[],n=t&&t.children||Ni;let r=-1;for(;++r<n.length;)e[r]=this.one(n[r],r,t);return e.join("")}function be(t,e){const n=typeof t=="string"?{}:{...t.colorReplacements},r=typeof t=="string"?t:t.name;for(const[i,o]of Object.entries(e?.colorReplacements||{}))typeof o=="string"?n[i]=o:i===r&&Object.assign(n,o);return n}function j(t,e){return t&&(e?.[t?.toLowerCase()]||t)}function Ti(t){return Array.isArray(t)?t:[t]}async function mn(t){return Promise.resolve(typeof t=="function"?t():t).then(e=>e.default||e)}function tt(t){return!t||["plaintext","txt","text","plain"].includes(t)}function hn(t){return t==="ansi"||tt(t)}function nt(t){return t==="none"}function dn(t){return nt(t)}function fn(t,e){if(!e)return t;t.properties||={},t.properties.class||=[],typeof t.properties.class=="string"&&(t.properties.class=t.properties.class.split(/\s+/g)),Array.isArray(t.properties.class)||(t.properties.class=[]);const n=Array.isArray(e)?e:e.split(/\s+/g);for(const r of n)r&&!t.properties.class.includes(r)&&t.properties.class.push(r);return t}function ve(t,e=!1){if(t.length===0)return[["",0]];const n=t.split(/(\r?\n)/g);let r=0;const i=[];for(let o=0;o<n.length;o+=2){const s=e?n[o]+(n[o+1]||""):n[o];i.push([s,r]),r+=n[o].length,r+=n[o+1]?.length||0}return i}function Ai(t){const e=ve(t,!0).map(([i])=>i);function n(i){if(i===t.length)return{line:e.length-1,character:e[e.length-1].length};let o=i,s=0;for(const l of e){if(o<l.length)break;o-=l.length,s++}return{line:s,character:o}}function r(i,o){let s=0;for(let l=0;l<i;l++)s+=e[l].length;return s+=o,s}return{lines:e,indexToPos:n,posToIndex:r}}const rt="light-dark()",Pi=["color","background-color"];function Ei(t,e){let n=0;const r=[];for(const i of e)i>n&&r.push({...t,content:t.content.slice(n,i),offset:t.offset+n}),n=i;return n<t.content.length&&r.push({...t,content:t.content.slice(n),offset:t.offset+n}),r}function Ii(t,e){const n=Array.from(e instanceof Set?e:new Set(e)).sort((r,i)=>r-i);return n.length?t.map(r=>r.flatMap(i=>{const o=n.filter(s=>i.offset<s&&s<i.offset+i.content.length).map(s=>s-i.offset).sort((s,l)=>s-l);return o.length?Ei(i,o):i})):t}function Oi(t,e,n,r,i="css-vars"){const o={content:t.content,explanation:t.explanation,offset:t.offset},s=e.map(u=>Se(t.variants[u])),l=new Set(s.flatMap(u=>Object.keys(u))),a={},c=(u,p)=>{const d=p==="color"?"":p==="background-color"?"-bg":`-${p}`;return n+e[u]+(p==="color"?"":d)};return s.forEach((u,p)=>{for(const d of l){const m=u[d]||"inherit";if(p===0&&r&&Pi.includes(d))if(r===rt&&s.length>1){const h=e.findIndex(b=>b==="light"),_=e.findIndex(b=>b==="dark");if(h===-1||_===-1)throw new R('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const S=s[h][d]||"inherit",y=s[_][d]||"inherit";a[d]=`light-dark(${S}, ${y})`,i==="css-vars"&&(a[c(p,d)]=m)}else a[d]=m;else i==="css-vars"&&(a[c(p,d)]=m)}}),o.htmlStyle=a,o}function Se(t){const e={};if(t.color&&(e.color=t.color),t.bgColor&&(e["background-color"]=t.bgColor),t.fontStyle){t.fontStyle&P.Italic&&(e["font-style"]="italic"),t.fontStyle&P.Bold&&(e["font-weight"]="bold");const n=[];t.fontStyle&P.Underline&&n.push("underline"),t.fontStyle&P.Strikethrough&&n.push("line-through"),n.length&&(e["text-decoration"]=n.join(" "))}return e}function Je(t){return typeof t=="string"?t:Object.entries(t).map(([e,n])=>`${e}:${n}`).join(";")}const gn=new WeakMap;function Ne(t,e){gn.set(t,e)}function oe(t){return gn.get(t)}class Q{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,n){return new Q(Object.fromEntries(Ti(n).map(r=>[r,ze])),e)}constructor(...e){if(e.length===2){const[n,r]=e;this.lang=r,this._stacks=n}else{const[n,r,i]=e;this.lang=r,this._stacks={[i]:n}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return Mi(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function Mi(t){const e=[],n=new Set;function r(i){if(n.has(i))return;n.add(i);const o=i?.nameScopesList?.scopeName;o&&e.push(o),i.parent&&r(i.parent)}return r(t),e}function Bi(t,e){if(!(t instanceof Q))throw new R("Invalid grammar state");return t.getInternalStack(e)}function Di(){const t=new WeakMap;function e(n){if(!t.has(n.meta)){let r=function(s){if(typeof s=="number"){if(s<0||s>n.source.length)throw new R(`Invalid decoration offset: ${s}. Code length: ${n.source.length}`);return{...i.indexToPos(s),offset:s}}else{const l=i.lines[s.line];if(l===void 0)throw new R(`Invalid decoration position ${JSON.stringify(s)}. Lines length: ${i.lines.length}`);let a=s.character;if(a<0&&(a=l.length+a),a<0||a>l.length)throw new R(`Invalid decoration position ${JSON.stringify(s)}. Line ${s.line} length: ${l.length}`);return{...s,character:a,offset:i.posToIndex(s.line,a)}}};const i=Ai(n.source),o=(n.options.decorations||[]).map(s=>({...s,start:r(s.start),end:r(s.end)}));Gi(o),t.set(n.meta,{decorations:o,converter:i,source:n.source})}return t.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(!this.options.decorations?.length)return;const i=e(this).decorations.flatMap(s=>[s.start.offset,s.end.offset]);return Ii(n,i)},code(n){if(!this.options.decorations?.length)return;const r=e(this),i=Array.from(n.children).filter(u=>u.type==="element"&&u.tagName==="span");if(i.length!==r.converter.lines.length)throw new R(`Number of lines in code element (${i.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function o(u,p,d,m){const h=i[u];let _="",S=-1,y=-1;if(p===0&&(S=0),d===0&&(y=0),d===Number.POSITIVE_INFINITY&&(y=h.children.length),S===-1||y===-1)for(let g=0;g<h.children.length;g++)_+=yn(h.children[g]),S===-1&&_.length===p&&(S=g+1),y===-1&&_.length===d&&(y=g+1);if(S===-1)throw new R(`Failed to find start index for decoration ${JSON.stringify(m.start)}`);if(y===-1)throw new R(`Failed to find end index for decoration ${JSON.stringify(m.end)}`);const b=h.children.slice(S,y);if(!m.alwaysWrap&&b.length===h.children.length)l(h,m,"line");else if(!m.alwaysWrap&&b.length===1&&b[0].type==="element")l(b[0],m,"token");else{const g={type:"element",tagName:"span",properties:{},children:b};l(g,m,"wrapper"),h.children.splice(S,b.length,g)}}function s(u,p){i[u]=l(i[u],p,"line")}function l(u,p,d){const m=p.properties||{},h=p.transform||(_=>_);return u.tagName=p.tagName||"span",u.properties={...u.properties,...m,class:u.properties.class},p.properties?.class&&fn(u,p.properties.class),u=h(u,d)||u,u}const a=[],c=r.decorations.sort((u,p)=>p.start.offset-u.start.offset||u.end.offset-p.end.offset);for(const u of c){const{start:p,end:d}=u;if(p.line===d.line)o(p.line,p.character,d.character,u);else if(p.line<d.line){o(p.line,p.character,Number.POSITIVE_INFINITY,u);for(let m=p.line+1;m<d.line;m++)a.unshift(()=>s(m,u));o(d.line,0,d.character,u)}}a.forEach(u=>u())}}}function Gi(t){for(let e=0;e<t.length;e++){const n=t[e];if(n.start.offset>n.end.offset)throw new R(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=e+1;r<t.length;r++){const i=t[r],o=n.start.offset<=i.start.offset&&i.start.offset<n.end.offset,s=n.start.offset<i.end.offset&&i.end.offset<=n.end.offset,l=i.start.offset<=n.start.offset&&n.start.offset<i.end.offset,a=i.start.offset<n.end.offset&&n.end.offset<=i.end.offset;if(o||s||l||a){if(o&&s||l&&a||l&&n.start.offset===n.end.offset||s&&i.start.offset===i.end.offset)continue;throw new R(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(i.start)} intersect.`)}}}}function yn(t){return t.type==="text"?t.value:t.type==="element"?t.children.map(yn).join(""):""}const ji=[Di()];function ke(t){const e=$i(t.transformers||[]);return[...e.pre,...e.normal,...e.post,...ji]}function $i(t){const e=[],n=[],r=[];for(const i of t)switch(i.enforce){case"pre":e.push(i);break;case"post":n.push(i);break;default:r.push(i)}return{pre:e,post:n,normal:r}}var H=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],De={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function Ui(t,e){const n=t.indexOf("\x1B",e);if(n!==-1&&t[n+1]==="["){const r=t.indexOf("m",n);if(r!==-1)return{sequence:t.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:t.length}}function At(t){const e=t.shift();if(e==="2"){const n=t.splice(0,3).map(r=>Number.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}else if(e==="5"){const n=t.shift();if(n)return{type:"table",index:Number(n)}}}function Hi(t){const e=[];for(;t.length>0;){const n=t.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)e.push({type:"resetAll"});else if(r<=9)De[r]&&e.push({type:"setDecoration",value:De[r]});else if(r<=29){const i=De[r-20];i&&(e.push({type:"resetDecoration",value:i}),i==="dim"&&e.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)e.push({type:"setForegroundColor",value:{type:"named",name:H[r-30]}});else if(r===38){const i=At(t);i&&e.push({type:"setForegroundColor",value:i})}else if(r===39)e.push({type:"resetForegroundColor"});else if(r<=47)e.push({type:"setBackgroundColor",value:{type:"named",name:H[r-40]}});else if(r===48){const i=At(t);i&&e.push({type:"setBackgroundColor",value:i})}else r===49?e.push({type:"resetBackgroundColor"}):r===53?e.push({type:"setDecoration",value:"overline"}):r===55?e.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?e.push({type:"setForegroundColor",value:{type:"named",name:H[r-90+8]}}):r>=100&&r<=107&&e.push({type:"setBackgroundColor",value:{type:"named",name:H[r-100+8]}})}return e}function Fi(){let t=null,e=null,n=new Set;return{parse(r){const i=[];let o=0;do{const s=Ui(r,o),l=s.sequence?r.substring(o,s.startPosition):r.substring(o);if(l.length>0&&i.push({value:l,foreground:t,background:e,decorations:new Set(n)}),s.sequence){const a=Hi(s.sequence);for(const c of a)c.type==="resetAll"?(t=null,e=null,n.clear()):c.type==="resetForegroundColor"?t=null:c.type==="resetBackgroundColor"?e=null:c.type==="resetDecoration"&&n.delete(c.value);for(const c of a)c.type==="setForegroundColor"?t=c.value:c.type==="setBackgroundColor"?e=c.value:c.type==="setDecoration"&&n.add(c.value)}o=s.position}while(o<r.length);return i}}}var Wi={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function zi(t=Wi){function e(l){return t[l]}function n(l){return`#${l.map(a=>Math.max(0,Math.min(a,255)).toString(16).padStart(2,"0")).join("")}`}let r;function i(){if(r)return r;r=[];for(let c=0;c<H.length;c++)r.push(e(H[c]));let l=[0,95,135,175,215,255];for(let c=0;c<6;c++)for(let u=0;u<6;u++)for(let p=0;p<6;p++)r.push(n([l[c],l[u],l[p]]));let a=8;for(let c=0;c<24;c++,a+=10)r.push(n([a,a,a]));return r}function o(l){return i()[l]}function s(l){switch(l.type){case"named":return e(l.name);case"rgb":return n(l.rgb);case"table":return o(l.index)}}return{value:s}}const qi={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function Vi(t,e,n){const r=be(t,n),i=ve(e),o=Object.fromEntries(H.map(a=>{const c=`terminal.ansi${a[0].toUpperCase()}${a.substring(1)}`,u=t.colors?.[c];return[a,u||qi[a]]})),s=zi(o),l=Fi();return i.map(a=>l.parse(a[0]).map(c=>{let u,p;c.decorations.has("reverse")?(u=c.background?s.value(c.background):t.bg,p=c.foreground?s.value(c.foreground):t.fg):(u=c.foreground?s.value(c.foreground):t.fg,p=c.background?s.value(c.background):void 0),u=j(u,r),p=j(p,r),c.decorations.has("dim")&&(u=Ki(u));let d=P.None;return c.decorations.has("bold")&&(d|=P.Bold),c.decorations.has("italic")&&(d|=P.Italic),c.decorations.has("underline")&&(d|=P.Underline),c.decorations.has("strikethrough")&&(d|=P.Strikethrough),{content:c.value,offset:a[1],color:u,bgColor:p,fontStyle:d}}))}function Ki(t){const e=t.match(/#([0-9a-f]{3,8})/i);if(e){const r=e[1];if(r.length===8){const i=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${i}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const i=r[0],o=r[1],s=r[2],l=r[3],a=Math.round(Number.parseInt(`${l}${l}`,16)/2).toString(16).padStart(2,"0");return`#${i}${i}${o}${o}${s}${s}${a}`}else if(r.length===3){const i=r[0],o=r[1],s=r[2];return`#${i}${i}${o}${o}${s}${s}80`}}}const n=t.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:t}function it(t,e,n={}){const{theme:r=t.getLoadedThemes()[0]}=n,i=t.resolveLangAlias(n.lang||"text");if(tt(i)||nt(r))return ve(e).map(a=>[{content:a[0],offset:a[1]}]);const{theme:o,colorMap:s}=t.setTheme(r);if(i==="ansi")return Vi(o,e,n);const l=t.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==l.name)throw new R(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${l.name}"`);if(!n.grammarState.themes.includes(o.name))throw new R(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${o.name}"`)}return Ji(e,l,o,s,n)}function Yi(...t){if(t.length===2)return oe(t[1]);const[e,n,r={}]=t,{lang:i="text",theme:o=e.getLoadedThemes()[0]}=r;if(tt(i)||nt(o))throw new R("Plain language does not have grammar state");if(i==="ansi")throw new R("ANSI language does not have grammar state");const{theme:s,colorMap:l}=e.setTheme(o),a=e.getLanguage(i);return new Q(ot(n,a,s,l,r).stateStack,a.name,s.name)}function Ji(t,e,n,r,i){const o=ot(t,e,n,r,i),s=new Q(o.stateStack,e.name,n.name);return Ne(o.tokens,s),o.tokens}function ot(t,e,n,r,i){const o=be(n,i),{tokenizeMaxLineLength:s=0,tokenizeTimeLimit:l=500}=i,a=ve(t);let c=i.grammarState?Bi(i.grammarState,n.name)??ze:i.grammarContextCode!=null?ot(i.grammarContextCode,e,n,r,{...i,grammarState:void 0,grammarContextCode:void 0}).stateStack:ze,u=[];const p=[];for(let d=0,m=a.length;d<m;d++){const[h,_]=a[d];if(h===""){u=[],p.push([]);continue}if(s>0&&h.length>=s){u=[],p.push([{content:h,offset:_,color:"",fontStyle:0}]);continue}let S,y,b;i.includeExplanation&&(S=e.tokenizeLine(h,c,l),y=S.tokens,b=0);const g=e.tokenizeLine2(h,c,l),w=g.tokens.length/2;for(let v=0;v<w;v++){const I=g.tokens[2*v],$=v+1<w?g.tokens[2*v+2]:h.length;if(I===$)continue;const pt=g.tokens[2*v+1],Nn=j(r[Y.getForeground(pt)],o),Rn=Y.getFontStyle(pt),Te={content:h.substring(I,$),offset:_+I,color:Nn,fontStyle:Rn};if(i.includeExplanation){const mt=[];if(i.includeExplanation!=="scopeName")for(const G of n.settings){let W;switch(typeof G.scope){case"string":W=G.scope.split(/,/).map(Ae=>Ae.trim());break;case"object":W=G.scope;break;default:continue}mt.push({settings:G,selectors:W.map(Ae=>Ae.split(/ /))})}Te.explanation=[];let ht=0;for(;I+ht<$;){const G=y[b],W=h.substring(G.startIndex,G.endIndex);ht+=W.length,Te.explanation.push({content:W,scopes:i.includeExplanation==="scopeName"?Xi(G.scopes):Qi(mt,G.scopes)}),b+=1}}u.push(Te)}p.push(u),u=[],c=g.ruleStack}return{tokens:p,stateStack:c}}function Xi(t){return t.map(e=>({scopeName:e}))}function Qi(t,e){const n=[];for(let r=0,i=e.length;r<i;r++){const o=e[r];n[r]={scopeName:o,themeMatches:eo(t,o,e.slice(0,r))}}return n}function Pt(t,e){return t===e||e.substring(0,t.length)===t&&e[t.length]==="."}function Zi(t,e,n){if(!Pt(t[t.length-1],e))return!1;let r=t.length-2,i=n.length-1;for(;r>=0&&i>=0;)Pt(t[r],n[i])&&(r-=1),i-=1;return r===-1}function eo(t,e,n){const r=[];for(const{selectors:i,settings:o}of t)for(const s of i)if(Zi(s,e,n)){r.push(o);break}return r}function _n(t,e,n){const r=Object.entries(n.themes).filter(a=>a[1]).map(a=>({color:a[0],theme:a[1]})),i=r.map(a=>{const c=it(t,e,{...n,theme:a.theme}),u=oe(c),p=typeof a.theme=="string"?a.theme:a.theme.name;return{tokens:c,state:u,theme:p}}),o=to(...i.map(a=>a.tokens)),s=o[0].map((a,c)=>a.map((u,p)=>{const d={content:u.content,variants:{},offset:u.offset};return"includeExplanation"in n&&n.includeExplanation&&(d.explanation=u.explanation),o.forEach((m,h)=>{const{content:_,explanation:S,offset:y,...b}=m[c][p];d.variants[r[h].color]=b}),d})),l=i[0].state?new Q(Object.fromEntries(i.map(a=>[a.theme,a.state?.getInternalStack(a.theme)])),i[0].state.lang):void 0;return l&&Ne(s,l),s}function to(...t){const e=t.map(()=>[]),n=t.length;for(let r=0;r<t[0].length;r++){const i=t.map(a=>a[r]),o=e.map(()=>[]);e.forEach((a,c)=>a.push(o[c]));const s=i.map(()=>0),l=i.map(a=>a[0]);for(;l.every(a=>a);){const a=Math.min(...l.map(c=>c.content.length));for(let c=0;c<n;c++){const u=l[c];u.content.length===a?(o[c].push(u),s[c]+=1,l[c]=i[c][s[c]]):(o[c].push({...u,content:u.content.slice(0,a)}),l[c]={...u,content:u.content.slice(a),offset:u.offset+a})}}}return e}function we(t,e,n){let r,i,o,s,l,a;if("themes"in n){const{defaultColor:c="light",cssVariablePrefix:u="--shiki-",colorsRendering:p="css-vars"}=n,d=Object.entries(n.themes).filter(y=>y[1]).map(y=>({color:y[0],theme:y[1]})).sort((y,b)=>y.color===c?-1:b.color===c?1:0);if(d.length===0)throw new R("`themes` option must not be empty");const m=_n(t,e,n);if(a=oe(m),c&&rt!==c&&!d.find(y=>y.color===c))throw new R(`\`themes\` option must contain the defaultColor key \`${c}\``);const h=d.map(y=>t.getTheme(y.theme)),_=d.map(y=>y.color);o=m.map(y=>y.map(b=>Oi(b,_,u,c,p))),a&&Ne(o,a);const S=d.map(y=>be(y.theme,n));i=Et(d,h,S,u,c,"fg",p),r=Et(d,h,S,u,c,"bg",p),s=`shiki-themes ${h.map(y=>y.name).join(" ")}`,l=c?void 0:[i,r].join(";")}else if("theme"in n){const c=be(n.theme,n);o=it(t,e,n);const u=t.getTheme(n.theme);r=j(u.bg,c),i=j(u.fg,c),s=u.name,a=oe(o)}else throw new R("Invalid options, either `theme` or `themes` must be provided");return{tokens:o,fg:i,bg:r,themeName:s,rootStyle:l,grammarState:a}}function Et(t,e,n,r,i,o,s){return t.map((l,a)=>{const c=j(e[a][o],n[a])||"inherit",u=`${r+l.color}${o==="bg"?"-bg":""}:${c}`;if(a===0&&i){if(i===rt&&t.length>1){const p=t.findIndex(_=>_.color==="light"),d=t.findIndex(_=>_.color==="dark");if(p===-1||d===-1)throw new R('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const m=j(e[p][o],n[p])||"inherit",h=j(e[d][o],n[d])||"inherit";return`light-dark(${m}, ${h});${u}`}return c}return s==="css-vars"?u:null}).filter(l=>!!l).join(";")}function Ce(t,e,n,r={meta:{},options:n,codeToHast:(i,o)=>Ce(t,i,o),codeToTokens:(i,o)=>we(t,i,o)}){let i=e;for(const h of ke(n))i=h.preprocess?.call(r,i,n)||i;let{tokens:o,fg:s,bg:l,themeName:a,rootStyle:c,grammarState:u}=we(t,i,n);const{mergeWhitespaces:p=!0,mergeSameStyleTokens:d=!1}=n;p===!0?o=ro(o):p==="never"&&(o=io(o)),d&&(o=oo(o));const m={...r,get source(){return i}};for(const h of ke(n))o=h.tokens?.call(m,o)||o;return no(o,{...n,fg:s,bg:l,themeName:a,rootStyle:n.rootStyle===!1?!1:n.rootStyle??c},m,u)}function no(t,e,n,r=oe(t)){const i=ke(e),o=[],s={type:"root",children:[]},{structure:l="classic",tabindex:a="0"}=e,c={class:`shiki ${e.themeName||""}`};e.rootStyle!==!1&&(e.rootStyle!=null?c.style=e.rootStyle:c.style=`background-color:${e.bg};color:${e.fg}`),a!==!1&&a!=null&&(c.tabindex=a.toString());for(const[_,S]of Object.entries(e.meta||{}))_.startsWith("_")||(c[_]=S);let u={type:"element",tagName:"pre",properties:c,children:[],data:e.data},p={type:"element",tagName:"code",properties:{},children:o};const d=[],m={...n,structure:l,addClassToHast:fn,get source(){return n.source},get tokens(){return t},get options(){return e},get root(){return s},get pre(){return u},get code(){return p},get lines(){return d}};if(t.forEach((_,S)=>{S&&(l==="inline"?s.children.push({type:"element",tagName:"br",properties:{},children:[]}):l==="classic"&&o.push({type:"text",value:`
12
- `}));let y={type:"element",tagName:"span",properties:{class:"line"},children:[]},b=0;for(const g of _){let w={type:"element",tagName:"span",properties:{...g.htmlAttrs},children:[{type:"text",value:g.content}]};const v=Je(g.htmlStyle||Se(g));v&&(w.properties.style=v);for(const I of i)w=I?.span?.call(m,w,S+1,b,y,g)||w;l==="inline"?s.children.push(w):l==="classic"&&y.children.push(w),b+=g.content.length}if(l==="classic"){for(const g of i)y=g?.line?.call(m,y,S+1)||y;d.push(y),o.push(y)}else l==="inline"&&d.push(y)}),l==="classic"){for(const _ of i)p=_?.code?.call(m,p)||p;u.children.push(p);for(const _ of i)u=_?.pre?.call(m,u)||u;s.children.push(u)}else if(l==="inline"){const _=[];let S={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const g of s.children)g.type==="element"&&g.tagName==="br"?(_.push(S),S={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(g.type==="element"||g.type==="text")&&S.children.push(g);_.push(S);let b={type:"element",tagName:"code",properties:{},children:_};for(const g of i)b=g?.code?.call(m,b)||b;s.children=[];for(let g=0;g<b.children.length;g++){g>0&&s.children.push({type:"element",tagName:"br",properties:{},children:[]});const w=b.children[g];w.type==="element"&&s.children.push(...w.children)}}let h=s;for(const _ of i)h=_?.root?.call(m,h)||h;return r&&Ne(h,r),h}function ro(t){return t.map(e=>{const n=[];let r="",i;return e.forEach((o,s)=>{const a=!(o.fontStyle&&(o.fontStyle&P.Underline||o.fontStyle&P.Strikethrough));a&&o.content.match(/^\s+$/)&&e[s+1]?(i===void 0&&(i=o.offset),r+=o.content):r?(a?n.push({...o,offset:i,content:r+o.content}):n.push({content:r,offset:i},o),i=void 0,r=""):n.push(o)}),n})}function io(t){return t.map(e=>e.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const r=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!r)return n;const[,i,o,s]=r;if(!i&&!s)return n;const l=[{...n,offset:n.offset+i.length,content:o}];return i&&l.unshift({content:i,offset:n.offset}),s&&l.push({content:s,offset:n.offset+i.length+o.length}),l}))}function oo(t){return t.map(e=>{const n=[];for(const r of e){if(n.length===0){n.push({...r});continue}const i=n[n.length-1],o=Je(i.htmlStyle||Se(i)),s=Je(r.htmlStyle||Se(r)),l=i.fontStyle&&(i.fontStyle&P.Underline||i.fontStyle&P.Strikethrough),a=r.fontStyle&&(r.fontStyle&P.Underline||r.fontStyle&P.Strikethrough);!l&&!a&&o===s?i.content+=r.content:n.push({...r})}return n})}const so=Ri;function ao(t,e,n){const r={meta:{},options:n,codeToHast:(o,s)=>Ce(t,o,s),codeToTokens:(o,s)=>we(t,o,s)};let i=so(Ce(t,e,n,r));for(const o of ke(n))i=o.postprocess?.call(r,i,n)||i;return i}const It={light:"#333333",dark:"#bbbbbb"},Ot={light:"#fffffe",dark:"#1e1e1e"},Mt="__shiki_resolved";function st(t){if(t?.[Mt])return t;const e={...t};e.tokenColors&&!e.settings&&(e.settings=e.tokenColors,delete e.tokenColors),e.type||="dark",e.colorReplacements={...e.colorReplacements},e.settings||=[];let{bg:n,fg:r}=e;if(!n||!r){const l=e.settings?e.settings.find(a=>!a.name&&!a.scope):void 0;l?.settings?.foreground&&(r=l.settings.foreground),l?.settings?.background&&(n=l.settings.background),!r&&e?.colors?.["editor.foreground"]&&(r=e.colors["editor.foreground"]),!n&&e?.colors?.["editor.background"]&&(n=e.colors["editor.background"]),r||(r=e.type==="light"?It.light:It.dark),n||(n=e.type==="light"?Ot.light:Ot.dark),e.fg=r,e.bg=n}e.settings[0]&&e.settings[0].settings&&!e.settings[0].scope||e.settings.unshift({settings:{foreground:e.fg,background:e.bg}});let i=0;const o=new Map;function s(l){if(o.has(l))return o.get(l);i+=1;const a=`#${i.toString(16).padStart(8,"0").toLowerCase()}`;return e.colorReplacements?.[`#${a}`]?s(l):(o.set(l,a),a)}e.settings=e.settings.map(l=>{const a=l.settings?.foreground&&!l.settings.foreground.startsWith("#"),c=l.settings?.background&&!l.settings.background.startsWith("#");if(!a&&!c)return l;const u={...l,settings:{...l.settings}};if(a){const p=s(l.settings.foreground);e.colorReplacements[p]=l.settings.foreground,u.settings.foreground=p}if(c){const p=s(l.settings.background);e.colorReplacements[p]=l.settings.background,u.settings.background=p}return u});for(const l of Object.keys(e.colors||{}))if((l==="editor.foreground"||l==="editor.background"||l.startsWith("terminal.ansi"))&&!e.colors[l]?.startsWith("#")){const a=s(e.colors[l]);e.colorReplacements[a]=e.colors[l],e.colors[l]=a}return Object.defineProperty(e,Mt,{enumerable:!1,writable:!1,value:!0}),e}async function bn(t){return Array.from(new Set((await Promise.all(t.filter(e=>!hn(e)).map(async e=>await mn(e).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function Sn(t){return(await Promise.all(t.map(async n=>dn(n)?null:st(await mn(n))))).filter(n=>!!n)}let lo=3;function co(t,e=3){e>lo||console.trace(`[SHIKI DEPRECATE]: ${t}`)}let q=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function kn(t,e){if(!e)return t;if(e[t]){const n=new Set([t]);for(;e[t];){if(t=e[t],n.has(t))throw new q(`Circular alias \`${Array.from(n).join(" -> ")} -> ${t}\``);n.add(t)}}return t}class uo extends mr{constructor(e,n,r,i={}){super(e),this._resolver=e,this._themes=n,this._langs=r,this._alias=i,this._themes.map(o=>this.loadTheme(o)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const n=st(e);return n.name&&(this._resolvedThemes.set(n.name,n),this._loadedThemesCache=null),n}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let n=this._textmateThemeCache.get(e);n||(n=de.createFromRawTheme(e),this._textmateThemeCache.set(e,n)),this._syncRegistry.setTheme(n)}getGrammar(e){return e=kn(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const n=new Set([...this._langMap.values()].filter(o=>o.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const r={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const i=this.loadGrammarWithConfiguration(e.scopeName,1,r);if(i.name=e.name,this._resolvedGrammars.set(e.name,i),e.aliases&&e.aliases.forEach(o=>{this._alias[o]=e.name}),this._loadedLanguagesCache=null,n.size)for(const o of n)this._resolvedGrammars.delete(o.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(o.scopeName),this._syncRegistry?._grammars?.delete(o.scopeName),this.loadLanguage(this._langMap.get(o.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const i of e)this.resolveEmbeddedLanguages(i);const n=Array.from(this._langGraph.entries()),r=n.filter(([i,o])=>!o);if(r.length){const i=n.filter(([o,s])=>s?(s.embeddedLanguages||s.embeddedLangs)?.some(a=>r.map(([c])=>c).includes(a)):!1).filter(o=>!r.includes(o));throw new q(`Missing languages ${r.map(([o])=>`\`${o}\``).join(", ")}, required by ${i.map(([o])=>`\`${o}\``).join(", ")}`)}for(const[i,o]of n)this._resolver.addLanguage(o);for(const[i,o]of n)this.loadLanguage(o)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);const n=e.embeddedLanguages??e.embeddedLangs;if(n)for(const r of n)this._langGraph.set(r,this._langMap.get(r))}}class po{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,n){this._onigLib={createOnigScanner:r=>e.createScanner(r),createOnigString:r=>e.createString(r)},n.forEach(r=>this.addLanguage(r))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(n=>{this._langs.set(n,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(e.scopeName)})}getInjections(e){const n=e.split(".");let r=[];for(let i=1;i<=n.length;i++){const o=n.slice(0,i).join(".");r=[...r,...this._injections.get(o)||[]]}return r}}let Z=0;function mo(t){Z+=1,t.warnings!==!1&&Z>=10&&Z%10===0&&console.warn(`[Shiki] ${Z} 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.`);let e=!1;if(!t.engine)throw new q("`engine` option is required for synchronous mode");const n=(t.langs||[]).flat(1),r=(t.themes||[]).flat(1).map(st),i=new po(t.engine,n),o=new uo(i,r,n,t.langAlias);let s;function l(g){return kn(g,t.langAlias)}function a(g){y();const w=o.getGrammar(typeof g=="string"?g:g.name);if(!w)throw new q(`Language \`${g}\` not found, you may need to load it first`);return w}function c(g){if(g==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};y();const w=o.getTheme(g);if(!w)throw new q(`Theme \`${g}\` not found, you may need to load it first`);return w}function u(g){y();const w=c(g);s!==g&&(o.setTheme(w),s=g);const v=o.getColorMap();return{theme:w,colorMap:v}}function p(){return y(),o.getLoadedThemes()}function d(){return y(),o.getLoadedLanguages()}function m(...g){y(),o.loadLanguages(g.flat(1))}async function h(...g){return m(await bn(g))}function _(...g){y();for(const w of g.flat(1))o.loadTheme(w)}async function S(...g){return y(),_(await Sn(g))}function y(){if(e)throw new q("Shiki instance has been disposed")}function b(){e||(e=!0,o.dispose(),Z-=1)}return{setTheme:u,getTheme:c,getLanguage:a,getLoadedThemes:p,getLoadedLanguages:d,resolveLangAlias:l,loadLanguage:h,loadLanguageSync:m,loadTheme:S,loadThemeSync:_,dispose:b,[Symbol.dispose]:b}}async function ho(t){t.engine||co("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[e,n,r]=await Promise.all([Sn(t.themes||[]),bn(t.langs||[]),t.engine]);return mo({...t,themes:e,langs:n,engine:r})}async function fo(t){const e=await ho(t);return{getLastGrammarState:(...n)=>Yi(e,...n),codeToTokensBase:(n,r)=>it(e,n,r),codeToTokensWithThemes:(n,r)=>_n(e,n,r),codeToTokens:(n,r)=>we(e,n,r),codeToHast:(n,r)=>Ce(e,n,r),codeToHtml:(n,r)=>ao(e,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...e,getInternalContext:()=>e}}function go(t){const e=t.langs,n=t.themes,r=t.engine;async function i(o){function s(p){if(typeof p=="string"){if(p=o.langAlias?.[p]||p,hn(p))return[];const d=e[p];if(!d)throw new R(`Language \`${p}\` is not included in this bundle. You may want to load it from external source.`);return d}return p}function l(p){if(dn(p))return"none";if(typeof p=="string"){const d=n[p];if(!d)throw new R(`Theme \`${p}\` is not included in this bundle. You may want to load it from external source.`);return d}return p}const a=(o.themes??[]).map(p=>l(p)),c=(o.langs??[]).map(p=>s(p)),u=await fo({engine:o.engine??r(),...o,themes:a,langs:c});return{...u,loadLanguage(...p){return u.loadLanguage(...p.map(s))},loadTheme(...p){return u.loadTheme(...p.map(l))},getBundledLanguages(){return e},getBundledThemes(){return n}}}return i}const wn=[{id:"abap",name:"ABAP",import:(()=>import("./abap-Dg923wIy.js"))},{id:"actionscript-3",name:"ActionScript",import:(()=>import("./actionscript-3-8WTK4YD2.js"))},{id:"ada",name:"Ada",import:(()=>import("./ada-CTi7YQtL.js"))},{id:"angular-html",name:"Angular HTML",import:(()=>import("./angular-html-D2R1pe45.js").then(function(t){return t.f}))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>import("./angular-ts-BDmYQnhm.js"))},{id:"apache",name:"Apache Conf",import:(()=>import("./apache-PcO-DBxQ.js"))},{id:"apex",name:"Apex",import:(()=>import("./apex-CnCu5_gb.js"))},{id:"apl",name:"APL",import:(()=>import("./apl-DkfyvC6M.js"))},{id:"applescript",name:"AppleScript",import:(()=>import("./applescript-Ds_W2jPS.js"))},{id:"ara",name:"Ara",import:(()=>import("./ara-C1--7J61.js"))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>import("./asciidoc-nTfEFGxb.js"))},{id:"asm",name:"Assembly",import:(()=>import("./asm-CTFRnVOM.js"))},{id:"astro",name:"Astro",import:(()=>import("./astro-DtPAdMss.js"))},{id:"awk",name:"AWK",import:(()=>import("./awk-CrWgQKhV.js"))},{id:"ballerina",name:"Ballerina",import:(()=>import("./ballerina-a0yOSyc5.js"))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>import("./bat-B0cHNp6s.js"))},{id:"beancount",name:"Beancount",import:(()=>import("./beancount-dPJi_gci.js"))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>import("./berry-CVKoklHx.js"))},{id:"bibtex",name:"BibTeX",import:(()=>import("./bibtex-DRcCXNgM.js"))},{id:"bicep",name:"Bicep",import:(()=>import("./bicep-jWz-hQ8I.js"))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>import("./bird2-DaGXIRGu.js"))},{id:"blade",name:"Blade",import:(()=>import("./blade-QlWdzBxO.js"))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>import("./bsl-jNujDQK2.js"))},{id:"c",name:"C",import:(()=>import("./c-BG-tZi7o.js"))},{id:"c3",name:"C3",import:(()=>import("./c3-Fcb8_HKm.js"))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>import("./cadence-BuaeHeSu.js"))},{id:"cairo",name:"Cairo",import:(()=>import("./cairo-BYiDgOF2.js"))},{id:"clarity",name:"Clarity",import:(()=>import("./clarity-CC_0IFDj.js"))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>import("./clojure-KnfDkB_V.js"))},{id:"cmake",name:"CMake",import:(()=>import("./cmake-bh2MLnkv.js"))},{id:"cobol",name:"COBOL",import:(()=>import("./cobol-dIXRVV9Y.js"))},{id:"codeowners",name:"CODEOWNERS",import:(()=>import("./codeowners-CtwIM3TN.js"))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>import("./codeql-D164juXQ.js"))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>import("./coffee-Bk-z6oI_.js"))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>import("./common-lisp-DXc9XcIM.js"))},{id:"coq",name:"Coq",import:(()=>import("./coq-BBL5-mG4.js"))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>import("./cpp-C0lzDePx.js"))},{id:"crystal",name:"Crystal",import:(()=>import("./crystal-Bhade0k2.js"))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>import("./csharp-B7nLXyi8.js"))},{id:"css",name:"CSS",import:(()=>import("./css-PZBBrkI0.js"))},{id:"csv",name:"CSV",import:(()=>import("./csv-D5aBhKLr.js"))},{id:"cue",name:"CUE",import:(()=>import("./cue-WCin6O4e.js"))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>import("./cypher-DYQk2G82.js"))},{id:"d",name:"D",import:(()=>import("./d-DVc-yF-l.js"))},{id:"dart",name:"Dart",import:(()=>import("./dart-YLd5yyRs.js"))},{id:"dax",name:"DAX",import:(()=>import("./dax-oldcCaJg.js"))},{id:"desktop",name:"Desktop",import:(()=>import("./desktop-DZfyBMgF.js"))},{id:"diff",name:"Diff",import:(()=>import("./diff-jW5kmiru.js"))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>import("./docker-DG9neUKd.js"))},{id:"dotenv",name:"dotEnv",import:(()=>import("./dotenv-Bea-FkXq.js"))},{id:"dream-maker",name:"Dream Maker",import:(()=>import("./dream-maker-DAHQwpwp.js"))},{id:"edge",name:"Edge",import:(()=>import("./edge-zt3dU95k.js"))},{id:"elixir",name:"Elixir",import:(()=>import("./elixir-JolcG37e.js"))},{id:"elm",name:"Elm",import:(()=>import("./elm-BjIDgKzz.js"))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>import("./emacs-lisp-DMBh55R4.js"))},{id:"erb",name:"ERB",import:(()=>import("./erb-rsjdL4fB.js"))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>import("./erlang-DNeY46SW.js"))},{id:"fennel",name:"Fennel",import:(()=>import("./fennel-DBMsxtrh.js"))},{id:"fish",name:"Fish",import:(()=>import("./fish-BxskpYPN.js"))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>import("./fluent-Bwo2XpEt.js"))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>import("./fortran-fixed-form-DFFnVrrY.js"))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>import("./fortran-free-form-DB5N_DgY.js"))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>import("./fsharp-DRAF1jsN.js"))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>import("./gdresource-BD-1uzY7.js"))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>import("./gdscript-C3mT4Uym.js"))},{id:"gdshader",name:"GDShader",import:(()=>import("./gdshader-G7X6ysY3.js"))},{id:"genie",name:"Genie",import:(()=>import("./genie-DSsjfZMX.js"))},{id:"gherkin",name:"Gherkin",import:(()=>import("./gherkin-Cl2Fw-_0.js"))},{id:"git-commit",name:"Git Commit Message",import:(()=>import("./git-commit-CJPsQObV.js"))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>import("./git-rebase-DeZqv4fp.js"))},{id:"gleam",name:"Gleam",import:(()=>import("./gleam-BeBqoPwE.js"))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>import("./glimmer-js-BuyKUjfV.js"))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>import("./glimmer-ts-D9iniPFN.js"))},{id:"glsl",name:"GLSL",import:(()=>import("./glsl-BOG9l2nV.js"))},{id:"gn",name:"GN",import:(()=>import("./gn-Dxr0sSUf.js"))},{id:"gnuplot",name:"Gnuplot",import:(()=>import("./gnuplot-CtW3R_Hz.js"))},{id:"go",name:"Go",import:(()=>import("./go-BBr2UQCn.js"))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>import("./graphql-B6XHM4uj.js"))},{id:"groovy",name:"Groovy",import:(()=>import("./groovy-DFxE31Qs.js"))},{id:"hack",name:"Hack",import:(()=>import("./hack-Cxa-FaZ4.js"))},{id:"haml",name:"Ruby Haml",import:(()=>import("./haml-2e0EI6Is.js"))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>import("./handlebars-CojHdNmS.js"))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>import("./haskell-BfdhR_WN.js"))},{id:"haxe",name:"Haxe",import:(()=>import("./haxe-DVIybFAS.js"))},{id:"hcl",name:"HashiCorp HCL",import:(()=>import("./hcl-B6OePqme.js"))},{id:"hjson",name:"Hjson",import:(()=>import("./hjson-D2jn7IRw.js"))},{id:"hlsl",name:"HLSL",import:(()=>import("./hlsl-MKeth5V9.js"))},{id:"html",name:"HTML",import:(()=>import("./html-DOf0XnR2.js"))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>import("./html-derivative-DfCZ6Hio.js"))},{id:"http",name:"HTTP",import:(()=>import("./http-CG3jvXcS.js"))},{id:"hurl",name:"Hurl",import:(()=>import("./hurl-CxQrh4RI.js"))},{id:"hxml",name:"HXML",import:(()=>import("./hxml-CkS3Eie7.js"))},{id:"hy",name:"Hy",import:(()=>import("./hy-DI6mCUnw.js"))},{id:"imba",name:"Imba",import:(()=>import("./imba-D-Pk5S0X.js"))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>import("./ini-Dix3pTmg.js"))},{id:"java",name:"Java",import:(()=>import("./java-BTDmaRNO.js"))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>import("./javascript-WyGyM1wV.js"))},{id:"jinja",name:"Jinja",import:(()=>import("./jinja-D0mZ3q2r.js"))},{id:"jison",name:"Jison",import:(()=>import("./jison-B9XHrcYJ.js"))},{id:"json",name:"JSON",import:(()=>import("./json-B8JryHcM.js"))},{id:"json5",name:"JSON5",import:(()=>import("./json5-Cdatmj9n.js"))},{id:"jsonc",name:"JSON with Comments",import:(()=>import("./jsonc-CvUCa1o5.js"))},{id:"jsonl",name:"JSON Lines",import:(()=>import("./jsonl-9I_GBd5L.js"))},{id:"jsonnet",name:"Jsonnet",import:(()=>import("./jsonnet-XoenQ2oc.js"))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>import("./jssm-CWE2S0Z5.js"))},{id:"jsx",name:"JSX",import:(()=>import("./jsx-8cLv2Six.js"))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>import("./julia-C1oINnwa.js"))},{id:"just",name:"Just",import:(()=>import("./just-Bo3fV9RY.js"))},{id:"kdl",name:"KDL",import:(()=>import("./kdl-CMbyIXjQ.js"))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>import("./kotlin-BQy537ds.js"))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>import("./kusto-B_y0uMaZ.js"))},{id:"latex",name:"LaTeX",import:(()=>import("./latex-CZAhoKip.js"))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>import("./lean-C4RHkN41.js"))},{id:"less",name:"Less",import:(()=>import("./less-XNfgnZC7.js"))},{id:"liquid",name:"Liquid",import:(()=>import("./liquid-DFlqVvG0.js"))},{id:"llvm",name:"LLVM IR",import:(()=>import("./llvm-BJRUtCev.js"))},{id:"log",name:"Log file",import:(()=>import("./log-CcaF_xNv.js"))},{id:"logo",name:"Logo",import:(()=>import("./logo-D9WQLoKQ.js"))},{id:"lua",name:"Lua",import:(()=>import("./lua-8Av-h-ns.js"))},{id:"luau",name:"Luau",import:(()=>import("./luau-BTSFCcFb.js"))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>import("./make-DXVx14cr.js"))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>import("./markdown-DX-TNHnc.js"))},{id:"marko",name:"Marko",import:(()=>import("./marko-DiIoNBFw.js"))},{id:"matlab",name:"MATLAB",import:(()=>import("./matlab-DzreyMvm.js"))},{id:"mdc",name:"MDC",import:(()=>import("./mdc-D_DpLax5.js"))},{id:"mdx",name:"MDX",import:(()=>import("./mdx-C2fqO2XY.js"))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>import("./mermaid-Cwy4Up_p.js"))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>import("./mipsasm-yE_Aqo9y.js"))},{id:"mojo",name:"Mojo",import:(()=>import("./mojo-M6pJPbMk.js"))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>import("./moonbit-CR8uFLGd.js"))},{id:"move",name:"Move",import:(()=>import("./move-CyYMWVy5.js"))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>import("./narrat-DXUZ_ZkW.js"))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>import("./nextflow-BPolriEg.js"))},{id:"nextflow-groovy",name:"nextflow-groovy",import:(()=>import("./nextflow-groovy-pQRwk_Jg.js"))},{id:"nginx",name:"Nginx",import:(()=>import("./nginx-DSXkacNc.js"))},{id:"nim",name:"Nim",import:(()=>import("./nim-e2z2kCcq.js"))},{id:"nix",name:"Nix",import:(()=>import("./nix-Ckjrpg0r.js"))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>import("./nushell-DtHLcZf1.js"))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>import("./objective-c-BoaBTdtz.js"))},{id:"objective-cpp",name:"Objective-C++",import:(()=>import("./objective-cpp-DstR8hNy.js"))},{id:"ocaml",name:"OCaml",import:(()=>import("./ocaml-DTbn2Hv7.js"))},{id:"odin",name:"Odin",import:(()=>import("./odin-Bxc4S6Xn.js"))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>import("./openscad-CXHpNBsb.js"))},{id:"pascal",name:"Pascal",import:(()=>import("./pascal-Sr-XLSE6.js"))},{id:"perl",name:"Perl",import:(()=>import("./perl-C95KruZl.js"))},{id:"php",name:"PHP",import:(()=>import("./php-B4Kqya17.js"))},{id:"pkl",name:"Pkl",import:(()=>import("./pkl-CRusufhw.js"))},{id:"plsql",name:"PL/SQL",import:(()=>import("./plsql-Dbm3tV2N.js"))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>import("./po-LG0lFwH4.js"))},{id:"polar",name:"Polar",import:(()=>import("./polar-DjOs3GWb.js"))},{id:"postcss",name:"PostCSS",import:(()=>import("./postcss-GRRkWn2F.js"))},{id:"powerquery",name:"PowerQuery",import:(()=>import("./powerquery-DHf-dtTS.js"))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>import("./powershell-DXrKVo3G.js"))},{id:"prisma",name:"Prisma",import:(()=>import("./prisma-Dgf8IN_C.js"))},{id:"prolog",name:"Prolog",import:(()=>import("./prolog-9JcfiY6I.js"))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>import("./proto-dqx_Sj2i.js"))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>import("./pug-CoOVtr4u.js"))},{id:"puppet",name:"Puppet",import:(()=>import("./puppet-Di57VbSS.js"))},{id:"purescript",name:"PureScript",import:(()=>import("./purescript-BgpM7rDH.js"))},{id:"python",name:"Python",aliases:["py"],import:(()=>import("./python-B6Ihcp-E.js"))},{id:"qml",name:"QML",import:(()=>import("./qml-DmGQGbca.js"))},{id:"qmldir",name:"QML Directory",import:(()=>import("./qmldir-DXd9s5XC.js"))},{id:"qss",name:"Qt Style Sheets",import:(()=>import("./qss-B7NnhfIi.js"))},{id:"r",name:"R",import:(()=>import("./r-1ts4xG1r.js"))},{id:"racket",name:"Racket",import:(()=>import("./racket-CeDx7KO2.js"))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>import("./raku-BMJwmrCS.js"))},{id:"razor",name:"ASP.NET Razor",import:(()=>import("./razor-BaMsy-R7.js"))},{id:"reg",name:"Windows Registry Script",import:(()=>import("./reg-Cvyu2Gnx.js"))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>import("./regexp-DK-WlHNu.js"))},{id:"rel",name:"Rel",import:(()=>import("./rel-BlqNHz8k.js"))},{id:"riscv",name:"RISC-V",import:(()=>import("./riscv-C5dpdlr7.js"))},{id:"ron",name:"RON",import:(()=>import("./ron-j5NfrB3z.js"))},{id:"rosmsg",name:"ROS Interface",import:(()=>import("./rosmsg-ZkSIzPhc.js"))},{id:"rst",name:"reStructuredText",import:(()=>import("./rst-C371KPjr.js"))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>import("./ruby-DusoydGj.js"))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>import("./rust-CxuBE0J8.js"))},{id:"sas",name:"SAS",import:(()=>import("./sas-DtSHuIwI.js"))},{id:"sass",name:"Sass",import:(()=>import("./sass-bfEVHPJ8.js"))},{id:"scala",name:"Scala",import:(()=>import("./scala-Dtw19ca_.js"))},{id:"scheme",name:"Scheme",import:(()=>import("./scheme-OJppFQF3.js"))},{id:"scss",name:"SCSS",import:(()=>import("./scss-DxBkwadj.js"))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>import("./sdbl-CvZs3G9c.js"))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>import("./shaderlab-CEJedz68.js"))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>import("./shellscript-DgJyDXW6.js"))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>import("./shellsession-DSlzxnCM.js"))},{id:"smalltalk",name:"Smalltalk",import:(()=>import("./smalltalk-B9IHbYt7.js"))},{id:"solidity",name:"Solidity",import:(()=>import("./solidity-B3CjIuAd.js"))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>import("./soy-BSb8SaP0.js"))},{id:"sparql",name:"SPARQL",import:(()=>import("./sparql-BJh4JEw-.js"))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>import("./splunk-h-bNAnbk.js"))},{id:"sql",name:"SQL",import:(()=>import("./sql-BbONfI8K.js"))},{id:"ssh-config",name:"SSH Config",import:(()=>import("./ssh-config-CywOjoXH.js"))},{id:"stata",name:"Stata",import:(()=>import("./stata-BKjsT8qe.js"))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>import("./stylus-CIg617SB.js"))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>import("./surrealql-2KNEnAt7.js"))},{id:"svelte",name:"Svelte",import:(()=>import("./svelte-xaxjcSSP.js"))},{id:"swift",name:"Swift",import:(()=>import("./swift-tEesUtni.js"))},{id:"system-verilog",name:"SystemVerilog",import:(()=>import("./system-verilog-Qdm_1g2q.js"))},{id:"systemd",name:"Systemd Units",import:(()=>import("./systemd-DKMPPZjB.js"))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>import("./talonscript-eRuyeYHl.js"))},{id:"tasl",name:"Tasl",import:(()=>import("./tasl-B9CVvjfG.js"))},{id:"tcl",name:"Tcl",import:(()=>import("./tcl-Bq9dbVAF.js"))},{id:"templ",name:"Templ",import:(()=>import("./templ-BVTOctZ7.js"))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>import("./terraform-CAp711iT.js"))},{id:"tex",name:"TeX",import:(()=>import("./tex-BHxF5DMe.js"))},{id:"toml",name:"TOML",import:(()=>import("./toml-Ms459DBw.js"))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>import("./ts-tags-C-gylFal.js"))},{id:"tsv",name:"TSV",import:(()=>import("./tsv-BFtm7NXx.js"))},{id:"tsx",name:"TSX",import:(()=>import("./tsx-D6116Ycy.js"))},{id:"turtle",name:"Turtle",import:(()=>import("./turtle-DpRhbQZY.js"))},{id:"twig",name:"Twig",import:(()=>import("./twig-DuP5mDZ4.js"))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>import("./typescript-BqvgUolh.js"))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>import("./typespec-DhK7u29_.js"))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>import("./typst-Dfd71gQj.js"))},{id:"v",name:"V",import:(()=>import("./v-BH76v7br.js"))},{id:"vala",name:"Vala",import:(()=>import("./vala-z59IxkFd.js"))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>import("./vb-4AxSLKIU.js"))},{id:"verilog",name:"Verilog",import:(()=>import("./verilog-LfQUkHDc.js"))},{id:"vhdl",name:"VHDL",import:(()=>import("./vhdl-DJCsFYgn.js"))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>import("./viml-pbKHW3Ia.js"))},{id:"vue",name:"Vue",import:(()=>import("./vue-D2k0BAl5.js"))},{id:"vue-html",name:"Vue HTML",import:(()=>import("./vue-html-zEfNEgpj.js"))},{id:"vue-vine",name:"Vue Vine",import:(()=>import("./vue-vine-D9eCaTqi.js"))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>import("./vyper-DpazWNpx.js"))},{id:"wasm",name:"WebAssembly",import:(()=>import("./wasm-CFi-k9--.js"))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>import("./wenyan-CYFFG9DK.js"))},{id:"wgsl",name:"WGSL",import:(()=>import("./wgsl-CxjTZs-b.js"))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>import("./wikitext-Bx2qct8O.js"))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>import("./wit-DDW3hD69.js"))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>import("./wolfram-pu21K997.js"))},{id:"xml",name:"XML",import:(()=>import("./xml-BkAJuBCc.js"))},{id:"xsl",name:"XSL",import:(()=>import("./xsl-C6UUWSil.js"))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>import("./yaml-Bopit2L3.js"))},{id:"zenscript",name:"ZenScript",import:(()=>import("./zenscript-BIAKq-aR.js"))},{id:"zig",name:"Zig",import:(()=>import("./zig-bSFrHQ7n.js"))}],yo=Object.fromEntries(wn.map(t=>[t.id,t.import])),_o=Object.fromEntries(wn.flatMap(t=>t.aliases?.map(e=>[e,t.import])||[])),at={...yo,..._o},bo=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>import("./andromeeda-CT0vplkN.js"))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>import("./aurora-x-C0VKFdlO.js"))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>import("./ayu-dark-wZ6ORhBL.js"))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>import("./ayu-light-xXLJ_Ch1.js"))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>import("./ayu-mirage-CQckA_sP.js"))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>import("./catppuccin-frappe-CfssSZMA.js"))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>import("./catppuccin-latte-DoBaWTGn.js"))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>import("./catppuccin-macchiato-BkAuvdZC.js"))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>import("./catppuccin-mocha-D9fcC0iT.js"))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>import("./dark-plus-DLU5INA3.js"))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>import("./dracula-XcYHBZy6.js"))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>import("./dracula-soft-BPeX9gxW.js"))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>import("./everforest-dark-WOub3wle.js"))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>import("./everforest-light-DCUg8VH8.js"))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>import("./github-dark-BQV5ugrc.js"))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>import("./github-dark-default-DLWDM7FH.js"))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>import("./github-dark-dimmed-D1FmiR_p.js"))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>import("./github-dark-high-contrast-BilLoi0o.js"))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>import("./github-light-Rcb2q3L5.js"))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>import("./github-light-default-CQ75esMw.js"))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>import("./github-light-high-contrast-CRF1wyLy.js"))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>import("./gruvbox-dark-hard-C37G1gbc.js"))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>import("./gruvbox-dark-medium-C3G9m3TV.js"))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>import("./gruvbox-dark-soft-eZmcmZ9I.js"))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>import("./gruvbox-light-hard-BYj-vz_3.js"))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>import("./gruvbox-light-medium-BdQlDiiF.js"))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>import("./gruvbox-light-soft-BGNwjiRh.js"))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>import("./horizon-cslQss18.js"))},{id:"horizon-bright",displayName:"Horizon Bright",type:"dark",import:(()=>import("./horizon-bright-CoQRYDvy.js"))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>import("./houston-RHIKkNfR.js"))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>import("./kanagawa-dragon-BOvIHJVT.js"))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>import("./kanagawa-lotus-Bwcd7Bvx.js"))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>import("./kanagawa-wave-0SAlpf0s.js"))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>import("./laserwave-si7wuSrt.js"))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>import("./light-plus-g_Fi9vkG.js"))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>import("./material-theme-CIJ3cGaW.js"))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>import("./material-theme-darker-BWg3m1GB.js"))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>import("./material-theme-lighter-DR8HWMN7.js"))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>import("./material-theme-ocean-CZf9pk28.js"))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>import("./material-theme-palenight-BF01YeZy.js"))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>import("./min-dark-DhfaepVE.js"))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>import("./min-light-6xx0uMgm.js"))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>import("./monokai-BodnsaDQ.js"))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>import("./night-owl-EdP2Hztp.js"))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>import("./night-owl-light-Bk-lYVyk.js"))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>import("./nord-BAu0wM6c.js"))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>import("./one-dark-pro-utPxbBbJ.js"))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>import("./one-light-BuCQ22aO.js"))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>import("./plastic-CXnNNlFZ.js"))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>import("./poimandres-BrOVMvuE.js"))},{id:"red",displayName:"Red",type:"dark",import:(()=>import("./red-DR6ZwibK.js"))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>import("./rose-pine-CN2F2lJl.js"))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>import("./rose-pine-dawn-0S8NEhsA.js"))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>import("./rose-pine-moon-DzBDT4rc.js"))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>import("./slack-dark-CWRQmTmo.js"))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>import("./slack-ochin-DO_ok7XK.js"))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>import("./snazzy-light-B5llO_gK.js"))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>import("./solarized-dark-G9yBjKj_.js"))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>import("./solarized-light-DeSzljQz.js"))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>import("./synthwave-84-DRVv-_m_.js"))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>import("./tokyo-night-BvwC8l2v.js"))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>import("./vesper--t9w6MWz.js"))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>import("./vitesse-black-B_BYPdvp.js"))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>import("./vitesse-dark-DOSOf2Sz.js"))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>import("./vitesse-light-gUX51GpB.js"))}],So=Object.fromEntries(bo.map(t=>[t.id,t.import]));class lt extends Error{constructor(e){super(e),this.name="ShikiError"}}function ko(){return 2147483648}function wo(){return typeof performance<"u"?performance.now():Date.now()}const Co=(t,e)=>t+(e-t%e)%e;async function vo(t){let e,n;const r={};function i(m){n=m,r.HEAPU8=new Uint8Array(m),r.HEAPU32=new Uint32Array(m)}function o(m,h,_){r.HEAPU8.copyWithin(m,h,h+_)}function s(m){try{return e.grow(m-n.byteLength+65535>>>16),i(e.buffer),1}catch{}}function l(m){const h=r.HEAPU8.length;m=m>>>0;const _=ko();if(m>_)return!1;for(let S=1;S<=4;S*=2){let y=h*(1+.2/S);y=Math.min(y,m+100663296);const b=Math.min(_,Co(Math.max(m,y),65536));if(s(b))return!0}return!1}const a=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function c(m,h,_=1024){const S=h+_;let y=h;for(;m[y]&&!(y>=S);)++y;if(y-h>16&&m.buffer&&a)return a.decode(m.subarray(h,y));let b="";for(;h<y;){let g=m[h++];if(!(g&128)){b+=String.fromCharCode(g);continue}const w=m[h++]&63;if((g&224)===192){b+=String.fromCharCode((g&31)<<6|w);continue}const v=m[h++]&63;if((g&240)===224?g=(g&15)<<12|w<<6|v:g=(g&7)<<18|w<<12|v<<6|m[h++]&63,g<65536)b+=String.fromCharCode(g);else{const I=g-65536;b+=String.fromCharCode(55296|I>>10,56320|I&1023)}}return b}function u(m,h){return m?c(r.HEAPU8,m,h):""}const p={emscripten_get_now:wo,emscripten_memcpy_big:o,emscripten_resize_heap:l,fd_write:()=>0};async function d(){const h=await t({env:p,wasi_snapshot_preview1:p});e=h.memory,i(e.buffer),Object.assign(r,h),r.UTF8ToString=u}return await d(),r}var No=Object.defineProperty,Ro=(t,e,n)=>e in t?No(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,L=(t,e,n)=>Ro(t,typeof e!="symbol"?e+"":e,n);let T=null;function Lo(t){throw new lt(t.UTF8ToString(t.getLastOnigError()))}class Re{constructor(e){L(this,"utf16Length"),L(this,"utf8Length"),L(this,"utf16Value"),L(this,"utf8Value"),L(this,"utf16OffsetToUtf8"),L(this,"utf8OffsetToUtf16");const n=e.length,r=Re._utf8ByteLength(e),i=r!==n,o=i?new Uint32Array(n+1):null;i&&(o[n]=r);const s=i?new Uint32Array(r+1):null;i&&(s[r]=n);const l=new Uint8Array(r);let a=0;for(let c=0;c<n;c++){const u=e.charCodeAt(c);let p=u,d=!1;if(u>=55296&&u<=56319&&c+1<n){const m=e.charCodeAt(c+1);m>=56320&&m<=57343&&(p=(u-55296<<10)+65536|m-56320,d=!0)}i&&(o[c]=a,d&&(o[c+1]=a),p<=127?s[a+0]=c:p<=2047?(s[a+0]=c,s[a+1]=c):p<=65535?(s[a+0]=c,s[a+1]=c,s[a+2]=c):(s[a+0]=c,s[a+1]=c,s[a+2]=c,s[a+3]=c)),p<=127?l[a++]=p:p<=2047?(l[a++]=192|(p&1984)>>>6,l[a++]=128|(p&63)>>>0):p<=65535?(l[a++]=224|(p&61440)>>>12,l[a++]=128|(p&4032)>>>6,l[a++]=128|(p&63)>>>0):(l[a++]=240|(p&1835008)>>>18,l[a++]=128|(p&258048)>>>12,l[a++]=128|(p&4032)>>>6,l[a++]=128|(p&63)>>>0),d&&c++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=e,this.utf8Value=l,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=s}static _utf8ByteLength(e){let n=0;for(let r=0,i=e.length;r<i;r++){const o=e.charCodeAt(r);let s=o,l=!1;if(o>=55296&&o<=56319&&r+1<i){const a=e.charCodeAt(r+1);a>=56320&&a<=57343&&(s=(o-55296<<10)+65536|a-56320,l=!0)}s<=127?n+=1:s<=2047?n+=2:s<=65535?n+=3:n+=4,l&&r++}return n}createString(e){const n=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,n),n}}const Le=class D{constructor(e){if(L(this,"id",++D.LAST_ID),L(this,"_onigBinding"),L(this,"content"),L(this,"utf16Length"),L(this,"utf8Length"),L(this,"utf16OffsetToUtf8"),L(this,"utf8OffsetToUtf16"),L(this,"ptr"),!T)throw new lt("Must invoke loadWasm first.");this._onigBinding=T,this.content=e;const n=new Re(e);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!D._sharedPtrInUse?(D._sharedPtr||(D._sharedPtr=T.omalloc(1e4)),D._sharedPtrInUse=!0,T.HEAPU8.set(n.utf8Value,D._sharedPtr),this.ptr=D._sharedPtr):this.ptr=n.createString(T)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===D._sharedPtr?D._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};L(Le,"LAST_ID",0);L(Le,"_sharedPtr",0);L(Le,"_sharedPtrInUse",!1);let Cn=Le;class xo{constructor(e){if(L(this,"_onigBinding"),L(this,"_ptr"),!T)throw new lt("Must invoke loadWasm first.");const n=[],r=[];for(let l=0,a=e.length;l<a;l++){const c=new Re(e[l]);n[l]=c.createString(T),r[l]=c.utf8Length}const i=T.omalloc(4*e.length);T.HEAPU32.set(n,i/4);const o=T.omalloc(4*e.length);T.HEAPU32.set(r,o/4);const s=T.createOnigScanner(i,o,e.length);for(let l=0,a=e.length;l<a;l++)T.ofree(n[l]);T.ofree(o),T.ofree(i),s===0&&Lo(T),this._onigBinding=T,this._ptr=s}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,n,r){let i=0;if(typeof r=="number"&&(i=r),typeof e=="string"){e=new Cn(e);const o=this._findNextMatchSync(e,n,!1,i);return e.dispose(),o}return this._findNextMatchSync(e,n,!1,i)}_findNextMatchSync(e,n,r,i){const o=this._onigBinding,s=o.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(n),i);if(s===0)return null;const l=o.HEAPU32;let a=s/4;const c=l[a++],u=l[a++],p=[];for(let d=0;d<u;d++){const m=e.convertUtf8OffsetToUtf16(l[a++]),h=e.convertUtf8OffsetToUtf16(l[a++]);p[d]={start:m,end:h,length:h-m}}return{index:c,captureIndices:p}}}function To(t){return typeof t.instantiator=="function"}function Ao(t){return typeof t.default=="function"}function Po(t){return typeof t.data<"u"}function Eo(t){return typeof Response<"u"&&t instanceof Response}function Io(t){return typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||ArrayBuffer.isView(t))||typeof Buffer<"u"&&Buffer.isBuffer?.(t)||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&t instanceof Uint32Array}let pe;function Oo(t){if(pe)return pe;async function e(){T=await vo(async n=>{let r=t;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),To(r)?r=await r.instantiator(n):Ao(r)?r=await r.default(n):(Po(r)&&(r=r.data),Eo(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await Mo(r)(n):r=await Bo(r)(n):Io(r)?r=await Ge(r)(n):r instanceof WebAssembly.Module?r=await Ge(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await Ge(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return pe=e(),pe}function Ge(t){return e=>WebAssembly.instantiate(t,e)}function Mo(t){return e=>WebAssembly.instantiateStreaming(t,e)}function Bo(t){return async e=>{const n=await t.arrayBuffer();return WebAssembly.instantiate(n,e)}}async function Do(t){return t&&await Oo(t),{createScanner(e){return new xo(e.map(n=>typeof n=="string"?n:n.source))},createString(e){return new Cn(e)}}}const Go=go({langs:at,themes:So,engine:()=>Do(import("./wasm-CG6Dc4jp.js"))}),vn="template-call",jo=t=>{const e=t.repository?.[vn]?.patterns;return Array.isArray(e)&&e.length>0},$o=t=>{if(!jo(t))return t;const e={...t.repository};return e[vn]={patterns:[]},{...t,repository:e}},ct="openchamber-md",Uo={name:ct,colors:{"editor.background":"transparent","editor.foreground":"var(--md-syntax-foreground)"},tokenColors:[{scope:["comment","punctuation.definition.comment","string.comment"],settings:{foreground:"var(--md-syntax-comment)",fontStyle:"italic"}},{scope:["string","punctuation.definition.string","string.template"],settings:{foreground:"var(--md-syntax-string)"}},{scope:["constant.numeric","constant.language","constant.character","constant"],settings:{foreground:"var(--md-syntax-number)"}},{scope:["keyword","storage","storage.type","storage.modifier","keyword.control"],settings:{foreground:"var(--md-syntax-keyword)"}},{scope:["keyword.operator","punctuation.separator","punctuation.terminator"],settings:{foreground:"var(--md-syntax-operator)"}},{scope:["entity.name.function","support.function","meta.function-call"],settings:{foreground:"var(--md-syntax-function)"}},{scope:["entity.name.type","entity.name.class","support.type","support.class","entity.other.inherited-class"],settings:{foreground:"var(--md-syntax-type)"}},{scope:["variable","variable.other","variable.parameter","meta.definition.variable"],settings:{foreground:"var(--md-syntax-variable)"}},{scope:["variable.other.property","meta.property-name","support.type.property-name"],settings:{foreground:"var(--md-syntax-property)"}},{scope:["entity.name.tag","punctuation.definition.tag"],settings:{foreground:"var(--md-syntax-keyword)"}},{scope:["entity.other.attribute-name"],settings:{foreground:"var(--md-syntax-property)"}},{scope:["markup.bold","punctuation.definition.bold"],settings:{fontStyle:"bold"}},{scope:["markup.italic","punctuation.definition.italic"],settings:{fontStyle:"italic"}},{scope:["markup.heading","markup.heading entity.name"],settings:{foreground:"var(--md-syntax-keyword)",fontStyle:"bold"}},{scope:["markup.inserted","punctuation.definition.inserted"],settings:{foreground:"var(--md-syntax-inserted)"}},{scope:["markup.deleted","punctuation.definition.deleted"],settings:{foreground:"var(--md-syntax-deleted)"}},{scope:["invalid","invalid.illegal"],settings:{foreground:"var(--md-syntax-deleted)"}}]},Ho=1,Fo=2,Wo=4,zo=t=>t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),qo=t=>{const e=[];t.color&&e.push(`color:${t.color}`);const n=t.fontStyle??0;return n&Ho&&e.push("font-style:italic"),n&Fo&&e.push("font-weight:bold"),n&Wo&&e.push("text-decoration:underline"),`<span${e.length?` style="${e.join(";")}"`:""}>${zo(t.content)}</span>`};let Bt,z=Promise.resolve();const xe=()=>(Bt??=Go({themes:[Uo],langs:[]}),Bt);self.onmessage=t=>{const e=t.data;if(e.type==="init"){xe();return}if(e.type==="highlight"){z=z.then(()=>Ko(e)).catch(()=>{});return}if(e.type==="highlightTokens"){z=z.then(()=>Yo(e)).catch(()=>{});return}z=z.then(()=>Jo(e)).catch(()=>{})};const Vo=async(t,e)=>{const r=(await at[e]()).default.map(i=>$o(i));await t.loadLanguage(...r)},ut=async(t,e)=>{let n=e in at?e:"text";if(n!=="text"&&!t.getLoadedLanguages().includes(n))try{await Vo(t,n)}catch{n="text"}return n};async function Ko(t){try{const e=await xe(),n=await ut(e,t.lang),r=e.codeToHtml(t.code,{lang:n,theme:ct,tabindex:!1});J({type:"highlight",id:t.id,html:r})}catch(e){J({type:"error",id:t.id,message:e instanceof Error?e.message:String(e)})}}async function Yo(t){try{const e=await xe();t.theme&&!e.getLoadedThemes().includes(t.themeName)&&await e.loadTheme(t.theme);const n=await ut(e,t.lang),{tokens:r}=e.codeToTokens(t.code,{lang:n,theme:t.themeName}),i=r.map(o=>o.map(s=>[s.content.length,s.color??"",s.fontStyle??0]));J({type:"highlightTokens",id:t.id,lines:i})}catch(e){J({type:"error",id:t.id,message:e instanceof Error?e.message:String(e)})}}async function Jo(t){try{const e=await xe(),n=await ut(e,t.lang),{tokens:r}=e.codeToTokens(t.code,{lang:n,theme:ct}),i=r.map(o=>o.map(qo).join(""));J({type:"highlightLines",id:t.id,lines:i})}catch(e){J({type:"error",id:t.id,message:e instanceof Error?e.message:String(e)})}}function J(t){self.postMessage(t)}
11
+ \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function yo(t,e,n,r){const o=r.schema,i=o.space==="svg"?!1:r.settings.omitOptionalTags;let s=o.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(t.tagName.toLowerCase());const l=[];let a;o.space==="html"&&t.tagName==="svg"&&(r.schema=an);const c=bo(r,t.properties),u=r.all(o.space==="html"&&t.tagName==="template"?t.content:t);return r.schema=o,u&&(s=!1),(c||!i||!uo(t,e,n))&&(l.push("<",t.tagName,c?" "+c:""),s&&(o.space==="svg"||r.settings.closeSelfClosing)&&(a=c.charAt(c.length-1),(!r.settings.tightSelfClosing||a==="/"||a&&a!=='"'&&a!=="'")&&l.push(" "),l.push("/")),l.push(">")),l.push(u),!s&&(!i||!tt(t,e,n))&&l.push("</"+t.tagName+">"),l.join("")}function bo(t,e){const n=[];let r=-1,o;if(e){for(o in e)if(e[o]!==null&&e[o]!==void 0){const i=_o(t,o,e[o]);i&&n.push(i)}}for(;++r<n.length;){const i=t.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&i!=='"'&&i!=="'"&&(n[r]+=" ")}return n.join("")}function _o(t,e,n){const r=kr(t.schema,e),o=t.settings.allowParseErrors&&t.schema.space==="html"?0:1,i=t.settings.allowDangerousCharacters?0:1;let s=t.quote,l;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const a=K(r.attribute,Object.assign({},t.settings.characterReferences,{subset:ue.name[o][i]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?Vr:Kr)(n,{padLeft:!t.settings.tightCommaSeparatedLists}):String(n),t.settings.collapseEmptyAttributes&&!n)?a:(t.settings.preferUnquoted&&(l=K(n,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:ue.unquoted[o][i]}))),l!==n&&(t.settings.quoteSmart&&xt(n,s)>xt(n,t.alternative)&&(s=t.alternative),l=s+K(n,Object.assign({},t.settings.characterReferences,{subset:(s==="'"?ue.single:ue.double)[o][i],attribute:!0}))+s),a+(l&&"="+l))}const So=["<","&"];function mn(t,e,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?t.value:K(t.value,Object.assign({},r.settings.characterReferences,{subset:So}))}function ko(t,e,n,r){return r.settings.allowDangerousHtml?t.value:mn(t,e,n,r)}function wo(t,e,n,r){return r.all(t)}const vo=Nr("type",{invalid:Co,unknown:No,handlers:{comment:zr,doctype:qr,element:yo,raw:ko,root:wo,text:mn}});function Co(t){throw new Error("Expected node, not `"+t+"`")}function No(t){const e=t;throw new Error("Cannot compile unknown node `"+e.type+"`")}const Ro={},xo={},Lo=[];function To(t,e){const n=e||Ro,r=n.quote||'"',o=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:Ao,all:Po,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||fr,characterReferences:n.characterReferences||xo,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?an:Cr,quote:r,alternative:o}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}function Ao(t,e,n){return vo(t,e,n,this)}function Po(t){const e=[],n=t&&t.children||Lo;let r=-1;for(;++r<n.length;)e[r]=this.one(n[r],r,t);return e.join("")}function Se(t,e){const n=typeof t=="string"?{}:{...t.colorReplacements},r=typeof t=="string"?t:t.name;for(const[o,i]of Object.entries(e?.colorReplacements||{}))typeof i=="string"?n[o]=i:o===r&&Object.assign(n,i);return n}function j(t,e){return t&&(e?.[t?.toLowerCase()]||t)}function Eo(t){return Array.isArray(t)?t:[t]}async function hn(t){return Promise.resolve(typeof t=="function"?t():t).then(e=>e.default||e)}function nt(t){return!t||["plaintext","txt","text","plain"].includes(t)}function dn(t){return t==="ansi"||nt(t)}function rt(t){return t==="none"}function fn(t){return rt(t)}function gn(t,e){if(!e)return t;t.properties||={},t.properties.class||=[],typeof t.properties.class=="string"&&(t.properties.class=t.properties.class.split(/\s+/g)),Array.isArray(t.properties.class)||(t.properties.class=[]);const n=Array.isArray(e)?e:e.split(/\s+/g);for(const r of n)r&&!t.properties.class.includes(r)&&t.properties.class.push(r);return t}function Ne(t,e=!1){if(t.length===0)return[["",0]];const n=t.split(/(\r?\n)/g);let r=0;const o=[];for(let i=0;i<n.length;i+=2){const s=e?n[i]+(n[i+1]||""):n[i];o.push([s,r]),r+=n[i].length,r+=n[i+1]?.length||0}return o}function Io(t){const e=Ne(t,!0).map(([o])=>o);function n(o){if(o===t.length)return{line:e.length-1,character:e[e.length-1].length};let i=o,s=0;for(const l of e){if(i<l.length)break;i-=l.length,s++}return{line:s,character:i}}function r(o,i){let s=0;for(let l=0;l<o;l++)s+=e[l].length;return s+=i,s}return{lines:e,indexToPos:n,posToIndex:r}}const ot="light-dark()",Oo=["color","background-color"];function Mo(t,e){let n=0;const r=[];for(const o of e)o>n&&r.push({...t,content:t.content.slice(n,o),offset:t.offset+n}),n=o;return n<t.content.length&&r.push({...t,content:t.content.slice(n),offset:t.offset+n}),r}function Bo(t,e){const n=Array.from(e instanceof Set?e:new Set(e)).sort((r,o)=>r-o);return n.length?t.map(r=>r.flatMap(o=>{const i=n.filter(s=>o.offset<s&&s<o.offset+o.content.length).map(s=>s-o.offset).sort((s,l)=>s-l);return i.length?Mo(o,i):o})):t}function Do(t,e,n,r,o="css-vars"){const i={content:t.content,explanation:t.explanation,offset:t.offset},s=e.map(u=>ke(t.variants[u])),l=new Set(s.flatMap(u=>Object.keys(u))),a={},c=(u,p)=>{const d=p==="color"?"":p==="background-color"?"-bg":`-${p}`;return n+e[u]+(p==="color"?"":d)};return s.forEach((u,p)=>{for(const d of l){const m=u[d]||"inherit";if(p===0&&r&&Oo.includes(d))if(r===ot&&s.length>1){const h=e.findIndex(_=>_==="light"),b=e.findIndex(_=>_==="dark");if(h===-1||b===-1)throw new R('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const S=s[h][d]||"inherit",y=s[b][d]||"inherit";a[d]=`light-dark(${S}, ${y})`,o==="css-vars"&&(a[c(p,d)]=m)}else a[d]=m;else o==="css-vars"&&(a[c(p,d)]=m)}}),i.htmlStyle=a,i}function ke(t){const e={};if(t.color&&(e.color=t.color),t.bgColor&&(e["background-color"]=t.bgColor),t.fontStyle){t.fontStyle&P.Italic&&(e["font-style"]="italic"),t.fontStyle&P.Bold&&(e["font-weight"]="bold");const n=[];t.fontStyle&P.Underline&&n.push("underline"),t.fontStyle&P.Strikethrough&&n.push("line-through"),n.length&&(e["text-decoration"]=n.join(" "))}return e}function Xe(t){return typeof t=="string"?t:Object.entries(t).map(([e,n])=>`${e}:${n}`).join(";")}const yn=new WeakMap;function Re(t,e){yn.set(t,e)}function ie(t){return yn.get(t)}class Q{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(e,n){return new Q(Object.fromEntries(Eo(n).map(r=>[r,qe])),e)}constructor(...e){if(e.length===2){const[n,r]=e;this.lang=r,this._stacks=n}else{const[n,r,o]=e;this.lang=r,this._stacks={[o]:n}}}getInternalStack(e=this.theme){return this._stacks[e]}getScopes(e=this.theme){return Go(this._stacks[e])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}}function Go(t){const e=[],n=new Set;function r(o){if(n.has(o))return;n.add(o);const i=o?.nameScopesList?.scopeName;i&&e.push(i),o.parent&&r(o.parent)}return r(t),e}function jo(t,e){if(!(t instanceof Q))throw new R("Invalid grammar state");return t.getInternalStack(e)}function $o(){const t=new WeakMap;function e(n){if(!t.has(n.meta)){let r=function(s){if(typeof s=="number"){if(s<0||s>n.source.length)throw new R(`Invalid decoration offset: ${s}. Code length: ${n.source.length}`);return{...o.indexToPos(s),offset:s}}else{const l=o.lines[s.line];if(l===void 0)throw new R(`Invalid decoration position ${JSON.stringify(s)}. Lines length: ${o.lines.length}`);let a=s.character;if(a<0&&(a=l.length+a),a<0||a>l.length)throw new R(`Invalid decoration position ${JSON.stringify(s)}. Line ${s.line} length: ${l.length}`);return{...s,character:a,offset:o.posToIndex(s.line,a)}}};const o=Io(n.source),i=(n.options.decorations||[]).map(s=>({...s,start:r(s.start),end:r(s.end)}));Uo(i),t.set(n.meta,{decorations:i,converter:o,source:n.source})}return t.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(!this.options.decorations?.length)return;const o=e(this).decorations.flatMap(s=>[s.start.offset,s.end.offset]);return Bo(n,o)},code(n){if(!this.options.decorations?.length)return;const r=e(this),o=Array.from(n.children).filter(u=>u.type==="element"&&u.tagName==="span");if(o.length!==r.converter.lines.length)throw new R(`Number of lines in code element (${o.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function i(u,p,d,m){const h=o[u];let b="",S=-1,y=-1;if(p===0&&(S=0),d===0&&(y=0),d===Number.POSITIVE_INFINITY&&(y=h.children.length),S===-1||y===-1)for(let g=0;g<h.children.length;g++)b+=bn(h.children[g]),S===-1&&b.length===p&&(S=g+1),y===-1&&b.length===d&&(y=g+1);if(S===-1)throw new R(`Failed to find start index for decoration ${JSON.stringify(m.start)}`);if(y===-1)throw new R(`Failed to find end index for decoration ${JSON.stringify(m.end)}`);const _=h.children.slice(S,y);if(!m.alwaysWrap&&_.length===h.children.length)l(h,m,"line");else if(!m.alwaysWrap&&_.length===1&&_[0].type==="element")l(_[0],m,"token");else{const g={type:"element",tagName:"span",properties:{},children:_};l(g,m,"wrapper"),h.children.splice(S,_.length,g)}}function s(u,p){o[u]=l(o[u],p,"line")}function l(u,p,d){const m=p.properties||{},h=p.transform||(b=>b);return u.tagName=p.tagName||"span",u.properties={...u.properties,...m,class:u.properties.class},p.properties?.class&&gn(u,p.properties.class),u=h(u,d)||u,u}const a=[],c=r.decorations.sort((u,p)=>p.start.offset-u.start.offset||u.end.offset-p.end.offset);for(const u of c){const{start:p,end:d}=u;if(p.line===d.line)i(p.line,p.character,d.character,u);else if(p.line<d.line){i(p.line,p.character,Number.POSITIVE_INFINITY,u);for(let m=p.line+1;m<d.line;m++)a.unshift(()=>s(m,u));i(d.line,0,d.character,u)}}a.forEach(u=>u())}}}function Uo(t){for(let e=0;e<t.length;e++){const n=t[e];if(n.start.offset>n.end.offset)throw new R(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=e+1;r<t.length;r++){const o=t[r],i=n.start.offset<=o.start.offset&&o.start.offset<n.end.offset,s=n.start.offset<o.end.offset&&o.end.offset<=n.end.offset,l=o.start.offset<=n.start.offset&&n.start.offset<o.end.offset,a=o.start.offset<n.end.offset&&n.end.offset<=o.end.offset;if(i||s||l||a){if(i&&s||l&&a||l&&n.start.offset===n.end.offset||s&&o.start.offset===o.end.offset)continue;throw new R(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(o.start)} intersect.`)}}}}function bn(t){return t.type==="text"?t.value:t.type==="element"?t.children.map(bn).join(""):""}const Ho=[$o()];function we(t){const e=Fo(t.transformers||[]);return[...e.pre,...e.normal,...e.post,...Ho]}function Fo(t){const e=[],n=[],r=[];for(const o of t)switch(o.enforce){case"pre":e.push(o);break;case"post":n.push(o);break;default:r.push(o)}return{pre:e,post:n,normal:r}}var H=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Ge={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function Wo(t,e){const n=t.indexOf("\x1B",e);if(n!==-1&&t[n+1]==="["){const r=t.indexOf("m",n);if(r!==-1)return{sequence:t.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:t.length}}function Pt(t){const e=t.shift();if(e==="2"){const n=t.splice(0,3).map(r=>Number.parseInt(r));return n.length!==3||n.some(r=>Number.isNaN(r))?void 0:{type:"rgb",rgb:n}}else if(e==="5"){const n=t.shift();if(n)return{type:"table",index:Number(n)}}}function zo(t){const e=[];for(;t.length>0;){const n=t.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)e.push({type:"resetAll"});else if(r<=9)Ge[r]&&e.push({type:"setDecoration",value:Ge[r]});else if(r<=29){const o=Ge[r-20];o&&(e.push({type:"resetDecoration",value:o}),o==="dim"&&e.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)e.push({type:"setForegroundColor",value:{type:"named",name:H[r-30]}});else if(r===38){const o=Pt(t);o&&e.push({type:"setForegroundColor",value:o})}else if(r===39)e.push({type:"resetForegroundColor"});else if(r<=47)e.push({type:"setBackgroundColor",value:{type:"named",name:H[r-40]}});else if(r===48){const o=Pt(t);o&&e.push({type:"setBackgroundColor",value:o})}else r===49?e.push({type:"resetBackgroundColor"}):r===53?e.push({type:"setDecoration",value:"overline"}):r===55?e.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?e.push({type:"setForegroundColor",value:{type:"named",name:H[r-90+8]}}):r>=100&&r<=107&&e.push({type:"setBackgroundColor",value:{type:"named",name:H[r-100+8]}})}return e}function qo(){let t=null,e=null,n=new Set;return{parse(r){const o=[];let i=0;do{const s=Wo(r,i),l=s.sequence?r.substring(i,s.startPosition):r.substring(i);if(l.length>0&&o.push({value:l,foreground:t,background:e,decorations:new Set(n)}),s.sequence){const a=zo(s.sequence);for(const c of a)c.type==="resetAll"?(t=null,e=null,n.clear()):c.type==="resetForegroundColor"?t=null:c.type==="resetBackgroundColor"?e=null:c.type==="resetDecoration"&&n.delete(c.value);for(const c of a)c.type==="setForegroundColor"?t=c.value:c.type==="setBackgroundColor"?e=c.value:c.type==="setDecoration"&&n.add(c.value)}i=s.position}while(i<r.length);return o}}}var Vo={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function Ko(t=Vo){function e(l){return t[l]}function n(l){return`#${l.map(a=>Math.max(0,Math.min(a,255)).toString(16).padStart(2,"0")).join("")}`}let r;function o(){if(r)return r;r=[];for(let c=0;c<H.length;c++)r.push(e(H[c]));let l=[0,95,135,175,215,255];for(let c=0;c<6;c++)for(let u=0;u<6;u++)for(let p=0;p<6;p++)r.push(n([l[c],l[u],l[p]]));let a=8;for(let c=0;c<24;c++,a+=10)r.push(n([a,a,a]));return r}function i(l){return o()[l]}function s(l){switch(l.type){case"named":return e(l.name);case"rgb":return n(l.rgb);case"table":return i(l.index)}}return{value:s}}const Yo={black:"#000000",red:"#cd3131",green:"#0DBC79",yellow:"#E5E510",blue:"#2472C8",magenta:"#BC3FBC",cyan:"#11A8CD",white:"#E5E5E5",brightBlack:"#666666",brightRed:"#F14C4C",brightGreen:"#23D18B",brightYellow:"#F5F543",brightBlue:"#3B8EEA",brightMagenta:"#D670D6",brightCyan:"#29B8DB",brightWhite:"#FFFFFF"};function Jo(t,e,n){const r=Se(t,n),o=Ne(e),i=Object.fromEntries(H.map(a=>{const c=`terminal.ansi${a[0].toUpperCase()}${a.substring(1)}`,u=t.colors?.[c];return[a,u||Yo[a]]})),s=Ko(i),l=qo();return o.map(a=>l.parse(a[0]).map(c=>{let u,p;c.decorations.has("reverse")?(u=c.background?s.value(c.background):t.bg,p=c.foreground?s.value(c.foreground):t.fg):(u=c.foreground?s.value(c.foreground):t.fg,p=c.background?s.value(c.background):void 0),u=j(u,r),p=j(p,r),c.decorations.has("dim")&&(u=Xo(u));let d=P.None;return c.decorations.has("bold")&&(d|=P.Bold),c.decorations.has("italic")&&(d|=P.Italic),c.decorations.has("underline")&&(d|=P.Underline),c.decorations.has("strikethrough")&&(d|=P.Strikethrough),{content:c.value,offset:a[1],color:u,bgColor:p,fontStyle:d}}))}function Xo(t){const e=t.match(/#([0-9a-f]{3,8})/i);if(e){const r=e[1];if(r.length===8){const o=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${o}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const o=r[0],i=r[1],s=r[2],l=r[3],a=Math.round(Number.parseInt(`${l}${l}`,16)/2).toString(16).padStart(2,"0");return`#${o}${o}${i}${i}${s}${s}${a}`}else if(r.length===3){const o=r[0],i=r[1],s=r[2];return`#${o}${o}${i}${i}${s}${s}80`}}}const n=t.match(/var\((--[\w-]+-ansi-[\w-]+)\)/);return n?`var(${n[1]}-dim)`:t}function it(t,e,n={}){const{theme:r=t.getLoadedThemes()[0]}=n,o=t.resolveLangAlias(n.lang||"text");if(nt(o)||rt(r))return Ne(e).map(a=>[{content:a[0],offset:a[1]}]);const{theme:i,colorMap:s}=t.setTheme(r);if(o==="ansi")return Jo(i,e,n);const l=t.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==l.name)throw new R(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${l.name}"`);if(!n.grammarState.themes.includes(i.name))throw new R(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${i.name}"`)}return Zo(e,l,i,s,n)}function Qo(...t){if(t.length===2)return ie(t[1]);const[e,n,r={}]=t,{lang:o="text",theme:i=e.getLoadedThemes()[0]}=r;if(nt(o)||rt(i))throw new R("Plain language does not have grammar state");if(o==="ansi")throw new R("ANSI language does not have grammar state");const{theme:s,colorMap:l}=e.setTheme(i),a=e.getLanguage(o);return new Q(st(n,a,s,l,r).stateStack,a.name,s.name)}function Zo(t,e,n,r,o){const i=st(t,e,n,r,o),s=new Q(i.stateStack,e.name,n.name);return Re(i.tokens,s),i.tokens}function st(t,e,n,r,o){const i=Se(n,o),{tokenizeMaxLineLength:s=0,tokenizeTimeLimit:l=500}=o,a=Ne(t);let c=o.grammarState?jo(o.grammarState,n.name)??qe:o.grammarContextCode!=null?st(o.grammarContextCode,e,n,r,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:qe,u=[];const p=[];for(let d=0,m=a.length;d<m;d++){const[h,b]=a[d];if(h===""){u=[],p.push([]);continue}if(s>0&&h.length>=s){u=[],p.push([{content:h,offset:b,color:"",fontStyle:0}]);continue}let S,y,_;o.includeExplanation&&(S=e.tokenizeLine(h,c,l),y=S.tokens,_=0);const g=e.tokenizeLine2(h,c,l),w=g.tokens.length/2;for(let C=0;C<w;C++){const I=g.tokens[2*C],$=C+1<w?g.tokens[2*C+2]:h.length;if(I===$)continue;const mt=g.tokens[2*C+1],xn=j(r[Y.getForeground(mt)],i),Ln=Y.getFontStyle(mt),Ae={content:h.substring(I,$),offset:b+I,color:xn,fontStyle:Ln};if(o.includeExplanation){const ht=[];if(o.includeExplanation!=="scopeName")for(const G of n.settings){let W;switch(typeof G.scope){case"string":W=G.scope.split(/,/).map(Pe=>Pe.trim());break;case"object":W=G.scope;break;default:continue}ht.push({settings:G,selectors:W.map(Pe=>Pe.split(/ /))})}Ae.explanation=[];let dt=0;for(;I+dt<$;){const G=y[_],W=h.substring(G.startIndex,G.endIndex);dt+=W.length,Ae.explanation.push({content:W,scopes:o.includeExplanation==="scopeName"?ei(G.scopes):ti(ht,G.scopes)}),_+=1}}u.push(Ae)}p.push(u),u=[],c=g.ruleStack}return{tokens:p,stateStack:c}}function ei(t){return t.map(e=>({scopeName:e}))}function ti(t,e){const n=[];for(let r=0,o=e.length;r<o;r++){const i=e[r];n[r]={scopeName:i,themeMatches:ri(t,i,e.slice(0,r))}}return n}function Et(t,e){return t===e||e.substring(0,t.length)===t&&e[t.length]==="."}function ni(t,e,n){if(!Et(t[t.length-1],e))return!1;let r=t.length-2,o=n.length-1;for(;r>=0&&o>=0;)Et(t[r],n[o])&&(r-=1),o-=1;return r===-1}function ri(t,e,n){const r=[];for(const{selectors:o,settings:i}of t)for(const s of o)if(ni(s,e,n)){r.push(i);break}return r}function _n(t,e,n){const r=Object.entries(n.themes).filter(a=>a[1]).map(a=>({color:a[0],theme:a[1]})),o=r.map(a=>{const c=it(t,e,{...n,theme:a.theme}),u=ie(c),p=typeof a.theme=="string"?a.theme:a.theme.name;return{tokens:c,state:u,theme:p}}),i=oi(...o.map(a=>a.tokens)),s=i[0].map((a,c)=>a.map((u,p)=>{const d={content:u.content,variants:{},offset:u.offset};return"includeExplanation"in n&&n.includeExplanation&&(d.explanation=u.explanation),i.forEach((m,h)=>{const{content:b,explanation:S,offset:y,..._}=m[c][p];d.variants[r[h].color]=_}),d})),l=o[0].state?new Q(Object.fromEntries(o.map(a=>[a.theme,a.state?.getInternalStack(a.theme)])),o[0].state.lang):void 0;return l&&Re(s,l),s}function oi(...t){const e=t.map(()=>[]),n=t.length;for(let r=0;r<t[0].length;r++){const o=t.map(a=>a[r]),i=e.map(()=>[]);e.forEach((a,c)=>a.push(i[c]));const s=o.map(()=>0),l=o.map(a=>a[0]);for(;l.every(a=>a);){const a=Math.min(...l.map(c=>c.content.length));for(let c=0;c<n;c++){const u=l[c];u.content.length===a?(i[c].push(u),s[c]+=1,l[c]=o[c][s[c]]):(i[c].push({...u,content:u.content.slice(0,a)}),l[c]={...u,content:u.content.slice(a),offset:u.offset+a})}}}return e}function ve(t,e,n){let r,o,i,s,l,a;if("themes"in n){const{defaultColor:c="light",cssVariablePrefix:u="--shiki-",colorsRendering:p="css-vars"}=n,d=Object.entries(n.themes).filter(y=>y[1]).map(y=>({color:y[0],theme:y[1]})).sort((y,_)=>y.color===c?-1:_.color===c?1:0);if(d.length===0)throw new R("`themes` option must not be empty");const m=_n(t,e,n);if(a=ie(m),c&&ot!==c&&!d.find(y=>y.color===c))throw new R(`\`themes\` option must contain the defaultColor key \`${c}\``);const h=d.map(y=>t.getTheme(y.theme)),b=d.map(y=>y.color);i=m.map(y=>y.map(_=>Do(_,b,u,c,p))),a&&Re(i,a);const S=d.map(y=>Se(y.theme,n));o=It(d,h,S,u,c,"fg",p),r=It(d,h,S,u,c,"bg",p),s=`shiki-themes ${h.map(y=>y.name).join(" ")}`,l=c?void 0:[o,r].join(";")}else if("theme"in n){const c=Se(n.theme,n);i=it(t,e,n);const u=t.getTheme(n.theme);r=j(u.bg,c),o=j(u.fg,c),s=u.name,a=ie(i)}else throw new R("Invalid options, either `theme` or `themes` must be provided");return{tokens:i,fg:o,bg:r,themeName:s,rootStyle:l,grammarState:a}}function It(t,e,n,r,o,i,s){return t.map((l,a)=>{const c=j(e[a][i],n[a])||"inherit",u=`${r+l.color}${i==="bg"?"-bg":""}:${c}`;if(a===0&&o){if(o===ot&&t.length>1){const p=t.findIndex(b=>b.color==="light"),d=t.findIndex(b=>b.color==="dark");if(p===-1||d===-1)throw new R('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const m=j(e[p][i],n[p])||"inherit",h=j(e[d][i],n[d])||"inherit";return`light-dark(${m}, ${h});${u}`}return c}return s==="css-vars"?u:null}).filter(l=>!!l).join(";")}function Ce(t,e,n,r={meta:{},options:n,codeToHast:(o,i)=>Ce(t,o,i),codeToTokens:(o,i)=>ve(t,o,i)}){let o=e;for(const h of we(n))o=h.preprocess?.call(r,o,n)||o;let{tokens:i,fg:s,bg:l,themeName:a,rootStyle:c,grammarState:u}=ve(t,o,n);const{mergeWhitespaces:p=!0,mergeSameStyleTokens:d=!1}=n;p===!0?i=si(i):p==="never"&&(i=ai(i)),d&&(i=li(i));const m={...r,get source(){return o}};for(const h of we(n))i=h.tokens?.call(m,i)||i;return ii(i,{...n,fg:s,bg:l,themeName:a,rootStyle:n.rootStyle===!1?!1:n.rootStyle??c},m,u)}function ii(t,e,n,r=ie(t)){const o=we(e),i=[],s={type:"root",children:[]},{structure:l="classic",tabindex:a="0"}=e,c={class:`shiki ${e.themeName||""}`};e.rootStyle!==!1&&(e.rootStyle!=null?c.style=e.rootStyle:c.style=`background-color:${e.bg};color:${e.fg}`),a!==!1&&a!=null&&(c.tabindex=a.toString());for(const[b,S]of Object.entries(e.meta||{}))b.startsWith("_")||(c[b]=S);let u={type:"element",tagName:"pre",properties:c,children:[],data:e.data},p={type:"element",tagName:"code",properties:{},children:i};const d=[],m={...n,structure:l,addClassToHast:gn,get source(){return n.source},get tokens(){return t},get options(){return e},get root(){return s},get pre(){return u},get code(){return p},get lines(){return d}};if(t.forEach((b,S)=>{S&&(l==="inline"?s.children.push({type:"element",tagName:"br",properties:{},children:[]}):l==="classic"&&i.push({type:"text",value:`
12
+ `}));let y={type:"element",tagName:"span",properties:{class:"line"},children:[]},_=0;for(const g of b){let w={type:"element",tagName:"span",properties:{...g.htmlAttrs},children:[{type:"text",value:g.content}]};const C=Xe(g.htmlStyle||ke(g));C&&(w.properties.style=C);for(const I of o)w=I?.span?.call(m,w,S+1,_,y,g)||w;l==="inline"?s.children.push(w):l==="classic"&&y.children.push(w),_+=g.content.length}if(l==="classic"){for(const g of o)y=g?.line?.call(m,y,S+1)||y;d.push(y),i.push(y)}else l==="inline"&&d.push(y)}),l==="classic"){for(const b of o)p=b?.code?.call(m,p)||p;u.children.push(p);for(const b of o)u=b?.pre?.call(m,u)||u;s.children.push(u)}else if(l==="inline"){const b=[];let S={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const g of s.children)g.type==="element"&&g.tagName==="br"?(b.push(S),S={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(g.type==="element"||g.type==="text")&&S.children.push(g);b.push(S);let _={type:"element",tagName:"code",properties:{},children:b};for(const g of o)_=g?.code?.call(m,_)||_;s.children=[];for(let g=0;g<_.children.length;g++){g>0&&s.children.push({type:"element",tagName:"br",properties:{},children:[]});const w=_.children[g];w.type==="element"&&s.children.push(...w.children)}}let h=s;for(const b of o)h=b?.root?.call(m,h)||h;return r&&Re(h,r),h}function si(t){return t.map(e=>{const n=[];let r="",o;return e.forEach((i,s)=>{const a=!(i.fontStyle&&(i.fontStyle&P.Underline||i.fontStyle&P.Strikethrough));a&&i.content.match(/^\s+$/)&&e[s+1]?(o===void 0&&(o=i.offset),r+=i.content):r?(a?n.push({...i,offset:o,content:r+i.content}):n.push({content:r,offset:o},i),o=void 0,r=""):n.push(i)}),n})}function ai(t){return t.map(e=>e.flatMap(n=>{if(n.content.match(/^\s+$/))return n;const r=n.content.match(/^(\s*)(.*?)(\s*)$/);if(!r)return n;const[,o,i,s]=r;if(!o&&!s)return n;const l=[{...n,offset:n.offset+o.length,content:i}];return o&&l.unshift({content:o,offset:n.offset}),s&&l.push({content:s,offset:n.offset+o.length+i.length}),l}))}function li(t){return t.map(e=>{const n=[];for(const r of e){if(n.length===0){n.push({...r});continue}const o=n[n.length-1],i=Xe(o.htmlStyle||ke(o)),s=Xe(r.htmlStyle||ke(r)),l=o.fontStyle&&(o.fontStyle&P.Underline||o.fontStyle&P.Strikethrough),a=r.fontStyle&&(r.fontStyle&P.Underline||r.fontStyle&P.Strikethrough);!l&&!a&&i===s?o.content+=r.content:n.push({...r})}return n})}const ci=To;function ui(t,e,n){const r={meta:{},options:n,codeToHast:(i,s)=>Ce(t,i,s),codeToTokens:(i,s)=>ve(t,i,s)};let o=ci(Ce(t,e,n,r));for(const i of we(n))o=i.postprocess?.call(r,o,n)||o;return o}const Ot={light:"#333333",dark:"#bbbbbb"},Mt={light:"#fffffe",dark:"#1e1e1e"},Bt="__shiki_resolved";function at(t){if(t?.[Bt])return t;const e={...t};e.tokenColors&&!e.settings&&(e.settings=e.tokenColors,delete e.tokenColors),e.type||="dark",e.colorReplacements={...e.colorReplacements},e.settings||=[];let{bg:n,fg:r}=e;if(!n||!r){const l=e.settings?e.settings.find(a=>!a.name&&!a.scope):void 0;l?.settings?.foreground&&(r=l.settings.foreground),l?.settings?.background&&(n=l.settings.background),!r&&e?.colors?.["editor.foreground"]&&(r=e.colors["editor.foreground"]),!n&&e?.colors?.["editor.background"]&&(n=e.colors["editor.background"]),r||(r=e.type==="light"?Ot.light:Ot.dark),n||(n=e.type==="light"?Mt.light:Mt.dark),e.fg=r,e.bg=n}e.settings[0]&&e.settings[0].settings&&!e.settings[0].scope||e.settings.unshift({settings:{foreground:e.fg,background:e.bg}});let o=0;const i=new Map;function s(l){if(i.has(l))return i.get(l);o+=1;const a=`#${o.toString(16).padStart(8,"0").toLowerCase()}`;return e.colorReplacements?.[`#${a}`]?s(l):(i.set(l,a),a)}e.settings=e.settings.map(l=>{const a=l.settings?.foreground&&!l.settings.foreground.startsWith("#"),c=l.settings?.background&&!l.settings.background.startsWith("#");if(!a&&!c)return l;const u={...l,settings:{...l.settings}};if(a){const p=s(l.settings.foreground);e.colorReplacements[p]=l.settings.foreground,u.settings.foreground=p}if(c){const p=s(l.settings.background);e.colorReplacements[p]=l.settings.background,u.settings.background=p}return u});for(const l of Object.keys(e.colors||{}))if((l==="editor.foreground"||l==="editor.background"||l.startsWith("terminal.ansi"))&&!e.colors[l]?.startsWith("#")){const a=s(e.colors[l]);e.colorReplacements[a]=e.colors[l],e.colors[l]=a}return Object.defineProperty(e,Bt,{enumerable:!1,writable:!1,value:!0}),e}async function Sn(t){return Array.from(new Set((await Promise.all(t.filter(e=>!dn(e)).map(async e=>await hn(e).then(n=>Array.isArray(n)?n:[n])))).flat()))}async function kn(t){return(await Promise.all(t.map(async n=>fn(n)?null:at(await hn(n))))).filter(n=>!!n)}let pi=3;function mi(t,e=3){e>pi||console.trace(`[SHIKI DEPRECATE]: ${t}`)}let q=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function wn(t,e){if(!e)return t;if(e[t]){const n=new Set([t]);for(;e[t];){if(t=e[t],n.has(t))throw new q(`Circular alias \`${Array.from(n).join(" -> ")} -> ${t}\``);n.add(t)}}return t}class hi extends dr{constructor(e,n,r,o={}){super(e),this._resolver=e,this._themes=n,this._langs=r,this._alias=o,this._themes.map(i=>this.loadTheme(i)),this.loadLanguages(this._langs)}_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const n=at(e);return n.name&&(this._resolvedThemes.set(n.name,n),this._loadedThemesCache=null),n}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let n=this._textmateThemeCache.get(e);n||(n=fe.createFromRawTheme(e),this._textmateThemeCache.set(e,n)),this._syncRegistry.setTheme(n)}getGrammar(e){return e=wn(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const n=new Set([...this._langMap.values()].filter(i=>i.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const r={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const o=this.loadGrammarWithConfiguration(e.scopeName,1,r);if(o.name=e.name,this._resolvedGrammars.set(e.name,o),e.aliases&&e.aliases.forEach(i=>{this._alias[i]=e.name}),this._loadedLanguagesCache=null,n.size)for(const i of n)this._resolvedGrammars.delete(i.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(i.scopeName),this._syncRegistry?._grammars?.delete(i.scopeName),this.loadLanguage(this._langMap.get(i.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const o of e)this.resolveEmbeddedLanguages(o);const n=Array.from(this._langGraph.entries()),r=n.filter(([o,i])=>!i);if(r.length){const o=n.filter(([i,s])=>s?(s.embeddedLanguages||s.embeddedLangs)?.some(a=>r.map(([c])=>c).includes(a)):!1).filter(i=>!r.includes(i));throw new q(`Missing languages ${r.map(([i])=>`\`${i}\``).join(", ")}, required by ${o.map(([i])=>`\`${i}\``).join(", ")}`)}for(const[o,i]of n)this._resolver.addLanguage(i);for(const[o,i]of n)this.loadLanguage(i)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);const n=e.embeddedLanguages??e.embeddedLangs;if(n)for(const r of n)this._langGraph.set(r,this._langMap.get(r))}}class di{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,n){this._onigLib={createOnigScanner:r=>e.createScanner(r),createOnigString:r=>e.createString(r)},n.forEach(r=>this.addLanguage(r))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(n=>{this._langs.set(n,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(n=>{this._injections.get(n)||this._injections.set(n,[]),this._injections.get(n).push(e.scopeName)})}getInjections(e){const n=e.split(".");let r=[];for(let o=1;o<=n.length;o++){const i=n.slice(0,o).join(".");r=[...r,...this._injections.get(i)||[]]}return r}}let Z=0;function fi(t){Z+=1,t.warnings!==!1&&Z>=10&&Z%10===0&&console.warn(`[Shiki] ${Z} 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.`);let e=!1;if(!t.engine)throw new q("`engine` option is required for synchronous mode");const n=(t.langs||[]).flat(1),r=(t.themes||[]).flat(1).map(at),o=new di(t.engine,n),i=new hi(o,r,n,t.langAlias);let s;function l(g){return wn(g,t.langAlias)}function a(g){y();const w=i.getGrammar(typeof g=="string"?g:g.name);if(!w)throw new q(`Language \`${g}\` not found, you may need to load it first`);return w}function c(g){if(g==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};y();const w=i.getTheme(g);if(!w)throw new q(`Theme \`${g}\` not found, you may need to load it first`);return w}function u(g){y();const w=c(g);s!==g&&(i.setTheme(w),s=g);const C=i.getColorMap();return{theme:w,colorMap:C}}function p(){return y(),i.getLoadedThemes()}function d(){return y(),i.getLoadedLanguages()}function m(...g){y(),i.loadLanguages(g.flat(1))}async function h(...g){return m(await Sn(g))}function b(...g){y();for(const w of g.flat(1))i.loadTheme(w)}async function S(...g){return y(),b(await kn(g))}function y(){if(e)throw new q("Shiki instance has been disposed")}function _(){e||(e=!0,i.dispose(),Z-=1)}return{setTheme:u,getTheme:c,getLanguage:a,getLoadedThemes:p,getLoadedLanguages:d,resolveLangAlias:l,loadLanguage:h,loadLanguageSync:m,loadTheme:S,loadThemeSync:b,dispose:_,[Symbol.dispose]:_}}async function gi(t){t.engine||mi("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[e,n,r]=await Promise.all([kn(t.themes||[]),Sn(t.langs||[]),t.engine]);return fi({...t,themes:e,langs:n,engine:r})}async function yi(t){const e=await gi(t);return{getLastGrammarState:(...n)=>Qo(e,...n),codeToTokensBase:(n,r)=>it(e,n,r),codeToTokensWithThemes:(n,r)=>_n(e,n,r),codeToTokens:(n,r)=>ve(e,n,r),codeToHast:(n,r)=>Ce(e,n,r),codeToHtml:(n,r)=>ui(e,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...e,getInternalContext:()=>e}}function bi(t){const e=t.langs,n=t.themes,r=t.engine;async function o(i){function s(p){if(typeof p=="string"){if(p=i.langAlias?.[p]||p,dn(p))return[];const d=e[p];if(!d)throw new R(`Language \`${p}\` is not included in this bundle. You may want to load it from external source.`);return d}return p}function l(p){if(fn(p))return"none";if(typeof p=="string"){const d=n[p];if(!d)throw new R(`Theme \`${p}\` is not included in this bundle. You may want to load it from external source.`);return d}return p}const a=(i.themes??[]).map(p=>l(p)),c=(i.langs??[]).map(p=>s(p)),u=await yi({engine:i.engine??r(),...i,themes:a,langs:c});return{...u,loadLanguage(...p){return u.loadLanguage(...p.map(s))},loadTheme(...p){return u.loadTheme(...p.map(l))},getBundledLanguages(){return e},getBundledThemes(){return n}}}return o}const vn=[{id:"abap",name:"ABAP",import:(()=>import("./abap-Dg923wIy.js"))},{id:"actionscript-3",name:"ActionScript",import:(()=>import("./actionscript-3-8WTK4YD2.js"))},{id:"ada",name:"Ada",import:(()=>import("./ada-CTi7YQtL.js"))},{id:"angular-html",name:"Angular HTML",import:(()=>import("./angular-html-D2R1pe45.js").then(function(t){return t.f}))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>import("./angular-ts-BDmYQnhm.js"))},{id:"apache",name:"Apache Conf",import:(()=>import("./apache-PcO-DBxQ.js"))},{id:"apex",name:"Apex",import:(()=>import("./apex-CnCu5_gb.js"))},{id:"apl",name:"APL",import:(()=>import("./apl-DkfyvC6M.js"))},{id:"applescript",name:"AppleScript",import:(()=>import("./applescript-Ds_W2jPS.js"))},{id:"ara",name:"Ara",import:(()=>import("./ara-C1--7J61.js"))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>import("./asciidoc-nTfEFGxb.js"))},{id:"asm",name:"Assembly",import:(()=>import("./asm-CTFRnVOM.js"))},{id:"astro",name:"Astro",import:(()=>import("./astro-DtPAdMss.js"))},{id:"awk",name:"AWK",import:(()=>import("./awk-CrWgQKhV.js"))},{id:"ballerina",name:"Ballerina",import:(()=>import("./ballerina-a0yOSyc5.js"))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>import("./bat-B0cHNp6s.js"))},{id:"beancount",name:"Beancount",import:(()=>import("./beancount-dPJi_gci.js"))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>import("./berry-CVKoklHx.js"))},{id:"bibtex",name:"BibTeX",import:(()=>import("./bibtex-DRcCXNgM.js"))},{id:"bicep",name:"Bicep",import:(()=>import("./bicep-jWz-hQ8I.js"))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>import("./bird2-DaGXIRGu.js"))},{id:"blade",name:"Blade",import:(()=>import("./blade-QlWdzBxO.js"))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>import("./bsl-jNujDQK2.js"))},{id:"c",name:"C",import:(()=>import("./c-BG-tZi7o.js"))},{id:"c3",name:"C3",import:(()=>import("./c3-Fcb8_HKm.js"))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>import("./cadence-BuaeHeSu.js"))},{id:"cairo",name:"Cairo",import:(()=>import("./cairo-BYiDgOF2.js"))},{id:"clarity",name:"Clarity",import:(()=>import("./clarity-CC_0IFDj.js"))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>import("./clojure-KnfDkB_V.js"))},{id:"cmake",name:"CMake",import:(()=>import("./cmake-bh2MLnkv.js"))},{id:"cobol",name:"COBOL",import:(()=>import("./cobol-dIXRVV9Y.js"))},{id:"codeowners",name:"CODEOWNERS",import:(()=>import("./codeowners-CtwIM3TN.js"))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>import("./codeql-D164juXQ.js"))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>import("./coffee-Bk-z6oI_.js"))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>import("./common-lisp-DXc9XcIM.js"))},{id:"coq",name:"Coq",import:(()=>import("./coq-BBL5-mG4.js"))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>import("./cpp-C0lzDePx.js"))},{id:"crystal",name:"Crystal",import:(()=>import("./crystal-Bhade0k2.js"))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>import("./csharp-B7nLXyi8.js"))},{id:"css",name:"CSS",import:(()=>import("./css-PZBBrkI0.js"))},{id:"csv",name:"CSV",import:(()=>import("./csv-D5aBhKLr.js"))},{id:"cue",name:"CUE",import:(()=>import("./cue-WCin6O4e.js"))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>import("./cypher-DYQk2G82.js"))},{id:"d",name:"D",import:(()=>import("./d-DVc-yF-l.js"))},{id:"dart",name:"Dart",import:(()=>import("./dart-YLd5yyRs.js"))},{id:"dax",name:"DAX",import:(()=>import("./dax-oldcCaJg.js"))},{id:"desktop",name:"Desktop",import:(()=>import("./desktop-DZfyBMgF.js"))},{id:"diff",name:"Diff",import:(()=>import("./diff-jW5kmiru.js"))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>import("./docker-DG9neUKd.js"))},{id:"dotenv",name:"dotEnv",import:(()=>import("./dotenv-Bea-FkXq.js"))},{id:"dream-maker",name:"Dream Maker",import:(()=>import("./dream-maker-DAHQwpwp.js"))},{id:"edge",name:"Edge",import:(()=>import("./edge-zt3dU95k.js"))},{id:"elixir",name:"Elixir",import:(()=>import("./elixir-JolcG37e.js"))},{id:"elm",name:"Elm",import:(()=>import("./elm-BjIDgKzz.js"))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>import("./emacs-lisp-DMBh55R4.js"))},{id:"erb",name:"ERB",import:(()=>import("./erb-rsjdL4fB.js"))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>import("./erlang-DNeY46SW.js"))},{id:"fennel",name:"Fennel",import:(()=>import("./fennel-DBMsxtrh.js"))},{id:"fish",name:"Fish",import:(()=>import("./fish-BxskpYPN.js"))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>import("./fluent-Bwo2XpEt.js"))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>import("./fortran-fixed-form-DFFnVrrY.js"))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>import("./fortran-free-form-DB5N_DgY.js"))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>import("./fsharp-DRAF1jsN.js"))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>import("./gdresource-BD-1uzY7.js"))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>import("./gdscript-C3mT4Uym.js"))},{id:"gdshader",name:"GDShader",import:(()=>import("./gdshader-G7X6ysY3.js"))},{id:"genie",name:"Genie",import:(()=>import("./genie-DSsjfZMX.js"))},{id:"gherkin",name:"Gherkin",import:(()=>import("./gherkin-Cl2Fw-_0.js"))},{id:"git-commit",name:"Git Commit Message",import:(()=>import("./git-commit-CJPsQObV.js"))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>import("./git-rebase-DeZqv4fp.js"))},{id:"gleam",name:"Gleam",import:(()=>import("./gleam-BeBqoPwE.js"))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>import("./glimmer-js-BuyKUjfV.js"))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>import("./glimmer-ts-D9iniPFN.js"))},{id:"glsl",name:"GLSL",import:(()=>import("./glsl-BOG9l2nV.js"))},{id:"gn",name:"GN",import:(()=>import("./gn-Dxr0sSUf.js"))},{id:"gnuplot",name:"Gnuplot",import:(()=>import("./gnuplot-CtW3R_Hz.js"))},{id:"go",name:"Go",import:(()=>import("./go-BBr2UQCn.js"))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>import("./graphql-B6XHM4uj.js"))},{id:"groovy",name:"Groovy",import:(()=>import("./groovy-DFxE31Qs.js"))},{id:"hack",name:"Hack",import:(()=>import("./hack-Cxa-FaZ4.js"))},{id:"haml",name:"Ruby Haml",import:(()=>import("./haml-2e0EI6Is.js"))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>import("./handlebars-CojHdNmS.js"))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>import("./haskell-BfdhR_WN.js"))},{id:"haxe",name:"Haxe",import:(()=>import("./haxe-DVIybFAS.js"))},{id:"hcl",name:"HashiCorp HCL",import:(()=>import("./hcl-B6OePqme.js"))},{id:"hjson",name:"Hjson",import:(()=>import("./hjson-D2jn7IRw.js"))},{id:"hlsl",name:"HLSL",import:(()=>import("./hlsl-MKeth5V9.js"))},{id:"html",name:"HTML",import:(()=>import("./html-DOf0XnR2.js"))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>import("./html-derivative-DfCZ6Hio.js"))},{id:"http",name:"HTTP",import:(()=>import("./http-CG3jvXcS.js"))},{id:"hurl",name:"Hurl",import:(()=>import("./hurl-CxQrh4RI.js"))},{id:"hxml",name:"HXML",import:(()=>import("./hxml-CkS3Eie7.js"))},{id:"hy",name:"Hy",import:(()=>import("./hy-DI6mCUnw.js"))},{id:"imba",name:"Imba",import:(()=>import("./imba-D-Pk5S0X.js"))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>import("./ini-Dix3pTmg.js"))},{id:"java",name:"Java",import:(()=>import("./java-BTDmaRNO.js"))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>import("./javascript-WyGyM1wV.js"))},{id:"jinja",name:"Jinja",import:(()=>import("./jinja-D0mZ3q2r.js"))},{id:"jison",name:"Jison",import:(()=>import("./jison-B9XHrcYJ.js"))},{id:"json",name:"JSON",import:(()=>import("./json-B8JryHcM.js"))},{id:"json5",name:"JSON5",import:(()=>import("./json5-Cdatmj9n.js"))},{id:"jsonc",name:"JSON with Comments",import:(()=>import("./jsonc-CvUCa1o5.js"))},{id:"jsonl",name:"JSON Lines",import:(()=>import("./jsonl-9I_GBd5L.js"))},{id:"jsonnet",name:"Jsonnet",import:(()=>import("./jsonnet-XoenQ2oc.js"))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>import("./jssm-CWE2S0Z5.js"))},{id:"jsx",name:"JSX",import:(()=>import("./jsx-8cLv2Six.js"))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>import("./julia-C1oINnwa.js"))},{id:"just",name:"Just",import:(()=>import("./just-Bo3fV9RY.js"))},{id:"kdl",name:"KDL",import:(()=>import("./kdl-CMbyIXjQ.js"))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>import("./kotlin-BQy537ds.js"))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>import("./kusto-B_y0uMaZ.js"))},{id:"latex",name:"LaTeX",import:(()=>import("./latex-CZAhoKip.js"))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>import("./lean-C4RHkN41.js"))},{id:"less",name:"Less",import:(()=>import("./less-XNfgnZC7.js"))},{id:"liquid",name:"Liquid",import:(()=>import("./liquid-DFlqVvG0.js"))},{id:"llvm",name:"LLVM IR",import:(()=>import("./llvm-BJRUtCev.js"))},{id:"log",name:"Log file",import:(()=>import("./log-CcaF_xNv.js"))},{id:"logo",name:"Logo",import:(()=>import("./logo-D9WQLoKQ.js"))},{id:"lua",name:"Lua",import:(()=>import("./lua-8Av-h-ns.js"))},{id:"luau",name:"Luau",import:(()=>import("./luau-BTSFCcFb.js"))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>import("./make-DXVx14cr.js"))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>import("./markdown-DX-TNHnc.js"))},{id:"marko",name:"Marko",import:(()=>import("./marko-DiIoNBFw.js"))},{id:"matlab",name:"MATLAB",import:(()=>import("./matlab-DzreyMvm.js"))},{id:"mdc",name:"MDC",import:(()=>import("./mdc-D_DpLax5.js"))},{id:"mdx",name:"MDX",import:(()=>import("./mdx-C2fqO2XY.js"))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>import("./mermaid-Cwy4Up_p.js"))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>import("./mipsasm-yE_Aqo9y.js"))},{id:"mojo",name:"Mojo",import:(()=>import("./mojo-M6pJPbMk.js"))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>import("./moonbit-CR8uFLGd.js"))},{id:"move",name:"Move",import:(()=>import("./move-CyYMWVy5.js"))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>import("./narrat-DXUZ_ZkW.js"))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>import("./nextflow-BPolriEg.js"))},{id:"nextflow-groovy",name:"nextflow-groovy",import:(()=>import("./nextflow-groovy-pQRwk_Jg.js"))},{id:"nginx",name:"Nginx",import:(()=>import("./nginx-DSXkacNc.js"))},{id:"nim",name:"Nim",import:(()=>import("./nim-e2z2kCcq.js"))},{id:"nix",name:"Nix",import:(()=>import("./nix-Ckjrpg0r.js"))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>import("./nushell-DtHLcZf1.js"))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>import("./objective-c-BoaBTdtz.js"))},{id:"objective-cpp",name:"Objective-C++",import:(()=>import("./objective-cpp-DstR8hNy.js"))},{id:"ocaml",name:"OCaml",import:(()=>import("./ocaml-DTbn2Hv7.js"))},{id:"odin",name:"Odin",import:(()=>import("./odin-Bxc4S6Xn.js"))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>import("./openscad-CXHpNBsb.js"))},{id:"pascal",name:"Pascal",import:(()=>import("./pascal-Sr-XLSE6.js"))},{id:"perl",name:"Perl",import:(()=>import("./perl-C95KruZl.js"))},{id:"php",name:"PHP",import:(()=>import("./php-B4Kqya17.js"))},{id:"pkl",name:"Pkl",import:(()=>import("./pkl-CRusufhw.js"))},{id:"plsql",name:"PL/SQL",import:(()=>import("./plsql-Dbm3tV2N.js"))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>import("./po-LG0lFwH4.js"))},{id:"polar",name:"Polar",import:(()=>import("./polar-DjOs3GWb.js"))},{id:"postcss",name:"PostCSS",import:(()=>import("./postcss-GRRkWn2F.js"))},{id:"powerquery",name:"PowerQuery",import:(()=>import("./powerquery-DHf-dtTS.js"))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>import("./powershell-DXrKVo3G.js"))},{id:"prisma",name:"Prisma",import:(()=>import("./prisma-Dgf8IN_C.js"))},{id:"prolog",name:"Prolog",import:(()=>import("./prolog-9JcfiY6I.js"))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>import("./proto-dqx_Sj2i.js"))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>import("./pug-CoOVtr4u.js"))},{id:"puppet",name:"Puppet",import:(()=>import("./puppet-Di57VbSS.js"))},{id:"purescript",name:"PureScript",import:(()=>import("./purescript-BgpM7rDH.js"))},{id:"python",name:"Python",aliases:["py"],import:(()=>import("./python-B6Ihcp-E.js"))},{id:"qml",name:"QML",import:(()=>import("./qml-DmGQGbca.js"))},{id:"qmldir",name:"QML Directory",import:(()=>import("./qmldir-DXd9s5XC.js"))},{id:"qss",name:"Qt Style Sheets",import:(()=>import("./qss-B7NnhfIi.js"))},{id:"r",name:"R",import:(()=>import("./r-1ts4xG1r.js"))},{id:"racket",name:"Racket",import:(()=>import("./racket-CeDx7KO2.js"))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>import("./raku-BMJwmrCS.js"))},{id:"razor",name:"ASP.NET Razor",import:(()=>import("./razor-BaMsy-R7.js"))},{id:"reg",name:"Windows Registry Script",import:(()=>import("./reg-Cvyu2Gnx.js"))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>import("./regexp-DK-WlHNu.js"))},{id:"rel",name:"Rel",import:(()=>import("./rel-BlqNHz8k.js"))},{id:"riscv",name:"RISC-V",import:(()=>import("./riscv-C5dpdlr7.js"))},{id:"ron",name:"RON",import:(()=>import("./ron-j5NfrB3z.js"))},{id:"rosmsg",name:"ROS Interface",import:(()=>import("./rosmsg-ZkSIzPhc.js"))},{id:"rst",name:"reStructuredText",import:(()=>import("./rst-C371KPjr.js"))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>import("./ruby-DusoydGj.js"))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>import("./rust-CxuBE0J8.js"))},{id:"sas",name:"SAS",import:(()=>import("./sas-DtSHuIwI.js"))},{id:"sass",name:"Sass",import:(()=>import("./sass-bfEVHPJ8.js"))},{id:"scala",name:"Scala",import:(()=>import("./scala-Dtw19ca_.js"))},{id:"scheme",name:"Scheme",import:(()=>import("./scheme-OJppFQF3.js"))},{id:"scss",name:"SCSS",import:(()=>import("./scss-DxBkwadj.js"))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>import("./sdbl-CvZs3G9c.js"))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>import("./shaderlab-CEJedz68.js"))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>import("./shellscript-DgJyDXW6.js"))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>import("./shellsession-DSlzxnCM.js"))},{id:"smalltalk",name:"Smalltalk",import:(()=>import("./smalltalk-B9IHbYt7.js"))},{id:"solidity",name:"Solidity",import:(()=>import("./solidity-B3CjIuAd.js"))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>import("./soy-BSb8SaP0.js"))},{id:"sparql",name:"SPARQL",import:(()=>import("./sparql-BJh4JEw-.js"))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>import("./splunk-h-bNAnbk.js"))},{id:"sql",name:"SQL",import:(()=>import("./sql-BbONfI8K.js"))},{id:"ssh-config",name:"SSH Config",import:(()=>import("./ssh-config-CywOjoXH.js"))},{id:"stata",name:"Stata",import:(()=>import("./stata-BKjsT8qe.js"))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>import("./stylus-CIg617SB.js"))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>import("./surrealql-2KNEnAt7.js"))},{id:"svelte",name:"Svelte",import:(()=>import("./svelte-xaxjcSSP.js"))},{id:"swift",name:"Swift",import:(()=>import("./swift-tEesUtni.js"))},{id:"system-verilog",name:"SystemVerilog",import:(()=>import("./system-verilog-Qdm_1g2q.js"))},{id:"systemd",name:"Systemd Units",import:(()=>import("./systemd-DKMPPZjB.js"))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>import("./talonscript-eRuyeYHl.js"))},{id:"tasl",name:"Tasl",import:(()=>import("./tasl-B9CVvjfG.js"))},{id:"tcl",name:"Tcl",import:(()=>import("./tcl-Bq9dbVAF.js"))},{id:"templ",name:"Templ",import:(()=>import("./templ-BVTOctZ7.js"))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>import("./terraform-CAp711iT.js"))},{id:"tex",name:"TeX",import:(()=>import("./tex-BHxF5DMe.js"))},{id:"toml",name:"TOML",import:(()=>import("./toml-Ms459DBw.js"))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>import("./ts-tags-C-gylFal.js"))},{id:"tsv",name:"TSV",import:(()=>import("./tsv-BFtm7NXx.js"))},{id:"tsx",name:"TSX",import:(()=>import("./tsx-D6116Ycy.js"))},{id:"turtle",name:"Turtle",import:(()=>import("./turtle-DpRhbQZY.js"))},{id:"twig",name:"Twig",import:(()=>import("./twig-DuP5mDZ4.js"))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>import("./typescript-BqvgUolh.js"))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>import("./typespec-DhK7u29_.js"))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>import("./typst-Dfd71gQj.js"))},{id:"v",name:"V",import:(()=>import("./v-BH76v7br.js"))},{id:"vala",name:"Vala",import:(()=>import("./vala-z59IxkFd.js"))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>import("./vb-4AxSLKIU.js"))},{id:"verilog",name:"Verilog",import:(()=>import("./verilog-LfQUkHDc.js"))},{id:"vhdl",name:"VHDL",import:(()=>import("./vhdl-DJCsFYgn.js"))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>import("./viml-pbKHW3Ia.js"))},{id:"vue",name:"Vue",import:(()=>import("./vue-D2k0BAl5.js"))},{id:"vue-html",name:"Vue HTML",import:(()=>import("./vue-html-zEfNEgpj.js"))},{id:"vue-vine",name:"Vue Vine",import:(()=>import("./vue-vine-D9eCaTqi.js"))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>import("./vyper-DpazWNpx.js"))},{id:"wasm",name:"WebAssembly",import:(()=>import("./wasm-CFi-k9--.js"))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>import("./wenyan-CYFFG9DK.js"))},{id:"wgsl",name:"WGSL",import:(()=>import("./wgsl-CxjTZs-b.js"))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>import("./wikitext-Bx2qct8O.js"))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>import("./wit-DDW3hD69.js"))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>import("./wolfram-pu21K997.js"))},{id:"xml",name:"XML",import:(()=>import("./xml-BkAJuBCc.js"))},{id:"xsl",name:"XSL",import:(()=>import("./xsl-C6UUWSil.js"))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>import("./yaml-Bopit2L3.js"))},{id:"zenscript",name:"ZenScript",import:(()=>import("./zenscript-BIAKq-aR.js"))},{id:"zig",name:"Zig",import:(()=>import("./zig-bSFrHQ7n.js"))}],_i=Object.fromEntries(vn.map(t=>[t.id,t.import])),Si=Object.fromEntries(vn.flatMap(t=>t.aliases?.map(e=>[e,t.import])||[])),lt={..._i,...Si},ki=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>import("./andromeeda-CT0vplkN.js"))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>import("./aurora-x-C0VKFdlO.js"))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>import("./ayu-dark-wZ6ORhBL.js"))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>import("./ayu-light-xXLJ_Ch1.js"))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>import("./ayu-mirage-CQckA_sP.js"))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>import("./catppuccin-frappe-CfssSZMA.js"))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>import("./catppuccin-latte-DoBaWTGn.js"))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>import("./catppuccin-macchiato-BkAuvdZC.js"))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>import("./catppuccin-mocha-D9fcC0iT.js"))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>import("./dark-plus-DLU5INA3.js"))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>import("./dracula-XcYHBZy6.js"))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>import("./dracula-soft-BPeX9gxW.js"))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>import("./everforest-dark-WOub3wle.js"))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>import("./everforest-light-DCUg8VH8.js"))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>import("./github-dark-BQV5ugrc.js"))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>import("./github-dark-default-DLWDM7FH.js"))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>import("./github-dark-dimmed-D1FmiR_p.js"))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>import("./github-dark-high-contrast-BilLoi0o.js"))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>import("./github-light-Rcb2q3L5.js"))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>import("./github-light-default-CQ75esMw.js"))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>import("./github-light-high-contrast-CRF1wyLy.js"))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>import("./gruvbox-dark-hard-C37G1gbc.js"))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>import("./gruvbox-dark-medium-C3G9m3TV.js"))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>import("./gruvbox-dark-soft-eZmcmZ9I.js"))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>import("./gruvbox-light-hard-BYj-vz_3.js"))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>import("./gruvbox-light-medium-BdQlDiiF.js"))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>import("./gruvbox-light-soft-BGNwjiRh.js"))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>import("./horizon-cslQss18.js"))},{id:"horizon-bright",displayName:"Horizon Bright",type:"dark",import:(()=>import("./horizon-bright-CoQRYDvy.js"))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>import("./houston-RHIKkNfR.js"))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>import("./kanagawa-dragon-BOvIHJVT.js"))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>import("./kanagawa-lotus-Bwcd7Bvx.js"))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>import("./kanagawa-wave-0SAlpf0s.js"))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>import("./laserwave-si7wuSrt.js"))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>import("./light-plus-g_Fi9vkG.js"))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>import("./material-theme-CIJ3cGaW.js"))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>import("./material-theme-darker-BWg3m1GB.js"))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>import("./material-theme-lighter-DR8HWMN7.js"))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>import("./material-theme-ocean-CZf9pk28.js"))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>import("./material-theme-palenight-BF01YeZy.js"))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>import("./min-dark-DhfaepVE.js"))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>import("./min-light-6xx0uMgm.js"))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>import("./monokai-BodnsaDQ.js"))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>import("./night-owl-EdP2Hztp.js"))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>import("./night-owl-light-Bk-lYVyk.js"))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>import("./nord-BAu0wM6c.js"))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>import("./one-dark-pro-utPxbBbJ.js"))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>import("./one-light-BuCQ22aO.js"))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>import("./plastic-CXnNNlFZ.js"))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>import("./poimandres-BrOVMvuE.js"))},{id:"red",displayName:"Red",type:"dark",import:(()=>import("./red-DR6ZwibK.js"))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>import("./rose-pine-CN2F2lJl.js"))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>import("./rose-pine-dawn-0S8NEhsA.js"))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>import("./rose-pine-moon-DzBDT4rc.js"))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>import("./slack-dark-CWRQmTmo.js"))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>import("./slack-ochin-DO_ok7XK.js"))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>import("./snazzy-light-B5llO_gK.js"))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>import("./solarized-dark-G9yBjKj_.js"))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>import("./solarized-light-DeSzljQz.js"))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>import("./synthwave-84-DRVv-_m_.js"))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>import("./tokyo-night-BvwC8l2v.js"))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>import("./vesper--t9w6MWz.js"))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>import("./vitesse-black-B_BYPdvp.js"))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>import("./vitesse-dark-DOSOf2Sz.js"))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>import("./vitesse-light-gUX51GpB.js"))}],wi=Object.fromEntries(ki.map(t=>[t.id,t.import]));class ct extends Error{constructor(e){super(e),this.name="ShikiError"}}function vi(){return 2147483648}function Ci(){return typeof performance<"u"?performance.now():Date.now()}const Ni=(t,e)=>t+(e-t%e)%e;async function Ri(t){let e,n;const r={};function o(m){n=m,r.HEAPU8=new Uint8Array(m),r.HEAPU32=new Uint32Array(m)}function i(m,h,b){r.HEAPU8.copyWithin(m,h,h+b)}function s(m){try{return e.grow(m-n.byteLength+65535>>>16),o(e.buffer),1}catch{}}function l(m){const h=r.HEAPU8.length;m=m>>>0;const b=vi();if(m>b)return!1;for(let S=1;S<=4;S*=2){let y=h*(1+.2/S);y=Math.min(y,m+100663296);const _=Math.min(b,Ni(Math.max(m,y),65536));if(s(_))return!0}return!1}const a=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function c(m,h,b=1024){const S=h+b;let y=h;for(;m[y]&&!(y>=S);)++y;if(y-h>16&&m.buffer&&a)return a.decode(m.subarray(h,y));let _="";for(;h<y;){let g=m[h++];if(!(g&128)){_+=String.fromCharCode(g);continue}const w=m[h++]&63;if((g&224)===192){_+=String.fromCharCode((g&31)<<6|w);continue}const C=m[h++]&63;if((g&240)===224?g=(g&15)<<12|w<<6|C:g=(g&7)<<18|w<<12|C<<6|m[h++]&63,g<65536)_+=String.fromCharCode(g);else{const I=g-65536;_+=String.fromCharCode(55296|I>>10,56320|I&1023)}}return _}function u(m,h){return m?c(r.HEAPU8,m,h):""}const p={emscripten_get_now:Ci,emscripten_memcpy_big:i,emscripten_resize_heap:l,fd_write:()=>0};async function d(){const h=await t({env:p,wasi_snapshot_preview1:p});e=h.memory,o(e.buffer),Object.assign(r,h),r.UTF8ToString=u}return await d(),r}var xi=Object.defineProperty,Li=(t,e,n)=>e in t?xi(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,x=(t,e,n)=>Li(t,typeof e!="symbol"?e+"":e,n);let T=null;function Ti(t){throw new ct(t.UTF8ToString(t.getLastOnigError()))}class xe{constructor(e){x(this,"utf16Length"),x(this,"utf8Length"),x(this,"utf16Value"),x(this,"utf8Value"),x(this,"utf16OffsetToUtf8"),x(this,"utf8OffsetToUtf16");const n=e.length,r=xe._utf8ByteLength(e),o=r!==n,i=o?new Uint32Array(n+1):null;o&&(i[n]=r);const s=o?new Uint32Array(r+1):null;o&&(s[r]=n);const l=new Uint8Array(r);let a=0;for(let c=0;c<n;c++){const u=e.charCodeAt(c);let p=u,d=!1;if(u>=55296&&u<=56319&&c+1<n){const m=e.charCodeAt(c+1);m>=56320&&m<=57343&&(p=(u-55296<<10)+65536|m-56320,d=!0)}o&&(i[c]=a,d&&(i[c+1]=a),p<=127?s[a+0]=c:p<=2047?(s[a+0]=c,s[a+1]=c):p<=65535?(s[a+0]=c,s[a+1]=c,s[a+2]=c):(s[a+0]=c,s[a+1]=c,s[a+2]=c,s[a+3]=c)),p<=127?l[a++]=p:p<=2047?(l[a++]=192|(p&1984)>>>6,l[a++]=128|(p&63)>>>0):p<=65535?(l[a++]=224|(p&61440)>>>12,l[a++]=128|(p&4032)>>>6,l[a++]=128|(p&63)>>>0):(l[a++]=240|(p&1835008)>>>18,l[a++]=128|(p&258048)>>>12,l[a++]=128|(p&4032)>>>6,l[a++]=128|(p&63)>>>0),d&&c++}this.utf16Length=n,this.utf8Length=r,this.utf16Value=e,this.utf8Value=l,this.utf16OffsetToUtf8=i,this.utf8OffsetToUtf16=s}static _utf8ByteLength(e){let n=0;for(let r=0,o=e.length;r<o;r++){const i=e.charCodeAt(r);let s=i,l=!1;if(i>=55296&&i<=56319&&r+1<o){const a=e.charCodeAt(r+1);a>=56320&&a<=57343&&(s=(i-55296<<10)+65536|a-56320,l=!0)}s<=127?n+=1:s<=2047?n+=2:s<=65535?n+=3:n+=4,l&&r++}return n}createString(e){const n=e.omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,n),n}}const Le=class D{constructor(e){if(x(this,"id",++D.LAST_ID),x(this,"_onigBinding"),x(this,"content"),x(this,"utf16Length"),x(this,"utf8Length"),x(this,"utf16OffsetToUtf8"),x(this,"utf8OffsetToUtf16"),x(this,"ptr"),!T)throw new ct("Must invoke loadWasm first.");this._onigBinding=T,this.content=e;const n=new xe(e);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!D._sharedPtrInUse?(D._sharedPtr||(D._sharedPtr=T.omalloc(1e4)),D._sharedPtrInUse=!0,T.HEAPU8.set(n.utf8Value,D._sharedPtr),this.ptr=D._sharedPtr):this.ptr=n.createString(T)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===D._sharedPtr?D._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};x(Le,"LAST_ID",0);x(Le,"_sharedPtr",0);x(Le,"_sharedPtrInUse",!1);let Cn=Le;class Ai{constructor(e){if(x(this,"_onigBinding"),x(this,"_ptr"),!T)throw new ct("Must invoke loadWasm first.");const n=[],r=[];for(let l=0,a=e.length;l<a;l++){const c=new xe(e[l]);n[l]=c.createString(T),r[l]=c.utf8Length}const o=T.omalloc(4*e.length);T.HEAPU32.set(n,o/4);const i=T.omalloc(4*e.length);T.HEAPU32.set(r,i/4);const s=T.createOnigScanner(o,i,e.length);for(let l=0,a=e.length;l<a;l++)T.ofree(n[l]);T.ofree(i),T.ofree(o),s===0&&Ti(T),this._onigBinding=T,this._ptr=s}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(e,n,r){let o=0;if(typeof r=="number"&&(o=r),typeof e=="string"){e=new Cn(e);const i=this._findNextMatchSync(e,n,!1,o);return e.dispose(),i}return this._findNextMatchSync(e,n,!1,o)}_findNextMatchSync(e,n,r,o){const i=this._onigBinding,s=i.findNextOnigScannerMatch(this._ptr,e.id,e.ptr,e.utf8Length,e.convertUtf16OffsetToUtf8(n),o);if(s===0)return null;const l=i.HEAPU32;let a=s/4;const c=l[a++],u=l[a++],p=[];for(let d=0;d<u;d++){const m=e.convertUtf8OffsetToUtf16(l[a++]),h=e.convertUtf8OffsetToUtf16(l[a++]);p[d]={start:m,end:h,length:h-m}}return{index:c,captureIndices:p}}}function Pi(t){return typeof t.instantiator=="function"}function Ei(t){return typeof t.default=="function"}function Ii(t){return typeof t.data<"u"}function Oi(t){return typeof Response<"u"&&t instanceof Response}function Mi(t){return typeof ArrayBuffer<"u"&&(t instanceof ArrayBuffer||ArrayBuffer.isView(t))||typeof Buffer<"u"&&Buffer.isBuffer?.(t)||typeof SharedArrayBuffer<"u"&&t instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&t instanceof Uint32Array}let pe;function Bi(t){if(pe)return pe;async function e(){T=await Ri(async n=>{let r=t;return r=await r,typeof r=="function"&&(r=await r(n)),typeof r=="function"&&(r=await r(n)),Pi(r)?r=await r.instantiator(n):Ei(r)?r=await r.default(n):(Ii(r)&&(r=r.data),Oi(r)?typeof WebAssembly.instantiateStreaming=="function"?r=await Di(r)(n):r=await Gi(r)(n):Mi(r)?r=await je(r)(n):r instanceof WebAssembly.Module?r=await je(r)(n):"default"in r&&r.default instanceof WebAssembly.Module&&(r=await je(r.default)(n))),"instance"in r&&(r=r.instance),"exports"in r&&(r=r.exports),r})}return pe=e(),pe}function je(t){return e=>WebAssembly.instantiate(t,e)}function Di(t){return e=>WebAssembly.instantiateStreaming(t,e)}function Gi(t){return async e=>{const n=await t.arrayBuffer();return WebAssembly.instantiate(n,e)}}async function ji(t){return t&&await Bi(t),{createScanner(e){return new Ai(e.map(n=>typeof n=="string"?n:n.source))},createString(e){return new Cn(e)}}}const $i=bi({langs:lt,themes:wi,engine:()=>ji(import("./wasm-CG6Dc4jp.js"))}),Nn="template-call",Ui=t=>{const e=t.repository?.[Nn]?.patterns;return Array.isArray(e)&&e.length>0},Hi=t=>{if(!Ui(t))return t;const e={...t.repository};return e[Nn]={patterns:[]},{...t,repository:e}};function Rn(t){const e=t.base,n=t.tokens??{},r=n.variableProperty??e.variable,o=n.className??n.class??e.type;return{commentDoc:e.comment,stringEscape:e.foreground,stringInterpolation:e.variable,stringRegex:e.string,keywordControl:e.keyword,keywordOperator:e.operator,keywordImport:e.operator,keywordReturn:e.keyword,storageModifier:e.keyword,functionCall:e.function,functionBuiltin:e.function,method:e.function,methodCall:n.method??e.function,variableBuiltin:e.variable,variableProperty:r,variableReadonly:e.number,variableOther:e.variable,variableGlobal:e.string,variableLocal:e.variable,parameter:n.stringEscape??e.foreground,typePrimitive:e.type,typeInterface:n.interface??e.type,interface:e.type,class:o,className:o,struct:o,enum:o,typeParameter:e.type,boolean:e.keyword,null:e.number,constant:e.number,punctuation:e.comment,delimiter:n.punctuation??e.comment,bracket:e.foreground,tag:e.keyword,jsxTag:n.tag??e.keyword,tagAttribute:r,tagAttributeValue:e.string,tagBracket:n.punctuation??e.comment,decorator:e.function,annotation:e.function,namespace:e.type,module:e.operator,label:e.operator,macro:e.keyword,preprocessor:e.operator,regex:e.string,url:e.string,key:r,exception:e.operator,...n}}const Fi=(t,e)=>typeof t=="string"&&t.trim().length>0?t:e,Wi=t=>{const e=t.base,n=new Map(Object.entries(Rn(t))),r=(o,i)=>Fi(n.get(o),i);return[{name:"plain",scope:["source","support.type.property-name.css"],settings:{foreground:e.foreground}},{name:"classes",scope:["entity.name.type.class"],settings:{foreground:r("className",r("class",e.function))}},{name:"interfaces",scope:["entity.name.type.interface","entity.name.type"],settings:{foreground:r("interface",e.type)}},{name:"structs",scope:["entity.name.type.struct"],settings:{foreground:r("struct",e.function)}},{name:"enums",scope:["entity.name.type.enum"],settings:{foreground:r("enum",e.function)}},{name:"keys",scope:["meta.object-literal.key","support.type.property-name"],settings:{foreground:r("key",e.function)}},{name:"methods",scope:["entity.name.function.method","meta.function.method"],settings:{foreground:r("method",e.function)}},{name:"functions",scope:["entity.name.function","support.function","meta.function-call.generic"],settings:{foreground:e.function,fontStyle:"bold"}},{name:"variables",scope:["variable","meta.variable","variable.other.object.property"],settings:{foreground:e.variable}},{name:"variablesOther",scope:["variable.other.object","variable.other.readwrite.alias"],settings:{foreground:r("variableOther",e.variable)}},{name:"globalVariables",scope:["variable.other.global","variable.language.this"],settings:{foreground:r("variableGlobal",e.number)}},{name:"localVariables",scope:["variable.other.local"],settings:{foreground:r("variableLocal",e.variable)}},{name:"parameters",scope:["variable.parameter","meta.parameter"],settings:{foreground:r("parameter",e.foreground)}},{name:"properties",scope:["variable.other.property","meta.property"],settings:{foreground:r("variableProperty",e.variable)}},{name:"strings",scope:["string","string.other.link","markup.inline.raw.string.markdown"],settings:{foreground:e.string}},{name:"stringEscapeSequences",scope:["constant.character.escape","constant.other.placeholder"],settings:{foreground:r("stringEscape",e.foreground)}},{name:"keywords",scope:["keyword"],settings:{foreground:e.keyword}},{name:"keywordsControl",scope:["keyword.control.import","keyword.control.from","keyword.import"],settings:{foreground:r("keywordImport",e.operator)}},{name:"storageModifiers",scope:["storage.modifier","keyword.modifier","storage.type"],settings:{foreground:r("storageModifier",e.keyword)}},{name:"comments",scope:["comment","punctuation.definition.comment"],settings:{foreground:e.comment}},{name:"docComments",scope:["comment.documentation","comment.line.documentation"],settings:{foreground:r("commentDoc",e.comment)}},{name:"numbers",scope:["constant.numeric"],settings:{foreground:e.number}},{name:"booleans",scope:["constant.language.boolean","constant.language.json"],settings:{foreground:r("boolean",e.type)}},{name:"operators",scope:["keyword.operator"],settings:{foreground:e.operator}},{name:"macros",scope:["entity.name.function.preprocessor","meta.preprocessor"],settings:{foreground:r("macro",e.keyword)}},{name:"preprocessor",scope:["meta.preprocessor"],settings:{foreground:r("preprocessor",r("label",e.number))}},{name:"urls",scope:["markup.underline.link"],settings:{foreground:r("url",e.string)}},{name:"tags",scope:["entity.name.tag"],settings:{foreground:r("tag",e.keyword)}},{name:"jsxTags",scope:["support.class.component"],settings:{foreground:r("jsxTag",r("label",e.number))}},{name:"attributes",scope:["entity.other.attribute-name","meta.attribute"],settings:{foreground:r("tagAttribute",e.type)}},{name:"types",scope:["support.type"],settings:{foreground:e.type}},{name:"constants",scope:["variable.other.constant","variable.readonly"],settings:{foreground:r("constant",e.foreground)}},{name:"labels",scope:["entity.name.label","punctuation.definition.label"],settings:{foreground:r("label",r("variableGlobal",e.number))}},{name:"namespaces",scope:["entity.name.namespace","storage.modifier.namespace","markup.bold.markdown"],settings:{foreground:r("namespace",e.type)}},{name:"modules",scope:["entity.name.module","storage.modifier.module"],settings:{foreground:r("module",e.operator)}},{name:"typeParameters",scope:["variable.type.parameter","variable.parameter.type"],settings:{foreground:r("typeParameter",e.function)}},{name:"exceptions",scope:["keyword.control.exception","keyword.control.trycatch"],settings:{foreground:r("exception",r("label",e.number))}},{name:"decorators",scope:["meta.decorator","punctuation.decorator","entity.name.function.decorator"],settings:{foreground:r("decorator",e.type)}},{name:"calls",scope:["variable.function"],settings:{foreground:e.foreground}},{name:"punctuation",scope:["punctuation","punctuation.terminator","punctuation.definition.tag","punctuation.separator","punctuation.definition.string","punctuation.section.block"],settings:{foreground:r("punctuation",e.comment)}},{name:"yellow",scope:["storage.type.numeric.go","storage.type.byte.go","storage.type.boolean.go","storage.type.string.go","storage.type.uintptr.go","storage.type.error.go","storage.type.rune.go","constant.language.go","support.class.dart","keyword.other.documentation","storage.modifier.import.java","punctuation.definition.list.begin.markdown","punctuation.definition.quote.begin.markdown","meta.separator.markdown","entity.name.section.markdown"],settings:{foreground:e.type}},{name:"green",scope:[],settings:{foreground:r("method",e.function)}},{name:"cyan",scope:["markup.italic.markdown","support.type.python","variable.legacy.builtin.python","support.constant.property-value.css","storage.modifier.attribute.swift"],settings:{foreground:e.string}},{name:"blue",scope:[],settings:{foreground:e.keyword}},{name:"purple",scope:["keyword.channel.go","keyword.other.platform.os.swift"],settings:{foreground:e.number}},{name:"magenta",scope:["punctuation.definition.heading.markdown"],settings:{foreground:r("label",r("variableGlobal",e.number))}},{name:"red",scope:[],settings:{foreground:e.operator}},{name:"orange",scope:[],settings:{foreground:e.function}}]},ut="openchamber-md",de={background:"transparent",foreground:"var(--md-syntax-foreground)",comment:"var(--md-syntax-comment)",keyword:"var(--md-syntax-keyword)",string:"var(--md-syntax-string)",number:"var(--md-syntax-number)",function:"var(--md-syntax-function)",variable:"var(--md-syntax-variable)",type:"var(--md-syntax-type)",operator:"var(--md-syntax-operator)"},zi=Object.fromEntries(Object.keys(Rn({base:de})).map(t=>[t,`var(--md-token-${t})`])),qi={name:ut,colors:{"editor.background":"transparent","editor.foreground":de.foreground},tokenColors:[...Wi({base:de,tokens:zi}),{scope:["markup.bold","punctuation.definition.bold"],settings:{fontStyle:"bold"}},{scope:["markup.italic","punctuation.definition.italic"],settings:{fontStyle:"italic"}},{scope:["markup.heading","markup.heading entity.name"],settings:{foreground:de.keyword,fontStyle:"bold"}},{scope:["markup.inserted","punctuation.definition.inserted"],settings:{foreground:"var(--md-syntax-inserted)"}},{scope:["markup.deleted","punctuation.definition.deleted","invalid","invalid.illegal"],settings:{foreground:"var(--md-syntax-deleted)"}}]},Vi=1,Ki=2,Yi=4,Ji=t=>t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),Xi=t=>{const e=[];t.color&&e.push(`color:${t.color}`);const n=t.fontStyle??0;return n&Vi&&e.push("font-style:italic"),n&Ki&&e.push("font-weight:bold"),n&Yi&&e.push("text-decoration:underline"),`<span${e.length?` style="${e.join(";")}"`:""}>${Ji(t.content)}</span>`};let Dt,z=Promise.resolve();const Te=()=>(Dt??=$i({themes:[qi],langs:[]}),Dt);self.onmessage=t=>{const e=t.data;if(e.type==="init"){Te();return}if(e.type==="highlight"){z=z.then(()=>Zi(e)).catch(()=>{});return}if(e.type==="highlightTokens"){z=z.then(()=>es(e)).catch(()=>{});return}z=z.then(()=>ts(e)).catch(()=>{})};const Qi=async(t,e)=>{const r=(await lt[e]()).default.map(o=>Hi(o));await t.loadLanguage(...r)},pt=async(t,e)=>{let n=e in lt?e:"text";if(n!=="text"&&!t.getLoadedLanguages().includes(n))try{await Qi(t,n)}catch{n="text"}return n};async function Zi(t){try{const e=await Te(),n=await pt(e,t.lang),r=e.codeToHtml(t.code,{lang:n,theme:ut,tabindex:!1});J({type:"highlight",id:t.id,html:r})}catch(e){J({type:"error",id:t.id,message:e instanceof Error?e.message:String(e)})}}async function es(t){try{const e=await Te();t.theme&&!e.getLoadedThemes().includes(t.themeName)&&await e.loadTheme(t.theme);const n=await pt(e,t.lang),{tokens:r}=e.codeToTokens(t.code,{lang:n,theme:t.themeName}),o=r.map(i=>i.map(s=>[s.content.length,s.color??"",s.fontStyle??0]));J({type:"highlightTokens",id:t.id,lines:o})}catch(e){J({type:"error",id:t.id,message:e instanceof Error?e.message:String(e)})}}async function ts(t){try{const e=await Te(),n=await pt(e,t.lang),{tokens:r}=e.codeToTokens(t.code,{lang:n,theme:ut}),o=r.map(i=>i.map(Xi).join(""));J({type:"highlightLines",id:t.id,lines:o})}catch(e){J({type:"error",id:t.id,message:e instanceof Error?e.message:String(e)})}}function J(t){self.postMessage(t)}