@prismshadow/penguin-server 0.2.13 → 0.2.15

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 (428) hide show
  1. package/dist/api/types.d.ts +2722 -159
  2. package/dist/api/types.js +3 -1
  3. package/dist/auth-token.d.ts +22 -1
  4. package/dist/auth-token.js +2 -2
  5. package/dist/auth-token.js.map +1 -1
  6. package/dist/benchmark-package.d.ts +39 -0
  7. package/dist/benchmark-package.js +97 -0
  8. package/dist/benchmark-package.js.map +1 -0
  9. package/dist/chunk-54E64LWB.js +63 -0
  10. package/dist/chunk-54E64LWB.js.map +1 -0
  11. package/dist/{chunk-3I2XOPJB.js → chunk-5Z4UCHDB.js} +95 -78
  12. package/dist/chunk-5Z4UCHDB.js.map +1 -0
  13. package/dist/chunk-HX3WBUYX.js +18 -0
  14. package/dist/chunk-HX3WBUYX.js.map +1 -0
  15. package/dist/chunk-JKJXQTHH.js +19 -0
  16. package/dist/chunk-JKJXQTHH.js.map +1 -0
  17. package/dist/{chunk-A3QANMU5.js → chunk-NVWAYYRX.js} +279 -9
  18. package/dist/chunk-NVWAYYRX.js.map +1 -0
  19. package/dist/chunk-Q4ON2L6E.js +52 -0
  20. package/dist/chunk-Q4ON2L6E.js.map +1 -0
  21. package/dist/chunk-QFV3ERQO.js +20 -0
  22. package/dist/chunk-QFV3ERQO.js.map +1 -0
  23. package/dist/index.js +69394 -36621
  24. package/dist/index.js.map +1 -1
  25. package/dist/install.ps1 +16 -6
  26. package/dist/install.sh +24 -10
  27. package/dist/machine-status.js +1 -1
  28. package/dist/plugin/index.d.ts +1061 -272
  29. package/dist/reset-admin-password.js +3 -2
  30. package/dist/reset-admin-password.js.map +1 -1
  31. package/dist/secret-file.js +3 -14
  32. package/dist/secret-file.js.map +1 -1
  33. package/dist/version-report.d.ts +3 -0
  34. package/dist/version-report.js +1 -1
  35. package/package.json +12 -6
  36. package/web-dist/assets/KaTeX_Size3-Regular-gV2CO0n9.woff2 +0 -0
  37. package/web-dist/assets/abnfDiagram-VCTEODGH-CKWh4hoA.js +1 -0
  38. package/web-dist/assets/{addon-clipboard-DrZY90Ks.js → addon-clipboard-DxLqat7q.js} +1 -1
  39. package/web-dist/assets/{addon-fit-CtEAdAax.js → addon-fit-B8oPGPkW.js} +1 -1
  40. package/web-dist/assets/{addon-web-links-DJL13cYY.js → addon-web-links-C0W5TcK0.js} +1 -1
  41. package/web-dist/assets/arc-Dp9EkaAH.js +1 -0
  42. package/web-dist/assets/architectureDiagram-5GKGNRK7-BQ3LUcle.js +36 -0
  43. package/web-dist/assets/blockDiagram-I7D4REHJ-CZzyU0Jj.js +129 -0
  44. package/web-dist/assets/c4Diagram-7LVT6UL2-Qps3jeAu.js +38 -0
  45. package/web-dist/assets/channel--PblgLlC.js +1 -0
  46. package/web-dist/assets/chunk-2Q5K7J3B-CQMntzuX.js +1 -0
  47. package/web-dist/assets/chunk-5VM5RSS4-2H2ZJAte.js +15 -0
  48. package/web-dist/assets/chunk-F27PBJKO-B30xCNBv.js +1 -0
  49. package/web-dist/assets/chunk-IMKFNOWR-Cyfx4zDs.js +231 -0
  50. package/web-dist/assets/chunk-JWPE2WC7-DADUytTh.js +1 -0
  51. package/web-dist/assets/chunk-POPQ4Y6H-9bjsAxLS.js +1 -0
  52. package/web-dist/assets/chunk-SVP7TREG-B9xO1VpN.js +88 -0
  53. package/web-dist/assets/chunk-TICWLB2K-B6oDkrep.js +206 -0
  54. package/web-dist/assets/chunk-XXDRQBXY-BbU8DR4B.js +1 -0
  55. package/web-dist/assets/classDiagram-ZZMXUADV-mn8tbuqa.js +1 -0
  56. package/web-dist/assets/classDiagram-v2-VYDZK3BY-mn8tbuqa.js +1 -0
  57. package/web-dist/assets/cose-bilkent-JH36ORCC-pkbuyec-.js +1 -0
  58. package/web-dist/assets/cynefin-OW5HDTMX-DU9YQQnc.js +166 -0
  59. package/web-dist/assets/cynefinDiagram-5FMLGOSQ-3a3XuhQq.js +62 -0
  60. package/web-dist/assets/cytoscape.esm-BB4DxJjf.js +321 -0
  61. package/web-dist/assets/dagre-GXQ25YYZ-BfZ9C5CZ.js +4 -0
  62. package/web-dist/assets/defaultLocale-DX6XiGOO.js +1 -0
  63. package/web-dist/assets/diagram-S7CK7UJ4-BoGhVBMn.js +30 -0
  64. package/web-dist/assets/diagram-UQ7AKVKN-zE67quty.js +41 -0
  65. package/web-dist/assets/diagram-VSXAHHWV-NihoXeXm.js +3 -0
  66. package/web-dist/assets/diagram-VX7I27RA-1627np0S.js +24 -0
  67. package/web-dist/assets/diagram-Z3DM3KII-Ddg_bUan.js +24 -0
  68. package/web-dist/assets/ebnfDiagram-PWID7BFC-CmPUOM4j.js +1 -0
  69. package/web-dist/assets/erDiagram-RLTQ6QDP-DiTnEK72.js +99 -0
  70. package/web-dist/assets/flowDiagram-HODETNUW-mGQ38tRM.js +168 -0
  71. package/web-dist/assets/ganttDiagram-EL5Y4UJY-DU7MlzpW.js +292 -0
  72. package/web-dist/assets/gitGraphDiagram-WWUBYQGX-CRE_3vjl.js +106 -0
  73. package/web-dist/assets/highlighter-CzfXQ6yd.js +2 -0
  74. package/web-dist/assets/{highlighter-core-CrBdruEx.js → highlighter-core-B5CvXcEK.js} +7 -7
  75. package/web-dist/assets/{highlighter.worker-CL6f9Fzw.js → highlighter.worker-D6D9fPma.js} +9 -9
  76. package/web-dist/assets/ibm-plex-sans-condensed-latin-600-normal-CRd5VyFf.woff2 +0 -0
  77. package/web-dist/assets/ibm-plex-sans-condensed-latin-ext-600-normal-CBdNZ9Ci.woff2 +0 -0
  78. package/web-dist/assets/ibm-plex-sans-latin-ext-wght-normal-CIII54If.woff2 +0 -0
  79. package/web-dist/assets/ibm-plex-sans-latin-wght-normal-IvpUvPa2.woff2 +0 -0
  80. package/web-dist/assets/index-BdG4qRyI.js +1275 -0
  81. package/web-dist/assets/index-W-xYFoIm.css +1 -0
  82. package/web-dist/assets/infoDiagram-27XIBGKW-Cdo6Ar-a.js +2 -0
  83. package/web-dist/assets/init-Gi6I4Gst.js +1 -0
  84. package/web-dist/assets/ishikawaDiagram-5VMMS53U-C27pgect.js +70 -0
  85. package/web-dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  86. package/web-dist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  87. package/web-dist/assets/journeyDiagram-3NMN7TZE-CVxtKpLG.js +139 -0
  88. package/web-dist/assets/kanban-definition-UXKFOSKX-DWA31Da7.js +89 -0
  89. package/web-dist/assets/layout-DWKCU9PO.js +1 -0
  90. package/web-dist/assets/linear-BwCthj_k.js +1 -0
  91. package/web-dist/assets/mermaid.core-BcTrmPOv.js +310 -0
  92. package/web-dist/assets/mindmap-definition-YA3MSWOX-BLEDhbn1.js +96 -0
  93. package/web-dist/assets/misans-400-100-DHkMCix2.woff2 +0 -0
  94. package/web-dist/assets/misans-400-101-CwgSLsmc.woff2 +0 -0
  95. package/web-dist/assets/misans-400-102-BQgefHPQ.woff2 +0 -0
  96. package/web-dist/assets/misans-400-103-CP58Mc_T.woff2 +0 -0
  97. package/web-dist/assets/misans-400-104-Ta_Xu1gd.woff2 +0 -0
  98. package/web-dist/assets/misans-400-105-CDop11AR.woff2 +0 -0
  99. package/web-dist/assets/misans-400-106-Dv8y0ubk.woff2 +0 -0
  100. package/web-dist/assets/misans-400-107-CjnHtp9E.woff2 +0 -0
  101. package/web-dist/assets/misans-400-108-BA8nQUBw.woff2 +0 -0
  102. package/web-dist/assets/misans-400-109-B6uEN0pG.woff2 +0 -0
  103. package/web-dist/assets/misans-400-110-BQqnShrY.woff2 +0 -0
  104. package/web-dist/assets/misans-400-111-CHB-Jj5X.woff2 +0 -0
  105. package/web-dist/assets/misans-400-112-D1dh4Cjx.woff2 +0 -0
  106. package/web-dist/assets/misans-400-113-Bw_wNCFp.woff2 +0 -0
  107. package/web-dist/assets/misans-400-114-CUb-5IzE.woff2 +0 -0
  108. package/web-dist/assets/misans-400-115-BICOatsO.woff2 +0 -0
  109. package/web-dist/assets/misans-400-116-B3_gmYW6.woff2 +0 -0
  110. package/web-dist/assets/misans-400-117-B8k_y3cv.woff2 +0 -0
  111. package/web-dist/assets/misans-400-118-C-2Cf5C6.woff2 +0 -0
  112. package/web-dist/assets/misans-400-119-CmLP7xnX.woff2 +0 -0
  113. package/web-dist/assets/misans-400-21-DsSSD_Zj.woff2 +0 -0
  114. package/web-dist/assets/misans-400-22-rtkxWOv4.woff2 +0 -0
  115. package/web-dist/assets/misans-400-23-CDDB4M1H.woff2 +0 -0
  116. package/web-dist/assets/misans-400-24-Dqf_XeOL.woff2 +0 -0
  117. package/web-dist/assets/misans-400-25-C4U1tJ5J.woff2 +0 -0
  118. package/web-dist/assets/misans-400-26-CEXOK-nT.woff2 +0 -0
  119. package/web-dist/assets/misans-400-27-BrNOAScF.woff2 +0 -0
  120. package/web-dist/assets/misans-400-28-CPpEnCkG.woff2 +0 -0
  121. package/web-dist/assets/misans-400-29-C9JMVw8g.woff2 +0 -0
  122. package/web-dist/assets/misans-400-30-CD-QimXa.woff2 +0 -0
  123. package/web-dist/assets/misans-400-31-S4k06NbS.woff2 +0 -0
  124. package/web-dist/assets/misans-400-32-zRMBDkz6.woff2 +0 -0
  125. package/web-dist/assets/misans-400-33-sQ_tNZSM.woff2 +0 -0
  126. package/web-dist/assets/misans-400-34-8LEGljja.woff2 +0 -0
  127. package/web-dist/assets/misans-400-35-CxSPyuiU.woff2 +0 -0
  128. package/web-dist/assets/misans-400-36-BY1i4WtO.woff2 +0 -0
  129. package/web-dist/assets/misans-400-37-C0oF42pu.woff2 +0 -0
  130. package/web-dist/assets/misans-400-38-y7xcB90w.woff2 +0 -0
  131. package/web-dist/assets/misans-400-39-C307YgZx.woff2 +0 -0
  132. package/web-dist/assets/misans-400-40-ByZr736f.woff2 +0 -0
  133. package/web-dist/assets/misans-400-41-ChKEw5zV.woff2 +0 -0
  134. package/web-dist/assets/misans-400-42-CD__zJu5.woff2 +0 -0
  135. package/web-dist/assets/misans-400-43-CqNV6_TG.woff2 +0 -0
  136. package/web-dist/assets/misans-400-44-zE-akmW8.woff2 +0 -0
  137. package/web-dist/assets/misans-400-45-Du98otwc.woff2 +0 -0
  138. package/web-dist/assets/misans-400-46-B6JXbEy2.woff2 +0 -0
  139. package/web-dist/assets/misans-400-47-DpqW0kSq.woff2 +0 -0
  140. package/web-dist/assets/misans-400-48-BprON5Q_.woff2 +0 -0
  141. package/web-dist/assets/misans-400-49-N-ct3sN6.woff2 +0 -0
  142. package/web-dist/assets/misans-400-5-ton_4jCN.woff2 +0 -0
  143. package/web-dist/assets/misans-400-50-JgU49P0U.woff2 +0 -0
  144. package/web-dist/assets/misans-400-51-DSS3Moge.woff2 +0 -0
  145. package/web-dist/assets/misans-400-52-BMoXFmwE.woff2 +0 -0
  146. package/web-dist/assets/misans-400-53-BaLMGl4z.woff2 +0 -0
  147. package/web-dist/assets/misans-400-54-CaeSn3OR.woff2 +0 -0
  148. package/web-dist/assets/misans-400-55-BBqrtLxN.woff2 +0 -0
  149. package/web-dist/assets/misans-400-56-DAZ5BnbO.woff2 +0 -0
  150. package/web-dist/assets/misans-400-57-F-n3b0gI.woff2 +0 -0
  151. package/web-dist/assets/misans-400-58-DEUuPQAq.woff2 +0 -0
  152. package/web-dist/assets/misans-400-59-DXP5rhCL.woff2 +0 -0
  153. package/web-dist/assets/misans-400-6-DWCCUO_c.woff2 +0 -0
  154. package/web-dist/assets/misans-400-60-BE6IO6zJ.woff2 +0 -0
  155. package/web-dist/assets/misans-400-61-5Qb1gaxK.woff2 +0 -0
  156. package/web-dist/assets/misans-400-62-D_tJKNAj.woff2 +0 -0
  157. package/web-dist/assets/misans-400-63-hwmne8yB.woff2 +0 -0
  158. package/web-dist/assets/misans-400-64-BGedxReM.woff2 +0 -0
  159. package/web-dist/assets/misans-400-65-BaKPsugb.woff2 +0 -0
  160. package/web-dist/assets/misans-400-66-IdaOMzCz.woff2 +0 -0
  161. package/web-dist/assets/misans-400-67-BdWyS83H.woff2 +0 -0
  162. package/web-dist/assets/misans-400-68-DrZ_1swq.woff2 +0 -0
  163. package/web-dist/assets/misans-400-69-B3jsSD92.woff2 +0 -0
  164. package/web-dist/assets/misans-400-70-D6UZI2Ua.woff2 +0 -0
  165. package/web-dist/assets/misans-400-71-HFxyMCYg.woff2 +0 -0
  166. package/web-dist/assets/misans-400-72-CP5A-yQP.woff2 +0 -0
  167. package/web-dist/assets/misans-400-73-BoD_bu6s.woff2 +0 -0
  168. package/web-dist/assets/misans-400-74-CbJlhZlZ.woff2 +0 -0
  169. package/web-dist/assets/misans-400-75-BsbWuELX.woff2 +0 -0
  170. package/web-dist/assets/misans-400-76-DkwiQhof.woff2 +0 -0
  171. package/web-dist/assets/misans-400-77-6pVHXHnF.woff2 +0 -0
  172. package/web-dist/assets/misans-400-78-CfUF6pih.woff2 +0 -0
  173. package/web-dist/assets/misans-400-79-BCS3Dx4e.woff2 +0 -0
  174. package/web-dist/assets/misans-400-80-BEYSdQ_N.woff2 +0 -0
  175. package/web-dist/assets/misans-400-81-BzL-Gncx.woff2 +0 -0
  176. package/web-dist/assets/misans-400-82-CaENmdUU.woff2 +0 -0
  177. package/web-dist/assets/misans-400-83-Bvq1eBcA.woff2 +0 -0
  178. package/web-dist/assets/misans-400-84-Ctd90hiP.woff2 +0 -0
  179. package/web-dist/assets/misans-400-85-DWuOxfL1.woff2 +0 -0
  180. package/web-dist/assets/misans-400-86-D5niZS5c.woff2 +0 -0
  181. package/web-dist/assets/misans-400-87-DkOIADQJ.woff2 +0 -0
  182. package/web-dist/assets/misans-400-88-CGY4WTcC.woff2 +0 -0
  183. package/web-dist/assets/misans-400-89-CA3eoMTt.woff2 +0 -0
  184. package/web-dist/assets/misans-400-90-CzxR9MYb.woff2 +0 -0
  185. package/web-dist/assets/misans-400-91-Dyr85txc.woff2 +0 -0
  186. package/web-dist/assets/misans-400-97-qEZrCUNe.woff2 +0 -0
  187. package/web-dist/assets/misans-400-cyrillic--hFcG0Xp.woff2 +0 -0
  188. package/web-dist/assets/misans-400-extra-ZRI9n2Hu.woff2 +0 -0
  189. package/web-dist/assets/misans-400-latin-BRDR1WaL.woff2 +0 -0
  190. package/web-dist/assets/misans-400-latin-ext-6xS-MvHW.woff2 +0 -0
  191. package/web-dist/assets/misans-400-vietnamese-D7xD7kBB.woff2 +0 -0
  192. package/web-dist/assets/misans-500-100-BHuGA96E.woff2 +0 -0
  193. package/web-dist/assets/misans-500-101-CDMYUz0c.woff2 +0 -0
  194. package/web-dist/assets/misans-500-102-CWcqYYCV.woff2 +0 -0
  195. package/web-dist/assets/misans-500-103-BE1QSEzY.woff2 +0 -0
  196. package/web-dist/assets/misans-500-104-CDp743BV.woff2 +0 -0
  197. package/web-dist/assets/misans-500-105-y7dY6Foi.woff2 +0 -0
  198. package/web-dist/assets/misans-500-106-CP-kGZ6j.woff2 +0 -0
  199. package/web-dist/assets/misans-500-107-CUc8Hvle.woff2 +0 -0
  200. package/web-dist/assets/misans-500-108-ItN_x8jX.woff2 +0 -0
  201. package/web-dist/assets/misans-500-109-CEtf3R4D.woff2 +0 -0
  202. package/web-dist/assets/misans-500-110-BSZSHYRL.woff2 +0 -0
  203. package/web-dist/assets/misans-500-111-DfdArrjn.woff2 +0 -0
  204. package/web-dist/assets/misans-500-112-DRtNyrQw.woff2 +0 -0
  205. package/web-dist/assets/misans-500-113-CDT7tKuB.woff2 +0 -0
  206. package/web-dist/assets/misans-500-114-CCh4jwL8.woff2 +0 -0
  207. package/web-dist/assets/misans-500-115-DplUgPp0.woff2 +0 -0
  208. package/web-dist/assets/misans-500-116-C7eCklyK.woff2 +0 -0
  209. package/web-dist/assets/misans-500-117-BA0KabyT.woff2 +0 -0
  210. package/web-dist/assets/misans-500-118-V_M0eu2q.woff2 +0 -0
  211. package/web-dist/assets/misans-500-119-Cgf3Hszt.woff2 +0 -0
  212. package/web-dist/assets/misans-500-21-Di6DyR6O.woff2 +0 -0
  213. package/web-dist/assets/misans-500-22-CSnXvtL-.woff2 +0 -0
  214. package/web-dist/assets/misans-500-23-A06Hm9a6.woff2 +0 -0
  215. package/web-dist/assets/misans-500-24-Df97RCik.woff2 +0 -0
  216. package/web-dist/assets/misans-500-25-bOSJ6YXH.woff2 +0 -0
  217. package/web-dist/assets/misans-500-26-C65icgBb.woff2 +0 -0
  218. package/web-dist/assets/misans-500-27-C_GRm0va.woff2 +0 -0
  219. package/web-dist/assets/misans-500-28-CzZkqO0l.woff2 +0 -0
  220. package/web-dist/assets/misans-500-29-BReyeRyX.woff2 +0 -0
  221. package/web-dist/assets/misans-500-30-DzfjlROz.woff2 +0 -0
  222. package/web-dist/assets/misans-500-31-B2nLpgdU.woff2 +0 -0
  223. package/web-dist/assets/misans-500-32-Bz3rHm8X.woff2 +0 -0
  224. package/web-dist/assets/misans-500-33-AU3lZ1vY.woff2 +0 -0
  225. package/web-dist/assets/misans-500-34-CBAWkH-I.woff2 +0 -0
  226. package/web-dist/assets/misans-500-35-VgnGd14P.woff2 +0 -0
  227. package/web-dist/assets/misans-500-36-B2kfXv6A.woff2 +0 -0
  228. package/web-dist/assets/misans-500-37-DhKo8ykb.woff2 +0 -0
  229. package/web-dist/assets/misans-500-38-D8tTxFuc.woff2 +0 -0
  230. package/web-dist/assets/misans-500-39-DTm3aqJQ.woff2 +0 -0
  231. package/web-dist/assets/misans-500-40-C_akwj8_.woff2 +0 -0
  232. package/web-dist/assets/misans-500-41-RVM1JHQW.woff2 +0 -0
  233. package/web-dist/assets/misans-500-42-MVWIN_il.woff2 +0 -0
  234. package/web-dist/assets/misans-500-43-BtLZYNyD.woff2 +0 -0
  235. package/web-dist/assets/misans-500-44-D0QHMl6G.woff2 +0 -0
  236. package/web-dist/assets/misans-500-45-DRlclX7-.woff2 +0 -0
  237. package/web-dist/assets/misans-500-46-BEWswL4N.woff2 +0 -0
  238. package/web-dist/assets/misans-500-47-COSoxWaW.woff2 +0 -0
  239. package/web-dist/assets/misans-500-48-DZAISq3n.woff2 +0 -0
  240. package/web-dist/assets/misans-500-49-KSfi7MW0.woff2 +0 -0
  241. package/web-dist/assets/misans-500-5-h1SBcwuW.woff2 +0 -0
  242. package/web-dist/assets/misans-500-50-CIVMfG11.woff2 +0 -0
  243. package/web-dist/assets/misans-500-51-BdeNBhBL.woff2 +0 -0
  244. package/web-dist/assets/misans-500-52-CEW4e7ex.woff2 +0 -0
  245. package/web-dist/assets/misans-500-53-lmPCsEnt.woff2 +0 -0
  246. package/web-dist/assets/misans-500-54-B_7AqKQW.woff2 +0 -0
  247. package/web-dist/assets/misans-500-55-B-3RtUnH.woff2 +0 -0
  248. package/web-dist/assets/misans-500-56-g6D0e0cW.woff2 +0 -0
  249. package/web-dist/assets/misans-500-57-D5hp5Yqr.woff2 +0 -0
  250. package/web-dist/assets/misans-500-58-ilnDgEKt.woff2 +0 -0
  251. package/web-dist/assets/misans-500-59-DJYXz8tr.woff2 +0 -0
  252. package/web-dist/assets/misans-500-6-uCdpdDQy.woff2 +0 -0
  253. package/web-dist/assets/misans-500-60-B3Iaqx0p.woff2 +0 -0
  254. package/web-dist/assets/misans-500-61-CMxqg5hc.woff2 +0 -0
  255. package/web-dist/assets/misans-500-62-7FY8O2NQ.woff2 +0 -0
  256. package/web-dist/assets/misans-500-63-JP6vEuJf.woff2 +0 -0
  257. package/web-dist/assets/misans-500-64-Cdub62jh.woff2 +0 -0
  258. package/web-dist/assets/misans-500-65-DVHk_mlC.woff2 +0 -0
  259. package/web-dist/assets/misans-500-66-BX39wRtF.woff2 +0 -0
  260. package/web-dist/assets/misans-500-67-BcsepI3X.woff2 +0 -0
  261. package/web-dist/assets/misans-500-68-etUIUjrh.woff2 +0 -0
  262. package/web-dist/assets/misans-500-69-DfhVmnuA.woff2 +0 -0
  263. package/web-dist/assets/misans-500-70-D6dgy6-B.woff2 +0 -0
  264. package/web-dist/assets/misans-500-71-PkeKjcVn.woff2 +0 -0
  265. package/web-dist/assets/misans-500-72-D66Fnb30.woff2 +0 -0
  266. package/web-dist/assets/misans-500-73-jr9z9870.woff2 +0 -0
  267. package/web-dist/assets/misans-500-74-DsCkPKwe.woff2 +0 -0
  268. package/web-dist/assets/misans-500-75-Dkooq6KM.woff2 +0 -0
  269. package/web-dist/assets/misans-500-76-B0sfieHl.woff2 +0 -0
  270. package/web-dist/assets/misans-500-77-8tflq1ji.woff2 +0 -0
  271. package/web-dist/assets/misans-500-78-COKdMbdp.woff2 +0 -0
  272. package/web-dist/assets/misans-500-79-Bm0rBjSF.woff2 +0 -0
  273. package/web-dist/assets/misans-500-80-B9OoAnyy.woff2 +0 -0
  274. package/web-dist/assets/misans-500-81-DsQ9tpfX.woff2 +0 -0
  275. package/web-dist/assets/misans-500-82-VKsL2Tk2.woff2 +0 -0
  276. package/web-dist/assets/misans-500-83-Ce6mfHYD.woff2 +0 -0
  277. package/web-dist/assets/misans-500-84-D7kPSZLm.woff2 +0 -0
  278. package/web-dist/assets/misans-500-85-W5L0cEfd.woff2 +0 -0
  279. package/web-dist/assets/misans-500-86-DukGOEET.woff2 +0 -0
  280. package/web-dist/assets/misans-500-87-BJ_Lok6j.woff2 +0 -0
  281. package/web-dist/assets/misans-500-88-DbJ11zcA.woff2 +0 -0
  282. package/web-dist/assets/misans-500-89-LNKcEq6M.woff2 +0 -0
  283. package/web-dist/assets/misans-500-90-DNDDgSCd.woff2 +0 -0
  284. package/web-dist/assets/misans-500-91-rT8Q0evu.woff2 +0 -0
  285. package/web-dist/assets/misans-500-97-c8zW_WRq.woff2 +0 -0
  286. package/web-dist/assets/misans-500-cyrillic-CLHOGwgx.woff2 +0 -0
  287. package/web-dist/assets/misans-500-extra-CTAMEQ59.woff2 +0 -0
  288. package/web-dist/assets/misans-500-latin-Be606ott.woff2 +0 -0
  289. package/web-dist/assets/misans-500-latin-ext-BzDyL4sU.woff2 +0 -0
  290. package/web-dist/assets/misans-500-vietnamese-DBOLOqZH.woff2 +0 -0
  291. package/web-dist/assets/mona-sans-latin-ext-wght-normal-BqSk0Z3x.woff2 +0 -0
  292. package/web-dist/assets/mona-sans-latin-wght-normal-Pz49MTQZ.woff2 +0 -0
  293. package/web-dist/assets/noto-sans-sc-100-wght-normal-DrqXJETY.woff2 +0 -0
  294. package/web-dist/assets/noto-sans-sc-101-wght-normal-c94LAl5p.woff2 +0 -0
  295. package/web-dist/assets/noto-sans-sc-102-wght-normal-C1RtbCZr.woff2 +0 -0
  296. package/web-dist/assets/noto-sans-sc-103-wght-normal-DGHo20nu.woff2 +0 -0
  297. package/web-dist/assets/noto-sans-sc-104-wght-normal-CJT2ioDJ.woff2 +0 -0
  298. package/web-dist/assets/noto-sans-sc-105-wght-normal-BFoiJwz2.woff2 +0 -0
  299. package/web-dist/assets/noto-sans-sc-106-wght-normal-D6uUHw3w.woff2 +0 -0
  300. package/web-dist/assets/noto-sans-sc-107-wght-normal-kFQzJDLH.woff2 +0 -0
  301. package/web-dist/assets/noto-sans-sc-108-wght-normal-7aXvqIa2.woff2 +0 -0
  302. package/web-dist/assets/noto-sans-sc-109-wght-normal-CnjNbNmw.woff2 +0 -0
  303. package/web-dist/assets/noto-sans-sc-110-wght-normal-D2JBr045.woff2 +0 -0
  304. package/web-dist/assets/noto-sans-sc-111-wght-normal-ClFr5QXM.woff2 +0 -0
  305. package/web-dist/assets/noto-sans-sc-112-wght-normal-CiZxJMyY.woff2 +0 -0
  306. package/web-dist/assets/noto-sans-sc-113-wght-normal-OgQXOX6x.woff2 +0 -0
  307. package/web-dist/assets/noto-sans-sc-114-wght-normal-CRH9SDZu.woff2 +0 -0
  308. package/web-dist/assets/noto-sans-sc-115-wght-normal-BN__2iBG.woff2 +0 -0
  309. package/web-dist/assets/noto-sans-sc-116-wght-normal-vdFVzbO2.woff2 +0 -0
  310. package/web-dist/assets/noto-sans-sc-117-wght-normal-Dsz3vkzU.woff2 +0 -0
  311. package/web-dist/assets/noto-sans-sc-118-wght-normal-BPEb0gM9.woff2 +0 -0
  312. package/web-dist/assets/noto-sans-sc-119-wght-normal-BfzSEbFz.woff2 +0 -0
  313. package/web-dist/assets/noto-sans-sc-21-wght-normal-DIu_1ZBI.woff2 +0 -0
  314. package/web-dist/assets/noto-sans-sc-22-wght-normal-VXjdYcT-.woff2 +0 -0
  315. package/web-dist/assets/noto-sans-sc-23-wght-normal-4HrHKhpL.woff2 +0 -0
  316. package/web-dist/assets/noto-sans-sc-24-wght-normal-B58DWgHS.woff2 +0 -0
  317. package/web-dist/assets/noto-sans-sc-25-wght-normal-C3Jm6l7O.woff2 +0 -0
  318. package/web-dist/assets/noto-sans-sc-26-wght-normal-YNOygvr_.woff2 +0 -0
  319. package/web-dist/assets/noto-sans-sc-27-wght-normal-BP2pEGQH.woff2 +0 -0
  320. package/web-dist/assets/noto-sans-sc-28-wght-normal-BWPKDbtH.woff2 +0 -0
  321. package/web-dist/assets/noto-sans-sc-29-wght-normal-45aVmHn_.woff2 +0 -0
  322. package/web-dist/assets/noto-sans-sc-30-wght-normal-B8_s30jZ.woff2 +0 -0
  323. package/web-dist/assets/noto-sans-sc-31-wght-normal-DW0t445S.woff2 +0 -0
  324. package/web-dist/assets/noto-sans-sc-32-wght-normal-ShbWPcei.woff2 +0 -0
  325. package/web-dist/assets/noto-sans-sc-33-wght-normal-BOTZYTjM.woff2 +0 -0
  326. package/web-dist/assets/noto-sans-sc-34-wght-normal-BF1rqDSt.woff2 +0 -0
  327. package/web-dist/assets/noto-sans-sc-35-wght-normal-Bosspiyr.woff2 +0 -0
  328. package/web-dist/assets/noto-sans-sc-36-wght-normal-CtU9CyKw.woff2 +0 -0
  329. package/web-dist/assets/noto-sans-sc-37-wght-normal-ghDiyiuv.woff2 +0 -0
  330. package/web-dist/assets/noto-sans-sc-38-wght-normal-4Nz8k_dt.woff2 +0 -0
  331. package/web-dist/assets/noto-sans-sc-39-wght-normal-Ddtm1XVC.woff2 +0 -0
  332. package/web-dist/assets/noto-sans-sc-4-wght-normal-BRbPMj-C.woff2 +0 -0
  333. package/web-dist/assets/noto-sans-sc-40-wght-normal-BVn4-kgX.woff2 +0 -0
  334. package/web-dist/assets/noto-sans-sc-41-wght-normal-CZqajZnl.woff2 +0 -0
  335. package/web-dist/assets/noto-sans-sc-42-wght-normal-CQ4lY28u.woff2 +0 -0
  336. package/web-dist/assets/noto-sans-sc-43-wght-normal-psppu0d8.woff2 +0 -0
  337. package/web-dist/assets/noto-sans-sc-44-wght-normal-cbKJlTUe.woff2 +0 -0
  338. package/web-dist/assets/noto-sans-sc-45-wght-normal-MKIEVRIC.woff2 +0 -0
  339. package/web-dist/assets/noto-sans-sc-46-wght-normal-CErGc6Mt.woff2 +0 -0
  340. package/web-dist/assets/noto-sans-sc-47-wght-normal-C5Kgg1_m.woff2 +0 -0
  341. package/web-dist/assets/noto-sans-sc-48-wght-normal-DFMjDDY6.woff2 +0 -0
  342. package/web-dist/assets/noto-sans-sc-49-wght-normal-B7l_3BZr.woff2 +0 -0
  343. package/web-dist/assets/noto-sans-sc-5-wght-normal-DI846rD9.woff2 +0 -0
  344. package/web-dist/assets/noto-sans-sc-50-wght-normal-C5KfAmFp.woff2 +0 -0
  345. package/web-dist/assets/noto-sans-sc-51-wght-normal-C2bq6hC8.woff2 +0 -0
  346. package/web-dist/assets/noto-sans-sc-52-wght-normal-P18e_Y0j.woff2 +0 -0
  347. package/web-dist/assets/noto-sans-sc-53-wght-normal-Bgkuo2tF.woff2 +0 -0
  348. package/web-dist/assets/noto-sans-sc-54-wght-normal-DL5lmlUd.woff2 +0 -0
  349. package/web-dist/assets/noto-sans-sc-55-wght-normal-BV_Oy6IF.woff2 +0 -0
  350. package/web-dist/assets/noto-sans-sc-56-wght-normal-B4L7Hj8f.woff2 +0 -0
  351. package/web-dist/assets/noto-sans-sc-57-wght-normal-DU8YBsDj.woff2 +0 -0
  352. package/web-dist/assets/noto-sans-sc-58-wght-normal-CE0BKS9u.woff2 +0 -0
  353. package/web-dist/assets/noto-sans-sc-59-wght-normal-Azv2Ku9_.woff2 +0 -0
  354. package/web-dist/assets/noto-sans-sc-6-wght-normal-ozUCEY9O.woff2 +0 -0
  355. package/web-dist/assets/noto-sans-sc-60-wght-normal-C1lngC61.woff2 +0 -0
  356. package/web-dist/assets/noto-sans-sc-61-wght-normal-BxWkGF5M.woff2 +0 -0
  357. package/web-dist/assets/noto-sans-sc-62-wght-normal-CXXMAq-5.woff2 +0 -0
  358. package/web-dist/assets/noto-sans-sc-63-wght-normal-4La5uKvS.woff2 +0 -0
  359. package/web-dist/assets/noto-sans-sc-64-wght-normal-CbIuD2Eg.woff2 +0 -0
  360. package/web-dist/assets/noto-sans-sc-65-wght-normal-BGqvKda2.woff2 +0 -0
  361. package/web-dist/assets/noto-sans-sc-66-wght-normal-BvNozWOY.woff2 +0 -0
  362. package/web-dist/assets/noto-sans-sc-67-wght-normal-CC-WRBV-.woff2 +0 -0
  363. package/web-dist/assets/noto-sans-sc-68-wght-normal-c0FjfUaj.woff2 +0 -0
  364. package/web-dist/assets/noto-sans-sc-69-wght-normal-D596Jjl2.woff2 +0 -0
  365. package/web-dist/assets/noto-sans-sc-70-wght-normal-ColEcmtJ.woff2 +0 -0
  366. package/web-dist/assets/noto-sans-sc-71-wght-normal-ChZfXpdg.woff2 +0 -0
  367. package/web-dist/assets/noto-sans-sc-72-wght-normal-D1VyfEG3.woff2 +0 -0
  368. package/web-dist/assets/noto-sans-sc-73-wght-normal-DwSJRYPJ.woff2 +0 -0
  369. package/web-dist/assets/noto-sans-sc-74-wght-normal-Cte7o1QG.woff2 +0 -0
  370. package/web-dist/assets/noto-sans-sc-75-wght-normal-B0qL41rF.woff2 +0 -0
  371. package/web-dist/assets/noto-sans-sc-76-wght-normal-BPLMO_2x.woff2 +0 -0
  372. package/web-dist/assets/noto-sans-sc-77-wght-normal-Dkbi3pye.woff2 +0 -0
  373. package/web-dist/assets/noto-sans-sc-78-wght-normal-BFUXeSw6.woff2 +0 -0
  374. package/web-dist/assets/noto-sans-sc-79-wght-normal-DoJG4UTB.woff2 +0 -0
  375. package/web-dist/assets/noto-sans-sc-80-wght-normal-BEFypWOO.woff2 +0 -0
  376. package/web-dist/assets/noto-sans-sc-81-wght-normal-ed_TZlfo.woff2 +0 -0
  377. package/web-dist/assets/noto-sans-sc-82-wght-normal-DcxfR5OJ.woff2 +0 -0
  378. package/web-dist/assets/noto-sans-sc-83-wght-normal-C9UjAcMM.woff2 +0 -0
  379. package/web-dist/assets/noto-sans-sc-84-wght-normal-C7NxT478.woff2 +0 -0
  380. package/web-dist/assets/noto-sans-sc-85-wght-normal-DBcDBu1n.woff2 +0 -0
  381. package/web-dist/assets/noto-sans-sc-86-wght-normal-CLJIoPpl.woff2 +0 -0
  382. package/web-dist/assets/noto-sans-sc-87-wght-normal-DYfJ-vGE.woff2 +0 -0
  383. package/web-dist/assets/noto-sans-sc-88-wght-normal-ClNDOCGW.woff2 +0 -0
  384. package/web-dist/assets/noto-sans-sc-89-wght-normal-IQU_KQA8.woff2 +0 -0
  385. package/web-dist/assets/noto-sans-sc-90-wght-normal-BWcrRNoG.woff2 +0 -0
  386. package/web-dist/assets/noto-sans-sc-91-wght-normal-CGekvDdH.woff2 +0 -0
  387. package/web-dist/assets/noto-sans-sc-97-wght-normal-BsBHkXi3.woff2 +0 -0
  388. package/web-dist/assets/noto-sans-sc-98-wght-normal-BZqSA1r_.woff2 +0 -0
  389. package/web-dist/assets/noto-sans-sc-99-wght-normal-Q_IptJM5.woff2 +0 -0
  390. package/web-dist/assets/noto-sans-sc-cyrillic-wght-normal-CRA5_Pf1.woff2 +0 -0
  391. package/web-dist/assets/noto-sans-sc-latin-ext-wght-normal-CqPqLCfe.woff2 +0 -0
  392. package/web-dist/assets/noto-sans-sc-latin-wght-normal-DYAKOyvl.woff2 +0 -0
  393. package/web-dist/assets/noto-sans-sc-vietnamese-wght-normal-y5SU35Rl.woff2 +0 -0
  394. package/web-dist/assets/ordinal-Cboi1Yqb.js +1 -0
  395. package/web-dist/assets/pegDiagram-XKGWAZYB-CLEM1SDU.js +1 -0
  396. package/web-dist/assets/pieDiagram-E7YTZNPT-B__g6eF0.js +39 -0
  397. package/web-dist/assets/quadrantDiagram-AXDQQJYC-C7VQ2LMY.js +7 -0
  398. package/web-dist/assets/railroadDiagram-O6MQD6OU-eWNnzjwS.js +1 -0
  399. package/web-dist/assets/requirementDiagram-BXWQKSXE-Bi5qeD4b.js +84 -0
  400. package/web-dist/assets/sankeyDiagram-P5KCCOFB-DG1VOpXX.js +40 -0
  401. package/web-dist/assets/sequenceDiagram-WJ2MYXX4-Fhkw73Th.js +162 -0
  402. package/web-dist/assets/sizeCapture-INFHLROL-D9E_17SF.js +1 -0
  403. package/web-dist/assets/stateDiagram-D77RDMKH-Cs5Y0xhW.js +1 -0
  404. package/web-dist/assets/stateDiagram-v2-MP3YSRHH-CEM51fAf.js +1 -0
  405. package/web-dist/assets/swimlanes-42K2YHIH-t-EocvKZ.js +1 -0
  406. package/web-dist/assets/swimlanesDiagram-VR7AAH4N-BrR66vrK.js +8 -0
  407. package/web-dist/assets/timeline-definition-24CTP7MA-CozGCxuA.js +120 -0
  408. package/web-dist/assets/vennDiagram-4TSXK5OY-ewU8ycSa.js +34 -0
  409. package/web-dist/assets/wardleyDiagram-VM6X3IG4-DuAhDu-0.js +78 -0
  410. package/web-dist/assets/{xterm-B2oS8Mg8.js → xterm-v5e56GC9.js} +1 -1
  411. package/web-dist/assets/xychartDiagram-S5SC5T6Z-BxGuZO23.js +7 -0
  412. package/web-dist/fonts-licenses/ibm-plex-sans-condensed.txt +93 -0
  413. package/web-dist/fonts-licenses/ibm-plex-sans.txt +93 -0
  414. package/web-dist/fonts-licenses/jetbrains-mono.txt +93 -0
  415. package/web-dist/fonts-licenses/misans.txt +119 -0
  416. package/web-dist/fonts-licenses/mona-sans.txt +93 -0
  417. package/web-dist/fonts-licenses/noto-sans-sc.txt +93 -0
  418. package/web-dist/index.html +18 -4
  419. package/web-dist/workflow-ui.css +261 -0
  420. package/dist/chunk-3I2XOPJB.js.map +0 -1
  421. package/dist/chunk-A3QANMU5.js.map +0 -1
  422. package/dist/chunk-L2H3K4DT.js +0 -7
  423. package/dist/chunk-L2H3K4DT.js.map +0 -1
  424. package/dist/chunk-S3BI6R7I.js +0 -14
  425. package/dist/chunk-S3BI6R7I.js.map +0 -1
  426. package/web-dist/assets/highlighter-CUb4XKtQ.js +0 -2
  427. package/web-dist/assets/index-CmfumtXy.js +0 -570
  428. package/web-dist/assets/index-Ywc2uM5u.css +0 -1
@@ -1,6 +1,6 @@
1
- var A=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function rs(e){return Ut(e)}function Ut(e){return Array.isArray(e)?ss(e):e instanceof RegExp?e:typeof e=="object"?os(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 os(e){let t={};for(let n in e)t[n]=Ut(e[n]);return t}function qn(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function Vn(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?Vn(e.substring(0,e.length-1)):e.substr(~t+1)}var lt=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Ne=class{static hasCaptures(e){return e===null?!1:(lt.lastIndex=0,lt.test(e))}static replaceCaptures(e,t,n){return e.replace(lt,(r,s,o,a)=>{let i=n[parseInt(s||o,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 Xn(e,t){return e<t?-1:e>t?1:0}function Kn(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 s=0;s<n;s++){let o=Xn(e[s],t[s]);if(o!==0)return o}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 Qn(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Zn=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},De=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(ls(e),t)}static createFromParsedTheme(e,t){return us(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;const t=e.scopeName,r=this._cachedMatchRoot.get(t).find(s=>as(e.parent,s.parentScopes));return r?new Yn(r.fontStyle,r.foreground,r.background):null}},ct=class Oe{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new Oe(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new Oe(n,t[r]);return n}push(t){return new Oe(this,t)}getSegments(){let t=this;const 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){const n=[];let r=this;for(;r&&r!==t;)n.push(r.scopeName),r=r.parent;return r===t?n.reverse():void 0}};function as(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],s=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],s=!0}for(;e&&!is(e.scopeName,r);){if(s)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function is(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var Yn=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function ls(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let s=0,o=t.length;s<o;s++){let a=t[s];if(!a.settings)continue;let i;if(typeof a.scope=="string"){let h=a.scope;h=h.replace(/^[,]+/,""),h=h.replace(/[,]+$/,""),i=h.split(",")}else Array.isArray(a.scope)?i=a.scope:i=[""];let l=-1;if(typeof a.settings.fontStyle=="string"){l=0;let h=a.settings.fontStyle.split(" ");for(let p=0,f=h.length;p<f;p++)switch(h[p]){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 h=0,p=i.length;h<p;h++){let d=i[h].trim().split(" "),b=d[d.length-1],w=null;d.length>1&&(w=d.slice(0,d.length-1),w.reverse()),n[r++]=new cs(b,w,s,l,c,u)}}return n}var cs=class{constructor(e,t,n,r,s,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=s,this.background=o}},T=(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))(T||{});function us(e,t){e.sort((l,c)=>{let u=Xn(l.scope,c.scope);return u!==0||(u=Kn(l.parentScopes,c.parentScopes),u!==0)?u:l.index-c.index});let n=0,r="#000000",s="#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&&(s=l.background)}let o=new hs(t),a=new Yn(n,o.getId(r),o.getId(s)),i=new fs(new kt(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,o.getId(u.foreground),o.getId(u.background))}return new De(o,a,i)}var hs=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)}},ps=Object.freeze([]),kt=class Jn{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,r,s,o){this.scopeDepth=t,this.parentScopes=n||ps,this.fontStyle=r,this.foreground=s,this.background=o}clone(){return new Jn(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let r=0,s=t.length;r<s;r++)n[r]=t[r].clone();return n}acceptOverwrite(t,n,r,s){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),s!==0&&(this.background=s)}},fs=class vt{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,s=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[s]===">"&&s++,!(r>=t.parentScopes.length||s>=n.parentScopes.length);){const o=n.parentScopes[s].length-t.parentScopes[r].length;if(o!==0)return o;r++,s++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),s,o;if(r===-1?(s=t,o=""):(s=t.substring(0,r),o=t.substring(r+1)),this._children.hasOwnProperty(s))return this._children[s].match(o)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(vt._cmpBySpecificity),n}insert(t,n,r,s,o,a){if(n===""){this._doInsertHere(t,r,s,o,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 vt(this._mainRule.clone(),kt.cloneArr(this._rulesWithParentScopes)),this._children[l]=u),u.insert(t+1,c,r,s,o,a)}_doInsertHere(t,n,r,s,o){if(n===null){this._mainRule.acceptOverwrite(t,r,s,o);return}for(let a=0,i=this._rulesWithParentScopes.length;a<i;a++){let l=this._rulesWithParentScopes[a];if(Kn(l.parentScopes,n)===0){l.acceptOverwrite(t,r,s,o);return}}r===-1&&(r=this._mainRule.fontStyle),s===0&&(s=this._mainRule.foreground),o===0&&(o=this._mainRule.background),this._rulesWithParentScopes.push(new kt(t,n,r,s,o))}},se=class B{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=B.getLanguageId(t),r=B.getTokenType(t),s=B.getFontStyle(t),o=B.getForeground(t),a=B.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:s,foreground:o,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,s,o,a,i){let l=B.getLanguageId(t),c=B.getTokenType(t),u=B.containsBalancedBrackets(t)?1:0,h=B.getFontStyle(t),p=B.getForeground(t),f=B.getBackground(t);return n!==0&&(l=n),r!==8&&(c=r),s!==null&&(u=s?1:0),o!==-1&&(h=o),a!==0&&(p=a),i!==0&&(f=i),(l<<0|c<<8|u<<10|h<<11|p<<15|f<<24)>>>0}};function Fe(e,t){const n=[],r=ds(e);let s=r.next();for(;s!==null;){let l=0;if(s.length===2&&s.charAt(1)===":"){switch(s.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${s} in scope selector`)}s=r.next()}let c=a();if(n.push({matcher:c,priority:l}),s!==",")break;s=r.next()}return n;function o(){if(s==="-"){s=r.next();const l=o();return c=>!!l&&!l(c)}if(s==="("){s=r.next();const l=i();return s===")"&&(s=r.next()),l}if(nn(s)){const l=[];do l.push(s),s=r.next();while(nn(s));return c=>t(l,c)}return null}function a(){const l=[];let c=o();for(;c;)l.push(c),c=o();return u=>l.every(h=>h(u))}function i(){const l=[];let c=a();for(;c&&(l.push(c),s==="|"||s===",");){do s=r.next();while(s==="|"||s===",");c=a()}return u=>l.some(h=>h(u))}}function nn(e){return!!e&&!!e.match(/[\w\.:]+/)}function ds(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function er(e){typeof e.dispose=="function"&&e.dispose()}var Se=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},gs=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},ms=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const 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 Se(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new ms;for(const n of e)bs(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Se){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 bs(e,t,n,r){const s=n.lookup(e.scopeName);if(!s){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const o=n.lookup(t);e instanceof Se?Ge({baseGrammar:o,selfGrammar:s},r):xt(e.ruleName,{baseGrammar:o,selfGrammar:s,repository:s.repository},r);const a=n.injections(e.scopeName);if(a)for(const i of a)r.add(new Se(i))}function xt(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];je([r],t,n)}}function Ge(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&je(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&je(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function je(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const s=r.repository?qn({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&je(r.patterns,{...t,repository:s},n);const o=r.include;if(!o)continue;const a=tr(o);switch(a.kind){case 0:Ge({...t,selfGrammar:t.baseGrammar},n);break;case 1:Ge(t,n);break;case 2:xt(a.ruleName,{...t,repository:s},n);break;case 3:case 4:const i=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(i){const l={baseGrammar:t.baseGrammar,selfGrammar:i,repository:s};a.kind===4?xt(a.ruleName,l,n):Ge(l,n)}else a.kind===4?n.add(new gs(a.scopeName,a.ruleName)):n.add(new Se(a.scopeName));break}}}var ws=class{kind=0},Cs=class{kind=1},_s=class{constructor(e){this.ruleName=e}kind=2},Ss=class{constructor(e){this.scopeName=e}kind=3},ks=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function tr(e){if(e==="$base")return new ws;if(e==="$self")return new Cs;const t=e.indexOf("#");if(t===-1)return new Ss(e);if(t===0)return new _s(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new ks(n,r)}}var vs=/\\(\d+)/,rn=/\\(\d+)/g,xs=-1,nr=-2;var Ee=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Ne.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Ne.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Vn(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:Ne.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Ne.replaceCaptures(this._contentName,e,t)}},As=class extends Ee{retokenizeCapturedWithRuleId;constructor(e,t,n,r,s){super(e,t,n,r),this.retokenizeCapturedWithRuleId=s}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!")}},Es=class extends Ee{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,s){super(e,t,n,null),this._match=new ke(r,this.id),this.captures=s,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 ve,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},sn=class extends Ee{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,s){super(e,t,n,r),this.patterns=s.patterns,this.hasMissingPatterns=s.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const 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 ve,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},At=class extends Ee{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,s,o,a,i,l,c){super(e,t,n,r),this._begin=new ke(s,this.id),this.beginCaptures=o,this._end=new ke(a||"￿",-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 ve;for(const 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}},Ue=class extends Ee{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,s,o,a,i,l){super(e,t,n,r),this._begin=new ke(s,this.id),this.beginCaptures=o,this.whileCaptures=i,this._while=new ke(a,nr),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 ve;for(const 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 ve,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},rr=class P{static createCaptureRule(t,n,r,s,o){return t.registerRule(a=>new As(n,a,r,s,o))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(s=>{if(t.id=s,t.match)return new Es(t.$vscodeTextmateLocation,t.id,t.name,t.match,P._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=qn({},r,t.repository));let o=t.patterns;return typeof o>"u"&&t.include&&(o=[{include:t.include}]),new sn(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,P._compilePatterns(o,n,r))}return t.while?new Ue(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,P._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,P._compileCaptures(t.whileCaptures||t.captures,n,r),P._compilePatterns(t.patterns,n,r)):new At(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,P._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,P._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,P._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let s=[];if(t){let o=0;for(const a in t){if(a==="$vscodeTextmateLocation")continue;const i=parseInt(a,10);i>o&&(o=i)}for(let a=0;a<=o;a++)s[a]=null;for(const a in t){if(a==="$vscodeTextmateLocation")continue;const i=parseInt(a,10);let l=0;t[a].patterns&&(l=P.getCompiledRuleId(t[a],n,r)),s[i]=P.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,l)}}return s}static _compilePatterns(t,n,r){let s=[];if(t)for(let o=0,a=t.length;o<a;o++){const i=t[o];let l=-1;if(i.include){const c=tr(i.include);switch(c.kind){case 0:case 1:l=P.getCompiledRuleId(r[i.include],n,r);break;case 2:let u=r[c.ruleName];u&&(l=P.getCompiledRuleId(u,n,r));break;case 3:case 4:const h=c.scopeName,p=c.kind===4?c.ruleName:null,f=n.getExternalGrammar(h,r);if(f)if(p){let d=f.repository[p];d&&(l=P.getCompiledRuleId(d,n,f.repository))}else l=P.getCompiledRuleId(f.repository.$self,n,f.repository);break}}else l=P.getCompiledRuleId(i,n,r);if(l!==-1){const c=n.getRule(l);let u=!1;if((c instanceof sn||c instanceof At||c instanceof Ue)&&c.hasMissingPatterns&&c.patterns.length===0&&(u=!0),u)continue;s.push(l)}}return{patterns:s,hasMissingPatterns:(t?t.length:0)!==s.length}}},ke=class sr{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const r=t.length;let s=0,o=[],a=!1;for(let i=0;i<r;i++)if(t.charAt(i)==="\\"&&i+1<r){const c=t.charAt(i+1);c==="z"?(o.push(t.substring(s,i)),o.push("$(?!\\n)(?<!\\n)"),s=i+2):(c==="A"||c==="G")&&(a=!0),i++}this.hasAnchor=a,s===0?this.source=t:(o.push(t.substring(s,r)),this.source=o.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=vs.test(this.source):this.hasBackReferences=!1}clone(){return new sr(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(s=>t.substring(s.start,s.end));return rn.lastIndex=0,this.source.replace(rn,(s,o)=>Qn(r[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],s=[],o,a,i,l;for(o=0,a=this.source.length;o<a;o++)i=this.source.charAt(o),t[o]=i,n[o]=i,r[o]=i,s[o]=i,i==="\\"&&o+1<a&&(l=this.source.charAt(o+1),l==="A"?(t[o+1]="￿",n[o+1]="￿",r[o+1]="A",s[o+1]="A"):l==="G"?(t[o+1]="￿",n[o+1]="G",r[o+1]="￿",s[o+1]="G"):(t[o+1]=l,n[o+1]=l,r[o+1]=l,s[o+1]=l),o++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:s.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}},ve=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 on(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(s=>s.resolveAnchors(t,n));return new on(e,r,this._items.map(s=>s.ruleId))}},on=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const 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){const r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},ut=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Is=class Et{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new ut(t,8),this._embeddedLanguagesMatcher=new Rs(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?Et._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new ut(0,0);_getBasicScopeAttributes=new Zn(t=>{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new ut(n,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(Et.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/},Rs=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,r])=>Qn(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},an=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function or(e,t,n,r,s,o,a,i){const l=t.content.length;let c=!1,u=-1;if(a){const f=Ns(e,t,n,r,s,o);s=f.stack,r=f.linePos,n=f.isFirstLine,u=f.anchorPosition}const h=Date.now();for(;!c;){if(i!==0&&Date.now()-h>i)return new an(s,!0);p()}return new an(s,!1);function p(){const f=Ls(e,t,n,r,s,u);if(!f){o.produce(s,l),c=!0;return}const d=f.captureIndices,b=f.matchedRuleId,w=d&&d.length>0?d[0].end>r:!1;if(b===xs){const m=s.getRule(e);o.produce(s,d[0].start),s=s.withContentNameScopesList(s.nameScopesList),we(e,t,n,s,o,m.endCaptures,d),o.produce(s,d[0].end);const y=s;if(s=s.parent,u=y.getAnchorPos(),!w&&y.getEnterPos()===r){s=y,o.produce(s,l),c=!0;return}}else{const m=e.getRule(b);o.produce(s,d[0].start);const y=s,C=m.getName(t.content,d),k=s.contentNameScopesList.pushAttributed(C,e);if(s=s.push(b,r,u,d[0].end===l,null,k,k),m instanceof At){const v=m;we(e,t,n,s,o,v.beginCaptures,d),o.produce(s,d[0].end),u=d[0].end;const $=v.getContentName(t.content,d),M=k.pushAttributed($,e);if(s=s.withContentNameScopesList(M),v.endHasBackReferences&&(s=s.withEndRule(v.getEndWithResolvedBackReferences(t.content,d))),!w&&y.hasSameRuleAs(s)){s=s.pop(),o.produce(s,l),c=!0;return}}else if(m instanceof Ue){const v=m;we(e,t,n,s,o,v.beginCaptures,d),o.produce(s,d[0].end),u=d[0].end;const $=v.getContentName(t.content,d),M=k.pushAttributed($,e);if(s=s.withContentNameScopesList(M),v.whileHasBackReferences&&(s=s.withEndRule(v.getWhileWithResolvedBackReferences(t.content,d))),!w&&y.hasSameRuleAs(s)){s=s.pop(),o.produce(s,l),c=!0;return}}else if(we(e,t,n,s,o,m.captures,d),o.produce(s,d[0].end),s=s.pop(),!w){s=s.safePop(),o.produce(s,l),c=!0;return}}d[0].end>r&&(r=d[0].end,n=!1)}}function Ns(e,t,n,r,s,o){let a=s.beginRuleCapturedEOL?0:-1;const i=[];for(let l=s;l;l=l.pop()){const c=l.getRule(e);c instanceof Ue&&i.push({rule:c,stack:l})}for(let l=i.pop();l;l=i.pop()){const{ruleScanner:c,findOptions:u}=Ts(l.rule,e,l.stack.endRule,n,r===a),h=c.findNextMatchSync(t,r,u);if(h){if(h.ruleId!==nr){s=l.stack.pop();break}h.captureIndices&&h.captureIndices.length&&(o.produce(l.stack,h.captureIndices[0].start),we(e,t,n,l.stack,o,l.rule.whileCaptures,h.captureIndices),o.produce(l.stack,h.captureIndices[0].end),a=h.captureIndices[0].end,h.captureIndices[0].end>r&&(r=h.captureIndices[0].end,n=!1))}else{s=l.stack.pop();break}}return{stack:s,linePos:r,anchorPosition:a,isFirstLine:n}}function Ls(e,t,n,r,s,o){const a=$s(e,t,n,r,s,o),i=e.getInjections();if(i.length===0)return a;const l=Ps(i,e,t,n,r,s,o);if(!l)return a;if(!a)return l;const c=a.captureIndices[0].start,u=l.captureIndices[0].start;return u<c||l.priorityMatch&&u===c?l:a}function $s(e,t,n,r,s,o){const a=s.getRule(e),{ruleScanner:i,findOptions:l}=ar(a,e,s.endRule,n,r===o),c=i.findNextMatchSync(t,r,l);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Ps(e,t,n,r,s,o,a){let i=Number.MAX_VALUE,l=null,c,u=0;const h=o.contentNameScopesList.getScopeNames();for(let p=0,f=e.length;p<f;p++){const d=e[p];if(!d.matcher(h))continue;const b=t.getRule(d.ruleId),{ruleScanner:w,findOptions:m}=ar(b,t,null,r,s===a),y=w.findNextMatchSync(n,s,m);if(!y)continue;const C=y.captureIndices[0].start;if(!(C>=i)&&(i=C,l=y.captureIndices,c=y.ruleId,u=d.priority,i===s))break}return l?{priorityMatch:u===-1,captureIndices:l,matchedRuleId:c}:null}function ar(e,t,n,r,s){return{ruleScanner:e.compileAG(t,n,r,s),findOptions:0}}function Ts(e,t,n,r,s){return{ruleScanner:e.compileWhileAG(t,n,r,s),findOptions:0}}function we(e,t,n,r,s,o,a){if(o.length===0)return;const i=t.content,l=Math.min(o.length,a.length),c=[],u=a[0].end;for(let h=0;h<l;h++){const p=o[h];if(p===null)continue;const f=a[h];if(f.length===0)continue;if(f.start>u)break;for(;c.length>0&&c[c.length-1].endPos<=f.start;)s.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?s.produceFromScopes(c[c.length-1].scopes,f.start):s.produce(r,f.start),p.retokenizeCapturedWithRuleId){const b=p.getName(i,a),w=r.contentNameScopesList.pushAttributed(b,e),m=p.getContentName(i,a),y=w.pushAttributed(m,e),C=r.push(p.retokenizeCapturedWithRuleId,f.start,-1,!1,null,w,y),k=e.createOnigString(i.substring(0,f.end));or(e,k,n&&f.start===0,f.start,C,s,!1,0),er(k);continue}const d=p.getName(i,a);if(d!==null){const w=(c.length>0?c[c.length-1].scopes:r.contentNameScopesList).pushAttributed(d,e);c.push(new Ms(w,f.end))}}for(;c.length>0;)s.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var Ms=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Os(e,t,n,r,s,o,a,i){return new Bs(e,t,n,r,s,o,a,i)}function ln(e,t,n,r,s){const o=Fe(t,We),a=rr.getCompiledRuleId(n,r,s.repository);for(const i of o)e.push({debugSelector:t,matcher:i.matcher,ruleId:a,grammar:s,priority:i.priority})}function We(e,t){if(t.length<e.length)return!1;let n=0;return e.every(r=>{for(let s=n;s<t.length;s++)if(Gs(t[s],r))return n=s+1,!0;return!1})}function Gs(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var Bs=class{constructor(e,t,n,r,s,o,a,i){if(this._rootScopeName=e,this.balancedBracketSelectors=o,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=cn(t,null),this._injections=null,this._tokenTypeMatchers=[],s)for(const l of Object.keys(s)){const c=Fe(l,We);for(const u of c)this._tokenTypeMatchers.push({matcher:u.matcher,type:s[l]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const 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(){const e={lookup:s=>s===this._rootScopeName?this._grammar:this.getExternalGrammar(s),injections:s=>this._grammarRepository.injections(s)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){const s=r.injections;if(s)for(let a in s)ln(t,a,s[a],this,r);const o=this._grammarRepository.injections(n);o&&o.forEach(a=>{const i=this.getExternalGrammar(a);if(i){const l=i.injectionSelector;l&&ln(t,l,i,this,i)}})}return t.sort((s,o)=>s.priority-o.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const 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){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=cn(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const 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){const 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=rr.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let s;if(!t||t===It.NULL){s=!0;const c=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),h=se.set(0,c.languageId,c.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),p=this.getRule(this._rootId).getName(null,null);let f;p?f=Ce.createRootAndLookUpScopeName(p,h,this):f=Ce.createRoot("unknown",h),t=new It(null,this._rootId,-1,-1,!1,null,f,f)}else s=!1,t.reset();e=e+`
3
- `;const o=this.createOnigString(e),a=o.content.length,i=new Fs(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=or(this,o,s,0,t,i,!0,r);return er(o),{lineLength:a,lineTokens:i,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function cn(e,t){return e=rs(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 Ce=class H{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,s=t?.scopePath??null;for(const o of n)s=ct.push(s,o.scopeNames),r=new H(r,s,o.encodedTokenAttributes);return r}static createRoot(t,n){return new H(null,new ct(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const s=r.getMetadataForScope(t),o=new ct(null,t),a=r.themeProvider.themeMatch(o),i=H.mergeAttributes(n,s,a);return new H(null,o,i)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return H.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 s=-1,o=0,a=0;return r!==null&&(s=r.fontStyle,o=r.foregroundId,a=r.backgroundId),se.set(t,n.languageId,n.tokenType,null,s,o,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return H._pushAttributed(this,t,n);const r=t.split(/ /g);let s=this;for(const o of r)s=H._pushAttributed(s,o,n);return s}static _pushAttributed(t,n,r){const s=r.getMetadataForScope(n),o=t.scopePath.push(n),a=r.themeProvider.themeMatch(o),i=H.mergeAttributes(t.tokenAttributes,s,a);return new H(t,o,i)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let 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}},It=class ee{constructor(t,n,r,s,o,a,i,l){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=o,this.endRule=a,this.nameScopesList=i,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=s}_stackElementBrand=void 0;static NULL=new ee(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:ee._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Ce.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(){ee._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,s,o,a,i){return new ee(this,t,n,r,s,o,a,i)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const 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 ee(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){const r=Ce.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new ee(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Ce.fromExtension(r,n.contentNameScopesList))}},Ds=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Fe(n,We).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>Fe(n,We).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(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Fs=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}_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,s=!1;if(this.balancedBracketSelectors?.matchesAlways&&(s=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const o=e?.getScopeNames()??[];for(const a of this._tokenTypeOverrides)a.matcher(o)&&(r=se.set(r,0,a.type,null,-1,0,0));this.balancedBracketSelectors&&(s=this.balancedBracketSelectors.match(o))}if(s&&(r=se.set(r,0,8,s,-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}const 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);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,s=this._binaryTokens.length;r<s;r++)n[r]=this._binaryTokens[r];return n}},js=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const 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,s){if(!this._grammars.has(e)){let o=this._rawGrammars.get(e);if(!o)return null;this._grammars.set(e,Os(e,o,t,n,r,s,this,this._onigLib))}return this._grammars.get(e)}},Us=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new js(De.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(De.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,r){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:r})}loadGrammarWithConfiguration(t,n,r){return this._loadGrammar(t,n,r.embeddedLanguages,r.tokenTypes,new Ds(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,r,s,o){const a=new ys(this._syncRegistry,t);for(;a.Q.length>0;)a.Q.map(i=>this._loadSingleGrammar(i.scopeName)),a.processQueue();return this._grammarForScopeName(t,n,r,s,o)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(t,n=[],r=0,s=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,r,s)}_grammarForScopeName(t,n=0,r=null,s=null,o=null){return this._syncRegistry.grammarForScopeName(t,n,r,s,o)}},Rt=It.NULL;function ze(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[s,o]of Object.entries(t?.colorReplacements||{}))typeof o=="string"?n[s]=o:s===r&&Object.assign(n,o);return n}function Y(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Ws(e){return Array.isArray(e)?e:[e]}async function ir(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Qe(e){return!e||["plaintext","txt","text","plain"].includes(e)}function zs(e){return e==="ansi"||Qe(e)}function Ze(e){return e==="none"}function Hs(e){return Ze(e)}const qs=/(\r?\n)/g;function Ye(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(qs);let r=0;const s=[];for(let o=0;o<n.length;o+=2){const a=t?n[o]+(n[o+1]||""):n[o];s.push([a,r]),r+=n[o].length,r+=n[o+1]?.length||0}return s}const un={light:"#333333",dark:"#bbbbbb"},hn={light:"#fffffe",dark:"#1e1e1e"},pn="__shiki_resolved";function Wt(e){if(e?.[pn])return e;const 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){const 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"?un.light:un.dark),n||(n=t.type==="light"?hn.light:hn.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 s=0;const o=new Map;function a(i){if(o.has(i))return o.get(i);s+=1;const l=`#${s.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${l}`]?a(i):(o.set(i,l),l)}t.settings=t.settings.map(i=>{const l=i.settings?.foreground&&!i.settings.foreground.startsWith("#"),c=i.settings?.background&&!i.settings.background.startsWith("#");if(!l&&!c)return i;const u={...i,settings:{...i.settings}};if(l){const h=a(i.settings.foreground);t.colorReplacements[h]=i.settings.foreground,u.settings.foreground=h}if(c){const h=a(i.settings.background);t.colorReplacements[h]=i.settings.background,u.settings.background=h}return u});for(const i of Object.keys(t.colors||{}))if((i==="editor.foreground"||i==="editor.background"||i.startsWith("terminal.ansi"))&&!t.colors[i]?.startsWith("#")){const l=a(t.colors[i]);t.colorReplacements[l]=t.colors[i],t.colors[i]=l}return Object.defineProperty(t,pn,{enumerable:!1,writable:!1,value:!0}),t}async function lr(e){return[...new Set((await Promise.all(e.filter(t=>!zs(t)).map(async t=>await ir(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function cr(e){return(await Promise.all(e.map(async t=>Hs(t)?null:Wt(await ir(t))))).filter(t=>!!t)}function ur(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new A(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var Vs=class extends Us{_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(s=>this.loadTheme(s)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=Wt(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=De.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=ur(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(s=>s.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(s=>{this._alias[s]=e.name}),this._loadedLanguagesCache=null,t.size)for(const s of t)this._resolvedGrammars.delete(s.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(s.scopeName),this._syncRegistry?._grammars?.delete(s.scopeName),this.loadLanguage(this._langMap.get(s.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const r of e)this.resolveEmbeddedLanguages(r);const t=[...this._langGraph.entries()],n=t.filter(([r,s])=>!s);if(n.length){const r=t.filter(([s,o])=>o?(o.embeddedLanguages||o.embeddedLangs)?.some(a=>n.map(([i])=>i).includes(a)):!1).filter(s=>!n.includes(s));throw new A(`Missing languages ${n.map(([s])=>`\`${s}\``).join(", ")}, required by ${r.map(([s])=>`\`${s}\``).join(", ")}`)}for(const[r,s]of t)this._resolver.addLanguage(s);for(const[r,s]of t)this.loadLanguage(s)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);const t=e.embeddedLanguages??e.embeddedLangs;if(t)for(const n of t)this._langGraph.set(n,this._langMap.get(n))}},Xs=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).push(e.scopeName)})}getInjections(e){const t=e.split(".");let n=[];for(let r=1;r<=t.length;r++){const s=t.slice(0,r).join(".");n=[...n,...this._injections.get(s)||[]]}return n}};let be=0;function Ks(e){be+=1,e.warnings!==!1&&be>=10&&be%10===0&&console.warn(`[Shiki] ${be} 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 A("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(Wt),s=new Vs(new Xs(e.engine,n),r,n,e.langAlias);let o;function a(y){return ur(y,e.langAlias)}function i(y){w();const C=s.getGrammar(typeof y=="string"?y:y.name);if(!C)throw new A(`Language \`${y}\` not found, you may need to load it first`);return C}function l(y){if(y==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};w();const C=s.getTheme(y);if(!C)throw new A(`Theme \`${y}\` not found, you may need to load it first`);return C}function c(y){w();const C=l(y);return o!==y&&(s.setTheme(C),o=y),{theme:C,colorMap:s.getColorMap()}}function u(){return w(),s.getLoadedThemes()}function h(){return w(),s.getLoadedLanguages()}function p(...y){w(),s.loadLanguages(y.flat(1))}async function f(...y){return p(await lr(y))}function d(...y){w();for(const C of y.flat(1))s.loadTheme(C)}async function b(...y){return w(),d(await cr(y))}function w(){if(t)throw new A("Shiki instance has been disposed")}function m(){t||(t=!0,s.dispose(),be-=1)}return{setTheme:c,getTheme:l,getLanguage:i,getLoadedThemes:u,getLoadedLanguages:h,resolveLangAlias:a,loadLanguage:f,loadLanguageSync:p,loadTheme:b,loadThemeSync:d,dispose:m,[Symbol.dispose]:m}}async function Qs(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([cr(e.themes||[]),lr(e.langs||[]),e.engine]);return Ks({...e,themes:t,langs:n,engine:r})}const hr=new WeakMap;function Je(e,t){hr.set(e,t)}function xe(e){return hr.get(e)}var et=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(Ws(n).map(r=>[r,Rt])),t)}constructor(...t){if(t.length===2){const[n,r]=t;this.lang=r,this._stacks=n}else{const[n,r,s]=t;this.lang=r,this._stacks={[s]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return Zs(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Zs(e){const t=[],n=new Set;function r(s){if(n.has(s))return;n.add(s);const o=s?.nameScopesList?.scopeName;o&&t.push(o),s.parent&&r(s.parent)}return r(e),t}function Ys(e,t){if(!(e instanceof et))throw new A("Invalid grammar state");return e.getInternalStack(t)}const Js=/,/,eo=/ /;function fr(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n;if(Qe(e.resolveLangAlias(n.lang||"text"))||Ze(r))return Ye(t).map(i=>[{content:i[0],offset:i[1]}]);const{theme:s,colorMap:o}=e.setTheme(r),a=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==a.name)throw new A(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${a.name}"`);if(!n.grammarState.themes.includes(s.name))throw new A(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return no(t,a,s,o,n)}function to(...e){if(e.length===2)return xe(e[1]);const[t,n,r={}]=e,{lang:s="text",theme:o=t.getLoadedThemes()[0]}=r;if(Qe(s)||Ze(o))throw new A("Plain language does not have grammar state");if(s==="ansi")throw new A("ANSI language does not have grammar state");const{theme:a,colorMap:i}=t.setTheme(o),l=t.getLanguage(s);return new et(zt(n,l,a,i,r).stateStack,l.name,a.name)}function no(e,t,n,r,s){const o=zt(e,t,n,r,s),a=new et(o.stateStack,t.name,n.name);return Je(o.tokens,a),o.tokens}function zt(e,t,n,r,s){const o=ze(n,s),{tokenizeMaxLineLength:a=0,tokenizeTimeLimit:i=500,includeExplanation:l=!1}=s,c=Ye(e);let u=s.grammarState?Ys(s.grammarState,n.name)??Rt:s.grammarContextCode!=null?zt(s.grammarContextCode,t,n,r,{...s,grammarState:void 0,grammarContextCode:void 0}).stateStack:Rt,h=[];const p=[];for(let f=0,d=c.length;f<d;f++){const[b,w]=c[f];if(b===""){h=[],p.push([]);continue}if(a>0&&b.length>=a){h=[],p.push([{content:b,offset:w,color:"",fontStyle:0}]);continue}let m,y,C;l&&l!=="tokenType"&&(m=t.tokenizeLine(b,u,i),y=m.tokens,C=0);const k=t.tokenizeLine2(b,u,i),v=k.tokens.length/2;for(let $=0;$<v;$++){const M=k.tokens[2*$],W=$+1<v?k.tokens[2*$+2]:b.length;if(M===W)continue;const le=k.tokens[2*$+1],ot=Y(r[se.getForeground(le)],o),at=se.getFontStyle(le),z={content:b.substring(M,W),offset:w+M,color:ot,fontStyle:at};if(l==="tokenType")z.type=se.getTokenType(le);else if(l){const Jt=[];if(l!=="scopeName")for(const q of n.settings){let ce;switch(typeof q.scope){case"string":ce=q.scope.split(Js).map(it=>it.trim());break;case"object":ce=q.scope;break;default:continue}Jt.push({settings:q,selectors:ce.map(it=>it.split(eo))})}z.explanation=[];let en=0;for(;M+en<W;){const q=y[C],ce=b.substring(q.startIndex,q.endIndex);en+=ce.length,z.explanation.push({content:ce,scopes:l==="scopeName"?ro(q.scopes):so(Jt,q.scopes)}),C+=1}}h.push(z)}p.push(h),h=[],u=k.ruleStack}return{tokens:p,stateStack:u}}function ro(e){return e.map(t=>({scopeName:t}))}function so(e,t){const n=[];for(let r=0,s=t.length;r<s;r++){const o=t[r];n[r]={scopeName:o,themeMatches:ao(e,o,t.slice(0,r))}}return n}function fn(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function oo(e,t,n){if(!fn(e.at(-1),t))return!1;let r=e.length-2,s=n.length-1;for(;r>=0&&s>=0;)fn(e[r],n[s])&&(r-=1),s-=1;return r===-1}function ao(e,t,n){const r=[];for(const{selectors:s,settings:o}of e)for(const a of s)if(oo(a,t,n)){r.push(o);break}return r}function dr(e,t,n,r=fr){const s=Object.entries(n.themes).filter(c=>c[1]).map(c=>({color:c[0],theme:c[1]})),o=s.map(c=>{const u=r(e,t,{...n,theme:c.theme});return{tokens:u,state:xe(u),theme:typeof c.theme=="string"?c.theme:c.theme.name}}),a=io(...o.map(c=>c.tokens)),i=a[0].map((c,u)=>c.map((h,p)=>{const f={content:h.content,variants:{},offset:h.offset};return"includeExplanation"in n&&n.includeExplanation&&(f.explanation=h.explanation),a.forEach((d,b)=>{const{content:w,explanation:m,offset:y,...C}=d[u][p];f.variants[s[b].color]=C}),f})),l=o[0].state?new et(Object.fromEntries(o.map(c=>[c.theme,c.state?.getInternalStack(c.theme)])),o[0].state.lang):void 0;return l&&Je(i,l),i}function io(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){const s=e.map(l=>l[r]),o=t.map(()=>[]);t.forEach((l,c)=>l.push(o[c]));const a=s.map(()=>0),i=s.map(l=>l[0]);for(;i.every(l=>l);){const l=Math.min(...i.map(c=>c.content.length));for(let c=0;c<n;c++){const u=i[c];u.content.length===l?(o[c].push(u),a[c]+=1,i[c]=s[c][a[c]]):(o[c].push({...u,content:u.content.slice(0,l)}),i[c]={...u,content:u.content.slice(l),offset:u.offset+l})}}}return t}const lo=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Ie{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ie.prototype.normal={};Ie.prototype.property={};Ie.prototype.space=void 0;function gr(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new Ie(n,r,t)}function Nt(e){return e.toLowerCase()}class O{constructor(t,n){this.attribute=n,this.property=t}}O.prototype.attribute="";O.prototype.booleanish=!1;O.prototype.boolean=!1;O.prototype.commaOrSpaceSeparated=!1;O.prototype.commaSeparated=!1;O.prototype.defined=!1;O.prototype.mustUseProperty=!1;O.prototype.number=!1;O.prototype.overloadedBoolean=!1;O.prototype.property="";O.prototype.spaceSeparated=!1;O.prototype.space=void 0;let co=0;const _=ie(),I=ie(),Lt=ie(),g=ie(),x=ie(),oe=ie(),G=ie();function ie(){return 2**++co}var $t=Object.freeze({__proto__:null,boolean:_,booleanish:I,commaOrSpaceSeparated:G,commaSeparated:oe,number:g,overloadedBoolean:Lt,spaceSeparated:x});const ht=Object.keys($t);class Ht extends O{constructor(t,n,r,s){let o=-1;if(super(t,n),dn(this,"space",s),typeof r=="number")for(;++o<ht.length;){const a=ht[o];dn(this,ht[o],(r&$t[a])===$t[a])}}}Ht.prototype.defined=!0;function dn(e,t,n){n&&(e[t]=n)}function ge(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const o=new Ht(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Nt(r)]=r,n[Nt(o.attribute)]=r}return new Ie(t,n,e.space)}const mr=ge({properties:{ariaActiveDescendant:null,ariaAtomic:I,ariaAutoComplete:null,ariaBusy:I,ariaChecked:I,ariaColCount:g,ariaColIndex:g,ariaColSpan:g,ariaControls:x,ariaCurrent:null,ariaDescribedBy:x,ariaDetails:null,ariaDisabled:I,ariaDropEffect:x,ariaErrorMessage:null,ariaExpanded:I,ariaFlowTo:x,ariaGrabbed:I,ariaHasPopup:null,ariaHidden:I,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:x,ariaLevel:g,ariaLive:null,ariaModal:I,ariaMultiLine:I,ariaMultiSelectable:I,ariaOrientation:null,ariaOwns:x,ariaPlaceholder:null,ariaPosInSet:g,ariaPressed:I,ariaReadOnly:I,ariaRelevant:null,ariaRequired:I,ariaRoleDescription:x,ariaRowCount:g,ariaRowIndex:g,ariaRowSpan:g,ariaSelected:I,ariaSetSize:g,ariaSort:null,ariaValueMax:g,ariaValueMin:g,ariaValueNow:g,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function yr(e,t){return t in e?e[t]:t}function br(e,t){return yr(e,t.toLowerCase())}const uo=ge({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:oe,acceptCharset:x,accessKey:x,action:null,allow:null,allowFullScreen:_,allowPaymentRequest:_,allowUserMedia:_,alpha:_,alt:null,as:null,async:_,autoCapitalize:null,autoComplete:x,autoFocus:_,autoPlay:_,blocking:x,capture:null,charSet:null,checked:_,cite:null,className:x,closedBy:null,colorSpace:null,cols:g,colSpan:g,command:null,commandFor:null,content:null,contentEditable:I,controls:_,controlsList:x,coords:g|oe,crossOrigin:null,data:null,dateTime:null,decoding:null,default:_,defer:_,dir:null,dirName:null,disabled:_,download:Lt,draggable:I,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:_,formTarget:null,headers:x,height:g,hidden:Lt,high:g,href:null,hrefLang:null,htmlFor:x,httpEquiv:x,id:null,imageSizes:null,imageSrcSet:null,inert:_,inputMode:null,integrity:null,is:null,isMap:_,itemId:null,itemProp:x,itemRef:x,itemScope:_,itemType:x,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:_,low:g,manifest:null,max:null,maxLength:g,media:null,method:null,min:null,minLength:g,multiple:_,muted:_,name:null,nonce:null,noModule:_,noValidate:_,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:_,optimum:g,pattern:null,ping:x,placeholder:null,playsInline:_,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:_,referrerPolicy:null,rel:x,required:_,reversed:_,rows:g,rowSpan:g,sandbox:x,scope:null,scoped:_,seamless:_,selected:_,shadowRootClonable:_,shadowRootCustomElementRegistry:_,shadowRootDelegatesFocus:_,shadowRootMode:null,shadowRootSerializable:_,shape:null,size:g,sizes:null,slot:null,span:g,spellCheck:I,src:null,srcDoc:null,srcLang:null,srcSet:null,start:g,step:null,style:null,tabIndex:g,target:null,title:null,translate:null,type:null,typeMustMatch:_,useMap:null,value:I,width:g,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:x,axis:null,background:null,bgColor:null,border:g,borderColor:null,bottomMargin:g,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:_,declare:_,event:null,face:null,frame:null,frameBorder:null,hSpace:g,leftMargin:g,link:null,longDesc:null,lowSrc:null,marginHeight:g,marginWidth:g,noResize:_,noHref:_,noShade:_,noWrap:_,object:null,profile:null,prompt:null,rev:null,rightMargin:g,rules:null,scheme:null,scrolling:I,standby:null,summary:null,text:null,topMargin:g,valueType:null,version:null,vAlign:null,vLink:null,vSpace:g,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:_,disablePictureInPicture:_,disableRemotePlayback:_,exportParts:oe,part:x,prefix:null,property:null,results:g,security:null,unselectable:null},space:"html",transform:br}),ho=ge({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:g,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:g,amplitude:g,arabicForm:null,ascent:g,attributeName:null,attributeType:null,azimuth:g,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:g,by:null,calcMode:null,capHeight:g,className:x,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:g,diffuseConstant:g,direction:null,display:null,dur:null,divisor:g,dominantBaseline:null,download:_,dx:null,dy:null,edgeMode:null,editable:null,elevation:g,enableBackground:null,end:null,event:null,exponent:g,externalResourcesRequired:null,fill:null,fillOpacity:g,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:oe,g2:oe,glyphName:oe,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:g,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:g,horizOriginX:g,horizOriginY:g,id:null,ideographic:g,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:g,k:g,k1:g,k2:g,k3:g,k4:g,kernelMatrix:G,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:g,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:g,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:g,overlineThickness:g,paintOrder:null,panose1:null,path:null,pathLength:g,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:x,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:g,pointsAtY:g,pointsAtZ:g,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:g,specularExponent:g,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:g,strikethroughThickness:g,string:null,stroke:null,strokeDashArray:G,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:g,strokeOpacity:g,strokeWidth:null,style:null,surfaceScale:g,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:G,tabIndex:g,tableValues:null,target:null,targetX:g,targetY:g,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:g,underlineThickness:g,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:g,values:null,vAlphabetic:g,vMathematical:g,vectorEffect:null,vHanging:g,vIdeographic:g,version:null,vertAdvY:g,vertOriginX:g,vertOriginY:g,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:g,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:yr}),wr=ge({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()}}),Cr=ge({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:br}),_r=ge({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),po=/[A-Z]/g,gn=/-[a-z]/g,fo=/^data[-\w.:]+$/i;function go(e,t){const n=Nt(t);let r=t,s=O;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&fo.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(gn,yo);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!gn.test(o)){let a=o.replace(po,mo);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}s=Ht}return new s(r,t)}function mo(e){return"-"+e.toLowerCase()}function yo(e){return e.charAt(1).toUpperCase()}const bo=gr([mr,uo,wr,Cr,_r],"html"),Sr=gr([mr,ho,wr,Cr,_r],"svg"),mn={}.hasOwnProperty;function wo(e,t){const n=t||{};function r(s,...o){let a=r.invalid;const i=r.handlers;if(s&&mn.call(s,e)){const l=String(s[e]);a=mn.call(i,l)?i[l]:r.unknown}if(a)return a.call(this,s,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Co=/["&'<>`]/g,_o=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,So=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,ko=/[|\\{}()[\]^$+*?.]/g,yn=new WeakMap;function vo(e,t){if(e=e.replace(t.subset?xo(t.subset):Co,r),t.subset||t.escapeOnly)return e;return e.replace(_o,n).replace(So,r);function n(s,o,a){return t.format((s.charCodeAt(0)-55296)*1024+s.charCodeAt(1)-56320+65536,a.charCodeAt(o+2),t)}function r(s,o,a){return t.format(s.charCodeAt(0),a.charCodeAt(o+1),t)}}function xo(e){let t=yn.get(e);return t||(t=Ao(e),yn.set(e,t)),t}function Ao(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(ko,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const Eo=/[\dA-Fa-f]/;function Io(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!Eo.test(String.fromCharCode(t))?r:r+";"}const Ro=/\d/;function No(e,t,n){const r="&#"+String(e);return n&&t&&!Ro.test(String.fromCharCode(t))?r:r+";"}const Lo=["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"],pt={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},$o=["cent","copy","divide","gt","lt","not","para","times"],kr={}.hasOwnProperty,Pt={};let Le;for(Le in pt)kr.call(pt,Le)&&(Pt[pt[Le]]=Le);const Po=/[^\dA-Za-z]/;function To(e,t,n,r){const s=String.fromCharCode(e);if(kr.call(Pt,s)){const o=Pt[s],a="&"+o;return n&&Lo.includes(o)&&!$o.includes(o)&&(!r||t&&t!==61&&Po.test(String.fromCharCode(t)))?a:a+";"}return""}function Mo(e,t,n){let r=Io(e,t,n.omitOptionalSemicolons),s;if((n.useNamedReferences||n.useShortestReferences)&&(s=To(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!s)&&n.useShortestReferences){const o=No(e,t,n.omitOptionalSemicolons);o.length<r.length&&(r=o)}return s&&(!n.useShortestReferences||s.length<r.length)?s:r}function de(e,t){return vo(e,Object.assign({format:Mo},t))}const Oo=/^>|^->|<!--|-->|--!>|<!-$/g,Go=[">"],Bo=["<",">"];function Do(e,t,n,r){return r.settings.bogusComments?"<?"+de(e.value,Object.assign({},r.settings.characterReferences,{subset:Go}))+">":"<!--"+e.value.replace(Oo,s)+"-->";function s(o){return de(o,Object.assign({},r.settings.characterReferences,{subset:Bo}))}}function Fo(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function bn(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}function jo(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Uo(e){return e.join(" ").trim()}const Wo=/[ \t\n\f\r]/g;function qt(e){return typeof e=="object"?e.type==="text"?wn(e.value):!1:wn(e)}function wn(e){return e.replace(Wo,"")===""}const N=xr(1),vr=xr(-1),zo=[];function xr(e){return t;function t(n,r,s){const o=n?n.children:zo;let a=(r||0)+e,i=o[a];if(!s)for(;i&&qt(i);)a+=e,i=o[a];return i}}const Ho={}.hasOwnProperty;function Ar(e){return t;function t(n,r,s){return Ho.call(e,n.tagName)&&e[n.tagName](n,r,s)}}const Vt=Ar({body:Vo,caption:ft,colgroup:ft,dd:Zo,dt:Qo,head:ft,html:qo,li:Ko,optgroup:Yo,option:Jo,p:Xo,rp:Cn,rt:Cn,tbody:ta,td:_n,tfoot:na,th:_n,thead:ea,tr:ra});function ft(e,t,n){const r=N(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&qt(r.value.charAt(0)))}function qo(e,t,n){const r=N(n,t);return!r||r.type!=="comment"}function Vo(e,t,n){const r=N(n,t);return!r||r.type!=="comment"}function Xo(e,t,n){const r=N(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"))}function Ko(e,t,n){const r=N(n,t);return!r||r.type==="element"&&r.tagName==="li"}function Qo(e,t,n){const r=N(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Zo(e,t,n){const r=N(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function Cn(e,t,n){const r=N(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Yo(e,t,n){const r=N(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function Jo(e,t,n){const r=N(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function ea(e,t,n){const r=N(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function ta(e,t,n){const r=N(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function na(e,t,n){return!N(n,t)}function ra(e,t,n){const r=N(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function _n(e,t,n){const r=N(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const sa=Ar({body:ia,colgroup:la,head:aa,html:oa,tbody:ca});function oa(e){const t=N(e,-1);return!t||t.type!=="comment"}function aa(e){const t=new Set;for(const 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)}const n=e.children[0];return!n||n.type==="element"}function ia(e){const t=N(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&qt(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function la(e,t,n){const r=vr(n,t),s=N(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&Vt(r,n.children.indexOf(r),n)?!1:!!(s&&s.type==="element"&&s.tagName==="col")}function ca(e,t,n){const r=vr(n,t),s=N(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&Vt(r,n.children.indexOf(r),n)?!1:!!(s&&s.type==="element"&&s.tagName==="tr")}const $e={name:[[`
1
+ var E=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function rs(e){return Ut(e)}function Ut(e){return Array.isArray(e)?ss(e):e instanceof RegExp?e:typeof e=="object"?os(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 os(e){let t={};for(let n in e)t[n]=Ut(e[n]);return t}function qn(e,...t){return t.forEach(n=>{for(let r in n)e[r]=n[r]}),e}function Vn(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?Vn(e.substring(0,e.length-1)):e.substr(~t+1)}var lt=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Ne=class{static hasCaptures(e){return e===null?!1:(lt.lastIndex=0,lt.test(e))}static replaceCaptures(e,t,n){return e.replace(lt,(r,s,o,a)=>{let i=n[parseInt(s||o,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 Xn(e,t){return e<t?-1:e>t?1:0}function Kn(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 s=0;s<n;s++){let o=Xn(e[s],t[s]);if(o!==0)return o}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 Qn(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Zn=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},De=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(ls(e),t)}static createFromParsedTheme(e,t){return us(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;const t=e.scopeName,r=this._cachedMatchRoot.get(t).find(s=>as(e.parent,s.parentScopes));return r?new Yn(r.fontStyle,r.foreground,r.background):null}},ct=class Oe{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const r of n)t=new Oe(t,r);return t}static from(...t){let n=null;for(let r=0;r<t.length;r++)n=new Oe(n,t[r]);return n}push(t){return new Oe(this,t)}getSegments(){let t=this;const 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){const n=[];let r=this;for(;r&&r!==t;)n.push(r.scopeName),r=r.parent;return r===t?n.reverse():void 0}};function as(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let r=t[n],s=!1;if(r===">"){if(n===t.length-1)return!1;r=t[++n],s=!0}for(;e&&!is(e.scopeName,r);){if(s)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function is(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var Yn=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function ls(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],r=0;for(let s=0,o=t.length;s<o;s++){let a=t[s];if(!a.settings)continue;let i;if(typeof a.scope=="string"){let h=a.scope;h=h.replace(/^[,]+/,""),h=h.replace(/[,]+$/,""),i=h.split(",")}else Array.isArray(a.scope)?i=a.scope:i=[""];let l=-1;if(typeof a.settings.fontStyle=="string"){l=0;let h=a.settings.fontStyle.split(" ");for(let p=0,f=h.length;p<f;p++)switch(h[p]){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 h=0,p=i.length;h<p;h++){let d=i[h].trim().split(" "),b=d[d.length-1],w=null;d.length>1&&(w=d.slice(0,d.length-1),w.reverse()),n[r++]=new cs(b,w,s,l,c,u)}}return n}var cs=class{constructor(e,t,n,r,s,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=s,this.background=o}},T=(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))(T||{});function us(e,t){e.sort((l,c)=>{let u=Xn(l.scope,c.scope);return u!==0||(u=Kn(l.parentScopes,c.parentScopes),u!==0)?u:l.index-c.index});let n=0,r="#000000",s="#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&&(s=l.background)}let o=new hs(t),a=new Yn(n,o.getId(r),o.getId(s)),i=new fs(new kt(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,o.getId(u.foreground),o.getId(u.background))}return new De(o,a,i)}var hs=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)}},ps=Object.freeze([]),kt=class Jn{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,r,s,o){this.scopeDepth=t,this.parentScopes=n||ps,this.fontStyle=r,this.foreground=s,this.background=o}clone(){return new Jn(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let r=0,s=t.length;r<s;r++)n[r]=t[r].clone();return n}acceptOverwrite(t,n,r,s){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),r!==0&&(this.foreground=r),s!==0&&(this.background=s)}},fs=class vt{constructor(t,n=[],r={}){this._mainRule=t,this._children=r,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let r=0,s=0;for(;t.parentScopes[r]===">"&&r++,n.parentScopes[s]===">"&&s++,!(r>=t.parentScopes.length||s>=n.parentScopes.length);){const o=n.parentScopes[s].length-t.parentScopes[r].length;if(o!==0)return o;r++,s++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let r=t.indexOf("."),s,o;if(r===-1?(s=t,o=""):(s=t.substring(0,r),o=t.substring(r+1)),this._children.hasOwnProperty(s))return this._children[s].match(o)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(vt._cmpBySpecificity),n}insert(t,n,r,s,o,a){if(n===""){this._doInsertHere(t,r,s,o,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 vt(this._mainRule.clone(),kt.cloneArr(this._rulesWithParentScopes)),this._children[l]=u),u.insert(t+1,c,r,s,o,a)}_doInsertHere(t,n,r,s,o){if(n===null){this._mainRule.acceptOverwrite(t,r,s,o);return}for(let a=0,i=this._rulesWithParentScopes.length;a<i;a++){let l=this._rulesWithParentScopes[a];if(Kn(l.parentScopes,n)===0){l.acceptOverwrite(t,r,s,o);return}}r===-1&&(r=this._mainRule.fontStyle),s===0&&(s=this._mainRule.foreground),o===0&&(o=this._mainRule.background),this._rulesWithParentScopes.push(new kt(t,n,r,s,o))}},se=class B{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=B.getLanguageId(t),r=B.getTokenType(t),s=B.getFontStyle(t),o=B.getForeground(t),a=B.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:s,foreground:o,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,s,o,a,i){let l=B.getLanguageId(t),c=B.getTokenType(t),u=B.containsBalancedBrackets(t)?1:0,h=B.getFontStyle(t),p=B.getForeground(t),f=B.getBackground(t);return n!==0&&(l=n),r!==8&&(c=r),s!==null&&(u=s?1:0),o!==-1&&(h=o),a!==0&&(p=a),i!==0&&(f=i),(l<<0|c<<8|u<<10|h<<11|p<<15|f<<24)>>>0}};function Fe(e,t){const n=[],r=ds(e);let s=r.next();for(;s!==null;){let l=0;if(s.length===2&&s.charAt(1)===":"){switch(s.charAt(0)){case"R":l=1;break;case"L":l=-1;break;default:console.log(`Unknown priority ${s} in scope selector`)}s=r.next()}let c=a();if(n.push({matcher:c,priority:l}),s!==",")break;s=r.next()}return n;function o(){if(s==="-"){s=r.next();const l=o();return c=>!!l&&!l(c)}if(s==="("){s=r.next();const l=i();return s===")"&&(s=r.next()),l}if(nn(s)){const l=[];do l.push(s),s=r.next();while(nn(s));return c=>t(l,c)}return null}function a(){const l=[];let c=o();for(;c;)l.push(c),c=o();return u=>l.every(h=>h(u))}function i(){const l=[];let c=a();for(;c&&(l.push(c),s==="|"||s===",");){do s=r.next();while(s==="|"||s===",");c=a()}return u=>l.some(h=>h(u))}}function nn(e){return!!e&&!!e.match(/[\w\.:]+/)}function ds(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}function er(e){typeof e.dispose=="function"&&e.dispose()}var Se=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},gs=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},ms=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const 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 Se(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new ms;for(const n of e)bs(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Se){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 bs(e,t,n,r){const s=n.lookup(e.scopeName);if(!s){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const o=n.lookup(t);e instanceof Se?Ge({baseGrammar:o,selfGrammar:s},r):xt(e.ruleName,{baseGrammar:o,selfGrammar:s,repository:s.repository},r);const a=n.injections(e.scopeName);if(a)for(const i of a)r.add(new Se(i))}function xt(e,t,n){if(t.repository&&t.repository[e]){const r=t.repository[e];je([r],t,n)}}function Ge(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&je(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&je(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function je(e,t,n){for(const r of e){if(n.visitedRule.has(r))continue;n.visitedRule.add(r);const s=r.repository?qn({},t.repository,r.repository):t.repository;Array.isArray(r.patterns)&&je(r.patterns,{...t,repository:s},n);const o=r.include;if(!o)continue;const a=tr(o);switch(a.kind){case 0:Ge({...t,selfGrammar:t.baseGrammar},n);break;case 1:Ge(t,n);break;case 2:xt(a.ruleName,{...t,repository:s},n);break;case 3:case 4:const i=a.scopeName===t.selfGrammar.scopeName?t.selfGrammar:a.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(i){const l={baseGrammar:t.baseGrammar,selfGrammar:i,repository:s};a.kind===4?xt(a.ruleName,l,n):Ge(l,n)}else a.kind===4?n.add(new gs(a.scopeName,a.ruleName)):n.add(new Se(a.scopeName));break}}}var ws=class{kind=0},Cs=class{kind=1},_s=class{constructor(e){this.ruleName=e}kind=2},Ss=class{constructor(e){this.scopeName=e}kind=3},ks=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function tr(e){if(e==="$base")return new ws;if(e==="$self")return new Cs;const t=e.indexOf("#");if(t===-1)return new Ss(e);if(t===0)return new _s(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new ks(n,r)}}var vs=/\\(\d+)/,rn=/\\(\d+)/g,xs=-1,nr=-2;var Ae=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Ne.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=Ne.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Vn(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:Ne.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Ne.replaceCaptures(this._contentName,e,t)}},Es=class extends Ae{retokenizeCapturedWithRuleId;constructor(e,t,n,r,s){super(e,t,n,r),this.retokenizeCapturedWithRuleId=s}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!")}},As=class extends Ae{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,r,s){super(e,t,n,null),this._match=new ke(r,this.id),this.captures=s,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 ve,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},sn=class extends Ae{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,s){super(e,t,n,r),this.patterns=s.patterns,this.hasMissingPatterns=s.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const 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 ve,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Et=class extends Ae{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,r,s,o,a,i,l,c){super(e,t,n,r),this._begin=new ke(s,this.id),this.beginCaptures=o,this._end=new ke(a||"￿",-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 ve;for(const 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}},Ue=class extends Ae{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,r,s,o,a,i,l){super(e,t,n,r),this._begin=new ke(s,this.id),this.beginCaptures=o,this.whileCaptures=i,this._while=new ke(a,nr),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 ve;for(const 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 ve,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},rr=class P{static createCaptureRule(t,n,r,s,o){return t.registerRule(a=>new Es(n,a,r,s,o))}static getCompiledRuleId(t,n,r){return t.id||n.registerRule(s=>{if(t.id=s,t.match)return new As(t.$vscodeTextmateLocation,t.id,t.name,t.match,P._compileCaptures(t.captures,n,r));if(typeof t.begin>"u"){t.repository&&(r=qn({},r,t.repository));let o=t.patterns;return typeof o>"u"&&t.include&&(o=[{include:t.include}]),new sn(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,P._compilePatterns(o,n,r))}return t.while?new Ue(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,P._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,P._compileCaptures(t.whileCaptures||t.captures,n,r),P._compilePatterns(t.patterns,n,r)):new Et(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,P._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,P._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,P._compilePatterns(t.patterns,n,r))}),t.id}static _compileCaptures(t,n,r){let s=[];if(t){let o=0;for(const a in t){if(a==="$vscodeTextmateLocation")continue;const i=parseInt(a,10);i>o&&(o=i)}for(let a=0;a<=o;a++)s[a]=null;for(const a in t){if(a==="$vscodeTextmateLocation")continue;const i=parseInt(a,10);let l=0;t[a].patterns&&(l=P.getCompiledRuleId(t[a],n,r)),s[i]=P.createCaptureRule(n,t[a].$vscodeTextmateLocation,t[a].name,t[a].contentName,l)}}return s}static _compilePatterns(t,n,r){let s=[];if(t)for(let o=0,a=t.length;o<a;o++){const i=t[o];let l=-1;if(i.include){const c=tr(i.include);switch(c.kind){case 0:case 1:l=P.getCompiledRuleId(r[i.include],n,r);break;case 2:let u=r[c.ruleName];u&&(l=P.getCompiledRuleId(u,n,r));break;case 3:case 4:const h=c.scopeName,p=c.kind===4?c.ruleName:null,f=n.getExternalGrammar(h,r);if(f)if(p){let d=f.repository[p];d&&(l=P.getCompiledRuleId(d,n,f.repository))}else l=P.getCompiledRuleId(f.repository.$self,n,f.repository);break}}else l=P.getCompiledRuleId(i,n,r);if(l!==-1){const c=n.getRule(l);let u=!1;if((c instanceof sn||c instanceof Et||c instanceof Ue)&&c.hasMissingPatterns&&c.patterns.length===0&&(u=!0),u)continue;s.push(l)}}return{patterns:s,hasMissingPatterns:(t?t.length:0)!==s.length}}},ke=class sr{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const r=t.length;let s=0,o=[],a=!1;for(let i=0;i<r;i++)if(t.charAt(i)==="\\"&&i+1<r){const c=t.charAt(i+1);c==="z"?(o.push(t.substring(s,i)),o.push("$(?!\\n)(?<!\\n)"),s=i+2):(c==="A"||c==="G")&&(a=!0),i++}this.hasAnchor=a,s===0?this.source=t:(o.push(t.substring(s,r)),this.source=o.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=vs.test(this.source):this.hasBackReferences=!1}clone(){return new sr(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(s=>t.substring(s.start,s.end));return rn.lastIndex=0,this.source.replace(rn,(s,o)=>Qn(r[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],r=[],s=[],o,a,i,l;for(o=0,a=this.source.length;o<a;o++)i=this.source.charAt(o),t[o]=i,n[o]=i,r[o]=i,s[o]=i,i==="\\"&&o+1<a&&(l=this.source.charAt(o+1),l==="A"?(t[o+1]="￿",n[o+1]="￿",r[o+1]="A",s[o+1]="A"):l==="G"?(t[o+1]="￿",n[o+1]="G",r[o+1]="￿",s[o+1]="G"):(t[o+1]=l,n[o+1]=l,r[o+1]=l,s[o+1]=l),o++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:r.join(""),A1_G1:s.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}},ve=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 on(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(s=>s.resolveAnchors(t,n));return new on(e,r,this._items.map(s=>s.ruleId))}},on=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const 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){const r=this.scanner.findNextMatchSync(e,t,n);return r?{ruleId:this.rules[r.index],captureIndices:r.captureIndices}:null}},ut=class{constructor(e,t){this.languageId=e,this.tokenType=t}},Is=class At{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new ut(t,8),this._embeddedLanguagesMatcher=new Rs(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?At._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new ut(0,0);_getBasicScopeAttributes=new Zn(t=>{const n=this._scopeToLanguage(t),r=this._toStandardTokenType(t);return new ut(n,r)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(At.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/},Rs=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,r])=>Qn(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},an=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function or(e,t,n,r,s,o,a,i){const l=t.content.length;let c=!1,u=-1;if(a){const f=Ns(e,t,n,r,s,o);s=f.stack,r=f.linePos,n=f.isFirstLine,u=f.anchorPosition}const h=Date.now();for(;!c;){if(i!==0&&Date.now()-h>i)return new an(s,!0);p()}return new an(s,!1);function p(){const f=Ls(e,t,n,r,s,u);if(!f){o.produce(s,l),c=!0;return}const d=f.captureIndices,b=f.matchedRuleId,w=d&&d.length>0?d[0].end>r:!1;if(b===xs){const m=s.getRule(e);o.produce(s,d[0].start),s=s.withContentNameScopesList(s.nameScopesList),we(e,t,n,s,o,m.endCaptures,d),o.produce(s,d[0].end);const y=s;if(s=s.parent,u=y.getAnchorPos(),!w&&y.getEnterPos()===r){s=y,o.produce(s,l),c=!0;return}}else{const m=e.getRule(b);o.produce(s,d[0].start);const y=s,C=m.getName(t.content,d),k=s.contentNameScopesList.pushAttributed(C,e);if(s=s.push(b,r,u,d[0].end===l,null,k,k),m instanceof Et){const v=m;we(e,t,n,s,o,v.beginCaptures,d),o.produce(s,d[0].end),u=d[0].end;const $=v.getContentName(t.content,d),M=k.pushAttributed($,e);if(s=s.withContentNameScopesList(M),v.endHasBackReferences&&(s=s.withEndRule(v.getEndWithResolvedBackReferences(t.content,d))),!w&&y.hasSameRuleAs(s)){s=s.pop(),o.produce(s,l),c=!0;return}}else if(m instanceof Ue){const v=m;we(e,t,n,s,o,v.beginCaptures,d),o.produce(s,d[0].end),u=d[0].end;const $=v.getContentName(t.content,d),M=k.pushAttributed($,e);if(s=s.withContentNameScopesList(M),v.whileHasBackReferences&&(s=s.withEndRule(v.getWhileWithResolvedBackReferences(t.content,d))),!w&&y.hasSameRuleAs(s)){s=s.pop(),o.produce(s,l),c=!0;return}}else if(we(e,t,n,s,o,m.captures,d),o.produce(s,d[0].end),s=s.pop(),!w){s=s.safePop(),o.produce(s,l),c=!0;return}}d[0].end>r&&(r=d[0].end,n=!1)}}function Ns(e,t,n,r,s,o){let a=s.beginRuleCapturedEOL?0:-1;const i=[];for(let l=s;l;l=l.pop()){const c=l.getRule(e);c instanceof Ue&&i.push({rule:c,stack:l})}for(let l=i.pop();l;l=i.pop()){const{ruleScanner:c,findOptions:u}=Ts(l.rule,e,l.stack.endRule,n,r===a),h=c.findNextMatchSync(t,r,u);if(h){if(h.ruleId!==nr){s=l.stack.pop();break}h.captureIndices&&h.captureIndices.length&&(o.produce(l.stack,h.captureIndices[0].start),we(e,t,n,l.stack,o,l.rule.whileCaptures,h.captureIndices),o.produce(l.stack,h.captureIndices[0].end),a=h.captureIndices[0].end,h.captureIndices[0].end>r&&(r=h.captureIndices[0].end,n=!1))}else{s=l.stack.pop();break}}return{stack:s,linePos:r,anchorPosition:a,isFirstLine:n}}function Ls(e,t,n,r,s,o){const a=$s(e,t,n,r,s,o),i=e.getInjections();if(i.length===0)return a;const l=Ps(i,e,t,n,r,s,o);if(!l)return a;if(!a)return l;const c=a.captureIndices[0].start,u=l.captureIndices[0].start;return u<c||l.priorityMatch&&u===c?l:a}function $s(e,t,n,r,s,o){const a=s.getRule(e),{ruleScanner:i,findOptions:l}=ar(a,e,s.endRule,n,r===o),c=i.findNextMatchSync(t,r,l);return c?{captureIndices:c.captureIndices,matchedRuleId:c.ruleId}:null}function Ps(e,t,n,r,s,o,a){let i=Number.MAX_VALUE,l=null,c,u=0;const h=o.contentNameScopesList.getScopeNames();for(let p=0,f=e.length;p<f;p++){const d=e[p];if(!d.matcher(h))continue;const b=t.getRule(d.ruleId),{ruleScanner:w,findOptions:m}=ar(b,t,null,r,s===a),y=w.findNextMatchSync(n,s,m);if(!y)continue;const C=y.captureIndices[0].start;if(!(C>=i)&&(i=C,l=y.captureIndices,c=y.ruleId,u=d.priority,i===s))break}return l?{priorityMatch:u===-1,captureIndices:l,matchedRuleId:c}:null}function ar(e,t,n,r,s){return{ruleScanner:e.compileAG(t,n,r,s),findOptions:0}}function Ts(e,t,n,r,s){return{ruleScanner:e.compileWhileAG(t,n,r,s),findOptions:0}}function we(e,t,n,r,s,o,a){if(o.length===0)return;const i=t.content,l=Math.min(o.length,a.length),c=[],u=a[0].end;for(let h=0;h<l;h++){const p=o[h];if(p===null)continue;const f=a[h];if(f.length===0)continue;if(f.start>u)break;for(;c.length>0&&c[c.length-1].endPos<=f.start;)s.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop();if(c.length>0?s.produceFromScopes(c[c.length-1].scopes,f.start):s.produce(r,f.start),p.retokenizeCapturedWithRuleId){const b=p.getName(i,a),w=r.contentNameScopesList.pushAttributed(b,e),m=p.getContentName(i,a),y=w.pushAttributed(m,e),C=r.push(p.retokenizeCapturedWithRuleId,f.start,-1,!1,null,w,y),k=e.createOnigString(i.substring(0,f.end));or(e,k,n&&f.start===0,f.start,C,s,!1,0),er(k);continue}const d=p.getName(i,a);if(d!==null){const w=(c.length>0?c[c.length-1].scopes:r.contentNameScopesList).pushAttributed(d,e);c.push(new Ms(w,f.end))}}for(;c.length>0;)s.produceFromScopes(c[c.length-1].scopes,c[c.length-1].endPos),c.pop()}var Ms=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function Os(e,t,n,r,s,o,a,i){return new Bs(e,t,n,r,s,o,a,i)}function ln(e,t,n,r,s){const o=Fe(t,We),a=rr.getCompiledRuleId(n,r,s.repository);for(const i of o)e.push({debugSelector:t,matcher:i.matcher,ruleId:a,grammar:s,priority:i.priority})}function We(e,t){if(t.length<e.length)return!1;let n=0;return e.every(r=>{for(let s=n;s<t.length;s++)if(Gs(t[s],r))return n=s+1,!0;return!1})}function Gs(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var Bs=class{constructor(e,t,n,r,s,o,a,i){if(this._rootScopeName=e,this.balancedBracketSelectors=o,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=cn(t,null),this._injections=null,this._tokenTypeMatchers=[],s)for(const l of Object.keys(s)){const c=Fe(l,We);for(const u of c)this._tokenTypeMatchers.push({matcher:u.matcher,type:s[l]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const 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(){const e={lookup:s=>s===this._rootScopeName?this._grammar:this.getExternalGrammar(s),injections:s=>this._grammarRepository.injections(s)},t=[],n=this._rootScopeName,r=e.lookup(n);if(r){const s=r.injections;if(s)for(let a in s)ln(t,a,s[a],this,r);const o=this._grammarRepository.injections(n);o&&o.forEach(a=>{const i=this.getExternalGrammar(a);if(i){const l=i.injectionSelector;l&&ln(t,l,i,this,i)}})}return t.sort((s,o)=>s.priority-o.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const 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){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=cn(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const 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){const 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=rr.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let s;if(!t||t===It.NULL){s=!0;const c=this._basicScopeAttributesProvider.getDefaultAttributes(),u=this.themeProvider.getDefaults(),h=se.set(0,c.languageId,c.tokenType,null,u.fontStyle,u.foregroundId,u.backgroundId),p=this.getRule(this._rootId).getName(null,null);let f;p?f=Ce.createRootAndLookUpScopeName(p,h,this):f=Ce.createRoot("unknown",h),t=new It(null,this._rootId,-1,-1,!1,null,f,f)}else s=!1,t.reset();e=e+`
3
+ `;const o=this.createOnigString(e),a=o.content.length,i=new Fs(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),l=or(this,o,s,0,t,i,!0,r);return er(o),{lineLength:a,lineTokens:i,ruleStack:l.stack,stoppedEarly:l.stoppedEarly}}};function cn(e,t){return e=rs(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 Ce=class H{constructor(t,n,r){this.parent=t,this.scopePath=n,this.tokenAttributes=r}static fromExtension(t,n){let r=t,s=t?.scopePath??null;for(const o of n)s=ct.push(s,o.scopeNames),r=new H(r,s,o.encodedTokenAttributes);return r}static createRoot(t,n){return new H(null,new ct(null,t),n)}static createRootAndLookUpScopeName(t,n,r){const s=r.getMetadataForScope(t),o=new ct(null,t),a=r.themeProvider.themeMatch(o),i=H.mergeAttributes(n,s,a);return new H(null,o,i)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return H.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 s=-1,o=0,a=0;return r!==null&&(s=r.fontStyle,o=r.foregroundId,a=r.backgroundId),se.set(t,n.languageId,n.tokenType,null,s,o,a)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return H._pushAttributed(this,t,n);const r=t.split(/ /g);let s=this;for(const o of r)s=H._pushAttributed(s,o,n);return s}static _pushAttributed(t,n,r){const s=r.getMetadataForScope(n),o=t.scopePath.push(n),a=r.themeProvider.themeMatch(o),i=H.mergeAttributes(t.tokenAttributes,s,a);return new H(t,o,i)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let 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}},It=class ee{constructor(t,n,r,s,o,a,i,l){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=o,this.endRule=a,this.nameScopesList=i,this.contentNameScopesList=l,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=r,this._anchorPos=s}_stackElementBrand=void 0;static NULL=new ee(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:ee._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Ce.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(){ee._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,r,s,o,a,i){return new ee(this,t,n,r,s,o,a,i)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const 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 ee(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){const r=Ce.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new ee(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,r,Ce.fromExtension(r,n.contentNameScopesList))}},Ds=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):Fe(n,We).map(r=>r.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>Fe(n,We).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(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},Fs=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}_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,s=!1;if(this.balancedBracketSelectors?.matchesAlways&&(s=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const o=e?.getScopeNames()??[];for(const a of this._tokenTypeOverrides)a.matcher(o)&&(r=se.set(r,0,a.type,null,-1,0,0));this.balancedBracketSelectors&&(s=this.balancedBracketSelectors.match(o))}if(s&&(r=se.set(r,0,8,s,-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}const 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);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,s=this._binaryTokens.length;r<s;r++)n[r]=this._binaryTokens[r];return n}},js=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const 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,s){if(!this._grammars.has(e)){let o=this._rawGrammars.get(e);if(!o)return null;this._grammars.set(e,Os(e,o,t,n,r,s,this,this._onigLib))}return this._grammars.get(e)}},Us=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new js(De.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(De.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,r){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:r})}loadGrammarWithConfiguration(t,n,r){return this._loadGrammar(t,n,r.embeddedLanguages,r.tokenTypes,new Ds(r.balancedBracketSelectors||[],r.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,r,s,o){const a=new ys(this._syncRegistry,t);for(;a.Q.length>0;)a.Q.map(i=>this._loadSingleGrammar(i.scopeName)),a.processQueue();return this._grammarForScopeName(t,n,r,s,o)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const r=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,r)}}addGrammar(t,n=[],r=0,s=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,r,s)}_grammarForScopeName(t,n=0,r=null,s=null,o=null){return this._syncRegistry.grammarForScopeName(t,n,r,s,o)}},Rt=It.NULL;function ze(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},r=typeof e=="string"?e:e.name;for(const[s,o]of Object.entries(t?.colorReplacements||{}))typeof o=="string"?n[s]=o:s===r&&Object.assign(n,o);return n}function Y(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function Ws(e){return Array.isArray(e)?e:[e]}async function ir(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function Qe(e){return!e||["plaintext","txt","text","plain"].includes(e)}function zs(e){return e==="ansi"||Qe(e)}function Ze(e){return e==="none"}function Hs(e){return Ze(e)}const qs=/(\r?\n)/g;function Ye(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(qs);let r=0;const s=[];for(let o=0;o<n.length;o+=2){const a=t?n[o]+(n[o+1]||""):n[o];s.push([a,r]),r+=n[o].length,r+=n[o+1]?.length||0}return s}const un={light:"#333333",dark:"#bbbbbb"},hn={light:"#fffffe",dark:"#1e1e1e"},pn="__shiki_resolved";function Wt(e){if(e?.[pn])return e;const 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){const 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"?un.light:un.dark),n||(n=t.type==="light"?hn.light:hn.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 s=0;const o=new Map;function a(i){if(o.has(i))return o.get(i);s+=1;const l=`#${s.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${l}`]?a(i):(o.set(i,l),l)}t.settings=t.settings.map(i=>{const l=i.settings?.foreground&&!i.settings.foreground.startsWith("#"),c=i.settings?.background&&!i.settings.background.startsWith("#");if(!l&&!c)return i;const u={...i,settings:{...i.settings}};if(l){const h=a(i.settings.foreground);t.colorReplacements[h]=i.settings.foreground,u.settings.foreground=h}if(c){const h=a(i.settings.background);t.colorReplacements[h]=i.settings.background,u.settings.background=h}return u});for(const i of Object.keys(t.colors||{}))if((i==="editor.foreground"||i==="editor.background"||i.startsWith("terminal.ansi"))&&!t.colors[i]?.startsWith("#")){const l=a(t.colors[i]);t.colorReplacements[l]=t.colors[i],t.colors[i]=l}return Object.defineProperty(t,pn,{enumerable:!1,writable:!1,value:!0}),t}async function lr(e){return[...new Set((await Promise.all(e.filter(t=>!zs(t)).map(async t=>await ir(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function cr(e){return(await Promise.all(e.map(async t=>Hs(t)?null:Wt(await ir(t))))).filter(t=>!!t)}function ur(e,t){if(!t)return e;if(t[e]){const 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 Vs=class extends Us{_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(s=>this.loadTheme(s)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=Wt(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=De.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=ur(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(s=>s.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const r=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(r.name=e.name,this._resolvedGrammars.set(e.name,r),e.aliases&&e.aliases.forEach(s=>{this._alias[s]=e.name}),this._loadedLanguagesCache=null,t.size)for(const s of t)this._resolvedGrammars.delete(s.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(s.scopeName),this._syncRegistry?._grammars?.delete(s.scopeName),this.loadLanguage(this._langMap.get(s.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const r of e)this.resolveEmbeddedLanguages(r);const t=[...this._langGraph.entries()],n=t.filter(([r,s])=>!s);if(n.length){const r=t.filter(([s,o])=>o?(o.embeddedLanguages||o.embeddedLangs)?.some(a=>n.map(([i])=>i).includes(a)):!1).filter(s=>!n.includes(s));throw new E(`Missing languages ${n.map(([s])=>`\`${s}\``).join(", ")}, required by ${r.map(([s])=>`\`${s}\``).join(", ")}`)}for(const[r,s]of t)this._resolver.addLanguage(s);for(const[r,s]of t)this.loadLanguage(s)}getLoadedLanguages(){return this._loadedLanguagesCache||(this._loadedLanguagesCache=[...new Set([...this._resolvedGrammars.keys(),...Object.keys(this._alias)])]),this._loadedLanguagesCache}resolveEmbeddedLanguages(e){this._langMap.set(e.name,e),this._langGraph.set(e.name,e);const t=e.embeddedLanguages??e.embeddedLangs;if(t)for(const n of t)this._langGraph.set(n,this._langMap.get(n))}},Xs=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).push(e.scopeName)})}getInjections(e){const t=e.split(".");let n=[];for(let r=1;r<=t.length;r++){const s=t.slice(0,r).join(".");n=[...n,...this._injections.get(s)||[]]}return n}};let be=0;function Ks(e){be+=1,e.warnings!==!1&&be>=10&&be%10===0&&console.warn(`[Shiki] ${be} 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");const n=(e.langs||[]).flat(1),r=(e.themes||[]).flat(1).map(Wt),s=new Vs(new Xs(e.engine,n),r,n,e.langAlias);let o;function a(y){return ur(y,e.langAlias)}function i(y){w();const C=s.getGrammar(typeof y=="string"?y:y.name);if(!C)throw new E(`Language \`${y}\` not found, you may need to load it first`);return C}function l(y){if(y==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};w();const C=s.getTheme(y);if(!C)throw new E(`Theme \`${y}\` not found, you may need to load it first`);return C}function c(y){w();const C=l(y);return o!==y&&(s.setTheme(C),o=y),{theme:C,colorMap:s.getColorMap()}}function u(){return w(),s.getLoadedThemes()}function h(){return w(),s.getLoadedLanguages()}function p(...y){w(),s.loadLanguages(y.flat(1))}async function f(...y){return p(await lr(y))}function d(...y){w();for(const C of y.flat(1))s.loadTheme(C)}async function b(...y){return w(),d(await cr(y))}function w(){if(t)throw new E("Shiki instance has been disposed")}function m(){t||(t=!0,s.dispose(),be-=1)}return{setTheme:c,getTheme:l,getLanguage:i,getLoadedThemes:u,getLoadedLanguages:h,resolveLangAlias:a,loadLanguage:f,loadLanguageSync:p,loadTheme:b,loadThemeSync:d,dispose:m,[Symbol.dispose]:m}}async function Qs(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,r]=await Promise.all([cr(e.themes||[]),lr(e.langs||[]),e.engine]);return Ks({...e,themes:t,langs:n,engine:r})}const hr=new WeakMap;function Je(e,t){hr.set(e,t)}function xe(e){return hr.get(e)}var et=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(Ws(n).map(r=>[r,Rt])),t)}constructor(...t){if(t.length===2){const[n,r]=t;this.lang=r,this._stacks=n}else{const[n,r,s]=t;this.lang=r,this._stacks={[s]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return Zs(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function Zs(e){const t=[],n=new Set;function r(s){if(n.has(s))return;n.add(s);const o=s?.nameScopesList?.scopeName;o&&t.push(o),s.parent&&r(s.parent)}return r(e),t}function Ys(e,t){if(!(e instanceof et))throw new E("Invalid grammar state");return e.getInternalStack(t)}const Js=/,/,eo=/ /;function fr(e,t,n={}){const{theme:r=e.getLoadedThemes()[0]}=n;if(Qe(e.resolveLangAlias(n.lang||"text"))||Ze(r))return Ye(t).map(i=>[{content:i[0],offset:i[1]}]);const{theme:s,colorMap:o}=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(s.name))throw new E(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${s.name}"`)}return no(t,a,s,o,n)}function to(...e){if(e.length===2)return xe(e[1]);const[t,n,r={}]=e,{lang:s="text",theme:o=t.getLoadedThemes()[0]}=r;if(Qe(s)||Ze(o))throw new E("Plain language does not have grammar state");if(s==="ansi")throw new E("ANSI language does not have grammar state");const{theme:a,colorMap:i}=t.setTheme(o),l=t.getLanguage(s);return new et(zt(n,l,a,i,r).stateStack,l.name,a.name)}function no(e,t,n,r,s){const o=zt(e,t,n,r,s),a=new et(o.stateStack,t.name,n.name);return Je(o.tokens,a),o.tokens}function zt(e,t,n,r,s){const o=ze(n,s),{tokenizeMaxLineLength:a=0,tokenizeTimeLimit:i=500,includeExplanation:l=!1}=s,c=Ye(e);let u=s.grammarState?Ys(s.grammarState,n.name)??Rt:s.grammarContextCode!=null?zt(s.grammarContextCode,t,n,r,{...s,grammarState:void 0,grammarContextCode:void 0}).stateStack:Rt,h=[];const p=[];for(let f=0,d=c.length;f<d;f++){const[b,w]=c[f];if(b===""){h=[],p.push([]);continue}if(a>0&&b.length>=a){h=[],p.push([{content:b,offset:w,color:"",fontStyle:0}]);continue}let m,y,C;l&&l!=="tokenType"&&(m=t.tokenizeLine(b,u,i),y=m.tokens,C=0);const k=t.tokenizeLine2(b,u,i),v=k.tokens.length/2;for(let $=0;$<v;$++){const M=k.tokens[2*$],W=$+1<v?k.tokens[2*$+2]:b.length;if(M===W)continue;const le=k.tokens[2*$+1],ot=Y(r[se.getForeground(le)],o),at=se.getFontStyle(le),z={content:b.substring(M,W),offset:w+M,color:ot,fontStyle:at};if(l==="tokenType")z.type=se.getTokenType(le);else if(l){const Jt=[];if(l!=="scopeName")for(const q of n.settings){let ce;switch(typeof q.scope){case"string":ce=q.scope.split(Js).map(it=>it.trim());break;case"object":ce=q.scope;break;default:continue}Jt.push({settings:q,selectors:ce.map(it=>it.split(eo))})}z.explanation=[];let en=0;for(;M+en<W;){const q=y[C],ce=b.substring(q.startIndex,q.endIndex);en+=ce.length,z.explanation.push({content:ce,scopes:l==="scopeName"?ro(q.scopes):so(Jt,q.scopes)}),C+=1}}h.push(z)}p.push(h),h=[],u=k.ruleStack}return{tokens:p,stateStack:u}}function ro(e){return e.map(t=>({scopeName:t}))}function so(e,t){const n=[];for(let r=0,s=t.length;r<s;r++){const o=t[r];n[r]={scopeName:o,themeMatches:ao(e,o,t.slice(0,r))}}return n}function fn(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function oo(e,t,n){if(!fn(e.at(-1),t))return!1;let r=e.length-2,s=n.length-1;for(;r>=0&&s>=0;)fn(e[r],n[s])&&(r-=1),s-=1;return r===-1}function ao(e,t,n){const r=[];for(const{selectors:s,settings:o}of e)for(const a of s)if(oo(a,t,n)){r.push(o);break}return r}function dr(e,t,n,r=fr){const s=Object.entries(n.themes).filter(c=>c[1]).map(c=>({color:c[0],theme:c[1]})),o=s.map(c=>{const u=r(e,t,{...n,theme:c.theme});return{tokens:u,state:xe(u),theme:typeof c.theme=="string"?c.theme:c.theme.name}}),a=io(...o.map(c=>c.tokens)),i=a[0].map((c,u)=>c.map((h,p)=>{const f={content:h.content,variants:{},offset:h.offset};return"includeExplanation"in n&&n.includeExplanation&&(f.explanation=h.explanation),a.forEach((d,b)=>{const{content:w,explanation:m,offset:y,...C}=d[u][p];f.variants[s[b].color]=C}),f})),l=o[0].state?new et(Object.fromEntries(o.map(c=>[c.theme,c.state?.getInternalStack(c.theme)])),o[0].state.lang):void 0;return l&&Je(i,l),i}function io(...e){const t=e.map(()=>[]),n=e.length;for(let r=0;r<e[0].length;r++){const s=e.map(l=>l[r]),o=t.map(()=>[]);t.forEach((l,c)=>l.push(o[c]));const a=s.map(()=>0),i=s.map(l=>l[0]);for(;i.every(l=>l);){const l=Math.min(...i.map(c=>c.content.length));for(let c=0;c<n;c++){const u=i[c];u.content.length===l?(o[c].push(u),a[c]+=1,i[c]=s[c][a[c]]):(o[c].push({...u,content:u.content.slice(0,l)}),i[c]={...u,content:u.content.slice(l),offset:u.offset+l})}}}return t}const lo=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class Ie{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ie.prototype.normal={};Ie.prototype.property={};Ie.prototype.space=void 0;function gr(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new Ie(n,r,t)}function Nt(e){return e.toLowerCase()}class O{constructor(t,n){this.attribute=n,this.property=t}}O.prototype.attribute="";O.prototype.booleanish=!1;O.prototype.boolean=!1;O.prototype.commaOrSpaceSeparated=!1;O.prototype.commaSeparated=!1;O.prototype.defined=!1;O.prototype.mustUseProperty=!1;O.prototype.number=!1;O.prototype.overloadedBoolean=!1;O.prototype.property="";O.prototype.spaceSeparated=!1;O.prototype.space=void 0;let co=0;const _=ie(),I=ie(),Lt=ie(),g=ie(),x=ie(),oe=ie(),G=ie();function ie(){return 2**++co}var $t=Object.freeze({__proto__:null,boolean:_,booleanish:I,commaOrSpaceSeparated:G,commaSeparated:oe,number:g,overloadedBoolean:Lt,spaceSeparated:x});const ht=Object.keys($t);class Ht extends O{constructor(t,n,r,s){let o=-1;if(super(t,n),dn(this,"space",s),typeof r=="number")for(;++o<ht.length;){const a=ht[o];dn(this,ht[o],(r&$t[a])===$t[a])}}}Ht.prototype.defined=!0;function dn(e,t,n){n&&(e[t]=n)}function ge(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const o=new Ht(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Nt(r)]=r,n[Nt(o.attribute)]=r}return new Ie(t,n,e.space)}const mr=ge({properties:{ariaActiveDescendant:null,ariaAtomic:I,ariaAutoComplete:null,ariaBusy:I,ariaChecked:I,ariaColCount:g,ariaColIndex:g,ariaColSpan:g,ariaControls:x,ariaCurrent:null,ariaDescribedBy:x,ariaDetails:null,ariaDisabled:I,ariaDropEffect:x,ariaErrorMessage:null,ariaExpanded:I,ariaFlowTo:x,ariaGrabbed:I,ariaHasPopup:null,ariaHidden:I,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:x,ariaLevel:g,ariaLive:null,ariaModal:I,ariaMultiLine:I,ariaMultiSelectable:I,ariaOrientation:null,ariaOwns:x,ariaPlaceholder:null,ariaPosInSet:g,ariaPressed:I,ariaReadOnly:I,ariaRelevant:null,ariaRequired:I,ariaRoleDescription:x,ariaRowCount:g,ariaRowIndex:g,ariaRowSpan:g,ariaSelected:I,ariaSetSize:g,ariaSort:null,ariaValueMax:g,ariaValueMin:g,ariaValueNow:g,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function yr(e,t){return t in e?e[t]:t}function br(e,t){return yr(e,t.toLowerCase())}const uo=ge({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:oe,acceptCharset:x,accessKey:x,action:null,allow:null,allowFullScreen:_,allowPaymentRequest:_,allowUserMedia:_,alpha:_,alt:null,as:null,async:_,autoCapitalize:null,autoComplete:x,autoFocus:_,autoPlay:_,blocking:x,capture:null,charSet:null,checked:_,cite:null,className:x,closedBy:null,colorSpace:null,cols:g,colSpan:g,command:null,commandFor:null,content:null,contentEditable:I,controls:_,controlsList:x,coords:g|oe,crossOrigin:null,data:null,dateTime:null,decoding:null,default:_,defer:_,dir:null,dirName:null,disabled:_,download:Lt,draggable:I,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:_,formTarget:null,headers:x,height:g,hidden:Lt,high:g,href:null,hrefLang:null,htmlFor:x,httpEquiv:x,id:null,imageSizes:null,imageSrcSet:null,inert:_,inputMode:null,integrity:null,is:null,isMap:_,itemId:null,itemProp:x,itemRef:x,itemScope:_,itemType:x,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:_,low:g,manifest:null,max:null,maxLength:g,media:null,method:null,min:null,minLength:g,multiple:_,muted:_,name:null,nonce:null,noModule:_,noValidate:_,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:_,optimum:g,pattern:null,ping:x,placeholder:null,playsInline:_,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:_,referrerPolicy:null,rel:x,required:_,reversed:_,rows:g,rowSpan:g,sandbox:x,scope:null,scoped:_,seamless:_,selected:_,shadowRootClonable:_,shadowRootCustomElementRegistry:_,shadowRootDelegatesFocus:_,shadowRootMode:null,shadowRootSerializable:_,shape:null,size:g,sizes:null,slot:null,span:g,spellCheck:I,src:null,srcDoc:null,srcLang:null,srcSet:null,start:g,step:null,style:null,tabIndex:g,target:null,title:null,translate:null,type:null,typeMustMatch:_,useMap:null,value:I,width:g,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:x,axis:null,background:null,bgColor:null,border:g,borderColor:null,bottomMargin:g,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:_,declare:_,event:null,face:null,frame:null,frameBorder:null,hSpace:g,leftMargin:g,link:null,longDesc:null,lowSrc:null,marginHeight:g,marginWidth:g,noResize:_,noHref:_,noShade:_,noWrap:_,object:null,profile:null,prompt:null,rev:null,rightMargin:g,rules:null,scheme:null,scrolling:I,standby:null,summary:null,text:null,topMargin:g,valueType:null,version:null,vAlign:null,vLink:null,vSpace:g,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:_,disablePictureInPicture:_,disableRemotePlayback:_,exportParts:oe,part:x,prefix:null,property:null,results:g,security:null,unselectable:null},space:"html",transform:br}),ho=ge({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:g,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:g,amplitude:g,arabicForm:null,ascent:g,attributeName:null,attributeType:null,azimuth:g,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:g,by:null,calcMode:null,capHeight:g,className:x,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:g,diffuseConstant:g,direction:null,display:null,dur:null,divisor:g,dominantBaseline:null,download:_,dx:null,dy:null,edgeMode:null,editable:null,elevation:g,enableBackground:null,end:null,event:null,exponent:g,externalResourcesRequired:null,fill:null,fillOpacity:g,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:oe,g2:oe,glyphName:oe,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:g,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:g,horizOriginX:g,horizOriginY:g,id:null,ideographic:g,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:g,k:g,k1:g,k2:g,k3:g,k4:g,kernelMatrix:G,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:g,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:g,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:g,overlineThickness:g,paintOrder:null,panose1:null,path:null,pathLength:g,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:x,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:g,pointsAtY:g,pointsAtZ:g,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:g,specularExponent:g,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:g,strikethroughThickness:g,string:null,stroke:null,strokeDashArray:G,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:g,strokeOpacity:g,strokeWidth:null,style:null,surfaceScale:g,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:G,tabIndex:g,tableValues:null,target:null,targetX:g,targetY:g,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:g,underlineThickness:g,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:g,values:null,vAlphabetic:g,vMathematical:g,vectorEffect:null,vHanging:g,vIdeographic:g,version:null,vertAdvY:g,vertOriginX:g,vertOriginY:g,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:g,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:yr}),wr=ge({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()}}),Cr=ge({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:br}),_r=ge({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),po=/[A-Z]/g,gn=/-[a-z]/g,fo=/^data[-\w.:]+$/i;function go(e,t){const n=Nt(t);let r=t,s=O;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&fo.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(gn,yo);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!gn.test(o)){let a=o.replace(po,mo);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}s=Ht}return new s(r,t)}function mo(e){return"-"+e.toLowerCase()}function yo(e){return e.charAt(1).toUpperCase()}const bo=gr([mr,uo,wr,Cr,_r],"html"),Sr=gr([mr,ho,wr,Cr,_r],"svg"),mn={}.hasOwnProperty;function wo(e,t){const n=t||{};function r(s,...o){let a=r.invalid;const i=r.handlers;if(s&&mn.call(s,e)){const l=String(s[e]);a=mn.call(i,l)?i[l]:r.unknown}if(a)return a.call(this,s,...o)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}const Co=/["&'<>`]/g,_o=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,So=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,ko=/[|\\{}()[\]^$+*?.]/g,yn=new WeakMap;function vo(e,t){if(e=e.replace(t.subset?xo(t.subset):Co,r),t.subset||t.escapeOnly)return e;return e.replace(_o,n).replace(So,r);function n(s,o,a){return t.format((s.charCodeAt(0)-55296)*1024+s.charCodeAt(1)-56320+65536,a.charCodeAt(o+2),t)}function r(s,o,a){return t.format(s.charCodeAt(0),a.charCodeAt(o+1),t)}}function xo(e){let t=yn.get(e);return t||(t=Eo(e),yn.set(e,t)),t}function Eo(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(ko,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const Ao=/[\dA-Fa-f]/;function Io(e,t,n){const r="&#x"+e.toString(16).toUpperCase();return n&&t&&!Ao.test(String.fromCharCode(t))?r:r+";"}const Ro=/\d/;function No(e,t,n){const r="&#"+String(e);return n&&t&&!Ro.test(String.fromCharCode(t))?r:r+";"}const Lo=["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"],pt={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},$o=["cent","copy","divide","gt","lt","not","para","times"],kr={}.hasOwnProperty,Pt={};let Le;for(Le in pt)kr.call(pt,Le)&&(Pt[pt[Le]]=Le);const Po=/[^\dA-Za-z]/;function To(e,t,n,r){const s=String.fromCharCode(e);if(kr.call(Pt,s)){const o=Pt[s],a="&"+o;return n&&Lo.includes(o)&&!$o.includes(o)&&(!r||t&&t!==61&&Po.test(String.fromCharCode(t)))?a:a+";"}return""}function Mo(e,t,n){let r=Io(e,t,n.omitOptionalSemicolons),s;if((n.useNamedReferences||n.useShortestReferences)&&(s=To(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!s)&&n.useShortestReferences){const o=No(e,t,n.omitOptionalSemicolons);o.length<r.length&&(r=o)}return s&&(!n.useShortestReferences||s.length<r.length)?s:r}function de(e,t){return vo(e,Object.assign({format:Mo},t))}const Oo=/^>|^->|<!--|-->|--!>|<!-$/g,Go=[">"],Bo=["<",">"];function Do(e,t,n,r){return r.settings.bogusComments?"<?"+de(e.value,Object.assign({},r.settings.characterReferences,{subset:Go}))+">":"<!--"+e.value.replace(Oo,s)+"-->";function s(o){return de(o,Object.assign({},r.settings.characterReferences,{subset:Bo}))}}function Fo(e,t,n,r){return"<!"+(r.settings.upperDoctype?"DOCTYPE":"doctype")+(r.settings.tightDoctype?"":" ")+"html>"}function bn(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}function jo(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function Uo(e){return e.join(" ").trim()}const Wo=/[ \t\n\f\r]/g;function qt(e){return typeof e=="object"?e.type==="text"?wn(e.value):!1:wn(e)}function wn(e){return e.replace(Wo,"")===""}const N=xr(1),vr=xr(-1),zo=[];function xr(e){return t;function t(n,r,s){const o=n?n.children:zo;let a=(r||0)+e,i=o[a];if(!s)for(;i&&qt(i);)a+=e,i=o[a];return i}}const Ho={}.hasOwnProperty;function Er(e){return t;function t(n,r,s){return Ho.call(e,n.tagName)&&e[n.tagName](n,r,s)}}const Vt=Er({body:Vo,caption:ft,colgroup:ft,dd:Zo,dt:Qo,head:ft,html:qo,li:Ko,optgroup:Yo,option:Jo,p:Xo,rp:Cn,rt:Cn,tbody:ta,td:_n,tfoot:na,th:_n,thead:ea,tr:ra});function ft(e,t,n){const r=N(n,t,!0);return!r||r.type!=="comment"&&!(r.type==="text"&&qt(r.value.charAt(0)))}function qo(e,t,n){const r=N(n,t);return!r||r.type!=="comment"}function Vo(e,t,n){const r=N(n,t);return!r||r.type!=="comment"}function Xo(e,t,n){const r=N(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"))}function Ko(e,t,n){const r=N(n,t);return!r||r.type==="element"&&r.tagName==="li"}function Qo(e,t,n){const r=N(n,t);return!!(r&&r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd"))}function Zo(e,t,n){const r=N(n,t);return!r||r.type==="element"&&(r.tagName==="dt"||r.tagName==="dd")}function Cn(e,t,n){const r=N(n,t);return!r||r.type==="element"&&(r.tagName==="rp"||r.tagName==="rt")}function Yo(e,t,n){const r=N(n,t);return!r||r.type==="element"&&r.tagName==="optgroup"}function Jo(e,t,n){const r=N(n,t);return!r||r.type==="element"&&(r.tagName==="option"||r.tagName==="optgroup")}function ea(e,t,n){const r=N(n,t);return!!(r&&r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot"))}function ta(e,t,n){const r=N(n,t);return!r||r.type==="element"&&(r.tagName==="tbody"||r.tagName==="tfoot")}function na(e,t,n){return!N(n,t)}function ra(e,t,n){const r=N(n,t);return!r||r.type==="element"&&r.tagName==="tr"}function _n(e,t,n){const r=N(n,t);return!r||r.type==="element"&&(r.tagName==="td"||r.tagName==="th")}const sa=Er({body:ia,colgroup:la,head:aa,html:oa,tbody:ca});function oa(e){const t=N(e,-1);return!t||t.type!=="comment"}function aa(e){const t=new Set;for(const 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)}const n=e.children[0];return!n||n.type==="element"}function ia(e){const t=N(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&qt(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function la(e,t,n){const r=vr(n,t),s=N(e,-1,!0);return n&&r&&r.type==="element"&&r.tagName==="colgroup"&&Vt(r,n.children.indexOf(r),n)?!1:!!(s&&s.type==="element"&&s.tagName==="col")}function ca(e,t,n){const r=vr(n,t),s=N(e,-1);return n&&r&&r.type==="element"&&(r.tagName==="thead"||r.tagName==="tbody")&&Vt(r,n.children.indexOf(r),n)?!1:!!(s&&s.type==="element"&&s.tagName==="tr")}const $e={name:[[`
4
4
  \f\r &/=>`.split(""),`
5
5
  \f\r "&'/=>\``.split("")],[`\0
6
6
  \f\r "&'/<=>`.split(""),`\0
@@ -8,7 +8,7 @@ var A=class extends Error{constructor(e){super(e),this.name="ShikiError"}};funct
8
8
  \f\r &>`.split(""),`\0
9
9
  \f\r "&'<=>\``.split("")],[`\0
10
10
  \f\r "&'<=>\``.split(""),`\0
11
- \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function ua(e,t,n,r){const s=r.schema,o=s.space==="svg"?!1:r.settings.omitOptionalTags;let a=s.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const i=[];let l;s.space==="html"&&e.tagName==="svg"&&(r.schema=Sr);const c=ha(r,e.properties),u=r.all(s.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=s,u&&(a=!1),(c||!o||!sa(e,t,n))&&(i.push("<",e.tagName,c?" "+c:""),a&&(s.space==="svg"||r.settings.closeSelfClosing)&&(l=c.charAt(c.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&i.push(" "),i.push("/")),i.push(">")),i.push(u),!a&&(!o||!Vt(e,t,n))&&i.push("</"+e.tagName+">"),i.join("")}function ha(e,t){const n=[];let r=-1,s;if(t){for(s in t)if(t[s]!==null&&t[s]!==void 0){const o=pa(e,s,t[s]);o&&n.push(o)}}for(;++r<n.length;){const o=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&o!=='"'&&o!=="'"&&(n[r]+=" ")}return n.join("")}function pa(e,t,n){const r=go(e.schema,t),s=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,o=e.settings.allowDangerousCharacters?0:1;let a=e.quote,i;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const l=de(r.attribute,Object.assign({},e.settings.characterReferences,{subset:$e.name[s][o]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?jo:Uo)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?l:(e.settings.preferUnquoted&&(i=de(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:$e.unquoted[s][o]}))),i!==n&&(e.settings.quoteSmart&&bn(n,a)>bn(n,e.alternative)&&(a=e.alternative),i=a+de(n,Object.assign({},e.settings.characterReferences,{subset:(a==="'"?$e.single:$e.double)[s][o],attribute:!0}))+a),l+(i&&"="+i))}const fa=["<","&"];function Er(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:de(e.value,Object.assign({},r.settings.characterReferences,{subset:fa}))}function da(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Er(e,t,n,r)}function ga(e,t,n,r){return r.all(e)}const ma=wo("type",{invalid:ya,unknown:ba,handlers:{comment:Do,doctype:Fo,element:ua,raw:da,root:ga,text:Er}});function ya(e){throw new Error("Expected node, not `"+e+"`")}function ba(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const wa={},Ca={},_a=[];function Sa(e,t){const n=t||wa,r=n.quote||'"',s=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:ka,all:va,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||lo,characterReferences:n.characterReferences||Ca,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?Sr:bo,quote:r,alternative:s}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function ka(e,t,n){return ma(e,t,n,this)}function va(e){const t=[],n=e&&e.children||_a;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}const Sn=/\s+/g;function Ir(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(Sn)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(Sn);for(const r of n)r&&!e.properties.class.includes(r)&&e.properties.class.push(r);return e}function xa(e){const t=Ye(e,!0).map(([s])=>s);function n(s){if(s===e.length)return{line:t.length-1,character:t.at(-1).length};let o=s,a=0;for(const i of t){if(o<i.length)break;o-=i.length,a++}return{line:a,character:o}}function r(s,o){let a=0;for(let i=0;i<s;i++)a+=t[i].length;return a+=o,a}return{lines:t,indexToPos:n,posToIndex:r}}const Aa=["color","background-color"];function Ea(e,t){let n=0;const r=[];for(const s of t)s>n&&r.push({...e,content:e.content.slice(n,s),offset:e.offset+n}),n=s;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function Ia(e,t){const n=[...t instanceof Set?t:new Set(t)].sort((r,s)=>r-s);return n.length?e.map(r=>r.flatMap(s=>{const o=n.filter(a=>s.offset<a&&a<s.offset+s.content.length).map(a=>a-s.offset).sort((a,i)=>a-i);return o.length?Ea(s,o):s})):e}function Ra(e,t,n,r,s="css-vars"){const o={content:e.content,explanation:e.explanation,offset:e.offset},a=t.map(u=>He(e.variants[u])),i=new Set(a.flatMap(u=>Object.keys(u))),l={},c=(u,h)=>{const p=h==="color"?"":h==="background-color"?"-bg":`-${h}`;return n+t[u]+(h==="color"?"":p)};return a.forEach((u,h)=>{for(const p of i){const f=u[p]||"inherit";if(h===0&&r&&Aa.includes(p))if(r==="light-dark()"&&a.length>1){const d=t.findIndex(w=>w==="light"),b=t.findIndex(w=>w==="dark");if(d===-1||b===-1)throw new A('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');l[p]=`light-dark(${a[d][p]||"inherit"}, ${a[b][p]||"inherit"})`,s==="css-vars"&&(l[c(h,p)]=f)}else l[p]=f;else s==="css-vars"&&(l[c(h,p)]=f)}}),o.htmlStyle=l,o}function He(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&T.Italic&&(t["font-style"]="italic"),e.fontStyle&T.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&T.Underline&&n.push("underline"),e.fontStyle&T.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function Tt(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}function Na(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let o=function(i){if(typeof i=="number"){if(i<0||i>n.source.length)throw new A(`Invalid decoration offset: ${i}. Code length: ${n.source.length}`);return{...s.indexToPos(i),offset:i}}else{const l=s.lines[i.line];if(l===void 0)throw new A(`Invalid decoration position ${JSON.stringify(i)}. Lines length: ${s.lines.length}`);let c=i.character;if(c<0&&(c=l.length+c),c<0||c>l.length)throw new A(`Invalid decoration position ${JSON.stringify(i)}. Line ${i.line} length: ${l.length}`);return{...i,character:c,offset:s.posToIndex(i.line,c)}}};var r=o;const s=xa(n.source),a=(n.options.decorations||[]).map(i=>({...i,start:o(i.start),end:o(i.end)}));La(a),e.set(n.meta,{decorations:a,converter:s,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(this.options.decorations?.length)return Ia(n,t(this).decorations.flatMap(r=>[r.start.offset,r.end.offset]))},code(n){if(!this.options.decorations?.length)return;const r=t(this),s=[...n.children].filter(u=>u.type==="element"&&u.tagName==="span");if(s.length!==r.converter.lines.length)throw new A(`Number of lines in code element (${s.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function o(u,h,p,f){const d=s[u];let b="",w=-1,m=-1;if(h===0&&(w=0),p===0&&(m=0),p===Number.POSITIVE_INFINITY&&(m=d.children.length),w===-1||m===-1)for(let C=0;C<d.children.length;C++)b+=Rr(d.children[C]),w===-1&&b.length===h&&(w=C+1),m===-1&&b.length===p&&(m=C+1);if(w===-1)throw new A(`Failed to find start index for decoration ${JSON.stringify(f.start)}`);if(m===-1)throw new A(`Failed to find end index for decoration ${JSON.stringify(f.end)}`);const y=d.children.slice(w,m);if(!f.alwaysWrap&&y.length===d.children.length)i(d,f,"line");else if(!f.alwaysWrap&&y.length===1&&y[0].type==="element")i(y[0],f,"token");else{const C={type:"element",tagName:"span",properties:{},children:y};i(C,f,"wrapper"),d.children.splice(w,y.length,C)}}function a(u,h){s[u]=i(s[u],h,"line")}function i(u,h,p){const f=h.properties||{},d=h.transform||(b=>b);return u.tagName=h.tagName||"span",u.properties={...u.properties,...f,class:u.properties.class},h.properties?.class&&Ir(u,h.properties.class),u=d(u,p)||u,u}const l=[],c=r.decorations.sort((u,h)=>h.start.offset-u.start.offset||u.end.offset-h.end.offset);for(const u of c){const{start:h,end:p}=u;if(h.line===p.line)o(h.line,h.character,p.character,u);else if(h.line<p.line){o(h.line,h.character,Number.POSITIVE_INFINITY,u);for(let f=h.line+1;f<p.line;f++)l.unshift(()=>a(f,u));o(p.line,0,p.character,u)}}l.forEach(u=>u())}}}function La(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new A(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let r=t+1;r<e.length;r++){const s=e[r],o=n.start.offset<=s.start.offset&&s.start.offset<n.end.offset,a=n.start.offset<s.end.offset&&s.end.offset<=n.end.offset,i=s.start.offset<=n.start.offset&&n.start.offset<s.end.offset,l=s.start.offset<n.end.offset&&n.end.offset<=s.end.offset;if(o||a||i||l){if(o&&a||i&&l||i&&n.start.offset===n.end.offset||a&&s.start.offset===s.end.offset)continue;throw new A(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(s.start)} intersect.`)}}}}function Rr(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(Rr).join(""):""}const $a=[Na()];function qe(e){const t=Pa(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...$a]}function Pa(e){const t=[],n=[],r=[];for(const s of e)switch(s.enforce){case"pre":t.push(s);break;case"post":n.push(s);break;default:r.push(s)}return{pre:t,post:n,normal:r}}var ne=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],dt={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function Ta(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const 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 kn(e){const t=e.shift();if(t==="2"){const 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"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function Ma(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:"resetAll"});else if(r<=9)dt[r]&&t.push({type:"setDecoration",value:dt[r]});else if(r<=29){const s=dt[r-20];s&&(t.push({type:"resetDecoration",value:s}),s==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:ne[r-30]}});else if(r===38){const s=kn(e);s&&t.push({type:"setForegroundColor",value:s})}else if(r===39)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:ne[r-40]}});else if(r===48){const s=kn(e);s&&t.push({type:"setBackgroundColor",value:s})}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:ne[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:ne[r-100+8]}})}return t}function Oa(){let e=null,t=null,n=new Set;return{parse(r){const s=[];let o=0;do{const a=Ta(r,o),i=a.sequence?r.substring(o,a.startPosition):r.substring(o);if(i.length>0&&s.push({value:i,foreground:e,background:t,decorations:new Set(n)}),a.sequence){const l=Ma(a.sequence);for(const 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(const c of l)c.type==="setForegroundColor"?e=c.value:c.type==="setBackgroundColor"?t=c.value:c.type==="setDecoration"&&n.add(c.value)}o=a.position}while(o<r.length);return s}}}var Ga={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 Ba(e=Ga){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 s(){if(r)return r;r=[];for(let c=0;c<ne.length;c++)r.push(t(ne[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 h=0;h<6;h++)r.push(n([i[c],i[u],i[h]]));let l=8;for(let c=0;c<24;c++,l+=10)r.push(n([l,l,l]));return r}function o(i){return s()[i]}function a(i){switch(i.type){case"named":return t(i.name);case"rgb":return n(i.rgb);case"table":return o(i.index)}}return{value:a}}const Da=/#([0-9a-f]{3,8})/i,Fa=/var\((--[\w-]+-ansi-[\w-]+)\)/,ja={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 Ua(e,t,n){const r=ze(e,n),s=Ye(t),o=Ba(Object.fromEntries(ne.map(i=>{const l=`terminal.ansi${i[0].toUpperCase()}${i.substring(1)}`;return[i,e.colors?.[l]||ja[i]]}))),a=Oa();return s.map(i=>a.parse(i[0]).map(l=>{let c,u;l.decorations.has("reverse")?(c=l.background?o.value(l.background):e.bg,u=l.foreground?o.value(l.foreground):e.fg):(c=l.foreground?o.value(l.foreground):e.fg,u=l.background?o.value(l.background):void 0),c=Y(c,r),u=Y(u,r),l.decorations.has("dim")&&(c=Wa(c));let h=T.None;return l.decorations.has("bold")&&(h|=T.Bold),l.decorations.has("italic")&&(h|=T.Italic),l.decorations.has("underline")&&(h|=T.Underline),l.decorations.has("strikethrough")&&(h|=T.Strikethrough),{content:l.value,offset:i[1],color:c,bgColor:u,fontStyle:h}}))}function Wa(e){const t=e.match(Da);if(t){const r=t[1];if(r.length===8){const s=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${s}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const s=r[0],o=r[1],a=r[2],i=r[3];return`#${s}${s}${o}${o}${a}${a}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,"0")}`}else if(r.length===3){const s=r[0],o=r[1],a=r[2];return`#${s}${s}${o}${o}${a}${a}80`}}}const n=e.match(Fa);return n?`var(${n[1]}-dim)`:e}function Mt(e,t,n={}){const r=e.resolveLangAlias(n.lang||"text"),{theme:s=e.getLoadedThemes()[0]}=n;if(!Qe(r)&&!Ze(s)&&r==="ansi"){const{theme:o}=e.setTheme(s);return Ua(o,t,n)}return fr(e,t,n)}function Ve(e,t,n){let r,s,o,a,i,l;if("themes"in n){const{defaultColor:c="light",cssVariablePrefix:u="--shiki-",colorsRendering:h="css-vars"}=n,p=Object.entries(n.themes).filter(m=>m[1]).map(m=>({color:m[0],theme:m[1]})).sort((m,y)=>m.color===c?-1:y.color===c?1:0);if(p.length===0)throw new A("`themes` option must not be empty");const f=dr(e,t,n,Mt);if(l=xe(f),c&&c!=="light-dark()"&&!p.some(m=>m.color===c))throw new A(`\`themes\` option must contain the defaultColor key \`${c}\``);const d=p.map(m=>e.getTheme(m.theme)),b=p.map(m=>m.color);o=f.map(m=>m.map(y=>Ra(y,b,u,c,h))),l&&Je(o,l);const w=p.map(m=>ze(m.theme,n));s=vn(p,d,w,u,c,"fg",h),r=vn(p,d,w,u,c,"bg",h),a=`shiki-themes ${d.map(m=>m.name).join(" ")}`,i=c?void 0:[s,r].join(";")}else if("theme"in n){const c=ze(n.theme,n);o=Mt(e,t,n);const u=e.getTheme(n.theme);r=Y(u.bg,c),s=Y(u.fg,c),a=u.name,l=xe(o)}else throw new A("Invalid options, either `theme` or `themes` must be provided");return{tokens:o,fg:s,bg:r,themeName:a,rootStyle:i,grammarState:l}}function vn(e,t,n,r,s,o,a){return e.map((i,l)=>{const c=Y(t[l][o],n[l])||"inherit",u=`${r+i.color}${o==="bg"?"-bg":""}:${c}`;if(l===0&&s){if(s==="light-dark()"&&e.length>1){const h=e.findIndex(f=>f.color==="light"),p=e.findIndex(f=>f.color==="dark");if(h===-1||p===-1)throw new A('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${Y(t[h][o],n[h])||"inherit"}, ${Y(t[p][o],n[p])||"inherit"});${u}`}return c}return a==="css-vars"?u:null}).filter(i=>!!i).join(";")}const Nr=/^\s+$/,za=/^(\s*)(.*?)(\s*)$/;function Xe(e,t,n,r={meta:{},options:n,codeToHast:(s,o)=>Xe(e,s,o),codeToTokens:(s,o)=>Ve(e,s,o)}){let s=t;for(const d of qe(n))s=d.preprocess?.call(r,s,n)||s;let{tokens:o,fg:a,bg:i,themeName:l,rootStyle:c,grammarState:u}=Ve(e,s,n);const{mergeWhitespaces:h=!0,mergeSameStyleTokens:p=!1}=n;h===!0?o=qa(o):h==="never"&&(o=Va(o)),p&&(o=Xa(o));const f={...r,get source(){return s}};for(const d of qe(n))o=d.tokens?.call(f,o)||o;return Ha(o,{...n,fg:a,bg:i,themeName:l,rootStyle:n.rootStyle===!1?!1:n.rootStyle??c},f,u)}function Ha(e,t,n,r=xe(e)){const s=qe(t),o=[],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(const[b,w]of Object.entries(t.meta||{}))b.startsWith("_")||(c[b]=w);let u={type:"element",tagName:"pre",properties:c,children:[],data:t.data},h={type:"element",tagName:"code",properties:{},children:o};const p=[],f={...n,structure:i,addClassToHast:Ir,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return a},get pre(){return u},get code(){return h},get lines(){return p}};if(e.forEach((b,w)=>{w&&(i==="inline"?a.children.push({type:"element",tagName:"br",properties:{},children:[]}):i==="classic"&&o.push({type:"text",value:`
11
+ \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function ua(e,t,n,r){const s=r.schema,o=s.space==="svg"?!1:r.settings.omitOptionalTags;let a=s.space==="svg"?r.settings.closeEmptyElements:r.settings.voids.includes(e.tagName.toLowerCase());const i=[];let l;s.space==="html"&&e.tagName==="svg"&&(r.schema=Sr);const c=ha(r,e.properties),u=r.all(s.space==="html"&&e.tagName==="template"?e.content:e);return r.schema=s,u&&(a=!1),(c||!o||!sa(e,t,n))&&(i.push("<",e.tagName,c?" "+c:""),a&&(s.space==="svg"||r.settings.closeSelfClosing)&&(l=c.charAt(c.length-1),(!r.settings.tightSelfClosing||l==="/"||l&&l!=='"'&&l!=="'")&&i.push(" "),i.push("/")),i.push(">")),i.push(u),!a&&(!o||!Vt(e,t,n))&&i.push("</"+e.tagName+">"),i.join("")}function ha(e,t){const n=[];let r=-1,s;if(t){for(s in t)if(t[s]!==null&&t[s]!==void 0){const o=pa(e,s,t[s]);o&&n.push(o)}}for(;++r<n.length;){const o=e.settings.tightAttributes?n[r].charAt(n[r].length-1):void 0;r!==n.length-1&&o!=='"'&&o!=="'"&&(n[r]+=" ")}return n.join("")}function pa(e,t,n){const r=go(e.schema,t),s=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,o=e.settings.allowDangerousCharacters?0:1;let a=e.quote,i;if(r.overloadedBoolean&&(n===r.attribute||n==="")?n=!0:(r.boolean||r.overloadedBoolean)&&(typeof n!="string"||n===r.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const l=de(r.attribute,Object.assign({},e.settings.characterReferences,{subset:$e.name[s][o]}));return n===!0||(n=Array.isArray(n)?(r.commaSeparated?jo:Uo)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?l:(e.settings.preferUnquoted&&(i=de(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:$e.unquoted[s][o]}))),i!==n&&(e.settings.quoteSmart&&bn(n,a)>bn(n,e.alternative)&&(a=e.alternative),i=a+de(n,Object.assign({},e.settings.characterReferences,{subset:(a==="'"?$e.single:$e.double)[s][o],attribute:!0}))+a),l+(i&&"="+i))}const fa=["<","&"];function Ar(e,t,n,r){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:de(e.value,Object.assign({},r.settings.characterReferences,{subset:fa}))}function da(e,t,n,r){return r.settings.allowDangerousHtml?e.value:Ar(e,t,n,r)}function ga(e,t,n,r){return r.all(e)}const ma=wo("type",{invalid:ya,unknown:ba,handlers:{comment:Do,doctype:Fo,element:ua,raw:da,root:ga,text:Ar}});function ya(e){throw new Error("Expected node, not `"+e+"`")}function ba(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const wa={},Ca={},_a=[];function Sa(e,t){const n=t||wa,r=n.quote||'"',s=r==='"'?"'":'"';if(r!=='"'&&r!=="'")throw new Error("Invalid quote `"+r+"`, expected `'` or `\"`");return{one:ka,all:va,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||lo,characterReferences:n.characterReferences||Ca,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?Sr:bo,quote:r,alternative:s}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function ka(e,t,n){return ma(e,t,n,this)}function va(e){const t=[],n=e&&e.children||_a;let r=-1;for(;++r<n.length;)t[r]=this.one(n[r],r,e);return t.join("")}const Sn=/\s+/g;function Ir(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(Sn)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(Sn);for(const r of n)r&&!e.properties.class.includes(r)&&e.properties.class.push(r);return e}function xa(e){const t=Ye(e,!0).map(([s])=>s);function n(s){if(s===e.length)return{line:t.length-1,character:t.at(-1).length};let o=s,a=0;for(const i of t){if(o<i.length)break;o-=i.length,a++}return{line:a,character:o}}function r(s,o){let a=0;for(let i=0;i<s;i++)a+=t[i].length;return a+=o,a}return{lines:t,indexToPos:n,posToIndex:r}}const Ea=["color","background-color"];function Aa(e,t){let n=0;const r=[];for(const s of t)s>n&&r.push({...e,content:e.content.slice(n,s),offset:e.offset+n}),n=s;return n<e.content.length&&r.push({...e,content:e.content.slice(n),offset:e.offset+n}),r}function Ia(e,t){const n=[...t instanceof Set?t:new Set(t)].sort((r,s)=>r-s);return n.length?e.map(r=>r.flatMap(s=>{const o=n.filter(a=>s.offset<a&&a<s.offset+s.content.length).map(a=>a-s.offset).sort((a,i)=>a-i);return o.length?Aa(s,o):s})):e}function Ra(e,t,n,r,s="css-vars"){const o={content:e.content,explanation:e.explanation,offset:e.offset},a=t.map(u=>He(e.variants[u])),i=new Set(a.flatMap(u=>Object.keys(u))),l={},c=(u,h)=>{const p=h==="color"?"":h==="background-color"?"-bg":`-${h}`;return n+t[u]+(h==="color"?"":p)};return a.forEach((u,h)=>{for(const p of i){const f=u[p]||"inherit";if(h===0&&r&&Ea.includes(p))if(r==="light-dark()"&&a.length>1){const d=t.findIndex(w=>w==="light"),b=t.findIndex(w=>w==="dark");if(d===-1||b===-1)throw new E('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');l[p]=`light-dark(${a[d][p]||"inherit"}, ${a[b][p]||"inherit"})`,s==="css-vars"&&(l[c(h,p)]=f)}else l[p]=f;else s==="css-vars"&&(l[c(h,p)]=f)}}),o.htmlStyle=l,o}function He(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&T.Italic&&(t["font-style"]="italic"),e.fontStyle&T.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&T.Underline&&n.push("underline"),e.fontStyle&T.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function Tt(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}function Na(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let o=function(i){if(typeof i=="number"){if(i<0||i>n.source.length)throw new E(`Invalid decoration offset: ${i}. Code length: ${n.source.length}`);return{...s.indexToPos(i),offset:i}}else{const l=s.lines[i.line];if(l===void 0)throw new E(`Invalid decoration position ${JSON.stringify(i)}. Lines length: ${s.lines.length}`);let c=i.character;if(c<0&&(c=l.length+c),c<0||c>l.length)throw new E(`Invalid decoration position ${JSON.stringify(i)}. Line ${i.line} length: ${l.length}`);return{...i,character:c,offset:s.posToIndex(i.line,c)}}};var r=o;const s=xa(n.source),a=(n.options.decorations||[]).map(i=>({...i,start:o(i.start),end:o(i.end)}));La(a),e.set(n.meta,{decorations:a,converter:s,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(this.options.decorations?.length)return Ia(n,t(this).decorations.flatMap(r=>[r.start.offset,r.end.offset]))},code(n){if(!this.options.decorations?.length)return;const r=t(this),s=[...n.children].filter(u=>u.type==="element"&&u.tagName==="span");if(s.length!==r.converter.lines.length)throw new E(`Number of lines in code element (${s.length}) does not match the number of lines in the source (${r.converter.lines.length}). Failed to apply decorations.`);function o(u,h,p,f){const d=s[u];let b="",w=-1,m=-1;if(h===0&&(w=0),p===0&&(m=0),p===Number.POSITIVE_INFINITY&&(m=d.children.length),w===-1||m===-1)for(let C=0;C<d.children.length;C++)b+=Rr(d.children[C]),w===-1&&b.length===h&&(w=C+1),m===-1&&b.length===p&&(m=C+1);if(w===-1)throw new E(`Failed to find start index for decoration ${JSON.stringify(f.start)}`);if(m===-1)throw new E(`Failed to find end index for decoration ${JSON.stringify(f.end)}`);const y=d.children.slice(w,m);if(!f.alwaysWrap&&y.length===d.children.length)i(d,f,"line");else if(!f.alwaysWrap&&y.length===1&&y[0].type==="element")i(y[0],f,"token");else{const C={type:"element",tagName:"span",properties:{},children:y};i(C,f,"wrapper"),d.children.splice(w,y.length,C)}}function a(u,h){s[u]=i(s[u],h,"line")}function i(u,h,p){const f=h.properties||{},d=h.transform||(b=>b);return u.tagName=h.tagName||"span",u.properties={...u.properties,...f,class:u.properties.class},h.properties?.class&&Ir(u,h.properties.class),u=d(u,p)||u,u}const l=[],c=r.decorations.sort((u,h)=>h.start.offset-u.start.offset||u.end.offset-h.end.offset);for(const u of c){const{start:h,end:p}=u;if(h.line===p.line)o(h.line,h.character,p.character,u);else if(h.line<p.line){o(h.line,h.character,Number.POSITIVE_INFINITY,u);for(let f=h.line+1;f<p.line;f++)l.unshift(()=>a(f,u));o(p.line,0,p.character,u)}}l.forEach(u=>u())}}}function La(e){for(let t=0;t<e.length;t++){const 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++){const s=e[r],o=n.start.offset<=s.start.offset&&s.start.offset<n.end.offset,a=n.start.offset<s.end.offset&&s.end.offset<=n.end.offset,i=s.start.offset<=n.start.offset&&n.start.offset<s.end.offset,l=s.start.offset<n.end.offset&&n.end.offset<=s.end.offset;if(o||a||i||l){if(o&&a||i&&l||i&&n.start.offset===n.end.offset||a&&s.start.offset===s.end.offset)continue;throw new E(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(s.start)} intersect.`)}}}}function Rr(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(Rr).join(""):""}const $a=[Na()];function qe(e){const t=Pa(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...$a]}function Pa(e){const t=[],n=[],r=[];for(const s of e)switch(s.enforce){case"pre":t.push(s);break;case"post":n.push(s);break;default:r.push(s)}return{pre:t,post:n,normal:r}}var ne=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],dt={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function Ta(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const 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 kn(e){const t=e.shift();if(t==="2"){const 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"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function Ma(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(r===0)t.push({type:"resetAll"});else if(r<=9)dt[r]&&t.push({type:"setDecoration",value:dt[r]});else if(r<=29){const s=dt[r-20];s&&(t.push({type:"resetDecoration",value:s}),s==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:ne[r-30]}});else if(r===38){const s=kn(e);s&&t.push({type:"setForegroundColor",value:s})}else if(r===39)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:ne[r-40]}});else if(r===48){const s=kn(e);s&&t.push({type:"setBackgroundColor",value:s})}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:ne[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:ne[r-100+8]}})}return t}function Oa(){let e=null,t=null,n=new Set;return{parse(r){const s=[];let o=0;do{const a=Ta(r,o),i=a.sequence?r.substring(o,a.startPosition):r.substring(o);if(i.length>0&&s.push({value:i,foreground:e,background:t,decorations:new Set(n)}),a.sequence){const l=Ma(a.sequence);for(const 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(const c of l)c.type==="setForegroundColor"?e=c.value:c.type==="setBackgroundColor"?t=c.value:c.type==="setDecoration"&&n.add(c.value)}o=a.position}while(o<r.length);return s}}}var Ga={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 Ba(e=Ga){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 s(){if(r)return r;r=[];for(let c=0;c<ne.length;c++)r.push(t(ne[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 h=0;h<6;h++)r.push(n([i[c],i[u],i[h]]));let l=8;for(let c=0;c<24;c++,l+=10)r.push(n([l,l,l]));return r}function o(i){return s()[i]}function a(i){switch(i.type){case"named":return t(i.name);case"rgb":return n(i.rgb);case"table":return o(i.index)}}return{value:a}}const Da=/#([0-9a-f]{3,8})/i,Fa=/var\((--[\w-]+-ansi-[\w-]+)\)/,ja={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 Ua(e,t,n){const r=ze(e,n),s=Ye(t),o=Ba(Object.fromEntries(ne.map(i=>{const l=`terminal.ansi${i[0].toUpperCase()}${i.substring(1)}`;return[i,e.colors?.[l]||ja[i]]}))),a=Oa();return s.map(i=>a.parse(i[0]).map(l=>{let c,u;l.decorations.has("reverse")?(c=l.background?o.value(l.background):e.bg,u=l.foreground?o.value(l.foreground):e.fg):(c=l.foreground?o.value(l.foreground):e.fg,u=l.background?o.value(l.background):void 0),c=Y(c,r),u=Y(u,r),l.decorations.has("dim")&&(c=Wa(c));let h=T.None;return l.decorations.has("bold")&&(h|=T.Bold),l.decorations.has("italic")&&(h|=T.Italic),l.decorations.has("underline")&&(h|=T.Underline),l.decorations.has("strikethrough")&&(h|=T.Strikethrough),{content:l.value,offset:i[1],color:c,bgColor:u,fontStyle:h}}))}function Wa(e){const t=e.match(Da);if(t){const r=t[1];if(r.length===8){const s=Math.round(Number.parseInt(r.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${r.slice(0,6)}${s}`}else{if(r.length===6)return`#${r}80`;if(r.length===4){const s=r[0],o=r[1],a=r[2],i=r[3];return`#${s}${s}${o}${o}${a}${a}${Math.round(Number.parseInt(`${i}${i}`,16)/2).toString(16).padStart(2,"0")}`}else if(r.length===3){const s=r[0],o=r[1],a=r[2];return`#${s}${s}${o}${o}${a}${a}80`}}}const n=e.match(Fa);return n?`var(${n[1]}-dim)`:e}function Mt(e,t,n={}){const r=e.resolveLangAlias(n.lang||"text"),{theme:s=e.getLoadedThemes()[0]}=n;if(!Qe(r)&&!Ze(s)&&r==="ansi"){const{theme:o}=e.setTheme(s);return Ua(o,t,n)}return fr(e,t,n)}function Ve(e,t,n){let r,s,o,a,i,l;if("themes"in n){const{defaultColor:c="light",cssVariablePrefix:u="--shiki-",colorsRendering:h="css-vars"}=n,p=Object.entries(n.themes).filter(m=>m[1]).map(m=>({color:m[0],theme:m[1]})).sort((m,y)=>m.color===c?-1:y.color===c?1:0);if(p.length===0)throw new E("`themes` option must not be empty");const f=dr(e,t,n,Mt);if(l=xe(f),c&&c!=="light-dark()"&&!p.some(m=>m.color===c))throw new E(`\`themes\` option must contain the defaultColor key \`${c}\``);const d=p.map(m=>e.getTheme(m.theme)),b=p.map(m=>m.color);o=f.map(m=>m.map(y=>Ra(y,b,u,c,h))),l&&Je(o,l);const w=p.map(m=>ze(m.theme,n));s=vn(p,d,w,u,c,"fg",h),r=vn(p,d,w,u,c,"bg",h),a=`shiki-themes ${d.map(m=>m.name).join(" ")}`,i=c?void 0:[s,r].join(";")}else if("theme"in n){const c=ze(n.theme,n);o=Mt(e,t,n);const u=e.getTheme(n.theme);r=Y(u.bg,c),s=Y(u.fg,c),a=u.name,l=xe(o)}else throw new E("Invalid options, either `theme` or `themes` must be provided");return{tokens:o,fg:s,bg:r,themeName:a,rootStyle:i,grammarState:l}}function vn(e,t,n,r,s,o,a){return e.map((i,l)=>{const c=Y(t[l][o],n[l])||"inherit",u=`${r+i.color}${o==="bg"?"-bg":""}:${c}`;if(l===0&&s){if(s==="light-dark()"&&e.length>1){const h=e.findIndex(f=>f.color==="light"),p=e.findIndex(f=>f.color==="dark");if(h===-1||p===-1)throw new E('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${Y(t[h][o],n[h])||"inherit"}, ${Y(t[p][o],n[p])||"inherit"});${u}`}return c}return a==="css-vars"?u:null}).filter(i=>!!i).join(";")}const Nr=/^\s+$/,za=/^(\s*)(.*?)(\s*)$/;function Xe(e,t,n,r={meta:{},options:n,codeToHast:(s,o)=>Xe(e,s,o),codeToTokens:(s,o)=>Ve(e,s,o)}){let s=t;for(const d of qe(n))s=d.preprocess?.call(r,s,n)||s;let{tokens:o,fg:a,bg:i,themeName:l,rootStyle:c,grammarState:u}=Ve(e,s,n);const{mergeWhitespaces:h=!0,mergeSameStyleTokens:p=!1}=n;h===!0?o=qa(o):h==="never"&&(o=Va(o)),p&&(o=Xa(o));const f={...r,get source(){return s}};for(const d of qe(n))o=d.tokens?.call(f,o)||o;return Ha(o,{...n,fg:a,bg:i,themeName:l,rootStyle:n.rootStyle===!1?!1:n.rootStyle??c},f,u)}function Ha(e,t,n,r=xe(e)){const s=qe(t),o=[],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(const[b,w]of Object.entries(t.meta||{}))b.startsWith("_")||(c[b]=w);let u={type:"element",tagName:"pre",properties:c,children:[],data:t.data},h={type:"element",tagName:"code",properties:{},children:o};const p=[],f={...n,structure:i,addClassToHast:Ir,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return a},get pre(){return u},get code(){return h},get lines(){return p}};if(e.forEach((b,w)=>{w&&(i==="inline"?a.children.push({type:"element",tagName:"br",properties:{},children:[]}):i==="classic"&&o.push({type:"text",value:`
12
12
  `}));let m={type:"element",tagName:"span",properties:{class:"line"},children:[]},y=0;for(const C of b){let k={type:"element",tagName:"span",properties:{...C.htmlAttrs},children:[{type:"text",value:C.content}]};const v=Tt(C.htmlStyle||He(C));v&&(k.properties.style=v);for(const $ of s)k=$?.span?.call(f,k,w+1,y,m,C)||k;i==="inline"?a.children.push(k):i==="classic"&&m.children.push(k),y+=C.content.length}if(i==="classic"){for(const C of s)m=C?.line?.call(f,m,w+1)||m;p.push(m),o.push(m)}else i==="inline"&&p.push(m)}),i==="classic"){for(const b of s)h=b?.code?.call(f,h)||h;u.children.push(h);for(const b of s)u=b?.pre?.call(f,u)||u;a.children.push(u)}else if(i==="inline"){const b=[];let w={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const y of a.children)y.type==="element"&&y.tagName==="br"?(b.push(w),w={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(y.type==="element"||y.type==="text")&&w.children.push(y);b.push(w);let m={type:"element",tagName:"code",properties:{},children:b};for(const y of s)m=y?.code?.call(f,m)||m;a.children=[];for(let y=0;y<m.children.length;y++){y>0&&a.children.push({type:"element",tagName:"br",properties:{},children:[]});const C=m.children[y];C.type==="element"&&a.children.push(...C.children)}}let d=a;for(const b of s)d=b?.root?.call(f,d)||d;return r&&Je(d,r),d}function qa(e){return e.map(t=>{const n=[];let r="",s;return t.forEach((o,a)=>{const i=!(o.fontStyle&&(o.fontStyle&T.Underline||o.fontStyle&T.Strikethrough));i&&Nr.test(o.content)&&t[a+1]?(s===void 0&&(s=o.offset),r+=o.content):r?(i?n.push({...o,offset:s,content:r+o.content}):n.push({content:r,offset:s},o),s=void 0,r=""):n.push(o)}),n})}function Va(e){return e.map(t=>t.flatMap(n=>{if(Nr.test(n.content))return n;const r=n.content.match(za);if(!r)return n;const[,s,o,a]=r;if(!s&&!a)return n;const i=[{...n,offset:n.offset+s.length,content:o}];return s&&i.unshift({content:s,offset:n.offset}),a&&i.push({content:a,offset:n.offset+s.length+o.length}),i}))}function Xa(e){return e.map(t=>{const n=[];for(const r of t){if(n.length===0){n.push({...r});continue}const s=n.at(-1),o=Tt(s.htmlStyle||He(s)),a=Tt(r.htmlStyle||He(r)),i=s.fontStyle&&(s.fontStyle&T.Underline||s.fontStyle&T.Strikethrough),l=r.fontStyle&&(r.fontStyle&T.Underline||r.fontStyle&T.Strikethrough);!i&&!l&&o===a?s.content+=r.content:n.push({...r})}return n})}const Ka=Sa;function Qa(e,t,n){const r={meta:{},options:n,codeToHast:(o,a)=>Xe(e,o,a),codeToTokens:(o,a)=>Ve(e,o,a)};let s=Ka(Xe(e,t,n,r));for(const o of qe(n))s=o.postprocess?.call(r,s,n)||s;return s}async function Za(e){const t=await Qs(e);return{getLastGrammarState:(...n)=>to(t,...n),codeToTokensBase:(n,r)=>Mt(t,n,r),codeToTokensWithThemes:(n,r)=>dr(t,n,r),codeToTokens:(n,r)=>Ve(t,n,r),codeToHast:(n,r)=>Xe(t,n,r),codeToHtml:(n,r)=>Qa(t,n,r),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}const xn=4294967295;var Ya=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;const{forgiving:n=!1,cache:r,regexConstructor:s}=t;if(!s)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(o=>{if(typeof o!="string")return o;const a=r?.get(o);if(a){if(a instanceof RegExp)return a;if(n)return null;throw a}try{const i=s(o);return r?.set(o,i),i}catch(i){if(r?.set(o,i),n)return null;throw i}})}findNextMatchSync(e,t,n){const r=typeof e=="string"?e:e.content,s=[];function o(a,i,l=0){return{index:a,captureIndices:i.indices.map(c=>c==null?{start:xn,end:xn,length:0}:{start:c[0]+l,end:c[1]+l,length:c[1]-c[0]})}}for(let a=0;a<this.regexps.length;a++){const i=this.regexps[a];if(i)try{i.lastIndex=t;const l=i.exec(r);if(!l)continue;if(l.index===t)return o(a,l,0);s.push([a,l,0])}catch(l){if(this.options.forgiving)continue;throw l}}if(s.length){const a=Math.min(...s.map(i=>i[1].index));for(const[i,l,c]of s)if(l.index===a)return o(i,l,c)}return null}};function me(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function Ja(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const Xt=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),L=String.raw;function ye(e,t){if(e==null)throw new Error(t??"Value expected");return e}const Lr=L`\[\^?`,$r=`c.? | C(?:-.?)?|${L`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${L`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${L`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${L`o\{[^\}]*\}?`}|${L`\d{1,3}`}`,Kt=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Pe=new RegExp(L`
13
13
  \\ (?:
14
14
  ${$r}
@@ -40,8 +40,8 @@ var A=class extends Error{constructor(e){super(e),this.name="ShikiError"}};funct
40
40
  | ${Lr}
41
41
  | &&
42
42
  | .
43
- `.replace(/\s+/g,""),"gsu");function ei(e,t={}){const n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");const r=wi(n.flags),s=[r.extended],o={captureGroup:n.rules.captureGroup,getCurrentModX(){return s.at(-1)},numOpenGroups:0,popModX(){s.pop()},pushModX(h){s.push(h)},replaceCurrentModX(h){s[s.length-1]=h},singleline:n.rules.singleline};let a=[],i;for(Pe.lastIndex=0;i=Pe.exec(e);){const h=ti(o,e,i[0],Pe.lastIndex);h.tokens?a.push(...h.tokens):h.token&&a.push(h.token),h.lastIndex!==void 0&&(Pe.lastIndex=h.lastIndex)}const l=[];let c=0;a.filter(h=>h.type==="GroupOpen").forEach(h=>{h.kind==="capturing"?h.number=++c:h.raw==="("&&l.push(h)}),c||l.forEach((h,p)=>{h.kind="capturing",h.number=p+1});const u=c||l.length;return{tokens:a.map(h=>h.type==="EscapedNumber"?_i(h,u):h).flat(),flags:r}}function ti(e,t,n,r){const[s,o]=n;if(n==="["||n==="[^"){const a=ni(t,n,r);return{tokens:a.tokens,lastIndex:a.lastIndex}}if(s==="\\"){if("AbBGyYzZ".includes(o))return{token:An(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:pi(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:Tr(n)}}if(o==="K")return{token:Mr("keep",n)};if(o==="N"||o==="R")return{token:re("newline",n,{negate:o==="N"})};if(o==="O")return{token:re("any",n)};if(o==="X")return{token:re("text_segment",n)};const a=Pr(n,{inCharClass:!1});return Array.isArray(a)?{tokens:a}:{token:a}}if(s==="("){if(o==="*")return{token:mi(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:gi(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:pe("group",n)};if(n==="(?>")return{token:pe("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:pe(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:pe("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:pe("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:ci(n)}}if(e.getCurrentModX()){if(n==="#"){const a=t.indexOf(`
44
- `,r);return{lastIndex:a===-1?t.length:a}}if(/^\s$/.test(n)){const a=/\s+/y;return a.lastIndex=r,{lastIndex:a.exec(t)?a.lastIndex:r}}}if(n===".")return{token:re("dot",n)};if(n==="^"||n==="$"){const a=e.singleline?{"^":L`\A`,$:L`\Z`}[n]:n;return{token:An(a,n)}}return n==="|"?{token:si(n)}:Kt.test(n)?{tokens:Si(n)}:{token:K(me(n),n)}}function ni(e,t,n){const r=[En(t[1]==="^",t)];let s=1,o;for(gt.lastIndex=n;o=gt.exec(e);){const a=o[0];if(a[0]==="["&&a[1]!==":")s++,r.push(En(a[1]==="^",a));else if(a==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(K(93,a));else if(s--,r.push(oi(a)),!s)break}else{const i=ri(a);Array.isArray(i)?r.push(...i):r.push(i)}}return{tokens:r,lastIndex:gt.lastIndex||e.length}}function ri(e){if(e[0]==="\\")return Pr(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!Xt.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return re("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?ai(e):e==="&&"?ii(e):K(me(e),e)}function Pr(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return di(e);if("dDhHsSwW".includes(n))return yi(e);if(e.startsWith(L`\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 bi(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const r=e.split(/\\x/).slice(1).map(a=>parseInt(a,16)),s=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),o=new TextEncoder;return[...s].map(a=>{const i=[...o.encode(a)].map(l=>`\\x${l.toString(16)}`).join("");return K(me(a),i)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return K(Ci(e),e);if(In.has(n))return K(In.get(n),e);if(/\d/.test(n))return li(t,e);if(e==="\\")throw new Error(L`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return K(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function si(e){return{type:"Alternator",raw:e}}function An(e,t){return{type:"Assertion",kind:e,raw:t}}function Tr(e){return{type:"Backreference",raw:e}}function K(e,t){return{type:"Character",value:e,raw:t}}function oi(e){return{type:"CharacterClassClose",raw:e}}function ai(e){return{type:"CharacterClassHyphen",raw:e}}function ii(e){return{type:"CharacterClassIntersector",raw:e}}function En(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function re(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function Mr(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:ye(n.flags),raw:t}}function li(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function ci(e){return{type:"GroupClose",raw:e}}function pe(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function ui(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}function hi(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}function pi(e){return{type:"Subroutine",raw:e}}const fi=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),In=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function di(e){const t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return K(me(t.toUpperCase())-64,e)}function gi(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??="";const s=(t.getCurrentModX()||n.includes("x"))&&!r.includes("x"),o=Nn(n),a=Nn(r),i={};if(o&&(i.enable=o),a&&(i.disable=a),e.endsWith(")"))return t.replaceCurrentModX(s),Mr("flags",e,{flags:i});if(e.endsWith(":"))return t.pushModX(s),t.numOpenGroups++,pe("group",e,{...(o||a)&&{flags:i}});throw new Error(`Unexpected flag modifier "${e}"`)}function mi(e){const 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}"`);const{name:n,tag:r,args:s}=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}"`);const o=s?s.split(",").filter(u=>u!=="").map(u=>/^[+-]?\d+$/.test(u)?+u:u):[],[a,i,l]=o,c=fi.has(n)?n.toLowerCase():"custom";switch(c){case"fail":case"mismatch":case"skip":if(o.length>0)throw new Error(`Named callout arguments not allowed "${o}"`);break;case"error":if(o.length>1)throw new Error(`Named callout allows only one argument "${o}"`);if(typeof a=="string")throw new Error(`Named callout argument must be a number "${a}"`);break;case"max":if(!o.length||o.length>2)throw new Error(`Named callout must have one or two arguments "${o}"`);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(o.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(o.length>1)throw new Error(`Named callout allows only one argument "${o}"`);if(o.length===1&&(typeof a=="number"||!/^[<>X]$/.test(a)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${a}"`);break;case"cmp":if(o.length!==3)throw new Error(`Named callout must have three arguments "${o}"`);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 ui(c,r??null,s?.split(",")??null,e)}function Rn(e){let t=null,n,r;if(e[0]==="{"){const{minStr:s,maxStr:o}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,a=1e5;if(+s>a||o&&+o>a)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+s,r=o===void 0?+s:o===""?1/0:+o,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 hi(t,n,r,e)}function yi(e){const t=e[1].toLowerCase();return re({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function bi(e){const{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return re("property",e,{value:r,negate:t==="P"&&!n||t==="p"&&!!n})}function Nn(e){const 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 wi(e){const 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++){const 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 Ci(e){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const t=e[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function _i(e,t){const{raw:n,inCharClass:r}=e,s=n.slice(1);if(!r&&(s!=="0"&&s.length===1||s[0]!=="0"&&+s<=t))return[Tr(n)];const o=[],a=s.match(/^[0-7]+|\d/g);for(let i=0;i<a.length;i++){const l=a[i];let c;if(i===0&&l!=="8"&&l!=="9"){if(c=parseInt(l,8),c>127)throw new Error(L`Octal encoded byte above 177 unsupported "${n}"`)}else c=me(l);o.push(K(c,(i===0?"\\":"")+l))}return o}function Si(e){const t=[],n=new RegExp(Kt,"gy");let r;for(;r=n.exec(e);){const s=r[0];if(s[0]==="{"){const o=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(s);if(o){const{min:a,max:i}=o.groups;if(+a>+i&&s.endsWith("?")){n.lastIndex--,t.push(Rn(s.slice(0,-1)));continue}}}t.push(Rn(s))}return t}function Or(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const n=e.body[0];return!t||Object.keys(t).every(r=>t[r]===n[r])}function ki(e){return vi.has(e.type)}const vi=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function Gr(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=ei(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),s=(p,f)=>{const d=r.tokens[o.nextIndex];switch(o.parent=p,o.nextIndex++,d.type){case"Alternator":return ae();case"Assertion":return xi(d);case"Backreference":return Ai(d,o);case"Character":return tt(d.value,{useLastValid:!!f.isCheckingRangeEnd});case"CharacterClassHyphen":return Ei(d,o,f);case"CharacterClassOpen":return Ii(d,o,f);case"CharacterSet":return Ri(d,o);case"Directive":return Mi(d.kind,{flags:d.flags});case"GroupOpen":return Ni(d,o,f);case"NamedCallout":return Gi(d.kind,d.tag,d.arguments);case"Quantifier":return Li(d,o);case"Subroutine":return $i(d,o);default:throw new Error(`Unexpected token type "${d.type}"`)}},o={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:s},a=Di(Oi(r.flags));let i=a.body[0];for(;o.nextIndex<r.tokens.length;){const p=s(i,{});p.type==="Alternative"?(a.body.push(p),i=p):i.body.push(p)}const{capturingGroups:l,hasNumberedRef:c,namedGroupsByName:u,subroutines:h}=o;if(c&&u.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:p}of h)if(typeof p=="number"){if(p>l.length)throw new Error("Subroutine uses a group number that's not defined");p&&(l[p-1].isSubroutined=!0)}else if(u.has(p)){if(u.get(p).length>1)throw new Error(L`Subroutine uses a duplicate group name "\g<${p}>"`);u.get(p)[0].isSubroutined=!0}else throw new Error(L`Subroutine uses a group name that's not defined "\g<${p}>"`);return a}function xi({kind:e}){return Ot(ye({"^":"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===L`\B`||e===L`\Y`})}function Ai({raw:e},t){const n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),s=(o,a=!1)=>{const i=t.capturingGroups.length;let l=!1;if(o>i)if(t.skipBackrefValidation)l=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,Gt(a?i+1-o:o,{orphan:l})};if(n){const o=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(o)return s(+o.groups.num,!!o.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 Gt(r)}return s(+r)}function Ei(e,t,n){const{tokens:r,walk:s}=t,o=t.parent,a=o.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"){const l=s(o,{...n,isCheckingRangeEnd:!0});if(a.type==="Character"&&l.type==="Character")return o.body.pop(),Ti(a,l);throw new Error("Invalid character class range")}return tt(me("-"))}function Ii({negate:e},t,n){const{tokens:r,walk:s}=t,o=[Be()],a=r[t.nextIndex];let i=Pn(a);for(;i.type!=="CharacterClassClose";){if(i.type==="CharacterClassIntersector")o.push(Be()),t.nextIndex++;else{const c=o.at(-1);c.body.push(s(c,n))}i=Pn(r[t.nextIndex],a)}const l=Be({negate:e});return o.length===1?l.body=o[0].body:(l.kind="intersection",l.body=o.map(c=>c.body.length===1?c.body[0]:c)),t.nextIndex++,l}function Ri({kind:e,negate:t,value:n},r){const{normalizeUnknownPropertyNames:s,skipPropertyNameValidation:o,unicodePropertyMap:a}=r;if(e==="property"){const i=nt(n);if(Xt.has(i)&&!a?.has(i))e="posix",n=i;else return fe(n,{negate:t,normalizeUnknownPropertyNames:s,skipPropertyNameValidation:o,unicodePropertyMap:a})}return e==="posix"?Bi(n,{negate:t}):Bt(e,{negate:t})}function Ni(e,t,n){const{tokens:r,capturingGroups:s,namedGroupsByName:o,skipLookbehindValidation:a,walk:i}=t,l=Fi(e),c=l.type==="AbsenceFunction",u=$n(l),h=u&&l.negate;if(l.type==="CapturingGroup"&&(s.push(l),l.name&&Ja(o,l.name,[]).push(l)),c&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let p=Tn(r[t.nextIndex]);for(;p.type!=="GroupClose";){if(p.type==="Alternator")l.body.push(ae()),t.nextIndex++;else{const f=l.body.at(-1),d=i(f,{...n,isInAbsenceFunction:n.isInAbsenceFunction||c,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||h});if(f.body.push(d),(u||n.isInLookbehind)&&!a){const b="Lookbehind includes a pattern not allowed by Oniguruma";if(h||n.isInNegLookbehind){if(Ln(d)||d.type==="CapturingGroup")throw new Error(b)}else if(Ln(d)||$n(d)&&d.negate)throw new Error(b)}}p=Tn(r[t.nextIndex])}return t.nextIndex++,l}function Li({kind:e,min:t,max:n},r){const s=r.parent,o=s.body.at(-1);if(!o||!ki(o))throw new Error("Quantifier requires a repeatable token");const a=Dr(e,t,n,o);return s.body.pop(),a}function $i({raw:e},t){const{capturingGroups:n,subroutines:r}=t;let s=e.slice(3,-1);const o=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(s);if(o){const i=+o.groups.num,l=n.length;if(t.hasNumberedRef=!0,s={"":i,"+":l+i,"-":l+1-i}[o.groups.sign],s<1)throw new Error("Invalid subroutine number")}else s==="0"&&(s=0);const a=Fr(s);return r.push(a),a}function Pi(e,t){return{type:"AbsenceFunction",kind:e,body:Re(t?.body)}}function ae(e){return{type:"Alternative",body:jr(e?.body)}}function Ot(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function Gt(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function Br(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!ji(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:Re(t?.body)}}function tt(e,t){const n={useLastValid:!1,...t};if(e>1114111){const 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 Be(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:jr(e?.body)}}function Ti(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function Bt(e,t){const 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 Mi(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:ye(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function Oi(e){return{type:"Flags",...e}}function j(e){const 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:Re(e?.body)}}function te(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:Re(e?.body)}}function Gi(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function Bi(e,t){const n=!!t?.negate;if(!Xt.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function Dr(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 Di(e,t){return{type:"Regex",body:Re(t?.body),flags:e}}function Fr(e){return{type:"Subroutine",ref:e}}function fe(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let r=n.unicodePropertyMap?.get(nt(e));if(!r){if(n.normalizeUnknownPropertyNames)r=Ui(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(L`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function Fi({flags:e,kind:t,name:n,negate:r,number:s}){switch(t){case"absence_repeater":return Pi("repeater");case"atomic":return j({atomic:!0});case"capturing":return Br(s,{name:n});case"group":return j({flags:e});case"lookahead":case"lookbehind":return te({behind:t==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${t}"`)}}function Re(e){if(e===void 0)e=[ae()];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 jr(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 Ln(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function $n(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function ji(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function Ui(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 nt(e){return e.replace(/[- _]+/g,"").toLowerCase()}function Pn(e,t){const n=t;return ye(e,`Unclosed character class${n?.type==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function Tn(e){return ye(e,"Unclosed group")}function _e(e,t,n=null){function r(o,a){for(let i=0;i<o.length;i++){const l=s(o[i],a,i,o);i=Math.max(-1,i+l)}}function s(o,a=null,i=null,l=null){let c=0,u=!1;const h={node:o,parent:a,key:i,container:l,root:e,remove(){Te(l).splice(Math.max(0,ue(i)+c),1),c--,u=!0},removeAllNextSiblings(){return Te(l).splice(ue(i)+1)},removeAllPrevSiblings(){const m=ue(i)+c;return c-=m,Te(l).splice(0,Math.max(0,m))},replaceWith(m,y={}){const C=!!y.traverse;l?l[Math.max(0,ue(i)+c)]=m:ye(a,"Can't replace root node")[i]=m,C&&s(m,a,i,l),u=!0},replaceWithMultiple(m,y={}){const C=!!y.traverse;if(Te(l).splice(Math.max(0,ue(i)+c),1,...m),c+=m.length-1,C){let k=0;for(let v=0;v<m.length;v++)k+=s(m[v],a,ue(i)+v+k,l)}u=!0},skip(){u=!0}},{type:p}=o,f=t["*"],d=t[p],b=typeof f=="function"?f:f?.enter,w=typeof d=="function"?d:d?.enter;if(b?.(h,n),w?.(h,n),!u)switch(p){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":r(o.body,o);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":s(o.min,o,"min"),s(o.max,o,"max");break;case"Quantifier":s(o.body,o,"body");break;case"Regex":r(o.body,o),s(o.flags,o,"flags");break;default:throw new Error(`Unexpected node type "${p}"`)}return d?.exit?.(h,n),f?.exit?.(h,n),c}return s(e),e}function Te(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function ue(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const Wi=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function zi(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function Hi(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}const F=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function Qt(e,t,n,r){const s=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),o=[!1];let a=0,i="";for(const l of e.matchAll(s)){const{0:c,groups:{$skip:u}}=l;if(!u&&(!r||r===F.DEFAULT==!a)){n instanceof Function?i+=n(l,{context:a?F.CHAR_CLASS:F.DEFAULT,negated:o[o.length-1]}):i+=n;continue}c[0]==="["?(a++,o.push(c[1]==="^")):c==="]"&&a&&(a--,o.pop()),i+=c}return i}function Ur(e,t,n,r){Qt(e,t,n,r)}function qi(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;const s=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");s.lastIndex=n;let o=0,a;for(;a=s.exec(e);){const{0:i,groups:{$skip:l}}=a;if(!l&&(!r||r===F.DEFAULT==!o))return a;i==="["?o++:i==="]"&&o&&o--,s.lastIndex==a.index&&s.lastIndex++}return null}function Me(e,t,n){return!!qi(e,t,0,n)}function Vi(e,t){const n=/\\?./gsu;n.lastIndex=t;let r=e.length,s=0,o=1,a;for(;a=n.exec(e);){const[i]=a;if(i==="[")s++;else if(s)i==="]"&&s--;else if(i==="(")o++;else if(i===")"&&(o--,!o)){r=a.index;break}}return e.slice(t,r)}const Mn=new RegExp(String.raw`(?<noncapturingStart>${Wi})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function Xi(e,t){const n=t?.hiddenCaptures??[];let r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};const s="(?>",o="(?:(?=(",a=[0],i=[];let l=0,c=0,u=NaN,h;do{h=!1;let p=0,f=0,d=!1,b;for(Mn.lastIndex=Number.isNaN(u)?0:u+o.length;b=Mn.exec(e);){const{0:w,index:m,groups:{capturingStart:y,noncapturingStart:C}}=b;if(w==="[")p++;else if(p)w==="]"&&p--;else if(w===s&&!d)u=m,d=!0;else if(d&&C)f++;else if(y)d?f++:(l++,a.push(l+c));else if(w===")"&&d){if(!f){c++;const k=l+c;if(e=`${e.slice(0,u)}${o}${e.slice(u+s.length,m)}))<$$${k}>)${e.slice(m+1)}`,h=!0,i.push(k),zi(n,k),r.size){const v=new Map;r.forEach(($,M)=>{v.set(M>=k?M+1:M,$.map(W=>W>=k?W+1:W))}),r=v}break}f--}}}while(h);return n.push(...i),e=Qt(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:p,groups:{backrefNum:f,wrappedBackrefNum:d}})=>{if(f){const b=+f;if(b>a.length-1)throw new Error(`Backref "${p}" greater than number of captures`);return`\\${a[b]}`}return`\\${d}`},F.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}const Wr=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,mt=new RegExp(String.raw`
43
+ `.replace(/\s+/g,""),"gsu");function ei(e,t={}){const n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");const r=wi(n.flags),s=[r.extended],o={captureGroup:n.rules.captureGroup,getCurrentModX(){return s.at(-1)},numOpenGroups:0,popModX(){s.pop()},pushModX(h){s.push(h)},replaceCurrentModX(h){s[s.length-1]=h},singleline:n.rules.singleline};let a=[],i;for(Pe.lastIndex=0;i=Pe.exec(e);){const h=ti(o,e,i[0],Pe.lastIndex);h.tokens?a.push(...h.tokens):h.token&&a.push(h.token),h.lastIndex!==void 0&&(Pe.lastIndex=h.lastIndex)}const l=[];let c=0;a.filter(h=>h.type==="GroupOpen").forEach(h=>{h.kind==="capturing"?h.number=++c:h.raw==="("&&l.push(h)}),c||l.forEach((h,p)=>{h.kind="capturing",h.number=p+1});const u=c||l.length;return{tokens:a.map(h=>h.type==="EscapedNumber"?_i(h,u):h).flat(),flags:r}}function ti(e,t,n,r){const[s,o]=n;if(n==="["||n==="[^"){const a=ni(t,n,r);return{tokens:a.tokens,lastIndex:a.lastIndex}}if(s==="\\"){if("AbBGyYzZ".includes(o))return{token:En(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:pi(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:Tr(n)}}if(o==="K")return{token:Mr("keep",n)};if(o==="N"||o==="R")return{token:re("newline",n,{negate:o==="N"})};if(o==="O")return{token:re("any",n)};if(o==="X")return{token:re("text_segment",n)};const a=Pr(n,{inCharClass:!1});return Array.isArray(a)?{tokens:a}:{token:a}}if(s==="("){if(o==="*")return{token:mi(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:gi(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:pe("group",n)};if(n==="(?>")return{token:pe("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:pe(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:pe("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:pe("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:ci(n)}}if(e.getCurrentModX()){if(n==="#"){const a=t.indexOf(`
44
+ `,r);return{lastIndex:a===-1?t.length:a}}if(/^\s$/.test(n)){const a=/\s+/y;return a.lastIndex=r,{lastIndex:a.exec(t)?a.lastIndex:r}}}if(n===".")return{token:re("dot",n)};if(n==="^"||n==="$"){const a=e.singleline?{"^":L`\A`,$:L`\Z`}[n]:n;return{token:En(a,n)}}return n==="|"?{token:si(n)}:Kt.test(n)?{tokens:Si(n)}:{token:K(me(n),n)}}function ni(e,t,n){const r=[An(t[1]==="^",t)];let s=1,o;for(gt.lastIndex=n;o=gt.exec(e);){const a=o[0];if(a[0]==="["&&a[1]!==":")s++,r.push(An(a[1]==="^",a));else if(a==="]"){if(r.at(-1).type==="CharacterClassOpen")r.push(K(93,a));else if(s--,r.push(oi(a)),!s)break}else{const i=ri(a);Array.isArray(i)?r.push(...i):r.push(i)}}return{tokens:r,lastIndex:gt.lastIndex||e.length}}function ri(e){if(e[0]==="\\")return Pr(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!Xt.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return re("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?ai(e):e==="&&"?ii(e):K(me(e),e)}function Pr(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return di(e);if("dDhHsSwW".includes(n))return yi(e);if(e.startsWith(L`\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 bi(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const r=e.split(/\\x/).slice(1).map(a=>parseInt(a,16)),s=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(r)),o=new TextEncoder;return[...s].map(a=>{const i=[...o.encode(a)].map(l=>`\\x${l.toString(16)}`).join("");return K(me(a),i)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return K(Ci(e),e);if(In.has(n))return K(In.get(n),e);if(/\d/.test(n))return li(t,e);if(e==="\\")throw new Error(L`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return K(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function si(e){return{type:"Alternator",raw:e}}function En(e,t){return{type:"Assertion",kind:e,raw:t}}function Tr(e){return{type:"Backreference",raw:e}}function K(e,t){return{type:"Character",value:e,raw:t}}function oi(e){return{type:"CharacterClassClose",raw:e}}function ai(e){return{type:"CharacterClassHyphen",raw:e}}function ii(e){return{type:"CharacterClassIntersector",raw:e}}function An(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function re(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function Mr(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:ye(n.flags),raw:t}}function li(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function ci(e){return{type:"GroupClose",raw:e}}function pe(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function ui(e,t,n,r){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:r}}function hi(e,t,n,r){return{type:"Quantifier",kind:e,min:t,max:n,raw:r}}function pi(e){return{type:"Subroutine",raw:e}}const fi=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),In=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function di(e){const t=e[1]==="c"?e[2]:e[3];if(!t||!/[A-Za-z]/.test(t))throw new Error(`Unsupported control character "${e}"`);return K(me(t.toUpperCase())-64,e)}function gi(e,t){let{on:n,off:r}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;r??="";const s=(t.getCurrentModX()||n.includes("x"))&&!r.includes("x"),o=Nn(n),a=Nn(r),i={};if(o&&(i.enable=o),a&&(i.disable=a),e.endsWith(")"))return t.replaceCurrentModX(s),Mr("flags",e,{flags:i});if(e.endsWith(":"))return t.pushModX(s),t.numOpenGroups++,pe("group",e,{...(o||a)&&{flags:i}});throw new Error(`Unexpected flag modifier "${e}"`)}function mi(e){const 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}"`);const{name:n,tag:r,args:s}=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}"`);const o=s?s.split(",").filter(u=>u!=="").map(u=>/^[+-]?\d+$/.test(u)?+u:u):[],[a,i,l]=o,c=fi.has(n)?n.toLowerCase():"custom";switch(c){case"fail":case"mismatch":case"skip":if(o.length>0)throw new Error(`Named callout arguments not allowed "${o}"`);break;case"error":if(o.length>1)throw new Error(`Named callout allows only one argument "${o}"`);if(typeof a=="string")throw new Error(`Named callout argument must be a number "${a}"`);break;case"max":if(!o.length||o.length>2)throw new Error(`Named callout must have one or two arguments "${o}"`);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(o.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(o.length>1)throw new Error(`Named callout allows only one argument "${o}"`);if(o.length===1&&(typeof a=="number"||!/^[<>X]$/.test(a)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${a}"`);break;case"cmp":if(o.length!==3)throw new Error(`Named callout must have three arguments "${o}"`);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 ui(c,r??null,s?.split(",")??null,e)}function Rn(e){let t=null,n,r;if(e[0]==="{"){const{minStr:s,maxStr:o}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,a=1e5;if(+s>a||o&&+o>a)throw new Error("Quantifier value unsupported in Oniguruma");if(n=+s,r=o===void 0?+s:o===""?1/0:+o,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 hi(t,n,r,e)}function yi(e){const t=e[1].toLowerCase();return re({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function bi(e){const{p:t,neg:n,value:r}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return re("property",e,{value:r,negate:t==="P"&&!n||t==="p"&&!!n})}function Nn(e){const 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 wi(e){const 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++){const 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 Ci(e){if(new RegExp("^(?:\\\\u(?!\\p{AHex}{4})|\\\\x(?!\\p{AHex}{1,2}|\\{\\p{AHex}{1,8}\\}))","u").test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const t=e[2]==="{"?new RegExp("^\\\\x\\{\\s*(?<hex>\\p{AHex}+)","u").exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function _i(e,t){const{raw:n,inCharClass:r}=e,s=n.slice(1);if(!r&&(s!=="0"&&s.length===1||s[0]!=="0"&&+s<=t))return[Tr(n)];const o=[],a=s.match(/^[0-7]+|\d/g);for(let i=0;i<a.length;i++){const l=a[i];let c;if(i===0&&l!=="8"&&l!=="9"){if(c=parseInt(l,8),c>127)throw new Error(L`Octal encoded byte above 177 unsupported "${n}"`)}else c=me(l);o.push(K(c,(i===0?"\\":"")+l))}return o}function Si(e){const t=[],n=new RegExp(Kt,"gy");let r;for(;r=n.exec(e);){const s=r[0];if(s[0]==="{"){const o=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(s);if(o){const{min:a,max:i}=o.groups;if(+a>+i&&s.endsWith("?")){n.lastIndex--,t.push(Rn(s.slice(0,-1)));continue}}}t.push(Rn(s))}return t}function Or(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const n=e.body[0];return!t||Object.keys(t).every(r=>t[r]===n[r])}function ki(e){return vi.has(e.type)}const vi=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function Gr(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},r=ei(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),s=(p,f)=>{const d=r.tokens[o.nextIndex];switch(o.parent=p,o.nextIndex++,d.type){case"Alternator":return ae();case"Assertion":return xi(d);case"Backreference":return Ei(d,o);case"Character":return tt(d.value,{useLastValid:!!f.isCheckingRangeEnd});case"CharacterClassHyphen":return Ai(d,o,f);case"CharacterClassOpen":return Ii(d,o,f);case"CharacterSet":return Ri(d,o);case"Directive":return Mi(d.kind,{flags:d.flags});case"GroupOpen":return Ni(d,o,f);case"NamedCallout":return Gi(d.kind,d.tag,d.arguments);case"Quantifier":return Li(d,o);case"Subroutine":return $i(d,o);default:throw new Error(`Unexpected token type "${d.type}"`)}},o={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:s},a=Di(Oi(r.flags));let i=a.body[0];for(;o.nextIndex<r.tokens.length;){const p=s(i,{});p.type==="Alternative"?(a.body.push(p),i=p):i.body.push(p)}const{capturingGroups:l,hasNumberedRef:c,namedGroupsByName:u,subroutines:h}=o;if(c&&u.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:p}of h)if(typeof p=="number"){if(p>l.length)throw new Error("Subroutine uses a group number that's not defined");p&&(l[p-1].isSubroutined=!0)}else if(u.has(p)){if(u.get(p).length>1)throw new Error(L`Subroutine uses a duplicate group name "\g<${p}>"`);u.get(p)[0].isSubroutined=!0}else throw new Error(L`Subroutine uses a group name that's not defined "\g<${p}>"`);return a}function xi({kind:e}){return Ot(ye({"^":"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===L`\B`||e===L`\Y`})}function Ei({raw:e},t){const n=/^\\k[<']/.test(e),r=n?e.slice(3,-1):e.slice(1),s=(o,a=!1)=>{const i=t.capturingGroups.length;let l=!1;if(o>i)if(t.skipBackrefValidation)l=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,Gt(a?i+1-o:o,{orphan:l})};if(n){const o=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(r);if(o)return s(+o.groups.num,!!o.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 Gt(r)}return s(+r)}function Ai(e,t,n){const{tokens:r,walk:s}=t,o=t.parent,a=o.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"){const l=s(o,{...n,isCheckingRangeEnd:!0});if(a.type==="Character"&&l.type==="Character")return o.body.pop(),Ti(a,l);throw new Error("Invalid character class range")}return tt(me("-"))}function Ii({negate:e},t,n){const{tokens:r,walk:s}=t,o=[Be()],a=r[t.nextIndex];let i=Pn(a);for(;i.type!=="CharacterClassClose";){if(i.type==="CharacterClassIntersector")o.push(Be()),t.nextIndex++;else{const c=o.at(-1);c.body.push(s(c,n))}i=Pn(r[t.nextIndex],a)}const l=Be({negate:e});return o.length===1?l.body=o[0].body:(l.kind="intersection",l.body=o.map(c=>c.body.length===1?c.body[0]:c)),t.nextIndex++,l}function Ri({kind:e,negate:t,value:n},r){const{normalizeUnknownPropertyNames:s,skipPropertyNameValidation:o,unicodePropertyMap:a}=r;if(e==="property"){const i=nt(n);if(Xt.has(i)&&!a?.has(i))e="posix",n=i;else return fe(n,{negate:t,normalizeUnknownPropertyNames:s,skipPropertyNameValidation:o,unicodePropertyMap:a})}return e==="posix"?Bi(n,{negate:t}):Bt(e,{negate:t})}function Ni(e,t,n){const{tokens:r,capturingGroups:s,namedGroupsByName:o,skipLookbehindValidation:a,walk:i}=t,l=Fi(e),c=l.type==="AbsenceFunction",u=$n(l),h=u&&l.negate;if(l.type==="CapturingGroup"&&(s.push(l),l.name&&Ja(o,l.name,[]).push(l)),c&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let p=Tn(r[t.nextIndex]);for(;p.type!=="GroupClose";){if(p.type==="Alternator")l.body.push(ae()),t.nextIndex++;else{const f=l.body.at(-1),d=i(f,{...n,isInAbsenceFunction:n.isInAbsenceFunction||c,isInLookbehind:n.isInLookbehind||u,isInNegLookbehind:n.isInNegLookbehind||h});if(f.body.push(d),(u||n.isInLookbehind)&&!a){const b="Lookbehind includes a pattern not allowed by Oniguruma";if(h||n.isInNegLookbehind){if(Ln(d)||d.type==="CapturingGroup")throw new Error(b)}else if(Ln(d)||$n(d)&&d.negate)throw new Error(b)}}p=Tn(r[t.nextIndex])}return t.nextIndex++,l}function Li({kind:e,min:t,max:n},r){const s=r.parent,o=s.body.at(-1);if(!o||!ki(o))throw new Error("Quantifier requires a repeatable token");const a=Dr(e,t,n,o);return s.body.pop(),a}function $i({raw:e},t){const{capturingGroups:n,subroutines:r}=t;let s=e.slice(3,-1);const o=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(s);if(o){const i=+o.groups.num,l=n.length;if(t.hasNumberedRef=!0,s={"":i,"+":l+i,"-":l+1-i}[o.groups.sign],s<1)throw new Error("Invalid subroutine number")}else s==="0"&&(s=0);const a=Fr(s);return r.push(a),a}function Pi(e,t){return{type:"AbsenceFunction",kind:e,body:Re(t?.body)}}function ae(e){return{type:"Alternative",body:jr(e?.body)}}function Ot(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function Gt(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function Br(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!ji(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:Re(t?.body)}}function tt(e,t){const n={useLastValid:!1,...t};if(e>1114111){const 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 Be(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:jr(e?.body)}}function Ti(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function Bt(e,t){const 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 Mi(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:ye(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function Oi(e){return{type:"Flags",...e}}function j(e){const 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:Re(e?.body)}}function te(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:Re(e?.body)}}function Gi(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function Bi(e,t){const n=!!t?.negate;if(!Xt.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function Dr(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 Di(e,t){return{type:"Regex",body:Re(t?.body),flags:e}}function Fr(e){return{type:"Subroutine",ref:e}}function fe(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let r=n.unicodePropertyMap?.get(nt(e));if(!r){if(n.normalizeUnknownPropertyNames)r=Ui(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(L`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:r??e,negate:n.negate}}function Fi({flags:e,kind:t,name:n,negate:r,number:s}){switch(t){case"absence_repeater":return Pi("repeater");case"atomic":return j({atomic:!0});case"capturing":return Br(s,{name:n});case"group":return j({flags:e});case"lookahead":case"lookbehind":return te({behind:t==="lookbehind",negate:r});default:throw new Error(`Unexpected group kind "${t}"`)}}function Re(e){if(e===void 0)e=[ae()];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 jr(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 Ln(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function $n(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function ji(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function Ui(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 nt(e){return e.replace(/[- _]+/g,"").toLowerCase()}function Pn(e,t){const n=t;return ye(e,`Unclosed character class${n?.type==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function Tn(e){return ye(e,"Unclosed group")}function _e(e,t,n=null){function r(o,a){for(let i=0;i<o.length;i++){const l=s(o[i],a,i,o);i=Math.max(-1,i+l)}}function s(o,a=null,i=null,l=null){let c=0,u=!1;const h={node:o,parent:a,key:i,container:l,root:e,remove(){Te(l).splice(Math.max(0,ue(i)+c),1),c--,u=!0},removeAllNextSiblings(){return Te(l).splice(ue(i)+1)},removeAllPrevSiblings(){const m=ue(i)+c;return c-=m,Te(l).splice(0,Math.max(0,m))},replaceWith(m,y={}){const C=!!y.traverse;l?l[Math.max(0,ue(i)+c)]=m:ye(a,"Can't replace root node")[i]=m,C&&s(m,a,i,l),u=!0},replaceWithMultiple(m,y={}){const C=!!y.traverse;if(Te(l).splice(Math.max(0,ue(i)+c),1,...m),c+=m.length-1,C){let k=0;for(let v=0;v<m.length;v++)k+=s(m[v],a,ue(i)+v+k,l)}u=!0},skip(){u=!0}},{type:p}=o,f=t["*"],d=t[p],b=typeof f=="function"?f:f?.enter,w=typeof d=="function"?d:d?.enter;if(b?.(h,n),w?.(h,n),!u)switch(p){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":r(o.body,o);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":s(o.min,o,"min"),s(o.max,o,"max");break;case"Quantifier":s(o.body,o,"body");break;case"Regex":r(o.body,o),s(o.flags,o,"flags");break;default:throw new Error(`Unexpected node type "${p}"`)}return d?.exit?.(h,n),f?.exit?.(h,n),c}return s(e),e}function Te(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function ue(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const Wi=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function zi(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function Hi(e,t,n,r){return e.slice(0,t)+r+e.slice(t+n.length)}const F=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function Qt(e,t,n,r){const s=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),o=[!1];let a=0,i="";for(const l of e.matchAll(s)){const{0:c,groups:{$skip:u}}=l;if(!u&&(!r||r===F.DEFAULT==!a)){n instanceof Function?i+=n(l,{context:a?F.CHAR_CLASS:F.DEFAULT,negated:o[o.length-1]}):i+=n;continue}c[0]==="["?(a++,o.push(c[1]==="^")):c==="]"&&a&&(a--,o.pop()),i+=c}return i}function Ur(e,t,n,r){Qt(e,t,n,r)}function qi(e,t,n=0,r){if(!new RegExp(t,"su").test(e))return null;const s=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");s.lastIndex=n;let o=0,a;for(;a=s.exec(e);){const{0:i,groups:{$skip:l}}=a;if(!l&&(!r||r===F.DEFAULT==!o))return a;i==="["?o++:i==="]"&&o&&o--,s.lastIndex==a.index&&s.lastIndex++}return null}function Me(e,t,n){return!!qi(e,t,0,n)}function Vi(e,t){const n=/\\?./gsu;n.lastIndex=t;let r=e.length,s=0,o=1,a;for(;a=n.exec(e);){const[i]=a;if(i==="[")s++;else if(s)i==="]"&&s--;else if(i==="(")o++;else if(i===")"&&(o--,!o)){r=a.index;break}}return e.slice(t,r)}const Mn=new RegExp(String.raw`(?<noncapturingStart>${Wi})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function Xi(e,t){const n=t?.hiddenCaptures??[];let r=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};const s="(?>",o="(?:(?=(",a=[0],i=[];let l=0,c=0,u=NaN,h;do{h=!1;let p=0,f=0,d=!1,b;for(Mn.lastIndex=Number.isNaN(u)?0:u+o.length;b=Mn.exec(e);){const{0:w,index:m,groups:{capturingStart:y,noncapturingStart:C}}=b;if(w==="[")p++;else if(p)w==="]"&&p--;else if(w===s&&!d)u=m,d=!0;else if(d&&C)f++;else if(y)d?f++:(l++,a.push(l+c));else if(w===")"&&d){if(!f){c++;const k=l+c;if(e=`${e.slice(0,u)}${o}${e.slice(u+s.length,m)}))<$$${k}>)${e.slice(m+1)}`,h=!0,i.push(k),zi(n,k),r.size){const v=new Map;r.forEach(($,M)=>{v.set(M>=k?M+1:M,$.map(W=>W>=k?W+1:W))}),r=v}break}f--}}}while(h);return n.push(...i),e=Qt(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:p,groups:{backrefNum:f,wrappedBackrefNum:d}})=>{if(f){const b=+f;if(b>a.length-1)throw new Error(`Backref "${p}" greater than number of captures`);return`\\${a[b]}`}return`\\${d}`},F.DEFAULT),{pattern:e,captureTransfers:r,hiddenCaptures:n}}const Wr=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,mt=new RegExp(String.raw`
45
45
  \\(?: \d+
46
46
  | c[A-Za-z]
47
47
  | [gk]<[^>]+>
@@ -56,7 +56,7 @@ var A=class extends Error{constructor(e){super(e),this.name="ShikiError"}};funct
56
56
  ))?
57
57
  | (?<qBase>${Wr})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
58
58
  | \\?.
59
- `.replace(/\s+/g,""),"gsu");function Ki(e){if(!new RegExp(`${Wr}\\+`).test(e))return{pattern:e};const t=[];let n=null,r=null,s="",o=0,a;for(mt.lastIndex=0;a=mt.exec(e);){const{0:i,index:l,groups:{qBase:c,qMod:u,invalidQ:h}}=a;if(i==="[")o||(r=l),o++;else if(i==="]")o?o--:r=null;else if(!o)if(u==="+"&&s&&!s.startsWith("(")){if(h)throw new Error(`Invalid quantifier "${i}"`);let p=-1;if(/^\{\d+\}$/.test(c))e=Hi(e,l+c.length,u,"");else{if(s===")"||s==="]"){const f=s===")"?n:r;if(f===null)throw new Error(`Invalid unmatched "${s}"`);e=`${e.slice(0,f)}(?>${e.slice(f,l)}${c})${e.slice(l+i.length)}`}else e=`${e.slice(0,l-s.length)}(?>${s}${c})${e.slice(l+i.length)}`;p+=4}mt.lastIndex+=p}else i[0]==="("?t.push(l):i===")"&&(n=t.length?t.pop():null);s=i}return{pattern:e}}const D=String.raw,Qi=D`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Dt=D`\(\?R=(?<rDepth>[^\)]+)\)|${Qi}`,rt=D`\(\?<(?![=!])(?<captureName>[^>]+)>`,zr=D`${rt}|(?<unnamed>\()(?!\?)`,J=new RegExp(D`${rt}|${Dt}|\(\?|\\?.`,"gsu"),yt="Cannot use multiple overlapping recursions";function Zi(e,t){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t};let s=t?.captureTransfers??new Map;if(!new RegExp(Dt,"su").test(e))return{pattern:e,captureTransfers:s,hiddenCaptures:n};if(r==="plugin"&&Me(e,D`\(\?\(DEFINE\)`,F.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const o=[],a=Me(e,D`\\[1-9]`,F.DEFAULT),i=new Map,l=[];let c=!1,u=0,h=0,p;for(J.lastIndex=0;p=J.exec(e);){const{0:f,groups:{captureName:d,rDepth:b,gRNameOrNum:w,gRDepth:m}}=p;if(f==="[")u++;else if(u)f==="]"&&u--;else if(b){if(On(b),c)throw new Error(yt);if(a)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const y=e.slice(0,p.index),C=e.slice(J.lastIndex);if(Me(C,Dt,F.DEFAULT))throw new Error(yt);const k=+b-1;e=Gn(y,C,k,!1,n,o,h),s=Dn(s,y,k,o.length,0,h);break}else if(w){On(m);let y=!1;for(const z of l)if(z.name===w||z.num===+w){if(y=!0,z.hasRecursedWithin)throw new Error(yt);break}if(!y)throw new Error(D`Recursive \g cannot be used outside the referenced group "${r==="external"?w:D`\g<${w}&R=${m}>`}"`);const C=i.get(w),k=Vi(e,C);if(a&&Me(k,D`${rt}|\((?!\?)`,F.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const v=e.slice(C,p.index),$=k.slice(v.length+f.length),M=o.length,W=+m-1,le=Gn(v,$,W,!0,n,o,h);s=Dn(s,v,W,o.length-M,M,h);const ot=e.slice(0,C),at=e.slice(C+k.length);e=`${ot}${le}${at}`,J.lastIndex+=le.length-f.length-v.length-$.length,l.forEach(z=>z.hasRecursedWithin=!0),c=!0}else if(d)h++,i.set(String(h),J.lastIndex),i.set(d,J.lastIndex),l.push({num:h,name:d});else if(f[0]==="("){const y=f==="(";y&&(h++,i.set(String(h),J.lastIndex)),l.push(y?{num:h}:{})}else f===")"&&l.pop()}return n.push(...o),{pattern:e,captureTransfers:s,hiddenCaptures:n}}function On(e){const 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 Gn(e,t,n,r,s,o,a){const i=new Set;r&&Ur(e+t,rt,({groups:{captureName:c}})=>{i.add(c)},F.DEFAULT);const l=[n,r?i:null,s,o,a];return`${e}${Bn(`(?:${e}`,"forward",...l)}(?:)${Bn(`${t})`,"backward",...l)}${t}`}function Bn(e,t,n,r,s,o,a){const l=u=>t==="forward"?u+2:n-u+2-1;let c="";for(let u=0;u<n;u++){const h=l(u);c+=Qt(e,D`${zr}|\\k<(?<backref>[^>]+)>`,({0:p,groups:{captureName:f,unnamed:d,backref:b}})=>{if(b&&r&&!r.has(b))return p;const w=`_$${h}`;if(d||f){const m=a+o.length+1;return o.push(m),Yi(s,m),d?p:`(?<${f}${w}>`}return D`\k<${b}${w}>`},F.DEFAULT)}return c}function Yi(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function Dn(e,t,n,r,s,o){if(e.size&&r){let a=0;Ur(t,zr,()=>a++,F.DEFAULT);const i=o-a+s,l=new Map;return e.forEach((c,u)=>{const h=(r-a*n)/n,p=a*n,f=u>i+a?u+r:u,d=[];for(const b of c)if(b<=i)d.push(b);else if(b>i+a+h)d.push(b+r);else if(b<=i+a)for(let w=0;w<=n;w++)d.push(b+a*w);else for(let w=0;w<=n;w++)d.push(b+p+h*w);l.set(f,d)}),l}return e}var R=String.fromCodePoint,S=String.raw,U={},st=globalThis.RegExp;U.flagGroups=(()=>{try{new st("(?i:)")}catch{return!1}return!0})();U.unicodeSets=(()=>{try{new st("[[]]","v")}catch{return!1}return!0})();U.bugFlagVLiteralHyphenIsRange=U.unicodeSets?(()=>{try{new st(S`[\d\-a]`,"v")}catch{return!0}return!1})():!1;U.bugNestedClassIgnoresNegation=U.unicodeSets&&new st("[[^a]]","v").test("a");function Ke(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function Ae(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Ft(e,t){return Fn[e]>=Fn[t]}function Ji(e,t){if(e==null)throw new Error(t??"Value expected");return e}var Fn={ES2025:2025,ES2024:2024,ES2018:2018},el={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function Hr(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!el[e.target])throw new Error(`Unexpected target "${e.target}"`);const 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=U.flagGroups?"ES2025":U.unicodeSets?"ES2024":"ES2018"),t}var tl="[ -\r ]",nl=new Set([R(304),R(305)]),V=S`[\p{L}\p{M}\p{N}\p{Pc}]`;function qr(e){if(nl.has(e))return[e];const t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),s=ol.get(n),o=rl.get(n),a=sl.get(n);return[...r].length===1&&t.add(r),a&&t.add(a),s&&t.add(s),t.add(n),o&&t.add(o),[...t]}var Zt=new Map(`C Other
59
+ `.replace(/\s+/g,""),"gsu");function Ki(e){if(!new RegExp(`${Wr}\\+`).test(e))return{pattern:e};const t=[];let n=null,r=null,s="",o=0,a;for(mt.lastIndex=0;a=mt.exec(e);){const{0:i,index:l,groups:{qBase:c,qMod:u,invalidQ:h}}=a;if(i==="[")o||(r=l),o++;else if(i==="]")o?o--:r=null;else if(!o)if(u==="+"&&s&&!s.startsWith("(")){if(h)throw new Error(`Invalid quantifier "${i}"`);let p=-1;if(/^\{\d+\}$/.test(c))e=Hi(e,l+c.length,u,"");else{if(s===")"||s==="]"){const f=s===")"?n:r;if(f===null)throw new Error(`Invalid unmatched "${s}"`);e=`${e.slice(0,f)}(?>${e.slice(f,l)}${c})${e.slice(l+i.length)}`}else e=`${e.slice(0,l-s.length)}(?>${s}${c})${e.slice(l+i.length)}`;p+=4}mt.lastIndex+=p}else i[0]==="("?t.push(l):i===")"&&(n=t.length?t.pop():null);s=i}return{pattern:e}}const D=String.raw,Qi=D`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Dt=D`\(\?R=(?<rDepth>[^\)]+)\)|${Qi}`,rt=D`\(\?<(?![=!])(?<captureName>[^>]+)>`,zr=D`${rt}|(?<unnamed>\()(?!\?)`,J=new RegExp(D`${rt}|${Dt}|\(\?|\\?.`,"gsu"),yt="Cannot use multiple overlapping recursions";function Zi(e,t){const{hiddenCaptures:n,mode:r}={hiddenCaptures:[],mode:"plugin",...t};let s=t?.captureTransfers??new Map;if(!new RegExp(Dt,"su").test(e))return{pattern:e,captureTransfers:s,hiddenCaptures:n};if(r==="plugin"&&Me(e,D`\(\?\(DEFINE\)`,F.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const o=[],a=Me(e,D`\\[1-9]`,F.DEFAULT),i=new Map,l=[];let c=!1,u=0,h=0,p;for(J.lastIndex=0;p=J.exec(e);){const{0:f,groups:{captureName:d,rDepth:b,gRNameOrNum:w,gRDepth:m}}=p;if(f==="[")u++;else if(u)f==="]"&&u--;else if(b){if(On(b),c)throw new Error(yt);if(a)throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const y=e.slice(0,p.index),C=e.slice(J.lastIndex);if(Me(C,Dt,F.DEFAULT))throw new Error(yt);const k=+b-1;e=Gn(y,C,k,!1,n,o,h),s=Dn(s,y,k,o.length,0,h);break}else if(w){On(m);let y=!1;for(const z of l)if(z.name===w||z.num===+w){if(y=!0,z.hasRecursedWithin)throw new Error(yt);break}if(!y)throw new Error(D`Recursive \g cannot be used outside the referenced group "${r==="external"?w:D`\g<${w}&R=${m}>`}"`);const C=i.get(w),k=Vi(e,C);if(a&&Me(k,D`${rt}|\((?!\?)`,F.DEFAULT))throw new Error(`${r==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const v=e.slice(C,p.index),$=k.slice(v.length+f.length),M=o.length,W=+m-1,le=Gn(v,$,W,!0,n,o,h);s=Dn(s,v,W,o.length-M,M,h);const ot=e.slice(0,C),at=e.slice(C+k.length);e=`${ot}${le}${at}`,J.lastIndex+=le.length-f.length-v.length-$.length,l.forEach(z=>z.hasRecursedWithin=!0),c=!0}else if(d)h++,i.set(String(h),J.lastIndex),i.set(d,J.lastIndex),l.push({num:h,name:d});else if(f[0]==="("){const y=f==="(";y&&(h++,i.set(String(h),J.lastIndex)),l.push(y?{num:h}:{})}else f===")"&&l.pop()}return n.push(...o),{pattern:e,captureTransfers:s,hiddenCaptures:n}}function On(e){const 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 Gn(e,t,n,r,s,o,a){const i=new Set;r&&Ur(e+t,rt,({groups:{captureName:c}})=>{i.add(c)},F.DEFAULT);const l=[n,r?i:null,s,o,a];return`${e}${Bn(`(?:${e}`,"forward",...l)}(?:)${Bn(`${t})`,"backward",...l)}${t}`}function Bn(e,t,n,r,s,o,a){const l=u=>t==="forward"?u+2:n-u+2-1;let c="";for(let u=0;u<n;u++){const h=l(u);c+=Qt(e,D`${zr}|\\k<(?<backref>[^>]+)>`,({0:p,groups:{captureName:f,unnamed:d,backref:b}})=>{if(b&&r&&!r.has(b))return p;const w=`_$${h}`;if(d||f){const m=a+o.length+1;return o.push(m),Yi(s,m),d?p:`(?<${f}${w}>`}return D`\k<${b}${w}>`},F.DEFAULT)}return c}function Yi(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function Dn(e,t,n,r,s,o){if(e.size&&r){let a=0;Ur(t,zr,()=>a++,F.DEFAULT);const i=o-a+s,l=new Map;return e.forEach((c,u)=>{const h=(r-a*n)/n,p=a*n,f=u>i+a?u+r:u,d=[];for(const b of c)if(b<=i)d.push(b);else if(b>i+a+h)d.push(b+r);else if(b<=i+a)for(let w=0;w<=n;w++)d.push(b+a*w);else for(let w=0;w<=n;w++)d.push(b+p+h*w);l.set(f,d)}),l}return e}var R=String.fromCodePoint,S=String.raw,U={},st=globalThis.RegExp;U.flagGroups=(()=>{try{new st("(?i:)")}catch{return!1}return!0})();U.unicodeSets=(()=>{try{new st("[[]]","v")}catch{return!1}return!0})();U.bugFlagVLiteralHyphenIsRange=U.unicodeSets?(()=>{try{new st(S`[\d\-a]`,"v")}catch{return!0}return!1})():!1;U.bugNestedClassIgnoresNegation=U.unicodeSets&&new st("[[^a]]","v").test("a");function Ke(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function Ee(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function Ft(e,t){return Fn[e]>=Fn[t]}function Ji(e,t){if(e==null)throw new Error(t??"Value expected");return e}var Fn={ES2025:2025,ES2024:2024,ES2018:2018},el={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function Hr(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!el[e.target])throw new Error(`Unexpected target "${e.target}"`);const 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=U.flagGroups?"ES2025":U.unicodeSets?"ES2024":"ES2018"),t}var tl="[ -\r ]",nl=new Set([R(304),R(305)]),V=S`[\p{L}\p{M}\p{N}\p{Pc}]`;function qr(e){if(nl.has(e))return[e];const t=new Set,n=e.toLowerCase(),r=n.toUpperCase(),s=ol.get(n),o=rl.get(n),a=sl.get(n);return[...r].length===1&&t.add(r),a&&t.add(a),s&&t.add(s),t.add(n),o&&t.add(o),[...t]}var Zt=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=>[nt(e),e])),rl=new Map([["s",R(383)],[R(383),"s"]]),sl=new Map([[R(223),R(7838)],[R(107),R(8490)],[R(229),R(8491)],[R(969),R(8486)]]),ol=new Map([Q(453),Q(456),Q(459),Q(498),...bt(8072,8079),...bt(8088,8095),...bt(8104,8111),Q(8124),Q(8140),Q(8188)]),al=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 il(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Q(e){const t=R(e);return[t.toLowerCase(),t]}function bt(e,t){return il(e,t).map(n=>Q(n))}var Vr=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function ll(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};Xr(e);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Ft(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};_e(e,cl,r);const s={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},o={currentFlags:s,prevFlags:null,globalFlags:s,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};_e(e,ul,o);const a={groupsByName:o.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:o.reffedNodesByReferencer};return _e(e,hl,a),e._originMap=o.groupOriginByCopy,e._strategy=r.strategy,e}var cl={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:r,kind:s}=e;if(s==="repeater"){const o=j();o.body[0].body.push(te({negate:!0,body:r}),fe("Any"));const a=j();a.body[0].body.push(Dr("greedy",0,1/0,o)),n(E(a,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){const s=e.body.filter(o=>o.kind==="flags");for(let o=n+1;o<t.body.length;o++){const a=t.body[o];Ae(r,a,[]).push(...s)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){const n=Qr(t.get(e));if(n){const r=j({flags:n});r.body[0].body=e.body,e.body=[E(r,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:s,remove:o,replaceWith:a},i){const{kind:l,negate:c}=e,{asciiWordBoundaries:u,avoidSubclass:h,supportedGNodes:p,wordIsAscii:f}=i;if(l==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${c?"Y":"y"}"`);if(l==="line_end")a(E(te({body:[ae({body:[Ot("string_end")]}),ae({body:[tt(10)]})]}),t));else if(l==="line_start")a(E(X(S`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(l==="search_start")if(p.has(e))s.flags.sticky=!0,o();else{const d=r[n-1];if(d&&yl(d))a(E(te({negate:!0}),t));else{if(h)throw new Error(S`Uses "\G" in a way that requires a subclass`);a(Z(Ot("string_start"),t)),i.strategy="clip_search"}}else if(!(l==="string_end"||l==="string_start"))if(l==="string_end_newline")a(E(X(S`(?=\n?\z)`),t));else if(l==="word_boundary"){if(!f&&!u){const d=`(?:(?<=${V})(?!${V})|(?<!${V})(?=${V}))`,b=`(?:(?<=${V})(?=${V})|(?<!${V})(?!${V}))`;a(E(X(c?b:d),t))}}else throw new Error(`Unexpected assertion kind "${l}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Ct(n)&&(n=wt(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!Ct(r)&&(r=wt(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"){const r=Be({body:[e]});n(E(r,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:s,digitIsAscii:o,spaceIsAscii:a,wordIsAscii:i}){const{kind:l,negate:c,value:u}=e;if(o&&(l==="digit"||u==="digit")){n(Z(Bt("digit",{negate:c}),t));return}if(a&&(l==="space"||u==="space")){n(E(_t(X(tl),c),t));return}if(i&&(l==="word"||u==="word")){n(Z(Bt("word",{negate:c}),t));return}if(l==="any")n(Z(fe("Any"),t));else if(l==="digit")n(Z(fe("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`);const h="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",p=S`\p{RI}{2}|${h}(?:\u200D${h})*`;n(E(X(S`(?>\r\n|${s?S`\p{RGI_Emoji}`:p}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(l==="hex")n(Z(fe("AHex",{negate:c}),t));else if(l==="newline")n(E(X(c?`[^
149
+ XID_Start XIDS`.split(/\s/).map(e=>[nt(e),e])),rl=new Map([["s",R(383)],[R(383),"s"]]),sl=new Map([[R(223),R(7838)],[R(107),R(8490)],[R(229),R(8491)],[R(969),R(8486)]]),ol=new Map([Q(453),Q(456),Q(459),Q(498),...bt(8072,8079),...bt(8088,8095),...bt(8104,8111),Q(8124),Q(8140),Q(8188)]),al=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 il(e,t){const n=[];for(let r=e;r<=t;r++)n.push(r);return n}function Q(e){const t=R(e);return[t.toLowerCase(),t]}function bt(e,t){return il(e,t).map(n=>Q(n))}var Vr=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function ll(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};Xr(e);const r={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:Ft(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};_e(e,cl,r);const s={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},o={currentFlags:s,prevFlags:null,globalFlags:s,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:r.subroutineRefMap};_e(e,ul,o);const a={groupsByName:o.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:o.reffedNodesByReferencer};return _e(e,hl,a),e._originMap=o.groupOriginByCopy,e._strategy=r.strategy,e}var cl={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:r,kind:s}=e;if(s==="repeater"){const o=j();o.body[0].body.push(te({negate:!0,body:r}),fe("Any"));const a=j();a.body[0].body.push(Dr("greedy",0,1/0,o)),n(A(a,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:r}){const s=e.body.filter(o=>o.kind==="flags");for(let o=n+1;o<t.body.length;o++){const a=t.body[o];Ee(r,a,[]).push(...s)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){const n=Qr(t.get(e));if(n){const r=j({flags:n});r.body[0].body=e.body,e.body=[A(r,e)]}}}},Assertion({node:e,parent:t,key:n,container:r,root:s,remove:o,replaceWith:a},i){const{kind:l,negate:c}=e,{asciiWordBoundaries:u,avoidSubclass:h,supportedGNodes:p,wordIsAscii:f}=i;if(l==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${c?"Y":"y"}"`);if(l==="line_end")a(A(te({body:[ae({body:[Ot("string_end")]}),ae({body:[tt(10)]})]}),t));else if(l==="line_start")a(A(X(S`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(l==="search_start")if(p.has(e))s.flags.sticky=!0,o();else{const d=r[n-1];if(d&&yl(d))a(A(te({negate:!0}),t));else{if(h)throw new Error(S`Uses "\G" in a way that requires a subclass`);a(Z(Ot("string_start"),t)),i.strategy="clip_search"}}else if(!(l==="string_end"||l==="string_start"))if(l==="string_end_newline")a(A(X(S`(?=\n?\z)`),t));else if(l==="word_boundary"){if(!f&&!u){const d=`(?:(?<=${V})(?!${V})|(?<!${V})(?=${V}))`,b=`(?:(?<=${V})(?=${V})|(?<!${V})(?!${V}))`;a(A(X(c?b:d),t))}}else throw new Error(`Unexpected assertion kind "${l}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Ct(n)&&(n=wt(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:r}=e;r&&!Ct(r)&&(r=wt(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"){const r=Be({body:[e]});n(A(r,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:r,minTargetEs2024:s,digitIsAscii:o,spaceIsAscii:a,wordIsAscii:i}){const{kind:l,negate:c,value:u}=e;if(o&&(l==="digit"||u==="digit")){n(Z(Bt("digit",{negate:c}),t));return}if(a&&(l==="space"||u==="space")){n(A(_t(X(tl),c),t));return}if(i&&(l==="word"||u==="word")){n(Z(Bt("word",{negate:c}),t));return}if(l==="any")n(Z(fe("Any"),t));else if(l==="digit")n(Z(fe("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`);const h="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",p=S`\p{RI}{2}|${h}(?:\u200D${h})*`;n(A(X(S`(?>\r\n|${s?S`\p{RGI_Emoji}`:p}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(l==="hex")n(Z(fe("AHex",{negate:c}),t));else if(l==="newline")n(A(X(c?`[^
150
150
  ]`:`(?>\r
151
151
  ?|[
152
- \v\f…\u2028\u2029])`),t));else if(l==="posix")if(!s&&(u==="graph"||u==="print")){if(r==="strict")throw new Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let h={graph:"!-~",print:" -~"}[u];c&&(h=`\0-${R(h.codePointAt(0)-1)}${R(h.codePointAt(2)+1)}-􏿿`),n(E(X(`[${h}]`),t))}else n(E(_t(X(al.get(u)),c),t));else if(l==="property")Zt.has(nt(u))||(e.key="sc");else if(l==="space")n(Z(fe("space",{negate:c}),t));else if(l==="word")n(E(_t(X(V),c),t));else throw new Error(`Unexpected character set kind "${l}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:s,removeAllPrevSiblings:o,removeAllNextSiblings:a}){const{kind:i,flags:l}=e;if(i==="flags")if(!l.enable&&!l.disable)r();else{const c=j({flags:l});c.body[0].body=a(),s(E(c,t),{traverse:!0})}else if(i==="keep"){const c=n.body[0],h=n.body.length===1&&Or(c,{type:"Group"})&&c.body[0].body.length===1?c.body[0]:n;if(t.parent!==h||h.body.length>1)throw new Error(S`Uses "\K" in a way that's unsupported`);const p=te({behind:!0});p.body[0].body=o(),s(E(p,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;const{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){const{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){const{kind:r}=e;if(r==="fail")n(E(te({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=j();t.body[0].body.push(e.body),e.body=E(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let r=!1,s=!1;for(const o of e.body)if(o.body.length===1&&o.body[0].kind==="search_start")o.body.pop();else{const a=Yr(o.body);a?(r=!0,Array.isArray(a)?n.push(...a):n.push(a)):s=!0}r&&!s&&n.forEach(o=>t.add(o))},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"&&!Ct(n)&&(n=wt(n,t),e.ref=n)}},ul={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:r,ref:s}=e;r||n.set(e,[...t.get(s).map(({node:o})=>o)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:s,groupsByName:o,multiplexCapturesToLeftByRef:a,openRefs:i,reffedNodesByReferencer:l}){const c=s.get(e);if(c&&i.has(e.number)){const h=Z(jn(e.number),t);l.set(h,i.get(e.number)),n(h);return}i.set(e.number,e),a.set(e.number,[]),e.name&&Ae(a,e.name,[]);const u=a.get(e.name??e.number);for(let h=0;h<u.length;h++){const p=u[h];if(c===p.node||c&&c===p.origin||e===p.origin){u.splice(h,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){const h=Ae(o,e.name,new Map);let p=!1;if(c)p=!0;else for(const f of h.values())if(!f.hasDuplicateNameToRemove){p=!0;break}o.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:p})}},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=Ke(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){const{isRecursive:s,ref:o}=e;if(s){let u=t;for(;(u=u.parent)&&!(u.type==="CapturingGroup"&&(u.name===o||u.number===o)););r.reffedNodesByReferencer.set(e,u);return}const a=r.subroutineRefMap.get(o),i=o===0,l=i?jn(0):Kr(a,r.groupOriginByCopy,null);let c=l;if(!i){const u=Qr(dl(a,p=>p.type==="Group"&&!!p.flags)),h=u?Ke(r.globalFlags,u):r.globalFlags;pl(h,r.currentFlags)||(c=j({flags:gl(h)}),c.body[0].body.push(l))}n(E(c,t),{traverse:!i})}},hl={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}const o=r.reffedNodesByReferencer.get(e).filter(a=>fl(a,e));if(!o.length)n(E(te({negate:!0}),t));else if(o.length>1){const a=j({atomic:!0,body:o.reverse().map(i=>ae({body:[Gt(i.number)]}))});n(E(a,t))}else e.ref=o[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){const n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let r=0;r<n;r++){const s=Br();e.body.at(-1).body.push(s)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function Xr(e){_e(e,{"*"({node:t,parent:n}){t.parent=n}})}function pl(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function fl(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const r=Zr(n.parent);for(const s of r){if(s===n)break;if(s===e||Jr(s,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function Kr(e,t,n,r){const s=Array.isArray(e)?[]:{};for(const[o,a]of Object.entries(e))o==="parent"?s.parent=Array.isArray(n)?r:n:a&&typeof a=="object"?s[o]=Kr(a,t,s,n):(o==="type"&&a==="CapturingGroup"&&t.set(s,t.get(e)??e),s[o]=a);return s}function jn(e){const t=Fr(e);return t.isRecursive=!0,t}function dl(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function wt(e,t){if(t.has(e))return t.get(e);const n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,n),n}function Qr(e){const t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return e.forEach(({flags:r})=>{t.forEach(s=>{r.enable?.[s]&&(delete n.disable[s],n.enable[s]=!0),r.disable?.[s]&&(n.disable[s]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function gl({dotAll:e,ignoreCase:t}){const 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 Zr(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function Yr(e){const t=e.find(n=>n.kind==="search_start"||bl(n,{negate:!1})||!ml(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"){const n=[];for(const r of t.body){const s=Yr(r.body);if(!s)return null;Array.isArray(s)?n.push(...s):n.push(s)}return n}return null}function Jr(e,t){const n=Zr(e)??[];for(const r of n)if(r===t||Jr(r,t))return!0;return!1}function ml({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function yl(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function bl(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&Or(e.body[0],{type:"Assertion",kind:"search_start"})}function Ct(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function X(e,t){const r=Gr(e,{...t,unicodePropertyMap:Zt}).body;return r.length>1||r[0].body.length>1?j({body:r}):r[0].body[0]}function _t(e,t){return e.negate=t,e}function Z(e,t){return e.parent=t,e}function E(e,t){return Xr(e),e.parent=t,e}function wl(e,t){const n=Hr(t),r=Ft(n.target,"ES2024"),s=Ft(n.target,"ES2025"),o=n.rules.recursionLimit;if(!Number.isInteger(o)||o<2||o>20)throw new Error("Invalid recursionLimit; use 2-20");let a=null,i=null;if(!s){const f=[e.flags.ignoreCase];_e(e,Cl,{getCurrentModI:()=>f.at(-1),popModI(){f.pop()},pushModI(d){f.push(d)},setHasCasedChar(){f.at(-1)?a=!0:i=!0}})}const l={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||a)&&!i)};let c=e;const 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:o,useAppliedIgnoreCase:!!(!s&&a&&i),useFlagMods:s,useFlagV:r,verbose:n.verbose};function h(f){return u.lastNode=c,c=f,Ji(_l[f.type],`Unexpected node type "${f.type}"`)(f,u,h)}const p={pattern:e.body.map(h).join("|"),flags:h(e.flags),options:{...e.options}};return r||(delete p.options.force.v,p.options.disable.v=!0,p.options.unicodeSetsPlugin=null),p._captureTransfers=new Map,p._hiddenCaptures=[],u.captureMap.forEach((f,d)=>{f.hidden&&p._hiddenCaptures.push(d),f.transferTo&&Ae(p._captureTransfers,f.transferTo,[]).push(d)}),p}var Cl={"*":{enter({node:e},t){if(Wn(e)){const n=t.getCurrentModI();t.pushModI(e.flags?Ke({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){Wn(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){Yt(R(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),es(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&Vr.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){const{body:r,name:s,number:o}=e,a={ignoreCase:t.currentFlags.ignoreCase},i=t.originMap.get(e);return i&&(a.hidden=!0,o>i.number&&(a.transferTo=i.number)),t.captureMap.set(o,a),`(${s?`?<${s}>`:""}${r.map(n).join("|")})`},Character({value:e},t){const n=R(e),r=he(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Yt(n)){const s=qr(n);return t.inCharClass?s.join(""):s.length>1?`[${s.join("")}]`:s[0]}return n},CharacterClass(e,t,n){const{kind:r,negate:s,parent:o}=e;let{body:a}=e;if(r==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");U.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&a.some(zn)&&(a=[tt(45),...a.filter(c=>!zn(c))]);const i=()=>`[${s?"^":""}${a.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||U.bugNestedClassIgnoresNegation)&&!s){const u=a.filter(h=>h.type==="CharacterClass"&&h.kind==="union"&&h.negate);if(u.length){const h=j(),p=h.body[0];return h.parent=o,p.parent=h,a=a.filter(f=>!u.includes(f)),e.body=a,a.length?(e.parent=p,p.body.push(e)):h.body.pop(),u.forEach(f=>{const d=ae({body:[f]});f.parent=d,d.parent=h,h.body.push(d)}),n(h)}}t.inCharClass=!0;const c=i();return t.inCharClass=!1,c}const l=a[0];if(r==="union"&&!s&&l&&((!t.useFlagV||!t.verbose)&&o.kind==="union"&&!(U.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&o.kind==="intersection"&&a.length===1&&l.type!=="CharacterClassRange"))return a.map(n).join("");if(!t.useFlagV&&o.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return i()},CharacterClassRange(e,t){const n=e.min.value,r=e.max.value,s={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},o=he(n,s),a=he(r,s),i=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const l=es(e);Al(l).forEach(u=>{i.add(Array.isArray(u)?`${he(u[0],s)}-${he(u[1],s)}`:he(u,s))})}return`${o}-${a}${[...i].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},s){if(e==="dot")return s.currentFlags.dotAll?s.appliedGlobalFlags.dotAll||s.useFlagMods?".":"[^]":S`[^\n]`;if(e==="digit")return t?S`\D`:S`\d`;if(e==="property"){if(s.useAppliedIgnoreCase&&s.currentFlags.ignoreCase&&Vr.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},s,o){const a=s.currentFlags;n&&(s.currentFlags=Ke(a,n));const i=t.map(o).join("|"),l=!s.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!s.useFlagMods||!n)?i:`(?${El(e,n,s.useFlagMods)}${i})`;return s.currentFlags=a,l},LookaroundAssertion({body:e,kind:t,negate:n},r,s){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(s).join("|")})`},Quantifier(e,t,n){return n(e.body)+Il(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const r=n.recursionLimit;return t===0?`(?R=${r})`:S`\g<${t}&R=${r}>`}},Sl=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),kl=new Set(["-","\\","]","^","["]),vl=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),Un=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`]]),xl=new RegExp("^\\p{Cased}$","u");function Yt(e){return xl.test(e)}function es(e,t){const n=!!t?.firstOnly,r=e.min.value,s=e.max.value,o=[];if(r<65&&(s===65535||s>=131071)||r===65536&&s>=131071)return o;for(let a=r;a<=s;a++){const i=R(a);if(!Yt(i))continue;const l=qr(i).filter(c=>{const u=c.codePointAt(0);return u<r||u>s});if(l.length&&(o.push(...l),n))break}return o}function he(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(Un.has(e))return Un.get(e);if(e<32||e>126&&e<160||e>262143||t&&Rl(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const s=n?r?vl:kl:Sl,o=R(e);return(s.has(o)?"\\":"")+o}function Al(e){const t=e.map(s=>s.codePointAt(0)).sort((s,o)=>s-o),n=[];let r=null;for(let s=0;s<t.length;s++)t[s+1]===t[s]+1?r??=t[s]:r===null?n.push(t[s]):(n.push([r,t[s]]),r=null);return n}function El(e,t,n){if(e)return">";let r="";if(t&&n){const{enable:s,disable:o}=t;r=(s?.ignoreCase?"i":"")+(s?.dotAll?"s":"")+(o?"-":"")+(o?.ignoreCase?"i":"")+(o?.dotAll?"s":"")}return`${r}:`}function Il({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 Wn({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function Rl(e){return e>47&&e<58}function zn({type:e,value:t}){return e==="Character"&&t===45}var Nl=class jt extends RegExp{#t=new Map;#e=null;#r;#n=null;#s=null;rawOptions={};get source(){return this.#r||"(?:)"}constructor(t,n,r){const s=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw new Error("Cannot provide options when copying a regexp");const o=t;super(o,n),this.#r=o.source,o instanceof jt&&(this.#t=o.#t,this.#n=o.#n,this.#s=o.#s,this.rawOptions=o.rawOptions)}else{const o={hiddenCaptures:[],strategy:null,transfers:[],...r};super(s?"":t,n),this.#r=t,this.#t=$l(o.hiddenCaptures,o.transfers),this.#s=o.strategy,this.rawOptions=r??{}}s||(this.#e=this)}exec(t){if(!this.#e){const{lazyCompile:s,...o}=this.rawOptions;this.#e=new jt(this.#r,this.flags,o)}const n=this.global||this.sticky,r=this.lastIndex;if(this.#s==="clip_search"&&n&&r){this.lastIndex=0;const s=this.#o(t.slice(r));return s&&(Ll(s,r,t,this.hasIndices),this.lastIndex+=r),s}return this.#o(t)}#o(t){this.#e.lastIndex=this.lastIndex;const n=super.exec.call(this.#e,t);if(this.lastIndex=this.#e.lastIndex,!n||!this.#t.size)return n;const r=[...n];n.length=1;let s;this.hasIndices&&(s=[...n.indices],n.indices.length=1);const o=[0];for(let a=1;a<r.length;a++){const{hidden:i,transferTo:l}=this.#t.get(a)??{};if(i?o.push(null):(o.push(n.length),n.push(r[a]),this.hasIndices&&n.indices.push(s[a])),l&&r[a]!==void 0){const c=o[l];if(!c)throw new Error(`Invalid capture transfer to "${c}"`);if(n[c]=r[a],this.hasIndices&&(n.indices[c]=s[a]),n.groups){this.#n||(this.#n=Pl(this.source));const u=this.#n.get(l);u&&(n.groups[u]=r[a],this.hasIndices&&(n.indices.groups[u]=s[a]))}}}return n}};function Ll(e,t,n,r){if(e.index+=t,e.input=n,r){const s=e.indices;for(let a=0;a<s.length;a++){const i=s[a];i&&(s[a]=[i[0]+t,i[1]+t])}const o=s.groups;o&&Object.keys(o).forEach(a=>{const i=o[a];i&&(o[a]=[i[0]+t,i[1]+t])})}}function $l(e,t){const n=new Map;for(const r of e)n.set(r,{hidden:!0});for(const[r,s]of t)for(const o of s)Ae(n,o,{}).transferTo=r;return n}function Pl(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,s=0,o;for(;o=t.exec(e);){const{0:a,groups:{capture:i,name:l}}=o;a==="["?r++:r?a==="]"&&r--:i&&(s++,l&&n.set(s,l))}return n}function Tl(e,t){const n=Ml(e,t);return n.options?new Nl(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function Ml(e,t){const n=Hr(t),r=Gr(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:Zt}),s=ll(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),o=wl(s,n),a=Zi(o.pattern,{captureTransfers:o._captureTransfers,hiddenCaptures:o._hiddenCaptures,mode:"external"}),i=Ki(a.pattern),l=Xi(i.pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),c={pattern:l.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${o.flags}${o.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const u=l.hiddenCaptures.sort((d,b)=>d-b),h=Array.from(l.captureTransfers),p=s._strategy,f=c.pattern.length>=n.lazyCompileLength;(u.length||h.length||p||f)&&(c.options={...u.length&&{hiddenCaptures:u},...h.length&&{transfers:h},...p&&{strategy:p},...f&&{lazyCompile:f}})}return c}function Ol(e,t){return Tl(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function Gl(e={}){const t={target:"auto",cache:new Map,...e};return t.regexConstructor||=n=>Ol(n,{target:t.target}),{createScanner(n){return new Ya(n,t)},createString(n){return{content:n}}}}const ts=new Set(["text","plaintext","txt"]),ns=new Map(Object.entries({c:()=>import("./c-BG-tZi7o.js"),cpp:()=>import("./cpp-CaeG3uDQ.js"),css:()=>import("./css-Br67jR8j.js"),diff:()=>import("./diff-jW5kmiru.js"),go:()=>import("./go-B7VTfpnm.js"),html:()=>import("./html-BW_6VhB7.js"),ini:()=>import("./ini-Dix3pTmg.js"),java:()=>import("./java-BTDmaRNO.js"),javascript:()=>import("./javascript-WyGyM1wV.js"),json:()=>import("./json-B8JryHcM.js"),jsx:()=>import("./jsx-8cLv2Six.js"),log:()=>import("./log-CcaF_xNv.js"),markdown:()=>import("./markdown-DX-TNHnc.js"),php:()=>import("./php-CNeTOyEV.js"),python:()=>import("./python-B6Ihcp-E.js"),ruby:()=>import("./ruby-CYiNE6ps.js"),rust:()=>import("./rust-CxuBE0J8.js"),shellscript:()=>import("./shellscript-DgJyDXW6.js"),sql:()=>import("./sql-Dq2MiB0T.js"),toml:()=>import("./toml-Ms459DBw.js"),tsx:()=>import("./tsx-D6116Ycy.js"),typescript:()=>import("./typescript-BqvgUolh.js"),xml:()=>import("./xml-BkAJuBCc.js"),yaml:()=>import("./yaml-Bopit2L3.js")})),Bl=new Map(Object.entries({"c++":"cpp",bash:"shellscript",cjs:"javascript",cts:"typescript",js:"javascript",md:"markdown",mjs:"javascript",mts:"typescript",properties:"ini",py:"python",rb:"ruby",rs:"rust",sh:"shellscript",shell:"shellscript",ts:"typescript",yml:"yaml",zsh:"shellscript"}));new Map(Object.entries({html:"html",htm:"html",css:"css",js:"javascript",mjs:"javascript",cjs:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",json:"json",md:"markdown",py:"python",rb:"ruby",php:"php",go:"go",rs:"rust",java:"java",c:"c",h:"c",cpp:"cpp",hpp:"cpp",sh:"shellscript",bash:"shellscript",yml:"yaml",yaml:"yaml",toml:"toml",ini:"ini",conf:"ini",xml:"xml",sql:"sql",log:"log"}));const Dl="text";function Fl(e){const t=e.trim().toLowerCase();if(!t||ts.has(t))return Dl;const n=Bl.get(t)??t;return ns.has(n)?n:void 0}function jl(e){return ts.has(e)}let Hn;const St=new Map;function Ul(){return Hn??=Za({themes:[import("./github-light-Rcb2q3L5.js"),import("./github-dark-BQV5ugrc.js")],langs:[],engine:Gl()}),Hn}function Wl(e,t,n){let r=St.get(t);return r||(r=n().then(s=>e.loadLanguage(s.default)).then(()=>{}).catch(s=>{throw St.delete(t),s}),St.set(t,r)),r}const zl={code(e){e.children=e.children.filter(t=>t.type!=="text")}};async function Hl(e,t,n){const r=Fl(t);if(!r)return;const s=await Ul(),o=jl(r)?void 0:ns.get(r);return o&&await Wl(s,r,o),s.codeToHtml(e,{lang:r,themes:{light:"github-light",dark:"github-dark"},...n?{transformers:[zl]}:{}})}self.onmessage=e=>{const{id:t,code:n,language:r,blockLines:s}=e.data;Hl(n,r,s).then(o=>{const a=o===void 0?{id:t}:{id:t,html:o};self.postMessage(a)},o=>{const a={id:t,error:o instanceof Error?o.message:"failed"};self.postMessage(a)})};
152
+ \v\f…\u2028\u2029])`),t));else if(l==="posix")if(!s&&(u==="graph"||u==="print")){if(r==="strict")throw new Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let h={graph:"!-~",print:" -~"}[u];c&&(h=`\0-${R(h.codePointAt(0)-1)}${R(h.codePointAt(2)+1)}-􏿿`),n(A(X(`[${h}]`),t))}else n(A(_t(X(al.get(u)),c),t));else if(l==="property")Zt.has(nt(u))||(e.key="sc");else if(l==="space")n(Z(fe("space",{negate:c}),t));else if(l==="word")n(A(_t(X(V),c),t));else throw new Error(`Unexpected character set kind "${l}"`)},Directive({node:e,parent:t,root:n,remove:r,replaceWith:s,removeAllPrevSiblings:o,removeAllNextSiblings:a}){const{kind:i,flags:l}=e;if(i==="flags")if(!l.enable&&!l.disable)r();else{const c=j({flags:l});c.body[0].body=a(),s(A(c,t),{traverse:!0})}else if(i==="keep"){const c=n.body[0],h=n.body.length===1&&Or(c,{type:"Group"})&&c.body[0].body.length===1?c.body[0]:n;if(t.parent!==h||h.body.length>1)throw new Error(S`Uses "\K" in a way that's unsupported`);const p=te({behind:!0});p.body[0].body=o(),s(A(p,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;const{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){const{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){const{kind:r}=e;if(r==="fail")n(A(te({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${r.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=j();t.body[0].body.push(e.body),e.body=A(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let r=!1,s=!1;for(const o of e.body)if(o.body.length===1&&o.body[0].kind==="search_start")o.body.pop();else{const a=Yr(o.body);a?(r=!0,Array.isArray(a)?n.push(...a):n.push(a)):s=!0}r&&!s&&n.forEach(o=>t.add(o))},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"&&!Ct(n)&&(n=wt(n,t),e.ref=n)}},ul={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:r,ref:s}=e;r||n.set(e,[...t.get(s).map(({node:o})=>o)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:r},{groupOriginByCopy:s,groupsByName:o,multiplexCapturesToLeftByRef:a,openRefs:i,reffedNodesByReferencer:l}){const c=s.get(e);if(c&&i.has(e.number)){const h=Z(jn(e.number),t);l.set(h,i.get(e.number)),n(h);return}i.set(e.number,e),a.set(e.number,[]),e.name&&Ee(a,e.name,[]);const u=a.get(e.name??e.number);for(let h=0;h<u.length;h++){const p=u[h];if(c===p.node||c&&c===p.origin||e===p.origin){u.splice(h,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){const h=Ee(o,e.name,new Map);let p=!1;if(c)p=!0;else for(const f of h.values())if(!f.hasDuplicateNameToRemove){p=!0;break}o.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:p})}},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=Ke(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},r){const{isRecursive:s,ref:o}=e;if(s){let u=t;for(;(u=u.parent)&&!(u.type==="CapturingGroup"&&(u.name===o||u.number===o)););r.reffedNodesByReferencer.set(e,u);return}const a=r.subroutineRefMap.get(o),i=o===0,l=i?jn(0):Kr(a,r.groupOriginByCopy,null);let c=l;if(!i){const u=Qr(dl(a,p=>p.type==="Group"&&!!p.flags)),h=u?Ke(r.globalFlags,u):r.globalFlags;pl(h,r.currentFlags)||(c=j({flags:gl(h)}),c.body[0].body.push(l))}n(A(c,t),{traverse:!i})}},hl={Backreference({node:e,parent:t,replaceWith:n},r){if(e.orphan){r.highestOrphanBackref=Math.max(r.highestOrphanBackref,e.ref);return}const o=r.reffedNodesByReferencer.get(e).filter(a=>fl(a,e));if(!o.length)n(A(te({negate:!0}),t));else if(o.length>1){const a=j({atomic:!0,body:o.reverse().map(i=>ae({body:[Gt(i.number)]}))});n(A(a,t))}else e.ref=o[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){const n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let r=0;r<n;r++){const s=Br();e.body.at(-1).body.push(s)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function Xr(e){_e(e,{"*"({node:t,parent:n}){t.parent=n}})}function pl(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function fl(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const r=Zr(n.parent);for(const s of r){if(s===n)break;if(s===e||Jr(s,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function Kr(e,t,n,r){const s=Array.isArray(e)?[]:{};for(const[o,a]of Object.entries(e))o==="parent"?s.parent=Array.isArray(n)?r:n:a&&typeof a=="object"?s[o]=Kr(a,t,s,n):(o==="type"&&a==="CapturingGroup"&&t.set(s,t.get(e)??e),s[o]=a);return s}function jn(e){const t=Fr(e);return t.isRecursive=!0,t}function dl(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function wt(e,t){if(t.has(e))return t.get(e);const n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,n),n}function Qr(e){const t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return e.forEach(({flags:r})=>{t.forEach(s=>{r.enable?.[s]&&(delete n.disable[s],n.enable[s]=!0),r.disable?.[s]&&(n.disable[s]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function gl({dotAll:e,ignoreCase:t}){const 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 Zr(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function Yr(e){const t=e.find(n=>n.kind==="search_start"||bl(n,{negate:!1})||!ml(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"){const n=[];for(const r of t.body){const s=Yr(r.body);if(!s)return null;Array.isArray(s)?n.push(...s):n.push(s)}return n}return null}function Jr(e,t){const n=Zr(e)??[];for(const r of n)if(r===t||Jr(r,t))return!0;return!1}function ml({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function yl(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function bl(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&Or(e.body[0],{type:"Assertion",kind:"search_start"})}function Ct(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function X(e,t){const r=Gr(e,{...t,unicodePropertyMap:Zt}).body;return r.length>1||r[0].body.length>1?j({body:r}):r[0].body[0]}function _t(e,t){return e.negate=t,e}function Z(e,t){return e.parent=t,e}function A(e,t){return Xr(e),e.parent=t,e}function wl(e,t){const n=Hr(t),r=Ft(n.target,"ES2024"),s=Ft(n.target,"ES2025"),o=n.rules.recursionLimit;if(!Number.isInteger(o)||o<2||o>20)throw new Error("Invalid recursionLimit; use 2-20");let a=null,i=null;if(!s){const f=[e.flags.ignoreCase];_e(e,Cl,{getCurrentModI:()=>f.at(-1),popModI(){f.pop()},pushModI(d){f.push(d)},setHasCasedChar(){f.at(-1)?a=!0:i=!0}})}const l={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||a)&&!i)};let c=e;const 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:o,useAppliedIgnoreCase:!!(!s&&a&&i),useFlagMods:s,useFlagV:r,verbose:n.verbose};function h(f){return u.lastNode=c,c=f,Ji(_l[f.type],`Unexpected node type "${f.type}"`)(f,u,h)}const p={pattern:e.body.map(h).join("|"),flags:h(e.flags),options:{...e.options}};return r||(delete p.options.force.v,p.options.disable.v=!0,p.options.unicodeSetsPlugin=null),p._captureTransfers=new Map,p._hiddenCaptures=[],u.captureMap.forEach((f,d)=>{f.hidden&&p._hiddenCaptures.push(d),f.transferTo&&Ee(p._captureTransfers,f.transferTo,[]).push(d)}),p}var Cl={"*":{enter({node:e},t){if(Wn(e)){const n=t.getCurrentModI();t.pushModI(e.flags?Ke({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){Wn(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){Yt(R(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),es(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&Vr.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){const{body:r,name:s,number:o}=e,a={ignoreCase:t.currentFlags.ignoreCase},i=t.originMap.get(e);return i&&(a.hidden=!0,o>i.number&&(a.transferTo=i.number)),t.captureMap.set(o,a),`(${s?`?<${s}>`:""}${r.map(n).join("|")})`},Character({value:e},t){const n=R(e),r=he(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(r!==n)return r;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Yt(n)){const s=qr(n);return t.inCharClass?s.join(""):s.length>1?`[${s.join("")}]`:s[0]}return n},CharacterClass(e,t,n){const{kind:r,negate:s,parent:o}=e;let{body:a}=e;if(r==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");U.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&a.some(zn)&&(a=[tt(45),...a.filter(c=>!zn(c))]);const i=()=>`[${s?"^":""}${a.map(n).join(r==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||U.bugNestedClassIgnoresNegation)&&!s){const u=a.filter(h=>h.type==="CharacterClass"&&h.kind==="union"&&h.negate);if(u.length){const h=j(),p=h.body[0];return h.parent=o,p.parent=h,a=a.filter(f=>!u.includes(f)),e.body=a,a.length?(e.parent=p,p.body.push(e)):h.body.pop(),u.forEach(f=>{const d=ae({body:[f]});f.parent=d,d.parent=h,h.body.push(d)}),n(h)}}t.inCharClass=!0;const c=i();return t.inCharClass=!1,c}const l=a[0];if(r==="union"&&!s&&l&&((!t.useFlagV||!t.verbose)&&o.kind==="union"&&!(U.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&o.kind==="intersection"&&a.length===1&&l.type!=="CharacterClassRange"))return a.map(n).join("");if(!t.useFlagV&&o.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return i()},CharacterClassRange(e,t){const n=e.min.value,r=e.max.value,s={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},o=he(n,s),a=he(r,s),i=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const l=es(e);El(l).forEach(u=>{i.add(Array.isArray(u)?`${he(u[0],s)}-${he(u[1],s)}`:he(u,s))})}return`${o}-${a}${[...i].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:r},s){if(e==="dot")return s.currentFlags.dotAll?s.appliedGlobalFlags.dotAll||s.useFlagMods?".":"[^]":S`[^\n]`;if(e==="digit")return t?S`\D`:S`\d`;if(e==="property"){if(s.useAppliedIgnoreCase&&s.currentFlags.ignoreCase&&Vr.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},s,o){const a=s.currentFlags;n&&(s.currentFlags=Ke(a,n));const i=t.map(o).join("|"),l=!s.verbose&&t.length===1&&r.type!=="Quantifier"&&!e&&(!s.useFlagMods||!n)?i:`(?${Al(e,n,s.useFlagMods)}${i})`;return s.currentFlags=a,l},LookaroundAssertion({body:e,kind:t,negate:n},r,s){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(s).join("|")})`},Quantifier(e,t,n){return n(e.body)+Il(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const r=n.recursionLimit;return t===0?`(?R=${r})`:S`\g<${t}&R=${r}>`}},Sl=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),kl=new Set(["-","\\","]","^","["]),vl=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),Un=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`]]),xl=new RegExp("^\\p{Cased}$","u");function Yt(e){return xl.test(e)}function es(e,t){const n=!!t?.firstOnly,r=e.min.value,s=e.max.value,o=[];if(r<65&&(s===65535||s>=131071)||r===65536&&s>=131071)return o;for(let a=r;a<=s;a++){const i=R(a);if(!Yt(i))continue;const l=qr(i).filter(c=>{const u=c.codePointAt(0);return u<r||u>s});if(l.length&&(o.push(...l),n))break}return o}function he(e,{escDigit:t,inCharClass:n,useFlagV:r}){if(Un.has(e))return Un.get(e);if(e<32||e>126&&e<160||e>262143||t&&Rl(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const s=n?r?vl:kl:Sl,o=R(e);return(s.has(o)?"\\":"")+o}function El(e){const t=e.map(s=>s.codePointAt(0)).sort((s,o)=>s-o),n=[];let r=null;for(let s=0;s<t.length;s++)t[s+1]===t[s]+1?r??=t[s]:r===null?n.push(t[s]):(n.push([r,t[s]]),r=null);return n}function Al(e,t,n){if(e)return">";let r="";if(t&&n){const{enable:s,disable:o}=t;r=(s?.ignoreCase?"i":"")+(s?.dotAll?"s":"")+(o?"-":"")+(o?.ignoreCase?"i":"")+(o?.dotAll?"s":"")}return`${r}:`}function Il({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 Wn({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function Rl(e){return e>47&&e<58}function zn({type:e,value:t}){return e==="Character"&&t===45}var Nl=class jt extends RegExp{#t=new Map;#e=null;#r;#n=null;#s=null;rawOptions={};get source(){return this.#r||"(?:)"}constructor(t,n,r){const s=!!r?.lazyCompile;if(t instanceof RegExp){if(r)throw new Error("Cannot provide options when copying a regexp");const o=t;super(o,n),this.#r=o.source,o instanceof jt&&(this.#t=o.#t,this.#n=o.#n,this.#s=o.#s,this.rawOptions=o.rawOptions)}else{const o={hiddenCaptures:[],strategy:null,transfers:[],...r};super(s?"":t,n),this.#r=t,this.#t=$l(o.hiddenCaptures,o.transfers),this.#s=o.strategy,this.rawOptions=r??{}}s||(this.#e=this)}exec(t){if(!this.#e){const{lazyCompile:s,...o}=this.rawOptions;this.#e=new jt(this.#r,this.flags,o)}const n=this.global||this.sticky,r=this.lastIndex;if(this.#s==="clip_search"&&n&&r){this.lastIndex=0;const s=this.#o(t.slice(r));return s&&(Ll(s,r,t,this.hasIndices),this.lastIndex+=r),s}return this.#o(t)}#o(t){this.#e.lastIndex=this.lastIndex;const n=super.exec.call(this.#e,t);if(this.lastIndex=this.#e.lastIndex,!n||!this.#t.size)return n;const r=[...n];n.length=1;let s;this.hasIndices&&(s=[...n.indices],n.indices.length=1);const o=[0];for(let a=1;a<r.length;a++){const{hidden:i,transferTo:l}=this.#t.get(a)??{};if(i?o.push(null):(o.push(n.length),n.push(r[a]),this.hasIndices&&n.indices.push(s[a])),l&&r[a]!==void 0){const c=o[l];if(!c)throw new Error(`Invalid capture transfer to "${c}"`);if(n[c]=r[a],this.hasIndices&&(n.indices[c]=s[a]),n.groups){this.#n||(this.#n=Pl(this.source));const u=this.#n.get(l);u&&(n.groups[u]=r[a],this.hasIndices&&(n.indices.groups[u]=s[a]))}}}return n}};function Ll(e,t,n,r){if(e.index+=t,e.input=n,r){const s=e.indices;for(let a=0;a<s.length;a++){const i=s[a];i&&(s[a]=[i[0]+t,i[1]+t])}const o=s.groups;o&&Object.keys(o).forEach(a=>{const i=o[a];i&&(o[a]=[i[0]+t,i[1]+t])})}}function $l(e,t){const n=new Map;for(const r of e)n.set(r,{hidden:!0});for(const[r,s]of t)for(const o of s)Ee(n,o,{}).transferTo=r;return n}function Pl(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let r=0,s=0,o;for(;o=t.exec(e);){const{0:a,groups:{capture:i,name:l}}=o;a==="["?r++:r?a==="]"&&r--:i&&(s++,l&&n.set(s,l))}return n}function Tl(e,t){const n=Ml(e,t);return n.options?new Nl(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function Ml(e,t){const n=Hr(t),r=Gr(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:Zt}),s=ll(r,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),o=wl(s,n),a=Zi(o.pattern,{captureTransfers:o._captureTransfers,hiddenCaptures:o._hiddenCaptures,mode:"external"}),i=Ki(a.pattern),l=Xi(i.pattern,{captureTransfers:a.captureTransfers,hiddenCaptures:a.hiddenCaptures}),c={pattern:l.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${o.flags}${o.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const u=l.hiddenCaptures.sort((d,b)=>d-b),h=Array.from(l.captureTransfers),p=s._strategy,f=c.pattern.length>=n.lazyCompileLength;(u.length||h.length||p||f)&&(c.options={...u.length&&{hiddenCaptures:u},...h.length&&{transfers:h},...p&&{strategy:p},...f&&{lazyCompile:f}})}return c}function Ol(e,t){return Tl(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function Gl(e={}){const t={target:"auto",cache:new Map,...e};return t.regexConstructor||=n=>Ol(n,{target:t.target}),{createScanner(n){return new Ya(n,t)},createString(n){return{content:n}}}}const ts=new Set(["text","plaintext","txt"]),ns=new Map(Object.entries({c:()=>import("./c-BG-tZi7o.js"),cpp:()=>import("./cpp-CaeG3uDQ.js"),css:()=>import("./css-Br67jR8j.js"),diff:()=>import("./diff-jW5kmiru.js"),go:()=>import("./go-B7VTfpnm.js"),html:()=>import("./html-BW_6VhB7.js"),ini:()=>import("./ini-Dix3pTmg.js"),java:()=>import("./java-BTDmaRNO.js"),javascript:()=>import("./javascript-WyGyM1wV.js"),json:()=>import("./json-B8JryHcM.js"),jsx:()=>import("./jsx-8cLv2Six.js"),log:()=>import("./log-CcaF_xNv.js"),markdown:()=>import("./markdown-DX-TNHnc.js"),php:()=>import("./php-CNeTOyEV.js"),python:()=>import("./python-B6Ihcp-E.js"),ruby:()=>import("./ruby-CYiNE6ps.js"),rust:()=>import("./rust-CxuBE0J8.js"),shellscript:()=>import("./shellscript-DgJyDXW6.js"),sql:()=>import("./sql-Dq2MiB0T.js"),toml:()=>import("./toml-Ms459DBw.js"),tsx:()=>import("./tsx-D6116Ycy.js"),typescript:()=>import("./typescript-BqvgUolh.js"),xml:()=>import("./xml-BkAJuBCc.js"),yaml:()=>import("./yaml-Bopit2L3.js")})),Bl=new Map(Object.entries({"c++":"cpp",a2ui:"json",bash:"shellscript",cjs:"javascript",cts:"typescript",js:"javascript",md:"markdown",mjs:"javascript",mts:"typescript",properties:"ini",py:"python",rb:"ruby",rs:"rust",sh:"shellscript",shell:"shellscript",ts:"typescript",yml:"yaml",zsh:"shellscript"}));new Map(Object.entries({html:"html",htm:"html",css:"css",js:"javascript",mjs:"javascript",cjs:"javascript",jsx:"jsx",ts:"typescript",tsx:"tsx",json:"json",md:"markdown",py:"python",rb:"ruby",php:"php",go:"go",rs:"rust",java:"java",c:"c",h:"c",cpp:"cpp",hpp:"cpp",sh:"shellscript",bash:"shellscript",yml:"yaml",yaml:"yaml",toml:"toml",ini:"ini",conf:"ini",xml:"xml",sql:"sql",log:"log"}));const Dl="text";function Fl(e){const t=e.trim().toLowerCase();if(!t||ts.has(t))return Dl;const n=Bl.get(t)??Wl.get(t)??t;return ns.has(n)||Ul.has(n)?n:void 0}function jl(e){return ts.has(e)}const Ul=new Map,Wl=new Map,zl={light:"github-light",dark:"github-dark"};let Hn;const St=new Map;function Hl(){return Hn??=Za({themes:[import("./github-light-Rcb2q3L5.js"),import("./github-dark-BQV5ugrc.js")],langs:[],engine:Gl()}),Hn}function ql(e,t,n){let r=St.get(t);return r||(r=n().then(s=>e.loadLanguage(s.default)).then(()=>{}).catch(s=>{throw St.delete(t),s}),St.set(t,r)),r}const Vl={code(e){e.children=e.children.filter(t=>t.type!=="text")}};function Xl({id:e,grammarUrl:t}){return fetch(t,{credentials:"same-origin"}).then(n=>{if(!n.ok)throw new Error(`grammar for ${e} answered HTTP ${n.status}`);return n.json()}).then(n=>({default:n}))}async function Kl(e,t,n={},r){const s=r?.id??Fl(t);if(!s)return;const o=await Hl(),a=jl(s)?void 0:ns.get(s)??(r!==void 0?()=>Xl(r):void 0);a&&await ql(o,s,a);const i=(n.marks??[]).filter(l=>l.end>l.start).map(l=>({start:{line:l.line,character:l.start},end:{line:l.line,character:l.end},properties:{class:l.className},alwaysWrap:!0}));return o.codeToHtml(e,{lang:s,themes:zl,...n.blockLines===!0?{transformers:[Vl]}:{},...i.length>0?{decorations:i}:{}})}self.onmessage=e=>{const{id:t,code:n,language:r,options:s,runtime:o}=e.data;Kl(n,r,s,o).then(a=>{const i=a===void 0?{id:t}:{id:t,html:a};self.postMessage(i)},a=>{const i={id:t,error:a instanceof Error?a.message:"failed"};self.postMessage(i)})};