@mastra/deployer-sandbox 0.3.16-alpha.0 → 0.3.16

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 (334) hide show
  1. package/dist/studio/assets/CodeDiff.es-B70fI05O.js +298 -0
  2. package/dist/studio/assets/abap-BdImnpbu.js +1 -0
  3. package/dist/studio/assets/actionscript-3-B3316cI-.js +1 -0
  4. package/dist/studio/assets/ada-bCR0ucgS.js +1 -0
  5. package/dist/studio/assets/ahk-CsyLZFj1.js +1 -0
  6. package/dist/studio/assets/ahk2-8Zs4aa1G.js +1 -0
  7. package/dist/studio/assets/andromeeda-C4gqWexZ.js +1 -0
  8. package/dist/studio/assets/angular-html-DA-rfuFy.js +1 -0
  9. package/dist/studio/assets/angular-ts-BrjP3tb8.js +1 -0
  10. package/dist/studio/assets/apache-Pmp26Uib.js +1 -0
  11. package/dist/studio/assets/apex-DhZFqWV2.js +1 -0
  12. package/dist/studio/assets/apl-CORt7UWP.js +1 -0
  13. package/dist/studio/assets/applescript-Co6uUVPk.js +1 -0
  14. package/dist/studio/assets/ara-BRHolxvo.js +1 -0
  15. package/dist/studio/assets/asciidoc-CSVQ5wI8.js +1 -0
  16. package/dist/studio/assets/asm-D_Q5rh1f.js +1 -0
  17. package/dist/studio/assets/astro-HNnZUWAn.js +1 -0
  18. package/dist/studio/assets/aurora-x-D-2ljcwZ.js +1 -0
  19. package/dist/studio/assets/awk-DMzUqQB5.js +1 -0
  20. package/dist/studio/assets/ayu-dark-DYE7WIF3.js +1 -0
  21. package/dist/studio/assets/ayu-light-BA47KaF1.js +1 -0
  22. package/dist/studio/assets/ayu-mirage-32ctXXKs.js +1 -0
  23. package/dist/studio/assets/ballerina-BFfxhgS-.js +1 -0
  24. package/dist/studio/assets/bat-CickPsom.js +1 -0
  25. package/dist/studio/assets/beancount-k_qm7-4y.js +1 -0
  26. package/dist/studio/assets/berry-uYugtg8r.js +1 -0
  27. package/dist/studio/assets/bibtex-CHM0blh-.js +1 -0
  28. package/dist/studio/assets/bicep-Bmn6On1c.js +1 -0
  29. package/dist/studio/assets/bird2-Bx8U0n9b.js +1 -0
  30. package/dist/studio/assets/blade-2xfisSek.js +1 -0
  31. package/dist/studio/assets/bsl-DlhNcFeZ.js +1 -0
  32. package/dist/studio/assets/c-BIGW1oBm.js +1 -0
  33. package/dist/studio/assets/c3-Dp5svz6Z.js +1 -0
  34. package/dist/studio/assets/cadence-Bv_4Rxtq.js +1 -0
  35. package/dist/studio/assets/cairo-KRGpt6FW.js +1 -0
  36. package/dist/studio/assets/catppuccin-frappe-CZL1YF0i.js +1 -0
  37. package/dist/studio/assets/catppuccin-latte-DH-8KZSZ.js +1 -0
  38. package/dist/studio/assets/catppuccin-macchiato-B7yYVSCf.js +1 -0
  39. package/dist/studio/assets/catppuccin-mocha-Ct7hS0mc.js +1 -0
  40. package/dist/studio/assets/chapel-DTp_pixX.js +1 -0
  41. package/dist/studio/assets/clarity-Dn5IMItf.js +1 -0
  42. package/dist/studio/assets/clojure-P80f7IUj.js +1 -0
  43. package/dist/studio/assets/cmake-D1j8_8rp.js +1 -0
  44. package/dist/studio/assets/cobol-nBiQ_Alo.js +1 -0
  45. package/dist/studio/assets/codeowners-Bp6g37R7.js +1 -0
  46. package/dist/studio/assets/codeql-DsOJ9woJ.js +1 -0
  47. package/dist/studio/assets/coffee-Ch7k5sss.js +1 -0
  48. package/dist/studio/assets/common-lisp-Cg-RD9OK.js +1 -0
  49. package/dist/studio/assets/coq-C7JzOVbR.js +1 -0
  50. package/dist/studio/assets/core-DTG0TnrS.js +2 -0
  51. package/dist/studio/assets/cpp-BMRokrvK.js +1 -0
  52. package/dist/studio/assets/crystal-DGywbUpC.js +1 -0
  53. package/dist/studio/assets/csharp-DSvCPggb.js +1 -0
  54. package/dist/studio/assets/css-CLj8gQPS.js +1 -0
  55. package/dist/studio/assets/csv-fuZLfV_i.js +1 -0
  56. package/dist/studio/assets/cue-D82EKSYY.js +1 -0
  57. package/dist/studio/assets/cypher-COkxafJQ.js +1 -0
  58. package/dist/studio/assets/d-85-TOEBH.js +1 -0
  59. package/dist/studio/assets/dark-plus-C3mMm8J8.js +1 -0
  60. package/dist/studio/assets/dart-bE4Kk8sk.js +1 -0
  61. package/dist/studio/assets/dax-CEL-wOlO.js +1 -0
  62. package/dist/studio/assets/desktop-BmXAJ9_W.js +1 -0
  63. package/dist/studio/assets/diff-D97Zzqfu.js +1 -0
  64. package/dist/studio/assets/docker-BcOcwvcX.js +1 -0
  65. package/dist/studio/assets/dotenv-Da5cRb03.js +1 -0
  66. package/dist/studio/assets/dracula-BzJJZx-M.js +1 -0
  67. package/dist/studio/assets/dracula-soft-BXkSAIEj.js +1 -0
  68. package/dist/studio/assets/dream-maker-BtqSS_iP.js +1 -0
  69. package/dist/studio/assets/edge-FbVlp4U3.js +1 -0
  70. package/dist/studio/assets/elixir-CkH2-t6x.js +1 -0
  71. package/dist/studio/assets/elm-DbKCFpqz.js +1 -0
  72. package/dist/studio/assets/emacs-lisp-C_m_b--Z.js +1 -0
  73. package/dist/studio/assets/engine-compile-CUTZfOIo.js +137 -0
  74. package/dist/studio/assets/engine-javascript-DSQaR0Yq.js +1 -0
  75. package/dist/studio/assets/erb-DXfck5VN.js +1 -0
  76. package/dist/studio/assets/erlang-DsQrWhSR.js +1 -0
  77. package/dist/studio/assets/everforest-dark-BgDCqdQA.js +1 -0
  78. package/dist/studio/assets/everforest-light-C8M2exoo.js +1 -0
  79. package/dist/studio/assets/fennel-BYunw83y.js +1 -0
  80. package/dist/studio/assets/fish-BvzEVeQv.js +1 -0
  81. package/dist/studio/assets/fluent-C4IJs8-o.js +1 -0
  82. package/dist/studio/assets/fortran-fixed-form-CkoXwp7k.js +1 -0
  83. package/dist/studio/assets/fortran-free-form-BxgE0vQu.js +1 -0
  84. package/dist/studio/assets/fsharp-CXgrBDvD.js +1 -0
  85. package/dist/studio/assets/gdresource-TyuKm33G.js +1 -0
  86. package/dist/studio/assets/gdscript-DqcFQ5yU.js +1 -0
  87. package/dist/studio/assets/gdshader-DkwncUOv.js +1 -0
  88. package/dist/studio/assets/genie-D0YGMca9.js +1 -0
  89. package/dist/studio/assets/gherkin-DyxjwDmM.js +1 -0
  90. package/dist/studio/assets/git-commit-F4YmCXRG.js +1 -0
  91. package/dist/studio/assets/git-rebase-r7XF79zn.js +1 -0
  92. package/dist/studio/assets/github-dark-default-Cuk6v7N8.js +1 -0
  93. package/dist/studio/assets/github-dark-dimmed-DH5Ifo-i.js +1 -0
  94. package/dist/studio/assets/github-dark-high-contrast-E3gJ1_iC.js +1 -0
  95. package/dist/studio/assets/github-dark-vbPMK5nw.js +1 -0
  96. package/dist/studio/assets/github-light-CBO01_j6.js +1 -0
  97. package/dist/studio/assets/github-light-default-D7oLnXFd.js +1 -0
  98. package/dist/studio/assets/github-light-high-contrast-BfjtVDDH.js +1 -0
  99. package/dist/studio/assets/gleam-BspZqrRM.js +1 -0
  100. package/dist/studio/assets/glimmer-js-ByusRIyA.js +1 -0
  101. package/dist/studio/assets/glimmer-ts-BfAWNZQY.js +1 -0
  102. package/dist/studio/assets/glsl-DplSGwfg.js +1 -0
  103. package/dist/studio/assets/gn-n2N0HUVH.js +1 -0
  104. package/dist/studio/assets/gnuplot-DdkO51Og.js +1 -0
  105. package/dist/studio/assets/go-C27-OAKa.js +1 -0
  106. package/dist/studio/assets/graphql-ChdNCCLP.js +1 -0
  107. package/dist/studio/assets/groovy-gcz8RCvz.js +1 -0
  108. package/dist/studio/assets/gruvbox-dark-hard-CFHQjOhq.js +1 -0
  109. package/dist/studio/assets/gruvbox-dark-medium-GsRaNv29.js +1 -0
  110. package/dist/studio/assets/gruvbox-dark-soft-CVdnzihN.js +1 -0
  111. package/dist/studio/assets/gruvbox-light-hard-CH1njM8p.js +1 -0
  112. package/dist/studio/assets/gruvbox-light-medium-DRw_LuNl.js +1 -0
  113. package/dist/studio/assets/gruvbox-light-soft-hJgmCMqR.js +1 -0
  114. package/dist/studio/assets/hack-BWmVpMyf.js +1 -0
  115. package/dist/studio/assets/haml-D5jkg6IW.js +1 -0
  116. package/dist/studio/assets/handlebars-BpdQsYii.js +1 -0
  117. package/dist/studio/assets/haskell-Df6bDoY_.js +1 -0
  118. package/dist/studio/assets/haxe-CfZj7gIn.js +1 -0
  119. package/dist/studio/assets/hcl-BWvSN4gD.js +1 -0
  120. package/dist/studio/assets/hjson-D5-asLiD.js +1 -0
  121. package/dist/studio/assets/hlsl-D3lLCCz7.js +1 -0
  122. package/dist/studio/assets/horizon-BUw7H-hv.js +1 -0
  123. package/dist/studio/assets/horizon-bright-CUuTKBJd.js +1 -0
  124. package/dist/studio/assets/houston-DnULxvSX.js +1 -0
  125. package/dist/studio/assets/html-derivative-DlHx6ybY.js +1 -0
  126. package/dist/studio/assets/html-pp8916En.js +1 -0
  127. package/dist/studio/assets/http-jrhK8wxY.js +1 -0
  128. package/dist/studio/assets/hurl-irOxFIW8.js +1 -0
  129. package/dist/studio/assets/hxml-2-FPmUDs.js +1 -0
  130. package/dist/studio/assets/hy-DFXneXwc.js +1 -0
  131. package/dist/studio/assets/imba-DGztddWO.js +1 -0
  132. package/dist/studio/assets/index-2BQyy0xI.js +1 -0
  133. package/dist/studio/assets/{index-oK5agSnP.js → index-BJ_vi2fY.js} +2 -2
  134. package/dist/studio/assets/index-CSUZnxJT.js +11 -0
  135. package/dist/studio/assets/ini-BEwlwnbL.js +1 -0
  136. package/dist/studio/assets/java-CylS5w8V.js +1 -0
  137. package/dist/studio/assets/javascript-wDzz0qaB.js +1 -0
  138. package/dist/studio/assets/jinja-f2NsQr07.js +1 -0
  139. package/dist/studio/assets/jison-wvAkD_A8.js +1 -0
  140. package/dist/studio/assets/json-Cp-IABpG.js +1 -0
  141. package/dist/studio/assets/json5-C9tS-k6U.js +1 -0
  142. package/dist/studio/assets/jsonc-Des-eS-w.js +1 -0
  143. package/dist/studio/assets/jsonl-DcaNXYhu.js +1 -0
  144. package/dist/studio/assets/jsonnet-DFQXde-d.js +1 -0
  145. package/dist/studio/assets/jssm-C2t-YnRu.js +1 -0
  146. package/dist/studio/assets/jsx-g9-lgVsj.js +1 -0
  147. package/dist/studio/assets/julia-5Bft2YPA.js +1 -0
  148. package/dist/studio/assets/just-Cwhn7H3k.js +1 -0
  149. package/dist/studio/assets/kanagawa-dragon-BuwD2xS4.js +1 -0
  150. package/dist/studio/assets/kanagawa-lotus-C3DzagqV.js +1 -0
  151. package/dist/studio/assets/kanagawa-wave-DFGoQZhC.js +1 -0
  152. package/dist/studio/assets/kdl-DV7GczEv.js +1 -0
  153. package/dist/studio/assets/kotlin-BdnUsdx6.js +1 -0
  154. package/dist/studio/assets/kusto-wEQ09or8.js +1 -0
  155. package/dist/studio/assets/laserwave-DUszq2jm.js +1 -0
  156. package/dist/studio/assets/latex-D5pSuvFb.js +1 -0
  157. package/dist/studio/assets/lean-BZvkOJ9d.js +1 -0
  158. package/dist/studio/assets/less-B1dDrJ26.js +1 -0
  159. package/dist/studio/assets/light-plus-B7mTdjB0.js +1 -0
  160. package/dist/studio/assets/liquid-C0sCDyMI.js +1 -0
  161. package/dist/studio/assets/llvm-BZoOZj88.js +1 -0
  162. package/dist/studio/assets/log-2UxHyX5q.js +1 -0
  163. package/dist/studio/assets/logo-BtOb2qkB.js +1 -0
  164. package/dist/studio/assets/lua-BaeVxFsk.js +1 -0
  165. package/dist/studio/assets/luau-BnpPk5vE.js +1 -0
  166. package/dist/studio/assets/{main-Db0LaPDB.js → main-BdlnxtPy.js} +322 -317
  167. package/dist/studio/assets/make-CHLpvVh8.js +1 -0
  168. package/dist/studio/assets/markdown-Cvjx9yec.js +1 -0
  169. package/dist/studio/assets/marko-DjSrsDqO.js +1 -0
  170. package/dist/studio/assets/material-theme-D5KoaKCx.js +1 -0
  171. package/dist/studio/assets/material-theme-darker-BfHTSMKl.js +1 -0
  172. package/dist/studio/assets/material-theme-lighter-B0m2ddpp.js +1 -0
  173. package/dist/studio/assets/material-theme-ocean-CyktbL80.js +1 -0
  174. package/dist/studio/assets/material-theme-palenight-Csfq5Kiy.js +1 -0
  175. package/dist/studio/assets/matlab-D7o27uSR.js +1 -0
  176. package/dist/studio/assets/mdc-D1_yUvq7.js +1 -0
  177. package/dist/studio/assets/mdx-Cmh6b_Ma.js +1 -0
  178. package/dist/studio/assets/mermaid-CQcHuHx7.js +1 -0
  179. package/dist/studio/assets/min-dark-CafNBF8u.js +1 -0
  180. package/dist/studio/assets/min-light-CTRr51gU.js +1 -0
  181. package/dist/studio/assets/mipsasm-CKIfxQSi.js +1 -0
  182. package/dist/studio/assets/mojo-DJz3ZmWd.js +1 -0
  183. package/dist/studio/assets/monokai-BRVnQi9A.js +1 -0
  184. package/dist/studio/assets/moonbit-CHtswR0a.js +1 -0
  185. package/dist/studio/assets/move-el3G9tDJ.js +1 -0
  186. package/dist/studio/assets/narrat-DRg8JJMk.js +1 -0
  187. package/dist/studio/assets/nextflow-C-mBbutL.js +1 -0
  188. package/dist/studio/assets/nextflow-groovy-vE_lwT2v.js +1 -0
  189. package/dist/studio/assets/nginx-BpAMiNFr.js +1 -0
  190. package/dist/studio/assets/night-owl-C39BiMTA.js +1 -0
  191. package/dist/studio/assets/night-owl-light-CMTm3GFP.js +1 -0
  192. package/dist/studio/assets/nim-BIad80T-.js +1 -0
  193. package/dist/studio/assets/nix-CwoSXNpI.js +1 -0
  194. package/dist/studio/assets/nord-Ddv68eIx.js +1 -0
  195. package/dist/studio/assets/nsis-BlV79W_Q.js +1 -0
  196. package/dist/studio/assets/nushell-D3jzshHO.js +1 -0
  197. package/dist/studio/assets/objective-c-DXmwc3jG.js +1 -0
  198. package/dist/studio/assets/objective-cpp-CLxacb5B.js +1 -0
  199. package/dist/studio/assets/ocaml-C0hk2d4L.js +1 -0
  200. package/dist/studio/assets/odin-BBf5iR-q.js +1 -0
  201. package/dist/studio/assets/one-dark-pro-DVMEJ2y_.js +1 -0
  202. package/dist/studio/assets/one-light-C3Wv6jpd.js +1 -0
  203. package/dist/studio/assets/openscad-C4EeE6gA.js +1 -0
  204. package/dist/studio/assets/org-DM6o9KBp.js +1 -0
  205. package/dist/studio/assets/pascal-D93ZcfNL.js +1 -0
  206. package/dist/studio/assets/perl-B9cMNwum.js +1 -0
  207. package/dist/studio/assets/php-Csjmro_R.js +1 -0
  208. package/dist/studio/assets/pierre-dark-CyvmCCZW.js +1 -0
  209. package/dist/studio/assets/pierre-dark-protanopia-deuteranopia-Rgc0TwpF.js +1 -0
  210. package/dist/studio/assets/pierre-dark-soft-BHGpRqa4.js +1 -0
  211. package/dist/studio/assets/pierre-dark-tritanopia-Beq2gCRQ.js +1 -0
  212. package/dist/studio/assets/pierre-dark-vibrant-BWBVywrn.js +1 -0
  213. package/dist/studio/assets/pierre-light-480U9XYS.js +1 -0
  214. package/dist/studio/assets/pierre-light-protanopia-deuteranopia-CaVOBURG.js +1 -0
  215. package/dist/studio/assets/pierre-light-soft-CVdyfjmI.js +1 -0
  216. package/dist/studio/assets/pierre-light-tritanopia-B4_gpKOM.js +1 -0
  217. package/dist/studio/assets/pierre-light-vibrant-DdTDNdfJ.js +1 -0
  218. package/dist/studio/assets/pkl-u5AG7uiY.js +1 -0
  219. package/dist/studio/assets/plastic-3e1v2bzS.js +1 -0
  220. package/dist/studio/assets/plsql-ChMvpjG-.js +1 -0
  221. package/dist/studio/assets/po-BTJTHyun.js +1 -0
  222. package/dist/studio/assets/poimandres-CS3Unz2-.js +1 -0
  223. package/dist/studio/assets/polar-C0HS_06l.js +1 -0
  224. package/dist/studio/assets/postcss-CXtECtnM.js +1 -0
  225. package/dist/studio/assets/powerquery-CEu0bR-o.js +1 -0
  226. package/dist/studio/assets/powershell-BmBUJMz7.js +1 -0
  227. package/dist/studio/assets/prisma-Vru482bI.js +1 -0
  228. package/dist/studio/assets/prolog-CbFg5uaA.js +1 -0
  229. package/dist/studio/assets/proto-C7zT0LnQ.js +1 -0
  230. package/dist/studio/assets/pug-DKIMFp6K.js +1 -0
  231. package/dist/studio/assets/puppet-BMWR74SV.js +1 -0
  232. package/dist/studio/assets/purescript-CklMAg4u.js +1 -0
  233. package/dist/studio/assets/python-B6aJPvgy.js +1 -0
  234. package/dist/studio/assets/qml-3beO22l8.js +1 -0
  235. package/dist/studio/assets/qmldir-C8lEn-DE.js +1 -0
  236. package/dist/studio/assets/qss-IeuSbFQv.js +1 -0
  237. package/dist/studio/assets/r-Cf5RLm7j.js +1 -0
  238. package/dist/studio/assets/racket-BqYA7rlc.js +1 -0
  239. package/dist/studio/assets/raku-DXvB9xmW.js +1 -0
  240. package/dist/studio/assets/razor-BjBPvh-w.js +1 -0
  241. package/dist/studio/assets/rbs-CpoqiR4B.js +1 -0
  242. package/dist/studio/assets/red-hvxz__6c.js +1 -0
  243. package/dist/studio/assets/reg-C-SQnVFl.js +1 -0
  244. package/dist/studio/assets/regexp-CDVJQ6XC.js +1 -0
  245. package/dist/studio/assets/rel-C3B-1QV4.js +1 -0
  246. package/dist/studio/assets/riscv-BM1_JUlF.js +1 -0
  247. package/dist/studio/assets/ron-D8l8udqQ.js +1 -0
  248. package/dist/studio/assets/rose-pine-5qJOZa0Y.js +1 -0
  249. package/dist/studio/assets/rose-pine-dawn-zx0QlTCp.js +1 -0
  250. package/dist/studio/assets/rose-pine-moon-C9pEdX9L.js +1 -0
  251. package/dist/studio/assets/rosmsg-BJDFO7_C.js +1 -0
  252. package/dist/studio/assets/rst-bs7f0vWN.js +1 -0
  253. package/dist/studio/assets/ruby-C0TQ7zu5.js +1 -0
  254. package/dist/studio/assets/rust-B1yitclQ.js +1 -0
  255. package/dist/studio/assets/sas-DEy46yEz.js +1 -0
  256. package/dist/studio/assets/sass-Cj5Yp3dK.js +1 -0
  257. package/dist/studio/assets/scala-CqE71os6.js +1 -0
  258. package/dist/studio/assets/scheme-C98Dy4si.js +1 -0
  259. package/dist/studio/assets/scss-D5BDwBP9.js +1 -0
  260. package/dist/studio/assets/sdbl-DVxCFoDh.js +1 -0
  261. package/dist/studio/assets/shaderlab-Dg9Lc6iA.js +1 -0
  262. package/dist/studio/assets/shellscript-Yzrsuije.js +1 -0
  263. package/dist/studio/assets/shellsession-BADoaaVG.js +1 -0
  264. package/dist/studio/assets/slack-dark-BthQWCQV.js +1 -0
  265. package/dist/studio/assets/slack-ochin-DqwNpetd.js +1 -0
  266. package/dist/studio/assets/smalltalk-BOQMe2GC.js +1 -0
  267. package/dist/studio/assets/smithy-cds9vsN8.js +1 -0
  268. package/dist/studio/assets/snazzy-light-Bw305WKR.js +1 -0
  269. package/dist/studio/assets/solarized-dark-CpvCGNkr.js +1 -0
  270. package/dist/studio/assets/solarized-light-Dlz6yCKv.js +1 -0
  271. package/dist/studio/assets/solidity-DijEV5ha.js +1 -0
  272. package/dist/studio/assets/soy-8wufbnw4.js +1 -0
  273. package/dist/studio/assets/sparql-rVzFXLq3.js +1 -0
  274. package/dist/studio/assets/splunk-BtCnVYZw.js +1 -0
  275. package/dist/studio/assets/sql-CRqJ_cUM.js +1 -0
  276. package/dist/studio/assets/ssh-config-_ykCGR6B.js +1 -0
  277. package/dist/studio/assets/stata-DI20mbqo.js +1 -0
  278. package/dist/studio/assets/style-BvrTt61h.css +1 -0
  279. package/dist/studio/assets/stylus-BEDo0Tqx.js +1 -0
  280. package/dist/studio/assets/surrealql-Cjom0U5J.js +1 -0
  281. package/dist/studio/assets/svelte-Cy7k_4gC.js +1 -0
  282. package/dist/studio/assets/swift-C2oV4EkX.js +1 -0
  283. package/dist/studio/assets/synthwave-84-CbfX1IO0.js +1 -0
  284. package/dist/studio/assets/system-verilog-0hqHdDBg.js +1 -0
  285. package/dist/studio/assets/systemd-4A_iFExJ.js +1 -0
  286. package/dist/studio/assets/talonscript-CkByrt1z.js +1 -0
  287. package/dist/studio/assets/tasl-QIJgUcNo.js +1 -0
  288. package/dist/studio/assets/tcl-dwOrl1Do.js +1 -0
  289. package/dist/studio/assets/templ-DhtptRzy.js +1 -0
  290. package/dist/studio/assets/terraform-BETggiCN.js +1 -0
  291. package/dist/studio/assets/tex-D96PA37w.js +1 -0
  292. package/dist/studio/assets/tokyo-night-hegEt444.js +1 -0
  293. package/dist/studio/assets/toml-vGWfd6FD.js +1 -0
  294. package/dist/studio/assets/ts-tags-D351s5mN.js +1 -0
  295. package/dist/studio/assets/tsv-B_m7g4N7.js +1 -0
  296. package/dist/studio/assets/tsx-COt5Ahok.js +1 -0
  297. package/dist/studio/assets/turtle-BsS91CYL.js +1 -0
  298. package/dist/studio/assets/twig-27uCiNez.js +1 -0
  299. package/dist/studio/assets/typescript-BPQ3VLAy.js +1 -0
  300. package/dist/studio/assets/typespec-CAFt9gP4.js +1 -0
  301. package/dist/studio/assets/typst-BUadGCkm.js +1 -0
  302. package/dist/studio/assets/v-BGw2Nkan.js +1 -0
  303. package/dist/studio/assets/vala-CsfeWuGM.js +1 -0
  304. package/dist/studio/assets/vb-Cu-pLBUe.js +1 -0
  305. package/dist/studio/assets/verilog-nZwndyjY.js +1 -0
  306. package/dist/studio/assets/vesper-DRje8inN.js +1 -0
  307. package/dist/studio/assets/vhdl-CeAyd5Ju.js +1 -0
  308. package/dist/studio/assets/viml-CJc9bBzg.js +1 -0
  309. package/dist/studio/assets/vitesse-black-Bkuqu6BP.js +1 -0
  310. package/dist/studio/assets/vitesse-dark-D0r3Knsf.js +1 -0
  311. package/dist/studio/assets/vitesse-light-CVO1_9PV.js +1 -0
  312. package/dist/studio/assets/vue-BqiEGhQt.js +1 -0
  313. package/dist/studio/assets/vue-html-AaS7Mt5G.js +1 -0
  314. package/dist/studio/assets/vue-vine-BoDAl6tE.js +1 -0
  315. package/dist/studio/assets/vyper-CDx5xZoG.js +1 -0
  316. package/dist/studio/assets/wasm-CG6Dc4jp.js +1 -0
  317. package/dist/studio/assets/wasm-MzD3tlZU.js +1 -0
  318. package/dist/studio/assets/wenyan-BV7otONQ.js +1 -0
  319. package/dist/studio/assets/wgsl-Dx-B1_4e.js +1 -0
  320. package/dist/studio/assets/wikitext-BhOHFoWU.js +1 -0
  321. package/dist/studio/assets/wit-5i3qLPDT.js +1 -0
  322. package/dist/studio/assets/wolfram-lXgVvXCa.js +1 -0
  323. package/dist/studio/assets/xml-sdJ4AIDG.js +1 -0
  324. package/dist/studio/assets/xsl-CtQFsRM5.js +1 -0
  325. package/dist/studio/assets/yaml-Buea-lGh.js +1 -0
  326. package/dist/studio/assets/zenscript-DVFEvuxE.js +1 -0
  327. package/dist/studio/assets/zig-VOosw3JB.js +1 -0
  328. package/dist/studio/index.html +2 -2
  329. package/dist/studio/routes-manifest.json +0 -1
  330. package/package.json +6 -6
  331. package/dist/studio/assets/core-CJQBASNs.js +0 -12
  332. package/dist/studio/assets/engine-compile-BkERmzkH.js +0 -137
  333. package/dist/studio/assets/engine-javascript-CSIo_1eZ.js +0 -1
  334. package/dist/studio/assets/style-BLviGijk.css +0 -1
@@ -0,0 +1,298 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./angular-html-DA-rfuFy.js","./html-pp8916En.js","./javascript-wDzz0qaB.js","./css-CLj8gQPS.js","./angular-ts-BrjP3tb8.js","./scss-D5BDwBP9.js","./apl-CORt7UWP.js","./xml-sdJ4AIDG.js","./java-CylS5w8V.js","./json-Cp-IABpG.js","./astro-HNnZUWAn.js","./typescript-BPQ3VLAy.js","./postcss-CXtECtnM.js","./tsx-COt5Ahok.js","./blade-2xfisSek.js","./html-derivative-DlHx6ybY.js","./sql-CRqJ_cUM.js","./bsl-DlhNcFeZ.js","./sdbl-DVxCFoDh.js","./cairo-KRGpt6FW.js","./python-B6aJPvgy.js","./chapel-DTp_pixX.js","./c-BIGW1oBm.js","./cobol-nBiQ_Alo.js","./coffee-Ch7k5sss.js","./cpp-BMRokrvK.js","./regexp-CDVJQ6XC.js","./glsl-DplSGwfg.js","./crystal-DGywbUpC.js","./shellscript-Yzrsuije.js","./edge-FbVlp4U3.js","./elixir-CkH2-t6x.js","./elm-DbKCFpqz.js","./erb-DXfck5VN.js","./ruby-C0TQ7zu5.js","./haml-D5jkg6IW.js","./graphql-ChdNCCLP.js","./jsx-g9-lgVsj.js","./lua-BaeVxFsk.js","./yaml-Buea-lGh.js","./erlang-DsQrWhSR.js","./markdown-Cvjx9yec.js","./fortran-fixed-form-CkoXwp7k.js","./fortran-free-form-BxgE0vQu.js","./fsharp-CXgrBDvD.js","./gdresource-TyuKm33G.js","./gdshader-DkwncUOv.js","./gdscript-DqcFQ5yU.js","./git-commit-F4YmCXRG.js","./diff-D97Zzqfu.js","./git-rebase-r7XF79zn.js","./glimmer-js-ByusRIyA.js","./glimmer-ts-BfAWNZQY.js","./hack-BWmVpMyf.js","./handlebars-BpdQsYii.js","./http-jrhK8wxY.js","./hurl-irOxFIW8.js","./csv-fuZLfV_i.js","./hxml-2-FPmUDs.js","./haxe-CfZj7gIn.js","./jinja-f2NsQr07.js","./jison-wvAkD_A8.js","./julia-5Bft2YPA.js","./r-Cf5RLm7j.js","./just-Cwhn7H3k.js","./perl-B9cMNwum.js","./latex-D5pSuvFb.js","./tex-D96PA37w.js","./liquid-C0sCDyMI.js","./marko-DjSrsDqO.js","./less-B1dDrJ26.js","./mdc-D1_yUvq7.js","./nextflow-C-mBbutL.js","./nextflow-groovy-vE_lwT2v.js","./nginx-BpAMiNFr.js","./nim-BIad80T-.js","./org-DM6o9KBp.js","./ini-BEwlwnbL.js","./make-CHLpvVh8.js","./php-Csjmro_R.js","./vb-Cu-pLBUe.js","./clojure-P80f7IUj.js","./objective-c-DXmwc3jG.js","./docker-BcOcwvcX.js","./go-C27-OAKa.js","./groovy-gcz8RCvz.js","./raku-DXvB9xmW.js","./rust-B1yitclQ.js","./scala-CqE71os6.js","./csharp-DSvCPggb.js","./dart-bE4Kk8sk.js","./ocaml-C0hk2d4L.js","./zig-VOosw3JB.js","./xsl-CtQFsRM5.js","./pug-DKIMFp6K.js","./qml-3beO22l8.js","./razor-BjBPvh-w.js","./rst-bs7f0vWN.js","./cmake-D1j8_8rp.js","./sas-DEy46yEz.js","./shaderlab-Dg9Lc6iA.js","./hlsl-D3lLCCz7.js","./shellsession-BADoaaVG.js","./soy-8wufbnw4.js","./sparql-rVzFXLq3.js","./turtle-BsS91CYL.js","./stata-DI20mbqo.js","./surrealql-Cjom0U5J.js","./svelte-Cy7k_4gC.js","./templ-DhtptRzy.js","./ts-tags-D351s5mN.js","./twig-27uCiNez.js","./typst-BUadGCkm.js","./bat-CickPsom.js","./bibtex-CHM0blh-.js","./jsonc-Des-eS-w.js","./log-2UxHyX5q.js","./powershell-BmBUJMz7.js","./swift-C2oV4EkX.js","./verilog-nZwndyjY.js","./system-verilog-0hqHdDBg.js","./vue-BqiEGhQt.js","./vue-html-AaS7Mt5G.js","./vue-vine-BoDAl6tE.js","./stylus-BEDo0Tqx.js"])))=>i.map(i=>d[i]);
2
+ import{r as q,j as U,u as Xs,d as Js}from"./main-BdlnxtPy.js";import{_ as p}from"./preload-helper-PPVm8Dsz.js";import{I as Yi,E as ki,R as Qs,T as Zs,t as Re,F as ee}from"./index-CSUZnxJT.js";import{r as co,C as Ue,h as Dt,g as Ys,f as fo}from"./index-2BQyy0xI.js";function Pt(e){const t=q.useRef(e);return q.useInsertionEffect(()=>{t.current=e}),q.useCallback((...i)=>t.current(...i),[])}const ea=q.createContext(void 0);function ta(){return q.useContext(ea)}const ia={position:"absolute",top:0,bottom:0,textAlign:"center",whiteSpace:"normal",touchAction:"none"},na={display:"contents"};function Bn(){return null}const Tn="diffs-container";(()=>{try{return!1}catch{return!1}})();const ra=/(?=^From [a-f0-9]+ .+$)/m,ho=/(?=^diff --git)/gm,oa=new RegExp("(?<=\\n)"),sa=/^(---|\+\+\+)\s+([^\t\r\n]+)/,aa=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,po="header-prefix",mo="header-filename-suffix",go="header-metadata",In="header-custom",_e={dark:"pierre-dark",light:"pierre-light"},la="data-theme-css",da="data-unsafe-css",ua="data-diffs-scrollbar-measure",vo="--diffs-scrollbar-gutter-measured",ca=1e5,fa={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8},ha=Object.freeze({fromStart:0,fromEnd:0}),Gn={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},pa={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};function Je(e){return`annotation-${"side"in e?`${e.side}-`:""}${e.lineNumber}`}function ma({hunkIndex:e,lineIndex:t,conflictIndex:i}){return`merge-conflict-action-${e}-${t}-${i}`}function ae(e,t){return e-(t===0?0:1)}function ne(e,t){return ae(e,t)+t}function ga(e,t){const i=t.hunks[e.hunkIndex];if(i!=null)return{hunkIndex:e.hunkIndex,lineIndex:va(i,e.startContentIndex)}}function va(e,t){let i=e.unifiedLineStart;for(let n=0;n<t;n++){const r=e.hunkContent[n];i+=r.type==="context"?r.lines:r.deletions+r.additions}return i}function _o({fileDiff:e,actions:t,renderCustomHeader:i,renderHeaderPrefix:n,renderHeaderFilenameSuffix:r,renderHeaderMetadata:o,renderAnnotation:s,renderGutterUtility:l,renderMergeConflictUtility:a,lineAnnotations:d,getHoveredLine:u,getInstance:c,getAnnotationSlotName:f=Je}){const h=i?.(e),m=n?.(e),g=r?.(e),y=o?.(e);return U.jsxs(U.Fragment,{children:[h!=null?U.jsx("div",{slot:In,children:h}):U.jsxs(U.Fragment,{children:[m!=null&&U.jsx("div",{slot:"header-prefix",children:m}),g!=null&&U.jsx("div",{slot:"header-filename-suffix",children:g}),y!=null&&U.jsx("div",{slot:"header-metadata",children:y})]}),s!=null&&d?.map((v,_)=>U.jsx("div",{slot:f(v),children:s(v)},_)),t!=null&&a!=null&&c!=null&&t.map(v=>{if(v==null)return;const _=_a(v,e);return U.jsx("div",{slot:_,style:na,children:a(v,c)},_)}),l!=null&&U.jsx("div",{slot:"gutter-utility-slot",style:ia,children:l(u)})]})}function _a(e,t){const i=ga(e,t);return i!=null?ma({hunkIndex:i.hunkIndex,lineIndex:i.lineIndex,conflictIndex:e.conflictIndex}):void 0}const wt=new Map,xi=new Map,ba=new Map,en=new Set;function tn(e){for(const t of Array.isArray(e)?e:[e])if(!(t==="text"||t==="ansi")&&!en.has(t))return!1;return!0}function Dn(e=_e){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}const nn=new Set;function kt(e){const t=[],i=new Set;for(const c of ya(e.themes)){const f=bo(c)?c.getThemes():[c];for(const h of f){if(i.has(h.name))throw new Error(`Theme collection already contains theme "${h.name}"`);i.add(h.name),t.push(h)}}const n=Object.freeze([...t]),r=Object.freeze(n.filter(c=>c.colorScheme==="light")),o=Object.freeze(n.filter(c=>c.colorScheme==="dark")),s=new Map(n.map(c=>[c.name,c])),l=Object.freeze(n.map(c=>c.name)),a=Object.freeze(r.map(c=>c.name)),d=Object.freeze(o.map(c=>c.name));function u(c){if(c==null)return n;const{colorScheme:f,collection:h}=c;return h==null?f==="light"?r:f==="dark"?o:n:n.filter(m=>m.collection!==h?!1:f==null||m.colorScheme===f)}return{getTheme(c){return s.get(c)},getThemes(c){return u(c)},getThemeNames(c){return c?.collection==null?c?.colorScheme==="light"?a:c?.colorScheme==="dark"?d:l:u(c).map(f=>f.name)},hasTheme(c){return s.has(c)},orderBy(c){return kt({themes:n.map((f,h)=>({descriptor:f,index:h})).sort((f,h)=>{const m=c(f.descriptor,h.descriptor);return m!==0?m:f.index-h.index}).map(f=>f.descriptor)})},pick(c){const f=[],h=new Set;for(const m of c){if(h.has(m))throw new Error(`Theme collection pick already includes theme "${m}"`);h.add(m);const g=s.get(m);if(g==null)throw new Error(`Theme collection does not contain theme "${m}"`);f.push(g)}return kt({themes:f})},registerInto(c){for(const f of n)c.registerThemeIfAbsent(f.name,f.load)}}}function ya(e){return Ea(e)?[e]:e}function Ea(e){return bo(e)||Sa(e)}function Sa(e){return typeof e.name=="string"&&typeof e.load=="function"}function bo(e){return typeof e.getThemes=="function"}function yo(e){return e!==null&&typeof e=="object"&&"default"in e?e.default:e}var La=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name="DuplicateThemeError"}},Ca=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name="UnregisteredThemeError"}},wa=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name="UnresolvedThemeError"}};function ka(){const e=new Map,t=new Map,i=new Map;let n=0;function r(v,_){if(e.has(v))throw new La(v);e.set(v,_)}function o(v,_){return e.has(v)?!1:(e.set(v,_),!0)}function s(v){return e.has(v)}function l(v){const _=t.get(v);if(_!==void 0)return Promise.resolve(_);const b=i.get(v);if(b!==void 0)return b;const L=e.get(v);if(L===void 0)return Promise.reject(new Ca(v));const E=n,S=L().then(C=>{const x=yo(C);return E===n&&t.set(v,x),i.get(v)===S&&i.delete(v),x}).catch(C=>{throw i.get(v)===S&&i.delete(v),C});return i.set(v,S),S}function a(v){return Promise.all(v.map(_=>l(_)))}function d(v,_){t.set(v,_)}function u(v){for(const[_,b]of v)d(_,b)}function c(v){return t.get(v)}function f(v){const _=[];for(const b of v){const L=t.get(b);if(L===void 0)throw new wa(b);_.push(L)}return _}function h(v){return t.has(v)}function m(v){for(const _ of v)if(!t.has(_))return!1;return!0}function g(v){const _=t.get(v);return _!==void 0?_:l(v)}function y(){n++,t.clear(),i.clear()}return{clearResolvedThemes:y,getResolvedOrResolveTheme:g,getResolvedTheme:c,getResolvedThemes:f,hasRegisteredTheme:s,hasResolvedTheme:h,hasResolvedThemes:m,registerTheme:r,registerThemeIfAbsent:o,resolveTheme:l,resolveThemes:a,seedResolvedTheme:d,seedResolvedThemes:u}}const ze=ka();function jn(e,t){e=Array.isArray(e)?e:[e];for(let i of e){let n;if(typeof i=="string"){if(n=ze.getResolvedTheme(i),n==null)throw new Error(`loadResolvedThemes: ${i} is not resolved, you must resolve it before calling loadResolvedThemes`)}else n=i,i=i.name,ze.getResolvedTheme(i)==null&&ze.seedResolvedTheme(i,n);nn.has(i)||(nn.add(i),t.loadThemeSync(n))}}function Wn(e,t){e=Array.isArray(e)?e:[e];for(const i of e){if(en.has(i.name))continue;let n=wt.get(i.name);n==null&&(n=i,wt.set(i.name,n));const r=n.data.find(o=>o.name===n.name||o.aliases?.includes(n.name)===!0);if(r==null)throw new Error(`attachResolvedLanguages: No returned grammar declares "${n.name}" as its name or an alias.`);t.loadLanguageSync(n.data);try{t.getLanguage(n.name)}catch{throw new Error(`attachResolvedLanguages: "${r.name}" is already loaded without alias "${n.name}". Load the alias first or give the grammar a unique name.`)}en.add(n.name)}}function Eo(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}var rn=Object.defineProperty,xa=Object.getOwnPropertyDescriptor,Aa=Object.getOwnPropertyNames,Ra=Object.prototype.hasOwnProperty,Ta=(e,t)=>{let i={};for(var n in e)rn(i,n,{get:e[n],enumerable:!0});return rn(i,Symbol.toStringTag,{value:"Module"}),i},Ia=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(var r=Aa(t),o=0,s=r.length,l;o<s;o++)l=r[o],!Ra.call(e,l)&&l!==i&&rn(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(n=xa(t,l))||n.enumerable});return e},Da=(e,t,i)=>(Ia(e,t,"default"),i);const So=[{id:"abap",name:"ABAP",import:(()=>p(()=>import("./abap-BdImnpbu.js"),[],import.meta.url))},{id:"actionscript-3",name:"ActionScript",aliases:["actionscript","as3"],import:(()=>p(()=>import("./actionscript-3-B3316cI-.js"),[],import.meta.url))},{id:"ada",name:"Ada",import:(()=>p(()=>import("./ada-bCR0ucgS.js"),[],import.meta.url))},{id:"ahk",name:"AutoHotkey",aliases:["ahk1"],import:(()=>p(()=>import("./ahk-CsyLZFj1.js"),[],import.meta.url))},{id:"ahk2",name:"AutoHotkey2",import:(()=>p(()=>import("./ahk2-8Zs4aa1G.js"),[],import.meta.url))},{id:"angular-html",name:"Angular HTML",import:(()=>p(()=>import("./angular-html-DA-rfuFy.js").then(e=>e.f),__vite__mapDeps([0,1,2,3]),import.meta.url))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>p(()=>import("./angular-ts-BrjP3tb8.js"),__vite__mapDeps([4,0,1,2,3,5]),import.meta.url))},{id:"apache",name:"Apache Conf",import:(()=>p(()=>import("./apache-Pmp26Uib.js"),[],import.meta.url))},{id:"apex",name:"Apex",import:(()=>p(()=>import("./apex-DhZFqWV2.js"),[],import.meta.url))},{id:"apl",name:"APL",import:(()=>p(()=>import("./apl-CORt7UWP.js"),__vite__mapDeps([6,1,2,3,7,8,9]),import.meta.url))},{id:"applescript",name:"AppleScript",import:(()=>p(()=>import("./applescript-Co6uUVPk.js"),[],import.meta.url))},{id:"ara",name:"Ara",import:(()=>p(()=>import("./ara-BRHolxvo.js"),[],import.meta.url))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>p(()=>import("./asciidoc-CSVQ5wI8.js"),[],import.meta.url))},{id:"asm",name:"Assembly",import:(()=>p(()=>import("./asm-D_Q5rh1f.js"),[],import.meta.url))},{id:"astro",name:"Astro",import:(()=>p(()=>import("./astro-HNnZUWAn.js"),__vite__mapDeps([10,9,2,11,3,12,13]),import.meta.url))},{id:"awk",name:"AWK",import:(()=>p(()=>import("./awk-DMzUqQB5.js"),[],import.meta.url))},{id:"ballerina",name:"Ballerina",import:(()=>p(()=>import("./ballerina-BFfxhgS-.js"),[],import.meta.url))},{id:"bat",name:"Batch File",aliases:["batch","cmd"],import:(()=>p(()=>import("./bat-CickPsom.js"),[],import.meta.url))},{id:"beancount",name:"Beancount",import:(()=>p(()=>import("./beancount-k_qm7-4y.js"),[],import.meta.url))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>p(()=>import("./berry-uYugtg8r.js"),[],import.meta.url))},{id:"bibtex",name:"BibTeX",import:(()=>p(()=>import("./bibtex-CHM0blh-.js"),[],import.meta.url))},{id:"bicep",name:"Bicep",import:(()=>p(()=>import("./bicep-Bmn6On1c.js"),[],import.meta.url))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>p(()=>import("./bird2-Bx8U0n9b.js"),[],import.meta.url))},{id:"blade",name:"Blade",import:(()=>p(()=>import("./blade-2xfisSek.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9]),import.meta.url))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>p(()=>import("./bsl-DlhNcFeZ.js"),__vite__mapDeps([17,18]),import.meta.url))},{id:"c",name:"C",import:(()=>p(()=>import("./c-BIGW1oBm.js"),[],import.meta.url))},{id:"c3",name:"C3",import:(()=>p(()=>import("./c3-Dp5svz6Z.js"),[],import.meta.url))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>p(()=>import("./cadence-Bv_4Rxtq.js"),[],import.meta.url))},{id:"cairo",name:"Cairo",import:(()=>p(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20]),import.meta.url))},{id:"chapel",name:"Chapel",aliases:["chpl"],import:(()=>p(()=>import("./chapel-DTp_pixX.js"),__vite__mapDeps([21,22]),import.meta.url))},{id:"clarity",name:"Clarity",import:(()=>p(()=>import("./clarity-Dn5IMItf.js"),[],import.meta.url))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>p(()=>import("./clojure-P80f7IUj.js"),[],import.meta.url))},{id:"cmake",name:"CMake",import:(()=>p(()=>import("./cmake-D1j8_8rp.js"),[],import.meta.url))},{id:"cobol",name:"COBOL",import:(()=>p(()=>import("./cobol-nBiQ_Alo.js"),__vite__mapDeps([23,1,2,3,8]),import.meta.url))},{id:"codeowners",name:"CODEOWNERS",import:(()=>p(()=>import("./codeowners-Bp6g37R7.js"),[],import.meta.url))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>p(()=>import("./codeql-DsOJ9woJ.js"),[],import.meta.url))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>p(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([24,2]),import.meta.url))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>p(()=>import("./common-lisp-Cg-RD9OK.js"),[],import.meta.url))},{id:"coq",name:"Rocq",import:(()=>p(()=>import("./coq-C7JzOVbR.js"),[],import.meta.url))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>p(()=>import("./cpp-BMRokrvK.js"),__vite__mapDeps([25,26,27,22]),import.meta.url))},{id:"crystal",name:"Crystal",import:(()=>p(()=>import("./crystal-DGywbUpC.js"),__vite__mapDeps([28,1,2,3,16,22,29]),import.meta.url))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>p(()=>import("./csharp-DSvCPggb.js"),[],import.meta.url))},{id:"css",name:"CSS",import:(()=>p(()=>import("./css-CLj8gQPS.js"),[],import.meta.url))},{id:"csv",name:"CSV",import:(()=>p(()=>import("./csv-fuZLfV_i.js"),[],import.meta.url))},{id:"cue",name:"CUE",import:(()=>p(()=>import("./cue-D82EKSYY.js"),[],import.meta.url))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>p(()=>import("./cypher-COkxafJQ.js"),[],import.meta.url))},{id:"d",name:"D",import:(()=>p(()=>import("./d-85-TOEBH.js"),[],import.meta.url))},{id:"dart",name:"Dart",import:(()=>p(()=>import("./dart-bE4Kk8sk.js"),[],import.meta.url))},{id:"dax",name:"DAX",import:(()=>p(()=>import("./dax-CEL-wOlO.js"),[],import.meta.url))},{id:"desktop",name:"Desktop",import:(()=>p(()=>import("./desktop-BmXAJ9_W.js"),[],import.meta.url))},{id:"diff",name:"Diff",import:(()=>p(()=>import("./diff-D97Zzqfu.js"),[],import.meta.url))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>p(()=>import("./docker-BcOcwvcX.js"),[],import.meta.url))},{id:"dotenv",name:"dotEnv",import:(()=>p(()=>import("./dotenv-Da5cRb03.js"),[],import.meta.url))},{id:"dream-maker",name:"Dream Maker",import:(()=>p(()=>import("./dream-maker-BtqSS_iP.js"),[],import.meta.url))},{id:"edge",name:"Edge",import:(()=>p(()=>import("./edge-FbVlp4U3.js"),__vite__mapDeps([30,11,1,2,3,15]),import.meta.url))},{id:"elixir",name:"Elixir",import:(()=>p(()=>import("./elixir-CkH2-t6x.js"),__vite__mapDeps([31,1,2,3]),import.meta.url))},{id:"elm",name:"Elm",import:(()=>p(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([32,27,22]),import.meta.url))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>p(()=>import("./emacs-lisp-C_m_b--Z.js"),[],import.meta.url))},{id:"erb",name:"ERB",import:(()=>p(()=>import("./erb-DXfck5VN.js"),__vite__mapDeps([33,1,2,3,34,35,7,8,16,36,11,37,13,25,26,27,22,29,38,39]),import.meta.url))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>p(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([40,41]),import.meta.url))},{id:"fennel",name:"Fennel",import:(()=>p(()=>import("./fennel-BYunw83y.js"),[],import.meta.url))},{id:"fish",name:"Fish",import:(()=>p(()=>import("./fish-BvzEVeQv.js"),[],import.meta.url))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>p(()=>import("./fluent-C4IJs8-o.js"),[],import.meta.url))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>p(()=>import("./fortran-fixed-form-CkoXwp7k.js"),__vite__mapDeps([42,43]),import.meta.url))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>p(()=>import("./fortran-free-form-BxgE0vQu.js"),[],import.meta.url))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>p(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([44,41]),import.meta.url))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>p(()=>import("./gdresource-TyuKm33G.js"),__vite__mapDeps([45,46,47]),import.meta.url))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>p(()=>import("./gdscript-DqcFQ5yU.js"),[],import.meta.url))},{id:"gdshader",name:"GDShader",import:(()=>p(()=>import("./gdshader-DkwncUOv.js"),[],import.meta.url))},{id:"genie",name:"Genie",import:(()=>p(()=>import("./genie-D0YGMca9.js"),[],import.meta.url))},{id:"gherkin",name:"Gherkin",import:(()=>p(()=>import("./gherkin-DyxjwDmM.js"),[],import.meta.url))},{id:"git-commit",name:"Git Commit Message",import:(()=>p(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([48,49]),import.meta.url))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>p(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([50,29]),import.meta.url))},{id:"gleam",name:"Gleam",import:(()=>p(()=>import("./gleam-BspZqrRM.js"),[],import.meta.url))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>p(()=>import("./glimmer-js-ByusRIyA.js"),__vite__mapDeps([51,2,11,3,1]),import.meta.url))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>p(()=>import("./glimmer-ts-BfAWNZQY.js"),__vite__mapDeps([52,11,3,2,1]),import.meta.url))},{id:"glsl",name:"GLSL",import:(()=>p(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([27,22]),import.meta.url))},{id:"gn",name:"GN",import:(()=>p(()=>import("./gn-n2N0HUVH.js"),[],import.meta.url))},{id:"gnuplot",name:"Gnuplot",import:(()=>p(()=>import("./gnuplot-DdkO51Og.js"),[],import.meta.url))},{id:"go",name:"Go",import:(()=>p(()=>import("./go-C27-OAKa.js"),[],import.meta.url))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>p(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([36,2,11,37,13]),import.meta.url))},{id:"groovy",name:"Groovy",import:(()=>p(()=>import("./groovy-gcz8RCvz.js"),[],import.meta.url))},{id:"hack",name:"Hack",import:(()=>p(()=>import("./hack-BWmVpMyf.js"),__vite__mapDeps([53,1,2,3,16]),import.meta.url))},{id:"haml",name:"Ruby Haml",import:(()=>p(()=>import("./haml-D5jkg6IW.js"),__vite__mapDeps([35,2,3]),import.meta.url))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>p(()=>import("./handlebars-BpdQsYii.js"),__vite__mapDeps([54,1,2,3,39]),import.meta.url))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>p(()=>import("./haskell-Df6bDoY_.js"),[],import.meta.url))},{id:"haxe",name:"Haxe",import:(()=>p(()=>import("./haxe-CfZj7gIn.js"),[],import.meta.url))},{id:"hcl",name:"HashiCorp HCL",import:(()=>p(()=>import("./hcl-BWvSN4gD.js"),[],import.meta.url))},{id:"hjson",name:"Hjson",import:(()=>p(()=>import("./hjson-D5-asLiD.js"),[],import.meta.url))},{id:"hlsl",name:"HLSL",import:(()=>p(()=>import("./hlsl-D3lLCCz7.js"),[],import.meta.url))},{id:"html",name:"HTML",import:(()=>p(()=>import("./html-pp8916En.js"),__vite__mapDeps([1,2,3]),import.meta.url))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>p(()=>import("./html-derivative-DlHx6ybY.js"),__vite__mapDeps([15,1,2,3]),import.meta.url))},{id:"http",name:"HTTP",import:(()=>p(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([55,29,9,7,8,36,2,11,37,13]),import.meta.url))},{id:"hurl",name:"Hurl",import:(()=>p(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([56,36,2,11,37,13,7,8,57]),import.meta.url))},{id:"hxml",name:"HXML",import:(()=>p(()=>import("./hxml-2-FPmUDs.js"),__vite__mapDeps([58,59]),import.meta.url))},{id:"hy",name:"Hy",import:(()=>p(()=>import("./hy-DFXneXwc.js"),[],import.meta.url))},{id:"imba",name:"Imba",import:(()=>p(()=>import("./imba-DGztddWO.js"),[],import.meta.url))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>p(()=>import("./ini-BEwlwnbL.js"),[],import.meta.url))},{id:"java",name:"Java",import:(()=>p(()=>import("./java-CylS5w8V.js"),[],import.meta.url))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>p(()=>import("./javascript-wDzz0qaB.js"),[],import.meta.url))},{id:"jinja",name:"Jinja",import:(()=>p(()=>import("./jinja-f2NsQr07.js"),__vite__mapDeps([60,1,2,3]),import.meta.url))},{id:"jison",name:"Jison",import:(()=>p(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([61,2]),import.meta.url))},{id:"json",name:"JSON",import:(()=>p(()=>import("./json-Cp-IABpG.js"),[],import.meta.url))},{id:"json5",name:"JSON5",import:(()=>p(()=>import("./json5-C9tS-k6U.js"),[],import.meta.url))},{id:"jsonc",name:"JSON with Comments",import:(()=>p(()=>import("./jsonc-Des-eS-w.js"),[],import.meta.url))},{id:"jsonl",name:"JSON Lines",import:(()=>p(()=>import("./jsonl-DcaNXYhu.js"),[],import.meta.url))},{id:"jsonnet",name:"Jsonnet",import:(()=>p(()=>import("./jsonnet-DFQXde-d.js"),[],import.meta.url))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>p(()=>import("./jssm-C2t-YnRu.js"),[],import.meta.url))},{id:"jsx",name:"JSX",import:(()=>p(()=>import("./jsx-g9-lgVsj.js"),[],import.meta.url))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>p(()=>import("./julia-5Bft2YPA.js"),__vite__mapDeps([62,25,26,27,22,20,2,63,16]),import.meta.url))},{id:"just",name:"Just",aliases:["justfile"],import:(()=>p(()=>import("./just-Cwhn7H3k.js"),__vite__mapDeps([64,29,2,11,65,1,3,7,8,16,20,34,35,36,37,13,25,26,27,22,38,39]),import.meta.url))},{id:"kdl",name:"KDL",import:(()=>p(()=>import("./kdl-DV7GczEv.js"),[],import.meta.url))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>p(()=>import("./kotlin-BdnUsdx6.js"),[],import.meta.url))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>p(()=>import("./kusto-wEQ09or8.js"),[],import.meta.url))},{id:"latex",name:"LaTeX",import:(()=>p(()=>import("./latex-D5pSuvFb.js"),__vite__mapDeps([66,67,63]),import.meta.url))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>p(()=>import("./lean-BZvkOJ9d.js"),[],import.meta.url))},{id:"less",name:"Less",import:(()=>p(()=>import("./less-B1dDrJ26.js"),[],import.meta.url))},{id:"liquid",name:"Liquid",import:(()=>p(()=>import("./liquid-C0sCDyMI.js"),__vite__mapDeps([68,1,2,3,9]),import.meta.url))},{id:"llvm",name:"LLVM IR",import:(()=>p(()=>import("./llvm-BZoOZj88.js"),[],import.meta.url))},{id:"log",name:"Log file",import:(()=>p(()=>import("./log-2UxHyX5q.js"),[],import.meta.url))},{id:"logo",name:"Logo",import:(()=>p(()=>import("./logo-BtOb2qkB.js"),[],import.meta.url))},{id:"lua",name:"Lua",import:(()=>p(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([38,22]),import.meta.url))},{id:"luau",name:"Luau",import:(()=>p(()=>import("./luau-BnpPk5vE.js"),[],import.meta.url))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>p(()=>import("./make-CHLpvVh8.js"),[],import.meta.url))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>p(()=>import("./markdown-Cvjx9yec.js"),[],import.meta.url))},{id:"marko",name:"Marko",import:(()=>p(()=>import("./marko-DjSrsDqO.js"),__vite__mapDeps([69,3,70,5,11]),import.meta.url))},{id:"matlab",name:"MATLAB",import:(()=>p(()=>import("./matlab-D7o27uSR.js"),[],import.meta.url))},{id:"mdc",name:"MDC",import:(()=>p(()=>import("./mdc-D1_yUvq7.js"),__vite__mapDeps([71,41,39,15,1,2,3]),import.meta.url))},{id:"mdx",name:"MDX",import:(()=>p(()=>import("./mdx-Cmh6b_Ma.js"),[],import.meta.url))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>p(()=>import("./mermaid-CQcHuHx7.js"),[],import.meta.url))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>p(()=>import("./mipsasm-CKIfxQSi.js"),[],import.meta.url))},{id:"mojo",name:"Mojo",import:(()=>p(()=>import("./mojo-DJz3ZmWd.js"),[],import.meta.url))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>p(()=>import("./moonbit-CHtswR0a.js"),[],import.meta.url))},{id:"move",name:"Move",import:(()=>p(()=>import("./move-el3G9tDJ.js"),[],import.meta.url))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>p(()=>import("./narrat-DRg8JJMk.js"),[],import.meta.url))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>p(()=>import("./nextflow-C-mBbutL.js"),__vite__mapDeps([72,73]),import.meta.url))},{id:"nextflow-groovy",name:"Nextflow Groovy",import:(()=>p(()=>import("./nextflow-groovy-vE_lwT2v.js"),[],import.meta.url))},{id:"nginx",name:"Nginx",import:(()=>p(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([74,38,22]),import.meta.url))},{id:"nim",name:"Nim",import:(()=>p(()=>import("./nim-BIad80T-.js"),__vite__mapDeps([75,22,1,2,3,7,8,27,41]),import.meta.url))},{id:"nix",name:"Nix",import:(()=>p(()=>import("./nix-CwoSXNpI.js"),[],import.meta.url))},{id:"nsis",name:"NSIS",import:(()=>p(()=>import("./nsis-BlV79W_Q.js"),[],import.meta.url))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>p(()=>import("./nushell-D3jzshHO.js"),[],import.meta.url))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>p(()=>import("./objective-c-DXmwc3jG.js"),[],import.meta.url))},{id:"objective-cpp",name:"Objective-C++",import:(()=>p(()=>import("./objective-cpp-CLxacb5B.js"),[],import.meta.url))},{id:"ocaml",name:"OCaml",import:(()=>p(()=>import("./ocaml-C0hk2d4L.js"),[],import.meta.url))},{id:"odin",name:"Odin",import:(()=>p(()=>import("./odin-BBf5iR-q.js"),[],import.meta.url))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>p(()=>import("./openscad-C4EeE6gA.js"),[],import.meta.url))},{id:"org",name:"Org Markup",import:(()=>p(()=>import("./org-DM6o9KBp.js"),__vite__mapDeps([76,2,11,13,8,20,26,3,38,22,77,78,65,1,7,16,63,34,35,36,37,25,27,29,39,79,9,80,81,24,82,49,83,84,85,70,5,86,87,88,89,90,75,41,31,40,91,92,93,48,50,66,67]),import.meta.url))},{id:"pascal",name:"Pascal",import:(()=>p(()=>import("./pascal-D93ZcfNL.js"),[],import.meta.url))},{id:"perl",name:"Perl",import:(()=>p(()=>import("./perl-B9cMNwum.js"),__vite__mapDeps([65,1,2,3,7,8,16]),import.meta.url))},{id:"php",name:"PHP",import:(()=>p(()=>import("./php-Csjmro_R.js"),__vite__mapDeps([79,1,2,3,7,8,16,9]),import.meta.url))},{id:"pkl",name:"Pkl",import:(()=>p(()=>import("./pkl-u5AG7uiY.js"),[],import.meta.url))},{id:"plsql",name:"PL/SQL",import:(()=>p(()=>import("./plsql-ChMvpjG-.js"),[],import.meta.url))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>p(()=>import("./po-BTJTHyun.js"),[],import.meta.url))},{id:"polar",name:"Polar",import:(()=>p(()=>import("./polar-C0HS_06l.js"),[],import.meta.url))},{id:"postcss",name:"PostCSS",import:(()=>p(()=>import("./postcss-CXtECtnM.js"),[],import.meta.url))},{id:"powerquery",name:"PowerQuery",import:(()=>p(()=>import("./powerquery-CEu0bR-o.js"),[],import.meta.url))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1","pwsh"],import:(()=>p(()=>import("./powershell-BmBUJMz7.js"),[],import.meta.url))},{id:"prisma",name:"Prisma",import:(()=>p(()=>import("./prisma-Vru482bI.js"),[],import.meta.url))},{id:"prolog",name:"Prolog",import:(()=>p(()=>import("./prolog-CbFg5uaA.js"),[],import.meta.url))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>p(()=>import("./proto-C7zT0LnQ.js"),[],import.meta.url))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>p(()=>import("./pug-DKIMFp6K.js"),__vite__mapDeps([94,2,3,1]),import.meta.url))},{id:"puppet",name:"Puppet",import:(()=>p(()=>import("./puppet-BMWR74SV.js"),[],import.meta.url))},{id:"purescript",name:"PureScript",import:(()=>p(()=>import("./purescript-CklMAg4u.js"),[],import.meta.url))},{id:"python",name:"Python",aliases:["py"],import:(()=>p(()=>import("./python-B6aJPvgy.js"),[],import.meta.url))},{id:"qml",name:"QML",import:(()=>p(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([95,2]),import.meta.url))},{id:"qmldir",name:"QML Directory",import:(()=>p(()=>import("./qmldir-C8lEn-DE.js"),[],import.meta.url))},{id:"qss",name:"Qt Style Sheets",import:(()=>p(()=>import("./qss-IeuSbFQv.js"),[],import.meta.url))},{id:"r",name:"R",import:(()=>p(()=>import("./r-Cf5RLm7j.js"),[],import.meta.url))},{id:"racket",name:"Racket",import:(()=>p(()=>import("./racket-BqYA7rlc.js"),[],import.meta.url))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>p(()=>import("./raku-DXvB9xmW.js"),[],import.meta.url))},{id:"razor",name:"ASP.NET Razor",import:(()=>p(()=>import("./razor-BjBPvh-w.js"),__vite__mapDeps([96,1,2,3,89]),import.meta.url))},{id:"rbs",name:"RBS",aliases:["ruby-signature"],import:(()=>p(()=>import("./rbs-CpoqiR4B.js"),[],import.meta.url))},{id:"reg",name:"Windows Registry Script",import:(()=>p(()=>import("./reg-C-SQnVFl.js"),[],import.meta.url))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>p(()=>import("./regexp-CDVJQ6XC.js"),[],import.meta.url))},{id:"rel",name:"Rel",import:(()=>p(()=>import("./rel-C3B-1QV4.js"),[],import.meta.url))},{id:"riscv",name:"RISC-V",import:(()=>p(()=>import("./riscv-BM1_JUlF.js"),[],import.meta.url))},{id:"ron",name:"RON",import:(()=>p(()=>import("./ron-D8l8udqQ.js"),[],import.meta.url))},{id:"rosmsg",name:"ROS Interface",import:(()=>p(()=>import("./rosmsg-BJDFO7_C.js"),[],import.meta.url))},{id:"rst",name:"reStructuredText",import:(()=>p(()=>import("./rst-bs7f0vWN.js"),__vite__mapDeps([97,15,1,2,3,25,26,27,22,20,29,39,98,34,35,7,8,16,36,11,37,13,38]),import.meta.url))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>p(()=>import("./ruby-C0TQ7zu5.js"),__vite__mapDeps([34,1,2,3,35,7,8,16,36,11,37,13,25,26,27,22,29,38,39]),import.meta.url))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>p(()=>import("./rust-B1yitclQ.js"),[],import.meta.url))},{id:"sas",name:"SAS",import:(()=>p(()=>import("./sas-DEy46yEz.js"),__vite__mapDeps([99,16]),import.meta.url))},{id:"sass",name:"Sass",import:(()=>p(()=>import("./sass-Cj5Yp3dK.js"),[],import.meta.url))},{id:"scala",name:"Scala",import:(()=>p(()=>import("./scala-CqE71os6.js"),[],import.meta.url))},{id:"scheme",name:"Scheme",import:(()=>p(()=>import("./scheme-C98Dy4si.js"),[],import.meta.url))},{id:"scss",name:"SCSS",import:(()=>p(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([5,3]),import.meta.url))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>p(()=>import("./sdbl-DVxCFoDh.js"),[],import.meta.url))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>p(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([100,101]),import.meta.url))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>p(()=>import("./shellscript-Yzrsuije.js"),[],import.meta.url))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>p(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([102,29]),import.meta.url))},{id:"smalltalk",name:"GNU Smalltalk",import:(()=>p(()=>import("./smalltalk-BOQMe2GC.js"),[],import.meta.url))},{id:"smithy",name:"Smithy",import:(()=>p(()=>import("./smithy-cds9vsN8.js"),[],import.meta.url))},{id:"solidity",name:"Solidity",import:(()=>p(()=>import("./solidity-DijEV5ha.js"),[],import.meta.url))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>p(()=>import("./soy-8wufbnw4.js"),__vite__mapDeps([103,1,2,3]),import.meta.url))},{id:"sparql",name:"SPARQL",import:(()=>p(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([104,105]),import.meta.url))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>p(()=>import("./splunk-BtCnVYZw.js"),[],import.meta.url))},{id:"sql",name:"SQL",import:(()=>p(()=>import("./sql-CRqJ_cUM.js"),[],import.meta.url))},{id:"ssh-config",name:"SSH Config",import:(()=>p(()=>import("./ssh-config-_ykCGR6B.js"),[],import.meta.url))},{id:"stata",name:"Stata",import:(()=>p(()=>import("./stata-DI20mbqo.js"),__vite__mapDeps([106,16]),import.meta.url))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>p(()=>import("./stylus-BEDo0Tqx.js"),[],import.meta.url))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>p(()=>import("./surrealql-Cjom0U5J.js"),__vite__mapDeps([107,2]),import.meta.url))},{id:"svelte",name:"Svelte",import:(()=>p(()=>import("./svelte-Cy7k_4gC.js"),__vite__mapDeps([108,2,11,3,12]),import.meta.url))},{id:"swift",name:"Swift",import:(()=>p(()=>import("./swift-C2oV4EkX.js"),[],import.meta.url))},{id:"system-verilog",name:"SystemVerilog",import:(()=>p(()=>import("./system-verilog-0hqHdDBg.js"),[],import.meta.url))},{id:"systemd",name:"Systemd Units",import:(()=>p(()=>import("./systemd-4A_iFExJ.js"),[],import.meta.url))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>p(()=>import("./talonscript-CkByrt1z.js"),[],import.meta.url))},{id:"tasl",name:"Tasl",import:(()=>p(()=>import("./tasl-QIJgUcNo.js"),[],import.meta.url))},{id:"tcl",name:"Tcl",import:(()=>p(()=>import("./tcl-dwOrl1Do.js"),[],import.meta.url))},{id:"templ",name:"Templ",import:(()=>p(()=>import("./templ-DhtptRzy.js"),__vite__mapDeps([109,84,2,3]),import.meta.url))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>p(()=>import("./terraform-BETggiCN.js"),[],import.meta.url))},{id:"tex",name:"TeX",import:(()=>p(()=>import("./tex-D96PA37w.js"),__vite__mapDeps([67,63]),import.meta.url))},{id:"toml",name:"TOML",import:(()=>p(()=>import("./toml-vGWfd6FD.js"),[],import.meta.url))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>p(()=>import("./ts-tags-D351s5mN.js"),__vite__mapDeps([110,11,3,2,27,22,1,16,7,8]),import.meta.url))},{id:"tsv",name:"TSV",import:(()=>p(()=>import("./tsv-B_m7g4N7.js"),[],import.meta.url))},{id:"tsx",name:"TSX",import:(()=>p(()=>import("./tsx-COt5Ahok.js"),[],import.meta.url))},{id:"turtle",name:"Turtle",import:(()=>p(()=>import("./turtle-BsS91CYL.js"),[],import.meta.url))},{id:"twig",name:"Twig",import:(()=>p(()=>import("./twig-27uCiNez.js"),__vite__mapDeps([111,3,2,5,79,1,7,8,16,9,20,34,35,36,11,37,13,25,26,27,22,29,38,39]),import.meta.url))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>p(()=>import("./typescript-BPQ3VLAy.js"),[],import.meta.url))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>p(()=>import("./typespec-CAFt9gP4.js"),[],import.meta.url))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>p(()=>import("./typst-BUadGCkm.js"),__vite__mapDeps([112,113,114,22,81,24,2,25,26,27,3,89,90,49,83,31,1,40,41,44,48,50,29,84,85,54,39,77,8,115,9,62,20,63,16,66,67,70,116,38,78,82,65,7,86,79,117,94,34,35,36,11,37,13,5,118,93,87,88,111,119,120,80]),import.meta.url))},{id:"v",name:"V",import:(()=>p(()=>import("./v-BGw2Nkan.js"),[],import.meta.url))},{id:"vala",name:"Vala",import:(()=>p(()=>import("./vala-CsfeWuGM.js"),[],import.meta.url))},{id:"vb",name:"Visual Basic",import:(()=>p(()=>import("./vb-Cu-pLBUe.js"),[],import.meta.url))},{id:"verilog",name:"Verilog",import:(()=>p(()=>import("./verilog-nZwndyjY.js"),[],import.meta.url))},{id:"vhdl",name:"VHDL",import:(()=>p(()=>import("./vhdl-CeAyd5Ju.js"),[],import.meta.url))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>p(()=>import("./viml-CJc9bBzg.js"),[],import.meta.url))},{id:"vue",name:"Vue",import:(()=>p(()=>import("./vue-BqiEGhQt.js"),__vite__mapDeps([121,3,2,11,9,1,15]),import.meta.url))},{id:"vue-html",name:"Vue HTML",import:(()=>p(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([122,2]),import.meta.url))},{id:"vue-vine",name:"Vue Vine",import:(()=>p(()=>import("./vue-vine-BoDAl6tE.js"),__vite__mapDeps([123,3,5,70,124,12,2]),import.meta.url))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>p(()=>import("./vyper-CDx5xZoG.js"),[],import.meta.url))},{id:"wasm",name:"WebAssembly",import:(()=>p(()=>import("./wasm-MzD3tlZU.js"),[],import.meta.url))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>p(()=>import("./wenyan-BV7otONQ.js"),[],import.meta.url))},{id:"wgsl",name:"WGSL",import:(()=>p(()=>import("./wgsl-Dx-B1_4e.js"),[],import.meta.url))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>p(()=>import("./wikitext-BhOHFoWU.js"),[],import.meta.url))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>p(()=>import("./wit-5i3qLPDT.js"),[],import.meta.url))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>p(()=>import("./wolfram-lXgVvXCa.js"),[],import.meta.url))},{id:"xml",name:"XML",import:(()=>p(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8]),import.meta.url))},{id:"xsl",name:"XSL",import:(()=>p(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([93,7,8]),import.meta.url))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>p(()=>import("./yaml-Buea-lGh.js"),[],import.meta.url))},{id:"zenscript",name:"ZenScript",import:(()=>p(()=>import("./zenscript-DVFEvuxE.js"),[],import.meta.url))},{id:"zig",name:"Zig",import:(()=>p(()=>import("./zig-VOosw3JB.js"),[],import.meta.url))}],Pa=Object.fromEntries(So.map(e=>[e.id,e.import])),Oa=Object.fromEntries(So.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),on={...Pa,...Oa},Ma=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>p(()=>import("./andromeeda-C4gqWexZ.js"),[],import.meta.url))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>p(()=>import("./aurora-x-D-2ljcwZ.js"),[],import.meta.url))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>p(()=>import("./ayu-dark-DYE7WIF3.js"),[],import.meta.url))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>p(()=>import("./ayu-light-BA47KaF1.js"),[],import.meta.url))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>p(()=>import("./ayu-mirage-32ctXXKs.js"),[],import.meta.url))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>p(()=>import("./catppuccin-frappe-CZL1YF0i.js"),[],import.meta.url))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>p(()=>import("./catppuccin-latte-DH-8KZSZ.js"),[],import.meta.url))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>p(()=>import("./catppuccin-macchiato-B7yYVSCf.js"),[],import.meta.url))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>p(()=>import("./catppuccin-mocha-Ct7hS0mc.js"),[],import.meta.url))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>p(()=>import("./dark-plus-C3mMm8J8.js"),[],import.meta.url))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>p(()=>import("./dracula-BzJJZx-M.js"),[],import.meta.url))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>p(()=>import("./dracula-soft-BXkSAIEj.js"),[],import.meta.url))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>p(()=>import("./everforest-dark-BgDCqdQA.js"),[],import.meta.url))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>p(()=>import("./everforest-light-C8M2exoo.js"),[],import.meta.url))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>p(()=>import("./github-dark-vbPMK5nw.js"),[],import.meta.url))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>p(()=>import("./github-dark-default-Cuk6v7N8.js"),[],import.meta.url))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>p(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[],import.meta.url))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>p(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[],import.meta.url))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>p(()=>import("./github-light-CBO01_j6.js"),[],import.meta.url))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>p(()=>import("./github-light-default-D7oLnXFd.js"),[],import.meta.url))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>p(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[],import.meta.url))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>p(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[],import.meta.url))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>p(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[],import.meta.url))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>p(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[],import.meta.url))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>p(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[],import.meta.url))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>p(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[],import.meta.url))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>p(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[],import.meta.url))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>p(()=>import("./horizon-BUw7H-hv.js"),[],import.meta.url))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>p(()=>import("./horizon-bright-CUuTKBJd.js"),[],import.meta.url))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>p(()=>import("./houston-DnULxvSX.js"),[],import.meta.url))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>p(()=>import("./kanagawa-dragon-BuwD2xS4.js"),[],import.meta.url))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>p(()=>import("./kanagawa-lotus-C3DzagqV.js"),[],import.meta.url))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>p(()=>import("./kanagawa-wave-DFGoQZhC.js"),[],import.meta.url))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>p(()=>import("./laserwave-DUszq2jm.js"),[],import.meta.url))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>p(()=>import("./light-plus-B7mTdjB0.js"),[],import.meta.url))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>p(()=>import("./material-theme-D5KoaKCx.js"),[],import.meta.url))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>p(()=>import("./material-theme-darker-BfHTSMKl.js"),[],import.meta.url))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>p(()=>import("./material-theme-lighter-B0m2ddpp.js"),[],import.meta.url))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>p(()=>import("./material-theme-ocean-CyktbL80.js"),[],import.meta.url))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>p(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[],import.meta.url))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>p(()=>import("./min-dark-CafNBF8u.js"),[],import.meta.url))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>p(()=>import("./min-light-CTRr51gU.js"),[],import.meta.url))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>p(()=>import("./monokai-BRVnQi9A.js"),[],import.meta.url))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>p(()=>import("./night-owl-C39BiMTA.js"),[],import.meta.url))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>p(()=>import("./night-owl-light-CMTm3GFP.js"),[],import.meta.url))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>p(()=>import("./nord-Ddv68eIx.js"),[],import.meta.url))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>p(()=>import("./one-dark-pro-DVMEJ2y_.js"),[],import.meta.url))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>p(()=>import("./one-light-C3Wv6jpd.js"),[],import.meta.url))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>p(()=>import("./plastic-3e1v2bzS.js"),[],import.meta.url))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>p(()=>import("./poimandres-CS3Unz2-.js"),[],import.meta.url))},{id:"red",displayName:"Red",type:"dark",import:(()=>p(()=>import("./red-hvxz__6c.js"),[],import.meta.url))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>p(()=>import("./rose-pine-5qJOZa0Y.js"),[],import.meta.url))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>p(()=>import("./rose-pine-dawn-zx0QlTCp.js"),[],import.meta.url))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>p(()=>import("./rose-pine-moon-C9pEdX9L.js"),[],import.meta.url))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>p(()=>import("./slack-dark-BthQWCQV.js"),[],import.meta.url))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>p(()=>import("./slack-ochin-DqwNpetd.js"),[],import.meta.url))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>p(()=>import("./snazzy-light-Bw305WKR.js"),[],import.meta.url))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>p(()=>import("./solarized-dark-CpvCGNkr.js"),[],import.meta.url))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>p(()=>import("./solarized-light-Dlz6yCKv.js"),[],import.meta.url))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>p(()=>import("./synthwave-84-CbfX1IO0.js"),[],import.meta.url))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>p(()=>import("./tokyo-night-hegEt444.js"),[],import.meta.url))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>p(()=>import("./vesper-DRje8inN.js"),[],import.meta.url))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>p(()=>import("./vitesse-black-Bkuqu6BP.js"),[],import.meta.url))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>p(()=>import("./vitesse-dark-D0r3Knsf.js"),[],import.meta.url))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>p(()=>import("./vitesse-light-CVO1_9PV.js"),[],import.meta.url))}],Ha=Object.fromEntries(Ma.map(e=>[e.id,e.import]));var Pn=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function Na(){return 2147483648}function Fa(){return typeof performance<"u"?performance.now():Date.now()}const Va=(e,t)=>e+(t-e%t)%t;async function $a(e){let t,i;const n={};function r(h){i=h,n.HEAPU8=new Uint8Array(h),n.HEAPU32=new Uint32Array(h)}function o(h,m,g){n.HEAPU8.copyWithin(h,m,m+g)}function s(h){try{return t.grow(h-i.byteLength+65535>>>16),r(t.buffer),1}catch{}}function l(h){const m=n.HEAPU8.length;h=h>>>0;const g=Na();if(h>g)return!1;for(let y=1;y<=4;y*=2){let v=m*(1+.2/y);v=Math.min(v,h+100663296);const _=Math.min(g,Va(Math.max(h,v),65536));if(s(_))return!0}return!1}const a=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function d(h,m,g=1024){const y=m+g;let v=m;for(;h[v]&&!(v>=y);)++v;if(v-m>16&&h.buffer&&a)return a.decode(h.subarray(m,v));let _="";for(;m<v;){let b=h[m++];if(!(b&128)){_+=String.fromCharCode(b);continue}const L=h[m++]&63;if((b&224)===192){_+=String.fromCharCode((b&31)<<6|L);continue}const E=h[m++]&63;if((b&240)===224?b=(b&15)<<12|L<<6|E:b=(b&7)<<18|L<<12|E<<6|h[m++]&63,b<65536)_+=String.fromCharCode(b);else{const S=b-65536;_+=String.fromCharCode(55296|S>>10,56320|S&1023)}}return _}function u(h,m){return h?d(n.HEAPU8,h,m):""}const c={emscripten_get_now:Fa,emscripten_memcpy_big:o,emscripten_resize_heap:l,fd_write:()=>0};async function f(){const m=await e({env:c,wasi_snapshot_preview1:c});t=m.memory,r(t.buffer),Object.assign(n,m),n.UTF8ToString=u}return await f(),n}var Ua=Object.defineProperty,za=(e,t,i)=>t in e?Ua(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,X=(e,t,i)=>za(e,typeof t!="symbol"?t+"":t,i);let Q=null;function Ba(e){throw new Pn(e.UTF8ToString(e.getLastOnigError()))}class ci{constructor(t){X(this,"utf16Length"),X(this,"utf8Length"),X(this,"utf16Value"),X(this,"utf8Value"),X(this,"utf16OffsetToUtf8"),X(this,"utf8OffsetToUtf16");const i=t.length,n=ci._utf8ByteLength(t),r=n!==i,o=r?new Uint32Array(i+1):null;r&&(o[i]=n);const s=r?new Uint32Array(n+1):null;r&&(s[n]=i);const l=new Uint8Array(n);let a=0;for(let d=0;d<i;d++){const u=t.charCodeAt(d);let c=u,f=!1;if(u>=55296&&u<=56319&&d+1<i){const h=t.charCodeAt(d+1);h>=56320&&h<=57343&&(c=(u-55296<<10)+65536|h-56320,f=!0)}r&&(o[d]=a,f&&(o[d+1]=a),c<=127?s[a+0]=d:c<=2047?(s[a+0]=d,s[a+1]=d):c<=65535?(s[a+0]=d,s[a+1]=d,s[a+2]=d):(s[a+0]=d,s[a+1]=d,s[a+2]=d,s[a+3]=d)),c<=127?l[a++]=c:c<=2047?(l[a++]=192|(c&1984)>>>6,l[a++]=128|(c&63)>>>0):c<=65535?(l[a++]=224|(c&61440)>>>12,l[a++]=128|(c&4032)>>>6,l[a++]=128|(c&63)>>>0):(l[a++]=240|(c&1835008)>>>18,l[a++]=128|(c&258048)>>>12,l[a++]=128|(c&4032)>>>6,l[a++]=128|(c&63)>>>0),f&&d++}this.utf16Length=i,this.utf8Length=n,this.utf16Value=t,this.utf8Value=l,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=s}static _utf8ByteLength(t){let i=0;for(let n=0,r=t.length;n<r;n++){const o=t.charCodeAt(n);let s=o,l=!1;if(o>=55296&&o<=56319&&n+1<r){const a=t.charCodeAt(n+1);a>=56320&&a<=57343&&(s=(o-55296<<10)+65536|a-56320,l=!0)}s<=127?i+=1:s<=2047?i+=2:s<=65535?i+=3:i+=4,l&&n++}return i}createString(t){const i=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,i),i}}const fi=class ge{constructor(t){if(X(this,"id",++ge.LAST_ID),X(this,"_onigBinding"),X(this,"content"),X(this,"utf16Length"),X(this,"utf8Length"),X(this,"utf16OffsetToUtf8"),X(this,"utf8OffsetToUtf16"),X(this,"ptr"),!Q)throw new Pn("Must invoke loadWasm first.");this._onigBinding=Q,this.content=t;const i=new ci(t);this.utf16Length=i.utf16Length,this.utf8Length=i.utf8Length,this.utf16OffsetToUtf8=i.utf16OffsetToUtf8,this.utf8OffsetToUtf16=i.utf8OffsetToUtf16,this.utf8Length<1e4&&!ge._sharedPtrInUse?(ge._sharedPtr||(ge._sharedPtr=Q.omalloc(1e4)),ge._sharedPtrInUse=!0,Q.HEAPU8.set(i.utf8Value,ge._sharedPtr),this.ptr=ge._sharedPtr):this.ptr=i.createString(Q)}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===ge._sharedPtr?ge._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};X(fi,"LAST_ID",0);X(fi,"_sharedPtr",0);X(fi,"_sharedPtrInUse",!1);let Lo=fi;class Ga{constructor(t){if(X(this,"_onigBinding"),X(this,"_ptr"),!Q)throw new Pn("Must invoke loadWasm first.");const i=[],n=[];for(let l=0,a=t.length;l<a;l++){const d=new ci(t[l]);i[l]=d.createString(Q),n[l]=d.utf8Length}const r=Q.omalloc(4*t.length);Q.HEAPU32.set(i,r/4);const o=Q.omalloc(4*t.length);Q.HEAPU32.set(n,o/4);const s=Q.createOnigScanner(r,o,t.length);for(let l=0,a=t.length;l<a;l++)Q.ofree(i[l]);Q.ofree(o),Q.ofree(r),s===0&&Ba(Q),this._onigBinding=Q,this._ptr=s}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,i,n){let r=0;if(typeof n=="number"&&(r=n),typeof t=="string"){t=new Lo(t);const o=this._findNextMatchSync(t,i,!1,r);return t.dispose(),o}return this._findNextMatchSync(t,i,!1,r)}_findNextMatchSync(t,i,n,r){const o=this._onigBinding,s=o.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(i),r);if(s===0)return null;const l=o.HEAPU32;let a=s/4;const d=l[a++],u=l[a++],c=[];for(let f=0;f<u;f++){const h=t.convertUtf8OffsetToUtf16(l[a++]),m=t.convertUtf8OffsetToUtf16(l[a++]);c[f]={start:h,end:m,length:m-h}}return{index:d,captureIndices:c}}}function ja(e){return typeof e.instantiator=="function"}function Wa(e){return typeof e.default=="function"}function qa(e){return typeof e.data<"u"}function Ka(e){return typeof Response<"u"&&e instanceof Response}function Xa(e){return typeof ArrayBuffer<"u"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e))||typeof Buffer<"u"&&Buffer.isBuffer?.(e)||typeof SharedArrayBuffer<"u"&&e instanceof SharedArrayBuffer||typeof Uint32Array<"u"&&e instanceof Uint32Array}let Ot;function Co(e){if(Ot)return Ot;async function t(){Q=await $a(async i=>{let n=e;return n=await n,typeof n=="function"&&(n=await n(i)),typeof n=="function"&&(n=await n(i)),ja(n)?n=await n.instantiator(i):Wa(n)?n=await n.default(i):(qa(n)&&(n=n.data),Ka(n)?typeof WebAssembly.instantiateStreaming=="function"?n=await Ja(n)(i):n=await Qa(n)(i):Xa(n)?n=await Ai(n)(i):n instanceof WebAssembly.Module?n=await Ai(n)(i):"default"in n&&n.default instanceof WebAssembly.Module&&(n=await Ai(n.default)(i))),"instance"in n&&(n=n.instance),"exports"in n&&(n=n.exports),n})}return Ot=t(),Ot}function Ai(e){return t=>WebAssembly.instantiate(e,t)}function Ja(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Qa(e){return async t=>{const i=await e.arrayBuffer();return WebAssembly.instantiate(i,t)}}let wo;function Za(e){wo=e}function Ya(){return wo}async function ko(e){return e&&await Co(e),{createScanner(t){return new Ga(t.map(i=>typeof i=="string"?i:i.source))},createString(t){return new Lo(t)}}}const el=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:ko,getDefaultWasmLoader:Ya,loadWasm:Co,setDefaultWasmLoader:Za},Symbol.toStringTag,{value:"Module"}));var xo=Ta({});Da(xo,el);var z=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function ei(e,t){const i=typeof e=="string"?{}:{...e.colorReplacements},n=typeof e=="string"?e:e.name;for(const[r,o]of Object.entries(t?.colorReplacements||{}))typeof o=="string"?i[r]=o:r===n&&Object.assign(i,o);return i}function Be(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function tl(e){return Array.isArray(e)?e:[e]}async function Ao(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function hi(e){return!e||["plaintext","txt","text","plain"].includes(e)}function Ro(e){return e==="ansi"||hi(e)}function pi(e){return e==="none"}function To(e){return pi(e)}const il=/(\r?\n)/g;function mi(e,t=!1){if(e.length===0)return[["",0]];const i=e.split(il);let n=0;const r=[];for(let o=0;o<i.length;o+=2){const s=t?i[o]+(i[o+1]||""):i[o];r.push([s,n]),n+=i[o].length,n+=i[o+1]?.length||0}return r}const qn={light:"#333333",dark:"#bbbbbb"},Kn={light:"#fffffe",dark:"#1e1e1e"},Xn="__shiki_resolved";function gi(e){if(e?.[Xn])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:i,fg:n}=t;if(!i||!n){const l=t.settings?t.settings.find(a=>!a.name&&!a.scope):void 0;l?.settings?.foreground&&(n=l.settings.foreground),l?.settings?.background&&(i=l.settings.background),!n&&t?.colors?.["editor.foreground"]&&(n=t.colors["editor.foreground"]),!i&&t?.colors?.["editor.background"]&&(i=t.colors["editor.background"]),n||(n=t.type==="light"?qn.light:qn.dark),i||(i=t.type==="light"?Kn.light:Kn.dark),t.fg=n,t.bg=i}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let r=0;const o=new Map;function s(l){if(o.has(l))return o.get(l);r+=1;const a=`#${r.toString(16).padStart(8,"0").toLowerCase()}`;return t.colorReplacements?.[`#${a}`]?s(l):(o.set(l,a),a)}t.settings=t.settings.map(l=>{const a=l.settings?.foreground&&!l.settings.foreground.startsWith("#"),d=l.settings?.background&&!l.settings.background.startsWith("#");if(!a&&!d)return l;const u={...l,settings:{...l.settings}};if(a){const c=s(l.settings.foreground);t.colorReplacements[c]=l.settings.foreground,u.settings.foreground=c}if(d){const c=s(l.settings.background);t.colorReplacements[c]=l.settings.background,u.settings.background=c}return u});for(const l of Object.keys(t.colors||{}))if((l==="editor.foreground"||l==="editor.background"||l.startsWith("terminal.ansi"))&&!t.colors[l]?.startsWith("#")){const a=s(t.colors[l]);t.colorReplacements[a]=t.colors[l],t.colors[l]=a}return Object.defineProperty(t,Xn,{enumerable:!1,writable:!1,value:!0}),t}async function Io(e){return[...new Set((await Promise.all(e.filter(t=>!Ro(t)).map(async t=>await Ao(t).then(i=>Array.isArray(i)?i:[i])))).flat())]}async function Do(e){return(await Promise.all(e.map(async t=>To(t)?null:gi(await Ao(t))))).filter(t=>!!t)}function Po(e,t){if(!t)return e;if(t[e]){const i=new Set([e]);for(;t[e];){if(e=t[e],i.has(e))throw new z(`Circular alias \`${[...i].join(" -> ")} -> ${e}\``);i.add(e)}}return e}var nl=class extends Qs{_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,i,n={}){super(e),this._resolver=e,this._themes=t,this._langs=i,this._alias=n,this._themes.map(r=>this.loadTheme(r)),this.loadLanguages(this._langs)}getTheme(e){return typeof e=="string"?this._resolvedThemes.get(e):this.loadTheme(e)}loadTheme(e){const t=gi(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=Zs.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=Po(e,this._alias),this._resolvedGrammars.get(e)}loadLanguage(e){if(this.getGrammar(e.name))return;const t=new Set([...this._langMap.values()].filter(r=>r.embeddedLangsLazy?.includes(e.name)));this._resolver.addLanguage(e);const i={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const n=this.loadGrammarWithConfiguration(e.scopeName,1,i);if(n.name=e.name,this._resolvedGrammars.set(e.name,n),e.aliases&&e.aliases.forEach(r=>{this._alias[r]=e.name}),this._loadedLanguagesCache=null,t.size)for(const r of t)this._resolvedGrammars.delete(r.name),this._loadedLanguagesCache=null,this._syncRegistry?._injectionGrammars?.delete(r.scopeName),this._syncRegistry?._grammars?.delete(r.scopeName),this.loadLanguage(this._langMap.get(r.name))}dispose(){super.dispose(),this._resolvedThemes.clear(),this._resolvedGrammars.clear(),this._langMap.clear(),this._langGraph.clear(),this._loadedThemesCache=null}loadLanguages(e){for(const n of e)this.resolveEmbeddedLanguages(n);const t=[...this._langGraph.entries()],i=t.filter(([n,r])=>!r);if(i.length){const n=t.filter(([r,o])=>o?(o.embeddedLanguages||o.embeddedLangs)?.some(s=>i.map(([l])=>l).includes(s)):!1).filter(r=>!i.includes(r));throw new z(`Missing languages ${i.map(([r])=>`\`${r}\``).join(", ")}, required by ${n.map(([r])=>`\`${r}\``).join(", ")}`)}for(const[n,r]of t)this._resolver.addLanguage(r);for(const[n,r]of t)this.loadLanguage(r)}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 i of t)this._langGraph.set(i,this._langMap.get(i))}},rl=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:i=>e.createScanner(i),createOnigString:i=>e.createString(i)},t.forEach(i=>this.addLanguage(i))}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 i=[];for(let n=1;n<=t.length;n++){const r=t.slice(0,n).join(".");i=[...i,...this._injections.get(r)||[]]}return i}};let gt=0;function ol(e){gt+=1,e.warnings!==!1&&gt>=10&&gt%10===0&&console.warn(`[Shiki] ${gt} 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 z("`engine` option is required for synchronous mode");const i=(e.langs||[]).flat(1),n=(e.themes||[]).flat(1).map(gi),r=new nl(new rl(e.engine,i),n,i,e.langAlias);let o;function s(_){return Po(_,e.langAlias)}function l(_){y();const b=r.getGrammar(typeof _=="string"?_:_.name);if(!b)throw new z(`Language \`${_}\` not found, you may need to load it first`);return b}function a(_){if(_==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};y();const b=r.getTheme(_);if(!b)throw new z(`Theme \`${_}\` not found, you may need to load it first`);return b}function d(_){y();const b=a(_);return o!==_&&(r.setTheme(b),o=_),{theme:b,colorMap:r.getColorMap()}}function u(){return y(),r.getLoadedThemes()}function c(){return y(),r.getLoadedLanguages()}function f(..._){y(),r.loadLanguages(_.flat(1))}async function h(..._){return f(await Io(_))}function m(..._){y();for(const b of _.flat(1))r.loadTheme(b)}async function g(..._){return y(),m(await Do(_))}function y(){if(t)throw new z("Shiki instance has been disposed")}function v(){t||(t=!0,r.dispose(),gt-=1)}return{setTheme:d,getTheme:a,getLanguage:l,getLoadedThemes:u,getLoadedLanguages:c,resolveLangAlias:s,loadLanguage:h,loadLanguageSync:f,loadTheme:g,loadThemeSync:m,dispose:v,[Symbol.dispose]:v}}async function sl(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,i,n]=await Promise.all([Do(e.themes||[]),Io(e.langs||[]),e.engine]);return ol({...e,themes:t,langs:i,engine:n})}const Oo=new WeakMap;function vi(e,t){Oo.set(e,t)}function xt(e){return Oo.get(e)}var _i=class Mo{_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,i){return new Mo(Object.fromEntries(tl(i).map(n=>[n,Yi])),t)}constructor(...t){if(t.length===2){const[i,n]=t;this.lang=n,this._stacks=i}else{const[i,n,r]=t;this.lang=n,this._stacks={[r]:i}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return al(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function al(e){const t=[],i=new Set;function n(r){if(i.has(r))return;i.add(r);const o=r?.nameScopesList?.scopeName;o&&t.push(o),r.parent&&n(r.parent)}return n(e),t}function ll(e,t){if(!(e instanceof _i))throw new z("Invalid grammar state");return e.getInternalStack(t)}const dl=/,/,ul=/ /;function Ho(e,t,i={}){const{theme:n=e.getLoadedThemes()[0]}=i;if(hi(e.resolveLangAlias(i.lang||"text"))||pi(n))return mi(t).map(l=>[{content:l[0],offset:l[1]}]);const{theme:r,colorMap:o}=e.setTheme(n),s=e.getLanguage(i.lang||"text");if(i.grammarState){if(i.grammarState.lang!==s.name)throw new z(`Grammar state language "${i.grammarState.lang}" does not match highlight language "${s.name}"`);if(!i.grammarState.themes.includes(r.name))throw new z(`Grammar state themes "${i.grammarState.themes}" do not contain highlight theme "${r.name}"`)}return fl(t,s,r,o,i)}function cl(...e){if(e.length===2)return xt(e[1]);const[t,i,n={}]=e,{lang:r="text",theme:o=t.getLoadedThemes()[0]}=n;if(hi(r)||pi(o))throw new z("Plain language does not have grammar state");if(r==="ansi")throw new z("ANSI language does not have grammar state");const{theme:s,colorMap:l}=t.setTheme(o),a=t.getLanguage(r);return new _i(On(i,a,s,l,n).stateStack,a.name,s.name)}function fl(e,t,i,n,r){const o=On(e,t,i,n,r),s=new _i(o.stateStack,t.name,i.name);return vi(o.tokens,s),o.tokens}function On(e,t,i,n,r){const o=ei(i,r),{tokenizeMaxLineLength:s=0,tokenizeTimeLimit:l=500,includeExplanation:a=!1}=r,d=mi(e);let u=r.grammarState?ll(r.grammarState,i.name)??Yi:r.grammarContextCode!=null?On(r.grammarContextCode,t,i,n,{...r,grammarState:void 0,grammarContextCode:void 0}).stateStack:Yi,c=[];const f=[];for(let h=0,m=d.length;h<m;h++){const[g,y]=d[h];if(g===""){c=[],f.push([]);continue}if(s>0&&g.length>=s){c=[],f.push([{content:g,offset:y,color:"",fontStyle:0}]);continue}let v,_,b;a&&a!=="tokenType"&&(v=t.tokenizeLine(g,u,l),_=v.tokens,b=0);const L=t.tokenizeLine2(g,u,l),E=L.tokens.length/2;for(let S=0;S<E;S++){const C=L.tokens[2*S],x=S+1<E?L.tokens[2*S+2]:g.length;if(C===x)continue;const w=L.tokens[2*S+1],A=Be(n[ki.getForeground(w)],o),I=ki.getFontStyle(w),k={content:g.substring(C,x),offset:y+C,color:A,fontStyle:I};if(a==="tokenType")k.type=ki.getTokenType(w);else if(a){const R=[];if(a!=="scopeName")for(const F of i.settings){let T;switch(typeof F.scope){case"string":T=F.scope.split(dl).map(M=>M.trim());break;case"object":T=F.scope;break;default:continue}R.push({settings:F,selectors:T.map(M=>M.split(ul))})}k.explanation=[];let D=0;for(;C+D<x;){const F=_[b],T=g.substring(F.startIndex,F.endIndex);D+=T.length,k.explanation.push({content:T,scopes:a==="scopeName"?hl(F.scopes):pl(R,F.scopes)}),b+=1}}c.push(k)}f.push(c),c=[],u=L.ruleStack}return{tokens:f,stateStack:u}}function hl(e){return e.map(t=>({scopeName:t}))}function pl(e,t){const i=[];for(let n=0,r=t.length;n<r;n++){const o=t[n];i[n]={scopeName:o,themeMatches:gl(e,o,t.slice(0,n))}}return i}function Jn(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function ml(e,t,i){if(!Jn(e.at(-1),t))return!1;let n=e.length-2,r=i.length-1;for(;n>=0&&r>=0;)Jn(e[n],i[r])&&(n-=1),r-=1;return n===-1}function gl(e,t,i){const n=[];for(const{selectors:r,settings:o}of e)for(const s of r)if(ml(s,t,i)){n.push(o);break}return n}function No(e,t,i,n=Ho){const r=Object.entries(i.themes).filter(d=>d[1]).map(d=>({color:d[0],theme:d[1]})),o=r.map(d=>{const u=n(e,t,{...i,theme:d.theme});return{tokens:u,state:xt(u),theme:typeof d.theme=="string"?d.theme:d.theme.name}}),s=vl(...o.map(d=>d.tokens)),l=s[0].map((d,u)=>d.map((c,f)=>{const h={content:c.content,variants:{},offset:c.offset};return"includeExplanation"in i&&i.includeExplanation&&(h.explanation=c.explanation),s.forEach((m,g)=>{const{content:y,explanation:v,offset:_,...b}=m[u][f];h.variants[r[g].color]=b}),h})),a=o[0].state?new _i(Object.fromEntries(o.map(d=>[d.theme,d.state?.getInternalStack(d.theme)])),o[0].state.lang):void 0;return a&&vi(l,a),l}function vl(...e){const t=e.map(()=>[]),i=e.length;for(let n=0;n<e[0].length;n++){const r=e.map(a=>a[n]),o=t.map(()=>[]);t.forEach((a,d)=>a.push(o[d]));const s=r.map(()=>0),l=r.map(a=>a[0]);for(;l.every(a=>a);){const a=Math.min(...l.map(d=>d.content.length));for(let d=0;d<i;d++){const u=l[d];u.content.length===a?(o[d].push(u),s[d]+=1,l[d]=r[d][s[d]]):(o[d].push({...u,content:u.content.slice(0,a)}),l[d]={...u,content:u.content.slice(a),offset:u.offset+a})}}}return t}const Qn=/\s+/g;function Fo(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(Qn)),Array.isArray(e.properties.class)||(e.properties.class=[]);const i=Array.isArray(t)?t:t.split(Qn);for(const n of i)n&&!e.properties.class.includes(n)&&e.properties.class.push(n);return e}function _l(e){const t=mi(e,!0).map(([r])=>r);function i(r){if(r===e.length)return{line:t.length-1,character:t.at(-1).length};let o=r,s=0;for(const l of t){if(o<l.length)break;o-=l.length,s++}return{line:s,character:o}}function n(r,o){let s=0;for(let l=0;l<r;l++)s+=t[l].length;return s+=o,s}return{lines:t,indexToPos:i,posToIndex:n}}const bl=["color","background-color"];function yl(e,t){let i=0;const n=[];for(const r of t)r>i&&n.push({...e,content:e.content.slice(i,r),offset:e.offset+i}),i=r;return i<e.content.length&&n.push({...e,content:e.content.slice(i),offset:e.offset+i}),n}function El(e,t){let i=0,n=e.length;for(;i<n;){const r=i+(n-i>>1);e[r]<=t?i=r+1:n=r}return i}function Sl(e,t){const i=[...t instanceof Set?t:new Set(t)].sort((n,r)=>n-r);return i.length?e.map(n=>n.flatMap(r=>{const o=r.offset+r.content.length,s=El(i,r.offset);let l=s;for(;l<i.length&&i[l]<o;)l++;if(s===l)return r;const a=i.slice(s,l);for(let d=0;d<a.length;d++)a[d]-=r.offset;return yl(r,a)})):e}function Ll(e,t,i,n,r="css-vars"){const o={content:e.content,explanation:e.explanation,offset:e.offset},s=t.map(u=>ti(e.variants[u])),l=new Set(s.flatMap(u=>Object.keys(u))),a={},d=(u,c)=>{const f=c==="color"?"":c==="background-color"?"-bg":`-${c}`;return i+t[u]+(c==="color"?"":f)};return s.forEach((u,c)=>{for(const f of l){const h=u[f]||"inherit";if(c===0&&n&&bl.includes(f))if(n==="light-dark()"&&s.length>1){const m=t.findIndex(_=>_==="light"),g=t.findIndex(_=>_==="dark");if(m===-1||g===-1)throw new z('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');const y=s[m][f]||"inherit",v=s[g][f]||"inherit";a[f]=`light-dark(${y}, ${v})`,r==="css-vars"&&(a[d(c,f)]=h)}else a[f]=h;else r==="css-vars"&&(a[d(c,f)]=h)}}),o.htmlStyle=a,o}function ti(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&ee.Italic&&(t["font-style"]="italic"),e.fontStyle&ee.Bold&&(t["font-weight"]="bold");const i=[];e.fontStyle&ee.Underline&&i.push("underline"),e.fontStyle&ee.Strikethrough&&i.push("line-through"),i.length&&(t["text-decoration"]=i.join(" "))}return t}function sn(e){return typeof e=="string"?e:Object.entries(e).map(([t,i])=>`${t}:${i}`).join(";")}function Cl(){const e=new WeakMap;function t(i){if(!e.has(i.meta)){let n=function(s){if(typeof s=="number"){if(s<0||s>i.source.length)throw new z(`Invalid decoration offset: ${s}. Code length: ${i.source.length}`);return{...r.indexToPos(s),offset:s}}else{const l=r.lines[s.line];if(l===void 0)throw new z(`Invalid decoration position ${JSON.stringify(s)}. Lines length: ${r.lines.length}`);let a=s.character;if(a<0&&(a=l.length+a),a<0||a>l.length)throw new z(`Invalid decoration position ${JSON.stringify(s)}. Line ${s.line} length: ${l.length}`);return{...s,character:a,offset:r.posToIndex(s.line,a)}}};const r=_l(i.source),o=(i.options.decorations||[]).map(s=>({...s,start:n(s.start),end:n(s.end)}));wl(o),e.set(i.meta,{decorations:o,converter:r,source:i.source})}return e.get(i.meta)}return{name:"shiki:decorations",tokens(i){if(this.options.decorations?.length)return Sl(i,t(this).decorations.flatMap(n=>[n.start.offset,n.end.offset]))},code(i){if(!this.options.decorations?.length)return;const n=t(this),r=[...i.children].filter(u=>u.type==="element"&&u.tagName==="span");if(r.length!==n.converter.lines.length)throw new z(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${n.converter.lines.length}). Failed to apply decorations.`);function o(u,c,f,h){const m=r[u];let g="",y=-1,v=-1;if(c===0&&(y=0),f===0&&(v=0),f===Number.POSITIVE_INFINITY&&(v=m.children.length),y===-1||v===-1)for(let b=0;b<m.children.length;b++)g+=Vo(m.children[b]),y===-1&&g.length===c&&(y=b+1),v===-1&&g.length===f&&(v=b+1);if(y===-1)throw new z(`Failed to find start index for decoration ${JSON.stringify(h.start)}`);if(v===-1)throw new z(`Failed to find end index for decoration ${JSON.stringify(h.end)}`);const _=m.children.slice(y,v);if(!h.alwaysWrap&&_.length===m.children.length)l(m,h,"line");else if(!h.alwaysWrap&&_.length===1&&_[0].type==="element")l(_[0],h,"token");else{const b={type:"element",tagName:"span",properties:{},children:_};l(b,h,"wrapper"),m.children.splice(y,_.length,b)}}function s(u,c){r[u]=l(r[u],c,"line")}function l(u,c,f){const h=c.properties||{},m=c.transform||(g=>g);return u.tagName=c.tagName||"span",u.properties={...u.properties,...h,class:u.properties.class},c.properties?.class&&Fo(u,c.properties.class),u=m(u,f)||u,u}const a=[],d=n.decorations.sort((u,c)=>c.start.offset-u.start.offset||u.end.offset-c.end.offset);for(const u of d){const{start:c,end:f}=u;if(c.line===f.line)o(c.line,c.character,f.character,u);else if(c.line<f.line){o(c.line,c.character,Number.POSITIVE_INFINITY,u);for(let h=c.line+1;h<f.line;h++)a.unshift(()=>s(h,u));o(f.line,0,f.character,u)}}a.forEach(u=>u())}}}function wl(e){for(let t=0;t<e.length;t++){const i=e[t];if(i.start.offset>i.end.offset)throw new z(`Invalid decoration range: ${JSON.stringify(i.start)} - ${JSON.stringify(i.end)}`);for(let n=t+1;n<e.length;n++){const r=e[n],o=i.start.offset<=r.start.offset&&r.start.offset<i.end.offset,s=i.start.offset<r.end.offset&&r.end.offset<=i.end.offset,l=r.start.offset<=i.start.offset&&i.start.offset<r.end.offset,a=r.start.offset<i.end.offset&&i.end.offset<=r.end.offset;if(o||s||l||a){if(o&&s||l&&a||l&&i.start.offset===i.end.offset||s&&r.start.offset===r.end.offset)continue;throw new z(`Decorations ${JSON.stringify(i.start)} and ${JSON.stringify(r.start)} intersect.`)}}}}function Vo(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(Vo).join(""):""}const kl=[Cl()];function ii(e){const t=xl(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...kl]}function xl(e){const t=[],i=[],n=[];for(const r of e)switch(r.enforce){case"pre":t.push(r);break;case"post":i.push(r);break;default:n.push(r)}return{pre:t,post:i,normal:n}}var Qe=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Ri={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function Al(e,t){const i=e.indexOf("\x1B",t);if(i!==-1&&e[i+1]==="["){const n=e.indexOf("m",i);if(n!==-1)return{sequence:e.substring(i+2,n).split(";"),startPosition:i,position:n+1}}return{position:e.length}}function Zn(e){const t=e.shift();if(t==="2"){const i=e.splice(0,3).map(n=>Number.parseInt(n));return i.length!==3||i.some(n=>Number.isNaN(n))?void 0:{type:"rgb",rgb:i}}else if(t==="5"){const i=e.shift();if(i)return{type:"table",index:Number(i)}}}function Rl(e){const t=[];for(;e.length>0;){const i=e.shift();if(!i)continue;const n=Number.parseInt(i);if(!Number.isNaN(n))if(n===0)t.push({type:"resetAll"});else if(n<=9)Ri[n]&&t.push({type:"setDecoration",value:Ri[n]});else if(n<=29){const r=Ri[n-20];r&&(t.push({type:"resetDecoration",value:r}),r==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(n<=37)t.push({type:"setForegroundColor",value:{type:"named",name:Qe[n-30]}});else if(n===38){const r=Zn(e);r&&t.push({type:"setForegroundColor",value:r})}else if(n===39)t.push({type:"resetForegroundColor"});else if(n<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:Qe[n-40]}});else if(n===48){const r=Zn(e);r&&t.push({type:"setBackgroundColor",value:r})}else n===49?t.push({type:"resetBackgroundColor"}):n===53?t.push({type:"setDecoration",value:"overline"}):n===55?t.push({type:"resetDecoration",value:"overline"}):n>=90&&n<=97?t.push({type:"setForegroundColor",value:{type:"named",name:Qe[n-90+8]}}):n>=100&&n<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:Qe[n-100+8]}})}return t}function Tl(){let e=null,t=null,i=new Set;return{parse(n){const r=[];let o=0;do{const s=Al(n,o),l=s.sequence?n.substring(o,s.startPosition):n.substring(o);if(l.length>0&&r.push({value:l,foreground:e,background:t,decorations:new Set(i)}),s.sequence){const a=Rl(s.sequence);for(const d of a)d.type==="resetAll"?(e=null,t=null,i.clear()):d.type==="resetForegroundColor"?e=null:d.type==="resetBackgroundColor"?t=null:d.type==="resetDecoration"&&i.delete(d.value);for(const d of a)d.type==="setForegroundColor"?e=d.value:d.type==="setBackgroundColor"?t=d.value:d.type==="setDecoration"&&i.add(d.value)}o=s.position}while(o<n.length);return r}}}var Il={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 Dl(e=Il){function t(l){return e[l]}function i(l){return`#${l.map(a=>Math.max(0,Math.min(a,255)).toString(16).padStart(2,"0")).join("")}`}let n;function r(){if(n)return n;n=[];for(let d=0;d<Qe.length;d++)n.push(t(Qe[d]));let l=[0,95,135,175,215,255];for(let d=0;d<6;d++)for(let u=0;u<6;u++)for(let c=0;c<6;c++)n.push(i([l[d],l[u],l[c]]));let a=8;for(let d=0;d<24;d++,a+=10)n.push(i([a,a,a]));return n}function o(l){return r()[l]}function s(l){switch(l.type){case"named":return t(l.name);case"rgb":return i(l.rgb);case"table":return o(l.index)}}return{value:s}}const Pl=/#([0-9a-f]{3,8})/i,Ol=/var\((--[\w-]+-ansi-[\w-]+)\)/,Ml={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 Hl(e,t,i){const n=ei(e,i),r=mi(t),o=Dl(Object.fromEntries(Qe.map(l=>{const a=`terminal.ansi${l[0].toUpperCase()}${l.substring(1)}`;return[l,e.colors?.[a]||Ml[l]]}))),s=Tl();return r.map(l=>s.parse(l[0]).map(a=>{let d,u;a.decorations.has("reverse")?(d=a.background?o.value(a.background):e.bg,u=a.foreground?o.value(a.foreground):e.fg):(d=a.foreground?o.value(a.foreground):e.fg,u=a.background?o.value(a.background):void 0),d=Be(d,n),u=Be(u,n),a.decorations.has("dim")&&(d=Nl(d));let c=ee.None;return a.decorations.has("bold")&&(c|=ee.Bold),a.decorations.has("italic")&&(c|=ee.Italic),a.decorations.has("underline")&&(c|=ee.Underline),a.decorations.has("strikethrough")&&(c|=ee.Strikethrough),{content:a.value,offset:l[1],color:d,bgColor:u,fontStyle:c}}))}function Nl(e){const t=e.match(Pl);if(t){const n=t[1];if(n.length===8){const r=Math.round(Number.parseInt(n.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${n.slice(0,6)}${r}`}else{if(n.length===6)return`#${n}80`;if(n.length===4){const r=n[0],o=n[1],s=n[2],l=n[3];return`#${r}${r}${o}${o}${s}${s}${Math.round(Number.parseInt(`${l}${l}`,16)/2).toString(16).padStart(2,"0")}`}else if(n.length===3){const r=n[0],o=n[1],s=n[2];return`#${r}${r}${o}${o}${s}${s}80`}}}const i=e.match(Ol);return i?`var(${i[1]}-dim)`:e}function an(e,t,i={}){const n=e.resolveLangAlias(i.lang||"text"),{theme:r=e.getLoadedThemes()[0]}=i;if(!hi(n)&&!pi(r)&&n==="ansi"){const{theme:o}=e.setTheme(r);return Hl(o,t,i)}return Ho(e,t,i)}function ni(e,t,i){let n,r,o,s,l,a;if("themes"in i){const{defaultColor:d="light",cssVariablePrefix:u="--shiki-",colorsRendering:c="css-vars"}=i,f=Object.entries(i.themes).filter(v=>v[1]).map(v=>({color:v[0],theme:v[1]})).sort((v,_)=>v.color===d?-1:_.color===d?1:0);if(f.length===0)throw new z("`themes` option must not be empty");const h=No(e,t,i,an);if(a=xt(h),d&&d!=="light-dark()"&&!f.some(v=>v.color===d))throw new z(`\`themes\` option must contain the defaultColor key \`${d}\``);const m=f.map(v=>e.getTheme(v.theme)),g=f.map(v=>v.color);o=h.map(v=>v.map(_=>Ll(_,g,u,d,c))),a&&vi(o,a);const y=f.map(v=>ei(v.theme,i));r=Yn(f,m,y,u,d,"fg",c),n=Yn(f,m,y,u,d,"bg",c),s=`shiki-themes ${m.map(v=>v.name).join(" ")}`,l=d?void 0:[r,n].join(";")}else if("theme"in i){const d=ei(i.theme,i);o=an(e,t,i);const u=e.getTheme(i.theme);n=Be(u.bg,d),r=Be(u.fg,d),s=u.name,a=xt(o)}else throw new z("Invalid options, either `theme` or `themes` must be provided");return{tokens:o,fg:r,bg:n,themeName:s,rootStyle:l,grammarState:a}}function Yn(e,t,i,n,r,o,s){return e.map((l,a)=>{const d=Be(t[a][o],i[a])||"inherit",u=`${n+l.color}${o==="bg"?"-bg":""}:${d}`;if(a===0&&r){if(r==="light-dark()"&&e.length>1){const c=e.findIndex(h=>h.color==="light"),f=e.findIndex(h=>h.color==="dark");if(c===-1||f===-1)throw new z('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${Be(t[c][o],i[c])||"inherit"}, ${Be(t[f][o],i[f])||"inherit"});${u}`}return d}return s==="css-vars"?u:null}).filter(l=>!!l).join(";")}const $o=/^\s+$/,Fl=/^(\s*)(.*?)(\s*)$/;function ri(e,t,i,n={meta:{},options:i,codeToHast:(r,o)=>ri(e,r,o),codeToTokens:(r,o)=>ni(e,r,o)}){let r=t;for(const m of ii(i))r=m.preprocess?.call(n,r,i)||r;let{tokens:o,fg:s,bg:l,themeName:a,rootStyle:d,grammarState:u}=ni(e,r,i);const{mergeWhitespaces:c=!0,mergeSameStyleTokens:f=!1}=i;c===!0?o=$l(o):c==="never"&&(o=Ul(o)),f&&(o=zl(o));const h={...n,get source(){return r}};for(const m of ii(i))o=m.tokens?.call(h,o)||o;return Vl(o,{...i,fg:s,bg:l,themeName:a,rootStyle:i.rootStyle===!1?!1:i.rootStyle??d},h,u)}function Vl(e,t,i,n=xt(e)){const r=ii(t),o=[],s={type:"root",children:[]},{structure:l="classic",tabindex:a="0"}=t,d={class:`shiki ${t.themeName||""}`};t.rootStyle!==!1&&(t.rootStyle!=null?d.style=t.rootStyle:d.style=`background-color:${t.bg};color:${t.fg}`),a!==!1&&a!=null&&(d.tabindex=a.toString());for(const[g,y]of Object.entries(t.meta||{}))g.startsWith("_")||(d[g]=y);let u={type:"element",tagName:"pre",properties:d,children:[],data:t.data},c={type:"element",tagName:"code",properties:{},children:o};const f=[],h={...i,structure:l,addClassToHast:Fo,get source(){return i.source},get tokens(){return e},get options(){return t},get root(){return s},get pre(){return u},get code(){return c},get lines(){return f}};if(e.forEach((g,y)=>{y&&(l==="inline"?s.children.push({type:"element",tagName:"br",properties:{},children:[]}):l==="classic"&&o.push({type:"text",value:`
3
+ `}));let v={type:"element",tagName:"span",properties:{class:"line"},children:[]},_=0;for(const b of g){let L={type:"element",tagName:"span",properties:{...b.htmlAttrs},children:[{type:"text",value:b.content}]};const E=sn(b.htmlStyle||ti(b));E&&(L.properties.style=E);for(const S of r)L=S?.span?.call(h,L,y+1,_,v,b)||L;l==="inline"?s.children.push(L):l==="classic"&&v.children.push(L),_+=b.content.length}if(l==="classic"){for(const b of r)v=b?.line?.call(h,v,y+1)||v;f.push(v),o.push(v)}else l==="inline"&&f.push(v)}),l==="classic"){for(const g of r)c=g?.code?.call(h,c)||c;u.children.push(c);for(const g of r)u=g?.pre?.call(h,u)||u;s.children.push(u)}else if(l==="inline"){const g=[];let y={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const _ of s.children)_.type==="element"&&_.tagName==="br"?(g.push(y),y={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(_.type==="element"||_.type==="text")&&y.children.push(_);g.push(y);let v={type:"element",tagName:"code",properties:{},children:g};for(const _ of r)v=_?.code?.call(h,v)||v;s.children=[];for(let _=0;_<v.children.length;_++){_>0&&s.children.push({type:"element",tagName:"br",properties:{},children:[]});const b=v.children[_];b.type==="element"&&s.children.push(...b.children)}}let m=s;for(const g of r)m=g?.root?.call(h,m)||m;return n&&vi(m,n),m}function $l(e){return e.map(t=>{const i=[];let n="",r;return t.forEach((o,s)=>{const l=!(o.fontStyle&&(o.fontStyle&ee.Underline||o.fontStyle&ee.Strikethrough));l&&$o.test(o.content)&&t[s+1]?(r===void 0&&(r=o.offset),n+=o.content):n?(l?i.push({...o,offset:r,content:n+o.content}):i.push({content:n,offset:r},o),r=void 0,n=""):i.push(o)}),i})}function Ul(e){return e.map(t=>t.flatMap(i=>{if($o.test(i.content))return i;const n=i.content.match(Fl);if(!n)return i;const[,r,o,s]=n;if(!r&&!s)return i;const l=[{...i,offset:i.offset+r.length,content:o}];return r&&l.unshift({content:r,offset:i.offset}),s&&l.push({content:s,offset:i.offset+r.length+o.length}),l}))}function zl(e){return e.map(t=>{const i=[];for(const n of t){if(i.length===0){i.push({...n});continue}const r=i.at(-1),o=sn(r.htmlStyle||ti(r)),s=sn(n.htmlStyle||ti(n)),l=r.fontStyle&&(r.fontStyle&ee.Underline||r.fontStyle&ee.Strikethrough),a=n.fontStyle&&(n.fontStyle&ee.Underline||n.fontStyle&ee.Strikethrough);!l&&!a&&o===s?r.content+=n.content:i.push({...n})}return i})}const Bl=Re;function Gl(e,t,i){const n={meta:{},options:i,codeToHast:(o,s)=>ri(e,o,s),codeToTokens:(o,s)=>ni(e,o,s)};let r=Bl(ri(e,t,i,n));for(const o of ii(i))r=o.postprocess?.call(n,r,i)||r;return r}async function jl(e){const t=await sl(e);return{getLastGrammarState:(...i)=>cl(t,...i),codeToTokensBase:(i,n)=>an(t,i,n),codeToTokensWithThemes:(i,n)=>No(t,i,n),codeToTokens:(i,n)=>ni(t,i,n),codeToHast:(i,n)=>ri(t,i,n),codeToHtml:(i,n)=>Gl(t,i,n),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function Wl(e){const t=e.langs,i=e.themes,n=e.engine;async function r(o){function s(c){if(typeof c=="string"){if(c=o.langAlias?.[c]||c,Ro(c))return[];const f=t[c];if(!f)throw new z(`Language \`${c}\` is not included in this bundle. You may want to load it from external source.`);return f}return c}function l(c){if(To(c))return"none";if(typeof c=="string"){const f=i[c];if(!f)throw new z(`Theme \`${c}\` is not included in this bundle. You may want to load it from external source.`);return f}return c}const a=(o.themes??[]).map(c=>l(c)),d=(o.langs??[]).map(c=>s(c)),u=await jl({engine:o.engine??n(),...o,themes:a,langs:d});return{...u,loadLanguage(...c){return u.loadLanguage(...c.map(s))},loadTheme(...c){return u.loadTheme(...c.map(l))},getBundledLanguages(){return t},getBundledThemes(){return i}}}return r}const ql=Wl({langs:on,themes:Ha,engine:()=>(0,xo.createOnigurumaEngine)(p(()=>import("./wasm-CG6Dc4jp.js"),[],import.meta.url))}),er=4294967295;var Kl=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;const{forgiving:i=!1,cache:n,regexConstructor:r}=t;if(!r)throw new Error("Option `regexConstructor` is not provided");this.regexps=e.map(o=>{if(typeof o!="string")return o;const s=n?.get(o);if(s){if(s instanceof RegExp)return s;if(i)return null;throw s}try{const l=r(o);return n?.set(o,l),l}catch(l){if(n?.set(o,l),i)return null;throw l}})}findNextMatchSync(e,t,i){const n=typeof e=="string"?e:e.content,r=[];function o(s,l,a=0){return{index:s,captureIndices:l.indices.map(d=>d==null?{start:er,end:er,length:0}:{start:d[0]+a,end:d[1]+a,length:d[1]-d[0]})}}for(let s=0;s<this.regexps.length;s++){const l=this.regexps[s];if(l)try{l.lastIndex=t;const a=l.exec(n);if(!a)continue;if(a.index===t)return o(s,a,0);r.push([s,a,0])}catch(a){if(this.options.forgiving)continue;throw a}}if(r.length){const s=Math.min(...r.map(l=>l[1].index));for(const[l,a,d]of r)if(a.index===s)return o(l,a,d)}return null}};function ht(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function Xl(e,t,i){return e.has(t)||e.set(t,i),e.get(t)}const Mn=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),Z=String.raw;function pt(e,t){if(e==null)throw new Error(t??"Value expected");return e}const Uo=Z`\[\^?`,zo=`c.? | C(?:-.?)?|${Z`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${Z`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${Z`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${Z`o\{[^\}]*\}?`}|${Z`\d{1,3}`}`,Hn=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Mt=new RegExp(Z`
4
+ \\ (?:
5
+ ${zo}
6
+ | [gk]<[^>]*>?
7
+ | [gk]'[^']*'?
8
+ | .
9
+ )
10
+ | \( (?:
11
+ \? (?:
12
+ [:=!>({]
13
+ | <[=!]
14
+ | <[^>]*>
15
+ | '[^']*'
16
+ | ~\|?
17
+ | #(?:[^)\\]|\\.?)*
18
+ | [^:)]*[:)]
19
+ )?
20
+ | \*[^\)]*\)?
21
+ )?
22
+ | (?:${Hn.source})+
23
+ | ${Uo}
24
+ | .
25
+ `.replace(/\s+/g,""),"gsu"),Ti=new RegExp(Z`
26
+ \\ (?:
27
+ ${zo}
28
+ | .
29
+ )
30
+ | \[:(?:\^?\p{Alpha}+|\^):\]
31
+ | ${Uo}
32
+ | &&
33
+ | .
34
+ `.replace(/\s+/g,""),"gsu");function Jl(e,t={}){const i={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");const n=md(i.flags),r=[n.extended],o={captureGroup:i.rules.captureGroup,getCurrentModX(){return r.at(-1)},numOpenGroups:0,popModX(){r.pop()},pushModX(c){r.push(c)},replaceCurrentModX(c){r[r.length-1]=c},singleline:i.rules.singleline};let s=[],l;for(Mt.lastIndex=0;l=Mt.exec(e);){const c=Ql(o,e,l[0],Mt.lastIndex);c.tokens?s.push(...c.tokens):c.token&&s.push(c.token),c.lastIndex!==void 0&&(Mt.lastIndex=c.lastIndex)}const a=[];let d=0;s.filter(c=>c.type==="GroupOpen").forEach(c=>{c.kind==="capturing"?c.number=++d:c.raw==="("&&a.push(c)}),d||a.forEach((c,f)=>{c.kind="capturing",c.number=f+1});const u=d||a.length;return{tokens:s.map(c=>c.type==="EscapedNumber"?vd(c,u):c).flat(),flags:n}}function Ql(e,t,i,n){const[r,o]=i;if(i==="["||i==="[^"){const s=Zl(t,i,n);return{tokens:s.tokens,lastIndex:s.lastIndex}}if(r==="\\"){if("AbBGyYzZ".includes(o))return{token:tr(i,i)};if(/^\\g[<']/.test(i)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(i))throw new Error(`Invalid group name "${i}"`);return{token:ld(i)}}if(/^\\k[<']/.test(i)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(i))throw new Error(`Invalid group name "${i}"`);return{token:Go(i)}}if(o==="K")return{token:jo("keep",i)};if(o==="N"||o==="R")return{token:Ze("newline",i,{negate:o==="N"})};if(o==="O")return{token:Ze("any",i)};if(o==="X")return{token:Ze("text_segment",i)};const s=Bo(i,{inCharClass:!1});return Array.isArray(s)?{tokens:s}:{token:s}}if(r==="("){if(o==="*")return{token:fd(i)};if(i==="(?{")throw new Error(`Unsupported callout "${i}"`);if(i.startsWith("(?#")){if(t[n]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:n+1}}if(/^\(\?[-imx]+[:)]$/.test(i))return{token:cd(i,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,i==="("&&!e.captureGroup||i==="(?:")return{token:st("group",i)};if(i==="(?>")return{token:st("atomic",i)};if(i==="(?="||i==="(?!"||i==="(?<="||i==="(?<!")return{token:st(i[2]==="<"?"lookbehind":"lookahead",i,{negate:i.endsWith("!")})};if(i==="("&&e.captureGroup||i.startsWith("(?<")&&i.endsWith(">")||i.startsWith("(?'")&&i.endsWith("'"))return{token:st("capturing",i,{...i!=="("&&{name:i.slice(3,-1)}})};if(i.startsWith("(?~")){if(i==="(?~|")throw new Error(`Unsupported absence function kind "${i}"`);return{token:st("absence_repeater",i)}}throw i==="(?("?new Error(`Unsupported conditional "${i}"`):new Error(`Invalid or unsupported group option "${i}"`)}if(i===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:od(i)}}if(e.getCurrentModX()){if(i==="#"){const s=t.indexOf(`
35
+ `,n);return{lastIndex:s===-1?t.length:s}}if(/^\s$/.test(i)){const s=/\s+/y;return s.lastIndex=n,{lastIndex:s.exec(t)?s.lastIndex:n}}}if(i===".")return{token:Ze("dot",i)};if(i==="^"||i==="$"){const s=e.singleline?{"^":Z`\A`,$:Z`\Z`}[i]:i;return{token:tr(s,i)}}return i==="|"?{token:ed(i)}:Hn.test(i)?{tokens:_d(i)}:{token:Te(ht(i),i)}}function Zl(e,t,i){const n=[ir(t[1]==="^",t)];let r=1,o;for(Ti.lastIndex=i;o=Ti.exec(e);){const s=o[0];if(s[0]==="["&&s[1]!==":")r++,n.push(ir(s[1]==="^",s));else if(s==="]"){if(n.at(-1).type==="CharacterClassOpen")n.push(Te(93,s));else if(r--,n.push(td(s)),!r)break}else{const l=Yl(s);Array.isArray(l)?n.push(...l):n.push(l)}}return{tokens:n,lastIndex:Ti.lastIndex||e.length}}function Yl(e){if(e[0]==="\\")return Bo(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!Mn.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return Ze("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?id(e):e==="&&"?nd(e):Te(ht(e),e)}function Bo(e,{inCharClass:t}){const i=e[1];if(i==="c"||i==="C")return ud(e);if("dDhHsSwW".includes(i))return hd(e);if(e.startsWith(Z`\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 pd(e)}if(new RegExp("^\\\\x[89A-Fa-f]\\p{AHex}","u").test(e))try{const n=e.split(/\\x/).slice(1).map(s=>parseInt(s,16)),r=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(n)),o=new TextEncoder;return[...r].map(s=>{const l=[...o.encode(s)].map(a=>`\\x${a.toString(16)}`).join("");return Te(ht(s),l)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(i==="u"||i==="x")return Te(gd(e),e);if(nr.has(i))return Te(nr.get(i),e);if(/\d/.test(i))return rd(t,e);if(e==="\\")throw new Error(Z`Incomplete escape "\"`);if(i==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return Te(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function ed(e){return{type:"Alternator",raw:e}}function tr(e,t){return{type:"Assertion",kind:e,raw:t}}function Go(e){return{type:"Backreference",raw:e}}function Te(e,t){return{type:"Character",value:e,raw:t}}function td(e){return{type:"CharacterClassClose",raw:e}}function id(e){return{type:"CharacterClassHyphen",raw:e}}function nd(e){return{type:"CharacterClassIntersector",raw:e}}function ir(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function Ze(e,t,i={}){return{type:"CharacterSet",kind:e,...i,raw:t}}function jo(e,t,i={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:pt(i.flags),raw:t}}function rd(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function od(e){return{type:"GroupClose",raw:e}}function st(e,t,i={}){return{type:"GroupOpen",kind:e,...i,raw:t}}function sd(e,t,i,n){return{type:"NamedCallout",kind:e,tag:t,arguments:i,raw:n}}function ad(e,t,i,n){return{type:"Quantifier",kind:e,min:t,max:i,raw:n}}function ld(e){return{type:"Subroutine",raw:e}}const dd=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),nr=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function ud(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 Te(ht(t.toUpperCase())-64,e)}function cd(e,t){let{on:i,off:n}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;n??="";const r=(t.getCurrentModX()||i.includes("x"))&&!n.includes("x"),o=or(i),s=or(n),l={};if(o&&(l.enable=o),s&&(l.disable=s),e.endsWith(")"))return t.replaceCurrentModX(r),jo("flags",e,{flags:l});if(e.endsWith(":"))return t.pushModX(r),t.numOpenGroups++,st("group",e,{...(o||s)&&{flags:l}});throw new Error(`Unexpected flag modifier "${e}"`)}function fd(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:i,tag:n,args:r}=t.groups;if(!i)throw new Error(`Invalid named callout "${e}"`);if(n==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const o=r?r.split(",").filter(u=>u!=="").map(u=>/^[+-]?\d+$/.test(u)?+u:u):[],[s,l,a]=o,d=dd.has(i)?i.toLowerCase():"custom";switch(d){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 s=="string")throw new Error(`Named callout argument must be a number "${s}"`);break;case"max":if(!o.length||o.length>2)throw new Error(`Named callout must have one or two arguments "${o}"`);if(typeof s=="string"&&!/^[A-Za-z_]\w*$/.test(s))throw new Error(`Named callout argument one must be a tag or number "${s}"`);if(o.length===2&&(typeof l=="number"||!/^[<>X]$/.test(l)))throw new Error(`Named callout optional argument two must be '<', '>', or 'X' "${l}"`);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 s=="number"||!/^[<>X]$/.test(s)))throw new Error(`Named callout optional argument must be '<', '>', or 'X' "${s}"`);break;case"cmp":if(o.length!==3)throw new Error(`Named callout must have three arguments "${o}"`);if(typeof s=="string"&&!/^[A-Za-z_]\w*$/.test(s))throw new Error(`Named callout argument one must be a tag or number "${s}"`);if(typeof l=="number"||!/^(?:[<>!=]=|[<>])$/.test(l))throw new Error(`Named callout argument two must be '==', '!=', '>', '<', '>=', or '<=' "${l}"`);if(typeof a=="string"&&!/^[A-Za-z_]\w*$/.test(a))throw new Error(`Named callout argument three must be a tag or number "${a}"`);break;case"custom":throw new Error(`Undefined callout name "${i}"`);default:throw new Error(`Unexpected named callout kind "${d}"`)}return sd(d,n??null,r?.split(",")??null,e)}function rr(e){let t=null,i,n;if(e[0]==="{"){const{minStr:r,maxStr:o}=/^\{(?<minStr>\d*)(?:,(?<maxStr>\d*))?/.exec(e).groups,s=1e5;if(+r>s||o&&+o>s)throw new Error("Quantifier value unsupported in Oniguruma");if(i=+r,n=o===void 0?+r:o===""?1/0:+o,i>n&&(t="possessive",[i,n]=[n,i]),e.endsWith("?")){if(t==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else i=e[0]==="+"?1:0,n=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return ad(t,i,n,e)}function hd(e){const t=e[1].toLowerCase();return Ze({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function pd(e){const{p:t,neg:i,value:n}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return Ze("property",e,{value:n,negate:t==="P"&&!i||t==="p"&&!!i})}function or(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 md(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let i=0;i<e.length;i++){const n=e[i];if(!"imxDPSWy".includes(n))throw new Error(`Invalid flag "${n}"`);if(n==="y"){if(!/^y{[gw]}/.test(e.slice(i)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[i+2]==="g"?"grapheme":"word",i+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[n]]=!0}return t}function gd(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 vd(e,t){const{raw:i,inCharClass:n}=e,r=i.slice(1);if(!n&&(r!=="0"&&r.length===1||r[0]!=="0"&&+r<=t))return[Go(i)];const o=[],s=r.match(/^[0-7]+|\d/g);for(let l=0;l<s.length;l++){const a=s[l];let d;if(l===0&&a!=="8"&&a!=="9"){if(d=parseInt(a,8),d>127)throw new Error(Z`Octal encoded byte above 177 unsupported "${i}"`)}else d=ht(a);o.push(Te(d,(l===0?"\\":"")+a))}return o}function _d(e){const t=[],i=new RegExp(Hn,"gy");let n;for(;n=i.exec(e);){const r=n[0];if(r[0]==="{"){const o=/^\{(?<min>\d+),(?<max>\d+)\}\??$/.exec(r);if(o){const{min:s,max:l}=o.groups;if(+s>+l&&r.endsWith("?")){i.lastIndex--,t.push(rr(r.slice(0,-1)));continue}}}t.push(rr(r))}return t}function Wo(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const i=e.body[0];return!t||Object.keys(t).every(n=>t[n]===i[n])}function bd(e){return yd.has(e.type)}const yd=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function qo(e,t={}){const i={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},n=Jl(e,{flags:i.flags,rules:{captureGroup:i.rules.captureGroup,singleline:i.rules.singleline}}),r=(f,h)=>{const m=n.tokens[o.nextIndex];switch(o.parent=f,o.nextIndex++,m.type){case"Alternator":return et();case"Assertion":return Ed(m);case"Backreference":return Sd(m,o);case"Character":return bi(m.value,{useLastValid:!!h.isCheckingRangeEnd});case"CharacterClassHyphen":return Ld(m,o,h);case"CharacterClassOpen":return Cd(m,o,h);case"CharacterSet":return wd(m,o);case"Directive":return Id(m.kind,{flags:m.flags});case"GroupOpen":return kd(m,o,h);case"NamedCallout":return Pd(m.kind,m.tag,m.arguments);case"Quantifier":return xd(m,o);case"Subroutine":return Ad(m,o);default:throw new Error(`Unexpected token type "${m.type}"`)}},o={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:i.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:i.skipBackrefValidation,skipLookbehindValidation:i.skipLookbehindValidation,skipPropertyNameValidation:i.skipPropertyNameValidation,subroutines:[],tokens:n.tokens,unicodePropertyMap:i.unicodePropertyMap,walk:r},s=Md(Dd(n.flags));let l=s.body[0];for(;o.nextIndex<n.tokens.length;){const f=r(l,{});f.type==="Alternative"?(s.body.push(f),l=f):l.body.push(f)}const{capturingGroups:a,hasNumberedRef:d,namedGroupsByName:u,subroutines:c}=o;if(d&&u.size&&!i.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:f}of c)if(typeof f=="number"){if(f>a.length)throw new Error("Subroutine uses a group number that's not defined");f&&(a[f-1].isSubroutined=!0)}else if(u.has(f)){if(u.get(f).length>1)throw new Error(Z`Subroutine uses a duplicate group name "\g<${f}>"`);u.get(f)[0].isSubroutined=!0}else throw new Error(Z`Subroutine uses a group name that's not defined "\g<${f}>"`);return s}function Ed({kind:e}){return ln(pt({"^":"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===Z`\B`||e===Z`\Y`})}function Sd({raw:e},t){const i=/^\\k[<']/.test(e),n=i?e.slice(3,-1):e.slice(1),r=(o,s=!1)=>{const l=t.capturingGroups.length;let a=!1;if(o>l)if(t.skipBackrefValidation)a=!0;else throw new Error(`Not enough capturing groups defined to the left "${e}"`);return t.hasNumberedRef=!0,dn(s?l+1-o:o,{orphan:a})};if(i){const o=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(n);if(o)return r(+o.groups.num,!!o.groups.sign);if(/[-+]/.test(n))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(n))throw new Error(`Group name not defined to the left "${e}"`);return dn(n)}return r(+n)}function Ld(e,t,i){const{tokens:n,walk:r}=t,o=t.parent,s=o.body.at(-1),l=n[t.nextIndex];if(!i.isCheckingRangeEnd&&s&&s.type!=="CharacterClass"&&s.type!=="CharacterClassRange"&&l&&l.type!=="CharacterClassOpen"&&l.type!=="CharacterClassClose"&&l.type!=="CharacterClassIntersector"){const a=r(o,{...i,isCheckingRangeEnd:!0});if(s.type==="Character"&&a.type==="Character")return o.body.pop(),Td(s,a);throw new Error("Invalid character class range")}return bi(ht("-"))}function Cd({negate:e},t,i){const{tokens:n,walk:r}=t,o=[Jt()],s=n[t.nextIndex];let l=lr(s);for(;l.type!=="CharacterClassClose";){if(l.type==="CharacterClassIntersector")o.push(Jt()),t.nextIndex++;else{const d=o.at(-1);d.body.push(r(d,i))}l=lr(n[t.nextIndex],s)}const a=Jt({negate:e});return o.length===1?a.body=o[0].body:(a.kind="intersection",a.body=o.map(d=>d.body.length===1?d.body[0]:d)),t.nextIndex++,a}function wd({kind:e,negate:t,value:i},n){const{normalizeUnknownPropertyNames:r,skipPropertyNameValidation:o,unicodePropertyMap:s}=n;if(e==="property"){const l=yi(i);if(Mn.has(l)&&!s?.has(l))e="posix",i=l;else return at(i,{negate:t,normalizeUnknownPropertyNames:r,skipPropertyNameValidation:o,unicodePropertyMap:s})}return e==="posix"?Od(i,{negate:t}):un(e,{negate:t})}function kd(e,t,i){const{tokens:n,capturingGroups:r,namedGroupsByName:o,skipLookbehindValidation:s,walk:l}=t,a=Hd(e),d=a.type==="AbsenceFunction",u=ar(a),c=u&&a.negate;if(a.type==="CapturingGroup"&&(r.push(a),a.name&&Xl(o,a.name,[]).push(a)),d&&i.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let f=dr(n[t.nextIndex]);for(;f.type!=="GroupClose";){if(f.type==="Alternator")a.body.push(et()),t.nextIndex++;else{const h=a.body.at(-1),m=l(h,{...i,isInAbsenceFunction:i.isInAbsenceFunction||d,isInLookbehind:i.isInLookbehind||u,isInNegLookbehind:i.isInNegLookbehind||c});if(h.body.push(m),(u||i.isInLookbehind)&&!s){const g="Lookbehind includes a pattern not allowed by Oniguruma";if(c||i.isInNegLookbehind){if(sr(m)||m.type==="CapturingGroup")throw new Error(g)}else if(sr(m)||ar(m)&&m.negate)throw new Error(g)}}f=dr(n[t.nextIndex])}return t.nextIndex++,a}function xd({kind:e,min:t,max:i},n){const r=n.parent,o=r.body.at(-1);if(!o||!bd(o))throw new Error("Quantifier requires a repeatable token");const s=Xo(e,t,i,o);return r.body.pop(),s}function Ad({raw:e},t){const{capturingGroups:i,subroutines:n}=t;let r=e.slice(3,-1);const o=/^(?<sign>[-+]?)0*(?<num>[1-9]\d*)$/.exec(r);if(o){const l=+o.groups.num,a=i.length;if(t.hasNumberedRef=!0,r={"":l,"+":a+l,"-":a+1-l}[o.groups.sign],r<1)throw new Error("Invalid subroutine number")}else r==="0"&&(r=0);const s=Jo(r);return n.push(s),s}function Rd(e,t){return{type:"AbsenceFunction",kind:e,body:Tt(t?.body)}}function et(e){return{type:"Alternative",body:Qo(e?.body)}}function ln(e,t){const i={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(i.negate=!!t?.negate),i}function dn(e,t){const i=!!t?.orphan;return{type:"Backreference",ref:e,...i&&{orphan:i}}}function Ko(e,t){const i={name:void 0,isSubroutined:!1,...t};if(i.name!==void 0&&!Nd(i.name))throw new Error(`Group name "${i.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...i.name&&{name:i.name},...i.isSubroutined&&{isSubroutined:i.isSubroutined},body:Tt(t?.body)}}function bi(e,t){const i={useLastValid:!1,...t};if(e>1114111){const n=e.toString(16);if(i.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${n}}"`):new Error(`Invalid code point out of range in JS "\\x{${n}}"`)}return{type:"Character",value:e}}function Jt(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:Qo(e?.body)}}function Td(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function un(e,t){const i=!!t?.negate,n={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(n.negate=i),(e==="text_segment"||e==="newline"&&!i)&&(n.variableLength=!0),n}function Id(e,t={}){if(e==="keep")return{type:"Directive",kind:e};if(e==="flags")return{type:"Directive",kind:e,flags:pt(t.flags)};throw new Error(`Unexpected directive kind "${e}"`)}function Dd(e){return{type:"Flags",...e}}function fe(e){const t=e?.atomic,i=e?.flags;if(t&&i)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...i&&{flags:i},body:Tt(e?.body)}}function Ke(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:Tt(e?.body)}}function Pd(e,t,i){return{type:"NamedCallout",kind:e,tag:t,arguments:i}}function Od(e,t){const i=!!t?.negate;if(!Mn.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:i}}function Xo(e,t,i,n){if(t>i)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:i,body:n}}function Md(e,t){return{type:"Regex",body:Tt(t?.body),flags:e}}function Jo(e){return{type:"Subroutine",ref:e}}function at(e,t){const i={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let n=i.unicodePropertyMap?.get(yi(e));if(!n){if(i.normalizeUnknownPropertyNames)n=Fd(e);else if(i.unicodePropertyMap&&!i.skipPropertyNameValidation)throw new Error(Z`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:n??e,negate:i.negate}}function Hd({flags:e,kind:t,name:i,negate:n,number:r}){switch(t){case"absence_repeater":return Rd("repeater");case"atomic":return fe({atomic:!0});case"capturing":return Ko(r,{name:i});case"group":return fe({flags:e});case"lookahead":case"lookbehind":return Ke({behind:t==="lookbehind",negate:n});default:throw new Error(`Unexpected group kind "${t}"`)}}function Tt(e){if(e===void 0)e=[et()];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 Qo(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 sr(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function ar(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function Nd(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function Fd(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 yi(e){return e.replace(/[- _]+/g,"").toLowerCase()}function lr(e,t){const i=t;return pt(e,`Unclosed character class${i?.type==="Character"&&i.value===93&&i.raw==="]"?' (started with "]")':""}`)}function dr(e){return pt(e,"Unclosed group")}function Ct(e,t,i=null){function n(o,s){for(let l=0;l<o.length;l++){const a=r(o[l],s,l,o);l=Math.max(-1,l+a)}}function r(o,s=null,l=null,a=null){let d=0,u=!1;const c={node:o,parent:s,key:l,container:a,root:e,remove(){Ht(a).splice(Math.max(0,it(l)+d),1),d--,u=!0},removeAllNextSiblings(){return Ht(a).splice(it(l)+1)},removeAllPrevSiblings(){const v=it(l)+d;return d-=v,Ht(a).splice(0,Math.max(0,v))},replaceWith(v,_={}){const b=!!_.traverse;a?a[Math.max(0,it(l)+d)]=v:pt(s,"Can't replace root node")[l]=v,b&&r(v,s,l,a),u=!0},replaceWithMultiple(v,_={}){const b=!!_.traverse;if(Ht(a).splice(Math.max(0,it(l)+d),1,...v),d+=v.length-1,b){let L=0;for(let E=0;E<v.length;E++)L+=r(v[E],s,it(l)+E+L,a)}u=!0},skip(){u=!0}},{type:f}=o,h=t["*"],m=t[f],g=typeof h=="function"?h:h?.enter,y=typeof m=="function"?m:m?.enter;if(g?.(c,i),y?.(c,i),!u)switch(f){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":n(o.body,o);break;case"Assertion":case"Backreference":case"Character":case"CharacterSet":case"Directive":case"Flags":case"NamedCallout":case"Subroutine":break;case"CharacterClassRange":r(o.min,o,"min"),r(o.max,o,"max");break;case"Quantifier":r(o.body,o,"body");break;case"Regex":n(o.body,o),r(o.flags,o,"flags");break;default:throw new Error(`Unexpected node type "${f}"`)}return m?.exit?.(c,i),h?.exit?.(c,i),d}return r(e),e}function Ht(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function it(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const Vd=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function $d(e,t){for(let i=0;i<e.length;i++)e[i]>=t&&e[i]++}function Ud(e,t,i,n){return e.slice(0,t)+n+e.slice(t+i.length)}const ur=new RegExp(String.raw`(?<noncapturingStart>${Vd})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function zd(e,t){const i=t?.hiddenCaptures??[];let n=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:n,hiddenCaptures:i};const r="(?>",o="(?:(?=(",s=[0],l=[];let a=0,d=0,u=NaN,c;do{c=!1;let f=0,h=0,m=!1,g;for(ur.lastIndex=Number.isNaN(u)?0:u+o.length;g=ur.exec(e);){const{0:y,index:v,groups:{capturingStart:_,noncapturingStart:b}}=g;if(y==="[")f++;else if(f)y==="]"&&f--;else if(y===r&&!m)u=v,m=!0;else if(m&&b)h++;else if(_)m?h++:(a++,s.push(a+d));else if(y===")"&&m){if(!h){d++;const L=a+d;if(e=`${e.slice(0,u)}${o}${e.slice(u+r.length,v)}))<$$${L}>)${e.slice(v+1)}`,c=!0,l.push(L),$d(i,L),n.size){const E=new Map;n.forEach((S,C)=>{E.set(C>=L?C+1:C,S.map(x=>x>=L?x+1:x))}),n=E}break}h--}}}while(c);return i.push(...l),e=co(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:f,groups:{backrefNum:h,wrappedBackrefNum:m}})=>{if(h){const g=+h;if(g>s.length-1)throw new Error(`Backref "${f}" greater than number of captures`);return`\\${s[g]}`}return`\\${m}`},Ue.DEFAULT),{pattern:e,captureTransfers:n,hiddenCaptures:i}}const Zo=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,Ii=new RegExp(String.raw`
36
+ \\(?: \d+
37
+ | c[A-Za-z]
38
+ | [gk]<[^>]+>
39
+ | [pPu]\{[^\}]+\}
40
+ | u[A-Fa-f\d]{4}
41
+ | x[A-Fa-f\d]{2}
42
+ )
43
+ | \((?: \? (?: [:=!>]
44
+ | <(?:[=!]|[^>]+>)
45
+ | [A-Za-z\-]+:
46
+ | \(DEFINE\)
47
+ ))?
48
+ | (?<qBase>${Zo})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
49
+ | \\?.
50
+ `.replace(/\s+/g,""),"gsu");function Bd(e){if(!new RegExp(`${Zo}\\+`).test(e))return{pattern:e};const t=[];let i=null,n=null,r="",o=0,s;for(Ii.lastIndex=0;s=Ii.exec(e);){const{0:l,index:a,groups:{qBase:d,qMod:u,invalidQ:c}}=s;if(l==="[")o||(n=a),o++;else if(l==="]")o?o--:n=null;else if(!o)if(u==="+"&&r&&!r.startsWith("(")){if(c)throw new Error(`Invalid quantifier "${l}"`);let f=-1;if(/^\{\d+\}$/.test(d))e=Ud(e,a+d.length,u,"");else{if(r===")"||r==="]"){const h=r===")"?i:n;if(h===null)throw new Error(`Invalid unmatched "${r}"`);e=`${e.slice(0,h)}(?>${e.slice(h,a)}${d})${e.slice(a+l.length)}`}else e=`${e.slice(0,a-r.length)}(?>${r}${d})${e.slice(a+l.length)}`;f+=4}Ii.lastIndex+=f}else l[0]==="("?t.push(a):l===")"&&(i=t.length?t.pop():null);r=l}return{pattern:e}}const se=String.raw,Gd=se`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,cn=se`\(\?R=(?<rDepth>[^\)]+)\)|${Gd}`,Ei=se`\(\?<(?![=!])(?<captureName>[^>]+)>`,Yo=se`${Ei}|(?<unnamed>\()(?!\?)`,qe=new RegExp(se`${Ei}|${cn}|\(\?|\\?.`,"gsu"),Di="Cannot use multiple overlapping recursions";function jd(e,t){const{hiddenCaptures:i,mode:n}={hiddenCaptures:[],mode:"plugin",...t};let r=t?.captureTransfers??new Map;if(!new RegExp(cn,"su").test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:i};if(n==="plugin"&&Dt(e,se`\(\?\(DEFINE\)`,Ue.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const o=[],s=Dt(e,se`\\[1-9]`,Ue.DEFAULT),l=new Map,a=[];let d=!1,u=0,c=0,f;for(qe.lastIndex=0;f=qe.exec(e);){const{0:h,groups:{captureName:m,rDepth:g,gRNameOrNum:y,gRDepth:v}}=f;if(h==="[")u++;else if(u)h==="]"&&u--;else if(g){if(cr(g),d)throw new Error(Di);if(s)throw new Error(`${n==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const _=e.slice(0,f.index),b=e.slice(qe.lastIndex);if(Dt(b,cn,Ue.DEFAULT))throw new Error(Di);const L=+g-1;e=fr(_,b,L,!1,i,o,c),r=pr(r,_,L,o.length,0,c);break}else if(y){cr(v);let _=!1;for(const k of a)if(k.name===y||k.num===+y){if(_=!0,k.hasRecursedWithin)throw new Error(Di);break}if(!_)throw new Error(se`Recursive \g cannot be used outside the referenced group "${n==="external"?y:se`\g<${y}&R=${v}>`}"`);const b=l.get(y),L=Ys(e,b);if(s&&Dt(L,se`${Ei}|\((?!\?)`,Ue.DEFAULT))throw new Error(`${n==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const E=e.slice(b,f.index),S=L.slice(E.length+h.length),C=o.length,x=+v-1,w=fr(E,S,x,!0,i,o,c);r=pr(r,E,x,o.length-C,C,c);const A=e.slice(0,b),I=e.slice(b+L.length);e=`${A}${w}${I}`,qe.lastIndex+=w.length-h.length-E.length-S.length,a.forEach(k=>k.hasRecursedWithin=!0),d=!0}else if(m)c++,l.set(String(c),qe.lastIndex),l.set(m,qe.lastIndex),a.push({num:c,name:m});else if(h[0]==="("){const _=h==="(";_&&(c++,l.set(String(c),qe.lastIndex)),a.push(_?{num:c}:{})}else h===")"&&a.pop()}return i.push(...o),{pattern:e,captureTransfers:r,hiddenCaptures:i}}function cr(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 fr(e,t,i,n,r,o,s){const l=new Set;n&&fo(e+t,Ei,({groups:{captureName:d}})=>{l.add(d)},Ue.DEFAULT);const a=[i,n?l:null,r,o,s];return`${e}${hr(`(?:${e}`,"forward",...a)}(?:)${hr(`${t})`,"backward",...a)}${t}`}function hr(e,t,i,n,r,o,s){const a=u=>t==="forward"?u+2:i-u+2-1;let d="";for(let u=0;u<i;u++){const c=a(u);d+=co(e,se`${Yo}|\\k<(?<backref>[^>]+)>`,({0:f,groups:{captureName:h,unnamed:m,backref:g}})=>{if(g&&n&&!n.has(g))return f;const y=`_$${c}`;if(m||h){const v=s+o.length+1;return o.push(v),Wd(r,v),m?f:`(?<${h}${y}>`}return se`\k<${g}${y}>`},Ue.DEFAULT)}return d}function Wd(e,t){for(let i=0;i<e.length;i++)e[i]>=t&&e[i]++}function pr(e,t,i,n,r,o){if(e.size&&n){let s=0;fo(t,Yo,()=>s++,Ue.DEFAULT);const l=o-s+r,a=new Map;return e.forEach((d,u)=>{const c=(n-s*i)/i,f=s*i,h=u>l+s?u+n:u,m=[];for(const g of d)if(g<=l)m.push(g);else if(g>l+s+c)m.push(g+n);else if(g<=l+s)for(let y=0;y<=i;y++)m.push(g+s*y);else for(let y=0;y<=i;y++)m.push(g+f+c*y);a.set(h,m)}),a}return e}var J=String.fromCodePoint,O=String.raw,he={},Si=globalThis.RegExp;he.flagGroups=(()=>{try{new Si("(?i:)")}catch{return!1}return!0})();he.unicodeSets=(()=>{try{new Si("[[]]","v")}catch{return!1}return!0})();he.bugFlagVLiteralHyphenIsRange=he.unicodeSets?(()=>{try{new Si(O`[\d\-a]`,"v")}catch{return!0}return!1})():!1;he.bugNestedClassIgnoresNegation=he.unicodeSets&&new Si("[[^a]]","v").test("a");function oi(e,{enable:t,disable:i}){return{dotAll:!i?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!i?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function At(e,t,i){return e.has(t)||e.set(t,i),e.get(t)}function fn(e,t){return mr[e]>=mr[t]}function qd(e,t){if(e==null)throw new Error(t??"Value expected");return e}var mr={ES2025:2025,ES2024:2024,ES2018:2018},Kd={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function es(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!Kd[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=he.flagGroups?"ES2025":he.unicodeSets?"ES2024":"ES2018"),t}var Xd="[ -\r ]",Jd=new Set([J(304),J(305)]),Se=O`[\p{L}\p{M}\p{N}\p{Pc}]`;function ts(e){if(Jd.has(e))return[e];const t=new Set,i=e.toLowerCase(),n=i.toUpperCase(),r=Yd.get(i),o=Qd.get(i),s=Zd.get(i);return[...n].length===1&&t.add(n),s&&t.add(s),r&&t.add(r),t.add(i),o&&t.add(o),[...t]}var Nn=new Map(`C Other
51
+ Cc Control cntrl
52
+ Cf Format
53
+ Cn Unassigned
54
+ Co Private_Use
55
+ Cs Surrogate
56
+ L Letter
57
+ LC Cased_Letter
58
+ Ll Lowercase_Letter
59
+ Lm Modifier_Letter
60
+ Lo Other_Letter
61
+ Lt Titlecase_Letter
62
+ Lu Uppercase_Letter
63
+ M Mark Combining_Mark
64
+ Mc Spacing_Mark
65
+ Me Enclosing_Mark
66
+ Mn Nonspacing_Mark
67
+ N Number
68
+ Nd Decimal_Number digit
69
+ Nl Letter_Number
70
+ No Other_Number
71
+ P Punctuation punct
72
+ Pc Connector_Punctuation
73
+ Pd Dash_Punctuation
74
+ Pe Close_Punctuation
75
+ Pf Final_Punctuation
76
+ Pi Initial_Punctuation
77
+ Po Other_Punctuation
78
+ Ps Open_Punctuation
79
+ S Symbol
80
+ Sc Currency_Symbol
81
+ Sk Modifier_Symbol
82
+ Sm Math_Symbol
83
+ So Other_Symbol
84
+ Z Separator
85
+ Zl Line_Separator
86
+ Zp Paragraph_Separator
87
+ Zs Space_Separator
88
+ ASCII
89
+ ASCII_Hex_Digit AHex
90
+ Alphabetic Alpha
91
+ Any
92
+ Assigned
93
+ Bidi_Control Bidi_C
94
+ Bidi_Mirrored Bidi_M
95
+ Case_Ignorable CI
96
+ Cased
97
+ Changes_When_Casefolded CWCF
98
+ Changes_When_Casemapped CWCM
99
+ Changes_When_Lowercased CWL
100
+ Changes_When_NFKC_Casefolded CWKCF
101
+ Changes_When_Titlecased CWT
102
+ Changes_When_Uppercased CWU
103
+ Dash
104
+ Default_Ignorable_Code_Point DI
105
+ Deprecated Dep
106
+ Diacritic Dia
107
+ Emoji
108
+ Emoji_Component EComp
109
+ Emoji_Modifier EMod
110
+ Emoji_Modifier_Base EBase
111
+ Emoji_Presentation EPres
112
+ Extended_Pictographic ExtPict
113
+ Extender Ext
114
+ Grapheme_Base Gr_Base
115
+ Grapheme_Extend Gr_Ext
116
+ Hex_Digit Hex
117
+ IDS_Binary_Operator IDSB
118
+ IDS_Trinary_Operator IDST
119
+ ID_Continue IDC
120
+ ID_Start IDS
121
+ Ideographic Ideo
122
+ Join_Control Join_C
123
+ Logical_Order_Exception LOE
124
+ Lowercase Lower
125
+ Math
126
+ Noncharacter_Code_Point NChar
127
+ Pattern_Syntax Pat_Syn
128
+ Pattern_White_Space Pat_WS
129
+ Quotation_Mark QMark
130
+ Radical
131
+ Regional_Indicator RI
132
+ Sentence_Terminal STerm
133
+ Soft_Dotted SD
134
+ Terminal_Punctuation Term
135
+ Unified_Ideograph UIdeo
136
+ Uppercase Upper
137
+ Variation_Selector VS
138
+ White_Space space
139
+ XID_Continue XIDC
140
+ XID_Start XIDS`.split(/\s/).map(e=>[yi(e),e])),Qd=new Map([["s",J(383)],[J(383),"s"]]),Zd=new Map([[J(223),J(7838)],[J(107),J(8490)],[J(229),J(8491)],[J(969),J(8486)]]),Yd=new Map([Ve(453),Ve(456),Ve(459),Ve(498),...Pi(8072,8079),...Pi(8088,8095),...Pi(8104,8111),Ve(8124),Ve(8140),Ve(8188)]),eu=new Map([["alnum",O`[\p{Alpha}\p{Nd}]`],["alpha",O`\p{Alpha}`],["ascii",O`\p{ASCII}`],["blank",O`[\p{Zs}\t]`],["cntrl",O`\p{Cc}`],["digit",O`\p{Nd}`],["graph",O`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",O`\p{Lower}`],["print",O`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",O`[\p{P}\p{S}]`],["space",O`\p{space}`],["upper",O`\p{Upper}`],["word",O`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",O`\p{AHex}`]]);function tu(e,t){const i=[];for(let n=e;n<=t;n++)i.push(n);return i}function Ve(e){const t=J(e);return[t.toLowerCase(),t]}function Pi(e,t){return tu(e,t).map(i=>Ve(i))}var is=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function iu(e,t){const i={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};ns(e);const n={accuracy:i.accuracy,asciiWordBoundaries:i.asciiWordBoundaries,avoidSubclass:i.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:fn(i.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};Ct(e,nu,n);const r={dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},o={currentFlags:r,prevFlags:null,globalFlags:r,groupOriginByCopy:new Map,groupsByName:new Map,multiplexCapturesToLeftByRef:new Map,openRefs:new Map,reffedNodesByReferencer:new Map,subroutineRefMap:n.subroutineRefMap};Ct(e,ru,o);const s={groupsByName:o.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:o.reffedNodesByReferencer};return Ct(e,ou,s),e._originMap=o.groupOriginByCopy,e._strategy=n.strategy,e}var nu={AbsenceFunction({node:e,parent:t,replaceWith:i}){const{body:n,kind:r}=e;if(r==="repeater"){const o=fe();o.body[0].body.push(Ke({negate:!0,body:n}),at("Any"));const s=fe();s.body[0].body.push(Xo("greedy",0,1/0,o)),i(W(s,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:i},{flagDirectivesByAlt:n}){const r=e.body.filter(o=>o.kind==="flags");for(let o=i+1;o<t.body.length;o++){const s=t.body[o];At(n,s,[]).push(...r)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){const i=os(t.get(e));if(i){const n=fe({flags:i});n.body[0].body=e.body,e.body=[W(n,e)]}}}},Assertion({node:e,parent:t,key:i,container:n,root:r,remove:o,replaceWith:s},l){const{kind:a,negate:d}=e,{asciiWordBoundaries:u,avoidSubclass:c,supportedGNodes:f,wordIsAscii:h}=l;if(a==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${d?"Y":"y"}"`);if(a==="line_end")s(W(Ke({body:[et({body:[ln("string_end")]}),et({body:[bi(10)]})]}),t));else if(a==="line_start")s(W(Le(O`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(a==="search_start")if(f.has(e))r.flags.sticky=!0,o();else{const m=n[i-1];if(m&&cu(m))s(W(Ke({negate:!0}),t));else{if(c)throw new Error(O`Uses "\G" in a way that requires a subclass`);s($e(ln("string_start"),t)),l.strategy="clip_search"}}else if(!(a==="string_end"||a==="string_start"))if(a==="string_end_newline")s(W(Le(O`(?=\n?\z)`),t));else if(a==="word_boundary"){if(!h&&!u){const m=`(?:(?<=${Se})(?!${Se})|(?<!${Se})(?=${Se}))`,g=`(?:(?<=${Se})(?=${Se})|(?<!${Se})(?!${Se}))`;s(W(Le(d?g:m),t))}}else throw new Error(`Unexpected assertion kind "${a}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:i}=e;typeof i=="string"&&!Mi(i)&&(i=Oi(i,t),e.ref=i)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:i}){let{name:n}=e;n&&!Mi(n)&&(n=Oi(n,t),e.name=n),i.set(e.number,e),n&&i.set(n,e)},CharacterClassRange({node:e,parent:t,replaceWith:i}){if(t.kind==="intersection"){const n=Jt({body:[e]});i(W(n,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:i},{accuracy:n,minTargetEs2024:r,digitIsAscii:o,spaceIsAscii:s,wordIsAscii:l}){const{kind:a,negate:d,value:u}=e;if(o&&(a==="digit"||u==="digit")){i($e(un("digit",{negate:d}),t));return}if(s&&(a==="space"||u==="space")){i(W(Hi(Le(Xd),d),t));return}if(l&&(a==="word"||u==="word")){i($e(un("word",{negate:d}),t));return}if(a==="any")i($e(at("Any"),t));else if(a==="digit")i($e(at("Nd",{negate:d}),t));else if(a!=="dot")if(a==="text_segment"){if(n==="strict")throw new Error(O`Use of "\X" requires non-strict accuracy`);const c="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",f=O`\p{RI}{2}|${c}(?:\u200D${c})*`;i(W(Le(O`(?>\r\n|${r?O`\p{RGI_Emoji}`:f}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(a==="hex")i($e(at("AHex",{negate:d}),t));else if(a==="newline")i(W(Le(d?`[^
141
+ ]`:`(?>\r
142
+ ?|[
143
+ \v\f…\u2028\u2029])`),t));else if(a==="posix")if(!r&&(u==="graph"||u==="print")){if(n==="strict")throw new Error(`POSIX class "${u}" requires min target ES2024 or non-strict accuracy`);let c={graph:"!-~",print:" -~"}[u];d&&(c=`\0-${J(c.codePointAt(0)-1)}${J(c.codePointAt(2)+1)}-􏿿`),i(W(Le(`[${c}]`),t))}else i(W(Hi(Le(eu.get(u)),d),t));else if(a==="property")Nn.has(yi(u))||(e.key="sc");else if(a==="space")i($e(at("space",{negate:d}),t));else if(a==="word")i(W(Hi(Le(Se),d),t));else throw new Error(`Unexpected character set kind "${a}"`)},Directive({node:e,parent:t,root:i,remove:n,replaceWith:r,removeAllPrevSiblings:o,removeAllNextSiblings:s}){const{kind:l,flags:a}=e;if(l==="flags")if(!a.enable&&!a.disable)n();else{const d=fe({flags:a});d.body[0].body=s(),r(W(d,t),{traverse:!0})}else if(l==="keep"){const d=i.body[0],c=i.body.length===1&&Wo(d,{type:"Group"})&&d.body[0].body.length===1?d.body[0]:i;if(t.parent!==c||c.body.length>1)throw new Error(O`Uses "\K" in a way that's unsupported`);const f=Ke({behind:!0});f.body[0].body=o(),r(W(f,t))}else throw new Error(`Unexpected directive kind "${l}"`)},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(i=>delete e[i]),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:i}=e.flags;t?.extended&&delete t.extended,i?.extended&&delete i.extended,t?.dotAll&&i?.dotAll&&delete t.dotAll,t?.ignoreCase&&i?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,i&&!Object.keys(i).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:i}=e;i==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:i}){const{kind:n}=e;if(n==="fail")i(W(Ke({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${n.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=fe();t.body[0].body.push(e.body),e.body=W(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const i=[];let n=!1,r=!1;for(const o of e.body)if(o.body.length===1&&o.body[0].kind==="search_start")o.body.pop();else{const s=as(o.body);s?(n=!0,Array.isArray(s)?i.push(...s):i.push(s)):r=!0}n&&!r&&i.forEach(o=>t.add(o))},exit(e,{accuracy:t,passedLookbehind:i,strategy:n}){if(t==="strict"&&i&&n)throw new Error(O`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:i}=e;typeof i=="string"&&!Mi(i)&&(i=Oi(i,t),e.ref=i)}},ru={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:i}){const{orphan:n,ref:r}=e;n||i.set(e,[...t.get(r).map(({node:o})=>o)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:i,skip:n},{groupOriginByCopy:r,groupsByName:o,multiplexCapturesToLeftByRef:s,openRefs:l,reffedNodesByReferencer:a}){const d=r.get(e);if(d&&l.has(e.number)){const c=$e(gr(e.number),t);a.set(c,l.get(e.number)),i(c);return}l.set(e.number,e),s.set(e.number,[]),e.name&&At(s,e.name,[]);const u=s.get(e.name??e.number);for(let c=0;c<u.length;c++){const f=u[c];if(d===f.node||d&&d===f.origin||e===f.origin){u.splice(c,1);break}}if(s.get(e.number).push({node:e,origin:d}),e.name&&s.get(e.name).push({node:e,origin:d}),e.name){const c=At(o,e.name,new Map);let f=!1;if(d)f=!0;else for(const h of c.values())if(!h.hasDuplicateNameToRemove){f=!0;break}o.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:f})}},exit({node:e},{openRefs:t}){t.get(e.number)===e&&t.delete(e.number)}},Group:{enter({node:e},t){t.prevFlags=t.currentFlags,e.flags&&(t.currentFlags=oi(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:i},n){const{isRecursive:r,ref:o}=e;if(r){let u=t;for(;(u=u.parent)&&!(u.type==="CapturingGroup"&&(u.name===o||u.number===o)););n.reffedNodesByReferencer.set(e,u);return}const s=n.subroutineRefMap.get(o),l=o===0,a=l?gr(0):rs(s,n.groupOriginByCopy,null);let d=a;if(!l){const u=os(lu(s,f=>f.type==="Group"&&!!f.flags)),c=u?oi(n.globalFlags,u):n.globalFlags;su(c,n.currentFlags)||(d=fe({flags:du(c)}),d.body[0].body.push(a))}i(W(d,t),{traverse:!l})}},ou={Backreference({node:e,parent:t,replaceWith:i},n){if(e.orphan){n.highestOrphanBackref=Math.max(n.highestOrphanBackref,e.ref);return}const o=n.reffedNodesByReferencer.get(e).filter(s=>au(s,e));if(!o.length)i(W(Ke({negate:!0}),t));else if(o.length>1){const s=fe({atomic:!0,body:o.reverse().map(l=>et({body:[dn(l.number)]}))});i(W(s,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 i=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let n=0;n<i;n++){const r=Ko();e.body.at(-1).body.push(r)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function ns(e){Ct(e,{"*"({node:t,parent:i}){t.parent=i}})}function su(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function au(e,t){let i=t;do{if(i.type==="Regex")return!1;if(i.type==="Alternative")continue;if(i===e)return!1;const n=ss(i.parent);for(const r of n){if(r===i)break;if(r===e||ls(r,e))return!0}}while(i=i.parent);throw new Error("Unexpected path")}function rs(e,t,i,n){const r=Array.isArray(e)?[]:{};for(const[o,s]of Object.entries(e))o==="parent"?r.parent=Array.isArray(i)?n:i:s&&typeof s=="object"?r[o]=rs(s,t,r,i):(o==="type"&&s==="CapturingGroup"&&t.set(r,t.get(e)??e),r[o]=s);return r}function gr(e){const t=Jo(e);return t.isRecursive=!0,t}function lu(e,t){const i=[];for(;e=e.parent;)(!t||t(e))&&i.push(e);return i}function Oi(e,t){if(t.has(e))return t.get(e);const i=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,i),i}function os(e){const t=["dotAll","ignoreCase"],i={enable:{},disable:{}};return e.forEach(({flags:n})=>{t.forEach(r=>{n.enable?.[r]&&(delete i.disable[r],i.enable[r]=!0),n.disable?.[r]&&(i.disable[r]=!0)})}),Object.keys(i.enable).length||delete i.enable,Object.keys(i.disable).length||delete i.disable,i.enable||i.disable?i:null}function du({dotAll:e,ignoreCase:t}){const i={};return(e||t)&&(i.enable={},e&&(i.enable.dotAll=!0),t&&(i.enable.ignoreCase=!0)),(!e||!t)&&(i.disable={},!e&&(i.disable.dotAll=!0),!t&&(i.disable.ignoreCase=!0)),i}function ss(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function as(e){const t=e.find(i=>i.kind==="search_start"||fu(i,{negate:!1})||!uu(i));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 i=[];for(const n of t.body){const r=as(n.body);if(!r)return null;Array.isArray(r)?i.push(...r):i.push(r)}return i}return null}function ls(e,t){const i=ss(e)??[];for(const n of i)if(n===t||ls(n,t))return!0;return!1}function uu({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function cu(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function fu(e,t){const i={negate:null,...t};return e.type==="LookaroundAssertion"&&(i.negate===null||e.negate===i.negate)&&e.body.length===1&&Wo(e.body[0],{type:"Assertion",kind:"search_start"})}function Mi(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Le(e,t){const n=qo(e,{...t,unicodePropertyMap:Nn}).body;return n.length>1||n[0].body.length>1?fe({body:n}):n[0].body[0]}function Hi(e,t){return e.negate=t,e}function $e(e,t){return e.parent=t,e}function W(e,t){return ns(e),e.parent=t,e}function hu(e,t){const i=es(t),n=fn(i.target,"ES2024"),r=fn(i.target,"ES2025"),o=i.rules.recursionLimit;if(!Number.isInteger(o)||o<2||o>20)throw new Error("Invalid recursionLimit; use 2-20");let s=null,l=null;if(!r){const h=[e.flags.ignoreCase];Ct(e,pu,{getCurrentModI:()=>h.at(-1),popModI(){h.pop()},pushModI(m){h.push(m)},setHasCasedChar(){h.at(-1)?s=!0:l=!0}})}const a={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||s)&&!l)};let d=e;const u={accuracy:i.accuracy,appliedGlobalFlags:a,captureMap:new Map,currentFlags:{dotAll:e.flags.dotAll,ignoreCase:e.flags.ignoreCase},inCharClass:!1,lastNode:d,originMap:e._originMap,recursionLimit:o,useAppliedIgnoreCase:!!(!r&&s&&l),useFlagMods:r,useFlagV:n,verbose:i.verbose};function c(h){return u.lastNode=d,d=h,qd(mu[h.type],`Unexpected node type "${h.type}"`)(h,u,c)}const f={pattern:e.body.map(c).join("|"),flags:c(e.flags),options:{...e.options}};return n||(delete f.options.force.v,f.options.disable.v=!0,f.options.unicodeSetsPlugin=null),f._captureTransfers=new Map,f._hiddenCaptures=[],u.captureMap.forEach((h,m)=>{h.hidden&&f._hiddenCaptures.push(m),h.transferTo&&At(f._captureTransfers,h.transferTo,[]).push(m)}),f}var pu={"*":{enter({node:e},t){if(_r(e)){const i=t.getCurrentModI();t.pushModI(e.flags?oi({ignoreCase:i},e.flags).ignoreCase:i)}},exit({node:e},t){_r(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){Fn(J(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},i){t(),ds(e,{firstOnly:!0}).length&&i.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&is.has(e.value)&&t.setHasCasedChar()}},mu={Alternative({body:e},t,i){return e.map(i).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?O`\B`:O`\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,i){const{body:n,name:r,number:o}=e,s={ignoreCase:t.currentFlags.ignoreCase},l=t.originMap.get(e);return l&&(s.hidden=!0,o>l.number&&(s.transferTo=l.number)),t.captureMap.set(o,s),`(${r?`?<${r}>`:""}${n.map(i).join("|")})`},Character({value:e},t){const i=J(e),n=nt(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(n!==i)return n;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&Fn(i)){const r=ts(i);return t.inCharClass?r.join(""):r.length>1?`[${r.join("")}]`:r[0]}return i},CharacterClass(e,t,i){const{kind:n,negate:r,parent:o}=e;let{body:s}=e;if(n==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");he.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&s.some(br)&&(s=[bi(45),...s.filter(d=>!br(d))]);const l=()=>`[${r?"^":""}${s.map(i).join(n==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||he.bugNestedClassIgnoresNegation)&&!r){const u=s.filter(c=>c.type==="CharacterClass"&&c.kind==="union"&&c.negate);if(u.length){const c=fe(),f=c.body[0];return c.parent=o,f.parent=c,s=s.filter(h=>!u.includes(h)),e.body=s,s.length?(e.parent=f,f.body.push(e)):c.body.pop(),u.forEach(h=>{const m=et({body:[h]});h.parent=m,m.parent=c,c.body.push(m)}),i(c)}}t.inCharClass=!0;const d=l();return t.inCharClass=!1,d}const a=s[0];if(n==="union"&&!r&&a&&((!t.useFlagV||!t.verbose)&&o.kind==="union"&&!(he.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&o.kind==="intersection"&&s.length===1&&a.type!=="CharacterClassRange"))return s.map(i).join("");if(!t.useFlagV&&o.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return l()},CharacterClassRange(e,t){const i=e.min.value,n=e.max.value,r={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},o=nt(i,r),s=nt(n,r),l=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const a=ds(e);yu(a).forEach(u=>{l.add(Array.isArray(u)?`${nt(u[0],r)}-${nt(u[1],r)}`:nt(u,r))})}return`${o}-${s}${[...l].join("")}`},CharacterSet({kind:e,negate:t,value:i,key:n},r){if(e==="dot")return r.currentFlags.dotAll?r.appliedGlobalFlags.dotAll||r.useFlagMods?".":"[^]":O`[^\n]`;if(e==="digit")return t?O`\D`:O`\d`;if(e==="property"){if(r.useAppliedIgnoreCase&&r.currentFlags.ignoreCase&&is.has(i))throw new Error(`Unicode property "${i}" can't be case-insensitive when other chars have specific case`);return`${t?O`\P`:O`\p`}{${n?`${n}=`:""}${i}}`}if(e==="word")return t?O`\W`:O`\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:i,parent:n},r,o){const s=r.currentFlags;i&&(r.currentFlags=oi(s,i));const l=t.map(o).join("|"),a=!r.verbose&&t.length===1&&n.type!=="Quantifier"&&!e&&(!r.useFlagMods||!i)?l:`(?${Eu(e,i,r.useFlagMods)}${l})`;return r.currentFlags=s,a},LookaroundAssertion({body:e,kind:t,negate:i},n,r){return`(?${`${t==="lookahead"?"":"<"}${i?"!":"="}`}${e.map(r).join("|")})`},Quantifier(e,t,i){return i(e.body)+Su(e)},Subroutine({isRecursive:e,ref:t},i){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const n=i.recursionLimit;return t===0?`(?R=${n})`:O`\g<${t}&R=${n}>`}},gu=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),vu=new Set(["-","\\","]","^","["]),_u=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),vr=new Map([[9,O`\t`],[10,O`\n`],[11,O`\v`],[12,O`\f`],[13,O`\r`],[8232,O`\u2028`],[8233,O`\u2029`],[65279,O`\uFEFF`]]),bu=new RegExp("^\\p{Cased}$","u");function Fn(e){return bu.test(e)}function ds(e,t){const i=!!t?.firstOnly,n=e.min.value,r=e.max.value,o=[];if(n<65&&(r===65535||r>=131071)||n===65536&&r>=131071)return o;for(let s=n;s<=r;s++){const l=J(s);if(!Fn(l))continue;const a=ts(l).filter(d=>{const u=d.codePointAt(0);return u<n||u>r});if(a.length&&(o.push(...a),i))break}return o}function nt(e,{escDigit:t,inCharClass:i,useFlagV:n}){if(vr.has(e))return vr.get(e);if(e<32||e>126&&e<160||e>262143||t&&Lu(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const r=i?n?_u:vu:gu,o=J(e);return(r.has(o)?"\\":"")+o}function yu(e){const t=e.map(r=>r.codePointAt(0)).sort((r,o)=>r-o),i=[];let n=null;for(let r=0;r<t.length;r++)t[r+1]===t[r]+1?n??=t[r]:n===null?i.push(t[r]):(i.push([n,t[r]]),n=null);return i}function Eu(e,t,i){if(e)return">";let n="";if(t&&i){const{enable:r,disable:o}=t;n=(r?.ignoreCase?"i":"")+(r?.dotAll?"s":"")+(o?"-":"")+(o?.ignoreCase?"i":"")+(o?.dotAll?"s":"")}return`${n}:`}function Su({kind:e,max:t,min:i}){let n;return!i&&t===1?n="?":!i&&t===1/0?n="*":i===1&&t===1/0?n="+":i===t?n=`{${i}}`:n=`{${i},${t===1/0?"":t}}`,n+{greedy:"",lazy:"?",possessive:"+"}[e]}function _r({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function Lu(e){return e>47&&e<58}function br({type:e,value:t}){return e==="Character"&&t===45}var Cu=class hn extends RegExp{#t=new Map;#e=null;#n;#i=null;#r=null;rawOptions={};get source(){return this.#n||"(?:)"}constructor(t,i,n){const r=!!n?.lazyCompile;if(t instanceof RegExp){if(n)throw new Error("Cannot provide options when copying a regexp");const o=t;super(o,i),this.#n=o.source,o instanceof hn&&(this.#t=o.#t,this.#i=o.#i,this.#r=o.#r,this.rawOptions=o.rawOptions)}else{const o={hiddenCaptures:[],strategy:null,transfers:[],...n};super(r?"":t,i),this.#n=t,this.#t=ku(o.hiddenCaptures,o.transfers),this.#r=o.strategy,this.rawOptions=n??{}}r||(this.#e=this)}exec(t){if(!this.#e){const{lazyCompile:r,...o}=this.rawOptions;this.#e=new hn(this.#n,this.flags,o)}const i=this.global||this.sticky,n=this.lastIndex;if(this.#r==="clip_search"&&i&&n){this.lastIndex=0;const r=this.#o(t.slice(n));return r&&(wu(r,n,t,this.hasIndices),this.lastIndex+=n),r}return this.#o(t)}#o(t){this.#e.lastIndex=this.lastIndex;const i=super.exec.call(this.#e,t);if(this.lastIndex=this.#e.lastIndex,!i||!this.#t.size)return i;const n=[...i];i.length=1;let r;this.hasIndices&&(r=[...i.indices],i.indices.length=1);const o=[0];for(let s=1;s<n.length;s++){const{hidden:l,transferTo:a}=this.#t.get(s)??{};if(l?o.push(null):(o.push(i.length),i.push(n[s]),this.hasIndices&&i.indices.push(r[s])),a&&n[s]!==void 0){const d=o[a];if(!d)throw new Error(`Invalid capture transfer to "${d}"`);if(i[d]=n[s],this.hasIndices&&(i.indices[d]=r[s]),i.groups){this.#i||(this.#i=xu(this.source));const u=this.#i.get(a);u&&(i.groups[u]=n[s],this.hasIndices&&(i.indices.groups[u]=r[s]))}}}return i}};function wu(e,t,i,n){if(e.index+=t,e.input=i,n){const r=e.indices;for(let s=0;s<r.length;s++){const l=r[s];l&&(r[s]=[l[0]+t,l[1]+t])}const o=r.groups;o&&Object.keys(o).forEach(s=>{const l=o[s];l&&(o[s]=[l[0]+t,l[1]+t])})}}function ku(e,t){const i=new Map;for(const n of e)i.set(n,{hidden:!0});for(const[n,r]of t)for(const o of r)At(i,o,{}).transferTo=n;return i}function xu(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,i=new Map;let n=0,r=0,o;for(;o=t.exec(e);){const{0:s,groups:{capture:l,name:a}}=o;s==="["?n++:n?s==="]"&&n--:l&&(r++,a&&i.set(r,a))}return i}function Au(e,t){const i=Ru(e,t);return i.options?new Cu(i.pattern,i.flags,i.options):new RegExp(i.pattern,i.flags)}function Ru(e,t){const i=es(t),n=qo(e,{flags:i.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:i.rules.captureGroup,singleline:i.rules.singleline},skipBackrefValidation:i.rules.allowOrphanBackrefs,unicodePropertyMap:Nn}),r=iu(n,{accuracy:i.accuracy,asciiWordBoundaries:i.rules.asciiWordBoundaries,avoidSubclass:i.avoidSubclass,bestEffortTarget:i.target}),o=hu(r,i),s=jd(o.pattern,{captureTransfers:o._captureTransfers,hiddenCaptures:o._hiddenCaptures,mode:"external"}),l=Bd(s.pattern),a=zd(l.pattern,{captureTransfers:s.captureTransfers,hiddenCaptures:s.hiddenCaptures}),d={pattern:a.pattern,flags:`${i.hasIndices?"d":""}${i.global?"g":""}${o.flags}${o.options.disable.v?"u":"v"}`};if(i.avoidSubclass){if(i.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const u=a.hiddenCaptures.sort((m,g)=>m-g),c=Array.from(a.captureTransfers),f=r._strategy,h=d.pattern.length>=i.lazyCompileLength;(u.length||c.length||f||h)&&(d.options={...u.length&&{hiddenCaptures:u},...c.length&&{transfers:c},...f&&{strategy:f},...h&&{lazyCompile:h}})}return d}function Tu(e,t){return Au(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function Iu(e={}){const t={target:"auto",cache:new Map,...e};return t.regexConstructor||=i=>Tu(i,{target:t.target}),{createScanner(i){return new Kl(i,t)},createString(i){return{content:i}}}}async function Du(e){if(Eo())throw new Error(`resolveLanguage("${e}") cannot be called from a worker context. Languages must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);const t=xi.get(e);if(t!=null)return t;try{let i=ba.get(e);if(i==null&&Object.prototype.hasOwnProperty.call(on,e)&&(i=on[e]),i==null)throw new Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);const n=i().then(({default:r})=>{const o={name:e,data:r};return wt.has(e)||wt.set(e,o),o});return xi.set(e,n),await n}finally{xi.delete(e)}}function Pu(e){return wt.get(e)??Du(e)}function lt(e){for(const t of Dn(e))if(!nn.has(t))return!1;return!0}function us({name:e,load:t,colorScheme:i,collection:n,displayName:r}){return{name:e,colorScheme:i,collection:n,displayName:r,load:Ou(t)}}function Ou(e){return async()=>gi(yo(await e()))}const Mu="pierre",Hu=["pierre-dark","pierre-dark-soft","pierre-dark-vibrant","pierre-dark-protanopia-deuteranopia","pierre-dark-tritanopia"],cs=["pierre-light","pierre-light-soft","pierre-light-vibrant","pierre-light-protanopia-deuteranopia","pierre-light-tritanopia"],Nu=[...cs,...Hu],Fu=new Set(cs);function Vu(e){return Fu.has(e)?"light":"dark"}const $u={"pierre-dark":"Pierre Dark","pierre-dark-soft":"Pierre Dark Soft","pierre-dark-vibrant":"Pierre Dark Vibrant","pierre-dark-protanopia-deuteranopia":"Pierre Dark Protanopia & Deuteranopia","pierre-dark-tritanopia":"Pierre Dark Tritanopia","pierre-light":"Pierre Light","pierre-light-soft":"Pierre Light Soft","pierre-light-vibrant":"Pierre Light Vibrant","pierre-light-protanopia-deuteranopia":"Pierre Light Protanopia & Deuteranopia","pierre-light-tritanopia":"Pierre Light Tritanopia"},Uu={"pierre-dark":()=>p(()=>import("./pierre-dark-CyvmCCZW.js"),[],import.meta.url),"pierre-dark-soft":()=>p(()=>import("./pierre-dark-soft-BHGpRqa4.js"),[],import.meta.url),"pierre-dark-vibrant":()=>p(()=>import("./pierre-dark-vibrant-BWBVywrn.js"),[],import.meta.url),"pierre-dark-protanopia-deuteranopia":()=>p(()=>import("./pierre-dark-protanopia-deuteranopia-Rgc0TwpF.js"),[],import.meta.url),"pierre-dark-tritanopia":()=>p(()=>import("./pierre-dark-tritanopia-Beq2gCRQ.js"),[],import.meta.url),"pierre-light":()=>p(()=>import("./pierre-light-480U9XYS.js"),[],import.meta.url),"pierre-light-soft":()=>p(()=>import("./pierre-light-soft-CVdyfjmI.js"),[],import.meta.url),"pierre-light-vibrant":()=>p(()=>import("./pierre-light-vibrant-DdTDNdfJ.js"),[],import.meta.url),"pierre-light-protanopia-deuteranopia":()=>p(()=>import("./pierre-light-protanopia-deuteranopia-CaVOBURG.js"),[],import.meta.url),"pierre-light-tritanopia":()=>p(()=>import("./pierre-light-tritanopia-B4_gpKOM.js"),[],import.meta.url)};function zu(e){return us({name:e,collection:Mu,colorScheme:Vu(e),displayName:$u[e],load:Uu[e]})}const fs=kt({themes:Nu.map(e=>zu(e))}),Bu="shiki",hs=["ayu-light","catppuccin-latte","everforest-light","github-light","github-light-default","github-light-high-contrast","gruvbox-light-hard","gruvbox-light-medium","gruvbox-light-soft","horizon-bright","kanagawa-lotus","light-plus","material-theme-lighter","min-light","night-owl-light","one-light","rose-pine-dawn","slack-ochin","snazzy-light","solarized-light","vitesse-light"],Gu=["andromeeda","aurora-x","ayu-dark","ayu-mirage","catppuccin-frappe","catppuccin-macchiato","catppuccin-mocha","dark-plus","dracula","dracula-soft","everforest-dark","github-dark","github-dark-default","github-dark-dimmed","github-dark-high-contrast","gruvbox-dark-hard","gruvbox-dark-medium","gruvbox-dark-soft","horizon","houston","kanagawa-dragon","kanagawa-wave","laserwave","material-theme","material-theme-darker","material-theme-ocean","material-theme-palenight","min-dark","monokai","night-owl","nord","one-dark-pro","plastic","poimandres","red","rose-pine","rose-pine-moon","slack-dark","solarized-dark","synthwave-84","tokyo-night","vesper","vitesse-black","vitesse-dark"],ju=new Set(hs);function Wu(e){return ju.has(e)?"light":"dark"}const qu={andromeeda:()=>p(()=>import("./andromeeda-C4gqWexZ.js"),[],import.meta.url),"aurora-x":()=>p(()=>import("./aurora-x-D-2ljcwZ.js"),[],import.meta.url),"ayu-dark":()=>p(()=>import("./ayu-dark-DYE7WIF3.js"),[],import.meta.url),"ayu-light":()=>p(()=>import("./ayu-light-BA47KaF1.js"),[],import.meta.url),"ayu-mirage":()=>p(()=>import("./ayu-mirage-32ctXXKs.js"),[],import.meta.url),"catppuccin-frappe":()=>p(()=>import("./catppuccin-frappe-CZL1YF0i.js"),[],import.meta.url),"catppuccin-latte":()=>p(()=>import("./catppuccin-latte-DH-8KZSZ.js"),[],import.meta.url),"catppuccin-macchiato":()=>p(()=>import("./catppuccin-macchiato-B7yYVSCf.js"),[],import.meta.url),"catppuccin-mocha":()=>p(()=>import("./catppuccin-mocha-Ct7hS0mc.js"),[],import.meta.url),"dark-plus":()=>p(()=>import("./dark-plus-C3mMm8J8.js"),[],import.meta.url),dracula:()=>p(()=>import("./dracula-BzJJZx-M.js"),[],import.meta.url),"dracula-soft":()=>p(()=>import("./dracula-soft-BXkSAIEj.js"),[],import.meta.url),"everforest-dark":()=>p(()=>import("./everforest-dark-BgDCqdQA.js"),[],import.meta.url),"everforest-light":()=>p(()=>import("./everforest-light-C8M2exoo.js"),[],import.meta.url),"github-dark":()=>p(()=>import("./github-dark-vbPMK5nw.js"),[],import.meta.url),"github-dark-default":()=>p(()=>import("./github-dark-default-Cuk6v7N8.js"),[],import.meta.url),"github-dark-dimmed":()=>p(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[],import.meta.url),"github-dark-high-contrast":()=>p(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[],import.meta.url),"github-light":()=>p(()=>import("./github-light-CBO01_j6.js"),[],import.meta.url),"github-light-default":()=>p(()=>import("./github-light-default-D7oLnXFd.js"),[],import.meta.url),"github-light-high-contrast":()=>p(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[],import.meta.url),"gruvbox-dark-hard":()=>p(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[],import.meta.url),"gruvbox-dark-medium":()=>p(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[],import.meta.url),"gruvbox-dark-soft":()=>p(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[],import.meta.url),"gruvbox-light-hard":()=>p(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[],import.meta.url),"gruvbox-light-medium":()=>p(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[],import.meta.url),"gruvbox-light-soft":()=>p(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[],import.meta.url),horizon:()=>p(()=>import("./horizon-BUw7H-hv.js"),[],import.meta.url),"horizon-bright":()=>p(()=>import("./horizon-bright-CUuTKBJd.js"),[],import.meta.url),houston:()=>p(()=>import("./houston-DnULxvSX.js"),[],import.meta.url),"kanagawa-dragon":()=>p(()=>import("./kanagawa-dragon-BuwD2xS4.js"),[],import.meta.url),"kanagawa-lotus":()=>p(()=>import("./kanagawa-lotus-C3DzagqV.js"),[],import.meta.url),"kanagawa-wave":()=>p(()=>import("./kanagawa-wave-DFGoQZhC.js"),[],import.meta.url),laserwave:()=>p(()=>import("./laserwave-DUszq2jm.js"),[],import.meta.url),"light-plus":()=>p(()=>import("./light-plus-B7mTdjB0.js"),[],import.meta.url),"material-theme":()=>p(()=>import("./material-theme-D5KoaKCx.js"),[],import.meta.url),"material-theme-darker":()=>p(()=>import("./material-theme-darker-BfHTSMKl.js"),[],import.meta.url),"material-theme-lighter":()=>p(()=>import("./material-theme-lighter-B0m2ddpp.js"),[],import.meta.url),"material-theme-ocean":()=>p(()=>import("./material-theme-ocean-CyktbL80.js"),[],import.meta.url),"material-theme-palenight":()=>p(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[],import.meta.url),"min-dark":()=>p(()=>import("./min-dark-CafNBF8u.js"),[],import.meta.url),"min-light":()=>p(()=>import("./min-light-CTRr51gU.js"),[],import.meta.url),monokai:()=>p(()=>import("./monokai-BRVnQi9A.js"),[],import.meta.url),"night-owl":()=>p(()=>import("./night-owl-C39BiMTA.js"),[],import.meta.url),"night-owl-light":()=>p(()=>import("./night-owl-light-CMTm3GFP.js"),[],import.meta.url),nord:()=>p(()=>import("./nord-Ddv68eIx.js"),[],import.meta.url),"one-dark-pro":()=>p(()=>import("./one-dark-pro-DVMEJ2y_.js"),[],import.meta.url),"one-light":()=>p(()=>import("./one-light-C3Wv6jpd.js"),[],import.meta.url),plastic:()=>p(()=>import("./plastic-3e1v2bzS.js"),[],import.meta.url),poimandres:()=>p(()=>import("./poimandres-CS3Unz2-.js"),[],import.meta.url),red:()=>p(()=>import("./red-hvxz__6c.js"),[],import.meta.url),"rose-pine":()=>p(()=>import("./rose-pine-5qJOZa0Y.js"),[],import.meta.url),"rose-pine-dawn":()=>p(()=>import("./rose-pine-dawn-zx0QlTCp.js"),[],import.meta.url),"rose-pine-moon":()=>p(()=>import("./rose-pine-moon-C9pEdX9L.js"),[],import.meta.url),"slack-dark":()=>p(()=>import("./slack-dark-BthQWCQV.js"),[],import.meta.url),"slack-ochin":()=>p(()=>import("./slack-ochin-DqwNpetd.js"),[],import.meta.url),"snazzy-light":()=>p(()=>import("./snazzy-light-Bw305WKR.js"),[],import.meta.url),"solarized-dark":()=>p(()=>import("./solarized-dark-CpvCGNkr.js"),[],import.meta.url),"solarized-light":()=>p(()=>import("./solarized-light-Dlz6yCKv.js"),[],import.meta.url),"synthwave-84":()=>p(()=>import("./synthwave-84-CbfX1IO0.js"),[],import.meta.url),"tokyo-night":()=>p(()=>import("./tokyo-night-hegEt444.js"),[],import.meta.url),vesper:()=>p(()=>import("./vesper-DRje8inN.js"),[],import.meta.url),"vitesse-black":()=>p(()=>import("./vitesse-black-Bkuqu6BP.js"),[],import.meta.url),"vitesse-dark":()=>p(()=>import("./vitesse-dark-D0r3Knsf.js"),[],import.meta.url),"vitesse-light":()=>p(()=>import("./vitesse-light-CVO1_9PV.js"),[],import.meta.url)};function yr(e){return us({name:e,collection:Bu,colorScheme:Wu(e),load:qu[e]})}const ps=kt({themes:Object.freeze([...hs.map(e=>yr(e)),...Gu.map(e=>yr(e))])});kt({themes:[fs,ps]});function Ku(e){if(Eo())throw new Error(`Theme "${e}" cannot be resolved from a worker context. Themes must be pre-resolved on the main thread and passed to the worker via the resolvedLanguages parameter.`);if(ze.hasRegisteredTheme(e))return;const t=ps.getTheme(e);if(t!=null){ze.registerThemeIfAbsent(t.name,t.load);return}throw new Error(`No valid theme loader registered for "${e}"`)}function Xu(e,t){if(t.name!==e)throw new Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function Ju(e){Ku(e);const t=await ze.resolveTheme(e);return Xu(e,t),t}function Qu(e){return ze.getResolvedTheme(e)??Ju(e)}let ve;async function ms({themes:e,langs:t,preferredHighlighter:i="shiki-js"}){ve??=ql({themes:[],langs:["text"],engine:i==="shiki-wasm"?ko(p(()=>import("./wasm-CG6Dc4jp.js"),[],import.meta.url)):Iu()});const n=Zu(ve)?await ve:ve;ve=n;const r=[];for(const s of Array.from(new Set(t))){if(s==="text"||s==="ansi")continue;const l=Pu(s);"then"in l?r.push(l):Wn(l,n)}const o=[];for(const s of e){const l=Qu(s);"then"in l?o.push(l):jn(l,ve)}return(r.length>0||o.length>0)&&await Promise.all([Promise.all(r).then(s=>{Wn(s,n)}),Promise.all(o).then(s=>{jn(s,n)})]),n}function pn(e){if(!(ve==null||"then"in ve)&&!(e!=null&&(!lt(e.theme)||!tn(e.lang))))return ve}function Zu(e=ve){return e!=null&&"then"in e}for(const e of fs.getThemes())ze.registerThemeIfAbsent(e.name,e.load);function Vn(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}const rt=new Map,vt={"1c":"1c",abap:"abap",as:"actionscript-3",ada:"ada",adb:"ada",ads:"ada",adoc:"asciidoc",asciidoc:"asciidoc","component.html":"angular-html","component.ts":"angular-ts",conf:"nginx",htaccess:"apache",cls:"tex",trigger:"apex",apl:"apl",applescript:"applescript",scpt:"applescript",ara:"ara",asm:"asm",s:"riscv",astro:"astro",awk:"awk",bal:"ballerina",sh:"zsh",bash:"zsh",bat:"cmd",cmd:"cmd",be:"berry",beancount:"beancount",bib:"bibtex",bicep:"bicep","blade.php":"blade",bsl:"bsl",c:"c",h:"objective-cpp",cs:"csharp",cpp:"cpp",hpp:"cpp",cc:"cpp",cxx:"cpp",hh:"cpp",cdc:"cdc",cairo:"cairo",clar:"clarity",clj:"clojure",cljs:"clojure",cljc:"clojure",soy:"soy",cmake:"cmake","CMakeLists.txt":"cmake",cob:"cobol",cbl:"cobol",cobol:"cobol",CODEOWNERS:"codeowners",ql:"ql",coffee:"coffeescript",lisp:"lisp",cl:"lisp",lsp:"lisp",log:"log",v:"verilog",cql:"cql",cr:"crystal",css:"css",csv:"csv",cue:"cue",cypher:"cypher",cyp:"cypher",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",patch:"diff",Dockerfile:"dockerfile",dockerfile:"dockerfile",env:"dotenv",dm:"dream-maker",edge:"edge",el:"emacs-lisp",ex:"elixir",exs:"elixir",elm:"elm",erb:"erb",erl:"erlang",hrl:"erlang",f:"fortran-fixed-form",for:"fortran-fixed-form",fs:"fsharp",fsi:"fsharp",fsx:"fsharp",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"fortran-free-form",f95:"fortran-free-form",fnl:"fennel",fish:"fish",ftl:"ftl",tres:"gdresource",res:"gdresource",gd:"gdscript",gdshader:"gdshader",gs:"genie",feature:"gherkin",COMMIT_EDITMSG:"git-commit","git-rebase-todo":"git-rebase",gjs:"glimmer-js",gleam:"gleam",gts:"glimmer-ts",glsl:"glsl",vert:"glsl",frag:"glsl",shader:"shaderlab",gp:"gnuplot",plt:"gnuplot",gnuplot:"gnuplot",go:"go",graphql:"graphql",gql:"graphql",groovy:"groovy",gvy:"groovy",hack:"hack",haml:"haml",hbs:"handlebars",handlebars:"handlebars",hs:"haskell",lhs:"haskell",hx:"haxe",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",fx:"hlsl",html:"html",htm:"html",http:"http",rest:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",cfg:"ini",jade:"pug",pug:"pug",java:"java",js:"javascript",mjs:"javascript",cjs:"javascript",jinja:"jinja",jinja2:"jinja",j2:"jinja",jison:"jison",jl:"julia",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",libsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",kt:"kotlin",kts:"kts",kql:"kusto",tex:"tex",ltx:"tex",lean:"lean4",less:"less",liquid:"liquid",lit:"lit",ll:"llvm",logo:"logo",lua:"lua",luau:"luau",Makefile:"makefile",mk:"makefile",makefile:"makefile",md:"markdown",markdown:"markdown",marko:"marko",m:"wolfram",mat:"matlab",mdc:"mdc",mdx:"mdx",wiki:"wikitext",mediawiki:"wikitext",mmd:"mermaid",mermaid:"mermaid",mips:"mipsasm",mojo:"mojo","🔥":"mojo",move:"move",nar:"narrat",nf:"nextflow",nim:"nim",nims:"nim",nimble:"nim",nix:"nix",nu:"nushell",mm:"objective-cpp",ml:"ocaml",mli:"ocaml",mll:"ocaml",mly:"ocaml",pas:"pascal",p:"pascal",pl:"prolog",pm:"perl",t:"perl",raku:"raku",p6:"raku",pl6:"raku",php:"php",phtml:"php",pls:"plsql",sql:"sql",po:"po",polar:"polar",pcss:"postcss",pot:"pot",potx:"potx",pq:"powerquery",pqm:"powerquery",ps1:"powershell",psm1:"powershell",psd1:"powershell",prisma:"prisma",pro:"prolog",P:"prolog",properties:"properties",proto:"protobuf",pp:"puppet",purs:"purescript",py:"python",pyw:"python",pyi:"python",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",R:"r",rkt:"racket",rktl:"racket",razor:"razor",cshtml:"razor",rb:"ruby",rbw:"ruby",reg:"reg",regex:"regexp",rel:"rel",rs:"rust",rst:"rst",rake:"ruby",gemspec:"ruby",jbuilder:"ruby",builder:"ruby",rabl:"ruby",arb:"ruby",ru:"ruby",podspec:"ruby",Gemfile:"ruby",Rakefile:"ruby",Guardfile:"ruby",Capfile:"ruby",Berksfile:"ruby",Brewfile:"ruby",Vagrantfile:"ruby",Thorfile:"ruby",Appraisals:"ruby",Dangerfile:"ruby",sas:"sas",sass:"sass",scala:"scala",sc:"scala",scm:"scheme",ss:"scheme",sld:"scheme",scss:"scss",sdbl:"sdbl",shadergraph:"shader",st:"smalltalk",sol:"solidity",sparql:"sparql",rq:"sparql",spl:"splunk",config:"ssh-config",do:"stata",ado:"stata",dta:"stata",styl:"stylus",stylus:"stylus",svelte:"svelte",swift:"swift",sv:"system-verilog",svh:"system-verilog",service:"systemd",socket:"systemd",device:"systemd",timer:"systemd",talon:"talonscript",tasl:"tasl",tcl:"tcl",templ:"templ",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"typescript",mts:"typescript",cts:"typescript",tsp:"typespec",tsv:"tsv",tsx:"tsx",ttl:"turtle",twig:"twig",typ:"typst",vv:"v",vala:"vala",vapi:"vala",vb:"vb",vbs:"vb",bas:"vb",vh:"verilog",vhd:"vhdl",vhdl:"vhdl",vim:"vimscript",vue:"vue","vine.ts":"vue-vine",vy:"vyper",wasm:"wasm",wat:"wasm",wy:"文言",wgsl:"wgsl",wit:"wit",wl:"wolfram",nb:"wolfram",xml:"xml",xsl:"xsl",xslt:"xsl",yaml:"yaml",yml:"yml",zs:"zenscript",zig:"zig",zsh:"zsh",sty:"tex"};function Ie(e){if(rt.has(e))return rt.get(e)??"text";if(vt[e]!=null)return vt[e];const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(rt.has(t[1]))return rt.get(t[1])??"text";if(vt[t[1]]!=null)return vt[t[1]]??"text"}const i=e.match(/\.([^.]+)$/)?.[1]??"";return rt.has(i)?rt.get(i)??"text":vt[i]??"text"}function Er(e,t){for(const i of t)e.push(i)}function be(e){return{type:"text",value:e}}function H({tagName:e,children:t=[],properties:i={}}){return{type:"element",tagName:e,properties:i,children:t}}function si({name:e,width:t=16,height:i=16,properties:n}){return H({tagName:"svg",properties:{width:t,height:i,viewBox:"0 0 16 16",...n},children:[H({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function Yu(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t;"children"in t?t=t.children[0]:t=null}}function Nt(e){return H({tagName:"div",properties:{"data-gutter":""},children:e})}function ec(e,t,i,n={}){return H({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":i,...n},children:t!=null?[H({tagName:"span",properties:{"data-line-number-content":""},children:[be(`${t}`)]})]:void 0})}function ue(e,t,i){return H({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":i,"data-line-type":t==="annotation"?void 0:e,style:t==="annotation"?`grid-row: span ${i};`:`grid-row: span ${i};min-height:calc(${i} * 1lh);`}})}function tc(e,t,i){const n=typeof i.lineInfo=="function"?i.lineInfo(t):i.lineInfo[t-1];if(n==null){const r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:i}),new Error(r)}return e.tagName="div",e.properties["data-line"]=n.lineNumber,e.properties["data-alt-line"]=n.altLineNumber,e.properties["data-line-type"]=n.type,e.properties["data-line-index"]=n.lineIndex,e.children.length===0&&e.children.push(be(`
144
+ `)),e}const Ft=Symbol("no-token"),Ni=Symbol("multiple-tokens");function gs(e){const t=ic(e);if(t!=null)return t;let i=Ft;const n=[];let r=[],o;const s=()=>{if(r.length===0||o==null){r=[],o=void 0;return}if(r.length===1){const a=r[0];if(a?.type==="element"){nc(a,o);for(const d of a.children)Qt(d)}else Qt(a);n.push(a),r=[],o=void 0;return}for(const a of r)Qt(a);n.push(H({tagName:"span",properties:{"data-char":o},children:r})),r=[],o=void 0},l=a=>{if(a!==Ft){if(a===Ni){i=Ni;return}if(i===Ft){i=a;return}i!==a&&(i=Ni)}};for(const a of e.children){const d=a.type==="element"?gs(a):Ft;if(l(d),typeof d!="number"){s(),n.push(a);continue}o!=null&&o!==d&&s(),o??=d,r.push(a)}return s(),e.children=n,i}function ic(e){const t=e.properties["data-char"];if(typeof t=="number")return t}function Qt(e){if(e.type==="element"){e.properties["data-char"]=void 0;for(const t of e.children)Qt(t)}}function nc(e,t){e.properties["data-char"]=t}function rc(e={}){const{classPrefix:t="__shiki_",classSuffix:i="",classReplacer:n=l=>l}=e,r=new Map;function o(l){return Object.entries(l).map(([a,d])=>`${a}:${d}`).join(";")}function s(l){const a=typeof l=="string"?l:o(l);let d=t+oc(a)+i;return d=n(d),r.has(d)||r.set(d,typeof l=="string"?l:{...l}),d}return{name:"@shikijs/transformers:style-to-class",pre(l){if(!l.properties.style)return;const a=s(l.properties.style);delete l.properties.style,this.addClassToHast(l,a)},tokens(l){for(const a of l)for(const d of a){if(!d.htmlStyle)continue;const u=s(d.htmlStyle);d.htmlStyle={},d.htmlAttrs||={},d.htmlAttrs.class?d.htmlAttrs.class+=` ${u}`:d.htmlAttrs.class=u}},getClassRegistry(){return r},getCSS(){let l="";for(const[a,d]of r.entries())l+=`.${a}{${typeof d=="string"?d:o(d)}}`;return l},clearRegistry(){r.clear()}}}function oc(e,t=0){let i=3735928559^t,n=1103547991^t;for(let r=0,o;r<e.length;r++)o=e.charCodeAt(r),i=Math.imul(i^o,2654435761),n=Math.imul(n^o,1597334677);return i=Math.imul(i^i>>>16,2246822507),i^=Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(i^i>>>13,3266489909),(4294967296*(2097151&n)+(i>>>0)).toString(36).slice(0,6)}function sc(e=!1,t=!1){const i={lineInfo:[]},n=[{line(r){return delete r.properties.class,r},pre(r){const o=Yu(r),s=[];if(o!=null){let l=1;for(const a of o.children)a.type==="element"&&(e&&gs(a),s.push(tc(a,l,i)),l++);o.children=s}return r},...e?{tokens(r){for(const o of r){let s=0;for(const l of o){const a=l;a.__lineChar??=s,s+=l.content.length}}},preprocess(r,o){o.mergeWhitespaces="never"},span(r,o,s,l,a){if(a?.offset!=null&&a.content!=null){const d=a.__lineChar;return d!=null&&(r.properties["data-char"]=d),r}return r}}:null}];return t&&n.push(ac,Sr),e&&n.push({line:r=>(r.type==="element"&&r.children.length===0&&r.children.push({type:"element",tagName:"br",properties:{},children:[]}),r)}),{state:i,transformers:n,toClass:Sr}}const Sr=rc({classPrefix:"hl-"}),ac={name:"token-style-normalizer",tokens(e){for(const t of e)for(const i of t){if(i.htmlStyle!=null)continue;const n={};i.color!=null&&(n.color=i.color),i.bgColor!=null&&(n["background-color"]=i.bgColor),i.fontStyle!=null&&i.fontStyle!==0&&((i.fontStyle&1)!==0&&(n["font-style"]="italic"),(i.fontStyle&2)!==0&&(n["font-weight"]="bold"),(i.fontStyle&4)!==0&&(n["text-decoration"]="underline")),Object.keys(n).length>0&&(i.htmlStyle=n)}}};function ce(e){return`--${e==="token"?"diffs-token":"diffs"}-`}const lc=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,dc=/^0(?:\.0+)?%?$/;function uc(e){const t=e.indexOf("(");if(t<=0||!e.endsWith(")"))return;const i=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(i))return;const n=e.slice(t+1,-1).trim();if(n.length===0)return;const r=n.lastIndexOf("/");if(r!==-1)return n.slice(r+1).trim();if(/^(?:rgba|hsla)$/i.test(i)){const o=n.split(",");if(o.length===4)return o[3]?.trim()}}function cc(e){const t=/^#([0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})\b/i.exec(e.trim());if(t==null)return null;const i=t[1];let n,r=1;return i.length===3?n=i.split("").map(o=>o+o).join(""):i.length===6?n=i:(n=i.slice(0,6),r=parseInt(i.slice(6,8),16)/255),[parseInt(n.slice(0,2),16),parseInt(n.slice(2,4),16),parseInt(n.slice(4,6),16),r]}function Fi(e){if(e==null)return null;const t=cc(e);if(t==null)return null;const i=t[0]/255,n=t[1]/255,r=t[2]/255,o=s=>s<=.03928?s/12.92:((s+.055)/1.055)**2.4;return .2126*o(i)+.7152*o(n)+.0722*o(r)}function Lr(e){if(e==null)return!1;const t=e.trim().toLowerCase();if(t==="transparent"||lc.test(t))return!0;const i=uc(t);return i!=null&&dc.test(i)}function fc(e,t,i){if(t==null||i==null)return!1;const n=Fi(e),r=Fi(t),o=Fi(i);return n==null||r==null||o==null?!1:Math.abs(n-o)<Math.abs(n-r)}const Cr=new WeakMap;function Vi(e){const t=Cr.get(e);if(t!=null)return t;const i=e.colors??{},n={...i},r=i["editor.background"]??e.bg,o=i["editor.foreground"]??e.fg,s=i["sideBar.background"]??r,l=i["sideBar.foreground"]??o;me(n,"editor.background",r),me(n,"editor.foreground",o),me(n,"sideBar.background",s),me(n,"sideBar.foreground",l),me(n,"input.background",i["input.background"]??s),me(n,"sideBarSectionHeader.foreground",i["sideBarSectionHeader.foreground"]??l),me(n,"list.activeSelectionForeground",i["list.activeSelectionForeground"]??l),me(n,"gitDecoration.addedResourceForeground",$i(i["gitDecoration.addedResourceForeground"],i["terminal.ansiGreen"],i["editorGutter.addedBackground"])),me(n,"gitDecoration.modifiedResourceForeground",$i(i["gitDecoration.modifiedResourceForeground"],i["terminal.ansiBlue"],i["editorGutter.modifiedBackground"])),me(n,"gitDecoration.deletedResourceForeground",$i(i["gitDecoration.deletedResourceForeground"],i["terminal.ansiRed"],i["editorGutter.deletedBackground"]));const a=(Lr(i["list.focusOutline"])?void 0:i["list.focusOutline"])??(Lr(i.focusBorder)?void 0:i.focusBorder);a!=null?n["list.focusOutline"]=a:delete n["list.focusOutline"];const d=i["list.hoverBackground"];d!=null&&(hc(d,s)||fc(d,s,l))&&delete n["list.hoverBackground"];const u=Object.freeze({...e,colors:Object.freeze(n)});return Cr.set(e,u),u}function me(e,t,i){i!=null&&i!==""&&(e[t]=i)}function $i(...e){for(const t of e)if(t!=null&&t!=="")return t}function hc(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function pc({theme:e=_e,highlighter:t,prefix:i}){let n="";if(typeof e=="string"){const r=t.getTheme(e),o=Vi(r);n+=`color:${o.fg};`,n+=`background-color:${o.bg};`,n+=`${ce("global")}fg:${o.fg};`,n+=`${ce("global")}bg:${o.bg};`,n+=Ui(r,i)}else{let r=t.getTheme(e.dark),o=Vi(r);n+=`${ce("global")}dark:${o.fg};`,n+=`${ce("global")}dark-bg:${o.bg};`,n+=Ui(r,"dark"),r=t.getTheme(e.light),o=Vi(r),n+=`${ce("global")}light:${o.fg};`,n+=`${ce("global")}light-bg:${o.bg};`,n+=Ui(r,"light")}return n}function Ui(e,t){t=t!=null?`${t}-`:"";let i="";const n=e.colors?.["gitDecoration.addedResourceForeground"]??e.colors?.["terminal.ansiGreen"];n!=null&&(i+=`${ce("global")}${t}addition-color:${n};`);const r=e.colors?.["gitDecoration.deletedResourceForeground"]??e.colors?.["terminal.ansiRed"];r!=null&&(i+=`${ce("global")}${t}deletion-color:${r};`);const o=e.colors?.["gitDecoration.modifiedResourceForeground"]??e.colors?.["terminal.ansiBlue"];return o!=null&&(i+=`${ce("global")}${t}modified-color:${o};`),i}function wr(e){let t=e.children[0];for(;t!=null;){if(t.type==="element"&&t.tagName==="code")return t.children;"children"in t?t=t.children[0]:t=null}throw console.error(e),new Error("getLineNodes: Unable to find children")}function G(e,t){return e?.cacheKey!=null||t?.cacheKey!=null?e?.cacheKey===t?.cacheKey:e===t}function vs(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function Ce(e,t){return Vn(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function Et(e){const t=e.lang??Ie(e.name),i=e.lang??(e.prevName!=null?Ie(e.prevName):"text");return t==="text"&&i==="text"}function zi(e){return{...fa,...e}}function dt(e,t){const i=mc(e,t);return t?i:e.diffHeaderHeight+i}function mc(e,t){return e.paddingTop??(t?e.spacing:0)}function _s(e){return e.paddingBottom??e.spacing}function gc(e){switch(e){case"simple":return 4;case"metadata":case"line-info":case"line-info-basic":case"custom":return 32}}function Rt(e){return[ae(e.additionStart,e.additionCount)+1,ne(e.additionStart,e.additionCount)+1]}function De({isPartial:e,rangeSize:t,expandedHunks:i,hunkIndex:n,collapsedContextThreshold:r}){const o=Math.max(t,0);if(o===0||e)return{fromStart:0,fromEnd:0,rangeSize:o,collapsedLines:o,renderAll:!1};if(i===!0||o<=r)return{fromStart:o,fromEnd:0,rangeSize:o,collapsedLines:0,renderAll:!0};const s=i?.get(n),l=Math.min(Math.max(s?.fromStart??0,0),o),a=Math.min(Math.max(s?.fromEnd??0,0),o),d=l+a,u=d>=o;return{fromStart:u?o:l,fromEnd:u?0:a,rangeSize:o,collapsedLines:Math.max(o-d,0),renderAll:u}}function vc(e){const t=e.hunks[e.hunks.length-1];if(t==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return!1;const i=e.additionLines.length-ne(t.additionStart,t.additionCount),n=e.deletionLines.length-ne(t.deletionStart,t.deletionCount);return i<=0&&n<=0?!1:i!==n}function bs({fileDiff:e,errorPrefix:t}){const i=e.hunks[e.hunks.length-1];if(i==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;const n=e.additionLines.length-ne(i.additionStart,i.additionCount),r=e.deletionLines.length-ne(i.deletionStart,i.deletionCount);if(n<=0&&r<=0)return 0;if(n!==r)throw new Error(`${t}: trailing context mismatch (additions=${n}, deletions=${r}) for ${e.name}`);return Math.min(n,r)}function Pe({fileDiff:e,hunkIndex:t,expandedHunks:i,collapsedContextThreshold:n,errorPrefix:r}){if(t!==e.hunks.length-1)return;const o=bs({fileDiff:e,errorPrefix:r});if(o<=0)return;if(i===!0||o<=n)return{fromStart:o,fromEnd:0,rangeSize:o,collapsedLines:0,renderAll:!0};const s=i?.get(e.hunks.length),l=Math.min(Math.max(s?.fromStart??0,0),o);return{fromStart:l,fromEnd:0,rangeSize:o,collapsedLines:o-l,renderAll:l>=o}}function ys({fileDiff:e,lineNumber:t,expandedHunks:i,collapsedContextThreshold:n}){if(i===!0||e.isPartial)return!0;for(const[l,a]of e.hunks.entries()){const[d,u]=Rt(a);if(t<d){const c=De({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:i,hunkIndex:l,collapsedContextThreshold:n}),f=d-c.rangeSize;return c.renderAll||t<f+c.fromStart||t>=d-c.fromEnd}if(t<u)return!0}const r=Pe({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:i,collapsedContextThreshold:n,errorPrefix:"isAdditionLineRenderable"});if(r==null||r.renderAll)return!0;const o=e.hunks[e.hunks.length-1],[,s]=Rt(o);return t<s+r.fromStart||t>=s+r.rangeSize}function _c({fileDiff:e,lineNumber:t,direction:i,expandedHunks:n,collapsedContextThreshold:r}){if(n===!0||e.isPartial)return t;const o=[];let s=1;for(const[a,d]of e.hunks.entries()){const[u,c]=Rt(d),f=De({isPartial:e.isPartial,rangeSize:d.collapsedBefore,expandedHunks:n,hunkIndex:a,collapsedContextThreshold:r}),h=u-f.rangeSize;f.renderAll?o.push([h,u]):(f.fromStart>0&&o.push([h,h+f.fromStart]),f.fromEnd>0&&o.push([u-f.fromEnd,u])),o.push([u,c]),s=c}const l=Pe({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:n,collapsedContextThreshold:r,errorPrefix:"getNearestRenderableAdditionLine"});if(l!=null){const a=s;s=a+l.rangeSize,l.renderAll?o.push([a,s]):l.fromStart>0&&o.push([a,a+l.fromStart])}if(t>=s)return t;if(i==="down"){for(const[a,d]of o)if(d>t)return Math.max(a,t);return}for(let a=o.length-1;a>=0;a--){const[d,u]=o[a];if(d<=t)return Math.min(u-1,t)}}function Es({type:e,metrics:t}){return t.hunkSeparatorHeight??gc(e)}function Ss({type:e,metrics:t}){return e==="simple"||e==="metadata"||e==="line-info-basic"?0:t.spacing}function bc({type:e,hunkIndex:t,hunkSpecs:i}){switch(e){case"simple":return t>0;case"metadata":return i!=null;case"line-info":case"line-info-basic":case"custom":return!0}}function yc(e){return e!=="simple"&&e!=="metadata"}function St({type:e,metrics:t,hunkIndex:i,hunkSpecs:n}){if(!bc({type:e,hunkIndex:i,hunkSpecs:n}))return;const r=Es({type:e,metrics:t}),o=Ss({type:e,metrics:t}),s=i>0?o:0,l=o;return{height:r,gapBefore:s,gapAfter:l,totalHeight:s+r+l}}function Xe({type:e,metrics:t}){if(!yc(e))return;const i=Es({type:e,metrics:t}),n=Ss({type:e,metrics:t});return{height:i,gapBefore:n,gapAfter:0,totalHeight:n+i}}function Ye({diff:e,diffStyle:t,startingLine:i=0,totalLines:n=1/0,expandedHunks:r,collapsedContextThreshold:o=1,callback:s}){const l=Ec({diff:e,diffStyle:t,startingLine:i,expandedHunks:r,collapsedContextThreshold:o}),a={viewportStart:i,viewportEnd:i+n,isWindowedHighlight:i>0||n<1/0,splitCount:l.splitCount,unifiedCount:l.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!a.isWindowedHighlight)return!1;const d=a.unifiedCount>=i+n,u=a.splitCount>=i+n;return t==="unified"?d:(t==="split"||d)&&u},shouldSkip(d,u){if(!a.isWindowedHighlight)return!1;const c=d>0&&a.unifiedCount+d<=i,f=u>0&&a.splitCount+u<=i;return t==="unified"?c:(t==="split"||c)&&f},incrementCounts(d,u){(t==="unified"||t==="both")&&(a.unifiedCount+=d),(t==="split"||t==="both")&&(a.splitCount+=u)},isInWindow(d,u){if(!a.isWindowedHighlight)return!0;const c=a.isInUnifiedWindow(d),f=a.isInSplitWindow(u);return t==="unified"?c:t==="split"?f:c||f},isInUnifiedWindow(d){return!a.isWindowedHighlight||a.unifiedCount>=i-d&&a.unifiedCount<i+n},isInSplitWindow(d){return!a.isWindowedHighlight||a.splitCount>=i-d&&a.splitCount<i+n},emit(d,u=!1){return u||(t==="unified"?a.incrementCounts(1,0):t==="split"?a.incrementCounts(0,1):a.incrementCounts(1,1)),s(d)??!1}};e:for(let d=l.hunkIndex;d<e.hunks.length;d++){let _=function(k,R){return y==null||y.collapsedLines<=0||y.fromStart+y.fromEnd>0?0:t==="unified"?k===u.unifiedLineStart+u.unifiedLineCount-1?y.collapsedLines:0:R===u.splitLineStart+u.splitLineCount-1?y.collapsedLines:0},L=function(){return b?0:(b=!0,g.collapsedLines)};const u=e.hunks[d];if(u==null)throw new Error("iterateOverDiff: invalid hunk index");if(a.shouldBreak())break;const c=ae(u.deletionStart,u.deletionCount),f=ae(u.additionStart,u.additionCount),h=!e.isPartial&&u.deletionCount===0?c:u.deletionLineIndex,m=!e.isPartial&&u.additionCount===0?f:u.additionLineIndex,g=De({isPartial:e.isPartial,rangeSize:u.collapsedBefore,expandedHunks:r,hunkIndex:d,collapsedContextThreshold:o}),y=d===a.finalHunkIndex?Pe({fileDiff:e,hunkIndex:d,expandedHunks:r,collapsedContextThreshold:o,errorPrefix:"iterateOverDiff"}):void 0,v=g.fromStart+g.fromEnd;let b=g.collapsedLines===0;if(a.shouldSkip(v,v))a.incrementCounts(v,v),L();else{let k=u.unifiedLineStart-g.rangeSize,R=u.splitLineStart-g.rangeSize,D=h-g.rangeSize,F=m-g.rangeSize,T=c+1-g.rangeSize,M=f+1-g.rangeSize;if(Vt(a,g.fromStart,t,V=>a.emit({hunkIndex:d,hunk:u,collapsedBefore:0,collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:T+V,lineIndex:D+V,noEOFCR:!1,unifiedLineIndex:k+V,splitLineIndex:R+V},additionLine:{unifiedLineIndex:k+V,splitLineIndex:R+V,lineIndex:F+V,lineNumber:M+V,noEOFCR:!1}}))||(k=u.unifiedLineStart-g.fromEnd,R=u.splitLineStart-g.fromEnd,D=h-g.fromEnd,F=m-g.fromEnd,T=c+1-g.fromEnd,M=f+1-g.fromEnd,Vt(a,g.fromEnd,t,V=>a.emit({hunkIndex:d,hunk:u,collapsedBefore:L(),collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:T+V,lineIndex:D+V,noEOFCR:!1,unifiedLineIndex:k+V,splitLineIndex:R+V},additionLine:{unifiedLineIndex:k+V,splitLineIndex:R+V,lineIndex:F+V,lineNumber:M+V,noEOFCR:!1}}),()=>{L()})))break e}let E=u.unifiedLineStart,S=u.splitLineStart,C=h,x=m,w=c+1,A=f+1;const I=u.hunkContent.at(-1);for(const k of u.hunkContent){if(a.shouldBreak())break e;const R=k===I;if(k.type==="context"){if(a.shouldSkip(k.lines,k.lines))a.incrementCounts(k.lines,k.lines),L();else if(Vt(a,k.lines,t,D=>{const F=R&&D===k.lines-1,T=E+D,M=S+D;return a.emit({hunkIndex:d,hunk:u,collapsedBefore:L(),collapsedAfter:_(T,M),type:"context",deletionLine:{lineNumber:w+D,lineIndex:C+D,noEOFCR:F&&u.noEOFCRDeletions,unifiedLineIndex:T,splitLineIndex:M},additionLine:{unifiedLineIndex:T,splitLineIndex:M,lineIndex:x+D,lineNumber:A+D,noEOFCR:F&&u.noEOFCRAdditions}})},()=>{L()}))break e;E+=k.lines,S+=k.lines,C+=k.lines,x+=k.lines,w+=k.lines,A+=k.lines}else{const D=Math.max(k.deletions,k.additions),F=k.deletions+k.additions;if(!a.shouldSkip(F,D)){const T=Cc(a,k,t);(T[0]?.[0]??0)>0&&L();for(const[M,V]of T)for(let P=M;P<V;P++){const N=_(E+P,t==="unified"?S+(P<k.deletions?P:P-k.deletions):S+P);if(a.emit(wc({hunkIndex:d,hunk:u,collapsedBefore:L(),collapsedAfter:N,diffStyle:t,index:P,unifiedLineIndex:E,splitLineIndex:S,additionLineIndex:x,deletionLineIndex:C,additionLineNumber:A,deletionLineNumber:w,content:k,isLastContent:R,unifiedCount:F,splitCount:D}),!0))break e}}L(),a.incrementCounts(F,D),E+=F,S+=D,C+=k.deletions,x+=k.additions,w+=k.deletions,A+=k.additions}}if(y!=null){const{collapsedLines:k,fromStart:R,fromEnd:D}=y,F=R+D;if(Vt(a,F,t,T=>{const M=T===F-1;return a.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:M?k:0,type:"context-expanded",deletionLine:{lineNumber:w+T,lineIndex:C+T,noEOFCR:!1,unifiedLineIndex:E+T,splitLineIndex:S+T},additionLine:{unifiedLineIndex:E+T,splitLineIndex:S+T,lineIndex:x+T,lineNumber:A+T,noEOFCR:!1}})},void 0,()=>a.shouldBreak()))break e}}}function Ec({diff:e,diffStyle:t,startingLine:i,expandedHunks:n,collapsedContextThreshold:r}){if(i<=0||t==="both")return{hunkIndex:0,splitCount:0,unifiedCount:0};const o=Sc({diff:e,expandedHunks:n,collapsedContextThreshold:r});let s=0,l=e.hunks.length-1,a=e.hunks.length;for(;s<=l;){const u=s+l>>1,c=o[u+1];if(c==null)throw new Error("iterateOverDiff: invalid hunk prefix index");(t==="unified"?c.unifiedCount:c.splitCount)>i?(a=u,l=u-1):s=u+1}if(a>=e.hunks.length){const u=o[e.hunks.length];if(u==null)throw new Error("iterateOverDiff: invalid terminal hunk prefix index");return{hunkIndex:e.hunks.length,splitCount:u.splitCount,unifiedCount:u.unifiedCount}}const d=o[a];if(d==null)throw new Error("iterateOverDiff: invalid selected hunk prefix index");return{hunkIndex:a,splitCount:d.splitCount,unifiedCount:d.unifiedCount}}function Sc({diff:e,expandedHunks:t,collapsedContextThreshold:i}){let n=0,r=0;const o=e.hunks.length-1,s=[{splitCount:0,unifiedCount:0}];for(let l=0;l<e.hunks.length;l++){const a=e.hunks[l];if(a==null)throw new Error("iterateOverDiff: invalid hunk summary index");const d=De({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:t,hunkIndex:l,collapsedContextThreshold:i}),u=d.fromStart+d.fromEnd;n+=u+a.splitLineCount,r+=u+a.unifiedLineCount;const c=l===o?Pe({fileDiff:e,hunkIndex:l,expandedHunks:t,collapsedContextThreshold:i,errorPrefix:"iterateOverDiff"}):void 0;if(c!=null){const f=c.fromStart+c.fromEnd;n+=f,r+=f}s.push({splitCount:n,unifiedCount:r})}return s}function Lc(e,t,i){if(!e.isWindowedHighlight||t<=0)return[0,t];const n=[];function r(l){const a=Math.max(0,e.viewportStart-l),d=Math.min(t,e.viewportEnd-l);d>a&&n.push([a,d])}if(i!=="split"&&r(e.unifiedCount),i!=="unified"&&r(e.splitCount),n.length===0)return[0,0];let o=n[0][0],s=n[0][1];for(let l=1;l<n.length;l++){const a=n[l];o=Math.min(o,a[0]),s=Math.max(s,a[1])}return[o,s]}function Vt(e,t,i,n,r,o){const[s,l]=Lc(e,t,i);s>0&&(e.incrementCounts(s,s),r?.());let a=s;for(;a<t;){if(o?.()===!0)return!0;if(a>=l){e.incrementCounts(t-a,t-a);break}if(e.isInWindow(0,0)){if(n(a)===!0)return!0}else e.incrementCounts(1,1);a++}return!1}function Cc(e,t,i){if(!e.isWindowedHighlight)return[[0,i==="unified"?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];const n=i!=="split",r=i!=="unified",o=i==="unified"?"unified":"split",s=[];function l(c,f){if(c+f<=e.viewportStart||c>=e.viewportEnd)return;const h=Math.max(0,e.viewportStart-c),m=Math.min(f,e.viewportEnd-c);return m>h?[h,m]:void 0}function a(c,f){return o==="split"?c:f==="additions"?[c[0]+t.deletions,c[1]+t.deletions]:c}function d(c,f){if(c==null)return;const[h,m]=a(c,f);m>h&&s.push([h,m])}if(n&&(d(l(e.unifiedCount,t.deletions),"deletions"),d(l(e.unifiedCount+t.deletions,t.additions),"additions")),r&&(d(l(e.splitCount,t.deletions),"deletions"),d(l(e.splitCount,t.additions),"additions")),s.length===0)return s;s.sort((c,f)=>c[0]-f[0]);const u=[s[0]];for(const[c,f]of s.slice(1)){const h=u[u.length-1];c<=h[1]?h[1]=Math.max(h[1],f):u.push([c,f])}return u}function wc({hunkIndex:e,hunk:t,collapsedAfter:i,collapsedBefore:n,diffStyle:r,index:o,unifiedLineIndex:s,splitLineIndex:l,additionLineIndex:a,deletionLineIndex:d,additionLineNumber:u,deletionLineNumber:c,content:f,isLastContent:h,unifiedCount:m,splitCount:g}){const y=o<f.deletions?s+o:void 0,v=r==="unified"?o>=f.deletions?s+o:void 0:o<f.additions?s+f.deletions+o:void 0,_=r==="unified"?l+(o<f.deletions?o:o-f.deletions):l+o,b=o<f.deletions?d+o:void 0,L=o<f.deletions?c+o:void 0,E=r==="unified"?o>=f.deletions?a+(o-f.deletions):void 0:o<f.additions?a+o:void 0,S=r==="unified"?o>=f.deletions?u+(o-f.deletions):void 0:o<f.additions?u+o:void 0,C=r==="unified"?h&&o===f.deletions-1&&t.noEOFCRDeletions:h&&o===g-1&&t.noEOFCRDeletions,x=r==="unified"?h&&o===m-1&&t.noEOFCRAdditions:h&&o===g-1&&t.noEOFCRAdditions,w=b!=null&&L!=null&&y!=null?{lineNumber:L,lineIndex:b,noEOFCR:C,unifiedLineIndex:y,splitLineIndex:_}:void 0,A=E!=null&&S!=null&&v!=null?{unifiedLineIndex:v,splitLineIndex:_,lineIndex:E,lineNumber:S,noEOFCR:x}:void 0;if(w==null&&A!=null)return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:i,collapsedBefore:n,deletionLine:void 0,additionLine:A};if(w!=null&&A==null)return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:i,collapsedBefore:n,deletionLine:w,additionLine:void 0};if(w==null||A==null)throw new Error("iterateOverDiff: missing change line data");return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:i,collapsedBefore:n,deletionLine:w,additionLine:A}}function Oe(e){let t=e.length;return e.charCodeAt(t-1)===10&&(t--,e.charCodeAt(t-1)===13&&t--),e.slice(0,t)}class $n{diff(t,i,n={}){let r;typeof n=="function"?(r=n,n={}):"callback"in n&&(r=n.callback);const o=this.castInput(t,n),s=this.castInput(i,n),l=this.removeEmpty(this.tokenize(o,n)),a=this.removeEmpty(this.tokenize(s,n));return this.diffWithOptionsObj(l,a,n,r)}diffWithOptionsObj(t,i,n,r){var o;const s=_=>{if(_=this.postProcess(_,n),r){setTimeout(function(){r(_)},0);return}else return _},l=i.length,a=t.length;let d=1,u=l+a;n.maxEditLength!=null&&(u=Math.min(u,n.maxEditLength));const c=(o=n.timeout)!==null&&o!==void 0?o:1/0,f=Date.now()+c,h=[{oldPos:-1,lastComponent:void 0}];let m=this.extractCommon(h[0],i,t,0,n);if(h[0].oldPos+1>=a&&m+1>=l)return s(this.buildValues(h[0].lastComponent,i,t));let g=-1/0,y=1/0;const v=()=>{for(let _=Math.max(g,-d);_<=Math.min(y,d);_+=2){let b;const L=h[_-1],E=h[_+1];L&&(h[_-1]=void 0);let S=!1;if(E){const x=E.oldPos-_;S=E&&0<=x&&x<l}const C=L&&L.oldPos+1<a;if(!S&&!C){h[_]=void 0;continue}if(!C||S&&L.oldPos<E.oldPos?b=this.addToPath(E,!0,!1,0,n):b=this.addToPath(L,!1,!0,1,n),m=this.extractCommon(b,i,t,_,n),b.oldPos+1>=a&&m+1>=l)return s(this.buildValues(b.lastComponent,i,t))||!0;h[_]=b,b.oldPos+1>=a&&(y=Math.min(y,_-1)),m+1>=l&&(g=Math.max(g,_+1))}d++};if(r)(function _(){setTimeout(function(){if(d>u||Date.now()>f)return r(void 0);v()||_()},0)})();else for(;d<=u&&Date.now()<=f;){const _=v();if(_)return _}}addToPath(t,i,n,r,o){const s=t.lastComponent;return s&&!o.oneChangePerToken&&s.added===i&&s.removed===n?{oldPos:t.oldPos+r,lastComponent:{count:s.count+1,added:i,removed:n,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+r,lastComponent:{count:1,added:i,removed:n,previousComponent:s}}}extractCommon(t,i,n,r,o){const s=i.length,l=n.length;let a=t.oldPos,d=a-r,u=0;for(;d+1<s&&a+1<l&&this.equals(n[a+1],i[d+1],o);)d++,a++,u++,o.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return u&&!o.oneChangePerToken&&(t.lastComponent={count:u,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=a,d}equals(t,i,n){return n.comparator?n.comparator(t,i):t===i||!!n.ignoreCase&&t.toLowerCase()===i.toLowerCase()}removeEmpty(t){const i=[];for(let n=0;n<t.length;n++)t[n]&&i.push(t[n]);return i}castInput(t,i){return t}tokenize(t,i){return Array.from(t)}join(t){return t.join("")}postProcess(t,i){return t}get useLongestToken(){return!1}buildValues(t,i,n){const r=[];let o;for(;t;)r.push(t),o=t.previousComponent,delete t.previousComponent,t=o;r.reverse();const s=r.length;let l=0,a=0,d=0;for(;l<s;l++){const u=r[l];if(u.removed)u.value=this.join(n.slice(d,d+u.count)),d+=u.count;else{if(!u.added&&this.useLongestToken){let c=i.slice(a,a+u.count);c=c.map(function(f,h){const m=n[d+h];return m.length>f.length?m:f}),u.value=this.join(c)}else u.value=this.join(i.slice(a,a+u.count));a+=u.count,u.added||(d+=u.count)}}return r}}class kc extends $n{}const xc=new kc;function Ac(e,t,i){return xc.diff(e,t,i)}const kr="a-zA-Z0-9_\\u{AD}\\u{C0}-\\u{D6}\\u{D8}-\\u{F6}\\u{F8}-\\u{2C6}\\u{2C8}-\\u{2D7}\\u{2DE}-\\u{2FF}\\u{1E00}-\\u{1EFF}";class Rc extends $n{tokenize(t){const i=new RegExp(`(\\r?\\n)|[${kr}]+|[^\\S\\n\\r]+|[^${kr}]`,"ug");return t.match(i)||[]}}const Tc=new Rc;function Ic(e,t,i){return Tc.diff(e,t,i)}class Dc extends $n{constructor(){super(...arguments),this.tokenize=Oc}equals(t,i,n){return n.ignoreWhitespace?((!n.newlineIsToken||!t.includes(`
145
+ `))&&(t=t.trim()),(!n.newlineIsToken||!i.includes(`
146
+ `))&&(i=i.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(t.endsWith(`
147
+ `)&&(t=t.slice(0,-1)),i.endsWith(`
148
+ `)&&(i=i.slice(0,-1))),super.equals(t,i,n)}}const Pc=new Dc;function xr(e,t,i){return Pc.diff(e,t,i)}function Oc(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
149
+ `));const i=[],n=e.split(/(\n|\r\n)/);n[n.length-1]||n.pop();for(let r=0;r<n.length;r++){const o=n[r];r%2&&!t.newlineIsToken?i[i.length-1]+=o:i.push(o)}return i}function Mc(e){for(let t=0;t<e.length;t++)if(e[t]<" "||e[t]>"~"||e[t]==='"'||e[t]==="\\")return!0;return!1}function Ne(e){if(!Mc(e))return e;let t='"';const i=new TextEncoder().encode(e);let n=0;for(;n<i.length;){const r=i[n];r===7?t+="\\a":r===8?t+="\\b":r===9?t+="\\t":r===10?t+="\\n":r===11?t+="\\v":r===12?t+="\\f":r===13?t+="\\r":r===34?t+='\\"':r===92?t+="\\\\":r>=32&&r<=126?t+=String.fromCharCode(r):t+="\\"+r.toString(8).padStart(3,"0"),n++}return t+='"',t}const Ar={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function Rr(e,t,i,n,r,o,s){let l;s?typeof s=="function"?l={callback:s}:l=s:l={},typeof l.context>"u"&&(l.context=4);const a=l.context;if(l.newlineIsToken)throw new Error("newlineIsToken may not be used with patch-generation functions, only with diffing functions");if(l.callback){const{callback:u}=l;xr(i,n,Object.assign(Object.assign({},l),{callback:c=>{const f=d(c);u(f)}}))}else return d(xr(i,n,l));function d(u){if(!u)return;u.push({value:"",lines:[]});function c(_){return _.map(function(b){return" "+b})}const f=[];let h=0,m=0,g=[],y=1,v=1;for(let _=0;_<u.length;_++){const b=u[_],L=b.lines||Nc(b.value);if(b.lines=L,b.added||b.removed){if(!h){const E=u[_-1];h=y,m=v,E&&(g=a>0?c(E.lines.slice(-a)):[],h-=g.length,m-=g.length)}for(const E of L)g.push((b.added?"+":"-")+E);b.added?v+=L.length:y+=L.length}else{if(h)if(L.length<=a*2&&_<u.length-2)for(const E of c(L))g.push(E);else{const E=Math.min(L.length,a);for(const C of c(L.slice(0,E)))g.push(C);const S={oldStart:h,oldLines:y-h+E,newStart:m,newLines:v-m+E,lines:g};f.push(S),h=0,m=0,g=[]}y+=L.length,v+=L.length}}for(const _ of f)for(let b=0;b<_.lines.length;b++)_.lines[b].endsWith(`
150
+ `)?_.lines[b]=_.lines[b].slice(0,-1):(_.lines.splice(b+1,0,"\"),b++);return{oldFileName:e,newFileName:t,oldHeader:r,newHeader:o,hunks:f}}}function mn(e,t){var i,n,r,o,s,l;if(t||(t=Ar),Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders&&!e.every(u=>u.isGit))throw new Error("Cannot omit file headers on a multi-file patch. (The result would be unparseable; how would a tool trying to apply the patch know which changes are to which file?)");return e.map(u=>mn(u,t)).join(`
151
+ `)}const a=[];if(e.isGit){if(t=Ar,!e.oldFileName)throw new Error("oldFileName must be specified for Git patches");if(!e.newFileName)throw new Error("newFileName must be specified for Git patches");let u=e.oldFileName,c=e.newFileName;e.isCreate&&u==="/dev/null"?u=c.replace(/^b\//,"a/"):e.isDelete&&c==="/dev/null"&&(c=u.replace(/^a\//,"b/")),a.push("diff --git "+Ne(u)+" "+Ne(c)),e.isDelete&&a.push("deleted file mode "+((i=e.oldMode)!==null&&i!==void 0?i:"100644")),e.isCreate&&a.push("new file mode "+((n=e.newMode)!==null&&n!==void 0?n:"100644")),e.oldMode&&e.newMode&&!e.isDelete&&!e.isCreate&&(a.push("old mode "+e.oldMode),a.push("new mode "+e.newMode)),e.isRename&&(a.push("rename from "+Ne(((r=e.oldFileName)!==null&&r!==void 0?r:"").replace(/^a\//,""))),a.push("rename to "+Ne(((o=e.newFileName)!==null&&o!==void 0?o:"").replace(/^b\//,"")))),e.isCopy&&(a.push("copy from "+Ne(((s=e.oldFileName)!==null&&s!==void 0?s:"").replace(/^a\//,""))),a.push("copy to "+Ne(((l=e.newFileName)!==null&&l!==void 0?l:"").replace(/^b\//,""))))}else t.includeIndex&&e.oldFileName==e.newFileName&&e.oldFileName!==void 0&&a.push("Index: "+e.oldFileName),t.includeUnderline&&a.push("===================================================================");const d=e.hunks.length>0;t.includeFileHeaders&&e.oldFileName!==void 0&&e.newFileName!==void 0&&(!e.isGit||d)&&(a.push("--- "+Ne(e.oldFileName)+(e.oldHeader?" "+e.oldHeader:"")),a.push("+++ "+Ne(e.newFileName)+(e.newHeader?" "+e.newHeader:"")));for(let u=0;u<e.hunks.length;u++){const c=e.hunks[u],f=c.oldLines===0?c.oldStart-1:c.oldStart,h=c.newLines===0?c.newStart-1:c.newStart;a.push("@@ -"+f+","+c.oldLines+" +"+h+","+c.newLines+" @@");for(const m of c.lines)a.push(m)}return a.join(`
152
+ `)+`
153
+ `}function Hc(e,t,i,n,r,o,s){if(typeof s=="function"&&(s={callback:s}),s?.callback){const{callback:l}=s;Rr(e,t,i,n,r,o,Object.assign(Object.assign({},s),{callback:a=>{l(a?mn(a,s.headerOptions):void 0)}}))}else{const l=Rr(e,t,i,n,r,o,s);return l?mn(l,s?.headerOptions):void 0}}function Nc(e){const t=e.endsWith(`
154
+ `),i=e.split(`
155
+ `).map(n=>n+`
156
+ `);return t?i.pop():i.push(i.pop().slice(0,-1)),i}function ai({line:e,spanStart:t,spanLength:i}){return{start:{line:e,character:t},end:{line:e,character:t+i},properties:{"data-diff-span":""},alwaysWrap:!0}}function $t({item:e,arr:t,enableJoin:i,isNeutral:n=!1,isLastItem:r=!1}){const o=t[t.length-1];if(o==null||r||!i){t.push([n?0:1,e.value]);return}const s=o[0]===0;if(n===s||n&&e.value.length===1&&!s){o[1]+=e.value;return}t.push([n?0:1,e.value])}const Fc={forcePlainText:!1};function Vc(e,t,i,{forcePlainText:n,startingLine:r,totalLines:o,expandedHunks:s,collapsedContextThreshold:l=1}=Fc){n?(r??=0,o??=1/0):(r=0,o=1/0);const a=r>0||o<1/0,d=typeof i.theme=="string"?t.getTheme(i.theme).type:void 0,u=pc({theme:i.theme,highlighter:t}),c=n&&!a&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?"none":i.lineDiffType,f={deletionLines:[],additionLines:[]},{maxLineDiffLength:h}=i,m=!n&&!e.isPartial,g=n?s:void 0,y=new Map;function v(b){const L=m?0:b,E=y.get(L)??zc();return y.set(L,E),E}function _(b,L,E,S){if(a){let C=E.at(-1);(C==null||C.targetIndex+C.count!==L)&&(C={targetIndex:L,originalOffset:S.length,count:0},E.push(C)),C.count++}S.push(b)}Ye({diff:e,diffStyle:"both",startingLine:r,totalLines:o,expandedHunks:a?g:!0,collapsedContextThreshold:l,callback:({hunkIndex:b,additionLine:L,deletionLine:E,type:S})=>{const C=v(b),x=L!=null?L.splitLineIndex:E.splitLineIndex;S==="change"&&L!=null&&E!=null&&Uc({additionLine:e.additionLines[L.lineIndex],deletionLine:e.deletionLines[E.lineIndex],deletionLineIndex:C.deletionContent.length,additionLineIndex:C.additionContent.length,deletionDecorations:C.deletionDecorations,additionDecorations:C.additionDecorations,lineDiffType:c,maxLineDiffLength:h}),E!=null&&(_(e.deletionLines[E.lineIndex],E.lineIndex,C.deletionSegments,C.deletionContent),C.deletionInfo.push({type:S==="change"?"change-deletion":S,lineNumber:E.lineNumber,altLineNumber:S==="change"?void 0:L.lineNumber??void 0,lineIndex:`${E.unifiedLineIndex},${x}`})),L!=null&&(_(e.additionLines[L.lineIndex],L.lineIndex,C.additionSegments,C.additionContent),C.additionInfo.push({type:S==="change"?"change-addition":S,lineNumber:L.lineNumber,altLineNumber:S==="change"?void 0:E.lineNumber??void 0,lineIndex:`${L.unifiedLineIndex},${x}`}))}});for(const b of y.values()){if(b.deletionContent.length===0&&b.additionContent.length===0)continue;const L={name:e.prevName??e.name,contents:b.deletionContent.value},E={name:e.name,contents:b.additionContent.value},{deletionLines:S,additionLines:C}=Bc({deletionFile:L,deletionInfo:b.deletionInfo,deletionDecorations:b.deletionDecorations,additionFile:E,additionInfo:b.additionInfo,additionDecorations:b.additionDecorations,highlighter:t,options:i,languageOverride:n?"text":e.lang});if(m){f.deletionLines=S,f.additionLines=C;continue}if(b.deletionSegments.length>0)for(const x of b.deletionSegments)for(let w=0;w<x.count;w++)f.deletionLines[x.targetIndex+w]=S[x.originalOffset+w];else Er(f.deletionLines,S);if(b.additionSegments.length>0)for(const x of b.additionSegments)for(let w=0;w<x.count;w++)f.additionLines[x.targetIndex+w]=C[x.originalOffset+w];else Er(f.additionLines,C)}return{code:f,themeStyles:u,baseThemeType:d}}function $c(e,{deletionLineIndex:t,additionLineIndex:i,deletionDecorations:n,additionDecorations:r}){let o=0,s=0,l=-1,a=0,d=-1,u=0;for(const{value:c,added:f,removed:h}of e)h?(l===-1&&(l=o),o+=c.length,a=o):f?(d===-1&&(d=s),s+=c.length,u=s):(o+=c.length,s+=c.length);l!==-1&&n.push(ai({line:t,spanStart:l,spanLength:a-l})),d!==-1&&r.push(ai({line:i,spanStart:d,spanLength:u-d}))}function Uc({deletionLine:e,additionLine:t,deletionLineIndex:i,additionLineIndex:n,deletionDecorations:r,additionDecorations:o,lineDiffType:s,maxLineDiffLength:l}){if(e==null||t==null||s==="none"||(e=Oe(e),t=Oe(t),e.length>l||t.length>l))return;const a=s==="char"?Ac(e,t):Ic(e,t);if(s==="word-line"){$c(a,{deletionLineIndex:i,additionLineIndex:n,deletionDecorations:r,additionDecorations:o});return}const d=[],u=[],c=s==="word-alt",f=a.at(-1);for(const m of a){const g=m===f;!m.added&&!m.removed?($t({item:m,arr:d,enableJoin:c,isNeutral:!0,isLastItem:g}),$t({item:m,arr:u,enableJoin:c,isNeutral:!0,isLastItem:g})):m.removed?$t({item:m,arr:d,enableJoin:c,isLastItem:g}):$t({item:m,arr:u,enableJoin:c,isLastItem:g})}let h=0;for(const m of d)m[0]===1&&r.push(ai({line:i,spanStart:h,spanLength:m[1].length})),h+=m[1].length;h=0;for(const m of u)m[0]===1&&o.push(ai({line:n,spanStart:h,spanLength:m[1].length})),h+=m[1].length}function zc(){return{deletionContent:{push(e){this.value+=e,this.length++},value:"",length:0},additionContent:{push(e){this.value+=e,this.length++},value:"",length:0},deletionInfo:[],additionInfo:[],deletionDecorations:[],additionDecorations:[],deletionSegments:[],additionSegments:[]}}function Bc({deletionFile:e,additionFile:t,deletionInfo:i,additionInfo:n,highlighter:r,deletionDecorations:o,additionDecorations:s,languageOverride:l,options:{theme:a,...d}}){const u=l??Ie(e.name),c=l??Ie(t.name),{state:f,transformers:h}=sc(d.useTokenTransformer),m=typeof a=="string"?{...d,lang:"text",theme:a,transformers:h,decorations:void 0,defaultColor:!1,cssVariablePrefix:ce("token"),tokenizeTimeLimit:0}:{...d,lang:"text",themes:a,transformers:h,decorations:void 0,defaultColor:!1,cssVariablePrefix:ce("token"),tokenizeTimeLimit:0};return{deletionLines:e.contents===""?[]:(m.lang=u,f.lineInfo=i,m.decorations=o,wr(r.codeToHast(Oe(e.contents),m))),additionLines:t.contents===""?[]:(m.lang=c,m.decorations=s,f.lineInfo=n,wr(r.codeToHast(Oe(t.contents),m)))}}const Gc=q.createContext(void 0);function gn(e,t,i){if(e===t||e==null||t==null)return e===t;const n=new Set(i),r=Object.keys(e),o=new Set(Object.keys(t));for(const s of r)if(o.delete(s),!n.has(s)&&(!(s in t)||e[s]!==t[s]))return!1;for(const s of Array.from(o))if(!n.has(s))return!1;return!0}function Ls(e,t){const i=e?.theme??_e,n=t?.theme??_e,r=Tr(e),o=Tr(t);return Vn(i,n)&&gn(e,t,["theme","parseDiffOptions"])&&gn(r,o)}function Tr(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}const ct=new Set;let ft=null;function Cs(e){ct.add(e),ft??=requestAnimationFrame(ws)}function vn(e){ct.delete(e)&&ct.size===0&&ft!=null&&(cancelAnimationFrame(ft),ft=null)}function ws(e){const t=new Set(ct);ct.clear();for(const i of t)try{i(e)}catch(n){console.error(n)}ct.size>0?ft=requestAnimationFrame(ws):ft=null}function _n(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function Ir(e){if(typeof HTMLStyleElement<"u"&&e instanceof HTMLStyleElement)return!0;const t=e.tagName??e.nodeName;return typeof t=="string"&&t.toLowerCase()==="style"}function Dr(e,t){return e?.cacheKey!=null||t?.cacheKey!=null?e?.cacheKey===t?.cacheKey:e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}const jc="-1,-1";function Wc(e){return e?.some(t=>t.lineNumber===0)??!1}function Pr(e){const t=e[0];return t!=null&&t.length>0?t:void 0}function ks(e){return e.startingLine===0&&e.totalLines>0}function qc(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}function Kc(){return H({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[si({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}function Ut(e){for(const t of e)if(t instanceof HTMLElement&&(t.hasAttribute("data-utility-button")||t.hasAttribute("data-gutter-utility-slot")||t.getAttribute("slot")==="gutter-utility-slot"||t.getAttribute("name")==="gutter-utility-slot"))return!0;return!1}var Xc=class{mode;options;hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;selectedRangeHighlightSide;selectedRangeLineNumberOnly=!1;editorActiveLine=null;editorActiveLineSide;editorLineNumberOnly=!1;proposedSelectedRange;renderedSelectedLinesState;renderedEditorActiveLineState;selectionAnchor;pointerSession={mode:"idle"};constructor(e,t){this.mode=e,this.options=t}setOptions(e){this.options=e}cleanUp(){this.pre?.removeEventListener("click",this.handlePointerClick),this.pre?.removeEventListener("pointerdown",this.handlePointerDown),this.pre?.removeEventListener("pointermove",this.handlePointerMove),this.pre?.removeEventListener("pointerleave",this.handlePointerLeave),this.pre?.removeAttribute("data-interactive-lines"),this.pre?.removeAttribute("data-interactive-line-numbers"),this.pre=void 0,this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.clearHoveredLine(),this.clearHoveredToken(),this.detachDocumentPointerListeners(),this.clearPointerSession(),vn(this.renderSelection),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1,this.setSelectionDirty()}setup(e){this.setSelectionDirty();const{usesCustomGutterUtility:t=!1,enableGutterUtility:i=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),i?this.ensureGutterUtilityNode(t):this.gutterUtilityContainer!=null&&(this.gutterUtilityContainer.remove(),this.gutterUtilityLine=void 0,this.gutterUtilityContainer=void 0,this.gutterUtilityButton=void 0,this.gutterUtilitySlot=void 0,this.pointerSession.mode==="gutterSelecting"&&(this.clearPointerSession(),this.detachDocumentPointerListeners())),this.syncPointerListeners(e),this.updateInteractiveLineAttributes(),this.renderSelection(),this.placeUtility()}setSelectionDirty(){this.renderedSelectedLinesState=void 0,this.renderedEditorActiveLineState=void 0}isSelectionDirty(){return this.renderedSelectedLinesState===void 0||this.renderedEditorActiveLineState===void 0}setSelection(e,t){const i=!(e===this.selectedRange||_n(e??void 0,this.selectedRange??void 0)),n=t?.lineNumberOnly??!1,r=t?.activeLineSide!==this.selectedRangeHighlightSide||n!==this.selectedRangeLineNumberOnly;!this.isSelectionDirty()&&!i&&!r||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.selectedRangeHighlightSide=t?.activeLineSide,this.selectedRangeLineNumberOnly=n,this.renderSelection(),this.placeUtility(),i&&t?.notify!==!1&&this.notifySelectionCommitted(e))}setEditorActiveLine(e,{lineNumberOnly:t=!1,side:i}={}){const n=e!==this.editorActiveLine,r=i!==this.editorActiveLineSide||t!==this.editorLineNumberOnly;!this.isSelectionDirty()&&!n&&!r||(this.editorActiveLine=e,this.editorActiveLineSide=i,this.editorLineNumberOnly=t,this.renderSelection())}getSelection(){return this.selectedRange}getHoveredLine=()=>{const e=this.gutterUtilityLine??this.hoveredLine;if(e!=null){if(this.mode==="diff"&&e.type==="diff-line")return{lineNumber:e.lineNumber,side:e.annotationSide};if(this.mode==="file"&&e.type==="line")return{lineNumber:e.lineNumber}}};handlePointerClick=e=>{const{onHunkExpand:t,onLineClick:i,onLineNumberClick:n,onTokenClick:r,onMergeConflictActionClick:o}=this.options;t==null&&i==null&&n==null&&o==null&&r==null||this.options.onGutterUtilityClick!=null&&Ut(e.composedPath())||(we(this.options.__debugPointerEvents,"click","FileDiff.DEBUG.handlePointerClick:",e),this.handlePointerEvent({eventType:"click",event:e}))};handlePointerMove=e=>{if(e.pointerType!=="mouse")return;const{lineHoverHighlight:t="disabled",onLineEnter:i,onLineLeave:n,onTokenEnter:r,onTokenLeave:o,enableGutterUtility:s=!1}=this.options;t==="disabled"&&!s&&i==null&&n==null&&r==null&&o==null||(we(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",e),this.handlePointerEvent({eventType:"move",event:e}))};handlePointerLeave=e=>{const{__debugPointerEvents:t}=this.options;if(we(t,"move","FileDiff.DEBUG.handlePointerLeave: no event"),this.hoveredLine==null&&this.hoveredToken==null){we(t,"move","FileDiff.DEBUG.handlePointerLeave: returned early, no hovered line or token");return}this.hoveredToken!=null&&(this.options.onTokenLeave?.(this.hoveredToken,e),this.clearHoveredToken()),this.hoveredLine!=null&&(this.options.onLineLeave?.({...this.hoveredLine,event:e}),this.clearHoveredLine()),this.placeUtility()};handlePointerEvent({eventType:e,event:t}){const{__debugPointerEvents:i}=this.options,n=t.composedPath();we(i,e,"FileDiff.DEBUG.handlePointerEvent:",{eventType:e,composedPath:n});const r=this.resolvePointerTarget(n);we(i,e,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",r);const{onLineClick:o,onLineNumberClick:s,onLineEnter:l,onLineLeave:a,onTokenClick:d,onTokenEnter:u,onTokenLeave:c,onHunkExpand:f,onMergeConflictActionClick:h}=this.options;switch(e){case"move":{const m=Bi(r)&&this.hoveredLine?.lineElement===r.lineElement;Zt(r)&&this.hoveredToken?.tokenElement===r.tokenElement||(this.hoveredToken!=null&&(c?.(this.hoveredToken,t),this.clearHoveredToken()),Zt(r)&&(this.setHoveredToken(this.toTokenEventBaseProps(r)),u?.(this.hoveredToken,t))),m||(this.hoveredLine!=null&&(a?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),Bi(r)?(this.setHoveredLine(this.toEventBaseProps(r)),this.placeUtility(),l?.({...this.hoveredLine,event:t})):this.placeUtility());break}case"click":{if(r==null)break;if(Zc(r)&&h!=null){h(r);break}if(Qc(r)&&f!=null){f(r.hunkIndex,r.all||t.shiftKey?"both":r.direction,r.all||t.shiftKey?Number.POSITIVE_INFINITY:void 0);break}if(!Bi(r))break;Zt(r)&&d!=null&&d(this.toTokenEventBaseProps(r),t);const m=this.toEventBaseProps(r);s!=null&&r.numberColumn?s({...m,event:t}):o?.({...m,event:t});break}}}syncPointerListeners(e){const{__debugPointerEvents:t,lineHoverHighlight:i="disabled",onLineClick:n,onLineNumberClick:r,onLineEnter:o,onLineLeave:s,onTokenClick:l,onTokenEnter:a,onTokenLeave:d,onHunkExpand:u,onMergeConflictActionClick:c,enableGutterUtility:f=!1,enableLineSelection:h=!1,onGutterUtilityClick:m}=this.options,g=m!=null,y=i!=="disabled"||n!=null||r!=null||o!=null||s!=null||l!=null||a!=null||d!=null||u!=null||c!=null||f||h||g;y&&!this.hasPointerListeners?(e.addEventListener("click",this.handlePointerClick),e.addEventListener("pointerdown",this.handlePointerDown),e.addEventListener("pointermove",this.handlePointerMove),e.addEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!0,we(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{const b=[];return(t==="both"||t==="click")&&(n!=null&&b.push("onLineClick"),r!=null&&b.push("onLineNumberClick"),u!=null&&b.push("expandable hunk separators"),c!=null&&b.push("merge conflict actions")),b})()),we(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),we(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event")):!y&&this.hasPointerListeners&&(e.removeEventListener("click",this.handlePointerClick),e.removeEventListener("pointerdown",this.handlePointerDown),e.removeEventListener("pointermove",this.handlePointerMove),e.removeEventListener("pointerleave",this.handlePointerLeave),this.hasPointerListeners=!1);const v=this.pointerSession.mode==="selecting"||this.pointerSession.mode==="pendingSingleLineUnselect",_=this.pointerSession.mode==="gutterSelecting";(!h&&v||!g&&_)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;const{onLineClick:e,onLineNumberClick:t,enableLineSelection:i=!1}=this.options,n=e!=null,r=t!=null||i;n&&!this.interactiveLinesAttr?(this.pre.setAttribute("data-interactive-lines",""),this.interactiveLinesAttr=!0):!n&&this.interactiveLinesAttr&&(this.pre.removeAttribute("data-interactive-lines"),this.interactiveLinesAttr=!1),r&&!this.interactiveLineNumbersAttr?(this.pre.setAttribute("data-interactive-line-numbers",""),this.interactiveLineNumbersAttr=!0):!r&&this.interactiveLineNumbersAttr&&(this.pre.removeAttribute("data-interactive-line-numbers"),this.interactiveLineNumbersAttr=!1)}handlePointerDown=e=>{if(e.pointerType==="mouse"&&e.button!==0||this.pre==null||this.pointerSession.mode!=="idle")return;const t=e.composedPath();Ut(t)&&this.options.onGutterUtilityClick!=null?this.startGutterSelectionFromPointerDown(e):(e.pointerType!=="mouse"&&this.revealUtilityFromGutterPath(t),this.startLineSelectionFromPointerDown(e))};startLineSelectionFromPointerDown(e){const{enableLineSelection:t=!1}=this.options;if(!t)return;const i=this.resolveSelectionInfo(e,{source:"event-path",requireNumberColumn:!0});if(i==null)return;const{pre:n}=this;if(n==null)return;const{lineNumber:r,eventSide:o,lineIndex:s}=i;if(e.shiftKey&&this.selectedRange!=null){const l=this.getIndexesFromSelection(this.selectedRange,n.getAttribute("data-diff-type")==="split");if(l==null)return;const a=l.start<=l.end?s>=l.start:s<=l.end;this.selectionAnchor={lineNumber:a?this.selectedRange.start:this.selectedRange.end,side:a?this.selectedRange.side:this.selectedRange.endSide??this.selectedRange.side},this.updateSelection(r,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners();return}if(this.selectedRange?.start===r&&this.selectedRange?.end===r){const l={lineNumber:r,side:o};this.selectionAnchor=l,this.pointerSession={mode:"pendingSingleLineUnselect",pointerId:e.pointerId,anchor:l,pending:l},this.attachDocumentPointerListeners();return}this.options.controlledSelection===!0?this.proposedSelectedRange=null:this.selectedRange=null,this.placeUtility(),this.selectionAnchor={lineNumber:r,side:o},this.updateSelection(r,o,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.pointerSession={mode:"selecting",pointerId:e.pointerId},this.attachDocumentPointerListeners()}startGutterSelectionFromPointerDown(e){const{onGutterUtilityClick:t}=this.options;if(t==null)return;const i=this.currentSelectionEnds(),n=i?.bottom??this.resolveSelectionPoint(e,{source:"event-path",excludeUtility:!1}),r=i?.top??n;n==null||r==null||(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:"gutterSelecting",pointerId:e.pointerId,anchor:r,current:n},this.selectionAnchor={lineNumber:r.lineNumber,side:r.side},this.updateSelection(n.lineNumber,n.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const t=this.resolveSelectionPoint(e,{source:"coordinates-first"});if(t==null)return;this.pointerSession.current=t,this.updateSelection(t.lineNumber,t.side);return}case"selecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const t=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;this.updateSelection(t.lineNumber,t.eventSide);return}case"pendingSingleLineUnselect":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const t=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(t==null||this.selectionAnchor==null)return;const i={lineNumber:t.lineNumber,side:t.eventSide};if(qc(this.pointerSession.pending,i))return;this.updateSelection(t.lineNumber,t.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:"selecting",pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{const{onGutterUtilityClick:t}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{const{pointerSession:i}=this;if(e.pointerId!==i.pointerId)return;e.preventDefault();const n=this.resolveSelectionPoint(e,{source:"coordinates-first"});n!=null&&(i.current=n,this.updateSelection(n.lineNumber,n.side));const r=this.buildSelectedLineRange(i.anchor,i.current);t?.({...r}),this.selectionAnchor=void 0,this.notifySelectionEnd(r),this.notifySelectionCommitted(r),this.clearProposedSelection(),this.clearPointerSession(),this.detachDocumentPointerListeners();return}case"pendingSingleLineUnselect":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.updateSelection(null,void 0,!1),this.selectionAnchor=void 0,this.clearPendingSingleLineState(),this.detachDocumentPointerListeners(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection();return;case"selecting":if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault(),this.selectionAnchor=void 0,this.detachDocumentPointerListeners(),this.clearPointerSession(),this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(this.getCurrentSelectionRange()),this.clearProposedSelection()}};handleDocumentPointerCancel=e=>{switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":case"selecting":case"pendingSingleLineUnselect":if("pointerId"in this.pointerSession&&e.pointerId!==this.pointerSession.pointerId)return;this.selectionAnchor=void 0,this.clearProposedSelection(),this.clearPendingSingleLineState(),this.clearPointerSession(),this.detachDocumentPointerListeners()}};clearHoveredLine(){this.hoveredLine!=null&&(this.hoveredLine.lineElement.removeAttribute("data-hovered"),this.hoveredLine.numberElement.removeAttribute("data-hovered"),this.hoveredLine=void 0)}setHoveredLine(e){const{lineHoverHighlight:t="disabled"}=this.options;this.hoveredLine!=null&&this.clearHoveredLine(),this.hoveredLine=e,t!=="disabled"&&((t==="both"||t==="line")&&this.hoveredLine.lineElement.setAttribute("data-hovered",""),(t==="both"||t==="number")&&this.hoveredLine.numberElement.setAttribute("data-hovered",""))}clearHoveredToken(){this.hoveredToken!=null&&(this.hoveredToken=void 0)}setHoveredToken(e){this.hoveredToken!=null&&this.clearHoveredToken(),this.hoveredToken=e}ensureGutterUtilityNode(e){if(this.gutterUtilityContainer==null&&(this.gutterUtilityContainer=document.createElement("div"),this.gutterUtilityContainer.setAttribute("data-gutter-utility-slot","")),e)this.gutterUtilityButton!=null&&(this.gutterUtilityButton.remove(),this.gutterUtilityButton=void 0),this.gutterUtilitySlot==null&&(this.gutterUtilitySlot=document.createElement("slot"),this.gutterUtilitySlot.name="gutter-utility-slot"),this.gutterUtilitySlot.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilitySlot);else{if(this.gutterUtilitySlot?.remove(),this.gutterUtilitySlot=void 0,this.gutterUtilityButton==null){const t=document.createElement("div");t.innerHTML=Re(Kc());const i=t.firstElementChild;if(!(i instanceof HTMLButtonElement))throw new Error("InteractionManager.ensureGutterUtilityNode: Node element should be a button");i.remove(),this.gutterUtilityButton=i}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;const t=this.resolvePointerTarget(e);Lt(t)&&t.numberColumn&&this.showUtilityOnLine(this.toEventBaseProps(t))}placeUtility(){if(!this.placeUtilityFromSelection()){if(this.hoveredLine!=null){this.showUtilityOnLine(this.hoveredLine);return}this.hideUtility()}}placeUtilityFromSelection(){const e=this.currentSelectionEnds();if(e==null)return!1;const t=this.targetForSelectionPoint(e.bottom);return t==null?this.hideUtility():this.showUtilityOnLine(this.toEventBaseProps(t)),!0}showUtilityOnLine(e){this.gutterUtilityContainer!=null&&(this.gutterUtilityLine=e,e.numberElement.appendChild(this.gutterUtilityContainer))}hideUtility(){this.gutterUtilityContainer?.remove(),this.gutterUtilityLine=void 0}currentSelectionEnds(){const e=this.getCurrentSelectionRange();return e==null?void 0:this.selectionEnds(e)}selectionEnds(e){const t={lineNumber:e.start,side:e.side},i={lineNumber:e.end,side:e.endSide??e.side},n=this.selectionPointRowIndex(t),r=this.selectionPointRowIndex(i);if(!(n==null||r==null))return n>r?{top:i,bottom:t}:{top:t,bottom:i}}selectionPointRowIndex(e){const t=this.getLineIndex(e.lineNumber,e.side);if(t!=null)return this.isSplitDiff()?t[1]:t[0]}targetForSelectionPoint(e){if(this.pre==null)return;const t=this.getLineIndex(e.lineNumber,e.side);if(t==null)return;const i=this.mode==="diff"?`${t[0]},${t[1]}`:`${t[0]}`,n=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${i}"]`);for(const r of n){if(!(r instanceof HTMLElement))continue;const o=this.resolvePointerTarget(_t(r));if(Lt(o)&&!(this.mode==="diff"&&e.side!=null&&o.side!==e.side))return o}}attachDocumentPointerListeners(){this.hasDocumentPointerListeners||(document.addEventListener("pointermove",this.handleDocumentPointerMove),document.addEventListener("pointerup",this.handleDocumentPointerUp),document.addEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!0)}detachDocumentPointerListeners(){this.hasDocumentPointerListeners&&(document.removeEventListener("pointermove",this.handleDocumentPointerMove),document.removeEventListener("pointerup",this.handleDocumentPointerUp),document.removeEventListener("pointercancel",this.handleDocumentPointerCancel),this.hasDocumentPointerListeners=!1)}clearPointerSession(){this.pointerSession={mode:"idle"}}clearPendingSingleLineState(){this.pointerSession.mode==="pendingSingleLineUnselect"&&(this.pointerSession={mode:"idle"})}selectionInfoFromPath(e,t){const i=this.resolvePointerTarget(e);if(Lt(i)&&!(t&&!i.numberColumn)&&i.splitLineIndex!=null)return{lineIndex:i.splitLineIndex,lineNumber:i.lineNumber,eventSide:this.mode==="diff"?i.side:void 0}}resolveSelectionInfo(e,t){const i=this.resolveSelectionPath(e,t);return i!=null?this.selectionInfoFromPath(i,t.requireNumberColumn):void 0}selectionPointFromPath(e){const t=this.resolvePointerTarget(e);if(Lt(t))return{lineNumber:t.lineNumber,side:this.mode==="diff"?t.side:void 0}}resolveSelectionPoint(e,t){const i=this.resolveSelectionPath(e,t);return i!=null?this.selectionPointFromPath(i):void 0}resolveSelectionPath(e,t){const i=t.excludeUtility!==!1;switch(t.source){case"event-path":return this.pathFromEventPath(e.composedPath(),i);case"coordinates-first":{const n=this.pathFromCoordinates(e,i);return n!==void 0?n??void 0:this.pathFromEventPath(e.composedPath(),i)}}}pathFromCoordinates(e,t){const i=this.hitTest(e);if(i!==void 0)return i===null?null:this.pathFromElement(i,t)??null}pathFromEventPath(e,t){if(!(t&&Ut(e))){for(const i of e)if(i instanceof Element)return this.pathFromElement(i,t)}}pathFromElement(e,t){const i=_t(e);if(t&&Ut(i))return;const n=ef(e);return n!=null?_t(n):this.pathFromAnnotationSlot(e)}pathFromAnnotationSlot(e){const t=tf(e)?.previousElementSibling;if(t instanceof HTMLElement&&(t.hasAttribute("data-line")||t.hasAttribute("data-column-number")))return _t(t);const i=rf(nf(e));if(i==null)return;const n=this.targetForSelectionPoint(i);return n!=null?_t(n.lineElement):void 0}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;const t=this.pre?.getRootNode(),i=Hr(t)?t:Hr(document)?document:void 0;if(i!=null)return i.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){const{getLineIndex:i}=this.options;return i!=null?i(e,t):[e-1,e-1]}getCurrentSelectionRange(){return this.proposedSelectedRange!==void 0?this.proposedSelectedRange:this.selectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,i=!0){const n=this.getCurrentSelectionRange();let r;if(e==null)r=null;else{const o=this.selectionAnchor?.side??t,s=this.selectionAnchor?.lineNumber??e;r=this.buildSelectionRange(s,e,o,t)}_n(n??void 0,r??void 0)||(this.selectedRangeHighlightSide=void 0,this.selectedRangeLineNumberOnly=!1,this.options.controlledSelection===!0?this.proposedSelectedRange=r:(this.selectedRange=r,Cs(this.renderSelection)),this.placeUtility(),i&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;const i=this.getLineIndex(e.start,e.side),n=this.getLineIndex(e.end,e.endSide??e.side);return i!=null&&n!=null?{start:t?i[1]:i[0],end:t?n[1]:n[0]}:void 0}getSelectionRenderState(){return{selectedLines:{range:this.selectedRange,highlightSide:this.selectedRangeHighlightSide,lineNumberOnly:this.selectedRangeLineNumberOnly},editorActiveLine:{range:this.editorActiveLine==null?null:{start:this.editorActiveLine,end:this.editorActiveLine,side:this.editorActiveLineSide},highlightSide:this.editorActiveLineSide,lineNumberOnly:this.editorLineNumberOnly}}}resolveLineRenderRange(e,t,i){if(e.range==null)return;const n=this.getIndexesFromSelection(e.range,t);if(n==null)throw console.error({rowRange:n,range:e.range}),new Error(`InteractionManager.renderSelection: No valid ${i} rowRange`);return n}getLineRenderColumns(e,t,i,n){if(this.pre==null||t==null&&n==null)return[];const{children:r}=this.pre;if(r.length>2)throw console.error(r),new Error("InteractionManager.renderSelection: Somehow there are more than 2 code elements...");const o=[];for(const s of r){const l=s.hasAttribute("data-deletions")?"deletions":s.hasAttribute("data-additions")?"additions":void 0,a=e!=null&&t!=null&&(e.highlightSide==null||l==null||e.highlightSide===l),d=i!=null&&n!=null&&(i.highlightSide==null||l==null||i.highlightSide===l);if(!a&&!d)continue;const[u,c]=s.children;if(!(u instanceof HTMLElement)||!(c instanceof HTMLElement))throw new Error("InteractionManager.renderSelection: missing gutter or content element");if(c.children.length!==u.children.length)throw new Error("InteractionManager.renderSelection: gutter and content children dont match, something is wrong");o.push({content:c,gutter:u,renderEditorActiveLine:d,renderSelectedLines:a})}return o}renderSelection=()=>{vn(this.renderSelection);const e=this.getSelectionRenderState();if(this.pre==null)return;const{editorActiveLine:t,selectedLines:i}=e,n=!Nr(this.renderedSelectedLinesState,i),r=!Nr(this.renderedEditorActiveLineState,t);if(!n&&!r)return;n&&(this.renderedSelectedLinesState=void 0),r&&(this.renderedEditorActiveLineState=void 0);const o=this.pre.getAttribute("data-diff-type")==="split",s=n?this.resolveLineRenderRange(i,o,"selected-lines"):void 0,l=r?this.resolveLineRenderRange(t,o,"editor-active-line"):void 0,a=this.getLineRenderColumns(n?i:void 0,s,r?t:void 0,l),d=i.range==null||a.some(g=>g.renderSelectedLines),u=t.range==null||a.some(g=>g.renderEditorActiveLine);if(n)for(const g of this.pre.querySelectorAll("[data-selected-line]"))g.removeAttribute("data-selected-line");if(r)for(const g of this.pre.querySelectorAll("[data-editor-active-line]"))g.removeAttribute("data-editor-active-line");const c=s==null?void 0:Math.min(s.start,s.end),f=s==null?void 0:Math.max(s.start,s.end),h=c===f,m=l?.start;for(const g of a){const{content:y,gutter:v,renderEditorActiveLine:_,renderSelectedLines:b}=g,L=Math.max(b?f??-1/0:-1/0,_?m??-1/0:-1/0),E=y.children.length;for(let S=0;S<E;S++){const C=y.children[S],x=v.children[S];if(!(C instanceof HTMLElement)||!(x instanceof HTMLElement))continue;const w=this.parseLineIndex(C,o);if((w??0)>L)break;if(w!=null){if(b&&c!=null&&f!=null&&w>=c&&w<=f){let A=h?"single":w===c?"first":w===f?"last":"";x.setAttribute("data-selected-line",A),i.lineNumberOnly||(C.setAttribute("data-selected-line",A),x.nextSibling instanceof HTMLElement&&C.nextSibling instanceof HTMLElement&&(C.nextSibling.hasAttribute("data-line-annotation")||C.nextSibling.hasAttribute("data-merge-conflict-actions"))&&(h?(A="last",C.setAttribute("data-selected-line","first")):w===c?A="":w===f&&C.setAttribute("data-selected-line",""),C.nextSibling.setAttribute("data-selected-line",A),x.nextSibling.setAttribute("data-selected-line",A)))}_&&w===m&&(x.setAttribute("data-editor-active-line",""),t.lineNumberOnly||C.setAttribute("data-editor-active-line",""))}}}n&&d&&(this.renderedSelectedLinesState=i),r&&u&&(this.renderedEditorActiveLineState=t)};notifySelectionCommitted(e){this.options.onLineSelected?.(e)}notifySelectionChangeDelta(){this.options.onLineSelectionChange?.(this.getCurrentSelectionRange()??null)}notifySelectionStart(e){this.options.onLineSelectionStart?.(e)}notifySelectionEnd(e){this.options.onLineSelectionEnd?.(e)}toEventBaseProps(e){return this.mode==="file"?{type:"line",lineElement:e.lineElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn,numberElement:e.numberElement}:{type:"diff-line",annotationSide:e.side,lineType:e.lineType,lineElement:e.lineElement,numberElement:e.numberElement,lineNumber:e.lineNumber,numberColumn:e.numberColumn}}toTokenEventBaseProps({lineCharEnd:e,lineCharStart:t,lineNumber:i,side:n,tokenElement:r,tokenText:o}){return this.mode==="file"?{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:i,tokenElement:r,tokenText:o}:{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:i,side:n,tokenElement:r,tokenText:o}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,i,n){return{start:e,end:t,...i!=null?{side:i}:{},...i!==n&&n!=null?{endSide:n}:{}}}resolvePointerTarget(e){let t=!1,i,n,r,o,s,l,a,d,u,c;for(const h of e){if(!(h instanceof HTMLElement))continue;if(c==null&&h.hasAttribute("data-merge-conflict-action")){const v=h.getAttribute("data-merge-conflict-action")??void 0,_=h.getAttribute("data-merge-conflict-conflict-index")??void 0,b=_!=null?Number.parseInt(_,10):NaN;Yc(v)&&Number.isFinite(b)&&(c={kind:"merge-conflict-action",resolution:v,conflictIndex:b})}if(l==null&&h.hasAttribute("data-char")){l=h;const v=h.getAttribute("data-char");if(v!=null){const _=Number.parseInt(v,10);if(!Number.isNaN(_)){const b=h.textContent??"",L=_+b.length;(b.trim()!==""||this.options.enableTokenInteractionsOnWhitespace===!0)&&(a={tokenElement:l,lineCharStart:_,lineCharEnd:L,tokenText:b});continue}}}const m=s==null?h.getAttribute("data-column-number")??void 0:void 0;if(m!=null){s=h,u=Number.parseInt(m,10),t=!0,i=Vr(h),o=h.getAttribute("data-line-index")??void 0;continue}const g=r==null?h.getAttribute("data-line")??void 0:void 0;if(g!=null){r=h,u=Number.parseInt(g,10),i=Vr(h),o=h.getAttribute("data-line-index")??void 0;continue}if(d==null&&(h.hasAttribute("data-expand-button")||h.hasAttribute("data-unmodified-lines"))){d={hunkIndex:void 0,direction:h.hasAttribute("data-expand-up")?"up":h.hasAttribute("data-expand-down")?"down":"both",all:h.hasAttribute("data-expand-all-button")};continue}const y=d!=null?h.getAttribute("data-expand-index")??void 0:void 0;if(d!=null&&y!=null){const v=Number.parseInt(y,10);Number.isNaN(v)||(d.hunkIndex=v);continue}if(n==null&&h.hasAttribute("data-code")){n=h;break}}if(c!=null)return c;if(d?.hunkIndex!=null)return{type:"line-info",hunkIndex:d.hunkIndex,direction:d.direction,all:d.all};if(r??=o!=null?Mr(n,`[data-line][data-line-index="${o}"]`):void 0,s??=o!=null?Mr(n,`[data-column-number][data-line-index="${o}"]`):void 0,n==null||r==null||s==null||i==null||u==null||Number.isNaN(u))return;const f=this.parseLineIndex(r,this.isSplitDiff());return a!=null?this.mode==="file"?{kind:"token",lineType:i,lineElement:r,lineNumber:u,numberColumn:t,numberElement:s,side:void 0,splitLineIndex:f,...a}:{kind:"token",lineType:i,lineElement:r,lineNumber:u,numberColumn:t,numberElement:s,side:Fr(i,n),splitLineIndex:f,...a}:this.mode==="file"?{kind:"line",lineType:i,lineElement:r,lineNumber:u,numberColumn:t,numberElement:s,side:void 0,splitLineIndex:f}:{kind:"line",lineType:i,lineElement:r,lineNumber:u,numberColumn:t,numberElement:s,side:Fr(i,n),splitLineIndex:f}}isSplitDiff(){return this.pre?.getAttribute("data-diff-type")==="split"}parseLineIndex(e,t){const i=(e.getAttribute("data-line-index")??"").split(",").map(n=>Number.parseInt(n,10)).filter(n=>!Number.isNaN(n));if(t&&i.length===2)return i[1];if(!t)return i[0]}};function Or({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:i,onGutterUtilityClick:n,onLineClick:r,onLineEnter:o,onLineLeave:s,onLineNumberClick:l,onTokenClick:a,onTokenEnter:d,onTokenLeave:u,renderGutterUtility:c,__debugPointerEvents:f,enableLineSelection:h,controlledSelection:m,onLineSelected:g,onLineSelectionStart:y,onLineSelectionChange:v,onLineSelectionEnd:_},b,L,E){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:Jc({enableGutterUtility:t,renderGutterUtility:c,onGutterUtilityClick:n}),usesCustomGutterUtility:c!=null,lineHoverHighlight:i,onGutterUtilityClick:n,onHunkExpand:b,onMergeConflictActionClick:E,onLineClick:r,onLineEnter:o,onLineLeave:s,onLineNumberClick:l,onTokenClick:a,onTokenEnter:d,onTokenLeave:u,__debugPointerEvents:f,enableLineSelection:h,controlledSelection:m,onLineSelected:g,onLineSelectionStart:y,onLineSelectionChange:v,onLineSelectionEnd:_,getLineIndex:L}}function Jc({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:i}){if(i!=null&&t!=null)throw new Error("Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.");return e??!1}function Lt(e){return e!=null&&"kind"in e&&e.kind==="line"}function Zt(e){return e!=null&&"kind"in e&&e.kind==="token"}function Bi(e){return Lt(e)||Zt(e)}function Qc(e){return"type"in e&&e.type==="line-info"}function Zc(e){return"kind"in e&&e.kind==="merge-conflict-action"}function Yc(e){return e==="current"||e==="incoming"||e==="both"}function Mr(e,t){const i=e?.querySelector(t);return i instanceof HTMLElement?i:void 0}function _t(e){const t=[];let i=e;for(;i!=null;)t.push(i),i=i.parentNode;return t}function ef(e){const t=e.closest("[data-line], [data-column-number]");if(t instanceof HTMLElement)return t;const i=e.closest('[data-line-annotation], [data-gutter-buffer="annotation"]');if(!(i instanceof HTMLElement))return;const n=i.previousElementSibling;return n instanceof HTMLElement&&(n.hasAttribute("data-line")||n.hasAttribute("data-column-number"))?n:void 0}function tf(e){const t=e.closest('[slot^="annotation-"]'),i=(t instanceof HTMLElement&&t.assignedSlot!=null?t.assignedSlot:e.tagName==="SLOT"?e:void 0)?.closest("[data-line-annotation]");return i instanceof HTMLElement?i:void 0}function nf(e){const t=e.closest('[slot^="annotation-"]');if(t instanceof HTMLElement)return t.getAttribute("slot")??void 0;if(e instanceof HTMLElement){const i=e.getAttribute("name")??void 0;return i!=null&&i.startsWith("annotation-")?i:void 0}}function rf(e){if(e==null)return;const t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;const i=Number.parseInt(t[2],10);if(!(!Number.isFinite(i)||i<=0))return{lineNumber:i,side:t[1]}}function Hr(e){return e!=null&&typeof e.elementFromPoint=="function"}function of(e,t){return e===t||_n(e??void 0,t??void 0)}function Nr(e,t){return e?.highlightSide===t.highlightSide&&e?.lineNumberOnly===t.lineNumberOnly&&of(e?.range??null,t.range)}function Fr(e,t){switch(e){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return t.hasAttribute("data-deletions")?"deletions":"additions"}}function Vr(e){const t=e.getAttribute("data-line-type");if(t!=null)switch(t){case"change-deletion":case"change-addition":case"context":case"context-expanded":return t;default:return}}function we(e="none",t,...i){switch(e){case"none":return;case"both":break;case"click":if(t!=="click")return;break;case"move":if(t!=="move")return}console.log(...i)}var sf=class xe{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){const t=xe.resizeObserver??new ResizeObserver(xe.handleSharedResizeEntries);return xe.resizeObserver=t,t}static handleSharedResizeEntries(t){const i=new Map;for(const n of t){const r=xe.managersByElement.get(n.target);if(r==null)continue;const o=i.get(r);o==null?i.set(r,[n]):o.push(n)}for(const[n,r]of i)n.handleResizeEntries(r)}observedNodes=new Map;setup(t,{disableAnnotations:i,columnVariables:n="apply"}){const r=new Set,o=n==="apply";let s=0;const l=new Map(this.observedNodes);this.observedNodes.clear();for(const a of t.children){if(s===2)break;const d=(()=>{if(a instanceof HTMLElement&&a.tagName==="CODE")return a})();if(d==null)continue;s++;let u=l.get(d);if(u!=null&&u.type!=="code")throw new Error("ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible");let c=d.firstElementChild;c instanceof HTMLElement||(c=null),u!=null?(this.observedNodes.set(d,u),l.delete(d),u.numberElement!==c?(u.numberElement!=null&&(this.unobserve(u.numberElement),l.delete(u.numberElement)),c!=null&&(this.observe(c),l.delete(c),this.observedNodes.set(c,u)),u.numberElement=c,u.numberWidth=0):u.numberElement!=null?(l.delete(u.numberElement),this.observedNodes.set(u.numberElement,u)):u.numberWidth=0,df(u,o)):(u={type:"code",codeElement:d,numberElement:c,codeWidth:"auto",numberWidth:0,applyColumnVariables:o},this.observedNodes.set(d,u),this.observe(d),c!=null&&(this.observedNodes.set(c,u),this.observe(c)))}if(s>1&&!i){const a=t.querySelectorAll('[data-line-annotation*=","]'),d=new Map;for(const u of a){if(!(u instanceof HTMLElement))continue;const c=u.getAttribute("data-line-annotation")??"";if(!/^-?\d+,-?\d+$/.test(c)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:c,element:u});continue}let f=d.get(c);f==null&&(f=[],d.set(c,f)),f.push(u)}for(const[u,c]of d){if(c.length!==2){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",u,c);continue}const[f,h]=c,m=f.firstElementChild,g=h.firstElementChild;if(!(f instanceof HTMLElement)||!(h instanceof HTMLElement)||!(m instanceof HTMLElement)||!(g instanceof HTMLElement))continue;let y=l.get(m);if(y!=null){this.observedNodes.set(m,y),this.observedNodes.set(g,y),l.delete(m),l.delete(g);continue}const v=m.getBoundingClientRect().height,_=g.getBoundingClientRect().height;y={type:"annotations",column1:{container:f,child:m,childHeight:v},column2:{container:h,child:g,childHeight:_},currentHeight:"auto"},r.add({child1:m,child2:g,item:y,newHeight:Math.max(v,_)})}for(const u of r)this.applyNewHeight(u.item,u.newHeight),this.observedNodes.set(u.child1,u.item),this.observedNodes.set(u.child2,u.item),this.observe(u.child1),this.observe(u.child2);r.clear()}for(const[a,d]of l)this.unobserve(a),d.type==="code"?uf(d):cf(d);l.clear()}cleanUp(){for(const t of this.observedNodes.keys())this.unobserve(t);this.observedNodes.clear()}observe(t){const{managersByElement:i}=xe,n=i.get(t);if(n!==this){if(n!=null&&n!==this)throw new Error("ResizeManager.observe: element is already owned by another ResizeManager");i.set(t,this),xe.getResizeObserver().observe(t)}}unobserve(t){const{managersByElement:i,resizeObserver:n}=xe,r=i.get(t);if(r!=null){if(r!==this)throw new Error("ResizeManager.unobserve: element is owned by another ResizeManager");i.delete(t),n?.unobserve(t),n!=null&&i.size===0&&(n.disconnect(),xe.resizeObserver=void 0)}}handleResizeEntries(t){const i=new Map,n=new Set;for(const r of t){const{target:o,borderBoxSize:s,contentBoxSize:l}=r;if(!(o instanceof HTMLElement)){console.error("ResizeManager.handleResizeEntries: Invalid element for ResizeObserver",r);continue}const a=this.observedNodes.get(o);if(a==null){console.error("ResizeManager.handleResizeEntries: Not a valid observed node",r);continue}if(a.type==="annotations"){const d=(()=>{if(o===a.column1.child)return a.column1;if(o===a.column2.child)return a.column2})();if(d==null){console.error("ResizeManager.handleResizeEntries: Couldn't find a column for",{item:a,target:o});continue}d.childHeight=s[0].blockSize,n.add(a)}else if(a.type==="code"){const d=i.get(a)??{},u=l[0].inlineSize;o===a.codeElement?d.codeInlineSize=u:o===a.numberElement&&(d.numberInlineSize=u),i.set(a,d)}}this.applyAnnotationUpdates(n),n.clear(),this.applyColumnUpdates(i),i.clear()}applyAnnotationUpdates(t){for(const i of t)this.applyNewHeight(i,Math.max(i.column1.childHeight,i.column2.childHeight))}applyColumnUpdates=t=>{for(const[i,n]of t){const r=n.codeInlineSize!=null?af(n.codeInlineSize):i.codeWidth,o=n.numberInlineSize!=null?lf(n.numberInlineSize):i.numberWidth,s=r!==i.codeWidth,l=o!==i.numberWidth;!s&&!l||(i.codeWidth=r,i.numberWidth=o,i.applyColumnVariables&&xs(i,{codeWidthChanged:s,numberWidthChanged:l}))}};applyNewHeight(t,i){i!==t.currentHeight&&(t.currentHeight=Math.max(i,0),t.column1.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`),t.column2.container.style.setProperty("--diffs-annotation-min-height",`${t.currentHeight}px`))}};function af(e){const t=Math.max(Math.floor(e),0);return t===0?"auto":t}function lf(e){return Math.max(Math.ceil(e),0)}function df(e,t){e.applyColumnVariables!==t&&(e.applyColumnVariables=t,t?xs(e,{codeWidthChanged:!0,numberWidthChanged:!0}):As(e))}function xs(e,{codeWidthChanged:t,numberWidthChanged:i}){const{codeElement:n,codeWidth:r,numberWidth:o}=e;if(t&&n.style.setProperty("--diffs-column-width",`${typeof r=="number"?`${r}px`:"auto"}`),i&&n.style.setProperty("--diffs-column-number-width",`${o===0?"auto":`${o}px`}`),t||i&&r!=="auto"){const s=typeof r=="number"?Math.max(r-o,0):0;n.style.setProperty("--diffs-column-content-width",`${s>0?`${s}px`:"auto"}`)}}function As(e){e.codeElement.style.removeProperty("--diffs-column-content-width"),e.codeElement.style.removeProperty("--diffs-column-number-width"),e.codeElement.style.removeProperty("--diffs-column-width")}function uf(e){e.codeElement.isConnected&&As(e)}function cf(e){e.column1.container.isConnected&&e.column1.container.style.removeProperty("--diffs-annotation-min-height"),e.column2.container.isConnected&&e.column2.container.style.removeProperty("--diffs-annotation-min-height")}function Rs(e,t){return e==null||t==null?e===t:e.startingLine===t.startingLine&&e.totalLines===t.totalLines&&e.bufferBefore===t.bufferBefore&&e.bufferAfter===t.bufferAfter}function ff(e,t){return e.endsWith(`\r
157
+ `)?t+`\r
158
+ `:e.endsWith("\r")?t+"\r":e.endsWith(`
159
+ `)?t+`
160
+ `:t}function hf(e){return H({tagName:"div",children:[H({tagName:"div",children:e.annotations?.map(t=>H({tagName:"slot",properties:{name:t}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function pf(e,t){return H({tagName:"div",children:e,properties:{"data-content":"",style:`grid-row: span ${t}`}})}function mf(e){switch(e){case"file":return"diffs-icon-file-code";case"change":return"diffs-icon-symbol-modified";case"new":return"diffs-icon-symbol-added";case"deleted":return"diffs-icon-symbol-deleted";case"rename-pure":case"rename-changed":return"diffs-icon-symbol-moved"}}function gf({fileOrDiff:e,mode:t,stickyHeader:i}){const n="type"in e?e:void 0,r={"data-diffs-header":t,"data-change-type":n?.type,"data-sticky":i?"":void 0};return H({tagName:"div",children:[t==="custom"?H({tagName:"slot",properties:{name:In}}):vf({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:n?.type??"file"}),...t==="custom"?[]:[_f(n)]],properties:r})}function vf({name:e,prevName:t,iconType:i}){const n=[H({tagName:"slot",properties:{name:po}}),si({name:mf(i),properties:{"data-change-icon":i}})];return t!=null&&(n.push(H({tagName:"div",children:[H({tagName:"bdi",children:[be(t)]})],properties:{"data-prev-name":""}})),n.push(si({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),n.push(H({tagName:"div",children:[H({tagName:"bdi",children:[be(e)]})],properties:{"data-title":""}})),n.push(H({tagName:"slot",properties:{name:mo}})),H({tagName:"div",children:n,properties:{"data-header-content":""}})}function _f(e){const t=[];if(e!=null){let i=0,n=0;for(const r of e.hunks)i+=r.additionLines,n+=r.deletionLines;(n>0||i===0)&&t.push(H({tagName:"span",children:[be(`-${n}`)],properties:{"data-deletions-count":""}})),(i>0||n===0)&&t.push(H({tagName:"span",children:[be(`+${i}`)],properties:{"data-additions-count":""}}))}return t.push(H({tagName:"slot",properties:{name:go}})),H({tagName:"div",children:t,properties:{"data-metadata":""}})}function bf(e){return H({tagName:"pre",properties:yf(e)})}function yf({diffIndicators:e,disableBackground:t,disableLineNumbers:i,overflow:n,split:r,totalLines:o,type:s,customProperties:l}){return{...l,"data-diff":s==="diff"?"":void 0,"data-file":s==="file"?"":void 0,"data-diff-type":s==="diff"?r?"split":"single":void 0,"data-overflow":n,"data-disable-line-numbers":i?"":void 0,"data-background":t?void 0:"","data-indicators":e==="bars"||e==="classic"?e:void 0,style:`--diffs-min-number-column-width-default:${`${o}`.length}ch;`}}function Ef(e,{theme:t,preferredHighlighter:i="shiki-js"}){return{langs:Array.isArray(e)?e:[e??"text"],themes:Dn(t),preferredHighlighter:i}}function bn(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}const Sf=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
161
+ <symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
162
+ <path d="M8.47 4.22a.75.75 0 0 0 0 1.06l1.97 1.97H3.75a.75.75 0 0 0 0 1.5h6.69l-1.97 1.97a.75.75 0 1 0 1.06 1.06l3.25-3.25a.75.75 0 0 0 0-1.06L9.53 4.22a.75.75 0 0 0-1.06 0"/>
163
+ </symbol>
164
+ <symbol id="diffs-icon-brand-github" viewBox="0 0 16 16">
165
+ <path d="M8 0c4.42 0 8 3.58 8 8a8.01 8.01 0 0 1-5.45 7.59c-.4.08-.55-.17-.55-.38 0-.27.01-1.13.01-2.2 0-.75-.25-1.23-.54-1.48 1.78-.2 3.65-.88 3.65-3.95 0-.88-.31-1.59-.82-2.15.08-.2.36-1.02-.08-2.12 0 0-.67-.22-2.2.82-.64-.18-1.32-.27-2-.27s-1.36.09-2 .27c-1.53-1.03-2.2-.82-2.2-.82-.44 1.1-.16 1.92-.08 2.12-.51.56-.82 1.28-.82 2.15 0 3.06 1.86 3.75 3.64 3.95-.23.2-.44.55-.51 1.07-.46.21-1.61.55-2.33-.66-.15-.24-.6-.83-1.23-.82-.67.01-.27.38.01.53.34.19.73.9.82 1.13.16.45.68 1.31 2.69.94 0 .67.01 1.3.01 1.49 0 .21-.15.45-.55.38A7.995 7.995 0 0 1 0 8c0-4.42 3.58-8 8-8"/>
166
+ </symbol>
167
+ <symbol id="diffs-icon-chevron" viewBox="0 0 16 16">
168
+ <path d="M1.47 4.47a.75.75 0 0 1 1.06 0L8 9.94l5.47-5.47a.75.75 0 1 1 1.06 1.06l-6 6a.75.75 0 0 1-1.06 0l-6-6a.75.75 0 0 1 0-1.06"/>
169
+ </symbol>
170
+ <symbol id="diffs-icon-chevrons-narrow" viewBox="0 0 10 16">
171
+ <path d="M4.47 2.22a.75.75 0 0 1 1.06 0l3.25 3.25a.75.75 0 0 1-1.06 1.06L5 3.81 2.28 6.53a.75.75 0 0 1-1.06-1.06zM1.22 9.47a.75.75 0 0 1 1.06 0L5 12.19l2.72-2.72a.75.75 0 0 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0l-3.25-3.25a.75.75 0 0 1 0-1.06"/>
172
+ </symbol>
173
+ <symbol id="diffs-icon-diff-split" viewBox="0 0 16 16">
174
+ <path d="M14 0H8.5v16H14a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2m-1.5 6.5v1h1a.5.5 0 0 1 0 1h-1v1a.5.5 0 0 1-1 0v-1h-1a.5.5 0 0 1 0-1h1v-1a.5.5 0 0 1 1 0"/><path d="M2 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h5.5V0zm.5 7.5h3a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1" opacity=".3"/>
175
+ </symbol>
176
+ <symbol id="diffs-icon-diff-unified" viewBox="0 0 16 16">
177
+ <path fill-rule="evenodd" d="M16 14a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V8.5h16zm-8-4a.5.5 0 0 0-.5.5v1h-1a.5.5 0 0 0 0 1h1v1a.5.5 0 0 0 1 0v-1h1a.5.5 0 0 0 0-1h-1v-1A.5.5 0 0 0 8 10" clip-rule="evenodd"/><path fill-rule="evenodd" d="M14 0a2 2 0 0 1 2 2v5.5H0V2a2 2 0 0 1 2-2zM6.5 3.5a.5.5 0 0 0 0 1h3a.5.5 0 0 0 0-1z" clip-rule="evenodd" opacity=".4"/>
178
+ </symbol>
179
+ <symbol id="diffs-icon-expand" viewBox="0 0 16 16">
180
+ <path d="M3.47 5.47a.75.75 0 0 1 1.06 0L8 8.94l3.47-3.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 0 1 0-1.06"/>
181
+ </symbol>
182
+ <symbol id="diffs-icon-expand-all" viewBox="0 0 16 16">
183
+ <path d="M11.47 9.47a.75.75 0 1 1 1.06 1.06l-4 4a.75.75 0 0 1-1.06 0l-4-4a.75.75 0 1 1 1.06-1.06L8 12.94zM7.526 1.418a.75.75 0 0 1 1.004.052l4 4a.75.75 0 1 1-1.06 1.06L8 3.06 4.53 6.53a.75.75 0 1 1-1.06-1.06l4-4z"/>
184
+ </symbol>
185
+ <symbol id="diffs-icon-eye-slash" viewBox="0 0 16 16">
186
+ <path d="m13.47 1.47-12 12 1.06 1.06 12-12zM8 14c-.92 0-1.802-.208-2.624-.547l1.173-1.174c.476.142.963.221 1.451.221 1.66 0 3.307-.949 4.626-2.196a10.4 10.4 0 0 0 1.494-1.751A5 5 0 0 0 14.443 8a5 5 0 0 0-.323-.553 10 10 0 0 0-1.238-1.5l1.061-1.062C15.222 6.173 16 7.511 16 8c0 1.05-3.582 6-8 6"/><path d="M8 11q-.084 0-.167-.005l3.162-3.162q.006.083.005.167a3 3 0 0 1-3 3M5.005 8.167l3.162-3.162a3 3 0 0 0-3.162 3.162"/><path d="M8 3.5c.485 0 .97.081 1.445.227l1.168-1.169C9.794 2.212 8.915 2 8 2 3.582 2 0 6.8 0 8c0 .555.766 1.88 2.027 3.144l1.06-1.06a9.5 9.5 0 0 1-1.203-1.461 4.3 4.3 0 0 1-.345-.617L1.536 8l.003-.006c.064-.149.176-.359.345-.617a9.8 9.8 0 0 1 1.482-1.73C4.675 4.427 6.326 3.5 8 3.5"/>
187
+ </symbol>
188
+ <symbol id="diffs-icon-file-code" viewBox="0 0 16 16">
189
+ <path d="M10.75 0c.199 0 .39.08.53.22l3.5 3.5c.14.14.22.331.22.53v9A2.75 2.75 0 0 1 12.25 16h-8.5A2.75 2.75 0 0 1 1 13.25V2.75A2.75 2.75 0 0 1 3.75 0zm-7 1.5c-.69 0-1.25.56-1.25 1.25v10.5c0 .69.56 1.25 1.25 1.25h8.5c.69 0 1.25-.56 1.25-1.25V5h-1.25A2.25 2.25 0 0 1 10 2.75V1.5z"/><path d="M7.248 6.19a.75.75 0 0 1 .063 1.058L5.753 9l1.558 1.752a.75.75 0 0 1-1.122.996l-2-2.25a.75.75 0 0 1 0-.996l2-2.25a.75.75 0 0 1 1.06-.063M8.69 7.248a.75.75 0 1 1 1.12-.996l2 2.25a.75.75 0 0 1 0 .996l-2 2.25a.75.75 0 1 1-1.12-.996L10.245 9z"/>
190
+ </symbol>
191
+ <symbol id="diffs-icon-plus" viewBox="0 0 16 16">
192
+ <path d="M8 3a.75.75 0 0 1 .75.75v3.5h3.5a.75.75 0 0 1 0 1.5h-3.5v3.5a.75.75 0 0 1-1.5 0v-3.5h-3.5a.75.75 0 0 1 0-1.5h3.5v-3.5A.75.75 0 0 1 8 3"/>
193
+ </symbol>
194
+ <symbol id="diffs-icon-symbol-added" viewBox="0 0 16 16">
195
+ <path d="M8 4a.75.75 0 0 1 .75.75v2.5h2.5a.75.75 0 0 1 0 1.5h-2.5v2.5a.75.75 0 0 1-1.5 0v-2.5h-2.5a.75.75 0 0 1 0-1.5h2.5v-2.5A.75.75 0 0 1 8 4"/><path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/>
196
+ </symbol>
197
+ <symbol id="diffs-icon-symbol-added-duo" viewBox="0 0 16 16">
198
+ <path d="M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8" opacity=".2"/><path d="M8 4a.75.75 0 0 1 .75.75v2.5h2.5a.75.75 0 0 1 0 1.5h-2.5v2.5a.75.75 0 0 1-1.5 0v-2.5h-2.5a.75.75 0 0 1 0-1.5h2.5v-2.5A.75.75 0 0 1 8 4"/>
199
+ </symbol>
200
+ <symbol id="diffs-icon-symbol-added-fill" viewBox="0 0 16 16">
201
+ <path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8m0 4a.75.75 0 0 0-.75.75v2.5h-2.5a.75.75 0 0 0 0 1.5h2.5v2.5a.75.75 0 0 0 1.5 0v-2.5h2.5a.75.75 0 0 0 0-1.5h-2.5v-2.5A.75.75 0 0 0 8 4" clip-rule="evenodd"/>
202
+ </symbol>
203
+ <symbol id="diffs-icon-symbol-deleted" viewBox="0 0 16 16">
204
+ <path d="M4 8a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5A.75.75 0 0 1 4 8"/><path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/>
205
+ </symbol>
206
+ <symbol id="diffs-icon-symbol-deleted-duo" viewBox="0 0 16 16">
207
+ <path d="M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8" opacity=".2"/><path d="M4 8a.75.75 0 0 1 .75-.75h6.5a.75.75 0 0 1 0 1.5h-6.5A.75.75 0 0 1 4 8"/>
208
+ </symbol>
209
+ <symbol id="diffs-icon-symbol-deleted-fill" viewBox="0 0 16 16">
210
+ <path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8M4.75 7.25a.75.75 0 0 0 0 1.5h6.5a.75.75 0 0 0 0-1.5z" clip-rule="evenodd"/>
211
+ </symbol>
212
+ <symbol id="diffs-icon-symbol-diffstat" viewBox="0 0 16 16">
213
+ <path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/><path d="M8.75 4.296a.75.75 0 0 0-1.5 0V6.25h-2a.75.75 0 0 0 0 1.5h2v1.5h1.5v-1.5h2a.75.75 0 0 0 0-1.5h-2zM5.25 10a.75.75 0 0 0 0 1.5h5.5a.75.75 0 0 0 0-1.5z"/>
214
+ </symbol>
215
+ <symbol id="diffs-icon-symbol-diffstat-duo" viewBox="0 0 16 16">
216
+ <path d="M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8" opacity=".2"/><path d="M8.75 4.296a.75.75 0 0 0-1.5 0V6.25h-2a.75.75 0 0 0 0 1.5h2v1.5h1.5v-1.5h2a.75.75 0 0 0 0-1.5h-2zM5.25 10a.75.75 0 0 0 0 1.5h5.5a.75.75 0 0 0 0-1.5z"/>
217
+ </symbol>
218
+ <symbol id="diffs-icon-symbol-diffstat-fill" viewBox="0 0 16 16">
219
+ <path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8M5.25 10a.75.75 0 0 0 0 1.5h5.5a.75.75 0 0 0 0-1.5zM8 3.546a.75.75 0 0 0-.75.75V6.25h-2a.75.75 0 0 0 0 1.5h2v1.5h1.5v-1.5h2a.75.75 0 0 0 0-1.5h-2V4.296a.75.75 0 0 0-.75-.75" clip-rule="evenodd"/>
220
+ </symbol>
221
+ <symbol id="diffs-icon-symbol-extracted" viewBox="0 0 16 16">
222
+ <path d="M8.25 4.25a.75.75 0 0 1 0 1.5H6.81l3.302 3.302a1.5 1.5 0 1 1-1.06 1.06L5.75 6.811V8.25a.75.75 0 0 1-1.5 0V5A.75.75 0 0 1 5 4.25z"/><path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8m0 1.5c-1.613 0-2.807.089-3.704.288-.88.196-1.382.477-1.706.802-.325.324-.606.826-.802 1.706C1.588 5.193 1.5 6.387 1.5 8s.089 2.807.288 3.704c.196.88.477 1.382.802 1.706.324.325.826.606 1.706.802.897.2 2.091.288 3.704.288s2.807-.089 3.704-.288c.88-.196 1.382-.477 1.706-.802.325-.324.606-.826.802-1.706.2-.897.288-2.091.288-3.704s-.089-2.807-.288-3.704c-.196-.88-.477-1.382-.802-1.706-.324-.325-.826-.606-1.706-.802C10.807 1.588 9.613 1.5 8 1.5" clip-rule="evenodd"/>
223
+ </symbol>
224
+ <symbol id="diffs-icon-symbol-extracted-duo" viewBox="0 0 16 16">
225
+ <path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8" clip-rule="evenodd" opacity=".2"/><path d="M8.25 4.25a.75.75 0 0 1 0 1.5H6.81l3.302 3.302a1.5 1.5 0 1 1-1.06 1.06L5.75 6.811V8.25a.75.75 0 0 1-1.5 0V5A.75.75 0 0 1 5 4.25z"/>
226
+ </symbol>
227
+ <symbol id="diffs-icon-symbol-extracted-fill" viewBox="0 0 16 16">
228
+ <path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8M5 4.25a.75.75 0 0 0-.75.75v3.25a.75.75 0 0 0 1.5 0V6.81l3.302 3.302a1.5 1.5 0 1 0 1.06-1.06L6.811 5.75H8.25a.75.75 0 0 0 0-1.5z" clip-rule="evenodd"/>
229
+ </symbol>
230
+ <symbol id="diffs-icon-symbol-ignored" viewBox="0 0 16 16">
231
+ <path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706s.826.607 1.706.802c.898.2 2.091.288 3.704.288s2.806-.088 3.704-.288c.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5s-2.806.088-3.704.288c-.88.196-1.381.478-1.706.802s-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8M0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m11.53-2.47a.75.75 0 0 0-1.06-1.06l-6 6a.75.75 0 1 0 1.06 1.06z"/>
232
+ </symbol>
233
+ <symbol id="diffs-icon-symbol-ignored-duo" viewBox="0 0 16 16">
234
+ <path d="M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8" opacity=".2"/><path d="M11.53 4.47a.75.75 0 0 1 0 1.06l-6 6a.75.75 0 0 1-1.06-1.06l6-6a.75.75 0 0 1 1.06 0"/>
235
+ </symbol>
236
+ <symbol id="diffs-icon-symbol-ignored-fill" viewBox="0 0 16 16">
237
+ <path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8m3.53 4.47a.75.75 0 0 0-1.06 0l-6 6a.75.75 0 1 0 1.06 1.06l6-6a.75.75 0 0 0 0-1.06" clip-rule="evenodd"/>
238
+ </symbol>
239
+ <symbol id="diffs-icon-symbol-inlined" viewBox="0 0 16 16">
240
+ <path d="M7.75 11.75a.75.75 0 0 1 0-1.5h1.44L5.887 6.948a1.5 1.5 0 1 1 1.06-1.06l3.302 3.301V7.75a.75.75 0 0 1 1.5 0V11a.75.75 0 0 1-.75.75z"/><path fill-rule="evenodd" d="M8 16c-6.588 0-8-1.412-8-8s1.412-8 8-8 8 1.412 8 8-1.412 8-8 8m0-1.5c1.613 0 2.807-.089 3.704-.288.88-.196 1.382-.477 1.706-.802.325-.324.606-.826.802-1.706.2-.897.288-2.091.288-3.704s-.089-2.807-.288-3.704c-.196-.88-.477-1.382-.802-1.706-.324-.325-.826-.606-1.706-.802C10.807 1.588 9.613 1.5 8 1.5s-2.807.089-3.704.288c-.88.196-1.382.477-1.706.802-.325.324-.606.826-.802 1.706C1.588 5.193 1.5 6.387 1.5 8s.089 2.807.288 3.704c.196.88.477 1.382.802 1.706.324.325.826.606 1.706.802.897.2 2.091.288 3.704.288" clip-rule="evenodd"/>
241
+ </symbol>
242
+ <symbol id="diffs-icon-symbol-inlined-duo" viewBox="0 0 16 16">
243
+ <path fill-rule="evenodd" d="M8 16c-6.588 0-8-1.412-8-8s1.412-8 8-8 8 1.412 8 8-1.412 8-8 8" clip-rule="evenodd" opacity=".2"/><path d="M7.75 11.75a.75.75 0 0 1 0-1.5h1.44L5.887 6.948a1.5 1.5 0 1 1 1.06-1.06l3.302 3.301V7.75a.75.75 0 0 1 1.5 0V11a.75.75 0 0 1-.75.75z"/>
244
+ </symbol>
245
+ <symbol id="diffs-icon-symbol-inlined-fill" viewBox="0 0 16 16">
246
+ <path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8M5.5 4a1.5 1.5 0 1 0 .388 2.948l3.301 3.302H7.75a.75.75 0 0 0 0 1.5H11a.75.75 0 0 0 .75-.75V7.75a.75.75 0 0 0-1.5 0v1.44L6.948 5.887A1.5 1.5 0 0 0 5.5 4" clip-rule="evenodd"/>
247
+ </symbol>
248
+ <symbol id="diffs-icon-symbol-modified" viewBox="0 0 16 16">
249
+ <path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706s.826.607 1.706.802c.898.2 2.091.288 3.704.288s2.806-.088 3.704-.288c.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5s-2.806.088-3.704.288c-.88.196-1.381.478-1.706.802s-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8M0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m8 3a3 3 0 1 0 0-6 3 3 0 0 0 0 6"/>
250
+ </symbol>
251
+ <symbol id="diffs-icon-symbol-modified-duo" viewBox="0 0 16 16">
252
+ <path d="M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8" opacity=".2"/><path d="M11 8a3 3 0 1 1-6 0 3 3 0 0 1 6 0"/>
253
+ </symbol>
254
+ <symbol id="diffs-icon-symbol-modified-fill" viewBox="0 0 16 16">
255
+ <path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8m0 5a3 3 0 1 0 0 6 3 3 0 0 0 0-6" clip-rule="evenodd"/>
256
+ </symbol>
257
+ <symbol id="diffs-icon-symbol-moved" viewBox="0 0 16 16">
258
+ <path d="M1.788 4.296c.196-.88.478-1.381.802-1.706s.826-.606 1.706-.802C5.194 1.588 6.387 1.5 8 1.5s2.806.088 3.704.288c.88.196 1.381.478 1.706.802s.607.826.802 1.706c.2.898.288 2.091.288 3.704s-.088 2.806-.288 3.704c-.195.88-.478 1.381-.802 1.706s-.826.607-1.706.802c-.898.2-2.091.288-3.704.288s-2.806-.088-3.704-.288c-.88-.195-1.381-.478-1.706-.802s-.606-.826-.802-1.706C1.588 10.806 1.5 9.613 1.5 8s.088-2.806.288-3.704M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8"/><path d="M8.495 4.695a.75.75 0 0 0-.05 1.06L10.486 8l-2.041 2.246a.75.75 0 0 0 1.11 1.008l2.5-2.75a.75.75 0 0 0 0-1.008l-2.5-2.75a.75.75 0 0 0-1.06-.051m-4 0a.75.75 0 0 0-.05 1.06l2.044 2.248-1.796 1.995a.75.75 0 0 0 1.114 1.004l2.25-2.5a.75.75 0 0 0-.002-1.007l-2.5-2.75a.75.75 0 0 0-1.06-.05"/>
259
+ </symbol>
260
+ <symbol id="diffs-icon-symbol-moved-duo" viewBox="0 0 16 16">
261
+ <path d="M8 0C1.412 0 0 1.412 0 8s1.412 8 8 8 8-1.412 8-8-1.412-8-8-8" opacity=".2"/><path d="M8.496 4.695a.75.75 0 0 0-.051 1.06L10.486 8l-2.041 2.246a.75.75 0 0 0 1.11 1.008l2.5-2.75a.75.75 0 0 0 0-1.008l-2.5-2.75a.75.75 0 0 0-1.06-.051m-4 0a.75.75 0 0 0-.051 1.06L6.49 8.003 4.693 9.998a.75.75 0 0 0 1.114 1.004l2.25-2.5a.75.75 0 0 0-.002-1.007l-2.5-2.75a.75.75 0 0 0-1.06-.05"/>
262
+ </symbol>
263
+ <symbol id="diffs-icon-symbol-moved-fill" viewBox="0 0 16 16">
264
+ <path fill-rule="evenodd" d="M8 0c6.588 0 8 1.412 8 8s-1.412 8-8 8-8-1.412-8-8 1.412-8 8-8m1.555 4.745a.75.75 0 0 0-1.11 1.01L10.486 8l-2.04 2.245a.75.75 0 0 0 1.109 1.01l2.5-2.75a.75.75 0 0 0 0-1.01zm-4 0a.75.75 0 0 0-1.11 1.01l2.043 2.248-1.796 1.995a.75.75 0 0 0 1.116 1.004l2.25-2.5a.75.75 0 0 0-.003-1.007z" clip-rule="evenodd"/>
265
+ </symbol>
266
+ <symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
267
+ <path d="M1.5 8c0 1.613.088 2.806.288 3.704.196.88.478 1.381.802 1.706.286.286.71.54 1.41.73V1.86c-.7.19-1.124.444-1.41.73-.324.325-.606.826-.802 1.706C1.588 5.194 1.5 6.387 1.5 8m4 6.397c.697.07 1.522.103 2.5.103 1.613 0 2.806-.088 3.704-.288.88-.195 1.381-.478 1.706-.802s.607-.826.802-1.706c.2-.898.288-2.091.288-3.704s-.088-2.806-.288-3.704c-.195-.88-.478-1.381-.802-1.706s-.826-.606-1.706-.802C10.806 1.588 9.613 1.5 8 1.5c-.978 0-1.803.033-2.5.103zM0 8c0-6.588 1.412-8 8-8s8 1.412 8 8-1.412 8-8 8-8-1.412-8-8m7-2a1 1 0 0 1 1-1h3a1 1 0 0 1 1 1v1a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1z"/>
268
+ </symbol>
269
+ </svg>`;function Lf(e,t){return e==null||t==null?e===t:Cf(e.customProperties,t.customProperties)&&e.type===t.type&&e.diffIndicators===t.diffIndicators&&e.disableBackground===t.disableBackground&&e.disableLineNumbers===t.disableLineNumbers&&e.overflow===t.overflow&&e.split===t.split&&e.totalLines===t.totalLines}const $r={};function Cf(e=$r,t=$r){if(e===t)return!0;const i=Object.keys(e),n=Object.keys(t);if(i.length!==n.length)return!1;for(const r of i)if(e[r]!==t[r])return!1;return!0}function wf(e){const t=document.createElement("div");return t.dataset.annotationSlot="",t.slot=e,t.style.whiteSpace="normal",t}function kf(){const e=document.createElement("div");return e.slot="gutter-utility-slot",e.style.position="absolute",e.style.top="0",e.style.bottom="0",e.style.textAlign="center",e.style.whiteSpace="normal",e.style.touchAction="none",e}function xf(){const e=document.createElement("style");return e.setAttribute(da,""),e}let zt;function yn(e){if(zt!=null)return zt;const t=e.host;if(typeof HTMLElement<"u"&&t instanceof HTMLElement&&!t.isConnected)return;const i=document.createElement("div");i.setAttribute("data-code",""),i.setAttribute(ua,"true");const n=document.createElement("div");return n.style.position="relative",n.style.width="200%",n.style.height="200%",i.appendChild(n),e.appendChild(i),zt=Math.max(i.offsetHeight-i.clientHeight,0),i.remove(),zt}function Ts(e){const t=e==null?"var(--diffs-scrollbar-gutter-fallback)":`${e}px`;return`${vo}: ${t};`}var Af=`@layer base,theme,rendered,unsafe;@layer base{:host{--diffs-font-fallback:"SF Mono", Monaco, Consolas, "Ubuntu Mono", "Liberation Mono", "Courier New", monospace;--diffs-header-font-fallback:system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif;--diffs-mixer:light-dark(#000,#fff);--diffs-gap-fallback:8px;--diffs-scrollbar-gutter-fallback:6px;--diffs-scrollbar-gutter:var(--diffs-scrollbar-gutter-override,var(--diffs-scrollbar-gutter-measured,var(--diffs-scrollbar-gutter-fallback)));--diffs-added-light:#0dbe4e;--diffs-added-dark:#5ecc71;--diffs-modified-light:#009fff;--diffs-modified-dark:#69b1ff;--diffs-deleted-light:#ff2e3f;--diffs-deleted-dark:#ff6762;--diffs-warning-light:#d5a910;--diffs-warning-dark:#ffd452;color-scheme:light dark;font-family:var(--diffs-header-font-family,var(--diffs-header-font-fallback));font-size:var(--diffs-font-size,13px);line-height:var(--diffs-line-height,20px);font-feature-settings:var(--diffs-font-features);--diffs-bg:light-dark(var(--diffs-light-bg,#fff),var(--diffs-dark-bg,#000));--diffs-bg-buffer:var(--diffs-bg-buffer-override,light-dark(color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer)),color-mix(in lab, var(--diffs-bg) 92%, var(--diffs-mixer))));--diffs-bg-context:var(--diffs-bg-context-override,light-dark(color-mix(in lab, var(--diffs-bg) 98.5%, var(--diffs-mixer)),color-mix(in lab, var(--diffs-bg) 92.5%, var(--diffs-mixer))));--diffs-bg-context-gutter:var(--diffs-bg-context-gutter-override,light-dark(color-mix(in lab, var(--diffs-bg-context) 90%, var(--diffs-bg)),color-mix(in lab, var(--diffs-bg-context) 45%, var(--diffs-bg))));--diffs-bg-separator:var(--diffs-bg-separator-override,light-dark(color-mix(in lab, var(--diffs-bg) 96%, var(--diffs-mixer)),color-mix(in lab, var(--diffs-bg) 85%, var(--diffs-mixer))));--diffs-fg:light-dark(var(--diffs-light,#000),var(--diffs-dark,#fff));--diffs-fg-number:var(--diffs-fg-number-override,light-dark(color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg)),color-mix(in lab, var(--diffs-fg) 65%, var(--diffs-bg))));--diffs-fg-conflict-marker:var(--diffs-fg-conflict-marker-override,var(--diffs-fg-number));--diffs-deletion-base:var(--diffs-deletion-color-override,light-dark(var(--diffs-light-deletion-color,var(--diffs-deletion-color,var(--diffs-deleted-light))),var(--diffs-dark-deletion-color,var(--diffs-deletion-color,var(--diffs-deleted-dark)))));--diffs-addition-base:var(--diffs-addition-color-override,light-dark(var(--diffs-light-addition-color,var(--diffs-addition-color,var(--diffs-added-light))),var(--diffs-dark-addition-color,var(--diffs-addition-color,var(--diffs-added-dark)))));--diffs-modified-base:var(--diffs-modified-color-override,light-dark(var(--diffs-light-modified-color,var(--diffs-modified-color,var(--diffs-modified-light))),var(--diffs-dark-modified-color,var(--diffs-modified-color,var(--diffs-modified-dark)))));--diffs-bg-deletion:var(--diffs-bg-deletion-override,light-dark(color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-deletion-base)),color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-deletion-base))));--diffs-bg-deletion-emphasis:var(--diffs-bg-deletion-emphasis-override,light-dark(rgb(from var(--diffs-deletion-base) r g b / .15),rgb(from var(--diffs-deletion-base) r g b / .2)));--diffs-bg-addition:var(--diffs-bg-addition-override,light-dark(color-mix(in lab, var(--diffs-bg) 88%, var(--diffs-addition-base)),color-mix(in lab, var(--diffs-bg) 80%, var(--diffs-addition-base))));--diffs-bg-addition-emphasis:var(--diffs-bg-addition-emphasis-override,light-dark(rgb(from var(--diffs-addition-base) r g b / .15),rgb(from var(--diffs-addition-base) r g b / .2)));--diffs-selection-base:var(--diffs-modified-base);--diffs-selection-number-fg:light-dark(color-mix(in lab, var(--diffs-selection-base) 65%, var(--diffs-mixer)),color-mix(in lab, var(--diffs-selection-base) 75%, var(--diffs-mixer)));background-color:var(--diffs-bg);color:var(--diffs-fg);display:block}pre,code,[data-error-wrapper]{isolation:isolate;font-family:var(--diffs-font-family,var(--diffs-font-fallback));outline:none;margin:0;padding:0;display:block}pre,code{background-color:var(--diffs-bg)}code{contain:content}input,button{font-family:inherit;font-size:inherit;line-height:inherit}*,:before,:after{box-sizing:border-box}[data-icon-sprite]{display:none}[data-diffs-header],[data-separator]{font-family:var(--diffs-header-font-family,var(--diffs-header-font-fallback))}[data-diffs-header][data-sticky]{z-index:1;background-color:var(--diffs-bg);position:sticky;top:0}[data-file-info]{color:var(--fg);background-color:color-mix(in lab, var(--bg) 98%, var(--fg));border-block:1px solid color-mix(in lab, var(--bg) 95%, var(--fg));padding:10px;font-weight:700}[data-diff],[data-file]{--diffs-grid-number-column-width:minmax(min-content, max-content);--diffs-code-grid:var(--diffs-grid-number-column-width) 1fr;&[data-dehydrated]{--diffs-code-grid:var(--diffs-grid-number-column-width) minmax(0, 1fr)}&:hover [data-code]::-webkit-scrollbar-thumb{background-color:var(--diffs-bg-context)}}@supports (-webkit-touch-callout:none){:host{--diffs-scrollbar-gutter-fallback:0px}}[data-line] span,[data-edit-prediction-suffix] span{color:light-dark(var(--diffs-token-light,var(--diffs-light)),var(--diffs-token-dark,var(--diffs-dark)));background-color:light-dark(var(--diffs-token-light-bg,inherit),var(--diffs-token-dark-bg,inherit));font-weight:light-dark(var(--diffs-token-light-font-weight,inherit),var(--diffs-token-dark-font-weight,inherit));font-style:light-dark(var(--diffs-token-light-font-style,inherit),var(--diffs-token-dark-font-style,inherit));text-decoration:light-dark(var(--diffs-token-light-text-decoration,inherit),var(--diffs-token-dark-text-decoration,inherit))}[data-line],[data-gutter-buffer],[data-column-number],[data-line-annotation],[data-no-newline],[data-merge-conflict],[data-merge-conflict-actions],[data-editor-overlay]{--diffs-computed-decoration-bg:var(--diffs-bg);--diffs-computed-diff-line-bg:var(--diffs-computed-decoration-bg);--diffs-computed-selected-line-bg:var(--diffs-computed-diff-line-bg);--diffs-computed-editor-active-line-bg:var(--diffs-computed-selected-line-bg);--diffs-computed-hovered-line-bg:var(--diffs-computed-editor-active-line-bg);--diffs-hover-mix-target:var(--diffs-bg-hover-override,var(--diffs-mixer));--diffs-line-bg:var(--diffs-computed-hovered-line-bg);color:var(--diffs-fg);background-color:var(--diffs-line-bg,var(--diffs-bg))}[data-line],[data-no-newline]{&[data-decoration-bg]{--mix-deco-light:92%;--mix-deco-dark:85%;&[data-decoration-bg-depth="2"]{--mix-deco-light:88%;--mix-deco-dark:80%}&[data-decoration-bg-depth="3"]{--mix-deco-light:85%;--mix-deco-dark:78%}--diffs-hover-mix-target:var(--diffs-decoration-bg);--diffs-computed-decoration-bg:light-dark(color-mix(in lab, var(--diffs-bg) var(--mix-deco-light), var(--diffs-decoration-bg)),color-mix(in lab, var(--diffs-bg) var(--mix-deco-dark), var(--diffs-decoration-bg)))}}[data-line-annotation],[data-gutter-buffer=annotation]{--diffs-annotation-bg:var(--diffs-bg-context);--diffs-computed-decoration-bg:var(--diffs-annotation-bg);--diffs-hover-mix-target:var(--diffs-computed-editor-active-line-bg)}[data-merge-conflict-actions],[data-gutter-buffer=merge-conflict-action],[data-gutter-buffer=merge-conflict-marker-base],[data-gutter-buffer=merge-conflict-marker-separator],[data-merge-conflict=marker-base],[data-merge-conflict=marker-separator]{--diffs-computed-decoration-bg:var(--diffs-bg-context);--diffs-hover-mix-target:var(--diffs-computed-editor-active-line-bg)}[data-gutter-buffer=merge-conflict-marker-start],[data-merge-conflict=marker-start]{--diffs-computed-decoration-bg:light-dark(color-mix(in lab, var(--diffs-bg) 78%, var(--conflict-bg-current-header-override,var(--diffs-addition-base))),color-mix(in lab, var(--diffs-bg) 68%, var(--conflict-bg-current-header-override,var(--diffs-addition-base))));--diffs-hover-mix-target:var(--diffs-computed-editor-active-line-bg)}[data-gutter-buffer=merge-conflict-marker-end],[data-merge-conflict=marker-end]{--diffs-computed-decoration-bg:light-dark(color-mix(in lab, var(--diffs-bg) 78%, var(--conflict-bg-incoming-header-override,var(--diffs-modified-base))),color-mix(in lab, var(--diffs-bg) 68%, var(--conflict-bg-incoming-header-override,var(--diffs-modified-base))));--diffs-hover-mix-target:var(--diffs-computed-editor-active-line-bg)}[data-has-merge-conflict] [data-line-annotation],[data-has-merge-conflict] [data-gutter-buffer=annotation]{--diffs-computed-decoration-bg:var(--diffs-bg);--diffs-hover-mix-target:var(--diffs-computed-editor-active-line-bg)}:where([data-background]){& [data-gutter-buffer],& [data-column-number]{--mix-light:91%;--mix-dark:85%}& [data-line],& [data-no-newline]{--mix-light:88%;--mix-dark:80%}& [data-gutter-buffer],& [data-column-number],& [data-line],& [data-no-newline]{--diffs-diff-line-mix-target:var(--diffs-bg);&[data-line-type=change-deletion]{--diffs-diff-line-mix-target:var(--diffs-bg-deletion-override,var(--diffs-deletion-base));--diffs-hover-mix-target:var(--diffs-diff-line-mix-target);&:where([data-gutter-buffer],[data-column-number]){color:var(--diffs-fg-number-deletion-override,var(--diffs-deletion-base));--diffs-diff-line-mix-target:var(--diffs-bg-deletion-number-override,var(--diffs-deletion-base))}--diffs-computed-diff-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-light), var(--diffs-diff-line-mix-target)),color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-dark), var(--diffs-diff-line-mix-target)))}&[data-line-type=change-addition]{--diffs-diff-line-mix-target:var(--diffs-bg-addition-override,var(--diffs-addition-base));--diffs-hover-mix-target:var(--diffs-diff-line-mix-target);&:where([data-gutter-buffer],[data-column-number]){color:var(--diffs-fg-number-addition-override,var(--diffs-addition-base));--diffs-diff-line-mix-target:var(--diffs-bg-addition-number-override,var(--diffs-addition-base))}--diffs-computed-diff-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-light), var(--diffs-diff-line-mix-target)),color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-dark), var(--diffs-diff-line-mix-target)))}&[data-merge-conflict=current]{--diffs-diff-line-mix-target:var(--conflict-bg-current-override,var(--diffs-addition-base));--diffs-hover-mix-target:var(--diffs-diff-line-mix-target);&:where([data-gutter-buffer],[data-column-number]){color:var(--diffs-fg-number-addition-override,var(--diffs-addition-base));--diffs-diff-line-mix-target:var(--conflict-bg-current-number-override,var(--diffs-addition-base))}--diffs-computed-diff-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-light), var(--diffs-diff-line-mix-target)),color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-dark), var(--diffs-diff-line-mix-target)))}&[data-merge-conflict=incoming]{--diffs-diff-line-mix-target:var(--conflict-bg-incoming-override,var(--diffs-modified-base));--diffs-hover-mix-target:var(--diffs-diff-line-mix-target);&:where([data-gutter-buffer],[data-column-number]){color:var(--diffs-modified-base);--diffs-diff-line-mix-target:var(--conflict-bg-incoming-number-override,var(--diffs-modified-base))}--diffs-computed-diff-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-light), var(--diffs-diff-line-mix-target)),color-mix(in lab, var(--diffs-computed-decoration-bg) var(--mix-dark), var(--diffs-diff-line-mix-target)))}}}[data-gutter-buffer],[data-column-number],[data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline],[data-editor-overlay]{--diffs-selection-mix-target:var(--diffs-bg-selection-override,var(--diffs-selection-base));--diffs-selection-emphasis-mix-target:var(--diffs-selection-mix-target);&:where([data-editor-overlay]),&:where([data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline])[data-selected-line]{--mix-selection-light:82%;--mix-selection-dark:75%;--diffs-hover-mix-target:var(--diffs-selection-mix-target)}&:where([data-gutter-buffer][data-selected-line],[data-column-number]:is([data-selected-line],[data-editor-active-line])){--mix-selection-light:75%;--mix-selection-dark:60%;--diffs-selection-mix-target:var(--diffs-bg-selection-number-override,var(--diffs-selection-base));--diffs-hover-mix-target:var(--diffs-selection-mix-target)}&:where([data-line][data-selected-line]):is([data-line-type=change-addition],[data-line-type=change-deletion]){--diffs-selection-emphasis-mix-target:light-dark(color-mix(in lab, var(--diffs-diff-line-mix-target,var(--diffs-selection-mix-target)) var(--mix-selection-light), var(--diffs-selection-mix-target)),var(--diffs-selection-mix-target))}&:where([data-editor-overlay]),&[data-selected-line]{--diffs-computed-selected-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-diff-line-bg) var(--mix-selection-light), var(--diffs-selection-mix-target)),color-mix(in lab, var(--diffs-computed-diff-line-bg) var(--mix-selection-dark), var(--diffs-selection-mix-target)))}}[data-line][data-editor-active-line],[data-column-number][data-editor-active-line]{--diffs-computed-editor-active-line-bg:color-mix(in lab, var(--diffs-computed-selected-line-bg) var(--diffs-editor-active-line-source-mix,100%), var(--diffs-selection-emphasis-mix-target))}@media (pointer:fine){[data-line][data-hovered],[data-gutter-buffer][data-hovered],[data-column-number][data-hovered],[data-line-annotation][data-hovered],[data-no-newline][data-hovered],[data-merge-conflict][data-hovered],[data-merge-conflict-actions][data-hovered],[data-editor-overlay][data-hovered]{--diffs-computed-hovered-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-editor-active-line-bg) 97%, var(--diffs-hover-mix-target)),color-mix(in lab, var(--diffs-computed-editor-active-line-bg) 91%, var(--diffs-hover-mix-target)))}}[data-gutter-buffer][data-selected-line],[data-column-number]:is([data-selected-line],[data-editor-active-line]){color:var(--diffs-selection-number-fg)}[data-no-newline]{user-select:none;& span{opacity:.6}}[data-diff-type=split][data-overflow=scroll]{grid-template-columns:1fr 1fr;display:grid;& [data-additions]{border-left:1px solid var(--diffs-bg)}& [data-deletions]{border-right:1px solid var(--diffs-bg)}}[data-code]{grid-auto-flow:dense;grid-template-columns:var(--diffs-code-grid);overflow:var(--diffs-overflow-override,scroll) clip;overscroll-behavior-x:none;tab-size:var(--diffs-tab-size,2);padding-top:var(--diffs-gap-block,var(--diffs-gap-fallback));padding-bottom:max(0px, calc(var(--diffs-gap-block,var(--diffs-gap-fallback)) - var(--diffs-scrollbar-gutter)));scrollbar-gutter:stable;align-self:flex-start;display:grid}[data-diffs-scrollbar-measure]{opacity:0;pointer-events:none;scrollbar-gutter:auto;grid-template-columns:none;width:100px;height:100px;padding:0;position:absolute;top:-200px;left:-200px}[data-container-size]{container-type:inline-size}[data-code]::-webkit-scrollbar{width:0;height:var(--diffs-scrollbar-gutter)}[data-code]::-webkit-scrollbar-track{background:0 0}[data-code]::-webkit-scrollbar-thumb{background-color:#0000;background-clip:content-box;border:1px solid #0000;border-radius:3px}[data-code]::-webkit-scrollbar-corner{background-color:#0000}@supports ((-moz-appearance:none)){[data-code]{scrollbar-width:thin;scrollbar-color:var(--diffs-bg-context) transparent;padding-bottom:var(--diffs-gap-block,var(--diffs-gap-fallback))}}[data-diffs-header]~[data-diff],[data-diffs-header]~[data-file]{& [data-code],&[data-overflow=wrap],&[data-dehydrated][data-diff-type=split][data-overflow=scroll]{padding-top:0}}[data-gutter]{grid-template-rows:subgrid;grid-template-columns:subgrid;z-index:3;background-color:var(--diffs-bg);grid-column:1;display:grid;position:relative;& [data-gutter-buffer],& [data-column-number]{border-right:var(--diffs-gap-style,2px solid var(--diffs-bg))}}[data-content]{grid-template-rows:subgrid;grid-template-columns:subgrid;background-color:var(--diffs-bg);grid-column:2;min-width:0;display:grid}[data-diff-type=split][data-overflow=wrap],[data-dehydrated][data-diff-type=split][data-overflow=scroll]{grid-auto-flow:dense;grid-template-columns:repeat(2, var(--diffs-code-grid));padding-block:var(--diffs-gap-block,var(--diffs-gap-fallback));display:grid;& [data-code]{display:contents}& [data-deletions]{& [data-gutter]{grid-column:1}& [data-content]{border-right:1px solid var(--diffs-bg);grid-column:2}}& [data-additions]{& [data-gutter]{border-left:1px solid var(--diffs-bg);grid-column:3}& [data-content]{grid-column:4}}}[data-dehydrated][data-diff-type=split][data-overflow=scroll] [data-content]{overflow:clip}[data-overflow=scroll] [data-gutter]{position:sticky;left:0}[data-interactive-lines] [data-line]{cursor:pointer}[data-interactive-line-numbers] [data-column-number]{cursor:pointer;touch-action:none}[data-content-buffer],[data-gutter-buffer]{user-select:none;min-height:1lh;position:relative}[data-gutter-buffer]{padding-left:2ch;padding-right:1ch;&:before{content:"";min-width:var(--diffs-min-number-column-width,var(--diffs-min-number-column-width-default,3ch));display:block}}[data-gutter-buffer=annotation]{--diffs-annotation-bg:var(--diffs-bg-context-gutter);min-height:0}[data-gutter-buffer=buffer]{--diffs-line-bg:var(--diffs-bg-context-gutter)}[data-content-buffer]{background-position:5px 0;background-size:8px 8px;background-origin:border-box;background-image:repeating-linear-gradient(-45deg, transparent, transparent calc(3px * 1.414), var(--diffs-bg-buffer) calc(3px * 1.414), var(--diffs-bg-buffer) calc(4px * 1.414));grid-column:1}[data-separator]{box-sizing:content-box;background-color:var(--diffs-bg)}[data-separator=simple]{min-height:4px}[data-separator=line-info],[data-separator=line-info-basic],[data-separator=metadata],[data-separator=simple]{background-color:var(--diffs-bg-separator)}[data-separator=line-info],[data-separator=line-info-basic],[data-separator=metadata]{height:32px;position:relative}[data-separator-wrapper]{user-select:none;fill:currentColor;background-color:var(--diffs-bg);align-items:center;height:100%;display:flex;position:absolute;inset-inline:0}[data-content] [data-separator-wrapper]{display:none}[data-separator=metadata] [data-separator-wrapper]{background-color:var(--diffs-bg-separator);height:100%;color:var(--diffs-fg-number);white-space:nowrap;text-overflow:ellipsis;min-width:min-content;padding-inline:1ch;inset-inline:100% auto;overflow:hidden}[data-separator=line-info]{margin-block:var(--diffs-gap-block,var(--diffs-gap-fallback));& [data-separator-wrapper]{min-width:16px}}[data-separator=line-info-basic],[data-separator=metadata]{margin-block:0}[data-separator=line-info][data-separator-first]{margin-top:0}[data-separator=line-info][data-separator-last]{margin-bottom:0}[data-expand-index] [data-separator-wrapper]{grid-template-columns:32px auto;display:grid}[data-expand-index] [data-separator-wrapper][data-separator-multi-button]{grid-template-columns:32px 32px auto}[data-expand-button],[data-separator-content]{background-color:var(--diffs-bg-separator);flex:none;align-items:center;display:flex}[data-expand-index] [data-separator-content]:hover{cursor:pointer;text-decoration:underline}[data-expand-button]{cursor:pointer;min-width:32px;color:var(--diffs-fg-number);border-right:2px solid var(--diffs-bg);flex-shrink:0;justify-content:center;align-self:stretch;&:hover{color:var(--diffs-fg)}&[data-expand-all-button]{display:none}}[data-expand-down] [data-icon]{transform:scaleY(-1)}[data-separator-content]{height:100%;color:var(--diffs-fg-number);flex:auto;justify-content:flex-start;padding:0 1ch;overflow:hidden}[data-separator=line-info],[data-separator=line-info-basic]{& [data-separator-content]{user-select:none;height:100%;overflow:clip}}[data-unmodified-lines]{text-overflow:ellipsis;white-space:nowrap;flex:0 auto;min-width:0;display:block;overflow:hidden}@supports (width:1cqi){[data-unified]{& [data-separator=line-info] [data-separator-wrapper]{padding-inline:var(--diffs-gap-inline,var(--diffs-gap-fallback));width:100cqi;& [data-separator-content]{border-radius:6px}}& [data-separator=line-info][data-expand-index] [data-separator-wrapper] [data-separator-content]{border-top-left-radius:unset;border-bottom-left-radius:unset}}[data-gutter]{& [data-separator=line-info] [data-separator-wrapper]{padding-left:var(--diffs-gap-inline,var(--diffs-gap-fallback))}& [data-separator=line-info] [data-separator-content]{border-top-left-radius:6px;border-bottom-left-radius:6px}& [data-separator=line-info][data-expand-index] [data-separator-content]{border-top-left-radius:unset;border-bottom-left-radius:unset}}[data-additions]{& [data-content] [data-separator=line-info]{background-color:var(--diffs-bg);& [data-separator-wrapper]{display:none}}& [data-gutter] [data-separator=line-info] [data-separator-wrapper]{background-color:var(--diffs-bg-separator);border-top-right-radius:6px;border-bottom-right-radius:6px;height:100%;display:block;& [data-separator-content],& [data-expand-button]{display:none}}}[data-overflow=scroll] [data-additions] [data-gutter] [data-separator=line-info] [data-separator-wrapper]{width:calc(100cqi - var(--diffs-gap-inline,var(--diffs-gap-fallback)))}[data-overflow=wrap] [data-additions] [data-content] [data-separator=line-info] [data-separator-wrapper]{background-color:var(--diffs-bg-separator);height:100%;margin-right:var(--diffs-gap-inline,var(--diffs-gap-fallback));border-top-right-radius:6px;border-bottom-right-radius:6px;display:block;& [data-separator-content],& [data-expand-button]{display:none}}[data-separator=line-info] [data-separator-wrapper]{& [data-expand-both],& [data-expand-down],& [data-expand-up]{border-top-left-radius:6px;border-bottom-left-radius:6px}}@media (pointer:fine){[data-separator=line-info] [data-separator-wrapper]{&[data-separator-multi-button]{& [data-expand-up]{border-top-left-radius:6px;border-bottom-left-radius:unset}& [data-expand-down]{border-bottom-left-radius:6px;border-top-left-radius:unset}}}}}@media (pointer:coarse){[data-separator=line-info-basic] [data-separator-wrapper][data-separator-multi-button]{grid-template-columns:34px 34px auto;& [data-separator-content]{grid-column:unset;grid-row:unset}}@supports (width:1cqi){[data-separator=line-info] [data-separator-wrapper]{& [data-expand-both],& [data-expand-down],& [data-expand-up]{border-top-left-radius:6px;border-bottom-left-radius:6px}&[data-separator-multi-button]{& [data-expand-up]{border-top-left-radius:6px;border-bottom-left-radius:6px}& [data-expand-down]{border-bottom-left-radius:unset;border-top-left-radius:unset}}}}}@media (pointer:fine){[data-separator-wrapper][data-separator-multi-button]{grid-template-rows:50% 50%;display:grid;& [data-separator-content]{grid-area:1/2/-1;min-width:min-content}& [data-expand-button]{grid-column:1}}[data-separator=line-info] [data-separator-wrapper],[data-separator=line-info] [data-separator-wrapper][data-separator-multi-button]{grid-template-columns:34px auto}[data-separator=line-info-basic][data-expand-index] [data-separator-wrapper]{grid-template-columns:100% auto}[data-separator=line-info],[data-separator=line-info-basic]{& [data-separator-multi-button]{& [data-expand-up]{border-bottom:1px solid var(--diffs-bg);border-right:2px solid var(--diffs-bg)}& [data-expand-down]{border-top:1px solid var(--diffs-bg);border-right:2px solid var(--diffs-bg)}}}}[data-additions] [data-gutter] [data-separator-wrapper],[data-additions] [data-separator=line-info-basic] [data-separator-wrapper],[data-content] [data-separator-wrapper]{display:none}[data-line-annotation]{min-height:var(--diffs-annotation-min-height,0);z-index:2}[data-merge-conflict-actions]{z-index:2}[data-separator=custom]{grid-template-columns:subgrid;display:grid}[data-line],[data-column-number],[data-no-newline]{padding-inline:1ch;position:relative}[data-indicators=classic] [data-line]{padding-inline-start:2ch}[data-indicators=classic]{& [data-line-type=change-addition],& [data-line-type=change-deletion]{&[data-no-newline],&[data-line]{&:before{user-select:none;width:1ch;height:1lh;display:inline-block;position:absolute;top:0;left:0}}}& [data-line-type=change-addition]{&[data-line],&[data-no-newline]{&:before{content:"+";color:var(--diffs-addition-base)}}}& [data-line-type=change-deletion]{&[data-line],&[data-no-newline]{&:before{content:"-";color:var(--diffs-deletion-base)}}}}[data-indicators=bars]{& [data-line-type=change-deletion],& [data-line-type=change-addition]{&[data-column-number]{&:before{content:"";user-select:none;contain:strict;width:4px;height:100%;display:block;position:absolute;top:0;left:0}}}& [data-line-type=change-deletion]{&[data-column-number]{&:before{background-image:linear-gradient(0deg, var(--diffs-bg-deletion) 50%, var(--diffs-deletion-base) 50%);background-repeat:repeat;background-size:2px 2px;background-size:calc(1lh / round(1lh / 2px)) calc(1lh / round(1lh / 2px))}}}& [data-line-type=change-addition]{&[data-column-number]{&:before{background-color:var(--diffs-addition-base)}}}}[data-overflow=wrap]{& [data-line]{white-space:pre-wrap;word-break:break-word}& [data-annotation-content]{word-break:break-word}}[data-overflow=scroll] [data-line]{white-space:pre;min-height:1lh}[data-column-number]{box-sizing:content-box;text-align:right;user-select:none;color:var(--diffs-fg-number);padding-left:2ch}[data-line-number-content]{min-width:var(--diffs-min-number-column-width,var(--diffs-min-number-column-width-default,3ch));z-index:1;display:inline-block;position:relative}[data-disable-line-numbers]{& [data-gutter-buffer],& [data-column-number]{min-width:4px;padding:0;&:before{min-width:0}}& [data-line-number-content]{display:none}& [data-gutter-utility-slot]{right:unset;justify-content:flex-start;left:0}&[data-indicators=bars] [data-gutter-utility-slot]{left:6px}}[data-file][data-disable-line-numbers]{& [data-gutter-buffer],& [data-column-number]{border-right:0;min-width:0}}[data-diff-span]{box-decoration-break:clone;border-radius:3px}[data-line-type=change-addition] [data-diff-span]{background-color:var(--diffs-bg-addition-emphasis)}[data-line-type=change-deletion] [data-diff-span]{background-color:var(--diffs-bg-deletion-emphasis)}[data-merge-conflict=marker-start],[data-merge-conflict=marker-base],[data-merge-conflict=marker-separator],[data-merge-conflict=marker-end]{color:var(--diffs-fg);padding-left:1ch}[data-merge-conflict=marker-start],[data-merge-conflict=marker-end]{align-items:center;display:flex;&:after{color:var(--diffs-fg-conflict-marker);font-size:.75rem;font-style:normal;line-height:1.25rem;font-family:var(--diffs-header-font-family,var(--diffs-header-font-fallback));padding-left:1ch}}[data-merge-conflict=marker-start]:after{content:"(Current Change)"}[data-merge-conflict=marker-end]:after{content:"(Incoming Change)"}[data-merge-conflict-actions-content]{min-height:1.75rem;font-family:var(--diffs-header-font-family,var(--diffs-header-font-fallback));color:var(--diffs-fg);align-items:center;gap:.25rem;padding-inline:.5rem;font-size:.75rem;line-height:1.2;display:flex}[data-merge-conflict-action]{appearance:none;color:var(--diffs-fg-number);font:inherit;cursor:pointer;background:0 0;border:0;padding:0;font-style:normal}[data-merge-conflict-action]:hover{color:var(--diffs-fg)}[data-merge-conflict-action=current]:hover{color:var(--diffs-addition-base)}[data-merge-conflict-action=incoming]:hover{color:var(--diffs-modified-base)}[data-merge-conflict-action-separator]{color:var(--diffs-fg-number);opacity:.6;user-select:none}[data-diffs-header=default]{background-color:var(--diffs-bg);justify-content:space-between;align-items:center;gap:var(--diffs-gap-inline,var(--diffs-gap-fallback));min-height:calc(1lh + (var(--diffs-gap-block,var(--diffs-gap-fallback)) * 3));z-index:2;flex-direction:row;padding-inline:16px;display:flex;position:relative;top:0}[data-header-content]{align-items:center;gap:var(--diffs-gap-inline,var(--diffs-gap-fallback));white-space:nowrap;flex-direction:row;min-width:0;display:flex}[data-header-content] [data-prev-name],[data-header-content] [data-title]{text-overflow:ellipsis;white-space:nowrap;direction:rtl;min-width:0;overflow:hidden}[data-prev-name]{opacity:.7}[data-rename-icon]{fill:currentColor;flex-grow:0;flex-shrink:0}[data-diffs-header=default] [data-metadata]{white-space:nowrap;align-items:center;gap:1ch;display:flex}[data-diffs-header=default] [data-additions-count]{font-family:var(--diffs-font-family,var(--diffs-font-fallback));color:var(--diffs-addition-base)}[data-diffs-header=default] [data-deletions-count]{font-family:var(--diffs-font-family,var(--diffs-font-fallback));color:var(--diffs-deletion-base)}[data-change-icon]{fill:currentColor;flex-shrink:0}[data-change-icon=change],[data-change-icon=rename-pure],[data-change-icon=rename-changed]{color:var(--diffs-modified-base)}[data-change-icon=new]{color:var(--diffs-addition-base)}[data-change-icon=deleted]{color:var(--diffs-deletion-base)}[data-change-icon=file]{opacity:.6}[data-annotation-content]{z-index:2;isolation:isolate;white-space:normal;align-self:flex-start;min-width:0;display:flow-root;position:relative}[data-overflow=scroll] [data-annotation-content],[data-overflow=scroll] [data-merge-conflict-actions-content]{width:var(--diffs-column-content-width,auto);left:var(--diffs-column-number-width,0);position:sticky}[data-annotation-slot]{text-wrap-mode:wrap;word-break:normal;white-space-collapse:collapse}[data-gutter-utility-slot]{touch-action:none;justify-content:flex-end;display:flex;position:absolute;top:0;bottom:0;right:0}[data-utility-button]{appearance:none;cursor:pointer;width:1lh;height:1lh;font-size:var(--diffs-font-size,13px);line-height:var(--diffs-line-height,20px);background-color:var(--diffs-modified-base);color:var(--diffs-bg);fill:currentColor;z-index:4;touch-action:none;border:none;border-radius:4px;justify-content:center;align-items:center;margin-right:calc(-1lh + 1ch);padding:0;display:flex;position:relative;&:before{content:"";display:block;position:absolute;inset:0 0 0 -4px}}[data-decoration-bar-stack]{pointer-events:none;isolation:isolate;z-index:1;background-color:var(--diffs-decoration-bar-color,transparent);box-sizing:content-box;border-left:2px solid var(--diffs-bg);border-right:2px solid var(--diffs-bg);width:6px;position:absolute;top:0;bottom:0;right:-2px;[data-decoration-bar-depth="1"] &{background-color:color-mix(in lab, var(--diffs-bg) 20%, var(--diffs-decoration-bar-color,transparent))}[data-decoration-bar-depth="2"] &{background-color:color-mix(in lab, var(--diffs-bg) 45%, var(--diffs-decoration-bar-color,transparent))}[data-decoration-bar-depth="3"] &{background-color:color-mix(in lab, var(--diffs-bg) 65%, var(--diffs-decoration-bar-color,transparent))}[data-decoration-bar-start] &{border-top-left-radius:5px;border-top-right-radius:5px}[data-decoration-bar-end] &{z-index:3;border-bottom-right-radius:5px;border-bottom-left-radius:5px}}[data-placeholder]{contain:strict}[data-error-wrapper]{padding:var(--diffs-gap-block,var(--diffs-gap-fallback)) var(--diffs-gap-inline,var(--diffs-gap-fallback));scrollbar-width:none;max-height:400px;overflow:auto;& [data-error-message]{color:var(--diffs-deletion-base);font-size:18px;font-weight:700}& [data-error-stack]{color:var(--diffs-fg-number)}}}@layer theme,rendered,unsafe;
270
+ `;const Is="@layer base, theme, rendered, unsafe;",Rf=new RegExp(`${Pf(vo)}\\s*:\\s*[^;]+;`);function Tf(e){return`${Is}
271
+ @layer unsafe {
272
+ ${e}
273
+ }`}function If(e,t="system",i){const n=t==="system"?"":`
274
+ color-scheme: ${t};`,r=Ts(i);return`${Is}
275
+ @layer rendered {
276
+ :host {${n}
277
+ ${r}
278
+ ${e}
279
+ }
280
+ }`}function Df(e,t){const i=Ts(t);return e.replace(Rf,i)}function Pf(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}const Of=new WeakMap;function Un(e){const t=Of.get(e);return t??e}function Ur(e,t,i){const n=new Map;for(const r of e){const o=Un(r);n.set(o,i?.slotNames.get(o)??t(r))}return{provided:e,current:e,slotNames:n}}function Mf(e,t,i){for(const n of t){const r=Un(n);e.slotNames.has(r)||e.slotNames.set(r,i(n))}e.provided=t,e.current=t}function Hf(e,t,i){if(e==null)return i(t);const n=Un(t);let r=e.slotNames.get(n);return r==null&&(r=i(t),e.slotNames.set(n,r)),r}function Nf(e){return e?.useTokenTransformer===!0||e?.onTokenClick!=null||e?.onTokenEnter!=null||e?.onTokenLeave!=null}function Gi({code:e,pre:t,columnType:i,rowSpan:n,containerSize:r=!1}={}){return e==null&&(e=document.createElement("code"),e.setAttribute("data-code",""),i!=null&&e.setAttribute(`data-${i}`,""),t?.appendChild(e)),n!=null?e.style.setProperty("grid-row",`span ${n}`):e.style.removeProperty("grid-row"),r?e.setAttribute("data-container-size",""):e.removeAttribute("data-container-size"),e}function zr(e,t){const i=e?.offsetHeight??0;if(e==null||i===0){t();return}e.style.minHeight=`${i}px`;try{t(),e.offsetHeight}finally{e.style.minHeight=""}}function Ff({shadowRoot:e,currentNode:t,themeCSS:i}){if(i.trim()===""){t?.remove();return}return t??=Vf(),t.textContent=i,t.parentNode!==e&&e.appendChild(t),t}function Vf(){const e=document.createElement("style");return e.setAttribute(la,""),e}let $f;function Uf(){return $f??="safari"in window&&"pushNotification"in window.safari||/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function zf(e,t){if(t==null)return;const i=e.shadowRoot??e.attachShadow({mode:"open"});i.innerHTML===""&&(i.innerHTML=t)}function Bf(e,{type:t,diffIndicators:i,disableBackground:n,disableLineNumbers:r,overflow:o,split:s,totalLines:l,customProperties:a}){if(a!=null)for(const d in a){const u=a[d];u!=null&&e.setAttribute(d,`${u}`)}switch(t==="diff"?(e.setAttribute("data-diff",""),e.removeAttribute("data-file")):(e.setAttribute("data-file",""),e.removeAttribute("data-diff")),i){case"bars":case"classic":e.setAttribute("data-indicators",i);break;case"none":e.removeAttribute("data-indicators")}return r?e.setAttribute("data-disable-line-numbers",""):e.removeAttribute("data-disable-line-numbers"),n?e.removeAttribute("data-background"):e.setAttribute("data-background",""),t==="diff"?e.setAttribute("data-diff-type",s?"split":"single"):e.removeAttribute("data-diff-type"),e.setAttribute("data-overflow",o),e.style.setProperty("--diffs-min-number-column-width-default",`${`${l}`.length}ch`),e}if(typeof HTMLElement<"u"&&customElements.get("diffs-container")==null){let e;class t extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;const n=this.attachShadow({mode:"open"});e==null&&(e=new CSSStyleSheet,e.replaceSync(Af)),n.adoptedStyleSheets=[e]}connectedCallback(){const n=this.shadowRoot??this.attachShadow({mode:"open"});yn(n)}}customElements.define(Tn,t)}async function En(e,t=300){let i;try{await Promise.race([e(),new Promise(n=>{i=setTimeout(n,t)})])}finally{i!=null&&clearTimeout(i)}}function Gf({fileDiff:e,metrics:t,disableFileHeader:i,hunkSeparators:n,expandUnchanged:r,expandedHunks:o,collapsedContextThreshold:s,canHydratePartialDiff:l}){let a=dt(t,i),d=a;const u=r?!0:o,c=e.hunks.length-1;for(let f=0;f<e.hunks.length;f++){const h=e.hunks[f];if(h==null)throw new Error("computeEstimatedDiffHeights: invalid hunk index");const m=De({isPartial:e.isPartial,rangeSize:h.collapsedBefore,expandedHunks:u,hunkIndex:f,collapsedContextThreshold:s}),g=(m.fromStart+m.fromEnd)*t.lineHeight;if(a+=g,d+=g,m.collapsedLines>0){const _=St({type:n,metrics:t,hunkIndex:f,hunkSpecs:h.hunkSpecs})?.totalHeight??0;a+=_,d+=_}a+=h.splitLineCount*t.lineHeight,d+=h.unifiedLineCount*t.lineHeight;const y=jf(h);a+=y.split*t.lineHeight,d+=y.unified*t.lineHeight;const v=f===c?Pe({fileDiff:e,hunkIndex:f,expandedHunks:u,collapsedContextThreshold:s,errorPrefix:"computeEstimatedDiffHeights"}):void 0;if(v!=null){const _=(v.fromStart+v.fromEnd)*t.lineHeight;if(a+=_,d+=_,v.collapsedLines>0){const b=Xe({type:n,metrics:t})?.totalHeight??0;a+=b,d+=b}}else if(f===c&&e.isPartial&&l){const _=Xe({type:n,metrics:t})?.totalHeight??0;a+=_,d+=_}}if(e.hunks.length>0){const f=_s(t);a+=f,d+=f}return{splitHeight:a,unifiedHeight:d}}function jf(e){if(!e.noEOFCRAdditions&&!e.noEOFCRDeletions)return{split:0,unified:0};const t=e.hunkContent.at(-1);if(t==null)return{split:0,unified:0};if(t.type==="context"){const i=t.lines>0?1:0;return{split:i,unified:i}}return Wf(e,t)}function Wf(e,t){const i=(t.deletions>0&&e.noEOFCRDeletions?1:0)+(t.additions>0&&e.noEOFCRAdditions?1:0),n=t.deletions>0&&e.noEOFCRDeletions,r=t.additions>0&&e.noEOFCRAdditions;return{split:n||r?1:0,unified:i}}function Sn({oldFile:e,newFile:t},i){if(!(e===void 0&&t===void 0)){if(e===void 0||t===void 0)throw new Error(`${i}: Pass null for an intentionally missing oldFile or newFile side`);if(e===null){if(t===null)throw new Error(`${i}: You must pass oldFile, newFile, or both`);return{oldFile:e,newFile:t}}return t===null?{oldFile:e,newFile:t}:{oldFile:e,newFile:t}}}function Ds(e){return e.map(t=>({...t,hunkContent:t.hunkContent.map(i=>({...i}))}))}function Ps(e){return{...e,hunks:Ds(e.hunks),deletionLines:[...e.deletionLines],additionLines:[...e.additionLines]}}const qf=1;function Os(e,...t){return`ck${qf}:${JSON.stringify([e,...t])}`}function li(e){return e!==""?e.split(oa):[]}function Ln(e,t,i){const n=e==="clone"?Ps(t):t;if(!n.isPartial)throw new Error("hydratePartialDiff: fileDiff must be partial");switch(n.type){case"change":case"rename-changed":return Kf(n,Jf(n,i),Br(n,i));case"rename-pure":{const r=Br(n,i);Qf(n,i);const o=li(r.contents);return n.isPartial=!1,n.deletionLines=o,n.additionLines=o,Ms(n,null,r),n}}throw new Error(`hydratePartialDiff: ${n.type} diffs cannot be hydrated from loaded files`)}function Kf(e,t,i){const n=li(t.contents),r=li(i.contents),{hunks:o,splitLineCount:s,unifiedLineCount:l}=Xf(e.hunks,r.length);return e.hunks=o,e.splitLineCount=s,e.unifiedLineCount=l,e.isPartial=!1,e.deletionLines=n,e.additionLines=r,Ms(e,t,i),e}function Xf(e,t){let i=0,n=0,r=0;const o=[];for(const s of e){const l=Math.max(s.additionStart-1,0),a=Math.max(s.deletionStart-1,0);let d=l,u=a,c=0,f=0,h=0,m=0;const g=[];for(const v of s.hunkContent){if(v.type==="context"){g.push({...v,additionLineIndex:d,deletionLineIndex:u}),d+=v.lines,u+=v.lines,h+=v.lines,m+=v.lines;continue}g.push({...v,additionLineIndex:d,deletionLineIndex:u}),d+=v.additions,u+=v.deletions,c+=v.additions,f+=v.deletions,h+=Math.max(v.additions,v.deletions),m+=v.additions+v.deletions}const y=Math.max(ae(s.additionStart,s.additionCount)-r,0);o.push({...s,collapsedBefore:y,additionLineIndex:l,deletionLineIndex:a,additionLines:c,deletionLines:f,hunkContent:g,splitLineStart:i+y,unifiedLineStart:n+y,splitLineCount:h,unifiedLineCount:m}),i+=y+h,n+=y+m,r=ne(s.additionStart,s.additionCount)}if(o.length>0){const s=o[o.length-1],l=ne(s.additionStart,s.additionCount),a=Math.max(t-l,0);i+=a,n+=a}return{hunks:o,splitLineCount:i,unifiedLineCount:n}}function Jf(e,t){if(t.oldFile==null)throw new Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile`);return t.oldFile}function Br(e,t){if(t.newFile==null)throw new Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires newFile`);return t.newFile}function Qf(e,t){if(t.oldFile!==null)throw new Error(`hydratePartialDiff: ${e.type} diff for ${e.name} requires oldFile to be null`)}function Zf(e,t,i){return e.cacheKey!=null?`${e.cacheKey}:hydrated`:Yf(t,i)}function Ms(e,t,i){const n=Zf(e,t,i);if(n==null){delete e.cacheKey;return}e.cacheKey=n}function Yf(e,t){return e!=null&&t!=null?e.cacheKey!=null&&t.cacheKey!=null?Os("hydrated-files",e.cacheKey,t.cacheKey):void 0:e?.cacheKey??t?.cacheKey}const eh=new TextEncoder,th=new TextDecoder("utf-8",{ignoreBOM:!0}),ih=/[\uD800-\uDFFF]/,Cn=1024;let ut=new Uint8Array(Cn);function Hs(){ut.length!==Cn&&(ut=new Uint8Array(Cn))}function K(e){if(e.length===0)return e;if(ih.test(e))return JSON.parse(JSON.stringify(e));const t=e.length*3;ut.length<t&&(ut=new Uint8Array(t));const{written:i}=eh.encodeInto(e,ut);return th.decode(ut.subarray(0,i))}const nh=new TextDecoder("utf-8",{ignoreBOM:!0}),rh={'"':'"',"\\":"\\",a:"\x07",b:"\b",t:" ",n:`
281
+ `,v:"\v",f:"\f",r:"\r"};function oh(e){if(e[0]!=='"')return;let t="",i=1;for(;i<e.length;){const n=e[i];if(n==='"')return{fileName:t,rawLength:i+1};if(n!=="\\"){t+=n,i++;continue}const r=rh[e[i+1]];if(r!=null){t+=r,i+=2;continue}const o=[];do{const s=sh(e,i+1);if(s==null)return;o.push(s),i+=4}while(e[i]==="\\"&&e[i+1]>="0"&&e[i+1]<="7");t+=nh.decode(new Uint8Array(o))}}function sh(e,t){const i=e.charCodeAt(t)-48,n=e.charCodeAt(t+1)-48,r=e.charCodeAt(t+2)-48;if(i>=0&&i<=3&&n>=0&&n<=7&&r>=0&&r<=7)return i*64+n*8+r}const ah=4096,lh=.5;function dh(e){for(const t of e.hunks)for(let i=0;i<t.hunkContent.length;i++){const n=t.hunkContent[i];if(n.type!=="change")continue;const r=ch(e,n);r!=null&&(t.hunkContent.splice(i,1,...r),i+=r.length-1)}}function uh(e,t,i){const{hunkContent:n}=e;for(let r=1;r<n.length;r++){const o=n[r],s=n[r-1];if(o.type!=="change"||o.additions>0&&o.deletions>0||s.type!=="context")continue;const l=o.additions>0,a=l?t.additionLines:t.deletionLines,d=l?o.additionLineIndex:o.deletionLineIndex,u=l?o.additions:o.deletions,c=a[d]??"";if(c.trim()!=="")continue;let f=!0;for(let v=1;v<u;v++)if(a[d+v]!==c){f=!1;break}if(!f)continue;let h=0;for(;h<s.lines&&t.additionLines[s.additionLineIndex+s.lines-1-h]===c;)h++;if(h===0||r===1&&h===s.lines||i!=null&&(h=i(o,h),h===0))continue;o.additionLineIndex-=h,o.deletionLineIndex-=h;const m=o.additionLineIndex+o.additions,g=o.deletionLineIndex+o.deletions,y=n[r+1];y?.type==="context"?(y.lines+=h,y.additionLineIndex=m,y.deletionLineIndex=g):n.splice(r+1,0,{type:"context",lines:h,additionLineIndex:m,deletionLineIndex:g}),s.lines-=h,s.lines===0&&(n.splice(r-1,1),r--)}}function ch(e,t){const{deletions:i,additions:n,deletionLineIndex:r,additionLineIndex:o}=t,s=Math.min(i,n),l=Math.abs(n-i);if(s===0||l===0||s*(l+1)>ah)return null;const a=[];for(let g=0;g<i;g++)a.push(Gr(e.deletionLines[r+g]??""));const d=[];for(let g=0;g<n;g++)d.push(Gr(e.additionLines[o+g]??""));const u=n>i;let c=0,f=-1;for(let g=0;g<=l;g++){let y=0;for(let v=0;v<s;v++)y+=hh(a[v+(u?0:g)],d[v+(u?g:0)]);g===0?f=y+s*lh:y>f&&(f=y,c=g)}if(c===0)return null;const h=[],m=(g,y,v,_)=>{(g>0||y>0)&&h.push({type:"change",deletions:g,additions:y,deletionLineIndex:v,additionLineIndex:_})};return u?(m(0,c,r,o),m(s,s,r,o+c),m(0,n-s-c,r+s,o+c+s)):(m(c,0,r,o),m(s,s,r+c,o),m(i-s-c,0,r+c+s,o+s)),h}const fh=/\s+/g;function Gr(e){return e.replace(fh,"")}function hh(e,t){if(e===t)return 1;const i=Math.max(e.length,t.length),n=Math.min(e.length,t.length);if(n===0)return 0;let r=0;for(;r<n&&e[r]===t[r];)r++;let o=0;for(;o<n-r&&e[e.length-1-o]===t[t.length-1-o];)o++;return(r+o)/i}const ph=/^diff --git ("a\/(?:[^"\\]|\\.)*"|a\/.+?) ("b\/(?:[^"\\]|\\.)*"|b\/.+?)$/;function mh(e,t,i=!1,n){const r=wh(e),o=r?bh(e):yh(e);let s;const l=[];for(const a of o){if(r&&!ho.test(a)){if(s==null)s=K(a);else{if(i)throw Error("parsePatchContent: unknown file blob");console.error("parsePatchContent: unknown file blob:",a)}continue}else if(!r&&!Eh(a)){if(s==null)s=K(a);else{if(i)throw Error("parsePatchContent: unknown file blob");console.error("parsePatchContent: unknown file blob:",a)}continue}const d=Ns(a,{cacheKey:void 0,isGitDiff:r,throwOnError:i});d!=null&&l.push(d)}return{patchMetadata:s,files:l}}function gh(e,t){try{return Ns(e,t)}finally{Hs()}}function Ns(e,{cacheKey:t,isGitDiff:i=ho.test(e),oldFile:n,newFile:r,throwOnError:o=!1}={}){let s=0;const l=Us(e,"@@ ");let a;const d=n==null||r==null;let u=0,c=0;for(const f of l){const h=Fs(f),m=h[0];if(m==null){if(o)throw Error("parsePatchContent: invalid hunk");console.error("parsePatchContent: invalid hunk",f);continue}const g=$s(m);let y=0,v=0;if(g==null||a==null){if(a!=null){if(o)throw Error("parsePatchContent: Invalid hunk");console.error("parsePatchContent: Invalid hunk",f);continue}a={name:"",type:"change",hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:d,additionLines:!d&&n!=null&&r!=null?jr(r.contents):[],deletionLines:!d&&n!=null&&r!=null?jr(n.contents):[],cacheKey:Kr(t)},a.additionLines.length===1&&r?.contents===""&&(a.additionLines.length=0),a.deletionLines.length===1&&n?.contents===""&&(a.deletionLines.length=0);for(const w of h){if(w.startsWith("diff --git")){const I=w.trim().match(ph);if(I==null){if(o)throw Error("parsePatchContent: invalid git diff header");console.error("parsePatchContent: invalid git diff header",w);continue}const k=bt(I[1],!0),R=bt(I[2],!0);a.name=K(R),k!==R&&(a.prevName=K(k));continue}const A=w.startsWith("---")||w.startsWith("+++")?w.match(sa):null;if(A!=null){const[,I,k]=A,R=bt(k,i);if(I==="---"&&R!=="/dev/null"){const D=K(R);a.prevName=D,a.name=D}else I==="+++"&&R!=="/dev/null"&&(a.name=K(R))}else if(i){if(w.startsWith("new mode ")&&(a.mode=K(w.slice(8).trim())),w.startsWith("old mode ")&&(a.prevMode=K(w.slice(8).trim())),w.startsWith("new file mode")&&(a.type="new",a.mode=K(w.slice(13).trim())),w.startsWith("deleted file mode")&&(a.type="deleted",a.mode=K(w.slice(17).trim())),w.startsWith("similarity index")&&(w.startsWith("similarity index 100%")?a.type="rename-pure":a.type="rename-changed"),w.startsWith("index ")){const[,I,k,R]=w.trim().match(aa)??[];I!=null&&(a.prevObjectId=K(I)),k!=null&&(a.newObjectId=K(k)),R!=null&&(a.mode=K(R))}(w.startsWith("rename from ")||w.startsWith("copy from "))&&(a.prevName=K(bt(w.slice(w.startsWith("rename")?12:10)))),(w.startsWith("rename to ")||w.startsWith("copy to "))&&(a.name=K(bt(w.slice(w.startsWith("rename")?10:8))))}}continue}let _,b;for(;h.length>0&&(h[h.length-1]===`
282
+ `||h[h.length-1]==="\r"||h[h.length-1]===`\r
283
+ `||h[h.length-1]==="");)h.pop();const{additionStart:L,deletionStart:E}=g;u=d?u:E-1,c=d?c:L-1;const S={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:g.additionCount,additionStart:L,additionLines:y,deletionCount:g.deletionCount,deletionStart:E,deletionLines:v,deletionLineIndex:u,additionLineIndex:c,hunkContent:[],hunkContext:Kr(g.hunkContext),hunkSpecs:K(m),noEOFCRAdditions:!1,noEOFCRDeletions:!1};let C=0,x=0;for(let w=1;w<h.length;w++){const A=h[w];if(C>=S.additionCount&&x>=S.deletionCount&&!A.startsWith("\\")){if(!(Sh(A)&&!Lh(A)))break;if(o)throw Error("parsePatchContent: hunk has more lines than expected")}const I=A[0];if(I!=="+"&&I!=="-"&&I!==" "&&I!=="\\"){if(o)throw Error("parsePatchContent: invalid hunk line");console.error(`parseLineType: Invalid firstChar: "${I}", full line: "${A}"`),console.error("processFile: invalid rawLine:",A);continue}const k=kh(I);if(k==="addition"){if(o&&C>=S.additionCount)throw Error("parsePatchContent: hunk has too many addition lines");const R=ji(A);(_==null||_.type!=="change")&&(_=Wi("change",u,c),S.hunkContent.push(_)),c++,C++,d&&a.additionLines.push(R),_.additions++,y++,b="addition"}else if(k==="deletion"){if(o&&x>=S.deletionCount)throw Error("parsePatchContent: hunk has too many deletion lines");const R=ji(A);(_==null||_.type!=="change")&&(_=Wi("change",u,c),S.hunkContent.push(_)),u++,x++,d&&a.deletionLines.push(R),_.deletions++,v++,b="deletion"}else if(k==="context"){if(o&&(x>=S.deletionCount||C>=S.additionCount))throw Error("parsePatchContent: hunk has too many context lines");const R=ji(A);(_==null||_.type!=="context")&&(_=Wi("context",u,c),S.hunkContent.push(_)),c++,u++,C++,x++,d&&(a.deletionLines.push(R),a.additionLines.push(R)),_.lines++,b="context"}else if(k==="metadata"&&_!=null){if(_.type==="context"?(S.noEOFCRAdditions=!0,S.noEOFCRDeletions=!0):b==="deletion"?S.noEOFCRDeletions=!0:b==="addition"&&(S.noEOFCRAdditions=!0),d&&(b==="addition"||b==="context")){const R=a.additionLines.length-1;R>=0&&(a.additionLines[R]=Oe(a.additionLines[R]))}if(d&&(b==="deletion"||b==="context")){const R=a.deletionLines.length-1;R>=0&&(a.deletionLines[R]=Oe(a.deletionLines[R]))}}}if(C!==S.additionCount||x!==S.deletionCount){if(o)throw Error("parsePatchContent: hunk line count mismatch");console.error(`parsePatchContent: hunk line count mismatch: "${m.trimEnd()}", declared old/new ${S.deletionCount}/${S.additionCount}, parsed old/new ${x}/${C}`);const w=ae(S.additionStart,S.additionCount)+(C===0?0:1),A=ae(S.deletionStart,S.deletionCount)+(x===0?0:1);if(!d){const I=w-S.additionStart,k=A-S.deletionStart;S.additionLineIndex+=I,S.deletionLineIndex+=k;for(const R of S.hunkContent)R.additionLineIndex+=I,R.deletionLineIndex+=k}S.additionStart=w,S.deletionStart=A,S.additionCount=C,S.deletionCount=x}S.additionLines=y,S.deletionLines=v,S.collapsedBefore=Math.max(ae(S.additionStart,S.additionCount)-s,0),a.hunks.push(S),s=ne(S.additionStart,S.additionCount);for(const w of S.hunkContent)w.type==="context"?(S.splitLineCount+=w.lines,S.unifiedLineCount+=w.lines):(S.splitLineCount+=Math.max(w.additions,w.deletions),S.unifiedLineCount+=w.deletions+w.additions);S.splitLineStart=a.splitLineCount+S.collapsedBefore,S.unifiedLineStart=a.unifiedLineCount+S.collapsedBefore,a.splitLineCount+=S.collapsedBefore+S.splitLineCount,a.unifiedLineCount+=S.collapsedBefore+S.unifiedLineCount}if(a!=null){if(o&&d&&!i&&a.hunks.length===0)throw Error("parsePatchContent: unified file has no hunks");if(a.hunks.length>0&&!d&&a.additionLines.length>0&&a.deletionLines.length>0){const f=a.hunks[a.hunks.length-1],h=ne(f.additionStart,f.additionCount),m=a.additionLines.length,g=Math.max(m-h,0);a.splitLineCount+=g,a.unifiedLineCount+=g}return i||(a.prevName!=null&&a.name!==a.prevName?a.hunks.length>0?a.type="rename-changed":a.type="rename-pure":(n==null||n.contents==="")&&r!=null&&r.contents!==""?a.type="new":n!=null&&n.contents!==""&&(r==null||r.contents==="")&&(a.type="deleted")),a.type!=="rename-pure"&&a.type!=="rename-changed"&&(a.prevName=void 0),dh(a),a}}function vh(e,t,i=!1){const n=[],r=_h(e)?e.split(ra):[e];for(const o of r)try{n.push(mh(o,t,i,t!=null?n.length:void 0))}catch(s){if(i)throw s;console.error(s)}finally{Hs()}return n}function bt(e,t=!1){const i=e.trim(),n=i.startsWith('"')?oh(i)?.fileName??i:i;return t&&(n.startsWith("a/")||n.startsWith("b/"))?n.slice(2):n}function _h(e){return e.startsWith("From ")||e.includes(`
284
+ From `)}function jr(e){const t=Fs(e);for(let i=0;i<t.length;i++)t[i]=K(t[i]);return t}function Fs(e){if(e.length===0)return[""];const t=[];let i=0;for(;;){const n=e.indexOf(`
285
+ `,i);if(n===-1)break;t.push(e.slice(i,n+1)),i=n+1}return i<e.length&&t.push(e.slice(i)),t}function bh(e){return Us(e,"diff --git")}function yh(e){if(e.length===0)return[""];const t=[];let i=0,n=0,r=0,o=0,s=!1;for(;n<e.length;){const l=wn(e,n);if(r<=0&&o<=0){if(Vs(e,n)){n>i&&t.push(e.slice(i,n)),i=n,s=!0,n=wn(e,l);continue}if(s&&e.startsWith("@@ -",n)){const d=$s(e.slice(n,l));d!=null&&(r=d.deletionCount,o=d.additionCount)}n=l;continue}const a=e[n];if(a==="\\"){n=l;continue}a===" "?(r=Math.max(r-1,0),o=Math.max(o-1,0)):a==="-"?r=Math.max(r-1,0):a==="+"&&(o=Math.max(o-1,0)),n=l}return t.push(e.slice(i)),t}function Eh(e){return Vs(e,0)}function Vs(e,t){const i=wn(e,t);return Wr(e,t,"---")&&Wr(e,i,"+++")}function Wr(e,t,i){if(!e.startsWith(i,t))return!1;const n=e[t+i.length];if(n!==" "&&n!==" ")return!1;for(let r=t+i.length+1;r<e.length;r++){const o=e[r];if(o===`
286
+ `||o==="\r")break;if(o!==" "&&o!==" ")return!0}return!1}function wn(e,t){const i=e.indexOf(`
287
+ `,t);return i===-1?e.length:i+1}function Sh(e){const t=e[0];return t==="+"||t==="-"||t===" "}function Lh(e){if(!e.startsWith("--"))return!1;for(let t=2;t<e.length;t++){const i=e[t];if(i!==" "&&i!==" "&&i!==`
288
+ `&&i!=="\r")return!1}return!0}function $s(e){if(!e.startsWith("@@ -"))return;let t=4;const i=Bt(e,t);if(i==null)return;const n=i.value;t=i.endIndex;let r=1;if(e[t]===","){const u=Bt(e,t+1);if(u==null)return;r=u.value,t=u.endIndex}if(e[t]!==" "||e[t+1]!=="+")return;t+=2;const o=Bt(e,t);if(o==null)return;const s=o.value;t=o.endIndex;let l=1;if(e[t]===","){const u=Bt(e,t+1);if(u==null)return;l=u.value,t=u.endIndex}if(e[t]!==" "||e[t+1]!=="@"||e[t+2]!=="@")return;let a;const d=t+3;return e[d]===" "&&(a=Ch(e.slice(d+1))),{additionCount:l,additionStart:s,deletionCount:r,deletionStart:n,hunkContext:a}}function Bt(e,t){let i=t,n=0;for(;i<e.length;i++){const r=e.charCodeAt(i)-48;if(r<0||r>9)break;n=n*10+r}if(i!==t)return{value:n,endIndex:i}}function Ch(e){return e.endsWith(`\r
289
+ `)?e.slice(0,-2):e.endsWith(`
290
+ `)?e.slice(0,-1):e}function wh(e){return e.startsWith("diff --git")||e.includes(`
291
+ diff --git`)}function Us(e,t){if(e.length===0)return[""];const i=`
292
+ ${t}`,n=e.startsWith(t)?0:qr(e,i,0);if(n===-1)return[e];const r=[];n>0&&r.push(e.slice(0,n));let o=n;for(;;){const s=qr(e,i,o+1);if(s===-1)break;r.push(e.slice(o,s)),o=s}return r.push(e.slice(o)),r}function qr(e,t,i){const n=e.indexOf(t,i);return n===-1?-1:n+1}function Kr(e){return e==null?e:K(e)}function kh(e){return e===" "?"context":e==="\\"?"metadata":e==="+"?"addition":"deletion"}function ji(e){const t=e.slice(1);return K(t===""?`
293
+ `:t)}function Wi(e,t,i){return e==="change"?{type:"change",additions:0,deletions:0,additionLineIndex:i,deletionLineIndex:t}:{type:"context",lines:0,additionLineIndex:i,deletionLineIndex:t}}const xh="/dev/null";function Ge(e,t,i,n=!1){if(e===null&&t===null)throw new Error("parseDiffFromFile: You must pass oldFile, newFile, or both");const r=e??Xr(),o=t??Xr(),s=Hc(r.name,o.name,r.contents,o.contents,r.header,o.header,i),l=gh(s,{cacheKey:(()=>{const d=e?.cacheKey,u=t?.cacheKey;return d!=null&&u!=null?Os("diff",d,u):void 0})(),oldFile:r,newFile:o,throwOnError:n});if(l==null)throw new Error("parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?");e===null?(l.type="new",l.prevName=void 0):t===null&&(l.type="deleted",l.prevName=void 0);const a=t?.lang??(t===null?e?.lang:void 0);return a!=null&&(l.lang=a),l}function Xr(){return{name:xh,contents:""}}var Ah=class{isDeletionsScrolling=!1;isAdditionsScrolling=!1;timeoutId=-1;codeDeletions;codeAdditions;enabled=!1;cleanUp(){this.enabled&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),clearTimeout(this.timeoutId),this.codeDeletions=void 0,this.codeAdditions=void 0,this.enabled=!1)}setup(e,t,i){if(t==null||i==null)for(const n of e.children??[])n instanceof HTMLElement&&("deletions"in n.dataset?t=n:"additions"in n.dataset&&(i=n));if(i==null||t==null){this.cleanUp();return}this.codeDeletions!==t&&(this.codeDeletions?.removeEventListener("scroll",this.handleDeletionsScroll),this.codeDeletions=t,t.addEventListener("scroll",this.handleDeletionsScroll,{passive:!0})),this.codeAdditions!==i&&(this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),this.codeAdditions=i,i.addEventListener("scroll",this.handleAdditionsScroll,{passive:!0})),this.enabled=!0}handleDeletionsScroll=()=>{this.isAdditionsScrolling||(this.isDeletionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isDeletionsScrolling=!1},300),this.codeAdditions?.scrollTo({left:this.codeDeletions?.scrollLeft}))};handleAdditionsScroll=()=>{this.isDeletionsScrolling||(this.isAdditionsScrolling=!0,clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isAdditionsScrolling=!1},300),this.codeDeletions?.scrollTo({left:this.codeAdditions?.scrollLeft}))}};function Ae(e,t){const i=Ge({name:e.prevName??e.name,contents:e.deletionLines.join("")},{name:e.name,contents:e.additionLines.join(""),lang:e.lang},t);return{hunks:i.hunks,splitLineCount:i.splitLineCount,unifiedLineCount:i.unifiedLineCount,additionLines:i.additionLines,deletionLines:i.deletionLines,type:i.type}}function Rh(e,t){const i=Math.max(e,1);let n=Array.from({length:i},(r,o)=>`${" ".repeat(o+1)}
294
+ `).join("");return n===t&&(n=Array.from({length:i},(r,o)=>`\0${" ".repeat(o)}
295
+ `).join("")),n}function Th(e){for(const t of e)if(t.trim().length>0)return!1;return!0}function kn(e,t){return t.length>0&&t.length<e.deletionLines.length&&Th(t)}function di(e,t,i){const n=e.deletionLines.join(""),r=Rh(t.length,n),o=Ge({name:e.prevName??e.name,contents:n},{name:e.name,contents:r,lang:e.lang},i);return{hunks:o.hunks,splitLineCount:o.splitLineCount,unifiedLineCount:o.unifiedLineCount,additionLines:t,deletionLines:o.deletionLines,type:o.type}}function Yt(e,t){return di(e,[""],t)}function zs(e,t){if(e.additionLines.length===0)return Yt(e,t);if(kn(e,e.additionLines))return di(e,e.additionLines,t);const i=e.additionLines,n=Ae(e,t);return Bs(n,i),n}function Ih(e){return e.length>1&&e.at(-1)===""}function Bs(e,t){if(!Ih(t))return;const i=t.length-e.additionLines.length;if(i<=0)return;const n=e.additionLines.length,r=e.hunks.at(-1);if(r!=null&&ne(r.additionStart,r.additionCount)===n){for(const o of r.hunkContent)if(o.type==="change"&&o.additions<o.deletions&&o.additionLineIndex+o.additions===n){e.additionLines=t,o.additions+=i,r.additionCount+=i,r.additionLines+=i,Li(e);return}}}function Dh(e,t,i){if(e.isPartial||e.deletionLines.length!==e.additionLines.length)return ke(e,Ae(e,i));const n=Array.from(t);if(n.length===0)return ke(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type});for(const o of n){const s=e.additionLines[o],l=e.deletionLines[o];if(s==null||l==null||Oe(s)===Oe(l))return ke(e,Ae(e,i))}const r=Ph(e,n);if(r.size===0)return ke(e,Ae(e,i));for(const o of r)if(!Mh(e,o,i))return ke(e,Ae(e,i));return Li(e),vc(e)?ke(e,Ae(e,i)):ke(e,{hunks:e.hunks,splitLineCount:e.splitLineCount,unifiedLineCount:e.unifiedLineCount,type:e.type})}function ke(e,t){return Object.assign(e,t),t}function Ph(e,t){const i=new Set;for(const n of t){const r=Oh(e,n);if(r==null)return new Set;i.add(r)}return i}function Oh(e,t){for(const[i,n]of e.hunks.entries()){const r=n.additionLineIndex+n.additionCount;if(t>=n.additionLineIndex&&t<r)return i}}function Mh(e,t,i){const n=e.hunks[t];if(n==null)return!1;const r=e.deletionLines.slice(n.deletionLineIndex,n.deletionLineIndex+n.deletionCount),o=e.additionLines.slice(n.additionLineIndex,n.additionLineIndex+n.additionCount),s=Ge({name:e.prevName??e.name,contents:r.join("")},{name:e.name,contents:o.join(""),lang:e.lang},{...i,context:0}),l=s.hunks[0];return l==null||s.hunks.length!==1?!1:(Hh(n,l),Gs(e,t),!0)}function Gs(e,t){const i=e.hunks[t];if(i==null)return;if(t!==e.hunks.length-1){i.noEOFCRAdditions=!1,i.noEOFCRDeletions=!1;return}const n=e.additionLines.at(-1),r=e.deletionLines.at(-1);i.noEOFCRAdditions=n!=null&&n!==""&&!n.endsWith(`
296
+ `),i.noEOFCRDeletions=r!=null&&r!==""&&!r.endsWith(`
297
+ `)}function Hh(e,t){const i=e.additionLineIndex,n=e.deletionLineIndex;e.hunkContent=t.hunkContent.map(r=>js(r,i,n)),e.additionLineIndex=i+t.additionLineIndex,e.additionStart=e.additionStart+t.additionLineIndex,e.additionCount=t.additionCount,e.additionLines=t.additionLines,t.deletionLineIndex>=0&&(e.deletionLineIndex=n+t.deletionLineIndex,e.deletionStart=e.deletionStart+t.deletionLineIndex),e.deletionCount=t.deletionCount,e.deletionLines=t.deletionLines,e.noEOFCRAdditions=t.noEOFCRAdditions,e.noEOFCRDeletions=t.noEOFCRDeletions,zn(e)}function js(e,t,i){return{...e,additionLineIndex:e.additionLineIndex+t,deletionLineIndex:e.deletionLineIndex+i}}function zn(e){let t=0,i=0;for(const n of e.hunkContent)n.type==="context"?(t+=n.lines,i+=n.lines):(t+=Math.max(n.additions,n.deletions),i+=n.additions+n.deletions);e.splitLineCount=t,e.unifiedLineCount=i}function Li(e){let t=0,i=0,n=0;for(const r of e.hunks)r.collapsedBefore=Math.max(ae(r.additionStart,r.additionCount)-n,0),r.splitLineStart=t+r.collapsedBefore,r.unifiedLineStart=i+r.collapsedBefore,zn(r),t+=r.collapsedBefore+r.splitLineCount,i+=r.collapsedBefore+r.unifiedLineCount,n=ne(r.additionStart,r.additionCount);if(e.hunks.length>0){const r=e.hunks[e.hunks.length-1],o=Math.max(e.additionLines.length-ne(r.additionStart,r.additionCount),0);t+=o,i+=o}e.splitLineCount=t,e.unifiedLineCount=i}const Jr=new WeakMap;function Nh(e){return e.length>1&&e[e.length-1]===""?e.slice(0,-1):e}function Fh(e,t){const i=Math.min(e.length,t.length);let n=0;for(;n<i&&e[n]===t[n];)n++;let r=e.length,o=t.length;for(;r>n&&o>n&&e[r-1]===t[o-1];)r--,o--;if(!(n===r&&n===o))return{start:n,deletionEnd:r,additionEnd:o}}function xn(e,t,i){const n=e.hunks,r=e.additionLines,o=Nh(r),s=o===r?e:{...e,additionLines:o},l=Kh(n,Wh(s,t,i),e.deletionLines.length),a=Qh(s,l);if(e.additionLines=o,e.hunks=a,e.editSessionDirty=!0,tp(e),Bs(e,r),!!Yh(n,e.hunks))return{regions:l.map(d=>d.previousSpan)}}function Vh(e,t,i,n){const r=new Set(t),o=Array.from(r).filter(u=>u>=0&&u<e.additionLines.length).sort((u,c)=>u-c);if(o.length===0)return;const s=u=>r.has(u)?n?.get(u):e.additionLines[u],{hunks:l}=e;let a,d=0;for(const u of o){for(;d<l.length;){const h=l[d];if(u<ui(h)+h.additionCount)break;d++}const c=l[d],f=c==null?void 0:ui(c);if(f==null||u<f||a!=null&&a!==d)return xn(e,i,s);a=d}if(a!=null){if($h(e,o,a,n,i)){e.editSessionDirty=!0;return}return xn(e,i,s)}}function $h(e,t,i,n,r){if(n==null||r?.ignoreWhitespace===!0||r?.stripTrailingCr===!0)return!1;const o=Uh(e),s=e.hunks[i];if(s.hunkContent.some(zh))return!1;for(const l of t){const a=n.get(l),d=e.additionLines[l];if(a==null||d==null||o.has(a)||o.has(d))return!1;let u=!1;for(const c of s.hunkContent)if(c.type==="change"&&c.additions===c.deletions&&l>=c.additionLineIndex&&l<c.additionLineIndex+c.additions){u=!0;break}if(!u)return!1}return!0}function Uh(e){const t=Jr.get(e);if(t?.lines===e.deletionLines)return t.set;const i=new Set(e.deletionLines);return Jr.set(e,{lines:e.deletionLines,set:i}),i}function zh(e){return e?.type==="change"&&(e.additions===0||e.deletions===0)}function Bh(e,t){const i=new Map,{regions:n}=t;for(let r=0;r<=n.length;r++){const o=n[r-1],s=n[r],l=r===0?e.get(0):o==null?void 0:e.get(o.lastIndex+1),a=s==null?void 0:e.get(s.firstIndex),d=l?.fromStart??0,u=a?.fromEnd??0;(d>0||u>0)&&i.set(r,{fromStart:d,fromEnd:u})}return i}function Gh(e,t,i){const n=[];if(e.isPartial)return n;for(const[o,s]of e.hunks.entries()){const l=De({isPartial:e.isPartial,rangeSize:s.collapsedBefore,expandedHunks:t,hunkIndex:o,collapsedContextThreshold:i});if(l.rangeSize<=i)continue;const a=tt(s),d=a-l.rangeSize;l.fromStart>0&&n.push([d,d+l.fromStart]),l.fromEnd>0&&n.push([a-l.fromEnd,a])}const r=Pe({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:t,collapsedContextThreshold:i,errorPrefix:"captureExpansionAnchors"});if(r!=null&&r.fromStart>0&&r.rangeSize>i){const o=e.hunks[e.hunks.length-1],s=tt(o)+o.deletionCount;n.push([s,s+r.fromStart])}return n}function jh(e,t){const i=new Map;if(t.length===0)return i;const n=(o,s,l)=>{if(l<=s)return;let a=0,d=0;for(const[u,c]of t)c<=s||u>=l||(u<=s&&(a=Math.max(a,Math.min(c,l)-s)),c>=l&&(d=Math.max(d,l-Math.max(u,s))));(a>0||d>0)&&i.set(o,{fromStart:a,fromEnd:d})};for(const[o,s]of e.hunks.entries()){const l=tt(s);n(o,l-Math.max(s.collapsedBefore,0),l)}const r=e.hunks[e.hunks.length-1];return r!=null&&!e.isPartial&&e.deletionLines.length>0&&n(e.hunks.length,tt(r)+r.deletionCount,e.deletionLines.length),i}function Qr(e,t){return e.editSessionDirty!==!0?!1:(delete e.editSessionDirty,Object.assign(e,e.additionLines.length<=1&&e.additionLines.join("")===""?Ae(e,t):zs(e,t)),!0)}function Wh(e,t,i){if(Fh(e.deletionLines,e.additionLines)==null)return[];const n=Ge({name:e.prevName??e.name,contents:e.deletionLines.join("")},{name:e.name,contents:e.additionLines.join(""),lang:e.lang},t);let r;const o=(d,u)=>{r??=qh(e.hunks);for(let c=0;c<=u;c++){const f=r.get(d.deletionLineIndex-c);if(!(f==null||f.additions!==d.additions||f.deletions!==d.deletions)){if(d.additions>0&&i!=null){for(let h=0;h<d.additions;h++)if(i(f.additionLineIndex+h)!==n.additionLines[d.additionLineIndex+h])return u}return c}}return u},s=[];let l=0,a=0;for(const d of n.hunks){uh(d,n,o);const u=d.additionCount>0?d.additionLineIndex-l:d.deletionLineIndex-a;l+=u,a+=u;for(const c of d.hunkContent){if(c.type==="context"){l+=c.lines,a+=c.lines;continue}const f=js(c,0,0);f.additions===0&&(f.additionLineIndex=l),f.deletions===0&&(f.deletionLineIndex=a),s.push(f),l+=f.additions,a+=f.deletions}}return s}function qh(e){const t=new Map;for(const i of e)for(const n of i.hunkContent)n.type==="change"&&(n.additions===0||n.deletions===0)&&t.set(n.deletionLineIndex,n);return t}function Kh(e,t,i){const n=e.map((s,l)=>{const a=tt(s);return{deletionStart:a,deletionEnd:a+s.deletionCount,blocks:[],previousSpan:{firstIndex:l,lastIndex:l}}}),r=[];let o=0;for(const s of t){const l=s.deletionLineIndex,a=l+s.deletions;for(;o<n.length&&n[o].deletionEnd<l;)r.push(n[o]),o++;let d=r.length>0&&Xh(l,a,r[r.length-1])?r.pop():void 0;for(;o<n.length&&n[o].deletionStart<=a;)d=Jh(d,n[o]),o++;if(d==null){let u=l,c=a;if((s.deletions===0||s.additions===0)&&i>s.deletions){const f=r[r.length-1]?.deletionEnd??0,h=n[o]?.deletionStart??i;l>f?u--:a<h&&c++}d={deletionStart:u,deletionEnd:c,blocks:[],previousSpan:void 0}}d.deletionStart=Math.min(d.deletionStart,l),d.deletionEnd=Math.max(d.deletionEnd,a),d.blocks.push(s),r.push(d)}for(;o<n.length;)r.push(n[o]),o++;return r}function Xh(e,t,i){return e<=i.deletionEnd&&t>=i.deletionStart}function Jh(e,t){return e==null?t:(e.deletionStart=Math.min(e.deletionStart,t.deletionStart),e.deletionEnd=Math.max(e.deletionEnd,t.deletionEnd),e.blocks.push(...t.blocks),t.previousSpan!=null&&(e.previousSpan??={...t.previousSpan},e.previousSpan.firstIndex=Math.min(e.previousSpan.firstIndex,t.previousSpan.firstIndex),e.previousSpan.lastIndex=Math.max(e.previousSpan.lastIndex,t.previousSpan.lastIndex)),e)}function Qh(e,t){const i=[];let n=0,r=0;for(const o of t){const s=o.deletionStart-n;if(s<0)throw new Error("buildRegionHunks: overlapping old-side regions");n+=s,r+=s;const l=r,a=[];for(const u of o.blocks){const c=u.deletionLineIndex-n,f=u.additionLineIndex-r;if(c<0||c!==f)throw new Error("buildRegionHunks: canonical block context mismatch");Zr(a,c,r,n),n+=c,r+=f,a.push({...u}),n+=u.deletions,r+=u.additions}const d=o.deletionEnd-n;if(d<0)throw new Error("buildRegionHunks: block exceeds its old-side region");Zr(a,d,r,n),n+=d,r+=d,i.push(Zh(e,{additionStart:l,additionEnd:r,deletionStart:o.deletionStart,deletionEnd:o.deletionEnd},a))}if(e.deletionLines.length-n!==e.additionLines.length-r)throw new Error("buildRegionHunks: trailing context mismatch");return i}function Zh(e,t,i){const n=t.additionEnd-t.additionStart,r=t.deletionEnd-t.deletionStart;let o=0,s=0;for(const a of i)a.type==="change"&&(o+=a.additions,s+=a.deletions);const l={collapsedBefore:0,additionStart:Gt(t.additionStart,n),additionCount:n,additionLines:o,additionLineIndex:eo(t.additionStart,n),deletionStart:Gt(t.deletionStart,r),deletionCount:r,deletionLines:s,deletionLineIndex:eo(t.deletionStart,r),hunkContent:i,hunkSpecs:`@@ -${Gt(t.deletionStart,r)},${r} +${Gt(t.additionStart,n)},${n} @@`,splitLineStart:0,splitLineCount:0,unifiedLineStart:0,unifiedLineCount:0,noEOFCRAdditions:!1,noEOFCRDeletions:!1};return zn(l),l}function Zr(e,t,i,n){t>0&&e.push({type:"context",lines:t,additionLineIndex:i,deletionLineIndex:n})}function Yh(e,t){if(e.length!==t.length)return!0;for(let i=0;i<e.length;i++){const n=e[i],r=t[i];if(tt(n)!==tt(r)||n.deletionCount!==r.deletionCount||ui(n)!==ui(r)||n.additionCount!==r.additionCount||n.splitLineCount!==r.splitLineCount||!ep(n,r))return!0}return!1}function ep(e,t){const i=Yr(e),n=Yr(t);for(;;){const r=i.next(),o=n.next();if(r.done===!0||o.done===!0)return r.done===o.done;if(r.value[0]!==o.value[0]||r.value[1]!==o.value[1])return!1}}function*Yr(e){for(const t of e.hunkContent){if(t.type==="context"){for(let n=0;n<t.lines;n++)yield[t.deletionLineIndex+n,t.additionLineIndex+n];continue}const i=Math.max(t.deletions,t.additions);for(let n=0;n<i;n++)yield[n<t.deletions?t.deletionLineIndex+n:void 0,n<t.additions?t.additionLineIndex+n:void 0]}}function ui(e){return ae(e.additionStart,e.additionCount)}function tt(e){return ae(e.deletionStart,e.deletionCount)}function Gt(e,t){return t===0?e:e+1}function eo(e,t){return t===0?e-1:e}function tp(e){Li(e);for(let t=0;t<e.hunks.length;t++)Gs(e,t)}function jt(e){return H({tagName:"div",properties:{"data-content-buffer":"","data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function Wt(e){return H({tagName:"div",children:[H({tagName:"span",children:[be("No newline at end of file")]})],properties:{"data-no-newline":"","data-line-type":e,"data-column-content":""}})}function qi(e){return H({tagName:"div",children:[si({name:e==="both"?"diffs-icon-expand-all":"diffs-icon-expand",properties:{"data-icon":""}})],properties:{role:"button","data-expand-button":"","data-expand-both":e==="both"?"":void 0,"data-expand-up":e==="up"?"":void 0,"data-expand-down":e==="down"?"":void 0}})}function ot({type:e,content:t,expandIndex:i,chunked:n=!1,slotName:r,isFirstHunk:o,isLastHunk:s}){let l=0;const a=[];if(e==="metadata"&&t!=null&&a.push(H({tagName:"div",children:[be(t)],properties:{"data-separator-wrapper":""}})),(e==="line-info"||e==="line-info-basic")&&t!=null){const d=[];i!=null&&(n?(o||(d.push(qi("up")),l++),s||(d.push(qi("down")),l++)):(d.push(qi(!o&&!s?"both":o?"down":"up")),l++)),d.push(H({tagName:"div",children:[H({tagName:"span",children:[be(t)],properties:{"data-unmodified-lines":""}})],properties:{"data-separator-content":""}})),n&&i!=null&&d.push(H({tagName:"div",children:[be("Expand all")],properties:{role:"button","data-expand-button":"","data-expand-all-button":""}})),a.push(H({tagName:"div",children:d,properties:{"data-separator-wrapper":"","data-separator-multi-button":l>1?"":void 0}}))}return e==="custom"&&r!=null&&a.push(H({tagName:"slot",properties:{name:r}})),H({tagName:"div",children:a,properties:{"data-separator":a.length===0?"simple":e,"data-expand-index":i,"data-separator-first":o?"":void 0,"data-separator-last":s?"":void 0}})}function ip(e,t){return`hunk-separator-${e}-${t}`}function np(e){const t=e.at(-1);return t==null?0:Math.max(ne(t.additionStart,t.additionCount),ne(t.deletionStart,t.deletionCount))}let rp=-1;var op=class{options;annotationSlotName;onRenderUpdate;workerManager;__id=`diff-hunks-renderer:${++rp}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLangs=["text"];renderCache;pendingHighlightResult;pendingStructuralRows;editSessionActive=!1;constructor(e={theme:_e},t=Je,i,n){this.options=e,this.annotationSlotName=t,this.onRenderUpdate=i,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=lt(e.theme??_e)?pn():void 0)}cleanUp(){this.endEditSession(),this.recycle(),this.expandedHunks.clear(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.highlighter=void 0,this.diff=void 0,this.editSessionActive?(this.renderCache!=null&&(this.renderCache.renderRange=void 0),this.pendingHighlightResult=void 0,this.pendingStructuralRows=void 0):this.clearRenderCache(),this.additionAnnotations={},this.deletionAnnotations={},this.workerManager?.cleanUpTasks(this)}beginEditSession(e,t){const{editSessionActive:i}=this;this.editSessionActive=!0,i||(this.pendingHighlightResult=void 0),this.diff=e,i&&this.renderCache!=null&&this.renderCache.diff!==e&&this.clearRenderCache();const{renderCache:n}=this;if(!e.isPartial&&e.additionLines.length===0){Object.assign(e,Yt(e,this.options.parseDiffOptions)),this.markEditSessionPass(e),this.clearRenderCache();return}if(n==null||i&&n.diff===e)return;const{options:r}=this.getRenderOptions(e),o=n.diff===e,s=t!=null&&G(n.diff,t),{result:l}=n;if(!n.highlighted||l==null||!Ce(n.options,r)||!o&&!s){this.clearRenderCache();return}o||(this.renderCache={diff:e,options:r,highlighted:!0,result:{...l,code:{...l.code,additionLines:[...l.code.additionLines]}},renderRange:n.renderRange})}endEditSession(){this.editSessionActive=!1,this.pendingHighlightResult=void 0,this.diff==null&&this.clearRenderCache()}editorRenderReady(){return this.renderCache?.options.useTokenTransformer===!0&&this.renderCache.highlighted&&this.renderCache.result!=null}refreshHighlightedResult(){const{diff:e,renderCache:t,workerManager:i}=this;return e==null||t==null||!G(t.diff,e)||Et(e)||yt(e,this.getTokenizeMaxLength())?Promise.resolve():!this.editSessionActive&&i?.isWorkingPool()===!0&&e.cacheKey!=null?(i.evictDiffFromCache(e.cacheKey),i.primeDiffHighlightCache(e).then(()=>{this.applyRefreshedResult(e,i.getDiffResultCache(e))}).catch(n=>this.onHighlightError(n))):this.asyncHighlight(e).then(n=>this.applyRefreshedResult(e,n)).catch(n=>this.onHighlightError(n))}applyRefreshedResult(e,t){const{diff:i,renderCache:n}=this;if(t==null||i==null||n==null||!G(i,e)||!G(n.diff,e)||this.editSessionActive)return;const{options:r}=this.getRenderOptions(i);Ce(r,t.options)&&(this.pendingHighlightResult={diff:i,options:t.options,highlighted:!0,result:t.result},this.onRenderUpdate?.())}get diffCache(){return this.renderCache?.diff??this.diff}clearRenderCache(){this.renderCache=void 0,this.pendingHighlightResult=void 0,this.pendingStructuralRows=void 0}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,i=this.getOptionsWithDefaults().expansionLineCount){const n={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};(t==="up"||t==="both")&&(n.fromStart+=i),(t==="down"||t==="both")&&(n.fromEnd+=i),this.renderCache?.highlighted!==!0&&this.clearRenderCache(),this.expandedHunks.set(e,n)}getExpandedHunk(e){return this.expandedHunks.get(e)??ha}getExpandedHunksMap(){return this.expandedHunks}setExpandedHunksMap(e){this.expandedHunks=e}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(const t of e){const i=(()=>{switch(t.side){case"deletions":return this.deletionAnnotations;case"additions":return this.additionAnnotations}})(),n=i[t.lineNumber]??[];i[t.lineNumber]=n,n.push(t)}}updateRenderCache(e,t,i=!1){this.pendingStructuralRows=void 0;const{renderCache:n}=this;if(n==null)return!1;const{result:r,diff:o}=n;if(r==null)return!1;if(o.isPartial)throw new Error("Could not update render cache for partial diff");const s=r.code.additionLines,l=this.pendingStructuralRows=i?new Map:void 0,a=[],d=new Map;for(const[c,f]of e){const h=s[c]?.properties??{},m=f.map(b=>b[2]).join(""),g=c<o.additionLines.length,y=g?o.additionLines[c]??"":"",v=Oe(y);l==null&&g&&(o.additionLines[c]=ff(y,m),v!==m&&(a.push(c),d.set(c,y)));const _={type:"element",tagName:"div",properties:{"data-line":h["data-line"]??c+1,"data-line-index":h["data-line-index"]??c,"data-line-type":h["data-line-type"]??"context"},children:f.map(([b,L,E])=>b===0&&L===""?E===""?{type:"element",tagName:"br",properties:{},children:[]}:{type:"text",value:E}:{type:"element",tagName:"span",properties:{"data-char":b,style:`color:${L};`},children:[{type:"text",value:E}]})};l!=null?l.set(c,_):s[c]=_}let u=!1;if(a.length>0)if(this.editSessionActive)if(o.additionLines.length<=1&&o.additionLines.join("")==="")this.applyRecomputePreservingSessionType(o,Yt(o,this.options.parseDiffOptions)),u=!0;else if(kn(o,o.additionLines))this.applyRecomputePreservingSessionType(o,di(o,o.additionLines,this.options.parseDiffOptions)),u=!0;else{const c=Vh(o,a,this.options.parseDiffOptions,d);this.applyExpansionRemap(c),u=c!=null}else Object.assign(o,Dh(o,a,this.options.parseDiffOptions));return r.baseThemeType=t,n.isDirty=!0,u}applyExpansionRemap(e){e!=null&&(this.expandedHunks=Bh(this.expandedHunks,e))}applyDocumentChange(e){const{pendingStructuralRows:t,renderCache:i}=this;this.pendingStructuralRows=void 0;const n=this.diff??i?.diff;if(n==null)return;const r=i?.result;if(n.isPartial)throw new Error("Could not apply document change for partial diff");const{additionLines:o}=n;if(n.additionLines=dp(e),r!=null&&(r.code.additionLines=lp(o,n.additionLines,r.code.additionLines,e)),n.additionLines.length<=1&&n.additionLines.join("")===""?(this.applyRecomputePreservingSessionType(n,Yt(n,this.options.parseDiffOptions)),r!=null&&(r.code.additionLines[0]=An(0,e.getLineText(0)))):this.editSessionActive?this.applySessionDocumentChange(n,o):Object.assign(n,zs(n,this.options.parseDiffOptions)),t!=null&&r!=null)for(const[s,l]of t)s<r.code.additionLines.length&&(r.code.additionLines[s]=l);i!=null&&(i.isDirty=!0)}applySessionDocumentChange(e,t){const{parseDiffOptions:i}=this.options,n=e.additionLines;if(kn(e,n)){this.applyRecomputePreservingSessionType(e,di(e,n,i));return}this.applyExpansionRemap(xn(e,i,r=>t[r]))}applyRecomputePreservingSessionType(e,t){const i=this.editSessionActive?e.type:void 0;Object.assign(e,t),i!=null&&(e.type=i),this.markEditSessionPass(e)}markEditSessionPass(e){this.editSessionActive&&(e.editSessionDirty=!0)}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e,contentProperties:{"data-line-type":e}}}getSplitLineDecoration({side:e,type:t}){const i=t==="change"?e==="deletions"?"change-deletion":"change-addition":t;return{gutterLineType:i,contentProperties:{"data-line-type":i}}}createAnnotationElement=e=>hf(e);getOptionsWithDefaults(){const{diffIndicators:e="bars",diffStyle:t="split",disableBackground:i=!1,disableFileHeader:n=!1,disableLineNumbers:r=!1,disableVirtualizationBuffers:o=!1,collapsed:s=!1,expandUnchanged:l=!1,collapsedContextThreshold:a=1,expansionLineCount:d=100,hunkSeparators:u="line-info",lineDiffType:c="word-alt",maxLineDiffLength:f=1e3,overflow:h="scroll",stickyHeader:m=!1,theme:g=_e,headerRenderMode:y="default",tokenizeMaxLineLength:v=1e3,tokenizeMaxLength:_=ca,useTokenTransformer:b=!1,useCSSClasses:L=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:i,disableFileHeader:n,disableLineNumbers:r,disableVirtualizationBuffers:o,collapsed:s,expandUnchanged:l,collapsedContextThreshold:a,expansionLineCount:d,hunkSeparators:u,lineDiffType:c,maxLineDiffLength:f,overflow:h,stickyHeader:m,theme:this.workerManager?.getDiffRenderOptions().theme??g,headerRenderMode:y,tokenizeMaxLineLength:v,tokenizeMaxLength:_,useTokenTransformer:b,useCSSClasses:L}}async initializeHighlighter(){return this.highlighter=await ms(Ef(this.computedLangs,{theme:this.getLocalHighlightTheme(),preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter})),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;const{options:t}=this.getRenderOptions(e),i=yt(e,this.getTokenizeMaxLength());let n=this.workerManager?.getDiffResultCache(e);n!=null&&!Ce(t,n.options)&&(n=void 0),this.renderCache??={diff:e,hydrated:!0,highlighted:!i&&!Et(e),options:t,result:i?void 0:n?.result,renderRange:void 0},!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!i&&this.workerManager.highlightDiffAST(this,this.diff):this.highlighter==null&&(this.computedLangs=Xi(e),this.initializeHighlighter())}getLocalHighlightTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??_e}getEffectiveCodeOptions(){const e=this.workerManager?.isWorkingPool()===!0?this.workerManager.getDiffRenderOptions():void 0;return{theme:this.getLocalHighlightTheme(),tokenizeMaxLineLength:e?.tokenizeMaxLineLength??this.options.tokenizeMaxLineLength}}getRenderOptions(e){const t=(()=>{if(this.workerManager?.isWorkingPool()===!0){const l=this.workerManager.getDiffRenderOptions();return this.editSessionActive&&l.useTokenTransformer!==!0?{...l,useTokenTransformer:!0}:l}const{theme:n,tokenizeMaxLineLength:r,lineDiffType:o,maxLineDiffLength:s}=this.getOptionsWithDefaults();return{theme:n,useTokenTransformer:this.editSessionActive||this.options.useTokenTransformer===!0,tokenizeMaxLineLength:r,lineDiffType:o,maxLineDiffLength:s}})();this.getOptionsWithDefaults();const{renderCache:i}=this;return i?.result==null?{options:t,forceHighlight:!0}:!G(e,i.diff)||!Ce(t,i.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}getDiffForNextRender(e){const{options:t}=this.getRenderOptions(e);if(this.getReadyRenderResult(e,t)!=null||this.renderCache==null)return e;if(G(this.renderCache.diff,e))return this.renderCache.diff;const i=!(e.additionLines.length>0||e.deletionLines.length>0)||Et(e)||yt(e,this.getTokenizeMaxLength());return this.canRenderDiff(e,t,i)?e:this.renderCache.diff}canRenderDiff(e,t,i){const{renderCache:n}=this;return n==null||G(n.diff,e)?!0:i?n.result==null&&n.hydrated!==!0||this.workerManager?.isWorkingPool()===!0||this.highlighter!=null&&lt(t.theme):n.result==null&&n.hydrated!==!0?!0:!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0?!n.highlighted:this.highlighter!=null&&lt(t.theme)}renderDiff(e=this.diff,t=Gn){if(this.diff=e,e==null){this.pendingHighlightResult=void 0;return}const{expandUnchanged:i,collapsedContextThreshold:n}=this.getOptionsWithDefaults();let{options:r,forceHighlight:o}=this.getRenderOptions(e);const s=this.getReadyRenderResult(e,r);this.pendingHighlightResult=void 0,s!=null&&(this.renderCache={...s,diff:e,renderRange:void 0},o=!1),this.renderCache??={diff:e,highlighted:!1,options:r,result:void 0,renderRange:void 0};const l=e.additionLines.length>0||e.deletionLines.length>0,a=!l||Et(e)||yt(e,this.getTokenizeMaxLength()),d=this.canRenderDiff(e,r,a),u=!G(e,this.renderCache.diff),c=!Rs(this.renderCache.renderRange,t);if(!this.editSessionActive&&this.workerManager?.isWorkingPool()===!0){const f=this.renderCache.result==null&&this.renderCache.highlighted&&!a&&!u&&bn(t);d&&!f&&(a||this.renderCache.result==null||!this.renderCache.highlighted&&(u||c))&&(this.renderCache.diff=e,this.renderCache.options=r,this.renderCache.highlighted=!1,(this.renderCache.result==null||u||c||o)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,bn(t)||i?!0:this.expandedHunks,n)),this.renderCache.renderRange=t),!a&&l&&(!this.renderCache.highlighted||o)&&this.workerManager.highlightDiffAST(this,e)}else{this.computedLangs=Xi(e),this.highlighter??=pn();const f=this.highlighter!=null&&lt(r.theme),h=this.highlighter!=null&&tn(this.computedLangs),m=!a&&h;if(d&&this.highlighter!=null&&f&&(o||a||!this.renderCache.highlighted&&m||this.renderCache.result==null)){const{result:g,options:y}=this.renderDiffWithHighlighter(e,this.highlighter,a||!h);this.renderCache={diff:e,options:y,highlighted:m,result:g,renderRange:void 0}}(!f||!a&&!h)&&this.asyncHighlight(e).then(({result:g,options:y})=>{this.applyHighlightResult(e,g,y,!a)})}return this.renderCache.result!=null?this.processDiffResult(this.renderCache.diff,t,this.renderCache.result):void 0}async asyncRender(e,t=Gn){this.diff=e;const{result:i}=await this.asyncHighlight(e);return this.processDiffResult(e,t,i)}createPreElement(e,t,i){const{diffIndicators:n,disableBackground:r,disableLineNumbers:o,overflow:s}=this.getOptionsWithDefaults();return bf({type:"diff",diffIndicators:n,disableBackground:r,disableLineNumbers:o,overflow:s,split:e,totalLines:t,customProperties:i})}async asyncHighlight(e){const t=yt(e,this.getTokenizeMaxLength());this.computedLangs=t?["text"]:Xi(e);const i=this.highlighter!=null&&lt(this.getLocalHighlightTheme()),n=t||this.highlighter!=null&&tn(this.computedLangs);return(this.highlighter==null||!i||!n)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,i=!1){const{options:n}=this.getRenderOptions(e),{collapsedContextThreshold:r}=this.getOptionsWithDefaults(),o=Vc(e,t,n,{forcePlainText:i,expandedHunks:i?!0:void 0,collapsedContextThreshold:r});if(this.editSessionActive&&e.additionLines.length===1&&e.additionLines[0]===""&&o.code.additionLines[0]==null){let s;if(Ye({diff:e,diffStyle:"both",expandedHunks:i?!0:void 0,collapsedContextThreshold:r,callback:({additionLine:l})=>{if(l?.lineIndex===0)return s=l,!0}}),s==null)throw new Error("DiffHunksRenderer: missing empty addition line");o.code.additionLines[0]=An(0,"",s.unifiedLineIndex,s.splitLineIndex)}return{result:o,options:n}}onHighlightSuccess(e,t,i,n=!0){this.editSessionActive||this.applyHighlightResult(e,t,i,n)}applyHighlightResult(e,t,i,n=!0){const{diff:r,renderCache:o}=this;r==null||o==null||!G(r,e)||!Ce(i,this.getRenderOptions(r).options)||(o.result==null||!o.highlighted||!Ce(o.options,i)||!G(o.diff,r))&&(this.pendingHighlightResult={diff:r,options:i,highlighted:n,result:t},this.onRenderUpdate?.())}getMatchingWorkerResultCache(e,t){if(this.editSessionActive)return;const i=this.workerManager?.getDiffResultCache(e);if(!(i==null||!Ce(t,i.options)))return i}getReadyRenderResult(e,t){const{pendingHighlightResult:i}=this;if(i!=null&&G(i.diff,e)&&Ce(i.options,t))return i;const n=this.getMatchingWorkerResultCache(e,t);if(!(n==null||this.hasHighlightedRenderCache(e,t)))return{diff:e,highlighted:!0,...n}}hasHighlightedRenderCache(e,t){const{renderCache:i}=this;return i?.result!=null&&i.highlighted&&G(e,i.diff)&&Ce(t,i.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??1e5}processDiffResult(e,t,{code:i,themeStyles:n,baseThemeType:r}){const{diffStyle:o,disableFileHeader:s,expandUnchanged:l,expansionLineCount:a,collapsedContextThreshold:d,hunkSeparators:u}=this.getOptionsWithDefaults(),c=this.renderCache?.isDirty??!1,f=o==="unified",h=up(e,this.options.loadDiffFiles!=null),m=!e.isPartial||h;let g=[],y=[],v=[];const _=[],{additionLines:b,deletionLines:L}=i,E={rowCount:0,hunkSeparators:u,additionsContentAST:g,deletionsContentAST:y,unifiedContentAST:v,unifiedGutterAST:Nt(),deletionsGutterAST:Nt(),additionsGutterAST:Nt(),expansionLineCount:a,hunkData:_,incrementRowCount(T=1){E.rowCount+=T},pushToGutter(T,M){switch(T){case"unified":E.unifiedGutterAST.children.push(M);break;case"deletions":E.deletionsGutterAST.children.push(M);break;case"additions":E.additionsGutterAST.children.push(M)}}},S=bs({fileDiff:e,errorPrefix:"DiffHunksRenderer.processDiffResult"}),C={size:0,side:void 0,increment(){this.size+=1},flush(){if(o!=="unified"){if(this.size<=0||this.side==null){this.side=void 0,this.size=0;return}this.side==="additions"?(E.pushToGutter("additions",ue(void 0,"buffer",this.size)),g?.push(jt(this.size))):(E.pushToGutter("deletions",ue(void 0,"buffer",this.size)),y?.push(jt(this.size))),this.size=0,this.side=void 0}}},x=(T,M,V,P,N)=>{E.pushToGutter(T,ec(M,V,P,N))};function w(T){C.flush(),o==="unified"?Ki("unified",T,E):(Ki("deletions",T,E),Ki("additions",T,E))}this.pushFileLevelAnnotations(e,o,t,E),Ye({diff:e,diffStyle:o,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:l?!0:this.expandedHunks,collapsedContextThreshold:d,callback:({hunkIndex:T,hunk:M,collapsedBefore:V,collapsedAfter:P,additionLine:N,deletionLine:$,type:B})=>{const Y=$!=null?$.splitLineIndex:N.splitLineIndex,re=N!=null?N.unifiedLineIndex:$.unifiedLineIndex;o==="split"&&B!=="change"&&C.flush(),V>0&&w({hunkIndex:T,collapsedLines:V,rangeSize:Math.max(M?.collapsedBefore??0,0),hunkSpecs:M?.hunkSpecs,isFirstHunk:T===0,isLastHunk:!1,isExpandable:m});const pe=o==="unified"?re:Y,Me={type:B,hunkIndex:T,lineIndex:pe,unifiedLineIndex:re,splitLineIndex:Y,deletionLine:$,additionLine:N};if(o==="unified"){const j=this.getUnifiedInjectedRowsForLine?.(Me);j?.before!=null&&to(j.before,E);let te=$!=null?L[$.lineIndex]:void 0,oe=N!=null?b[N.lineIndex]:void 0;if(te==null&&oe==null){const de="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(de,{file:e.name}),new Error(de)}const We=B==="change"?N!=null?"change-addition":"change-deletion":B,le=this.getUnifiedLineDecoration({type:B,lineType:We,additionLineIndex:N?.lineIndex,deletionLineIndex:$?.lineIndex});x("unified",le.gutterLineType,N!=null?N.lineNumber:$.lineNumber,`${re},${Y}`,le.gutterProperties),oe!=null?oe=Kt(oe,le.contentProperties,c&&N!=null?{"data-line":N.lineNumber,"data-line-index":`${re},${Y}`}:void 0):te!=null&&(te=Kt(te,le.contentProperties,c&&$!=null?{"data-line":$.lineNumber,"data-line-index":`${re},${Y}`}:void 0)),qt({diffStyle:"unified",type:B,deletionLine:te,additionLine:oe,unifiedSpan:this.getAnnotations("unified",$?.lineNumber,N?.lineNumber,T,pe),createAnnotationElement:de=>this.createAnnotationElement(de),context:E}),j?.after!=null&&to(j.after,E)}else{const j=this.getSplitInjectedRowsForLine?.(Me);j?.before!=null&&io(j.before,E,C);let te=$!=null?L[$.lineIndex]:void 0,oe=N!=null?b[N.lineIndex]:void 0;const We=this.getSplitLineDecoration({side:"deletions",type:B,lineIndex:$?.lineIndex}),le=this.getSplitLineDecoration({side:"additions",type:B,lineIndex:N?.lineIndex});if(te==null&&oe==null){const ie="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(ie,{file:e.name}),new Error(ie)}const de=(()=>{if(B==="change"){if(oe==null)return"additions";if(te==null)return"deletions"}})();de!=null?(C.side!=null&&C.side!==de&&C.flush(),C.side=de,C.increment()):B==="change"&&C.flush();const He=this.getAnnotations("split",$?.lineNumber,N?.lineNumber,T,pe);if(He!=null&&C.size>0&&C.flush(),$!=null){const ie=Kt(te,We.contentProperties,c?{"data-line":$.lineNumber,"data-line-index":`${$.unifiedLineIndex},${Y}`}:void 0);x("deletions",We.gutterLineType,$.lineNumber,`${$.unifiedLineIndex},${Y}`,We.gutterProperties),ie!=null&&(te=ie)}if(N!=null){const ie=Kt(oe,le.contentProperties,c?{"data-line":N.lineNumber,"data-line-index":`${N.unifiedLineIndex},${Y}`}:void 0);x("additions",le.gutterLineType,N.lineNumber,`${N.unifiedLineIndex},${Y}`,le.gutterProperties),ie!=null&&(oe=ie)}qt({diffStyle:"split",type:B,additionLine:oe,deletionLine:te,...He,createAnnotationElement:ie=>this.createAnnotationElement(ie),context:E}),j?.after!=null&&io(j.after,E,C)}const mt=o==="split"&&M!=null&&Y===M.splitLineStart+M.splitLineCount-1,ye=T===e.hunks.length-1&&M!=null&&(o==="split"?Y===M.splitLineStart+M.splitLineCount-1:re===M.unifiedLineStart+M.unifiedLineCount-1),Ci=mt?M.noEOFCRDeletions:!1,wi=mt?M.noEOFCRAdditions:!1,je=($?.noEOFCR??!1)||Ci,Ee=(N?.noEOFCR??!1)||wi;if(Ee||je){if(o==="split"&&C.flush(),je){const j=B==="context"||B==="context-expanded"?B:"change-deletion";o==="unified"?(E.unifiedContentAST.push(Wt(j)),E.pushToGutter("unified",ue(j,"metadata",1))):(E.deletionsContentAST.push(Wt(j)),E.pushToGutter("deletions",ue(j,"metadata",1)),Ee||(E.pushToGutter("additions",ue(void 0,"buffer",1)),E.additionsContentAST.push(jt(1))))}if(Ee){const j=B==="context"||B==="context-expanded"?B:"change-addition";o==="unified"?(E.unifiedContentAST.push(Wt(j)),E.pushToGutter("unified",ue(j,"metadata",1))):(E.additionsContentAST.push(Wt(j)),E.pushToGutter("additions",ue(j,"metadata",1)),je||(E.pushToGutter("deletions",ue(void 0,"buffer",1)),E.deletionsContentAST.push(jt(1))))}E.incrementRowCount(1)}u!=="simple"&&u!=="metadata"&&(P>0||ye&&h)&&w({hunkIndex:B==="context-expanded"?T:T+1,collapsedLines:ye&&h?"unknown":P,rangeSize:S,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:m}),E.incrementRowCount(1)}}),o==="split"&&C.flush();const A=Math.max(np(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),I=t.bufferBefore>0||t.bufferAfter>0,k=!f&&e.type!=="deleted",R=!f&&e.type!=="new",D=E.rowCount>0||I;g=k&&D?g:void 0,y=R&&D?y:void 0,v=f&&D?v:void 0;const F=this.createPreElement(y!=null&&g!=null,A);return{fileDiff:e,unifiedGutterAST:f&&D?E.unifiedGutterAST.children:void 0,unifiedContentAST:v,deletionsGutterAST:R&&D?E.deletionsGutterAST.children:void 0,deletionsContentAST:y,additionsGutterAST:k&&D?E.additionsGutterAST.children:void 0,additionsContentAST:g,hunkData:_,preNode:F,themeStyles:n,baseThemeType:r,headerElement:s?void 0:this.renderHeader(e),totalLines:A,rowCount:E.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderCodeAST(e,t){const i=e==="unified"?t.unifiedGutterAST:e==="deletions"?t.deletionsGutterAST:t.additionsGutterAST,n=e==="unified"?t.unifiedContentAST:e==="deletions"?t.deletionsContentAST:t.additionsContentAST;if(i==null||n==null)return;const r=Nt(i);return r.properties.style=`grid-row: span ${t.rowCount}`,[r,pf(n,t.rowCount)]}renderFullAST(e,t=[]){const i=this.getOptionsWithDefaults().hunkSeparators==="line-info",n=this.renderCodeAST("unified",e);if(n!=null)return t.push(H({tagName:"code",children:n,properties:{"data-code":"","data-container-size":i?"":void 0,"data-unified":""}})),{...e.preNode,children:t};const r=this.renderCodeAST("deletions",e);r!=null&&t.push(H({tagName:"code",children:r,properties:{"data-code":"","data-container-size":i?"":void 0,"data-deletions":""}}));const o=this.renderCodeAST("additions",e);return o!=null&&t.push(H({tagName:"code",children:o,properties:{"data-code":"","data-container-size":i?"":void 0,"data-additions":""}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return Re(this.renderFullAST(e,t))}renderPartialHTML(e,t){return t==null?Re(e):Re(H({tagName:"code",children:e,properties:{"data-code":"","data-container-size":this.getOptionsWithDefaults().hunkSeparators==="line-info"?"":void 0,[`data-${t}`]:""}}))}pushFileLevelAnnotations(e,t,i,n){if(!ks(i))return;const r=e.type!=="new"?this.getAnnotationNames(Pr(this.deletionAnnotations)):[],o=e.type!=="deleted"?this.getAnnotationNames(Pr(this.additionAnnotations)):[];if(r.length===0&&o.length===0)return;const s=-1,l=-1,{createAnnotationElement:a}=this;if(t==="unified"){qt({diffStyle:t,type:"context",unifiedSpan:{type:"annotation",hunkIndex:s,lineIndex:l,annotations:r.concat(o)},createAnnotationElement:a,context:n});return}qt({diffStyle:t,type:"context",deletionSpan:{type:"annotation",hunkIndex:s,lineIndex:l,annotations:r},additionSpan:{type:"annotation",hunkIndex:s,lineIndex:l,annotations:o},createAnnotationElement:a,context:n})}getAnnotations(e,t,i,n,r){const o={type:"annotation",hunkIndex:n,lineIndex:r,annotations:[]};if(t!=null)for(const l of this.deletionAnnotations[t]??[])o.annotations.push(this.annotationSlotName(l));const s={type:"annotation",hunkIndex:n,lineIndex:r,annotations:[]};if(i!=null)for(const l of this.additionAnnotations[i]??[])(e==="unified"?o:s).annotations.push(this.annotationSlotName(l));if(e==="unified")return o.annotations.length>0?o:void 0;if(!(s.annotations.length===0&&o.annotations.length===0))return{deletionSpan:o,additionSpan:s}}getAnnotationNames(e){return e?.map(t=>this.annotationSlotName(t))??[]}renderHeader(e){const{headerRenderMode:t,stickyHeader:i}=this.getOptionsWithDefaults();return gf({fileOrDiff:e,mode:t,stickyHeader:i})}};const sp=new Intl.PluralRules("en-US");function ap(e){return`${e} unmodified line${sp.select(e)==="one"?"":"s"}`}function to(e,t){for(const i of e)t.unifiedContentAST.push(i.content),t.pushToGutter("unified",i.gutter),t.incrementRowCount(1)}function io(e,t,i){for(const{deletion:n,addition:r}of e){if(n==null&&r==null)continue;const o=n!=null&&r!=null?void 0:n==null?"deletions":"additions";(o==null||i.side!==o)&&i.flush(),n!=null&&(t.deletionsContentAST.push(n.content),t.pushToGutter("deletions",n.gutter)),r!=null&&(t.additionsContentAST.push(r.content),t.pushToGutter("additions",r.gutter)),o!=null&&(i.side=o,i.increment()),t.incrementRowCount(1)}}function qt({diffStyle:e,type:t,deletionLine:i,additionLine:n,unifiedSpan:r,deletionSpan:o,additionSpan:s,createAnnotationElement:l,context:a}){let d=!1;if(e==="unified"){if(n!=null?a.unifiedContentAST.push(n):i!=null&&a.unifiedContentAST.push(i),r!=null){const u=t==="change"?i!=null?"change-deletion":"change-addition":t;a.unifiedContentAST.push(l(r)),a.pushToGutter("unified",ue(u,"annotation",1)),d=!0}}else if(e==="split"){if(i!=null&&a.deletionsContentAST.push(i),n!=null&&a.additionsContentAST.push(n),o!=null){const u=t==="change"?i!=null?"change-deletion":"context":t;a.deletionsContentAST.push(l(o)),a.pushToGutter("deletions",ue(u,"annotation",1)),d=!0}if(s!=null){const u=t==="change"?n!=null?"change-addition":"context":t;a.additionsContentAST.push(l(s)),a.pushToGutter("additions",ue(u,"annotation",1)),d=!0}}d&&a.incrementRowCount(1)}function Ki(e,{hunkIndex:t,collapsedLines:i,rangeSize:n,hunkSpecs:r,isFirstHunk:o,isLastHunk:s,isExpandable:l},a){if(typeof i=="number"&&i<=0)return;const d=e==="unified"?a.unifiedContentAST:e==="deletions"?a.deletionsContentAST:a.additionsContentAST;if(a.hunkSeparators==="metadata"){r!=null&&(a.pushToGutter(e,ot({type:"metadata",content:r,isFirstHunk:o,isLastHunk:s})),d.push(ot({type:"metadata",content:r,isFirstHunk:o,isLastHunk:s})),e!=="additions"&&a.incrementRowCount(1));return}if(a.hunkSeparators==="simple"){t>0&&(a.pushToGutter(e,ot({type:"simple",isFirstHunk:o,isLastHunk:!1})),d.push(ot({type:"simple",isFirstHunk:o,isLastHunk:!1})),e!=="additions"&&a.incrementRowCount(1));return}const u=ip(e,t),c=n>a.expansionLineCount,f=l?t:void 0,h=typeof i=="number"?ap(i):"More unchanged context may be available";a.pushToGutter(e,ot({type:a.hunkSeparators,content:h,expandIndex:f,chunked:c,slotName:u,isFirstHunk:o,isLastHunk:s})),d.push(ot({type:a.hunkSeparators,content:h,expandIndex:f,chunked:c,slotName:u,isFirstHunk:o,isLastHunk:s})),e!=="additions"&&a.incrementRowCount(1),a.hunkData.push({slotName:u,hunkIndex:t,lines:typeof i=="number"?i:0,lineCountKnown:typeof i=="number",type:e,expandable:l?{up:!o,down:!s,chunked:c}:void 0})}function Kt(e,t,i){return e==null||e.type!=="element"||t==null&&i==null?e:{...e,properties:{...e.properties,...t,...i}}}function no(e){return e.length>0&&e[e.length-1]===""?e.length-1:e.length}function lp(e,t,i,n){const r=no(e),o=no(t),s=Math.min(r,o);let l=0;for(;l<s&&e[l]===t[l];)l++;let a=0;for(;a<s-l&&e[r-1-a]===t[o-1-a];)a++;const d=new Array(t.length);for(let u=0;u<l;u++)d[u]=i[u];for(let u=0;u<a;u++)d[o-1-u]=i[r-1-u];r<e.length&&o<t.length&&(d[t.length-1]=i[e.length-1]);for(let u=l;u<t.length;u++)d[u]??=An(u,n.getLineText(u));return d}function An(e,t,i=e,n=e){return{type:"element",tagName:"div",properties:{"data-line":e+1,"data-line-index":`${i},${n}`,"data-line-type":"context"},children:[{type:"element",tagName:"span",properties:{"data-char":0},children:[{type:"text",value:t}]}]}}function dp(e){const t=[];for(let i=0;i<e.lineCount;i++)t.push(e.getLineText(i,!0));return t}function Xi(e){if(e.lang!=null)return[e.lang];const t=Ie(e.prevName??e.name),i=Ie(e.name);return t===i?[i]:[t,i]}function yt(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function up(e,t){return e.isPartial&&t&&(e.type==="change"||e.type==="rename-changed")}function cp(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function fp(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.lineCountKnown===t.lineCountKnown&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}function hp(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:Nf(e),tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,diffStyle:e?.diffStyle,diffIndicators:e?.diffIndicators,disableBackground:e?.disableBackground,hunkSeparators:typeof e?.hunkSeparators=="function"?"custom":e?.hunkSeparators,expandUnchanged:e?.expandUnchanged,loadDiffFiles:e?.loadDiffFiles,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader!=null?"custom":"default"}}function Ji(e){return e.isPartial&&(e.type==="change"||e.type==="rename-changed"||e.type==="rename-pure")}function pp(e){const t={...e};return delete t.cacheKey,t}function ro(e,t){if(e.isPartial||t.isPartial)throw new Error("FileDiff.shouldResetEditorForExternalDiff: diffs must be fully hydrated");const i=e.lang??Ie(e.name),n=t.lang??Ie(t.name),r=e.type!=="new",o=t.type!=="new";return e.name!==t.name||i!==n||r!==o||e.deletionLines.length!==t.deletionLines.length?!0:e.deletionLines.some((s,l)=>s!==t.deletionLines[l])}function mp(e,t){return e.length===t.length&&e.every((i,n)=>i===t[n])}function gp(e,t){const{oldFile:i}=e;return i==null?t.type==="new":t.type!=="new"&&i.name===(t.prevName??t.name)&&mp(i.lines,t.deletionLines)}let vp=-1;var Ws=class{options;workerManager;isContainerManaged;static LoadedCustomComponent=!0;__id=`file-diff:${++vp}`;type="file-diff";fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerFilenameSuffix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;editSession;renderedDiff;renderRange;pendingFiles;appliedPreAttributes;headerCache={lastRenderedHTML:void 0,html:void 0,fileDiff:void 0};lastRowCount;mounted=!1;enabled=!0;editor;refreshViewTimeout;lineStateRefreshPending=!1;deferredSelectedLines;deferredEditorActiveLine;constructor(e={theme:_e},t,i=!1){this.options=e,this.workerManager=t,this.isContainerManaged=i,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new sf,this.scrollSyncManager=new Ah,this.interactionManager=new Xc("diff",Or(e,typeof e.hunkSeparators=="function"||(e.hunkSeparators??"line-info")==="line-info"||e.hunkSeparators==="line-info-basic"?this.handleExpandHunk:void 0,this.getLineIndex)),this.workerManager?.subscribeToThemeChanges(this),this.enabled=!0}handleHighlightRender=()=>{this.rerender()};getTheme(){return this.workerManager?.getDiffRenderOptions().theme??this.options.theme??_e}getHunksRendererOptions(e){return hp(e)}createHunksRenderer(e){return new op(this.getHunksRendererOptions(e),this.getAnnotationSlotName,this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t="additions")=>this.getLineIndexForDiff(this.getDiffForLineIndex(),e,t);getDiffForLineIndex(){return this.getRenderedDiff()}getLineIndexForDiff(e,t,i){if(e==null)return;const n=e.hunks.at(-1);let r,o;e:for(const s of e.hunks){const l=i==="deletions"?s.deletionStart:s.additionStart,a=i==="deletions"?s.deletionCount:s.additionCount;let d=ae(l,a)+1,u=s.splitLineStart,c=s.unifiedLineStart;if(t<d){const f=d-t;r=Math.max(c-f,0),o=Math.max(u-f,0);break e}if(t>=d+a){if(s===n){const f=t-(d+a);r=c+s.unifiedLineCount+f,o=u+s.splitLineCount+f;break e}continue}for(const f of s.hunkContent)if(f.type==="context")if(t<d+f.lines){const h=t-d;o=u+h,r=c+h;break e}else d+=f.lines,u+=f.lines,c+=f.lines;else{const h=i==="deletions"?f.deletions:f.additions;if(t<d+h){const m=t-d;r=c+(i==="additions"?f.deletions:0)+m,o=u+m;break e}else d+=h,u+=Math.max(f.deletions,f.additions),c+=f.deletions+f.additions}break e}if(!(r==null||o==null))return[r,o]}setOptions(e){e!=null&&(this.options=e,this.clearReusableHeader(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(Or(this.options,typeof this.options.hunkSeparators=="function"||(this.options.hunkSeparators??"line-info")==="line-info"||this.options.hunkSeparators==="line-info-basic"?this.handleExpandHunk:void 0,this.getLineIndex))}mergeOptions(e){this.options={...this.options,...e}}setThemeType(e){(this.options.themeType??"system")!==e&&(this.mergeOptions({themeType:e}),this.applyCachedThemeState(e))}applyCachedThemeState(e){if(typeof this.options.theme=="string"||this.fileContainer==null||this.appliedThemeCSS==null)return!1;const t=this.appliedThemeCSS.baseThemeType??e;return this.appliedThemeCSS.themeType===t?!1:(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,e,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!Vn(this.appliedThemeCSS.theme,this.getTheme())}getHoveredLine=()=>this.interactionManager.getHoveredLine();getAnnotationSlotName=e=>Hf(this.editSession?.annotations,e,Je);getLatestAnnotations(){return this.editSession?.annotations?.current??this.lineAnnotations}isNewAnnotations(e){const t=this.editSession?.annotations;return e===this.lineAnnotations?!1:t==null||e!==t.provided&&e!==t.current}setLineAnnotations(e){const t=this.editSession?.annotations;if(t==null){this.lineAnnotations=e;return}this.isNewAnnotations(e)&&(this.lineAnnotations=e,Mf(t,e,Je))}syncEditSessionAnnotationsFromEditor(e){const t=this.editSession?.annotations;return t==null||e===t.current?!1:(t.current=e,this.hunksRenderer.setLineAnnotations(e),this.renderAnnotations(),!0)}canPartiallyRender(e,t,i){return!(e||t||i||typeof this.options.hunkSeparators=="function")}setSelectedLines(e,t){this.lineStateRefreshPending?this.deferredSelectedLines=[e,t]:this.interactionManager.setSelection(e,t)}setEditorActiveLine(e,t){this.lineStateRefreshPending?this.deferredEditorActiveLine=[e,t]:this.interactionManager.setEditorActiveLine(e,{lineNumberOnly:t?.lineNumberOnly,side:t?.side??"additions"})}flushDeferredLineState(){const{deferredEditorActiveLine:e,deferredSelectedLines:t}=this;this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,e!=null&&this.setEditorActiveLine(...e),t!=null&&this.interactionManager.setSelection(...t)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}const{diffStyle:e="split",overflow:t="scroll"}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,{disableAnnotations:t==="wrap",columnVariables:this.shouldApplyColumnVariables(t)?"apply":"measure"}),t==="scroll"&&e==="split"?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}shouldApplyColumnVariables(e){return typeof this.options.hunkSeparators=="function"?!0:e==="scroll"&&(this.getLatestAnnotations().length>0||this.pre?.hasAttribute("data-has-merge-conflict")===!0)}getCodeScrollLeft(){return Math.max(this.codeUnified?.scrollLeft??0,this.codeDeletions?.scrollLeft??0,this.codeAdditions?.scrollLeft??0)}setCodeScrollLeft(e){this.codeUnified!=null&&(this.codeUnified.scrollLeft=e),this.codeAdditions!=null&&(this.codeAdditions.scrollLeft=e),this.codeDeletions!=null&&(this.codeDeletions.scrollLeft=e)}__getEffectiveCodeOptions(){return{...this.options,...this.hunksRenderer.getEffectiveCodeOptions()}}cleanUp(e=!1){const{editor:t}=this;vn(this.handleEditSessionRender),this.emitPostRender(!0),t?.cleanUp(e?"recycle":"discard"),e||(this.editor=void 0),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,e||(this.pendingFiles=void 0),this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,e||(this.lineAnnotations=[]),this.clearAuxiliaryNodes(),this.annotationCache.clear(),this.pre=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder?.remove(),this.placeHolder=void 0,this.headerCache.lastRenderedHTML=void 0,e||this.clearReusableHeader(),this.errorWrapper?.remove(),this.errorWrapper=void 0,this.spriteSVG=void 0,this.lastRowCount=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,e?this.hunksRenderer.recycle():(this.hunksRenderer.cleanUp(),this.workerManager=void 0,this.fileDiff=void 0,this.editSession=void 0,this.renderedDiff=void 0,this.deletionFile=void 0,this.additionFile=void 0),this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!1,this.deferredEditorActiveLine=void 0,this.deferredSelectedLines=void 0,this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate({fileContainer:e,prerenderedHTML:t,preventEmit:i=!1,lineAnnotations:n,fileDiff:r,...o}){if(!this.enabled)throw new Error("FileDiff.hydrate: attempting to call hydrate after cleaned up");if(this.fileContainer!=null)throw new Error("FileDiff.hydrate: hydrate can only be called before the instance has rendered or hydrated");const s=Sn(o,"FileDiff.hydrate"),l=s?.oldFile,a=s?.newFile;this.hydrateElements(e,t);const d=this.editor!=null;d||Ep(this.pre,bp({fileDiff:r,oldFile:l,newFile:a}),this.options.collapsed)||Sp(this.headerElement,yp({fileDiff:r,oldFile:l,newFile:a}),this.options.disableFileHeader)?this.render({...o,fileContainer:e,lineAnnotations:n,fileDiff:r,forceRender:d||o.forceRender,preventEmit:!0}):this.hydrationSetup({fileDiff:r,lineAnnotations:n,...s}),i||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),zf(e,t);for(const i of e.shadowRoot?.children??[]){if(i instanceof SVGElement){this.spriteSVG=i;continue}if(i instanceof HTMLElement){if(i instanceof HTMLPreElement){this.pre=i;for(const n of i.children)!(n instanceof HTMLElement)||n.tagName.toLowerCase()!=="code"||("deletions"in n.dataset&&(this.codeDeletions=n),"additions"in n.dataset&&(this.codeAdditions=n),"unified"in n.dataset&&(this.codeUnified=n));continue}if("diffsHeader"in i.dataset){this.headerElement=i;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute("data-theme-css")){this.themeCSSStyle=i;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute("data-unsafe-css")){this.unsafeCSSStyle=i,this.appliedUnsafeCSS=i.textContent;continue}}}this.pre!=null&&(this.syncCodeNodesFromPre(this.pre),this.pre.removeAttribute("data-dehydrated")),this.fileContainer=e,this.hydrateMeasuredScrollbar()}hydrationSetup({fileDiff:e,oldFile:t,newFile:i,lineAnnotations:n}){this.lineAnnotations=n??this.lineAnnotations,this.additionFile=i,this.deletionFile=t,this.fileDiff=e??(t!==void 0&&i!==void 0?Ge(t,i,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(this.fileDiff),this.renderedDiff=this.fileDiff,this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}rerender(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||this.render({forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.hunksRenderer.clearRenderCache(),this.rerender()}handleExpandHunk=(e,t,i)=>{this.expandHunk(e,t,i)};expandHunk=(e,t,i)=>{this.loadFilesIfNecessary(),this.hunksRenderer.expandHunk(e,t,i),this.rerender()};loadFilesIfNecessary(){const{fileDiff:e,options:{loadDiffFiles:t}}=this;if(e==null||!Ji(e)||this.pendingFiles?.fileDiff===e)return;if(t==null)throw new Error("FileDiff: loadDiffFiles is required to load full files for a partial diff");const i=this.loadFilesForDiff(e,t),n=this.pendingFiles={fileDiff:e,promise:i},r=()=>{this.pendingFiles===n&&(this.pendingFiles=void 0)};n.promise=i.finally(r)}__canAttachEditor(){return this.fileDiff!=null&&!this.fileDiff.isPartial}async prepareForEditing(){if(this.__canAttachEditor())return;const e=this.__prepareForEditing();if(e==null)throw this.fileDiff?.isPartial===!0&&!Ji(this.fileDiff)?new Error("FileDiff.prepareForEditing: this partial diff cannot be hydrated; provide a complete diff"):new Error("FileDiff.prepareForEditing: a partial diff requires loadDiffFiles");if(await e,!this.__canAttachEditor())throw new Error("FileDiff.prepareForEditing: the diff did not finish loading")}__prepareForEditing(){if(!this.__canAttachEditor()){if(this.fileDiff?.isPartial===!0&&!Ji(this.fileDiff))throw new Error("FileDiff: this partial diff cannot be hydrated; provide a complete diff to edit");return this.loadFilesIfNecessary(),this.pendingFiles?.promise}}async loadFilesForDiff(e,t){try{const i=await t(e);if(this.fileDiff!==e)return;await this.handleFilesLoaded(e,i)}catch(i){if(this.options.disableErrorHandling===!0)throw i;console.error(i)}}async handleFilesLoaded(e,t){if(!(this.fileDiff!==e||!e.isPartial)){if(Ln("merge",e,t),this.setHydratedState(t),this.installHydratedSessionDiff(e)){this.rerender();return}await En(()=>this.primeHighlightCache(e)),!(!this.enabled||this.fileDiff!==e)&&this.rerender()}}installHydratedSessionDiff(e){if(e.isPartial)throw new Error("FileDiff.installHydratedSessionDiff: diffs cannot be partial for editing");return this.fileDiff!==e?!1:this.editSession?.outgoingDiff!=null?(this.installEditSession(e),!0):!1}updateExternalDiff(e,t){if(G(this.fileDiff,e))return!1;const i=this.editSession?.outgoingDiff??this.editSession?.diff;return this.fileDiff=e,i!=null&&(e.isPartial?this.loadFilesIfNecessary():this.installEditSession(e),this.editSession!=null&&(this.editSession.outgoingDiff=i)),this.editSession?.annotations!=null&&t!=null&&(this.lineAnnotations=t,this.editSession.annotations=Ur(t,Je,this.editSession.annotations)),!0}installEditSession(e,t,i){const n=e.additionLines.join(""),r=t!=null?li(t.contents):void 0,o=i!=null&&gp(i,e);if(i!=null&&!o)throw new Error("FileDiff: retained session cannot resume against a different old file");if(t!=null&&t.contents!==n&&!o)throw new Error("FileDiff: retained edits are missing their diff session state");const s=t==null||t.name===e.name&&t.lang===e.lang&&t.contents===n,l=pp(e);t!=null&&r!=null&&!s&&(l.name=t.name,l.lang=t.lang),o&&i!=null&&r!=null&&(l.additionLines=r,l.type=i.type,l.hunks=i.hunks,l.editSessionDirty=!0,Li(l)),this.editSession={diff:l,annotations:this.editSession?.annotations??Ur(this.lineAnnotations,Je),outgoingDiff:this.editSession?.outgoingDiff},this.hunksRenderer.beginEditSession(l,s&&!o?e:void 0)}setHydratedState(e){this.deletionFile=e.oldFile,this.additionFile=e.newFile,this.workerManager?.cleanUpTasks(this.hunksRenderer),this.hunksRenderer.clearRenderCache()}render({fileDiff:e,deferManagers:t=!1,forceRender:i=!1,preventEmit:n=!1,lineAnnotations:r,fileContainer:o,containerWrapper:s,renderRange:l,...a}){if(!this.enabled)throw new Error("FileDiff.render: attempting to call render after cleaned up");const d=Sn(a,"FileDiff.render"),u=d?.oldFile,c=d?.newFile;this.editor?.__postponeBgTokenizeToNextFrame();const{collapsed:f=!1,themeType:h="system",expandUnchanged:m=!1}=this.options,g=f?void 0:l,y=this.hasThemeChanged(),v=d!=null,_=v&&(!oo(u,this.deletionFile)||!oo(c,this.additionFile));let b=e!=null&&!G(e,this.fileDiff);const L=r!=null&&(r.length>0||this.getLatestAnnotations().length>0)?this.isNewAnnotations(r):!1;if(!f&&Rs(g,this.renderRange)&&!i&&!L&&!y&&(e!=null&&!b||e==null&&!_)){const A=this.applyCachedThemeState(h);return A&&this.finalizeRender(),A}let E;e==null&&v&&(_||this.fileDiff==null)&&(E=Ge(d.oldFile,d.newFile,this.options.parseDiffOptions));const{renderRange:S}=this;this.renderRange=g,v?(this.deletionFile=u,this.additionFile=c):e!=null&&(this.deletionFile=void 0,this.additionFile=void 0),e!=null&&b?this.updateExternalDiff(e,r):E!=null&&(b=!0,this.updateExternalDiff(E,r)),b&&this.clearReusableHeader(),r!=null&&this.setLineAnnotations(r);const C=this.getLatestDiff();if(C==null)return!1;C.editSessionDirty===!0&&this.shouldSelfHealEditSession()&&(Qr(C,this.options.parseDiffOptions),this.hunksRenderer.refreshHighlightedResult()),m&&this.loadFilesIfNecessary(),this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.getLatestAnnotations());const{disableErrorHandling:x=!1,disableFileHeader:w=!1}=this.options;if(w&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.headerCache.lastRenderedHTML=void 0),this.clearHeaderSlots()),o=this.getOrCreateFileContainer(o,s),this.applyCachedThemeState(h),f){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{const A=this.hunksRenderer.renderDiff(C,pa);A!=null&&this.applyThemeState(o,A.themeStyles,h,A.baseThemeType),A?.headerElement!=null&&this.applyHeaderToDOM(A.headerElement,o,A.fileDiff),this.renderSeparators([]),this.renderedDiff=A?.fileDiff??C,this.injectUnsafeCSS()}catch(A){if(x)throw A;console.error(A),A instanceof Error&&this.applyErrorToDOM(A,o)}return this.finalizeRender(),n||this.emitPostRender(),!0}try{const A=this.getOrCreatePreNode(o);if(!(this.canPartiallyRender(i,L,_||b||y||!G(this.renderedDiff,C))&&this.applyPartialRender({fileDiff:C,previousRenderRange:S,renderRange:g}))){const I=this.hunksRenderer.renderDiff(C,g);if(I==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.isWorkingPool()&&this.workerManager.initialize().catch(()=>{}).then(()=>this.rerender()),!1;this.applyThemeState(o,I.themeStyles,h,I.baseThemeType),I.headerElement!=null&&this.applyHeaderToDOM(I.headerElement,o,I.fileDiff),I.additionsContentAST!=null||I.deletionsContentAST!=null||I.unifiedContentAST!=null?this.applyHunksToDOM(A,I):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(I.hunkData),this.renderedDiff=I.fileDiff}this.applyBuffers(A,g),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,t||this.flushManagers(),this.finalizeRender(),this.editor!=null&&this.syncRenderViewToEditor()}catch(A){if(x)throw A;console.error(A),A instanceof Error&&this.applyErrorToDOM(A,o)}return n||this.emitPostRender(),!0}finalizeRender(){}emitPostRender(e=!1){const{fileContainer:t,options:{onPostRender:i}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,"unmount");return}if(t==null)return;const n=this.mounted?"update":"mount";this.mounted=!0,i?.(t,this,n)}getLatestDiff(e=this.fileDiff){return this.editSession?.diff??e}getRenderedDiff(){return this.renderedDiff}syncRenderViewToEditor(){const{editor:e,fileContainer:t}=this,i=this.getLatestAnnotations(),n=this.computeEditorRenderRange(this.renderRange),r=this.getLatestDiff();if(e==null||t==null||r==null||r.isPartial)return;const o=d=>{if(!this.enabled||this.editor!==e||this.fileContainer!==t||this.getLatestDiff()!==r)return;const u=this.editSession?.outgoingDiff,{fileDiff:c}=this,f=u!=null&&c!=null&&u!==r,h=f&&u!=null&&c!=null?ro(u,c):!1;e.__syncRenderView({highlighter:d,fileContainer:t,fileDiff:r,lineAnnotations:i,renderRange:n,externalDocument:f,resetHistory:h})},s=this.getTheme(),l=r.lang??Ie(r.name),a=pn({theme:s,lang:l});a!=null?o(a):ms({themes:Dn(s),langs:["text",l],preferredHighlighter:this.workerManager?.getPreferredHighlighter()??this.options.preferredHighlighter}).then(o)}computeEditorRenderRange(e){const t=this.getLatestDiff();if(e==null||t==null||bn(e))return e;const{diffStyle:i="split",expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options;let o,s;return Ye({diff:t,diffStyle:i,startingLine:e.startingLine,totalLines:e.totalLines,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r,callback:({additionLine:l})=>{l!=null&&(o??=l.lineNumber,s=l.lineNumber)}}),o==null||s==null?{...e,startingLine:0,totalLines:0}:{...e,startingLine:o-1,totalLines:s-o+1}}__acknowledgeDocumentUpdate(){this.editSession!=null&&(this.editSession.outgoingDiff=void 0)}__acceptEditorChange(e){const{lineAnnotations:t}=e;t!=null&&this.syncEditSessionAnnotationsFromEditor(t)}emitEditChange(e){const{onEditChange:t}=this.options;t?.(e)}__captureDocumentSessionState(e=!0){let{fileDiff:t,editSession:{diff:i,outgoingDiff:n}={}}=this;if(n!=null&&t!=null){if(!t.isPartial&&ro(n,t))return;i=n}if(!(i==null||i.isPartial))return{diffSession:{oldFile:i.type!=="new"?{name:i.prevName??i.name,lines:e?[...i.deletionLines]:i.deletionLines}:null,type:i.type,hunks:e?Ds(i.hunks):i.hunks},hasChanges:i.editSessionDirty===!0}}__attachEditor(e){if(this.type!=="file-diff")throw new Error(`FileDiff.__attachEditor: cannot attach an editor to a "${this.type}" diff`);if(this.editor!=null)throw new Error("FileDiff.__attachEditor: an editor is already attached");if(!this.__canAttachEditor())throw new Error("FileDiff.__attachEditor: a complete diff is required before editing");const t=()=>{this.editor=void 0,this.finishEditSession()};try{return this.resumeEditorRendering(e),t}catch(i){throw t(),i}}__resumeEditor(e){if(this.editor!==e)throw new Error("FileDiff.__resumeEditor: editor association changed");this.resumeEditorRendering(e)}resumeEditorRendering(e){const{fileDiff:t}=this,i=this.editSession?.outgoingDiff;i!=null&&t!=null&&!t.isPartial&&this.editSession?.diff===i&&this.installEditSession(t);const n=this.editSession==null&&t!=null&&!t.isPartial?t:void 0;n!=null?this.installEditSession(n,e.__getDocumentContents(_p(n)),e.__getDocumentSessionState()):this.editSession!=null&&this.hunksRenderer.beginEditSession(this.editSession.diff),this.editor=e,this.fileDiff?.isPartial===!0&&this.loadFilesIfNecessary();const r=this.editSession?.diff;this.hunksRenderer.editorRenderReady()?(r!=null&&this.hunksRenderer.diffCache===r&&(this.renderedDiff=r),this.syncRenderViewToEditor()):this.rerender()}finishEditSession(){this.hunksRenderer.endEditSession(),this.finalizeEditSessionHunks()}__completeEditSession(e,t){this.settleEditSession(t==="install",e)}settleEditSession(e,t){const{editSession:i,fileDiff:n,lineAnnotations:r}=this;if(i==null||n==null)return;const{diff:o,annotations:s}=i;if(this.editor!=null)throw new Error("FileDiff.__completeEditSession: detach the editor before completing the session");this.hunksRenderer.endEditSession(),this.finalizeEditSessionHunks();const l=s?.current;let a,d=null,u=null,c=!1,f;if(t==null)throw new Error("FileDiff.__completeEditSession: editor is required for completion");const h=Ps(o),m={name:h.name,contents:h.additionLines.join("")};h.lang!=null&&(m.lang=h.lang);const g={fileDiff:h,editor:t,originalFileDiff:n,oldFile:h.type==="new"?null:{name:h.prevName??h.name,contents:h.deletionLines.join("")},newFile:m,lineAnnotations:l,originalLineAnnotations:r};Object.freeze(g);try{if(t.__emitEditComplete(g),this.options.onEditComplete?.(g)==="accept"){if(h.cacheKey!=null&&h.cacheKey===n.cacheKey)throw new Error("FileDiff.__completeEditSession: an accepted diff must not reuse the replaced diff cacheKey");a=h,d=g.oldFile,u=g.newFile}}catch(y){c=!0,f=y}if(e&&a!=null&&(this.fileDiff=a,this.additionFile!=null&&(this.deletionFile=d,this.additionFile=u),l!=null&&(this.lineAnnotations=l)),this.editSession=void 0,e&&this.fileContainer!=null&&this.rerender(),c)throw f}finalizeEditSessionHunks(){const e=this.getLatestDiff();if(e==null||e.editSessionDirty!==!0)return!1;const{collapsedContextThreshold:t=1}=this.options,i=Gh(e,this.hunksRenderer.getExpandedHunksMap(),t);return Qr(e,this.options.parseDiffOptions),this.hunksRenderer.setExpandedHunksMap(jh(e,i)),this.hunksRenderer.refreshHighlightedResult(),this.escalateEditSessionRender(),!0}applyDocumentChange(e,t){const i=this.editSession?.diff;if(i==null)throw new Error("FileDiff.applyDocumentChange: requires an active edit session");this.detachAdditionLines(),this.hunksRenderer.beginEditSession(i),this.hunksRenderer.applyDocumentChange(e),t!=null&&this.syncEditSessionAnnotationsFromEditor(t),this.rerender(),this.interactionManager.setSelectionDirty()}applySuspendedDocumentChange(e,t){this.applyDocumentChange(e,t),this.hunksRenderer.clearRenderCache()}updateRenderCache(e,t,i={}){const n=this.editSession?.diff;if(n==null)throw new Error("FileDiff.updateRenderCache: requires an active edit session");this.detachAdditionLines(),this.hunksRenderer.beginEditSession(n);const{shouldRefreshDiffsView:r,lineCountChangeInFlight:o}=i;if(this.hunksRenderer.updateRenderCache(e,t,o)){this.refreshViewTimeout!=null&&(clearTimeout(this.refreshViewTimeout),this.refreshViewTimeout=void 0),this.lineStateRefreshPending=!0,this.escalateEditSessionRender();return}r===!0&&(this.refreshViewTimeout!=null&&clearTimeout(this.refreshViewTimeout),this.lineStateRefreshPending=!0,this.refreshViewTimeout=setTimeout(()=>{this.refreshViewTimeout=void 0,this.options.diffStyle==="split"?this.refreshSplitDiffView():this.refreshUnifiedDiffView(),this.flushDeferredLineState()},150))}detachAdditionLines(){const e=this.editSession?.diff,{fileDiff:t}=this;e!=null&&(e.additionLines===t?.additionLines||e.additionLines===e.deletionLines)&&(e.additionLines=[...e.additionLines])}isLineRenderable(e){const t=this.getRenderedDiff();if(t==null)return!0;const{expandUnchanged:i=!1,collapsedContextThreshold:n=1}=this.options;return ys({fileDiff:t,lineNumber:e,expandedHunks:i?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:n})}getNearestRenderableLine(e,t){const i=this.getRenderedDiff();if(i==null)return e;const{expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options;return _c({fileDiff:i,lineNumber:e,direction:t,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r})}revealLine(e){const t=this.getRenderedDiff(),{expandUnchanged:i=!1,collapsedContextThreshold:n=1,expansionLineCount:r=100}=this.options;if(t==null||t.isPartial||i)return!1;const o=this.hunksRenderer.getExpandedHunksMap();for(const[d,u]of t.hunks.entries()){const[c,f]=Rt(u);if(e<c){const h=De({isPartial:t.isPartial,rangeSize:u.collapsedBefore,expandedHunks:o,hunkIndex:d,collapsedContextThreshold:n}),m=c-h.rangeSize;if(h.renderAll||e<m+h.fromStart||e>=c-h.fromEnd)return!1;const g=e-(m+h.fromStart)+1,y=c-h.fromEnd-e;return g<=y?this.expandHunk(d,"up",g+r):this.expandHunk(d,"down",y+r),!0}if(e<f)return!1}const s=Pe({fileDiff:t,hunkIndex:t.hunks.length-1,expandedHunks:o,collapsedContextThreshold:n,errorPrefix:"FileDiff.revealLine"});if(s==null||s.renderAll)return!1;const l=t.hunks[t.hunks.length-1],[,a]=Rt(l);return e<a+s.fromStart||e>=a+s.rangeSize?!1:(this.expandHunk(t.hunks.length,"up",e-(a+s.fromStart)+1+r),!0)}shouldSelfHealEditSession(){return this.editor==null}escalateEditSessionRender(){Cs(this.handleEditSessionRender)}handleEditSessionRender=()=>{this.rerender(),this.flushDeferredLineState()};removeRenderedCode(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(const{element:e}of this.separatorCache.values())e.remove();this.separatorCache.clear();for(const{element:e}of this.annotationCache.values())e.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}renderPlaceholder(e){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){const t=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:"open"});this.placeHolder=document.createElement("div"),this.placeHolder.dataset.placeholder="",t.appendChild(this.placeHolder)}return this.setPlaceholderHeight(e)}setPlaceholderHeight(e){return this.placeHolder==null?!1:(this.placeHolder.style.setProperty("height",`${e}px`),!0)}async primeHighlightCache(e=this.fileDiff){const{workerManager:t}=this;if(e==null||t==null||!t.isWorkingPool()||e.cacheKey==null||Et(e))return;const i=this.options.tokenizeMaxLength??1e5;Math.max(e.additionLines.length,e.deletionLines.length)>i||await t.primeDiffHighlightCache(e).catch(n=>{console.error(n)})}cleanChildNodes(){this.resizeManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.interactionManager.cleanUp(),this.clearAuxiliaryNodes(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.codeAdditions?.remove(),this.codeDeletions?.remove(),this.codeUnified?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.pre?.remove(),this.spriteSVG?.remove(),this.themeCSSStyle?.remove(),this.unsafeCSSStyle?.remove(),this.bufferAfter=void 0,this.bufferBefore=void 0,this.codeAdditions=void 0,this.codeDeletions=void 0,this.codeUnified=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.pre=void 0,this.spriteSVG=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.headerCache.lastRenderedHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderSeparators(e){const{hunkSeparators:t}=this.options;if(this.isContainerManaged||this.fileContainer==null||typeof t!="function"){for(const{element:n}of this.separatorCache.values())n.remove();this.separatorCache.clear();return}const i=new Map(this.separatorCache);for(const n of e){const r=n.slotName;let o=this.separatorCache.get(r);if(o==null||!fp(n,o.hunkData)){o?.element.remove();const s=document.createElement("div");s.style.display="contents",s.slot=n.slotName;const l=t(n,this);l!=null&&s.appendChild(l),this.fileContainer.appendChild(s),o={element:s,hunkData:n},this.separatorCache.set(r,o)}i.delete(r)}for(const[n,{element:r}]of i.entries())this.separatorCache.delete(n),r.remove()}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(const{element:n}of this.annotationCache.values())n.remove();this.annotationCache.clear();return}const e=new Map(this.annotationCache),{renderAnnotation:t}=this.options,i=this.getLatestAnnotations();if(t!=null&&i.length>0)for(const[n,r]of i.entries()){const o=this.getAnnotationSlotName(r),s=`${n}-${o}`;let l=this.annotationCache.get(s);if(l==null||!cp(r,l.annotation)){l?.element.remove();const a=t(r);if(a==null)continue;l={element:wf(o),annotation:r},l.element.appendChild(a),this.fileContainer.appendChild(l.element),this.annotationCache.set(s,l)}e.delete(s)}for(const[n,{element:r}]of e.entries())this.annotationCache.delete(n),r.remove()}renderGutterUtility(){const{renderGutterUtility:e}=this.options;if(this.fileContainer==null||e==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const t=e(this.interactionManager.getHoveredLine);if(t!=null&&this.gutterUtilityContent!=null)return;if(t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const i=kf();i.appendChild(t),this.fileContainer.appendChild(i),this.gutterUtilityContent=i}getOrCreateFileContainer(e,t){const{fileContainer:i}=this,n=e??i??document.createElement("diffs-container"),r=i!==n;return i!=null&&r&&this.editor?.__captureFocusForDOMReplacement(),r&&this.emitPostRender(!0),this.fileContainer=n,i!=null&&r&&(this.headerCache.lastRenderedHTML=void 0,this.headerElement=void 0),t!=null&&this.fileContainer.parentNode!==t&&t.appendChild(this.fileContainer),r&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(e){const{shadowRoot:t}=e;if(t!=null)for(const i of t.children)i instanceof SVGElement?this.spriteSVG??=i:Ir(i)&&i.hasAttribute("data-theme-css")?(this.themeCSSStyle??=i,this.hasAdoptedThemeCSS=!0):Ir(i)&&i.hasAttribute("data-unsafe-css")&&(this.unsafeCSSStyle??=i,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){const t=e.shadowRoot??e.attachShadow({mode:"open"});if(this.spriteSVG==null){const i=document.createElement("div");i.innerHTML=Sf;const n=i.firstChild;n instanceof SVGElement&&(this.spriteSVG=n)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==t&&t.appendChild(this.spriteSVG)}getOrCreatePreNode(e){const t=e.shadowRoot??e.attachShadow({mode:"open"});return this.pre==null?(this.pre=document.createElement("pre"),this.appliedPreAttributes=void 0,this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0,t.appendChild(this.pre)):this.pre.parentNode!==t&&(this.editor?.__captureFocusForDOMReplacement(),t.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodesFromPre(e){this.codeUnified=void 0,this.codeDeletions=void 0,this.codeAdditions=void 0;for(const t of Array.from(e.children))t instanceof HTMLElement&&(t.hasAttribute("data-unified")?this.codeUnified=t:t.hasAttribute("data-deletions")?this.codeDeletions=t:t.hasAttribute("data-additions")&&(this.codeAdditions=t))}applyHeaderToDOM(e,t,i){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;const{headerCache:{fileDiff:n,html:r,lastRenderedHTML:o}}=this,s=(i!==this.editSession?.diff&&G(n,i)?r:void 0)??Re(e);if(this.headerCache.html=s,this.headerCache.fileDiff=i,s!==o){const m=document.createElement("div");m.innerHTML=s;const g=m.firstElementChild;if(!(g instanceof HTMLElement))return;this.headerElement!=null?t.shadowRoot?.replaceChild(g,this.headerElement):t.shadowRoot?.prepend(g),this.headerElement=g,this.headerCache.lastRenderedHTML=s}if(this.isContainerManaged)return;const{renderCustomHeader:l,renderHeaderPrefix:a,renderHeaderFilenameSuffix:d,renderHeaderMetadata:u}=this.options;if(l!=null){const m=l(i)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,In,m),this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0;return}const c=a?.(i)??void 0,f=d?.(i)??void 0,h=u?.(i)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,po,c),this.headerFilenameSuffix=this.upsertHeaderSlotElement(t,this.headerFilenameSuffix,mo,f),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,go,h),this.headerCustom?.remove(),this.headerCustom=void 0}clearReusableHeader(){this.headerCache.html=void 0,this.headerCache.fileDiff=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerFilenameSuffix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerFilenameSuffix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,i,n){if(n==null){t?.remove();return}const r=t??this.createHeaderSlotElement(i);return t==null&&e.appendChild(r),this.replaceHeaderSlotContent(r,n),r}replaceHeaderSlotContent(e,t){e.replaceChildren(),t instanceof Element?e.appendChild(t):e.innerText=`${t}`}createHeaderSlotElement(e){const t=document.createElement("div");return t.slot=e,t}injectUnsafeCSS(){const{unsafeCSS:e}=this.options,t=this.fileContainer?.shadowRoot;if(t!=null){if(e==null||e===""){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}this.unsafeCSSStyle?.parentNode===t&&this.appliedUnsafeCSS===e||(this.unsafeCSSStyle??=xf(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=Tf(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,i,n){const r=e.shadowRoot??e.attachShadow({mode:"open"}),o=n??i,s=this.getTheme(),l=typeof s=="string"?s:{...s},a=yn(r);if(this.themeCSSStyle?.parentNode===r&&this.appliedThemeCSS?.themeStyles===t&&this.appliedThemeCSS.themeType===o&&this.appliedThemeCSS.scrollbarGutter===a){this.appliedThemeCSS.theme=l;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===r){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:l,themeStyles:t,themeType:o,baseThemeType:n,scrollbarGutter:a};return}this.themeCSSStyle=Ff({shadowRoot:r,currentNode:this.themeCSSStyle,themeCSS:If(t,o,a)}),this.appliedThemeCSS=this.themeCSSStyle!=null?{theme:l,themeStyles:t,themeType:o,baseThemeType:n,scrollbarGutter:a}:void 0}hydrateMeasuredScrollbar(){const e=this.fileContainer?.shadowRoot;e==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=Df(this.themeCSSStyle.textContent??"",yn(e)))}shouldGuardRebuildScroll(){return this.editor!=null&&Uf()}applyHunksToDOM(e,t){this.shouldGuardRebuildScroll()?zr(e,()=>this.replaceCodeColumns(e,t)):this.replaceCodeColumns(e,t)}applyCodeColumnsInPlace(e,t,i){const n=this.getColumnPair(e);if(n==null)return!1;const r=Fe(t[0]),o=Fe(t[1]);return r==null||o==null?!1:(n.gutter.innerHTML=Re(r),n.content.innerHTML=Re(o),i!==this.lastRowCount&&(n.gutter.style.setProperty("grid-row",`span ${i}`),n.content.style.setProperty("grid-row",`span ${i}`)),!0)}replaceCodeColumns(e,t){const{overflow:i="scroll"}=this.options,n=(this.options.hunkSeparators??"line-info")==="line-info",r=i==="wrap"?t.rowCount:void 0;this.cleanupErrorWrapper(),this.applyPreNodeAttributes(e,t);let o=!1;const s=[],l=this.hunksRenderer.renderCodeAST("unified",t),a=this.hunksRenderer.renderCodeAST("deletions",t),d=this.hunksRenderer.renderCodeAST("additions",t);this.editor?.__captureFocusForDOMReplacement(),l!=null?(o=this.codeUnified==null||this.codeAdditions!=null||this.codeDeletions!=null,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0,this.codeUnified=Gi({code:this.codeUnified,columnType:"unified",rowSpan:r,containerSize:n}),this.applyCodeColumnsInPlace(this.codeUnified,l,t.rowCount)||(this.codeUnified.innerHTML=this.hunksRenderer.renderPartialHTML(l)),s.push(this.codeUnified)):a!=null||d!=null?(a!=null?(o=this.codeDeletions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions=Gi({code:this.codeDeletions,columnType:"deletions",rowSpan:r,containerSize:n}),this.applyCodeColumnsInPlace(this.codeDeletions,a,t.rowCount)||(this.codeDeletions.innerHTML=this.hunksRenderer.renderPartialHTML(a)),s.push(this.codeDeletions)):(this.codeDeletions?.remove(),this.codeDeletions=void 0),d!=null?(o=o||this.codeAdditions==null||this.codeUnified!=null,this.codeUnified?.remove(),this.codeUnified=void 0,this.codeAdditions=Gi({code:this.codeAdditions,columnType:"additions",rowSpan:r,containerSize:n}),this.applyCodeColumnsInPlace(this.codeAdditions,d,t.rowCount)||(this.codeAdditions.innerHTML=this.hunksRenderer.renderPartialHTML(d)),s.push(this.codeAdditions)):(this.codeAdditions?.remove(),this.codeAdditions=void 0)):(this.codeUnified?.remove(),this.codeUnified=void 0,this.codeDeletions?.remove(),this.codeDeletions=void 0,this.codeAdditions?.remove(),this.codeAdditions=void 0),s.length===0?e.textContent="":o&&e.replaceChildren(...s),this.lastRowCount=t.rowCount}applyPartialRender({fileDiff:e,previousRenderRange:t,renderRange:i}){const{pre:n,codeUnified:r,codeAdditions:o,codeDeletions:s,options:{diffStyle:l="split"}}=this;if(n==null||t==null||i==null||!Number.isFinite(t.totalLines)||!Number.isFinite(i.totalLines)||this.lastRowCount==null)return!1;const a=this.getCodeColumns(l,r,s,o);if(a==null)return!1;const d=t.startingLine,u=i.startingLine,c=d+t.totalLines,f=u+i.totalLines,h=Math.max(d,u),m=Math.min(c,f);if(m<=h)return!1;const g=Math.max(0,h-d),y=Math.max(0,c-m),v=this.trimColumns({columns:a,trimStart:g,trimEnd:y,previousStart:d,overlapStart:h,overlapEnd:m,diffStyle:l});if(v<0)throw new Error("FileDiff.applyPartialRender: failed to trim to overlap");if(this.lastRowCount<v)throw new Error("FileDiff.applyPartialRender: trimmed beyond DOM row count");let _=this.lastRowCount-v;const b=(C,x)=>{if(!(x<=0))return this.hunksRenderer.renderDiff(e,{startingLine:C,totalLines:x,bufferBefore:0,bufferAfter:0})},L=b(u,Math.max(h-u,0));if(L==null&&u<h)return!1;const E=b(m,Math.max(f-m,0));if(E==null&&f>m)return!1;const S=(C,x)=>{if(C!=null){if(l==="unified"&&!Array.isArray(a))this.insertPartialHTML(l,a,C,x);else if(l==="split"&&Array.isArray(a))this.insertPartialHTML(l,a,C,x);else throw new Error("FileDiff.applyPartialRender.applyChunk: invalid chunk application");_+=C.rowCount,this.renderedDiff=C.fileDiff}};return this.cleanupErrorWrapper(),S(L,"afterbegin"),S(E,"beforeend"),this.lastRowCount!==_&&(this.applyRowSpan(l,a,_),this.lastRowCount=_),!0}insertPartialHTML(e,t,i,n){if(e==="unified"&&!Array.isArray(t)){const r=this.hunksRenderer.renderCodeAST("unified",i);this.renderPartialColumn(t,r,n)}else if(e==="split"&&Array.isArray(t)){const r=this.hunksRenderer.renderCodeAST("deletions",i),o=this.hunksRenderer.renderCodeAST("additions",i);this.renderPartialColumn(t[0],r,n),this.renderPartialColumn(t[1],o,n)}else throw new Error("FileDiff.insertPartialHTML: Invalid argument composition")}refreshSplitDiffView(){const e=this.getLatestDiff();if(this.options.diffStyle!=="split"||e==null)return;const t=this.hunksRenderer.renderDiff(e,this.renderRange);if(t==null)return;const i=this.getCodeColumns("split",this.codeUnified,this.codeDeletions,this.codeAdditions);if(!Array.isArray(i))return;const n=(r,o)=>{if(o==null)return;const s=this.hunksRenderer.renderCodeAST(r,t),l=Fe(s?.[0]),a=Fe(s?.[1]);for(const[d,u]of[[o.gutter,l],[o.content,a]])if(u!=null&&d.childElementCount===u.length)for(let c=0;c<u.length;c++){const f=d.children[c],h=u[c].properties["data-line-type"];h!=null&&f.dataset.lineType!==h&&(f.dataset.lineType=h)}};n("deletions",i[0]),n("additions",i[1]),this.renderedDiff=t.fileDiff}refreshUnifiedDiffView(){const e=this.getLatestDiff();if(this.options.diffStyle!=="unified"||e==null)return;const t=this.hunksRenderer.renderDiff(e,this.renderRange);if(t==null)return;const i=this.getCodeColumns("unified",this.codeUnified,this.codeDeletions,this.codeAdditions);if(i==null||Array.isArray(i))return;const n=this.hunksRenderer.renderCodeAST("unified",t),r=Fe(n?.[0]),o=Fe(n?.[1]),s=()=>{for(const[l,a]of[[i.gutter,r],[i.content,o]])a!=null&&(l.innerHTML=Re(a));t.rowCount!==this.lastRowCount&&(this.applyRowSpan("unified",i,t.rowCount),this.lastRowCount=t.rowCount),this.renderedDiff=t.fileDiff};this.shouldGuardRebuildScroll()?zr(this.pre,s):s(),this.renderSeparators(t.hunkData),this.managersDirty=!0,this.flushManagers(),this.syncRenderViewToEditor()}renderPartialColumn(e,t,i){if(e==null||t==null)return;const n=Fe(t[0]),r=Fe(t[1]);if(n==null||r==null)throw new Error("FileDiff.insertPartialHTML: Unexpected AST structure");const o=r.at(0);i==="beforeend"&&o?.type==="element"&&typeof o.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(o.properties["data-buffer-size"],e.content.children[e.content.children.length-1],e.gutter.children[e.gutter.children.length-1],n,r,!0);const s=r.at(-1);i==="afterbegin"&&s?.type==="element"&&typeof s.properties["data-buffer-size"]=="number"&&this.mergeBuffersIfNecessary(s.properties["data-buffer-size"],e.content.children[0],e.gutter.children[0],n,r,!1),e.gutter.insertAdjacentHTML(i,this.hunksRenderer.renderPartialHTML(n)),e.content.insertAdjacentHTML(i,this.hunksRenderer.renderPartialHTML(r))}mergeBuffersIfNecessary(e,t,i,n,r,o){if(!(t instanceof HTMLElement)||!(i instanceof HTMLElement))return;const s=this.getBufferSize(t.dataset);s!=null&&(o?(n.shift(),r.shift()):(n.pop(),r.pop()),this.updateBufferSize(t,s+e),this.updateBufferSize(i,s+e))}applyRowSpan(e,t,i){const n=r=>{r!=null&&(r.gutter.style.setProperty("grid-row",`span ${i}`),r.content.style.setProperty("grid-row",`span ${i}`))};if(e==="unified"&&!Array.isArray(t))n(t);else if(e==="split"&&Array.isArray(t))n(t[0]),n(t[1]);else throw new Error("dun fuuuuked up")}trimColumnRows(e,t,i){let n=0,r=0,o=0,s=!1;const l=i>=0;if(e==null)return 0;const a=Array.from(e.content.children),d=Array.from(e.gutter.children);if(a.length!==d.length)throw new Error("FileDiff.trimColumnRows: columns do not match");for(;o<a.length&&!(t<=0&&!l&&!s);){const u=d[o],c=a[o];if(o++,!(u instanceof HTMLElement)||!(c instanceof HTMLElement))throw console.error({gutterElement:u,contentElement:c}),new Error("FileDiff.trimColumnRows: invalid row elements");if(s&&(s=!1,u.dataset.gutterBuffer==="annotation"&&"lineAnnotation"in c.dataset||u.dataset.gutterBuffer==="metadata"&&"noNewline"in c.dataset)){u.remove(),c.remove(),r++;continue}if("lineIndex"in u.dataset&&"lineIndex"in c.dataset){(t>0||l&&n>=i)&&(u.remove(),c.remove(),t>0&&(t--,t===0&&(s=!0)),r++),n++;continue}if("separator"in u.dataset&&"separator"in c.dataset){(t>0||l&&n>=i)&&(u.remove(),c.remove(),r++);continue}if(u.dataset.gutterBuffer==="annotation"&&"lineAnnotation"in c.dataset){(t>0||l&&n>=i)&&(u.remove(),c.remove(),r++);continue}if(u.dataset.gutterBuffer==="metadata"&&"noNewline"in c.dataset){(t>0||l&&n>=i)&&(u.remove(),c.remove(),r++);continue}if(u.dataset.gutterBuffer==="buffer"&&"contentBuffer"in c.dataset){const f=this.getBufferSize(c.dataset);if(f==null)throw new Error("FileDiff.trimColumnRows: invalid element");if(t>0){const h=Math.min(t,f),m=f-h;m>0?(this.updateBufferSize(u,m),this.updateBufferSize(c,m),r+=h):(u.remove(),c.remove(),r+=f),t-=h,t===0&&m===0&&(s=!0)}else if(l){const h=n,m=n+f-1;if(i<=h)u.remove(),c.remove(),r+=f;else if(i<=m){const g=m-i+1,y=f-g;this.updateBufferSize(u,y),this.updateBufferSize(c,y),r+=g}}n+=f;continue}throw console.error({gutterElement:u,contentElement:c}),new Error("FileDiff.trimColumnRows: unknown row elements")}return r}trimColumns({columns:e,diffStyle:t,overlapEnd:i,overlapStart:n,previousStart:r,trimEnd:o,trimStart:s}){const l=Math.max(0,n-r),a=i-r;if(a<0)throw new Error("FileDiff.trimColumns: overlap ends before previous");const d=s>0,u=o>0;if(!d&&!u)return 0;const c=d?l:0,f=u?a:-1;if(t==="unified"&&!Array.isArray(e))return this.trimColumnRows(e,c,f);if(t==="split"&&Array.isArray(e)){const h=this.trimColumnRows(e[0],c,f),m=this.trimColumnRows(e[1],c,f);if(e[0]!=null&&e[1]!=null&&h!==m)throw new Error("FileDiff.trimColumns: split columns out of sync");return e[0]!=null?h:m}else throw console.error({diffStyle:t,columns:e}),new Error("FileDiff.trimColumns: Invalid columns for diffType")}getBufferSize(e){const t=Number.parseInt(e?.bufferSize??"",10);return Number.isNaN(t)?void 0:t}updateBufferSize(e,t){e.dataset.bufferSize=`${t}`,e.style.setProperty("grid-row",`span ${t}`),e.style.setProperty("min-height",`calc(${t} * 1lh)`)}getColumnPair(e){if(e==null)return;const t=e.children[0],i=e.children[1];if(!(!(t instanceof HTMLElement)||!(i instanceof HTMLElement)||t.dataset.gutter==null||i.dataset.content==null))return{gutter:t,content:i}}getCodeColumns(e,t,i,n){if(e==="unified")return this.getColumnPair(t);{const r=this.getColumnPair(i),o=this.getColumnPair(n);return r!=null||o!=null?[r,o]:void 0}}updateBuffers(e){this.pre!=null&&this.applyBuffers(this.pre,e)}applyBuffers(e,t){if(t==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}t.bufferBefore>0?(this.bufferBefore==null&&(this.bufferBefore=document.createElement("div"),this.bufferBefore.dataset.virtualizerBuffer="before",e.before(this.bufferBefore)),this.bufferBefore.style.setProperty("height",`${t.bufferBefore}px`),this.bufferBefore.style.setProperty("contain","strict")):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),t.bufferAfter>0?(this.bufferAfter==null&&(this.bufferAfter=document.createElement("div"),this.bufferAfter.dataset.virtualizerBuffer="after",e.after(this.bufferAfter)),this.bufferAfter.style.setProperty("height",`${t.bufferAfter}px`),this.bufferAfter.style.setProperty("contain","strict")):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyPreNodeAttributes(e,{additionsContentAST:t,deletionsContentAST:i,totalLines:n},r){const{diffIndicators:o="bars",disableBackground:s=!1,disableLineNumbers:l=!1,overflow:a="scroll",diffStyle:d="split"}=this.options,u={type:"diff",diffIndicators:o,disableBackground:s,disableLineNumbers:l,overflow:a,split:d==="unified"?!1:t!=null&&i!=null,totalLines:n,customProperties:r};Lf(u,this.appliedPreAttributes)||(Bf(e,u),this.appliedPreAttributes=u)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;const i=t.shadowRoot??t.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.textContent="",i.appendChild(this.errorWrapper);const n=document.createElement("div");n.dataset.errorMessage="",n.innerText=e.message,this.errorWrapper.appendChild(n);const r=document.createElement("pre");r.dataset.errorStack="",r.innerText=e.stack??"No Error Stack",this.errorWrapper.appendChild(r)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function _p(e){return{name:e.name,lang:e.lang,contents:e.additionLines.join("")}}function oo(e,t){return e==null||t==null?e==null&&t==null:vs(e,t)}function bp({fileDiff:e,oldFile:t,newFile:i}){return e!=null&&e.hunks.length>0||t!=null||i!=null}function yp({fileDiff:e,oldFile:t,newFile:i}){return e!=null||t!=null||i!=null}function Ep(e,t,i=!1){return!i&&e==null&&t}function Sp(e,t,i=!1){return e==null&&t&&!i}function Fe(e){if(!(e==null||e.type!=="element"))return e.children??[]}const Rn=3e3,Xt=new Map;let Lp=-1;var Cp=class extends Ws{__id=`little-virtualized-file-diff:${++Lp}`;renderType="virtualized";top;height=0;metrics;cache={heightDeltas:new Map,measuredHeightDeltaTotal:0,estimatedSplitHeight:void 0,estimatedUnifiedHeight:void 0,checkpoints:[],totalLines:0,fileAnnotationHeight:0,ghostTextRows:Xt,ghostTextRowsByIndex:new Map};isVisible=!1;isSetup=!1;virtualizer;layoutDirty=!0;forceRenderOverride;currentCollapsed;pendingHydratedDiff;pendingExpansions;pendingRender;constructor(e,t,i,n,r=!1){super(e,n,r),this.virtualizer=t,this.metrics=zi(i)}setMetrics(e,t=!1){const i=zi(e);!t&&gn(this.metrics,i)||(this.metrics=i,this.resetLayoutCache({includeEstimatedHeights:!0}))}setLineAnnotations(e){this.syncLineAnnotations(e)&&(this.forceRenderOverride=!0)}syncLineAnnotations(e){return e==null||!this.isNewAnnotations(e)||e.length===0&&this.getLatestAnnotations().length===0?!1:(super.setLineAnnotations(e),!0)}syncEditSessionAnnotationsFromEditor(e){return super.syncEditSessionAnnotationsFromEditor(e)?(this.forceRenderOverride=!0,!0):!1}setFileAnnotationHeight(e){const t=this.cache.fileAnnotationHeight;return e===t?!1:(this.cache.fileAnnotationHeight=e,this.cache.measuredHeightDeltaTotal+=e-t,!0)}hasFileAnnotations(e){const t=this.getLatestAnnotations();return Wc(t)?t.some(i=>i.lineNumber!==0?!1:e.type==="new"?i.side==="additions":e.type==="deleted"?i.side==="deletions":!0):!1}getLineHeight(e,t=!1){return this.getEstimatedLineHeight(t)+(this.cache.heightDeltas.get(e)??0)}getEstimatedLineHeight(e=!1){const t=e?2:1;return this.metrics.lineHeight*t}setOptions(e){if(this.isAdvancedMode())throw new Error("VirtualizedFileDiff.setOptions cannot be used inside CodeView. Update CodeView options instead.");if(e==null)return;const{options:t}=this,i=!Ls(t,e),n=i&&Tp(t,e);super.setOptions(e),n&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:Ip(t,e)}),i&&(this.forceRenderOverride=!0),i&&this.isSimpleMode()&&this.virtualizer.instanceChanged(this,n)}setThemeType(e){if(this.isAdvancedMode())throw new Error("VirtualizedFileDiff.setThemeType cannot be used inside CodeView. Update CodeView options instead.");super.setThemeType(e)}resetLayoutCache({forceSimpleRecompute:e=!1,includeEstimatedHeights:t=!1,resetRenderRange:i=!0}={}){this.layoutDirty=!0,this.cache.fileAnnotationHeight=0,this.cache.heightDeltas.clear(),this.cache.measuredHeightDeltaTotal=0,this.cache.ghostTextRows=Xt,this.cache.ghostTextRowsByIndex.size>0&&this.cache.ghostTextRowsByIndex.clear(),this.invalidateDerivedLayoutCache(t,i),e&&this.isSimpleMode()&&this.computeApproximateSize()}invalidateDerivedLayoutCache(e,t=!0){this.layoutDirty=!0,this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.cache.totalLines!==0&&(this.cache.totalLines=0),e&&(this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0),this.renderRange!=null&&t&&(this.renderRange=void 0)}applyGhostTextRows(e,t){const{cache:{heightDeltas:i,ghostTextRows:n,ghostTextRowsByIndex:r},metrics:{lineHeight:o}}=this;if(n===t)return!1;const s=this.getDiffStyle(),l=new Map;for(const[d,u]of t){const c=this.getLineIndexForDiff(e,d+1,"additions");c!=null&&l.set(s==="split"?c[1]:c[0],u)}let a=!1;for(const d of new Set([...r.keys(),...l.keys()])){const u=((l.get(d)??0)-(r.get(d)??0))*o;if(u===0)continue;const c=(i.get(d)??0)+u;c===0?i.delete(d):i.set(d,c),this.cache.measuredHeightDeltaTotal+=u,a=!0}return this.cache.ghostTextRows=t,this.cache.ghostTextRowsByIndex=l,a}reconcileHeights(){let e=!1;const{options:{overflow:t="scroll"},metrics:{lineHeight:i}}=this,n=this.placeHolder!=null?this.getLayoutDiff():this.getRenderedDiff();if(this.fileContainer==null||n==null)return this.height!==0&&(e=!0),this.height=0,e;this.top=this.getVirtualizedTop(),e=this.applyGhostTextRows(n,this.editor?.__getGhostTextRows()??Xt);const{ghostTextRowsByIndex:r}=this.cache,o=t!=="scroll"||this.getLatestAnnotations().length>0||this.isResizeDebuggingEnabled();if(this.placeHolder!=null||!o&&this.cache.heightDeltas.size===0&&this.cache.fileAnnotationHeight===0)return e&&(this.computeApproximateSize(!0),this.setPlaceholderHeight(this.height)),e;const s=this.getDiffStyle(),l=s==="split"?[this.codeDeletions,this.codeAdditions]:[this.codeUnified];if(this.renderRange!=null&&ks(this.renderRange)){const a=wp(l)??0;this.setFileAnnotationHeight(a)&&(e=!0)}for(const a of l){if(a==null)continue;const d=a.children[1];if(!(d instanceof HTMLElement))continue;const u=s==="split"&&a===this.codeDeletions;for(const c of d.children){if(!(c instanceof HTMLElement))continue;const f=c.dataset.lineIndex;if(f==null)continue;const h=Pp(f,s),m=r.get(h)??0;if(u&&m>0)continue;const g=this.cache.heightDeltas.get(h)??0;if(!o&&g===m*i)continue;let y=c.getBoundingClientRect().height+m*i,v=!1;c.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in c.nextElementSibling.dataset||"noNewline"in c.nextElementSibling.dataset)&&("noNewline"in c.nextElementSibling.dataset&&(v=!0),y+=c.nextElementSibling.getBoundingClientRect().height);const _=this.getEstimatedLineHeight(v),b=y-_;b!==g&&(e=!0,this.cache.measuredHeightDeltaTotal+=b-g,b===0?this.cache.heightDeltas.delete(h):this.cache.heightDeltas.set(h,b))}}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer==null?!1:(e&&(this.top=this.getVirtualizedTop()),this.render());flushManagers(){super.flushManagers(),this.lineStateRefreshPending&&this.flushDeferredLineState()}updateCodeViewLayout(e,t,i,n){let r=!1,o=!1;const{pendingExpansions:s,pendingHydratedDiff:l,options:{collapsed:a=!1}}=this;if(l!=null&&(this.pendingHydratedDiff=void 0,l.expectedDiff===e&&(Object.assign(e,l.nextDiff),this.setHydratedState(l.files),this.installHydratedSessionDiff(e),this.forceRenderOverride=!0,r=!0,o=!0)),s!=null){this.pendingExpansions=void 0;for(const{hunkIndex:m,direction:g,expansionLineCountOverride:y}of s)this.hunksRenderer.expandHunk(m,g,y),this.forceRenderOverride=!0,o=!0}const d=this.updateExternalDiff(e,n),{pendingRenderDiff:u,layoutDiffChanged:c,renderedDiffChanged:f,annotationsChanged:h}=this.updatePendingRender(e,n);return!this.forceRenderOverride&&(d||f||h)&&(this.forceRenderOverride=!0),(i?.resetDiffLayoutCache===!0||c)&&(r=!0),(c||i?.resetDiffLayoutCache===!0&&i.includeEstimatedDiffHeights)&&(o=!0),i?.metrics!=null&&(this.metrics=zi(i.metrics),r=!0,o=!0),this.currentCollapsed!==a&&(this.currentCollapsed=a,r=!0),r?this.resetLayoutCache({includeEstimatedHeights:o}):o&&this.invalidateDerivedLayoutCache(!0),this.top=t,this.computeApproximateSize(!1,u),this.height}getLinePosition(e,t="additions"){const i=this.getLayoutDiff();if(i==null||e<1)return;const n=this.getLineIndexForDiff(i,e,t);if(n==null)return;const{disableFileHeader:r=!1,expandUnchanged:o=!1,collapsed:s=!1,collapsedContextThreshold:l=1}=this.options,a=this.getDiffStyle(),d=this.getHunkSeparatorType(),u=a==="split"?n[1]:n[0];this.approximateLayoutCheckpoints(i);const c=dt(this.metrics,r),f=this.getLayoutCheckpointBeforeLineIndex(u);let h=f?.top??c+this.cache.fileAnnotationHeight;if(s)return{top:c,height:0};let m;return Ye({diff:i,diffStyle:a,startingLine:f?.renderedLineIndex??0,expandedHunks:o?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:l,callback:({hunkIndex:g,hunk:y,collapsedBefore:v,collapsedAfter:_,deletionLine:b,additionLine:L})=>{const E=a==="split"?L?.splitLineIndex??b?.splitLineIndex:L?.unifiedLineIndex??b?.unifiedLineIndex;if(E==null)throw new Error("VirtualizedFileDiff.getLinePosition: missing line index data");if(v>0){const C=St({type:d,metrics:this.metrics,hunkIndex:g,hunkSpecs:y?.hunkSpecs});if(C!=null){if(h+=C.gapBefore,u>=E-v&&u<E)return m={top:h,height:C.height},!0;h+=C.height+C.gapAfter}}const S=this.getLineHeight(E,(L?.noEOFCR??!1)||(b?.noEOFCR??!1));if(E===u)return m={top:h,height:S},!0;if(h+=S,_>0){const C=Xe({type:d,metrics:this.metrics});if(C!=null){if(u>E&&u<=E+_)return m={top:h+C.gapBefore,height:C.height},!0;h+=C.totalHeight}}return!1}}),m}getEditorViewport(){return this.virtualizer.type==="simple"?this.virtualizer.getRoot():this.virtualizer.getContainerElement()}getNumericScrollAnchor(e){const t=this.getLayoutDiff();if(t==null)return;const{disableFileHeader:i=!1,expandUnchanged:n=!1,collapsed:r=!1,collapsedContextThreshold:o=1}=this.options;if(r)return;const s=this.getDiffStyle(),l=this.getHunkSeparatorType();this.approximateLayoutCheckpoints(t);const a=this.getLayoutCheckpointBeforeTop(e);let d=a?.top??dt(this.metrics,i)+this.cache.fileAnnotationHeight,u;return Ye({diff:t,diffStyle:s,startingLine:a?.renderedLineIndex??0,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:o,callback:({hunkIndex:c,hunk:f,collapsedBefore:h,collapsedAfter:m,deletionLine:g,additionLine:y})=>{const v=s==="split"?y?.splitLineIndex??g?.splitLineIndex:y?.unifiedLineIndex??g?.unifiedLineIndex;if(v==null)throw new Error("VirtualizedFileDiff.getNumericScrollAnchor: missing line index data");if(h>0){const b=St({type:l,metrics:this.metrics,hunkIndex:c,hunkSpecs:f?.hunkSpecs});b!=null&&(d+=b.totalHeight)}if(d>=e&&(g!=null?u={lineNumber:g.lineNumber,side:"deletions",top:d}:y!=null&&(u={lineNumber:y.lineNumber,side:"additions",top:d}),u!=null))return!0;const _=this.getLineHeight(v,(y?.noEOFCR??!1)||(g?.noEOFCR??!1));if(d+=_,m>0){const b=Xe({type:l,metrics:this.metrics});b!=null&&(d+=b.totalHeight)}return!1}}),u}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){const t=this.getLayoutDiff();if(this.top==null||t==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};const i=e!=null?this.computeRenderRangeFromWindow(t,this.top,e):this.renderRange;if(i==null)return;const{bufferBefore:n,bufferAfter:r,totalLines:o}=i;let s=0;if(o===0){const l=e??this.virtualizer.getWindowSpecs();this.top<l.top&&(s=r)}return{topOffset:this.top+n+s,height:this.height-(n+r)}}cleanUp(e=!1){const t=this.cache.ghostTextRows.size>0;t&&(this.layoutDirty=!0);const i=e&&this.isAdvancedMode()&&this.fileContainer!=null&&(t||!G(this.getRenderedDiff(),this.getLatestDiff()));this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||(this.resetLayoutCache({includeEstimatedHeights:!0}),this.pendingExpansions=void 0,this.pendingHydratedDiff=void 0),this.pendingRender=void 0,this.isSetup=!1,super.cleanUp(e),i&&this.virtualizer.instanceChanged(this,!0)}expandHunk=(e,t,i)=>{this.fileDiff!=null&&(this.loadFilesIfNecessary(),this.isAdvancedMode()?(this.pendingExpansions??=[],this.pendingExpansions.push({hunkIndex:e,direction:t,expansionLineCountOverride:i})):(this.hunksRenderer.expandHunk(e,t,i),this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()),this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))};async handleFilesLoaded(e,t){if(!(this.fileDiff!==e||!e.isPartial)){if(this.isAdvancedMode()){const i=Ln("clone",e,t);if(await En(()=>this.primeHighlightCache(i)),this.fileDiff!==e)return;this.pendingHydratedDiff={expectedDiff:e,nextDiff:i,files:t}}else{if(Ln("merge",e,t),this.setHydratedState(t),!this.installHydratedSessionDiff(e)&&(await En(()=>this.primeHighlightCache(e)),this.fileDiff!==e))return;this.resetLayoutCache({includeEstimatedHeights:!0}),this.computeApproximateSize()}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}}loadFilesIfNecessary(){if(this.pendingHydratedDiff!=null){if(this.pendingHydratedDiff.expectedDiff===this.fileDiff)return;this.pendingHydratedDiff=void 0}super.loadFilesIfNecessary()}isLineRenderable(e){if(super.isLineRenderable(e))return!0;const{pendingExpansions:t}=this,i=this.getRenderedDiff();if(t==null||t.length===0||i==null)return!1;const{expansionLineCount:n=100,collapsedContextThreshold:r=1}=this.options,o=new Map(this.hunksRenderer.getExpandedHunksMap());for(const s of t){const l={...o.get(s.hunkIndex)??{fromStart:0,fromEnd:0}},a=s.expansionLineCountOverride??n;(s.direction==="up"||s.direction==="both")&&(l.fromStart+=a),(s.direction==="down"||s.direction==="both")&&(l.fromEnd+=a),o.set(s.hunkIndex,l)}return ys({fileDiff:i,lineNumber:e,expandedHunks:o,collapsedContextThreshold:r})}invalidateEditSessionLayout(){this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1}),this.isSimpleMode()||this.computeApproximateSize(!0),this.getSimpleVirtualizer()?.requestHeightReconcile(this)}escalateEditSessionRender(){this.invalidateEditSessionLayout(),!(!this.enabled||this.fileDiff==null)&&(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0))}shouldSelfHealEditSession(){return!this.isAdvancedMode()&&super.shouldSelfHealEditSession()}setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(this.renderRange=void 0,e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){if(!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null)return;const e=this.getLatestDiff(),t=e==null?void 0:this.hunksRenderer.getDiffForNextRender(e);this.isSimpleMode()&&(this.pendingRender=void 0),this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!G(this.getRenderedDiff(),t))}syncGhostTextRows(){const e=this.getAdvancedVirtualizer();e!=null?(e.capturePendingLayoutAnchor(),this.layoutDirty=!0,e.instanceChanged(this,!0)):this.getSimpleVirtualizer()?.requestHeightReconcile(this)}applyDocumentChange(e,t,i=!1){const{renderRange:n}=this;this.getAdvancedVirtualizer()?.capturePendingLayoutAnchor(),super.applyDocumentChange(e,t),this.getSimpleVirtualizer()?.markDOMDirty(),this.resetLayoutCache({forceSimpleRecompute:this.isSimpleMode(),includeEstimatedHeights:!0,resetRenderRange:!1});const r=this.getRenderedDiff();if(!this.isSimpleMode())this.computeApproximateSize(!0);else if(i&&n!=null&&r!=null){const o=this.virtualizer.getWindowSpecs(),s=this.computeRenderRangeFromWindow(r,this.top??0,o);s.bufferAfter!==n.bufferAfter&&this.updateBuffers(s)}this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!0)}computeApproximateSize(e=!1,t=this.getLayoutDiff()){const i=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!i)return;const n=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.cache.totalLines=0,t==null){this.layoutDirty=!1;return}this.applyGhostTextRows(t,this.editor?.__getGhostTextRows()??Xt);const{disableFileHeader:r=!1,collapsed:o=!1}=this.options,s=dt(this.metrics,r);if(this.height+=s,o){this.layoutDirty=!1;return}this.height=this.getActiveEstimatedHeight(t)+this.cache.measuredHeightDeltaTotal,i&&!n&&this.validateComputedHeight(t),this.layoutDirty=!1}getLayoutDiff(){return this.pendingRender?.diff??this.getRenderedDiff()}getActiveEstimatedHeight(e=this.getLayoutDiff()){this.ensureEstimatedDiffHeights(e);const t=this.getDiffStyle()==="split"?this.cache.estimatedSplitHeight:this.cache.estimatedUnifiedHeight;if(t==null)throw new Error("VirtualizedFileDiff.getActiveEstimatedHeight: missing estimated height");return t}ensureEstimatedDiffHeights(e=this.getLayoutDiff()){if(e==null){this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0;return}if(this.cache.estimatedSplitHeight!=null&&this.cache.estimatedUnifiedHeight!=null)return;const{disableFileHeader:t=!1,expandUnchanged:i=!1,collapsedContextThreshold:n=1}=this.options,{splitHeight:r,unifiedHeight:o}=Gf({fileDiff:e,metrics:this.metrics,disableFileHeader:t,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:i,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:n,canHydratePartialDiff:Qi(e,this.options.loadDiffFiles!=null)});this.cache.estimatedSplitHeight=r,this.cache.estimatedUnifiedHeight=o}validateComputedHeight(e=this.getLayoutDiff()){if(this.fileContainer==null||e==null)return;const t=this.fileContainer.getBoundingClientRect();t.height!==this.height?console.log("VirtualizedFileDiff.computeApproximateSize: computed height doesnt match",{name:e.name,elementHeight:t.height,computedHeight:this.height}):console.log("VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT")}render({fileContainer:e,fileDiff:t,forceRender:i=!1,lineAnnotations:n,...r}={}){const o=Sn(r,"VirtualizedFileDiff.render"),s=o!=null,l=o?.oldFile,a=o?.newFile,d=s&&(!lo(l,this.deletionFile)||!lo(a,this.additionFile));let u=t??this.fileDiff;t==null&&s&&(d||this.fileDiff==null)&&(u=Ge(o.oldFile,o.newFile,this.options.parseDiffOptions));const{forceRenderOverride:c,isSetup:f}=this;this.forceRenderOverride=void 0;const h=u!=null&&!G(this.fileDiff,u),m=h||d;if(e=this.getOrCreateFileContainer(e),u==null)return console.error("VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data"),!1;h&&this.updateExternalDiff(u,n);const{pendingRenderDiff:g,layoutDiffChanged:y,renderedDiffChanged:v,annotationsChanged:_}=this.pendingRender!=null&&this.pendingRender.latestDiff===(this.getLatestDiff(u)??u)?{pendingRenderDiff:this.pendingRender.diff,layoutDiffChanged:!1,renderedDiffChanged:!1,annotationsChanged:this.syncLineAnnotations(n)}:this.updatePendingRender(u,n);if(y&&this.resetLayoutCache({includeEstimatedHeights:!0}),f)this.top??=this.getVirtualizedTop(),this.layoutDirty&&this.isSimpleMode()&&(this.getSimpleVirtualizer()?.markDOMDirty(),this.computeApproximateSize(!1,g));else{this.computeApproximateSize(!1,g);const S=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(S==null)throw new Error("VirtualizedFileDiff.render: simple virtualizer is not available");S.connect(e,this),this.isVisible=S.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode()&&(!m||!f))return o!=null&&(this.deletionFile=l,this.additionFile=a),h&&this.clearReusableHeader(),this.renderPlaceholder(this.height);const b=this.virtualizer.getWindowSpecs(),L=this.top??0,E=this.computeRenderRangeFromWindow(g,L,b);return super.render({fileDiff:u,fileContainer:e,renderRange:E,lineAnnotations:n,forceRender:(c??i)||_||v||h,...o,...r})}finalizeRender(){if(!G(this.getRenderedDiff(),this.pendingRender?.diff))throw new Error("VirtualizedFileDiff.render: rendered a different diff than its prepared layout");this.pendingRender=void 0,this.isSimpleMode()&&this.getSimpleVirtualizer()?.requestHeightReconcile(this)}updatePendingRender(e,t){const i=this.getLatestDiff(e)??e,n=this.getRenderedDiff(),{pendingRender:r}=this,o=r?.diff??n,s=this.hunksRenderer.getDiffForNextRender(i);return this.pendingRender={latestDiff:i,diff:s},{pendingRenderDiff:s,annotationsChanged:this.syncLineAnnotations(t),layoutDiffChanged:!G(o,s),renderedDiffChanged:!G(n,s)}}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}shouldGuardRebuildScroll(){return!1}isSimpleMode(){return this.virtualizer.type==="simple"}isAdvancedMode(){return this.virtualizer.type==="advanced"}getVirtualizedTop(){return this.virtualizer.type==="advanced"?this.virtualizer.getLocalTopForInstance(this):this.fileContainer!=null?this.virtualizer.getOffsetInScrollContainer(this.fileContainer):0}getSimpleVirtualizer(){return this.virtualizer.type==="simple"?this.virtualizer:void 0}getAdvancedVirtualizer(){return this.virtualizer.type==="advanced"?this.virtualizer:void 0}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}getDiffStyle(){return this.options.diffStyle??"split"}getHunkSeparatorType(){return Dp(this.options.hunkSeparators)}approximateLayoutCheckpoints(e){if(!this.layoutDirty&&this.cache.checkpoints.length>0||e.hunks.length===0||this.options.collapsed===!0)return;const{disableFileHeader:t=!1,expandUnchanged:i=!1,collapsedContextThreshold:n=1}=this.options,r=e.hunks.length-1,o=Qi(e,this.options.loadDiffFiles!=null),s=this.getDiffStyle(),l=this.getHunkSeparatorType(),a=i?!0:this.hunksRenderer.getExpandedHunksMap(),d=kp(this.cache.heightDeltas);let u=dt(this.metrics,t)+this.cache.fileAnnotationHeight,c=0;const f=({rowCount:h,startLineIndex:m,preSeparatorHeight:g=0,postSeparatorHeight:y=0,metadataOffsets:v=[]})=>{if(h<=0)return;const _=c,b=c+h;let L=xp(_);for(;L<b;){const E=L-_,S=u+(E>0?g:0)+E*this.metrics.lineHeight+Ap(v,E)*this.metrics.lineHeight+so(d,m,m+E);this.cache.checkpoints.push({renderedLineIndex:L,lineIndex:m+E,top:S}),L+=Rn}u+=g+h*this.metrics.lineHeight+v.length*this.metrics.lineHeight+so(d,m,m+h)+y,c=b};for(let h=0;h<e.hunks.length;h++){const m=e.hunks[h];if(m==null)throw new Error("VirtualizedFileDiff.approximateLayoutCheckpoints: invalid hunk index");const g=De({isPartial:e.isPartial,rangeSize:m.collapsedBefore,expandedHunks:a,hunkIndex:h,collapsedContextThreshold:n}),y=g.collapsedLines>0?St({type:l,metrics:this.metrics,hunkIndex:h,hunkSpecs:m.hunkSpecs})?.totalHeight??0:0;f({rowCount:g.fromStart,startLineIndex:(s==="split"?m.splitLineStart:m.unifiedLineStart)-g.rangeSize});let v=y;f({rowCount:g.fromEnd,startLineIndex:(s==="split"?m.splitLineStart:m.unifiedLineStart)-g.fromEnd,preSeparatorHeight:v}),g.fromEnd>0&&(v=0);const _=h===r?Pe({fileDiff:e,hunkIndex:h,expandedHunks:a,collapsedContextThreshold:n,errorPrefix:"VirtualizedFileDiff"}):void 0,b=_!=null&&_.collapsedLines>0?Xe({type:l,metrics:this.metrics})?.totalHeight??0:h===r&&o?Xe({type:l,metrics:this.metrics})?.totalHeight??0:0,L=_!=null?_.fromStart+_.fromEnd:0,E=s==="split"?m.splitLineCount:m.unifiedLineCount,S=s==="split"?m.splitLineStart:m.unifiedLineStart;f({rowCount:E,startLineIndex:S,preSeparatorHeight:v,postSeparatorHeight:L===0?b:0,metadataOffsets:Rp({diffStyle:s,hunk:m,rowCount:E})}),_!=null&&L>0&&f({rowCount:L,startLineIndex:S+E,postSeparatorHeight:b})}this.cache.totalLines=c}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,i=this.cache.checkpoints.length-1,n;for(;t<=i;){const r=t+i>>1,o=this.cache.checkpoints[r];if(o==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");o.lineIndex<=e?(n=o,t=r+1):i=r-1}return n}getLayoutCheckpointBeforeTop(e,t){let i=0,n=this.cache.checkpoints.length-1,r=-1;for(;i<=n;){const o=i+n>>1,s=this.cache.checkpoints[o];if(s==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");s.top<=e?(r=o,i=o+1):n=o-1}if(t==null)return r>=0?this.cache.checkpoints[r]:void 0;for(let o=r;o>=0;o--){const s=this.cache.checkpoints[o];if(s==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");if(s.renderedLineIndex%t===0)return s}}getExpandedLineCount(e,t){let i=0;if(e.isPartial){for(const l of e.hunks)i+=t==="split"?l.splitLineCount:l.unifiedLineCount;return i}const{expandUnchanged:n=!1,collapsedContextThreshold:r=1}=this.options,o=n?!0:this.hunksRenderer.getExpandedHunksMap();for(const[l,a]of e.hunks.entries()){const d=t==="split"?a.splitLineCount:a.unifiedLineCount;i+=d;const u=Math.max(a.collapsedBefore,0),{fromStart:c,fromEnd:f,renderAll:h}=De({isPartial:e.isPartial,rangeSize:u,expandedHunks:o,hunkIndex:l,collapsedContextThreshold:r});u>0&&(i+=h?u:c+f)}const s=Pe({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:o,collapsedContextThreshold:r,errorPrefix:"VirtualizedFileDiff"});return s!=null&&(i+=s.fromStart+s.fromEnd),i}getLayoutLineCount(e,t){const i=this.getExpandedLineCount(e,t),n=t==="split"?e.splitLineCount:e.unifiedLineCount;return Math.max(i,n,e.additionLines.length,e.deletionLines.length,this.cache.totalLines)}computeRenderRangeFromWindow(e,t,{top:i,bottom:n}){const{disableFileHeader:r=!1,expandUnchanged:o=!1,collapsedContextThreshold:s=1}=this.options,{hunkLineCount:l,lineHeight:a}=this.metrics,d=this.getDiffStyle(),u=this.getHunkSeparatorType(),c=Qi(e,this.options.loadDiffFiles!=null),f=this.height;let h=this.getLayoutLineCount(e,d);const m=dt(this.metrics,r),g=e.hunks.length>0?_s(this.metrics):0,{fileAnnotationHeight:y}=this.cache,v=m+y,_=Math.max(0,f-m-y-g),b=this.hasFileAnnotations(e),L=t+m,E=y>0&&b&&L<n&&L+y>i;if(t<i-f||t>n)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-m-g};if(h<=l||e.hunks.length===0)return{startingLine:0,totalLines:l,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(e),h=this.getLayoutLineCount(e,d);const S=Math.ceil(Math.max(n-i,0)/a),C=Math.ceil(S/l)*l+l,x=C/l,w=x,A=[],I=(i+n)/2,k=this.getLayoutCheckpointBeforeTop(Math.max(0,i-t-C*a*2),l);let R=t+(k?.top??v),D=k?.renderedLineIndex??0,F,T,M;if(Ye({diff:e,diffStyle:d,startingLine:k?.renderedLineIndex??0,expandedHunks:o?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:s,callback:({hunkIndex:mt,hunk:ye,collapsedBefore:Ci,collapsedAfter:wi,deletionLine:je,additionLine:Ee})=>{const j=Ee!=null?Ee.splitLineIndex:je.splitLineIndex,te=Ee!=null?Ee.unifiedLineIndex:je.unifiedLineIndex,oe=(Ee?.noEOFCR??!1)||(je?.noEOFCR??!1),We=mt===e.hunks.length-1&&ye!=null&&(d==="split"?j===ye.splitLineStart+ye.splitLineCount-1:te===ye.unifiedLineStart+ye.unifiedLineCount-1),le=(Ci>0?St({type:u,metrics:this.metrics,hunkIndex:mt,hunkSpecs:ye?.hunkSpecs}):void 0)?.totalHeight??0;R+=le;const de=D%l===0,He=Math.floor(D/l);if(de&&(A[He]=R-(t+v+le),M!=null)){if(M<=0)return!0;M--}const ie=this.getLineHeight(d==="split"?j:te,oe);if(R>i-ie&&R<n&&(F??=He),T==null&&R+ie>I&&(T=He),M==null&&R>=n&&de&&(M=w),D++,R+=ie,wi>0||We&&c){const It=Xe({type:u,metrics:this.metrics});It!=null&&(R<n&&R+It.totalHeight>i&&(F??=He),T==null&&R+It.totalHeight>I&&(T=He),R+=It.totalHeight)}return!1}}),F==null)if(E)F=0,T=0;else return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:f-m-g};T??=F;const V=Math.round(T-x/2),P=Math.max(0,Math.ceil(h/l)-x),N=Math.max(0,Math.min(V,P)),$=N*l,B=V<0?C+V*l:C,Y=A[N]??0,re=$===0?0:y+Y,pe=N+B/l,Me=pe<A.length?_-A[pe]:_-(R-t-v);return{startingLine:$,totalLines:B,bufferBefore:re,bufferAfter:Math.max(0,Me)}}};function wp(e){let t;for(const i of e){if(i==null)continue;const n=i.children[1];if(n instanceof HTMLElement)for(const r of n.children)r instanceof HTMLElement&&r.dataset.lineAnnotation===jc&&(t=Math.max(t??0,r.getBoundingClientRect().height))}return t}function kp(e){const t=Array.from(e).sort((o,s)=>o[0]-s[0]),i=[],n=[0];let r=0;for(const[o,s]of t)i.push(o),r+=s,n.push(r);return{lineIndexes:i,prefixTotals:n}}function so({lineIndexes:e,prefixTotals:t},i,n){if(i>=n||e.length===0)return 0;const r=ao(e,i);return(t[ao(e,n)]??0)-(t[r]??0)}function ao(e,t){let i=0,n=e.length;for(;i<n;){const r=i+n>>1,o=e[r];if(o==null)throw new Error("VirtualizedFileDiff: invalid prefix index");o<t?i=r+1:n=r}return i}function xp(e){return Math.ceil(e/Rn)*Rn}function Ap(e,t){let i=0;for(const n of e)n<t&&i++;return i}function Rp({diffStyle:e,hunk:t,rowCount:i}){if(i<=0||!t.noEOFCRAdditions&&!t.noEOFCRDeletions)return[];const n=t.hunkContent.at(-1);if(n==null)return[];if(n.type==="context")return[i-1];const r=Math.max(n.deletions,n.additions),o=n.deletions+n.additions;if(e==="split")return r>0&&(t.noEOFCRAdditions||t.noEOFCRDeletions)?[i-1]:[];const s=[],l=i-o;return n.deletions>0&&t.noEOFCRDeletions&&s.push(l+n.deletions-1),n.additions>0&&t.noEOFCRAdditions&&s.push(i-1),s}function Tp(e,t){return(e.diffStyle??"split")!==(t.diffStyle??"split")||(e.overflow??"scroll")!==(t.overflow??"scroll")||(e.collapsed??!1)!==(t.collapsed??!1)||(e.disableLineNumbers??!1)!==(t.disableLineNumbers??!1)||(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.diffIndicators??"bars")!==(t.diffIndicators??"bars")||(e.hunkSeparators??"line-info")!==(t.hunkSeparators??"line-info")||!!e.loadDiffFiles!=!!t.loadDiffFiles||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)||e.unsafeCSS!==t.unsafeCSS}function Ip(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??"line-info")!==(t.hunkSeparators??"line-info")||!!e.loadDiffFiles!=!!t.loadDiffFiles||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??1)!==(t.collapsedContextThreshold??1)}function Qi(e,t){return e.isPartial&&t&&(e.type==="change"||e.type==="rename-changed")}function Dp(e){return typeof e=="function"?"custom":e??"line-info"}function lo(e,t){return e==null||t==null?e==null&&t==null:vs(e,t)}function Pp(e,t){const[i,n]=e.split(",").map(Number);return t==="split"?n:i}function qs(e,t){return typeof window>"u"&&t!=null?U.jsxs(U.Fragment,{children:[U.jsx("template",{shadowrootmode:"open",dangerouslySetInnerHTML:{__html:t}}),e]}):U.jsx(U.Fragment,{children:e})}const Op=q.createContext(void 0);function Mp(){return q.useContext(Op)}const Hp=typeof window>"u"?q.useEffect:q.useLayoutEffect;function Ks({fileDiff:e,oldFile:t,newFile:i,options:n,editorOptions:r,editStateKey:o,lineAnnotations:s,selectedLines:l,prerenderedHTML:a,metrics:d,hasGutterRenderUtility:u,hasCustomHeader:c,disableWorkerPool:f,edit:h,onEditChange:m,onEditComplete:g}){const y=Mp(),v=l!==void 0,_=q.useContext(Gc),b=ta(),[L,E]=q.useState(),S=Pt(P=>m?.(P)),C=m!=null?S:void 0,x=q.useRef(null),w=Pt(P=>{const N=g?.(P)??"reject";return N==="accept"&&(x.current={fileDiff:{installed:P.fileDiff,stale:P.originalFileDiff},filePair:e==null?{fileDiff:P.fileDiff,installed:{oldFile:P.oldFile,newFile:P.newFile},stale:{oldFile:t??null,newFile:i??null}}:null,annotations:{installed:P.lineAnnotations,stale:P.originalLineAnnotations}}),N}),A=g!=null?w:void 0,I=Np({acceptedCache:x,fileDiff:e,newFile:i,oldFile:t,parseDiffOptions:n?.parseDiffOptions}),k=q.useRef(null),R=q.useRef(null),D=q.useRef(null),F=Pt(()=>{if(b==null)throw new Error("FileDiff: EditContext is not attached");return b("file-diff",r??{},o)}),T=Pt(P=>{if(P!=null){if(k.current!=null)throw new Error("useFileDiffInstance: An instance should not already exist when a node is created");y!=null?k.current=new Cp(Zi({controlledSelection:v,hasCustomHeader:c,hasGutterRenderUtility:u,onEditChange:C,onEditComplete:A,options:n}),y,d,f?void 0:_,!0):k.current=new Ws(Zi({controlledSelection:v,hasCustomHeader:c,hasGutterRenderUtility:u,onEditChange:C,onEditComplete:A,options:n}),f?void 0:_,!0),k.current.hydrate({fileDiff:I,fileContainer:P,lineAnnotations:s,prerenderedHTML:a})}else{if(k.current==null)throw new Error("useFileDiffInstance: A FileDiff instance should exist when unmounting");D.current=null,k.current.cleanUp(),k.current=null,R.current=null}});Hp(()=>{const{current:P}=k;if(P==null)return;const N=Zi({controlledSelection:v,hasCustomHeader:c,hasGutterRenderUtility:u,onEditChange:C,onEditComplete:A,options:n}),$=N!==void 0&&!Ls(P.options,N);if(P.setOptions(N),!h&&(D.current=null,R.current!=null)){const{current:Me}=R;R.current=null,Me()}const B=Fp(I,s,x);if(P.render({forceRender:$,fileDiff:B.fileDiff,lineAnnotations:B.lineAnnotations}),l!==void 0&&P.setSelectedLines(l),!h||R.current!=null)return;if(b==null)throw new Error("FileDiff: EditContext is not attached");const Y=()=>{k.current!==P||R.current!=null||!P.__canAttachEditor()||(R.current=Vp(P,F))};if(P.__canAttachEditor()){D.current=null,Y();return}const re=P.__prepareForEditing();if(re==null){D.current=null;return}if(D.current?.promise===re)return;const pe={promise:re};D.current=pe,re.then(()=>{D.current===pe&&(Y(),D.current=null)}).catch(Me=>{D.current===pe&&(D.current=null,E(Me))})});const M=q.useCallback(()=>k.current?.getHoveredLine(),[]),V=q.useCallback(P=>k.current?.getAnnotationSlotName(P)??Je(P),[]);if(L!=null)throw L;return{fileDiff:I,ref:T,getHoveredLine:M,getAnnotationSlotName:V}}function Np({acceptedCache:e,fileDiff:t,newFile:i,oldFile:n,parseDiffOptions:r}){return q.useMemo(()=>{if(t!=null)return t;const{current:o}=e,s=o?.filePair;if(o!=null&&s!=null){if(uo(n,i,s.stale)||uo(n,i,s.installed))return s.fileDiff;o.filePair=null}return Ge(n??null,i??null,r)},[e,t,n,i,r])}function uo(e,t,i){return Dr(e??void 0,i.oldFile??void 0)&&Dr(t??void 0,i.newFile??void 0)}function Fp(e,t,i){const{current:n}=i;if(n==null)return{fileDiff:e,lineAnnotations:t};const{fileDiff:r,annotations:o}=n;let s=e;r!=null&&(G(e,r.stale)?s=r.installed:n.fileDiff=null);let l=t;return o!=null&&(t===o.stale?l=o.installed:n.annotations=null),n.fileDiff==null&&n.annotations==null&&n.filePair==null&&(i.current=null),{fileDiff:s,lineAnnotations:l}}function Zi({options:e,controlledSelection:t,hasCustomHeader:i,hasGutterRenderUtility:n,onEditChange:r,onEditComplete:o}){return t||n||i||r!=null||o!=null?{...e,controlledSelection:t,renderCustomHeader:i?Bn:e?.renderCustomHeader,renderGutterUtility:n?Bn:e?.renderGutterUtility,onEditChange:r,onEditComplete:o}:e}function Vp(e,t){const i=t();try{return i.edit(e)}catch(n){throw i.cleanUp(),n}}function $p({oldFile:e,newFile:t,options:i,editorOptions:n,editStateKey:r,metrics:o,lineAnnotations:s,selectedLines:l,className:a,style:d,prerenderedHTML:u,renderAnnotation:c,renderCustomHeader:f,renderHeaderPrefix:h,renderHeaderFilenameSuffix:m,renderHeaderMetadata:g,renderGutterUtility:y,disableWorkerPool:v=!1,edit:_=!1,onEditChange:b,onEditComplete:L}){const{fileDiff:E,ref:S,getHoveredLine:C,getAnnotationSlotName:x}=Ks({oldFile:e,newFile:t,options:i,editorOptions:n,editStateKey:r,metrics:o,lineAnnotations:s,selectedLines:l,prerenderedHTML:u,hasGutterRenderUtility:y!=null,hasCustomHeader:f!=null,disableWorkerPool:v,edit:_,onEditChange:b,onEditComplete:L}),w=_o({fileDiff:E,renderCustomHeader:f,renderHeaderPrefix:h,renderHeaderFilenameSuffix:m,renderHeaderMetadata:g,renderAnnotation:c,lineAnnotations:s,renderGutterUtility:y,getHoveredLine:C,getAnnotationSlotName:x});return U.jsx(Tn,{ref:S,className:a,style:d,children:qs(w,u)})}function Up(e){const t=vh(e);if(t.length!==1)throw console.error(t),new Error("PatchDiff: Provided patch must include only 1 patch, with 1 diff");const{files:i}=t[0];if(i.length!==1)throw console.error(i),new Error("FileDiff: Provided patch must contain exactly 1 file diff");return i[0]}function zp({patch:e,options:t,editorOptions:i,editStateKey:n,metrics:r,lineAnnotations:o,selectedLines:s,className:l,style:a,prerenderedHTML:d,renderAnnotation:u,renderCustomHeader:c,renderHeaderPrefix:f,renderHeaderFilenameSuffix:h,renderHeaderMetadata:m,renderGutterUtility:g,disableWorkerPool:y=!1,edit:v=!1,onEditChange:_,onEditComplete:b}){const L=Bp(e),{ref:E,getHoveredLine:S,getAnnotationSlotName:C}=Ks({fileDiff:L,options:t,editorOptions:i,editStateKey:n,metrics:r,lineAnnotations:o,selectedLines:s,prerenderedHTML:d,hasGutterRenderUtility:g!=null,hasCustomHeader:c!=null,disableWorkerPool:y,edit:v,onEditChange:_,onEditComplete:b}),x=_o({fileDiff:L,renderCustomHeader:c,renderHeaderPrefix:f,renderHeaderFilenameSuffix:h,renderHeaderMetadata:m,renderAnnotation:u,lineAnnotations:o,renderGutterUtility:g,getHoveredLine:S,getAnnotationSlotName:C});return U.jsx(Tn,{ref:E,className:l,style:a,children:qs(x,d)})}function Bp(e){return q.useMemo(()=>Up(e),[e])}const Gp=["Binary files ","GIT binary patch","similarity index ","rename from ","rename to ","copy from ","copy to ","new file mode ","deleted file mode ","old mode ","new mode "];function jp({patch:e}){const t=e.split(`
298
+ `).filter(i=>Gp.some(n=>i.startsWith(n)));return t.length===0?U.jsx("p",{className:"p-3 text-caption text-muted-foreground",children:"No textual changes."}):U.jsx("div",{className:"p-3 font-mono text-caption",children:t.map(i=>U.jsx("div",{children:i},i))})}function Wp({patch:e,options:t}){return/^@@ -\d/m.test(e)?U.jsx(zp,{patch:e,options:t}):U.jsx(jp,{patch:e})}function Zp({className:e,layout:t,...i}){const{resolvedTheme:n}=Xs(),r=i.patch!==void 0,o={theme:{dark:"pierre-dark",light:"pierre-light"},themeType:n,diffStyle:t??(r?"unified":"split"),diffIndicators:"classic",disableFileHeader:!0,overflow:"wrap"};return U.jsx("div",{className:Js("code-diff min-w-0 overflow-auto rounded-md border border-border bg-card",e),children:i.patch!==void 0?U.jsx(Wp,{patch:i.patch,options:o}):U.jsx($p,{oldFile:{name:i.filename??"content.txt",contents:i.codeA},newFile:{name:i.filename??"content.txt",contents:i.codeB},options:o})})}export{Zp as CodeDiff};