@dooc-dev/dooc 0.0.7 → 0.0.8

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 (302) hide show
  1. package/dist/client.global.js +1 -0
  2. package/dist/code-worker.global.js +11 -11
  3. package/dist/code.global.js +75 -75
  4. package/dist/edit.global.js +234 -231
  5. package/dist/{compiler → engine/compiler}/bundle-urls.js +1 -4
  6. package/dist/{compiler → engine/compiler}/check-prose.d.ts +1 -1
  7. package/dist/{compiler → engine/compiler}/check-prose.js +1 -1
  8. package/dist/{compiler → engine/compiler}/check.js +15 -27
  9. package/dist/{compiler → engine/compiler}/code-blocks.js +3 -1
  10. package/dist/{compiler → engine/compiler}/code-languages.js +1 -2
  11. package/dist/{compiler → engine/compiler}/compile.d.ts +5 -4
  12. package/dist/{compiler → engine/compiler}/compile.js +91 -32
  13. package/dist/{compiler → engine/compiler}/config.js +1 -3
  14. package/dist/{compiler → engine/compiler}/dialect.d.ts +1 -3
  15. package/dist/{compiler → engine/compiler}/dialect.js +8 -52
  16. package/dist/{compiler → engine/compiler}/dxf.js +1 -1
  17. package/dist/{compiler → engine/compiler}/export.js +15 -8
  18. package/dist/{compiler → engine/compiler}/figures.js +26 -22
  19. package/dist/{compiler → engine/compiler}/file-cache.d.ts +1 -2
  20. package/dist/{compiler → engine/compiler}/file-cache.js +8 -15
  21. package/dist/{compiler → engine/compiler}/files.js +49 -38
  22. package/dist/{compiler → engine/compiler}/fonts.js +1 -3
  23. package/dist/{compiler → engine/compiler}/from-mdast.js +1 -1
  24. package/dist/engine/compiler/host.d.ts +10 -0
  25. package/dist/engine/compiler/host.js +16 -0
  26. package/dist/{compiler → engine/compiler}/icons.d.ts +3 -0
  27. package/dist/{compiler → engine/compiler}/icons.js +28 -10
  28. package/dist/{compiler → engine/compiler}/ignored-files.d.ts +2 -0
  29. package/dist/{compiler → engine/compiler}/ignored-files.js +12 -3
  30. package/dist/{compiler → engine/compiler}/locales.js +2 -8
  31. package/dist/{compiler → engine/compiler}/manifest.d.ts +3 -2
  32. package/dist/engine/compiler/manifest.js +46 -0
  33. package/dist/{compiler → engine/compiler}/ops.d.ts +4 -1
  34. package/dist/{compiler → engine/compiler}/ops.js +36 -21
  35. package/dist/engine/compiler/schema-file-references.d.ts +2 -0
  36. package/dist/engine/compiler/schema-file-references.js +82 -0
  37. package/dist/engine/compiler/serialize.d.ts +2 -0
  38. package/dist/engine/compiler/serialize.js +5 -0
  39. package/dist/{compiler → engine/compiler}/subformat-schema.js +1 -3
  40. package/dist/{compiler → engine/compiler}/subformats.d.ts +10 -0
  41. package/dist/{compiler → engine/compiler}/subformats.js +122 -18
  42. package/dist/{compiler → engine/compiler}/textfile-remote.js +1 -2
  43. package/dist/{compiler → engine/compiler}/textfile.js +4 -6
  44. package/dist/{compiler → engine/compiler}/theme-variants.js +1 -1
  45. package/dist/{compiler → engine/compiler}/zip.js +1 -1
  46. package/dist/{core → engine/core}/blocks.d.ts +6 -4
  47. package/dist/{core → engine/core}/content-metadata.d.ts +6 -1
  48. package/dist/{core → engine/core}/content-metadata.js +84 -18
  49. package/dist/{core → engine/core}/content-types.d.ts +4 -2
  50. package/dist/{core → engine/core}/html.d.ts +7 -0
  51. package/dist/{core → engine/core}/html.js +44 -3
  52. package/dist/{core → engine/core}/icons.d.ts +3 -0
  53. package/dist/engine/core/icons.js +20 -0
  54. package/dist/{core → engine/core}/routing.d.ts +2 -0
  55. package/dist/{core → engine/core}/routing.js +9 -0
  56. package/dist/{core → engine/core}/schema-refs.d.ts +1 -1
  57. package/dist/{core → engine/core}/schema-refs.js +3 -1
  58. package/dist/engine/core/subformat-references.d.ts +5 -0
  59. package/dist/engine/core/subformat-references.js +33 -0
  60. package/dist/{core → engine/core}/subformats.d.ts +7 -0
  61. package/dist/{core → engine/core}/subformats.js +5 -1
  62. package/dist/{core → engine/core}/taxonomy.d.ts +2 -3
  63. package/dist/{core → engine/core}/taxonomy.js +1 -5
  64. package/dist/flow.global.js +306 -306
  65. package/dist/frontend/application-request.d.ts +14 -0
  66. package/dist/frontend/application-request.js +36 -0
  67. package/dist/frontend/document-application.d.ts +200 -0
  68. package/dist/{viewer/serve.js → frontend/document-application.js} +1611 -1670
  69. package/dist/frontend/figure-preview.d.ts +4 -0
  70. package/dist/{viewer → frontend}/figure-preview.js +4 -4
  71. package/dist/{viewer → frontend}/file-references.d.ts +1 -1
  72. package/dist/{viewer → frontend}/file-references.js +3 -3
  73. package/dist/{viewer → frontend}/font-picker.d.ts +1 -1
  74. package/dist/{viewer → frontend}/font-settings.d.ts +1 -1
  75. package/dist/{viewer → frontend}/language-picker.js +112 -18
  76. package/dist/{viewer → frontend}/locales/eng.json +16 -2
  77. package/dist/{viewer → frontend}/locales/jpn.json +16 -2
  78. package/dist/{viewer → frontend}/locales/zho.json +16 -2
  79. package/dist/{viewer → frontend}/nav-focus.js +2 -0
  80. package/dist/{viewer → frontend}/plugin-blocks.js +2 -2
  81. package/dist/{viewer → frontend}/resize.js +14 -2
  82. package/dist/frontend/resource-download.d.ts +2 -0
  83. package/dist/frontend/resource-download.js +43 -0
  84. package/dist/{viewer → frontend}/resource-library.d.ts +9 -2
  85. package/dist/{viewer → frontend}/resource-library.js +133 -37
  86. package/dist/{core → frontend}/schema-graph-flow.d.ts +1 -1
  87. package/dist/{core → frontend}/schema-graph-flow.js +1 -1
  88. package/dist/{viewer → frontend}/search.d.ts +2 -2
  89. package/dist/{viewer → frontend}/search.js +26 -8
  90. package/dist/graph/schema-graph-global.js +17 -17
  91. package/dist/install.sh +68 -0
  92. package/dist/plugins.global.js +62 -62
  93. package/dist/{viewer → server}/assets.d.ts +2 -0
  94. package/dist/server/assets.js +7 -0
  95. package/dist/{viewer → server}/build-plugins.js +4 -4
  96. package/dist/{viewer → server}/build.d.ts +2 -1
  97. package/dist/{viewer → server}/build.js +31 -15
  98. package/dist/{cli.js → server/cli.js} +199 -66
  99. package/dist/server/editor-tools.d.ts +1 -0
  100. package/dist/server/editor-tools.js +1 -0
  101. package/dist/{viewer → server}/extension-pack.js +2 -2
  102. package/dist/{viewer → server}/extensions.d.ts +1 -1
  103. package/dist/{viewer → server}/extensions.js +3 -3
  104. package/dist/server/git-diff.d.ts +10 -0
  105. package/dist/{viewer → server}/git-diff.js +45 -10
  106. package/dist/server/git-origin.d.ts +4 -0
  107. package/dist/server/git-origin.js +103 -0
  108. package/dist/server/git.d.ts +9 -0
  109. package/dist/{viewer → server}/git.js +50 -6
  110. package/dist/server/history.d.ts +14 -0
  111. package/dist/server/history.js +205 -0
  112. package/dist/{viewer → server}/hmr.d.ts +0 -22
  113. package/dist/server/hmr.js +168 -0
  114. package/dist/server/index.d.ts +17 -0
  115. package/dist/{index.js → server/index.js} +16 -16
  116. package/dist/{viewer → server}/ja-lint.d.ts +1 -1
  117. package/dist/{viewer → server}/languages.d.ts +1 -1
  118. package/dist/{viewer → server}/languages.js +3 -3
  119. package/dist/{mcp.d.ts → server/mcp.d.ts} +2 -2
  120. package/dist/{mcp.js → server/mcp.js} +60 -21
  121. package/dist/{viewer → server}/plugin-config.d.ts +2 -2
  122. package/dist/{viewer → server}/plugin-config.js +2 -2
  123. package/dist/{plugins → server/plugins}/local-storage.d.ts +1 -1
  124. package/dist/{plugins → server/plugins}/local-storage.js +1 -1
  125. package/dist/{plugins → server/plugins}/runtime.d.ts +4 -4
  126. package/dist/{plugins → server/plugins}/runtime.js +4 -4
  127. package/dist/{viewer → server}/plugins.d.ts +3 -3
  128. package/dist/{viewer → server}/plugins.js +14 -13
  129. package/dist/server/resource-library.d.ts +1 -0
  130. package/dist/server/resource-library.js +1 -0
  131. package/dist/server/self.d.ts +5 -0
  132. package/dist/server/self.js +98 -0
  133. package/dist/server/serve.d.ts +61 -0
  134. package/dist/server/serve.js +503 -0
  135. package/dist/server/static-client.d.ts +4 -0
  136. package/dist/server/static-client.js +117 -0
  137. package/dist/server/workspace-server.d.ts +16 -0
  138. package/dist/server/workspace-server.js +266 -0
  139. package/dist/{viewer → server}/workspace.d.ts +6 -1
  140. package/dist/{viewer → server}/workspace.js +46 -0
  141. package/dist/subformats.global.js +92 -6
  142. package/dist/ui.global.js +85 -72
  143. package/dist/workspace/client.d.ts +13 -0
  144. package/dist/workspace/client.js +114 -0
  145. package/dist/{viewer → workspace}/code-file.d.ts +1 -1
  146. package/dist/{viewer → workspace}/code-file.js +7 -7
  147. package/dist/workspace/connection.d.ts +27 -0
  148. package/dist/workspace/connection.js +38 -0
  149. package/dist/{viewer → workspace}/editor-tools.d.ts +7 -1
  150. package/dist/{viewer → workspace}/editor-tools.js +12 -9
  151. package/dist/{viewer → workspace}/git-types.d.ts +7 -0
  152. package/dist/workspace/github.d.ts +4 -0
  153. package/dist/workspace/github.js +99 -0
  154. package/dist/workspace/history.d.ts +46 -0
  155. package/dist/workspace/history.js +86 -0
  156. package/dist/workspace/protocol.d.ts +38 -0
  157. package/dist/workspace/protocol.js +20 -0
  158. package/dist/workspace/resource-download.d.ts +1 -0
  159. package/dist/workspace/resource-download.js +8 -0
  160. package/dist/workspace/server.d.ts +9 -0
  161. package/dist/workspace/server.js +48 -0
  162. package/dist/{viewer → workspace}/site-icon.js +9 -10
  163. package/dist/{viewer → workspace}/site-title.js +6 -7
  164. package/dist/{viewer → workspace}/textfile.d.ts +1 -1
  165. package/dist/{viewer → workspace}/textfile.js +5 -5
  166. package/dist/workspace-worker.global.js +2859 -0
  167. package/package.json +34 -20
  168. package/dist/compiler/manifest.js +0 -37
  169. package/dist/compiler/serialize.d.ts +0 -3
  170. package/dist/compiler/serialize.js +0 -16
  171. package/dist/core/icons.js +0 -5
  172. package/dist/index.d.ts +0 -17
  173. package/dist/viewer/assets.js +0 -3
  174. package/dist/viewer/figure-preview.d.ts +0 -4
  175. package/dist/viewer/git-diff.d.ts +0 -6
  176. package/dist/viewer/git.d.ts +0 -5
  177. package/dist/viewer/hmr.js +0 -341
  178. package/dist/viewer/serve.d.ts +0 -216
  179. /package/dist/{compiler → engine/compiler}/asset-references.d.ts +0 -0
  180. /package/dist/{compiler → engine/compiler}/asset-references.js +0 -0
  181. /package/dist/{compiler → engine/compiler}/bundle-urls.d.ts +0 -0
  182. /package/dist/{compiler → engine/compiler}/check-types.d.ts +0 -0
  183. /package/dist/{compiler → engine/compiler}/check-types.js +0 -0
  184. /package/dist/{compiler → engine/compiler}/check.d.ts +0 -0
  185. /package/dist/{compiler → engine/compiler}/code-blocks.d.ts +0 -0
  186. /package/dist/{compiler → engine/compiler}/code-languages.d.ts +0 -0
  187. /package/dist/{compiler → engine/compiler}/config.d.ts +0 -0
  188. /package/dist/{compiler → engine/compiler}/drawio.d.ts +0 -0
  189. /package/dist/{compiler → engine/compiler}/drawio.js +0 -0
  190. /package/dist/{compiler → engine/compiler}/dxf.d.ts +0 -0
  191. /package/dist/{compiler → engine/compiler}/export.d.ts +0 -0
  192. /package/dist/{compiler → engine/compiler}/figures.d.ts +0 -0
  193. /package/dist/{compiler → engine/compiler}/files.d.ts +0 -0
  194. /package/dist/{compiler → engine/compiler}/fonts.d.ts +0 -0
  195. /package/dist/{compiler → engine/compiler}/format.d.ts +0 -0
  196. /package/dist/{compiler → engine/compiler}/format.js +0 -0
  197. /package/dist/{compiler → engine/compiler}/from-mdast.d.ts +0 -0
  198. /package/dist/{compiler → engine/compiler}/language-codes.d.ts +0 -0
  199. /package/dist/{compiler → engine/compiler}/language-codes.js +0 -0
  200. /package/dist/{compiler → engine/compiler}/locales.d.ts +0 -0
  201. /package/dist/{compiler → engine/compiler}/public-file.d.ts +0 -0
  202. /package/dist/{compiler → engine/compiler}/public-file.js +0 -0
  203. /package/dist/{compiler → engine/compiler}/subformat-schema.d.ts +0 -0
  204. /package/dist/{compiler → engine/compiler}/terms.d.ts +0 -0
  205. /package/dist/{compiler → engine/compiler}/terms.js +0 -0
  206. /package/dist/{compiler → engine/compiler}/textfile-remote.d.ts +0 -0
  207. /package/dist/{compiler → engine/compiler}/textfile.d.ts +0 -0
  208. /package/dist/{compiler → engine/compiler}/theme-variants.d.ts +0 -0
  209. /package/dist/{compiler → engine/compiler}/zip.d.ts +0 -0
  210. /package/dist/{core → engine/core}/blocks.js +0 -0
  211. /package/dist/{core → engine/core}/code-file.d.ts +0 -0
  212. /package/dist/{core → engine/core}/code-file.js +0 -0
  213. /package/dist/{core → engine/core}/code-grammars.d.ts +0 -0
  214. /package/dist/{core → engine/core}/code-grammars.js +0 -0
  215. /package/dist/{core → engine/core}/content-types.js +0 -0
  216. /package/dist/{core → engine/core}/escape-html.d.ts +0 -0
  217. /package/dist/{core → engine/core}/escape-html.js +0 -0
  218. /package/dist/{core → engine/core}/extension-package.d.ts +0 -0
  219. /package/dist/{core → engine/core}/extension-package.js +0 -0
  220. /package/dist/{core → engine/core}/figure-frame.d.ts +0 -0
  221. /package/dist/{core → engine/core}/figure-frame.js +0 -0
  222. /package/dist/{core → engine/core}/file-embed.d.ts +0 -0
  223. /package/dist/{core → engine/core}/file-embed.js +0 -0
  224. /package/dist/{core → engine/core}/files.d.ts +0 -0
  225. /package/dist/{core → engine/core}/files.js +0 -0
  226. /package/dist/{core → engine/core}/graph-common.d.ts +0 -0
  227. /package/dist/{core → engine/core}/graph-common.js +0 -0
  228. /package/dist/{core → engine/core}/graph.d.ts +0 -0
  229. /package/dist/{core → engine/core}/graph.js +0 -0
  230. /package/dist/{core → engine/core}/inline.d.ts +0 -0
  231. /package/dist/{core → engine/core}/inline.js +0 -0
  232. /package/dist/{core → engine/core}/json-tools.d.ts +0 -0
  233. /package/dist/{core → engine/core}/json-tools.js +0 -0
  234. /package/dist/{core → engine/core}/language.d.ts +0 -0
  235. /package/dist/{core → engine/core}/language.js +0 -0
  236. /package/dist/{core → engine/core}/languages/ja.d.ts +0 -0
  237. /package/dist/{core → engine/core}/languages/ja.js +0 -0
  238. /package/dist/{core → engine/core}/markdown.d.ts +0 -0
  239. /package/dist/{core → engine/core}/markdown.js +0 -0
  240. /package/dist/{core → engine/core}/previewers.d.ts +0 -0
  241. /package/dist/{core → engine/core}/previewers.js +0 -0
  242. /package/dist/{core → engine/core}/schema-comments.d.ts +0 -0
  243. /package/dist/{core → engine/core}/schema-comments.js +0 -0
  244. /package/dist/{core → engine/core}/schema-fields.d.ts +0 -0
  245. /package/dist/{core → engine/core}/schema-fields.js +0 -0
  246. /package/dist/{core → engine/core}/schema-graph.d.ts +0 -0
  247. /package/dist/{core → engine/core}/schema-graph.js +0 -0
  248. /package/dist/{core → engine/core}/subformat-record.d.ts +0 -0
  249. /package/dist/{core → engine/core}/subformat-record.js +0 -0
  250. /package/dist/{core → engine/core}/term-reference.d.ts +0 -0
  251. /package/dist/{core → engine/core}/term-reference.js +0 -0
  252. /package/dist/{core → engine/core}/textfile.d.ts +0 -0
  253. /package/dist/{core → engine/core}/textfile.js +0 -0
  254. /package/dist/{core → engine/core}/theme-variants.d.ts +0 -0
  255. /package/dist/{core → engine/core}/theme-variants.js +0 -0
  256. /package/dist/{core → engine/core}/workspace.d.ts +0 -0
  257. /package/dist/{core → engine/core}/workspace.js +0 -0
  258. /package/dist/{viewer → frontend}/bundle-network.d.ts +0 -0
  259. /package/dist/{viewer → frontend}/bundle-network.js +0 -0
  260. /package/dist/{core → frontend}/flow-base-css.generated.d.ts +0 -0
  261. /package/dist/{core → frontend}/flow-base-css.generated.js +0 -0
  262. /package/dist/{core → frontend}/flow-css.d.ts +0 -0
  263. /package/dist/{core → frontend}/flow-css.js +0 -0
  264. /package/dist/{viewer → frontend}/font-picker.js +0 -0
  265. /package/dist/{viewer → frontend}/font-settings.js +0 -0
  266. /package/dist/{viewer → frontend}/i18n.d.ts +0 -0
  267. /package/dist/{viewer → frontend}/i18n.js +0 -0
  268. /package/dist/{viewer → frontend}/language-picker.d.ts +0 -0
  269. /package/dist/{viewer → frontend}/lazy-preview.d.ts +0 -0
  270. /package/dist/{viewer → frontend}/lazy-preview.js +0 -0
  271. /package/dist/{viewer → frontend}/nav-focus.d.ts +0 -0
  272. /package/dist/{viewer → frontend}/nav-update.d.ts +0 -0
  273. /package/dist/{viewer → frontend}/nav-update.js +0 -0
  274. /package/dist/{viewer → frontend}/plugin-blocks.d.ts +0 -0
  275. /package/dist/{viewer → frontend}/plugin-style.d.ts +0 -0
  276. /package/dist/{viewer → frontend}/plugin-style.js +0 -0
  277. /package/dist/{viewer → frontend}/plugin-view.d.ts +0 -0
  278. /package/dist/{viewer → frontend}/plugin-view.js +0 -0
  279. /package/dist/{viewer → frontend}/resize.d.ts +0 -0
  280. /package/dist/{core → frontend}/schema-graph-mount.d.ts +0 -0
  281. /package/dist/{core → frontend}/schema-graph-mount.js +0 -0
  282. /package/dist/{core → frontend}/table-ui.d.ts +0 -0
  283. /package/dist/{core → frontend}/table-ui.js +0 -0
  284. /package/dist/{core → frontend}/terms-ui.d.ts +0 -0
  285. /package/dist/{core → frontend}/terms-ui.js +0 -0
  286. /package/dist/{viewer → frontend}/theme-picker.d.ts +0 -0
  287. /package/dist/{viewer → frontend}/theme-picker.js +0 -0
  288. /package/dist/{core → frontend}/toc-ui.d.ts +0 -0
  289. /package/dist/{core → frontend}/toc-ui.js +0 -0
  290. /package/dist/{core → frontend}/video-ui.d.ts +0 -0
  291. /package/dist/{core → frontend}/video-ui.js +0 -0
  292. /package/dist/{viewer → server}/build-plugins.d.ts +0 -0
  293. /package/dist/{cli.d.ts → server/cli.d.ts} +0 -0
  294. /package/dist/{viewer → server}/extension-pack.d.ts +0 -0
  295. /package/dist/{viewer → server}/fonts/LICENSE.txt +0 -0
  296. /package/dist/{viewer → server}/fonts/udev-gothic-regular.woff2 +0 -0
  297. /package/dist/{viewer → server}/fonts.d.ts +0 -0
  298. /package/dist/{viewer → server}/fonts.js +0 -0
  299. /package/dist/{viewer → server}/ja-lint.js +0 -0
  300. /package/dist/{viewer → workspace}/git-types.js +0 -0
  301. /package/dist/{viewer → workspace}/site-icon.d.ts +0 -0
  302. /package/dist/{viewer → workspace}/site-title.d.ts +0 -0
@@ -1,6 +1,6 @@
1
- "use strict";(()=>{var rs=Object.defineProperty;var Nn=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var Nt=(e,t)=>{for(var n in t)rs(e,n,{get:t[n],enumerable:!0})};var Yo={};Nt(Yo,{default:()=>Kl});var Kl,Jo=Nn(()=>{Kl=Object.freeze(JSON.parse('{"colors":{"activityBar.activeBorder":"#f9826c","activityBar.background":"#fff","activityBar.border":"#e1e4e8","activityBar.foreground":"#2f363d","activityBar.inactiveForeground":"#959da5","activityBarBadge.background":"#2188ff","activityBarBadge.foreground":"#fff","badge.background":"#dbedff","badge.foreground":"#005cc5","breadcrumb.activeSelectionForeground":"#586069","breadcrumb.focusForeground":"#2f363d","breadcrumb.foreground":"#6a737d","breadcrumbPicker.background":"#fafbfc","button.background":"#159739","button.foreground":"#fff","button.hoverBackground":"#138934","button.secondaryBackground":"#e1e4e8","button.secondaryForeground":"#1b1f23","button.secondaryHoverBackground":"#d1d5da","checkbox.background":"#fafbfc","checkbox.border":"#d1d5da","debugToolBar.background":"#fff","descriptionForeground":"#6a737d","diffEditor.insertedTextBackground":"#34d05822","diffEditor.removedTextBackground":"#d73a4922","dropdown.background":"#fafbfc","dropdown.border":"#e1e4e8","dropdown.foreground":"#2f363d","dropdown.listBackground":"#fff","editor.background":"#fff","editor.findMatchBackground":"#ffdf5d","editor.findMatchHighlightBackground":"#ffdf5d66","editor.focusedStackFrameHighlightBackground":"#28a74525","editor.foldBackground":"#d1d5da11","editor.foreground":"#24292e","editor.inactiveSelectionBackground":"#0366d611","editor.lineHighlightBackground":"#f6f8fa","editor.linkedEditingBackground":"#0366d611","editor.selectionBackground":"#0366d625","editor.selectionHighlightBackground":"#34d05840","editor.selectionHighlightBorder":"#34d05800","editor.stackFrameHighlightBackground":"#ffd33d33","editor.wordHighlightBackground":"#34d05800","editor.wordHighlightBorder":"#24943e99","editor.wordHighlightStrongBackground":"#34d05800","editor.wordHighlightStrongBorder":"#24943e50","editorBracketHighlight.foreground1":"#005cc5","editorBracketHighlight.foreground2":"#e36209","editorBracketHighlight.foreground3":"#5a32a3","editorBracketHighlight.foreground4":"#005cc5","editorBracketHighlight.foreground5":"#e36209","editorBracketHighlight.foreground6":"#5a32a3","editorBracketMatch.background":"#34d05840","editorBracketMatch.border":"#34d05800","editorCursor.foreground":"#044289","editorError.foreground":"#cb2431","editorGroup.border":"#e1e4e8","editorGroupHeader.tabsBackground":"#f6f8fa","editorGroupHeader.tabsBorder":"#e1e4e8","editorGutter.addedBackground":"#28a745","editorGutter.deletedBackground":"#d73a49","editorGutter.modifiedBackground":"#2188ff","editorIndentGuide.activeBackground":"#d7dbe0","editorIndentGuide.background":"#eff2f6","editorLineNumber.activeForeground":"#24292e","editorLineNumber.foreground":"#1b1f234d","editorOverviewRuler.border":"#fff","editorWarning.foreground":"#f9c513","editorWhitespace.foreground":"#d1d5da","editorWidget.background":"#f6f8fa","errorForeground":"#cb2431","focusBorder":"#2188ff","foreground":"#444d56","gitDecoration.addedResourceForeground":"#28a745","gitDecoration.conflictingResourceForeground":"#e36209","gitDecoration.deletedResourceForeground":"#d73a49","gitDecoration.ignoredResourceForeground":"#959da5","gitDecoration.modifiedResourceForeground":"#005cc5","gitDecoration.submoduleResourceForeground":"#959da5","gitDecoration.untrackedResourceForeground":"#28a745","input.background":"#fafbfc","input.border":"#e1e4e8","input.foreground":"#2f363d","input.placeholderForeground":"#959da5","list.activeSelectionBackground":"#e2e5e9","list.activeSelectionForeground":"#2f363d","list.focusBackground":"#cce5ff","list.hoverBackground":"#ebf0f4","list.hoverForeground":"#2f363d","list.inactiveFocusBackground":"#dbedff","list.inactiveSelectionBackground":"#e8eaed","list.inactiveSelectionForeground":"#2f363d","notificationCenterHeader.background":"#e1e4e8","notificationCenterHeader.foreground":"#6a737d","notifications.background":"#fafbfc","notifications.border":"#e1e4e8","notifications.foreground":"#2f363d","notificationsErrorIcon.foreground":"#d73a49","notificationsInfoIcon.foreground":"#005cc5","notificationsWarningIcon.foreground":"#e36209","panel.background":"#f6f8fa","panel.border":"#e1e4e8","panelInput.border":"#e1e4e8","panelTitle.activeBorder":"#f9826c","panelTitle.activeForeground":"#2f363d","panelTitle.inactiveForeground":"#6a737d","pickerGroup.border":"#e1e4e8","pickerGroup.foreground":"#2f363d","progressBar.background":"#2188ff","quickInput.background":"#fafbfc","quickInput.foreground":"#2f363d","scrollbar.shadow":"#6a737d33","scrollbarSlider.activeBackground":"#959da588","scrollbarSlider.background":"#959da533","scrollbarSlider.hoverBackground":"#959da544","settings.headerForeground":"#2f363d","settings.modifiedItemIndicator":"#2188ff","sideBar.background":"#f6f8fa","sideBar.border":"#e1e4e8","sideBar.foreground":"#586069","sideBarSectionHeader.background":"#f6f8fa","sideBarSectionHeader.border":"#e1e4e8","sideBarSectionHeader.foreground":"#2f363d","sideBarTitle.foreground":"#2f363d","statusBar.background":"#fff","statusBar.border":"#e1e4e8","statusBar.debuggingBackground":"#f9826c","statusBar.debuggingForeground":"#fff","statusBar.foreground":"#586069","statusBar.noFolderBackground":"#fff","statusBarItem.prominentBackground":"#e8eaed","statusBarItem.remoteBackground":"#fff","statusBarItem.remoteForeground":"#586069","tab.activeBackground":"#fff","tab.activeBorder":"#fff","tab.activeBorderTop":"#f9826c","tab.activeForeground":"#2f363d","tab.border":"#e1e4e8","tab.hoverBackground":"#fff","tab.inactiveBackground":"#f6f8fa","tab.inactiveForeground":"#6a737d","tab.unfocusedActiveBorder":"#fff","tab.unfocusedActiveBorderTop":"#e1e4e8","tab.unfocusedHoverBackground":"#fff","terminal.ansiBlack":"#24292e","terminal.ansiBlue":"#0366d6","terminal.ansiBrightBlack":"#959da5","terminal.ansiBrightBlue":"#005cc5","terminal.ansiBrightCyan":"#3192aa","terminal.ansiBrightGreen":"#22863a","terminal.ansiBrightMagenta":"#5a32a3","terminal.ansiBrightRed":"#cb2431","terminal.ansiBrightWhite":"#d1d5da","terminal.ansiBrightYellow":"#b08800","terminal.ansiCyan":"#1b7c83","terminal.ansiGreen":"#28a745","terminal.ansiMagenta":"#5a32a3","terminal.ansiRed":"#d73a49","terminal.ansiWhite":"#6a737d","terminal.ansiYellow":"#dbab09","terminal.foreground":"#586069","terminal.tab.activeBorder":"#f9826c","terminalCursor.background":"#d1d5da","terminalCursor.foreground":"#005cc5","textBlockQuote.background":"#fafbfc","textBlockQuote.border":"#e1e4e8","textCodeBlock.background":"#f6f8fa","textLink.activeForeground":"#005cc5","textLink.foreground":"#0366d6","textPreformat.foreground":"#586069","textSeparator.foreground":"#d1d5da","titleBar.activeBackground":"#fff","titleBar.activeForeground":"#2f363d","titleBar.border":"#e1e4e8","titleBar.inactiveBackground":"#f6f8fa","titleBar.inactiveForeground":"#6a737d","tree.indentGuidesStroke":"#e1e4e8","welcomePage.buttonBackground":"#f6f8fa","welcomePage.buttonHoverBackground":"#e1e4e8"},"displayName":"GitHub Light","name":"github-light","semanticHighlighting":true,"tokenColors":[{"scope":["comment","punctuation.definition.comment","string.comment"],"settings":{"foreground":"#6a737d"}},{"scope":["constant","entity.name.constant","variable.other.constant","variable.other.enummember","variable.language"],"settings":{"foreground":"#005cc5"}},{"scope":["entity","entity.name"],"settings":{"foreground":"#6f42c1"}},{"scope":"variable.parameter.function","settings":{"foreground":"#24292e"}},{"scope":"entity.name.tag","settings":{"foreground":"#22863a"}},{"scope":"keyword","settings":{"foreground":"#d73a49"}},{"scope":["storage","storage.type"],"settings":{"foreground":"#d73a49"}},{"scope":["storage.modifier.package","storage.modifier.import","storage.type.java"],"settings":{"foreground":"#24292e"}},{"scope":["string","punctuation.definition.string","string punctuation.section.embedded source"],"settings":{"foreground":"#032f62"}},{"scope":"support","settings":{"foreground":"#005cc5"}},{"scope":"meta.property-name","settings":{"foreground":"#005cc5"}},{"scope":"variable","settings":{"foreground":"#e36209"}},{"scope":"variable.other","settings":{"foreground":"#24292e"}},{"scope":"invalid.broken","settings":{"fontStyle":"italic","foreground":"#b31d28"}},{"scope":"invalid.deprecated","settings":{"fontStyle":"italic","foreground":"#b31d28"}},{"scope":"invalid.illegal","settings":{"fontStyle":"italic","foreground":"#b31d28"}},{"scope":"invalid.unimplemented","settings":{"fontStyle":"italic","foreground":"#b31d28"}},{"scope":"carriage-return","settings":{"background":"#d73a49","content":"^M","fontStyle":"italic underline","foreground":"#fafbfc"}},{"scope":"message.error","settings":{"foreground":"#b31d28"}},{"scope":"string variable","settings":{"foreground":"#005cc5"}},{"scope":["source.regexp","string.regexp"],"settings":{"foreground":"#032f62"}},{"scope":["string.regexp.character-class","string.regexp constant.character.escape","string.regexp source.ruby.embedded","string.regexp string.regexp.arbitrary-repitition"],"settings":{"foreground":"#032f62"}},{"scope":"string.regexp constant.character.escape","settings":{"fontStyle":"bold","foreground":"#22863a"}},{"scope":"support.constant","settings":{"foreground":"#005cc5"}},{"scope":"support.variable","settings":{"foreground":"#005cc5"}},{"scope":"meta.module-reference","settings":{"foreground":"#005cc5"}},{"scope":"punctuation.definition.list.begin.markdown","settings":{"foreground":"#e36209"}},{"scope":["markup.heading","markup.heading entity.name"],"settings":{"fontStyle":"bold","foreground":"#005cc5"}},{"scope":"markup.quote","settings":{"foreground":"#22863a"}},{"scope":"markup.italic","settings":{"fontStyle":"italic","foreground":"#24292e"}},{"scope":"markup.bold","settings":{"fontStyle":"bold","foreground":"#24292e"}},{"scope":["markup.underline"],"settings":{"fontStyle":"underline"}},{"scope":["markup.strikethrough"],"settings":{"fontStyle":"strikethrough"}},{"scope":"markup.inline.raw","settings":{"foreground":"#005cc5"}},{"scope":["markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted"],"settings":{"background":"#ffeef0","foreground":"#b31d28"}},{"scope":["markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted"],"settings":{"background":"#f0fff4","foreground":"#22863a"}},{"scope":["markup.changed","punctuation.definition.changed"],"settings":{"background":"#ffebda","foreground":"#e36209"}},{"scope":["markup.ignored","markup.untracked"],"settings":{"background":"#005cc5","foreground":"#f6f8fa"}},{"scope":"meta.diff.range","settings":{"fontStyle":"bold","foreground":"#6f42c1"}},{"scope":"meta.diff.header","settings":{"foreground":"#005cc5"}},{"scope":"meta.separator","settings":{"fontStyle":"bold","foreground":"#005cc5"}},{"scope":"meta.output","settings":{"foreground":"#005cc5"}},{"scope":["brackethighlighter.tag","brackethighlighter.curly","brackethighlighter.round","brackethighlighter.square","brackethighlighter.angle","brackethighlighter.quote"],"settings":{"foreground":"#586069"}},{"scope":"brackethighlighter.unmatched","settings":{"foreground":"#b31d28"}},{"scope":["constant.other.reference.link","string.other.link"],"settings":{"fontStyle":"underline","foreground":"#032f62"}}],"type":"light"}'))});var Zo={};Nt(Zo,{default:()=>Yl});var Yl,es=Nn(()=>{Yl=Object.freeze(JSON.parse('{"colors":{"activityBar.activeBorder":"#f9826c","activityBar.background":"#24292e","activityBar.border":"#1b1f23","activityBar.foreground":"#e1e4e8","activityBar.inactiveForeground":"#6a737d","activityBarBadge.background":"#0366d6","activityBarBadge.foreground":"#fff","badge.background":"#044289","badge.foreground":"#c8e1ff","breadcrumb.activeSelectionForeground":"#d1d5da","breadcrumb.focusForeground":"#e1e4e8","breadcrumb.foreground":"#959da5","breadcrumbPicker.background":"#2b3036","button.background":"#176f2c","button.foreground":"#dcffe4","button.hoverBackground":"#22863a","button.secondaryBackground":"#444d56","button.secondaryForeground":"#fff","button.secondaryHoverBackground":"#586069","checkbox.background":"#444d56","checkbox.border":"#1b1f23","debugToolBar.background":"#2b3036","descriptionForeground":"#959da5","diffEditor.insertedTextBackground":"#28a74530","diffEditor.removedTextBackground":"#d73a4930","dropdown.background":"#2f363d","dropdown.border":"#1b1f23","dropdown.foreground":"#e1e4e8","dropdown.listBackground":"#24292e","editor.background":"#24292e","editor.findMatchBackground":"#ffd33d44","editor.findMatchHighlightBackground":"#ffd33d22","editor.focusedStackFrameHighlightBackground":"#2b6a3033","editor.foldBackground":"#58606915","editor.foreground":"#e1e4e8","editor.inactiveSelectionBackground":"#3392FF22","editor.lineHighlightBackground":"#2b3036","editor.linkedEditingBackground":"#3392FF22","editor.selectionBackground":"#3392FF44","editor.selectionHighlightBackground":"#17E5E633","editor.selectionHighlightBorder":"#17E5E600","editor.stackFrameHighlightBackground":"#C6902625","editor.wordHighlightBackground":"#17E5E600","editor.wordHighlightBorder":"#17E5E699","editor.wordHighlightStrongBackground":"#17E5E600","editor.wordHighlightStrongBorder":"#17E5E666","editorBracketHighlight.foreground1":"#79b8ff","editorBracketHighlight.foreground2":"#ffab70","editorBracketHighlight.foreground3":"#b392f0","editorBracketHighlight.foreground4":"#79b8ff","editorBracketHighlight.foreground5":"#ffab70","editorBracketHighlight.foreground6":"#b392f0","editorBracketMatch.background":"#17E5E650","editorBracketMatch.border":"#17E5E600","editorCursor.foreground":"#c8e1ff","editorError.foreground":"#f97583","editorGroup.border":"#1b1f23","editorGroupHeader.tabsBackground":"#1f2428","editorGroupHeader.tabsBorder":"#1b1f23","editorGutter.addedBackground":"#28a745","editorGutter.deletedBackground":"#ea4a5a","editorGutter.modifiedBackground":"#2188ff","editorIndentGuide.activeBackground":"#444d56","editorIndentGuide.background":"#2f363d","editorLineNumber.activeForeground":"#e1e4e8","editorLineNumber.foreground":"#444d56","editorOverviewRuler.border":"#1b1f23","editorWarning.foreground":"#ffea7f","editorWhitespace.foreground":"#444d56","editorWidget.background":"#1f2428","errorForeground":"#f97583","focusBorder":"#005cc5","foreground":"#d1d5da","gitDecoration.addedResourceForeground":"#34d058","gitDecoration.conflictingResourceForeground":"#ffab70","gitDecoration.deletedResourceForeground":"#ea4a5a","gitDecoration.ignoredResourceForeground":"#6a737d","gitDecoration.modifiedResourceForeground":"#79b8ff","gitDecoration.submoduleResourceForeground":"#6a737d","gitDecoration.untrackedResourceForeground":"#34d058","input.background":"#2f363d","input.border":"#1b1f23","input.foreground":"#e1e4e8","input.placeholderForeground":"#959da5","list.activeSelectionBackground":"#39414a","list.activeSelectionForeground":"#e1e4e8","list.focusBackground":"#044289","list.hoverBackground":"#282e34","list.hoverForeground":"#e1e4e8","list.inactiveFocusBackground":"#1d2d3e","list.inactiveSelectionBackground":"#282e34","list.inactiveSelectionForeground":"#e1e4e8","notificationCenterHeader.background":"#24292e","notificationCenterHeader.foreground":"#959da5","notifications.background":"#2f363d","notifications.border":"#1b1f23","notifications.foreground":"#e1e4e8","notificationsErrorIcon.foreground":"#ea4a5a","notificationsInfoIcon.foreground":"#79b8ff","notificationsWarningIcon.foreground":"#ffab70","panel.background":"#1f2428","panel.border":"#1b1f23","panelInput.border":"#2f363d","panelTitle.activeBorder":"#f9826c","panelTitle.activeForeground":"#e1e4e8","panelTitle.inactiveForeground":"#959da5","peekViewEditor.background":"#1f242888","peekViewEditor.matchHighlightBackground":"#ffd33d33","peekViewResult.background":"#1f2428","peekViewResult.matchHighlightBackground":"#ffd33d33","pickerGroup.border":"#444d56","pickerGroup.foreground":"#e1e4e8","progressBar.background":"#0366d6","quickInput.background":"#24292e","quickInput.foreground":"#e1e4e8","scrollbar.shadow":"#0008","scrollbarSlider.activeBackground":"#6a737d88","scrollbarSlider.background":"#6a737d33","scrollbarSlider.hoverBackground":"#6a737d44","settings.headerForeground":"#e1e4e8","settings.modifiedItemIndicator":"#0366d6","sideBar.background":"#1f2428","sideBar.border":"#1b1f23","sideBar.foreground":"#d1d5da","sideBarSectionHeader.background":"#1f2428","sideBarSectionHeader.border":"#1b1f23","sideBarSectionHeader.foreground":"#e1e4e8","sideBarTitle.foreground":"#e1e4e8","statusBar.background":"#24292e","statusBar.border":"#1b1f23","statusBar.debuggingBackground":"#931c06","statusBar.debuggingForeground":"#fff","statusBar.foreground":"#d1d5da","statusBar.noFolderBackground":"#24292e","statusBarItem.prominentBackground":"#282e34","statusBarItem.remoteBackground":"#24292e","statusBarItem.remoteForeground":"#d1d5da","tab.activeBackground":"#24292e","tab.activeBorder":"#24292e","tab.activeBorderTop":"#f9826c","tab.activeForeground":"#e1e4e8","tab.border":"#1b1f23","tab.hoverBackground":"#24292e","tab.inactiveBackground":"#1f2428","tab.inactiveForeground":"#959da5","tab.unfocusedActiveBorder":"#24292e","tab.unfocusedActiveBorderTop":"#1b1f23","tab.unfocusedHoverBackground":"#24292e","terminal.ansiBlack":"#586069","terminal.ansiBlue":"#2188ff","terminal.ansiBrightBlack":"#959da5","terminal.ansiBrightBlue":"#79b8ff","terminal.ansiBrightCyan":"#56d4dd","terminal.ansiBrightGreen":"#85e89d","terminal.ansiBrightMagenta":"#b392f0","terminal.ansiBrightRed":"#f97583","terminal.ansiBrightWhite":"#fafbfc","terminal.ansiBrightYellow":"#ffea7f","terminal.ansiCyan":"#39c5cf","terminal.ansiGreen":"#34d058","terminal.ansiMagenta":"#b392f0","terminal.ansiRed":"#ea4a5a","terminal.ansiWhite":"#d1d5da","terminal.ansiYellow":"#ffea7f","terminal.foreground":"#d1d5da","terminal.tab.activeBorder":"#f9826c","terminalCursor.background":"#586069","terminalCursor.foreground":"#79b8ff","textBlockQuote.background":"#24292e","textBlockQuote.border":"#444d56","textCodeBlock.background":"#2f363d","textLink.activeForeground":"#c8e1ff","textLink.foreground":"#79b8ff","textPreformat.foreground":"#d1d5da","textSeparator.foreground":"#586069","titleBar.activeBackground":"#24292e","titleBar.activeForeground":"#e1e4e8","titleBar.border":"#1b1f23","titleBar.inactiveBackground":"#1f2428","titleBar.inactiveForeground":"#959da5","tree.indentGuidesStroke":"#2f363d","welcomePage.buttonBackground":"#2f363d","welcomePage.buttonHoverBackground":"#444d56"},"displayName":"GitHub Dark","name":"github-dark","semanticHighlighting":true,"tokenColors":[{"scope":["comment","punctuation.definition.comment","string.comment"],"settings":{"foreground":"#6a737d"}},{"scope":["constant","entity.name.constant","variable.other.constant","variable.other.enummember","variable.language"],"settings":{"foreground":"#79b8ff"}},{"scope":["entity","entity.name"],"settings":{"foreground":"#b392f0"}},{"scope":"variable.parameter.function","settings":{"foreground":"#e1e4e8"}},{"scope":"entity.name.tag","settings":{"foreground":"#85e89d"}},{"scope":"keyword","settings":{"foreground":"#f97583"}},{"scope":["storage","storage.type"],"settings":{"foreground":"#f97583"}},{"scope":["storage.modifier.package","storage.modifier.import","storage.type.java"],"settings":{"foreground":"#e1e4e8"}},{"scope":["string","punctuation.definition.string","string punctuation.section.embedded source"],"settings":{"foreground":"#9ecbff"}},{"scope":"support","settings":{"foreground":"#79b8ff"}},{"scope":"meta.property-name","settings":{"foreground":"#79b8ff"}},{"scope":"variable","settings":{"foreground":"#ffab70"}},{"scope":"variable.other","settings":{"foreground":"#e1e4e8"}},{"scope":"invalid.broken","settings":{"fontStyle":"italic","foreground":"#fdaeb7"}},{"scope":"invalid.deprecated","settings":{"fontStyle":"italic","foreground":"#fdaeb7"}},{"scope":"invalid.illegal","settings":{"fontStyle":"italic","foreground":"#fdaeb7"}},{"scope":"invalid.unimplemented","settings":{"fontStyle":"italic","foreground":"#fdaeb7"}},{"scope":"carriage-return","settings":{"background":"#f97583","content":"^M","fontStyle":"italic underline","foreground":"#24292e"}},{"scope":"message.error","settings":{"foreground":"#fdaeb7"}},{"scope":"string variable","settings":{"foreground":"#79b8ff"}},{"scope":["source.regexp","string.regexp"],"settings":{"foreground":"#dbedff"}},{"scope":["string.regexp.character-class","string.regexp constant.character.escape","string.regexp source.ruby.embedded","string.regexp string.regexp.arbitrary-repitition"],"settings":{"foreground":"#dbedff"}},{"scope":"string.regexp constant.character.escape","settings":{"fontStyle":"bold","foreground":"#85e89d"}},{"scope":"support.constant","settings":{"foreground":"#79b8ff"}},{"scope":"support.variable","settings":{"foreground":"#79b8ff"}},{"scope":"meta.module-reference","settings":{"foreground":"#79b8ff"}},{"scope":"punctuation.definition.list.begin.markdown","settings":{"foreground":"#ffab70"}},{"scope":["markup.heading","markup.heading entity.name"],"settings":{"fontStyle":"bold","foreground":"#79b8ff"}},{"scope":"markup.quote","settings":{"foreground":"#85e89d"}},{"scope":"markup.italic","settings":{"fontStyle":"italic","foreground":"#e1e4e8"}},{"scope":"markup.bold","settings":{"fontStyle":"bold","foreground":"#e1e4e8"}},{"scope":["markup.underline"],"settings":{"fontStyle":"underline"}},{"scope":["markup.strikethrough"],"settings":{"fontStyle":"strikethrough"}},{"scope":"markup.inline.raw","settings":{"foreground":"#79b8ff"}},{"scope":["markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted"],"settings":{"background":"#86181d","foreground":"#fdaeb7"}},{"scope":["markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted"],"settings":{"background":"#144620","foreground":"#85e89d"}},{"scope":["markup.changed","punctuation.definition.changed"],"settings":{"background":"#c24e00","foreground":"#ffab70"}},{"scope":["markup.ignored","markup.untracked"],"settings":{"background":"#79b8ff","foreground":"#2f363d"}},{"scope":"meta.diff.range","settings":{"fontStyle":"bold","foreground":"#b392f0"}},{"scope":"meta.diff.header","settings":{"foreground":"#79b8ff"}},{"scope":"meta.separator","settings":{"fontStyle":"bold","foreground":"#79b8ff"}},{"scope":"meta.output","settings":{"foreground":"#79b8ff"}},{"scope":["brackethighlighter.tag","brackethighlighter.curly","brackethighlighter.round","brackethighlighter.square","brackethighlighter.angle","brackethighlighter.quote"],"settings":{"foreground":"#d1d5da"}},{"scope":"brackethighlighter.unmatched","settings":{"foreground":"#fdaeb7"}},{"scope":["constant.other.reference.link","string.other.link"],"settings":{"fontStyle":"underline","foreground":"#dbedff"}}],"type":"dark"}'))});var E=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function os(e){return Ut(e)}function Ut(e){return Array.isArray(e)?ss(e):e instanceof RegExp?e:typeof e=="object"?as(e):e}function ss(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Ut(e[n]);return t}function as(e){let t={};for(let n in e)t[n]=Ut(e[n]);return t}function Dn(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function Un(e){let t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?Un(e.substring(0,e.length-1)):e.substr(~t+1)}var Tt=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Ve=class{static hasCaptures(e){return e===null?!1:(Tt.lastIndex=0,Tt.test(e))}static replaceCaptures(e,t,n){return e.replace(Tt,(r,o,s,a)=>{let i=n[parseInt(o||s,10)];if(i){let l=t.substring(i.start,i.end);for(;l[0]===".";)l=l.substring(1);switch(a){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function Hn(e,t){return e<t?-1:e>t?1:0}function jn(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let o=0;o<n;o++){let s=Hn(e[o],t[o]);if(s!==0)return s}return 0}return n-r}function Tn(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function Wn(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var zn=class{constructor(e){this.fn=e}fn;cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},Re=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}_colorMap;_defaults;_root;static createFromRawTheme(e,t){return this.createFromParsedTheme(cs(e),t)}static createFromParsedTheme(e,t){return ds(e,t)}_cachedMatchRoot=new zn(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,r=this._cachedMatchRoot.get(t).find(o=>is(e.parent,o.parentScopes));return r?new qn(r.fontStyle,r.foreground,r.background):null}},Lt=class Xe{constructor(t,n){this.parent=t,this.scopeName=n}parent;scopeName;static push(t,n){for(let r of n)t=new Xe(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new Xe(n,t[r]);return n}push(t){return new Xe(this,t)}getSegments(){let t=this,n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){let n=[],r=this;for(;r&&r!==t;)n.push(r.scopeName),r=r.parent;return r===t?n.reverse():void 0}};function is(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],o=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],o=!0}for(;e&&!ls(e.scopeName,r);){if(o)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function ls(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var qn=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}fontStyle;foregroundId;backgroundId};function cs(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let o=0,s=t.length;o<s;o++){let a=t[o];if(!a.settings)continue;let i;if(typeof a.scope=="string"){let d=a.scope;d=d.replace(/^[,]+/,""),d=d.replace(/[,]+$/,""),i=d.split(",")}else Array.isArray(a.scope)?i=a.scope:i=[""];let l=-1;if(typeof a.settings.fontStyle=="string"){l=0;let d=a.settings.fontStyle.split(" ");for(let f=0,g=d.length;f<g;f++)switch(d[f]){case"italic":l=l|1;break;case"bold":l=l|2;break;case"underline":l=l|4;break;case"strikethrough":l=l|8;break}}let c=null;typeof a.settings.foreground=="string"&&Tn(a.settings.foreground)&&(c=a.settings.foreground);let u=null;typeof a.settings.background=="string"&&Tn(a.settings.background)&&(u=a.settings.background);for(let d=0,f=i.length;d<f;d++){let h=i[d].trim().split(" "),y=h[h.length-1],k=null;h.length>1&&(k=h.slice(0,h.length-1),k.reverse()),n[r++]=new us(y,k,o,l,c,u)}}return n}var us=class{constructor(e,t,n,r,o,s){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=o,this.background=s}scope;parentScopes;index;fontStyle;foreground;background},P=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(P||{});function ds(e,t){e.sort((l,c)=>{let u=Hn(l.scope,c.scope);return u!==0||(u=jn(l.parentScopes,c.parentScopes),u!==0)?u:l.index-c.index});let n=0,r="#000000",o="#ffffff";for(;e.length>=1&&e[0].scope==="";){let l=e.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(o=l.background)}let s=new fs(t),a=new qn(n,s.getId(r),s.getId(o)),i=new hs(new Mt(0,null,-1,0,0),[]);for(let l=0,c=e.length;l<c;l++){let u=e[l];i.insert(0,u.scope,u.parentScopes,u.fontStyle,s.getId(u.foreground),s.getId(u.background))}return new Re(s,a,i)}var fs=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},gs=Object.freeze([]),Mt=class Vn{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,r,o,s){this.scopeDepth=t,this.parentScopes=n||gs,this.fontStyle=r,this.foreground=o,this.background=s}clone(){return new Vn(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let r=0,o=t.length;r<o;r++)n[r]=t[r].clone();return n}acceptOverwrite(t,n,r,o){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),o!==0&&(this.background=o)}},hs=class $t{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_mainRule;_children;_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,o=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[o]===">"&&o++,!(r>=t.parentScopes.length||o>=n.parentScopes.length);){let s=n.parentScopes[o].length-t.parentScopes[r].length;if(s!==0)return s;r++,o++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),o,s;if(r===-1?(o=t,s=""):(o=t.substring(0,r),s=t.substring(r+1)),this._children.hasOwnProperty(o))return this._children[o].match(s)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort($t._cmpBySpecificity),n}insert(t,n,r,o,s,a){if(n===""){this._doInsertHere(t,r,o,s,a);return}let i=n.indexOf("."),l,c;i===-1?(l=n,c=""):(l=n.substring(0,i),c=n.substring(i+1));let u;this._children.hasOwnProperty(l)?u=this._children[l]:(u=new $t(this._mainRule.clone(),Mt.cloneArr(this._rulesWithParentScopes)),this._children[l]=u),u.insert(t+1,c,r,o,s,a)}_doInsertHere(t,n,r,o,s){if(n===null){this._mainRule.acceptOverwrite(t,r,o,s);return}for(let a=0,i=this._rulesWithParentScopes.length;a<i;a++){let l=this._rulesWithParentScopes[a];if(jn(l.parentScopes,n)===0){l.acceptOverwrite(t,r,o,s);return}}r===-1&&(r=this._mainRule.fontStyle),o===0&&(o=this._mainRule.foreground),s===0&&(s=this._mainRule.background),this._rulesWithParentScopes.push(new Mt(t,n,r,o,s))}},re=class D{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){let n=D.getLanguageId(t),r=D.getTokenType(t),o=D.getFontStyle(t),s=D.getForeground(t),a=D.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:o,foreground:s,background:a})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,o,s,a,i){let l=D.getLanguageId(t),c=D.getTokenType(t),u=D.containsBalancedBrackets(t)?1:0,d=D.getFontStyle(t),f=D.getForeground(t),g=D.getBackground(t);return n!==0&&(l=n),r!==8&&(c=r),o!==null&&(u=o?1:0),s!==-1&&(d=s),a!==0&&(f=a),i!==0&&(g=i),(l<<0|c<<8|u<<10|d<<11|f<<15|g<<24)>>>0}};function Ke(e,t){let n=[],r=ps(e),o=r.next();for(;o!==null;){let l=0;if(o.length===2&&o.charAt(1)===":"){switch(o.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${o} in scope selector`)}o=r.next()}let c=a();if(n.push({matcher:c,priority:l}),o!==",")break;o=r.next()}return n;function s(){if(o==="-"){o=r.next();let l=s();return c=>!!l&&!l(c)}if(o==="("){o=r.next();let l=i();return o===")"&&(o=r.next()),l}if(Ln(o)){let l=[];do l.push(o),o=r.next();while(Ln(o));return c=>t(l,c)}return null}function a(){let l=[],c=s();for(;c;)l.push(c),c=s();return u=>l.every(d=>d(u))}function i(){let l=[],c=a();for(;c&&(l.push(c),o==="|"||o===",");){do o=r.next();while(o==="|"||o===",");c=a()}return u=>l.some(d=>d(u))}}function Ln(e){return!!e&&!!e.match(/[\w\.:]+/)}function ps(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function Xn(e){typeof e.dispose=="function"&&e.dispose()}var Ie=class{constructor(e){this.scopeName=e}scopeName;toKey(){return this.scopeName}},ms=class{constructor(e,t){this.scopeName=e,this.ruleName=t}scopeName;ruleName;toKey(){return`${this.scopeName}#${this.ruleName}`}},bs=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},ys=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Ie(this.initialScopeName)]}repo;initialScopeName;seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new bs;for(let n of e)ks(n,this.initialScopeName,this.repo,t);for(let n of t.references)if(n instanceof Ie){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 ks(e,t,n,r){let o=n.lookup(e.scopeName);if(!o){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}let s=n.lookup(t);e instanceof Ie?Qe({baseGrammar:s,selfGrammar:o},r):Gt(e.ruleName,{baseGrammar:s,selfGrammar:o,repository:o.repository},r);let a=n.injections(e.scopeName);if(a)for(let i of a)r.add(new Ie(i))}function Gt(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];Ye([r],t,n)}}function Qe(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Ye(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Ye(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Ye(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let o=r.repository?Dn({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Ye(r.patterns,{...t,repository:o},n);let s=r.include;if(!s)continue;let a=Qn(s);switch(a.kind){case 0:Qe({...t,selfGrammar:t.baseGrammar},n);break;case 1:Qe(t,n);break;case 2:Gt(a.ruleName,{...t,repository:o},n);break;case 3:case 4:let i=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(i){let l={baseGrammar:t.baseGrammar,selfGrammar:i,repository:o};a.kind===4?Gt(a.ruleName,l,n):Qe(l,n)}else a.kind===4?n.add(new ms(a.scopeName,a.ruleName)):n.add(new Ie(a.scopeName));break}}}var ws=class{kind=0},Cs=class{kind=1},Ss=class{constructor(e){this.ruleName=e}ruleName;kind=2},_s=class{constructor(e){this.scopeName=e}scopeName;kind=3},vs=class{constructor(e,t){this.scopeName=e,this.ruleName=t}scopeName;ruleName;kind=4};function Qn(e){if(e==="$base")return new ws;if(e==="$self")return new Cs;let t=e.indexOf("#");if(t===-1)return new _s(e);if(t===0)return new Ss(e.substring(1));{let n=e.substring(0,t),r=e.substring(t+1);return new vs(n,r)}}var xs=/\\(\d+)/,Pn=/\\(\d+)/g,Es=-1,Kn=-2;var Te=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Ve.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Ve.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${Un(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Ve.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Ve.replaceCaptures(this._contentName,e,t)}},As=class extends Te{retokenizeCapturedWithRuleId;constructor(e,t,n,r,o){super(e,t,n,r),this.retokenizeCapturedWithRuleId=o}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},Rs=class extends Te{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,o){super(e,t,n,null),this._match=new Be(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(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Ne,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Mn=class extends Te{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,o){super(e,t,n,r),this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Ne,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ot=class extends Te{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,o,s,a,i,l,c){super(e,t,n,r),this._begin=new Be(o,this.id),this.beginCaptures=s,this._end=new Be(a||"\uFFFF",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=i,this.applyEndPatternLast=l||!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(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Ne;for(let n of this.patterns)e.getRule(n).collectPatterns(e,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,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Je=class extends Te{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,o,s,a,i,l){super(e,t,n,r),this._begin=new Be(o,this.id),this.beginCaptures=s,this.whileCaptures=i,this._while=new Be(a,Kn),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.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(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Ne;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Ne,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"\uFFFF"),this._cachedCompiledWhilePatterns}},Yn=class M{static createCaptureRule(t,n,r,o,s){return t.registerRule(a=>new As(n,a,r,o,s))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(o=>{if(t.id=o,t.match)return new Rs(t.$vscodeTextmateLocation,t.id,t.name,t.match,M._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=Dn({},r,t.repository));let s=t.patterns;return typeof s>"u"&&t.include&&(s=[{include:t.include}]),new Mn(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,M._compilePatterns(s,n,r))}return t.while?new Je(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,M._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,M._compileCaptures(t.whileCaptures||t.captures,n,r),M._compilePatterns(t.patterns,n,r)):new Ot(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,M._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,M._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,M._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let o=[];if(t){let s=0;for(let a in t){if(a==="$vscodeTextmateLocation")continue;let i=parseInt(a,10);i>s&&(s=i)}for(let a=0;a<=s;a++)o[a]=null;for(let a in t){if(a==="$vscodeTextmateLocation")continue;let i=parseInt(a,10),l=0;t[a].patterns&&(l=M.getCompiledRuleId(t[a],n,r)),o[i]=M.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,l)}}return o}static _compilePatterns(t,n,r){let o=[];if(t)for(let s=0,a=t.length;s<a;s++){let i=t[s],l=-1;if(i.include){let c=Qn(i.include);switch(c.kind){case 0:case 1:l=M.getCompiledRuleId(r[i.include],n,r);break;case 2:let u=r[c.ruleName];u&&(l=M.getCompiledRuleId(u,n,r));break;case 3:case 4:let d=c.scopeName,f=c.kind===4?c.ruleName:null,g=n.getExternalGrammar(d,r);if(g)if(f){let h=g.repository[f];h&&(l=M.getCompiledRuleId(h,n,g.repository))}else l=M.getCompiledRuleId(g.repository.$self,n,g.repository);break}}else l=M.getCompiledRuleId(i,n,r);if(l!==-1){let c=n.getRule(l),u=!1;if((c instanceof Mn||c instanceof Ot||c instanceof Je)&&c.hasMissingPatterns&&c.patterns.length===0&&(u=!0),u)continue;o.push(l)}}return{patterns:o,hasMissingPatterns:(t?t.length:0)!==o.length}}},Be=class Jn{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){let r=t.length,o=0,s=[],a=!1;for(let i=0;i<r;i++)if(t.charAt(i)==="\\"&&i+1<r){let c=t.charAt(i+1);c==="z"?(s.push(t.substring(o,i)),s.push("$(?!\\n)(?<!\\n)"),o=i+2):(c==="A"||c==="G")&&(a=!0),i++}this.hasAnchor=a,o===0?this.source=t:(s.push(t.substring(o,r)),this.source=s.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=xs.test(this.source):this.hasBackReferences=!1}clone(){return new Jn(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,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=>t.substring(o.start,o.end));return Pn.lastIndex=0,this.source.replace(Pn,(o,s)=>Wn(r[parseInt(s,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],o=[],s,a,i,l;for(s=0,a=this.source.length;s<a;s++)i=this.source.charAt(s),t[s]=i,n[s]=i,r[s]=i,o[s]=i,i==="\\"&&s+1<a&&(l=this.source.charAt(s+1),l==="A"?(t[s+1]="\uFFFF",n[s+1]="\uFFFF",r[s+1]="A",o[s+1]="A"):l==="G"?(t[s+1]="\uFFFF",n[s+1]="G",r[s+1]="\uFFFF",o[s+1]="G"):(t[s+1]=l,n[s+1]=l,r[s+1]=l,o[s+1]=l),s++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:o.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Ne=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(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new $n(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(o=>o.resolveAnchors(t,n));return new $n(e,r,this._items.map(o=>o.ruleId))}},$n=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}regExps;rules;scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
2
- `)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Pt=class{constructor(e,t){this.languageId=e,this.tokenType=t}languageId;tokenType},Is=class Ft{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new Pt(t,8),this._embeddedLanguagesMatcher=new Bs(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?Ft._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Pt(0,0);_getBasicScopeAttributes=new zn(t=>{let n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new Pt(n,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){let n=t.match(Ft.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/},Bs=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([n,r])=>Wn(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},tc={InDebugMode:typeof process<"u"&&!!process.env.VSCODE_TEXTMATE_DEBUG},Zn=!1,Gn=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}stack;stoppedEarly};function er(e,t,n,r,o,s,a,i){let l=t.content.length,c=!1,u=-1;if(a){let g=Ns(e,t,n,r,o,s);o=g.stack,r=g.linePos,n=g.isFirstLine,u=g.anchorPosition}let d=Date.now();for(;!c;){if(i!==0&&Date.now()-d>i)return new Gn(o,!0);f()}return new Gn(o,!1);function f(){let g=Ts(e,t,n,r,o,u);if(!g){s.produce(o,l),c=!0;return}let h=g.captureIndices,y=g.matchedRuleId,k=h&&h.length>0?h[0].end>r:!1;if(y===Es){let m=o.getRule(e);s.produce(o,h[0].start),o=o.withContentNameScopesList(o.nameScopesList),Ee(e,t,n,o,s,m.endCaptures,h),s.produce(o,h[0].end);let b=o;if(o=o.parent,u=b.getAnchorPos(),!k&&b.getEnterPos()===r){o=b,s.produce(o,l),c=!0;return}}else{let m=e.getRule(y);s.produce(o,h[0].start);let b=o,w=m.getName(t.content,h),_=o.contentNameScopesList.pushAttributed(w,e);if(o=o.push(y,r,u,h[0].end===l,null,_,_),m instanceof Ot){let x=m;Ee(e,t,n,o,s,x.beginCaptures,h),s.produce(o,h[0].end),u=h[0].end;let L=x.getContentName(t.content,h),$=_.pushAttributed(L,e);if(o=o.withContentNameScopesList($),x.endHasBackReferences&&(o=o.withEndRule(x.getEndWithResolvedBackReferences(t.content,h))),!k&&b.hasSameRuleAs(o)){o=o.pop(),s.produce(o,l),c=!0;return}}else if(m instanceof Je){let x=m;Ee(e,t,n,o,s,x.beginCaptures,h),s.produce(o,h[0].end),u=h[0].end;let L=x.getContentName(t.content,h),$=_.pushAttributed(L,e);if(o=o.withContentNameScopesList($),x.whileHasBackReferences&&(o=o.withEndRule(x.getWhileWithResolvedBackReferences(t.content,h))),!k&&b.hasSameRuleAs(o)){o=o.pop(),s.produce(o,l),c=!0;return}}else if(Ee(e,t,n,o,s,m.captures,h),s.produce(o,h[0].end),o=o.pop(),!k){o=o.safePop(),s.produce(o,l),c=!0;return}}h[0].end>r&&(r=h[0].end,n=!1)}}function Ns(e,t,n,r,o,s){let a=o.beginRuleCapturedEOL?0:-1,i=[];for(let l=o;l;l=l.pop()){let c=l.getRule(e);c instanceof Je&&i.push({rule:c,stack:l})}for(let l=i.pop();l;l=i.pop()){let{ruleScanner:c,findOptions:u}=Ms(l.rule,e,l.stack.endRule,n,r===a),d=c.findNextMatchSync(t,r,u);if(d){if(d.ruleId!==Kn){o=l.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(s.produce(l.stack,d.captureIndices[0].start),Ee(e,t,n,l.stack,s,l.rule.whileCaptures,d.captureIndices),s.produce(l.stack,d.captureIndices[0].end),a=d.captureIndices[0].end,d.captureIndices[0].end>r&&(r=d.captureIndices[0].end,n=!1))}else{o=l.stack.pop();break}}return{stack:o,linePos:r,anchorPosition:a,isFirstLine:n}}function Ts(e,t,n,r,o,s){let a=Ls(e,t,n,r,o,s),i=e.getInjections();if(i.length===0)return a;let l=Ps(i,e,t,n,r,o,s);if(!l)return a;if(!a)return l;let c=a.captureIndices[0].start,u=l.captureIndices[0].start;return u<c||l.priorityMatch&&u===c?l:a}function Ls(e,t,n,r,o,s){let a=o.getRule(e),{ruleScanner:i,findOptions:l}=tr(a,e,o.endRule,n,r===s),c=i.findNextMatchSync(t,r,l);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Ps(e,t,n,r,o,s,a){let i=Number.MAX_VALUE,l=null,c,u=0,d=s.contentNameScopesList.getScopeNames();for(let f=0,g=e.length;f<g;f++){let h=e[f];if(!h.matcher(d))continue;let y=t.getRule(h.ruleId),{ruleScanner:k,findOptions:m}=tr(y,t,null,r,o===a),b=k.findNextMatchSync(n,o,m);if(!b)continue;let w=b.captureIndices[0].start;if(!(w>=i)&&(i=w,l=b.captureIndices,c=b.ruleId,u=h.priority,i===o))break}return l?{priorityMatch:u===-1,captureIndices:l,matchedRuleId:c}:null}function tr(e,t,n,r,o){if(Zn){let a=e.compile(t,n),i=nr(r,o);return{ruleScanner:a,findOptions:i}}return{ruleScanner:e.compileAG(t,n,r,o),findOptions:0}}function Ms(e,t,n,r,o){if(Zn){let a=e.compileWhile(t,n),i=nr(r,o);return{ruleScanner:a,findOptions:i}}return{ruleScanner:e.compileWhileAG(t,n,r,o),findOptions:0}}function nr(e,t){let n=0;return e||(n|=1),t||(n|=4),n}function Ee(e,t,n,r,o,s,a){if(s.length===0)return;let i=t.content,l=Math.min(s.length,a.length),c=[],u=a[0].end;for(let d=0;d<l;d++){let f=s[d];if(f===null)continue;let g=a[d];if(g.length===0)continue;if(g.start>u)break;for(;c.length>0&&c[c.length-1].endPos<=g.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,g.start):o.produce(r,g.start),f.retokenizeCapturedWithRuleId){let y=f.getName(i,a),k=r.contentNameScopesList.pushAttributed(y,e),m=f.getContentName(i,a),b=k.pushAttributed(m,e),w=r.push(f.retokenizeCapturedWithRuleId,g.start,-1,!1,null,k,b),_=e.createOnigString(i.substring(0,g.end));er(e,_,n&&g.start===0,g.start,w,o,!1,0),Xn(_);continue}let h=f.getName(i,a);if(h!==null){let k=(c.length>0?c[c.length-1].scopes:r.contentNameScopesList).pushAttributed(h,e);c.push(new $s(k,g.end))}}for(;c.length>0;)o.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var $s=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Gs(e,t,n,r,o,s,a,i){return new Fs(e,t,n,r,o,s,a,i)}function On(e,t,n,r,o){let s=Ke(t,Ze),a=Yn.getCompiledRuleId(n,r,o.repository);for(let i of s)e.push({debugSelector:t,matcher:i.matcher,ruleId:a,grammar:o,priority:i.priority})}function Ze(e,t){if(t.length<e.length)return!1;let n=0;return e.every(r=>{for(let o=n;o<t.length;o++)if(Os(t[o],r))return n=o+1,!0;return!1})}function Os(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var Fs=class{constructor(e,t,n,r,o,s,a,i){if(this._rootScopeName=e,this.balancedBracketSelectors=s,this._onigLib=i,this._basicScopeAttributesProvider=new Is(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=a,this._grammar=Fn(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(let l of Object.keys(o)){let c=Ke(l,Ze);for(let u of c)this._tokenTypeMatchers.push({matcher:u.matcher,type:o[l]})}}_rootScopeName;balancedBracketSelectors;_onigLib;_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:o=>o===this._rootScopeName?this._grammar:this.getExternalGrammar(o),injections:o=>this._grammarRepository.injections(o)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let o=r.injections;if(o)for(let a in o)On(t,a,o[a],this,r);let s=this._grammarRepository.injections(n);s&&s.forEach(a=>{let i=this.getExternalGrammar(a);if(i){let l=i.injectionSelector;l&&On(t,l,i,this,i)}})}return t.sort((o,s)=>o.priority-s.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Fn(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=Yn.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let o;if(!t||t===Dt.NULL){o=!0;let c=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),d=re.set(0,c.languageId,c.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),f=this.getRule(this._rootId).getName(null,null),g;f?g=Ae.createRootAndLookUpScopeName(f,d,this):g=Ae.createRoot("unknown",d),t=new Dt(null,this._rootId,-1,-1,!1,null,g,g)}else o=!1,t.reset();e=e+`
3
- `;let s=this.createOnigString(e),a=s.content.length,i=new Us(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=er(this,s,o,0,t,i,!0,r);return Xn(s),{lineLength:a,lineTokens:i,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function Fn(e,t){return e=os(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Ae=class q{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}parent;scopePath;tokenAttributes;static fromExtension(t,n){let r=t,o=t?.scopePath??null;for(let s of n)o=Lt.push(o,s.scopeNames),r=new q(r,o,s.encodedTokenAttributes);return r}static createRoot(t,n){return new q(null,new Lt(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let o=r.getMetadataForScope(t),s=new Lt(null,t),a=r.themeProvider.themeMatch(s),i=q.mergeAttributes(n,o,a);return new q(null,s,i)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return q.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,r){let o=-1,s=0,a=0;return r!==null&&(o=r.fontStyle,s=r.foregroundId,a=r.backgroundId),re.set(t,n.languageId,n.tokenType,null,o,s,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return q._pushAttributed(this,t,n);let r=t.split(/ /g),o=this;for(let s of r)o=q._pushAttributed(o,s,n);return o}static _pushAttributed(t,n,r){let o=r.getMetadataForScope(n),s=t.scopePath.push(n),a=r.themeProvider.themeMatch(s),i=q.mergeAttributes(t.tokenAttributes,o,a);return new q(t,s,i)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){let n=[],r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===t?n.reverse():void 0}},Dt=class le{constructor(t,n,r,o,s,a,i,l){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=s,this.endRule=a,this.nameScopesList=i,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=o}parent;ruleId;beginRuleCapturedEOL;endRule;nameScopesList;contentNameScopesList;_stackElementBrand=void 0;static NULL=new le(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:le._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Ae.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){le._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,o,s,a,i){return new le(this,t,n,r,o,s,a,i)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){let t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new le(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.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(t,n){let r=Ae.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new le(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Ae.fromExtension(r,n.contentNameScopesList))}},Ds=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Ke(n,Ze).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>Ke(n,Ze).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Us=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}balancedBracketSelectors;_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let r=e?.tokenAttributes??0,o=!1;if(this.balancedBracketSelectors?.matchesAlways&&(o=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let s=e?.getScopeNames()??[];for(let a of this._tokenTypeOverrides)a.matcher(s)&&(r=re.set(r,0,a.type,null,-1,0,0));this.balancedBracketSelectors&&(o=this.balancedBracketSelectors.match(s))}if(o&&(r=re.set(r,0,8,o,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let r=0,o=this._binaryTokens.length;r<o;r++)n[r]=this._binaryTokens[r];return n}},Hs=class{constructor(e,t){this._onigLib=t,this._theme=e}_onigLib;_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,o){if(!this._grammars.has(e)){let s=this._rawGrammars.get(e);if(!s)return null;this._grammars.set(e,Gs(e,s,t,n,r,o,this,this._onigLib))}return this._grammars.get(e)}},rr=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new Hs(Re.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(Re.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new Ds(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,o){let s=new ys(this._syncRegistry,e);for(;s.Q.length>0;)s.Q.map(a=>this._loadSingleGrammar(a.scopeName)),s.processQueue();return this._grammarForScopeName(e,t,n,r,o)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,o=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,o)}},et=Dt.NULL;function Pe(e,t){let n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(let[o,s]of Object.entries(t?.colorReplacements||{}))typeof s=="string"?n[o]=s:o===r&&Object.assign(n,s);return n}function X(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function lr(e){return Array.isArray(e)?e:[e]}async function Ht(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Me(e){return!e||["plaintext","txt","text","plain"].includes(e)}function cr(e){return e==="ansi"||Me(e)}function $e(e){return e==="none"}function ur(e){return $e(e)}var js=/(\r?\n)/g;function ke(e,t=!1){if(e.length===0)return[["",0]];let n=e.split(js),r=0,o=[];for(let s=0;s<n.length;s+=2){let a=t?n[s]+(n[s+1]||""):n[s];o.push([a,r]),r+=n[s].length,r+=n[s+1]?.length||0}return o}var or={light:"#333333",dark:"#bbbbbb"},sr={light:"#fffffe",dark:"#1e1e1e"},ar="__shiki_resolved";function tt(e){if(e?.[ar])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let i=t.settings?t.settings.find(l=>!l.name&&!l.scope):void 0;i?.settings?.foreground&&(r=i.settings.foreground),i?.settings?.background&&(n=i.settings.background),!r&&t?.colors?.["editor.foreground"]&&(r=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?or.light:or.dark),n||(n=t.type==="light"?sr.light:sr.dark),t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let o=0,s=new Map;function a(i){if(s.has(i))return s.get(i);o+=1;let l=`#${o.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${l}`]?a(i):(s.set(i,l),l)}t.settings=t.settings.map(i=>{let l=i.settings?.foreground&&!i.settings.foreground.startsWith("#"),c=i.settings?.background&&!i.settings.background.startsWith("#");if(!l&&!c)return i;let u={...i,settings:{...i.settings}};if(l){let d=a(i.settings.foreground);t.colorReplacements[d]=i.settings.foreground,u.settings.foreground=d}if(c){let d=a(i.settings.background);t.colorReplacements[d]=i.settings.background,u.settings.background=d}return u});for(let i of Object.keys(t.colors||{}))if((i==="editor.foreground"||i==="editor.background"||i.startsWith("terminal.ansi"))&&!t.colors[i]?.startsWith("#")){let l=a(t.colors[i]);t.colorReplacements[l]=t.colors[i],t.colors[i]=l}return Object.defineProperty(t,ar,{enumerable:!1,writable:!1,value:!0}),t}async function dr(e){return[...new Set((await Promise.all(e.filter(t=>!cr(t)).map(async t=>await Ht(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function fr(e){return(await Promise.all(e.map(async t=>ur(t)?null:tt(await Ht(t))))).filter(t=>!!t)}function gr(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new E(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var Ws=class extends rr{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(o=>this.loadTheme(o)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=tt(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Re.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=gr(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(o=>o.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(o=>{this._alias[o]=e.name}),this._loadedLanguagesCache=null,t.size)for(let o of t)this._syncRegistry?._grammars?.get(o.scopeName)?.dispose(),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(let r of e)this.resolveEmbeddedLanguages(r);let t=[...this._langGraph.entries()],n=t.filter(([r,o])=>!o);if(n.length){let r=t.filter(([o,s])=>s?(s.embeddedLanguages||s.embeddedLangs)?.some(a=>n.map(([i])=>i).includes(a)):!1).filter(o=>!n.includes(o));throw new E(`Missing languages ${n.map(([o])=>`\`${o}\``).join(", ")}, required by ${r.map(([o])=>`\`${o}\``).join(", ")}`)}for(let[r,o]of t)this._resolver.addLanguage(o);for(let[r,o]of t)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);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let n of t)this._langGraph.set(n,this._langMap.get(n))}},zs=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:n=>e.createScanner(n),createOnigString:n=>e.createString(n)},t.forEach(n=>this.addLanguage(n))}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(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).includes(e.scopeName)||this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split("."),n=[];for(let r=1;r<=t.length;r++){let o=t.slice(0,r).join(".");n=[...n,...this._injections.get(o)||[]]}return n}},Le=0;function jt(e){Le+=1,e.warnings!==!1&&Le>=10&&Le%10===0&&console.warn(`[Shiki] ${Le} 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 t=!1;if(!e.engine)throw new E("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(tt),o=new Ws(new zs(e.engine,n),r,n,e.langAlias),s;function a(b){return gr(b,e.langAlias)}function i(b){k();let w=o.getGrammar(typeof b=="string"?b:b.name);if(!w)throw new E(`Language \`${b}\` not found, you may need to load it first`);return w}function l(b){if(b==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};k();let w=o.getTheme(b);if(!w)throw new E(`Theme \`${b}\` not found, you may need to load it first`);return w}function c(b){k();let w=l(b);return s!==b&&(o.setTheme(w),s=b),{theme:w,colorMap:o.getColorMap()}}function u(){return k(),o.getLoadedThemes()}function d(){return k(),o.getLoadedLanguages()}function f(...b){k(),o.loadLanguages(b.flat(1))}async function g(...b){return f(await dr(b))}function h(...b){k();for(let w of b.flat(1))o.loadTheme(w)}async function y(...b){return k(),h(await fr(b))}function k(){if(t)throw new E("Shiki instance has been disposed")}function m(){t||(t=!0,o.dispose(),Le-=1)}return{setTheme:c,getTheme:l,getLanguage:i,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:a,loadLanguage:g,loadLanguageSync:f,loadTheme:y,loadThemeSync:h,dispose:m,[Symbol.dispose]:m}}async function Wt(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([fr(e.themes||[]),dr(e.langs||[]),e.engine]);return jt({...e,themes:t,langs:n,engine:r})}var hr=new WeakMap;function Ge(e,t){hr.set(e,t)}function we(e){return hr.get(e)}var nt=class pr{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new pr(Object.fromEntries(lr(n).map(r=>[r,et])),t)}constructor(...t){if(t.length===2){let[n,r]=t;this.lang=r,this._stacks=n}else{let[n,r,o]=t;this.lang=r,this._stacks={[o]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return qs(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function qs(e){let t=[],n=new Set;function r(o){if(n.has(o))return;n.add(o);let s=o?.nameScopesList?.scopeName;s&&t.push(s),o.parent&&r(o.parent)}return r(e),t}function Vs(e,t){if(!(e instanceof nt))throw new E("Invalid grammar state");return e.getInternalStack(t)}var Xs=/,/,Qs=/ /;function zt(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(Me(e.resolveLangAlias(n.lang||"text"))||$e(r))return ke(t).map(i=>[{content:i[0],offset:i[1]}]);let{theme:o,colorMap:s}=e.setTheme(r),a=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==a.name)throw new E(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${a.name}"`);if(!n.grammarState.themes.includes(o.name))throw new E(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${o.name}"`)}return br(t,a,o,s,n)}function mr(...e){if(e.length===2)return we(e[1]);let[t,n,r={}]=e,{lang:o="text",theme:s=t.getLoadedThemes()[0]}=r;if(Me(o)||$e(s))throw new E("Plain language does not have grammar state");if(o==="ansi")throw new E("ANSI language does not have grammar state");let{theme:a,colorMap:i}=t.setTheme(s),l=t.getLanguage(o);return new nt(qt(n,l,a,i,r).stateStack,l.name,a.name)}function br(e,t,n,r,o){let s=qt(e,t,n,r,o),a=new nt(s.stateStack,t.name,n.name);return Ge(s.tokens,a),s.tokens}function qt(e,t,n,r,o){let s=Pe(n,o),{tokenizeMaxLineLength:a=0,tokenizeTimeLimit:i=500,includeExplanation:l=!1}=o,c=ke(e),u=o.grammarState?Vs(o.grammarState,n.name)??et:o.grammarContextCode!=null?qt(o.grammarContextCode,t,n,r,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:et,d=[],f=[];for(let g=0,h=c.length;g<h;g++){let[y,k]=c[g];if(y===""){d=[],f.push([]);continue}if(a>0&&y.length>=a){d=[],f.push([{content:y,offset:k,color:"",fontStyle:0}]);continue}let m,b,w;l&&l!=="tokenType"&&(m=t.tokenizeLine(y,u,i),b=m.tokens,w=0);let _=t.tokenizeLine2(y,u,i),x=_.tokens.length/2;for(let L=0;L<x;L++){let $=_.tokens[2*L],W=L+1<x?_.tokens[2*L+2]:y.length;if($===W)continue;let be=_.tokens[2*L+1],Rt=X(r[re.getForeground(be)],s),It=re.getFontStyle(be),z={content:y.substring($,W),offset:k+$,color:Rt,fontStyle:It};if(l==="tokenType")z.type=re.getTokenType(be);else if(l){let In=[];if(l!=="scopeName")for(let V of n.settings){let ye;switch(typeof V.scope){case"string":ye=V.scope.split(Xs).map(Bt=>Bt.trim());break;case"object":ye=V.scope;break;default:continue}In.push({settings:V,selectors:ye.map(Bt=>Bt.split(Qs))})}z.explanation=[];let Bn=0;for(;$+Bn<W;){let V=b[w],ye=y.substring(V.startIndex,V.endIndex);Bn+=ye.length,z.explanation.push({content:ye,scopes:l==="scopeName"?Ks(V.scopes):Ys(In,V.scopes)}),w+=1}}d.push(z)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function Ks(e){return e.map(t=>({scopeName:t}))}function Ys(e,t){let n=[];for(let r=0,o=t.length;r<o;r++){let s=t[r];n[r]={scopeName:s,themeMatches:Zs(e,s,t.slice(0,r))}}return n}function ir(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function Js(e,t,n){if(!ir(e.at(-1),t))return!1;let r=e.length-2,o=n.length-1;for(;r>=0&&o>=0;)ir(e[r],n[o])&&(r-=1),o-=1;return r===-1}function Zs(e,t,n){let r=[];for(let{selectors:o,settings:s}of e)for(let a of o)if(Js(a,t,n)){r.push(s);break}return r}function rt(e,t,n,r=zt){let o=Object.entries(n.themes).filter(c=>c[1]).map(c=>({color:c[0],theme:c[1]})),s=o.map(c=>{let u=r(e,t,{...n,theme:c.theme});return{tokens:u,state:we(u),theme:typeof c.theme=="string"?c.theme:c.theme.name}}),a=ea(...s.map(c=>c.tokens)),i=a[0].map((c,u)=>c.map((d,f)=>{let g={content:d.content,variants:{},offset:d.offset};return"includeExplanation"in n&&n.includeExplanation&&(g.explanation=d.explanation),a.forEach((h,y)=>{let{content:k,explanation:m,offset:b,...w}=h[u][f];g.variants[o[y].color]=w}),g})),l=s[0].state?new nt(Object.fromEntries(s.map(c=>[c.theme,c.state?.getInternalStack(c.theme)])),s[0].state.lang):void 0;return l&&Ge(i,l),i}function ea(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let o=e.map(l=>l[r]),s=t.map(()=>[]);t.forEach((l,c)=>l.push(s[c]));let a=o.map(()=>0),i=o.map(l=>l[0]);for(;i.every(l=>l);){let l=Math.min(...i.map(c=>c.content.length));for(let c=0;c<n;c++){let u=i[c];u.content.length===l?(s[c].push(u),a[c]+=1,i[c]=o[c][a[c]]):(s[c].push({...u,content:u.content.slice(0,l)}),i[c]={...u,content:u.content.slice(l),offset:u.offset+l})}}}return t}var yr=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];var Q=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};Q.prototype.normal={};Q.prototype.property={};Q.prototype.space=void 0;function Vt(e,t){let n={},r={};for(let o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new Q(n,r,t)}function Oe(e){return e.toLowerCase()}var T=class{constructor(t,n){this.attribute=n,this.property=t}};T.prototype.attribute="";T.prototype.booleanish=!1;T.prototype.boolean=!1;T.prototype.commaOrSpaceSeparated=!1;T.prototype.commaSeparated=!1;T.prototype.defined=!1;T.prototype.mustUseProperty=!1;T.prototype.number=!1;T.prototype.overloadedBoolean=!1;T.prototype.property="";T.prototype.spaceSeparated=!1;T.prototype.space=void 0;var Fe={};Nt(Fe,{boolean:()=>C,booleanish:()=>A,commaOrSpaceSeparated:()=>G,commaSeparated:()=>K,number:()=>p,overloadedBoolean:()=>ot,spaceSeparated:()=>v});var ta=0,C=ce(),A=ce(),ot=ce(),p=ce(),v=ce(),K=ce(),G=ce();function ce(){return 2**++ta}var Xt=Object.keys(Fe),ue=class extends T{constructor(t,n,r,o){let s=-1;if(super(t,n),kr(this,"space",o),typeof r=="number")for(;++s<Xt.length;){let a=Xt[s];kr(this,Xt[s],(r&Fe[a])===Fe[a])}}};ue.prototype.defined=!0;function kr(e,t,n){n&&(e[t]=n)}function U(e){let t={},n={};for(let[r,o]of Object.entries(e.properties)){let s=new ue(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Oe(r)]=r,n[Oe(s.attribute)]=r}return new Q(t,n,e.space)}var Qt=U({properties:{ariaActiveDescendant:null,ariaAtomic:A,ariaAutoComplete:null,ariaBusy:A,ariaChecked:A,ariaColCount:p,ariaColIndex:p,ariaColSpan:p,ariaControls:v,ariaCurrent:null,ariaDescribedBy:v,ariaDetails:null,ariaDisabled:A,ariaDropEffect:v,ariaErrorMessage:null,ariaExpanded:A,ariaFlowTo:v,ariaGrabbed:A,ariaHasPopup:null,ariaHidden:A,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:v,ariaLevel:p,ariaLive:null,ariaModal:A,ariaMultiLine:A,ariaMultiSelectable:A,ariaOrientation:null,ariaOwns:v,ariaPlaceholder:null,ariaPosInSet:p,ariaPressed:A,ariaReadOnly:A,ariaRelevant:null,ariaRequired:A,ariaRoleDescription:v,ariaRowCount:p,ariaRowIndex:p,ariaRowSpan:p,ariaSelected:A,ariaSetSize:p,ariaSort:null,ariaValueMax:p,ariaValueMin:p,ariaValueNow:p,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function st(e,t){return t in e?e[t]:t}function at(e,t){return st(e,t.toLowerCase())}var wr=U({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:K,acceptCharset:v,accessKey:v,action:null,allow:null,allowFullScreen:C,allowPaymentRequest:C,allowUserMedia:C,alpha:C,alt:null,as:null,async:C,autoCapitalize:null,autoComplete:v,autoFocus:C,autoPlay:C,blocking:v,capture:null,charSet:null,checked:C,cite:null,className:v,closedBy:null,colorSpace:null,cols:p,colSpan:p,command:null,commandFor:null,content:null,contentEditable:A,controls:C,controlsList:v,coords:p|K,crossOrigin:null,data:null,dateTime:null,decoding:null,default:C,defer:C,dir:null,dirName:null,disabled:C,download:ot,draggable:A,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:C,formTarget:null,headers:v,height:p,hidden:ot,high:p,href:null,hrefLang:null,htmlFor:v,httpEquiv:v,id:null,imageSizes:null,imageSrcSet:null,inert:C,inputMode:null,integrity:null,is:null,isMap:C,itemId:null,itemProp:v,itemRef:v,itemScope:C,itemType:v,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:C,low:p,manifest:null,max:null,maxLength:p,media:null,method:null,min:null,minLength:p,multiple:C,muted:C,name:null,nonce:null,noModule:C,noValidate:C,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:C,optimum:p,pattern:null,ping:v,placeholder:null,playsInline:C,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:C,referrerPolicy:null,rel:v,required:C,reversed:C,rows:p,rowSpan:p,sandbox:v,scope:null,scoped:C,seamless:C,selected:C,shadowRootClonable:C,shadowRootCustomElementRegistry:C,shadowRootDelegatesFocus:C,shadowRootMode:null,shadowRootSerializable:C,shape:null,size:p,sizes:null,slot:null,span:p,spellCheck:A,src:null,srcDoc:null,srcLang:null,srcSet:null,start:p,step:null,style:null,tabIndex:p,target:null,title:null,translate:null,type:null,typeMustMatch:C,useMap:null,value:A,width:p,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:v,axis:null,background:null,bgColor:null,border:p,borderColor:null,bottomMargin:p,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:C,declare:C,event:null,face:null,frame:null,frameBorder:null,hSpace:p,leftMargin:p,link:null,longDesc:null,lowSrc:null,marginHeight:p,marginWidth:p,noResize:C,noHref:C,noShade:C,noWrap:C,object:null,profile:null,prompt:null,rev:null,rightMargin:p,rules:null,scheme:null,scrolling:A,standby:null,summary:null,text:null,topMargin:p,valueType:null,version:null,vAlign:null,vLink:null,vSpace:p,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:C,disablePictureInPicture:C,disableRemotePlayback:C,exportParts:K,part:v,prefix:null,property:null,results:p,security:null,unselectable:null},space:"html",transform:at});var Cr=U({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",maskType:"mask-type",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:G,accentHeight:p,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:p,amplitude:p,arabicForm:null,ascent:p,attributeName:null,attributeType:null,azimuth:p,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:p,by:null,calcMode:null,capHeight:p,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:p,diffuseConstant:p,direction:null,display:null,dur:null,divisor:p,dominantBaseline:null,download:C,dx:null,dy:null,edgeMode:null,editable:null,elevation:p,enableBackground:null,end:null,event:null,exponent:p,externalResourcesRequired:null,fill:null,fillOpacity:p,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:K,g2:K,glyphName:K,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:p,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:p,horizOriginX:p,horizOriginY:p,id:null,ideographic:p,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:p,k:p,k1:p,k2:p,k3:p,k4:p,kernelMatrix:G,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:p,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:p,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:p,overlineThickness:p,paintOrder:null,panose1:null,path:null,pathLength:p,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:v,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:p,pointsAtY:p,pointsAtZ:p,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:G,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:G,rev:G,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:G,requiredFeatures:G,requiredFonts:G,requiredFormats:G,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:p,specularExponent:p,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:p,strikethroughThickness:p,string:null,stroke:null,strokeDashArray:G,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:p,strokeOpacity:p,strokeWidth:null,style:null,surfaceScale:p,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:G,tabIndex:p,tableValues:null,target:null,targetX:p,targetY:p,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:G,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:p,underlineThickness:p,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:p,values:null,vAlphabetic:p,vMathematical:p,vectorEffect:null,vHanging:p,vIdeographic:p,version:null,vertAdvY:p,vertOriginX:p,vertOriginY:p,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:p,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:st});var Kt=U({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}});var Yt=U({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:at});var Jt=U({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}});var na=/[A-Z]/g,Sr=/-[a-z]/g,ra=/^data[-\w.:]+$/i;function Zt(e,t){let n=Oe(t),r=t,o=T;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&ra.test(t)){if(t.charAt(4)==="-"){let s=t.slice(5).replace(Sr,sa);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{let s=t.slice(4);if(!Sr.test(s)){let a=s.replace(na,oa);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}o=ue}return new o(r,t)}function oa(e){return"-"+e.toLowerCase()}function sa(e){return e.charAt(1).toUpperCase()}var it=Vt([Qt,wr,Kt,Yt,Jt],"html"),lt=Vt([Qt,Cr,Kt,Yt,Jt],"svg");var _r={}.hasOwnProperty;function vr(e,t){let n=t||{};function r(o,...s){let a=r.invalid,i=r.handlers;if(o&&_r.call(o,e)){let l=String(o[e]);a=_r.call(i,l)?i[l]:r.unknown}if(a)return a.call(this,o,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var aa=/["&'<>`]/g,ia=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,la=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,ca=/[|\\{}()[\]^$+*?.]/g,xr=new WeakMap;function Er(e,t){if(e=e.replace(t.subset?ua(t.subset):aa,r),t.subset||t.escapeOnly)return e;return e.replace(ia,n).replace(la,r);function n(o,s,a){return t.format((o.charCodeAt(0)-55296)*1024+o.charCodeAt(1)-56320+65536,a.charCodeAt(s+2),t)}function r(o,s,a){return t.format(o.charCodeAt(0),a.charCodeAt(s+1),t)}}function ua(e){let t=xr.get(e);return t||(t=da(e),xr.set(e,t)),t}function da(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(ca,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}var fa=/[\dA-Fa-f]/;function Ar(e,t,n){let r="&#x"+e.toString(16).toUpperCase();return n&&t&&!fa.test(String.fromCharCode(t))?r:r+";"}var ga=/\d/;function Rr(e,t,n){let r="&#"+String(e);return n&&t&&!ga.test(String.fromCharCode(t))?r:r+";"}var Ir=["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"];var ct={nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",fnof:"\u0192",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",bull:"\u2022",hellip:"\u2026",prime:"\u2032",Prime:"\u2033",oline:"\u203E",frasl:"\u2044",weierp:"\u2118",image:"\u2111",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666",quot:'"',amp:"&",lt:"<",gt:">",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",circ:"\u02C6",tilde:"\u02DC",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",permil:"\u2030",lsaquo:"\u2039",rsaquo:"\u203A",euro:"\u20AC"};var Br=["cent","copy","divide","gt","lt","not","para","times"];var Nr={}.hasOwnProperty,en={},ut;for(ut in ct)Nr.call(ct,ut)&&(en[ct[ut]]=ut);var ha=/[^\dA-Za-z]/;function Tr(e,t,n,r){let o=String.fromCharCode(e);if(Nr.call(en,o)){let s=en[o],a="&"+s;return n&&Ir.includes(s)&&!Br.includes(s)&&(!r||t&&t!==61&&ha.test(String.fromCharCode(t)))?a:a+";"}return""}function Lr(e,t,n){let r=Ar(e,t,n.omitOptionalSemicolons),o;if((n.useNamedReferences||n.useShortestReferences)&&(o=Tr(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!o)&&n.useShortestReferences){let s=Rr(e,t,n.omitOptionalSemicolons);s.length<r.length&&(r=s)}return o&&(!n.useShortestReferences||o.length<r.length)?o:r}function Y(e,t){return Er(e,Object.assign({format:Lr},t))}var pa=/^>|^->|<!--|-->|--!>|<!-$/g,ma=[">"],ba=["<",">"];function Pr(e,t,n,r){return r.settings.bogusComments?"<?"+Y(e.value,Object.assign({},r.settings.characterReferences,{subset:ma}))+">":"<!--"+e.value.replace(pa,o)+"-->";function o(s){return Y(s,Object.assign({},r.settings.characterReferences,{subset:ba}))}}function Mr(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function tn(e,t){let n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,o=n.indexOf(t);for(;o!==-1;)r++,o=n.indexOf(t,o+t.length);return r}function $r(e,t){let n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Gr(e){return e.join(" ").trim()}var ya=/[ \t\n\f\r]/g;function de(e){return typeof e=="object"?e.type==="text"?Or(e.value):!1:Or(e)}function Or(e){return e.replace(ya,"")===""}var R=Fr(1),nn=Fr(-1),ka=[];function Fr(e){return t;function t(n,r,o){let s=n?n.children:ka,a=(r||0)+e,i=s[a];if(!o)for(;i&&de(i);)a+=e,i=s[a];return i}}var wa={}.hasOwnProperty;function dt(e){return t;function t(n,r,o){return wa.call(e,n.tagName)&&e[n.tagName](n,r,o)}}var De=dt({body:Sa,caption:rn,colgroup:rn,dd:Ea,dt:xa,head:rn,html:Ca,li:va,optgroup:Aa,option:Ra,p:_a,rp:Dr,rt:Dr,tbody:Ba,td:Ur,tfoot:Na,th:Ur,thead:Ia,tr:Ta});function rn(e,t,n){let r=R(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&de(r.value.charAt(0)))}function Ca(e,t,n){let r=R(n,t);return!r||r.type!=="comment"}function Sa(e,t,n){let r=R(n,t);return!r||r.type!=="comment"}function _a(e,t,n){let r=R(n,t);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"||n.tagName.includes("-")))}function va(e,t,n){let r=R(n,t);return!r||r.type==="element"&&r.tagName==="li"}function xa(e,t,n){let r=R(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Ea(e,t,n){let r=R(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function Dr(e,t,n){let r=R(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Aa(e,t,n){let r=R(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function Ra(e,t,n){let r=R(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function Ia(e,t,n){let r=R(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Ba(e,t,n){let r=R(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Na(e,t,n){return!R(n,t)}function Ta(e,t,n){let r=R(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function Ur(e,t,n){let r=R(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}var Hr=dt({body:Ma,colgroup:$a,head:Pa,html:La,tbody:Ga});function La(e){let t=R(e,-1);return!t||t.type!=="comment"}function Pa(e){let t=new Set;for(let r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}let n=e.children[0];return!n||n.type==="element"}function Ma(e){let t=R(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&de(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function $a(e,t,n){let r=nn(n,t);if(n&&r&&r.type==="element"&&r.tagName==="colgroup"&&De(r,n.children.indexOf(r),n))return!1;let o=R(e,-1,!0);return!!(o&&o.type==="element"&&o.tagName==="col")}function Ga(e,t,n){let r=nn(n,t);if(n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&De(r,n.children.indexOf(r),n))return!1;let o=R(e,-1);return!!(o&&o.type==="element"&&o.tagName==="tr")}var ft={name:[[`
1
+ "use strict";(()=>{var os=Object.defineProperty;var Nn=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(r){throw n=[r],r}};var Nt=(e,t)=>{for(var n in t)os(e,n,{get:t[n],enumerable:!0})};var Yo={};Nt(Yo,{default:()=>Yl});var Yl,Zo=Nn(()=>{Yl=Object.freeze(JSON.parse('{"colors":{"activityBar.activeBorder":"#f9826c","activityBar.background":"#fff","activityBar.border":"#e1e4e8","activityBar.foreground":"#2f363d","activityBar.inactiveForeground":"#959da5","activityBarBadge.background":"#2188ff","activityBarBadge.foreground":"#fff","badge.background":"#dbedff","badge.foreground":"#005cc5","breadcrumb.activeSelectionForeground":"#586069","breadcrumb.focusForeground":"#2f363d","breadcrumb.foreground":"#6a737d","breadcrumbPicker.background":"#fafbfc","button.background":"#159739","button.foreground":"#fff","button.hoverBackground":"#138934","button.secondaryBackground":"#e1e4e8","button.secondaryForeground":"#1b1f23","button.secondaryHoverBackground":"#d1d5da","checkbox.background":"#fafbfc","checkbox.border":"#d1d5da","debugToolBar.background":"#fff","descriptionForeground":"#6a737d","diffEditor.insertedTextBackground":"#34d05822","diffEditor.removedTextBackground":"#d73a4922","dropdown.background":"#fafbfc","dropdown.border":"#e1e4e8","dropdown.foreground":"#2f363d","dropdown.listBackground":"#fff","editor.background":"#fff","editor.findMatchBackground":"#ffdf5d","editor.findMatchHighlightBackground":"#ffdf5d66","editor.focusedStackFrameHighlightBackground":"#28a74525","editor.foldBackground":"#d1d5da11","editor.foreground":"#24292e","editor.inactiveSelectionBackground":"#0366d611","editor.lineHighlightBackground":"#f6f8fa","editor.linkedEditingBackground":"#0366d611","editor.selectionBackground":"#0366d625","editor.selectionHighlightBackground":"#34d05840","editor.selectionHighlightBorder":"#34d05800","editor.stackFrameHighlightBackground":"#ffd33d33","editor.wordHighlightBackground":"#34d05800","editor.wordHighlightBorder":"#24943e99","editor.wordHighlightStrongBackground":"#34d05800","editor.wordHighlightStrongBorder":"#24943e50","editorBracketHighlight.foreground1":"#005cc5","editorBracketHighlight.foreground2":"#e36209","editorBracketHighlight.foreground3":"#5a32a3","editorBracketHighlight.foreground4":"#005cc5","editorBracketHighlight.foreground5":"#e36209","editorBracketHighlight.foreground6":"#5a32a3","editorBracketMatch.background":"#34d05840","editorBracketMatch.border":"#34d05800","editorCursor.foreground":"#044289","editorError.foreground":"#cb2431","editorGroup.border":"#e1e4e8","editorGroupHeader.tabsBackground":"#f6f8fa","editorGroupHeader.tabsBorder":"#e1e4e8","editorGutter.addedBackground":"#28a745","editorGutter.deletedBackground":"#d73a49","editorGutter.modifiedBackground":"#2188ff","editorIndentGuide.activeBackground":"#d7dbe0","editorIndentGuide.background":"#eff2f6","editorLineNumber.activeForeground":"#24292e","editorLineNumber.foreground":"#1b1f234d","editorOverviewRuler.border":"#fff","editorWarning.foreground":"#f9c513","editorWhitespace.foreground":"#d1d5da","editorWidget.background":"#f6f8fa","errorForeground":"#cb2431","focusBorder":"#2188ff","foreground":"#444d56","gitDecoration.addedResourceForeground":"#28a745","gitDecoration.conflictingResourceForeground":"#e36209","gitDecoration.deletedResourceForeground":"#d73a49","gitDecoration.ignoredResourceForeground":"#959da5","gitDecoration.modifiedResourceForeground":"#005cc5","gitDecoration.submoduleResourceForeground":"#959da5","gitDecoration.untrackedResourceForeground":"#28a745","input.background":"#fafbfc","input.border":"#e1e4e8","input.foreground":"#2f363d","input.placeholderForeground":"#959da5","list.activeSelectionBackground":"#e2e5e9","list.activeSelectionForeground":"#2f363d","list.focusBackground":"#cce5ff","list.hoverBackground":"#ebf0f4","list.hoverForeground":"#2f363d","list.inactiveFocusBackground":"#dbedff","list.inactiveSelectionBackground":"#e8eaed","list.inactiveSelectionForeground":"#2f363d","notificationCenterHeader.background":"#e1e4e8","notificationCenterHeader.foreground":"#6a737d","notifications.background":"#fafbfc","notifications.border":"#e1e4e8","notifications.foreground":"#2f363d","notificationsErrorIcon.foreground":"#d73a49","notificationsInfoIcon.foreground":"#005cc5","notificationsWarningIcon.foreground":"#e36209","panel.background":"#f6f8fa","panel.border":"#e1e4e8","panelInput.border":"#e1e4e8","panelTitle.activeBorder":"#f9826c","panelTitle.activeForeground":"#2f363d","panelTitle.inactiveForeground":"#6a737d","pickerGroup.border":"#e1e4e8","pickerGroup.foreground":"#2f363d","progressBar.background":"#2188ff","quickInput.background":"#fafbfc","quickInput.foreground":"#2f363d","scrollbar.shadow":"#6a737d33","scrollbarSlider.activeBackground":"#959da588","scrollbarSlider.background":"#959da533","scrollbarSlider.hoverBackground":"#959da544","settings.headerForeground":"#2f363d","settings.modifiedItemIndicator":"#2188ff","sideBar.background":"#f6f8fa","sideBar.border":"#e1e4e8","sideBar.foreground":"#586069","sideBarSectionHeader.background":"#f6f8fa","sideBarSectionHeader.border":"#e1e4e8","sideBarSectionHeader.foreground":"#2f363d","sideBarTitle.foreground":"#2f363d","statusBar.background":"#fff","statusBar.border":"#e1e4e8","statusBar.debuggingBackground":"#f9826c","statusBar.debuggingForeground":"#fff","statusBar.foreground":"#586069","statusBar.noFolderBackground":"#fff","statusBarItem.prominentBackground":"#e8eaed","statusBarItem.remoteBackground":"#fff","statusBarItem.remoteForeground":"#586069","tab.activeBackground":"#fff","tab.activeBorder":"#fff","tab.activeBorderTop":"#f9826c","tab.activeForeground":"#2f363d","tab.border":"#e1e4e8","tab.hoverBackground":"#fff","tab.inactiveBackground":"#f6f8fa","tab.inactiveForeground":"#6a737d","tab.unfocusedActiveBorder":"#fff","tab.unfocusedActiveBorderTop":"#e1e4e8","tab.unfocusedHoverBackground":"#fff","terminal.ansiBlack":"#24292e","terminal.ansiBlue":"#0366d6","terminal.ansiBrightBlack":"#959da5","terminal.ansiBrightBlue":"#005cc5","terminal.ansiBrightCyan":"#3192aa","terminal.ansiBrightGreen":"#22863a","terminal.ansiBrightMagenta":"#5a32a3","terminal.ansiBrightRed":"#cb2431","terminal.ansiBrightWhite":"#d1d5da","terminal.ansiBrightYellow":"#b08800","terminal.ansiCyan":"#1b7c83","terminal.ansiGreen":"#28a745","terminal.ansiMagenta":"#5a32a3","terminal.ansiRed":"#d73a49","terminal.ansiWhite":"#6a737d","terminal.ansiYellow":"#dbab09","terminal.foreground":"#586069","terminal.tab.activeBorder":"#f9826c","terminalCursor.background":"#d1d5da","terminalCursor.foreground":"#005cc5","textBlockQuote.background":"#fafbfc","textBlockQuote.border":"#e1e4e8","textCodeBlock.background":"#f6f8fa","textLink.activeForeground":"#005cc5","textLink.foreground":"#0366d6","textPreformat.foreground":"#586069","textSeparator.foreground":"#d1d5da","titleBar.activeBackground":"#fff","titleBar.activeForeground":"#2f363d","titleBar.border":"#e1e4e8","titleBar.inactiveBackground":"#f6f8fa","titleBar.inactiveForeground":"#6a737d","tree.indentGuidesStroke":"#e1e4e8","welcomePage.buttonBackground":"#f6f8fa","welcomePage.buttonHoverBackground":"#e1e4e8"},"displayName":"GitHub Light","name":"github-light","semanticHighlighting":true,"tokenColors":[{"scope":["comment","punctuation.definition.comment","string.comment"],"settings":{"foreground":"#6a737d"}},{"scope":["constant","entity.name.constant","variable.other.constant","variable.other.enummember","variable.language"],"settings":{"foreground":"#005cc5"}},{"scope":["entity","entity.name"],"settings":{"foreground":"#6f42c1"}},{"scope":"variable.parameter.function","settings":{"foreground":"#24292e"}},{"scope":"entity.name.tag","settings":{"foreground":"#22863a"}},{"scope":"keyword","settings":{"foreground":"#d73a49"}},{"scope":["storage","storage.type"],"settings":{"foreground":"#d73a49"}},{"scope":["storage.modifier.package","storage.modifier.import","storage.type.java"],"settings":{"foreground":"#24292e"}},{"scope":["string","punctuation.definition.string","string punctuation.section.embedded source"],"settings":{"foreground":"#032f62"}},{"scope":"support","settings":{"foreground":"#005cc5"}},{"scope":"meta.property-name","settings":{"foreground":"#005cc5"}},{"scope":"variable","settings":{"foreground":"#e36209"}},{"scope":"variable.other","settings":{"foreground":"#24292e"}},{"scope":"invalid.broken","settings":{"fontStyle":"italic","foreground":"#b31d28"}},{"scope":"invalid.deprecated","settings":{"fontStyle":"italic","foreground":"#b31d28"}},{"scope":"invalid.illegal","settings":{"fontStyle":"italic","foreground":"#b31d28"}},{"scope":"invalid.unimplemented","settings":{"fontStyle":"italic","foreground":"#b31d28"}},{"scope":"carriage-return","settings":{"background":"#d73a49","content":"^M","fontStyle":"italic underline","foreground":"#fafbfc"}},{"scope":"message.error","settings":{"foreground":"#b31d28"}},{"scope":"string variable","settings":{"foreground":"#005cc5"}},{"scope":["source.regexp","string.regexp"],"settings":{"foreground":"#032f62"}},{"scope":["string.regexp.character-class","string.regexp constant.character.escape","string.regexp source.ruby.embedded","string.regexp string.regexp.arbitrary-repitition"],"settings":{"foreground":"#032f62"}},{"scope":"string.regexp constant.character.escape","settings":{"fontStyle":"bold","foreground":"#22863a"}},{"scope":"support.constant","settings":{"foreground":"#005cc5"}},{"scope":"support.variable","settings":{"foreground":"#005cc5"}},{"scope":"meta.module-reference","settings":{"foreground":"#005cc5"}},{"scope":"punctuation.definition.list.begin.markdown","settings":{"foreground":"#e36209"}},{"scope":["markup.heading","markup.heading entity.name"],"settings":{"fontStyle":"bold","foreground":"#005cc5"}},{"scope":"markup.quote","settings":{"foreground":"#22863a"}},{"scope":"markup.italic","settings":{"fontStyle":"italic","foreground":"#24292e"}},{"scope":"markup.bold","settings":{"fontStyle":"bold","foreground":"#24292e"}},{"scope":["markup.underline"],"settings":{"fontStyle":"underline"}},{"scope":["markup.strikethrough"],"settings":{"fontStyle":"strikethrough"}},{"scope":"markup.inline.raw","settings":{"foreground":"#005cc5"}},{"scope":["markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted"],"settings":{"background":"#ffeef0","foreground":"#b31d28"}},{"scope":["markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted"],"settings":{"background":"#f0fff4","foreground":"#22863a"}},{"scope":["markup.changed","punctuation.definition.changed"],"settings":{"background":"#ffebda","foreground":"#e36209"}},{"scope":["markup.ignored","markup.untracked"],"settings":{"background":"#005cc5","foreground":"#f6f8fa"}},{"scope":"meta.diff.range","settings":{"fontStyle":"bold","foreground":"#6f42c1"}},{"scope":"meta.diff.header","settings":{"foreground":"#005cc5"}},{"scope":"meta.separator","settings":{"fontStyle":"bold","foreground":"#005cc5"}},{"scope":"meta.output","settings":{"foreground":"#005cc5"}},{"scope":["brackethighlighter.tag","brackethighlighter.curly","brackethighlighter.round","brackethighlighter.square","brackethighlighter.angle","brackethighlighter.quote"],"settings":{"foreground":"#586069"}},{"scope":"brackethighlighter.unmatched","settings":{"foreground":"#b31d28"}},{"scope":["constant.other.reference.link","string.other.link"],"settings":{"fontStyle":"underline","foreground":"#032f62"}}],"type":"light"}'))});var es={};Nt(es,{default:()=>Zl});var Zl,ts=Nn(()=>{Zl=Object.freeze(JSON.parse('{"colors":{"activityBar.activeBorder":"#f9826c","activityBar.background":"#24292e","activityBar.border":"#1b1f23","activityBar.foreground":"#e1e4e8","activityBar.inactiveForeground":"#6a737d","activityBarBadge.background":"#0366d6","activityBarBadge.foreground":"#fff","badge.background":"#044289","badge.foreground":"#c8e1ff","breadcrumb.activeSelectionForeground":"#d1d5da","breadcrumb.focusForeground":"#e1e4e8","breadcrumb.foreground":"#959da5","breadcrumbPicker.background":"#2b3036","button.background":"#176f2c","button.foreground":"#dcffe4","button.hoverBackground":"#22863a","button.secondaryBackground":"#444d56","button.secondaryForeground":"#fff","button.secondaryHoverBackground":"#586069","checkbox.background":"#444d56","checkbox.border":"#1b1f23","debugToolBar.background":"#2b3036","descriptionForeground":"#959da5","diffEditor.insertedTextBackground":"#28a74530","diffEditor.removedTextBackground":"#d73a4930","dropdown.background":"#2f363d","dropdown.border":"#1b1f23","dropdown.foreground":"#e1e4e8","dropdown.listBackground":"#24292e","editor.background":"#24292e","editor.findMatchBackground":"#ffd33d44","editor.findMatchHighlightBackground":"#ffd33d22","editor.focusedStackFrameHighlightBackground":"#2b6a3033","editor.foldBackground":"#58606915","editor.foreground":"#e1e4e8","editor.inactiveSelectionBackground":"#3392FF22","editor.lineHighlightBackground":"#2b3036","editor.linkedEditingBackground":"#3392FF22","editor.selectionBackground":"#3392FF44","editor.selectionHighlightBackground":"#17E5E633","editor.selectionHighlightBorder":"#17E5E600","editor.stackFrameHighlightBackground":"#C6902625","editor.wordHighlightBackground":"#17E5E600","editor.wordHighlightBorder":"#17E5E699","editor.wordHighlightStrongBackground":"#17E5E600","editor.wordHighlightStrongBorder":"#17E5E666","editorBracketHighlight.foreground1":"#79b8ff","editorBracketHighlight.foreground2":"#ffab70","editorBracketHighlight.foreground3":"#b392f0","editorBracketHighlight.foreground4":"#79b8ff","editorBracketHighlight.foreground5":"#ffab70","editorBracketHighlight.foreground6":"#b392f0","editorBracketMatch.background":"#17E5E650","editorBracketMatch.border":"#17E5E600","editorCursor.foreground":"#c8e1ff","editorError.foreground":"#f97583","editorGroup.border":"#1b1f23","editorGroupHeader.tabsBackground":"#1f2428","editorGroupHeader.tabsBorder":"#1b1f23","editorGutter.addedBackground":"#28a745","editorGutter.deletedBackground":"#ea4a5a","editorGutter.modifiedBackground":"#2188ff","editorIndentGuide.activeBackground":"#444d56","editorIndentGuide.background":"#2f363d","editorLineNumber.activeForeground":"#e1e4e8","editorLineNumber.foreground":"#444d56","editorOverviewRuler.border":"#1b1f23","editorWarning.foreground":"#ffea7f","editorWhitespace.foreground":"#444d56","editorWidget.background":"#1f2428","errorForeground":"#f97583","focusBorder":"#005cc5","foreground":"#d1d5da","gitDecoration.addedResourceForeground":"#34d058","gitDecoration.conflictingResourceForeground":"#ffab70","gitDecoration.deletedResourceForeground":"#ea4a5a","gitDecoration.ignoredResourceForeground":"#6a737d","gitDecoration.modifiedResourceForeground":"#79b8ff","gitDecoration.submoduleResourceForeground":"#6a737d","gitDecoration.untrackedResourceForeground":"#34d058","input.background":"#2f363d","input.border":"#1b1f23","input.foreground":"#e1e4e8","input.placeholderForeground":"#959da5","list.activeSelectionBackground":"#39414a","list.activeSelectionForeground":"#e1e4e8","list.focusBackground":"#044289","list.hoverBackground":"#282e34","list.hoverForeground":"#e1e4e8","list.inactiveFocusBackground":"#1d2d3e","list.inactiveSelectionBackground":"#282e34","list.inactiveSelectionForeground":"#e1e4e8","notificationCenterHeader.background":"#24292e","notificationCenterHeader.foreground":"#959da5","notifications.background":"#2f363d","notifications.border":"#1b1f23","notifications.foreground":"#e1e4e8","notificationsErrorIcon.foreground":"#ea4a5a","notificationsInfoIcon.foreground":"#79b8ff","notificationsWarningIcon.foreground":"#ffab70","panel.background":"#1f2428","panel.border":"#1b1f23","panelInput.border":"#2f363d","panelTitle.activeBorder":"#f9826c","panelTitle.activeForeground":"#e1e4e8","panelTitle.inactiveForeground":"#959da5","peekViewEditor.background":"#1f242888","peekViewEditor.matchHighlightBackground":"#ffd33d33","peekViewResult.background":"#1f2428","peekViewResult.matchHighlightBackground":"#ffd33d33","pickerGroup.border":"#444d56","pickerGroup.foreground":"#e1e4e8","progressBar.background":"#0366d6","quickInput.background":"#24292e","quickInput.foreground":"#e1e4e8","scrollbar.shadow":"#0008","scrollbarSlider.activeBackground":"#6a737d88","scrollbarSlider.background":"#6a737d33","scrollbarSlider.hoverBackground":"#6a737d44","settings.headerForeground":"#e1e4e8","settings.modifiedItemIndicator":"#0366d6","sideBar.background":"#1f2428","sideBar.border":"#1b1f23","sideBar.foreground":"#d1d5da","sideBarSectionHeader.background":"#1f2428","sideBarSectionHeader.border":"#1b1f23","sideBarSectionHeader.foreground":"#e1e4e8","sideBarTitle.foreground":"#e1e4e8","statusBar.background":"#24292e","statusBar.border":"#1b1f23","statusBar.debuggingBackground":"#931c06","statusBar.debuggingForeground":"#fff","statusBar.foreground":"#d1d5da","statusBar.noFolderBackground":"#24292e","statusBarItem.prominentBackground":"#282e34","statusBarItem.remoteBackground":"#24292e","statusBarItem.remoteForeground":"#d1d5da","tab.activeBackground":"#24292e","tab.activeBorder":"#24292e","tab.activeBorderTop":"#f9826c","tab.activeForeground":"#e1e4e8","tab.border":"#1b1f23","tab.hoverBackground":"#24292e","tab.inactiveBackground":"#1f2428","tab.inactiveForeground":"#959da5","tab.unfocusedActiveBorder":"#24292e","tab.unfocusedActiveBorderTop":"#1b1f23","tab.unfocusedHoverBackground":"#24292e","terminal.ansiBlack":"#586069","terminal.ansiBlue":"#2188ff","terminal.ansiBrightBlack":"#959da5","terminal.ansiBrightBlue":"#79b8ff","terminal.ansiBrightCyan":"#56d4dd","terminal.ansiBrightGreen":"#85e89d","terminal.ansiBrightMagenta":"#b392f0","terminal.ansiBrightRed":"#f97583","terminal.ansiBrightWhite":"#fafbfc","terminal.ansiBrightYellow":"#ffea7f","terminal.ansiCyan":"#39c5cf","terminal.ansiGreen":"#34d058","terminal.ansiMagenta":"#b392f0","terminal.ansiRed":"#ea4a5a","terminal.ansiWhite":"#d1d5da","terminal.ansiYellow":"#ffea7f","terminal.foreground":"#d1d5da","terminal.tab.activeBorder":"#f9826c","terminalCursor.background":"#586069","terminalCursor.foreground":"#79b8ff","textBlockQuote.background":"#24292e","textBlockQuote.border":"#444d56","textCodeBlock.background":"#2f363d","textLink.activeForeground":"#c8e1ff","textLink.foreground":"#79b8ff","textPreformat.foreground":"#d1d5da","textSeparator.foreground":"#586069","titleBar.activeBackground":"#24292e","titleBar.activeForeground":"#e1e4e8","titleBar.border":"#1b1f23","titleBar.inactiveBackground":"#1f2428","titleBar.inactiveForeground":"#959da5","tree.indentGuidesStroke":"#2f363d","welcomePage.buttonBackground":"#2f363d","welcomePage.buttonHoverBackground":"#444d56"},"displayName":"GitHub Dark","name":"github-dark","semanticHighlighting":true,"tokenColors":[{"scope":["comment","punctuation.definition.comment","string.comment"],"settings":{"foreground":"#6a737d"}},{"scope":["constant","entity.name.constant","variable.other.constant","variable.other.enummember","variable.language"],"settings":{"foreground":"#79b8ff"}},{"scope":["entity","entity.name"],"settings":{"foreground":"#b392f0"}},{"scope":"variable.parameter.function","settings":{"foreground":"#e1e4e8"}},{"scope":"entity.name.tag","settings":{"foreground":"#85e89d"}},{"scope":"keyword","settings":{"foreground":"#f97583"}},{"scope":["storage","storage.type"],"settings":{"foreground":"#f97583"}},{"scope":["storage.modifier.package","storage.modifier.import","storage.type.java"],"settings":{"foreground":"#e1e4e8"}},{"scope":["string","punctuation.definition.string","string punctuation.section.embedded source"],"settings":{"foreground":"#9ecbff"}},{"scope":"support","settings":{"foreground":"#79b8ff"}},{"scope":"meta.property-name","settings":{"foreground":"#79b8ff"}},{"scope":"variable","settings":{"foreground":"#ffab70"}},{"scope":"variable.other","settings":{"foreground":"#e1e4e8"}},{"scope":"invalid.broken","settings":{"fontStyle":"italic","foreground":"#fdaeb7"}},{"scope":"invalid.deprecated","settings":{"fontStyle":"italic","foreground":"#fdaeb7"}},{"scope":"invalid.illegal","settings":{"fontStyle":"italic","foreground":"#fdaeb7"}},{"scope":"invalid.unimplemented","settings":{"fontStyle":"italic","foreground":"#fdaeb7"}},{"scope":"carriage-return","settings":{"background":"#f97583","content":"^M","fontStyle":"italic underline","foreground":"#24292e"}},{"scope":"message.error","settings":{"foreground":"#fdaeb7"}},{"scope":"string variable","settings":{"foreground":"#79b8ff"}},{"scope":["source.regexp","string.regexp"],"settings":{"foreground":"#dbedff"}},{"scope":["string.regexp.character-class","string.regexp constant.character.escape","string.regexp source.ruby.embedded","string.regexp string.regexp.arbitrary-repitition"],"settings":{"foreground":"#dbedff"}},{"scope":"string.regexp constant.character.escape","settings":{"fontStyle":"bold","foreground":"#85e89d"}},{"scope":"support.constant","settings":{"foreground":"#79b8ff"}},{"scope":"support.variable","settings":{"foreground":"#79b8ff"}},{"scope":"meta.module-reference","settings":{"foreground":"#79b8ff"}},{"scope":"punctuation.definition.list.begin.markdown","settings":{"foreground":"#ffab70"}},{"scope":["markup.heading","markup.heading entity.name"],"settings":{"fontStyle":"bold","foreground":"#79b8ff"}},{"scope":"markup.quote","settings":{"foreground":"#85e89d"}},{"scope":"markup.italic","settings":{"fontStyle":"italic","foreground":"#e1e4e8"}},{"scope":"markup.bold","settings":{"fontStyle":"bold","foreground":"#e1e4e8"}},{"scope":["markup.underline"],"settings":{"fontStyle":"underline"}},{"scope":["markup.strikethrough"],"settings":{"fontStyle":"strikethrough"}},{"scope":"markup.inline.raw","settings":{"foreground":"#79b8ff"}},{"scope":["markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted"],"settings":{"background":"#86181d","foreground":"#fdaeb7"}},{"scope":["markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted"],"settings":{"background":"#144620","foreground":"#85e89d"}},{"scope":["markup.changed","punctuation.definition.changed"],"settings":{"background":"#c24e00","foreground":"#ffab70"}},{"scope":["markup.ignored","markup.untracked"],"settings":{"background":"#79b8ff","foreground":"#2f363d"}},{"scope":"meta.diff.range","settings":{"fontStyle":"bold","foreground":"#b392f0"}},{"scope":"meta.diff.header","settings":{"foreground":"#79b8ff"}},{"scope":"meta.separator","settings":{"fontStyle":"bold","foreground":"#79b8ff"}},{"scope":"meta.output","settings":{"foreground":"#79b8ff"}},{"scope":["brackethighlighter.tag","brackethighlighter.curly","brackethighlighter.round","brackethighlighter.square","brackethighlighter.angle","brackethighlighter.quote"],"settings":{"foreground":"#d1d5da"}},{"scope":"brackethighlighter.unmatched","settings":{"foreground":"#fdaeb7"}},{"scope":["constant.other.reference.link","string.other.link"],"settings":{"fontStyle":"underline","foreground":"#dbedff"}}],"type":"dark"}'))});var E=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function ss(e){return Ut(e)}function Ut(e){return Array.isArray(e)?as(e):e instanceof RegExp?e:typeof e=="object"?is(e):e}function as(e){let t=[];for(let n=0,r=e.length;n<r;n++)t[n]=Ut(e[n]);return t}function is(e){let t={};for(let n in e)t[n]=Ut(e[n]);return t}function Dn(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function Un(e){let t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?Un(e.substring(0,e.length-1)):e.substr(~t+1)}var Tt=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Ve=class{static hasCaptures(e){return e===null?!1:(Tt.lastIndex=0,Tt.test(e))}static replaceCaptures(e,t,n){return e.replace(Tt,(r,o,s,a)=>{let i=n[parseInt(o||s,10)];if(i){let l=t.substring(i.start,i.end);for(;l[0]===".";)l=l.substring(1);switch(a){case"downcase":return l.toLowerCase();case"upcase":return l.toUpperCase();default:return l}}else return r})}};function Hn(e,t){return e<t?-1:e>t?1:0}function jn(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let o=0;o<n;o++){let s=Hn(e[o],t[o]);if(s!==0)return s}return 0}return n-r}function Tn(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function Wn(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var zn=class{constructor(e){this.fn=e}fn;cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);let t=this.fn(e);return this.cache.set(e,t),t}},Ae=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}_colorMap;_defaults;_root;static createFromRawTheme(e,t){return this.createFromParsedTheme(us(e),t)}static createFromParsedTheme(e,t){return fs(e,t)}_cachedMatchRoot=new zn(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;let t=e.scopeName,r=this._cachedMatchRoot.get(t).find(o=>ls(e.parent,o.parentScopes));return r?new qn(r.fontStyle,r.foreground,r.background):null}},Lt=class Xe{constructor(t,n){this.parent=t,this.scopeName=n}parent;scopeName;static push(t,n){for(let r of n)t=new Xe(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new Xe(n,t[r]);return n}push(t){return new Xe(this,t)}getSegments(){let t=this,n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){let n=[],r=this;for(;r&&r!==t;)n.push(r.scopeName),r=r.parent;return r===t?n.reverse():void 0}};function ls(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],o=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],o=!0}for(;e&&!cs(e.scopeName,r);){if(o)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function cs(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var qn=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}fontStyle;foregroundId;backgroundId};function us(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let o=0,s=t.length;o<s;o++){let a=t[o];if(!a.settings)continue;let i;if(typeof a.scope=="string"){let d=a.scope;d=d.replace(/^[,]+/,""),d=d.replace(/[,]+$/,""),i=d.split(",")}else Array.isArray(a.scope)?i=a.scope:i=[""];let l=-1;if(typeof a.settings.fontStyle=="string"){l=0;let d=a.settings.fontStyle.split(" ");for(let f=0,g=d.length;f<g;f++)switch(d[f]){case"italic":l=l|1;break;case"bold":l=l|2;break;case"underline":l=l|4;break;case"strikethrough":l=l|8;break}}let c=null;typeof a.settings.foreground=="string"&&Tn(a.settings.foreground)&&(c=a.settings.foreground);let u=null;typeof a.settings.background=="string"&&Tn(a.settings.background)&&(u=a.settings.background);for(let d=0,f=i.length;d<f;d++){let h=i[d].trim().split(" "),y=h[h.length-1],k=null;h.length>1&&(k=h.slice(0,h.length-1),k.reverse()),n[r++]=new ds(y,k,o,l,c,u)}}return n}var ds=class{constructor(e,t,n,r,o,s){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=o,this.background=s}scope;parentScopes;index;fontStyle;foreground;background},P=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(P||{});function fs(e,t){e.sort((l,c)=>{let u=Hn(l.scope,c.scope);return u!==0||(u=jn(l.parentScopes,c.parentScopes),u!==0)?u:l.index-c.index});let n=0,r="#000000",o="#ffffff";for(;e.length>=1&&e[0].scope==="";){let l=e.shift();l.fontStyle!==-1&&(n=l.fontStyle),l.foreground!==null&&(r=l.foreground),l.background!==null&&(o=l.background)}let s=new gs(t),a=new qn(n,s.getId(r),s.getId(o)),i=new ps(new Mt(0,null,-1,0,0),[]);for(let l=0,c=e.length;l<c;l++){let u=e[l];i.insert(0,u.scope,u.parentScopes,u.fontStyle,s.getId(u.foreground),s.getId(u.background))}return new Ae(s,a,i)}var gs=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},hs=Object.freeze([]),Mt=class Vn{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,r,o,s){this.scopeDepth=t,this.parentScopes=n||hs,this.fontStyle=r,this.foreground=o,this.background=s}clone(){return new Vn(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let r=0,o=t.length;r<o;r++)n[r]=t[r].clone();return n}acceptOverwrite(t,n,r,o){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),o!==0&&(this.background=o)}},ps=class $t{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_mainRule;_children;_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,o=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[o]===">"&&o++,!(r>=t.parentScopes.length||o>=n.parentScopes.length);){let s=n.parentScopes[o].length-t.parentScopes[r].length;if(s!==0)return s;r++,o++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),o,s;if(r===-1?(o=t,s=""):(o=t.substring(0,r),s=t.substring(r+1)),this._children.hasOwnProperty(o))return this._children[o].match(s)}let n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort($t._cmpBySpecificity),n}insert(t,n,r,o,s,a){if(n===""){this._doInsertHere(t,r,o,s,a);return}let i=n.indexOf("."),l,c;i===-1?(l=n,c=""):(l=n.substring(0,i),c=n.substring(i+1));let u;this._children.hasOwnProperty(l)?u=this._children[l]:(u=new $t(this._mainRule.clone(),Mt.cloneArr(this._rulesWithParentScopes)),this._children[l]=u),u.insert(t+1,c,r,o,s,a)}_doInsertHere(t,n,r,o,s){if(n===null){this._mainRule.acceptOverwrite(t,r,o,s);return}for(let a=0,i=this._rulesWithParentScopes.length;a<i;a++){let l=this._rulesWithParentScopes[a];if(jn(l.parentScopes,n)===0){l.acceptOverwrite(t,r,o,s);return}}r===-1&&(r=this._mainRule.fontStyle),o===0&&(o=this._mainRule.foreground),s===0&&(s=this._mainRule.background),this._rulesWithParentScopes.push(new Mt(t,n,r,o,s))}},re=class D{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){let n=D.getLanguageId(t),r=D.getTokenType(t),o=D.getFontStyle(t),s=D.getForeground(t),a=D.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:o,foreground:s,background:a})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,r,o,s,a,i){let l=D.getLanguageId(t),c=D.getTokenType(t),u=D.containsBalancedBrackets(t)?1:0,d=D.getFontStyle(t),f=D.getForeground(t),g=D.getBackground(t);return n!==0&&(l=n),r!==8&&(c=r),o!==null&&(u=o?1:0),s!==-1&&(d=s),a!==0&&(f=a),i!==0&&(g=i),(l<<0|c<<8|u<<10|d<<11|f<<15|g<<24)>>>0}};function Je(e,t){let n=[],r=ms(e),o=r.next();for(;o!==null;){let l=0;if(o.length===2&&o.charAt(1)===":"){switch(o.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${o} in scope selector`)}o=r.next()}let c=a();if(n.push({matcher:c,priority:l}),o!==",")break;o=r.next()}return n;function s(){if(o==="-"){o=r.next();let l=s();return c=>!!l&&!l(c)}if(o==="("){o=r.next();let l=i();return o===")"&&(o=r.next()),l}if(Ln(o)){let l=[];do l.push(o),o=r.next();while(Ln(o));return c=>t(l,c)}return null}function a(){let l=[],c=s();for(;c;)l.push(c),c=s();return u=>l.every(d=>d(u))}function i(){let l=[],c=a();for(;c&&(l.push(c),o==="|"||o===",");){do o=r.next();while(o==="|"||o===",");c=a()}return u=>l.some(d=>d(u))}}function Ln(e){return!!e&&!!e.match(/[\w\.:]+/)}function ms(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;let r=n[0];return n=t.exec(e),r}}}function Xn(e){typeof e.dispose=="function"&&e.dispose()}var Ie=class{constructor(e){this.scopeName=e}scopeName;toKey(){return this.scopeName}},bs=class{constructor(e,t){this.scopeName=e,this.ruleName=t}scopeName;ruleName;toKey(){return`${this.scopeName}#${this.ruleName}`}},ys=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){let t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},ks=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Ie(this.initialScopeName)]}repo;initialScopeName;seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){let e=this.Q;this.Q=[];let t=new ys;for(let n of e)ws(n,this.initialScopeName,this.repo,t);for(let n of t.references)if(n instanceof Ie){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 ws(e,t,n,r){let o=n.lookup(e.scopeName);if(!o){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}let s=n.lookup(t);e instanceof Ie?Qe({baseGrammar:s,selfGrammar:o},r):Gt(e.ruleName,{baseGrammar:s,selfGrammar:o,repository:o.repository},r);let a=n.injections(e.scopeName);if(a)for(let i of a)r.add(new Ie(i))}function Gt(e,t,n){if(t.repository&&t.repository[e]){let r=t.repository[e];Ke([r],t,n)}}function Qe(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&Ke(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&Ke(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function Ke(e,t,n){for(let r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);let o=r.repository?Dn({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&Ke(r.patterns,{...t,repository:o},n);let s=r.include;if(!s)continue;let a=Qn(s);switch(a.kind){case 0:Qe({...t,selfGrammar:t.baseGrammar},n);break;case 1:Qe(t,n);break;case 2:Gt(a.ruleName,{...t,repository:o},n);break;case 3:case 4:let i=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(i){let l={baseGrammar:t.baseGrammar,selfGrammar:i,repository:o};a.kind===4?Gt(a.ruleName,l,n):Qe(l,n)}else a.kind===4?n.add(new bs(a.scopeName,a.ruleName)):n.add(new Ie(a.scopeName));break}}}var Cs=class{kind=0},Ss=class{kind=1},_s=class{constructor(e){this.ruleName=e}ruleName;kind=2},vs=class{constructor(e){this.scopeName=e}scopeName;kind=3},xs=class{constructor(e,t){this.scopeName=e,this.ruleName=t}scopeName;ruleName;kind=4};function Qn(e){if(e==="$base")return new Cs;if(e==="$self")return new Ss;let t=e.indexOf("#");if(t===-1)return new vs(e);if(t===0)return new _s(e.substring(1));{let n=e.substring(0,t),r=e.substring(t+1);return new xs(n,r)}}var Es=/\\(\d+)/,Pn=/\\(\d+)/g,Rs=-1,Jn=-2;var Te=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Ve.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Ve.hasCaptures(this._contentName)}get debugName(){let e=this.$location?`${Un(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Ve.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Ve.replaceCaptures(this._contentName,e,t)}},As=class extends Te{retokenizeCapturedWithRuleId;constructor(e,t,n,r,o){super(e,t,n,r),this.retokenizeCapturedWithRuleId=o}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}},Is=class extends Te{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,o){super(e,t,n,null),this._match=new Be(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(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Ne,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Mn=class extends Te{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,o){super(e,t,n,r),this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(let n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new Ne,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Ot=class extends Te{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,o,s,a,i,l,c){super(e,t,n,r),this._begin=new Be(o,this.id),this.beginCaptures=s,this._end=new Be(a||"\uFFFF",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=i,this.applyEndPatternLast=l||!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(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Ne;for(let n of this.patterns)e.getRule(n).collectPatterns(e,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,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},Ye=class extends Te{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,o,s,a,i,l){super(e,t,n,r),this._begin=new Be(o,this.id),this.beginCaptures=s,this.whileCaptures=i,this._while=new Be(a,Jn),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=l.patterns,this.hasMissingPatterns=l.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(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new Ne;for(let t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new Ne,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"\uFFFF"),this._cachedCompiledWhilePatterns}},Kn=class M{static createCaptureRule(t,n,r,o,s){return t.registerRule(a=>new As(n,a,r,o,s))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(o=>{if(t.id=o,t.match)return new Is(t.$vscodeTextmateLocation,t.id,t.name,t.match,M._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=Dn({},r,t.repository));let s=t.patterns;return typeof s>"u"&&t.include&&(s=[{include:t.include}]),new Mn(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,M._compilePatterns(s,n,r))}return t.while?new Ye(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,M._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,M._compileCaptures(t.whileCaptures||t.captures,n,r),M._compilePatterns(t.patterns,n,r)):new Ot(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,M._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,M._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,M._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let o=[];if(t){let s=0;for(let a in t){if(a==="$vscodeTextmateLocation")continue;let i=parseInt(a,10);i>s&&(s=i)}for(let a=0;a<=s;a++)o[a]=null;for(let a in t){if(a==="$vscodeTextmateLocation")continue;let i=parseInt(a,10),l=0;t[a].patterns&&(l=M.getCompiledRuleId(t[a],n,r)),o[i]=M.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,l)}}return o}static _compilePatterns(t,n,r){let o=[];if(t)for(let s=0,a=t.length;s<a;s++){let i=t[s],l=-1;if(i.include){let c=Qn(i.include);switch(c.kind){case 0:case 1:l=M.getCompiledRuleId(r[i.include],n,r);break;case 2:let u=r[c.ruleName];u&&(l=M.getCompiledRuleId(u,n,r));break;case 3:case 4:let d=c.scopeName,f=c.kind===4?c.ruleName:null,g=n.getExternalGrammar(d,r);if(g)if(f){let h=g.repository[f];h&&(l=M.getCompiledRuleId(h,n,g.repository))}else l=M.getCompiledRuleId(g.repository.$self,n,g.repository);break}}else l=M.getCompiledRuleId(i,n,r);if(l!==-1){let c=n.getRule(l),u=!1;if((c instanceof Mn||c instanceof Ot||c instanceof Ye)&&c.hasMissingPatterns&&c.patterns.length===0&&(u=!0),u)continue;o.push(l)}}return{patterns:o,hasMissingPatterns:(t?t.length:0)!==o.length}}},Be=class Yn{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){let r=t.length,o=0,s=[],a=!1;for(let i=0;i<r;i++)if(t.charAt(i)==="\\"&&i+1<r){let c=t.charAt(i+1);c==="z"?(s.push(t.substring(o,i)),s.push("$(?!\\n)(?<!\\n)"),o=i+2):(c==="A"||c==="G")&&(a=!0),i++}this.hasAnchor=a,o===0?this.source=t:(s.push(t.substring(o,r)),this.source=s.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=Es.test(this.source):this.hasBackReferences=!1}clone(){return new Yn(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,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=>t.substring(o.start,o.end));return Pn.lastIndex=0,this.source.replace(Pn,(o,s)=>Wn(r[parseInt(s,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],o=[],s,a,i,l;for(s=0,a=this.source.length;s<a;s++)i=this.source.charAt(s),t[s]=i,n[s]=i,r[s]=i,o[s]=i,i==="\\"&&s+1<a&&(l=this.source.charAt(s+1),l==="A"?(t[s+1]="\uFFFF",n[s+1]="\uFFFF",r[s+1]="A",o[s+1]="A"):l==="G"?(t[s+1]="\uFFFF",n[s+1]="G",r[s+1]="\uFFFF",o[s+1]="G"):(t[s+1]=l,n[s+1]=l,r[s+1]=l,o[s+1]=l),s++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:o.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},Ne=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(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new $n(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map(o=>o.resolveAnchors(t,n));return new $n(e,r,this._items.map(o=>o.ruleId))}},$n=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}regExps;rules;scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){let e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
2
+ `)}findNextMatchSync(e,t,n){let r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},Pt=class{constructor(e,t){this.languageId=e,this.tokenType=t}languageId;tokenType},Bs=class Ft{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new Pt(t,8),this._embeddedLanguagesMatcher=new Ns(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?Ft._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Pt(0,0);_getBasicScopeAttributes=new zn(t=>{let n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new Pt(n,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){let n=t.match(Ft.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/},Ns=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);let t=e.map(([n,r])=>Wn(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;let t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},rc={InDebugMode:typeof process<"u"&&!!process.env.VSCODE_TEXTMATE_DEBUG},Zn=!1,Gn=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}stack;stoppedEarly};function er(e,t,n,r,o,s,a,i){let l=t.content.length,c=!1,u=-1;if(a){let g=Ts(e,t,n,r,o,s);o=g.stack,r=g.linePos,n=g.isFirstLine,u=g.anchorPosition}let d=Date.now();for(;!c;){if(i!==0&&Date.now()-d>i)return new Gn(o,!0);f()}return new Gn(o,!1);function f(){let g=Ls(e,t,n,r,o,u);if(!g){s.produce(o,l),c=!0;return}let h=g.captureIndices,y=g.matchedRuleId,k=h&&h.length>0?h[0].end>r:!1;if(y===Rs){let m=o.getRule(e);s.produce(o,h[0].start),o=o.withContentNameScopesList(o.nameScopesList),Ee(e,t,n,o,s,m.endCaptures,h),s.produce(o,h[0].end);let b=o;if(o=o.parent,u=b.getAnchorPos(),!k&&b.getEnterPos()===r){o=b,s.produce(o,l),c=!0;return}}else{let m=e.getRule(y);s.produce(o,h[0].start);let b=o,w=m.getName(t.content,h),_=o.contentNameScopesList.pushAttributed(w,e);if(o=o.push(y,r,u,h[0].end===l,null,_,_),m instanceof Ot){let x=m;Ee(e,t,n,o,s,x.beginCaptures,h),s.produce(o,h[0].end),u=h[0].end;let L=x.getContentName(t.content,h),$=_.pushAttributed(L,e);if(o=o.withContentNameScopesList($),x.endHasBackReferences&&(o=o.withEndRule(x.getEndWithResolvedBackReferences(t.content,h))),!k&&b.hasSameRuleAs(o)){o=o.pop(),s.produce(o,l),c=!0;return}}else if(m instanceof Ye){let x=m;Ee(e,t,n,o,s,x.beginCaptures,h),s.produce(o,h[0].end),u=h[0].end;let L=x.getContentName(t.content,h),$=_.pushAttributed(L,e);if(o=o.withContentNameScopesList($),x.whileHasBackReferences&&(o=o.withEndRule(x.getWhileWithResolvedBackReferences(t.content,h))),!k&&b.hasSameRuleAs(o)){o=o.pop(),s.produce(o,l),c=!0;return}}else if(Ee(e,t,n,o,s,m.captures,h),s.produce(o,h[0].end),o=o.pop(),!k){o=o.safePop(),s.produce(o,l),c=!0;return}}h[0].end>r&&(r=h[0].end,n=!1)}}function Ts(e,t,n,r,o,s){let a=o.beginRuleCapturedEOL?0:-1,i=[];for(let l=o;l;l=l.pop()){let c=l.getRule(e);c instanceof Ye&&i.push({rule:c,stack:l})}for(let l=i.pop();l;l=i.pop()){let{ruleScanner:c,findOptions:u}=$s(l.rule,e,l.stack.endRule,n,r===a),d=c.findNextMatchSync(t,r,u);if(d){if(d.ruleId!==Jn){o=l.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(s.produce(l.stack,d.captureIndices[0].start),Ee(e,t,n,l.stack,s,l.rule.whileCaptures,d.captureIndices),s.produce(l.stack,d.captureIndices[0].end),a=d.captureIndices[0].end,d.captureIndices[0].end>r&&(r=d.captureIndices[0].end,n=!1))}else{o=l.stack.pop();break}}return{stack:o,linePos:r,anchorPosition:a,isFirstLine:n}}function Ls(e,t,n,r,o,s){let a=Ps(e,t,n,r,o,s),i=e.getInjections();if(i.length===0)return a;let l=Ms(i,e,t,n,r,o,s);if(!l)return a;if(!a)return l;let c=a.captureIndices[0].start,u=l.captureIndices[0].start;return u<c||l.priorityMatch&&u===c?l:a}function Ps(e,t,n,r,o,s){let a=o.getRule(e),{ruleScanner:i,findOptions:l}=tr(a,e,o.endRule,n,r===s),c=i.findNextMatchSync(t,r,l);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Ms(e,t,n,r,o,s,a){let i=Number.MAX_VALUE,l=null,c,u=0,d=s.contentNameScopesList.getScopeNames();for(let f=0,g=e.length;f<g;f++){let h=e[f];if(!h.matcher(d))continue;let y=t.getRule(h.ruleId),{ruleScanner:k,findOptions:m}=tr(y,t,null,r,o===a),b=k.findNextMatchSync(n,o,m);if(!b)continue;let w=b.captureIndices[0].start;if(!(w>=i)&&(i=w,l=b.captureIndices,c=b.ruleId,u=h.priority,i===o))break}return l?{priorityMatch:u===-1,captureIndices:l,matchedRuleId:c}:null}function tr(e,t,n,r,o){if(Zn){let a=e.compile(t,n),i=nr(r,o);return{ruleScanner:a,findOptions:i}}return{ruleScanner:e.compileAG(t,n,r,o),findOptions:0}}function $s(e,t,n,r,o){if(Zn){let a=e.compileWhile(t,n),i=nr(r,o);return{ruleScanner:a,findOptions:i}}return{ruleScanner:e.compileWhileAG(t,n,r,o),findOptions:0}}function nr(e,t){let n=0;return e||(n|=1),t||(n|=4),n}function Ee(e,t,n,r,o,s,a){if(s.length===0)return;let i=t.content,l=Math.min(s.length,a.length),c=[],u=a[0].end;for(let d=0;d<l;d++){let f=s[d];if(f===null)continue;let g=a[d];if(g.length===0)continue;if(g.start>u)break;for(;c.length>0&&c[c.length-1].endPos<=g.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,g.start):o.produce(r,g.start),f.retokenizeCapturedWithRuleId){let y=f.getName(i,a),k=r.contentNameScopesList.pushAttributed(y,e),m=f.getContentName(i,a),b=k.pushAttributed(m,e),w=r.push(f.retokenizeCapturedWithRuleId,g.start,-1,!1,null,k,b),_=e.createOnigString(i.substring(0,g.end));er(e,_,n&&g.start===0,g.start,w,o,!1,0),Xn(_);continue}let h=f.getName(i,a);if(h!==null){let k=(c.length>0?c[c.length-1].scopes:r.contentNameScopesList).pushAttributed(h,e);c.push(new Gs(k,g.end))}}for(;c.length>0;)o.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var Gs=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Os(e,t,n,r,o,s,a,i){return new Ds(e,t,n,r,o,s,a,i)}function On(e,t,n,r,o){let s=Je(t,Ze),a=Kn.getCompiledRuleId(n,r,o.repository);for(let i of s)e.push({debugSelector:t,matcher:i.matcher,ruleId:a,grammar:o,priority:i.priority})}function Ze(e,t){if(t.length<e.length)return!1;let n=0;return e.every(r=>{for(let o=n;o<t.length;o++)if(Fs(t[o],r))return n=o+1,!0;return!1})}function Fs(e,t){if(!e)return!1;if(e===t)return!0;let n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var Ds=class{constructor(e,t,n,r,o,s,a,i){if(this._rootScopeName=e,this.balancedBracketSelectors=s,this._onigLib=i,this._basicScopeAttributesProvider=new Bs(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=a,this._grammar=Fn(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(let l of Object.keys(o)){let c=Je(l,Ze);for(let u of c)this._tokenTypeMatchers.push({matcher:u.matcher,type:o[l]})}}_rootScopeName;balancedBracketSelectors;_onigLib;_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(let e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){let e={lookup:o=>o===this._rootScopeName?this._grammar:this.getExternalGrammar(o),injections:o=>this._grammarRepository.injections(o)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){let o=r.injections;if(o)for(let a in o)On(t,a,o[a],this,r);let s=this._grammarRepository.injections(n);s&&s.forEach(a=>{let i=this.getExternalGrammar(a);if(i){let l=i.injectionSelector;l&&On(t,l,i,this,i)}})}return t.sort((o,s)=>o.priority-s.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){let t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){let n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Fn(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){let r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){let r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){this._rootId===-1&&(this._rootId=Kn.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let o;if(!t||t===Dt.NULL){o=!0;let c=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),d=re.set(0,c.languageId,c.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),f=this.getRule(this._rootId).getName(null,null),g;f?g=Re.createRootAndLookUpScopeName(f,d,this):g=Re.createRoot("unknown",d),t=new Dt(null,this._rootId,-1,-1,!1,null,g,g)}else o=!1,t.reset();e=e+`
3
+ `;let s=this.createOnigString(e),a=s.content.length,i=new Hs(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=er(this,s,o,0,t,i,!0,r);return Xn(s),{lineLength:a,lineTokens:i,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function Fn(e,t){return e=ss(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Re=class q{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}parent;scopePath;tokenAttributes;static fromExtension(t,n){let r=t,o=t?.scopePath??null;for(let s of n)o=Lt.push(o,s.scopeNames),r=new q(r,o,s.encodedTokenAttributes);return r}static createRoot(t,n){return new q(null,new Lt(null,t),n)}static createRootAndLookUpScopeName(t,n,r){let o=r.getMetadataForScope(t),s=new Lt(null,t),a=r.themeProvider.themeMatch(s),i=q.mergeAttributes(n,o,a);return new q(null,s,i)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return q.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,r){let o=-1,s=0,a=0;return r!==null&&(o=r.fontStyle,s=r.foregroundId,a=r.backgroundId),re.set(t,n.languageId,n.tokenType,null,o,s,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return q._pushAttributed(this,t,n);let r=t.split(/ /g),o=this;for(let s of r)o=q._pushAttributed(o,s,n);return o}static _pushAttributed(t,n,r){let o=r.getMetadataForScope(n),s=t.scopePath.push(n),a=r.themeProvider.themeMatch(s),i=q.mergeAttributes(t.tokenAttributes,o,a);return new q(t,s,i)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){let n=[],r=this;for(;r&&r!==t;)n.push({encodedTokenAttributes:r.tokenAttributes,scopeNames:r.scopePath.getExtensionIfDefined(r.parent?.scopePath??null)}),r=r.parent;return r===t?n.reverse():void 0}},Dt=class le{constructor(t,n,r,o,s,a,i,l){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=s,this.endRule=a,this.nameScopesList=i,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=o}parent;ruleId;beginRuleCapturedEOL;endRule;nameScopesList;contentNameScopesList;_stackElementBrand=void 0;static NULL=new le(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:le._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Re.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){le._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,o,s,a,i){return new le(this,t,n,r,o,s,a,i)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){let t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new le(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.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(t,n){let r=Re.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new le(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Re.fromExtension(r,n.contentNameScopesList))}},Us=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Je(n,Ze).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>Je(n,Ze).map(r=>r.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(let t of this.unbalancedBracketScopes)if(t(e))return!1;for(let t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Hs=class{constructor(e,t,n,r){this.balancedBracketSelectors=r,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}balancedBracketSelectors;_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let r=e?.tokenAttributes??0,o=!1;if(this.balancedBracketSelectors?.matchesAlways&&(o=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){let s=e?.getScopeNames()??[];for(let a of this._tokenTypeOverrides)a.matcher(s)&&(r=re.set(r,0,a.type,null,-1,0,0));this.balancedBracketSelectors&&(o=this.balancedBracketSelectors.match(s))}if(o&&(r=re.set(r,0,8,o,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===r){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(r),this._lastTokenEndIndex=t;return}let n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);let n=new Uint32Array(this._binaryTokens.length);for(let r=0,o=this._binaryTokens.length;r<o;r++)n[r]=this._binaryTokens[r];return n}},js=class{constructor(e,t){this._onigLib=t,this._theme=e}_onigLib;_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(let e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,r,o){if(!this._grammars.has(e)){let s=this._rawGrammars.get(e);if(!s)return null;this._grammars.set(e,Os(e,s,t,n,r,o,this,this._onigLib))}return this._grammars.get(e)}},rr=class{_options;_syncRegistry;_ensureGrammarCache;constructor(e){this._options=e,this._syncRegistry=new js(Ae.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(Ae.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new Us(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}_loadGrammar(e,t,n,r,o){let s=new ks(this._syncRegistry,e);for(;s.Q.length>0;)s.Q.map(a=>this._loadSingleGrammar(a.scopeName)),s.processQueue();return this._grammarForScopeName(e,t,n,r,o)}_loadSingleGrammar(e){this._ensureGrammarCache.has(e)||(this._doLoadSingleGrammar(e),this._ensureGrammarCache.set(e,!0))}_doLoadSingleGrammar(e){let t=this._options.loadGrammar(e);if(t){let n=typeof this._options.getInjections=="function"?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,o=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,o)}},et=Dt.NULL;function Pe(e,t){let n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(let[o,s]of Object.entries(t?.colorReplacements||{}))typeof s=="string"?n[o]=s:o===r&&Object.assign(n,s);return n}function X(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function lr(e){return Array.isArray(e)?e:[e]}async function Ht(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Me(e){return!e||["plaintext","txt","text","plain"].includes(e)}function cr(e){return e==="ansi"||Me(e)}function $e(e){return e==="none"}function ur(e){return $e(e)}var Ws=/(\r?\n)/g;function ke(e,t=!1){if(e.length===0)return[["",0]];let n=e.split(Ws),r=0,o=[];for(let s=0;s<n.length;s+=2){let a=t?n[s]+(n[s+1]||""):n[s];o.push([a,r]),r+=n[s].length,r+=n[s+1]?.length||0}return o}var or={light:"#333333",dark:"#bbbbbb"},sr={light:"#fffffe",dark:"#1e1e1e"},ar="__shiki_resolved";function tt(e){if(e?.[ar])return e;let t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:r}=t;if(!n||!r){let i=t.settings?t.settings.find(l=>!l.name&&!l.scope):void 0;i?.settings?.foreground&&(r=i.settings.foreground),i?.settings?.background&&(n=i.settings.background),!r&&t?.colors?.["editor.foreground"]&&(r=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),r||(r=t.type==="light"?or.light:or.dark),n||(n=t.type==="light"?sr.light:sr.dark),t.fg=r,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let o=0,s=new Map;function a(i){if(s.has(i))return s.get(i);o+=1;let l=`#${o.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${l}`]?a(i):(s.set(i,l),l)}t.settings=t.settings.map(i=>{let l=i.settings?.foreground&&!i.settings.foreground.startsWith("#"),c=i.settings?.background&&!i.settings.background.startsWith("#");if(!l&&!c)return i;let u={...i,settings:{...i.settings}};if(l){let d=a(i.settings.foreground);t.colorReplacements[d]=i.settings.foreground,u.settings.foreground=d}if(c){let d=a(i.settings.background);t.colorReplacements[d]=i.settings.background,u.settings.background=d}return u});for(let i of Object.keys(t.colors||{}))if((i==="editor.foreground"||i==="editor.background"||i.startsWith("terminal.ansi"))&&!t.colors[i]?.startsWith("#")){let l=a(t.colors[i]);t.colorReplacements[l]=t.colors[i],t.colors[i]=l}return Object.defineProperty(t,ar,{enumerable:!1,writable:!1,value:!0}),t}async function dr(e){return[...new Set((await Promise.all(e.filter(t=>!cr(t)).map(async t=>await Ht(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function fr(e){return(await Promise.all(e.map(async t=>ur(t)?null:tt(await Ht(t))))).filter(t=>!!t)}function gr(e,t){if(!t)return e;if(t[e]){let n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new E(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var zs=class extends rr{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,r={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=r,this._themes.map(o=>this.loadTheme(o)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){let t=tt(e);return t.name&&(this._resolvedThemes.set(t.name,t),this._loadedThemesCache=null),t}getLoadedThemes(){return this._loadedThemesCache||(this._loadedThemesCache=[...this._resolvedThemes.keys()]),this._loadedThemesCache}setTheme(e){let t=this._textmateThemeCache.get(e);t||(t=Ae.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=gr(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;let t=new Set([...this._langMap.values()].filter(o=>o.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);let n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);let r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(o=>{this._alias[o]=e.name}),this._loadedLanguagesCache=null,t.size)for(let o of t)this._syncRegistry?._grammars?.get(o.scopeName)?.dispose(),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(let r of e)this.resolveEmbeddedLanguages(r);let t=[...this._langGraph.entries()],n=t.filter(([r,o])=>!o);if(n.length){let r=t.filter(([o,s])=>s?(s.embeddedLanguages||s.embeddedLangs)?.some(a=>n.map(([i])=>i).includes(a)):!1).filter(o=>!n.includes(o));throw new E(`Missing languages ${n.map(([o])=>`\`${o}\``).join(", ")}, required by ${r.map(([o])=>`\`${o}\``).join(", ")}`)}for(let[r,o]of t)this._resolver.addLanguage(o);for(let[r,o]of t)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);let t=e.embeddedLanguages??e.embeddedLangs;if(t)for(let n of t)this._langGraph.set(n,this._langMap.get(n))}},qs=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:n=>e.createScanner(n),createOnigString:n=>e.createString(n)},t.forEach(n=>this.addLanguage(n))}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(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).includes(e.scopeName)||this._injections.get(t).push(e.scopeName)})}getInjections(e){let t=e.split("."),n=[];for(let r=1;r<=t.length;r++){let o=t.slice(0,r).join(".");n=[...n,...this._injections.get(o)||[]]}return n}},Le=0;function jt(e){Le+=1,e.warnings!==!1&&Le>=10&&Le%10===0&&console.warn(`[Shiki] ${Le} 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 t=!1;if(!e.engine)throw new E("`engine` option is required for synchronous mode");let n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(tt),o=new zs(new qs(e.engine,n),r,n,e.langAlias),s;function a(b){return gr(b,e.langAlias)}function i(b){k();let w=o.getGrammar(typeof b=="string"?b:b.name);if(!w)throw new E(`Language \`${b}\` not found, you may need to load it first`);return w}function l(b){if(b==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};k();let w=o.getTheme(b);if(!w)throw new E(`Theme \`${b}\` not found, you may need to load it first`);return w}function c(b){k();let w=l(b);return s!==b&&(o.setTheme(w),s=b),{theme:w,colorMap:o.getColorMap()}}function u(){return k(),o.getLoadedThemes()}function d(){return k(),o.getLoadedLanguages()}function f(...b){k(),o.loadLanguages(b.flat(1))}async function g(...b){return f(await dr(b))}function h(...b){k();for(let w of b.flat(1))o.loadTheme(w)}async function y(...b){return k(),h(await fr(b))}function k(){if(t)throw new E("Shiki instance has been disposed")}function m(){t||(t=!0,o.dispose(),Le-=1)}return{setTheme:c,getTheme:l,getLanguage:i,getLoadedThemes:u,getLoadedLanguages:d,resolveLangAlias:a,loadLanguage:g,loadLanguageSync:f,loadTheme:y,loadThemeSync:h,dispose:m,[Symbol.dispose]:m}}async function Wt(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");let[t,n,r]=await Promise.all([fr(e.themes||[]),dr(e.langs||[]),e.engine]);return jt({...e,themes:t,langs:n,engine:r})}var hr=new WeakMap;function Ge(e,t){hr.set(e,t)}function we(e){return hr.get(e)}var nt=class pr{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new pr(Object.fromEntries(lr(n).map(r=>[r,et])),t)}constructor(...t){if(t.length===2){let[n,r]=t;this.lang=r,this._stacks=n}else{let[n,r,o]=t;this.lang=r,this._stacks={[o]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return Vs(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Vs(e){let t=[],n=new Set;function r(o){if(n.has(o))return;n.add(o);let s=o?.nameScopesList?.scopeName;s&&t.push(s),o.parent&&r(o.parent)}return r(e),t}function Xs(e,t){if(!(e instanceof nt))throw new E("Invalid grammar state");return e.getInternalStack(t)}var Qs=/,/,Js=/ /;function zt(e,t,n={}){let{theme:r=e.getLoadedThemes()[0]}=n;if(Me(e.resolveLangAlias(n.lang||"text"))||$e(r))return ke(t).map(i=>[{content:i[0],offset:i[1]}]);let{theme:o,colorMap:s}=e.setTheme(r),a=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==a.name)throw new E(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${a.name}"`);if(!n.grammarState.themes.includes(o.name))throw new E(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${o.name}"`)}return br(t,a,o,s,n)}function mr(...e){if(e.length===2)return we(e[1]);let[t,n,r={}]=e,{lang:o="text",theme:s=t.getLoadedThemes()[0]}=r;if(Me(o)||$e(s))throw new E("Plain language does not have grammar state");if(o==="ansi")throw new E("ANSI language does not have grammar state");let{theme:a,colorMap:i}=t.setTheme(s),l=t.getLanguage(o);return new nt(qt(n,l,a,i,r).stateStack,l.name,a.name)}function br(e,t,n,r,o){let s=qt(e,t,n,r,o),a=new nt(s.stateStack,t.name,n.name);return Ge(s.tokens,a),s.tokens}function qt(e,t,n,r,o){let s=Pe(n,o),{tokenizeMaxLineLength:a=0,tokenizeTimeLimit:i=500,includeExplanation:l=!1}=o,c=ke(e),u=o.grammarState?Xs(o.grammarState,n.name)??et:o.grammarContextCode!=null?qt(o.grammarContextCode,t,n,r,{...o,grammarState:void 0,grammarContextCode:void 0}).stateStack:et,d=[],f=[];for(let g=0,h=c.length;g<h;g++){let[y,k]=c[g];if(y===""){d=[],f.push([]);continue}if(a>0&&y.length>=a){d=[],f.push([{content:y,offset:k,color:"",fontStyle:0}]);continue}let m,b,w;l&&l!=="tokenType"&&(m=t.tokenizeLine(y,u,i),b=m.tokens,w=0);let _=t.tokenizeLine2(y,u,i),x=_.tokens.length/2;for(let L=0;L<x;L++){let $=_.tokens[2*L],W=L+1<x?_.tokens[2*L+2]:y.length;if($===W)continue;let be=_.tokens[2*L+1],At=X(r[re.getForeground(be)],s),It=re.getFontStyle(be),z={content:y.substring($,W),offset:k+$,color:At,fontStyle:It};if(l==="tokenType")z.type=re.getTokenType(be);else if(l){let In=[];if(l!=="scopeName")for(let V of n.settings){let ye;switch(typeof V.scope){case"string":ye=V.scope.split(Qs).map(Bt=>Bt.trim());break;case"object":ye=V.scope;break;default:continue}In.push({settings:V,selectors:ye.map(Bt=>Bt.split(Js))})}z.explanation=[];let Bn=0;for(;$+Bn<W;){let V=b[w],ye=y.substring(V.startIndex,V.endIndex);Bn+=ye.length,z.explanation.push({content:ye,scopes:l==="scopeName"?Ks(V.scopes):Ys(In,V.scopes)}),w+=1}}d.push(z)}f.push(d),d=[],u=_.ruleStack}return{tokens:f,stateStack:u}}function Ks(e){return e.map(t=>({scopeName:t}))}function Ys(e,t){let n=[];for(let r=0,o=t.length;r<o;r++){let s=t[r];n[r]={scopeName:s,themeMatches:ea(e,s,t.slice(0,r))}}return n}function ir(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function Zs(e,t,n){if(!ir(e.at(-1),t))return!1;let r=e.length-2,o=n.length-1;for(;r>=0&&o>=0;)ir(e[r],n[o])&&(r-=1),o-=1;return r===-1}function ea(e,t,n){let r=[];for(let{selectors:o,settings:s}of e)for(let a of o)if(Zs(a,t,n)){r.push(s);break}return r}function rt(e,t,n,r=zt){let o=Object.entries(n.themes).filter(c=>c[1]).map(c=>({color:c[0],theme:c[1]})),s=o.map(c=>{let u=r(e,t,{...n,theme:c.theme});return{tokens:u,state:we(u),theme:typeof c.theme=="string"?c.theme:c.theme.name}}),a=ta(...s.map(c=>c.tokens)),i=a[0].map((c,u)=>c.map((d,f)=>{let g={content:d.content,variants:{},offset:d.offset};return"includeExplanation"in n&&n.includeExplanation&&(g.explanation=d.explanation),a.forEach((h,y)=>{let{content:k,explanation:m,offset:b,...w}=h[u][f];g.variants[o[y].color]=w}),g})),l=s[0].state?new nt(Object.fromEntries(s.map(c=>[c.theme,c.state?.getInternalStack(c.theme)])),s[0].state.lang):void 0;return l&&Ge(i,l),i}function ta(...e){let t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){let o=e.map(l=>l[r]),s=t.map(()=>[]);t.forEach((l,c)=>l.push(s[c]));let a=o.map(()=>0),i=o.map(l=>l[0]);for(;i.every(l=>l);){let l=Math.min(...i.map(c=>c.content.length));for(let c=0;c<n;c++){let u=i[c];u.content.length===l?(s[c].push(u),a[c]+=1,i[c]=o[c][a[c]]):(s[c].push({...u,content:u.content.slice(0,l)}),i[c]={...u,content:u.content.slice(l),offset:u.offset+l})}}}return t}var yr=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];var Q=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};Q.prototype.normal={};Q.prototype.property={};Q.prototype.space=void 0;function Vt(e,t){let n={},r={};for(let o of e)Object.assign(n,o.property),Object.assign(r,o.normal);return new Q(n,r,t)}function Oe(e){return e.toLowerCase()}var T=class{constructor(t,n){this.attribute=n,this.property=t}};T.prototype.attribute="";T.prototype.booleanish=!1;T.prototype.boolean=!1;T.prototype.commaOrSpaceSeparated=!1;T.prototype.commaSeparated=!1;T.prototype.defined=!1;T.prototype.mustUseProperty=!1;T.prototype.number=!1;T.prototype.overloadedBoolean=!1;T.prototype.property="";T.prototype.spaceSeparated=!1;T.prototype.space=void 0;var Fe={};Nt(Fe,{boolean:()=>C,booleanish:()=>R,commaOrSpaceSeparated:()=>G,commaSeparated:()=>J,number:()=>p,overloadedBoolean:()=>ot,spaceSeparated:()=>v});var na=0,C=ce(),R=ce(),ot=ce(),p=ce(),v=ce(),J=ce(),G=ce();function ce(){return 2**++na}var Xt=Object.keys(Fe),ue=class extends T{constructor(t,n,r,o){let s=-1;if(super(t,n),kr(this,"space",o),typeof r=="number")for(;++s<Xt.length;){let a=Xt[s];kr(this,Xt[s],(r&Fe[a])===Fe[a])}}};ue.prototype.defined=!0;function kr(e,t,n){n&&(e[t]=n)}function U(e){let t={},n={};for(let[r,o]of Object.entries(e.properties)){let s=new ue(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[Oe(r)]=r,n[Oe(s.attribute)]=r}return new Q(t,n,e.space)}var Qt=U({properties:{ariaActiveDescendant:null,ariaAtomic:R,ariaAutoComplete:null,ariaBusy:R,ariaChecked:R,ariaColCount:p,ariaColIndex:p,ariaColSpan:p,ariaControls:v,ariaCurrent:null,ariaDescribedBy:v,ariaDetails:null,ariaDisabled:R,ariaDropEffect:v,ariaErrorMessage:null,ariaExpanded:R,ariaFlowTo:v,ariaGrabbed:R,ariaHasPopup:null,ariaHidden:R,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:v,ariaLevel:p,ariaLive:null,ariaModal:R,ariaMultiLine:R,ariaMultiSelectable:R,ariaOrientation:null,ariaOwns:v,ariaPlaceholder:null,ariaPosInSet:p,ariaPressed:R,ariaReadOnly:R,ariaRelevant:null,ariaRequired:R,ariaRoleDescription:v,ariaRowCount:p,ariaRowIndex:p,ariaRowSpan:p,ariaSelected:R,ariaSetSize:p,ariaSort:null,ariaValueMax:p,ariaValueMin:p,ariaValueNow:p,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function st(e,t){return t in e?e[t]:t}function at(e,t){return st(e,t.toLowerCase())}var wr=U({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:J,acceptCharset:v,accessKey:v,action:null,allow:null,allowFullScreen:C,allowPaymentRequest:C,allowUserMedia:C,alpha:C,alt:null,as:null,async:C,autoCapitalize:null,autoComplete:v,autoFocus:C,autoPlay:C,blocking:v,capture:null,charSet:null,checked:C,cite:null,className:v,closedBy:null,colorSpace:null,cols:p,colSpan:p,command:null,commandFor:null,content:null,contentEditable:R,controls:C,controlsList:v,coords:p|J,crossOrigin:null,data:null,dateTime:null,decoding:null,default:C,defer:C,dir:null,dirName:null,disabled:C,download:ot,draggable:R,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:C,formTarget:null,headers:v,height:p,hidden:ot,high:p,href:null,hrefLang:null,htmlFor:v,httpEquiv:v,id:null,imageSizes:null,imageSrcSet:null,inert:C,inputMode:null,integrity:null,is:null,isMap:C,itemId:null,itemProp:v,itemRef:v,itemScope:C,itemType:v,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:C,low:p,manifest:null,max:null,maxLength:p,media:null,method:null,min:null,minLength:p,multiple:C,muted:C,name:null,nonce:null,noModule:C,noValidate:C,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:C,optimum:p,pattern:null,ping:v,placeholder:null,playsInline:C,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:C,referrerPolicy:null,rel:v,required:C,reversed:C,rows:p,rowSpan:p,sandbox:v,scope:null,scoped:C,seamless:C,selected:C,shadowRootClonable:C,shadowRootCustomElementRegistry:C,shadowRootDelegatesFocus:C,shadowRootMode:null,shadowRootSerializable:C,shape:null,size:p,sizes:null,slot:null,span:p,spellCheck:R,src:null,srcDoc:null,srcLang:null,srcSet:null,start:p,step:null,style:null,tabIndex:p,target:null,title:null,translate:null,type:null,typeMustMatch:C,useMap:null,value:R,width:p,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:v,axis:null,background:null,bgColor:null,border:p,borderColor:null,bottomMargin:p,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:C,declare:C,event:null,face:null,frame:null,frameBorder:null,hSpace:p,leftMargin:p,link:null,longDesc:null,lowSrc:null,marginHeight:p,marginWidth:p,noResize:C,noHref:C,noShade:C,noWrap:C,object:null,profile:null,prompt:null,rev:null,rightMargin:p,rules:null,scheme:null,scrolling:R,standby:null,summary:null,text:null,topMargin:p,valueType:null,version:null,vAlign:null,vLink:null,vSpace:p,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:C,disablePictureInPicture:C,disableRemotePlayback:C,exportParts:J,part:v,prefix:null,property:null,results:p,security:null,unselectable:null},space:"html",transform:at});var Cr=U({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",maskType:"mask-type",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:G,accentHeight:p,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:p,amplitude:p,arabicForm:null,ascent:p,attributeName:null,attributeType:null,azimuth:p,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:p,by:null,calcMode:null,capHeight:p,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:p,diffuseConstant:p,direction:null,display:null,dur:null,divisor:p,dominantBaseline:null,download:C,dx:null,dy:null,edgeMode:null,editable:null,elevation:p,enableBackground:null,end:null,event:null,exponent:p,externalResourcesRequired:null,fill:null,fillOpacity:p,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:J,g2:J,glyphName:J,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:p,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:p,horizOriginX:p,horizOriginY:p,id:null,ideographic:p,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:p,k:p,k1:p,k2:p,k3:p,k4:p,kernelMatrix:G,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:p,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:p,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:p,overlineThickness:p,paintOrder:null,panose1:null,path:null,pathLength:p,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:v,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:p,pointsAtY:p,pointsAtZ:p,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:G,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:G,rev:G,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:G,requiredFeatures:G,requiredFonts:G,requiredFormats:G,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:p,specularExponent:p,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:p,strikethroughThickness:p,string:null,stroke:null,strokeDashArray:G,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:p,strokeOpacity:p,strokeWidth:null,style:null,surfaceScale:p,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:G,tabIndex:p,tableValues:null,target:null,targetX:p,targetY:p,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:G,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:p,underlineThickness:p,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:p,values:null,vAlphabetic:p,vMathematical:p,vectorEffect:null,vHanging:p,vIdeographic:p,version:null,vertAdvY:p,vertOriginX:p,vertOriginY:p,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:p,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:st});var Jt=U({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}});var Kt=U({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:at});var Yt=U({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}});var ra=/[A-Z]/g,Sr=/-[a-z]/g,oa=/^data[-\w.:]+$/i;function Zt(e,t){let n=Oe(t),r=t,o=T;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&oa.test(t)){if(t.charAt(4)==="-"){let s=t.slice(5).replace(Sr,aa);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{let s=t.slice(4);if(!Sr.test(s)){let a=s.replace(ra,sa);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}o=ue}return new o(r,t)}function sa(e){return"-"+e.toLowerCase()}function aa(e){return e.charAt(1).toUpperCase()}var it=Vt([Qt,wr,Jt,Kt,Yt],"html"),lt=Vt([Qt,Cr,Jt,Kt,Yt],"svg");var _r={}.hasOwnProperty;function vr(e,t){let n=t||{};function r(o,...s){let a=r.invalid,i=r.handlers;if(o&&_r.call(o,e)){let l=String(o[e]);a=_r.call(i,l)?i[l]:r.unknown}if(a)return a.call(this,o,...s)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var ia=/["&'<>`]/g,la=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,ca=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,ua=/[|\\{}()[\]^$+*?.]/g,xr=new WeakMap;function Er(e,t){if(e=e.replace(t.subset?da(t.subset):ia,r),t.subset||t.escapeOnly)return e;return e.replace(la,n).replace(ca,r);function n(o,s,a){return t.format((o.charCodeAt(0)-55296)*1024+o.charCodeAt(1)-56320+65536,a.charCodeAt(s+2),t)}function r(o,s,a){return t.format(o.charCodeAt(0),a.charCodeAt(s+1),t)}}function da(e){let t=xr.get(e);return t||(t=fa(e),xr.set(e,t)),t}function fa(e){let t=[],n=-1;for(;++n<e.length;)t.push(e[n].replace(ua,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}var ga=/[\dA-Fa-f]/;function Rr(e,t,n){let r="&#x"+e.toString(16).toUpperCase();return n&&t&&!ga.test(String.fromCharCode(t))?r:r+";"}var ha=/\d/;function Ar(e,t,n){let r="&#"+String(e);return n&&t&&!ha.test(String.fromCharCode(t))?r:r+";"}var Ir=["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"];var ct={nbsp:"\xA0",iexcl:"\xA1",cent:"\xA2",pound:"\xA3",curren:"\xA4",yen:"\xA5",brvbar:"\xA6",sect:"\xA7",uml:"\xA8",copy:"\xA9",ordf:"\xAA",laquo:"\xAB",not:"\xAC",shy:"\xAD",reg:"\xAE",macr:"\xAF",deg:"\xB0",plusmn:"\xB1",sup2:"\xB2",sup3:"\xB3",acute:"\xB4",micro:"\xB5",para:"\xB6",middot:"\xB7",cedil:"\xB8",sup1:"\xB9",ordm:"\xBA",raquo:"\xBB",frac14:"\xBC",frac12:"\xBD",frac34:"\xBE",iquest:"\xBF",Agrave:"\xC0",Aacute:"\xC1",Acirc:"\xC2",Atilde:"\xC3",Auml:"\xC4",Aring:"\xC5",AElig:"\xC6",Ccedil:"\xC7",Egrave:"\xC8",Eacute:"\xC9",Ecirc:"\xCA",Euml:"\xCB",Igrave:"\xCC",Iacute:"\xCD",Icirc:"\xCE",Iuml:"\xCF",ETH:"\xD0",Ntilde:"\xD1",Ograve:"\xD2",Oacute:"\xD3",Ocirc:"\xD4",Otilde:"\xD5",Ouml:"\xD6",times:"\xD7",Oslash:"\xD8",Ugrave:"\xD9",Uacute:"\xDA",Ucirc:"\xDB",Uuml:"\xDC",Yacute:"\xDD",THORN:"\xDE",szlig:"\xDF",agrave:"\xE0",aacute:"\xE1",acirc:"\xE2",atilde:"\xE3",auml:"\xE4",aring:"\xE5",aelig:"\xE6",ccedil:"\xE7",egrave:"\xE8",eacute:"\xE9",ecirc:"\xEA",euml:"\xEB",igrave:"\xEC",iacute:"\xED",icirc:"\xEE",iuml:"\xEF",eth:"\xF0",ntilde:"\xF1",ograve:"\xF2",oacute:"\xF3",ocirc:"\xF4",otilde:"\xF5",ouml:"\xF6",divide:"\xF7",oslash:"\xF8",ugrave:"\xF9",uacute:"\xFA",ucirc:"\xFB",uuml:"\xFC",yacute:"\xFD",thorn:"\xFE",yuml:"\xFF",fnof:"\u0192",Alpha:"\u0391",Beta:"\u0392",Gamma:"\u0393",Delta:"\u0394",Epsilon:"\u0395",Zeta:"\u0396",Eta:"\u0397",Theta:"\u0398",Iota:"\u0399",Kappa:"\u039A",Lambda:"\u039B",Mu:"\u039C",Nu:"\u039D",Xi:"\u039E",Omicron:"\u039F",Pi:"\u03A0",Rho:"\u03A1",Sigma:"\u03A3",Tau:"\u03A4",Upsilon:"\u03A5",Phi:"\u03A6",Chi:"\u03A7",Psi:"\u03A8",Omega:"\u03A9",alpha:"\u03B1",beta:"\u03B2",gamma:"\u03B3",delta:"\u03B4",epsilon:"\u03B5",zeta:"\u03B6",eta:"\u03B7",theta:"\u03B8",iota:"\u03B9",kappa:"\u03BA",lambda:"\u03BB",mu:"\u03BC",nu:"\u03BD",xi:"\u03BE",omicron:"\u03BF",pi:"\u03C0",rho:"\u03C1",sigmaf:"\u03C2",sigma:"\u03C3",tau:"\u03C4",upsilon:"\u03C5",phi:"\u03C6",chi:"\u03C7",psi:"\u03C8",omega:"\u03C9",thetasym:"\u03D1",upsih:"\u03D2",piv:"\u03D6",bull:"\u2022",hellip:"\u2026",prime:"\u2032",Prime:"\u2033",oline:"\u203E",frasl:"\u2044",weierp:"\u2118",image:"\u2111",real:"\u211C",trade:"\u2122",alefsym:"\u2135",larr:"\u2190",uarr:"\u2191",rarr:"\u2192",darr:"\u2193",harr:"\u2194",crarr:"\u21B5",lArr:"\u21D0",uArr:"\u21D1",rArr:"\u21D2",dArr:"\u21D3",hArr:"\u21D4",forall:"\u2200",part:"\u2202",exist:"\u2203",empty:"\u2205",nabla:"\u2207",isin:"\u2208",notin:"\u2209",ni:"\u220B",prod:"\u220F",sum:"\u2211",minus:"\u2212",lowast:"\u2217",radic:"\u221A",prop:"\u221D",infin:"\u221E",ang:"\u2220",and:"\u2227",or:"\u2228",cap:"\u2229",cup:"\u222A",int:"\u222B",there4:"\u2234",sim:"\u223C",cong:"\u2245",asymp:"\u2248",ne:"\u2260",equiv:"\u2261",le:"\u2264",ge:"\u2265",sub:"\u2282",sup:"\u2283",nsub:"\u2284",sube:"\u2286",supe:"\u2287",oplus:"\u2295",otimes:"\u2297",perp:"\u22A5",sdot:"\u22C5",lceil:"\u2308",rceil:"\u2309",lfloor:"\u230A",rfloor:"\u230B",lang:"\u2329",rang:"\u232A",loz:"\u25CA",spades:"\u2660",clubs:"\u2663",hearts:"\u2665",diams:"\u2666",quot:'"',amp:"&",lt:"<",gt:">",OElig:"\u0152",oelig:"\u0153",Scaron:"\u0160",scaron:"\u0161",Yuml:"\u0178",circ:"\u02C6",tilde:"\u02DC",ensp:"\u2002",emsp:"\u2003",thinsp:"\u2009",zwnj:"\u200C",zwj:"\u200D",lrm:"\u200E",rlm:"\u200F",ndash:"\u2013",mdash:"\u2014",lsquo:"\u2018",rsquo:"\u2019",sbquo:"\u201A",ldquo:"\u201C",rdquo:"\u201D",bdquo:"\u201E",dagger:"\u2020",Dagger:"\u2021",permil:"\u2030",lsaquo:"\u2039",rsaquo:"\u203A",euro:"\u20AC"};var Br=["cent","copy","divide","gt","lt","not","para","times"];var Nr={}.hasOwnProperty,en={},ut;for(ut in ct)Nr.call(ct,ut)&&(en[ct[ut]]=ut);var pa=/[^\dA-Za-z]/;function Tr(e,t,n,r){let o=String.fromCharCode(e);if(Nr.call(en,o)){let s=en[o],a="&"+s;return n&&Ir.includes(s)&&!Br.includes(s)&&(!r||t&&t!==61&&pa.test(String.fromCharCode(t)))?a:a+";"}return""}function Lr(e,t,n){let r=Rr(e,t,n.omitOptionalSemicolons),o;if((n.useNamedReferences||n.useShortestReferences)&&(o=Tr(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!o)&&n.useShortestReferences){let s=Ar(e,t,n.omitOptionalSemicolons);s.length<r.length&&(r=s)}return o&&(!n.useShortestReferences||o.length<r.length)?o:r}function K(e,t){return Er(e,Object.assign({format:Lr},t))}var ma=/^>|^->|<!--|-->|--!>|<!-$/g,ba=[">"],ya=["<",">"];function Pr(e,t,n,r){return r.settings.bogusComments?"<?"+K(e.value,Object.assign({},r.settings.characterReferences,{subset:ba}))+">":"<!--"+e.value.replace(ma,o)+"-->";function o(s){return K(s,Object.assign({},r.settings.characterReferences,{subset:ya}))}}function Mr(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function tn(e,t){let n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,o=n.indexOf(t);for(;o!==-1;)r++,o=n.indexOf(t,o+t.length);return r}function $r(e,t){let n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Gr(e){return e.join(" ").trim()}var ka=/[ \t\n\f\r]/g;function de(e){return typeof e=="object"?e.type==="text"?Or(e.value):!1:Or(e)}function Or(e){return e.replace(ka,"")===""}var A=Fr(1),nn=Fr(-1),wa=[];function Fr(e){return t;function t(n,r,o){let s=n?n.children:wa,a=(r||0)+e,i=s[a];if(!o)for(;i&&de(i);)a+=e,i=s[a];return i}}var Ca={}.hasOwnProperty;function dt(e){return t;function t(n,r,o){return Ca.call(e,n.tagName)&&e[n.tagName](n,r,o)}}var De=dt({body:_a,caption:rn,colgroup:rn,dd:Ra,dt:Ea,head:rn,html:Sa,li:xa,optgroup:Aa,option:Ia,p:va,rp:Dr,rt:Dr,tbody:Na,td:Ur,tfoot:Ta,th:Ur,thead:Ba,tr:La});function rn(e,t,n){let r=A(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&de(r.value.charAt(0)))}function Sa(e,t,n){let r=A(n,t);return!r||r.type!=="comment"}function _a(e,t,n){let r=A(n,t);return!r||r.type!=="comment"}function va(e,t,n){let r=A(n,t);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"||n.tagName.includes("-")))}function xa(e,t,n){let r=A(n,t);return!r||r.type==="element"&&r.tagName==="li"}function Ea(e,t,n){let r=A(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Ra(e,t,n){let r=A(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function Dr(e,t,n){let r=A(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Aa(e,t,n){let r=A(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function Ia(e,t,n){let r=A(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function Ba(e,t,n){let r=A(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function Na(e,t,n){let r=A(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function Ta(e,t,n){return!A(n,t)}function La(e,t,n){let r=A(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function Ur(e,t,n){let r=A(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}var Hr=dt({body:$a,colgroup:Ga,head:Ma,html:Pa,tbody:Oa});function Pa(e){let t=A(e,-1);return!t||t.type!=="comment"}function Ma(e){let t=new Set;for(let r of e.children)if(r.type==="element"&&(r.tagName==="base"||r.tagName==="title")){if(t.has(r.tagName))return!1;t.add(r.tagName)}let n=e.children[0];return!n||n.type==="element"}function $a(e){let t=A(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&de(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function Ga(e,t,n){let r=nn(n,t);if(n&&r&&r.type==="element"&&r.tagName==="colgroup"&&De(r,n.children.indexOf(r),n))return!1;let o=A(e,-1,!0);return!!(o&&o.type==="element"&&o.tagName==="col")}function Oa(e,t,n){let r=nn(n,t);if(n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&De(r,n.children.indexOf(r),n))return!1;let o=A(e,-1);return!!(o&&o.type==="element"&&o.tagName==="tr")}var ft={name:[[`
4
4
  \f\r &/=>`.split(""),`
5
5
  \f\r "&'/=>\``.split("")],[`\0
6
6
  \f\r "&'/<=>`.split(""),`\0
@@ -8,8 +8,8 @@
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("")]]},Oa=new Set(["desc","foreignObject","title"]);function jr(e,t,n,r){let{schema:o}=r,s=o.space==="svg"?!1:r.settings.omitOptionalTags,a=o.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),i=[];o.space==="html"&&e.tagName==="svg"&&(r.schema=lt);let l=Fa(r,e.properties);r.schema.space==="svg"&&Oa.has(e.tagName)&&(r.schema=it);let c=r.all(o.space==="html"&&e.tagName==="template"?e.content:e);if(r.schema=o,c&&(a=!1),l||!s||!Hr(e,t,n)){if(i.push("<",e.tagName,l?" "+l:""),a&&(o.space==="svg"||r.settings.closeSelfClosing)){let u=l.charAt(l.length-1);(!r.settings.tightSelfClosing||u==="/"||u&&u!=='"'&&u!=="'")&&i.push(" "),i.push("/")}i.push(">")}return i.push(c),!a&&(!s||!De(e,t,n))&&i.push("</"+e.tagName+">"),i.join("")}function Fa(e,t){let n=[],r=-1,o;if(t){for(o in t)if(t[o]!==null&&t[o]!==void 0){let s=Da(e,o,t[o]);s&&n.push(s)}}for(;++r<n.length;){let s=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&s!=='"'&&s!=="'"&&(n[r]+=" ")}return n.join("")}function Da(e,t,n){let r=Zt(e.schema,t),o=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,s=e.settings.allowDangerousCharacters?0:1;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"";let a=Y(r.attribute,Object.assign({},e.settings.characterReferences,{subset:ft.name[o][s]}));if(n===!0||(n=Array.isArray(n)?(r.commaSeparated?$r:Gr)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n))return a;let i;if(e.settings.preferUnquoted&&(i=Y(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:ft.unquoted[o][s]}))),i!==n){let{quote:l}=e;e.settings.quoteSmart&&tn(n,l)>tn(n,e.alternative)&&(l=e.alternative),i=l+Y(n,Object.assign({},e.settings.characterReferences,{subset:(l==="'"?ft.single:ft.double)[o][s],attribute:!0}))+l}return a+(i&&"="+i)}var Ua=["<","&"];function gt(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Y(e.value,Object.assign({},r.settings.characterReferences,{subset:Ua}))}function Wr(e,t,n,r){return r.settings.allowDangerousHtml?e.value:gt(e,t,n,r)}function zr(e,t,n,r){return r.all(e)}var qr=vr("type",{invalid:Ha,unknown:ja,handlers:{comment:Pr,doctype:Mr,element:jr,raw:Wr,root:zr,text:gt}});function Ha(e){throw new Error("Expected node, not `"+e+"`")}function ja(e){let t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}var Wa={},za={},qa=[];function on(e,t){let n=t||Wa,r=n.quote||'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");let o=r==='"'?"'":'"';return{one:Va,all:Xa,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||yr,characterReferences:n.characterReferences||za,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?lt:it,quote:r,alternative:o}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function Va(e,t,n){return qr(e,t,n,this)}function Xa(e){let t=[],n=e&&e.children||qa,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}var Vr=/\s+/g;function Kr(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(Vr)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(Vr);for(let r of n)r&&!e.properties.class.includes(r)&&e.properties.class.push(r);return e}function Qa(e){let t=ke(e,!0).map(([o])=>o);function n(o){if(o===e.length)return{line:t.length-1,character:t.at(-1).length};let s=o,a=0;for(let i of t){if(s<i.length)break;s-=i.length,a++}return{line:a,character:s}}function r(o,s){let a=0;for(let i=0;i<o;i++)a+=t[i].length;return a+=s,a}return{lines:t,indexToPos:n,posToIndex:r}}var Ka=["color","background-color"];function Ya(e,t){let n=0,r=[];for(let o of t)o>n&&r.push({...e,content:e.content.slice(n,o),offset:e.offset+n}),n=o;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function Ja(e,t){let n=0,r=e.length;for(;n<r;){let o=n+(r-n>>1);e[o]<=t?n=o+1:r=o}return n}function Za(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((r,o)=>r-o);return n.length?e.map(r=>r.flatMap(o=>{let s=o.offset+o.content.length,a=Ja(n,o.offset),i=a;for(;i<n.length&&n[i]<s;)i++;if(a===i)return o;let l=n.slice(a,i);for(let c=0;c<l.length;c++)l[c]-=o.offset;return Ya(o,l)})):e}function ei(e,t,n,r,o="css-vars"){let s={content:e.content,explanation:e.explanation,offset:e.offset},a=t.map(u=>ht(e.variants[u])),i=new Set(a.flatMap(u=>Object.keys(u))),l={},c=(u,d)=>{let f=d==="color"?"":d==="background-color"?"-bg":`-${d}`;return n+t[u]+(d==="color"?"":f)};return a.forEach((u,d)=>{for(let f of i){let g=u[f]||"inherit";if(d===0&&r&&Ka.includes(f))if(r==="light-dark()"&&a.length>1){let h=t.findIndex(b=>b==="light"),y=t.findIndex(b=>b==="dark");if(h===-1||y===-1)throw new E('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let k=a[h][f]||"inherit",m=a[y][f]||"inherit";l[f]=`light-dark(${k}, ${m})`,o==="css-vars"&&(l[c(d,f)]=g)}else l[f]=g;else o==="css-vars"&&(l[c(d,f)]=g)}}),s.htmlStyle=l,s}function ht(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&P.Italic&&(t["font-style"]="italic"),e.fontStyle&P.Bold&&(t["font-weight"]="bold");let n=[];e.fontStyle&P.Underline&&n.push("underline"),e.fontStyle&P.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function an(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}function ti(){let e=new WeakMap;function t(n){if(!e.has(n.meta)){let o=function(a){if(typeof a=="number"){if(a<0||a>n.source.length)throw new E(`Invalid decoration offset: ${a}. Code length: ${n.source.length}`);return{...r.indexToPos(a),offset:a}}else{let i=r.lines[a.line];if(i===void 0)throw new E(`Invalid decoration position ${JSON.stringify(a)}. Lines length: ${r.lines.length}`);let l=a.character;if(l<0&&(l=i.length+l),l<0||l>i.length)throw new E(`Invalid decoration position ${JSON.stringify(a)}. Line ${a.line} length: ${i.length}`);return{...a,character:l,offset:r.posToIndex(a.line,l)}}},r=Qa(n.source),s=(n.options.decorations||[]).map(a=>({...a,start:o(a.start),end:o(a.end)}));ni(s),e.set(n.meta,{decorations:s,converter:r,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(this.options.decorations?.length)return Za(n,t(this).decorations.flatMap(r=>[r.start.offset,r.end.offset]))},code(n){if(!this.options.decorations?.length)return;let r=t(this),o=[...n.children].filter(u=>u.type==="element"&&u.tagName==="span");if(o.length!==r.converter.lines.length)throw new E(`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 s(u,d,f,g){let h=o[u],y="",k=-1,m=-1;if(d===0&&(k=0),f===0&&(m=0),f===Number.POSITIVE_INFINITY&&(m=h.children.length),k===-1||m===-1)for(let w=0;w<h.children.length;w++)y+=Yr(h.children[w]),k===-1&&y.length===d&&(k=w+1),m===-1&&y.length===f&&(m=w+1);if(k===-1)throw new E(`Failed to find start index for decoration ${JSON.stringify(g.start)}`);if(m===-1)throw new E(`Failed to find end index for decoration ${JSON.stringify(g.end)}`);let b=h.children.slice(k,m);if(!g.alwaysWrap&&b.length===h.children.length)i(h,g,"line");else if(!g.alwaysWrap&&b.length===1&&b[0].type==="element")i(b[0],g,"token");else{let w={type:"element",tagName:"span",properties:{},children:b};i(w,g,"wrapper"),h.children.splice(k,b.length,w)}}function a(u,d){o[u]=i(o[u],d,"line")}function i(u,d,f){let g=d.properties||{},h=d.transform||(y=>y);return u.tagName=d.tagName||"span",u.properties={...u.properties,...g,class:u.properties.class},d.properties?.class&&Kr(u,d.properties.class),u=h(u,f)||u,u}let l=[],c=r.decorations.sort((u,d)=>d.start.offset-u.start.offset||u.end.offset-d.end.offset);for(let u of c){let{start:d,end:f}=u;if(d.line===f.line)s(d.line,d.character,f.character,u);else if(d.line<f.line){s(d.line,d.character,Number.POSITIVE_INFINITY,u);for(let g=d.line+1;g<f.line;g++)l.unshift(()=>a(g,u));s(f.line,0,f.character,u)}}l.forEach(u=>u())}}}function ni(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new E(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let o=e[r],s=n.start.offset<=o.start.offset&&o.start.offset<n.end.offset,a=n.start.offset<o.end.offset&&o.end.offset<=n.end.offset,i=o.start.offset<=n.start.offset&&n.start.offset<o.end.offset,l=o.start.offset<n.end.offset&&n.end.offset<=o.end.offset;if(s||a||i||l){if(s&&a||i&&l||i&&n.start.offset===n.end.offset||a&&o.start.offset===o.end.offset)continue;throw new E(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(o.start)} intersect.`)}}}}function Yr(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(Yr).join(""):""}var ri=[ti()];function pt(e){let t=oi(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...ri]}function oi(e){let t=[],n=[],r=[];for(let o of e)switch(o.enforce){case"pre":t.push(o);break;case"post":n.push(o);break;default:r.push(o)}return{pre:t,post:n,normal:r}}var fe=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],sn={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function si(e,t){let n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){let r=e.indexOf("m",n);if(r!==-1)return{sequence:e.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:e.length}}function Xr(e){let t=e.shift();if(t==="2"){let n=e.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(t==="5"){let n=e.shift();if(n)return{type:"table",index:Number(n)}}}function ai(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:"resetAll"});else if(r<=9)sn[r]&&t.push({type:"setDecoration",value:sn[r]});else if(r<=29){let o=sn[r-20];o&&(t.push({type:"resetDecoration",value:o}),o==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:fe[r-30]}});else if(r===38){let o=Xr(e);o&&t.push({type:"setForegroundColor",value:o})}else if(r===39)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:fe[r-40]}});else if(r===48){let o=Xr(e);o&&t.push({type:"setBackgroundColor",value:o})}else r===49?t.push({type:"resetBackgroundColor"}):r===53?t.push({type:"setDecoration",value:"overline"}):r===55?t.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:fe[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:fe[r-100+8]}})}return t}function ii(){let e=null,t=null,n=new Set;return{parse(r){let o=[],s=0;do{let a=si(r,s),i=a.sequence?r.substring(s,a.startPosition):r.substring(s);if(i.length>0&&o.push({value:i,foreground:e,background:t,decorations:new Set(n)}),a.sequence){let l=ai(a.sequence);for(let c of l)c.type==="resetAll"?(e=null,t=null,n.clear()):c.type==="resetForegroundColor"?e=null:c.type==="resetBackgroundColor"?t=null:c.type==="resetDecoration"&&n.delete(c.value);for(let c of l)c.type==="setForegroundColor"?e=c.value:c.type==="setBackgroundColor"?t=c.value:c.type==="setDecoration"&&n.add(c.value)}s=a.position}while(s<r.length);return o}}}var li={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 ci(e=li){function t(i){return e[i]}function n(i){return`#${i.map(l=>Math.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let r;function o(){if(r)return r;r=[];for(let c=0;c<fe.length;c++)r.push(t(fe[c]));let i=[0,95,135,175,215,255];for(let c=0;c<6;c++)for(let u=0;u<6;u++)for(let d=0;d<6;d++)r.push(n([i[c],i[u],i[d]]));let l=8;for(let c=0;c<24;c++,l+=10)r.push(n([l,l,l]));return r}function s(i){return o()[i]}function a(i){switch(i.type){case"named":return t(i.name);case"rgb":return n(i.rgb);case"table":return s(i.index)}}return{value:a}}var ui=/#([0-9a-f]{3,8})/i,di=/var\((--[\w-]+-ansi-[\w-]+)\)/,fi={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 gi(e,t,n){let r=Pe(e,n),o=ke(t),s=ci(Object.fromEntries(fe.map(i=>{let l=`terminal.ansi${i[0].toUpperCase()}${i.substring(1)}`;return[i,e.colors?.[l]||fi[i]]}))),a=ii();return o.map(i=>a.parse(i[0]).map(l=>{let c,u;l.decorations.has("reverse")?(c=l.background?s.value(l.background):e.bg,u=l.foreground?s.value(l.foreground):e.fg):(c=l.foreground?s.value(l.foreground):e.fg,u=l.background?s.value(l.background):void 0),c=X(c,r),u=X(u,r),l.decorations.has("dim")&&(c=hi(c));let d=P.None;return l.decorations.has("bold")&&(d|=P.Bold),l.decorations.has("italic")&&(d|=P.Italic),l.decorations.has("underline")&&(d|=P.Underline),l.decorations.has("strikethrough")&&(d|=P.Strikethrough),{content:l.value,offset:i[1],color:c,bgColor:u,fontStyle:d}}))}function hi(e){let t=e.match(ui);if(t){let r=t[1];if(r.length===8){let 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){let o=r[0],s=r[1],a=r[2],i=r[3];return`#${o}${o}${s}${s}${a}${a}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,"0")}`}else if(r.length===3){let o=r[0],s=r[1],a=r[2];return`#${o}${o}${s}${s}${a}${a}80`}}}let n=e.match(di);return n?`var(${n[1]}-dim)`:e}function ln(e,t,n={}){let r=e.resolveLangAlias(n.lang||"text"),{theme:o=e.getLoadedThemes()[0]}=n;if(!Me(r)&&!$e(o)&&r==="ansi"){let{theme:s}=e.setTheme(o);return gi(s,t,n)}return zt(e,t,n)}function mt(e,t,n){let r,o,s,a,i,l;if("themes"in n){let{defaultColor:c="light",cssVariablePrefix:u="--shiki-",colorsRendering:d="css-vars"}=n,f=Object.entries(n.themes).filter(m=>m[1]).map(m=>({color:m[0],theme:m[1]})).sort((m,b)=>m.color===c?-1:b.color===c?1:0);if(f.length===0)throw new E("`themes` option must not be empty");let g=rt(e,t,n,ln);if(l=we(g),c&&c!=="light-dark()"&&!f.some(m=>m.color===c))throw new E(`\`themes\` option must contain the defaultColor key \`${c}\``);let h=f.map(m=>e.getTheme(m.theme)),y=f.map(m=>m.color);s=g.map(m=>m.map(b=>ei(b,y,u,c,d))),l&&Ge(s,l);let k=f.map(m=>Pe(m.theme,n));o=Qr(f,h,k,u,c,"fg",d),r=Qr(f,h,k,u,c,"bg",d),a=`shiki-themes ${h.map(m=>m.name).join(" ")}`,i=c?void 0:[o,r].join(";")}else if("theme"in n){let c=Pe(n.theme,n);s=ln(e,t,n);let u=e.getTheme(n.theme);r=X(u.bg,c),o=X(u.fg,c),a=u.name,l=we(s)}else throw new E("Invalid options, either `theme` or `themes` must be provided");return{tokens:s,fg:o,bg:r,themeName:a,rootStyle:i,grammarState:l}}function Qr(e,t,n,r,o,s,a){return e.map((i,l)=>{let c=X(t[l][s],n[l])||"inherit",u=`${r+i.color}${s==="bg"?"-bg":""}:${c}`;if(l===0&&o){if(o==="light-dark()"&&e.length>1){let d=e.findIndex(g=>g.color==="light"),f=e.findIndex(g=>g.color==="dark");if(d===-1||f===-1)throw new E('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${X(t[d][s],n[d])||"inherit"}, ${X(t[f][s],n[f])||"inherit"});${u}`}return c}return a==="css-vars"?u:null}).filter(i=>!!i).join(";")}var Jr=/^\s+$/,pi=/^(\s*)(.*?)(\s*)$/;function bt(e,t,n,r={meta:{},options:n,codeToHast:(o,s)=>bt(e,o,s),codeToTokens:(o,s)=>mt(e,o,s)}){let o=t;for(let h of pt(n))o=h.preprocess?.call(r,o,n)||o;let{tokens:s,fg:a,bg:i,themeName:l,rootStyle:c,grammarState:u}=mt(e,o,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?s=bi(s):d==="never"&&(s=yi(s)),f&&(s=ki(s));let g={...r,get source(){return o}};for(let h of pt(n))s=h.tokens?.call(g,s)||s;return mi(s,{...n,fg:a,bg:i,themeName:l,rootStyle:n.rootStyle===!1?!1:n.rootStyle??c},g,u)}function mi(e,t,n,r=we(e)){let o=pt(t),s=[],a={type:"root",children:[]},{structure:i="classic",tabindex:l="0"}=t,c={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?c.style=t.rootStyle:c.style=`background-color:${t.bg};color:${t.fg}`),l!==!1&&l!=null&&(c.tabindex=l.toString());for(let[y,k]of Object.entries(t.meta||{}))y.startsWith("_")||(c[y]=k);let u={type:"element",tagName:"pre",properties:c,children:[],data:t.data},d={type:"element",tagName:"code",properties:{},children:s},f=[],g={...n,structure:i,addClassToHast:Kr,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return a},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((y,k)=>{k&&(i==="inline"?a.children.push({type:"element",tagName:"br",properties:{},children:[]}):i==="classic"&&s.push({type:"text",value:`
12
- `}));let m={type:"element",tagName:"span",properties:{class:"line"},children:[]},b=0;for(let w of y){let _={type:"element",tagName:"span",properties:{...w.htmlAttrs},children:[{type:"text",value:w.content}]},x=an(w.htmlStyle||ht(w));x&&(_.properties.style=x);for(let L of o)_=L?.span?.call(g,_,k+1,b,m,w)||_;i==="inline"?a.children.push(_):i==="classic"&&m.children.push(_),b+=w.content.length}if(i==="classic"){for(let w of o)m=w?.line?.call(g,m,k+1)||m;f.push(m),s.push(m)}else i==="inline"&&f.push(m)}),i==="classic"){for(let y of o)d=y?.code?.call(g,d)||d;u.children.push(d);for(let y of o)u=y?.pre?.call(g,u)||u;a.children.push(u)}else if(i==="inline"){let y=[],k={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(let b of a.children)b.type==="element"&&b.tagName==="br"?(y.push(k),k={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(b.type==="element"||b.type==="text")&&k.children.push(b);y.push(k);let m={type:"element",tagName:"code",properties:{},children:y};for(let b of o)m=b?.code?.call(g,m)||m;a.children=[];for(let b=0;b<m.children.length;b++){b>0&&a.children.push({type:"element",tagName:"br",properties:{},children:[]});let w=m.children[b];w.type==="element"&&a.children.push(...w.children)}}let h=a;for(let y of o)h=y?.root?.call(g,h)||h;return r&&Ge(h,r),h}function bi(e){return e.map(t=>{let n=[],r="",o;return t.forEach((s,a)=>{let i=!(s.fontStyle&&(s.fontStyle&P.Underline||s.fontStyle&P.Strikethrough));i&&Jr.test(s.content)&&t[a+1]?(o===void 0&&(o=s.offset),r+=s.content):r?(i?n.push({...s,offset:o,content:r+s.content}):n.push({content:r,offset:o},s),o=void 0,r=""):n.push(s)}),n})}function yi(e){return e.map(t=>t.flatMap(n=>{if(Jr.test(n.content))return n;let r=n.content.match(pi);if(!r)return n;let[,o,s,a]=r;if(!o&&!a)return n;let i=[{...n,offset:n.offset+o.length,content:s}];return o&&i.unshift({content:o,offset:n.offset}),a&&i.push({content:a,offset:n.offset+o.length+s.length}),i}))}function ki(e){return e.map(t=>{let n=[];for(let r of t){if(n.length===0){n.push({...r});continue}let o=n.at(-1),s=an(o.htmlStyle||ht(o)),a=an(r.htmlStyle||ht(r)),i=o.fontStyle&&(o.fontStyle&P.Underline||o.fontStyle&P.Strikethrough),l=r.fontStyle&&(r.fontStyle&P.Underline||r.fontStyle&P.Strikethrough);!i&&!l&&s===a?o.content+=r.content:n.push({...r})}return n})}var wi=on;function Ci(e,t,n){let r={meta:{},options:n,codeToHast:(s,a)=>bt(e,s,a),codeToTokens:(s,a)=>mt(e,s,a)},o=wi(bt(e,t,n,r));for(let s of pt(n))o=s.postprocess?.call(r,o,n)||o;return o}async function Zr(e){let t=await Wt(e);return{getLastGrammarState:(...n)=>mr(t,...n),codeToTokensBase:(n,r)=>ln(t,n,r),codeToTokensWithThemes:(n,r)=>rt(t,n,r),codeToTokens:(n,r)=>mt(t,n,r),codeToHast:(n,r)=>bt(t,n,r),codeToHtml:(n,r)=>Ci(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Si(e){return!e.sticky&&!e.rawOptions?.strategy}function eo(e,t){return{index:e,captureIndices:t.map(n=>n==null?{start:4294967295,end:4294967295,length:0}:{start:n[0],end:n[1],length:n[1]-n[0]})}}var to=class{patterns;options;regexps;lastSearches;constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:o}=t;if(!o)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(s=>{if(typeof s!="string")return s;let a=r?.get(s);if(a){if(a instanceof RegExp)return a;if(n)return null;throw a}try{let i=o(s);return r?.set(s,i),i}catch(i){if(r?.set(s,i),n)return null;throw i}}),this.lastSearches=this.regexps.map(s=>s&&Si(s)?{strId:0,searchedFrom:0,matchIndex:-1,indices:null}:null)}findNextMatchSync(e,t,n){let r=typeof e=="string"?e:e.content,o=typeof e=="string"?0:e.id||0,s=-1,a=0,i=null;for(let l=0;l<this.regexps.length;l++){let c=this.regexps[l];if(c)try{let u=o?this.lastSearches[l]:null,d,f;if(u&&u.strId===o&&u.searchedFrom<=t&&(u.matchIndex===-1||u.matchIndex>=t))d=u.matchIndex,f=u.indices;else{c.lastIndex=t;let g=c.exec(r);d=g?g.index:-1,f=g?g.indices:null,u&&(u.strId=o,u.searchedFrom=t,u.matchIndex=d,u.indices=f)}if(d===-1)continue;if(d===t)return eo(l,f);(s===-1||d<a)&&(s=l,a=d,i=f)}catch(u){if(this.options.forgiving)continue;throw u}}return s===-1?null:eo(s,i)}},_i=0;function no(e){return{content:e,id:++_i}}function oe(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function ro(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var Ue=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),B=String.raw;function J(e,t){if(e==null)throw new Error(t??"Value expected");return e}var co=B`\[\^?`,uo=`c.? | C(?:-.?)?|${B`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${B`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${B`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${B`o\{[^\}]*\}?`}|${B`\d{1,3}`}`,un=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,yt=new RegExp(B`
11
+ \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]},Fa=new Set(["desc","foreignObject","title"]);function jr(e,t,n,r){let{schema:o}=r,s=o.space==="svg"?!1:r.settings.omitOptionalTags,a=o.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase()),i=[];o.space==="html"&&e.tagName==="svg"&&(r.schema=lt);let l=Da(r,e.properties);r.schema.space==="svg"&&Fa.has(e.tagName)&&(r.schema=it);let c=r.all(o.space==="html"&&e.tagName==="template"?e.content:e);if(r.schema=o,c&&(a=!1),l||!s||!Hr(e,t,n)){if(i.push("<",e.tagName,l?" "+l:""),a&&(o.space==="svg"||r.settings.closeSelfClosing)){let u=l.charAt(l.length-1);(!r.settings.tightSelfClosing||u==="/"||u&&u!=='"'&&u!=="'")&&i.push(" "),i.push("/")}i.push(">")}return i.push(c),!a&&(!s||!De(e,t,n))&&i.push("</"+e.tagName+">"),i.join("")}function Da(e,t){let n=[],r=-1,o;if(t){for(o in t)if(t[o]!==null&&t[o]!==void 0){let s=Ua(e,o,t[o]);s&&n.push(s)}}for(;++r<n.length;){let s=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&s!=='"'&&s!=="'"&&(n[r]+=" ")}return n.join("")}function Ua(e,t,n){let r=Zt(e.schema,t),o=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,s=e.settings.allowDangerousCharacters?0:1;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"";let a=K(r.attribute,Object.assign({},e.settings.characterReferences,{subset:ft.name[o][s]}));if(n===!0||(n=Array.isArray(n)?(r.commaSeparated?$r:Gr)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n))return a;let i;if(e.settings.preferUnquoted&&(i=K(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:ft.unquoted[o][s]}))),i!==n){let{quote:l}=e;e.settings.quoteSmart&&tn(n,l)>tn(n,e.alternative)&&(l=e.alternative),i=l+K(n,Object.assign({},e.settings.characterReferences,{subset:(l==="'"?ft.single:ft.double)[o][s],attribute:!0}))+l}return a+(i&&"="+i)}var Ha=["<","&"];function gt(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:K(e.value,Object.assign({},r.settings.characterReferences,{subset:Ha}))}function Wr(e,t,n,r){return r.settings.allowDangerousHtml?e.value:gt(e,t,n,r)}function zr(e,t,n,r){return r.all(e)}var qr=vr("type",{invalid:ja,unknown:Wa,handlers:{comment:Pr,doctype:Mr,element:jr,raw:Wr,root:zr,text:gt}});function ja(e){throw new Error("Expected node, not `"+e+"`")}function Wa(e){let t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}var za={},qa={},Va=[];function on(e,t){let n=t||za,r=n.quote||'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");let o=r==='"'?"'":'"';return{one:Xa,all:Qa,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||yr,characterReferences:n.characterReferences||qa,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?lt:it,quote:r,alternative:o}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function Xa(e,t,n){return qr(e,t,n,this)}function Qa(e){let t=[],n=e&&e.children||Va,r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}var Vr=/\s+/g;function Jr(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(Vr)),Array.isArray(e.properties.class)||(e.properties.class=[]);let n=Array.isArray(t)?t:t.split(Vr);for(let r of n)r&&!e.properties.class.includes(r)&&e.properties.class.push(r);return e}function Ja(e){let t=ke(e,!0).map(([o])=>o);function n(o){if(o===e.length)return{line:t.length-1,character:t.at(-1).length};let s=o,a=0;for(let i of t){if(s<i.length)break;s-=i.length,a++}return{line:a,character:s}}function r(o,s){let a=0;for(let i=0;i<o;i++)a+=t[i].length;return a+=s,a}return{lines:t,indexToPos:n,posToIndex:r}}var Ka=["color","background-color"];function Ya(e,t){let n=0,r=[];for(let o of t)o>n&&r.push({...e,content:e.content.slice(n,o),offset:e.offset+n}),n=o;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function Za(e,t){let n=0,r=e.length;for(;n<r;){let o=n+(r-n>>1);e[o]<=t?n=o+1:r=o}return n}function ei(e,t){let n=[...t instanceof Set?t:new Set(t)].sort((r,o)=>r-o);return n.length?e.map(r=>r.flatMap(o=>{let s=o.offset+o.content.length,a=Za(n,o.offset),i=a;for(;i<n.length&&n[i]<s;)i++;if(a===i)return o;let l=n.slice(a,i);for(let c=0;c<l.length;c++)l[c]-=o.offset;return Ya(o,l)})):e}function ti(e,t,n,r,o="css-vars"){let s={content:e.content,explanation:e.explanation,offset:e.offset},a=t.map(u=>ht(e.variants[u])),i=new Set(a.flatMap(u=>Object.keys(u))),l={},c=(u,d)=>{let f=d==="color"?"":d==="background-color"?"-bg":`-${d}`;return n+t[u]+(d==="color"?"":f)};return a.forEach((u,d)=>{for(let f of i){let g=u[f]||"inherit";if(d===0&&r&&Ka.includes(f))if(r==="light-dark()"&&a.length>1){let h=t.findIndex(b=>b==="light"),y=t.findIndex(b=>b==="dark");if(h===-1||y===-1)throw new E('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');let k=a[h][f]||"inherit",m=a[y][f]||"inherit";l[f]=`light-dark(${k}, ${m})`,o==="css-vars"&&(l[c(d,f)]=g)}else l[f]=g;else o==="css-vars"&&(l[c(d,f)]=g)}}),s.htmlStyle=l,s}function ht(e){let t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&P.Italic&&(t["font-style"]="italic"),e.fontStyle&P.Bold&&(t["font-weight"]="bold");let n=[];e.fontStyle&P.Underline&&n.push("underline"),e.fontStyle&P.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function an(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}function ni(){let e=new WeakMap;function t(n){if(!e.has(n.meta)){let o=function(a){if(typeof a=="number"){if(a<0||a>n.source.length)throw new E(`Invalid decoration offset: ${a}. Code length: ${n.source.length}`);return{...r.indexToPos(a),offset:a}}else{let i=r.lines[a.line];if(i===void 0)throw new E(`Invalid decoration position ${JSON.stringify(a)}. Lines length: ${r.lines.length}`);let l=a.character;if(l<0&&(l=i.length+l),l<0||l>i.length)throw new E(`Invalid decoration position ${JSON.stringify(a)}. Line ${a.line} length: ${i.length}`);return{...a,character:l,offset:r.posToIndex(a.line,l)}}},r=Ja(n.source),s=(n.options.decorations||[]).map(a=>({...a,start:o(a.start),end:o(a.end)}));ri(s),e.set(n.meta,{decorations:s,converter:r,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(this.options.decorations?.length)return ei(n,t(this).decorations.flatMap(r=>[r.start.offset,r.end.offset]))},code(n){if(!this.options.decorations?.length)return;let r=t(this),o=[...n.children].filter(u=>u.type==="element"&&u.tagName==="span");if(o.length!==r.converter.lines.length)throw new E(`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 s(u,d,f,g){let h=o[u],y="",k=-1,m=-1;if(d===0&&(k=0),f===0&&(m=0),f===Number.POSITIVE_INFINITY&&(m=h.children.length),k===-1||m===-1)for(let w=0;w<h.children.length;w++)y+=Kr(h.children[w]),k===-1&&y.length===d&&(k=w+1),m===-1&&y.length===f&&(m=w+1);if(k===-1)throw new E(`Failed to find start index for decoration ${JSON.stringify(g.start)}`);if(m===-1)throw new E(`Failed to find end index for decoration ${JSON.stringify(g.end)}`);let b=h.children.slice(k,m);if(!g.alwaysWrap&&b.length===h.children.length)i(h,g,"line");else if(!g.alwaysWrap&&b.length===1&&b[0].type==="element")i(b[0],g,"token");else{let w={type:"element",tagName:"span",properties:{},children:b};i(w,g,"wrapper"),h.children.splice(k,b.length,w)}}function a(u,d){o[u]=i(o[u],d,"line")}function i(u,d,f){let g=d.properties||{},h=d.transform||(y=>y);return u.tagName=d.tagName||"span",u.properties={...u.properties,...g,class:u.properties.class},d.properties?.class&&Jr(u,d.properties.class),u=h(u,f)||u,u}let l=[],c=r.decorations.sort((u,d)=>d.start.offset-u.start.offset||u.end.offset-d.end.offset);for(let u of c){let{start:d,end:f}=u;if(d.line===f.line)s(d.line,d.character,f.character,u);else if(d.line<f.line){s(d.line,d.character,Number.POSITIVE_INFINITY,u);for(let g=d.line+1;g<f.line;g++)l.unshift(()=>a(g,u));s(f.line,0,f.character,u)}}l.forEach(u=>u())}}}function ri(e){for(let t=0;t<e.length;t++){let n=e[t];if(n.start.offset>n.end.offset)throw new E(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){let o=e[r],s=n.start.offset<=o.start.offset&&o.start.offset<n.end.offset,a=n.start.offset<o.end.offset&&o.end.offset<=n.end.offset,i=o.start.offset<=n.start.offset&&n.start.offset<o.end.offset,l=o.start.offset<n.end.offset&&n.end.offset<=o.end.offset;if(s||a||i||l){if(s&&a||i&&l||i&&n.start.offset===n.end.offset||a&&o.start.offset===o.end.offset)continue;throw new E(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(o.start)} intersect.`)}}}}function Kr(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(Kr).join(""):""}var oi=[ni()];function pt(e){let t=si(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...oi]}function si(e){let t=[],n=[],r=[];for(let o of e)switch(o.enforce){case"pre":t.push(o);break;case"post":n.push(o);break;default:r.push(o)}return{pre:t,post:n,normal:r}}var fe=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],sn={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function ai(e,t){let n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){let r=e.indexOf("m",n);if(r!==-1)return{sequence:e.substring(n+2,r).split(";"),startPosition:n,position:r+1}}return{position:e.length}}function Xr(e){let t=e.shift();if(t==="2"){let n=e.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(t==="5"){let n=e.shift();if(n)return{type:"table",index:Number(n)}}}function ii(e){let t=[];for(;e.length>0;){let n=e.shift();if(!n)continue;let r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:"resetAll"});else if(r<=9)sn[r]&&t.push({type:"setDecoration",value:sn[r]});else if(r<=29){let o=sn[r-20];o&&(t.push({type:"resetDecoration",value:o}),o==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:fe[r-30]}});else if(r===38){let o=Xr(e);o&&t.push({type:"setForegroundColor",value:o})}else if(r===39)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:fe[r-40]}});else if(r===48){let o=Xr(e);o&&t.push({type:"setBackgroundColor",value:o})}else r===49?t.push({type:"resetBackgroundColor"}):r===53?t.push({type:"setDecoration",value:"overline"}):r===55?t.push({type:"resetDecoration",value:"overline"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:fe[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:fe[r-100+8]}})}return t}function li(){let e=null,t=null,n=new Set;return{parse(r){let o=[],s=0;do{let a=ai(r,s),i=a.sequence?r.substring(s,a.startPosition):r.substring(s);if(i.length>0&&o.push({value:i,foreground:e,background:t,decorations:new Set(n)}),a.sequence){let l=ii(a.sequence);for(let c of l)c.type==="resetAll"?(e=null,t=null,n.clear()):c.type==="resetForegroundColor"?e=null:c.type==="resetBackgroundColor"?t=null:c.type==="resetDecoration"&&n.delete(c.value);for(let c of l)c.type==="setForegroundColor"?e=c.value:c.type==="setBackgroundColor"?t=c.value:c.type==="setDecoration"&&n.add(c.value)}s=a.position}while(s<r.length);return o}}}var ci={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 ui(e=ci){function t(i){return e[i]}function n(i){return`#${i.map(l=>Math.max(0,Math.min(l,255)).toString(16).padStart(2,"0")).join("")}`}let r;function o(){if(r)return r;r=[];for(let c=0;c<fe.length;c++)r.push(t(fe[c]));let i=[0,95,135,175,215,255];for(let c=0;c<6;c++)for(let u=0;u<6;u++)for(let d=0;d<6;d++)r.push(n([i[c],i[u],i[d]]));let l=8;for(let c=0;c<24;c++,l+=10)r.push(n([l,l,l]));return r}function s(i){return o()[i]}function a(i){switch(i.type){case"named":return t(i.name);case"rgb":return n(i.rgb);case"table":return s(i.index)}}return{value:a}}var di=/#([0-9a-f]{3,8})/i,fi=/var\((--[\w-]+-ansi-[\w-]+)\)/,gi={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 hi(e,t,n){let r=Pe(e,n),o=ke(t),s=ui(Object.fromEntries(fe.map(i=>{let l=`terminal.ansi${i[0].toUpperCase()}${i.substring(1)}`;return[i,e.colors?.[l]||gi[i]]}))),a=li();return o.map(i=>a.parse(i[0]).map(l=>{let c,u;l.decorations.has("reverse")?(c=l.background?s.value(l.background):e.bg,u=l.foreground?s.value(l.foreground):e.fg):(c=l.foreground?s.value(l.foreground):e.fg,u=l.background?s.value(l.background):void 0),c=X(c,r),u=X(u,r),l.decorations.has("dim")&&(c=pi(c));let d=P.None;return l.decorations.has("bold")&&(d|=P.Bold),l.decorations.has("italic")&&(d|=P.Italic),l.decorations.has("underline")&&(d|=P.Underline),l.decorations.has("strikethrough")&&(d|=P.Strikethrough),{content:l.value,offset:i[1],color:c,bgColor:u,fontStyle:d}}))}function pi(e){let t=e.match(di);if(t){let r=t[1];if(r.length===8){let 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){let o=r[0],s=r[1],a=r[2],i=r[3];return`#${o}${o}${s}${s}${a}${a}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,"0")}`}else if(r.length===3){let o=r[0],s=r[1],a=r[2];return`#${o}${o}${s}${s}${a}${a}80`}}}let n=e.match(fi);return n?`var(${n[1]}-dim)`:e}function ln(e,t,n={}){let r=e.resolveLangAlias(n.lang||"text"),{theme:o=e.getLoadedThemes()[0]}=n;if(!Me(r)&&!$e(o)&&r==="ansi"){let{theme:s}=e.setTheme(o);return hi(s,t,n)}return zt(e,t,n)}function mt(e,t,n){let r,o,s,a,i,l;if("themes"in n){let{defaultColor:c="light",cssVariablePrefix:u="--shiki-",colorsRendering:d="css-vars"}=n,f=Object.entries(n.themes).filter(m=>m[1]).map(m=>({color:m[0],theme:m[1]})).sort((m,b)=>m.color===c?-1:b.color===c?1:0);if(f.length===0)throw new E("`themes` option must not be empty");let g=rt(e,t,n,ln);if(l=we(g),c&&c!=="light-dark()"&&!f.some(m=>m.color===c))throw new E(`\`themes\` option must contain the defaultColor key \`${c}\``);let h=f.map(m=>e.getTheme(m.theme)),y=f.map(m=>m.color);s=g.map(m=>m.map(b=>ti(b,y,u,c,d))),l&&Ge(s,l);let k=f.map(m=>Pe(m.theme,n));o=Qr(f,h,k,u,c,"fg",d),r=Qr(f,h,k,u,c,"bg",d),a=`shiki-themes ${h.map(m=>m.name).join(" ")}`,i=c?void 0:[o,r].join(";")}else if("theme"in n){let c=Pe(n.theme,n);s=ln(e,t,n);let u=e.getTheme(n.theme);r=X(u.bg,c),o=X(u.fg,c),a=u.name,l=we(s)}else throw new E("Invalid options, either `theme` or `themes` must be provided");return{tokens:s,fg:o,bg:r,themeName:a,rootStyle:i,grammarState:l}}function Qr(e,t,n,r,o,s,a){return e.map((i,l)=>{let c=X(t[l][s],n[l])||"inherit",u=`${r+i.color}${s==="bg"?"-bg":""}:${c}`;if(l===0&&o){if(o==="light-dark()"&&e.length>1){let d=e.findIndex(g=>g.color==="light"),f=e.findIndex(g=>g.color==="dark");if(d===-1||f===-1)throw new E('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${X(t[d][s],n[d])||"inherit"}, ${X(t[f][s],n[f])||"inherit"});${u}`}return c}return a==="css-vars"?u:null}).filter(i=>!!i).join(";")}var Yr=/^\s+$/,mi=/^(\s*)(.*?)(\s*)$/;function bt(e,t,n,r={meta:{},options:n,codeToHast:(o,s)=>bt(e,o,s),codeToTokens:(o,s)=>mt(e,o,s)}){let o=t;for(let h of pt(n))o=h.preprocess?.call(r,o,n)||o;let{tokens:s,fg:a,bg:i,themeName:l,rootStyle:c,grammarState:u}=mt(e,o,n),{mergeWhitespaces:d=!0,mergeSameStyleTokens:f=!1}=n;d===!0?s=yi(s):d==="never"&&(s=ki(s)),f&&(s=wi(s));let g={...r,get source(){return o}};for(let h of pt(n))s=h.tokens?.call(g,s)||s;return bi(s,{...n,fg:a,bg:i,themeName:l,rootStyle:n.rootStyle===!1?!1:n.rootStyle??c},g,u)}function bi(e,t,n,r=we(e)){let o=pt(t),s=[],a={type:"root",children:[]},{structure:i="classic",tabindex:l="0"}=t,c={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?c.style=t.rootStyle:c.style=`background-color:${t.bg};color:${t.fg}`),l!==!1&&l!=null&&(c.tabindex=l.toString());for(let[y,k]of Object.entries(t.meta||{}))y.startsWith("_")||(c[y]=k);let u={type:"element",tagName:"pre",properties:c,children:[],data:t.data},d={type:"element",tagName:"code",properties:{},children:s},f=[],g={...n,structure:i,addClassToHast:Jr,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return a},get pre(){return u},get code(){return d},get lines(){return f}};if(e.forEach((y,k)=>{k&&(i==="inline"?a.children.push({type:"element",tagName:"br",properties:{},children:[]}):i==="classic"&&s.push({type:"text",value:`
12
+ `}));let m={type:"element",tagName:"span",properties:{class:"line"},children:[]},b=0;for(let w of y){let _={type:"element",tagName:"span",properties:{...w.htmlAttrs},children:[{type:"text",value:w.content}]},x=an(w.htmlStyle||ht(w));x&&(_.properties.style=x);for(let L of o)_=L?.span?.call(g,_,k+1,b,m,w)||_;i==="inline"?a.children.push(_):i==="classic"&&m.children.push(_),b+=w.content.length}if(i==="classic"){for(let w of o)m=w?.line?.call(g,m,k+1)||m;f.push(m),s.push(m)}else i==="inline"&&f.push(m)}),i==="classic"){for(let y of o)d=y?.code?.call(g,d)||d;u.children.push(d);for(let y of o)u=y?.pre?.call(g,u)||u;a.children.push(u)}else if(i==="inline"){let y=[],k={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(let b of a.children)b.type==="element"&&b.tagName==="br"?(y.push(k),k={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(b.type==="element"||b.type==="text")&&k.children.push(b);y.push(k);let m={type:"element",tagName:"code",properties:{},children:y};for(let b of o)m=b?.code?.call(g,m)||m;a.children=[];for(let b=0;b<m.children.length;b++){b>0&&a.children.push({type:"element",tagName:"br",properties:{},children:[]});let w=m.children[b];w.type==="element"&&a.children.push(...w.children)}}let h=a;for(let y of o)h=y?.root?.call(g,h)||h;return r&&Ge(h,r),h}function yi(e){return e.map(t=>{let n=[],r="",o;return t.forEach((s,a)=>{let i=!(s.fontStyle&&(s.fontStyle&P.Underline||s.fontStyle&P.Strikethrough));i&&Yr.test(s.content)&&t[a+1]?(o===void 0&&(o=s.offset),r+=s.content):r?(i?n.push({...s,offset:o,content:r+s.content}):n.push({content:r,offset:o},s),o=void 0,r=""):n.push(s)}),n})}function ki(e){return e.map(t=>t.flatMap(n=>{if(Yr.test(n.content))return n;let r=n.content.match(mi);if(!r)return n;let[,o,s,a]=r;if(!o&&!a)return n;let i=[{...n,offset:n.offset+o.length,content:s}];return o&&i.unshift({content:o,offset:n.offset}),a&&i.push({content:a,offset:n.offset+o.length+s.length}),i}))}function wi(e){return e.map(t=>{let n=[];for(let r of t){if(n.length===0){n.push({...r});continue}let o=n.at(-1),s=an(o.htmlStyle||ht(o)),a=an(r.htmlStyle||ht(r)),i=o.fontStyle&&(o.fontStyle&P.Underline||o.fontStyle&P.Strikethrough),l=r.fontStyle&&(r.fontStyle&P.Underline||r.fontStyle&P.Strikethrough);!i&&!l&&s===a?o.content+=r.content:n.push({...r})}return n})}var Ci=on;function Si(e,t,n){let r={meta:{},options:n,codeToHast:(s,a)=>bt(e,s,a),codeToTokens:(s,a)=>mt(e,s,a)},o=Ci(bt(e,t,n,r));for(let s of pt(n))o=s.postprocess?.call(r,o,n)||o;return o}async function Zr(e){let t=await Wt(e);return{getLastGrammarState:(...n)=>mr(t,...n),codeToTokensBase:(n,r)=>ln(t,n,r),codeToTokensWithThemes:(n,r)=>rt(t,n,r),codeToTokens:(n,r)=>mt(t,n,r),codeToHast:(n,r)=>bt(t,n,r),codeToHtml:(n,r)=>Si(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function _i(e){return!e.sticky&&!e.rawOptions?.strategy}function eo(e,t){return{index:e,captureIndices:t.map(n=>n==null?{start:4294967295,end:4294967295,length:0}:{start:n[0],end:n[1],length:n[1]-n[0]})}}var to=class{patterns;options;regexps;lastSearches;constructor(e,t={}){this.patterns=e,this.options=t;let{forgiving:n=!1,cache:r,regexConstructor:o}=t;if(!o)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(s=>{if(typeof s!="string")return s;let a=r?.get(s);if(a){if(a instanceof RegExp)return a;if(n)return null;throw a}try{let i=o(s);return r?.set(s,i),i}catch(i){if(r?.set(s,i),n)return null;throw i}}),this.lastSearches=this.regexps.map(s=>s&&_i(s)?{strId:0,searchedFrom:0,matchIndex:-1,indices:null}:null)}findNextMatchSync(e,t,n){let r=typeof e=="string"?e:e.content,o=typeof e=="string"?0:e.id||0,s=-1,a=0,i=null;for(let l=0;l<this.regexps.length;l++){let c=this.regexps[l];if(c)try{let u=o?this.lastSearches[l]:null,d,f;if(u&&u.strId===o&&u.searchedFrom<=t&&(u.matchIndex===-1||u.matchIndex>=t))d=u.matchIndex,f=u.indices;else{c.lastIndex=t;let g=c.exec(r);d=g?g.index:-1,f=g?g.indices:null,u&&(u.strId=o,u.searchedFrom=t,u.matchIndex=d,u.indices=f)}if(d===-1)continue;if(d===t)return eo(l,f);(s===-1||d<a)&&(s=l,a=d,i=f)}catch(u){if(this.options.forgiving)continue;throw u}}return s===-1?null:eo(s,i)}},vi=0;function no(e){return{content:e,id:++vi}}function oe(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function ro(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}var Ue=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),B=String.raw;function Y(e,t){if(e==null)throw new Error(t??"Value expected");return e}var co=B`\[\^?`,uo=`c.? | C(?:-.?)?|${B`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${B`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${B`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${B`o\{[^\}]*\}?`}|${B`\d{1,3}`}`,un=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,yt=new RegExp(B`
13
13
  \\ (?:
14
14
  ${uo}
15
15
  | [gk]<[^>]*>?
@@ -40,8 +40,8 @@
40
40
  | ${co}
41
41
  | &&
42
42
  | .
43
- `.replace(/\s+/g,""),"gsu");function fo(e,t={}){let n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");let r=Hi(n.flags),o=[r.extended],s={captureGroup:n.rules.captureGroup,getCurrentModX(){return o.at(-1)},numOpenGroups:0,popModX(){o.pop()},pushModX(d){o.push(d)},replaceCurrentModX(d){o[o.length-1]=d},singleline:n.rules.singleline},a=[],i;for(yt.lastIndex=0;i=yt.exec(e);){let d=vi(s,e,i[0],yt.lastIndex);d.tokens?a.push(...d.tokens):d.token&&a.push(d.token),d.lastIndex!==void 0&&(yt.lastIndex=d.lastIndex)}let l=[],c=0;a.filter(d=>d.type==="GroupOpen").forEach(d=>{d.kind==="capturing"?d.number=++c:d.raw==="("&&l.push(d)}),c||l.forEach((d,f)=>{d.kind="capturing",d.number=f+1});let u=c||l.length;return{tokens:a.map(d=>d.type==="EscapedNumber"?Wi(d,u):d).flat(),flags:r}}function vi(e,t,n,r){let[o,s]=n;if(n==="["||n==="[^"){let a=xi(t,n,r);return{tokens:a.tokens,lastIndex:a.lastIndex}}if(o==="\\"){if("AbBGyYzZ".includes(s))return{token:oo(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:Mi(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:ho(n)}}if(s==="K")return{token:po("keep",n)};if(s==="N"||s==="R")return{token:ge("newline",n,{negate:s==="N"})};if(s==="O")return{token:ge("any",n)};if(s==="X")return{token:ge("text_segment",n)};let a=go(n,{inCharClass:!1});return Array.isArray(a)?{tokens:a}:{token:a}}if(o==="("){if(s==="*")return{token:Fi(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[r]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:Oi(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:Ce("group",n)};if(n==="(?>")return{token:Ce("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:Ce(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:Ce("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:Ce("absence_repeater",n)}}throw n==="(?("?new Error(`Unsupported conditional "${n}"`):new Error(`Invalid or unsupported group option "${n}"`)}if(n===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:Ti(n)}}if(e.getCurrentModX()){if(n==="#"){let a=t.indexOf(`
44
- `,r);return{lastIndex:a===-1?t.length:a}}if(/^\s$/.test(n)){let a=/\s+/y;return a.lastIndex=r,{lastIndex:a.exec(t)?a.lastIndex:r}}}if(n===".")return{token:ge("dot",n)};if(n==="^"||n==="$"){let a=e.singleline?{"^":B`\A`,$:B`\Z`}[n]:n;return{token:oo(a,n)}}return n==="|"?{token:Ai(n)}:un.test(n)?{tokens:zi(n)}:{token:Z(oe(n),n)}}function xi(e,t,n){let r=[so(t[1]==="^",t)],o=1,s;for(cn.lastIndex=n;s=cn.exec(e);){let a=s[0];if(a[0]==="["&&a[1]!==":")o++,r.push(so(a[1]==="^",a));else if(a==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(Z(93,a));else if(o--,r.push(Ri(a)),!o)break}else{let i=Ei(a);Array.isArray(i)?r.push(...i):r.push(i)}}return{tokens:r,lastIndex:cn.lastIndex||e.length}}function Ei(e){if(e[0]==="\\")return go(e,{inCharClass:!0});if(e[0]==="["){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!Ue.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return ge("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?Ii(e):e==="&&"?Bi(e):Z(oe(e),e)}function go(e,{inCharClass:t}){let n=e[1];if(n==="c"||n==="C")return Gi(e);if("dDhHsSwW".includes(n))return Di(e);if(e.startsWith(B`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return Ui(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{let r=e.split(/\\x/).slice(1).map(a=>parseInt(a,16)),o=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),s=new TextEncoder;return[...o].map(a=>{let i=[...s.encode(a)].map(l=>`\\x${l.toString(16)}`).join("");return Z(oe(a),i)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Z(ji(e),e);if(ao.has(n))return Z(ao.get(n),e);if(/\d/.test(n))return Ni(t,e);if(e==="\\")throw new Error(B`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Z(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function Ai(e){return{type:"Alternator",raw:e}}function oo(e,t){return{type:"Assertion",kind:e,raw:t}}function ho(e){return{type:"Backreference",raw:e}}function Z(e,t){return{type:"Character",value:e,raw:t}}function Ri(e){return{type:"CharacterClassClose",raw:e}}function Ii(e){return{type:"CharacterClassHyphen",raw:e}}function Bi(e){return{type:"CharacterClassIntersector",raw:e}}function so(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function ge(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function po(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:J(n.flags),raw:t}}function Ni(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function Ti(e){return{type:"GroupClose",raw:e}}function Ce(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function Li(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}function Pi(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}function Mi(e){return{type:"Subroutine",raw:e}}var $i=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),ao=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function Gi(e){let t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return Z(oe(t.toUpperCase())-64,e)}function Oi(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??="";let o=(t.getCurrentModX()||n.includes("x"))&&!r.includes("x"),s=lo(n),a=lo(r),i={};if(s&&(i.enable=s),a&&(i.disable=a),e.endsWith(")"))return t.replaceCurrentModX(o),po("flags",e,{flags:i});if(e.endsWith(":"))return t.pushModX(o),t.numOpenGroups++,Ce("group",e,{...(s||a)&&{flags:i}});throw new Error(`Unexpected flag modifier "${e}"`)}function Fi(e){let t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);let{name:n,tag:r,args:o}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(r==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);let s=o?o.split(",").filter(u=>u!=="").map(u=>/^[+-]?\d+$/.test(u)?+u:u):[],[a,i,l]=s,c=$i.has(n)?n.toLowerCase():"custom";switch(c){case"fail":case"mismatch":case"skip":if(s.length>0)throw new Error(`Named callout arguments not allowed "${s}"`);break;case"error":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(typeof a=="string")throw new Error(`Named callout argument must be a number "${a}"`);break;case"max":if(!s.length||s.length>2)throw new Error(`Named callout must have one or two arguments "${s}"`);if(typeof a=="string"&&!/^[A-Za-z_]\w*$/.test(a))throw new Error(`Named callout argument one must be a tag or number "${a}"`);if(s.length===2&&(typeof i=="number"||!/^[<>X]$/.test(i)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${i}"`);break;case"count":case"total_count":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(s.length===1&&(typeof a=="number"||!/^[<>X]$/.test(a)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${a}"`);break;case"cmp":if(s.length!==3)throw new Error(`Named callout must have three arguments "${s}"`);if(typeof a=="string"&&!/^[A-Za-z_]\w*$/.test(a))throw new Error(`Named callout argument one must be a tag or number "${a}"`);if(typeof i=="number"||!/^(?:[<>!=]=|[<>])$/.test(i))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${i}"`);if(typeof l=="string"&&!/^[A-Za-z_]\w*$/.test(l))throw new Error(`Named callout argument three must be a tag or number "${l}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${c}"`)}return Li(c,r??null,o?.split(",")??null,e)}function io(e){let t=null,n,r;if(e[0]==="{"){let{minStr:o,maxStr:s}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,a=1e5;if(+o>a||s&&+s>a)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+o,r=s===void 0?+o:s===""?1/0:+s,n>r&&(t="possessive",[n,r]=[r,n]),e.endsWith("?")){if(t==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else n=e[0]==="+"?1:0,r=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return Pi(t,n,r,e)}function Di(e){let t=e[1].toLowerCase();return ge({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function Ui(e){let{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return ge("property",e,{value:r,negate:t==="P"&&!n||t==="p"&&!!n})}function lo(e){let t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function Hi(e){let t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){let r=e[n];if(!"imxDPSWy".includes(r))throw new Error(`Invalid flag "${r}"`);if(r==="y"){if(!/^y{[gw]}/.test(e.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[n+2]==="g"?"grapheme":"word",n+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[r]]=!0}return t}function ji(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw new Error(`Incomplete or invalid escape "${e}"`);let t=e[2]==="{"?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function Wi(e,t){let{raw:n,inCharClass:r}=e,o=n.slice(1);if(!r&&(o!=="0"&&o.length===1||o[0]!=="0"&&+o<=t))return[ho(n)];let s=[],a=o.match(/^[0-7]+|\d/g);for(let i=0;i<a.length;i++){let l=a[i],c;if(i===0&&l!=="8"&&l!=="9"){if(c=parseInt(l,8),c>127)throw new Error(B`Octal encoded byte above 177 unsupported "${n}"`)}else c=oe(l);s.push(Z(c,(i===0?"\\":"")+l))}return s}function zi(e){let t=[],n=new RegExp(un,"gy"),r;for(;r=n.exec(e);){let o=r[0];if(o[0]==="{"){let s=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(o);if(s){let{min:a,max:i}=s.groups;if(+a>+i&&o.endsWith("?")){n.lastIndex--,t.push(io(o.slice(0,-1)));continue}}}t.push(io(o))}return t}function kt(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;let n=e.body[0];return!t||Object.keys(t).every(r=>t[r]===n[r])}function mo(e){return qi.has(e.type)}var qi=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function Ct(e,t={}){let n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=fo(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),o=(f,g)=>{let h=r.tokens[s.nextIndex];switch(s.parent=f,s.nextIndex++,h.type){case"Alternator":return ee();case"Assertion":return Vi(h);case"Backreference":return Xi(h,s);case"Character":return Se(h.value,{useLastValid:!!g.isCheckingRangeEnd});case"CharacterClassHyphen":return Qi(h,s,g);case"CharacterClassOpen":return Ki(h,s,g);case"CharacterSet":return Yi(h,s);case"Directive":return rl(h.kind,{flags:h.flags});case"GroupOpen":return Ji(h,s,g);case"NamedCallout":return sl(h.kind,h.tag,h.arguments);case"Quantifier":return Zi(h,s);case"Subroutine":return el(h,s);default:throw new Error(`Unexpected token type "${h.type}"`)}},s={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:o},a=il(ol(r.flags)),i=a.body[0];for(;s.nextIndex<r.tokens.length;){let f=o(i,{});f.type==="Alternative"?(a.body.push(f),i=f):i.body.push(f)}let{capturingGroups:l,hasNumberedRef:c,namedGroupsByName:u,subroutines:d}=s;if(c&&u.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(let{ref:f}of d)if(typeof f=="number"){if(f>l.length)throw new Error("Subroutine uses a group number that's not defined");f&&(l[f-1].isSubroutined=!0)}else if(u.has(f)){if(u.get(f).length>1)throw new Error(B`Subroutine uses a duplicate group name "\g<${f}>"`);u.get(f)[0].isSubroutined=!0}else throw new Error(B`Subroutine uses a group name that's not defined "\g<${f}>"`);return a}function Vi({kind:e}){return St(J({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===B`\B`||e===B`\Y`})}function Xi({raw:e},t){let n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),o=(s,a=!1)=>{let i=t.capturingGroups.length,l=!1;if(s>i)if(t.skipBackrefValidation)l=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,wt(a?i+1-s:s,{orphan:l})};if(n){let s=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(s)return o(+s.groups.num,!!s.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${e}"`);return wt(r)}return o(+r)}function Qi(e,t,n){let{tokens:r,walk:o}=t,s=t.parent,a=s.body.at(-1),i=r[t.nextIndex];if(!n.isCheckingRangeEnd&&a&&a.type!=="CharacterClass"&&a.type!=="CharacterClassRange"&&i&&i.type!=="CharacterClassOpen"&&i.type!=="CharacterClassClose"&&i.type!=="CharacterClassIntersector"){let l=o(s,{...n,isCheckingRangeEnd:!0});if(a.type==="Character"&&l.type==="Character")return s.body.pop(),nl(a,l);throw new Error("Invalid character class range")}return Se(oe("-"))}function Ki({negate:e},t,n){let{tokens:r,walk:o}=t,s=[He()],a=r[t.nextIndex],i=ko(a);for(;i.type!=="CharacterClassClose";){if(i.type==="CharacterClassIntersector")s.push(He()),t.nextIndex++;else{let c=s.at(-1);c.body.push(o(c,n))}i=ko(r[t.nextIndex],a)}let l=He({negate:e});return s.length===1?l.body=s[0].body:(l.kind="intersection",l.body=s.map(c=>c.body.length===1?c.body[0]:c)),t.nextIndex++,l}function Yi({kind:e,negate:t,value:n},r){let{normalizeUnknownPropertyNames:o,skipPropertyNameValidation:s,unicodePropertyMap:a}=r;if(e==="property"){let i=_e(n);if(Ue.has(i)&&!a?.has(i))e="posix",n=i;else return he(n,{negate:t,normalizeUnknownPropertyNames:o,skipPropertyNameValidation:s,unicodePropertyMap:a})}return e==="posix"?al(n,{negate:t}):_t(e,{negate:t})}function Ji(e,t,n){let{tokens:r,capturingGroups:o,namedGroupsByName:s,skipLookbehindValidation:a,walk:i}=t,l=ll(e),c=l.type==="AbsenceFunction",u=yo(l),d=u&&l.negate;if(l.type==="CapturingGroup"&&(o.push(l),l.name&&ro(s,l.name,[]).push(l)),c&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let f=wo(r[t.nextIndex]);for(;f.type!=="GroupClose";){if(f.type==="Alternator")l.body.push(ee()),t.nextIndex++;else{let g=l.body.at(-1),h=i(g,{...n,isInAbsenceFunction:n.isInAbsenceFunction||c,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||d});if(g.body.push(h),(u||n.isInLookbehind)&&!a){let y="Lookbehind includes a pattern not allowed by Oniguruma";if(d||n.isInNegLookbehind){if(bo(h)||h.type==="CapturingGroup")throw new Error(y)}else if(bo(h)||yo(h)&&h.negate)throw new Error(y)}}f=wo(r[t.nextIndex])}return t.nextIndex++,l}function Zi({kind:e,min:t,max:n},r){let o=r.parent,s=o.body.at(-1);if(!s||!mo(s))throw new Error("Quantifier requires a repeatable token");let a=fn(e,t,n,s);return o.body.pop(),a}function el({raw:e},t){let{capturingGroups:n,subroutines:r}=t,o=e.slice(3,-1),s=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(o);if(s){let i=+s.groups.num,l=n.length;if(t.hasNumberedRef=!0,o={"":i,"+":l+i,"-":l+1-i}[s.groups.sign],o<1)throw new Error("Invalid subroutine number")}else o==="0"&&(o=0);let a=gn(o);return r.push(a),a}function tl(e,t){if(e!=="repeater")throw new Error(`Unexpected absence function kind "${e}"`);return{type:"AbsenceFunction",kind:e,body:je(t?.body)}}function ee(e){return{type:"Alternative",body:Co(e?.body)}}function St(e,t){let n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function wt(e,t){let n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function dn(e,t){let n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!cl(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:je(t?.body)}}function Se(e,t){let n={useLastValid:!1,...t};if(e>1114111){let r=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${r}}"`):new Error(`Invalid code point out of range in JS "\\x{${r}}"`)}return{type:"Character",value:e}}function He(e){let t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:Co(e?.body)}}function nl(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function _t(e,t){let n=!!t?.negate,r={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(r.negate=n),(e==="text_segment"||e==="newline"&&!n)&&(r.variableLength=!0),r}function rl(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:J(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function ol(e){return{type:"Flags",...e}}function F(e){let t=e?.atomic,n=e?.flags;if(t&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...n&&{flags:n},body:je(e?.body)}}function se(e){let t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:je(e?.body)}}function sl(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function al(e,t){let n=!!t?.negate;if(!Ue.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function fn(e,t,n,r){if(t>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:r}}function il(e,t){return{type:"Regex",body:je(t?.body),flags:e}}function gn(e){return{type:"Subroutine",ref:e}}function he(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},r=n.unicodePropertyMap?.get(_e(e));if(!r){if(n.normalizeUnknownPropertyNames)r=ul(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(B`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function ll({flags:e,kind:t,name:n,negate:r,number:o}){switch(t){case"absence_repeater":return tl("repeater");case"atomic":return F({atomic:!0});case"capturing":return dn(o,{name:n});case"group":return F({flags:e});case"lookahead":case"lookbehind":return se({behind:t==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${t}"`)}}function je(e){if(e===void 0)e=[ee()];else if(!Array.isArray(e)||!e.length||!e.every(t=>t.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function Co(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(t=>!!t.type))throw new Error("Invalid body; expected array of nodes");return e}function bo(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function yo(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function cl(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function ul(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function _e(e){return e.replace(/[- _]+/g,"").toLowerCase()}function ko(e,t){let n=t;return J(e,`Unclosed character class${n?.type==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function wo(e){return J(e,"Unclosed group")}function pe(e,t,n=null){function r(s,a){for(let i=0;i<s.length;i++){let l=o(s[i],a,i,s);i=Math.max(-1,i+l)}}function o(s,a=null,i=null,l=null){let c=0,u=!1,d={node:s,parent:a,key:i,container:l,root:e,remove(){vt(l).splice(Math.max(0,ve(i)+c),1),c--,u=!0},removeAllNextSiblings(){return vt(l).splice(ve(i)+1)},removeAllPrevSiblings(){let m=ve(i)+c;return c-=m,vt(l).splice(0,Math.max(0,m))},replaceWith(m,b={}){let w=!!b.traverse;l?l[Math.max(0,ve(i)+c)]=m:J(a,"Can't replace root node")[i]=m,w&&o(m,a,i,l),u=!0},replaceWithMultiple(m,b={}){let w=!!b.traverse;if(vt(l).splice(Math.max(0,ve(i)+c),1,...m),c+=m.length-1,w){let _=0;for(let x=0;x<m.length;x++)_+=o(m[x],a,ve(i)+x+_,l)}u=!0},skip(){u=!0}},{type:f}=s,g=t["*"],h=t[f],y=typeof g=="function"?g:g?.enter,k=typeof h=="function"?h:h?.enter;if(y?.(d,n),k?.(d,n),!u)switch(f){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":r(s.body,s);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":o(s.min,s,"min"),o(s.max,s,"max");break;case"Quantifier":o(s.body,s,"body");break;case"Regex":r(s.body,s),o(s.flags,s,"flags");break;default:throw new Error(`Unexpected node type "${f}"`)}return h?.exit?.(d,n),g?.exit?.(d,n),c}return o(e),e}function vt(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function ve(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}var So=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function _o(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function vo(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var O=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function We(e,t,n,r){let o=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),s=[!1],a=0,i="";for(let l of e.matchAll(o)){let{0:c,groups:{$skip:u}}=l;if(!u&&(!r||r===O.DEFAULT==!a)){n instanceof Function?i+=n(l,{context:a?O.CHAR_CLASS:O.DEFAULT,negated:s[s.length-1]}):i+=n;continue}c[0]==="["?(a++,s.push(c[1]==="^")):c==="]"&&a&&(a--,s.pop()),i+=c}return i}function hn(e,t,n,r){We(e,t,n,r)}function dl(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;let o=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");o.lastIndex=n;let s=0,a;for(;a=o.exec(e);){let{0:i,groups:{$skip:l}}=a;if(!l&&(!r||r===O.DEFAULT==!s))return a;i==="["?s++:i==="]"&&s&&s--,o.lastIndex==a.index&&o.lastIndex++}return null}function ze(e,t,n){return!!dl(e,t,0,n)}function xo(e,t){let n=/\\?./gsu;n.lastIndex=t;let r=e.length,o=0,s=1,a;for(;a=n.exec(e);){let[i]=a;if(i==="[")o++;else if(o)i==="]"&&o--;else if(i==="(")s++;else if(i===")"&&(s--,!s)){r=a.index;break}}return e.slice(t,r)}var Eo=new RegExp(String.raw`(?<noncapturingStart>${So})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function mn(e,t){let n=t?.hiddenCaptures??[],r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};let o="(?>",s="(?:(?=(",a=[0],i=[],l=0,c=0,u=NaN,d;do{d=!1;let f=0,g=0,h=!1,y;for(Eo.lastIndex=Number.isNaN(u)?0:u+s.length;y=Eo.exec(e);){let{0:k,index:m,groups:{capturingStart:b,noncapturingStart:w}}=y;if(k==="[")f++;else if(f)k==="]"&&f--;else if(k===o&&!h)u=m,h=!0;else if(h&&w)g++;else if(b)h?g++:(l++,a.push(l+c));else if(k===")"&&h){if(!g){c++;let _=l+c;if(e=`${e.slice(0,u)}${s}${e.slice(u+o.length,m)}))<$$${_}>)${e.slice(m+1)}`,d=!0,i.push(_),_o(n,_),r.size){let x=new Map;r.forEach((L,$)=>{x.set($>=_?$+1:$,L.map(W=>W>=_?W+1:W))}),r=x}break}g--}}}while(d);return n.push(...i),e=We(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:f,groups:{backrefNum:g,wrappedBackrefNum:h}})=>{if(g){let y=+g;if(y>a.length-1)throw new Error(`Backref "${f}" greater than number of captures`);return`\\${a[y]}`}return`\\${h}`},O.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}var Ao=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,pn=new RegExp(String.raw`
43
+ `.replace(/\s+/g,""),"gsu");function fo(e,t={}){let n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");let r=ji(n.flags),o=[r.extended],s={captureGroup:n.rules.captureGroup,getCurrentModX(){return o.at(-1)},numOpenGroups:0,popModX(){o.pop()},pushModX(d){o.push(d)},replaceCurrentModX(d){o[o.length-1]=d},singleline:n.rules.singleline},a=[],i;for(yt.lastIndex=0;i=yt.exec(e);){let d=xi(s,e,i[0],yt.lastIndex);d.tokens?a.push(...d.tokens):d.token&&a.push(d.token),d.lastIndex!==void 0&&(yt.lastIndex=d.lastIndex)}let l=[],c=0;a.filter(d=>d.type==="GroupOpen").forEach(d=>{d.kind==="capturing"?d.number=++c:d.raw==="("&&l.push(d)}),c||l.forEach((d,f)=>{d.kind="capturing",d.number=f+1});let u=c||l.length;return{tokens:a.map(d=>d.type==="EscapedNumber"?zi(d,u):d).flat(),flags:r}}function xi(e,t,n,r){let[o,s]=n;if(n==="["||n==="[^"){let a=Ei(t,n,r);return{tokens:a.tokens,lastIndex:a.lastIndex}}if(o==="\\"){if("AbBGyYzZ".includes(s))return{token:oo(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:$i(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:ho(n)}}if(s==="K")return{token:po("keep",n)};if(s==="N"||s==="R")return{token:ge("newline",n,{negate:s==="N"})};if(s==="O")return{token:ge("any",n)};if(s==="X")return{token:ge("text_segment",n)};let a=go(n,{inCharClass:!1});return Array.isArray(a)?{tokens:a}:{token:a}}if(o==="("){if(s==="*")return{token:Di(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[r]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:r+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:Fi(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:Ce("group",n)};if(n==="(?>")return{token:Ce("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:Ce(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:Ce("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:Ce("absence_repeater",n)}}throw n==="(?("?new Error(`Unsupported conditional "${n}"`):new Error(`Invalid or unsupported group option "${n}"`)}if(n===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:Li(n)}}if(e.getCurrentModX()){if(n==="#"){let a=t.indexOf(`
44
+ `,r);return{lastIndex:a===-1?t.length:a}}if(/^\s$/.test(n)){let a=/\s+/y;return a.lastIndex=r,{lastIndex:a.exec(t)?a.lastIndex:r}}}if(n===".")return{token:ge("dot",n)};if(n==="^"||n==="$"){let a=e.singleline?{"^":B`\A`,$:B`\Z`}[n]:n;return{token:oo(a,n)}}return n==="|"?{token:Ai(n)}:un.test(n)?{tokens:qi(n)}:{token:Z(oe(n),n)}}function Ei(e,t,n){let r=[so(t[1]==="^",t)],o=1,s;for(cn.lastIndex=n;s=cn.exec(e);){let a=s[0];if(a[0]==="["&&a[1]!==":")o++,r.push(so(a[1]==="^",a));else if(a==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(Z(93,a));else if(o--,r.push(Ii(a)),!o)break}else{let i=Ri(a);Array.isArray(i)?r.push(...i):r.push(i)}}return{tokens:r,lastIndex:cn.lastIndex||e.length}}function Ri(e){if(e[0]==="\\")return go(e,{inCharClass:!0});if(e[0]==="["){let t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!Ue.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return ge("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?Bi(e):e==="&&"?Ni(e):Z(oe(e),e)}function go(e,{inCharClass:t}){let n=e[1];if(n==="c"||n==="C")return Oi(e);if("dDhHsSwW".includes(n))return Ui(e);if(e.startsWith(B`\o{`))throw new Error(`Incomplete, invalid, or unsupported octal code point "${e}"`);if(/^\\[pP]\{/.test(e)){if(e.length===3)throw new Error(`Incomplete or invalid Unicode property "${e}"`);return Hi(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{let r=e.split(/\\x/).slice(1).map(a=>parseInt(a,16)),o=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),s=new TextEncoder;return[...o].map(a=>{let i=[...s.encode(a)].map(l=>`\\x${l.toString(16)}`).join("");return Z(oe(a),i)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return Z(Wi(e),e);if(ao.has(n))return Z(ao.get(n),e);if(/\d/.test(n))return Ti(t,e);if(e==="\\")throw new Error(B`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Z(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function Ai(e){return{type:"Alternator",raw:e}}function oo(e,t){return{type:"Assertion",kind:e,raw:t}}function ho(e){return{type:"Backreference",raw:e}}function Z(e,t){return{type:"Character",value:e,raw:t}}function Ii(e){return{type:"CharacterClassClose",raw:e}}function Bi(e){return{type:"CharacterClassHyphen",raw:e}}function Ni(e){return{type:"CharacterClassIntersector",raw:e}}function so(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function ge(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function po(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:Y(n.flags),raw:t}}function Ti(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function Li(e){return{type:"GroupClose",raw:e}}function Ce(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function Pi(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}function Mi(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}function $i(e){return{type:"Subroutine",raw:e}}var Gi=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),ao=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function Oi(e){let t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return Z(oe(t.toUpperCase())-64,e)}function Fi(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??="";let o=(t.getCurrentModX()||n.includes("x"))&&!r.includes("x"),s=lo(n),a=lo(r),i={};if(s&&(i.enable=s),a&&(i.disable=a),e.endsWith(")"))return t.replaceCurrentModX(o),po("flags",e,{flags:i});if(e.endsWith(":"))return t.pushModX(o),t.numOpenGroups++,Ce("group",e,{...(s||a)&&{flags:i}});throw new Error(`Unexpected flag modifier "${e}"`)}function Di(e){let t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);let{name:n,tag:r,args:o}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(r==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);let s=o?o.split(",").filter(u=>u!=="").map(u=>/^[+-]?\d+$/.test(u)?+u:u):[],[a,i,l]=s,c=Gi.has(n)?n.toLowerCase():"custom";switch(c){case"fail":case"mismatch":case"skip":if(s.length>0)throw new Error(`Named callout arguments not allowed "${s}"`);break;case"error":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(typeof a=="string")throw new Error(`Named callout argument must be a number "${a}"`);break;case"max":if(!s.length||s.length>2)throw new Error(`Named callout must have one or two arguments "${s}"`);if(typeof a=="string"&&!/^[A-Za-z_]\w*$/.test(a))throw new Error(`Named callout argument one must be a tag or number "${a}"`);if(s.length===2&&(typeof i=="number"||!/^[<>X]$/.test(i)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${i}"`);break;case"count":case"total_count":if(s.length>1)throw new Error(`Named callout allows only one argument "${s}"`);if(s.length===1&&(typeof a=="number"||!/^[<>X]$/.test(a)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${a}"`);break;case"cmp":if(s.length!==3)throw new Error(`Named callout must have three arguments "${s}"`);if(typeof a=="string"&&!/^[A-Za-z_]\w*$/.test(a))throw new Error(`Named callout argument one must be a tag or number "${a}"`);if(typeof i=="number"||!/^(?:[<>!=]=|[<>])$/.test(i))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${i}"`);if(typeof l=="string"&&!/^[A-Za-z_]\w*$/.test(l))throw new Error(`Named callout argument three must be a tag or number "${l}"`);break;case"custom":throw new Error(`Undefined callout name "${n}"`);default:throw new Error(`Unexpected named callout kind "${c}"`)}return Pi(c,r??null,o?.split(",")??null,e)}function io(e){let t=null,n,r;if(e[0]==="{"){let{minStr:o,maxStr:s}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,a=1e5;if(+o>a||s&&+s>a)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+o,r=s===void 0?+o:s===""?1/0:+s,n>r&&(t="possessive",[n,r]=[r,n]),e.endsWith("?")){if(t==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else n=e[0]==="+"?1:0,r=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return Mi(t,n,r,e)}function Ui(e){let t=e[1].toLowerCase();return ge({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function Hi(e){let{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return ge("property",e,{value:r,negate:t==="P"&&!n||t==="p"&&!!n})}function lo(e){let t={};return e.includes("i")&&(t.ignoreCase=!0),e.includes("m")&&(t.dotAll=!0),e.includes("x")&&(t.extended=!0),Object.keys(t).length?t:null}function ji(e){let t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){let r=e[n];if(!"imxDPSWy".includes(r))throw new Error(`Invalid flag "${r}"`);if(r==="y"){if(!/^y{[gw]}/.test(e.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[n+2]==="g"?"grapheme":"word",n+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[r]]=!0}return t}function Wi(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw new Error(`Incomplete or invalid escape "${e}"`);let t=e[2]==="{"?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function zi(e,t){let{raw:n,inCharClass:r}=e,o=n.slice(1);if(!r&&(o!=="0"&&o.length===1||o[0]!=="0"&&+o<=t))return[ho(n)];let s=[],a=o.match(/^[0-7]+|\d/g);for(let i=0;i<a.length;i++){let l=a[i],c;if(i===0&&l!=="8"&&l!=="9"){if(c=parseInt(l,8),c>127)throw new Error(B`Octal encoded byte above 177 unsupported "${n}"`)}else c=oe(l);s.push(Z(c,(i===0?"\\":"")+l))}return s}function qi(e){let t=[],n=new RegExp(un,"gy"),r;for(;r=n.exec(e);){let o=r[0];if(o[0]==="{"){let s=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(o);if(s){let{min:a,max:i}=s.groups;if(+a>+i&&o.endsWith("?")){n.lastIndex--,t.push(io(o.slice(0,-1)));continue}}}t.push(io(o))}return t}function kt(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;let n=e.body[0];return!t||Object.keys(t).every(r=>t[r]===n[r])}function mo(e){return Vi.has(e.type)}var Vi=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function Ct(e,t={}){let n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=fo(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),o=(f,g)=>{let h=r.tokens[s.nextIndex];switch(s.parent=f,s.nextIndex++,h.type){case"Alternator":return ee();case"Assertion":return Xi(h);case"Backreference":return Qi(h,s);case"Character":return Se(h.value,{useLastValid:!!g.isCheckingRangeEnd});case"CharacterClassHyphen":return Ji(h,s,g);case"CharacterClassOpen":return Ki(h,s,g);case"CharacterSet":return Yi(h,s);case"Directive":return ol(h.kind,{flags:h.flags});case"GroupOpen":return Zi(h,s,g);case"NamedCallout":return al(h.kind,h.tag,h.arguments);case"Quantifier":return el(h,s);case"Subroutine":return tl(h,s);default:throw new Error(`Unexpected token type "${h.type}"`)}},s={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:r.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:o},a=ll(sl(r.flags)),i=a.body[0];for(;s.nextIndex<r.tokens.length;){let f=o(i,{});f.type==="Alternative"?(a.body.push(f),i=f):i.body.push(f)}let{capturingGroups:l,hasNumberedRef:c,namedGroupsByName:u,subroutines:d}=s;if(c&&u.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(let{ref:f}of d)if(typeof f=="number"){if(f>l.length)throw new Error("Subroutine uses a group number that's not defined");f&&(l[f-1].isSubroutined=!0)}else if(u.has(f)){if(u.get(f).length>1)throw new Error(B`Subroutine uses a duplicate group name "\g<${f}>"`);u.get(f)[0].isSubroutined=!0}else throw new Error(B`Subroutine uses a group name that's not defined "\g<${f}>"`);return a}function Xi({kind:e}){return St(Y({"^":"line_start",$:"line_end","\\A":"string_start","\\b":"word_boundary","\\B":"word_boundary","\\G":"search_start","\\y":"text_segment_boundary","\\Y":"text_segment_boundary","\\z":"string_end","\\Z":"string_end_newline"}[e],`Unexpected assertion kind "${e}"`),{negate:e===B`\B`||e===B`\Y`})}function Qi({raw:e},t){let n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),o=(s,a=!1)=>{let i=t.capturingGroups.length,l=!1;if(s>i)if(t.skipBackrefValidation)l=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,wt(a?i+1-s:s,{orphan:l})};if(n){let s=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(s)return o(+s.groups.num,!!s.groups.sign);if(/[-+]/.test(r))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(r))throw new Error(`Group name not defined to the left "${e}"`);return wt(r)}return o(+r)}function Ji(e,t,n){let{tokens:r,walk:o}=t,s=t.parent,a=s.body.at(-1),i=r[t.nextIndex];if(!n.isCheckingRangeEnd&&a&&a.type!=="CharacterClass"&&a.type!=="CharacterClassRange"&&i&&i.type!=="CharacterClassOpen"&&i.type!=="CharacterClassClose"&&i.type!=="CharacterClassIntersector"){let l=o(s,{...n,isCheckingRangeEnd:!0});if(a.type==="Character"&&l.type==="Character")return s.body.pop(),rl(a,l);throw new Error("Invalid character class range")}return Se(oe("-"))}function Ki({negate:e},t,n){let{tokens:r,walk:o}=t,s=[He()],a=r[t.nextIndex],i=ko(a);for(;i.type!=="CharacterClassClose";){if(i.type==="CharacterClassIntersector")s.push(He()),t.nextIndex++;else{let c=s.at(-1);c.body.push(o(c,n))}i=ko(r[t.nextIndex],a)}let l=He({negate:e});return s.length===1?l.body=s[0].body:(l.kind="intersection",l.body=s.map(c=>c.body.length===1?c.body[0]:c)),t.nextIndex++,l}function Yi({kind:e,negate:t,value:n},r){let{normalizeUnknownPropertyNames:o,skipPropertyNameValidation:s,unicodePropertyMap:a}=r;if(e==="property"){let i=_e(n);if(Ue.has(i)&&!a?.has(i))e="posix",n=i;else return he(n,{negate:t,normalizeUnknownPropertyNames:o,skipPropertyNameValidation:s,unicodePropertyMap:a})}return e==="posix"?il(n,{negate:t}):_t(e,{negate:t})}function Zi(e,t,n){let{tokens:r,capturingGroups:o,namedGroupsByName:s,skipLookbehindValidation:a,walk:i}=t,l=cl(e),c=l.type==="AbsenceFunction",u=yo(l),d=u&&l.negate;if(l.type==="CapturingGroup"&&(o.push(l),l.name&&ro(s,l.name,[]).push(l)),c&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let f=wo(r[t.nextIndex]);for(;f.type!=="GroupClose";){if(f.type==="Alternator")l.body.push(ee()),t.nextIndex++;else{let g=l.body.at(-1),h=i(g,{...n,isInAbsenceFunction:n.isInAbsenceFunction||c,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||d});if(g.body.push(h),(u||n.isInLookbehind)&&!a){let y="Lookbehind includes a pattern not allowed by Oniguruma";if(d||n.isInNegLookbehind){if(bo(h)||h.type==="CapturingGroup")throw new Error(y)}else if(bo(h)||yo(h)&&h.negate)throw new Error(y)}}f=wo(r[t.nextIndex])}return t.nextIndex++,l}function el({kind:e,min:t,max:n},r){let o=r.parent,s=o.body.at(-1);if(!s||!mo(s))throw new Error("Quantifier requires a repeatable token");let a=fn(e,t,n,s);return o.body.pop(),a}function tl({raw:e},t){let{capturingGroups:n,subroutines:r}=t,o=e.slice(3,-1),s=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(o);if(s){let i=+s.groups.num,l=n.length;if(t.hasNumberedRef=!0,o={"":i,"+":l+i,"-":l+1-i}[s.groups.sign],o<1)throw new Error("Invalid subroutine number")}else o==="0"&&(o=0);let a=gn(o);return r.push(a),a}function nl(e,t){if(e!=="repeater")throw new Error(`Unexpected absence function kind "${e}"`);return{type:"AbsenceFunction",kind:e,body:je(t?.body)}}function ee(e){return{type:"Alternative",body:Co(e?.body)}}function St(e,t){let n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function wt(e,t){let n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function dn(e,t){let n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!ul(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:je(t?.body)}}function Se(e,t){let n={useLastValid:!1,...t};if(e>1114111){let r=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${r}}"`):new Error(`Invalid code point out of range in JS "\\x{${r}}"`)}return{type:"Character",value:e}}function He(e){let t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:Co(e?.body)}}function rl(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function _t(e,t){let n=!!t?.negate,r={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(r.negate=n),(e==="text_segment"||e==="newline"&&!n)&&(r.variableLength=!0),r}function ol(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:Y(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function sl(e){return{type:"Flags",...e}}function F(e){let t=e?.atomic,n=e?.flags;if(t&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...n&&{flags:n},body:je(e?.body)}}function se(e){let t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:je(e?.body)}}function al(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function il(e,t){let n=!!t?.negate;if(!Ue.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function fn(e,t,n,r){if(t>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:r}}function ll(e,t){return{type:"Regex",body:je(t?.body),flags:e}}function gn(e){return{type:"Subroutine",ref:e}}function he(e,t){let n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t},r=n.unicodePropertyMap?.get(_e(e));if(!r){if(n.normalizeUnknownPropertyNames)r=dl(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(B`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function cl({flags:e,kind:t,name:n,negate:r,number:o}){switch(t){case"absence_repeater":return nl("repeater");case"atomic":return F({atomic:!0});case"capturing":return dn(o,{name:n});case"group":return F({flags:e});case"lookahead":case"lookbehind":return se({behind:t==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${t}"`)}}function je(e){if(e===void 0)e=[ee()];else if(!Array.isArray(e)||!e.length||!e.every(t=>t.type==="Alternative"))throw new Error("Invalid body; expected array of one or more Alternative nodes");return e}function Co(e){if(e===void 0)e=[];else if(!Array.isArray(e)||!e.every(t=>!!t.type))throw new Error("Invalid body; expected array of nodes");return e}function bo(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function yo(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function ul(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function dl(e){return e.trim().replace(/[- _]+/g,"_").replace(/[A-Z][a-z]+(?=[A-Z])/g,"$&_").replace(/[A-Za-z]+/g,t=>t[0].toUpperCase()+t.slice(1).toLowerCase())}function _e(e){return e.replace(/[- _]+/g,"").toLowerCase()}function ko(e,t){let n=t;return Y(e,`Unclosed character class${n?.type==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function wo(e){return Y(e,"Unclosed group")}function pe(e,t,n=null){function r(s,a){for(let i=0;i<s.length;i++){let l=o(s[i],a,i,s);i=Math.max(-1,i+l)}}function o(s,a=null,i=null,l=null){let c=0,u=!1,d={node:s,parent:a,key:i,container:l,root:e,remove(){vt(l).splice(Math.max(0,ve(i)+c),1),c--,u=!0},removeAllNextSiblings(){return vt(l).splice(ve(i)+1)},removeAllPrevSiblings(){let m=ve(i)+c;return c-=m,vt(l).splice(0,Math.max(0,m))},replaceWith(m,b={}){let w=!!b.traverse;l?l[Math.max(0,ve(i)+c)]=m:Y(a,"Can't replace root node")[i]=m,w&&o(m,a,i,l),u=!0},replaceWithMultiple(m,b={}){let w=!!b.traverse;if(vt(l).splice(Math.max(0,ve(i)+c),1,...m),c+=m.length-1,w){let _=0;for(let x=0;x<m.length;x++)_+=o(m[x],a,ve(i)+x+_,l)}u=!0},skip(){u=!0}},{type:f}=s,g=t["*"],h=t[f],y=typeof g=="function"?g:g?.enter,k=typeof h=="function"?h:h?.enter;if(y?.(d,n),k?.(d,n),!u)switch(f){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":r(s.body,s);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":o(s.min,s,"min"),o(s.max,s,"max");break;case"Quantifier":o(s.body,s,"body");break;case"Regex":r(s.body,s),o(s.flags,s,"flags");break;default:throw new Error(`Unexpected node type "${f}"`)}return h?.exit?.(d,n),g?.exit?.(d,n),c}return o(e),e}function vt(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function ve(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}var So=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function _o(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function vo(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}var O=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function We(e,t,n,r){let o=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),s=[!1],a=0,i="";for(let l of e.matchAll(o)){let{0:c,groups:{$skip:u}}=l;if(!u&&(!r||r===O.DEFAULT==!a)){n instanceof Function?i+=n(l,{context:a?O.CHAR_CLASS:O.DEFAULT,negated:s[s.length-1]}):i+=n;continue}c[0]==="["?(a++,s.push(c[1]==="^")):c==="]"&&a&&(a--,s.pop()),i+=c}return i}function hn(e,t,n,r){We(e,t,n,r)}function fl(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;let o=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");o.lastIndex=n;let s=0,a;for(;a=o.exec(e);){let{0:i,groups:{$skip:l}}=a;if(!l&&(!r||r===O.DEFAULT==!s))return a;i==="["?s++:i==="]"&&s&&s--,o.lastIndex==a.index&&o.lastIndex++}return null}function ze(e,t,n){return!!fl(e,t,0,n)}function xo(e,t){let n=/\\?./gsu;n.lastIndex=t;let r=e.length,o=0,s=1,a;for(;a=n.exec(e);){let[i]=a;if(i==="[")o++;else if(o)i==="]"&&o--;else if(i==="(")s++;else if(i===")"&&(s--,!s)){r=a.index;break}}return e.slice(t,r)}var Eo=new RegExp(String.raw`(?<noncapturingStart>${So})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function mn(e,t){let n=t?.hiddenCaptures??[],r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};let o="(?>",s="(?:(?=(",a=[0],i=[],l=0,c=0,u=NaN,d;do{d=!1;let f=0,g=0,h=!1,y;for(Eo.lastIndex=Number.isNaN(u)?0:u+s.length;y=Eo.exec(e);){let{0:k,index:m,groups:{capturingStart:b,noncapturingStart:w}}=y;if(k==="[")f++;else if(f)k==="]"&&f--;else if(k===o&&!h)u=m,h=!0;else if(h&&w)g++;else if(b)h?g++:(l++,a.push(l+c));else if(k===")"&&h){if(!g){c++;let _=l+c;if(e=`${e.slice(0,u)}${s}${e.slice(u+o.length,m)}))<$$${_}>)${e.slice(m+1)}`,d=!0,i.push(_),_o(n,_),r.size){let x=new Map;r.forEach((L,$)=>{x.set($>=_?$+1:$,L.map(W=>W>=_?W+1:W))}),r=x}break}g--}}}while(d);return n.push(...i),e=We(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:f,groups:{backrefNum:g,wrappedBackrefNum:h}})=>{if(g){let y=+g;if(y>a.length-1)throw new Error(`Backref "${f}" greater than number of captures`);return`\\${a[y]}`}return`\\${h}`},O.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}var Ro=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,pn=new RegExp(String.raw`
45
45
  \\(?: \d+
46
46
  | c[A-Za-z]
47
47
  | [gk]<[^>]+>
@@ -54,9 +54,9 @@
54
54
  | [A-Za-z\-]+:
55
55
  | \(DEFINE\)
56
56
  ))?
57
- | (?<qBase>${Ao})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
57
+ | (?<qBase>${Ro})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
58
58
  | \\?.
59
- `.replace(/\s+/g,""),"gsu");function bn(e){if(!new RegExp(`${Ao}\\+`).test(e))return{pattern:e};let t=[],n=null,r=null,o="",s=0,a;for(pn.lastIndex=0;a=pn.exec(e);){let{0:i,index:l,groups:{qBase:c,qMod:u,invalidQ:d}}=a;if(i==="[")s||(r=l),s++;else if(i==="]")s?s--:r=null;else if(!s)if(u==="+"&&o&&!o.startsWith("(")){if(d)throw new Error(`Invalid quantifier "${i}"`);let f=-1;if(/^\{\d+\}$/.test(c))e=vo(e,l+c.length,u,"");else{if(o===")"||o==="]"){let g=o===")"?n:r;if(g===null)throw new Error(`Invalid unmatched "${o}"`);e=`${e.slice(0,g)}(?>${e.slice(g,l)}${c})${e.slice(l+i.length)}`}else e=`${e.slice(0,l-o.length)}(?>${o}${c})${e.slice(l+i.length)}`;f+=4}pn.lastIndex+=f}else i[0]==="("?t.push(l):i===")"&&(n=t.length?t.pop():null);o=i}return{pattern:e}}var H=String.raw,fl=H`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,kn=H`\(\?R=(?<rDepth>[^\)]+)\)|${fl}`,xt=H`\(\?<(?![=!])(?<captureName>[^>]+)>`,To=H`${xt}|(?<unnamed>\()(?!\?)`,me=new RegExp(H`${xt}|${kn}|\(\?|\\?.`,"gsu"),yn="Cannot use multiple overlapping recursions";function Lo(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t},o=t?.captureTransfers??new Map;if(!new RegExp(kn,"su").test(e))return{pattern:e,captureTransfers:o,hiddenCaptures:n};if(r==="plugin"&&ze(e,H`\(\?\(DEFINE\)`,O.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");let s=[],a=ze(e,H`\\[1-9]`,O.DEFAULT),i=new Map,l=[],c=!1,u=0,d=0,f;for(me.lastIndex=0;f=me.exec(e);){let{0:g,groups:{captureName:h,rDepth:y,gRNameOrNum:k,gRDepth:m}}=f;if(g==="[")u++;else if(u)g==="]"&&u--;else if(y){if(Ro(y),c)throw new Error(yn);if(a)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);let b=e.slice(0,f.index),w=e.slice(me.lastIndex);if(ze(w,kn,O.DEFAULT))throw new Error(yn);let _=+y-1;e=Io(b,w,_,!1,n,s,d),o=No(o,b,_,s.length,0,d);break}else if(k){Ro(m);let b=!1;for(let z of l)if(z.name===k||z.num===+k){if(b=!0,z.hasRecursedWithin)throw new Error(yn);break}if(!b)throw new Error(H`Recursive \g cannot be used outside the referenced group "${r==="external"?k:H`\g<${k}&R=${m}>`}"`);let w=i.get(k),_=xo(e,w);if(a&&ze(_,H`${xt}|\((?!\?)`,O.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);let x=e.slice(w,f.index),L=_.slice(x.length+g.length),$=s.length,W=+m-1,be=Io(x,L,W,!0,n,s,d);o=No(o,x,W,s.length-$,$,d);let Rt=e.slice(0,w),It=e.slice(w+_.length);e=`${Rt}${be}${It}`,me.lastIndex+=be.length-g.length-x.length-L.length,l.forEach(z=>z.hasRecursedWithin=!0),c=!0}else if(h)d++,i.set(String(d),me.lastIndex),i.set(h,me.lastIndex),l.push({num:d,name:h});else if(g[0]==="("){let b=g==="(";b&&(d++,i.set(String(d),me.lastIndex)),l.push(b?{num:d}:{})}else g===")"&&l.pop()}return n.push(...s),{pattern:e,captureTransfers:o,hiddenCaptures:n}}function Ro(e){let t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e))throw new Error(t);if(e=+e,e<2||e>100)throw new Error(t)}function Io(e,t,n,r,o,s,a){let i=new Set;r&&hn(e+t,xt,({groups:{captureName:c}})=>{i.add(c)},O.DEFAULT);let l=[n,r?i:null,o,s,a];return`${e}${Bo(`(?:${e}`,"forward",...l)}(?:)${Bo(`${t})`,"backward",...l)}${t}`}function Bo(e,t,n,r,o,s,a){let l=u=>t==="forward"?u+2:n-u+2-1,c="";for(let u=0;u<n;u++){let d=l(u);c+=We(e,H`${To}|\\k<(?<backref>[^>]+)>`,({0:f,groups:{captureName:g,unnamed:h,backref:y}})=>{if(y&&r&&!r.has(y))return f;let k=`_$${d}`;if(h||g){let m=a+s.length+1;return s.push(m),gl(o,m),h?f:`(?<${g}${k}>`}return H`\k<${y}${k}>`},O.DEFAULT)}return c}function gl(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function No(e,t,n,r,o,s){if(e.size&&r){let a=0;hn(t,To,()=>a++,O.DEFAULT);let i=s-a+o,l=new Map;return e.forEach((c,u)=>{let d=(r-a*n)/n,f=a*n,g=u>i+a?u+r:u,h=[];for(let y of c)if(y<=i)h.push(y);else if(y>i+a+d)h.push(y+r);else if(y<=i+a)for(let k=0;k<=n;k++)h.push(y+a*k);else for(let k=0;k<=n;k++)h.push(y+f+d*k);l.set(g,h)}),l}return e}var N=String.fromCodePoint,S=String.raw,j={},At=globalThis.RegExp;j.flagGroups=(()=>{try{new At("(?i:)")}catch{return!1}return!0})();j.unicodeSets=(()=>{try{new At("[[]]","v")}catch{return!1}return!0})();j.bugFlagVLiteralHyphenIsRange=j.unicodeSets?(()=>{try{new At(S`[\d\-a]`,"v")}catch{return!0}return!1})():!1;j.bugNestedClassIgnoresNegation=j.unicodeSets&&new At("[[^a]]","v").test("a");function Et(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function qe(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function vn(e,t){return Po[e]>=Po[t]}function hl(e,t){if(e==null)throw new Error(t??"Value expected");return e}var Po={ES2025:2025,ES2024:2024,ES2018:2018},pl={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function Fo(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!pl[e.target])throw new Error(`Unexpected target "${e.target}"`);let t={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target==="auto"&&(t.target=j.flagGroups?"ES2025":j.unicodeSets?"ES2024":"ES2018"),t}var ml="[ -\r ]",bl=new Set([N(304),N(305)]),te=S`[\p{L}\p{M}\p{N}\p{Pc}]`;function Do(e){if(bl.has(e))return[e];let t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),o=wl.get(n),s=yl.get(n),a=kl.get(n);return[...r].length===1&&t.add(r),a&&t.add(a),o&&t.add(o),t.add(n),s&&t.add(s),[...t]}var En=new Map(`C Other
59
+ `.replace(/\s+/g,""),"gsu");function bn(e){if(!new RegExp(`${Ro}\\+`).test(e))return{pattern:e};let t=[],n=null,r=null,o="",s=0,a;for(pn.lastIndex=0;a=pn.exec(e);){let{0:i,index:l,groups:{qBase:c,qMod:u,invalidQ:d}}=a;if(i==="[")s||(r=l),s++;else if(i==="]")s?s--:r=null;else if(!s)if(u==="+"&&o&&!o.startsWith("(")){if(d)throw new Error(`Invalid quantifier "${i}"`);let f=-1;if(/^\{\d+\}$/.test(c))e=vo(e,l+c.length,u,"");else{if(o===")"||o==="]"){let g=o===")"?n:r;if(g===null)throw new Error(`Invalid unmatched "${o}"`);e=`${e.slice(0,g)}(?>${e.slice(g,l)}${c})${e.slice(l+i.length)}`}else e=`${e.slice(0,l-o.length)}(?>${o}${c})${e.slice(l+i.length)}`;f+=4}pn.lastIndex+=f}else i[0]==="("?t.push(l):i===")"&&(n=t.length?t.pop():null);o=i}return{pattern:e}}var H=String.raw,gl=H`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,kn=H`\(\?R=(?<rDepth>[^\)]+)\)|${gl}`,xt=H`\(\?<(?![=!])(?<captureName>[^>]+)>`,To=H`${xt}|(?<unnamed>\()(?!\?)`,me=new RegExp(H`${xt}|${kn}|\(\?|\\?.`,"gsu"),yn="Cannot use multiple overlapping recursions";function Lo(e,t){let{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t},o=t?.captureTransfers??new Map;if(!new RegExp(kn,"su").test(e))return{pattern:e,captureTransfers:o,hiddenCaptures:n};if(r==="plugin"&&ze(e,H`\(\?\(DEFINE\)`,O.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");let s=[],a=ze(e,H`\\[1-9]`,O.DEFAULT),i=new Map,l=[],c=!1,u=0,d=0,f;for(me.lastIndex=0;f=me.exec(e);){let{0:g,groups:{captureName:h,rDepth:y,gRNameOrNum:k,gRDepth:m}}=f;if(g==="[")u++;else if(u)g==="]"&&u--;else if(y){if(Ao(y),c)throw new Error(yn);if(a)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);let b=e.slice(0,f.index),w=e.slice(me.lastIndex);if(ze(w,kn,O.DEFAULT))throw new Error(yn);let _=+y-1;e=Io(b,w,_,!1,n,s,d),o=No(o,b,_,s.length,0,d);break}else if(k){Ao(m);let b=!1;for(let z of l)if(z.name===k||z.num===+k){if(b=!0,z.hasRecursedWithin)throw new Error(yn);break}if(!b)throw new Error(H`Recursive \g cannot be used outside the referenced group "${r==="external"?k:H`\g<${k}&R=${m}>`}"`);let w=i.get(k),_=xo(e,w);if(a&&ze(_,H`${xt}|\((?!\?)`,O.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);let x=e.slice(w,f.index),L=_.slice(x.length+g.length),$=s.length,W=+m-1,be=Io(x,L,W,!0,n,s,d);o=No(o,x,W,s.length-$,$,d);let At=e.slice(0,w),It=e.slice(w+_.length);e=`${At}${be}${It}`,me.lastIndex+=be.length-g.length-x.length-L.length,l.forEach(z=>z.hasRecursedWithin=!0),c=!0}else if(h)d++,i.set(String(d),me.lastIndex),i.set(h,me.lastIndex),l.push({num:d,name:h});else if(g[0]==="("){let b=g==="(";b&&(d++,i.set(String(d),me.lastIndex)),l.push(b?{num:d}:{})}else g===")"&&l.pop()}return n.push(...s),{pattern:e,captureTransfers:o,hiddenCaptures:n}}function Ao(e){let t=`Max depth must be integer between 2 and 100; used ${e}`;if(!/^[1-9]\d*$/.test(e))throw new Error(t);if(e=+e,e<2||e>100)throw new Error(t)}function Io(e,t,n,r,o,s,a){let i=new Set;r&&hn(e+t,xt,({groups:{captureName:c}})=>{i.add(c)},O.DEFAULT);let l=[n,r?i:null,o,s,a];return`${e}${Bo(`(?:${e}`,"forward",...l)}(?:)${Bo(`${t})`,"backward",...l)}${t}`}function Bo(e,t,n,r,o,s,a){let l=u=>t==="forward"?u+2:n-u+2-1,c="";for(let u=0;u<n;u++){let d=l(u);c+=We(e,H`${To}|\\k<(?<backref>[^>]+)>`,({0:f,groups:{captureName:g,unnamed:h,backref:y}})=>{if(y&&r&&!r.has(y))return f;let k=`_$${d}`;if(h||g){let m=a+s.length+1;return s.push(m),hl(o,m),h?f:`(?<${g}${k}>`}return H`\k<${y}${k}>`},O.DEFAULT)}return c}function hl(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function No(e,t,n,r,o,s){if(e.size&&r){let a=0;hn(t,To,()=>a++,O.DEFAULT);let i=s-a+o,l=new Map;return e.forEach((c,u)=>{let d=(r-a*n)/n,f=a*n,g=u>i+a?u+r:u,h=[];for(let y of c)if(y<=i)h.push(y);else if(y>i+a+d)h.push(y+r);else if(y<=i+a)for(let k=0;k<=n;k++)h.push(y+a*k);else for(let k=0;k<=n;k++)h.push(y+f+d*k);l.set(g,h)}),l}return e}var N=String.fromCodePoint,S=String.raw,j={},Rt=globalThis.RegExp;j.flagGroups=(()=>{try{new Rt("(?i:)")}catch{return!1}return!0})();j.unicodeSets=(()=>{try{new Rt("[[]]","v")}catch{return!1}return!0})();j.bugFlagVLiteralHyphenIsRange=j.unicodeSets?(()=>{try{new Rt(S`[\d\-a]`,"v")}catch{return!0}return!1})():!1;j.bugNestedClassIgnoresNegation=j.unicodeSets&&new Rt("[[^a]]","v").test("a");function Et(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function qe(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function vn(e,t){return Po[e]>=Po[t]}function pl(e,t){if(e==null)throw new Error(t??"Value expected");return e}var Po={ES2025:2025,ES2024:2024,ES2018:2018},ml={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function Fo(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!ml[e.target])throw new Error(`Unexpected target "${e.target}"`);let t={accuracy:"default",avoidSubclass:!1,flags:"",global:!1,hasIndices:!1,lazyCompileLength:1/0,target:"auto",verbose:!1,...e,rules:{allowOrphanBackrefs:!1,asciiWordBoundaries:!1,captureGroup:!1,recursionLimit:20,singleline:!1,...e.rules}};return t.target==="auto"&&(t.target=j.flagGroups?"ES2025":j.unicodeSets?"ES2024":"ES2018"),t}var bl="[ -\r ]",yl=new Set([N(304),N(305)]),te=S`[\p{L}\p{M}\p{N}\p{Pc}]`;function Do(e){if(yl.has(e))return[e];let t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),o=Cl.get(n),s=kl.get(n),a=wl.get(n);return[...r].length===1&&t.add(r),a&&t.add(a),o&&t.add(o),t.add(n),s&&t.add(s),[...t]}var En=new Map(`C Other
60
60
  Cc Control cntrl
61
61
  Cf Format
62
62
  Cn Unassigned
@@ -146,7 +146,7 @@ Uppercase Upper
146
146
  Variation_Selector VS
147
147
  White_Space space
148
148
  XID_Continue XIDC
149
- XID_Start XIDS`.split(/\s/).map(e=>[_e(e),e])),yl=new Map([["s",N(383)],[N(383),"s"]]),kl=new Map([[N(223),N(7838)],[N(107),N(8490)],[N(229),N(8491)],[N(969),N(8486)]]),wl=new Map([ae(453),ae(456),ae(459),ae(498),...wn(8072,8079),...wn(8088,8095),...wn(8104,8111),ae(8124),ae(8140),ae(8188)]),Cl=new Map([["alnum",S`[\p{Alpha}\p{Nd}]`],["alpha",S`\p{Alpha}`],["ascii",S`\p{ASCII}`],["blank",S`[\p{Zs}\t]`],["cntrl",S`\p{Cc}`],["digit",S`\p{Nd}`],["graph",S`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",S`\p{Lower}`],["print",S`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",S`[\p{P}\p{S}]`],["space",S`\p{space}`],["upper",S`\p{Upper}`],["word",S`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",S`\p{AHex}`]]);function Sl(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function ae(e){let t=N(e);return[t.toLowerCase(),t]}function wn(e,t){return Sl(e,t).map(n=>ae(n))}var Uo=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function _l(e,t){let n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};Ho(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:vn(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};pe(e,vl,r);let o={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},s={currentFlags:o,prevFlags:null,globalFlags:o,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};pe(e,xl,s);let a={groupsByName:s.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:s.reffedNodesByReferencer};return pe(e,El,a),e._originMap=s.groupOriginByCopy,e._strategy=r.strategy,e}var vl={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:o}=e;if(o==="repeater"){let s=F();s.body[0].body.push(se({negate:!0,body:r}),he("Any"));let a=F();a.body[0].body.push(fn("greedy",0,1/0,s)),n(I(a,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){let o=e.body.filter(s=>s.kind==="flags");for(let s=n+1;s<t.body.length;s++){let a=t.body[s];qe(r,a,[]).push(...o)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=Wo(t.get(e));if(n){let r=F({flags:n});r.body[0].body=e.body,e.body=[I(r,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:o,remove:s,replaceWith:a},i){let{kind:l,negate:c}=e,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:f,wordIsAscii:g}=i;if(l==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${c?"Y":"y"}"`);if(l==="line_end")a(I(se({body:[ee({body:[St("string_end")]}),ee({body:[Se(10)]})]}),t));else if(l==="line_start")a(I(ne(S`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(l==="search_start")if(f.has(e))o.flags.sticky=!0,s();else{let h=r[n-1];if(h&&Tl(h))a(I(se({negate:!0}),t));else{if(d)throw new Error(S`Uses "\G" in a way that requires a subclass`);a(ie(St("string_start"),t)),i.strategy="clip_search"}}else if(!(l==="string_end"||l==="string_start"))if(l==="string_end_newline")a(I(ne(S`(?=\n?\z)`),t));else if(l==="word_boundary"){if(!g&&!u){let h=`(?:(?<=${te})(?!${te})|(?<!${te})(?=${te}))`,y=`(?:(?<=${te})(?=${te})|(?<!${te})(?!${te}))`;a(I(ne(c?y:h),t))}}else throw new Error(`Unexpected assertion kind "${l}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Sn(n)&&(n=Cn(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!Sn(r)&&(r=Cn(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){if(t.kind==="intersection"){let r=He({body:[e]});n(I(r,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:o,digitIsAscii:s,spaceIsAscii:a,wordIsAscii:i}){let{kind:l,negate:c,value:u}=e;if(s&&(l==="digit"||u==="digit")){n(ie(_t("digit",{negate:c}),t));return}if(a&&(l==="space"||u==="space")){n(I(_n(ne(ml),c),t));return}if(i&&(l==="word"||u==="word")){n(ie(_t("word",{negate:c}),t));return}if(l==="any")n(ie(he("Any"),t));else if(l==="digit")n(ie(he("Nd",{negate:c}),t));else if(l!=="dot")if(l==="text_segment"){if(r==="strict")throw new Error(S`Use of "\X" requires non-strict accuracy`);let d="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",f=S`\p{RI}{2}|${d}(?:\u200D${d})*`;n(I(ne(S`(?>\r\n|${o?S`\p{RGI_Emoji}`:f}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(l==="hex")n(ie(he("AHex",{negate:c}),t));else if(l==="newline")n(I(ne(c?`[^
149
+ XID_Start XIDS`.split(/\s/).map(e=>[_e(e),e])),kl=new Map([["s",N(383)],[N(383),"s"]]),wl=new Map([[N(223),N(7838)],[N(107),N(8490)],[N(229),N(8491)],[N(969),N(8486)]]),Cl=new Map([ae(453),ae(456),ae(459),ae(498),...wn(8072,8079),...wn(8088,8095),...wn(8104,8111),ae(8124),ae(8140),ae(8188)]),Sl=new Map([["alnum",S`[\p{Alpha}\p{Nd}]`],["alpha",S`\p{Alpha}`],["ascii",S`\p{ASCII}`],["blank",S`[\p{Zs}\t]`],["cntrl",S`\p{Cc}`],["digit",S`\p{Nd}`],["graph",S`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",S`\p{Lower}`],["print",S`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",S`[\p{P}\p{S}]`],["space",S`\p{space}`],["upper",S`\p{Upper}`],["word",S`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",S`\p{AHex}`]]);function _l(e,t){let n=[];for(let r=e;r<=t;r++)n.push(r);return n}function ae(e){let t=N(e);return[t.toLowerCase(),t]}function wn(e,t){return _l(e,t).map(n=>ae(n))}var Uo=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function vl(e,t){let n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};Ho(e);let r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:vn(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};pe(e,xl,r);let o={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},s={currentFlags:o,prevFlags:null,globalFlags:o,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};pe(e,El,s);let a={groupsByName:s.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:s.reffedNodesByReferencer};return pe(e,Rl,a),e._originMap=s.groupOriginByCopy,e._strategy=r.strategy,e}var xl={AbsenceFunction({node:e,parent:t,replaceWith:n}){let{body:r,kind:o}=e;if(o==="repeater"){let s=F();s.body[0].body.push(se({negate:!0,body:r}),he("Any"));let a=F();a.body[0].body.push(fn("greedy",0,1/0,s)),n(I(a,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){let o=e.body.filter(s=>s.kind==="flags");for(let s=n+1;s<t.body.length;s++){let a=t.body[s];qe(r,a,[]).push(...o)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){let n=Wo(t.get(e));if(n){let r=F({flags:n});r.body[0].body=e.body,e.body=[I(r,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:o,remove:s,replaceWith:a},i){let{kind:l,negate:c}=e,{asciiWordBoundaries:u,avoidSubclass:d,supportedGNodes:f,wordIsAscii:g}=i;if(l==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${c?"Y":"y"}"`);if(l==="line_end")a(I(se({body:[ee({body:[St("string_end")]}),ee({body:[Se(10)]})]}),t));else if(l==="line_start")a(I(ne(S`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(l==="search_start")if(f.has(e))o.flags.sticky=!0,s();else{let h=r[n-1];if(h&&Ll(h))a(I(se({negate:!0}),t));else{if(d)throw new Error(S`Uses "\G" in a way that requires a subclass`);a(ie(St("string_start"),t)),i.strategy="clip_search"}}else if(!(l==="string_end"||l==="string_start"))if(l==="string_end_newline")a(I(ne(S`(?=\n?\z)`),t));else if(l==="word_boundary"){if(!g&&!u){let h=`(?:(?<=${te})(?!${te})|(?<!${te})(?=${te}))`,y=`(?:(?<=${te})(?=${te})|(?<!${te})(?!${te}))`;a(I(ne(c?y:h),t))}}else throw new Error(`Unexpected assertion kind "${l}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Sn(n)&&(n=Cn(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!Sn(r)&&(r=Cn(r,t),e.name=r),n.set(e.number,e),r&&n.set(r,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){if(t.kind==="intersection"){let r=He({body:[e]});n(I(r,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:o,digitIsAscii:s,spaceIsAscii:a,wordIsAscii:i}){let{kind:l,negate:c,value:u}=e;if(s&&(l==="digit"||u==="digit")){n(ie(_t("digit",{negate:c}),t));return}if(a&&(l==="space"||u==="space")){n(I(_n(ne(bl),c),t));return}if(i&&(l==="word"||u==="word")){n(ie(_t("word",{negate:c}),t));return}if(l==="any")n(ie(he("Any"),t));else if(l==="digit")n(ie(he("Nd",{negate:c}),t));else if(l!=="dot")if(l==="text_segment"){if(r==="strict")throw new Error(S`Use of "\X" requires non-strict accuracy`);let d="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",f=S`\p{RI}{2}|${d}(?:\u200D${d})*`;n(I(ne(S`(?>\r\n|${o?S`\p{RGI_Emoji}`:f}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(l==="hex")n(ie(he("AHex",{negate:c}),t));else if(l==="newline")n(I(ne(c?`[^
150
150
  ]`:`(?>\r
151
151
  ?|[
152
- \v\f\x85\u2028\u2029])`),t));else if(l==="posix")if(!o&&(u==="graph"||u==="print")){if(r==="strict")throw new Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let d={graph:"!-~",print:" -~"}[u];c&&(d=`\0-${N(d.codePointAt(0)-1)}${N(d.codePointAt(2)+1)}-\u{10FFFF}`),n(I(ne(`[${d}]`),t))}else n(I(_n(ne(Cl.get(u)),c),t));else if(l==="property")En.has(_e(u))||(e.key="sc");else if(l==="space")n(ie(he("space",{negate:c}),t));else if(l==="word")n(I(_n(ne(te),c),t));else throw new Error(`Unexpected character set kind "${l}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:o,removeAllPrevSiblings:s,removeAllNextSiblings:a}){let{kind:i,flags:l}=e;if(i==="flags")if(!l.enable&&!l.disable)r();else{let c=F({flags:l});c.body[0].body=a(),o(I(c,t),{traverse:!0})}else if(i==="keep"){let c=n.body[0],d=n.body.length===1&&kt(c,{type:"Group"})&&c.body[0].body.length===1?c.body[0]:n;if(t.parent!==d||d.body.length>1)throw new Error(S`Uses "\K" in a way that's unsupported`);let f=se({behind:!0});f.body[0].body=s(),o(I(f,t))}else throw new Error(`Unexpected directive kind "${i}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete e[n]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r==="fail")n(I(se({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){let t=F();t.body[0].body.push(e.body),e.body=I(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,o=!1;for(let s of e.body)if(s.body.length===1&&s.body[0].kind==="search_start")s.body.pop();else{let a=qo(s.body);a?(r=!0,Array.isArray(a)?n.push(...a):n.push(a)):o=!0}r&&!o&&n.forEach(s=>t.add(s))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t==="strict"&&n&&r)throw new Error(S`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Sn(n)&&(n=Cn(n,t),e.ref=n)}},xl={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:o}=e;r||n.set(e,[...t.get(o).map(({node:s})=>s)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:o,groupsByName:s,multiplexCapturesToLeftByRef:a,openRefs:i,reffedNodesByReferencer:l}){let c=o.get(e);if(c&&i.has(e.number)){let d=ie(Mo(e.number),t);l.set(d,i.get(e.number)),n(d);return}i.set(e.number,e),a.set(e.number,[]),e.name&&qe(a,e.name,[]);let u=a.get(e.name??e.number);for(let d=0;d<u.length;d++){let f=u[d];if(c===f.node||c&&c===f.origin||e===f.origin){u.splice(d,1);break}}if(a.get(e.number).push({node:e,origin:c}),e.name&&a.get(e.name).push({node:e,origin:c}),e.name){let d=qe(s,e.name,new Map),f=!1;if(c)f=!0;else for(let g of d.values())if(!g.hasDuplicateNameToRemove){f=!0;break}s.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:f})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=Et(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:o,ref:s}=e;if(o){let u=t;for(;(u=u.parent)&&!(u.type==="CapturingGroup"&&(u.name===s||u.number===s)););r.reffedNodesByReferencer.set(e,u);return}let a=r.subroutineRefMap.get(s),i=s===0,l=i?Mo(0):jo(a,r.groupOriginByCopy,null),c=l;if(!i){let u=Wo(Il(a,f=>f.type==="Group"&&!!f.flags)),d=u?Et(r.globalFlags,u):r.globalFlags;Al(d,r.currentFlags)||(c=F({flags:Bl(d)}),c.body[0].body.push(l))}n(I(c,t),{traverse:!i})}},El={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let s=r.reffedNodesByReferencer.get(e).filter(a=>Rl(a,e));if(!s.length)n(I(se({negate:!0}),t));else if(s.length>1){let a=F({atomic:!0,body:s.reverse().map(i=>ee({body:[wt(i.number)]}))});n(I(a,t))}else e.ref=s[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let r=0;r<n;r++){let o=dn();e.body.at(-1).body.push(o)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function Ho(e){pe(e,{"*"({node:t,parent:n}){t.parent=n}})}function Al(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function Rl(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;let r=zo(n.parent);for(let o of r){if(o===n)break;if(o===e||Vo(o,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function jo(e,t,n,r){let o=Array.isArray(e)?[]:{};for(let[s,a]of Object.entries(e))s==="parent"?o.parent=Array.isArray(n)?r:n:a&&typeof a=="object"?o[s]=jo(a,t,o,n):(s==="type"&&a==="CapturingGroup"&&t.set(o,t.get(e)??e),o[s]=a);return o}function Mo(e){let t=gn(e);return t.isRecursive=!0,t}function Il(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Cn(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,n),n}function Wo(e){let t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return e.forEach(({flags:r})=>{t.forEach(o=>{r.enable?.[o]&&(delete n.disable[o],n.enable[o]=!0),r.disable?.[o]&&(n.disable[o]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function Bl({dotAll:e,ignoreCase:t}){let n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function zo(e){if(!e)throw new Error("Node expected");let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function qo(e){let t=e.find(n=>n.kind==="search_start"||Ll(n,{negate:!1})||!Nl(n));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){let n=[];for(let r of t.body){let o=qo(r.body);if(!o)return null;Array.isArray(o)?n.push(...o):n.push(o)}return n}return null}function Vo(e,t){let n=zo(e)??[];for(let r of n)if(r===t||Vo(r,t))return!0;return!1}function Nl({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function Tl(e){let t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function Ll(e,t){let n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&kt(e.body[0],{type:"Assertion",kind:"search_start"})}function Sn(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function ne(e,t){let r=Ct(e,{...t,unicodePropertyMap:En}).body;return r.length>1||r[0].body.length>1?F({body:r}):r[0].body[0]}function _n(e,t){return e.negate=t,e}function ie(e,t){return e.parent=t,e}function I(e,t){return Ho(e),e.parent=t,e}function Pl(e,t){let n=Fo(t),r=vn(n.target,"ES2024"),o=vn(n.target,"ES2025"),s=n.rules.recursionLimit;if(!Number.isInteger(s)||s<2||s>20)throw new Error("Invalid recursionLimit; use 2-20");let a=null,i=null;if(!o){let g=[e.flags.ignoreCase];pe(e,Ml,{getCurrentModI:()=>g.at(-1),popModI(){g.pop()},pushModI(h){g.push(h)},setHasCasedChar(){g.at(-1)?a=!0:i=!0}})}let l={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||a)&&!i)},c=e,u={accuracy:n.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:c,originMap:e._originMap,recursionLimit:s,useAppliedIgnoreCase:!!(!o&&a&&i),useFlagMods:o,useFlagV:r,verbose:n.verbose};function d(g){return u.lastNode=c,c=g,hl($l[g.type],`Unexpected node type "${g.type}"`)(g,u,d)}let f={pattern:e.body.map(d).join("|"),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((g,h)=>{g.hidden&&f._hiddenCaptures.push(h),g.transferTo&&qe(f._captureTransfers,g.transferTo,[]).push(h)}),f}var Ml={"*":{enter({node:e},t){if(Go(e)){let n=t.getCurrentModI();t.pushModI(e.flags?Et({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){Go(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){An(N(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),Xo(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&Uo.has(e.value)&&t.setHasCasedChar()}},$l={Alternative({body:e},t,n){return e.map(n).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?S`\B`:S`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){let{body:r,name:o,number:s}=e,a={ignoreCase:t.currentFlags.ignoreCase},i=t.originMap.get(e);return i&&(a.hidden=!0,s>i.number&&(a.transferTo=i.number)),t.captureMap.set(s,a),`(${o?`?<${o}>`:""}${r.map(n).join("|")})`},Character({value:e},t){let n=N(e),r=xe(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&An(n)){let o=Do(n);return t.inCharClass?o.join(""):o.length>1?`[${o.join("")}]`:o[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:o,parent:s}=e,{body:a}=e;if(r==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");j.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&a.some(Oo)&&(a=[Se(45),...a.filter(c=>!Oo(c))]);let i=()=>`[${o?"^":""}${a.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||j.bugNestedClassIgnoresNegation)&&!o){let u=a.filter(d=>d.type==="CharacterClass"&&d.kind==="union"&&d.negate);if(u.length){let d=F(),f=d.body[0];return d.parent=s,f.parent=d,a=a.filter(g=>!u.includes(g)),e.body=a,a.length?(e.parent=f,f.body.push(e)):d.body.pop(),u.forEach(g=>{let h=ee({body:[g]});g.parent=h,h.parent=d,d.body.push(h)}),n(d)}}t.inCharClass=!0;let c=i();return t.inCharClass=!1,c}let l=a[0];if(r==="union"&&!o&&l&&((!t.useFlagV||!t.verbose)&&s.kind==="union"&&!(j.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&s.kind==="intersection"&&a.length===1&&l.type!=="CharacterClassRange"))return a.map(n).join("");if(!t.useFlagV&&s.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return i()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,o={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},s=xe(n,o),a=xe(r,o),i=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){let l=Xo(e);Ul(l).forEach(u=>{i.add(Array.isArray(u)?`${xe(u[0],o)}-${xe(u[1],o)}`:xe(u,o))})}return`${s}-${a}${[...i].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},o){if(e==="dot")return o.currentFlags.dotAll?o.appliedGlobalFlags.dotAll||o.useFlagMods?".":"[^]":S`[^\n]`;if(e==="digit")return t?S`\D`:S`\d`;if(e==="property"){if(o.useAppliedIgnoreCase&&o.currentFlags.ignoreCase&&Uo.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?S`\P`:S`\p`}{${r?`${r}=`:""}${n}}`}if(e==="word")return t?S`\W`:S`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:n,parent:r},o,s){let a=o.currentFlags;n&&(o.currentFlags=Et(a,n));let i=t.map(s).join("|"),l=!o.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!o.useFlagMods||!n)?i:`(?${Hl(e,n,o.useFlagMods)}${i})`;return o.currentFlags=a,l},LookaroundAssertion({body:e,kind:t,negate:n},r,o){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(o).join("|")})`},Quantifier(e,t,n){return n(e.body)+jl(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");let r=n.recursionLimit;return t===0?`(?R=${r})`:S`\g<${t}&R=${r}>`}},Gl=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),Ol=new Set(["-","\\","]","^","["]),Fl=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),$o=new Map([[9,S`\t`],[10,S`\n`],[11,S`\v`],[12,S`\f`],[13,S`\r`],[8232,S`\u2028`],[8233,S`\u2029`],[65279,S`\uFEFF`]]),Dl=/^\p{Cased}$/u;function An(e){return Dl.test(e)}function Xo(e,t){let n=!!t?.firstOnly,r=e.min.value,o=e.max.value,s=[];if(r<65&&(o===65535||o>=131071)||r===65536&&o>=131071)return s;for(let a=r;a<=o;a++){let i=N(a);if(!An(i))continue;let l=Do(i).filter(c=>{let u=c.codePointAt(0);return u<r||u>o});if(l.length&&(s.push(...l),n))break}return s}function xe(e,{escDigit:t,inCharClass:n,useFlagV:r}){if($o.has(e))return $o.get(e);if(e<32||e>126&&e<160||e>262143||t&&Wl(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;let o=n?r?Fl:Ol:Gl,s=N(e);return(o.has(s)?"\\":"")+s}function Ul(e){let t=e.map(o=>o.codePointAt(0)).sort((o,s)=>o-s),n=[],r=null;for(let o=0;o<t.length;o++)t[o+1]===t[o]+1?r??=t[o]:r===null?n.push(t[o]):(n.push([r,t[o]]),r=null);return n}function Hl(e,t,n){if(e)return">";let r="";if(t&&n){let{enable:o,disable:s}=t;r=(o?.ignoreCase?"i":"")+(o?.dotAll?"s":"")+(s?"-":"")+(s?.ignoreCase?"i":"")+(s?.dotAll?"s":"")}return`${r}:`}function jl({kind:e,max:t,min:n}){let r;return!n&&t===1?r="?":!n&&t===1/0?r="*":n===1&&t===1/0?r="+":n===t?r=`{${n}}`:r=`{${n},${t===1/0?"":t}}`,r+{greedy:"",lazy:"?",possessive:"+"}[e]}function Go({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function Wl(e){return e>47&&e<58}function Oo({type:e,value:t}){return e==="Character"&&t===45}var zl=class xn extends RegExp{#t=new Map;#e=null;#r;#n=null;#o=null;rawOptions={};get source(){return this.#r||"(?:)"}constructor(t,n,r){let o=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw new Error("Cannot provide options when copying a regexp");let s=t;super(s,n),this.#r=s.source,s instanceof xn&&(this.#t=s.#t,this.#n=s.#n,this.#o=s.#o,this.rawOptions=s.rawOptions)}else{let s={hiddenCaptures:[],strategy:null,transfers:[],...r};super(o?"":t,n),this.#r=t,this.#t=Vl(s.hiddenCaptures,s.transfers),this.#o=s.strategy,this.rawOptions=r??{}}o||(this.#e=this)}exec(t){if(!this.#e){let{lazyCompile:o,...s}=this.rawOptions;this.#e=new xn(this.#r,this.flags,s)}let n=this.global||this.sticky,r=this.lastIndex;if(this.#o==="clip_search"&&n&&r){this.lastIndex=0;let o=this.#s(t.slice(r));return o&&(ql(o,r,t,this.hasIndices),this.lastIndex+=r),o}return this.#s(t)}#s(t){this.#e.lastIndex=this.lastIndex;let n=super.exec.call(this.#e,t);if(this.lastIndex=this.#e.lastIndex,!n||!this.#t.size)return n;let r=[...n];n.length=1;let o;this.hasIndices&&(o=[...n.indices],n.indices.length=1);let s=[0];for(let a=1;a<r.length;a++){let{hidden:i,transferTo:l}=this.#t.get(a)??{};if(i?s.push(null):(s.push(n.length),n.push(r[a]),this.hasIndices&&n.indices.push(o[a])),l&&r[a]!==void 0){let c=s[l];if(!c)throw new Error(`Invalid capture transfer to "${c}"`);if(n[c]=r[a],this.hasIndices&&(n.indices[c]=o[a]),n.groups){this.#n||(this.#n=Xl(this.source));let u=this.#n.get(l);u&&(n.groups[u]=r[a],this.hasIndices&&(n.indices.groups[u]=o[a]))}}}return n}};function ql(e,t,n,r){if(e.index+=t,e.input=n,r){let o=e.indices;for(let a=0;a<o.length;a++){let i=o[a];i&&(o[a]=[i[0]+t,i[1]+t])}let s=o.groups;s&&Object.keys(s).forEach(a=>{let i=s[a];i&&(s[a]=[i[0]+t,i[1]+t])})}}function Vl(e,t){let n=new Map;for(let r of e)n.set(r,{hidden:!0});for(let[r,o]of t)for(let s of o)qe(n,s,{}).transferTo=r;return n}function Xl(e){let t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,o=0,s;for(;s=t.exec(e);){let{0:a,groups:{capture:i,name:l}}=s;a==="["?r++:r?a==="]"&&r--:i&&(o++,l&&n.set(o,l))}return n}function Qo(e,t){let n=Ql(e,t);return n.options?new zl(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function Ql(e,t){let n=Fo(t),r=Ct(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:En}),o=_l(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),s=Pl(o,n),a=Lo(s.pattern,{captureTransfers:s._captureTransfers,hiddenCaptures:s._hiddenCaptures,mode:"external"}),i=bn(a.pattern),l=mn(i.pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),c={pattern:l.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${s.flags}${s.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{let u=l.hiddenCaptures.sort((h,y)=>h-y),d=Array.from(l.captureTransfers),f=o._strategy,g=c.pattern.length>=n.lazyCompileLength;(u.length||d.length||f||g)&&(c.options={...u.length&&{hiddenCaptures:u},...d.length&&{transfers:d},...f&&{strategy:f},...g&&{lazyCompile:g}})}return c}function Ko(e,t){return Qo(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function Rn(e={}){let t={target:"auto",cache:new Map,...e};return t.regexConstructor||=n=>Ko(n,{target:t.target}),{createScanner(n){return new to(n,t)},createString:no}}var ts;var ns=async e=>{ts??=Zr({langs:[],themes:[Promise.resolve().then(()=>(Jo(),Yo)),Promise.resolve().then(()=>(es(),Zo))],engine:Rn()});let t=await ts;return t.getLoadedLanguages().includes(e.language)||await t.loadLanguage(...e.grammars),t.codeToTokens(e.source,{lang:e.language,theme:e.theme}).tokens};globalThis.onmessage=async({data:e})=>{let t;try{t={id:e.id,tokens:await ns(e)}}catch(n){t={id:e.id,error:n instanceof Error?n.message:String(n)}}globalThis.postMessage(t)};})();
152
+ \v\f\x85\u2028\u2029])`),t));else if(l==="posix")if(!o&&(u==="graph"||u==="print")){if(r==="strict")throw new Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let d={graph:"!-~",print:" -~"}[u];c&&(d=`\0-${N(d.codePointAt(0)-1)}${N(d.codePointAt(2)+1)}-\u{10FFFF}`),n(I(ne(`[${d}]`),t))}else n(I(_n(ne(Sl.get(u)),c),t));else if(l==="property")En.has(_e(u))||(e.key="sc");else if(l==="space")n(ie(he("space",{negate:c}),t));else if(l==="word")n(I(_n(ne(te),c),t));else throw new Error(`Unexpected character set kind "${l}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:o,removeAllPrevSiblings:s,removeAllNextSiblings:a}){let{kind:i,flags:l}=e;if(i==="flags")if(!l.enable&&!l.disable)r();else{let c=F({flags:l});c.body[0].body=a(),o(I(c,t),{traverse:!0})}else if(i==="keep"){let c=n.body[0],d=n.body.length===1&&kt(c,{type:"Group"})&&c.body[0].body.length===1?c.body[0]:n;if(t.parent!==d||d.body.length>1)throw new Error(S`Uses "\K" in a way that's unsupported`);let f=se({behind:!0});f.body[0].body=s(),o(I(f,t))}else throw new Error(`Unexpected directive kind "${i}"`)},Flags({node:e,parent:t}){if(e.posixIsAscii)throw new Error('Unsupported flag "P"');if(e.textSegmentMode==="word")throw new Error('Unsupported flag "y{w}"');["digitIsAscii","extended","posixIsAscii","spaceIsAscii","wordIsAscii","textSegmentMode"].forEach(n=>delete e[n]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;let{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){let{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){let{kind:r}=e;if(r==="fail")n(I(se({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){let t=F();t.body[0].body.push(e.body),e.body=I(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){let n=[],r=!1,o=!1;for(let s of e.body)if(s.body.length===1&&s.body[0].kind==="search_start")s.body.pop();else{let a=qo(s.body);a?(r=!0,Array.isArray(a)?n.push(...a):n.push(a)):o=!0}r&&!o&&n.forEach(s=>t.add(s))},exit(e,{accuracy:t,passedLookbehind:n,strategy:r}){if(t==="strict"&&n&&r)throw new Error(S`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Sn(n)&&(n=Cn(n,t),e.ref=n)}},El={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){let{orphan:r,ref:o}=e;r||n.set(e,[...t.get(o).map(({node:s})=>s)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:o,groupsByName:s,multiplexCapturesToLeftByRef:a,openRefs:i,reffedNodesByReferencer:l}){let c=o.get(e);if(c&&i.has(e.number)){let d=ie(Mo(e.number),t);l.set(d,i.get(e.number)),n(d);return}i.set(e.number,e),a.set(e.number,[]),e.name&&qe(a,e.name,[]);let u=a.get(e.name??e.number);for(let d=0;d<u.length;d++){let f=u[d];if(c===f.node||c&&c===f.origin||e===f.origin){u.splice(d,1);break}}if(a.get(e.number).push({node:e,origin:c}),e.name&&a.get(e.name).push({node:e,origin:c}),e.name){let d=qe(s,e.name,new Map),f=!1;if(c)f=!0;else for(let g of d.values())if(!g.hasDuplicateNameToRemove){f=!0;break}s.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:f})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=Et(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){let{isRecursive:o,ref:s}=e;if(o){let u=t;for(;(u=u.parent)&&!(u.type==="CapturingGroup"&&(u.name===s||u.number===s)););r.reffedNodesByReferencer.set(e,u);return}let a=r.subroutineRefMap.get(s),i=s===0,l=i?Mo(0):jo(a,r.groupOriginByCopy,null),c=l;if(!i){let u=Wo(Bl(a,f=>f.type==="Group"&&!!f.flags)),d=u?Et(r.globalFlags,u):r.globalFlags;Al(d,r.currentFlags)||(c=F({flags:Nl(d)}),c.body[0].body.push(l))}n(I(c,t),{traverse:!i})}},Rl={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}let s=r.reffedNodesByReferencer.get(e).filter(a=>Il(a,e));if(!s.length)n(I(se({negate:!0}),t));else if(s.length>1){let a=F({atomic:!0,body:s.reverse().map(i=>ee({body:[wt(i.number)]}))});n(I(a,t))}else e.ref=s[0].number},CapturingGroup({node:e},t){e.number=++t.numCapturesToLeft,e.name&&t.groupsByName.get(e.name).get(e).hasDuplicateNameToRemove&&delete e.name},Regex:{exit({node:e},t){let n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let r=0;r<n;r++){let o=dn();e.body.at(-1).body.push(o)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function Ho(e){pe(e,{"*"({node:t,parent:n}){t.parent=n}})}function Al(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function Il(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;let r=zo(n.parent);for(let o of r){if(o===n)break;if(o===e||Vo(o,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function jo(e,t,n,r){let o=Array.isArray(e)?[]:{};for(let[s,a]of Object.entries(e))s==="parent"?o.parent=Array.isArray(n)?r:n:a&&typeof a=="object"?o[s]=jo(a,t,o,n):(s==="type"&&a==="CapturingGroup"&&t.set(o,t.get(e)??e),o[s]=a);return o}function Mo(e){let t=gn(e);return t.isRecursive=!0,t}function Bl(e,t){let n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Cn(e,t){if(t.has(e))return t.get(e);let n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,n),n}function Wo(e){let t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return e.forEach(({flags:r})=>{t.forEach(o=>{r.enable?.[o]&&(delete n.disable[o],n.enable[o]=!0),r.disable?.[o]&&(n.disable[o]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function Nl({dotAll:e,ignoreCase:t}){let n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function zo(e){if(!e)throw new Error("Node expected");let{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function qo(e){let t=e.find(n=>n.kind==="search_start"||Pl(n,{negate:!1})||!Tl(n));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){let n=[];for(let r of t.body){let o=qo(r.body);if(!o)return null;Array.isArray(o)?n.push(...o):n.push(o)}return n}return null}function Vo(e,t){let n=zo(e)??[];for(let r of n)if(r===t||Vo(r,t))return!0;return!1}function Tl({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function Ll(e){let t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function Pl(e,t){let n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&kt(e.body[0],{type:"Assertion",kind:"search_start"})}function Sn(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function ne(e,t){let r=Ct(e,{...t,unicodePropertyMap:En}).body;return r.length>1||r[0].body.length>1?F({body:r}):r[0].body[0]}function _n(e,t){return e.negate=t,e}function ie(e,t){return e.parent=t,e}function I(e,t){return Ho(e),e.parent=t,e}function Ml(e,t){let n=Fo(t),r=vn(n.target,"ES2024"),o=vn(n.target,"ES2025"),s=n.rules.recursionLimit;if(!Number.isInteger(s)||s<2||s>20)throw new Error("Invalid recursionLimit; use 2-20");let a=null,i=null;if(!o){let g=[e.flags.ignoreCase];pe(e,$l,{getCurrentModI:()=>g.at(-1),popModI(){g.pop()},pushModI(h){g.push(h)},setHasCasedChar(){g.at(-1)?a=!0:i=!0}})}let l={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||a)&&!i)},c=e,u={accuracy:n.accuracy,appliedGlobalFlags:l,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:c,originMap:e._originMap,recursionLimit:s,useAppliedIgnoreCase:!!(!o&&a&&i),useFlagMods:o,useFlagV:r,verbose:n.verbose};function d(g){return u.lastNode=c,c=g,pl(Gl[g.type],`Unexpected node type "${g.type}"`)(g,u,d)}let f={pattern:e.body.map(d).join("|"),flags:d(e.flags),options:{...e.options}};return r||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((g,h)=>{g.hidden&&f._hiddenCaptures.push(h),g.transferTo&&qe(f._captureTransfers,g.transferTo,[]).push(h)}),f}var $l={"*":{enter({node:e},t){if(Go(e)){let n=t.getCurrentModI();t.pushModI(e.flags?Et({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){Go(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){Rn(N(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),Xo(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&Uo.has(e.value)&&t.setHasCasedChar()}},Gl={Alternative({body:e},t,n){return e.map(n).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?S`\B`:S`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){let{body:r,name:o,number:s}=e,a={ignoreCase:t.currentFlags.ignoreCase},i=t.originMap.get(e);return i&&(a.hidden=!0,s>i.number&&(a.transferTo=i.number)),t.captureMap.set(s,a),`(${o?`?<${o}>`:""}${r.map(n).join("|")})`},Character({value:e},t){let n=N(e),r=xe(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Rn(n)){let o=Do(n);return t.inCharClass?o.join(""):o.length>1?`[${o.join("")}]`:o[0]}return n},CharacterClass(e,t,n){let{kind:r,negate:o,parent:s}=e,{body:a}=e;if(r==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");j.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&a.some(Oo)&&(a=[Se(45),...a.filter(c=>!Oo(c))]);let i=()=>`[${o?"^":""}${a.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||j.bugNestedClassIgnoresNegation)&&!o){let u=a.filter(d=>d.type==="CharacterClass"&&d.kind==="union"&&d.negate);if(u.length){let d=F(),f=d.body[0];return d.parent=s,f.parent=d,a=a.filter(g=>!u.includes(g)),e.body=a,a.length?(e.parent=f,f.body.push(e)):d.body.pop(),u.forEach(g=>{let h=ee({body:[g]});g.parent=h,h.parent=d,d.body.push(h)}),n(d)}}t.inCharClass=!0;let c=i();return t.inCharClass=!1,c}let l=a[0];if(r==="union"&&!o&&l&&((!t.useFlagV||!t.verbose)&&s.kind==="union"&&!(j.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&s.kind==="intersection"&&a.length===1&&l.type!=="CharacterClassRange"))return a.map(n).join("");if(!t.useFlagV&&s.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return i()},CharacterClassRange(e,t){let n=e.min.value,r=e.max.value,o={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},s=xe(n,o),a=xe(r,o),i=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){let l=Xo(e);Hl(l).forEach(u=>{i.add(Array.isArray(u)?`${xe(u[0],o)}-${xe(u[1],o)}`:xe(u,o))})}return`${s}-${a}${[...i].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},o){if(e==="dot")return o.currentFlags.dotAll?o.appliedGlobalFlags.dotAll||o.useFlagMods?".":"[^]":S`[^\n]`;if(e==="digit")return t?S`\D`:S`\d`;if(e==="property"){if(o.useAppliedIgnoreCase&&o.currentFlags.ignoreCase&&Uo.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?S`\P`:S`\p`}{${r?`${r}=`:""}${n}}`}if(e==="word")return t?S`\W`:S`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:n,parent:r},o,s){let a=o.currentFlags;n&&(o.currentFlags=Et(a,n));let i=t.map(s).join("|"),l=!o.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!o.useFlagMods||!n)?i:`(?${jl(e,n,o.useFlagMods)}${i})`;return o.currentFlags=a,l},LookaroundAssertion({body:e,kind:t,negate:n},r,o){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(o).join("|")})`},Quantifier(e,t,n){return n(e.body)+Wl(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");let r=n.recursionLimit;return t===0?`(?R=${r})`:S`\g<${t}&R=${r}>`}},Ol=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),Fl=new Set(["-","\\","]","^","["]),Dl=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),$o=new Map([[9,S`\t`],[10,S`\n`],[11,S`\v`],[12,S`\f`],[13,S`\r`],[8232,S`\u2028`],[8233,S`\u2029`],[65279,S`\uFEFF`]]),Ul=/^\p{Cased}$/u;function Rn(e){return Ul.test(e)}function Xo(e,t){let n=!!t?.firstOnly,r=e.min.value,o=e.max.value,s=[];if(r<65&&(o===65535||o>=131071)||r===65536&&o>=131071)return s;for(let a=r;a<=o;a++){let i=N(a);if(!Rn(i))continue;let l=Do(i).filter(c=>{let u=c.codePointAt(0);return u<r||u>o});if(l.length&&(s.push(...l),n))break}return s}function xe(e,{escDigit:t,inCharClass:n,useFlagV:r}){if($o.has(e))return $o.get(e);if(e<32||e>126&&e<160||e>262143||t&&zl(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;let o=n?r?Dl:Fl:Ol,s=N(e);return(o.has(s)?"\\":"")+s}function Hl(e){let t=e.map(o=>o.codePointAt(0)).sort((o,s)=>o-s),n=[],r=null;for(let o=0;o<t.length;o++)t[o+1]===t[o]+1?r??=t[o]:r===null?n.push(t[o]):(n.push([r,t[o]]),r=null);return n}function jl(e,t,n){if(e)return">";let r="";if(t&&n){let{enable:o,disable:s}=t;r=(o?.ignoreCase?"i":"")+(o?.dotAll?"s":"")+(s?"-":"")+(s?.ignoreCase?"i":"")+(s?.dotAll?"s":"")}return`${r}:`}function Wl({kind:e,max:t,min:n}){let r;return!n&&t===1?r="?":!n&&t===1/0?r="*":n===1&&t===1/0?r="+":n===t?r=`{${n}}`:r=`{${n},${t===1/0?"":t}}`,r+{greedy:"",lazy:"?",possessive:"+"}[e]}function Go({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function zl(e){return e>47&&e<58}function Oo({type:e,value:t}){return e==="Character"&&t===45}var ql=class xn extends RegExp{#t=new Map;#e=null;#r;#n=null;#o=null;rawOptions={};get source(){return this.#r||"(?:)"}constructor(t,n,r){let o=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw new Error("Cannot provide options when copying a regexp");let s=t;super(s,n),this.#r=s.source,s instanceof xn&&(this.#t=s.#t,this.#n=s.#n,this.#o=s.#o,this.rawOptions=s.rawOptions)}else{let s={hiddenCaptures:[],strategy:null,transfers:[],...r};super(o?"":t,n),this.#r=t,this.#t=Xl(s.hiddenCaptures,s.transfers),this.#o=s.strategy,this.rawOptions=r??{}}o||(this.#e=this)}exec(t){if(!this.#e){let{lazyCompile:o,...s}=this.rawOptions;this.#e=new xn(this.#r,this.flags,s)}let n=this.global||this.sticky,r=this.lastIndex;if(this.#o==="clip_search"&&n&&r){this.lastIndex=0;let o=this.#s(t.slice(r));return o&&(Vl(o,r,t,this.hasIndices),this.lastIndex+=r),o}return this.#s(t)}#s(t){this.#e.lastIndex=this.lastIndex;let n=super.exec.call(this.#e,t);if(this.lastIndex=this.#e.lastIndex,!n||!this.#t.size)return n;let r=[...n];n.length=1;let o;this.hasIndices&&(o=[...n.indices],n.indices.length=1);let s=[0];for(let a=1;a<r.length;a++){let{hidden:i,transferTo:l}=this.#t.get(a)??{};if(i?s.push(null):(s.push(n.length),n.push(r[a]),this.hasIndices&&n.indices.push(o[a])),l&&r[a]!==void 0){let c=s[l];if(!c)throw new Error(`Invalid capture transfer to "${c}"`);if(n[c]=r[a],this.hasIndices&&(n.indices[c]=o[a]),n.groups){this.#n||(this.#n=Ql(this.source));let u=this.#n.get(l);u&&(n.groups[u]=r[a],this.hasIndices&&(n.indices.groups[u]=o[a]))}}}return n}};function Vl(e,t,n,r){if(e.index+=t,e.input=n,r){let o=e.indices;for(let a=0;a<o.length;a++){let i=o[a];i&&(o[a]=[i[0]+t,i[1]+t])}let s=o.groups;s&&Object.keys(s).forEach(a=>{let i=s[a];i&&(s[a]=[i[0]+t,i[1]+t])})}}function Xl(e,t){let n=new Map;for(let r of e)n.set(r,{hidden:!0});for(let[r,o]of t)for(let s of o)qe(n,s,{}).transferTo=r;return n}function Ql(e){let t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map,r=0,o=0,s;for(;s=t.exec(e);){let{0:a,groups:{capture:i,name:l}}=s;a==="["?r++:r?a==="]"&&r--:i&&(o++,l&&n.set(o,l))}return n}function Qo(e,t){let n=Jl(e,t);return n.options?new ql(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function Jl(e,t){let n=Fo(t),r=Ct(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:En}),o=vl(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),s=Ml(o,n),a=Lo(s.pattern,{captureTransfers:s._captureTransfers,hiddenCaptures:s._hiddenCaptures,mode:"external"}),i=bn(a.pattern),l=mn(i.pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),c={pattern:l.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${s.flags}${s.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{let u=l.hiddenCaptures.sort((h,y)=>h-y),d=Array.from(l.captureTransfers),f=o._strategy,g=c.pattern.length>=n.lazyCompileLength;(u.length||d.length||f||g)&&(c.options={...u.length&&{hiddenCaptures:u},...d.length&&{transfers:d},...f&&{strategy:f},...g&&{lazyCompile:g}})}return c}function Jo(e,t){return Qo(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function An(e={}){let t={target:"auto",cache:new Map,...e};return t.regexConstructor||=n=>Jo(n,{target:t.target}),{createScanner(n){return new to(n,t)},createString:no}}var Kl=()=>globalThis.__doocConnections??={active:"local",items:new Map},Ko=()=>Kl().active;var Qf=Ko();var ns=new Map;var rs=async e=>{let t=e.workspace??"local",n=ns.get(t);n||(n=Zr({langs:[],themes:[Promise.resolve().then(()=>(Zo(),Yo)),Promise.resolve().then(()=>(ts(),es))],engine:An()}),ns.set(t,n));let r=await n;return r.getLoadedLanguages().includes(e.language)||await r.loadLanguage(...e.grammars),r.codeToTokens(e.source,{lang:e.language,theme:e.theme}).tokens};globalThis.onmessage=async({data:e})=>{let t;try{t={id:e.id,tokens:await rs(e)}}catch(n){t={id:e.id,error:n instanceof Error?n.message:String(n)}}globalThis.postMessage(t)};})();