@kilocode/cli-darwin-arm64 7.5.15 → 7.6.0

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 (115) hide show
  1. package/bin/console/assets/AgentsRoute-CM6fw2cq.js +3 -0
  2. package/bin/console/assets/CliNotificationsRoute-BczmRSyg.js +1 -0
  3. package/bin/console/assets/CliUiRoute-CY-IjU1R.js +1 -0
  4. package/bin/console/assets/ConfigLayout-BnoOuJ0J.js +1 -0
  5. package/bin/console/assets/ConfigLayout-DjHPFaCq.css +1 -0
  6. package/bin/console/assets/ConfigPage-CF46-J2f.js +1 -0
  7. package/bin/console/assets/ConfirmDialog-BxeZcJR2.js +1 -0
  8. package/bin/console/assets/ConsoleUiRoute-BrZ2QFr6.js +1 -0
  9. package/bin/console/assets/CustomSelect-Bv8ga_sb.js +1 -0
  10. package/bin/console/assets/FormattersRoute-5K8HEXB2.css +1 -0
  11. package/bin/console/assets/FormattersRoute-CuG-ehXq.js +3 -0
  12. package/bin/console/assets/GhosttyTerminal-DOfViera.js +13 -0
  13. package/bin/console/assets/IndexingRoute-D0nIx9Pv.css +1 -0
  14. package/bin/console/assets/IndexingRoute-QzgacqGk.js +1 -0
  15. package/bin/console/assets/KeybindsRoute-BSo2-u5g.js +1 -0
  16. package/bin/console/assets/KeybindsRoute-DPP8xngh.css +1 -0
  17. package/bin/console/assets/LoginRoute-BvXKCbLf.js +1 -0
  18. package/bin/console/assets/McpRoute-D-Grz23A.js +138 -0
  19. package/bin/console/assets/McpRoute-D22Npdv0.css +1 -0
  20. package/bin/console/assets/ModelsRoute-Dk1uAzWQ.css +1 -0
  21. package/bin/console/assets/ModelsRoute-FzKm3GFg.js +1 -0
  22. package/bin/console/assets/OverviewRoute-DzMpRpg0.js +1 -0
  23. package/bin/console/assets/OverviewRoute-neFLWBjP.css +1 -0
  24. package/bin/console/assets/PermissionsRoute-BIjHuwFU.css +1 -0
  25. package/bin/console/assets/PermissionsRoute-D79Jf9T-.js +1 -0
  26. package/bin/console/assets/ProfileRoute-DY1DmDkk.js +1 -0
  27. package/bin/console/assets/ProjectConsoleRoute-B2CEEUWZ.js +4 -0
  28. package/bin/console/assets/ProjectConsoleRoute-Df0w2iOW.css +1 -0
  29. package/bin/console/assets/ProvidersRoute-jdHnKSmI.js +5 -0
  30. package/bin/console/assets/ServersRoute-BBRszzTY.css +1 -0
  31. package/bin/console/assets/ServersRoute-CLKvecV4.js +1 -0
  32. package/bin/console/assets/SourcesRoute-DIzmjUWT.js +1 -0
  33. package/bin/console/assets/SourcesRoute-DMunRt3T.css +1 -0
  34. package/bin/console/assets/ToolsRoute-Br8SrorE.js +1 -0
  35. package/bin/console/assets/agents-tools-DXx49OgX.css +1 -0
  36. package/bin/console/assets/button-DUESCiL9.js +1 -0
  37. package/bin/console/assets/cli-ui-DymkjzY0.css +1 -0
  38. package/bin/console/assets/config-rLoO0LDc.js +1 -0
  39. package/bin/console/assets/console-D_ICjwvI.js +1 -0
  40. package/bin/console/assets/dialogs-BCnEWnpn.css +1 -0
  41. package/bin/console/assets/file-PqLbqN2Z.js +649 -0
  42. package/bin/console/assets/index-5EVEMIHJ.css +1 -0
  43. package/bin/console/assets/index-aE_EEdSy.js +19 -0
  44. package/bin/console/assets/models-CkIsKFzm.css +1 -0
  45. package/bin/console/assets/models-wZrb2WKp.js +1 -0
  46. package/bin/console/assets/profile-Do_gK9qi.css +1 -0
  47. package/bin/console/assets/profile-tmBfOA4S.js +1 -0
  48. package/bin/console/assets/session-review-DUVNnuDV.js +30 -0
  49. package/bin/console/assets/tag-CWrSVrX3.js +1 -0
  50. package/bin/console/assets/ui-hTWDRfzG.js +1 -0
  51. package/bin/console/index.html +2 -2
  52. package/bin/kilo +0 -0
  53. package/package.json +1 -1
  54. package/bin/console/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  55. package/bin/console/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  56. package/bin/console/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  57. package/bin/console/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  58. package/bin/console/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  59. package/bin/console/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  60. package/bin/console/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  61. package/bin/console/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  62. package/bin/console/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  63. package/bin/console/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  64. package/bin/console/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  65. package/bin/console/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  66. package/bin/console/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  67. package/bin/console/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  68. package/bin/console/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  69. package/bin/console/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  70. package/bin/console/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  71. package/bin/console/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  72. package/bin/console/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  73. package/bin/console/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  74. package/bin/console/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  75. package/bin/console/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  76. package/bin/console/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  77. package/bin/console/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  78. package/bin/console/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  79. package/bin/console/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  80. package/bin/console/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  81. package/bin/console/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  82. package/bin/console/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  83. package/bin/console/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  84. package/bin/console/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  85. package/bin/console/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  86. package/bin/console/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  87. package/bin/console/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  88. package/bin/console/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  89. package/bin/console/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  90. package/bin/console/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  91. package/bin/console/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  92. package/bin/console/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  93. package/bin/console/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  94. package/bin/console/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  95. package/bin/console/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  96. package/bin/console/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  97. package/bin/console/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  98. package/bin/console/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  99. package/bin/console/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  100. package/bin/console/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  101. package/bin/console/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  102. package/bin/console/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  103. package/bin/console/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  104. package/bin/console/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  105. package/bin/console/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  106. package/bin/console/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  107. package/bin/console/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  108. package/bin/console/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  109. package/bin/console/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  110. package/bin/console/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  111. package/bin/console/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  112. package/bin/console/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  113. package/bin/console/assets/index--cB3s5a_.js +0 -851
  114. package/bin/console/assets/index-B2oknisZ.css +0 -1
  115. package/bin/console/logo.lottie +0 -0
@@ -0,0 +1,649 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/angular-html-DA-rfuFy.js","assets/html-pp8916En.js","assets/javascript-wDzz0qaB.js","assets/css-CLj8gQPS.js","assets/angular-ts-BrjP3tb8.js","assets/scss-D5BDwBP9.js","assets/apl-CORt7UWP.js","assets/xml-sdJ4AIDG.js","assets/java-CylS5w8V.js","assets/json-Cp-IABpG.js","assets/astro-HNnZUWAn.js","assets/typescript-BPQ3VLAy.js","assets/postcss-CXtECtnM.js","assets/tsx-COt5Ahok.js","assets/blade-2xfisSek.js","assets/html-derivative-DlHx6ybY.js","assets/sql-CRqJ_cUM.js","assets/bsl-BO_Y6i37.js","assets/sdbl-DVxCFoDh.js","assets/cairo-KRGpt6FW.js","assets/python-B6aJPvgy.js","assets/cobol-nBiQ_Alo.js","assets/coffee-Ch7k5sss.js","assets/cpp-UfJy6YNI.js","assets/regexp-CDVJQ6XC.js","assets/glsl-DplSGwfg.js","assets/c-BIGW1oBm.js","assets/crystal-DGywbUpC.js","assets/shellscript-Yzrsuije.js","assets/edge-FbVlp4U3.js","assets/elixir-CkH2-t6x.js","assets/elm-DbKCFpqz.js","assets/erb-Dm6A9KJ5.js","assets/ruby-DyJCeAvU.js","assets/haml-D5jkg6IW.js","assets/graphql-ChdNCCLP.js","assets/jsx-g9-lgVsj.js","assets/lua-BaeVxFsk.js","assets/yaml-Buea-lGh.js","assets/erlang-DsQrWhSR.js","assets/markdown-Cvjx9yec.js","assets/fortran-fixed-form-CkoXwp7k.js","assets/fortran-free-form-BxgE0vQu.js","assets/fsharp-CXgrBDvD.js","assets/gdresource-BOOCDP_w.js","assets/gdshader-DkwncUOv.js","assets/gdscript-C5YyOfLZ.js","assets/git-commit-F4YmCXRG.js","assets/diff-D97Zzqfu.js","assets/git-rebase-r7XF79zn.js","assets/glimmer-js-ByusRIyA.js","assets/glimmer-ts-BfAWNZQY.js","assets/hack-DbPARsA_.js","assets/handlebars-BpdQsYii.js","assets/http-jrhK8wxY.js","assets/hurl-irOxFIW8.js","assets/csv-fuZLfV_i.js","assets/hxml-Bvhsp5Yf.js","assets/haxe-CzTSHFRz.js","assets/jinja-f2NsQr07.js","assets/jison-wvAkD_A8.js","assets/julia-D7OTSIA_.js","assets/r-Dspwwk_N.js","assets/just-CUsbIsdP.js","assets/perl-B9cMNwum.js","assets/latex-CaSxy8MP.js","assets/tex-idrVyKtj.js","assets/liquid-C0sCDyMI.js","assets/marko-DjSrsDqO.js","assets/less-B1dDrJ26.js","assets/mdc-DTYItulj.js","assets/nextflow-C-mBbutL.js","assets/nextflow-groovy-vE_lwT2v.js","assets/nginx-BpAMiNFr.js","assets/nim-BIad80T-.js","assets/php-Csjmro_R.js","assets/pug-DKIMFp6K.js","assets/qml-3beO22l8.js","assets/razor-BjBPvh-w.js","assets/csharp-DSvCPggb.js","assets/rst-CpCqk9r5.js","assets/cmake-D1j8_8rp.js","assets/sas-DEy46yEz.js","assets/shaderlab-Dg9Lc6iA.js","assets/hlsl-D3lLCCz7.js","assets/shellsession-BADoaaVG.js","assets/soy-8wufbnw4.js","assets/sparql-rVzFXLq3.js","assets/turtle-BsS91CYL.js","assets/stata-DI20mbqo.js","assets/surrealql-Bq5Q-fJD.js","assets/svelte-Cy7k_4gC.js","assets/templ-DhtptRzy.js","assets/go-C27-OAKa.js","assets/ts-tags-D351s5mN.js","assets/twig-CW1WmMYd.js","assets/vue-D2xRrEX4.js","assets/vue-html-AaS7Mt5G.js","assets/vue-vine-BoDAl6tE.js","assets/stylus-BEDo0Tqx.js","assets/xsl-CtQFsRM5.js"])))=>i.map(i=>d[i]);
2
+ import{bb as rc,e as we,g as ct,b3 as gr,aE as br,bc as oc,bd as ua,be as ha,o as He,bf as sc,N as ac,O as lc,a0 as m,b2 as dc,b4 as cc,d as fa,b6 as uc,a1 as pa,c as re,b as hc,at as fc,f as Y,M as mn,S as Vn,s as ke,i as le,p as pc,t as tt,aZ as gn,a2 as zn,m as mc,v as Ut,x as xo,b7 as gc,h as ma,G as ga,Z as bc,a_ as vc}from"./index-aE_EEdSy.js";function Ze(e,t,n,i){return e.addEventListener(t,n,i),rc(e.removeEventListener.bind(e,t,n,i))}function N0(e,t,n,i){const r=()=>{gr(br(e)).forEach(o=>{o&&gr(br(t)).forEach(s=>Ze(o,s,n,i))})};typeof e=="function"?we(r):ct(r)}function yc(e,t=ha()){let n=0,i,r;return()=>(n++,He(()=>{n--,queueMicrotask(()=>{!n&&r&&(r(),r=i=void 0)})}),r||ua(o=>i=e(r=o),t),i)}function _c(e){const t=ha(),n=yc(e,t);return()=>oc.context?ua(e,t):n()}function ba(e,t=!1){const n=window.matchMedia(e),[i,r]=sc(t,()=>n.matches);return Ze(n,"change",()=>r(n.matches)),i}function wc(e){return ba("(prefers-color-scheme: dark)",e)}wc.bind(void 0,!1);const Sc={"ui.sessionReview.title":"Session changes","ui.sessionReview.title.git":"Git changes","ui.sessionReview.title.branch":"Branch changes","ui.sessionReview.title.lastTurn":"Last turn changes","ui.sessionReview.diffStyle.unified":"Unified","ui.sessionReview.diffStyle.split":"Split","ui.sessionReview.expandAll":"Expand all","ui.sessionReview.collapseAll":"Collapse all","ui.sessionReview.change.added":"Added","ui.sessionReview.change.removed":"Removed","ui.sessionReview.change.modified":"Modified","ui.sessionReview.image.loading":"Loading...","ui.sessionReview.image.placeholder":"Image","ui.sessionReview.largeDiff.title":"Diff too large to render","ui.sessionReview.largeDiff.meta":"Limit: {{limit}} changed lines. Current: {{current}} changed lines.","ui.sessionReview.largeDiff.renderAnyway":"Render anyway","ui.sessionReviewV2.expandMode":"Expand or collapse diff","ui.sessionReviewV2.filterFiles":"Filter files","ui.sessionReviewV2.toggleSidebar":"Toggle file tree","ui.sessionReviewV2.showAllLines":"Show all lines","ui.sessionReviewV2.hideNonDiffLines":"Hide non-diff lines","ui.sessionReviewV2.unifiedDiff":"Unified diff","ui.sessionReviewV2.splitDiff":"Split diff","ui.sessionReviewV2.previousFile":"Previous file","ui.sessionReviewV2.nextFile":"Next file","ui.sessionReviewV2.diffView":"Diff view","ui.sessionReviewV2.empty.noGit.title":"No tracked changes","ui.sessionReviewV2.empty.noGit.description":"Track, review, and undo changes in this project","ui.sessionReviewV2.empty.noGit.action":"Create Git repository","ui.sessionReviewV2.empty.noGit.actionLoading":"Creating Git repository...","ui.sessionReviewV2.empty.changes.title":"No file changes yet","ui.sessionReviewV2.empty.changes.description":"Project changes will appear here","ui.sessionReview.openFile":"Open file","ui.sessionReview.selection.line":"line {{line}}","ui.sessionReview.selection.lines":"lines {{start}}-{{end}}","ui.fileMedia.kind.image":"image","ui.fileMedia.kind.audio":"audio","ui.fileMedia.state.removed":"Removed {{kind}} file.","ui.fileMedia.state.loading":"Loading {{kind}}...","ui.fileMedia.state.error":"Unable to load {{kind}}.","ui.fileMedia.state.unavailable":"{{kind}} preview unavailable.","ui.fileMedia.binary.title":"Binary file","ui.fileMedia.binary.description.path":"{{path}} is binary.","ui.fileMedia.binary.description.default":"Binary content","ui.lineComment.label.prefix":"Comment on ","ui.lineComment.label.suffix":"","ui.lineComment.editorLabel.prefix":"Commenting on ","ui.lineComment.editorLabel.suffix":"","ui.lineComment.placeholder":"Add comment","ui.lineComment.contextPlaceholder":"Add context for this change","ui.lineComment.submit":"Comment","ui.lineComment.cancel":"Cancel","ui.sessionTurn.steps.show":"Show steps","ui.sessionTurn.steps.hide":"Hide steps","ui.sessionTurn.summary.response":"Response","ui.sessionTurn.diff.showMore":"Show more changes ({{count}})","ui.sessionTurn.diffs.changed.one":"{{count}} Changed file","ui.sessionTurn.diffs.changed.other":"{{count}} Changed files","ui.sessionTurn.diffs.showAll":"Show all","ui.sessionTurn.diffs.showLess":"Show less","ui.sessionTurn.diffs.more":"+{{count}} more files","ui.sessionTurn.retry.retrying":"retrying","ui.sessionTurn.retry.inSeconds":"in {{seconds}}s","ui.sessionTurn.retry.attempt":"attempt #{{attempt}}","ui.sessionTurn.retry.attemptLine":"{{line}} - attempt #{{attempt}}","ui.sessionTurn.retry.geminiHot":"gemini is way too hot right now","ui.sessionTurn.error.freeUsageExceeded":"Free usage exceeded","ui.sessionTurn.error.addCredits":"Add credits","dialog.usageExceeded.freeTier.title":"Free limit reached","dialog.usageExceeded.freeTier.description":"Subscribe to Kilo Go for reliable access to the best open-source models, starting at $5/month.","dialog.usageExceeded.freeTier.actionLabel":"Subscribe","dialog.usageExceeded.accountRateLimit.title":"Go limit reached","dialog.usageExceeded.accountRateLimit.description":"Usage limit reached. To continue using this model now, enable usage from your available balance","dialog.usageExceeded.accountRateLimit.actionLabel":"Open settings","ui.sessionTurn.status.delegating":"Delegating work","ui.sessionTurn.status.delegatingWaitingPermission":"Subagent waiting for permission","ui.sessionTurn.status.delegatingWaitingQuestion":"Subagent waiting for response","ui.sessionTurn.status.planning":"Planning next steps","ui.sessionTurn.status.gatheringContext":"Exploring","ui.sessionTurn.status.gatheredContext":"Explored","ui.sessionTurn.status.searchingCodebase":"Searching the codebase","ui.sessionTurn.status.searchingWeb":"Searching the web","ui.sessionTurn.status.makingEdits":"Making edits","ui.sessionTurn.status.runningCommands":"Running commands","ui.sessionTurn.status.thinking":"Thinking","ui.sessionTurn.status.thinkingWithTopic":"Thinking - {{topic}}","ui.sessionTurn.status.gatheringThoughts":"Gathering thoughts","ui.sessionTurn.status.consideringNextSteps":"Considering next steps","ui.messagePart.diagnostic.error":"Error","ui.messagePart.mcp.input":"Input","ui.messagePart.mcp.output":"Output","ui.messagePart.board.read":"Read agent messages","ui.messagePart.board.all":"All agents","ui.messagePart.board.primary":"Primary agent","ui.messagePart.board.agent":"Agent","ui.messagePart.board.route":"{{from}} to {{to}}","ui.messagePart.board.empty":"No agent messages","ui.messagePart.board.stored":"Stored only. Delivery and reading are not confirmed.","ui.messagePart.title.edit":"Edit","ui.messagePart.title.write":"Write","ui.messagePart.option.typeOwnAnswer":"Type your own answer","ui.messagePart.review.title":"Review your answers","ui.messagePart.questions.dismissed":"Questions dismissed","ui.messagePart.compaction":"Session compacted","ui.messagePart.context.read.one":"{{count}} read","ui.messagePart.context.read.other":"{{count}} reads","ui.messagePart.context.search.one":"{{count}} search","ui.messagePart.context.search.other":"{{count}} searches","ui.messagePart.context.list.one":"{{count}} list","ui.messagePart.context.list.other":"{{count}} lists","ui.list.loading":"Loading","ui.list.empty":"No results","ui.list.clearFilter":"Clear filter","ui.list.emptyWithFilter.prefix":"No results for","ui.list.emptyWithFilter.suffix":"","ui.fileSearch.placeholder":"Find","ui.fileSearch.previousMatch":"Previous match","ui.fileSearch.nextMatch":"Next match","ui.fileSearch.close":"Close search","ui.messageNav.newMessage":"New message","ui.promptInput.noMatchingItems":"No matching items","ui.promptInput.commands":"Commands","ui.promptInput.dropFiles":"Drop files to attach","ui.promptInput.removeAttachment":"Remove attachment","ui.promptInput.label":"Prompt","ui.promptInput.placeholder.shell":"Enter shell command...","ui.promptInput.placeholder.normal":"Ask anything, {{slash}} for commands, {{at}} for context...","ui.promptInput.add":"Add images and files","ui.promptInput.attachments":"Images and files","ui.promptInput.context":"Context","ui.promptInput.shell":"Shell command","ui.promptInput.chooseAgent":"Choose agent","ui.promptInput.chooseModel":"Choose model","ui.promptInput.chooseVariant":"Choose model variant","ui.promptInput.send":"Send","ui.promptInput.stop":"Stop","ui.tabs.close":"Close tab","ui.textField.copyToClipboard":"Copy to clipboard","ui.textField.copyLink":"Copy link","ui.textField.copied":"Copied","ui.imagePreview.alt":"Image preview","ui.mermaid.rendering":"Rendering Mermaid diagram...","ui.mermaid.renderError":"Mermaid render failed: {{message}}","ui.mermaid.errorDefault":"Unable to render Mermaid diagram.","ui.mermaid.errorEmpty":"Mermaid rendered an empty diagram.","ui.mermaid.download":"Download","ui.mermaid.copySource":"Copy Mermaid source","ui.mermaid.copySvg":"Copy SVG","ui.mermaid.copyPng":"Copy PNG","ui.mermaid.downloadSvg":"Download SVG","ui.mermaid.downloadPng":"Download PNG","ui.scrollView.ariaLabel":"scrollable content","ui.tool.read":"Read","ui.tool.loaded":"Loaded","ui.tool.list":"List","ui.tool.glob":"Glob","ui.tool.grep":"Grep","ui.tool.task":"Task","ui.tool.webfetch":"Webfetch","ui.tool.websearch":"Web Search","ui.tool.websearch.provider":"{{provider}} Web Search","ui.tool.shell":"Shell","ui.tool.patch":"Patch","ui.tool.todos":"To-dos","ui.tool.todos.read":"Read to-dos","ui.tool.questions":"Questions","ui.tool.questions.numbered":"Questions {{number}}","ui.tool.agent":"{{type}} Agent","ui.tool.agent.default":"Agent","ui.tool.skill":"Skill","ui.basicTool.called":"Called `{{tool}}`","ui.toolErrorCard.failed":"Failed","ui.toolErrorCard.copyError":"Copy error","ui.common.file.one":"file","ui.common.file.other":"files","ui.common.question.one":"question","ui.common.question.other":"questions","ui.common.add":"Add","ui.common.clear":"Clear","ui.common.file":"File","ui.common.back":"Back","ui.common.cancel":"Cancel","ui.common.confirm":"Confirm","ui.common.dismiss":"Dismiss","ui.common.close":"Close","ui.common.next":"Next","ui.common.submit":"Submit","ui.common.showMore":"Show more","ui.permission.deny":"Deny","ui.permission.allowAlways":"Allow always","ui.permission.allowOnce":"Allow once","ui.message.expand":"Expand message","ui.message.collapse":"Collapse message","ui.message.copy":"Copy","ui.message.copyMessage":"Copy message","ui.message.deleteQueued":"Delete queued message","ui.message.forkMessage":"Fork to new session","ui.message.revertMessage":"Revert to here","ui.message.copyResponse":"Copy response","ui.message.copied":"Copied","ui.message.duration.seconds":"{{count}}s","ui.message.duration.minutesSeconds":"{{minutes}}m {{seconds}}s","ui.message.interrupted":"Interrupted","ui.message.queued":"Queued","ui.message.attachment.alt":"attachment","ui.patch.action.deleted":"Deleted","ui.patch.action.created":"Created","ui.patch.action.moved":"Moved","ui.patch.action.patched":"Patched","ui.patch.action.plan":"Plan","ui.question.subtitle.answered":"{{count}} answered","ui.question.subtitle.dismissed":"{{count}} dismissed","ui.question.answer.none":"(no answer)","ui.question.answer.dismissed":"Dismissed","ui.question.review.notAnswered":"(not answered)","ui.question.multiHint":"Select all answers that apply","ui.question.singleHint":"Select one answer","ui.question.custom.placeholder":"Type your answer..."},Dt=new Map;function Cc(e,t){const n=Dt.get(e);if(n)return n.select(t);const i=new Intl.PluralRules(e);return Dt.size>=32&&Dt.delete(Dt.keys().next().value),Dt.set(e,i),i.select(t)}function kc(e,t){return`${e}.${t}`}function Ec(e,t){return t?e.replace(/{{\s*([^}]+?)\s*}}/g,(n,i)=>{const r=String(i),o=t[r];return o===void 0?"":String(o)}):e}const vr={locale:()=>"en",t:(e,t)=>{const n=Sc[e]??String(e);return Ec(n,t)},plural:(e,t,n)=>vr.t(kc(e,Cc(vr.locale(),t)),{...n,count:t})},xc=lc(vr);function va(){return ac(xc)}const jn="diffs-container";(()=>{try{return!1}catch{return!1}})();const Lc=/(?=^diff --git)/gm,Tc=/(?<=\n)/,Rc=/^(---|\+\+\+)\s+([^\t\r\n]+)/,Ac=/^(---|\+\+\+)\s+[ab]\/([^\t\r\n]+)/,Ic=/^diff --git (?:"a\/(.+?)"|a\/(.+?)) (?:"b\/(.+?)"|b\/(.+?))$/,Pc=/^index ([0-9a-f]+)\.\.([0-9a-f]+)(?: (\d+))?$/i,Zr="header-prefix",eo="header-metadata",to="header-custom",X={dark:"pierre-dark",light:"pierre-light"},Xt="data-theme-css",Qt="data-unsafe-css",Dc="data-diffs-scrollbar-measure",ya="--diffs-scrollbar-gutter-measured",fe=1,Yt=1e5,bi={hunkLineCount:50,lineHeight:20,diffHeaderHeight:44,spacing:8};({...bi});const Mc=Object.freeze({fromStart:0,fromEnd:0}),Kn={startingLine:0,totalLines:1/0,bufferBefore:0,bufferAfter:0},_a={startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:0};let $n=new Set,yr=null;function Ce(e){$n.add(e),yr??=requestAnimationFrame(wa)}function wa(e){const t=new Set($n);$n.clear();for(const n of t)try{n(e)}catch(i){console.error(i)}$n.size>0?yr=requestAnimationFrame(wa):yr=null}function Xn(e,t,n){if(e===t||e==null||t==null)return e===t;const i=new Set(n),r=Object.keys(e),o=new Set(Object.keys(t));for(const s of r)if(o.delete(s),!i.has(s)&&(!(s in t)||e[s]!==t[s]))return!1;for(const s of Array.from(o))if(!i.has(s))return!1;return!0}function Rt(e,t){return e==null||t==null||typeof e=="string"||typeof t=="string"?e===t:e.dark===t.dark&&e.light===t.light}function no(e,t){const n=e?.theme??X,i=t?.theme??X,r=Lo(e),o=Lo(t);return Rt(n,i)&&Xn(e,t,["theme","parseDiffOptions"])&&Xn(r,o)}function Lo(e){if(e!=null&&"parseDiffOptions"in e)return e.parseDiffOptions}function To(e,t){return e?.start===t?.start&&e?.end===t?.end&&e?.side===t?.side&&e?.endSide===t?.endSide}function Ro({scrollTop:e,scrollHeight:t,height:n,fitPerfectly:i=!1,fitPerfectlyOverscroll:r=0,overscrollSize:o}){const s=n+o*2,l=i?n+r*2:s;if(t=Math.max(t,l),s>=t||i){const c=Math.max(e-r,0),u=Math.min(e+l,t);return{top:c,bottom:Math.max(u,c)}}let a=e+n/2-s/2,d=a+s;return a<0&&(a=0),d>t&&(d=t),a=Math.floor(Math.max(a,0)),{top:a,bottom:Math.ceil(Math.max(Math.min(d,t),a))}}function Oe(e){return{type:"text",value:e}}function $({tagName:e,children:t=[],properties:n={}}){return{type:"element",tagName:e,properties:n,children:t}}function Qn({name:e,width:t=16,height:n=16,properties:i}){return $({tagName:"svg",properties:{width:t,height:n,viewBox:"0 0 16 16",...i},children:[$({tagName:"use",properties:{href:`#${e.replace(/^#/,"")}`}})]})}function Oc(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 kt(e){return $({tagName:"div",properties:{"data-gutter":""},children:e})}function Sa(e,t,n,i={}){return $({tagName:"div",properties:{"data-line-type":e,"data-column-number":t,"data-line-index":n,...i},children:t!=null?[$({tagName:"span",properties:{"data-line-number-content":""},children:[Oe(`${t}`)]})]:void 0})}function ve(e,t,n){return $({tagName:"div",properties:{"data-gutter-buffer":t,"data-buffer-size":n,"data-line-type":t==="annotation"?void 0:e,style:t==="annotation"?`grid-row: span ${n};`:`grid-row: span ${n};min-height:calc(${n} * 1lh);`}})}function Nc(){return $({tagName:"button",properties:{"data-utility-button":"",type:"button"},children:[Qn({name:"diffs-icon-plus",properties:{"data-icon":""}})]})}function Hc(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side}const Vc=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"];class hn{constructor(t,n,i){this.normal=n,this.property=t,i&&(this.space=i)}}hn.prototype.normal={};hn.prototype.property={};hn.prototype.space=void 0;function Ca(e,t){const n={},i={};for(const r of e)Object.assign(n,r.property),Object.assign(i,r.normal);return new hn(n,i,t)}function _r(e){return e.toLowerCase()}class de{constructor(t,n){this.attribute=n,this.property=t}}de.prototype.attribute="";de.prototype.booleanish=!1;de.prototype.boolean=!1;de.prototype.commaOrSpaceSeparated=!1;de.prototype.commaSeparated=!1;de.prototype.defined=!1;de.prototype.mustUseProperty=!1;de.prototype.number=!1;de.prototype.overloadedBoolean=!1;de.prototype.property="";de.prototype.spaceSeparated=!1;de.prototype.space=void 0;let zc=0;const N=gt(),Q=gt(),wr=gt(),T=gt(),B=gt(),ut=gt(),he=gt();function gt(){return 2**++zc}const Sr=Object.freeze(Object.defineProperty({__proto__:null,boolean:N,booleanish:Q,commaOrSpaceSeparated:he,commaSeparated:ut,number:T,overloadedBoolean:wr,spaceSeparated:B},Symbol.toStringTag,{value:"Module"})),Oi=Object.keys(Sr);class io extends de{constructor(t,n,i,r){let o=-1;if(super(t,n),Ao(this,"space",r),typeof i=="number")for(;++o<Oi.length;){const s=Oi[o];Ao(this,Oi[o],(i&Sr[s])===Sr[s])}}}io.prototype.defined=!0;function Ao(e,t,n){n&&(e[t]=n)}function At(e){const t={},n={};for(const[i,r]of Object.entries(e.properties)){const o=new io(i,e.transform(e.attributes||{},i),r,e.space);e.mustUseProperty&&e.mustUseProperty.includes(i)&&(o.mustUseProperty=!0),t[i]=o,n[_r(i)]=i,n[_r(o.attribute)]=i}return new hn(t,n,e.space)}const ka=At({properties:{ariaActiveDescendant:null,ariaAtomic:Q,ariaAutoComplete:null,ariaBusy:Q,ariaChecked:Q,ariaColCount:T,ariaColIndex:T,ariaColSpan:T,ariaControls:B,ariaCurrent:null,ariaDescribedBy:B,ariaDetails:null,ariaDisabled:Q,ariaDropEffect:B,ariaErrorMessage:null,ariaExpanded:Q,ariaFlowTo:B,ariaGrabbed:Q,ariaHasPopup:null,ariaHidden:Q,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:B,ariaLevel:T,ariaLive:null,ariaModal:Q,ariaMultiLine:Q,ariaMultiSelectable:Q,ariaOrientation:null,ariaOwns:B,ariaPlaceholder:null,ariaPosInSet:T,ariaPressed:Q,ariaReadOnly:Q,ariaRelevant:null,ariaRequired:Q,ariaRoleDescription:B,ariaRowCount:T,ariaRowIndex:T,ariaRowSpan:T,ariaSelected:Q,ariaSetSize:T,ariaSort:null,ariaValueMax:T,ariaValueMin:T,ariaValueNow:T,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Ea(e,t){return t in e?e[t]:t}function xa(e,t){return Ea(e,t.toLowerCase())}const $c=At({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ut,acceptCharset:B,accessKey:B,action:null,allow:null,allowFullScreen:N,allowPaymentRequest:N,allowUserMedia:N,alpha:N,alt:null,as:null,async:N,autoCapitalize:null,autoComplete:B,autoFocus:N,autoPlay:N,blocking:B,capture:null,charSet:null,checked:N,cite:null,className:B,closedBy:null,colorSpace:null,cols:T,colSpan:T,command:null,commandFor:null,content:null,contentEditable:Q,controls:N,controlsList:B,coords:T|ut,crossOrigin:null,data:null,dateTime:null,decoding:null,default:N,defer:N,dir:null,dirName:null,disabled:N,download:wr,draggable:Q,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:N,formTarget:null,headers:B,height:T,hidden:wr,high:T,href:null,hrefLang:null,htmlFor:B,httpEquiv:B,id:null,imageSizes:null,imageSrcSet:null,inert:N,inputMode:null,integrity:null,is:null,isMap:N,itemId:null,itemProp:B,itemRef:B,itemScope:N,itemType:B,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:N,low:T,manifest:null,max:null,maxLength:T,media:null,method:null,min:null,minLength:T,multiple:N,muted:N,name:null,nonce:null,noModule:N,noValidate:N,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:N,optimum:T,pattern:null,ping:B,placeholder:null,playsInline:N,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:N,referrerPolicy:null,rel:B,required:N,reversed:N,rows:T,rowSpan:T,sandbox:B,scope:null,scoped:N,seamless:N,selected:N,shadowRootClonable:N,shadowRootCustomElementRegistry:N,shadowRootDelegatesFocus:N,shadowRootMode:null,shadowRootSerializable:N,shape:null,size:T,sizes:null,slot:null,span:T,spellCheck:Q,src:null,srcDoc:null,srcLang:null,srcSet:null,start:T,step:null,style:null,tabIndex:T,target:null,title:null,translate:null,type:null,typeMustMatch:N,useMap:null,value:Q,width:T,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:B,axis:null,background:null,bgColor:null,border:T,borderColor:null,bottomMargin:T,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:N,declare:N,event:null,face:null,frame:null,frameBorder:null,hSpace:T,leftMargin:T,link:null,longDesc:null,lowSrc:null,marginHeight:T,marginWidth:T,noResize:N,noHref:N,noShade:N,noWrap:N,object:null,profile:null,prompt:null,rev:null,rightMargin:T,rules:null,scheme:null,scrolling:Q,standby:null,summary:null,text:null,topMargin:T,valueType:null,version:null,vAlign:null,vLink:null,vSpace:T,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:N,disablePictureInPicture:N,disableRemotePlayback:N,exportParts:ut,part:B,prefix:null,property:null,results:T,security:null,unselectable:null},space:"html",transform:xa}),Fc=At({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",maskType:"mask-type",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:he,accentHeight:T,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:T,amplitude:T,arabicForm:null,ascent:T,attributeName:null,attributeType:null,azimuth:T,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:T,by:null,calcMode:null,capHeight:T,className:B,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:T,diffuseConstant:T,direction:null,display:null,dur:null,divisor:T,dominantBaseline:null,download:N,dx:null,dy:null,edgeMode:null,editable:null,elevation:T,enableBackground:null,end:null,event:null,exponent:T,externalResourcesRequired:null,fill:null,fillOpacity:T,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:ut,g2:ut,glyphName:ut,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:T,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:T,horizOriginX:T,horizOriginY:T,id:null,ideographic:T,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:T,k:T,k1:T,k2:T,k3:T,k4:T,kernelMatrix:he,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:T,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:T,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:T,overlineThickness:T,paintOrder:null,panose1:null,path:null,pathLength:T,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:B,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:T,pointsAtY:T,pointsAtZ:T,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:he,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:he,rev:he,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:he,requiredFeatures:he,requiredFonts:he,requiredFormats:he,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:T,specularExponent:T,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:T,strikethroughThickness:T,string:null,stroke:null,strokeDashArray:he,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:T,strokeOpacity:T,strokeWidth:null,style:null,surfaceScale:T,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:he,tabIndex:T,tableValues:null,target:null,targetX:T,targetY:T,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:he,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:T,underlineThickness:T,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:T,values:null,vAlphabetic:T,vMathematical:T,vectorEffect:null,vHanging:T,vIdeographic:T,version:null,vertAdvY:T,vertOriginX:T,vertOriginY:T,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:T,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ea}),La=At({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Ta=At({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:xa}),Ra=At({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Bc=/[A-Z]/g,Io=/-[a-z]/g,Uc=/^data[-\w.:]+$/i;function Gc(e,t){const n=_r(t);let i=t,r=de;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Uc.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Io,qc);i="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Io.test(o)){let s=o.replace(Bc,Wc);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}r=io}return new r(i,t)}function Wc(e){return"-"+e.toLowerCase()}function qc(e){return e.charAt(1).toUpperCase()}const jc=Ca([ka,$c,La,Ta,Ra],"html"),Aa=Ca([ka,Fc,La,Ta,Ra],"svg"),Po={}.hasOwnProperty;function Kc(e,t){const n=t||{};function i(r,...o){let s=i.invalid;const l=i.handlers;if(r&&Po.call(r,e)){const a=String(r[e]);s=Po.call(l,a)?l[a]:i.unknown}if(s)return s.call(this,r,...o)}return i.handlers=n.handlers||{},i.invalid=n.invalid,i.unknown=n.unknown,i}const Xc=/["&'<>`]/g,Qc=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,Yc=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,Jc=/[|\\{}()[\]^$+*?.]/g,Do=new WeakMap;function Zc(e,t){if(e=e.replace(t.subset?eu(t.subset):Xc,i),t.subset||t.escapeOnly)return e;return e.replace(Qc,n).replace(Yc,i);function n(r,o,s){return t.format((r.charCodeAt(0)-55296)*1024+r.charCodeAt(1)-56320+65536,s.charCodeAt(o+2),t)}function i(r,o,s){return t.format(r.charCodeAt(0),s.charCodeAt(o+1),t)}}function eu(e){let t=Do.get(e);return t||(t=tu(e),Do.set(e,t)),t}function tu(e){const t=[];let n=-1;for(;++n<e.length;)t.push(e[n].replace(Jc,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}const nu=/[\dA-Fa-f]/;function iu(e,t,n){const i="&#x"+e.toString(16).toUpperCase();return n&&t&&!nu.test(String.fromCharCode(t))?i:i+";"}const ru=/\d/;function ou(e,t,n){const i="&#"+String(e);return n&&t&&!ru.test(String.fromCharCode(t))?i:i+";"}const su=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],Ni={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},au=["cent","copy","divide","gt","lt","not","para","times"],Ia={}.hasOwnProperty,Cr={};let bn;for(bn in Ni)Ia.call(Ni,bn)&&(Cr[Ni[bn]]=bn);const lu=/[^\dA-Za-z]/;function du(e,t,n,i){const r=String.fromCharCode(e);if(Ia.call(Cr,r)){const o=Cr[r],s="&"+o;return n&&su.includes(o)&&!au.includes(o)&&(!i||t&&t!==61&&lu.test(String.fromCharCode(t)))?s:s+";"}return""}function cu(e,t,n){let i=iu(e,t,n.omitOptionalSemicolons),r;if((n.useNamedReferences||n.useShortestReferences)&&(r=du(e,t,n.omitOptionalSemicolons,n.attribute)),(n.useShortestReferences||!r)&&n.useShortestReferences){const o=ou(e,t,n.omitOptionalSemicolons);o.length<i.length&&(i=o)}return r&&(!n.useShortestReferences||r.length<i.length)?r:i}function Lt(e,t){return Zc(e,Object.assign({format:cu},t))}const uu=/^>|^->|<!--|-->|--!>|<!-$/g,hu=[">"],fu=["<",">"];function pu(e,t,n,i){return i.settings.bogusComments?"<?"+Lt(e.value,Object.assign({},i.settings.characterReferences,{subset:hu}))+">":"<!--"+e.value.replace(uu,r)+"-->";function r(o){return Lt(o,Object.assign({},i.settings.characterReferences,{subset:fu}))}}function mu(e,t,n,i){return"<!"+(i.settings.upperDoctype?"DOCTYPE":"doctype")+(i.settings.tightDoctype?"":" ")+"html>"}function Mo(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,r=n.indexOf(t);for(;r!==-1;)i++,r=n.indexOf(t,r+t.length);return i}function gu(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}function bu(e){return e.join(" ").trim()}const vu=/[ \t\n\f\r]/g;function ro(e){return typeof e=="object"?e.type==="text"?Oo(e.value):!1:Oo(e)}function Oo(e){return e.replace(vu,"")===""}const ee=Da(1),Pa=Da(-1),yu=[];function Da(e){return t;function t(n,i,r){const o=n?n.children:yu;let s=(i||0)+e,l=o[s];if(!r)for(;l&&ro(l);)s+=e,l=o[s];return l}}const _u={}.hasOwnProperty;function Ma(e){return t;function t(n,i,r){return _u.call(e,n.tagName)&&e[n.tagName](n,i,r)}}const oo=Ma({body:Su,caption:Hi,colgroup:Hi,dd:xu,dt:Eu,head:Hi,html:wu,li:ku,optgroup:Lu,option:Tu,p:Cu,rp:No,rt:No,tbody:Au,td:Ho,tfoot:Iu,th:Ho,thead:Ru,tr:Pu});function Hi(e,t,n){const i=ee(n,t,!0);return!i||i.type!=="comment"&&!(i.type==="text"&&ro(i.value.charAt(0)))}function wu(e,t,n){const i=ee(n,t);return!i||i.type!=="comment"}function Su(e,t,n){const i=ee(n,t);return!i||i.type!=="comment"}function Cu(e,t,n){const i=ee(n,t);return i?i.type==="element"&&(i.tagName==="address"||i.tagName==="article"||i.tagName==="aside"||i.tagName==="blockquote"||i.tagName==="details"||i.tagName==="div"||i.tagName==="dl"||i.tagName==="fieldset"||i.tagName==="figcaption"||i.tagName==="figure"||i.tagName==="footer"||i.tagName==="form"||i.tagName==="h1"||i.tagName==="h2"||i.tagName==="h3"||i.tagName==="h4"||i.tagName==="h5"||i.tagName==="h6"||i.tagName==="header"||i.tagName==="hgroup"||i.tagName==="hr"||i.tagName==="main"||i.tagName==="menu"||i.tagName==="nav"||i.tagName==="ol"||i.tagName==="p"||i.tagName==="pre"||i.tagName==="section"||i.tagName==="table"||i.tagName==="ul"):!n||!(n.type==="element"&&(n.tagName==="a"||n.tagName==="audio"||n.tagName==="del"||n.tagName==="ins"||n.tagName==="map"||n.tagName==="noscript"||n.tagName==="video"))}function ku(e,t,n){const i=ee(n,t);return!i||i.type==="element"&&i.tagName==="li"}function Eu(e,t,n){const i=ee(n,t);return!!(i&&i.type==="element"&&(i.tagName==="dt"||i.tagName==="dd"))}function xu(e,t,n){const i=ee(n,t);return!i||i.type==="element"&&(i.tagName==="dt"||i.tagName==="dd")}function No(e,t,n){const i=ee(n,t);return!i||i.type==="element"&&(i.tagName==="rp"||i.tagName==="rt")}function Lu(e,t,n){const i=ee(n,t);return!i||i.type==="element"&&i.tagName==="optgroup"}function Tu(e,t,n){const i=ee(n,t);return!i||i.type==="element"&&(i.tagName==="option"||i.tagName==="optgroup")}function Ru(e,t,n){const i=ee(n,t);return!!(i&&i.type==="element"&&(i.tagName==="tbody"||i.tagName==="tfoot"))}function Au(e,t,n){const i=ee(n,t);return!i||i.type==="element"&&(i.tagName==="tbody"||i.tagName==="tfoot")}function Iu(e,t,n){return!ee(n,t)}function Pu(e,t,n){const i=ee(n,t);return!i||i.type==="element"&&i.tagName==="tr"}function Ho(e,t,n){const i=ee(n,t);return!i||i.type==="element"&&(i.tagName==="td"||i.tagName==="th")}const Du=Ma({body:Nu,colgroup:Hu,head:Ou,html:Mu,tbody:Vu});function Mu(e){const t=ee(e,-1);return!t||t.type!=="comment"}function Ou(e){const t=new Set;for(const i of e.children)if(i.type==="element"&&(i.tagName==="base"||i.tagName==="title")){if(t.has(i.tagName))return!1;t.add(i.tagName)}const n=e.children[0];return!n||n.type==="element"}function Nu(e){const t=ee(e,-1,!0);return!t||t.type!=="comment"&&!(t.type==="text"&&ro(t.value.charAt(0)))&&!(t.type==="element"&&(t.tagName==="meta"||t.tagName==="link"||t.tagName==="script"||t.tagName==="style"||t.tagName==="template"))}function Hu(e,t,n){const i=Pa(n,t),r=ee(e,-1,!0);return n&&i&&i.type==="element"&&i.tagName==="colgroup"&&oo(i,n.children.indexOf(i),n)?!1:!!(r&&r.type==="element"&&r.tagName==="col")}function Vu(e,t,n){const i=Pa(n,t),r=ee(e,-1);return n&&i&&i.type==="element"&&(i.tagName==="thead"||i.tagName==="tbody")&&oo(i,n.children.indexOf(i),n)?!1:!!(r&&r.type==="element"&&r.tagName==="tr")}const vn={name:[[`
3
+ \f\r &/=>`.split(""),`
4
+ \f\r "&'/=>\``.split("")],[`\0
5
+ \f\r "&'/<=>`.split(""),`\0
6
+ \f\r "&'/<=>\``.split("")]],unquoted:[[`
7
+ \f\r &>`.split(""),`\0
8
+ \f\r "&'<=>\``.split("")],[`\0
9
+ \f\r "&'<=>\``.split(""),`\0
10
+ \f\r "&'<=>\``.split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function zu(e,t,n,i){const r=i.schema,o=r.space==="svg"?!1:i.settings.omitOptionalTags;let s=r.space==="svg"?i.settings.closeEmptyElements:i.settings.voids.includes(e.tagName.toLowerCase());const l=[];let a;r.space==="html"&&e.tagName==="svg"&&(i.schema=Aa);const d=$u(i,e.properties),c=i.all(r.space==="html"&&e.tagName==="template"?e.content:e);return i.schema=r,c&&(s=!1),(d||!o||!Du(e,t,n))&&(l.push("<",e.tagName,d?" "+d:""),s&&(r.space==="svg"||i.settings.closeSelfClosing)&&(a=d.charAt(d.length-1),(!i.settings.tightSelfClosing||a==="/"||a&&a!=='"'&&a!=="'")&&l.push(" "),l.push("/")),l.push(">")),l.push(c),!s&&(!o||!oo(e,t,n))&&l.push("</"+e.tagName+">"),l.join("")}function $u(e,t){const n=[];let i=-1,r;if(t){for(r in t)if(t[r]!==null&&t[r]!==void 0){const o=Fu(e,r,t[r]);o&&n.push(o)}}for(;++i<n.length;){const o=e.settings.tightAttributes?n[i].charAt(n[i].length-1):void 0;i!==n.length-1&&o!=='"'&&o!=="'"&&(n[i]+=" ")}return n.join("")}function Fu(e,t,n){const i=Gc(e.schema,t),r=e.settings.allowParseErrors&&e.schema.space==="html"?0:1,o=e.settings.allowDangerousCharacters?0:1;let s=e.quote,l;if(i.overloadedBoolean&&(n===i.attribute||n==="")?n=!0:(i.boolean||i.overloadedBoolean)&&(typeof n!="string"||n===i.attribute||n==="")&&(n=!!n),n==null||n===!1||typeof n=="number"&&Number.isNaN(n))return"";const a=Lt(i.attribute,Object.assign({},e.settings.characterReferences,{subset:vn.name[r][o]}));return n===!0||(n=Array.isArray(n)?(i.commaSeparated?gu:bu)(n,{padLeft:!e.settings.tightCommaSeparatedLists}):String(n),e.settings.collapseEmptyAttributes&&!n)?a:(e.settings.preferUnquoted&&(l=Lt(n,Object.assign({},e.settings.characterReferences,{attribute:!0,subset:vn.unquoted[r][o]}))),l!==n&&(e.settings.quoteSmart&&Mo(n,s)>Mo(n,e.alternative)&&(s=e.alternative),l=s+Lt(n,Object.assign({},e.settings.characterReferences,{subset:(s==="'"?vn.single:vn.double)[r][o],attribute:!0}))+s),a+(l&&"="+l))}const Bu=["<","&"];function Oa(e,t,n,i){return n&&n.type==="element"&&(n.tagName==="script"||n.tagName==="style")?e.value:Lt(e.value,Object.assign({},i.settings.characterReferences,{subset:Bu}))}function Uu(e,t,n,i){return i.settings.allowDangerousHtml?e.value:Oa(e,t,n,i)}function Gu(e,t,n,i){return i.all(e)}const Wu=Kc("type",{invalid:qu,unknown:ju,handlers:{comment:pu,doctype:mu,element:zu,raw:Uu,root:Gu,text:Oa}});function qu(e){throw new Error("Expected node, not `"+e+"`")}function ju(e){const t=e;throw new Error("Cannot compile unknown node `"+t.type+"`")}const Ku={},Xu={},Qu=[];function Ne(e,t){const n=t||Ku,i=n.quote||'"',r=i==='"'?"'":'"';if(i!=='"'&&i!=="'")throw new Error("Invalid quote `"+i+"`, expected `'` or `\"`");return{one:Yu,all:Ju,settings:{omitOptionalTags:n.omitOptionalTags||!1,allowParseErrors:n.allowParseErrors||!1,allowDangerousCharacters:n.allowDangerousCharacters||!1,quoteSmart:n.quoteSmart||!1,preferUnquoted:n.preferUnquoted||!1,tightAttributes:n.tightAttributes||!1,upperDoctype:n.upperDoctype||!1,tightDoctype:n.tightDoctype||!1,bogusComments:n.bogusComments||!1,tightCommaSeparatedLists:n.tightCommaSeparatedLists||!1,tightSelfClosing:n.tightSelfClosing||!1,collapseEmptyAttributes:n.collapseEmptyAttributes||!1,allowDangerousHtml:n.allowDangerousHtml||!1,voids:n.voids||Vc,characterReferences:n.characterReferences||Xu,closeSelfClosing:n.closeSelfClosing||!1,closeEmptyElements:n.closeEmptyElements||!1},schema:n.space==="svg"?Aa:jc,quote:i,alternative:r}.one(Array.isArray(e)?{type:"root",children:e}:e,void 0,void 0)}function Yu(e,t,n){return Wu(e,t,n,this)}function Ju(e){const t=[],n=e&&e.children||Qu;let i=-1;for(;++i<n.length;)t[i]=this.one(n[i],i,e);return t.join("")}var Na=class{hoveredLine;hoveredToken;pre;gutterUtilityLine;gutterUtilityContainer;gutterUtilityButton;gutterUtilitySlot;interactiveLinesAttr=!1;interactiveLineNumbersAttr=!1;hasPointerListeners=!1;hasDocumentPointerListeners=!1;selectedRange=null;proposedSelectedRange;renderedSelectionRange;selectionAnchor;queuedSelectionRender;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(),this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.interactiveLinesAttr=!1,this.interactiveLineNumbersAttr=!1,this.hasPointerListeners=!1}setup(e){this.setSelectionDirty();const{usesCustomGutterUtility:t=!1,enableGutterUtility:n=!1}=this.options;this.pre!==e&&(this.cleanUp(),this.pre=e),n?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.renderedSelectionRange=void 0}isSelectionDirty(){return this.renderedSelectionRange===null}setSelection(e,t){const n=!(e===this.selectedRange||To(e??void 0,this.selectedRange??void 0));!this.isSelectionDirty()&&!n||(this.proposedSelectedRange=void 0,this.selectedRange=e,this.renderSelection(),this.placeUtility(),n&&t?.notify!==!1&&this.notifySelectionCommitted())}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:n,onLineNumberClick:i,onTokenClick:r,onMergeConflictActionClick:o}=this.options;t==null&&n==null&&i==null&&o==null&&r==null||this.options.onGutterUtilityClick!=null&&_n(e.composedPath())||(Fe(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:n,onLineLeave:i,onTokenEnter:r,onTokenLeave:o,enableGutterUtility:s=!1}=this.options;t==="disabled"&&!s&&n==null&&i==null&&r==null&&o==null||(Fe(this.options.__debugPointerEvents,"move","FileDiff.DEBUG.handlePointerMove:",e),this.handlePointerEvent({eventType:"move",event:e}))};handlePointerLeave=e=>{const{__debugPointerEvents:t}=this.options;if(Fe(t,"move","FileDiff.DEBUG.handlePointerLeave: no event"),this.hoveredLine==null&&this.hoveredToken==null){Fe(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:n}=this.options,i=t.composedPath();Fe(n,e,"FileDiff.DEBUG.handlePointerEvent:",{eventType:e,composedPath:i});const r=this.resolvePointerTarget(i);Fe(n,e,"FileDiff.DEBUG.handlePointerEvent: resolvePointerTarget result:",r);const{onLineClick:o,onLineNumberClick:s,onLineEnter:l,onLineLeave:a,onTokenClick:d,onTokenEnter:c,onTokenLeave:u,onHunkExpand:h,onMergeConflictActionClick:f}=this.options;switch(e){case"move":{const g=Vi(r)&&this.hoveredLine?.lineElement===r.lineElement;Fn(r)&&this.hoveredToken?.tokenElement===r.tokenElement||(this.hoveredToken!=null&&(u?.(this.hoveredToken,t),this.clearHoveredToken()),Fn(r)&&(this.setHoveredToken(this.toTokenEventBaseProps(r)),c?.(this.hoveredToken,t))),g||(this.hoveredLine!=null&&(a?.({...this.hoveredLine,event:t}),this.clearHoveredLine()),Vi(r)?(this.setHoveredLine(this.toEventBaseProps(r)),this.placeUtility(),l?.({...this.hoveredLine,event:t})):this.placeUtility());break}case"click":{if(r==null)break;if(th(r)&&f!=null){f(r);break}if(eh(r)&&h!=null){h(r.hunkIndex,r.all||t.shiftKey?"both":r.direction,r.all||t.shiftKey?Number.POSITIVE_INFINITY:void 0);break}if(!Vi(r))break;Fn(r)&&d!=null&&d(this.toTokenEventBaseProps(r),t);const g=this.toEventBaseProps(r);s!=null&&r.numberColumn?s({...g,event:t}):o?.({...g,event:t});break}}}syncPointerListeners(e){const{__debugPointerEvents:t,lineHoverHighlight:n="disabled",onLineClick:i,onLineNumberClick:r,onLineEnter:o,onLineLeave:s,onTokenClick:l,onTokenEnter:a,onTokenLeave:d,onHunkExpand:c,onMergeConflictActionClick:u,enableGutterUtility:h=!1,enableLineSelection:f=!1,onGutterUtilityClick:g}=this.options,y=g!=null,_=n!=="disabled"||i!=null||r!=null||o!=null||s!=null||l!=null||a!=null||d!=null||c!=null||u!=null||h||f||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,Fe(t,"click","FileDiff.DEBUG.attachEventListeners: Attaching click events for:",(()=>{const v=[];return(t==="both"||t==="click")&&(i!=null&&v.push("onLineClick"),r!=null&&v.push("onLineNumberClick"),c!=null&&v.push("expandable hunk separators"),u!=null&&v.push("merge conflict actions")),v})()),Fe(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer move event"),Fe(t,"move","FileDiff.DEBUG.attachEventListeners: Attaching pointer leave event")):!_&&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 b=this.pointerSession.mode==="selecting"||this.pointerSession.mode==="pendingSingleLineUnselect",p=this.pointerSession.mode==="gutterSelecting";(!f&&b||!y&&p)&&(this.clearPointerSession(),this.detachDocumentPointerListeners(),this.selectionAnchor=void 0,this.clearPendingSingleLineState())}updateInteractiveLineAttributes(){if(this.pre==null)return;const{onLineClick:e,onLineNumberClick:t,enableLineSelection:n=!1}=this.options,i=e!=null,r=t!=null||n;i&&!this.interactiveLinesAttr?(this.pre.setAttribute("data-interactive-lines",""),this.interactiveLinesAttr=!0):!i&&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();_n(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 n=this.resolveSelectionInfo(e,{source:"event-path",requireNumberColumn:!0});if(n==null)return;const{pre:i}=this;if(i==null)return;e.preventDefault();const{lineNumber:r,eventSide:o,lineIndex:s}=n;if(e.shiftKey&&this.selectedRange!=null){const l=this.getIndexesFromSelection(this.selectedRange,i.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{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;if(n==null)return;const i=this.currentSelectionEnds(),r=i?.bottom??this.resolveSelectionPoint(e,{source:"event-path",excludeUtility:!1}),o=i?.top??r;r==null||o==null||(e.preventDefault(),e.stopPropagation(),this.pointerSession={mode:"gutterSelecting",pointerId:e.pointerId,anchor:o,current:r},t&&(this.selectionAnchor={lineNumber:o.lineNumber,side:o.side},this.updateSelection(r.lineNumber,r.side,!1),this.notifySelectionStart(this.getCurrentSelectionRange())),this.attachDocumentPointerListeners())}handleDocumentPointerMove=e=>{const{enableLineSelection:t=!1}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionPoint(e,{source:"coordinates-first"});if(n==null)return;this.pointerSession.current=n,t===!0&&this.updateSelection(n.lineNumber,n.side);return}case"selecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(n==null||this.selectionAnchor==null)return;this.updateSelection(n.lineNumber,n.eventSide);return}case"pendingSingleLineUnselect":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const n=this.resolveSelectionInfo(e,{source:"coordinates-first",requireNumberColumn:!1});if(n==null||this.selectionAnchor==null)return;const i={lineNumber:n.lineNumber,side:n.eventSide};if(Hc(this.pointerSession.pending,i))return;this.updateSelection(n.lineNumber,n.eventSide,!1),this.notifySelectionStart(this.getCurrentSelectionRange()),this.notifySelectionChangeDelta(),this.pointerSession={mode:"selecting",pointerId:e.pointerId};return}}};handleDocumentPointerUp=e=>{const{enableLineSelection:t=!1,onGutterUtilityClick:n}=this.options;switch(this.pointerSession.mode){case"idle":return;case"gutterSelecting":{if(e.pointerId!==this.pointerSession.pointerId)return;e.preventDefault();const i=this.resolveSelectionPoint(e,{source:"coordinates-first"});i!=null&&(this.pointerSession.current=i,t&&this.updateSelection(i.lineNumber,i.side)),n?.(this.buildSelectedLineRange(this.pointerSession.anchor,this.pointerSession.current)),this.selectionAnchor=void 0,t&&(this.notifySelectionEnd(this.getCurrentSelectionRange()),this.notifySelectionCommitted(),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.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.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=Ne(Nc());const n=t.firstElementChild;if(!(n instanceof HTMLButtonElement))throw new Error("InteractionManager.ensureGutterUtilityNode: Node element should be a button");n.remove(),this.gutterUtilityButton=n}this.gutterUtilityButton.parentNode!==this.gutterUtilityContainer&&this.gutterUtilityContainer.replaceChildren(this.gutterUtilityButton)}}revealUtilityFromGutterPath(e){if(this.placeUtilityFromSelection())return;const t=this.resolvePointerTarget(e);Vt(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},n={lineNumber:e.end,side:e.endSide??e.side},i=this.selectionPointRowIndex(t),r=this.selectionPointRowIndex(n);if(!(i==null||r==null))return i>r?{top:n,bottom:t}:{top:t,bottom:n}}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 n=this.mode==="diff"?`${t[0]},${t[1]}`:`${t[0]}`,i=this.pre.querySelectorAll(`[data-column-number="${e.lineNumber}"][data-line-index="${n}"]`);for(const r of i){if(!(r instanceof HTMLElement))continue;const o=this.resolvePointerTarget(yn(r));if(Vt(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 n=this.resolvePointerTarget(e);if(Vt(n)&&!(t&&!n.numberColumn)&&n.splitLineIndex!=null)return{lineIndex:n.splitLineIndex,lineNumber:n.lineNumber,eventSide:this.mode==="diff"?n.side:void 0}}resolveSelectionInfo(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionInfoFromPath(n,t.requireNumberColumn):void 0}selectionPointFromPath(e){const t=this.resolvePointerTarget(e);if(Vt(t))return{lineNumber:t.lineNumber,side:this.mode==="diff"?t.side:void 0}}resolveSelectionPoint(e,t){const n=this.resolveSelectionPath(e,t);return n!=null?this.selectionPointFromPath(n):void 0}resolveSelectionPath(e,t){const n=t.excludeUtility!==!1;switch(t.source){case"event-path":return this.pathFromEventPath(e.composedPath(),n);case"coordinates-first":{const i=this.pathFromCoordinates(e,n);return i!==void 0?i??void 0:this.pathFromEventPath(e.composedPath(),n)}}}pathFromCoordinates(e,t){const n=this.hitTest(e);if(n!==void 0)return n===null?null:this.pathFromElement(n,t)??null}pathFromEventPath(e,t){if(!(t&&_n(e))){for(const n of e)if(n instanceof Element)return this.pathFromElement(n,t)}}pathFromElement(e,t){const n=yn(e);if(t&&_n(n))return;const i=ih(e);return i!=null?yn(i):this.pathFromAnnotationSlot(e)}pathFromAnnotationSlot(e){const t=oh(rh(e));if(t==null)return;const n=this.targetForSelectionPoint(t);return n!=null?yn(n.lineElement):void 0}hitTest(e){if(!Number.isFinite(e.clientX)||!Number.isFinite(e.clientY))return;const t=this.pre?.getRootNode(),n=zo(t)?t:zo(document)?document:void 0;if(n!=null)return n.elementFromPoint(e.clientX,e.clientY)}getLineIndex(e,t){const{getLineIndex:n}=this.options;return n!=null?n(e,t):[e-1,e-1]}getCurrentSelectionRange(){return this.proposedSelectedRange!==void 0?this.proposedSelectedRange:this.selectedRange}clearProposedSelection(){this.proposedSelectedRange=void 0}updateSelection(e,t,n=!0){const i=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)}To(i??void 0,r??void 0)||(this.options.controlledSelection===!0?this.proposedSelectedRange=r:(this.selectedRange=r,this.queuedSelectionRender??=requestAnimationFrame(this.renderSelection)),this.placeUtility(),n&&this.notifySelectionChangeDelta())}getIndexesFromSelection(e,t){if(this.pre==null)return;const n=this.getLineIndex(e.start,e.side),i=this.getLineIndex(e.end,e.endSide??e.side);return n!=null&&i!=null?{start:t?n[1]:n[0],end:t?i[1]:i[0]}:void 0}renderSelection=()=>{if(this.queuedSelectionRender!=null&&(cancelAnimationFrame(this.queuedSelectionRender),this.queuedSelectionRender=void 0),this.pre==null||this.renderedSelectionRange===this.selectedRange)return;const e=this.pre.querySelectorAll("[data-selected-line]");for(const l of e)l.removeAttribute("data-selected-line");if(this.renderedSelectionRange=this.selectedRange,this.selectedRange==null)return;const{children:t}=this.pre;if(t.length===0)return;if(t.length>2)throw console.error(t),new Error("InteractionManager.renderSelection: Somehow there are more than 2 code elements...");const n=this.pre.getAttribute("data-diff-type")==="split",i=this.getIndexesFromSelection(this.selectedRange,n);if(i==null)throw console.error({rowRange:i,selectedRange:this.selectedRange}),new Error("InteractionManager.renderSelection: No valid rowRange");const r=i.start===i.end,o=Math.min(i.start,i.end),s=Math.max(i.start,i.end);for(const l of t){const[a,d]=l.children,c=d.children.length;if(c!==a.children.length)throw new Error("InteractionManager.renderSelection: gutter and content children dont match, something is wrong");for(let u=0;u<c;u++){const h=d.children[u],f=a.children[u];if(!(h instanceof HTMLElement)||!(f instanceof HTMLElement))continue;const g=this.parseLineIndex(h,n);if((g??0)>s)break;if(g==null||g<o)continue;let y=r?"single":g===o?"first":g===s?"last":"";h.setAttribute("data-selected-line",y),f.setAttribute("data-selected-line",y),f.nextSibling instanceof HTMLElement&&h.nextSibling instanceof HTMLElement&&(h.nextSibling.hasAttribute("data-line-annotation")||h.nextSibling.hasAttribute("data-merge-conflict-actions"))&&(r?(y="last",h.setAttribute("data-selected-line","first")):g===o?y="":g===s&&h.setAttribute("data-selected-line",""),h.nextSibling.setAttribute("data-selected-line",y),f.nextSibling.setAttribute("data-selected-line",y))}}};notifySelectionCommitted(){this.options.onLineSelected?.(this.getCurrentSelectionRange()??null)}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:n,side:i,tokenElement:r,tokenText:o}){return this.mode==="file"?{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,tokenElement:r,tokenText:o}:{type:"token",lineCharEnd:e,lineCharStart:t,lineNumber:n,side:i,tokenElement:r,tokenText:o}}buildSelectedLineRange(e,t){return this.buildSelectionRange(e.lineNumber,t.lineNumber,e.side,t.side)}buildSelectionRange(e,t,n,i){return{start:e,end:t,...n!=null?{side:n}:{},...n!==i&&i!=null?{endSide:i}:{}}}resolvePointerTarget(e){let t=!1,n,i,r,o,s,l,a,d,c,u;for(const f of e){if(!(f instanceof HTMLElement))continue;if(u==null&&f.hasAttribute("data-merge-conflict-action")){const b=f.getAttribute("data-merge-conflict-action")??void 0,p=f.getAttribute("data-merge-conflict-conflict-index")??void 0,v=p!=null?Number.parseInt(p,10):NaN;nh(b)&&Number.isFinite(v)&&(u={kind:"merge-conflict-action",resolution:b,conflictIndex:v})}if(l==null&&f.hasAttribute("data-char")){l=f;const b=f.getAttribute("data-char");if(b!=null){const p=Number.parseInt(b,10);if(!Number.isNaN(p)){const v=f.textContent??"",w=p+v.length;(v.trim()!==""||this.options.enableTokenInteractionsOnWhitespace===!0)&&(a={tokenElement:l,lineCharStart:p,lineCharEnd:w,tokenText:v});continue}}}const g=s==null?f.getAttribute("data-column-number")??void 0:void 0;if(g!=null){s=f,c=Number.parseInt(g,10),t=!0,n=Fo(f),o=f.getAttribute("data-line-index")??void 0;continue}const y=r==null?f.getAttribute("data-line")??void 0:void 0;if(y!=null){r=f,c=Number.parseInt(y,10),n=Fo(f),o=f.getAttribute("data-line-index")??void 0;continue}if(d==null&&(f.hasAttribute("data-expand-button")||f.hasAttribute("data-unmodified-lines"))){d={hunkIndex:void 0,direction:f.hasAttribute("data-expand-up")?"up":f.hasAttribute("data-expand-down")?"down":"both",all:f.hasAttribute("data-expand-all-button")};continue}const _=d!=null?f.getAttribute("data-expand-index")??void 0:void 0;if(d!=null&&_!=null){const b=Number.parseInt(_,10);Number.isNaN(b)||(d.hunkIndex=b);continue}if(i==null&&f.hasAttribute("data-code")){i=f;break}}if(u!=null)return u;if(d?.hunkIndex!=null)return{type:"line-info",hunkIndex:d.hunkIndex,direction:d.direction,all:d.all};if(r??=o!=null?Vo(i,`[data-line][data-line-index="${o}"]`):void 0,s??=o!=null?Vo(i,`[data-column-number][data-line-index="${o}"]`):void 0,i==null||r==null||s==null||n==null||c==null||Number.isNaN(c))return;const h=this.parseLineIndex(r,this.isSplitDiff());return a!=null?this.mode==="file"?{kind:"token",lineType:n,lineElement:r,lineNumber:c,numberColumn:t,numberElement:s,side:void 0,splitLineIndex:h,...a}:{kind:"token",lineType:n,lineElement:r,lineNumber:c,numberColumn:t,numberElement:s,side:$o(n,i),splitLineIndex:h,...a}:this.mode==="file"?{kind:"line",lineType:n,lineElement:r,lineNumber:c,numberColumn:t,numberElement:s,side:void 0,splitLineIndex:h}:{kind:"line",lineType:n,lineElement:r,lineNumber:c,numberColumn:t,numberElement:s,side:$o(n,i),splitLineIndex:h}}isSplitDiff(){return this.pre?.getAttribute("data-diff-type")==="split"}parseLineIndex(e,t){const n=(e.getAttribute("data-line-index")??"").split(",").map(i=>Number.parseInt(i,10)).filter(i=>!Number.isNaN(i));if(t&&n.length===2)return n[1];if(!t)return n[0]}};function Yn({enableTokenInteractionsOnWhitespace:e,enableGutterUtility:t,lineHoverHighlight:n,onGutterUtilityClick:i,onLineClick:r,onLineEnter:o,onLineLeave:s,onLineNumberClick:l,onTokenClick:a,onTokenEnter:d,onTokenLeave:c,renderGutterUtility:u,__debugPointerEvents:h,enableLineSelection:f,controlledSelection:g,onLineSelected:y,onLineSelectionStart:_,onLineSelectionChange:b,onLineSelectionEnd:p},v,w,S){return{enableTokenInteractionsOnWhitespace:e,enableGutterUtility:Zu({enableGutterUtility:t,renderGutterUtility:u,onGutterUtilityClick:i}),usesCustomGutterUtility:u!=null,lineHoverHighlight:n,onGutterUtilityClick:i,onHunkExpand:v,onMergeConflictActionClick:S,onLineClick:r,onLineEnter:o,onLineLeave:s,onLineNumberClick:l,onTokenClick:a,onTokenEnter:d,onTokenLeave:c,__debugPointerEvents:h,enableLineSelection:f,controlledSelection:g,onLineSelected:y,onLineSelectionStart:_,onLineSelectionChange:b,onLineSelectionEnd:p,getLineIndex:w}}function Zu({enableGutterUtility:e,renderGutterUtility:t,onGutterUtilityClick:n}){if(n!=null&&t!=null)throw new Error("Cannot use both 'onGutterUtilityClick' and 'renderGutterUtility'. Use only one gutter utility API.");return e??!1}function Vt(e){return e!=null&&"kind"in e&&e.kind==="line"}function Fn(e){return e!=null&&"kind"in e&&e.kind==="token"}function Vi(e){return Vt(e)||Fn(e)}function eh(e){return"type"in e&&e.type==="line-info"}function th(e){return"kind"in e&&e.kind==="merge-conflict-action"}function nh(e){return e==="current"||e==="incoming"||e==="both"}function Vo(e,t){const n=e?.querySelector(t);return n instanceof HTMLElement?n:void 0}function yn(e){const t=[];let n=e;for(;n!=null;)t.push(n),n=n.parentNode;return t}function ih(e){const t=e.closest("[data-line], [data-column-number]");if(t instanceof HTMLElement)return t;const n=e.closest('[data-line-annotation], [data-gutter-buffer="annotation"]');if(!(n instanceof HTMLElement))return;const i=n.previousElementSibling;return i instanceof HTMLElement&&(i.hasAttribute("data-line")||i.hasAttribute("data-column-number"))?i:void 0}function rh(e){const t=e.closest('[slot^="annotation-"]');if(t instanceof HTMLElement)return t.getAttribute("slot")??void 0;if(e instanceof HTMLElement){const n=e.getAttribute("name")??void 0;return n!=null&&n.startsWith("annotation-")?n:void 0}}function oh(e){if(e==null)return;const t=/^annotation-(?:(additions|deletions)-)?(\d+)$/.exec(e);if(t==null)return;const n=Number.parseInt(t[2],10);if(Number.isFinite(n))return{lineNumber:n,side:t[1]}}function zo(e){return e!=null&&typeof e.elementFromPoint=="function"}function $o(e,t){switch(e){case"change-deletion":return"deletions";case"change-addition":return"additions";default:return t.hasAttribute("data-deletions")?"deletions":"additions"}}function Fo(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 _n(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}function Fe(e="none",t,...n){switch(e){case"none":return;case"both":break;case"click":if(t!=="click")return;break;case"move":if(t!=="move")return;break}console.log(...n)}var Ha=class Ge{static resizeObserver;static managersByElement=new Map;static getResizeObserver(){const t=Ge.resizeObserver??new ResizeObserver(Ge.handleSharedResizeEntries);return Ge.resizeObserver=t,t}static handleSharedResizeEntries(t){const n=new Map;for(const i of t){const r=Ge.managersByElement.get(i.target);if(r==null)continue;const o=n.get(r);o==null?n.set(r,[i]):o.push(i)}for(const[i,r]of n)i.handleResizeEntries(r)}observedNodes=new Map;setup(t,n){const i=new Set;let r=0;const o=new Map(this.observedNodes);this.observedNodes.clear();for(const s of t.children){if(r===2)break;const l=(()=>{if(s instanceof HTMLElement&&s.tagName==="CODE")return s})();if(l==null)continue;r++;let a=o.get(l);if(a!=null&&a.type!=="code")throw new Error("ResizeManager.setup: somehow a code node is being used for an annotation, should be impossible");let d=l.firstElementChild;d instanceof HTMLElement||(d=null),a!=null?(this.observedNodes.set(l,a),o.delete(l),a.numberElement!==d?(a.numberElement!=null&&(this.unobserve(a.numberElement),o.delete(a.numberElement)),d!=null&&(this.observe(d),o.delete(d),this.observedNodes.set(d,a)),a.numberElement=d,a.numberWidth=0):a.numberElement!=null?(o.delete(a.numberElement),this.observedNodes.set(a.numberElement,a)):a.numberWidth=0):(a={type:"code",codeElement:l,numberElement:d,codeWidth:"auto",numberWidth:0},this.observedNodes.set(l,a),this.observe(l),d!=null&&(this.observedNodes.set(d,a),this.observe(d)))}if(r>1&&!n){const s=t.querySelectorAll('[data-line-annotation*=","]'),l=new Map;for(const a of s){if(!(a instanceof HTMLElement))continue;const d=a.getAttribute("data-line-annotation")??"";if(!/^\d+,\d+$/.test(d)){console.error("DiffFileRenderer.setupResizeObserver: Invalid element or annotation",{lineAnnotation:d,element:a});continue}let c=l.get(d);c==null&&(c=[],l.set(d,c)),c.push(a)}for(const[a,d]of l){if(d.length!==2){console.error("DiffFileRenderer.setupResizeObserver: Bad Pair",a,d);continue}const[c,u]=d,h=c.firstElementChild,f=u.firstElementChild;if(!(c instanceof HTMLElement)||!(u instanceof HTMLElement)||!(h instanceof HTMLElement)||!(f instanceof HTMLElement))continue;let g=o.get(h);if(g!=null){this.observedNodes.set(h,g),this.observedNodes.set(f,g),o.delete(h),o.delete(f);continue}const y=h.getBoundingClientRect().height,_=f.getBoundingClientRect().height;g={type:"annotations",column1:{container:c,child:h,childHeight:y},column2:{container:u,child:f,childHeight:_},currentHeight:"auto"},i.add({child1:h,child2:f,item:g,newHeight:Math.max(y,_)})}for(const a of i)this.applyNewHeight(a.item,a.newHeight),this.observedNodes.set(a.child1,a.item),this.observedNodes.set(a.child2,a.item),this.observe(a.child1),this.observe(a.child2);i.clear()}for(const[s,l]of o)this.unobserve(s),l.type==="code"?lh(l):dh(l);o.clear()}cleanUp(){for(const t of this.observedNodes.keys())this.unobserve(t);this.observedNodes.clear()}observe(t){const{managersByElement:n}=Ge,i=n.get(t);if(i!==this){if(i!=null&&i!==this)throw new Error("ResizeManager.observe: element is already owned by another ResizeManager");n.set(t,this),Ge.getResizeObserver().observe(t)}}unobserve(t){const{managersByElement:n,resizeObserver:i}=Ge,r=n.get(t);if(r!=null){if(r!==this)throw new Error("ResizeManager.unobserve: element is owned by another ResizeManager");n.delete(t),i?.unobserve(t),i!=null&&n.size===0&&(i.disconnect(),Ge.resizeObserver=void 0)}}handleResizeEntries(t){const n=new Map,i=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,i.add(a)}else if(a.type==="code"){const d=n.get(a)??{},c=l[0].inlineSize;o===a.codeElement?d.codeInlineSize=c:o===a.numberElement&&(d.numberInlineSize=c),n.set(a,d)}}this.applyAnnotationUpdates(i),i.clear(),this.applyColumnUpdates(n),n.clear()}applyAnnotationUpdates(t){for(const n of t)this.applyNewHeight(n,Math.max(n.column1.childHeight,n.column2.childHeight))}applyColumnUpdates=t=>{for(const[n,i]of t){const r=i.codeInlineSize!=null?sh(i.codeInlineSize):n.codeWidth,o=i.numberInlineSize!=null?ah(i.numberInlineSize):n.numberWidth,s=r!==n.codeWidth,l=o!==n.numberWidth;if(!(!s&&!l)&&(n.codeWidth=r,n.numberWidth=o,s&&n.codeElement.style.setProperty("--diffs-column-width",`${typeof r=="number"?`${r}px`:"auto"}`),l&&n.codeElement.style.setProperty("--diffs-column-number-width",`${o===0?"auto":`${o}px`}`),s||l&&r!=="auto")){const a=typeof r=="number"?Math.max(r-o,0):0;n.codeElement.style.setProperty("--diffs-column-content-width",`${a>0?`${a}px`:"auto"}`)}}};applyNewHeight(t,n){n!==t.currentHeight&&(t.currentHeight=Math.max(n,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 sh(e){const t=Math.max(Math.floor(e),0);return t===0?"auto":t}function ah(e){return Math.max(Math.ceil(e),0)}function lh(e){e.codeElement.isConnected&&(e.codeElement.style.removeProperty("--diffs-column-content-width"),e.codeElement.style.removeProperty("--diffs-column-number-width"),e.codeElement.style.removeProperty("--diffs-column-width"))}function dh(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")}const ht=new Map,zi=new Map,ch=new Map,kr=new Set;function Jn(e){for(const t of Array.isArray(e)?e:[e])if(!(t==="text"||t==="ansi")&&!kr.has(t))return!1;return!0}function Bo(e,t){e=Array.isArray(e)?e:[e];for(const n of e){if(kr.has(n.name))continue;let i=ht.get(n.name);i==null&&(i=n,ht.set(n.name,i)),kr.add(i.name),t.loadLanguageSync(i.data)}}function Va(){return typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope}var Er=Object.defineProperty,uh=Object.getOwnPropertyDescriptor,hh=Object.getOwnPropertyNames,fh=Object.prototype.hasOwnProperty,so=(e,t)=>{let n={};for(var i in e)Er(n,i,{get:e[i],enumerable:!0});return Er(n,Symbol.toStringTag,{value:"Module"}),n},ph=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(var r=hh(t),o=0,s=r.length,l;o<s;o++)l=r[o],!fh.call(e,l)&&l!==n&&Er(e,l,{get:(a=>t[a]).bind(null,l),enumerable:!(i=uh(t,l))||i.enumerable});return e},za=(e,t,n)=>(ph(e,t,"default"),n);const vi=[{id:"abap",name:"ABAP",import:(()=>m(()=>import("./abap-BdImnpbu.js"),[]))},{id:"actionscript-3",name:"ActionScript",import:(()=>m(()=>import("./actionscript-3-CoDkCxhg.js"),[]))},{id:"ada",name:"Ada",import:(()=>m(()=>import("./ada-bCR0ucgS.js"),[]))},{id:"angular-html",name:"Angular HTML",import:(()=>m(()=>import("./angular-html-DA-rfuFy.js").then(e=>e.f),__vite__mapDeps([0,1,2,3])))},{id:"angular-ts",name:"Angular TypeScript",import:(()=>m(()=>import("./angular-ts-BrjP3tb8.js"),__vite__mapDeps([4,0,1,2,3,5])))},{id:"apache",name:"Apache Conf",import:(()=>m(()=>import("./apache-Pmp26Uib.js"),[]))},{id:"apex",name:"Apex",import:(()=>m(()=>import("./apex-Dqspr-GT.js"),[]))},{id:"apl",name:"APL",import:(()=>m(()=>import("./apl-CORt7UWP.js"),__vite__mapDeps([6,1,2,3,7,8,9])))},{id:"applescript",name:"AppleScript",import:(()=>m(()=>import("./applescript-Co6uUVPk.js"),[]))},{id:"ara",name:"Ara",import:(()=>m(()=>import("./ara-BRHolxvo.js"),[]))},{id:"asciidoc",name:"AsciiDoc",aliases:["adoc"],import:(()=>m(()=>import("./asciidoc-Ve4PFQV2.js"),[]))},{id:"asm",name:"Assembly",import:(()=>m(()=>import("./asm-D_Q5rh1f.js"),[]))},{id:"astro",name:"Astro",import:(()=>m(()=>import("./astro-HNnZUWAn.js"),__vite__mapDeps([10,9,2,11,3,12,13])))},{id:"awk",name:"AWK",import:(()=>m(()=>import("./awk-DMzUqQB5.js"),[]))},{id:"ballerina",name:"Ballerina",import:(()=>m(()=>import("./ballerina-BFfxhgS-.js"),[]))},{id:"bat",name:"Batch File",aliases:["batch"],import:(()=>m(()=>import("./bat-BkioyH1T.js"),[]))},{id:"beancount",name:"Beancount",import:(()=>m(()=>import("./beancount-k_qm7-4y.js"),[]))},{id:"berry",name:"Berry",aliases:["be"],import:(()=>m(()=>import("./berry-uYugtg8r.js"),[]))},{id:"bibtex",name:"BibTeX",import:(()=>m(()=>import("./bibtex-CHM0blh-.js"),[]))},{id:"bicep",name:"Bicep",import:(()=>m(()=>import("./bicep-Bmn6On1c.js"),[]))},{id:"bird2",name:"BIRD2 Configuration",aliases:["bird"],import:(()=>m(()=>import("./bird2-BIv1doCn.js"),[]))},{id:"blade",name:"Blade",import:(()=>m(()=>import("./blade-2xfisSek.js"),__vite__mapDeps([14,15,1,2,3,7,8,16,9])))},{id:"bsl",name:"1C (Enterprise)",aliases:["1c"],import:(()=>m(()=>import("./bsl-BO_Y6i37.js"),__vite__mapDeps([17,18])))},{id:"c",name:"C",import:(()=>m(()=>import("./c-BIGW1oBm.js"),[]))},{id:"c3",name:"C3",import:(()=>m(()=>import("./c3-MRO5bC_T.js"),[]))},{id:"cadence",name:"Cadence",aliases:["cdc"],import:(()=>m(()=>import("./cadence-Bv_4Rxtq.js"),[]))},{id:"cairo",name:"Cairo",import:(()=>m(()=>import("./cairo-KRGpt6FW.js"),__vite__mapDeps([19,20])))},{id:"clarity",name:"Clarity",import:(()=>m(()=>import("./clarity-D53aC0YG.js"),[]))},{id:"clojure",name:"Clojure",aliases:["clj"],import:(()=>m(()=>import("./clojure-P80f7IUj.js"),[]))},{id:"cmake",name:"CMake",import:(()=>m(()=>import("./cmake-D1j8_8rp.js"),[]))},{id:"cobol",name:"COBOL",import:(()=>m(()=>import("./cobol-nBiQ_Alo.js"),__vite__mapDeps([21,1,2,3,8])))},{id:"codeowners",name:"CODEOWNERS",import:(()=>m(()=>import("./codeowners-Bp6g37R7.js"),[]))},{id:"codeql",name:"CodeQL",aliases:["ql"],import:(()=>m(()=>import("./codeql-DsOJ9woJ.js"),[]))},{id:"coffee",name:"CoffeeScript",aliases:["coffeescript"],import:(()=>m(()=>import("./coffee-Ch7k5sss.js"),__vite__mapDeps([22,2])))},{id:"common-lisp",name:"Common Lisp",aliases:["lisp"],import:(()=>m(()=>import("./common-lisp-Cg-RD9OK.js"),[]))},{id:"coq",name:"Coq",import:(()=>m(()=>import("./coq-DkFqJrB1.js"),[]))},{id:"cpp",name:"C++",aliases:["c++"],import:(()=>m(()=>import("./cpp-UfJy6YNI.js"),__vite__mapDeps([23,24,25,26,16])))},{id:"crystal",name:"Crystal",import:(()=>m(()=>import("./crystal-DGywbUpC.js"),__vite__mapDeps([27,1,2,3,16,26,28])))},{id:"csharp",name:"C#",aliases:["c#","cs"],import:(()=>m(()=>import("./csharp-DSvCPggb.js"),[]))},{id:"css",name:"CSS",import:(()=>m(()=>import("./css-CLj8gQPS.js"),[]))},{id:"csv",name:"CSV",import:(()=>m(()=>import("./csv-fuZLfV_i.js"),[]))},{id:"cue",name:"CUE",import:(()=>m(()=>import("./cue-D82EKSYY.js"),[]))},{id:"cypher",name:"Cypher",aliases:["cql"],import:(()=>m(()=>import("./cypher-COkxafJQ.js"),[]))},{id:"d",name:"D",import:(()=>m(()=>import("./d-85-TOEBH.js"),[]))},{id:"dart",name:"Dart",import:(()=>m(()=>import("./dart-bE4Kk8sk.js"),[]))},{id:"dax",name:"DAX",import:(()=>m(()=>import("./dax-CEL-wOlO.js"),[]))},{id:"desktop",name:"Desktop",import:(()=>m(()=>import("./desktop-BmXAJ9_W.js"),[]))},{id:"diff",name:"Diff",import:(()=>m(()=>import("./diff-D97Zzqfu.js"),[]))},{id:"docker",name:"Dockerfile",aliases:["dockerfile"],import:(()=>m(()=>import("./docker-BcOcwvcX.js"),[]))},{id:"dotenv",name:"dotEnv",import:(()=>m(()=>import("./dotenv-Da5cRb03.js"),[]))},{id:"dream-maker",name:"Dream Maker",import:(()=>m(()=>import("./dream-maker-BtqSS_iP.js"),[]))},{id:"edge",name:"Edge",import:(()=>m(()=>import("./edge-FbVlp4U3.js"),__vite__mapDeps([29,11,1,2,3,15])))},{id:"elixir",name:"Elixir",import:(()=>m(()=>import("./elixir-CkH2-t6x.js"),__vite__mapDeps([30,1,2,3])))},{id:"elm",name:"Elm",import:(()=>m(()=>import("./elm-DbKCFpqz.js"),__vite__mapDeps([31,25,26])))},{id:"emacs-lisp",name:"Emacs Lisp",aliases:["elisp"],import:(()=>m(()=>import("./emacs-lisp-CXvaQtF9.js"),[]))},{id:"erb",name:"ERB",import:(()=>m(()=>import("./erb-Dm6A9KJ5.js"),__vite__mapDeps([32,1,2,3,33,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"erlang",name:"Erlang",aliases:["erl"],import:(()=>m(()=>import("./erlang-DsQrWhSR.js"),__vite__mapDeps([39,40])))},{id:"fennel",name:"Fennel",import:(()=>m(()=>import("./fennel-BYunw83y.js"),[]))},{id:"fish",name:"Fish",import:(()=>m(()=>import("./fish-BvzEVeQv.js"),[]))},{id:"fluent",name:"Fluent",aliases:["ftl"],import:(()=>m(()=>import("./fluent-C4IJs8-o.js"),[]))},{id:"fortran-fixed-form",name:"Fortran (Fixed Form)",aliases:["f","for","f77"],import:(()=>m(()=>import("./fortran-fixed-form-CkoXwp7k.js"),__vite__mapDeps([41,42])))},{id:"fortran-free-form",name:"Fortran (Free Form)",aliases:["f90","f95","f03","f08","f18"],import:(()=>m(()=>import("./fortran-free-form-BxgE0vQu.js"),[]))},{id:"fsharp",name:"F#",aliases:["f#","fs"],import:(()=>m(()=>import("./fsharp-CXgrBDvD.js"),__vite__mapDeps([43,40])))},{id:"gdresource",name:"GDResource",aliases:["tscn","tres"],import:(()=>m(()=>import("./gdresource-BOOCDP_w.js"),__vite__mapDeps([44,45,46])))},{id:"gdscript",name:"GDScript",aliases:["gd"],import:(()=>m(()=>import("./gdscript-C5YyOfLZ.js"),[]))},{id:"gdshader",name:"GDShader",import:(()=>m(()=>import("./gdshader-DkwncUOv.js"),[]))},{id:"genie",name:"Genie",import:(()=>m(()=>import("./genie-D0YGMca9.js"),[]))},{id:"gherkin",name:"Gherkin",import:(()=>m(()=>import("./gherkin-DyxjwDmM.js"),[]))},{id:"git-commit",name:"Git Commit Message",import:(()=>m(()=>import("./git-commit-F4YmCXRG.js"),__vite__mapDeps([47,48])))},{id:"git-rebase",name:"Git Rebase Message",import:(()=>m(()=>import("./git-rebase-r7XF79zn.js"),__vite__mapDeps([49,28])))},{id:"gleam",name:"Gleam",import:(()=>m(()=>import("./gleam-BspZqrRM.js"),[]))},{id:"glimmer-js",name:"Glimmer JS",aliases:["gjs"],import:(()=>m(()=>import("./glimmer-js-ByusRIyA.js"),__vite__mapDeps([50,2,11,3,1])))},{id:"glimmer-ts",name:"Glimmer TS",aliases:["gts"],import:(()=>m(()=>import("./glimmer-ts-BfAWNZQY.js"),__vite__mapDeps([51,11,3,2,1])))},{id:"glsl",name:"GLSL",import:(()=>m(()=>import("./glsl-DplSGwfg.js"),__vite__mapDeps([25,26])))},{id:"gn",name:"GN",import:(()=>m(()=>import("./gn-n2N0HUVH.js"),[]))},{id:"gnuplot",name:"Gnuplot",import:(()=>m(()=>import("./gnuplot-DdkO51Og.js"),[]))},{id:"go",name:"Go",import:(()=>m(()=>import("./go-C27-OAKa.js"),[]))},{id:"graphql",name:"GraphQL",aliases:["gql"],import:(()=>m(()=>import("./graphql-ChdNCCLP.js"),__vite__mapDeps([35,2,11,36,13])))},{id:"groovy",name:"Groovy",import:(()=>m(()=>import("./groovy-gcz8RCvz.js"),[]))},{id:"hack",name:"Hack",import:(()=>m(()=>import("./hack-DbPARsA_.js"),__vite__mapDeps([52,1,2,3,16])))},{id:"haml",name:"Ruby Haml",import:(()=>m(()=>import("./haml-D5jkg6IW.js"),__vite__mapDeps([34,2,3])))},{id:"handlebars",name:"Handlebars",aliases:["hbs"],import:(()=>m(()=>import("./handlebars-BpdQsYii.js"),__vite__mapDeps([53,1,2,3,38])))},{id:"haskell",name:"Haskell",aliases:["hs"],import:(()=>m(()=>import("./haskell-Df6bDoY_.js"),[]))},{id:"haxe",name:"Haxe",import:(()=>m(()=>import("./haxe-CzTSHFRz.js"),[]))},{id:"hcl",name:"HashiCorp HCL",import:(()=>m(()=>import("./hcl-BWvSN4gD.js"),[]))},{id:"hjson",name:"Hjson",import:(()=>m(()=>import("./hjson-D5-asLiD.js"),[]))},{id:"hlsl",name:"HLSL",import:(()=>m(()=>import("./hlsl-D3lLCCz7.js"),[]))},{id:"html",name:"HTML",import:(()=>m(()=>import("./html-pp8916En.js"),__vite__mapDeps([1,2,3])))},{id:"html-derivative",name:"HTML (Derivative)",import:(()=>m(()=>import("./html-derivative-DlHx6ybY.js"),__vite__mapDeps([15,1,2,3])))},{id:"http",name:"HTTP",import:(()=>m(()=>import("./http-jrhK8wxY.js"),__vite__mapDeps([54,28,9,7,8,35,2,11,36,13])))},{id:"hurl",name:"Hurl",import:(()=>m(()=>import("./hurl-irOxFIW8.js"),__vite__mapDeps([55,35,2,11,36,13,7,8,56])))},{id:"hxml",name:"HXML",import:(()=>m(()=>import("./hxml-Bvhsp5Yf.js"),__vite__mapDeps([57,58])))},{id:"hy",name:"Hy",import:(()=>m(()=>import("./hy-DFXneXwc.js"),[]))},{id:"imba",name:"Imba",import:(()=>m(()=>import("./imba-DGztddWO.js"),[]))},{id:"ini",name:"INI",aliases:["properties"],import:(()=>m(()=>import("./ini-BEwlwnbL.js"),[]))},{id:"java",name:"Java",import:(()=>m(()=>import("./java-CylS5w8V.js"),[]))},{id:"javascript",name:"JavaScript",aliases:["js","cjs","mjs"],import:(()=>m(()=>import("./javascript-wDzz0qaB.js"),[]))},{id:"jinja",name:"Jinja",import:(()=>m(()=>import("./jinja-f2NsQr07.js"),__vite__mapDeps([59,1,2,3])))},{id:"jison",name:"Jison",import:(()=>m(()=>import("./jison-wvAkD_A8.js"),__vite__mapDeps([60,2])))},{id:"json",name:"JSON",import:(()=>m(()=>import("./json-Cp-IABpG.js"),[]))},{id:"json5",name:"JSON5",import:(()=>m(()=>import("./json5-C9tS-k6U.js"),[]))},{id:"jsonc",name:"JSON with Comments",import:(()=>m(()=>import("./jsonc-Des-eS-w.js"),[]))},{id:"jsonl",name:"JSON Lines",import:(()=>m(()=>import("./jsonl-DcaNXYhu.js"),[]))},{id:"jsonnet",name:"Jsonnet",import:(()=>m(()=>import("./jsonnet-DFQXde-d.js"),[]))},{id:"jssm",name:"JSSM",aliases:["fsl"],import:(()=>m(()=>import("./jssm-C2t-YnRu.js"),[]))},{id:"jsx",name:"JSX",import:(()=>m(()=>import("./jsx-g9-lgVsj.js"),[]))},{id:"julia",name:"Julia",aliases:["jl"],import:(()=>m(()=>import("./julia-D7OTSIA_.js"),__vite__mapDeps([61,23,24,25,26,16,20,2,62])))},{id:"just",name:"Just",import:(()=>m(()=>import("./just-CUsbIsdP.js"),__vite__mapDeps([63,28,2,11,64,1,3,7,8,16,20,33,34,35,36,13,23,24,25,26,37,38])))},{id:"kdl",name:"KDL",import:(()=>m(()=>import("./kdl-DV7GczEv.js"),[]))},{id:"kotlin",name:"Kotlin",aliases:["kt","kts"],import:(()=>m(()=>import("./kotlin-BdnUsdx6.js"),[]))},{id:"kusto",name:"Kusto",aliases:["kql"],import:(()=>m(()=>import("./kusto-wEQ09or8.js"),[]))},{id:"latex",name:"LaTeX",import:(()=>m(()=>import("./latex-CaSxy8MP.js"),__vite__mapDeps([65,66,62])))},{id:"lean",name:"Lean 4",aliases:["lean4"],import:(()=>m(()=>import("./lean-BZvkOJ9d.js"),[]))},{id:"less",name:"Less",import:(()=>m(()=>import("./less-B1dDrJ26.js"),[]))},{id:"liquid",name:"Liquid",import:(()=>m(()=>import("./liquid-C0sCDyMI.js"),__vite__mapDeps([67,1,2,3,9])))},{id:"llvm",name:"LLVM IR",import:(()=>m(()=>import("./llvm-DjAJT7YJ.js"),[]))},{id:"log",name:"Log file",import:(()=>m(()=>import("./log-2UxHyX5q.js"),[]))},{id:"logo",name:"Logo",import:(()=>m(()=>import("./logo-BtOb2qkB.js"),[]))},{id:"lua",name:"Lua",import:(()=>m(()=>import("./lua-BaeVxFsk.js"),__vite__mapDeps([37,26])))},{id:"luau",name:"Luau",import:(()=>m(()=>import("./luau-KW6xsasC.js"),[]))},{id:"make",name:"Makefile",aliases:["makefile"],import:(()=>m(()=>import("./make-CHLpvVh8.js"),[]))},{id:"markdown",name:"Markdown",aliases:["md"],import:(()=>m(()=>import("./markdown-Cvjx9yec.js"),[]))},{id:"marko",name:"Marko",import:(()=>m(()=>import("./marko-DjSrsDqO.js"),__vite__mapDeps([68,3,69,5,11])))},{id:"matlab",name:"MATLAB",import:(()=>m(()=>import("./matlab-D7o27uSR.js"),[]))},{id:"mdc",name:"MDC",import:(()=>m(()=>import("./mdc-DTYItulj.js"),__vite__mapDeps([70,40,38,15,1,2,3])))},{id:"mdx",name:"MDX",import:(()=>m(()=>import("./mdx-Cmh6b_Ma.js"),[]))},{id:"mermaid",name:"Mermaid",aliases:["mmd"],import:(()=>m(()=>import("./mermaid-mWjccvbQ.js"),[]))},{id:"mipsasm",name:"MIPS Assembly",aliases:["mips"],import:(()=>m(()=>import("./mipsasm-CKIfxQSi.js"),[]))},{id:"mojo",name:"Mojo",import:(()=>m(()=>import("./mojo-rZm6bMo-.js"),[]))},{id:"moonbit",name:"MoonBit",aliases:["mbt","mbti"],import:(()=>m(()=>import("./moonbit-_H4v1dQx.js"),[]))},{id:"move",name:"Move",import:(()=>m(()=>import("./move-IF9eRakj.js"),[]))},{id:"narrat",name:"Narrat Language",aliases:["nar"],import:(()=>m(()=>import("./narrat-DRg8JJMk.js"),[]))},{id:"nextflow",name:"Nextflow",aliases:["nf"],import:(()=>m(()=>import("./nextflow-C-mBbutL.js"),__vite__mapDeps([71,72])))},{id:"nextflow-groovy",name:"Nextflow Groovy",import:(()=>m(()=>import("./nextflow-groovy-vE_lwT2v.js"),[]))},{id:"nginx",name:"Nginx",import:(()=>m(()=>import("./nginx-BpAMiNFr.js"),__vite__mapDeps([73,37,26])))},{id:"nim",name:"Nim",import:(()=>m(()=>import("./nim-BIad80T-.js"),__vite__mapDeps([74,26,1,2,3,7,8,25,40])))},{id:"nix",name:"Nix",import:(()=>m(()=>import("./nix-CwoSXNpI.js"),[]))},{id:"nushell",name:"nushell",aliases:["nu"],import:(()=>m(()=>import("./nushell-Cz2AlsmD.js"),[]))},{id:"objective-c",name:"Objective-C",aliases:["objc"],import:(()=>m(()=>import("./objective-c-DXmwc3jG.js"),[]))},{id:"objective-cpp",name:"Objective-C++",import:(()=>m(()=>import("./objective-cpp-CLxacb5B.js"),[]))},{id:"ocaml",name:"OCaml",import:(()=>m(()=>import("./ocaml-C0hk2d4L.js"),[]))},{id:"odin",name:"Odin",import:(()=>m(()=>import("./odin-BBf5iR-q.js"),[]))},{id:"openscad",name:"OpenSCAD",aliases:["scad"],import:(()=>m(()=>import("./openscad-C4EeE6gA.js"),[]))},{id:"pascal",name:"Pascal",import:(()=>m(()=>import("./pascal-D93ZcfNL.js"),[]))},{id:"perl",name:"Perl",import:(()=>m(()=>import("./perl-B9cMNwum.js"),__vite__mapDeps([64,1,2,3,7,8,16])))},{id:"php",name:"PHP",import:(()=>m(()=>import("./php-Csjmro_R.js"),__vite__mapDeps([75,1,2,3,7,8,16,9])))},{id:"pkl",name:"Pkl",import:(()=>m(()=>import("./pkl-u5AG7uiY.js"),[]))},{id:"plsql",name:"PL/SQL",import:(()=>m(()=>import("./plsql-ChMvpjG-.js"),[]))},{id:"po",name:"Gettext PO",aliases:["pot","potx"],import:(()=>m(()=>import("./po-BTJTHyun.js"),[]))},{id:"polar",name:"Polar",import:(()=>m(()=>import("./polar-C0HS_06l.js"),[]))},{id:"postcss",name:"PostCSS",import:(()=>m(()=>import("./postcss-CXtECtnM.js"),[]))},{id:"powerquery",name:"PowerQuery",import:(()=>m(()=>import("./powerquery-CEu0bR-o.js"),[]))},{id:"powershell",name:"PowerShell",aliases:["ps","ps1"],import:(()=>m(()=>import("./powershell-Dpen1YoG.js"),[]))},{id:"prisma",name:"Prisma",import:(()=>m(()=>import("./prisma-Dd19v3D-.js"),[]))},{id:"prolog",name:"Prolog",import:(()=>m(()=>import("./prolog-CbFg5uaA.js"),[]))},{id:"proto",name:"Protocol Buffer 3",aliases:["protobuf"],import:(()=>m(()=>import("./proto-C7zT0LnQ.js"),[]))},{id:"pug",name:"Pug",aliases:["jade"],import:(()=>m(()=>import("./pug-DKIMFp6K.js"),__vite__mapDeps([76,2,3,1])))},{id:"puppet",name:"Puppet",import:(()=>m(()=>import("./puppet-BMWR74SV.js"),[]))},{id:"purescript",name:"PureScript",import:(()=>m(()=>import("./purescript-CklMAg4u.js"),[]))},{id:"python",name:"Python",aliases:["py"],import:(()=>m(()=>import("./python-B6aJPvgy.js"),[]))},{id:"qml",name:"QML",import:(()=>m(()=>import("./qml-3beO22l8.js"),__vite__mapDeps([77,2])))},{id:"qmldir",name:"QML Directory",import:(()=>m(()=>import("./qmldir-C8lEn-DE.js"),[]))},{id:"qss",name:"Qt Style Sheets",import:(()=>m(()=>import("./qss-IeuSbFQv.js"),[]))},{id:"r",name:"R",import:(()=>m(()=>import("./r-Dspwwk_N.js"),[]))},{id:"racket",name:"Racket",import:(()=>m(()=>import("./racket-BqYA7rlc.js"),[]))},{id:"raku",name:"Raku",aliases:["perl6"],import:(()=>m(()=>import("./raku-DXvB9xmW.js"),[]))},{id:"razor",name:"ASP.NET Razor",import:(()=>m(()=>import("./razor-BjBPvh-w.js"),__vite__mapDeps([78,1,2,3,79])))},{id:"reg",name:"Windows Registry Script",import:(()=>m(()=>import("./reg-C-SQnVFl.js"),[]))},{id:"regexp",name:"RegExp",aliases:["regex"],import:(()=>m(()=>import("./regexp-CDVJQ6XC.js"),[]))},{id:"rel",name:"Rel",import:(()=>m(()=>import("./rel-C3B-1QV4.js"),[]))},{id:"riscv",name:"RISC-V",import:(()=>m(()=>import("./riscv-BM1_JUlF.js"),[]))},{id:"ron",name:"RON",import:(()=>m(()=>import("./ron-D8l8udqQ.js"),[]))},{id:"rosmsg",name:"ROS Interface",import:(()=>m(()=>import("./rosmsg-BJDFO7_C.js"),[]))},{id:"rst",name:"reStructuredText",import:(()=>m(()=>import("./rst-CpCqk9r5.js"),__vite__mapDeps([80,15,1,2,3,23,24,25,26,16,20,28,38,81,33,34,7,8,35,11,36,13,37])))},{id:"ruby",name:"Ruby",aliases:["rb"],import:(()=>m(()=>import("./ruby-DyJCeAvU.js"),__vite__mapDeps([33,1,2,3,34,7,8,16,35,11,36,13,23,24,25,26,28,37,38])))},{id:"rust",name:"Rust",aliases:["rs"],import:(()=>m(()=>import("./rust-B1yitclQ.js"),[]))},{id:"sas",name:"SAS",import:(()=>m(()=>import("./sas-DEy46yEz.js"),__vite__mapDeps([82,16])))},{id:"sass",name:"Sass",import:(()=>m(()=>import("./sass-Cj5Yp3dK.js"),[]))},{id:"scala",name:"Scala",import:(()=>m(()=>import("./scala-C151Ov-r.js"),[]))},{id:"scheme",name:"Scheme",import:(()=>m(()=>import("./scheme-C98Dy4si.js"),[]))},{id:"scss",name:"SCSS",import:(()=>m(()=>import("./scss-D5BDwBP9.js"),__vite__mapDeps([5,3])))},{id:"sdbl",name:"1C (Query)",aliases:["1c-query"],import:(()=>m(()=>import("./sdbl-DVxCFoDh.js"),[]))},{id:"shaderlab",name:"ShaderLab",aliases:["shader"],import:(()=>m(()=>import("./shaderlab-Dg9Lc6iA.js"),__vite__mapDeps([83,84])))},{id:"shellscript",name:"Shell",aliases:["bash","sh","shell","zsh"],import:(()=>m(()=>import("./shellscript-Yzrsuije.js"),[]))},{id:"shellsession",name:"Shell Session",aliases:["console"],import:(()=>m(()=>import("./shellsession-BADoaaVG.js"),__vite__mapDeps([85,28])))},{id:"smalltalk",name:"Smalltalk",import:(()=>m(()=>import("./smalltalk-BERRCDM3.js"),[]))},{id:"solidity",name:"Solidity",import:(()=>m(()=>import("./solidity-rGO070M0.js"),[]))},{id:"soy",name:"Closure Templates",aliases:["closure-templates"],import:(()=>m(()=>import("./soy-8wufbnw4.js"),__vite__mapDeps([86,1,2,3])))},{id:"sparql",name:"SPARQL",import:(()=>m(()=>import("./sparql-rVzFXLq3.js"),__vite__mapDeps([87,88])))},{id:"splunk",name:"Splunk Query Language",aliases:["spl"],import:(()=>m(()=>import("./splunk-BtCnVYZw.js"),[]))},{id:"sql",name:"SQL",import:(()=>m(()=>import("./sql-CRqJ_cUM.js"),[]))},{id:"ssh-config",name:"SSH Config",import:(()=>m(()=>import("./ssh-config-_ykCGR6B.js"),[]))},{id:"stata",name:"Stata",import:(()=>m(()=>import("./stata-DI20mbqo.js"),__vite__mapDeps([89,16])))},{id:"stylus",name:"Stylus",aliases:["styl"],import:(()=>m(()=>import("./stylus-BEDo0Tqx.js"),[]))},{id:"surrealql",name:"SurrealQL",aliases:["surql"],import:(()=>m(()=>import("./surrealql-Bq5Q-fJD.js"),__vite__mapDeps([90,2])))},{id:"svelte",name:"Svelte",import:(()=>m(()=>import("./svelte-Cy7k_4gC.js"),__vite__mapDeps([91,2,11,3,12])))},{id:"swift",name:"Swift",import:(()=>m(()=>import("./swift-D82vCrfD.js"),[]))},{id:"system-verilog",name:"SystemVerilog",import:(()=>m(()=>import("./system-verilog-CnnmHF94.js"),[]))},{id:"systemd",name:"Systemd Units",import:(()=>m(()=>import("./systemd-4A_iFExJ.js"),[]))},{id:"talonscript",name:"TalonScript",aliases:["talon"],import:(()=>m(()=>import("./talonscript-CkByrt1z.js"),[]))},{id:"tasl",name:"Tasl",import:(()=>m(()=>import("./tasl-QIJgUcNo.js"),[]))},{id:"tcl",name:"Tcl",import:(()=>m(()=>import("./tcl-dwOrl1Do.js"),[]))},{id:"templ",name:"Templ",import:(()=>m(()=>import("./templ-DhtptRzy.js"),__vite__mapDeps([92,93,2,3])))},{id:"terraform",name:"Terraform",aliases:["tf","tfvars"],import:(()=>m(()=>import("./terraform-BETggiCN.js"),[]))},{id:"tex",name:"TeX",import:(()=>m(()=>import("./tex-idrVyKtj.js"),__vite__mapDeps([66,62])))},{id:"toml",name:"TOML",import:(()=>m(()=>import("./toml-vGWfd6FD.js"),[]))},{id:"ts-tags",name:"TypeScript with Tags",aliases:["lit"],import:(()=>m(()=>import("./ts-tags-D351s5mN.js"),__vite__mapDeps([94,11,3,2,25,26,1,16,7,8])))},{id:"tsv",name:"TSV",import:(()=>m(()=>import("./tsv-B_m7g4N7.js"),[]))},{id:"tsx",name:"TSX",import:(()=>m(()=>import("./tsx-COt5Ahok.js"),[]))},{id:"turtle",name:"Turtle",import:(()=>m(()=>import("./turtle-BsS91CYL.js"),[]))},{id:"twig",name:"Twig",import:(()=>m(()=>import("./twig-CW1WmMYd.js"),__vite__mapDeps([95,3,2,5,75,1,7,8,16,9,20,33,34,35,11,36,13,23,24,25,26,28,37,38])))},{id:"typescript",name:"TypeScript",aliases:["ts","cts","mts"],import:(()=>m(()=>import("./typescript-BPQ3VLAy.js"),[]))},{id:"typespec",name:"TypeSpec",aliases:["tsp"],import:(()=>m(()=>import("./typespec-CAFt9gP4.js"),[]))},{id:"typst",name:"Typst",aliases:["typ"],import:(()=>m(()=>import("./typst-DHCkPAjA.js"),[]))},{id:"v",name:"V",import:(()=>m(()=>import("./v-BcVCzyr7.js"),[]))},{id:"vala",name:"Vala",import:(()=>m(()=>import("./vala-CsfeWuGM.js"),[]))},{id:"vb",name:"Visual Basic",aliases:["cmd"],import:(()=>m(()=>import("./vb-D17OF-Vu.js"),[]))},{id:"verilog",name:"Verilog",import:(()=>m(()=>import("./verilog-BQ8w6xss.js"),[]))},{id:"vhdl",name:"VHDL",import:(()=>m(()=>import("./vhdl-CeAyd5Ju.js"),[]))},{id:"viml",name:"Vim Script",aliases:["vim","vimscript"],import:(()=>m(()=>import("./viml-CJc9bBzg.js"),[]))},{id:"vue",name:"Vue",import:(()=>m(()=>import("./vue-D2xRrEX4.js"),__vite__mapDeps([96,3,2,11,9,1,15])))},{id:"vue-html",name:"Vue HTML",import:(()=>m(()=>import("./vue-html-AaS7Mt5G.js"),__vite__mapDeps([97,2])))},{id:"vue-vine",name:"Vue Vine",import:(()=>m(()=>import("./vue-vine-BoDAl6tE.js"),__vite__mapDeps([98,3,5,69,99,12,2])))},{id:"vyper",name:"Vyper",aliases:["vy"],import:(()=>m(()=>import("./vyper-CDx5xZoG.js"),[]))},{id:"wasm",name:"WebAssembly",import:(()=>m(()=>import("./wasm-MzD3tlZU.js"),[]))},{id:"wenyan",name:"Wenyan",aliases:["文言"],import:(()=>m(()=>import("./wenyan-BV7otONQ.js"),[]))},{id:"wgsl",name:"WGSL",import:(()=>m(()=>import("./wgsl-Dx-B1_4e.js"),[]))},{id:"wikitext",name:"Wikitext",aliases:["mediawiki","wiki"],import:(()=>m(()=>import("./wikitext-BhOHFoWU.js"),[]))},{id:"wit",name:"WebAssembly Interface Types",import:(()=>m(()=>import("./wit-5i3qLPDT.js"),[]))},{id:"wolfram",name:"Wolfram",aliases:["wl"],import:(()=>m(()=>import("./wolfram-lXgVvXCa.js"),[]))},{id:"xml",name:"XML",import:(()=>m(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([7,8])))},{id:"xsl",name:"XSL",import:(()=>m(()=>import("./xsl-CtQFsRM5.js"),__vite__mapDeps([100,7,8])))},{id:"yaml",name:"YAML",aliases:["yml"],import:(()=>m(()=>import("./yaml-Buea-lGh.js"),[]))},{id:"zenscript",name:"ZenScript",import:(()=>m(()=>import("./zenscript-DVFEvuxE.js"),[]))},{id:"zig",name:"Zig",import:(()=>m(()=>import("./zig-VOosw3JB.js"),[]))}],ao=Object.fromEntries(vi.map(e=>[e.id,e.import])),lo=Object.fromEntries(vi.flatMap(e=>e.aliases?.map(t=>[t,e.import])||[])),Jt={...ao,...lo},co=[{id:"andromeeda",displayName:"Andromeeda",type:"dark",import:(()=>m(()=>import("./andromeeda-C4gqWexZ.js"),[]))},{id:"aurora-x",displayName:"Aurora X",type:"dark",import:(()=>m(()=>import("./aurora-x-D-2ljcwZ.js"),[]))},{id:"ayu-dark",displayName:"Ayu Dark",type:"dark",import:(()=>m(()=>import("./ayu-dark-DYE7WIF3.js"),[]))},{id:"ayu-light",displayName:"Ayu Light",type:"light",import:(()=>m(()=>import("./ayu-light-BA47KaF1.js"),[]))},{id:"ayu-mirage",displayName:"Ayu Mirage",type:"dark",import:(()=>m(()=>import("./ayu-mirage-32ctXXKs.js"),[]))},{id:"catppuccin-frappe",displayName:"Catppuccin Frappé",type:"dark",import:(()=>m(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]))},{id:"catppuccin-latte",displayName:"Catppuccin Latte",type:"light",import:(()=>m(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]))},{id:"catppuccin-macchiato",displayName:"Catppuccin Macchiato",type:"dark",import:(()=>m(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]))},{id:"catppuccin-mocha",displayName:"Catppuccin Mocha",type:"dark",import:(()=>m(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]))},{id:"dark-plus",displayName:"Dark Plus",type:"dark",import:(()=>m(()=>import("./dark-plus-C3mMm8J8.js"),[]))},{id:"dracula",displayName:"Dracula Theme",type:"dark",import:(()=>m(()=>import("./dracula-BzJJZx-M.js"),[]))},{id:"dracula-soft",displayName:"Dracula Theme Soft",type:"dark",import:(()=>m(()=>import("./dracula-soft-BXkSAIEj.js"),[]))},{id:"everforest-dark",displayName:"Everforest Dark",type:"dark",import:(()=>m(()=>import("./everforest-dark-BgDCqdQA.js"),[]))},{id:"everforest-light",displayName:"Everforest Light",type:"light",import:(()=>m(()=>import("./everforest-light-C8M2exoo.js"),[]))},{id:"github-dark",displayName:"GitHub Dark",type:"dark",import:(()=>m(()=>import("./github-dark-DHJKELXO.js"),[]))},{id:"github-dark-default",displayName:"GitHub Dark Default",type:"dark",import:(()=>m(()=>import("./github-dark-default-Cuk6v7N8.js"),[]))},{id:"github-dark-dimmed",displayName:"GitHub Dark Dimmed",type:"dark",import:(()=>m(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]))},{id:"github-dark-high-contrast",displayName:"GitHub Dark High Contrast",type:"dark",import:(()=>m(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]))},{id:"github-light",displayName:"GitHub Light",type:"light",import:(()=>m(()=>import("./github-light-DAi9KRSo.js"),[]))},{id:"github-light-default",displayName:"GitHub Light Default",type:"light",import:(()=>m(()=>import("./github-light-default-D7oLnXFd.js"),[]))},{id:"github-light-high-contrast",displayName:"GitHub Light High Contrast",type:"light",import:(()=>m(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]))},{id:"gruvbox-dark-hard",displayName:"Gruvbox Dark Hard",type:"dark",import:(()=>m(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]))},{id:"gruvbox-dark-medium",displayName:"Gruvbox Dark Medium",type:"dark",import:(()=>m(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]))},{id:"gruvbox-dark-soft",displayName:"Gruvbox Dark Soft",type:"dark",import:(()=>m(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]))},{id:"gruvbox-light-hard",displayName:"Gruvbox Light Hard",type:"light",import:(()=>m(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]))},{id:"gruvbox-light-medium",displayName:"Gruvbox Light Medium",type:"light",import:(()=>m(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]))},{id:"gruvbox-light-soft",displayName:"Gruvbox Light Soft",type:"light",import:(()=>m(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]))},{id:"horizon",displayName:"Horizon",type:"dark",import:(()=>m(()=>import("./horizon-BUw7H-hv.js"),[]))},{id:"horizon-bright",displayName:"Horizon Bright",type:"light",import:(()=>m(()=>import("./horizon-bright-CUuTKBJd.js"),[]))},{id:"houston",displayName:"Houston",type:"dark",import:(()=>m(()=>import("./houston-DnULxvSX.js"),[]))},{id:"kanagawa-dragon",displayName:"Kanagawa Dragon",type:"dark",import:(()=>m(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]))},{id:"kanagawa-lotus",displayName:"Kanagawa Lotus",type:"light",import:(()=>m(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]))},{id:"kanagawa-wave",displayName:"Kanagawa Wave",type:"dark",import:(()=>m(()=>import("./kanagawa-wave-DWedfzmr.js"),[]))},{id:"laserwave",displayName:"LaserWave",type:"dark",import:(()=>m(()=>import("./laserwave-DUszq2jm.js"),[]))},{id:"light-plus",displayName:"Light Plus",type:"light",import:(()=>m(()=>import("./light-plus-B7mTdjB0.js"),[]))},{id:"material-theme",displayName:"Material Theme",type:"dark",import:(()=>m(()=>import("./material-theme-D5KoaKCx.js"),[]))},{id:"material-theme-darker",displayName:"Material Theme Darker",type:"dark",import:(()=>m(()=>import("./material-theme-darker-BfHTSMKl.js"),[]))},{id:"material-theme-lighter",displayName:"Material Theme Lighter",type:"light",import:(()=>m(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]))},{id:"material-theme-ocean",displayName:"Material Theme Ocean",type:"dark",import:(()=>m(()=>import("./material-theme-ocean-CyktbL80.js"),[]))},{id:"material-theme-palenight",displayName:"Material Theme Palenight",type:"dark",import:(()=>m(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]))},{id:"min-dark",displayName:"Min Dark",type:"dark",import:(()=>m(()=>import("./min-dark-CafNBF8u.js"),[]))},{id:"min-light",displayName:"Min Light",type:"light",import:(()=>m(()=>import("./min-light-CTRr51gU.js"),[]))},{id:"monokai",displayName:"Monokai",type:"dark",import:(()=>m(()=>import("./monokai-D4h5O-jR.js"),[]))},{id:"night-owl",displayName:"Night Owl",type:"dark",import:(()=>m(()=>import("./night-owl-C39BiMTA.js"),[]))},{id:"night-owl-light",displayName:"Night Owl Light",type:"light",import:(()=>m(()=>import("./night-owl-light-CMTm3GFP.js"),[]))},{id:"nord",displayName:"Nord",type:"dark",import:(()=>m(()=>import("./nord-Ddv68eIx.js"),[]))},{id:"one-dark-pro",displayName:"One Dark Pro",type:"dark",import:(()=>m(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]))},{id:"one-light",displayName:"One Light",type:"light",import:(()=>m(()=>import("./one-light-C3Wv6jpd.js"),[]))},{id:"plastic",displayName:"Plastic",type:"dark",import:(()=>m(()=>import("./plastic-3e1v2bzS.js"),[]))},{id:"poimandres",displayName:"Poimandres",type:"dark",import:(()=>m(()=>import("./poimandres-CS3Unz2-.js"),[]))},{id:"red",displayName:"Red",type:"dark",import:(()=>m(()=>import("./red-bN70gL4F.js"),[]))},{id:"rose-pine",displayName:"Rosé Pine",type:"dark",import:(()=>m(()=>import("./rose-pine-qdsjHGoJ.js"),[]))},{id:"rose-pine-dawn",displayName:"Rosé Pine Dawn",type:"light",import:(()=>m(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]))},{id:"rose-pine-moon",displayName:"Rosé Pine Moon",type:"dark",import:(()=>m(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]))},{id:"slack-dark",displayName:"Slack Dark",type:"dark",import:(()=>m(()=>import("./slack-dark-BthQWCQV.js"),[]))},{id:"slack-ochin",displayName:"Slack Ochin",type:"light",import:(()=>m(()=>import("./slack-ochin-DqwNpetd.js"),[]))},{id:"snazzy-light",displayName:"Snazzy Light",type:"light",import:(()=>m(()=>import("./snazzy-light-Bw305WKR.js"),[]))},{id:"solarized-dark",displayName:"Solarized Dark",type:"dark",import:(()=>m(()=>import("./solarized-dark-DXbdFlpD.js"),[]))},{id:"solarized-light",displayName:"Solarized Light",type:"light",import:(()=>m(()=>import("./solarized-light-L9t79GZl.js"),[]))},{id:"synthwave-84",displayName:"Synthwave '84",type:"dark",import:(()=>m(()=>import("./synthwave-84-CbfX1IO0.js"),[]))},{id:"tokyo-night",displayName:"Tokyo Night",type:"dark",import:(()=>m(()=>import("./tokyo-night-hegEt444.js"),[]))},{id:"vesper",displayName:"Vesper",type:"dark",import:(()=>m(()=>import("./vesper-DRje8inN.js"),[]))},{id:"vitesse-black",displayName:"Vitesse Black",type:"dark",import:(()=>m(()=>import("./vitesse-black-Bkuqu6BP.js"),[]))},{id:"vitesse-dark",displayName:"Vitesse Dark",type:"dark",import:(()=>m(()=>import("./vitesse-dark-D0r3Knsf.js"),[]))},{id:"vitesse-light",displayName:"Vitesse Light",type:"light",import:(()=>m(()=>import("./vitesse-light-CVO1_9PV.js"),[]))}],uo=Object.fromEntries(co.map(e=>[e.id,e.import]));var ho=class extends Error{constructor(t){super(t),this.name="ShikiError"}};function mh(){return 2147483648}function gh(){return typeof performance<"u"?performance.now():Date.now()}const bh=(e,t)=>e+(t-e%t)%t;async function vh(e){let t,n;const i={};function r(f){n=f,i.HEAPU8=new Uint8Array(f),i.HEAPU32=new Uint32Array(f)}function o(f,g,y){i.HEAPU8.copyWithin(f,g,g+y)}function s(f){try{return t.grow(f-n.byteLength+65535>>>16),r(t.buffer),1}catch{}}function l(f){const g=i.HEAPU8.length;f=f>>>0;const y=mh();if(f>y)return!1;for(let _=1;_<=4;_*=2){let b=g*(1+.2/_);b=Math.min(b,f+100663296);const p=Math.min(y,bh(Math.max(f,b),65536));if(s(p))return!0}return!1}const a=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0;function d(f,g,y=1024){const _=g+y;let b=g;for(;f[b]&&!(b>=_);)++b;if(b-g>16&&f.buffer&&a)return a.decode(f.subarray(g,b));let p="";for(;g<b;){let v=f[g++];if(!(v&128)){p+=String.fromCharCode(v);continue}const w=f[g++]&63;if((v&224)===192){p+=String.fromCharCode((v&31)<<6|w);continue}const S=f[g++]&63;if((v&240)===224?v=(v&15)<<12|w<<6|S:v=(v&7)<<18|w<<12|S<<6|f[g++]&63,v<65536)p+=String.fromCharCode(v);else{const k=v-65536;p+=String.fromCharCode(55296|k>>10,56320|k&1023)}}return p}function c(f,g){return f?d(i.HEAPU8,f,g):""}const u={emscripten_get_now:gh,emscripten_memcpy_big:o,emscripten_resize_heap:l,fd_write:()=>0};async function h(){const g=await e({env:u,wasi_snapshot_preview1:u});t=g.memory,r(t.buffer),Object.assign(i,g),i.UTF8ToString=c}return await h(),i}var yh=Object.defineProperty,_h=(e,t,n)=>t in e?yh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,J=(e,t,n)=>_h(e,typeof t!="symbol"?t+"":t,n);let te=null;function wh(e){throw new ho(e.UTF8ToString(e.getLastOnigError()))}class yi{constructor(t){J(this,"utf16Length"),J(this,"utf8Length"),J(this,"utf16Value"),J(this,"utf8Value"),J(this,"utf16OffsetToUtf8"),J(this,"utf8OffsetToUtf16");const n=t.length,i=yi._utf8ByteLength(t),r=i!==n,o=r?new Uint32Array(n+1):null;r&&(o[n]=i);const s=r?new Uint32Array(i+1):null;r&&(s[i]=n);const l=new Uint8Array(i);let a=0;for(let d=0;d<n;d++){const c=t.charCodeAt(d);let u=c,h=!1;if(c>=55296&&c<=56319&&d+1<n){const f=t.charCodeAt(d+1);f>=56320&&f<=57343&&(u=(c-55296<<10)+65536|f-56320,h=!0)}r&&(o[d]=a,h&&(o[d+1]=a),u<=127?s[a+0]=d:u<=2047?(s[a+0]=d,s[a+1]=d):u<=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)),u<=127?l[a++]=u:u<=2047?(l[a++]=192|(u&1984)>>>6,l[a++]=128|(u&63)>>>0):u<=65535?(l[a++]=224|(u&61440)>>>12,l[a++]=128|(u&4032)>>>6,l[a++]=128|(u&63)>>>0):(l[a++]=240|(u&1835008)>>>18,l[a++]=128|(u&258048)>>>12,l[a++]=128|(u&4032)>>>6,l[a++]=128|(u&63)>>>0),h&&d++}this.utf16Length=n,this.utf8Length=i,this.utf16Value=t,this.utf8Value=l,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=s}static _utf8ByteLength(t){let n=0;for(let i=0,r=t.length;i<r;i++){const o=t.charCodeAt(i);let s=o,l=!1;if(o>=55296&&o<=56319&&i+1<r){const a=t.charCodeAt(i+1);a>=56320&&a<=57343&&(s=(o-55296<<10)+65536|a-56320,l=!0)}s<=127?n+=1:s<=2047?n+=2:s<=65535?n+=3:n+=4,l&&i++}return n}createString(t){const n=t.omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}const _i=class Re{constructor(t){if(J(this,"id",++Re.LAST_ID),J(this,"_onigBinding"),J(this,"content"),J(this,"utf16Length"),J(this,"utf8Length"),J(this,"utf16OffsetToUtf8"),J(this,"utf8OffsetToUtf16"),J(this,"ptr"),!te)throw new ho("Must invoke loadWasm first.");this._onigBinding=te,this.content=t;const n=new yi(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!Re._sharedPtrInUse?(Re._sharedPtr||(Re._sharedPtr=te.omalloc(1e4)),Re._sharedPtrInUse=!0,te.HEAPU8.set(n.utf8Value,Re._sharedPtr),this.ptr=Re._sharedPtr):this.ptr=n.createString(te)}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===Re._sharedPtr?Re._sharedPtrInUse=!1:this._onigBinding.ofree(this.ptr)}};J(_i,"LAST_ID",0);J(_i,"_sharedPtr",0);J(_i,"_sharedPtrInUse",!1);let $a=_i;class Sh{constructor(t){if(J(this,"_onigBinding"),J(this,"_ptr"),!te)throw new ho("Must invoke loadWasm first.");const n=[],i=[];for(let l=0,a=t.length;l<a;l++){const d=new yi(t[l]);n[l]=d.createString(te),i[l]=d.utf8Length}const r=te.omalloc(4*t.length);te.HEAPU32.set(n,r/4);const o=te.omalloc(4*t.length);te.HEAPU32.set(i,o/4);const s=te.createOnigScanner(r,o,t.length);for(let l=0,a=t.length;l<a;l++)te.ofree(n[l]);te.ofree(o),te.ofree(r),s===0&&wh(te),this._onigBinding=te,this._ptr=s}dispose(){this._onigBinding.freeOnigScanner(this._ptr)}findNextMatchSync(t,n,i){let r=0;if(typeof i=="number"&&(r=i),typeof t=="string"){t=new $a(t);const o=this._findNextMatchSync(t,n,!1,r);return t.dispose(),o}return this._findNextMatchSync(t,n,!1,r)}_findNextMatchSync(t,n,i,r){const o=this._onigBinding,s=o.findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),r);if(s===0)return null;const l=o.HEAPU32;let a=s/4;const d=l[a++],c=l[a++],u=[];for(let h=0;h<c;h++){const f=t.convertUtf8OffsetToUtf16(l[a++]),g=t.convertUtf8OffsetToUtf16(l[a++]);u[h]={start:f,end:g,length:g-f}}return{index:d,captureIndices:u}}}function Ch(e){return typeof e.instantiator=="function"}function kh(e){return typeof e.default=="function"}function Eh(e){return typeof e.data<"u"}function xh(e){return typeof Response<"u"&&e instanceof Response}function Lh(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 wn;function fo(e){if(wn)return wn;async function t(){te=await vh(async n=>{let i=e;return i=await i,typeof i=="function"&&(i=await i(n)),typeof i=="function"&&(i=await i(n)),Ch(i)?i=await i.instantiator(n):kh(i)?i=await i.default(n):(Eh(i)&&(i=i.data),xh(i)?typeof WebAssembly.instantiateStreaming=="function"?i=await Th(i)(n):i=await Rh(i)(n):Lh(i)?i=await $i(i)(n):i instanceof WebAssembly.Module?i=await $i(i)(n):"default"in i&&i.default instanceof WebAssembly.Module&&(i=await $i(i.default)(n))),"instance"in i&&(i=i.instance),"exports"in i&&(i=i.exports),i})}return wn=t(),wn}function $i(e){return t=>WebAssembly.instantiate(e,t)}function Th(e){return t=>WebAssembly.instantiateStreaming(e,t)}function Rh(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}let Fa;function Ah(e){Fa=e}function Ih(){return Fa}async function po(e){return e&&await fo(e),{createScanner(t){return new Sh(t.map(n=>typeof n=="string"?n:n.source))},createString(t){return new $a(t)}}}const Ph=Object.freeze(Object.defineProperty({__proto__:null,createOnigurumaEngine:po,getDefaultWasmLoader:Ih,loadWasm:fo,setDefaultWasmLoader:Ah},Symbol.toStringTag,{value:"Module"}));var Ba=so({});za(Ba,Ph);var U=class extends Error{constructor(e){super(e),this.name="ShikiError"}};function Dh(e){return mo(e)}function mo(e){return Array.isArray(e)?Mh(e):e instanceof RegExp?e:typeof e=="object"?Oh(e):e}function Mh(e){let t=[];for(let n=0,i=e.length;n<i;n++)t[n]=mo(e[n]);return t}function Oh(e){let t={};for(let n in e)t[n]=mo(e[n]);return t}function Ua(e,...t){return t.forEach(n=>{for(let i in n)e[i]=n[i]}),e}function Ga(e){const t=~e.lastIndexOf("/")||~e.lastIndexOf("\\");return t===0?e:~t===e.length-1?Ga(e.substring(0,e.length-1)):e.substr(~t+1)}var Fi=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g,Sn=class{static hasCaptures(e){return e===null?!1:(Fi.lastIndex=0,Fi.test(e))}static replaceCaptures(e,t,n){return e.replace(Fi,(i,r,o,s)=>{let l=n[parseInt(r||o,10)];if(l){let a=t.substring(l.start,l.end);for(;a[0]===".";)a=a.substring(1);switch(s){case"downcase":return a.toLowerCase();case"upcase":return a.toUpperCase();default:return a}}else return i})}};function Wa(e,t){return e<t?-1:e>t?1:0}function qa(e,t){if(e===null&&t===null)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,i=t.length;if(n===i){for(let r=0;r<n;r++){let o=Wa(e[r],t[r]);if(o!==0)return o}return 0}return n-i}function Uo(e){return!!(/^#[0-9a-f]{6}$/i.test(e)||/^#[0-9a-f]{8}$/i.test(e)||/^#[0-9a-f]{3}$/i.test(e)||/^#[0-9a-f]{4}$/i.test(e))}function ja(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}var Ka=class{constructor(e){this.fn=e}cache=new Map;get(e){if(this.cache.has(e))return this.cache.get(e);const t=this.fn(e);return this.cache.set(e,t),t}},Zn=class{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n}static createFromRawTheme(e,t){return this.createFromParsedTheme(Vh(e),t)}static createFromParsedTheme(e,t){return $h(e,t)}_cachedMatchRoot=new Ka(e=>this._root.match(e));getColorMap(){return this._colorMap.getColorMap()}getDefaults(){return this._defaults}match(e){if(e===null)return this._defaults;const t=e.scopeName,i=this._cachedMatchRoot.get(t).find(r=>Nh(e.parent,r.parentScopes));return i?new Xa(i.fontStyle,i.foreground,i.background):null}},Bi=class Bn{constructor(t,n){this.parent=t,this.scopeName=n}static push(t,n){for(const i of n)t=new Bn(t,i);return t}static from(...t){let n=null;for(let i=0;i<t.length;i++)n=new Bn(n,t[i]);return n}push(t){return new Bn(this,t)}getSegments(){let t=this;const n=[];for(;t;)n.push(t.scopeName),t=t.parent;return n.reverse(),n}toString(){return this.getSegments().join(" ")}extends(t){return this===t?!0:this.parent===null?!1:this.parent.extends(t)}getExtensionIfDefined(t){const n=[];let i=this;for(;i&&i!==t;)n.push(i.scopeName),i=i.parent;return i===t?n.reverse():void 0}};function Nh(e,t){if(t.length===0)return!0;for(let n=0;n<t.length;n++){let i=t[n],r=!1;if(i===">"){if(n===t.length-1)return!1;i=t[++n],r=!0}for(;e&&!Hh(e.scopeName,i);){if(r)return!1;e=e.parent}if(!e)return!1;e=e.parent}return!0}function Hh(e,t){return t===e||e.startsWith(t)&&e[t.length]==="."}var Xa=class{constructor(e,t,n){this.fontStyle=e,this.foregroundId=t,this.backgroundId=n}};function Vh(e){if(!e)return[];if(!e.settings||!Array.isArray(e.settings))return[];let t=e.settings,n=[],i=0;for(let r=0,o=t.length;r<o;r++){let s=t[r];if(!s.settings)continue;let l;if(typeof s.scope=="string"){let u=s.scope;u=u.replace(/^[,]+/,""),u=u.replace(/[,]+$/,""),l=u.split(",")}else Array.isArray(s.scope)?l=s.scope:l=[""];let a=-1;if(typeof s.settings.fontStyle=="string"){a=0;let u=s.settings.fontStyle.split(" ");for(let h=0,f=u.length;h<f;h++)switch(u[h]){case"italic":a=a|1;break;case"bold":a=a|2;break;case"underline":a=a|4;break;case"strikethrough":a=a|8;break}}let d=null;typeof s.settings.foreground=="string"&&Uo(s.settings.foreground)&&(d=s.settings.foreground);let c=null;typeof s.settings.background=="string"&&Uo(s.settings.background)&&(c=s.settings.background);for(let u=0,h=l.length;u<h;u++){let g=l[u].trim().split(" "),y=g[g.length-1],_=null;g.length>1&&(_=g.slice(0,g.length-1),_.reverse()),n[i++]=new zh(y,_,r,a,d,c)}}return n}var zh=class{constructor(e,t,n,i,r,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=i,this.foreground=r,this.background=o}},se=(e=>(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e[e.Strikethrough=8]="Strikethrough",e))(se||{});function $h(e,t){e.sort((a,d)=>{let c=Wa(a.scope,d.scope);return c!==0||(c=qa(a.parentScopes,d.parentScopes),c!==0)?c:a.index-d.index});let n=0,i="#000000",r="#ffffff";for(;e.length>=1&&e[0].scope==="";){let a=e.shift();a.fontStyle!==-1&&(n=a.fontStyle),a.foreground!==null&&(i=a.foreground),a.background!==null&&(r=a.background)}let o=new Fh(t),s=new Xa(n,o.getId(i),o.getId(r)),l=new Uh(new xr(0,null,-1,0,0),[]);for(let a=0,d=e.length;a<d;a++){let c=e[a];l.insert(0,c.scope,c.parentScopes,c.fontStyle,o.getId(c.foreground),o.getId(c.background))}return new Zn(o,s,l)}var Fh=class{_isFrozen;_lastColorId;_id2color;_color2id;constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t]}else this._isFrozen=!1}getId(e){if(e===null)return 0;e=e.toUpperCase();let t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error(`Missing color in color map - ${e}`);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t}getColorMap(){return this._id2color.slice(0)}},Bh=Object.freeze([]),xr=class Qa{scopeDepth;parentScopes;fontStyle;foreground;background;constructor(t,n,i,r,o){this.scopeDepth=t,this.parentScopes=n||Bh,this.fontStyle=i,this.foreground=r,this.background=o}clone(){return new Qa(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)}static cloneArr(t){let n=[];for(let i=0,r=t.length;i<r;i++)n[i]=t[i].clone();return n}acceptOverwrite(t,n,i,r){this.scopeDepth>t?console.log("how did this happen?"):this.scopeDepth=t,n!==-1&&(this.fontStyle=n),i!==0&&(this.foreground=i),r!==0&&(this.background=r)}},Uh=class Lr{constructor(t,n=[],i={}){this._mainRule=t,this._children=i,this._rulesWithParentScopes=n}_rulesWithParentScopes;static _cmpBySpecificity(t,n){if(t.scopeDepth!==n.scopeDepth)return n.scopeDepth-t.scopeDepth;let i=0,r=0;for(;t.parentScopes[i]===">"&&i++,n.parentScopes[r]===">"&&r++,!(i>=t.parentScopes.length||r>=n.parentScopes.length);){const o=n.parentScopes[r].length-t.parentScopes[i].length;if(o!==0)return o;i++,r++}return n.parentScopes.length-t.parentScopes.length}match(t){if(t!==""){let i=t.indexOf("."),r,o;if(i===-1?(r=t,o=""):(r=t.substring(0,i),o=t.substring(i+1)),this._children.hasOwnProperty(r))return this._children[r].match(o)}const n=this._rulesWithParentScopes.concat(this._mainRule);return n.sort(Lr._cmpBySpecificity),n}insert(t,n,i,r,o,s){if(n===""){this._doInsertHere(t,i,r,o,s);return}let l=n.indexOf("."),a,d;l===-1?(a=n,d=""):(a=n.substring(0,l),d=n.substring(l+1));let c;this._children.hasOwnProperty(a)?c=this._children[a]:(c=new Lr(this._mainRule.clone(),xr.cloneArr(this._rulesWithParentScopes)),this._children[a]=c),c.insert(t+1,d,i,r,o,s)}_doInsertHere(t,n,i,r,o){if(n===null){this._mainRule.acceptOverwrite(t,i,r,o);return}for(let s=0,l=this._rulesWithParentScopes.length;s<l;s++){let a=this._rulesWithParentScopes[s];if(qa(a.parentScopes,n)===0){a.acceptOverwrite(t,i,r,o);return}}i===-1&&(i=this._mainRule.fontStyle),r===0&&(r=this._mainRule.foreground),o===0&&(o=this._mainRule.background),this._rulesWithParentScopes.push(new xr(t,n,i,r,o))}},Tt=class ge{static toBinaryStr(t){return t.toString(2).padStart(32,"0")}static print(t){const n=ge.getLanguageId(t),i=ge.getTokenType(t),r=ge.getFontStyle(t),o=ge.getForeground(t),s=ge.getBackground(t);console.log({languageId:n,tokenType:i,fontStyle:r,foreground:o,background:s})}static getLanguageId(t){return(t&255)>>>0}static getTokenType(t){return(t&768)>>>8}static containsBalancedBrackets(t){return(t&1024)!==0}static getFontStyle(t){return(t&30720)>>>11}static getForeground(t){return(t&16744448)>>>15}static getBackground(t){return(t&4278190080)>>>24}static set(t,n,i,r,o,s,l){let a=ge.getLanguageId(t),d=ge.getTokenType(t),c=ge.containsBalancedBrackets(t)?1:0,u=ge.getFontStyle(t),h=ge.getForeground(t),f=ge.getBackground(t);return n!==0&&(a=n),i!==8&&(d=i),r!==null&&(c=r?1:0),o!==-1&&(u=o),s!==0&&(h=s),l!==0&&(f=l),(a<<0|d<<8|c<<10|u<<11|h<<15|f<<24)>>>0}};function ei(e,t){const n=[],i=Gh(e);let r=i.next();for(;r!==null;){let a=0;if(r.length===2&&r.charAt(1)===":"){switch(r.charAt(0)){case"R":a=1;break;case"L":a=-1;break;default:console.log(`Unknown priority ${r} in scope selector`)}r=i.next()}let d=s();if(n.push({matcher:d,priority:a}),r!==",")break;r=i.next()}return n;function o(){if(r==="-"){r=i.next();const a=o();return d=>!!a&&!a(d)}if(r==="("){r=i.next();const a=l();return r===")"&&(r=i.next()),a}if(Go(r)){const a=[];do a.push(r),r=i.next();while(Go(r));return d=>t(a,d)}return null}function s(){const a=[];let d=o();for(;d;)a.push(d),d=o();return c=>a.every(u=>u(c))}function l(){const a=[];let d=s();for(;d&&(a.push(d),r==="|"||r===",");){do r=i.next();while(r==="|"||r===",");d=s()}return c=>a.some(u=>u(c))}}function Go(e){return!!e&&!!e.match(/[\w\.:]+/)}function Gh(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const i=n[0];return n=t.exec(e),i}}}function Ya(e){typeof e.dispose=="function"&&e.dispose()}var Zt=class{constructor(e){this.scopeName=e}toKey(){return this.scopeName}},Wh=class{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}},qh=class{_references=[];_seenReferenceKeys=new Set;get references(){return this._references}visitedRule=new Set;add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}},jh=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new Zt(this.initialScopeName)]}seenFullScopeRequests=new Set;seenPartialScopeRequests=new Set;Q;processQueue(){const e=this.Q;this.Q=[];const t=new qh;for(const n of e)Kh(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof Zt){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName)||this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};function Kh(e,t,n,i){const r=n.lookup(e.scopeName);if(!r){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const o=n.lookup(t);e instanceof Zt?Un({baseGrammar:o,selfGrammar:r},i):Tr(e.ruleName,{baseGrammar:o,selfGrammar:r,repository:r.repository},i);const s=n.injections(e.scopeName);if(s)for(const l of s)i.add(new Zt(l))}function Tr(e,t,n){if(t.repository&&t.repository[e]){const i=t.repository[e];ti([i],t,n)}}function Un(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&ti(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&ti(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function ti(e,t,n){for(const i of e){if(n.visitedRule.has(i))continue;n.visitedRule.add(i);const r=i.repository?Ua({},t.repository,i.repository):t.repository;Array.isArray(i.patterns)&&ti(i.patterns,{...t,repository:r},n);const o=i.include;if(!o)continue;const s=Ja(o);switch(s.kind){case 0:Un({...t,selfGrammar:t.baseGrammar},n);break;case 1:Un(t,n);break;case 2:Tr(s.ruleName,{...t,repository:r},n);break;case 3:case 4:const l=s.scopeName===t.selfGrammar.scopeName?t.selfGrammar:s.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(l){const a={baseGrammar:t.baseGrammar,selfGrammar:l,repository:r};s.kind===4?Tr(s.ruleName,a,n):Un(a,n)}else s.kind===4?n.add(new Wh(s.scopeName,s.ruleName)):n.add(new Zt(s.scopeName));break}}}var Xh=class{kind=0},Qh=class{kind=1},Yh=class{constructor(e){this.ruleName=e}kind=2},Jh=class{constructor(e){this.scopeName=e}kind=3},Zh=class{constructor(e,t){this.scopeName=e,this.ruleName=t}kind=4};function Ja(e){if(e==="$base")return new Xh;if(e==="$self")return new Qh;const t=e.indexOf("#");if(t===-1)return new Jh(e);if(t===0)return new Yh(e.substring(1));{const n=e.substring(0,t),i=e.substring(t+1);return new Zh(n,i)}}var ef=/\\(\d+)/,Wo=/\\(\d+)/g,tf=-1,Za=-2;var fn=class{$location;id;_nameIsCapturing;_name;_contentNameIsCapturing;_contentName;constructor(e,t,n,i){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=Sn.hasCaptures(this._name),this._contentName=i||null,this._contentNameIsCapturing=Sn.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${Ga(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return!this._nameIsCapturing||this._name===null||e===null||t===null?this._name:Sn.replaceCaptures(this._name,e,t)}getContentName(e,t){return!this._contentNameIsCapturing||this._contentName===null?this._contentName:Sn.replaceCaptures(this._contentName,e,t)}},nf=class extends fn{retokenizeCapturedWithRuleId;constructor(e,t,n,i,r){super(e,t,n,i),this.retokenizeCapturedWithRuleId=r}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,i){throw new Error("Not supported!")}},rf=class extends fn{_match;captures;_cachedCompiledPatterns;constructor(e,t,n,i,r){super(e,t,n,null),this._match=new en(i,this.id),this.captures=r,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new tn,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},qo=class extends fn{hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,i,r){super(e,t,n,i),this.patterns=r.patterns,this.hasMissingPatterns=r.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new tn,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}},Rr=class extends fn{_begin;beginCaptures;_end;endHasBackReferences;endCaptures;applyEndPatternLast;hasMissingPatterns;patterns;_cachedCompiledPatterns;constructor(e,t,n,i,r,o,s,l,a,d){super(e,t,n,i),this._begin=new en(r,this.id),this.beginCaptures=o,this._end=new en(s||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=l,this.applyEndPatternLast=a||!1,this.patterns=d.patterns,this.hasMissingPatterns=d.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,i)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new tn;for(const n of this.patterns)e.getRule(n).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}},ni=class extends fn{_begin;beginCaptures;whileCaptures;_while;whileHasBackReferences;hasMissingPatterns;patterns;_cachedCompiledPatterns;_cachedCompiledWhilePatterns;constructor(e,t,n,i,r,o,s,l,a){super(e,t,n,i),this._begin=new en(r,this.id),this.beginCaptures=o,this.whileCaptures=l,this._while=new en(s,Za),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=a.patterns,this.hasMissingPatterns=a.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,i){return this._getCachedCompiledPatterns(e).compileAG(e,n,i)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new tn;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,i){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,i)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new tn,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}},el=class oe{static createCaptureRule(t,n,i,r,o){return t.registerRule(s=>new nf(n,s,i,r,o))}static getCompiledRuleId(t,n,i){return t.id||n.registerRule(r=>{if(t.id=r,t.match)return new rf(t.$vscodeTextmateLocation,t.id,t.name,t.match,oe._compileCaptures(t.captures,n,i));if(typeof t.begin>"u"){t.repository&&(i=Ua({},i,t.repository));let o=t.patterns;return typeof o>"u"&&t.include&&(o=[{include:t.include}]),new qo(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,oe._compilePatterns(o,n,i))}return t.while?new ni(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,oe._compileCaptures(t.beginCaptures||t.captures,n,i),t.while,oe._compileCaptures(t.whileCaptures||t.captures,n,i),oe._compilePatterns(t.patterns,n,i)):new Rr(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,oe._compileCaptures(t.beginCaptures||t.captures,n,i),t.end,oe._compileCaptures(t.endCaptures||t.captures,n,i),t.applyEndPatternLast,oe._compilePatterns(t.patterns,n,i))}),t.id}static _compileCaptures(t,n,i){let r=[];if(t){let o=0;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const l=parseInt(s,10);l>o&&(o=l)}for(let s=0;s<=o;s++)r[s]=null;for(const s in t){if(s==="$vscodeTextmateLocation")continue;const l=parseInt(s,10);let a=0;t[s].patterns&&(a=oe.getCompiledRuleId(t[s],n,i)),r[l]=oe.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,a)}}return r}static _compilePatterns(t,n,i){let r=[];if(t)for(let o=0,s=t.length;o<s;o++){const l=t[o];let a=-1;if(l.include){const d=Ja(l.include);switch(d.kind){case 0:case 1:a=oe.getCompiledRuleId(i[l.include],n,i);break;case 2:let c=i[d.ruleName];c&&(a=oe.getCompiledRuleId(c,n,i));break;case 3:case 4:const u=d.scopeName,h=d.kind===4?d.ruleName:null,f=n.getExternalGrammar(u,i);if(f)if(h){let g=f.repository[h];g&&(a=oe.getCompiledRuleId(g,n,f.repository))}else a=oe.getCompiledRuleId(f.repository.$self,n,f.repository);break}}else a=oe.getCompiledRuleId(l,n,i);if(a!==-1){const d=n.getRule(a);let c=!1;if((d instanceof qo||d instanceof Rr||d instanceof ni)&&d.hasMissingPatterns&&d.patterns.length===0&&(c=!0),c)continue;r.push(a)}}return{patterns:r,hasMissingPatterns:(t?t.length:0)!==r.length}}},en=class tl{source;ruleId;hasAnchor;hasBackReferences;_anchorCache;constructor(t,n){if(t&&typeof t=="string"){const i=t.length;let r=0,o=[],s=!1;for(let l=0;l<i;l++)if(t.charAt(l)==="\\"&&l+1<i){const d=t.charAt(l+1);d==="z"?(o.push(t.substring(r,l)),o.push("$(?!\\n)(?<!\\n)"),r=l+2):(d==="A"||d==="G")&&(s=!0),l++}this.hasAnchor=s,r===0?this.source=t:(o.push(t.substring(r,i)),this.source=o.join(""))}else this.hasAnchor=!1,this.source=t;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=n,typeof this.source=="string"?this.hasBackReferences=ef.test(this.source):this.hasBackReferences=!1}clone(){return new tl(this.source,this.ruleId)}setSource(t){this.source!==t&&(this.source=t,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()))}resolveBackReferences(t,n){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let i=n.map(r=>t.substring(r.start,r.end));return Wo.lastIndex=0,this.source.replace(Wo,(r,o)=>ja(i[parseInt(o,10)]||""))}_buildAnchorCache(){if(typeof this.source!="string")throw new Error("This method should only be called if the source is a string");let t=[],n=[],i=[],r=[],o,s,l,a;for(o=0,s=this.source.length;o<s;o++)l=this.source.charAt(o),t[o]=l,n[o]=l,i[o]=l,r[o]=l,l==="\\"&&o+1<s&&(a=this.source.charAt(o+1),a==="A"?(t[o+1]="￿",n[o+1]="￿",i[o+1]="A",r[o+1]="A"):a==="G"?(t[o+1]="￿",n[o+1]="G",i[o+1]="￿",r[o+1]="G"):(t[o+1]=a,n[o+1]=a,i[o+1]=a,r[o+1]=a),o++);return{A0_G0:t.join(""),A0_G1:n.join(""),A1_G0:i.join(""),A1_G1:r.join("")}}resolveAnchors(t,n){return!this.hasAnchor||!this._anchorCache||typeof this.source!="string"?this.source:t?n?this._anchorCache.A1_G1:this._anchorCache.A1_G0:n?this._anchorCache.A0_G1:this._anchorCache.A0_G0}},tn=class{_items;_hasAnchors;_cached;_anchorCache;constructor(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null}}dispose(){this._disposeCaches()}_disposeCaches(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null)}push(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}unshift(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor}length(){return this._items.length}setSource(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t))}compile(e){if(!this._cached){let t=this._items.map(n=>n.source);this._cached=new jo(e,t,this._items.map(n=>n.ruleId))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let i=this._items.map(r=>r.resolveAnchors(t,n));return new jo(e,i,this._items.map(r=>r.ruleId))}},jo=class{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}scanner;dispose(){typeof this.scanner.dispose=="function"&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t<n;t++)e.push(" - "+this.rules[t]+": "+this.regExps[t]);return e.join(`
11
+ `)}findNextMatchSync(e,t,n){const i=this.scanner.findNextMatchSync(e,t,n);return i?{ruleId:this.rules[i.index],captureIndices:i.captureIndices}:null}},Ui=class{constructor(e,t){this.languageId=e,this.tokenType=t}},of=class Ar{_defaultAttributes;_embeddedLanguagesMatcher;constructor(t,n){this._defaultAttributes=new Ui(t,8),this._embeddedLanguagesMatcher=new sf(Object.entries(n||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(t){return t===null?Ar._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(t)}static _NULL_SCOPE_METADATA=new Ui(0,0);_getBasicScopeAttributes=new Ka(t=>{const n=this._scopeToLanguage(t),i=this._toStandardTokenType(t);return new Ui(n,i)});_scopeToLanguage(t){return this._embeddedLanguagesMatcher.match(t)||0}_toStandardTokenType(t){const n=t.match(Ar.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 8;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}static STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/},sf=class{values;scopesRegExp;constructor(e){if(e.length===0)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map(([n,i])=>ja(n));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);if(t)return this.values.get(t[1])}},Ko=class{constructor(e,t){this.stack=e,this.stoppedEarly=t}};function nl(e,t,n,i,r,o,s,l){const a=t.content.length;let d=!1,c=-1;if(s){const f=af(e,t,n,i,r,o);r=f.stack,i=f.linePos,n=f.isFirstLine,c=f.anchorPosition}const u=Date.now();for(;!d;){if(l!==0&&Date.now()-u>l)return new Ko(r,!0);h()}return new Ko(r,!1);function h(){const f=lf(e,t,n,i,r,c);if(!f){o.produce(r,a),d=!0;return}const g=f.captureIndices,y=f.matchedRuleId,_=g&&g.length>0?g[0].end>i:!1;if(y===tf){const b=r.getRule(e);o.produce(r,g[0].start),r=r.withContentNameScopesList(r.nameScopesList),zt(e,t,n,r,o,b.endCaptures,g),o.produce(r,g[0].end);const p=r;if(r=r.parent,c=p.getAnchorPos(),!_&&p.getEnterPos()===i){r=p,o.produce(r,a),d=!0;return}}else{const b=e.getRule(y);o.produce(r,g[0].start);const p=r,v=b.getName(t.content,g),w=r.contentNameScopesList.pushAttributed(v,e);if(r=r.push(y,i,c,g[0].end===a,null,w,w),b instanceof Rr){const S=b;zt(e,t,n,r,o,S.beginCaptures,g),o.produce(r,g[0].end),c=g[0].end;const k=S.getContentName(t.content,g),E=w.pushAttributed(k,e);if(r=r.withContentNameScopesList(E),S.endHasBackReferences&&(r=r.withEndRule(S.getEndWithResolvedBackReferences(t.content,g))),!_&&p.hasSameRuleAs(r)){r=r.pop(),o.produce(r,a),d=!0;return}}else if(b instanceof ni){const S=b;zt(e,t,n,r,o,S.beginCaptures,g),o.produce(r,g[0].end),c=g[0].end;const k=S.getContentName(t.content,g),E=w.pushAttributed(k,e);if(r=r.withContentNameScopesList(E),S.whileHasBackReferences&&(r=r.withEndRule(S.getWhileWithResolvedBackReferences(t.content,g))),!_&&p.hasSameRuleAs(r)){r=r.pop(),o.produce(r,a),d=!0;return}}else if(zt(e,t,n,r,o,b.captures,g),o.produce(r,g[0].end),r=r.pop(),!_){r=r.safePop(),o.produce(r,a),d=!0;return}}g[0].end>i&&(i=g[0].end,n=!1)}}function af(e,t,n,i,r,o){let s=r.beginRuleCapturedEOL?0:-1;const l=[];for(let a=r;a;a=a.pop()){const d=a.getRule(e);d instanceof ni&&l.push({rule:d,stack:a})}for(let a=l.pop();a;a=l.pop()){const{ruleScanner:d,findOptions:c}=uf(a.rule,e,a.stack.endRule,n,i===s),u=d.findNextMatchSync(t,i,c);if(u){if(u.ruleId!==Za){r=a.stack.pop();break}u.captureIndices&&u.captureIndices.length&&(o.produce(a.stack,u.captureIndices[0].start),zt(e,t,n,a.stack,o,a.rule.whileCaptures,u.captureIndices),o.produce(a.stack,u.captureIndices[0].end),s=u.captureIndices[0].end,u.captureIndices[0].end>i&&(i=u.captureIndices[0].end,n=!1))}else{r=a.stack.pop();break}}return{stack:r,linePos:i,anchorPosition:s,isFirstLine:n}}function lf(e,t,n,i,r,o){const s=df(e,t,n,i,r,o),l=e.getInjections();if(l.length===0)return s;const a=cf(l,e,t,n,i,r,o);if(!a)return s;if(!s)return a;const d=s.captureIndices[0].start,c=a.captureIndices[0].start;return c<d||a.priorityMatch&&c===d?a:s}function df(e,t,n,i,r,o){const s=r.getRule(e),{ruleScanner:l,findOptions:a}=il(s,e,r.endRule,n,i===o),d=l.findNextMatchSync(t,i,a);return d?{captureIndices:d.captureIndices,matchedRuleId:d.ruleId}:null}function cf(e,t,n,i,r,o,s){let l=Number.MAX_VALUE,a=null,d,c=0;const u=o.contentNameScopesList.getScopeNames();for(let h=0,f=e.length;h<f;h++){const g=e[h];if(!g.matcher(u))continue;const y=t.getRule(g.ruleId),{ruleScanner:_,findOptions:b}=il(y,t,null,i,r===s),p=_.findNextMatchSync(n,r,b);if(!p)continue;const v=p.captureIndices[0].start;if(!(v>=l)&&(l=v,a=p.captureIndices,d=p.ruleId,c=g.priority,l===r))break}return a?{priorityMatch:c===-1,captureIndices:a,matchedRuleId:d}:null}function il(e,t,n,i,r){return{ruleScanner:e.compileAG(t,n,i,r),findOptions:0}}function uf(e,t,n,i,r){return{ruleScanner:e.compileWhileAG(t,n,i,r),findOptions:0}}function zt(e,t,n,i,r,o,s){if(o.length===0)return;const l=t.content,a=Math.min(o.length,s.length),d=[],c=s[0].end;for(let u=0;u<a;u++){const h=o[u];if(h===null)continue;const f=s[u];if(f.length===0)continue;if(f.start>c)break;for(;d.length>0&&d[d.length-1].endPos<=f.start;)r.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop();if(d.length>0?r.produceFromScopes(d[d.length-1].scopes,f.start):r.produce(i,f.start),h.retokenizeCapturedWithRuleId){const y=h.getName(l,s),_=i.contentNameScopesList.pushAttributed(y,e),b=h.getContentName(l,s),p=_.pushAttributed(b,e),v=i.push(h.retokenizeCapturedWithRuleId,f.start,-1,!1,null,_,p),w=e.createOnigString(l.substring(0,f.end));nl(e,w,n&&f.start===0,f.start,v,r,!1,0),Ya(w);continue}const g=h.getName(l,s);if(g!==null){const _=(d.length>0?d[d.length-1].scopes:i.contentNameScopesList).pushAttributed(g,e);d.push(new hf(_,f.end))}}for(;d.length>0;)r.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop()}var hf=class{scopes;endPos;constructor(e,t){this.scopes=e,this.endPos=t}};function ff(e,t,n,i,r,o,s,l){return new mf(e,t,n,i,r,o,s,l)}function Xo(e,t,n,i,r){const o=ei(t,ii),s=el.getCompiledRuleId(n,i,r.repository);for(const l of o)e.push({debugSelector:t,matcher:l.matcher,ruleId:s,grammar:r,priority:l.priority})}function ii(e,t){if(t.length<e.length)return!1;let n=0;return e.every(i=>{for(let r=n;r<t.length;r++)if(pf(t[r],i))return n=r+1,!0;return!1})}function pf(e,t){if(!e)return!1;if(e===t)return!0;const n=t.length;return e.length>n&&e.substr(0,n)===t&&e[n]==="."}var mf=class{constructor(e,t,n,i,r,o,s,l){if(this._rootScopeName=e,this.balancedBracketSelectors=o,this._onigLib=l,this._basicScopeAttributesProvider=new of(n,i),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=Qo(t,null),this._injections=null,this._tokenTypeMatchers=[],r)for(const a of Object.keys(r)){const d=ei(a,ii);for(const c of d)this._tokenTypeMatchers.push({matcher:c.matcher,type:r[a]})}}_rootId;_lastRuleId;_ruleId2desc;_includedGrammars;_grammarRepository;_grammar;_injections;_basicScopeAttributesProvider;_tokenTypeMatchers;get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e={lookup:r=>r===this._rootScopeName?this._grammar:this.getExternalGrammar(r),injections:r=>this._grammarRepository.injections(r)},t=[],n=this._rootScopeName,i=e.lookup(n);if(i){const r=i.injections;if(r)for(let s in r)Xo(t,s,r[s],this,i);const o=this._grammarRepository.injections(n);o&&o.forEach(s=>{const l=this.getExternalGrammar(s);if(l){const a=l.injectionSelector;a&&Xo(t,a,l,this,l)}})}return t.sort((r,o)=>r.priority-o.priority),t}getInjections(){return this._injections===null&&(this._injections=this._collectInjections()),this._injections}registerRule(e){const t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[e]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=Qo(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const i=this._tokenize(e,t,!1,n);return{tokens:i.lineTokens.getResult(i.ruleStack,i.lineLength),ruleStack:i.ruleStack,stoppedEarly:i.stoppedEarly}}tokenizeLine2(e,t,n=0){const i=this._tokenize(e,t,!0,n);return{tokens:i.lineTokens.getBinaryResult(i.ruleStack,i.lineLength),ruleStack:i.ruleStack,stoppedEarly:i.stoppedEarly}}_tokenize(e,t,n,i){this._rootId===-1&&(this._rootId=el.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository),this.getInjections());let r;if(!t||t===Ir.NULL){r=!0;const d=this._basicScopeAttributesProvider.getDefaultAttributes(),c=this.themeProvider.getDefaults(),u=Tt.set(0,d.languageId,d.tokenType,null,c.fontStyle,c.foregroundId,c.backgroundId),h=this.getRule(this._rootId).getName(null,null);let f;h?f=Gt.createRootAndLookUpScopeName(h,u,this):f=Gt.createRoot("unknown",u),t=new Ir(null,this._rootId,-1,-1,!1,null,f,f)}else r=!1,t.reset();e=e+`
12
+ `;const o=this.createOnigString(e),s=o.content.length,l=new bf(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),a=nl(this,o,r,0,t,l,!0,i);return Ya(o),{lineLength:s,lineTokens:l,ruleStack:a.stack,stoppedEarly:a.stoppedEarly}}};function Qo(e,t){return e=Dh(e),e.repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}var Gt=class Ae{constructor(t,n,i){this.parent=t,this.scopePath=n,this.tokenAttributes=i}static fromExtension(t,n){let i=t,r=t?.scopePath??null;for(const o of n)r=Bi.push(r,o.scopeNames),i=new Ae(i,r,o.encodedTokenAttributes);return i}static createRoot(t,n){return new Ae(null,new Bi(null,t),n)}static createRootAndLookUpScopeName(t,n,i){const r=i.getMetadataForScope(t),o=new Bi(null,t),s=i.themeProvider.themeMatch(o),l=Ae.mergeAttributes(n,r,s);return new Ae(null,o,l)}get scopeName(){return this.scopePath.scopeName}toString(){return this.getScopeNames().join(" ")}equals(t){return Ae.equals(this,t)}static equals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.scopeName!==n.scopeName||t.tokenAttributes!==n.tokenAttributes)return!1;t=t.parent,n=n.parent}while(!0)}static mergeAttributes(t,n,i){let r=-1,o=0,s=0;return i!==null&&(r=i.fontStyle,o=i.foregroundId,s=i.backgroundId),Tt.set(t,n.languageId,n.tokenType,null,r,o,s)}pushAttributed(t,n){if(t===null)return this;if(t.indexOf(" ")===-1)return Ae._pushAttributed(this,t,n);const i=t.split(/ /g);let r=this;for(const o of i)r=Ae._pushAttributed(r,o,n);return r}static _pushAttributed(t,n,i){const r=i.getMetadataForScope(n),o=t.scopePath.push(n),s=i.themeProvider.themeMatch(o),l=Ae.mergeAttributes(t.tokenAttributes,r,s);return new Ae(t,o,l)}getScopeNames(){return this.scopePath.getSegments()}getExtensionIfDefined(t){const n=[];let i=this;for(;i&&i!==t;)n.push({encodedTokenAttributes:i.tokenAttributes,scopeNames:i.scopePath.getExtensionIfDefined(i.parent?.scopePath??null)}),i=i.parent;return i===t?n.reverse():void 0}},Ir=class ot{constructor(t,n,i,r,o,s,l,a){this.parent=t,this.ruleId=n,this.beginRuleCapturedEOL=o,this.endRule=s,this.nameScopesList=l,this.contentNameScopesList=a,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=i,this._anchorPos=r}_stackElementBrand=void 0;static NULL=new ot(null,0,0,0,!1,null,null,null);_enterPos;_anchorPos;depth;equals(t){return t===null?!1:ot._equals(this,t)}static _equals(t,n){return t===n?!0:this._structuralEquals(t,n)?Gt.equals(t.contentNameScopesList,n.contentNameScopesList):!1}static _structuralEquals(t,n){do{if(t===n||!t&&!n)return!0;if(!t||!n||t.depth!==n.depth||t.ruleId!==n.ruleId||t.endRule!==n.endRule)return!1;t=t.parent,n=n.parent}while(!0)}clone(){return this}static _reset(t){for(;t;)t._enterPos=-1,t._anchorPos=-1,t=t.parent}reset(){ot._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(t,n,i,r,o,s,l){return new ot(this,t,n,i,r,o,s,l)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(t){return t.getRule(this.ruleId)}toString(){const t=[];return this._writeString(t,0),"["+t.join(",")+"]"}_writeString(t,n){return this.parent&&(n=this.parent._writeString(t,n)),t[n++]=`(${this.ruleId}, ${this.nameScopesList?.toString()}, ${this.contentNameScopesList?.toString()})`,n}withContentNameScopesList(t){return this.contentNameScopesList===t?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,t)}withEndRule(t){return this.endRule===t?this:new ot(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(t){let n=this;for(;n&&n._enterPos===t._enterPos;){if(n.ruleId===t.ruleId)return!0;n=n.parent}return!1}toStateStackFrame(){return{ruleId:this.ruleId,beginRuleCapturedEOL:this.beginRuleCapturedEOL,endRule:this.endRule,nameScopesList:this.nameScopesList?.getExtensionIfDefined(this.parent?.nameScopesList??null)??[],contentNameScopesList:this.contentNameScopesList?.getExtensionIfDefined(this.nameScopesList)??[]}}static pushFrame(t,n){const i=Gt.fromExtension(t?.nameScopesList??null,n.nameScopesList);return new ot(t,n.ruleId,n.enterPos??-1,n.anchorPos??-1,n.beginRuleCapturedEOL,n.endRule,i,Gt.fromExtension(i,n.contentNameScopesList))}},gf=class{balancedBracketScopes;unbalancedBracketScopes;allowAny=!1;constructor(e,t){this.balancedBracketScopes=e.flatMap(n=>n==="*"?(this.allowAny=!0,[]):ei(n,ii).map(i=>i.matcher)),this.unbalancedBracketScopes=t.flatMap(n=>ei(n,ii).map(i=>i.matcher))}get matchesAlways(){return this.allowAny&&this.unbalancedBracketScopes.length===0}get matchesNever(){return this.balancedBracketScopes.length===0&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}},bf=class{constructor(e,t,n,i){this.balancedBracketSelectors=i,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}_emitBinaryTokens;_lineText;_tokens;_binaryTokens;_lastTokenEndIndex;_tokenTypeOverrides;produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let i=e?.tokenAttributes??0,r=!1;if(this.balancedBracketSelectors?.matchesAlways&&(r=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const o=e?.getScopeNames()??[];for(const s of this._tokenTypeOverrides)s.matcher(o)&&(i=Tt.set(i,0,s.type,null,-1,0,0));this.balancedBracketSelectors&&(r=this.balancedBracketSelectors.match(o))}if(r&&(i=Tt.set(i,0,8,r,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===i){this._lastTokenEndIndex=t;return}this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(i),this._lastTokenEndIndex=t;return}const n=e?.getScopeNames()??[];this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:n}),this._lastTokenEndIndex=t}getResult(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),this._tokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),this._binaryTokens.length===0&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let i=0,r=this._binaryTokens.length;i<r;i++)n[i]=this._binaryTokens[i];return n}},vf=class{constructor(e,t){this._onigLib=t,this._theme=e}_grammars=new Map;_rawGrammars=new Map;_injectionGrammars=new Map;_theme;dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}grammarForScopeName(e,t,n,i,r){if(!this._grammars.has(e)){let o=this._rawGrammars.get(e);if(!o)return null;this._grammars.set(e,ff(e,o,t,n,i,r,this,this._onigLib))}return this._grammars.get(e)}},yf=class{_options;_syncRegistry;_ensureGrammarCache;constructor(t){this._options=t,this._syncRegistry=new vf(Zn.createFromRawTheme(t.theme,t.colorMap),t.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(t,n){this._syncRegistry.setTheme(Zn.createFromRawTheme(t,n))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(t,n,i){return this.loadGrammarWithConfiguration(t,n,{embeddedLanguages:i})}loadGrammarWithConfiguration(t,n,i){return this._loadGrammar(t,n,i.embeddedLanguages,i.tokenTypes,new gf(i.balancedBracketSelectors||[],i.unbalancedBracketSelectors||[]))}loadGrammar(t){return this._loadGrammar(t,0,null,null,null)}_loadGrammar(t,n,i,r,o){const s=new jh(this._syncRegistry,t);for(;s.Q.length>0;)s.Q.map(l=>this._loadSingleGrammar(l.scopeName)),s.processQueue();return this._grammarForScopeName(t,n,i,r,o)}_loadSingleGrammar(t){this._ensureGrammarCache.has(t)||(this._doLoadSingleGrammar(t),this._ensureGrammarCache.set(t,!0))}_doLoadSingleGrammar(t){const n=this._options.loadGrammar(t);if(n){const i=typeof this._options.getInjections=="function"?this._options.getInjections(t):void 0;this._syncRegistry.addGrammar(n,i)}}addGrammar(t,n=[],i=0,r=null){return this._syncRegistry.addGrammar(t,n),this._grammarForScopeName(t.scopeName,i,r)}_grammarForScopeName(t,n=0,i=null,r=null,o=null){return this._syncRegistry.grammarForScopeName(t,n,i,r,o)}},Pr=Ir.NULL;function ri(e,t){const n=typeof e=="string"?{}:{...e.colorReplacements},i=typeof e=="string"?e:e.name;for(const[r,o]of Object.entries(t?.colorReplacements||{}))typeof o=="string"?n[r]=o:r===i&&Object.assign(n,o);return n}function et(e,t){return e&&(t?.[e?.toLowerCase()]||e)}function _f(e){return Array.isArray(e)?e:[e]}async function rl(e){return Promise.resolve(typeof e=="function"?e():e).then(t=>t.default||t)}function wi(e){return!e||["plaintext","txt","text","plain"].includes(e)}function ol(e){return e==="ansi"||wi(e)}function Si(e){return e==="none"}function sl(e){return Si(e)}const wf=/(\r?\n)/g;function Ci(e,t=!1){if(e.length===0)return[["",0]];const n=e.split(wf);let i=0;const r=[];for(let o=0;o<n.length;o+=2){const s=t?n[o]+(n[o+1]||""):n[o];r.push([s,i]),i+=n[o].length,i+=n[o+1]?.length||0}return r}const Yo={light:"#333333",dark:"#bbbbbb"},Jo={light:"#fffffe",dark:"#1e1e1e"},Zo="__shiki_resolved";function ki(e){if(e?.[Zo])return e;const t={...e};t.tokenColors&&!t.settings&&(t.settings=t.tokenColors,delete t.tokenColors),t.type||="dark",t.colorReplacements={...t.colorReplacements},t.settings||=[];let{bg:n,fg:i}=t;if(!n||!i){const l=t.settings?t.settings.find(a=>!a.name&&!a.scope):void 0;l?.settings?.foreground&&(i=l.settings.foreground),l?.settings?.background&&(n=l.settings.background),!i&&t?.colors?.["editor.foreground"]&&(i=t.colors["editor.foreground"]),!n&&t?.colors?.["editor.background"]&&(n=t.colors["editor.background"]),i||(i=t.type==="light"?Yo.light:Yo.dark),n||(n=t.type==="light"?Jo.light:Jo.dark),t.fg=i,t.bg=n}t.settings[0]&&t.settings[0].settings&&!t.settings[0].scope||t.settings.unshift({settings:{foreground:t.fg,background:t.bg}});let 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 c={...l,settings:{...l.settings}};if(a){const u=s(l.settings.foreground);t.colorReplacements[u]=l.settings.foreground,c.settings.foreground=u}if(d){const u=s(l.settings.background);t.colorReplacements[u]=l.settings.background,c.settings.background=u}return c});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,Zo,{enumerable:!1,writable:!1,value:!0}),t}async function al(e){return[...new Set((await Promise.all(e.filter(t=>!ol(t)).map(async t=>await rl(t).then(n=>Array.isArray(n)?n:[n])))).flat())]}async function ll(e){return(await Promise.all(e.map(async t=>sl(t)?null:ki(await rl(t))))).filter(t=>!!t)}function dl(e,t){if(!t)return e;if(t[e]){const n=new Set([e]);for(;t[e];){if(e=t[e],n.has(e))throw new U(`Circular alias \`${[...n].join(" -> ")} -> ${e}\``);n.add(e)}}return e}var Sf=class extends yf{_resolver;_themes;_langs;_alias;_resolvedThemes=new Map;_resolvedGrammars=new Map;_langMap=new Map;_langGraph=new Map;_textmateThemeCache=new WeakMap;_loadedThemesCache=null;_loadedLanguagesCache=null;constructor(e,t,n,i={}){super(e),this._resolver=e,this._themes=t,this._langs=n,this._alias=i,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=ki(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=Zn.createFromRawTheme(e),this._textmateThemeCache.set(e,t)),this._syncRegistry.setTheme(t)}getGrammar(e){return e=dl(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 n={balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]};this._syncRegistry._rawGrammars.set(e.scopeName,e);const i=this.loadGrammarWithConfiguration(e.scopeName,1,n);if(i.name=e.name,this._resolvedGrammars.set(e.name,i),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 i of e)this.resolveEmbeddedLanguages(i);const t=[...this._langGraph.entries()],n=t.filter(([i,r])=>!r);if(n.length){const i=t.filter(([r,o])=>o?(o.embeddedLanguages||o.embeddedLangs)?.some(s=>n.map(([l])=>l).includes(s)):!1).filter(r=>!n.includes(r));throw new U(`Missing languages ${n.map(([r])=>`\`${r}\``).join(", ")}, required by ${i.map(([r])=>`\`${r}\``).join(", ")}`)}for(const[i,r]of t)this._resolver.addLanguage(r);for(const[i,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 n of t)this._langGraph.set(n,this._langMap.get(n))}},Cf=class{_langs=new Map;_scopeToLang=new Map;_injections=new Map;_onigLib;constructor(e,t){this._onigLib={createOnigScanner:n=>e.createScanner(n),createOnigString:n=>e.createString(n)},t.forEach(n=>this.addLanguage(n))}get onigLib(){return this._onigLib}getLangRegistration(e){return this._langs.get(e)}loadGrammar(e){return this._scopeToLang.get(e)}addLanguage(e){this._langs.set(e.name,e),e.aliases&&e.aliases.forEach(t=>{this._langs.set(t,e)}),this._scopeToLang.set(e.scopeName,e),e.injectTo&&e.injectTo.forEach(t=>{this._injections.get(t)||this._injections.set(t,[]),this._injections.get(t).push(e.scopeName)})}getInjections(e){const t=e.split(".");let n=[];for(let i=1;i<=t.length;i++){const r=t.slice(0,i).join(".");n=[...n,...this._injections.get(r)||[]]}return n}};let Mt=0;function kf(e){Mt+=1,e.warnings!==!1&&Mt>=10&&Mt%10===0&&console.warn(`[Shiki] ${Mt} 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 U("`engine` option is required for synchronous mode");const n=(e.langs||[]).flat(1),i=(e.themes||[]).flat(1).map(ki),r=new Sf(new Cf(e.engine,n),i,n,e.langAlias);let o;function s(p){return dl(p,e.langAlias)}function l(p){_();const v=r.getGrammar(typeof p=="string"?p:p.name);if(!v)throw new U(`Language \`${p}\` not found, you may need to load it first`);return v}function a(p){if(p==="none")return{bg:"",fg:"",name:"none",settings:[],type:"dark"};_();const v=r.getTheme(p);if(!v)throw new U(`Theme \`${p}\` not found, you may need to load it first`);return v}function d(p){_();const v=a(p);return o!==p&&(r.setTheme(v),o=p),{theme:v,colorMap:r.getColorMap()}}function c(){return _(),r.getLoadedThemes()}function u(){return _(),r.getLoadedLanguages()}function h(...p){_(),r.loadLanguages(p.flat(1))}async function f(...p){return h(await al(p))}function g(...p){_();for(const v of p.flat(1))r.loadTheme(v)}async function y(...p){return _(),g(await ll(p))}function _(){if(t)throw new U("Shiki instance has been disposed")}function b(){t||(t=!0,r.dispose(),Mt-=1)}return{setTheme:d,getTheme:a,getLanguage:l,getLoadedThemes:c,getLoadedLanguages:u,resolveLangAlias:s,loadLanguage:f,loadLanguageSync:h,loadTheme:y,loadThemeSync:g,dispose:b,[Symbol.dispose]:b}}async function Ef(e){e.engine||console.warn("`engine` option is required. Use `createOnigurumaEngine` or `createJavaScriptRegexEngine` to create an engine.");const[t,n,i]=await Promise.all([ll(e.themes||[]),al(e.langs||[]),e.engine]);return kf({...e,themes:t,langs:n,engine:i})}const cl=new WeakMap;function Ei(e,t){cl.set(e,t)}function nn(e){return cl.get(e)}var xi=class ul{_stacks={};lang;get themes(){return Object.keys(this._stacks)}get theme(){return this.themes[0]}get _stack(){return this._stacks[this.theme]}static initial(t,n){return new ul(Object.fromEntries(_f(n).map(i=>[i,Pr])),t)}constructor(...t){if(t.length===2){const[n,i]=t;this.lang=i,this._stacks=n}else{const[n,i,r]=t;this.lang=i,this._stacks={[r]:n}}}getInternalStack(t=this.theme){return this._stacks[t]}getScopes(t=this.theme){return xf(this._stacks[t])}toJSON(){return{lang:this.lang,theme:this.theme,themes:this.themes,scopes:this.getScopes()}}};function xf(e){const t=[],n=new Set;function i(r){if(n.has(r))return;n.add(r);const o=r?.nameScopesList?.scopeName;o&&t.push(o),r.parent&&i(r.parent)}return i(e),t}function Lf(e,t){if(!(e instanceof xi))throw new U("Invalid grammar state");return e.getInternalStack(t)}const Tf=/,/,Rf=/ /;function hl(e,t,n={}){const{theme:i=e.getLoadedThemes()[0]}=n;if(wi(e.resolveLangAlias(n.lang||"text"))||Si(i))return Ci(t).map(l=>[{content:l[0],offset:l[1]}]);const{theme:r,colorMap:o}=e.setTheme(i),s=e.getLanguage(n.lang||"text");if(n.grammarState){if(n.grammarState.lang!==s.name)throw new U(`Grammar state language "${n.grammarState.lang}" does not match highlight language "${s.name}"`);if(!n.grammarState.themes.includes(r.name))throw new U(`Grammar state themes "${n.grammarState.themes}" do not contain highlight theme "${r.name}"`)}return If(t,s,r,o,n)}function Af(...e){if(e.length===2)return nn(e[1]);const[t,n,i={}]=e,{lang:r="text",theme:o=t.getLoadedThemes()[0]}=i;if(wi(r)||Si(o))throw new U("Plain language does not have grammar state");if(r==="ansi")throw new U("ANSI language does not have grammar state");const{theme:s,colorMap:l}=t.setTheme(o),a=t.getLanguage(r);return new xi(go(n,a,s,l,i).stateStack,a.name,s.name)}function If(e,t,n,i,r){const o=go(e,t,n,i,r),s=new xi(o.stateStack,t.name,n.name);return Ei(o.tokens,s),o.tokens}function go(e,t,n,i,r){const o=ri(n,r),{tokenizeMaxLineLength:s=0,tokenizeTimeLimit:l=500}=r,a=Ci(e);let d=r.grammarState?Lf(r.grammarState,n.name)??Pr:r.grammarContextCode!=null?go(r.grammarContextCode,t,n,i,{...r,grammarState:void 0,grammarContextCode:void 0}).stateStack:Pr,c=[];const u=[];for(let h=0,f=a.length;h<f;h++){const[g,y]=a[h];if(g===""){c=[],u.push([]);continue}if(s>0&&g.length>=s){c=[],u.push([{content:g,offset:y,color:"",fontStyle:0}]);continue}let _,b,p;r.includeExplanation&&(_=t.tokenizeLine(g,d,l),b=_.tokens,p=0);const v=t.tokenizeLine2(g,d,l),w=v.tokens.length/2;for(let S=0;S<w;S++){const k=v.tokens[2*S],E=S+1<w?v.tokens[2*S+2]:g.length;if(k===E)continue;const C=v.tokens[2*S+1],x=et(i[Tt.getForeground(C)],o),I=Tt.getFontStyle(C),P={content:g.substring(k,E),offset:y+k,color:x,fontStyle:I};if(r.includeExplanation){const A=[];if(r.includeExplanation!=="scopeName")for(const R of n.settings){let D;switch(typeof R.scope){case"string":D=R.scope.split(Tf).map(H=>H.trim());break;case"object":D=R.scope;break;default:continue}A.push({settings:R,selectors:D.map(H=>H.split(Rf))})}P.explanation=[];let L=0;for(;k+L<E;){const R=b[p],D=g.substring(R.startIndex,R.endIndex);L+=D.length,P.explanation.push({content:D,scopes:r.includeExplanation==="scopeName"?Pf(R.scopes):Df(A,R.scopes)}),p+=1}}c.push(P)}u.push(c),c=[],d=v.ruleStack}return{tokens:u,stateStack:d}}function Pf(e){return e.map(t=>({scopeName:t}))}function Df(e,t){const n=[];for(let i=0,r=t.length;i<r;i++){const o=t[i];n[i]={scopeName:o,themeMatches:Of(e,o,t.slice(0,i))}}return n}function es(e,t){return e===t||t.substring(0,e.length)===e&&t[e.length]==="."}function Mf(e,t,n){if(!es(e.at(-1),t))return!1;let i=e.length-2,r=n.length-1;for(;i>=0&&r>=0;)es(e[i],n[r])&&(i-=1),r-=1;return i===-1}function Of(e,t,n){const i=[];for(const{selectors:r,settings:o}of e)for(const s of r)if(Mf(s,t,n)){i.push(o);break}return i}function fl(e,t,n,i=hl){const r=Object.entries(n.themes).filter(d=>d[1]).map(d=>({color:d[0],theme:d[1]})),o=r.map(d=>{const c=i(e,t,{...n,theme:d.theme});return{tokens:c,state:nn(c),theme:typeof d.theme=="string"?d.theme:d.theme.name}}),s=Nf(...o.map(d=>d.tokens)),l=s[0].map((d,c)=>d.map((u,h)=>{const f={content:u.content,variants:{},offset:u.offset};return"includeExplanation"in n&&n.includeExplanation&&(f.explanation=u.explanation),s.forEach((g,y)=>{const{content:_,explanation:b,offset:p,...v}=g[c][h];f.variants[r[y].color]=v}),f})),a=o[0].state?new xi(Object.fromEntries(o.map(d=>[d.theme,d.state?.getInternalStack(d.theme)])),o[0].state.lang):void 0;return a&&Ei(l,a),l}function Nf(...e){const t=e.map(()=>[]),n=e.length;for(let i=0;i<e[0].length;i++){const r=e.map(a=>a[i]),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<n;d++){const c=l[d];c.content.length===a?(o[d].push(c),s[d]+=1,l[d]=r[d][s[d]]):(o[d].push({...c,content:c.content.slice(0,a)}),l[d]={...c,content:c.content.slice(a),offset:c.offset+a})}}}return t}const ts=/\s+/g;function pl(e,t){if(!t)return e;e.properties||={},e.properties.class||=[],typeof e.properties.class=="string"&&(e.properties.class=e.properties.class.split(ts)),Array.isArray(e.properties.class)||(e.properties.class=[]);const n=Array.isArray(t)?t:t.split(ts);for(const i of n)i&&!e.properties.class.includes(i)&&e.properties.class.push(i);return e}const Hf=/:?lang=["']([^"']+)["']/g,Vf=/(?:```|~~~)([\w-]+)/g,zf=/\\begin\{([\w-]+)\}/g,$f=/<script\s+(?:type|lang)=["']([^"']+)["']/gi;function Ff(e){const t=Ci(e,!0).map(([r])=>r);function n(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 i(r,o){let s=0;for(let l=0;l<r;l++)s+=t[l].length;return s+=o,s}return{lines:t,indexToPos:n,posToIndex:i}}function Bf(e,t,n){const i=new Set;for(const o of e.matchAll(Hf)){const s=o[1].toLowerCase().trim();s&&i.add(s)}for(const o of e.matchAll(Vf)){const s=o[1].toLowerCase().trim();s&&i.add(s)}for(const o of e.matchAll(zf)){const s=o[1].toLowerCase().trim();s&&i.add(s)}for(const o of e.matchAll($f)){const s=o[1].toLowerCase().trim(),l=s.includes("/")?s.split("/").pop():s;l&&i.add(l)}if(!n)return[...i];const r=n.getBundledLanguages();return[...i].filter(o=>o&&r[o])}const Uf=["color","background-color"];function Gf(e,t){let n=0;const i=[];for(const r of t)r>n&&i.push({...e,content:e.content.slice(n,r),offset:e.offset+n}),n=r;return n<e.content.length&&i.push({...e,content:e.content.slice(n),offset:e.offset+n}),i}function Wf(e,t){const n=[...t instanceof Set?t:new Set(t)].sort((i,r)=>i-r);return n.length?e.map(i=>i.flatMap(r=>{const o=n.filter(s=>r.offset<s&&s<r.offset+r.content.length).map(s=>s-r.offset).sort((s,l)=>s-l);return o.length?Gf(r,o):r})):e}function qf(e,t,n,i,r="css-vars"){const o={content:e.content,explanation:e.explanation,offset:e.offset},s=t.map(c=>oi(e.variants[c])),l=new Set(s.flatMap(c=>Object.keys(c))),a={},d=(c,u)=>{const h=u==="color"?"":u==="background-color"?"-bg":`-${u}`;return n+t[c]+(u==="color"?"":h)};return s.forEach((c,u)=>{for(const h of l){const f=c[h]||"inherit";if(u===0&&i&&Uf.includes(h))if(i==="light-dark()"&&s.length>1){const g=t.findIndex(_=>_==="light"),y=t.findIndex(_=>_==="dark");if(g===-1||y===-1)throw new U('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');a[h]=`light-dark(${s[g][h]||"inherit"}, ${s[y][h]||"inherit"})`,r==="css-vars"&&(a[d(u,h)]=f)}else a[h]=f;else r==="css-vars"&&(a[d(u,h)]=f)}}),o.htmlStyle=a,o}function oi(e){const t={};if(e.color&&(t.color=e.color),e.bgColor&&(t["background-color"]=e.bgColor),e.fontStyle){e.fontStyle&se.Italic&&(t["font-style"]="italic"),e.fontStyle&se.Bold&&(t["font-weight"]="bold");const n=[];e.fontStyle&se.Underline&&n.push("underline"),e.fontStyle&se.Strikethrough&&n.push("line-through"),n.length&&(t["text-decoration"]=n.join(" "))}return t}function Dr(e){return typeof e=="string"?e:Object.entries(e).map(([t,n])=>`${t}:${n}`).join(";")}function jf(){const e=new WeakMap;function t(n){if(!e.has(n.meta)){let r=function(s){if(typeof s=="number"){if(s<0||s>n.source.length)throw new U(`Invalid decoration offset: ${s}. Code length: ${n.source.length}`);return{...i.indexToPos(s),offset:s}}else{const l=i.lines[s.line];if(l===void 0)throw new U(`Invalid decoration position ${JSON.stringify(s)}. Lines length: ${i.lines.length}`);let a=s.character;if(a<0&&(a=l.length+a),a<0||a>l.length)throw new U(`Invalid decoration position ${JSON.stringify(s)}. Line ${s.line} length: ${l.length}`);return{...s,character:a,offset:i.posToIndex(s.line,a)}}};const i=Ff(n.source),o=(n.options.decorations||[]).map(s=>({...s,start:r(s.start),end:r(s.end)}));Kf(o),e.set(n.meta,{decorations:o,converter:i,source:n.source})}return e.get(n.meta)}return{name:"shiki:decorations",tokens(n){if(this.options.decorations?.length)return Wf(n,t(this).decorations.flatMap(i=>[i.start.offset,i.end.offset]))},code(n){if(!this.options.decorations?.length)return;const i=t(this),r=[...n.children].filter(c=>c.type==="element"&&c.tagName==="span");if(r.length!==i.converter.lines.length)throw new U(`Number of lines in code element (${r.length}) does not match the number of lines in the source (${i.converter.lines.length}). Failed to apply decorations.`);function o(c,u,h,f){const g=r[c];let y="",_=-1,b=-1;if(u===0&&(_=0),h===0&&(b=0),h===Number.POSITIVE_INFINITY&&(b=g.children.length),_===-1||b===-1)for(let v=0;v<g.children.length;v++)y+=ml(g.children[v]),_===-1&&y.length===u&&(_=v+1),b===-1&&y.length===h&&(b=v+1);if(_===-1)throw new U(`Failed to find start index for decoration ${JSON.stringify(f.start)}`);if(b===-1)throw new U(`Failed to find end index for decoration ${JSON.stringify(f.end)}`);const p=g.children.slice(_,b);if(!f.alwaysWrap&&p.length===g.children.length)l(g,f,"line");else if(!f.alwaysWrap&&p.length===1&&p[0].type==="element")l(p[0],f,"token");else{const v={type:"element",tagName:"span",properties:{},children:p};l(v,f,"wrapper"),g.children.splice(_,p.length,v)}}function s(c,u){r[c]=l(r[c],u,"line")}function l(c,u,h){const f=u.properties||{},g=u.transform||(y=>y);return c.tagName=u.tagName||"span",c.properties={...c.properties,...f,class:c.properties.class},u.properties?.class&&pl(c,u.properties.class),c=g(c,h)||c,c}const a=[],d=i.decorations.sort((c,u)=>u.start.offset-c.start.offset||c.end.offset-u.end.offset);for(const c of d){const{start:u,end:h}=c;if(u.line===h.line)o(u.line,u.character,h.character,c);else if(u.line<h.line){o(u.line,u.character,Number.POSITIVE_INFINITY,c);for(let f=u.line+1;f<h.line;f++)a.unshift(()=>s(f,c));o(h.line,0,h.character,c)}}a.forEach(c=>c())}}}function Kf(e){for(let t=0;t<e.length;t++){const n=e[t];if(n.start.offset>n.end.offset)throw new U(`Invalid decoration range: ${JSON.stringify(n.start)} - ${JSON.stringify(n.end)}`);for(let i=t+1;i<e.length;i++){const r=e[i],o=n.start.offset<=r.start.offset&&r.start.offset<n.end.offset,s=n.start.offset<r.end.offset&&r.end.offset<=n.end.offset,l=r.start.offset<=n.start.offset&&n.start.offset<r.end.offset,a=r.start.offset<n.end.offset&&n.end.offset<=r.end.offset;if(o||s||l||a){if(o&&s||l&&a||l&&n.start.offset===n.end.offset||s&&r.start.offset===r.end.offset)continue;throw new U(`Decorations ${JSON.stringify(n.start)} and ${JSON.stringify(r.start)} intersect.`)}}}}function ml(e){return e.type==="text"?e.value:e.type==="element"?e.children.map(ml).join(""):""}const Xf=[jf()];function si(e){const t=Qf(e.transformers||[]);return[...t.pre,...t.normal,...t.post,...Xf]}function Qf(e){const t=[],n=[],i=[];for(const r of e)switch(r.enforce){case"pre":t.push(r);break;case"post":n.push(r);break;default:i.push(r)}return{pre:t,post:n,normal:i}}var lt=["black","red","green","yellow","blue","magenta","cyan","white","brightBlack","brightRed","brightGreen","brightYellow","brightBlue","brightMagenta","brightCyan","brightWhite"],Gi={1:"bold",2:"dim",3:"italic",4:"underline",7:"reverse",8:"hidden",9:"strikethrough"};function Yf(e,t){const n=e.indexOf("\x1B",t);if(n!==-1&&e[n+1]==="["){const i=e.indexOf("m",n);if(i!==-1)return{sequence:e.substring(n+2,i).split(";"),startPosition:n,position:i+1}}return{position:e.length}}function ns(e){const t=e.shift();if(t==="2"){const n=e.splice(0,3).map(i=>Number.parseInt(i));return n.length!==3||n.some(i=>Number.isNaN(i))?void 0:{type:"rgb",rgb:n}}else if(t==="5"){const n=e.shift();if(n)return{type:"table",index:Number(n)}}}function Jf(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const i=Number.parseInt(n);if(!Number.isNaN(i))if(i===0)t.push({type:"resetAll"});else if(i<=9)Gi[i]&&t.push({type:"setDecoration",value:Gi[i]});else if(i<=29){const r=Gi[i-20];r&&(t.push({type:"resetDecoration",value:r}),r==="dim"&&t.push({type:"resetDecoration",value:"bold"}))}else if(i<=37)t.push({type:"setForegroundColor",value:{type:"named",name:lt[i-30]}});else if(i===38){const r=ns(e);r&&t.push({type:"setForegroundColor",value:r})}else if(i===39)t.push({type:"resetForegroundColor"});else if(i<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:lt[i-40]}});else if(i===48){const r=ns(e);r&&t.push({type:"setBackgroundColor",value:r})}else i===49?t.push({type:"resetBackgroundColor"}):i===53?t.push({type:"setDecoration",value:"overline"}):i===55?t.push({type:"resetDecoration",value:"overline"}):i>=90&&i<=97?t.push({type:"setForegroundColor",value:{type:"named",name:lt[i-90+8]}}):i>=100&&i<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:lt[i-100+8]}})}return t}function Zf(){let e=null,t=null,n=new Set;return{parse(i){const r=[];let o=0;do{const s=Yf(i,o),l=s.sequence?i.substring(o,s.startPosition):i.substring(o);if(l.length>0&&r.push({value:l,foreground:e,background:t,decorations:new Set(n)}),s.sequence){const a=Jf(s.sequence);for(const d of a)d.type==="resetAll"?(e=null,t=null,n.clear()):d.type==="resetForegroundColor"?e=null:d.type==="resetBackgroundColor"?t=null:d.type==="resetDecoration"&&n.delete(d.value);for(const d of a)d.type==="setForegroundColor"?e=d.value:d.type==="setBackgroundColor"?t=d.value:d.type==="setDecoration"&&n.add(d.value)}o=s.position}while(o<i.length);return r}}}var ep={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 tp(e=ep){function t(l){return e[l]}function n(l){return`#${l.map(a=>Math.max(0,Math.min(a,255)).toString(16).padStart(2,"0")).join("")}`}let i;function r(){if(i)return i;i=[];for(let d=0;d<lt.length;d++)i.push(t(lt[d]));let l=[0,95,135,175,215,255];for(let d=0;d<6;d++)for(let c=0;c<6;c++)for(let u=0;u<6;u++)i.push(n([l[d],l[c],l[u]]));let a=8;for(let d=0;d<24;d++,a+=10)i.push(n([a,a,a]));return i}function o(l){return r()[l]}function s(l){switch(l.type){case"named":return t(l.name);case"rgb":return n(l.rgb);case"table":return o(l.index)}}return{value:s}}const np=/#([0-9a-f]{3,8})/i,ip=/var\((--[\w-]+-ansi-[\w-]+)\)/,rp={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 op(e,t,n){const i=ri(e,n),r=Ci(t),o=tp(Object.fromEntries(lt.map(l=>{const a=`terminal.ansi${l[0].toUpperCase()}${l.substring(1)}`;return[l,e.colors?.[a]||rp[l]]}))),s=Zf();return r.map(l=>s.parse(l[0]).map(a=>{let d,c;a.decorations.has("reverse")?(d=a.background?o.value(a.background):e.bg,c=a.foreground?o.value(a.foreground):e.fg):(d=a.foreground?o.value(a.foreground):e.fg,c=a.background?o.value(a.background):void 0),d=et(d,i),c=et(c,i),a.decorations.has("dim")&&(d=sp(d));let u=se.None;return a.decorations.has("bold")&&(u|=se.Bold),a.decorations.has("italic")&&(u|=se.Italic),a.decorations.has("underline")&&(u|=se.Underline),a.decorations.has("strikethrough")&&(u|=se.Strikethrough),{content:a.value,offset:l[1],color:d,bgColor:c,fontStyle:u}}))}function sp(e){const t=e.match(np);if(t){const i=t[1];if(i.length===8){const r=Math.round(Number.parseInt(i.slice(6,8),16)/2).toString(16).padStart(2,"0");return`#${i.slice(0,6)}${r}`}else{if(i.length===6)return`#${i}80`;if(i.length===4){const r=i[0],o=i[1],s=i[2],l=i[3];return`#${r}${r}${o}${o}${s}${s}${Math.round(Number.parseInt(`${l}${l}`,16)/2).toString(16).padStart(2,"0")}`}else if(i.length===3){const r=i[0],o=i[1],s=i[2];return`#${r}${r}${o}${o}${s}${s}80`}}}const n=e.match(ip);return n?`var(${n[1]}-dim)`:e}function Mr(e,t,n={}){const i=e.resolveLangAlias(n.lang||"text"),{theme:r=e.getLoadedThemes()[0]}=n;if(!wi(i)&&!Si(r)&&i==="ansi"){const{theme:o}=e.setTheme(r);return op(o,t,n)}return hl(e,t,n)}function ai(e,t,n){let i,r,o,s,l,a;if("themes"in n){const{defaultColor:d="light",cssVariablePrefix:c="--shiki-",colorsRendering:u="css-vars"}=n,h=Object.entries(n.themes).filter(b=>b[1]).map(b=>({color:b[0],theme:b[1]})).sort((b,p)=>b.color===d?-1:p.color===d?1:0);if(h.length===0)throw new U("`themes` option must not be empty");const f=fl(e,t,n,Mr);if(a=nn(f),d&&d!=="light-dark()"&&!h.some(b=>b.color===d))throw new U(`\`themes\` option must contain the defaultColor key \`${d}\``);const g=h.map(b=>e.getTheme(b.theme)),y=h.map(b=>b.color);o=f.map(b=>b.map(p=>qf(p,y,c,d,u))),a&&Ei(o,a);const _=h.map(b=>ri(b.theme,n));r=is(h,g,_,c,d,"fg",u),i=is(h,g,_,c,d,"bg",u),s=`shiki-themes ${g.map(b=>b.name).join(" ")}`,l=d?void 0:[r,i].join(";")}else if("theme"in n){const d=ri(n.theme,n);o=Mr(e,t,n);const c=e.getTheme(n.theme);i=et(c.bg,d),r=et(c.fg,d),s=c.name,a=nn(o)}else throw new U("Invalid options, either `theme` or `themes` must be provided");return{tokens:o,fg:r,bg:i,themeName:s,rootStyle:l,grammarState:a}}function is(e,t,n,i,r,o,s){return e.map((l,a)=>{const d=et(t[a][o],n[a])||"inherit",c=`${i+l.color}${o==="bg"?"-bg":""}:${d}`;if(a===0&&r){if(r==="light-dark()"&&e.length>1){const u=e.findIndex(f=>f.color==="light"),h=e.findIndex(f=>f.color==="dark");if(u===-1||h===-1)throw new U('When using `defaultColor: "light-dark()"`, you must provide both `light` and `dark` themes');return`light-dark(${et(t[u][o],n[u])||"inherit"}, ${et(t[h][o],n[h])||"inherit"});${c}`}return d}return s==="css-vars"?c:null}).filter(l=>!!l).join(";")}const gl=/^\s+$/,ap=/^(\s*)(.*?)(\s*)$/;function li(e,t,n,i={meta:{},options:n,codeToHast:(r,o)=>li(e,r,o),codeToTokens:(r,o)=>ai(e,r,o)}){let r=t;for(const g of si(n))r=g.preprocess?.call(i,r,n)||r;let{tokens:o,fg:s,bg:l,themeName:a,rootStyle:d,grammarState:c}=ai(e,r,n);const{mergeWhitespaces:u=!0,mergeSameStyleTokens:h=!1}=n;u===!0?o=dp(o):u==="never"&&(o=cp(o)),h&&(o=up(o));const f={...i,get source(){return r}};for(const g of si(n))o=g.tokens?.call(f,o)||o;return lp(o,{...n,fg:s,bg:l,themeName:a,rootStyle:n.rootStyle===!1?!1:n.rootStyle??d},f,c)}function lp(e,t,n,i=nn(e)){const r=si(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[y,_]of Object.entries(t.meta||{}))y.startsWith("_")||(d[y]=_);let c={type:"element",tagName:"pre",properties:d,children:[],data:t.data},u={type:"element",tagName:"code",properties:{},children:o};const h=[],f={...n,structure:l,addClassToHast:pl,get source(){return n.source},get tokens(){return e},get options(){return t},get root(){return s},get pre(){return c},get code(){return u},get lines(){return h}};if(e.forEach((y,_)=>{_&&(l==="inline"?s.children.push({type:"element",tagName:"br",properties:{},children:[]}):l==="classic"&&o.push({type:"text",value:`
13
+ `}));let b={type:"element",tagName:"span",properties:{class:"line"},children:[]},p=0;for(const v of y){let w={type:"element",tagName:"span",properties:{...v.htmlAttrs},children:[{type:"text",value:v.content}]};const S=Dr(v.htmlStyle||oi(v));S&&(w.properties.style=S);for(const k of r)w=k?.span?.call(f,w,_+1,p,b,v)||w;l==="inline"?s.children.push(w):l==="classic"&&b.children.push(w),p+=v.content.length}if(l==="classic"){for(const v of r)b=v?.line?.call(f,b,_+1)||b;h.push(b),o.push(b)}else l==="inline"&&h.push(b)}),l==="classic"){for(const y of r)u=y?.code?.call(f,u)||u;c.children.push(u);for(const y of r)c=y?.pre?.call(f,c)||c;s.children.push(c)}else if(l==="inline"){const y=[];let _={type:"element",tagName:"span",properties:{class:"line"},children:[]};for(const p of s.children)p.type==="element"&&p.tagName==="br"?(y.push(_),_={type:"element",tagName:"span",properties:{class:"line"},children:[]}):(p.type==="element"||p.type==="text")&&_.children.push(p);y.push(_);let b={type:"element",tagName:"code",properties:{},children:y};for(const p of r)b=p?.code?.call(f,b)||b;s.children=[];for(let p=0;p<b.children.length;p++){p>0&&s.children.push({type:"element",tagName:"br",properties:{},children:[]});const v=b.children[p];v.type==="element"&&s.children.push(...v.children)}}let g=s;for(const y of r)g=y?.root?.call(f,g)||g;return i&&Ei(g,i),g}function dp(e){return e.map(t=>{const n=[];let i="",r;return t.forEach((o,s)=>{const l=!(o.fontStyle&&(o.fontStyle&se.Underline||o.fontStyle&se.Strikethrough));l&&gl.test(o.content)&&t[s+1]?(r===void 0&&(r=o.offset),i+=o.content):i?(l?n.push({...o,offset:r,content:i+o.content}):n.push({content:i,offset:r},o),r=void 0,i=""):n.push(o)}),n})}function cp(e){return e.map(t=>t.flatMap(n=>{if(gl.test(n.content))return n;const i=n.content.match(ap);if(!i)return n;const[,r,o,s]=i;if(!r&&!s)return n;const l=[{...n,offset:n.offset+r.length,content:o}];return r&&l.unshift({content:r,offset:n.offset}),s&&l.push({content:s,offset:n.offset+r.length+o.length}),l}))}function up(e){return e.map(t=>{const n=[];for(const i of t){if(n.length===0){n.push({...i});continue}const r=n.at(-1),o=Dr(r.htmlStyle||oi(r)),s=Dr(i.htmlStyle||oi(i)),l=r.fontStyle&&(r.fontStyle&se.Underline||r.fontStyle&se.Strikethrough),a=i.fontStyle&&(i.fontStyle&se.Underline||i.fontStyle&se.Strikethrough);!l&&!a&&o===s?r.content+=i.content:n.push({...i})}return n})}const hp=Ne;function fp(e,t,n){const i={meta:{},options:n,codeToHast:(o,s)=>li(e,o,s),codeToTokens:(o,s)=>ai(e,o,s)};let r=hp(li(e,t,n,i));for(const o of si(n))r=o.postprocess?.call(i,r,n)||r;return r}async function pp(e){const t=await Ef(e);return{getLastGrammarState:(...n)=>Af(t,...n),codeToTokensBase:(n,i)=>Mr(t,n,i),codeToTokensWithThemes:(n,i)=>fl(t,n,i),codeToTokens:(n,i)=>ai(t,n,i),codeToHast:(n,i)=>li(t,n,i),codeToHtml:(n,i)=>fp(t,n,i),getBundledLanguages:()=>({}),getBundledThemes:()=>({}),...t,getInternalContext:()=>t}}function mp(e){const t=e.langs,n=e.themes,i=e.engine;async function r(o){function s(u){if(typeof u=="string"){if(u=o.langAlias?.[u]||u,ol(u))return[];const h=t[u];if(!h)throw new U(`Language \`${u}\` is not included in this bundle. You may want to load it from external source.`);return h}return u}function l(u){if(sl(u))return"none";if(typeof u=="string"){const h=n[u];if(!h)throw new U(`Theme \`${u}\` is not included in this bundle. You may want to load it from external source.`);return h}return u}const a=(o.themes??[]).map(u=>l(u)),d=(o.langs??[]).map(u=>s(u)),c=await pp({engine:o.engine??i(),...o,themes:a,langs:d});return{...c,loadLanguage(...u){return c.loadLanguage(...u.map(s))},loadTheme(...u){return c.loadTheme(...u.map(l))},getBundledLanguages(){return t},getBundledThemes(){return n}}}return r}function gp(e){let t;async function n(i={}){if(t){const r=await t;return await Promise.all([r.loadTheme(...i.themes||[]),r.loadLanguage(...i.langs||[])]),r}else{t=e({...i,themes:[],langs:[]});const r=await t;return await Promise.all([r.loadTheme(...i.themes||[]),r.loadLanguage(...i.langs||[])]),r}}return n}function bp(e,t){const n=gp(e);async function i(r,o){const s=await n({langs:[o.lang],themes:"theme"in o?[o.theme]:Object.values(o.themes)}),l=await t?.guessEmbeddedLanguages?.(r,o.lang,s);return l&&await s.loadLanguage(...l),s}return{getSingletonHighlighter(r){return n(r)},async codeToHtml(r,o){return(await i(r,o)).codeToHtml(r,o)},async codeToHast(r,o){return(await i(r,o)).codeToHast(r,o)},async codeToTokens(r,o){return(await i(r,o)).codeToTokens(r,o)},async codeToTokensBase(r,o){return(await i(r,o)).codeToTokensBase(r,o)},async codeToTokensWithThemes(r,o){return(await i(r,o)).codeToTokensWithThemes(r,o)},async getLastGrammarState(r,o){return(await n({langs:[o.lang],themes:[o.theme]})).getLastGrammarState(r,o)}}}var vp=so({bundledLanguages:()=>Jt,bundledLanguagesAlias:()=>lo,bundledLanguagesBase:()=>ao,bundledLanguagesInfo:()=>vi,bundledThemes:()=>uo,bundledThemesInfo:()=>co,codeToHast:()=>vl,codeToHtml:()=>bl,codeToTokens:()=>yl,codeToTokensBase:()=>_l,codeToTokensWithThemes:()=>wl,createHighlighter:()=>Li,getLastGrammarState:()=>Cl,getSingletonHighlighter:()=>Sl});const Li=mp({langs:Jt,themes:uo,engine:()=>(0,Ba.createOnigurumaEngine)(m(()=>import("./wasm-CG6Dc4jp.js"),[]))}),{codeToHtml:bl,codeToHast:vl,codeToTokens:yl,codeToTokensBase:_l,codeToTokensWithThemes:wl,getSingletonHighlighter:Sl,getLastGrammarState:Cl}=bp(Li,{guessEmbeddedLanguages:Bf}),rs=4294967295;var yp=class{patterns;options;regexps;constructor(e,t={}){this.patterns=e,this.options=t;const{forgiving:n=!1,cache:i,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=i?.get(o);if(s){if(s instanceof RegExp)return s;if(n)return null;throw s}try{const l=r(o);return i?.set(o,l),l}catch(l){if(i?.set(o,l),n)return null;throw l}})}findNextMatchSync(e,t,n){const i=typeof e=="string"?e:e.content,r=[];function o(s,l,a=0){return{index:s,captureIndices:l.indices.map(d=>d==null?{start:rs,end:rs,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(i);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 It(e){if([...e].length!==1)throw new Error(`Expected "${e}" to be a single code point`);return e.codePointAt(0)}function _p(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}const bo=new Set(["alnum","alpha","ascii","blank","cntrl","digit","graph","lower","print","punct","space","upper","word","xdigit"]),ne=String.raw;function Pt(e,t){if(e==null)throw new Error(t??"Value expected");return e}const kl=ne`\[\^?`,El=`c.? | C(?:-.?)?|${ne`[pP]\{(?:\^?[-\x20_]*[A-Za-z][-\x20\w]*\})?`}|${ne`x[89A-Fa-f]\p{AHex}(?:\\x[89A-Fa-f]\p{AHex})*`}|${ne`u(?:\p{AHex}{4})? | x\{[^\}]*\}? | x\p{AHex}{0,2}`}|${ne`o\{[^\}]*\}?`}|${ne`\d{1,3}`}`,vo=/[?*+][?+]?|\{(?:\d+(?:,\d*)?|,\d+)\}\??/,Cn=new RegExp(ne`
14
+ \\ (?:
15
+ ${El}
16
+ | [gk]<[^>]*>?
17
+ | [gk]'[^']*'?
18
+ | .
19
+ )
20
+ | \( (?:
21
+ \? (?:
22
+ [:=!>({]
23
+ | <[=!]
24
+ | <[^>]*>
25
+ | '[^']*'
26
+ | ~\|?
27
+ | #(?:[^)\\]|\\.?)*
28
+ | [^:)]*[:)]
29
+ )?
30
+ | \*[^\)]*\)?
31
+ )?
32
+ | (?:${vo.source})+
33
+ | ${kl}
34
+ | .
35
+ `.replace(/\s+/g,""),"gsu"),Wi=new RegExp(ne`
36
+ \\ (?:
37
+ ${El}
38
+ | .
39
+ )
40
+ | \[:(?:\^?\p{Alpha}+|\^):\]
41
+ | ${kl}
42
+ | &&
43
+ | .
44
+ `.replace(/\s+/g,""),"gsu");function wp(e,t={}){const n={flags:"",...t,rules:{captureGroup:!1,singleline:!1,...t.rules}};if(typeof e!="string")throw new Error("String expected as pattern");const i=$p(n.flags),r=[i.extended],o={captureGroup:n.rules.captureGroup,getCurrentModX(){return r.at(-1)},numOpenGroups:0,popModX(){r.pop()},pushModX(u){r.push(u)},replaceCurrentModX(u){r[r.length-1]=u},singleline:n.rules.singleline};let s=[],l;for(Cn.lastIndex=0;l=Cn.exec(e);){const u=Sp(o,e,l[0],Cn.lastIndex);u.tokens?s.push(...u.tokens):u.token&&s.push(u.token),u.lastIndex!==void 0&&(Cn.lastIndex=u.lastIndex)}const a=[];let d=0;s.filter(u=>u.type==="GroupOpen").forEach(u=>{u.kind==="capturing"?u.number=++d:u.raw==="("&&a.push(u)}),d||a.forEach((u,h)=>{u.kind="capturing",u.number=h+1});const c=d||a.length;return{tokens:s.map(u=>u.type==="EscapedNumber"?Bp(u,c):u).flat(),flags:i}}function Sp(e,t,n,i){const[r,o]=n;if(n==="["||n==="[^"){const s=Cp(t,n,i);return{tokens:s.tokens,lastIndex:s.lastIndex}}if(r==="\\"){if("AbBGyYzZ".includes(o))return{token:os(n,n)};if(/^\\g[<']/.test(n)){if(!/^\\g(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:Dp(n)}}if(/^\\k[<']/.test(n)){if(!/^\\k(?:<[^>]+>|'[^']+')$/.test(n))throw new Error(`Invalid group name "${n}"`);return{token:Ll(n)}}if(o==="K")return{token:Tl("keep",n)};if(o==="N"||o==="R")return{token:dt("newline",n,{negate:o==="N"})};if(o==="O")return{token:dt("any",n)};if(o==="X")return{token:dt("text_segment",n)};const s=xl(n,{inCharClass:!1});return Array.isArray(s)?{tokens:s}:{token:s}}if(r==="("){if(o==="*")return{token:Hp(n)};if(n==="(?{")throw new Error(`Unsupported callout "${n}"`);if(n.startsWith("(?#")){if(t[i]!==")")throw new Error('Unclosed comment group "(?#"');return{lastIndex:i+1}}if(/^\(\?[-imx]+[:)]$/.test(n))return{token:Np(n,e)};if(e.pushModX(e.getCurrentModX()),e.numOpenGroups++,n==="("&&!e.captureGroup||n==="(?:")return{token:St("group",n)};if(n==="(?>")return{token:St("atomic",n)};if(n==="(?="||n==="(?!"||n==="(?<="||n==="(?<!")return{token:St(n[2]==="<"?"lookbehind":"lookahead",n,{negate:n.endsWith("!")})};if(n==="("&&e.captureGroup||n.startsWith("(?<")&&n.endsWith(">")||n.startsWith("(?'")&&n.endsWith("'"))return{token:St("capturing",n,{...n!=="("&&{name:n.slice(3,-1)}})};if(n.startsWith("(?~")){if(n==="(?~|")throw new Error(`Unsupported absence function kind "${n}"`);return{token:St("absence_repeater",n)}}throw n==="(?("?new Error(`Unsupported conditional "${n}"`):new Error(`Invalid or unsupported group option "${n}"`)}if(n===")"){if(e.popModX(),e.numOpenGroups--,e.numOpenGroups<0)throw new Error('Unmatched ")"');return{token:Ap(n)}}if(e.getCurrentModX()){if(n==="#"){const s=t.indexOf(`
45
+ `,i);return{lastIndex:s===-1?t.length:s}}if(/^\s$/.test(n)){const s=/\s+/y;return s.lastIndex=i,{lastIndex:s.exec(t)?s.lastIndex:i}}}if(n===".")return{token:dt("dot",n)};if(n==="^"||n==="$"){const s=e.singleline?{"^":ne`\A`,$:ne`\Z`}[n]:n;return{token:os(s,n)}}return n==="|"?{token:Ep(n)}:vo.test(n)?{tokens:Up(n)}:{token:qe(It(n),n)}}function Cp(e,t,n){const i=[ss(t[1]==="^",t)];let r=1,o;for(Wi.lastIndex=n;o=Wi.exec(e);){const s=o[0];if(s[0]==="["&&s[1]!==":")r++,i.push(ss(s[1]==="^",s));else if(s==="]"){if(i.at(-1).type==="CharacterClassOpen")i.push(qe(93,s));else if(r--,i.push(xp(s)),!r)break}else{const l=kp(s);Array.isArray(l)?i.push(...l):i.push(l)}}return{tokens:i,lastIndex:Wi.lastIndex||e.length}}function kp(e){if(e[0]==="\\")return xl(e,{inCharClass:!0});if(e[0]==="["){const t=/\[:(?<negate>\^?)(?<name>[a-z]+):\]/.exec(e);if(!t||!bo.has(t.groups.name))throw new Error(`Invalid POSIX class "${e}"`);return dt("posix",e,{value:t.groups.name,negate:!!t.groups.negate})}return e==="-"?Lp(e):e==="&&"?Tp(e):qe(It(e),e)}function xl(e,{inCharClass:t}){const n=e[1];if(n==="c"||n==="C")return Op(e);if("dDhHsSwW".includes(n))return Vp(e);if(e.startsWith(ne`\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 zp(e)}if(/^\\x[89A-Fa-f]\p{AHex}/u.test(e))try{const i=e.split(/\\x/).slice(1).map(s=>parseInt(s,16)),r=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}).decode(new Uint8Array(i)),o=new TextEncoder;return[...r].map(s=>{const l=[...o.encode(s)].map(a=>`\\x${a.toString(16)}`).join("");return qe(It(s),l)})}catch{throw new Error(`Multibyte code "${e}" incomplete or invalid in Oniguruma`)}if(n==="u"||n==="x")return qe(Fp(e),e);if(as.has(n))return qe(as.get(n),e);if(/\d/.test(n))return Rp(t,e);if(e==="\\")throw new Error(ne`Incomplete escape "\"`);if(n==="M")throw new Error(`Unsupported meta "${e}"`);if([...e].length===2)return qe(e.codePointAt(1),e);throw new Error(`Unexpected escape "${e}"`)}function Ep(e){return{type:"Alternator",raw:e}}function os(e,t){return{type:"Assertion",kind:e,raw:t}}function Ll(e){return{type:"Backreference",raw:e}}function qe(e,t){return{type:"Character",value:e,raw:t}}function xp(e){return{type:"CharacterClassClose",raw:e}}function Lp(e){return{type:"CharacterClassHyphen",raw:e}}function Tp(e){return{type:"CharacterClassIntersector",raw:e}}function ss(e,t){return{type:"CharacterClassOpen",negate:e,raw:t}}function dt(e,t,n={}){return{type:"CharacterSet",kind:e,...n,raw:t}}function Tl(e,t,n={}){return e==="keep"?{type:"Directive",kind:e,raw:t}:{type:"Directive",kind:e,flags:Pt(n.flags),raw:t}}function Rp(e,t){return{type:"EscapedNumber",inCharClass:e,raw:t}}function Ap(e){return{type:"GroupClose",raw:e}}function St(e,t,n={}){return{type:"GroupOpen",kind:e,...n,raw:t}}function Ip(e,t,n,i){return{type:"NamedCallout",kind:e,tag:t,arguments:n,raw:i}}function Pp(e,t,n,i){return{type:"Quantifier",kind:e,min:t,max:n,raw:i}}function Dp(e){return{type:"Subroutine",raw:e}}const Mp=new Set(["COUNT","CMP","ERROR","FAIL","MAX","MISMATCH","SKIP","TOTAL_COUNT"]),as=new Map([["a",7],["b",8],["e",27],["f",12],["n",10],["r",13],["t",9],["v",11]]);function Op(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 qe(It(t.toUpperCase())-64,e)}function Np(e,t){let{on:n,off:i}=/^\(\?(?<on>[imx]*)(?:-(?<off>[-imx]*))?/.exec(e).groups;i??="";const r=(t.getCurrentModX()||n.includes("x"))&&!i.includes("x"),o=ds(n),s=ds(i),l={};if(o&&(l.enable=o),s&&(l.disable=s),e.endsWith(")"))return t.replaceCurrentModX(r),Tl("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 Hp(e){const t=/\(\*(?<name>[A-Za-z_]\w*)?(?:\[(?<tag>(?:[A-Za-z_]\w*)?)\])?(?:\{(?<args>[^}]*)\})?\)/.exec(e);if(!t)throw new Error(`Incomplete or invalid named callout "${e}"`);const{name:n,tag:i,args:r}=t.groups;if(!n)throw new Error(`Invalid named callout "${e}"`);if(i==="")throw new Error(`Named callout tag with empty value not allowed "${e}"`);const o=r?r.split(",").filter(c=>c!=="").map(c=>/^[+-]?\d+$/.test(c)?+c:c):[],[s,l,a]=o,d=Mp.has(n)?n.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 "${n}"`);default:throw new Error(`Unexpected named callout kind "${d}"`)}return Ip(d,i??null,r?.split(",")??null,e)}function ls(e){let t=null,n,i;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(n=+r,i=o===void 0?+r:o===""?1/0:+o,n>i&&(t="possessive",[n,i]=[i,n]),e.endsWith("?")){if(t==="possessive")throw new Error('Unsupported possessive interval quantifier chain with "?"');t="lazy"}else t||(t="greedy")}else n=e[0]==="+"?1:0,i=e[0]==="?"?1:1/0,t=e[1]==="+"?"possessive":e[1]==="?"?"lazy":"greedy";return Pp(t,n,i,e)}function Vp(e){const t=e[1].toLowerCase();return dt({d:"digit",h:"hex",s:"space",w:"word"}[t],e,{negate:e[1]!==t})}function zp(e){const{p:t,neg:n,value:i}=/^\\(?<p>[pP])\{(?<neg>\^?)(?<value>[^}]+)/.exec(e).groups;return dt("property",e,{value:i,negate:t==="P"&&!n||t==="p"&&!!n})}function ds(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 $p(e){const t={ignoreCase:!1,dotAll:!1,extended:!1,digitIsAscii:!1,posixIsAscii:!1,spaceIsAscii:!1,wordIsAscii:!1,textSegmentMode:null};for(let n=0;n<e.length;n++){const i=e[n];if(!"imxDPSWy".includes(i))throw new Error(`Invalid flag "${i}"`);if(i==="y"){if(!/^y{[gw]}/.test(e.slice(n)))throw new Error('Invalid or unspecified flag "y" mode');t.textSegmentMode=e[n+2]==="g"?"grapheme":"word",n+=3;continue}t[{i:"ignoreCase",m:"dotAll",x:"extended",D:"digitIsAscii",P:"posixIsAscii",S:"spaceIsAscii",W:"wordIsAscii"}[i]]=!0}return t}function Fp(e){if(/^(?:\\u(?!\p{AHex}{4})|\\x(?!\p{AHex}{1,2}|\{\p{AHex}{1,8}\}))/u.test(e))throw new Error(`Incomplete or invalid escape "${e}"`);const t=e[2]==="{"?/^\\x\{\s*(?<hex>\p{AHex}+)/u.exec(e).groups.hex:e.slice(2);return parseInt(t,16)}function Bp(e,t){const{raw:n,inCharClass:i}=e,r=n.slice(1);if(!i&&(r!=="0"&&r.length===1||r[0]!=="0"&&+r<=t))return[Ll(n)];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(ne`Octal encoded byte above 177 unsupported "${n}"`)}else d=It(a);o.push(qe(d,(l===0?"\\":"")+a))}return o}function Up(e){const t=[],n=new RegExp(vo,"gy");let i;for(;i=n.exec(e);){const r=i[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("?")){n.lastIndex--,t.push(ls(r.slice(0,-1)));continue}}}t.push(ls(r))}return t}function Rl(e,t){if(!Array.isArray(e.body))throw new Error("Expected node with body array");if(e.body.length!==1)return!1;const n=e.body[0];return!t||Object.keys(t).every(i=>t[i]===n[i])}function Gp(e){return Wp.has(e.type)}const Wp=new Set(["AbsenceFunction","Backreference","CapturingGroup","Character","CharacterClass","CharacterSet","Group","Quantifier","Subroutine"]);function Al(e,t={}){const n={flags:"",normalizeUnknownPropertyNames:!1,skipBackrefValidation:!1,skipLookbehindValidation:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t,rules:{captureGroup:!1,singleline:!1,...t.rules}},i=wp(e,{flags:n.flags,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline}}),r=(h,f)=>{const g=i.tokens[o.nextIndex];switch(o.parent=h,o.nextIndex++,g.type){case"Alternator":return ft();case"Assertion":return qp(g);case"Backreference":return jp(g,o);case"Character":return Ti(g.value,{useLastValid:!!f.isCheckingRangeEnd});case"CharacterClassHyphen":return Kp(g,o,f);case"CharacterClassOpen":return Xp(g,o,f);case"CharacterSet":return Qp(g,o);case"Directive":return nm(g.kind,{flags:g.flags});case"GroupOpen":return Yp(g,o,f);case"NamedCallout":return rm(g.kind,g.tag,g.arguments);case"Quantifier":return Jp(g,o);case"Subroutine":return Zp(g,o);default:throw new Error(`Unexpected token type "${g.type}"`)}},o={capturingGroups:[],hasNumberedRef:!1,namedGroupsByName:new Map,nextIndex:0,normalizeUnknownPropertyNames:n.normalizeUnknownPropertyNames,parent:null,skipBackrefValidation:n.skipBackrefValidation,skipLookbehindValidation:n.skipLookbehindValidation,skipPropertyNameValidation:n.skipPropertyNameValidation,subroutines:[],tokens:i.tokens,unicodePropertyMap:n.unicodePropertyMap,walk:r},s=sm(im(i.flags));let l=s.body[0];for(;o.nextIndex<i.tokens.length;){const h=r(l,{});h.type==="Alternative"?(s.body.push(h),l=h):l.body.push(h)}const{capturingGroups:a,hasNumberedRef:d,namedGroupsByName:c,subroutines:u}=o;if(d&&c.size&&!n.rules.captureGroup)throw new Error("Numbered backref/subroutine not allowed when using named capture");for(const{ref:h}of u)if(typeof h=="number"){if(h>a.length)throw new Error("Subroutine uses a group number that's not defined");h&&(a[h-1].isSubroutined=!0)}else if(c.has(h)){if(c.get(h).length>1)throw new Error(ne`Subroutine uses a duplicate group name "\g<${h}>"`);c.get(h)[0].isSubroutined=!0}else throw new Error(ne`Subroutine uses a group name that's not defined "\g<${h}>"`);return s}function qp({kind:e}){return Or(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===ne`\B`||e===ne`\Y`})}function jp({raw:e},t){const n=/^\\k[<']/.test(e),i=n?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,Nr(s?l+1-o:o,{orphan:a})};if(n){const o=/^(?<sign>-?)0*(?<num>[1-9]\d*)$/.exec(i);if(o)return r(+o.groups.num,!!o.groups.sign);if(/[-+]/.test(i))throw new Error(`Invalid backref name "${e}"`);if(!t.namedGroupsByName.has(i))throw new Error(`Group name not defined to the left "${e}"`);return Nr(i)}return r(+i)}function Kp(e,t,n){const{tokens:i,walk:r}=t,o=t.parent,s=o.body.at(-1),l=i[t.nextIndex];if(!n.isCheckingRangeEnd&&s&&s.type!=="CharacterClass"&&s.type!=="CharacterClassRange"&&l&&l.type!=="CharacterClassOpen"&&l.type!=="CharacterClassClose"&&l.type!=="CharacterClassIntersector"){const a=r(o,{...n,isCheckingRangeEnd:!0});if(s.type==="Character"&&a.type==="Character")return o.body.pop(),tm(s,a);throw new Error("Invalid character class range")}return Ti(It("-"))}function Xp({negate:e},t,n){const{tokens:i,walk:r}=t,o=[Gn()],s=i[t.nextIndex];let l=hs(s);for(;l.type!=="CharacterClassClose";){if(l.type==="CharacterClassIntersector")o.push(Gn()),t.nextIndex++;else{const d=o.at(-1);d.body.push(r(d,n))}l=hs(i[t.nextIndex],s)}const a=Gn({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 Qp({kind:e,negate:t,value:n},i){const{normalizeUnknownPropertyNames:r,skipPropertyNameValidation:o,unicodePropertyMap:s}=i;if(e==="property"){const l=Ri(n);if(bo.has(l)&&!s?.has(l))e="posix",n=l;else return Ct(n,{negate:t,normalizeUnknownPropertyNames:r,skipPropertyNameValidation:o,unicodePropertyMap:s})}return e==="posix"?om(n,{negate:t}):Hr(e,{negate:t})}function Yp(e,t,n){const{tokens:i,capturingGroups:r,namedGroupsByName:o,skipLookbehindValidation:s,walk:l}=t,a=am(e),d=a.type==="AbsenceFunction",c=us(a),u=c&&a.negate;if(a.type==="CapturingGroup"&&(r.push(a),a.name&&_p(o,a.name,[]).push(a)),d&&n.isInAbsenceFunction)throw new Error("Nested absence function not supported by Oniguruma");let h=fs(i[t.nextIndex]);for(;h.type!=="GroupClose";){if(h.type==="Alternator")a.body.push(ft()),t.nextIndex++;else{const f=a.body.at(-1),g=l(f,{...n,isInAbsenceFunction:n.isInAbsenceFunction||d,isInLookbehind:n.isInLookbehind||c,isInNegLookbehind:n.isInNegLookbehind||u});if(f.body.push(g),(c||n.isInLookbehind)&&!s){const y="Lookbehind includes a pattern not allowed by Oniguruma";if(u||n.isInNegLookbehind){if(cs(g)||g.type==="CapturingGroup")throw new Error(y)}else if(cs(g)||us(g)&&g.negate)throw new Error(y)}}h=fs(i[t.nextIndex])}return t.nextIndex++,a}function Jp({kind:e,min:t,max:n},i){const r=i.parent,o=r.body.at(-1);if(!o||!Gp(o))throw new Error("Quantifier requires a repeatable token");const s=Pl(e,t,n,o);return r.body.pop(),s}function Zp({raw:e},t){const{capturingGroups:n,subroutines:i}=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=n.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=Dl(r);return i.push(s),s}function em(e,t){return{type:"AbsenceFunction",kind:e,body:pn(t?.body)}}function ft(e){return{type:"Alternative",body:Ml(e?.body)}}function Or(e,t){const n={type:"Assertion",kind:e};return(e==="word_boundary"||e==="text_segment_boundary")&&(n.negate=!!t?.negate),n}function Nr(e,t){const n=!!t?.orphan;return{type:"Backreference",ref:e,...n&&{orphan:n}}}function Il(e,t){const n={name:void 0,isSubroutined:!1,...t};if(n.name!==void 0&&!lm(n.name))throw new Error(`Group name "${n.name}" invalid in Oniguruma`);return{type:"CapturingGroup",number:e,...n.name&&{name:n.name},...n.isSubroutined&&{isSubroutined:n.isSubroutined},body:pn(t?.body)}}function Ti(e,t){const n={useLastValid:!1,...t};if(e>1114111){const i=e.toString(16);if(n.useLastValid)e=1114111;else throw e>1310719?new Error(`Invalid code point out of range "\\x{${i}}"`):new Error(`Invalid code point out of range in JS "\\x{${i}}"`)}return{type:"Character",value:e}}function Gn(e){const t={kind:"union",negate:!1,...e};return{type:"CharacterClass",kind:t.kind,negate:t.negate,body:Ml(e?.body)}}function tm(e,t){if(t.value<e.value)throw new Error("Character class range out of order");return{type:"CharacterClassRange",min:e,max:t}}function Hr(e,t){const n=!!t?.negate,i={type:"CharacterSet",kind:e};return(e==="digit"||e==="hex"||e==="newline"||e==="space"||e==="word")&&(i.negate=n),(e==="text_segment"||e==="newline"&&!n)&&(i.variableLength=!0),i}function nm(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 im(e){return{type:"Flags",...e}}function Ee(e){const t=e?.atomic,n=e?.flags;if(t&&n)throw new Error("Atomic group cannot have flags");return{type:"Group",...t&&{atomic:t},...n&&{flags:n},body:pn(e?.body)}}function at(e){const t={behind:!1,negate:!1,...e};return{type:"LookaroundAssertion",kind:t.behind?"lookbehind":"lookahead",negate:t.negate,body:pn(e?.body)}}function rm(e,t,n){return{type:"NamedCallout",kind:e,tag:t,arguments:n}}function om(e,t){const n=!!t?.negate;if(!bo.has(e))throw new Error(`Invalid POSIX class "${e}"`);return{type:"CharacterSet",kind:"posix",value:e,negate:n}}function Pl(e,t,n,i){if(t>n)throw new Error("Invalid reversed quantifier range");return{type:"Quantifier",kind:e,min:t,max:n,body:i}}function sm(e,t){return{type:"Regex",body:pn(t?.body),flags:e}}function Dl(e){return{type:"Subroutine",ref:e}}function Ct(e,t){const n={negate:!1,normalizeUnknownPropertyNames:!1,skipPropertyNameValidation:!1,unicodePropertyMap:null,...t};let i=n.unicodePropertyMap?.get(Ri(e));if(!i){if(n.normalizeUnknownPropertyNames)i=dm(e);else if(n.unicodePropertyMap&&!n.skipPropertyNameValidation)throw new Error(ne`Invalid Unicode property "\p{${e}}"`)}return{type:"CharacterSet",kind:"property",value:i??e,negate:n.negate}}function am({flags:e,kind:t,name:n,negate:i,number:r}){switch(t){case"absence_repeater":return em("repeater");case"atomic":return Ee({atomic:!0});case"capturing":return Il(r,{name:n});case"group":return Ee({flags:e});case"lookahead":case"lookbehind":return at({behind:t==="lookbehind",negate:i});default:throw new Error(`Unexpected group kind "${t}"`)}}function pn(e){if(e===void 0)e=[ft()];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 Ml(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 cs(e){return e.type==="LookaroundAssertion"&&e.kind==="lookahead"}function us(e){return e.type==="LookaroundAssertion"&&e.kind==="lookbehind"}function lm(e){return/^[\p{Alpha}\p{Pc}][^)]*$/u.test(e)}function dm(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 Ri(e){return e.replace(/[- _]+/g,"").toLowerCase()}function hs(e,t){const n=t;return Pt(e,`Unclosed character class${n?.type==="Character"&&n.value===93&&n.raw==="]"?' (started with "]")':""}`)}function fs(e){return Pt(e,"Unclosed group")}function Wt(e,t,n=null){function i(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,c=!1;const u={node:o,parent:s,key:l,container:a,root:e,remove(){kn(a).splice(Math.max(0,vt(l)+d),1),d--,c=!0},removeAllNextSiblings(){return kn(a).splice(vt(l)+1)},removeAllPrevSiblings(){const b=vt(l)+d;return d-=b,kn(a).splice(0,Math.max(0,b))},replaceWith(b,p={}){const v=!!p.traverse;a?a[Math.max(0,vt(l)+d)]=b:Pt(s,"Can't replace root node")[l]=b,v&&r(b,s,l,a),c=!0},replaceWithMultiple(b,p={}){const v=!!p.traverse;if(kn(a).splice(Math.max(0,vt(l)+d),1,...b),d+=b.length-1,v){let w=0;for(let S=0;S<b.length;S++)w+=r(b[S],s,vt(l)+S+w,a)}c=!0},skip(){c=!0}},{type:h}=o,f=t["*"],g=t[h],y=typeof f=="function"?f:f?.enter,_=typeof g=="function"?g:g?.enter;if(y?.(u,n),_?.(u,n),!c)switch(h){case"AbsenceFunction":case"Alternative":case"CapturingGroup":case"CharacterClass":case"Group":case"LookaroundAssertion":i(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":i(o.body,o),r(o.flags,o,"flags");break;default:throw new Error(`Unexpected node type "${h}"`)}return g?.exit?.(u,n),f?.exit?.(u,n),d}return r(e),e}function kn(e){if(!Array.isArray(e))throw new Error("Container expected");return e}function vt(e){if(typeof e!="number")throw new Error("Numeric key expected");return e}const cm=String.raw`\(\?(?:[:=!>A-Za-z\-]|<[=!]|\(DEFINE\))`;function um(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function hm(e,t,n,i){return e.slice(0,t)+i+e.slice(t+n.length)}const _e=Object.freeze({DEFAULT:"DEFAULT",CHAR_CLASS:"CHAR_CLASS"});function yo(e,t,n,i){const r=new RegExp(String.raw`${t}|(?<$skip>\[\^?|\\?.)`,"gsu"),o=[!1];let s=0,l="";for(const a of e.matchAll(r)){const{0:d,groups:{$skip:c}}=a;if(!c&&(!i||i===_e.DEFAULT==!s)){n instanceof Function?l+=n(a,{context:s?_e.CHAR_CLASS:_e.DEFAULT,negated:o[o.length-1]}):l+=n;continue}d[0]==="["?(s++,o.push(d[1]==="^")):d==="]"&&s&&(s--,o.pop()),l+=d}return l}function Ol(e,t,n,i){yo(e,t,n,i)}function fm(e,t,n=0,i){if(!new RegExp(t,"su").test(e))return null;const r=new RegExp(`${t}|(?<$skip>\\\\?.)`,"gsu");r.lastIndex=n;let o=0,s;for(;s=r.exec(e);){const{0:l,groups:{$skip:a}}=s;if(!a&&(!i||i===_e.DEFAULT==!o))return s;l==="["?o++:l==="]"&&o&&o--,r.lastIndex==s.index&&r.lastIndex++}return null}function En(e,t,n){return!!fm(e,t,0,n)}function pm(e,t){const n=/\\?./gsu;n.lastIndex=t;let i=e.length,r=0,o=1,s;for(;s=n.exec(e);){const[l]=s;if(l==="[")r++;else if(r)l==="]"&&r--;else if(l==="(")o++;else if(l===")"&&(o--,!o)){i=s.index;break}}return e.slice(t,i)}const ps=new RegExp(String.raw`(?<noncapturingStart>${cm})|(?<capturingStart>\((?:\?<[^>]+>)?)|\\?.`,"gsu");function mm(e,t){const n=t?.hiddenCaptures??[];let i=t?.captureTransfers??new Map;if(!/\(\?>/.test(e))return{pattern:e,captureTransfers:i,hiddenCaptures:n};const r="(?>",o="(?:(?=(",s=[0],l=[];let a=0,d=0,c=NaN,u;do{u=!1;let h=0,f=0,g=!1,y;for(ps.lastIndex=Number.isNaN(c)?0:c+o.length;y=ps.exec(e);){const{0:_,index:b,groups:{capturingStart:p,noncapturingStart:v}}=y;if(_==="[")h++;else if(h)_==="]"&&h--;else if(_===r&&!g)c=b,g=!0;else if(g&&v)f++;else if(p)g?f++:(a++,s.push(a+d));else if(_===")"&&g){if(!f){d++;const w=a+d;if(e=`${e.slice(0,c)}${o}${e.slice(c+r.length,b)}))<$$${w}>)${e.slice(b+1)}`,u=!0,l.push(w),um(n,w),i.size){const S=new Map;i.forEach((k,E)=>{S.set(E>=w?E+1:E,k.map(C=>C>=w?C+1:C))}),i=S}break}f--}}}while(u);return n.push(...l),e=yo(e,String.raw`\\(?<backrefNum>[1-9]\d*)|<\$\$(?<wrappedBackrefNum>\d+)>`,({0:h,groups:{backrefNum:f,wrappedBackrefNum:g}})=>{if(f){const y=+f;if(y>s.length-1)throw new Error(`Backref "${h}" greater than number of captures`);return`\\${s[y]}`}return`\\${g}`},_e.DEFAULT),{pattern:e,captureTransfers:i,hiddenCaptures:n}}const Nl=String.raw`(?:[?*+]|\{\d+(?:,\d*)?\})`,qi=new RegExp(String.raw`
46
+ \\(?: \d+
47
+ | c[A-Za-z]
48
+ | [gk]<[^>]+>
49
+ | [pPu]\{[^\}]+\}
50
+ | u[A-Fa-f\d]{4}
51
+ | x[A-Fa-f\d]{2}
52
+ )
53
+ | \((?: \? (?: [:=!>]
54
+ | <(?:[=!]|[^>]+>)
55
+ | [A-Za-z\-]+:
56
+ | \(DEFINE\)
57
+ ))?
58
+ | (?<qBase>${Nl})(?<qMod>[?+]?)(?<invalidQ>[?*+\{]?)
59
+ | \\?.
60
+ `.replace(/\s+/g,""),"gsu");function gm(e){if(!new RegExp(`${Nl}\\+`).test(e))return{pattern:e};const t=[];let n=null,i=null,r="",o=0,s;for(qi.lastIndex=0;s=qi.exec(e);){const{0:l,index:a,groups:{qBase:d,qMod:c,invalidQ:u}}=s;if(l==="[")o||(i=a),o++;else if(l==="]")o?o--:i=null;else if(!o)if(c==="+"&&r&&!r.startsWith("(")){if(u)throw new Error(`Invalid quantifier "${l}"`);let h=-1;if(/^\{\d+\}$/.test(d))e=hm(e,a+d.length,c,"");else{if(r===")"||r==="]"){const f=r===")"?n:i;if(f===null)throw new Error(`Invalid unmatched "${r}"`);e=`${e.slice(0,f)}(?>${e.slice(f,a)}${d})${e.slice(a+l.length)}`}else e=`${e.slice(0,a-r.length)}(?>${r}${d})${e.slice(a+l.length)}`;h+=4}qi.lastIndex+=h}else l[0]==="("?t.push(a):l===")"&&(n=t.length?t.pop():null);r=l}return{pattern:e}}const ye=String.raw,bm=ye`\\g<(?<gRNameOrNum>[^>&]+)&R=(?<gRDepth>[^>]+)>`,Vr=ye`\(\?R=(?<rDepth>[^\)]+)\)|${bm}`,Ai=ye`\(\?<(?![=!])(?<captureName>[^>]+)>`,Hl=ye`${Ai}|(?<unnamed>\()(?!\?)`,it=new RegExp(ye`${Ai}|${Vr}|\(\?|\\?.`,"gsu"),ji="Cannot use multiple overlapping recursions";function vm(e,t){const{hiddenCaptures:n,mode:i}={hiddenCaptures:[],mode:"plugin",...t};let r=t?.captureTransfers??new Map;if(!new RegExp(Vr,"su").test(e))return{pattern:e,captureTransfers:r,hiddenCaptures:n};if(i==="plugin"&&En(e,ye`\(\?\(DEFINE\)`,_e.DEFAULT))throw new Error("DEFINE groups cannot be used with recursion");const o=[],s=En(e,ye`\\[1-9]`,_e.DEFAULT),l=new Map,a=[];let d=!1,c=0,u=0,h;for(it.lastIndex=0;h=it.exec(e);){const{0:f,groups:{captureName:g,rDepth:y,gRNameOrNum:_,gRDepth:b}}=h;if(f==="[")c++;else if(c)f==="]"&&c--;else if(y){if(ms(y),d)throw new Error(ji);if(s)throw new Error(`${i==="external"?"Backrefs":"Numbered backrefs"} cannot be used with global recursion`);const p=e.slice(0,h.index),v=e.slice(it.lastIndex);if(En(v,Vr,_e.DEFAULT))throw new Error(ji);const w=+y-1;e=gs(p,v,w,!1,n,o,u),r=vs(r,p,w,o.length,0,u);break}else if(_){ms(b);let p=!1;for(const A of a)if(A.name===_||A.num===+_){if(p=!0,A.hasRecursedWithin)throw new Error(ji);break}if(!p)throw new Error(ye`Recursive \g cannot be used outside the referenced group "${i==="external"?_:ye`\g<${_}&R=${b}>`}"`);const v=l.get(_),w=pm(e,v);if(s&&En(w,ye`${Ai}|\((?!\?)`,_e.DEFAULT))throw new Error(`${i==="external"?"Backrefs":"Numbered backrefs"} cannot be used with recursion of capturing groups`);const S=e.slice(v,h.index),k=w.slice(S.length+f.length),E=o.length,C=+b-1,x=gs(S,k,C,!0,n,o,u);r=vs(r,S,C,o.length-E,E,u);const I=e.slice(0,v),P=e.slice(v+w.length);e=`${I}${x}${P}`,it.lastIndex+=x.length-f.length-S.length-k.length,a.forEach(A=>A.hasRecursedWithin=!0),d=!0}else if(g)u++,l.set(String(u),it.lastIndex),l.set(g,it.lastIndex),a.push({num:u,name:g});else if(f[0]==="("){const p=f==="(";p&&(u++,l.set(String(u),it.lastIndex)),a.push(p?{num:u}:{})}else f===")"&&a.pop()}return n.push(...o),{pattern:e,captureTransfers:r,hiddenCaptures:n}}function ms(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 gs(e,t,n,i,r,o,s){const l=new Set;i&&Ol(e+t,Ai,({groups:{captureName:d}})=>{l.add(d)},_e.DEFAULT);const a=[n,i?l:null,r,o,s];return`${e}${bs(`(?:${e}`,"forward",...a)}(?:)${bs(`${t})`,"backward",...a)}${t}`}function bs(e,t,n,i,r,o,s){const a=c=>t==="forward"?c+2:n-c+2-1;let d="";for(let c=0;c<n;c++){const u=a(c);d+=yo(e,ye`${Hl}|\\k<(?<backref>[^>]+)>`,({0:h,groups:{captureName:f,unnamed:g,backref:y}})=>{if(y&&i&&!i.has(y))return h;const _=`_$${u}`;if(g||f){const b=s+o.length+1;return o.push(b),ym(r,b),g?h:`(?<${f}${_}>`}return ye`\k<${y}${_}>`},_e.DEFAULT)}return d}function ym(e,t){for(let n=0;n<e.length;n++)e[n]>=t&&e[n]++}function vs(e,t,n,i,r,o){if(e.size&&i){let s=0;Ol(t,Hl,()=>s++,_e.DEFAULT);const l=o-s+r,a=new Map;return e.forEach((d,c)=>{const u=(i-s*n)/n,h=s*n,f=c>l+s?c+i:c,g=[];for(const y of d)if(y<=l)g.push(y);else if(y>l+s+u)g.push(y+i);else if(y<=l+s)for(let _=0;_<=n;_++)g.push(y+s*_);else for(let _=0;_<=n;_++)g.push(y+h+u*_);a.set(f,g)}),a}return e}var Z=String.fromCodePoint,z=String.raw,xe={},Ii=globalThis.RegExp;xe.flagGroups=(()=>{try{new Ii("(?i:)")}catch{return!1}return!0})();xe.unicodeSets=(()=>{try{new Ii("[[]]","v")}catch{return!1}return!0})();xe.bugFlagVLiteralHyphenIsRange=xe.unicodeSets?(()=>{try{new Ii(z`[\d\-a]`,"v")}catch{return!0}return!1})():!1;xe.bugNestedClassIgnoresNegation=xe.unicodeSets&&new Ii("[[^a]]","v").test("a");function di(e,{enable:t,disable:n}){return{dotAll:!n?.dotAll&&!!(t?.dotAll||e.dotAll),ignoreCase:!n?.ignoreCase&&!!(t?.ignoreCase||e.ignoreCase)}}function rn(e,t,n){return e.has(t)||e.set(t,n),e.get(t)}function zr(e,t){return ys[e]>=ys[t]}function _m(e,t){if(e==null)throw new Error(t??"Value expected");return e}var ys={ES2025:2025,ES2024:2024,ES2018:2018},wm={auto:"auto",ES2025:"ES2025",ES2024:"ES2024",ES2018:"ES2018"};function Vl(e={}){if({}.toString.call(e)!=="[object Object]")throw new Error("Unexpected options");if(e.target!==void 0&&!wm[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=xe.flagGroups?"ES2025":xe.unicodeSets?"ES2024":"ES2018"),t}var Sm="[ -\r ]",Cm=new Set([Z(304),Z(305)]),Be=z`[\p{L}\p{M}\p{N}\p{Pc}]`;function zl(e){if(Cm.has(e))return[e];const t=new Set,n=e.toLowerCase(),i=n.toUpperCase(),r=xm.get(n),o=km.get(n),s=Em.get(n);return[...i].length===1&&t.add(i),s&&t.add(s),r&&t.add(r),t.add(n),o&&t.add(o),[...t]}var _o=new Map(`C Other
61
+ Cc Control cntrl
62
+ Cf Format
63
+ Cn Unassigned
64
+ Co Private_Use
65
+ Cs Surrogate
66
+ L Letter
67
+ LC Cased_Letter
68
+ Ll Lowercase_Letter
69
+ Lm Modifier_Letter
70
+ Lo Other_Letter
71
+ Lt Titlecase_Letter
72
+ Lu Uppercase_Letter
73
+ M Mark Combining_Mark
74
+ Mc Spacing_Mark
75
+ Me Enclosing_Mark
76
+ Mn Nonspacing_Mark
77
+ N Number
78
+ Nd Decimal_Number digit
79
+ Nl Letter_Number
80
+ No Other_Number
81
+ P Punctuation punct
82
+ Pc Connector_Punctuation
83
+ Pd Dash_Punctuation
84
+ Pe Close_Punctuation
85
+ Pf Final_Punctuation
86
+ Pi Initial_Punctuation
87
+ Po Other_Punctuation
88
+ Ps Open_Punctuation
89
+ S Symbol
90
+ Sc Currency_Symbol
91
+ Sk Modifier_Symbol
92
+ Sm Math_Symbol
93
+ So Other_Symbol
94
+ Z Separator
95
+ Zl Line_Separator
96
+ Zp Paragraph_Separator
97
+ Zs Space_Separator
98
+ ASCII
99
+ ASCII_Hex_Digit AHex
100
+ Alphabetic Alpha
101
+ Any
102
+ Assigned
103
+ Bidi_Control Bidi_C
104
+ Bidi_Mirrored Bidi_M
105
+ Case_Ignorable CI
106
+ Cased
107
+ Changes_When_Casefolded CWCF
108
+ Changes_When_Casemapped CWCM
109
+ Changes_When_Lowercased CWL
110
+ Changes_When_NFKC_Casefolded CWKCF
111
+ Changes_When_Titlecased CWT
112
+ Changes_When_Uppercased CWU
113
+ Dash
114
+ Default_Ignorable_Code_Point DI
115
+ Deprecated Dep
116
+ Diacritic Dia
117
+ Emoji
118
+ Emoji_Component EComp
119
+ Emoji_Modifier EMod
120
+ Emoji_Modifier_Base EBase
121
+ Emoji_Presentation EPres
122
+ Extended_Pictographic ExtPict
123
+ Extender Ext
124
+ Grapheme_Base Gr_Base
125
+ Grapheme_Extend Gr_Ext
126
+ Hex_Digit Hex
127
+ IDS_Binary_Operator IDSB
128
+ IDS_Trinary_Operator IDST
129
+ ID_Continue IDC
130
+ ID_Start IDS
131
+ Ideographic Ideo
132
+ Join_Control Join_C
133
+ Logical_Order_Exception LOE
134
+ Lowercase Lower
135
+ Math
136
+ Noncharacter_Code_Point NChar
137
+ Pattern_Syntax Pat_Syn
138
+ Pattern_White_Space Pat_WS
139
+ Quotation_Mark QMark
140
+ Radical
141
+ Regional_Indicator RI
142
+ Sentence_Terminal STerm
143
+ Soft_Dotted SD
144
+ Terminal_Punctuation Term
145
+ Unified_Ideograph UIdeo
146
+ Uppercase Upper
147
+ Variation_Selector VS
148
+ White_Space space
149
+ XID_Continue XIDC
150
+ XID_Start XIDS`.split(/\s/).map(e=>[Ri(e),e])),km=new Map([["s",Z(383)],[Z(383),"s"]]),Em=new Map([[Z(223),Z(7838)],[Z(107),Z(8490)],[Z(229),Z(8491)],[Z(969),Z(8486)]]),xm=new Map([Xe(453),Xe(456),Xe(459),Xe(498),...Ki(8072,8079),...Ki(8088,8095),...Ki(8104,8111),Xe(8124),Xe(8140),Xe(8188)]),Lm=new Map([["alnum",z`[\p{Alpha}\p{Nd}]`],["alpha",z`\p{Alpha}`],["ascii",z`\p{ASCII}`],["blank",z`[\p{Zs}\t]`],["cntrl",z`\p{Cc}`],["digit",z`\p{Nd}`],["graph",z`[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]`],["lower",z`\p{Lower}`],["print",z`[[\P{space}&&\P{Cc}&&\P{Cn}&&\P{Cs}]\p{Zs}]`],["punct",z`[\p{P}\p{S}]`],["space",z`\p{space}`],["upper",z`\p{Upper}`],["word",z`[\p{Alpha}\p{M}\p{Nd}\p{Pc}]`],["xdigit",z`\p{AHex}`]]);function Tm(e,t){const n=[];for(let i=e;i<=t;i++)n.push(i);return n}function Xe(e){const t=Z(e);return[t.toLowerCase(),t]}function Ki(e,t){return Tm(e,t).map(n=>Xe(n))}var $l=new Set(["Lower","Lowercase","Upper","Uppercase","Ll","Lowercase_Letter","Lt","Titlecase_Letter","Lu","Uppercase_Letter"]);function Rm(e,t){const n={accuracy:"default",asciiWordBoundaries:!1,avoidSubclass:!1,bestEffortTarget:"ES2025",...t};Fl(e);const i={accuracy:n.accuracy,asciiWordBoundaries:n.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,flagDirectivesByAlt:new Map,jsGroupNameMap:new Map,minTargetEs2024:zr(n.bestEffortTarget,"ES2024"),passedLookbehind:!1,strategy:null,subroutineRefMap:new Map,supportedGNodes:new Set,digitIsAscii:e.flags.digitIsAscii,spaceIsAscii:e.flags.spaceIsAscii,wordIsAscii:e.flags.wordIsAscii};Wt(e,Am,i);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:i.subroutineRefMap};Wt(e,Im,o);const s={groupsByName:o.groupsByName,highestOrphanBackref:0,numCapturesToLeft:0,reffedNodesByReferencer:o.reffedNodesByReferencer};return Wt(e,Pm,s),e._originMap=o.groupOriginByCopy,e._strategy=i.strategy,e}var Am={AbsenceFunction({node:e,parent:t,replaceWith:n}){const{body:i,kind:r}=e;if(r==="repeater"){const o=Ee();o.body[0].body.push(at({negate:!0,body:i}),Ct("Any"));const s=Ee();s.body[0].body.push(Pl("greedy",0,1/0,o)),n(K(s,t),{traverse:!0})}else throw new Error('Unsupported absence function "(?~|"')},Alternative:{enter({node:e,parent:t,key:n},{flagDirectivesByAlt:i}){const r=e.body.filter(o=>o.kind==="flags");for(let o=n+1;o<t.body.length;o++){const s=t.body[o];rn(i,s,[]).push(...r)}},exit({node:e},{flagDirectivesByAlt:t}){if(t.get(e)?.length){const n=Ul(t.get(e));if(n){const i=Ee({flags:n});i.body[0].body=e.body,e.body=[K(i,e)]}}}},Assertion({node:e,parent:t,key:n,container:i,root:r,remove:o,replaceWith:s},l){const{kind:a,negate:d}=e,{asciiWordBoundaries:c,avoidSubclass:u,supportedGNodes:h,wordIsAscii:f}=l;if(a==="text_segment_boundary")throw new Error(`Unsupported text segment boundary "\\${d?"Y":"y"}"`);if(a==="line_end")s(K(at({body:[ft({body:[Or("string_end")]}),ft({body:[Ti(10)]})]}),t));else if(a==="line_start")s(K(Ue(z`(?<=\A|\n(?!\z))`,{skipLookbehindValidation:!0}),t));else if(a==="search_start")if(h.has(e))r.flags.sticky=!0,o();else{const g=i[n-1];if(g&&Vm(g))s(K(at({negate:!0}),t));else{if(u)throw new Error(z`Uses "\G" in a way that requires a subclass`);s(Qe(Or("string_start"),t)),l.strategy="clip_search"}}else if(!(a==="string_end"||a==="string_start"))if(a==="string_end_newline")s(K(Ue(z`(?=\n?\z)`),t));else if(a==="word_boundary"){if(!f&&!c){const g=`(?:(?<=${Be})(?!${Be})|(?<!${Be})(?=${Be}))`,y=`(?:(?<=${Be})(?=${Be})|(?<!${Be})(?!${Be}))`;s(K(Ue(d?y:g),t))}}else throw new Error(`Unexpected assertion kind "${a}"`)},Backreference({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Qi(n)&&(n=Xi(n,t),e.ref=n)},CapturingGroup({node:e},{jsGroupNameMap:t,subroutineRefMap:n}){let{name:i}=e;i&&!Qi(i)&&(i=Xi(i,t),e.name=i),n.set(e.number,e),i&&n.set(i,e)},CharacterClassRange({node:e,parent:t,replaceWith:n}){if(t.kind==="intersection"){const i=Gn({body:[e]});n(K(i,t),{traverse:!0})}},CharacterSet({node:e,parent:t,replaceWith:n},{accuracy:i,minTargetEs2024:r,digitIsAscii:o,spaceIsAscii:s,wordIsAscii:l}){const{kind:a,negate:d,value:c}=e;if(o&&(a==="digit"||c==="digit")){n(Qe(Hr("digit",{negate:d}),t));return}if(s&&(a==="space"||c==="space")){n(K(Yi(Ue(Sm),d),t));return}if(l&&(a==="word"||c==="word")){n(Qe(Hr("word",{negate:d}),t));return}if(a==="any")n(Qe(Ct("Any"),t));else if(a==="digit")n(Qe(Ct("Nd",{negate:d}),t));else if(a!=="dot")if(a==="text_segment"){if(i==="strict")throw new Error(z`Use of "\X" requires non-strict accuracy`);const u="\\p{Emoji}(?:\\p{EMod}|\\uFE0F\\u20E3?|[\\x{E0020}-\\x{E007E}]+\\x{E007F})?",h=z`\p{RI}{2}|${u}(?:\u200D${u})*`;n(K(Ue(z`(?>\r\n|${r?z`\p{RGI_Emoji}`:h}|\P{M}\p{M}*)`,{skipPropertyNameValidation:!0}),t))}else if(a==="hex")n(Qe(Ct("AHex",{negate:d}),t));else if(a==="newline")n(K(Ue(d?`[^
151
+ ]`:`(?>\r
152
+ ?|[
153
+ \v\f…\u2028\u2029])`),t));else if(a==="posix")if(!r&&(c==="graph"||c==="print")){if(i==="strict")throw new Error(`POSIX class "${c}" requires min target ES2024 or non-strict accuracy`);let u={graph:"!-~",print:" -~"}[c];d&&(u=`\0-${Z(u.codePointAt(0)-1)}${Z(u.codePointAt(2)+1)}-􏿿`),n(K(Ue(`[${u}]`),t))}else n(K(Yi(Ue(Lm.get(c)),d),t));else if(a==="property")_o.has(Ri(c))||(e.key="sc");else if(a==="space")n(Qe(Ct("space",{negate:d}),t));else if(a==="word")n(K(Yi(Ue(Be),d),t));else throw new Error(`Unexpected character set kind "${a}"`)},Directive({node:e,parent:t,root:n,remove:i,replaceWith:r,removeAllPrevSiblings:o,removeAllNextSiblings:s}){const{kind:l,flags:a}=e;if(l==="flags")if(!a.enable&&!a.disable)i();else{const d=Ee({flags:a});d.body[0].body=s(),r(K(d,t),{traverse:!0})}else if(l==="keep"){const d=n.body[0],u=n.body.length===1&&Rl(d,{type:"Group"})&&d.body[0].body.length===1?d.body[0]:n;if(t.parent!==u||u.body.length>1)throw new Error(z`Uses "\K" in a way that's unsupported`);const h=at({behind:!0});h.body[0].body=o(),r(K(h,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(n=>delete e[n]),Object.assign(e,{global:!1,hasIndices:!1,multiline:!1,sticky:e.sticky??!1}),t.options={disable:{x:!0,n:!0},force:{v:!0}}},Group({node:e}){if(!e.flags)return;const{enable:t,disable:n}=e.flags;t?.extended&&delete t.extended,n?.extended&&delete n.extended,t?.dotAll&&n?.dotAll&&delete t.dotAll,t?.ignoreCase&&n?.ignoreCase&&delete t.ignoreCase,t&&!Object.keys(t).length&&delete e.flags.enable,n&&!Object.keys(n).length&&delete e.flags.disable,!e.flags.enable&&!e.flags.disable&&delete e.flags},LookaroundAssertion({node:e},t){const{kind:n}=e;n==="lookbehind"&&(t.passedLookbehind=!0)},NamedCallout({node:e,parent:t,replaceWith:n}){const{kind:i}=e;if(i==="fail")n(K(at({negate:!0}),t));else throw new Error(`Unsupported named callout "(*${i.toUpperCase()}"`)},Quantifier({node:e}){if(e.body.type==="Quantifier"){const t=Ee();t.body[0].body.push(e.body),e.body=K(t,e)}},Regex:{enter({node:e},{supportedGNodes:t}){const n=[];let i=!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=Wl(o.body);s?(i=!0,Array.isArray(s)?n.push(...s):n.push(s)):r=!0}i&&!r&&n.forEach(o=>t.add(o))},exit(e,{accuracy:t,passedLookbehind:n,strategy:i}){if(t==="strict"&&n&&i)throw new Error(z`Uses "\G" in a way that requires non-strict accuracy`)}},Subroutine({node:e},{jsGroupNameMap:t}){let{ref:n}=e;typeof n=="string"&&!Qi(n)&&(n=Xi(n,t),e.ref=n)}},Im={Backreference({node:e},{multiplexCapturesToLeftByRef:t,reffedNodesByReferencer:n}){const{orphan:i,ref:r}=e;i||n.set(e,[...t.get(r).map(({node:o})=>o)])},CapturingGroup:{enter({node:e,parent:t,replaceWith:n,skip:i},{groupOriginByCopy:r,groupsByName:o,multiplexCapturesToLeftByRef:s,openRefs:l,reffedNodesByReferencer:a}){const d=r.get(e);if(d&&l.has(e.number)){const u=Qe(_s(e.number),t);a.set(u,l.get(e.number)),n(u);return}l.set(e.number,e),s.set(e.number,[]),e.name&&rn(s,e.name,[]);const c=s.get(e.name??e.number);for(let u=0;u<c.length;u++){const h=c[u];if(d===h.node||d&&d===h.origin||e===h.origin){c.splice(u,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 u=rn(o,e.name,new Map);let h=!1;if(d)h=!0;else for(const f of u.values())if(!f.hasDuplicateNameToRemove){h=!0;break}o.get(e.name).set(e,{node:e,hasDuplicateNameToRemove:h})}},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=di(t.currentFlags,e.flags))},exit(e,t){t.currentFlags=t.prevFlags}},Subroutine({node:e,parent:t,replaceWith:n},i){const{isRecursive:r,ref:o}=e;if(r){let c=t;for(;(c=c.parent)&&!(c.type==="CapturingGroup"&&(c.name===o||c.number===o)););i.reffedNodesByReferencer.set(e,c);return}const s=i.subroutineRefMap.get(o),l=o===0,a=l?_s(0):Bl(s,i.groupOriginByCopy,null);let d=a;if(!l){const c=Ul(Om(s,h=>h.type==="Group"&&!!h.flags)),u=c?di(i.globalFlags,c):i.globalFlags;Dm(u,i.currentFlags)||(d=Ee({flags:Nm(u)}),d.body[0].body.push(a))}n(K(d,t),{traverse:!l})}},Pm={Backreference({node:e,parent:t,replaceWith:n},i){if(e.orphan){i.highestOrphanBackref=Math.max(i.highestOrphanBackref,e.ref);return}const o=i.reffedNodesByReferencer.get(e).filter(s=>Mm(s,e));if(!o.length)n(K(at({negate:!0}),t));else if(o.length>1){const s=Ee({atomic:!0,body:o.reverse().map(l=>ft({body:[Nr(l.number)]}))});n(K(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 n=Math.max(t.highestOrphanBackref-t.numCapturesToLeft,0);for(let i=0;i<n;i++){const r=Il();e.body.at(-1).body.push(r)}}},Subroutine({node:e},t){!e.isRecursive||e.ref===0||(e.ref=t.reffedNodesByReferencer.get(e).number)}};function Fl(e){Wt(e,{"*"({node:t,parent:n}){t.parent=n}})}function Dm(e,t){return e.dotAll===t.dotAll&&e.ignoreCase===t.ignoreCase}function Mm(e,t){let n=t;do{if(n.type==="Regex")return!1;if(n.type==="Alternative")continue;if(n===e)return!1;const i=Gl(n.parent);for(const r of i){if(r===n)break;if(r===e||ql(r,e))return!0}}while(n=n.parent);throw new Error("Unexpected path")}function Bl(e,t,n,i){const r=Array.isArray(e)?[]:{};for(const[o,s]of Object.entries(e))o==="parent"?r.parent=Array.isArray(n)?i:n:s&&typeof s=="object"?r[o]=Bl(s,t,r,n):(o==="type"&&s==="CapturingGroup"&&t.set(r,t.get(e)??e),r[o]=s);return r}function _s(e){const t=Dl(e);return t.isRecursive=!0,t}function Om(e,t){const n=[];for(;e=e.parent;)(!t||t(e))&&n.push(e);return n}function Xi(e,t){if(t.has(e))return t.get(e);const n=`$${t.size}_${e.replace(/^[^$_\p{IDS}]|[^$\u200C\u200D\p{IDC}]/ug,"_")}`;return t.set(e,n),n}function Ul(e){const t=["dotAll","ignoreCase"],n={enable:{},disable:{}};return e.forEach(({flags:i})=>{t.forEach(r=>{i.enable?.[r]&&(delete n.disable[r],n.enable[r]=!0),i.disable?.[r]&&(n.disable[r]=!0)})}),Object.keys(n.enable).length||delete n.enable,Object.keys(n.disable).length||delete n.disable,n.enable||n.disable?n:null}function Nm({dotAll:e,ignoreCase:t}){const n={};return(e||t)&&(n.enable={},e&&(n.enable.dotAll=!0),t&&(n.enable.ignoreCase=!0)),(!e||!t)&&(n.disable={},!e&&(n.disable.dotAll=!0),!t&&(n.disable.ignoreCase=!0)),n}function Gl(e){if(!e)throw new Error("Node expected");const{body:t}=e;return Array.isArray(t)?t:t?[t]:null}function Wl(e){const t=e.find(n=>n.kind==="search_start"||zm(n,{negate:!1})||!Hm(n));if(!t)return null;if(t.kind==="search_start")return t;if(t.type==="LookaroundAssertion")return t.body[0].body[0];if(t.type==="CapturingGroup"||t.type==="Group"){const n=[];for(const i of t.body){const r=Wl(i.body);if(!r)return null;Array.isArray(r)?n.push(...r):n.push(r)}return n}return null}function ql(e,t){const n=Gl(e)??[];for(const i of n)if(i===t||ql(i,t))return!0;return!1}function Hm({type:e}){return e==="Assertion"||e==="Directive"||e==="LookaroundAssertion"}function Vm(e){const t=["Character","CharacterClass","CharacterSet"];return t.includes(e.type)||e.type==="Quantifier"&&e.min&&t.includes(e.body.type)}function zm(e,t){const n={negate:null,...t};return e.type==="LookaroundAssertion"&&(n.negate===null||e.negate===n.negate)&&e.body.length===1&&Rl(e.body[0],{type:"Assertion",kind:"search_start"})}function Qi(e){return/^[$_\p{IDS}][$\u200C\u200D\p{IDC}]*$/u.test(e)}function Ue(e,t){const i=Al(e,{...t,unicodePropertyMap:_o}).body;return i.length>1||i[0].body.length>1?Ee({body:i}):i[0].body[0]}function Yi(e,t){return e.negate=t,e}function Qe(e,t){return e.parent=t,e}function K(e,t){return Fl(e),e.parent=t,e}function $m(e,t){const n=Vl(t),i=zr(n.target,"ES2024"),r=zr(n.target,"ES2025"),o=n.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 f=[e.flags.ignoreCase];Wt(e,Fm,{getCurrentModI:()=>f.at(-1),popModI(){f.pop()},pushModI(g){f.push(g)},setHasCasedChar(){f.at(-1)?s=!0:l=!0}})}const a={dotAll:e.flags.dotAll,ignoreCase:!!((e.flags.ignoreCase||s)&&!l)};let d=e;const c={accuracy:n.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:i,verbose:n.verbose};function u(f){return c.lastNode=d,d=f,_m(Bm[f.type],`Unexpected node type "${f.type}"`)(f,c,u)}const h={pattern:e.body.map(u).join("|"),flags:u(e.flags),options:{...e.options}};return i||(delete h.options.force.v,h.options.disable.v=!0,h.options.unicodeSetsPlugin=null),h._captureTransfers=new Map,h._hiddenCaptures=[],c.captureMap.forEach((f,g)=>{f.hidden&&h._hiddenCaptures.push(g),f.transferTo&&rn(h._captureTransfers,f.transferTo,[]).push(g)}),h}var Fm={"*":{enter({node:e},t){if(Ss(e)){const n=t.getCurrentModI();t.pushModI(e.flags?di({ignoreCase:n},e.flags).ignoreCase:n)}},exit({node:e},t){Ss(e)&&t.popModI()}},Backreference(e,t){t.setHasCasedChar()},Character({node:e},t){wo(Z(e.value))&&t.setHasCasedChar()},CharacterClassRange({node:e,skip:t},n){t(),jl(e,{firstOnly:!0}).length&&n.setHasCasedChar()},CharacterSet({node:e},t){e.kind==="property"&&$l.has(e.value)&&t.setHasCasedChar()}},Bm={Alternative({body:e},t,n){return e.map(n).join("")},Assertion({kind:e,negate:t}){if(e==="string_end")return"$";if(e==="string_start")return"^";if(e==="word_boundary")return t?z`\B`:z`\b`;throw new Error(`Unexpected assertion kind "${e}"`)},Backreference({ref:e},t){if(typeof e!="number")throw new Error("Unexpected named backref in transformed AST");if(!t.useFlagMods&&t.accuracy==="strict"&&t.currentFlags.ignoreCase&&!t.captureMap.get(e).ignoreCase)throw new Error("Use of case-insensitive backref to case-sensitive group requires target ES2025 or non-strict accuracy");return"\\"+e},CapturingGroup(e,t,n){const{body:i,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}>`:""}${i.map(n).join("|")})`},Character({value:e},t){const n=Z(e),i=yt(e,{escDigit:t.lastNode.type==="Backreference",inCharClass:t.inCharClass,useFlagV:t.useFlagV});if(i!==n)return i;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase&&wo(n)){const r=zl(n);return t.inCharClass?r.join(""):r.length>1?`[${r.join("")}]`:r[0]}return n},CharacterClass(e,t,n){const{kind:i,negate:r,parent:o}=e;let{body:s}=e;if(i==="intersection"&&!t.useFlagV)throw new Error("Use of character class intersection requires min target ES2024");xe.bugFlagVLiteralHyphenIsRange&&t.useFlagV&&s.some(Cs)&&(s=[Ti(45),...s.filter(d=>!Cs(d))]);const l=()=>`[${r?"^":""}${s.map(n).join(i==="intersection"?"&&":"")}]`;if(!t.inCharClass){if((!t.useFlagV||xe.bugNestedClassIgnoresNegation)&&!r){const c=s.filter(u=>u.type==="CharacterClass"&&u.kind==="union"&&u.negate);if(c.length){const u=Ee(),h=u.body[0];return u.parent=o,h.parent=u,s=s.filter(f=>!c.includes(f)),e.body=s,s.length?(e.parent=h,h.body.push(e)):u.body.pop(),c.forEach(f=>{const g=ft({body:[f]});f.parent=g,g.parent=u,u.body.push(g)}),n(u)}}t.inCharClass=!0;const d=l();return t.inCharClass=!1,d}const a=s[0];if(i==="union"&&!r&&a&&((!t.useFlagV||!t.verbose)&&o.kind==="union"&&!(xe.bugFlagVLiteralHyphenIsRange&&t.useFlagV)||!t.verbose&&o.kind==="intersection"&&s.length===1&&a.type!=="CharacterClassRange"))return s.map(n).join("");if(!t.useFlagV&&o.type==="CharacterClass")throw new Error("Uses nested character class in a way that requires min target ES2024");return l()},CharacterClassRange(e,t){const n=e.min.value,i=e.max.value,r={escDigit:!1,inCharClass:!0,useFlagV:t.useFlagV},o=yt(n,r),s=yt(i,r),l=new Set;if(t.useAppliedIgnoreCase&&t.currentFlags.ignoreCase){const a=jl(e);jm(a).forEach(c=>{l.add(Array.isArray(c)?`${yt(c[0],r)}-${yt(c[1],r)}`:yt(c,r))})}return`${o}-${s}${[...l].join("")}`},CharacterSet({kind:e,negate:t,value:n,key:i},r){if(e==="dot")return r.currentFlags.dotAll?r.appliedGlobalFlags.dotAll||r.useFlagMods?".":"[^]":z`[^\n]`;if(e==="digit")return t?z`\D`:z`\d`;if(e==="property"){if(r.useAppliedIgnoreCase&&r.currentFlags.ignoreCase&&$l.has(n))throw new Error(`Unicode property "${n}" can't be case-insensitive when other chars have specific case`);return`${t?z`\P`:z`\p`}{${i?`${i}=`:""}${n}}`}if(e==="word")return t?z`\W`:z`\w`;throw new Error(`Unexpected character set kind "${e}"`)},Flags(e,t){return(t.appliedGlobalFlags.ignoreCase?"i":"")+(e.dotAll?"s":"")+(e.sticky?"y":"")},Group({atomic:e,body:t,flags:n,parent:i},r,o){const s=r.currentFlags;n&&(r.currentFlags=di(s,n));const l=t.map(o).join("|"),a=!r.verbose&&t.length===1&&i.type!=="Quantifier"&&!e&&(!r.useFlagMods||!n)?l:`(?${Km(e,n,r.useFlagMods)}${l})`;return r.currentFlags=s,a},LookaroundAssertion({body:e,kind:t,negate:n},i,r){return`(?${`${t==="lookahead"?"":"<"}${n?"!":"="}`}${e.map(r).join("|")})`},Quantifier(e,t,n){return n(e.body)+Xm(e)},Subroutine({isRecursive:e,ref:t},n){if(!e)throw new Error("Unexpected non-recursive subroutine in transformed AST");const i=n.recursionLimit;return t===0?`(?R=${i})`:z`\g<${t}&R=${i}>`}},Um=new Set(["$","(",")","*","+",".","?","[","\\","]","^","{","|","}"]),Gm=new Set(["-","\\","]","^","["]),Wm=new Set(["(",")","-","/","[","\\","]","^","{","|","}","!","#","$","%","&","*","+",",",".",":",";","<","=",">","?","@","`","~"]),ws=new Map([[9,z`\t`],[10,z`\n`],[11,z`\v`],[12,z`\f`],[13,z`\r`],[8232,z`\u2028`],[8233,z`\u2029`],[65279,z`\uFEFF`]]),qm=/^\p{Cased}$/u;function wo(e){return qm.test(e)}function jl(e,t){const n=!!t?.firstOnly,i=e.min.value,r=e.max.value,o=[];if(i<65&&(r===65535||r>=131071)||i===65536&&r>=131071)return o;for(let s=i;s<=r;s++){const l=Z(s);if(!wo(l))continue;const a=zl(l).filter(d=>{const c=d.codePointAt(0);return c<i||c>r});if(a.length&&(o.push(...a),n))break}return o}function yt(e,{escDigit:t,inCharClass:n,useFlagV:i}){if(ws.has(e))return ws.get(e);if(e<32||e>126&&e<160||e>262143||t&&Qm(e))return e>255?`\\u{${e.toString(16).toUpperCase()}}`:`\\x${e.toString(16).toUpperCase().padStart(2,"0")}`;const r=n?i?Wm:Gm:Um,o=Z(e);return(r.has(o)?"\\":"")+o}function jm(e){const t=e.map(r=>r.codePointAt(0)).sort((r,o)=>r-o),n=[];let i=null;for(let r=0;r<t.length;r++)t[r+1]===t[r]+1?i??=t[r]:i===null?n.push(t[r]):(n.push([i,t[r]]),i=null);return n}function Km(e,t,n){if(e)return">";let i="";if(t&&n){const{enable:r,disable:o}=t;i=(r?.ignoreCase?"i":"")+(r?.dotAll?"s":"")+(o?"-":"")+(o?.ignoreCase?"i":"")+(o?.dotAll?"s":"")}return`${i}:`}function Xm({kind:e,max:t,min:n}){let i;return!n&&t===1?i="?":!n&&t===1/0?i="*":n===1&&t===1/0?i="+":n===t?i=`{${n}}`:i=`{${n},${t===1/0?"":t}}`,i+{greedy:"",lazy:"?",possessive:"+"}[e]}function Ss({type:e}){return e==="CapturingGroup"||e==="Group"||e==="LookaroundAssertion"}function Qm(e){return e>47&&e<58}function Cs({type:e,value:t}){return e==="Character"&&t===45}var Ym=class $r extends RegExp{#t=new Map;#e=null;#i;#n=null;#r=null;rawOptions={};get source(){return this.#i||"(?:)"}constructor(t,n,i){const r=!!i?.lazyCompile;if(t instanceof RegExp){if(i)throw new Error("Cannot provide options when copying a regexp");const o=t;super(o,n),this.#i=o.source,o instanceof $r&&(this.#t=o.#t,this.#n=o.#n,this.#r=o.#r,this.rawOptions=o.rawOptions)}else{const o={hiddenCaptures:[],strategy:null,transfers:[],...i};super(r?"":t,n),this.#i=t,this.#t=Zm(o.hiddenCaptures,o.transfers),this.#r=o.strategy,this.rawOptions=i??{}}r||(this.#e=this)}exec(t){if(!this.#e){const{lazyCompile:r,...o}=this.rawOptions;this.#e=new $r(this.#i,this.flags,o)}const n=this.global||this.sticky,i=this.lastIndex;if(this.#r==="clip_search"&&n&&i){this.lastIndex=0;const r=this.#o(t.slice(i));return r&&(Jm(r,i,t,this.hasIndices),this.lastIndex+=i),r}return this.#o(t)}#o(t){this.#e.lastIndex=this.lastIndex;const n=super.exec.call(this.#e,t);if(this.lastIndex=this.#e.lastIndex,!n||!this.#t.size)return n;const i=[...n];n.length=1;let r;this.hasIndices&&(r=[...n.indices],n.indices.length=1);const o=[0];for(let s=1;s<i.length;s++){const{hidden:l,transferTo:a}=this.#t.get(s)??{};if(l?o.push(null):(o.push(n.length),n.push(i[s]),this.hasIndices&&n.indices.push(r[s])),a&&i[s]!==void 0){const d=o[a];if(!d)throw new Error(`Invalid capture transfer to "${d}"`);if(n[d]=i[s],this.hasIndices&&(n.indices[d]=r[s]),n.groups){this.#n||(this.#n=eg(this.source));const c=this.#n.get(a);c&&(n.groups[c]=i[s],this.hasIndices&&(n.indices.groups[c]=r[s]))}}}return n}};function Jm(e,t,n,i){if(e.index+=t,e.input=n,i){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 Zm(e,t){const n=new Map;for(const i of e)n.set(i,{hidden:!0});for(const[i,r]of t)for(const o of r)rn(n,o,{}).transferTo=i;return n}function eg(e){const t=/(?<capture>\((?:\?<(?![=!])(?<name>[^>]+)>|(?!\?)))|\\?./gsu,n=new Map;let i=0,r=0,o;for(;o=t.exec(e);){const{0:s,groups:{capture:l,name:a}}=o;s==="["?i++:i?s==="]"&&i--:l&&(r++,a&&n.set(r,a))}return n}function tg(e,t){const n=ng(e,t);return n.options?new Ym(n.pattern,n.flags,n.options):new RegExp(n.pattern,n.flags)}function ng(e,t){const n=Vl(t),i=Al(e,{flags:n.flags,normalizeUnknownPropertyNames:!0,rules:{captureGroup:n.rules.captureGroup,singleline:n.rules.singleline},skipBackrefValidation:n.rules.allowOrphanBackrefs,unicodePropertyMap:_o}),r=Rm(i,{accuracy:n.accuracy,asciiWordBoundaries:n.rules.asciiWordBoundaries,avoidSubclass:n.avoidSubclass,bestEffortTarget:n.target}),o=$m(r,n),s=vm(o.pattern,{captureTransfers:o._captureTransfers,hiddenCaptures:o._hiddenCaptures,mode:"external"}),l=gm(s.pattern),a=mm(l.pattern,{captureTransfers:s.captureTransfers,hiddenCaptures:s.hiddenCaptures}),d={pattern:a.pattern,flags:`${n.hasIndices?"d":""}${n.global?"g":""}${o.flags}${o.options.disable.v?"u":"v"}`};if(n.avoidSubclass){if(n.lazyCompileLength!==1/0)throw new Error("Lazy compilation requires subclass")}else{const c=a.hiddenCaptures.sort((g,y)=>g-y),u=Array.from(a.captureTransfers),h=r._strategy,f=d.pattern.length>=n.lazyCompileLength;(c.length||u.length||h||f)&&(d.options={...c.length&&{hiddenCaptures:c},...u.length&&{transfers:u},...h&&{strategy:h},...f&&{lazyCompile:f}})}return d}function Kl(e,t){return tg(e,{global:!0,hasIndices:!0,lazyCompileLength:3e3,rules:{allowOrphanBackrefs:!0,asciiWordBoundaries:!0,captureGroup:!0,recursionLimit:5,singleline:!0},...t})}function Xl(e={}){const t={target:"auto",cache:new Map,...e};return t.regexConstructor||=n=>Kl(n,{target:t.target}),{createScanner(n){return new yp(n,t)},createString(n){return{content:n}}}}za(so({bundledLanguages:()=>Jt,bundledLanguagesAlias:()=>lo,bundledLanguagesBase:()=>ao,bundledLanguagesInfo:()=>vi,bundledThemes:()=>uo,bundledThemesInfo:()=>co,codeToHast:()=>vl,codeToHtml:()=>bl,codeToTokens:()=>yl,codeToTokensBase:()=>_l,codeToTokensWithThemes:()=>wl,createHighlighter:()=>Li,createJavaScriptRegexEngine:()=>Xl,createOnigurumaEngine:()=>po,defaultJavaScriptRegexConstructor:()=>Kl,getLastGrammarState:()=>Cl,getSingletonHighlighter:()=>Sl,loadWasm:()=>fo}),vp);async function Ql(e){if(Va())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=zi.get(e);if(t!=null)return t;try{let n=ch.get(e);if(n==null&&Object.prototype.hasOwnProperty.call(Jt,e)&&(n=Jt[e]),n==null)throw new Error(`resolveLanguage: "${e}" not found in bundled or custom languages`);const i=n().then(({default:r})=>{const o={name:e,data:r};return ht.has(e)||ht.set(e,o),o});return zi.set(e,i),await i}finally{zi.delete(e)}}function Yl(e){return ht.get(e)??Ql(e)}const Fr=new Set;function on(e){const t=[],n=new Set;for(const u of ig(e.themes)){const h=Jl(u)?u.getThemes():[u];for(const f of h){if(n.has(f.name))throw new Error(`Theme collection already contains theme "${f.name}"`);n.add(f.name),t.push(f)}}const i=Object.freeze([...t]),r=Object.freeze(i.filter(u=>u.colorScheme==="light")),o=Object.freeze(i.filter(u=>u.colorScheme==="dark")),s=new Map(i.map(u=>[u.name,u])),l=Object.freeze(i.map(u=>u.name)),a=Object.freeze(r.map(u=>u.name)),d=Object.freeze(o.map(u=>u.name));function c(u){if(u==null)return i;const{colorScheme:h,collection:f}=u;return f==null?h==="light"?r:h==="dark"?o:i:i.filter(g=>g.collection!==f?!1:h==null||g.colorScheme===h)}return{getTheme(u){return s.get(u)},getThemes(u){return c(u)},getThemeNames(u){return u?.collection==null?u?.colorScheme==="light"?a:u?.colorScheme==="dark"?d:l:c(u).map(h=>h.name)},hasTheme(u){return s.has(u)},orderBy(u){return on({themes:i.map((h,f)=>({descriptor:h,index:f})).sort((h,f)=>{const g=u(h.descriptor,f.descriptor);return g!==0?g:h.index-f.index}).map(h=>h.descriptor)})},pick(u){const h=[],f=new Set;for(const g of u){if(f.has(g))throw new Error(`Theme collection pick already includes theme "${g}"`);f.add(g);const y=s.get(g);if(y==null)throw new Error(`Theme collection does not contain theme "${g}"`);h.push(y)}return on({themes:h})},registerInto(u){for(const h of i)u.registerThemeIfAbsent(h.name,h.load)}}}function ig(e){return rg(e)?[e]:e}function rg(e){return Jl(e)||og(e)}function og(e){return typeof e.name=="string"&&typeof e.load=="function"}function Jl(e){return typeof e.getThemes=="function"}function Zl(e){return e!==null&&typeof e=="object"&&"default"in e?e.default:e}var ed=class extends Error{constructor(e){super(`Theme "${e}" is already registered`),this.name="DuplicateThemeError"}},sg=class extends Error{constructor(e){super(`No loader registered for theme "${e}"`),this.name="UnregisteredThemeError"}},ag=class extends Error{constructor(e){super(`Theme "${e}" has not been resolved`),this.name="UnresolvedThemeError"}};function lg(){const e=new Map,t=new Map,n=new Map;let i=0;function r(b,p){if(e.has(b))throw new ed(b);e.set(b,p)}function o(b,p){return e.has(b)?!1:(e.set(b,p),!0)}function s(b){return e.has(b)}function l(b){const p=t.get(b);if(p!==void 0)return Promise.resolve(p);const v=n.get(b);if(v!==void 0)return v;const w=e.get(b);if(w===void 0)return Promise.reject(new sg(b));const S=i,k=w().then(E=>{const C=Zl(E);return S===i&&t.set(b,C),n.get(b)===k&&n.delete(b),C}).catch(E=>{throw n.get(b)===k&&n.delete(b),E});return n.set(b,k),k}function a(b){return Promise.all(b.map(p=>l(p)))}function d(b,p){t.set(b,p)}function c(b){for(const[p,v]of b)d(p,v)}function u(b){return t.get(b)}function h(b){const p=[];for(const v of b){const w=t.get(v);if(w===void 0)throw new ag(v);p.push(w)}return p}function f(b){return t.has(b)}function g(b){for(const p of b)if(!t.has(p))return!1;return!0}function y(b){const p=t.get(b);return p!==void 0?p:l(b)}function _(){i++,t.clear(),n.clear()}return{clearResolvedThemes:_,getResolvedOrResolveTheme:y,getResolvedTheme:u,getResolvedThemes:h,hasRegisteredTheme:s,hasResolvedTheme:f,hasResolvedThemes:g,registerTheme:r,registerThemeIfAbsent:o,resolveTheme:l,resolveThemes:a,seedResolvedTheme:d,seedResolvedThemes:c}}const Se=lg();function Br(e,t){e=Array.isArray(e)?e:[e];for(let n of e){let i;if(typeof n=="string"){if(i=Se.getResolvedTheme(n),i==null)throw new Error(`loadResolvedThemes: ${n} is not resolved, you must resolve it before calling loadResolvedThemes`)}else i=n,n=n.name,Se.getResolvedTheme(n)==null&&Se.seedResolvedTheme(n,i);Fr.has(n)||(Fr.add(n),t.loadThemeSync(i))}}function So({name:e,load:t,colorScheme:n,collection:i,displayName:r}){return{name:e,colorScheme:n,collection:i,displayName:r,load:dg(t)}}function dg(e){return async()=>ki(Zl(await e()))}const cg="pierre",td=["pierre-light","pierre-light-soft"],ug=["pierre-dark","pierre-dark-soft"],hg=[...td,...ug],fg=new Set(td);function pg(e){return fg.has(e)?"light":"dark"}const mg={"pierre-dark":"Pierre Dark","pierre-dark-soft":"Pierre Dark Soft","pierre-dark-vibrant":"Pierre Dark Vibrant","pierre-light":"Pierre Light","pierre-light-soft":"Pierre Light Soft","pierre-light-vibrant":"Pierre Light Vibrant"},gg={"pierre-dark":()=>m(()=>import("./pierre-dark-Dy3oF52j.js"),[]),"pierre-dark-soft":()=>m(()=>import("./pierre-dark-soft-K7D5SChL.js"),[]),"pierre-dark-vibrant":()=>m(()=>import("./pierre-dark-vibrant-KQ6p6T2R.js"),[]),"pierre-light":()=>m(()=>import("./pierre-light-DhMpYZcV.js"),[]),"pierre-light-soft":()=>m(()=>import("./pierre-light-soft-cPlVRKcQ.js"),[]),"pierre-light-vibrant":()=>m(()=>import("./pierre-light-vibrant-0cUW3kII.js"),[])};function bg(e){return async()=>({...(await gg[e]()).default,name:e})}function vg(e){return So({name:e,collection:cg,colorScheme:pg(e),displayName:mg[e],load:bg(e)})}const nd=on({themes:hg.map(e=>vg(e))}),yg="shiki",id=["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"],_g=["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"],wg=new Set(id);function Sg(e){return wg.has(e)?"light":"dark"}const Cg={andromeeda:()=>m(()=>import("./andromeeda-C4gqWexZ.js"),[]),"aurora-x":()=>m(()=>import("./aurora-x-D-2ljcwZ.js"),[]),"ayu-dark":()=>m(()=>import("./ayu-dark-DYE7WIF3.js"),[]),"ayu-light":()=>m(()=>import("./ayu-light-BA47KaF1.js"),[]),"ayu-mirage":()=>m(()=>import("./ayu-mirage-32ctXXKs.js"),[]),"catppuccin-frappe":()=>m(()=>import("./catppuccin-frappe-DFWUc33u.js"),[]),"catppuccin-latte":()=>m(()=>import("./catppuccin-latte-C9dUb6Cb.js"),[]),"catppuccin-macchiato":()=>m(()=>import("./catppuccin-macchiato-DQyhUUbL.js"),[]),"catppuccin-mocha":()=>m(()=>import("./catppuccin-mocha-D87Tk5Gz.js"),[]),"dark-plus":()=>m(()=>import("./dark-plus-C3mMm8J8.js"),[]),dracula:()=>m(()=>import("./dracula-BzJJZx-M.js"),[]),"dracula-soft":()=>m(()=>import("./dracula-soft-BXkSAIEj.js"),[]),"everforest-dark":()=>m(()=>import("./everforest-dark-BgDCqdQA.js"),[]),"everforest-light":()=>m(()=>import("./everforest-light-C8M2exoo.js"),[]),"github-dark":()=>m(()=>import("./github-dark-DHJKELXO.js"),[]),"github-dark-default":()=>m(()=>import("./github-dark-default-Cuk6v7N8.js"),[]),"github-dark-dimmed":()=>m(()=>import("./github-dark-dimmed-DH5Ifo-i.js"),[]),"github-dark-high-contrast":()=>m(()=>import("./github-dark-high-contrast-E3gJ1_iC.js"),[]),"github-light":()=>m(()=>import("./github-light-DAi9KRSo.js"),[]),"github-light-default":()=>m(()=>import("./github-light-default-D7oLnXFd.js"),[]),"github-light-high-contrast":()=>m(()=>import("./github-light-high-contrast-BfjtVDDH.js"),[]),"gruvbox-dark-hard":()=>m(()=>import("./gruvbox-dark-hard-CFHQjOhq.js"),[]),"gruvbox-dark-medium":()=>m(()=>import("./gruvbox-dark-medium-GsRaNv29.js"),[]),"gruvbox-dark-soft":()=>m(()=>import("./gruvbox-dark-soft-CVdnzihN.js"),[]),"gruvbox-light-hard":()=>m(()=>import("./gruvbox-light-hard-CH1njM8p.js"),[]),"gruvbox-light-medium":()=>m(()=>import("./gruvbox-light-medium-DRw_LuNl.js"),[]),"gruvbox-light-soft":()=>m(()=>import("./gruvbox-light-soft-hJgmCMqR.js"),[]),horizon:()=>m(()=>import("./horizon-BUw7H-hv.js"),[]),"horizon-bright":()=>m(()=>import("./horizon-bright-CUuTKBJd.js"),[]),houston:()=>m(()=>import("./houston-DnULxvSX.js"),[]),"kanagawa-dragon":()=>m(()=>import("./kanagawa-dragon-CkXjmgJE.js"),[]),"kanagawa-lotus":()=>m(()=>import("./kanagawa-lotus-CfQXZHmo.js"),[]),"kanagawa-wave":()=>m(()=>import("./kanagawa-wave-DWedfzmr.js"),[]),laserwave:()=>m(()=>import("./laserwave-DUszq2jm.js"),[]),"light-plus":()=>m(()=>import("./light-plus-B7mTdjB0.js"),[]),"material-theme":()=>m(()=>import("./material-theme-D5KoaKCx.js"),[]),"material-theme-darker":()=>m(()=>import("./material-theme-darker-BfHTSMKl.js"),[]),"material-theme-lighter":()=>m(()=>import("./material-theme-lighter-B0m2ddpp.js"),[]),"material-theme-ocean":()=>m(()=>import("./material-theme-ocean-CyktbL80.js"),[]),"material-theme-palenight":()=>m(()=>import("./material-theme-palenight-Csfq5Kiy.js"),[]),"min-dark":()=>m(()=>import("./min-dark-CafNBF8u.js"),[]),"min-light":()=>m(()=>import("./min-light-CTRr51gU.js"),[]),monokai:()=>m(()=>import("./monokai-D4h5O-jR.js"),[]),"night-owl":()=>m(()=>import("./night-owl-C39BiMTA.js"),[]),"night-owl-light":()=>m(()=>import("./night-owl-light-CMTm3GFP.js"),[]),nord:()=>m(()=>import("./nord-Ddv68eIx.js"),[]),"one-dark-pro":()=>m(()=>import("./one-dark-pro-DVMEJ2y_.js"),[]),"one-light":()=>m(()=>import("./one-light-C3Wv6jpd.js"),[]),plastic:()=>m(()=>import("./plastic-3e1v2bzS.js"),[]),poimandres:()=>m(()=>import("./poimandres-CS3Unz2-.js"),[]),red:()=>m(()=>import("./red-bN70gL4F.js"),[]),"rose-pine":()=>m(()=>import("./rose-pine-qdsjHGoJ.js"),[]),"rose-pine-dawn":()=>m(()=>import("./rose-pine-dawn-DHQR4-dF.js"),[]),"rose-pine-moon":()=>m(()=>import("./rose-pine-moon-D4_iv3hh.js"),[]),"slack-dark":()=>m(()=>import("./slack-dark-BthQWCQV.js"),[]),"slack-ochin":()=>m(()=>import("./slack-ochin-DqwNpetd.js"),[]),"snazzy-light":()=>m(()=>import("./snazzy-light-Bw305WKR.js"),[]),"solarized-dark":()=>m(()=>import("./solarized-dark-DXbdFlpD.js"),[]),"solarized-light":()=>m(()=>import("./solarized-light-L9t79GZl.js"),[]),"synthwave-84":()=>m(()=>import("./synthwave-84-CbfX1IO0.js"),[]),"tokyo-night":()=>m(()=>import("./tokyo-night-hegEt444.js"),[]),vesper:()=>m(()=>import("./vesper-DRje8inN.js"),[]),"vitesse-black":()=>m(()=>import("./vitesse-black-Bkuqu6BP.js"),[]),"vitesse-dark":()=>m(()=>import("./vitesse-dark-D0r3Knsf.js"),[]),"vitesse-light":()=>m(()=>import("./vitesse-light-CVO1_9PV.js"),[])};function ks(e){return So({name:e,collection:yg,colorScheme:Sg(e),load:Cg[e]})}const kg=Object.freeze([...id.map(e=>ks(e)),..._g.map(e=>ks(e))]),rd=on({themes:kg});on({themes:[nd,rd]});function od(e){if(Va())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(Se.hasRegisteredTheme(e))return;const t=rd.getTheme(e);if(t!=null){Se.registerThemeIfAbsent(t.name,t.load);return}throw new Error(`No valid theme loader registered for "${e}"`)}function sd(e,t){if(t.name!==e)throw new Error(`resolvedTheme: themeName: ${e} does not match theme.name: ${t.name}`)}async function Eg(e){od(e);const t=await Se.resolveTheme(e);return sd(e,t),t}function xg(e){return Se.getResolvedTheme(e)??Eg(e)}let Pe;async function ci({themes:e,langs:t,preferredHighlighter:n="shiki-js"}){Pe??=Li({themes:[],langs:["text"],engine:n==="shiki-wasm"?po(m(()=>import("./wasm-CG6Dc4jp.js"),[])):Xl()});const i=Lg(Pe)?await Pe:Pe;Pe=i;const r=[];for(const s of t){if(s==="text"||s==="ansi")continue;const l=Yl(s);"then"in l?r.push(l):Bo(l,i)}const o=[];for(const s of e){const l=xg(s);"then"in l?o.push(l):Br(l,Pe)}return(r.length>0||o.length>0)&&await Promise.all([Promise.all(r).then(s=>{Bo(s,i)}),Promise.all(o).then(s=>{Br(s,i)})]),i}function ad(){if(Pe!=null&&!("then"in Pe))return Pe}function Lg(e=Pe){return e!=null&&"then"in e}for(const e of nd.getThemes())Se.registerThemeIfAbsent(e.name,e.load);function sn(e=X){const t=[];return typeof e=="string"?t.push(e):(t.push(e.dark),t.push(e.light)),t}function qt(e){for(const t of sn(e))if(!Fr.has(t))return!1;return!0}function Ur(e){return Se.hasResolvedThemes(e)}function Je(e,t){return Rt(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength}function Me(e,t){return e?.cacheKey===t?.cacheKey&&e?.contents===t?.contents&&e?.name===t?.name&&e?.lang===t?.lang}function Pi(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 ld(e){return $({tagName:"div",children:[$({tagName:"div",children:e.annotations?.map(t=>$({tagName:"slot",properties:{name:t}})),properties:{"data-annotation-content":""}})],properties:{"data-line-annotation":`${e.hunkIndex},${e.lineIndex}`}})}function Tg(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 dd({fileOrDiff:e,mode:t,stickyHeader:n}){const i="type"in e?e:void 0,r={"data-diffs-header":t,"data-change-type":i?.type,"data-sticky":n?"":void 0};return $({tagName:"div",children:[t==="custom"?$({tagName:"slot",properties:{name:to}}):Rg({name:e.name,prevName:"prevName"in e?e.prevName:void 0,iconType:i?.type??"file"}),...t==="custom"?[]:[Ag(i)]],properties:r})}function Rg({name:e,prevName:t,iconType:n}){const i=[$({tagName:"slot",properties:{name:Zr}}),Qn({name:Tg(n),properties:{"data-change-icon":n}})];return t!=null&&(i.push($({tagName:"div",children:[$({tagName:"bdi",children:[Oe(t)]})],properties:{"data-prev-name":""}})),i.push(Qn({name:"diffs-icon-arrow-right-short",properties:{"data-rename-icon":""}}))),i.push($({tagName:"div",children:[$({tagName:"bdi",children:[Oe(e)]})],properties:{"data-title":""}})),$({tagName:"div",children:i,properties:{"data-header-content":""}})}function Ag(e){const t=[];if(e!=null){let n=0,i=0;for(const r of e.hunks)n+=r.additionLines,i+=r.deletionLines;(i>0||n===0)&&t.push($({tagName:"span",children:[Oe(`-${i}`)],properties:{"data-deletions-count":""}})),(n>0||i===0)&&t.push($({tagName:"span",children:[Oe(`+${n}`)],properties:{"data-additions-count":""}}))}return t.push($({tagName:"slot",properties:{name:eo}})),$({tagName:"div",children:t,properties:{"data-metadata":""}})}function cd(e){return $({tagName:"pre",properties:Ig(e)})}function Ig({diffIndicators:e,disableBackground:t,disableLineNumbers:n,overflow:i,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":i,"data-disable-line-numbers":n?"":void 0,"data-background":t?void 0:"","data-indicators":e==="bars"||e==="classic"?e:void 0,tabIndex:0,style:`--diffs-min-number-column-width-default:${`${o}`.length}ch;`}}const st=new Map;let Pg=0;const Ot={"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",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 ae(e){if(st.has(e))return st.get(e)??"text";if(Ot[e]!=null)return Ot[e];const t=e.match(/\.([^/\\]+\.[^/\\]+)$/);if(t!=null){if(st.has(t[1]))return st.get(t[1])??"text";if(Ot[t[1]]!=null)return Ot[t[1]]??"text"}const n=e.match(/\.([^.]+)$/)?.[1]??"";return st.has(n)?st.get(n)??"text":Ot[n]??"text"}function Dg(){return Pg}function Mg(){return Object.fromEntries(st)}function ud(e,{theme:t,preferredHighlighter:n="shiki-js"}){return{langs:[e??"text"],themes:sn(t),preferredHighlighter:n}}function pt(e){return`annotation-${"side"in e?`${e.side}-`:""}${e.lineNumber}`}function mt(e){return e.replace(/\n$|\r\n$/,"")}function Og(e,t,n){const i=typeof n.lineInfo=="function"?n.lineInfo(t):n.lineInfo[t-1];if(i==null){const r=`processLine: line ${t}, contains no state.lineInfo`;throw console.error(r,{node:e,line:t,state:n}),new Error(r)}return e.tagName="div",e.properties["data-line"]=i.lineNumber,e.properties["data-alt-line"]=i.altLineNumber,e.properties["data-line-type"]=i.type,e.properties["data-line-index"]=i.lineIndex,e.children.length===0&&e.children.push(Oe(`
154
+ `)),e}const xn=Symbol("no-token"),Ji=Symbol("multiple-tokens");function hd(e){const t=Ng(e);if(t!=null)return t;let n=xn;const i=[];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"){Hg(a,o);for(const d of a.children)Wn(d)}else Wn(a);i.push(a),r=[],o=void 0;return}for(const a of r)Wn(a);i.push($({tagName:"span",properties:{"data-char":o},children:r})),r=[],o=void 0},l=a=>{if(a!==xn){if(a===Ji){n=Ji;return}if(n===xn){n=a;return}n!==a&&(n=Ji)}};for(const a of e.children){const d=a.type==="element"?hd(a):xn;if(l(d),typeof d!="number"){s(),i.push(a);continue}o!=null&&o!==d&&s(),o??=d,r.push(a)}return s(),e.children=i,n}function Ng(e){const t=e.properties["data-char"];if(typeof t=="number")return t}function Wn(e){if(e.type==="element"){e.properties["data-char"]=void 0;for(const t of e.children)Wn(t)}}function Hg(e,t){e.properties["data-char"]=t}function Vg(e={}){const{classPrefix:t="__shiki_",classSuffix:n="",classReplacer:i=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+zg(a)+n;return d=i(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 c=s(d.htmlStyle);d.htmlStyle={},d.htmlAttrs||={},d.htmlAttrs.class?d.htmlAttrs.class+=` ${c}`:d.htmlAttrs.class=c}},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 zg(e,t=0){let n=3735928559^t,i=1103547991^t;for(let r=0,o;r<e.length;r++)o=e.charCodeAt(r),n=Math.imul(n^o,2654435761),i=Math.imul(i^o,1597334677);return n=Math.imul(n^n>>>16,2246822507),n^=Math.imul(i^i>>>13,3266489909),i=Math.imul(i^i>>>16,2246822507),i^=Math.imul(n^n>>>13,3266489909),(4294967296*(2097151&i)+(n>>>0)).toString(36).slice(0,6)}function fd(e=!1,t=!1){const n={lineInfo:[]},i=[{line(r){return delete r.properties.class,r},pre(r){const o=Oc(r),s=[];if(o!=null){let l=1;for(const a of o.children)a.type==="element"&&(e&&hd(a),s.push(Og(a,l,n)),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&&i.push($g,Es),{state:n,transformers:i,toClass:Es}}const Es=Vg({classPrefix:"hl-"}),$g={name:"token-style-normalizer",tokens(e){for(const t of e)for(const n of t){if(n.htmlStyle!=null)continue;const i={};n.color!=null&&(i.color=n.color),n.bgColor!=null&&(i["background-color"]=n.bgColor),n.fontStyle!=null&&n.fontStyle!==0&&((n.fontStyle&1)!==0&&(i["font-style"]="italic"),(n.fontStyle&2)!==0&&(i["font-weight"]="bold"),(n.fontStyle&4)!==0&&(i["text-decoration"]="underline")),Object.keys(i).length>0&&(n.htmlStyle=i)}}};function pe(e){return`--${e==="token"?"diffs-token":"diffs"}-`}const Fg=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,Bg=/^0(?:\.0+)?%?$/;function Ug(e){const t=e.indexOf("(");if(t<=0||!e.endsWith(")"))return;const n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;const i=e.slice(t+1,-1).trim();if(i.length===0)return;const r=i.lastIndexOf("/");if(r!==-1)return i.slice(r+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){const o=i.split(",");if(o.length===4)return o[3]?.trim()}}function Gg(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 n=t[1];let i,r=1;return n.length===3?i=n.split("").map(o=>o+o).join(""):n.length===6?i=n:(i=n.slice(0,6),r=parseInt(n.slice(6,8),16)/255),[parseInt(i.slice(0,2),16),parseInt(i.slice(2,4),16),parseInt(i.slice(4,6),16),r]}function Zi(e){if(e==null)return null;const t=Gg(e);if(t==null)return null;const n=t[0]/255,i=t[1]/255,r=t[2]/255,o=s=>s<=.03928?s/12.92:((s+.055)/1.055)**2.4;return .2126*o(n)+.7152*o(i)+.0722*o(r)}function xs(e){if(e==null)return!1;const t=e.trim().toLowerCase();if(t==="transparent"||Fg.test(t))return!0;const n=Ug(t);return n!=null&&Bg.test(n)}function Wg(e,t,n){if(t==null||n==null)return!1;const i=Zi(e),r=Zi(t),o=Zi(n);return i==null||r==null||o==null?!1:Math.abs(i-o)<Math.abs(i-r)}const Ls=new WeakMap;function er(e){const t=Ls.get(e);if(t!=null)return t;const n=e.colors??{},i={...n},r=n["editor.background"]??e.bg,o=n["editor.foreground"]??e.fg,s=n["sideBar.background"]??r,l=n["sideBar.foreground"]??o;Te(i,"editor.background",r),Te(i,"editor.foreground",o),Te(i,"sideBar.background",s),Te(i,"sideBar.foreground",l),Te(i,"input.background",n["input.background"]??s),Te(i,"sideBarSectionHeader.foreground",n["sideBarSectionHeader.foreground"]??l),Te(i,"list.activeSelectionForeground",n["list.activeSelectionForeground"]??l),Te(i,"gitDecoration.addedResourceForeground",tr(n["gitDecoration.addedResourceForeground"],n["terminal.ansiGreen"],n["editorGutter.addedBackground"])),Te(i,"gitDecoration.modifiedResourceForeground",tr(n["gitDecoration.modifiedResourceForeground"],n["terminal.ansiBlue"],n["editorGutter.modifiedBackground"])),Te(i,"gitDecoration.deletedResourceForeground",tr(n["gitDecoration.deletedResourceForeground"],n["terminal.ansiRed"],n["editorGutter.deletedBackground"]));const a=(xs(n["list.focusOutline"])?void 0:n["list.focusOutline"])??(xs(n.focusBorder)?void 0:n.focusBorder);a!=null?i["list.focusOutline"]=a:delete i["list.focusOutline"];const d=n["list.hoverBackground"];d!=null&&(qg(d,s)||Wg(d,s,l))&&delete i["list.hoverBackground"];const c=Object.freeze({...e,colors:Object.freeze(i)});return Ls.set(e,c),c}function Te(e,t,n){n!=null&&n!==""&&(e[t]=n)}function tr(...e){for(const t of e)if(t!=null&&t!=="")return t}function qg(e,t){return t!=null&&e.toLowerCase()===t.toLowerCase()}function pd({theme:e=X,highlighter:t,prefix:n}){let i="";if(typeof e=="string"){const r=t.getTheme(e),o=er(r);i+=`color:${o.fg};`,i+=`background-color:${o.bg};`,i+=`${pe("global")}fg:${o.fg};`,i+=`${pe("global")}bg:${o.bg};`,i+=nr(r,n)}else{let r=t.getTheme(e.dark),o=er(r);i+=`${pe("global")}dark:${o.fg};`,i+=`${pe("global")}dark-bg:${o.bg};`,i+=nr(r,"dark"),r=t.getTheme(e.light),o=er(r),i+=`${pe("global")}light:${o.fg};`,i+=`${pe("global")}light-bg:${o.bg};`,i+=nr(r,"light")}return i}function nr(e,t){t=t!=null?`${t}-`:"";let n="";const i=e.colors?.["gitDecoration.addedResourceForeground"]??e.colors?.["terminal.ansiGreen"];i!=null&&(n+=`${pe("global")}${t}addition-color:${i};`);const r=e.colors?.["gitDecoration.deletedResourceForeground"]??e.colors?.["terminal.ansiRed"];r!=null&&(n+=`${pe("global")}${t}deletion-color:${r};`);const o=e.colors?.["gitDecoration.modifiedResourceForeground"]??e.colors?.["terminal.ansiBlue"];return o!=null&&(n+=`${pe("global")}${t}modified-color:${o};`),n}function Gr(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 ui({lines:e,startingLine:t=0,totalLines:n=1/0,callback:i}){const r=Math.min(t+n,e.length),o=(()=>{const s=e.at(-1);return s===""||s===`
155
+ `||s===`\r
156
+ `||s==="\r"?Math.max(0,e.length-2):e.length-1})();for(let s=t;s<r;s++){const l=s===o;if(i({lineIndex:s,lineNumber:s+1,content:e[s],isLastLine:l})===!0||l)break}}function Wr(e){return e!==""?e.split(Tc):[]}const jg={forcePlainText:!1};function md(e,t,{theme:n=X,tokenizeMaxLineLength:i,useTokenTransformer:r},{forcePlainText:o,startingLine:s,totalLines:l,lines:a}=jg){o?(s??=0,l??=1/0):(s=0,l=1/0);const d=s>0||l<1/0,{state:c,transformers:u}=fd(r),h=o?"text":e.lang??ae(e.name),f=typeof n=="string"?t.getTheme(n).type:void 0,g=pd({theme:n,highlighter:t});c.lineInfo=p=>({type:"context",lineIndex:p-1+s,lineNumber:p+s});const y=typeof n=="string"?{lang:h,theme:n,transformers:u,defaultColor:!1,cssVariablePrefix:pe("token"),tokenizeMaxLineLength:i}:{lang:h,themes:n,transformers:u,defaultColor:!1,cssVariablePrefix:pe("token"),tokenizeMaxLineLength:i},_=Gr(t.codeToHast(d?Kg(a??Wr(e.contents),s,l):mt(e.contents),y)),b=d?new Array(s):_;return d&&b.push(..._),{code:b,themeStyles:g,baseThemeType:f}}function Kg(e,t,n){let i="";return ui({lines:e,startingLine:t,totalLines:n,callback({content:r}){i+=r}}),i}function gd(e,t){return $({tagName:"div",children:e,properties:{"data-content":"",style:`grid-row: span ${t}`}})}function an(e){return(e.lang??ae(e.name))==="text"}function bd(e){return e.useTokenTransformer===!0||e.onTokenClick!=null||e.onTokenEnter!=null||e.onTokenLeave!=null}let Xg=-1;var Qg=class{__id=`file-renderer:${++Xg}`;highlighter;renderCache;computedLang="text";lineAnnotations={};lineCache;constructor(e={theme:X},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=qt(e.theme??X)?ad():void 0)}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}setLineAnnotations(e){this.lineAnnotations={};for(const t of e){const n=this.lineAnnotations[t.lineNumber]??[];this.lineAnnotations[t.lineNumber]=n,n.push(t)}}cleanUp(){this.recycle(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.clearRenderCache(),this.highlighter=void 0,this.workerManager?.cleanUpTasks(this),this.lineCache=void 0}clearRenderCache(){this.renderCache=void 0}hydrate(e){const{options:t}=this.getRenderOptions(e),n=ir(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());let i=this.workerManager?.getFileResultCache(e);i!=null&&!Je(t,i.options)&&(i=void 0),this.renderCache??={file:e,options:t,highlighted:!n&&!an(e),result:n?void 0:i?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightFileAST(this,e):this.highlighter==null&&(this.computedLang=e.lang??ae(e.name),this.initializeHighlighter())}getRenderOptions(e){const t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getFileRenderOptions();const{theme:i=X,tokenizeMaxLineLength:r=1e3}=this.options;return{theme:i,useTokenTransformer:bd(this.options),tokenizeMaxLineLength:r}})(),{renderCache:n}=this;return n?.result==null?{options:t,forceHighlight:!0}:!Me(e,n.file)||!Je(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}getOrCreateLineCache(e){if(e.cacheKey==null)return this.lineCache=void 0,Wr(e.contents);let{lineCache:t}=this;return(t==null||t.cacheKey!==e.cacheKey)&&(t={cacheKey:e.cacheKey,lines:Wr(e.contents)}),this.lineCache=t,t.lines}renderFile(e=this.renderCache?.file,t=Kn){if(e==null)return;let{options:n,forceHighlight:i}=this.getRenderOptions(e);const r=this.getMatchingWorkerResultCache(e,n);r!=null&&!this.hasHighlightedRenderCache(e,n)&&(this.renderCache={file:e,highlighted:!0,renderRange:void 0,...r},i=!1),this.renderCache??={file:e,highlighted:!1,options:n,result:void 0,renderRange:void 0};const o=this.getOrCreateLineCache(e),s=e.contents.length>0,l=!s||an(e)||ir(o.length,this.getTokenizeMaxLength()),a=!Me(e,this.renderCache.file),d=!Pi(this.renderCache.renderRange,t);if(this.workerManager?.isWorkingPool()===!0)(l||this.renderCache.result==null||!this.renderCache.highlighted&&(a||d))&&(this.renderCache.file=e,this.renderCache.options=n,this.renderCache.highlighted=!1,(this.renderCache.result==null||a||d||i)&&(this.renderCache.result=this.workerManager.getPlainFileAST(e,t.startingLine,t.totalLines,o)),this.renderCache.renderRange=t),!l&&s&&(!this.renderCache.highlighted||i)&&this.workerManager.highlightFileAST(this,e);else{this.computedLang=e.lang??ae(e.name);const c=this.highlighter!=null&&qt(n.theme),u=this.highlighter!=null&&Jn(this.computedLang),h=!l&&u;if(this.highlighter!=null&&c&&(i||l||!this.renderCache.highlighted&&h||this.renderCache.result==null)){const{result:f,options:g}=this.renderFileWithHighlighter(e,this.highlighter,l||!u);this.renderCache={file:e,options:g,highlighted:h,result:f,renderRange:void 0}}(!c||!l&&!u)&&this.asyncHighlight(e).then(({result:f,options:g})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.onHighlightSuccess(e,f,g,!l)})}return this.renderCache.result!=null?this.processFileResult(this.renderCache.file,t,this.renderCache.result):void 0}async asyncRender(e,t=Kn){const{result:n}=await this.asyncHighlight(e);return this.processFileResult(e,t,n)}async asyncHighlight(e){const t=ir(this.getOrCreateLineCache(e).length,this.getTokenizeMaxLength());this.computedLang=t?"text":e.lang??ae(e.name);const n=this.highlighter!=null&&Ur(sn(this.options.theme)),i=t||this.highlighter!=null&&Jn(this.computedLang);return(this.highlighter==null||!n||!i)&&(this.highlighter=await this.initializeHighlighter()),this.renderFileWithHighlighter(e,this.highlighter,t)}renderFileWithHighlighter(e,t,n=!1){const{options:i}=this.getRenderOptions(e);return{result:md(e,t,i,{forcePlainText:n}),options:i}}processFileResult(e,t,{code:n,themeStyles:i,baseThemeType:r}){const{disableFileHeader:o=!1}=this.options,s=[],l=kt(),a=this.getOrCreateLineCache(e);let d=0;return ui({lines:a,startingLine:t.startingLine,totalLines:t.totalLines,callback:({lineIndex:c,lineNumber:u})=>{const h=n[c];if(h==null){const f="FileRenderer.processFileResult: Line doesnt exist";throw console.error(f,{name:e.name,lineIndex:c,lineNumber:u,lines:a}),new Error(f)}if(h!=null){l.children.push(Sa("context",u,`${c}`)),s.push(h),d++;const f=this.lineAnnotations[u];f!=null&&(l.children.push(ve("context","annotation",1)),s.push(ld({hunkIndex:0,lineIndex:u,annotations:f.map(g=>pt(g))})),d++)}}}),l.properties.style=`grid-row: span ${d}`,{gutterAST:l.children??[],contentAST:s,preAST:this.createPreElement(a.length),headerAST:o?void 0:this.renderHeader(e),totalLines:a.length,rowCount:d,themeStyles:i,baseThemeType:r,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderHeader(e){const{headerRenderMode:t="default",stickyHeader:n=!1}=this.options;return dd({fileOrDiff:e,mode:t,stickyHeader:n})}renderFullHTML(e){return Ne(this.renderFullAST(e))}renderFullAST(e,t=[]){return t.push($({tagName:"code",children:this.renderCodeAST(e),properties:{"data-code":""}})),{...e.preAST,children:t}}renderCodeAST(e){const t=kt();return t.children=e.gutterAST,t.properties.style=`grid-row: span ${e.rowCount}`,[t,gd(e.contentAST,e.rowCount)]}renderPartialHTML(e,t=!1){return Ne(t?$({tagName:"code",children:e,properties:{"data-code":""}}):e)}async initializeHighlighter(){return this.highlighter=await ci(ud(this.computedLang,this.options)),this.highlighter}onHighlightSuccess(e,t,n,i=!0){if(this.renderCache==null)return;const r=!Me(e,this.renderCache.file)||!this.renderCache.highlighted||!Je(n,this.renderCache.options);this.renderCache={file:e,options:n,highlighted:i,result:t,renderRange:void 0},r&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){const n=this.workerManager?.getFileResultCache(e);if(!(n==null||!Je(t,n.options)))return n}hasHighlightedRenderCache(e,t){const{renderCache:n}=this;return n?.result!=null&&n.highlighted&&Me(e,n.file)&&Je(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??Yt}createPreElement(e){const{disableLineNumbers:t=!1,overflow:n="scroll"}=this.options;return cd({type:"file",diffIndicators:"none",disableBackground:!0,disableLineNumbers:t,overflow:n,split:!1,totalLines:e})}};function ir(e,t){return e>t}const vd=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
157
+ <symbol id="diffs-icon-arrow-right-short" viewBox="0 0 16 16">
158
+ <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"/>
159
+ </symbol>
160
+ <symbol id="diffs-icon-brand-github" viewBox="0 0 16 16">
161
+ <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"/>
162
+ </symbol>
163
+ <symbol id="diffs-icon-chevron" viewBox="0 0 16 16">
164
+ <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"/>
165
+ </symbol>
166
+ <symbol id="diffs-icon-chevrons-narrow" viewBox="0 0 10 16">
167
+ <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"/>
168
+ </symbol>
169
+ <symbol id="diffs-icon-diff-split" viewBox="0 0 16 16">
170
+ <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"/>
171
+ </symbol>
172
+ <symbol id="diffs-icon-diff-unified" viewBox="0 0 16 16">
173
+ <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"/>
174
+ </symbol>
175
+ <symbol id="diffs-icon-expand" viewBox="0 0 16 16">
176
+ <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"/>
177
+ </symbol>
178
+ <symbol id="diffs-icon-expand-all" viewBox="0 0 16 16">
179
+ <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"/>
180
+ </symbol>
181
+ <symbol id="diffs-icon-file-code" viewBox="0 0 16 16">
182
+ <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"/>
183
+ </symbol>
184
+ <symbol id="diffs-icon-plus" viewBox="0 0 16 16">
185
+ <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"/>
186
+ </symbol>
187
+ <symbol id="diffs-icon-symbol-added" viewBox="0 0 16 16">
188
+ <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"/>
189
+ </symbol>
190
+ <symbol id="diffs-icon-symbol-deleted" viewBox="0 0 16 16">
191
+ <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"/>
192
+ </symbol>
193
+ <symbol id="diffs-icon-symbol-diffstat" viewBox="0 0 16 16">
194
+ <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"/>
195
+ </symbol>
196
+ <symbol id="diffs-icon-symbol-ignored" viewBox="0 0 16 16">
197
+ <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"/>
198
+ </symbol>
199
+ <symbol id="diffs-icon-symbol-modified" viewBox="0 0 16 16">
200
+ <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"/>
201
+ </symbol>
202
+ <symbol id="diffs-icon-symbol-moved" viewBox="0 0 16 16">
203
+ <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"/>
204
+ </symbol>
205
+ <symbol id="diffs-icon-symbol-ref" viewBox="0 0 16 16">
206
+ <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"/>
207
+ </symbol>
208
+ </svg>`;function Yg(e,t){return e.lineNumber===t.lineNumber&&e.metadata===t.metadata}function yd(e,t){return e==null||t==null?e===t:Jg(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 Ts={};function Jg(e=Ts,t=Ts){if(e===t)return!0;const n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(const r of n)if(e[r]!==t[r])return!1;return!0}function _d(e){const t=document.createElement("div");return t.dataset.annotationSlot="",t.slot=e,t.style.whiteSpace="normal",t}function wd(){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 Sd(){const e=document.createElement("style");return e.setAttribute(Qt,""),e}var Zg='@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;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}*,: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]:is([data-diff],[data-file]){--diffs-code-grid:var(--diffs-grid-number-column-width) minmax(0, 1fr)}:is([data-diff],[data-file]):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{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));-webkit-text-decoration:light-dark(var(--diffs-token-light-text-decoration,inherit),var(--diffs-token-dark-text-decoration,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]{--diffs-computed-decoration-bg:var(--diffs-bg);--diffs-computed-diff-line-bg:var(--diffs-bg);--diffs-computed-selected-line-bg:var(--diffs-bg);color:var(--diffs-fg);background-color:var(--diffs-line-bg,var(--diffs-bg))}@media (pointer:fine){:is([data-line],[data-gutter-buffer],[data-column-number],[data-line-annotation],[data-no-newline],[data-merge-conflict],[data-merge-conflict-actions]):where([data-hovered]){--diffs-computed-hovered-line-bg:light-dark(color-mix(in lab, var(--diffs-computed-selected-line-bg) 97%, var(--diffs-bg-hover-override,var(--diffs-mixer))),color-mix(in lab, var(--diffs-computed-selected-line-bg) 91%, var(--diffs-bg-hover-override,var(--diffs-mixer))));--diffs-line-bg:var(--diffs-computed-hovered-line-bg,inherit)}}[data-decoration-bg]:is([data-line],[data-no-newline]){--mix-deco-light:92%;--mix-deco-dark:85%}[data-decoration-bg][data-decoration-bg-depth="2"]:is([data-line],[data-no-newline]){--mix-deco-light:88%;--mix-deco-dark:80%}[data-decoration-bg][data-decoration-bg-depth="3"]:is([data-line],[data-no-newline]){--mix-deco-light:85%;--mix-deco-dark:78%}@media (pointer:fine){[data-decoration-bg][data-hovered]:is([data-line],[data-no-newline]):not([data-selected-line]){--mix-deco-light:85%;--mix-deco-dark:85%}[data-decoration-bg][data-hovered][data-decoration-bg-depth="2"]:is([data-line],[data-no-newline]):not([data-selected-line]){--mix-deco-light:83%;--mix-deco-dark:83%}[data-decoration-bg][data-hovered][data-decoration-bg-depth="3"]:is([data-line],[data-no-newline]):not([data-selected-line]){--mix-deco-light:81%;--mix-deco-dark:81%}}[data-decoration-bg]:is([data-line],[data-no-newline]){--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)));--diffs-computed-diff-line-bg:var(--diffs-computed-decoration-bg);--diffs-computed-selected-line-bg:var(--diffs-computed-decoration-bg);--diffs-line-bg:var(--diffs-computed-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-computed-diff-line-bg:var(--diffs-annotation-bg);--diffs-computed-selected-line-bg:var(--diffs-annotation-bg);--diffs-line-bg:var(--diffs-annotation-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-computed-diff-line-bg:var(--diffs-bg-context);--diffs-computed-selected-line-bg:var(--diffs-bg-context);--diffs-line-bg:var(--diffs-bg-context)}[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-computed-diff-line-bg:var(--diffs-computed-decoration-bg);--diffs-computed-selected-line-bg:var(--diffs-computed-decoration-bg);--diffs-line-bg:var(--diffs-computed-decoration-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-computed-diff-line-bg:var(--diffs-computed-decoration-bg);--diffs-computed-selected-line-bg:var(--diffs-computed-decoration-bg);--diffs-line-bg:var(--diffs-computed-decoration-bg)}[data-has-merge-conflict] [data-line-annotation],[data-has-merge-conflict] [data-gutter-buffer=annotation]{--diffs-computed-decoration-bg:var(--diffs-bg);--diffs-computed-diff-line-bg:var(--diffs-bg);--diffs-computed-selected-line-bg:var(--diffs-bg);--diffs-line-bg:var(--diffs-bg)}:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number]{--mix-light:91%;--mix-dark:85%}:where([data-background]) [data-line],:where([data-background]) [data-no-newline]{--mix-light:88%;--mix-dark:80%}:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]{--diffs-diff-line-mix-target:var(--diffs-bg)}[data-line-type=change-deletion]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--diffs-diff-line-mix-target:var(--diffs-bg-deletion-override,var(--diffs-deletion-base))}@media (pointer:fine){[data-line-type=change-deletion][data-hovered]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--mix-light:80%;--mix-dark:75%}}[data-line-type=change-deletion]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]):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))}[data-line-type=change-deletion]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--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)));--diffs-computed-selected-line-bg:var(--diffs-computed-diff-line-bg);--diffs-line-bg:var(--diffs-computed-diff-line-bg,inherit)}[data-line-type=change-addition]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--diffs-diff-line-mix-target:var(--diffs-bg-addition-override,var(--diffs-addition-base))}@media (pointer:fine){[data-line-type=change-addition][data-hovered]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--mix-light:80%;--mix-dark:70%}}[data-line-type=change-addition]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]):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))}[data-line-type=change-addition]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--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)));--diffs-computed-selected-line-bg:var(--diffs-computed-diff-line-bg);--diffs-line-bg:var(--diffs-computed-diff-line-bg,inherit)}[data-merge-conflict=current]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--diffs-diff-line-mix-target:var(--conflict-bg-current-override,var(--diffs-addition-base))}[data-merge-conflict=current]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]):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))}@media (pointer:fine){[data-merge-conflict=current][data-hovered]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--mix-light:80%;--mix-dark:70%}}[data-merge-conflict=current]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--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)));--diffs-computed-selected-line-bg:var(--diffs-computed-diff-line-bg);--diffs-line-bg:var(--diffs-computed-diff-line-bg,inherit)}[data-merge-conflict=incoming]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--diffs-diff-line-mix-target:var(--conflict-bg-incoming-override,var(--diffs-modified-base))}[data-merge-conflict=incoming]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]):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))}@media (pointer:fine){[data-merge-conflict=incoming][data-hovered]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--mix-light:80%;--mix-dark:70%}}[data-merge-conflict=incoming]:is(:where([data-background]) [data-gutter-buffer],:where([data-background]) [data-column-number],:where([data-background]) [data-line],:where([data-background]) [data-no-newline]){--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)));--diffs-computed-selected-line-bg:var(--diffs-computed-diff-line-bg);--diffs-line-bg:var(--diffs-computed-diff-line-bg,inherit)}[data-gutter-buffer],[data-column-number],[data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline]{--diffs-selection-mix-target:var(--diffs-bg-selection-override,var(--diffs-selection-base))}[data-selected-line]:is([data-gutter-buffer],[data-column-number],[data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline]):where([data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline]){--mix-selection-light:82%;--mix-selection-dark:75%}@media (pointer:fine){[data-selected-line][data-hovered]:is([data-gutter-buffer],[data-column-number],[data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline]):where([data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline]):not([data-merge-conflict],[data-line-type=change-addition],[data-line-type=change-deletion]){--mix-selection-light:75%;--mix-selection-dark:70%}}[data-selected-line]:is([data-gutter-buffer],[data-column-number],[data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline]):where([data-gutter-buffer],[data-column-number]){--mix-selection-light:75%;--mix-selection-dark:60%;--diffs-selection-mix-target:var(--diffs-bg-selection-number-override,var(--diffs-selection-base))}@media (pointer:fine){[data-selected-line][data-hovered]:is([data-gutter-buffer],[data-column-number],[data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline]):where([data-gutter-buffer],[data-column-number]):not([data-merge-conflict],[data-line-type=change-addition],[data-line-type=change-deletion]){--mix-selection-light:70%;--mix-selection-dark:55%}}[data-selected-line]:is([data-gutter-buffer],[data-column-number],[data-line],[data-line-annotation],[data-merge-conflict],[data-merge-conflict-actions],[data-no-newline]){--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)));--diffs-line-bg:var(--diffs-computed-selected-line-bg,inherit)}[data-selected-line]:is([data-gutter-buffer],[data-column-number]){color:var(--diffs-selection-number-fg)}[data-no-newline]{-webkit-user-select:none;user-select:none}[data-no-newline] span{opacity:.6}[data-diff-type=split][data-overflow=scroll]{grid-template-columns:1fr 1fr;display:grid}[data-diff-type=split][data-overflow=scroll] [data-additions]{border-left:1px solid var(--diffs-bg)}[data-diff-type=split][data-overflow=scroll] [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))}}:is([data-diffs-header]~[data-diff],[data-diffs-header]~[data-file]) [data-code],[data-overflow=wrap]:is([data-diffs-header]~[data-diff],[data-diffs-header]~[data-file]){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] [data-gutter-buffer],[data-gutter] [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]{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-diff-type=split][data-overflow=wrap] [data-deletions]{display:contents}:is([data-diff-type=split][data-overflow=wrap] [data-deletions]) [data-gutter]{grid-column:1}:is([data-diff-type=split][data-overflow=wrap] [data-deletions]) [data-content]{border-right:1px solid var(--diffs-bg);grid-column:2}[data-diff-type=split][data-overflow=wrap] [data-additions]{display:contents}:is([data-diff-type=split][data-overflow=wrap] [data-additions]) [data-gutter]{border-left:1px solid var(--diffs-bg);grid-column:3}:is([data-diff-type=split][data-overflow=wrap] [data-additions]) [data-content]{grid-column:4}[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]{-webkit-user-select:none;user-select:none;min-height:1lh;position:relative}[data-gutter-buffer]{padding-left:2ch;padding-right:1ch}[data-gutter-buffer]: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 4.242px, var(--diffs-bg-buffer) 4.242px, var(--diffs-bg-buffer) 5.656px);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]{-webkit-user-select:none;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=line-info] [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}[data-expand-button]:hover{color:var(--diffs-fg)}[data-expand-button][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}:is([data-separator=line-info],[data-separator=line-info-basic]) [data-separator-content]{-webkit-user-select:none;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}:is([data-unified] [data-separator=line-info] [data-separator-wrapper]) [data-separator-content]{border-radius:6px}[data-unified] [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-gutter] [data-separator=line-info] [data-separator-content]{border-top-left-radius:6px;border-bottom-left-radius:6px}[data-gutter] [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)}:is([data-additions] [data-content] [data-separator=line-info]) [data-separator-wrapper]{display:none}[data-additions] [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}:is([data-additions] [data-gutter] [data-separator=line-info] [data-separator-wrapper]) [data-separator-content],:is([data-additions] [data-gutter] [data-separator=line-info] [data-separator-wrapper]) [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}:is([data-overflow=wrap] [data-additions] [data-content] [data-separator=line-info] [data-separator-wrapper]) [data-separator-content],:is([data-overflow=wrap] [data-additions] [data-content] [data-separator=line-info] [data-separator-wrapper]) [data-expand-button]{display:none}:is([data-separator=line-info] [data-separator-wrapper]) [data-expand-both],:is([data-separator=line-info] [data-separator-wrapper]) [data-expand-down],:is([data-separator=line-info] [data-separator-wrapper]) [data-expand-up]{border-top-left-radius:6px;border-bottom-left-radius:6px}@media (pointer:fine){[data-separator-multi-button]:is([data-separator=line-info] [data-separator-wrapper]) [data-expand-up]{border-top-left-radius:6px;border-bottom-left-radius:unset}[data-separator-multi-button]:is([data-separator=line-info] [data-separator-wrapper]) [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}:is([data-separator=line-info-basic] [data-separator-wrapper][data-separator-multi-button]) [data-separator-content]{grid-column:unset;grid-row:unset}@supports (width:1cqi){:is([data-separator=line-info] [data-separator-wrapper]) [data-expand-both],:is([data-separator=line-info] [data-separator-wrapper]) [data-expand-down],:is([data-separator=line-info] [data-separator-wrapper]) [data-expand-up],[data-separator-multi-button]:is([data-separator=line-info] [data-separator-wrapper]) [data-expand-up]{border-top-left-radius:6px;border-bottom-left-radius:6px}[data-separator-multi-button]:is([data-separator=line-info] [data-separator-wrapper]) [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-wrapper][data-separator-multi-button] [data-separator-content]{grid-area:1/2/-1;min-width:min-content}[data-separator-wrapper][data-separator-multi-button] [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}:is(:is([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)}:is(:is([data-separator=line-info],[data-separator=line-info-basic]) [data-separator-multi-button]) [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}:is([data-no-newline]:is([data-indicators=classic] [data-line-type=change-addition],[data-indicators=classic] [data-line-type=change-deletion]),[data-line]:is([data-indicators=classic] [data-line-type=change-addition],[data-indicators=classic] [data-line-type=change-deletion])):before{-webkit-user-select:none;user-select:none;width:1ch;height:1lh;display:inline-block;position:absolute;top:0;left:0}:is([data-line]:is([data-indicators=classic] [data-line-type=change-addition]),[data-no-newline]:is([data-indicators=classic] [data-line-type=change-addition])):before{content:"+";color:var(--diffs-addition-base)}:is([data-line]:is([data-indicators=classic] [data-line-type=change-deletion]),[data-no-newline]:is([data-indicators=classic] [data-line-type=change-deletion])):before{content:"-";color:var(--diffs-deletion-base)}[data-column-number]:is([data-indicators=bars] [data-line-type=change-deletion],[data-indicators=bars] [data-line-type=change-addition]):before{content:"";-webkit-user-select:none;user-select:none;contain:strict;width:4px;height:100%;display:block;position:absolute;top:0;left:0}[data-column-number]:is([data-indicators=bars] [data-line-type=change-deletion]):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-column-number]:is([data-indicators=bars] [data-line-type=change-addition]):before{background-color:var(--diffs-addition-base)}[data-overflow=wrap] [data-line],[data-overflow=wrap] [data-annotation-content]{white-space:pre-wrap;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;-webkit-user-select:none;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-disable-line-numbers] [data-column-number]{min-width:4px;padding:0}:is([data-disable-line-numbers] [data-gutter-buffer],[data-disable-line-numbers] [data-column-number]):before{min-width:0}[data-disable-line-numbers] [data-line-number-content]{display:none}[data-disable-line-numbers] [data-gutter-utility-slot]{right:unset;justify-content:flex-start;left:0}[data-disable-line-numbers][data-indicators=bars] [data-gutter-utility-slot]{left:6px}[data-file][data-disable-line-numbers] [data-gutter-buffer],[data-file][data-disable-line-numbers] [data-column-number]{border-right:0;min-width:0}[data-diff-span]{-webkit-box-decoration-break:clone;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}:is([data-merge-conflict=marker-start],[data-merge-conflict=marker-end]):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;-webkit-user-select:none;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;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(1ch - 1lh);padding:0;display:flex;position:relative}[data-utility-button]: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"] [data-decoration-bar-stack]{background-color:color-mix(in lab, var(--diffs-bg) 20%, var(--diffs-decoration-bar-color,transparent))}[data-decoration-bar-depth="2"] [data-decoration-bar-stack]{background-color:color-mix(in lab, var(--diffs-bg) 45%, var(--diffs-decoration-bar-color,transparent))}[data-decoration-bar-depth="3"] [data-decoration-bar-stack]{background-color:color-mix(in lab, var(--diffs-bg) 65%, var(--diffs-decoration-bar-color,transparent))}[data-decoration-bar-start] [data-decoration-bar-stack]{border-top-left-radius:5px;border-top-right-radius:5px}[data-decoration-bar-end] [data-decoration-bar-stack]{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-wrapper] [data-error-message]{color:var(--diffs-deletion-base);font-size:18px;font-weight:700}[data-error-wrapper] [data-error-stack]{color:var(--diffs-fg-number)}}@layer theme,rendered,unsafe;';let Ln;function ln(e){if(Ln!=null)return Ln;const t=e.host;if(typeof HTMLElement<"u"&&t instanceof HTMLElement&&!t.isConnected)return;const n=document.createElement("div");n.setAttribute("data-code",""),n.setAttribute(Dc,"true");const i=document.createElement("div");return i.style.position="relative",i.style.width="200%",i.style.height="200%",n.appendChild(i),e.appendChild(n),Ln=Math.max(n.offsetHeight-n.clientHeight,0),n.remove(),Ln}function Cd(e){return`${ya}: ${e==null?"var(--diffs-scrollbar-gutter-fallback)":`${e}px`};`}const kd="@layer base, theme, rendered, unsafe;",eb=new RegExp(`${tb(ya)}\\s*:\\s*[^;]+;`);function Ed(e){return`${kd}
209
+ @layer unsafe {
210
+ ${e}
211
+ }`}function xd(e,t="system",n){return`${kd}
212
+ @layer rendered {
213
+ :host {${t==="system"?"":`
214
+ color-scheme: ${t};`}
215
+ ${Cd(n)}
216
+ ${e}
217
+ }
218
+ }`}function Ld(e,t){const n=Cd(t);return e.replace(eb,n)}function tb(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function qn({code:e,pre:t,columnType:n,rowSpan:i,containerSize:r=!1}={}){return e==null&&(e=document.createElement("code"),e.setAttribute("data-code",""),n!=null&&e.setAttribute(`data-${n}`,""),t?.appendChild(e)),i!=null?e.style.setProperty("grid-row",`span ${i}`):e.style.removeProperty("grid-row"),r?e.setAttribute("data-container-size",""):e.removeAttribute("data-container-size"),e}function Td(e,t){if(t==null)return;const n=e.shadowRoot??e.attachShadow({mode:"open"});n.innerHTML===""&&(n.innerHTML=t)}function Rd(e,{type:t,diffIndicators:n,disableBackground:i,disableLineNumbers:r,overflow:o,split:s,totalLines:l,customProperties:a}){if(a!=null)for(const d in a){const c=a[d];c!=null&&e.setAttribute(d,`${c}`)}switch(t==="diff"?(e.setAttribute("data-diff",""),e.removeAttribute("data-file")):(e.setAttribute("data-file",""),e.removeAttribute("data-diff")),n){case"bars":case"classic":e.setAttribute("data-indicators",n);break;case"none":e.removeAttribute("data-indicators");break}return r?e.setAttribute("data-disable-line-numbers",""):e.removeAttribute("data-disable-line-numbers"),i?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.tabIndex=0,e.style.setProperty("--diffs-min-number-column-width-default",`${`${l}`.length}ch`),e}function hi(e){if(typeof HTMLStyleElement<"u"&&e instanceof HTMLStyleElement)return!0;const t=e.tagName??e.nodeName;return typeof t=="string"&&t.toLowerCase()==="style"}function Rs(e){return{theme:e?.theme,disableLineNumbers:e?.disableLineNumbers,overflow:e?.overflow,themeType:e?.themeType,collapsed:e?.collapsed,disableFileHeader:e?.disableFileHeader,disableVirtualizationBuffers:e?.disableVirtualizationBuffers,stickyHeader:e?.stickyHeader,preferredHighlighter:e?.preferredHighlighter,useCSSClasses:e?.useCSSClasses,useTokenTransformer:e?.useTokenTransformer,tokenizeMaxLineLength:e?.tokenizeMaxLineLength,tokenizeMaxLength:e?.tokenizeMaxLength,unsafeCSS:e?.unsafeCSS,headerRenderMode:e?.renderCustomHeader!=null?"custom":"default"}}function Ad({shadowRoot:e,currentNode:t,themeCSS:n}){if(n.trim()===""){t?.remove();return}return t??=nb(),t.textContent=n,t.parentNode!==e&&e.appendChild(t),t}function nb(){const e=document.createElement("style");return e.setAttribute(Xt,""),e}if(typeof HTMLElement<"u"&&customElements.get(jn)==null){let e;class t extends HTMLElement{constructor(){if(super(),this.shadowRoot!=null)return;const i=this.attachShadow({mode:"open"});e==null&&(e=new CSSStyleSheet,e.replaceSync(Zg)),i.adoptedStyleSheets=[e]}connectedCallback(){ln(this.shadowRoot??this.attachShadow({mode:"open"}))}}customElements.define(jn,t)}const Id=!0,ib=[];let rb=-1;var Pd=class{static LoadedCustomComponent=Id;__id=`file:${++rb}`;type="file";fileContainer;spriteSVG;pre;code;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;errorWrapper;placeHolder;lastRenderedHeaderHTML;cachedHeaderHTML;appliedPreAttributes;lastRowCount;mounted=!1;headerElement;headerCustom;headerPrefix;headerMetadata;fileRenderer;resizeManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;file;renderRange;enabled=!0;constructor(t={theme:X},n,i=!1){this.options=t,this.workerManager=n,this.isContainerManaged=i,this.fileRenderer=new Qg(t,this.handleHighlightRender,this.workerManager),this.resizeManager=new Ha,this.interactionManager=new Na("file",Yn(t)),this.workerManager?.subscribeToThemeChanges(this)}handleHighlightRender=()=>{this.rerender()};rerender(){!this.enabled||this.file==null||this.render({file:this.file,forceRender:!0,renderRange:this.renderRange})}onThemeChange(){this.fileRenderer.clearRenderCache(),this.rerender()}setOptions(t){t!=null&&(this.options=t,this.cachedHeaderHTML=void 0,this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(Yn(this.options))}mergeOptions(t){this.options={...this.options,...t}}setThemeType(t){(this.options.themeType??"system")!==t&&(this.mergeOptions({themeType:t}),this.applyCachedThemeState(t))}applyCachedThemeState(t){if(typeof this.options.theme=="string"||this.fileContainer==null||this.appliedThemeCSS==null)return!1;const n=this.appliedThemeCSS.baseThemeType??t;return this.appliedThemeCSS.themeType===n?!1:(this.applyThemeState(this.fileContainer,this.appliedThemeCSS.themeStyles,t,this.appliedThemeCSS.baseThemeType),!0)}hasThemeChanged(){return this.appliedThemeCSS!=null&&!Rt(this.appliedThemeCSS.theme,this.options.theme??X)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(t){this.lineAnnotations=t}setSelectedLines(t,n){this.interactionManager.setSelection(t,n)}flushManagers(){if(!this.managersDirty||this.pre==null){this.managersDirty=!1;return}const{overflow:t="scroll"}=this.options;this.interactionManager.setup(this.pre),this.resizeManager.setup(this.pre,t==="wrap"),this.managersDirty=!1}cleanUp(t=!1){this.emitPostRender(!0),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,this.lineAnnotations=[],this.annotationCache.clear(),this.pre=void 0,this.bufferBefore=void 0,this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.lastRenderedHeaderHTML=void 0,t||(this.cachedHeaderHTML=void 0),this.errorWrapper=void 0,this.themeCSSStyle=void 0,this.appliedThemeCSS=void 0,this.hasAdoptedThemeCSS=!1,this.unsafeCSSStyle=void 0,this.appliedUnsafeCSS=void 0,this.placeHolder=void 0,this.unsafeCSSStyle=void 0,t?this.fileRenderer.recycle():(this.fileRenderer.cleanUp(),this.workerManager=void 0,this.file=void 0),this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(t){const{fileContainer:n,prerenderedHTML:i,preventEmit:r=!1,file:o,lineAnnotations:s}=t;this.hydrateElements(n,i),ob(this.pre,o,this.options.collapsed)||sb(this.headerElement,o,this.options.disableFileHeader)?this.render({...t,preventEmit:!0}):this.hydrationSetup({file:o,lineAnnotations:s}),r||this.emitPostRender()}hydrateElements(t,n){this.fileContainer!==t&&this.emitPostRender(!0),Td(t,n);for(const i of Array.from(t.shadowRoot?.children??[])){if(i instanceof SVGElement){this.spriteSVG=i;continue}if(i instanceof HTMLElement){if(i instanceof HTMLPreElement){this.pre=i,this.appliedPreAttributes=void 0;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute(Xt)){this.themeCSSStyle=i;continue}if(i instanceof HTMLStyleElement&&i.hasAttribute(Qt)){this.unsafeCSSStyle=i,this.appliedUnsafeCSS=i.textContent;continue}if("diffsHeader"in i.dataset){this.headerElement=i,this.lastRenderedHeaderHTML=void 0;continue}}}this.pre!=null&&(this.syncCodeNodeFromPre(this.pre),this.pre.removeAttribute("data-dehydrated")),this.fileContainer=t,this.hydrateMeasuredScrollbar()}hydrationSetup({file:t,lineAnnotations:n}){this.lineAnnotations=n??this.lineAnnotations,this.file=t,this.fileRenderer.setOptions(Rs(this.options)),this.syncInteractionOptions(),this.pre!=null&&(this.fileRenderer.hydrate(t),this.renderAnnotations(),this.renderGutterUtility(),this.injectUnsafeCSS(),this.managersDirty=!0,this.flushManagers())}getOrCreateLineCache(t=this.file){return t!=null?this.fileRenderer.getOrCreateLineCache(t):ib}render({file:t,fileContainer:n,forceRender:i=!1,preventEmit:r=!1,containerWrapper:o,deferManagers:s=!1,lineAnnotations:l,renderRange:a}){const{collapsed:d=!1,themeType:c="system"}=this.options;if(!this.enabled)throw new Error("File.render: attempting to call render after cleaned up");const u=d?void 0:a,h=this.renderRange,f=this.hasThemeChanged(),g=l!=null&&(l.length>0||this.lineAnnotations.length>0)?l!==this.lineAnnotations:!1,y=!Me(this.file,t);if(!d&&!i&&Pi(u,this.renderRange)&&!y&&!g&&!f)return this.applyCachedThemeState(c);this.renderRange=u,y&&(this.cachedHeaderHTML=void 0),this.file=t,this.fileRenderer.setOptions(Rs(this.options)),this.syncInteractionOptions(),l!=null&&this.setLineAnnotations(l),this.fileRenderer.setLineAnnotations(this.lineAnnotations);const{disableErrorHandling:_=!1,disableFileHeader:b=!1}=this.options;if(b&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),n=this.getOrCreateFileContainerNode(n,o),this.applyCachedThemeState(c),d){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{const p=this.fileRenderer.renderFile(t,_a);p!=null&&this.applyThemeState(n,p.themeStyles,c,p.baseThemeType),p?.headerAST!=null&&this.applyHeaderToDOM(p.headerAST,n),this.injectUnsafeCSS()}catch(p){if(_)throw p;console.error(p),p instanceof Error&&this.applyErrorToDOM(p,n)}return r||this.emitPostRender(),!0}try{const p=this.getOrCreatePreNode(n);if(!this.canPartiallyRender(i,g,y||f)||!this.applyPartialRender(h,u)){const v=this.fileRenderer.renderFile(t,u);if(v==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(n,v.themeStyles,c,v.baseThemeType),v.headerAST!=null&&this.applyHeaderToDOM(v.headerAST,n),this.applyFullRender(v,p)}this.applyBuffers(p,u),this.injectUnsafeCSS(),this.managersDirty=!0,s||this.flushManagers(),this.renderAnnotations(),this.renderGutterUtility()}catch(p){if(_)throw p;console.error(p),p instanceof Error&&this.applyErrorToDOM(p,n)}return r||this.emitPostRender(),!0}emitPostRender(t=!1){const{fileContainer:n,options:{onPostRender:i}}=this;if(t){if(!this.mounted||(this.mounted=!1,n==null))return;i?.(n,this,"unmount");return}if(n==null)return;const r=this.mounted?"update":"mount";this.mounted=!0,i?.(n,this,r)}removeRenderedCode(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferBefore?.remove(),this.bufferBefore=void 0,this.bufferAfter?.remove(),this.bufferAfter=void 0,this.code?.remove(),this.code=void 0,this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0,this.lastRowCount=void 0}clearAuxiliaryNodes(){for(const{element:t}of this.annotationCache.values())t.remove();this.annotationCache.clear(),this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0}canPartiallyRender(t,n,i){return!(t||n||i)}renderPlaceholder(t){if(this.fileContainer==null)return!1;if(this.emitPostRender(!0),this.cleanChildNodes(),this.placeHolder==null){const n=this.fileContainer.shadowRoot??this.fileContainer.attachShadow({mode:"open"});this.placeHolder=document.createElement("div"),this.placeHolder.dataset.placeholder="",n.appendChild(this.placeHolder)}return this.placeHolder.style.setProperty("height",`${t}px`),!0}primeHighlightCache(){const{file:t,workerManager:n}=this;t==null||t.cacheKey==null||n==null||an(t)||this.fileRenderer.getOrCreateLineCache(t).length>(this.options.tokenizeMaxLength??Yt)||n.primeFileHighlightCache(t)}cleanChildNodes(){this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.bufferAfter?.remove(),this.bufferBefore?.remove(),this.code?.remove(),this.errorWrapper?.remove(),this.headerElement?.remove(),this.gutterUtilityContent?.remove(),this.headerPrefix?.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.code=void 0,this.errorWrapper=void 0,this.headerElement=void 0,this.gutterUtilityContent=void 0,this.headerPrefix=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.lastRenderedHeaderHTML=void 0,this.lastRowCount=void 0,this.mounted=!1}renderAnnotations(){if(this.isContainerManaged||this.fileContainer==null){for(const{element:i}of this.annotationCache.values())i.remove();this.annotationCache.clear();return}const t=new Map(this.annotationCache),{renderAnnotation:n}=this.options;if(n!=null&&this.lineAnnotations.length>0)for(const[i,r]of this.lineAnnotations.entries()){const o=`${i}-${pt(r)}`;let s=this.annotationCache.get(o);if(s==null||!Yg(r,s.annotation)){s?.element.remove();const l=n(r);if(l==null)continue;s={element:_d(pt(r)),annotation:r},s.element.appendChild(l),this.fileContainer.appendChild(s.element),this.annotationCache.set(o,s)}t.delete(o)}for(const[i,{element:r}]of t.entries())this.annotationCache.delete(i),r.remove()}renderGutterUtility(){const{renderGutterUtility:t}=this.options;if(this.fileContainer==null||t==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const n=t(this.interactionManager.getHoveredLine);if(n!=null&&this.gutterUtilityContent!=null)return;if(n==null){this.gutterUtilityContent?.remove(),this.gutterUtilityContent=void 0;return}const i=wd();i.appendChild(n),this.fileContainer.appendChild(i),this.gutterUtilityContent=i}injectUnsafeCSS(){const{unsafeCSS:t}=this.options,n=this.fileContainer?.shadowRoot;if(n!=null){if(t==null||t===""){this.unsafeCSSStyle!=null&&(this.unsafeCSSStyle.remove(),this.unsafeCSSStyle=void 0),this.appliedUnsafeCSS=void 0;return}this.unsafeCSSStyle?.parentNode===n&&this.appliedUnsafeCSS===t||(this.unsafeCSSStyle??=Sd(),this.unsafeCSSStyle.parentNode!==n&&n.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=Ed(t),this.appliedUnsafeCSS=t)}}applyThemeState(t,n,i,r){const o=t.shadowRoot??t.attachShadow({mode:"open"}),s=r??i,l=this.options.theme??X,a=typeof l=="string"?l:{...l},d=ln(o);if(this.themeCSSStyle?.parentNode===o&&this.appliedThemeCSS?.themeStyles===n&&this.appliedThemeCSS.themeType===s&&this.appliedThemeCSS.scrollbarGutter===d){this.appliedThemeCSS.theme=a;return}if(this.hasAdoptedThemeCSS&&this.themeCSSStyle?.parentNode===o){this.hasAdoptedThemeCSS=!1,this.appliedThemeCSS={theme:a,themeStyles:n,themeType:s,baseThemeType:r,scrollbarGutter:d};return}this.themeCSSStyle=Ad({shadowRoot:o,currentNode:this.themeCSSStyle,themeCSS:xd(n,s,d)}),this.appliedThemeCSS=this.themeCSSStyle!=null?{theme:a,themeStyles:n,themeType:s,baseThemeType:r,scrollbarGutter:d}:void 0}hydrateMeasuredScrollbar(){const t=this.fileContainer?.shadowRoot;t==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=Ld(this.themeCSSStyle.textContent??"",ln(t)))}applyFullRender(t,n){this.cleanupErrorWrapper(),this.applyPreNodeAttributes(n,t),this.code=qn({code:this.code}),this.code.innerHTML=this.fileRenderer.renderPartialHTML(this.fileRenderer.renderCodeAST(t)),n.replaceChildren(this.code),this.lastRowCount=t.rowCount}applyPartialRender(t,n){if(t==null||n==null)return!1;const{file:i,code:r}=this,o=r!=null?this.getColumns(r):void 0;if(i==null||r==null||o==null)return!1;const s=t.startingLine,l=n.startingLine,a=t.totalLines===1/0?Number.POSITIVE_INFINITY:s+t.totalLines,d=n.totalLines===1/0?Number.POSITIVE_INFINITY:l+n.totalLines,c=Math.max(s,l),u=Math.min(a,d);if(u<=c||!this.trimDOMToOverlap(o.gutter,c,u)||!this.trimDOMToOverlap(o.content,c,u))return!1;let{length:h}=o.content.children;const f=(b,p)=>{if(!(p<=0))return this.fileRenderer.renderFile(i,{startingLine:b,totalLines:p,bufferBefore:0,bufferAfter:0})},g=l<c?f(l,c-l):void 0;if(g===void 0&&l<c)return!1;const y=d===Number.POSITIVE_INFINITY?Number.POSITIVE_INFINITY:Math.max(0,d-u),_=d>u?f(u,y):void 0;return _===void 0&&d>u?!1:(this.cleanupErrorWrapper(),g!=null&&(o.gutter.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(g.gutterAST)),o.content.insertAdjacentHTML("afterbegin",this.fileRenderer.renderPartialHTML(g.contentAST)),h+=g.rowCount),_!=null&&(o.gutter.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(_.gutterAST)),o.content.insertAdjacentHTML("beforeend",this.fileRenderer.renderPartialHTML(_.contentAST)),h+=_.rowCount),this.lastRowCount!==h&&(o.gutter.style.setProperty("grid-row",`span ${h}`),o.content.style.setProperty("grid-row",`span ${h}`),this.lastRowCount=h),!0)}getColumns(t){const n=t.children[0],i=t.children[1];if(!(!(n instanceof HTMLElement)||!(i instanceof HTMLElement)||n.dataset.gutter==null||i.dataset.content==null))return{gutter:n,content:i}}trimDOMToOverlap(t,n,i){const r=this.getDOMBoundaryIndices(t,[n,i]),o=r.get(n)??t.children.length,s=r.get(i)??t.children.length;if(o>s)return!1;for(let l=t.children.length-1;l>=s;l-=1)t.children[l]?.remove();for(let l=o-1;l>=0;l-=1)t.children[l]?.remove();return!0}getDOMBoundaryIndices(t,n){const i=[...new Set(n)].sort((a,d)=>a-d),r=new Map;if(i.length===0)return r;let o=0,s=i[o];const{children:l}=t;for(let a=0;a<l.length;a+=1){const d=l[a];if(!(d instanceof HTMLElement))continue;const c=this.getLineIndexFromDOMNode(d);if(c!=null){for(;s!=null&&c>=s;)r.set(s,a),o+=1,s=i[o];if(o>=i.length)break}}for(const a of i)r.has(a)||r.set(a,l.length);return r}getLineIndexFromDOMNode(t){const n=t.dataset.lineIndex;if(n==null)return;const i=Number(n);return Number.isNaN(i)?void 0:i}applyBuffers(t,n){if(n==null||this.shouldDisableVirtualizationBuffers()){this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0);return}n.bufferBefore>0?(this.bufferBefore==null&&(this.bufferBefore=document.createElement("div"),this.bufferBefore.dataset.virtualizerBuffer="before",t.before(this.bufferBefore)),this.bufferBefore.style.setProperty("height",`${n.bufferBefore}px`),this.bufferBefore.style.setProperty("contain","strict")):this.bufferBefore!=null&&(this.bufferBefore.remove(),this.bufferBefore=void 0),n.bufferAfter>0?(this.bufferAfter==null&&(this.bufferAfter=document.createElement("div"),this.bufferAfter.dataset.virtualizerBuffer="after",t.after(this.bufferAfter)),this.bufferAfter.style.setProperty("height",`${n.bufferAfter}px`),this.bufferAfter.style.setProperty("contain","strict")):this.bufferAfter!=null&&(this.bufferAfter.remove(),this.bufferAfter=void 0)}shouldDisableVirtualizationBuffers(){return this.options.disableVirtualizationBuffers??!1}applyHeaderToDOM(t,n){const{file:i}=this;if(i==null)return;this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;const r=this.cachedHeaderHTML??Ne(t);if(this.cachedHeaderHTML=r,r!==this.lastRenderedHeaderHTML){const a=document.createElement("div");a.innerHTML=r;const d=a.firstElementChild;if(!(d instanceof HTMLElement))return;this.headerElement!=null?n.shadowRoot?.replaceChild(d,this.headerElement):n.shadowRoot?.prepend(d),this.headerElement=d,this.lastRenderedHeaderHTML=r}if(this.isContainerManaged)return;const{renderHeaderPrefix:o,renderCustomHeader:s,renderHeaderMetadata:l}=this.options;if(s!=null){const a=s(i)??void 0;this.headerCustom=this.upsertHeaderSlotElement(n,this.headerCustom,to,a),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0}else{const a=o?.(i)??void 0,d=l?.(i)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(n,this.headerPrefix,Zr,a),this.headerMetadata=this.upsertHeaderSlotElement(n,this.headerMetadata,eo,d),this.headerCustom?.remove(),this.headerCustom=void 0}}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(t,n,i,r){if(r==null){n?.remove();return}const o=n??this.createHeaderSlotElement(i);return n==null&&t.appendChild(o),this.replaceHeaderSlotContent(o,r),o}replaceHeaderSlotContent(t,n){t.replaceChildren(),n instanceof Element?t.appendChild(n):t.innerText=`${n}`}createHeaderSlotElement(t){const n=document.createElement("div");return n.slot=t,n}getOrCreateFileContainerNode(t,n){const{fileContainer:i}=this,r=t??i??document.createElement(jn),o=i!==r;return o&&this.emitPostRender(!0),this.fileContainer=r,i!=null&&o&&(this.lastRenderedHeaderHTML=void 0,this.headerElement=void 0),n!=null&&this.fileContainer.parentNode!==n&&n.appendChild(this.fileContainer),o&&this.adoptReusableShellElements(this.fileContainer),this.ensureSpriteSVG(this.fileContainer),this.fileContainer}adoptReusableShellElements(t){const{shadowRoot:n}=t;if(n!=null)for(const i of n.children)i instanceof SVGElement?this.spriteSVG??=i:hi(i)&&i.hasAttribute(Xt)?(this.themeCSSStyle??=i,this.hasAdoptedThemeCSS=!0):hi(i)&&i.hasAttribute(Qt)&&(this.unsafeCSSStyle??=i,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(t){const n=t.shadowRoot??t.attachShadow({mode:"open"});if(this.spriteSVG==null){const i=document.createElement("div");i.innerHTML=vd;const r=i.firstChild;r instanceof SVGElement&&(this.spriteSVG=r)}this.spriteSVG!=null&&this.spriteSVG.parentNode!==n&&n.appendChild(this.spriteSVG)}getOrCreatePreNode(t){const n=t.shadowRoot??t.attachShadow({mode:"open"});return this.pre==null?(this.pre=document.createElement("pre"),this.appliedPreAttributes=void 0,this.code=void 0,n.appendChild(this.pre)):this.pre.parentNode!==n&&(t.shadowRoot?.appendChild(this.pre),this.appliedPreAttributes=void 0),this.placeHolder?.remove(),this.placeHolder=void 0,this.pre}syncCodeNodeFromPre(t){this.code=void 0;for(const n of Array.from(t.children))if(n instanceof HTMLElement&&n.hasAttribute("data-code")){this.code=n;return}}applyPreNodeAttributes(t,{totalLines:n}){const{overflow:i="scroll",disableLineNumbers:r=!1}=this.options,o={type:"file",split:!1,overflow:i,disableLineNumbers:r,diffIndicators:"none",disableBackground:!0,totalLines:n};yd(o,this.appliedPreAttributes)||(Rd(t,o),this.appliedPreAttributes=o)}applyErrorToDOM(t,n){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;const i=n.shadowRoot??n.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.textContent="",i.appendChild(this.errorWrapper);const r=document.createElement("div");r.dataset.errorMessage="",r.innerText=t.message,this.errorWrapper.appendChild(r);const o=document.createElement("pre");o.dataset.errorStack="",o.innerText=t.stack??"No Error Stack",this.errorWrapper.appendChild(o)}cleanupErrorWrapper(){this.errorWrapper?.remove(),this.errorWrapper=void 0}};function ob(e,t,n=!1){return!n&&e==null&&t!=null}function sb(e,t,n=!1){return e==null&&t!=null&&!n}function rr(e){return{...bi,...e}}function De(e,t){const n=ab(e,t);return t?n:e.diffHeaderHeight+n}function ab(e,t){return e.paddingTop??(t?e.spacing:0)}function fi(e){return e.paddingBottom??e.spacing}function lb(e){switch(e){case"simple":return 4;case"metadata":case"line-info":case"line-info-basic":case"custom":return 32}}const db=5e3;let cb=-1;function ub(e,t){return(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.unsafeCSS!==t.unsafeCSS}var hb=class extends Pd{__id=`virtualized-file:${++cb}`;top;height=0;cache={heights:new Map,checkpoints:[]};isVisible=!1;isSetup=!1;layoutDirty=!0;forceRenderOverride;currentCollapsed;constructor(e,t,n=bi,i,r=!1){super(e,i,r),this.virtualizer=t,this.metrics=n}setMetrics(e,t=!1){!t&&Xn(this.metrics,e)||(this.metrics=e,this.resetLayoutCache())}getLineHeight(e,t=!1){const n=this.cache.heights.get(e);if(n!=null)return n;const i=t?2:1;return this.metrics.lineHeight*i}setOptions(e){if(this.isAdvancedMode())throw new Error("VirtualizedFile.setOptions cannot be used inside CodeView. Update CodeView options instead.");if(e==null)return;const{options:t}=this,n=!no(t,e),i=ub(t,e);super.setOptions(e),i&&this.resetLayoutCache(!0),n&&(this.forceRenderOverride=!0),n&&this.virtualizer.instanceChanged(this,i)}setThemeType(e){if(this.isAdvancedMode())throw new Error("VirtualizedFile.setThemeType cannot be used inside CodeView. Update CodeView options instead.");super.setThemeType(e)}resetLayoutCache(e=!1){this.layoutDirty=!0,this.cache.heights.size>0&&this.cache.heights.clear(),this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.renderRange!=null&&(this.renderRange=void 0),e&&this.isSimpleMode()&&this.computeApproximateSize()}reconcileHeights(){let e=!1;if(this.fileContainer==null||this.file==null)return this.height!==0&&(e=!0),this.height=0,e;const{overflow:t="scroll"}=this.options;if(this.top=this.getVirtualizedTop(),t==="scroll"&&this.lineAnnotations.length===0&&!this.isResizeDebuggingEnabled()||this.code==null)return e;const n=this.code.children[1];if(!(n instanceof HTMLElement))return e;for(const i of n.children){if(!(i instanceof HTMLElement))continue;const r=i.dataset.lineIndex;if(r==null)continue;const o=Number(r);let s=i.getBoundingClientRect().height,l=!1;i.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in i.nextElementSibling.dataset||"noNewline"in i.nextElementSibling.dataset)&&("noNewline"in i.nextElementSibling.dataset&&(l=!0),s+=i.nextElementSibling.getBoundingClientRect().height);const a=this.getLineHeight(o,l);s!==a&&(e=!0,s===this.metrics.lineHeight*(l?2:1)?this.cache.heights.delete(o):this.cache.heights.set(o,s))}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer==null||this.file==null?!1:(e&&(this.top=this.getVirtualizedTop()),this.render({file:this.file}));prepareCodeViewItem(e,t,n){let i=n?.resetFileLayoutCache===!0;n?.metrics!=null&&(this.metrics=n.metrics,i=!0);const{collapsed:r=!1}=this.options;return this.currentCollapsed!==r&&(this.currentCollapsed=r,i=!0),i&&this.resetLayoutCache(),this.file!==e&&(this.layoutDirty=!0),this.file=e,this.top=t,this.computeApproximateSize(),this.height}getLinePosition(e){if(this.file==null)return;const{disableFileHeader:t=!1,collapsed:n=!1}=this.options,i=As(this.getOrCreateLineCache(this.file));let r=De(this.metrics,t);if(n||i<0)return{top:r,height:0};const o=Math.min(Math.max(e-1,0),i),{overflow:s="scroll"}=this.options,{lineHeight:l}=this.metrics;if(s==="scroll"&&this.lineAnnotations.length===0)return{top:r+o*l,height:l};const a=this.getLayoutCheckpointBeforeLineIndex(o);r=a?.top??r;for(let d=a?.lineIndex??0;d<o;d++)r+=this.getLineHeight(d,!1);return{top:r,height:this.getLineHeight(o,!1)}}getNumericScrollAnchor(e){if(this.file==null||this.renderRange==null)return;const{disableFileHeader:t=!1,collapsed:n=!1,overflow:i="scroll"}=this.options;if(n||this.renderRange.totalLines<=0)return;const r=As(this.getOrCreateLineCache(this.file));if(r<0)return;const o=De(this.metrics,t),s=Math.min(this.renderRange.startingLine,r),l=Math.min(s+this.renderRange.totalLines-1,r);if(l<s)return;if(i==="scroll"&&this.lineAnnotations.length===0){const{lineHeight:d}=this.metrics,c=o+this.renderRange.bufferBefore,u=s+Math.max(Math.ceil((e-c)/d),0);return u>l?void 0:{lineNumber:u+1,top:o+u*d}}let a=o+this.renderRange.bufferBefore;for(let d=s;d<=l;d++){if(a>=e)return{lineNumber:d+1,top:a};a+=this.getLineHeight(d)}}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){if(this.top==null||this.file==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};const t=e!=null?this.computeRenderRangeFromWindow(this.file,this.top,e):this.renderRange;if(t==null)return;const{bufferBefore:n,bufferAfter:i,totalLines:r}=t;let o=0;if(r===0){const s=e??this.virtualizer.getWindowSpecs();this.top<s.top&&(o=i)}return{topOffset:this.top+n+o,height:this.height-(n+i)}}cleanUp(e=!1){this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||(this.layoutDirty=!0),this.isSetup=!1,super.cleanUp(e)}computeApproximateSize(e=!1){const t=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!t)return;const n=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.file==null){this.layoutDirty=!1;return}const{disableFileHeader:i=!1,collapsed:r=!1,overflow:o="scroll"}=this.options,{lineHeight:s}=this.metrics,l=this.getOrCreateLineCache(this.file),a=De(this.metrics,i),d=fi(this.metrics);if(this.height+=a,r){this.layoutDirty=!1;return}if(o==="scroll"&&this.lineAnnotations.length===0?this.height+=this.getOrCreateLineCache(this.file).length*s:ui({lines:l,callback:({lineIndex:c})=>{this.addLayoutCheckpoint(c,this.height),this.height+=this.getLineHeight(c,!1)}}),l.length>0&&(this.height+=d),this.fileContainer!=null&&t&&!n){const c=this.fileContainer.getBoundingClientRect();c.height!==this.height?console.log("VirtualizedFile.computeApproximateSize: computed height doesnt match",{name:this.file.name,elementHeight:c.height,computedHeight:this.height}):console.log("VirtualizedFile.computeApproximateSize: computed height IS CORRECT")}this.layoutDirty=!1}setVisibility(e){this.isAdvancedMode()||this.fileContainer==null||(e&&!this.isVisible?(this.top=this.getVirtualizedTop(),this.isVisible=!0):!e&&this.isVisible&&(this.isVisible=!1,this.rerender()))}rerender(){!this.enabled||this.file==null||(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!1))}render({fileContainer:e,file:t,forceRender:n=!1,...i}){const{forceRenderOverride:r,isSetup:o}=this;if(this.forceRenderOverride=void 0,this.file??=t,e=this.getOrCreateFileContainerNode(e),this.file==null)return console.error("VirtualizedFile.render: attempting to virtually render when we dont have file"),!1;if(o)this.top??=this.getVirtualizedTop();else{this.computeApproximateSize();const d=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(d==null)throw new Error("VirtualizedFile.render: simple virtualizer is not available");d.connect(e,this),this.isVisible=d.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode())return this.renderPlaceholder(this.height);const s=this.virtualizer.getWindowSpecs(),l=this.top??0,a=this.computeRenderRangeFromWindow(this.file,l,s);return super.render({file:this.file,fileContainer:e,renderRange:a,forceRender:r??n,...i})}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}isSimpleMode(){return this.virtualizer.type==="simple"}isAdvancedMode(){return this.virtualizer.type==="advanced"}addLayoutCheckpoint(e,t){e%db===0&&this.cache.checkpoints.push({lineIndex:e,top:t})}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,i;for(;t<=n;){const r=t+n>>1,o=this.cache.checkpoints[r];if(o==null)throw new Error("VirtualizedFile: invalid checkpoint index");o.lineIndex<=e?(i=o,t=r+1):n=r-1}return i}getLayoutCheckpointBeforeTop(e,t){let n=0,i=this.cache.checkpoints.length-1,r=-1;for(;n<=i;){const o=n+i>>1,s=this.cache.checkpoints[o];if(s==null)throw new Error("VirtualizedFile: invalid checkpoint index");s.top<=e?(r=o,n=o+1):i=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("VirtualizedFile: invalid checkpoint index");if(s.lineIndex%t===0)return s}}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}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}computeRenderRangeFromWindow(e,t,{top:n,bottom:i}){const{disableFileHeader:r=!1,overflow:o="scroll"}=this.options,{hunkLineCount:s,lineHeight:l}=this.metrics,a=this.getOrCreateLineCache(e),d=a.length,c=this.height,u=De(this.metrics,r),h=d>0?fi(this.metrics):0;if(t<n-c||t>i)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:c-u-h};if(d<=s)return{startingLine:0,totalLines:s,bufferBefore:0,bufferAfter:0};const f=Math.ceil(Math.max(i-n,0)/l),g=Math.ceil(f/s)*s+s*2,y=g/s,_=(n+i)/2;if(o==="scroll"&&this.lineAnnotations.length===0){const H=Math.floor((_-(t+u))/l),M=Math.floor(H/s)-Math.floor(y/2),V=Math.ceil(d/s),O=Math.max(0,Math.min(M,V))*s,G=M<0?g+M*s:g,j=O*l,W=Math.min(G,d-O);return{startingLine:O,totalLines:G,bufferBefore:j,bufferAfter:Math.max(0,(d-O-W)*l)}}const b=y,p=[],v=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-g*l*2),s);let w=t+(v?.top??u),S=v?.lineIndex??0,k,E,C;if(ui({lines:a,startingLine:v?.lineIndex??0,callback:({lineIndex:H})=>{const M=S%s===0,V=Math.floor(S/s);if(M&&(p[V]=w-(t+u),C!=null)){if(C<=0)return!0;C--}const O=this.getLineHeight(H,!1);return w>n-O&&w<i&&(k??=V),w+O>_&&(E??=V),C==null&&w>=i&&M&&(C=b),S++,w+=O,!1}}),k==null)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:c-u-h};E??=k;const x=Math.round(E-y/2),I=Math.max(0,Math.ceil(d/s)-y),P=Math.max(0,Math.min(x,I)),A=P*s,L=x<0?g+x*s:g,R=p[P]??0,D=P+L/s;return{startingLine:A,totalLines:L,bufferBefore:R,bufferAfter:D<p.length?c-u-p[D]-h:c-(w-t)-h}}};function As(e){const t=e.at(-1);return t==null||t===""||t===`
219
+ `||t===`\r
220
+ `||t==="\r"?e.length-2:e.length-1}function Et(e,t){return e===t||e?.cacheKey!=null&&e.cacheKey===t?.cacheKey}const fb=new TextEncoder,pb=new TextDecoder("utf-8",{ignoreBOM:!0}),mb=/[\uD800-\uDFFF]/,qr=1024;let xt=new Uint8Array(qr);function gb(){xt.length!==qr&&(xt=new Uint8Array(qr))}function ie(e){if(e.length===0)return e;if(mb.test(e))return JSON.parse(JSON.stringify(e));const t=e.length*3;xt.length<t&&(xt=new Uint8Array(t));const{written:n}=fb.encodeInto(e,xt);return pb.decode(xt.subarray(0,n))}function bb(e,t){try{return vb(e,t)}finally{gb()}}function vb(e,{cacheKey:t,isGitDiff:n=Lc.test(e),oldFile:i,newFile:r,throwOnError:o=!1}={}){let s=0;const l=Cb(e,"@@ ");let a;const d=i==null||r==null;let c=0,u=0;for(const h of l){const f=Dd(h),g=f[0];if(g==null){if(o)throw Error("parsePatchContent: invalid hunk");console.error("parsePatchContent: invalid hunk",h);continue}const y=wb(g);let _=0,b=0;if(y==null||a==null){if(a!=null){if(o)throw Error("parsePatchContent: Invalid hunk");console.error("parsePatchContent: Invalid hunk",h);continue}a={name:"",type:"change",hunks:[],splitLineCount:0,unifiedLineCount:0,isPartial:d,additionLines:!d&&i!=null&&r!=null?Is(r.contents):[],deletionLines:!d&&i!=null&&r!=null?Is(i.contents):[],cacheKey:Ds(t)},a.additionLines.length===1&&r?.contents===""&&(a.additionLines.length=0),a.deletionLines.length===1&&i?.contents===""&&(a.deletionLines.length=0);for(const x of f){if(x.startsWith("diff --git")){const P=x.trim().match(Ic),A=P?.[1]??P?.[2],L=P?.[3]??P?.[4];if(A==null||L==null){if(o)throw Error("parsePatchContent: invalid git diff header");console.error("parsePatchContent: invalid git diff header",x);continue}a.name=ie(L.trim()),A!==L&&(a.prevName=ie(A.trim()));continue}const I=x.startsWith("---")||x.startsWith("+++")?x.match(n?Ac:Rc):null;if(I!=null){const[,P,A]=I;if(P==="---"&&A!=="/dev/null"){const L=ie(A.trim());a.prevName=L,a.name=L}else P==="+++"&&A!=="/dev/null"&&(a.name=ie(A.trim()))}else if(n){if(x.startsWith("new mode ")&&(a.mode=ie(x.slice(8).trim())),x.startsWith("old mode ")&&(a.prevMode=ie(x.slice(8).trim())),x.startsWith("new file mode")&&(a.type="new",a.mode=ie(x.slice(13).trim())),x.startsWith("deleted file mode")&&(a.type="deleted",a.mode=ie(x.slice(17).trim())),x.startsWith("similarity index")&&(x.startsWith("similarity index 100%")?a.type="rename-pure":a.type="rename-changed"),x.startsWith("index ")){const[,P,A,L]=x.trim().match(Pc)??[];P!=null&&(a.prevObjectId=ie(P)),A!=null&&(a.newObjectId=ie(A)),L!=null&&(a.mode=ie(L))}x.startsWith("rename from ")&&(a.prevName=ie(x.slice(12).trim())),x.startsWith("rename to ")&&(a.name=ie(x.slice(10).trim()))}}continue}let p,v;for(;f.length>0&&(f[f.length-1]===`
221
+ `||f[f.length-1]==="\r"||f[f.length-1]===`\r
222
+ `||f[f.length-1]==="");)f.pop();const{additionStart:w,deletionStart:S}=y;c=d?c:S-1,u=d?u:w-1;const k={collapsedBefore:0,splitLineCount:0,splitLineStart:0,unifiedLineCount:0,unifiedLineStart:0,additionCount:y.additionCount,additionStart:w,additionLines:_,deletionCount:y.deletionCount,deletionStart:S,deletionLines:b,deletionLineIndex:c,additionLineIndex:u,hunkContent:[],hunkContext:Ds(y.hunkContext),hunkSpecs:ie(g),noEOFCRAdditions:!1,noEOFCRDeletions:!1};let E=0,C=0;for(let x=1;x<f.length;x++){const I=f[x];if(E>=k.additionCount&&C>=k.deletionCount&&!I.startsWith("\\")){if(o&&yb(I)&&!_b(I))throw Error("parsePatchContent: hunk has more lines than expected");break}const P=I[0];if(P!=="+"&&P!=="-"&&P!==" "&&P!=="\\"){if(o)throw Error("parsePatchContent: invalid hunk line");console.error(`parseLineType: Invalid firstChar: "${P}", full line: "${I}"`),console.error("processFile: invalid rawLine:",I);continue}const A=kb(P);if(A==="addition"){if(o&&E>=k.additionCount)throw Error("parsePatchContent: hunk has too many addition lines");const L=or(I);(p==null||p.type!=="change")&&(p=sr("change",c,u),k.hunkContent.push(p)),u++,E++,d&&a.additionLines.push(L),p.additions++,_++,v="addition"}else if(A==="deletion"){if(o&&C>=k.deletionCount)throw Error("parsePatchContent: hunk has too many deletion lines");const L=or(I);(p==null||p.type!=="change")&&(p=sr("change",c,u),k.hunkContent.push(p)),c++,C++,d&&a.deletionLines.push(L),p.deletions++,b++,v="deletion"}else if(A==="context"){if(o&&(C>=k.deletionCount||E>=k.additionCount))throw Error("parsePatchContent: hunk has too many context lines");const L=or(I);(p==null||p.type!=="context")&&(p=sr("context",c,u),k.hunkContent.push(p)),u++,c++,E++,C++,d&&(a.deletionLines.push(L),a.additionLines.push(L)),p.lines++,v="context"}else if(A==="metadata"&&p!=null){if(p.type==="context"?(k.noEOFCRAdditions=!0,k.noEOFCRDeletions=!0):v==="deletion"?k.noEOFCRDeletions=!0:v==="addition"&&(k.noEOFCRAdditions=!0),d&&(v==="addition"||v==="context")){const L=a.additionLines.length-1;L>=0&&(a.additionLines[L]=mt(a.additionLines[L]))}if(d&&(v==="deletion"||v==="context")){const L=a.deletionLines.length-1;L>=0&&(a.deletionLines[L]=mt(a.deletionLines[L]))}}}if(o&&(E!==k.additionCount||C!==k.deletionCount))throw Error("parsePatchContent: hunk line count mismatch");k.additionLines=_,k.deletionLines=b,k.collapsedBefore=Math.max(k.additionStart-1-s,0),a.hunks.push(k),s=k.additionStart+k.additionCount-1;for(const x of k.hunkContent)x.type==="context"?(k.splitLineCount+=x.lines,k.unifiedLineCount+=x.lines):(k.splitLineCount+=Math.max(x.additions,x.deletions),k.unifiedLineCount+=x.deletions+x.additions);k.splitLineStart=a.splitLineCount+k.collapsedBefore,k.unifiedLineStart=a.unifiedLineCount+k.collapsedBefore,a.splitLineCount+=k.collapsedBefore+k.splitLineCount,a.unifiedLineCount+=k.collapsedBefore+k.unifiedLineCount}if(a!=null){if(o&&d&&!n&&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 h=a.hunks[a.hunks.length-1],f=h.additionStart+h.additionCount-1,g=a.additionLines.length,y=Math.max(g-f,0);a.splitLineCount+=y,a.unifiedLineCount+=y}return n||(a.prevName!=null&&a.name!==a.prevName?a.hunks.length>0?a.type="rename-changed":a.type="rename-pure":(i==null||i.contents==="")&&r!=null&&r.contents!==""?a.type="new":i!=null&&i.contents!==""&&(r==null||r.contents==="")&&(a.type="deleted")),a.type!=="rename-pure"&&a.type!=="rename-changed"&&(a.prevName=void 0),a}}function Is(e){const t=Dd(e);for(let n=0;n<t.length;n++)t[n]=ie(t[n]);return t}function Dd(e){if(e.length===0)return[""];const t=[];let n=0;for(;;){const i=e.indexOf(`
223
+ `,n);if(i===-1)break;t.push(e.slice(n,i+1)),n=i+1}return n<e.length&&t.push(e.slice(n)),t}function yb(e){const t=e[0];return t==="+"||t==="-"||t===" "}function _b(e){if(!e.startsWith("--"))return!1;for(let t=2;t<e.length;t++){const n=e[t];if(n!==" "&&n!==" "&&n!==`
224
+ `&&n!=="\r")return!1}return!0}function wb(e){if(!e.startsWith("@@ -"))return;let t=4;const n=Tn(e,t);if(n==null)return;const i=n.value;t=n.endIndex;let r=1;if(e[t]===","){const c=Tn(e,t+1);if(c==null)return;r=c.value,t=c.endIndex}if(e[t]!==" "||e[t+1]!=="+")return;t+=2;const o=Tn(e,t);if(o==null)return;const s=o.value;t=o.endIndex;let l=1;if(e[t]===","){const c=Tn(e,t+1);if(c==null)return;l=c.value,t=c.endIndex}if(e[t]!==" "||e[t+1]!=="@"||e[t+2]!=="@")return;let a;const d=t+3;return e[d]===" "&&(a=Sb(e.slice(d+1))),{additionCount:l,additionStart:s,deletionCount:r,deletionStart:i,hunkContext:a}}function Tn(e,t){let n=t,i=0;for(;n<e.length;n++){const r=e.charCodeAt(n)-48;if(r<0||r>9)break;i=i*10+r}if(n!==t)return{value:i,endIndex:n}}function Sb(e){return e.endsWith(`\r
225
+ `)?e.slice(0,-2):e.endsWith(`
226
+ `)?e.slice(0,-1):e}function Cb(e,t){if(e.length===0)return[""];const n=`
227
+ ${t}`,i=e.startsWith(t)?0:Ps(e,n,0);if(i===-1)return[e];const r=[];i>0&&r.push(e.slice(0,i));let o=i;for(;;){const s=Ps(e,n,o+1);if(s===-1)break;r.push(e.slice(o,s)),o=s}return r.push(e.slice(o)),r}function Ps(e,t,n){const i=e.indexOf(t,n);return i===-1?-1:i+1}function Ds(e){return e==null?e:ie(e)}function kb(e){return e===" "?"context":e==="\\"?"metadata":e==="+"?"addition":"deletion"}function or(e){const t=e.slice(1);return ie(t===""?`
228
+ `:t)}function sr(e,t,n){return e==="change"?{type:"change",additions:0,deletions:0,additionLineIndex:n,deletionLineIndex:t}:{type:"context",lines:0,additionLineIndex:n,deletionLineIndex:t}}class Co{diff(t,n,i={}){let r;typeof i=="function"?(r=i,i={}):"callback"in i&&(r=i.callback);const o=this.castInput(t,i),s=this.castInput(n,i),l=this.removeEmpty(this.tokenize(o,i)),a=this.removeEmpty(this.tokenize(s,i));return this.diffWithOptionsObj(l,a,i,r)}diffWithOptionsObj(t,n,i,r){var o;const s=p=>{if(p=this.postProcess(p,i),r){setTimeout(function(){r(p)},0);return}else return p},l=n.length,a=t.length;let d=1,c=l+a;i.maxEditLength!=null&&(c=Math.min(c,i.maxEditLength));const u=(o=i.timeout)!==null&&o!==void 0?o:1/0,h=Date.now()+u,f=[{oldPos:-1,lastComponent:void 0}];let g=this.extractCommon(f[0],n,t,0,i);if(f[0].oldPos+1>=a&&g+1>=l)return s(this.buildValues(f[0].lastComponent,n,t));let y=-1/0,_=1/0;const b=()=>{for(let p=Math.max(y,-d);p<=Math.min(_,d);p+=2){let v;const w=f[p-1],S=f[p+1];w&&(f[p-1]=void 0);let k=!1;if(S){const C=S.oldPos-p;k=S&&0<=C&&C<l}const E=w&&w.oldPos+1<a;if(!k&&!E){f[p]=void 0;continue}if(!E||k&&w.oldPos<S.oldPos?v=this.addToPath(S,!0,!1,0,i):v=this.addToPath(w,!1,!0,1,i),g=this.extractCommon(v,n,t,p,i),v.oldPos+1>=a&&g+1>=l)return s(this.buildValues(v.lastComponent,n,t))||!0;f[p]=v,v.oldPos+1>=a&&(_=Math.min(_,p-1)),g+1>=l&&(y=Math.max(y,p+1))}d++};if(r)(function p(){setTimeout(function(){if(d>c||Date.now()>h)return r(void 0);b()||p()},0)})();else for(;d<=c&&Date.now()<=h;){const p=b();if(p)return p}}addToPath(t,n,i,r,o){const s=t.lastComponent;return s&&!o.oneChangePerToken&&s.added===n&&s.removed===i?{oldPos:t.oldPos+r,lastComponent:{count:s.count+1,added:n,removed:i,previousComponent:s.previousComponent}}:{oldPos:t.oldPos+r,lastComponent:{count:1,added:n,removed:i,previousComponent:s}}}extractCommon(t,n,i,r,o){const s=n.length,l=i.length;let a=t.oldPos,d=a-r,c=0;for(;d+1<s&&a+1<l&&this.equals(i[a+1],n[d+1],o);)d++,a++,c++,o.oneChangePerToken&&(t.lastComponent={count:1,previousComponent:t.lastComponent,added:!1,removed:!1});return c&&!o.oneChangePerToken&&(t.lastComponent={count:c,previousComponent:t.lastComponent,added:!1,removed:!1}),t.oldPos=a,d}equals(t,n,i){return i.comparator?i.comparator(t,n):t===n||!!i.ignoreCase&&t.toLowerCase()===n.toLowerCase()}removeEmpty(t){const n=[];for(let i=0;i<t.length;i++)t[i]&&n.push(t[i]);return n}castInput(t,n){return t}tokenize(t,n){return Array.from(t)}join(t){return t.join("")}postProcess(t,n){return t}get useLongestToken(){return!1}buildValues(t,n,i){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 c=r[l];if(c.removed)c.value=this.join(i.slice(d,d+c.count)),d+=c.count;else{if(!c.added&&this.useLongestToken){let u=n.slice(a,a+c.count);u=u.map(function(h,f){const g=i[d+f];return g.length>h.length?g:h}),c.value=this.join(u)}else c.value=this.join(n.slice(a,a+c.count));a+=c.count,c.added||(d+=c.count)}}return r}}class Eb extends Co{}const xb=new Eb;function Lb(e,t,n){return xb.diff(e,t,n)}const Ms="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 Tb extends Co{tokenize(t){const n=new RegExp(`(\\r?\\n)|[${Ms}]+|[^\\S\\n\\r]+|[^${Ms}]`,"ug");return t.match(n)||[]}}const Rb=new Tb;function Ab(e,t,n){return Rb.diff(e,t,n)}class Ib extends Co{constructor(){super(...arguments),this.tokenize=Db}equals(t,n,i){return i.ignoreWhitespace?((!i.newlineIsToken||!t.includes(`
229
+ `))&&(t=t.trim()),(!i.newlineIsToken||!n.includes(`
230
+ `))&&(n=n.trim())):i.ignoreNewlineAtEof&&!i.newlineIsToken&&(t.endsWith(`
231
+ `)&&(t=t.slice(0,-1)),n.endsWith(`
232
+ `)&&(n=n.slice(0,-1))),super.equals(t,n,i)}}const Pb=new Ib;function Os(e,t,n){return Pb.diff(e,t,n)}function Db(e,t){t.stripTrailingCr&&(e=e.replace(/\r\n/g,`
233
+ `));const n=[],i=e.split(/(\n|\r\n)/);i[i.length-1]||i.pop();for(let r=0;r<i.length;r++){const o=i[r];r%2&&!t.newlineIsToken?n[n.length-1]+=o:n.push(o)}return n}const Mb={includeIndex:!0,includeUnderline:!0,includeFileHeaders:!0};function Ns(e,t,n,i,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:c}=l;Os(n,i,Object.assign(Object.assign({},l),{callback:u=>{const h=d(u);c(h)}}))}else return d(Os(n,i,l));function d(c){if(!c)return;c.push({value:"",lines:[]});function u(p){return p.map(function(v){return" "+v})}const h=[];let f=0,g=0,y=[],_=1,b=1;for(let p=0;p<c.length;p++){const v=c[p],w=v.lines||Nb(v.value);if(v.lines=w,v.added||v.removed){if(!f){const S=c[p-1];f=_,g=b,S&&(y=a>0?u(S.lines.slice(-a)):[],f-=y.length,g-=y.length)}for(const S of w)y.push((v.added?"+":"-")+S);v.added?b+=w.length:_+=w.length}else{if(f)if(w.length<=a*2&&p<c.length-2)for(const S of u(w))y.push(S);else{const S=Math.min(w.length,a);for(const E of u(w.slice(0,S)))y.push(E);const k={oldStart:f,oldLines:_-f+S,newStart:g,newLines:b-g+S,lines:y};h.push(k),f=0,g=0,y=[]}_+=w.length,b+=w.length}}for(const p of h)for(let v=0;v<p.lines.length;v++)p.lines[v].endsWith(`
234
+ `)?p.lines[v]=p.lines[v].slice(0,-1):(p.lines.splice(v+1,0,"\"),v++);return{oldFileName:e,newFileName:t,oldHeader:r,newHeader:o,hunks:h}}}function jr(e,t){if(t||(t=Mb),Array.isArray(e)){if(e.length>1&&!t.includeFileHeaders)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(i=>jr(i,t)).join(`
235
+ `)}const n=[];t.includeIndex&&e.oldFileName==e.newFileName&&n.push("Index: "+e.oldFileName),t.includeUnderline&&n.push("==================================================================="),t.includeFileHeaders&&(n.push("--- "+e.oldFileName+(typeof e.oldHeader>"u"?"":" "+e.oldHeader)),n.push("+++ "+e.newFileName+(typeof e.newHeader>"u"?"":" "+e.newHeader)));for(let i=0;i<e.hunks.length;i++){const r=e.hunks[i];r.oldLines===0&&(r.oldStart-=1),r.newLines===0&&(r.newStart-=1),n.push("@@ -"+r.oldStart+","+r.oldLines+" +"+r.newStart+","+r.newLines+" @@");for(const o of r.lines)n.push(o)}return n.join(`
236
+ `)+`
237
+ `}function Ob(e,t,n,i,r,o,s){if(typeof s=="function"&&(s={callback:s}),s?.callback){const{callback:l}=s;Ns(e,t,n,i,r,o,Object.assign(Object.assign({},s),{callback:a=>{l(a?jr(a,s.headerOptions):void 0)}}))}else{const l=Ns(e,t,n,i,r,o,s);return l?jr(l,s?.headerOptions):void 0}}function Nb(e){const t=e.endsWith(`
238
+ `),n=e.split(`
239
+ `).map(i=>i+`
240
+ `);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function Kr(e,t,n,i=!1){const r=bb(Ob(e.name,t.name,e.contents,t.contents,e.header,t.header,n),{cacheKey:(()=>{if(e.cacheKey!=null&&t.cacheKey!=null)return`${e.cacheKey}:${t.cacheKey}`})(),oldFile:e,newFile:t,throwOnError:i});if(r==null)throw new Error("parseDiffFrom: FileInvalid diff -- probably need to fix something -- if the files are the same maybe?");return t.lang!=null&&(r.lang=t.lang),r}var Hb=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,n){if(t==null||n==null)for(const i of e.children??[])i instanceof HTMLElement&&("deletions"in i.dataset?t=i:"additions"in i.dataset&&(n=i));if(n==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!==n&&(this.codeAdditions?.removeEventListener("scroll",this.handleAdditionsScroll),this.codeAdditions=n,n.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 We(e,t){return Rt(e.theme,t.theme)&&e.useTokenTransformer===t.useTokenTransformer&&e.tokenizeMaxLineLength===t.tokenizeMaxLineLength&&e.lineDiffType===t.lineDiffType&&e.maxLineDiffLength===t.maxLineDiffLength}function Rn(e){return $({tagName:"div",properties:{"data-content-buffer":"","data-buffer-size":e,style:`grid-row: span ${e};min-height:calc(${e} * 1lh)`}})}function An(e){return $({tagName:"div",children:[$({tagName:"span",children:[Oe("No newline at end of file")]})],properties:{"data-no-newline":"","data-line-type":e,"data-column-content":""}})}function ar(e){return $({tagName:"div",children:[Qn({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 _t({type:e,content:t,expandIndex:n,chunked:i=!1,slotName:r,isFirstHunk:o,isLastHunk:s}){let l=0;const a=[];if(e==="metadata"&&t!=null&&a.push($({tagName:"div",children:[Oe(t)],properties:{"data-separator-wrapper":""}})),(e==="line-info"||e==="line-info-basic")&&t!=null){const d=[];n!=null&&(i?(o||(d.push(ar("up")),l++),s||(d.push(ar("down")),l++)):(d.push(ar(!o&&!s?"both":o?"down":"up")),l++)),d.push($({tagName:"div",children:[$({tagName:"span",children:[Oe(t)],properties:{"data-unmodified-lines":""}})],properties:{"data-separator-content":""}})),i&&n!=null&&d.push($({tagName:"div",children:[Oe("Expand all")],properties:{role:"button","data-expand-button":"","data-expand-all-button":""}})),a.push($({tagName:"div",children:d,properties:{"data-separator-wrapper":"","data-separator-multi-button":l>1?"":void 0}}))}return e==="custom"&&r!=null&&a.push($({tagName:"slot",properties:{name:r}})),$({tagName:"div",children:a,properties:{"data-separator":a.length===0?"simple":e,"data-expand-index":n,"data-separator-first":o?"":void 0,"data-separator-last":s?"":void 0}})}function Vb(e,t){return`hunk-separator-${e}-${t}`}function zb(e){const t=e.at(-1);return t==null?0:Math.max(t.additionStart+t.additionCount,t.deletionStart+t.deletionCount)}function $b(e){return e.startingLine===0&&e.totalLines===1/0&&e.bufferBefore===0&&e.bufferAfter===0}function Hs({line:e,spanStart:t,spanLength:n}){return{start:{line:e,character:t},end:{line:e,character:t+n},properties:{"data-diff-span":""},alwaysWrap:!0}}function In({item:e,arr:t,enableJoin:n,isNeutral:i=!1,isLastItem:r=!1}){const o=t[t.length-1];if(o==null||r||!n){t.push([i?0:1,e.value]);return}const s=o[0]===0;if(i===s||i&&e.value.length===1&&!s){o[1]+=e.value;return}t.push([i?0:1,e.value])}function dn({isPartial:e,rangeSize:t,expandedHunks:n,hunkIndex:i,collapsedContextThreshold:r}){const o=Math.max(t,0);if(o===0||e)return{fromStart:0,fromEnd:0,rangeSize:o,collapsedLines:o,renderAll:!1};if(n===!0||o<=r)return{fromStart:o,fromEnd:0,rangeSize:o,collapsedLines:0,renderAll:!0};const s=n?.get(i),l=Math.min(Math.max(s?.fromStart??0,0),o),a=Math.min(Math.max(s?.fromEnd??0,0),o),d=l+a,c=d>=o;return{fromStart:c?o:l,fromEnd:c?0:a,rangeSize:o,collapsedLines:Math.max(o-d,0),renderAll:c}}function Md({fileDiff:e,errorPrefix:t}){const n=e.hunks[e.hunks.length-1];if(n==null||e.isPartial||e.additionLines.length===0||e.deletionLines.length===0)return 0;const i=e.additionLines.length-(n.additionLineIndex+n.additionCount),r=e.deletionLines.length-(n.deletionLineIndex+n.deletionCount);if(i<=0&&r<=0)return 0;if(i!==r)throw new Error(`${t}: trailing context mismatch (additions=${i}, deletions=${r}) for ${e.name}`);return Math.min(i,r)}function cn({fileDiff:e,hunkIndex:t,expandedHunks:n,collapsedContextThreshold:i,errorPrefix:r}){if(t!==e.hunks.length-1)return;const o=Md({fileDiff:e,errorPrefix:r});if(o<=0)return;if(n===!0||o<=i)return{fromStart:o,fromEnd:0,rangeSize:o,collapsedLines:0,renderAll:!0};const s=n?.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 Od({type:e,metrics:t}){return t.hunkSeparatorHeight??lb(e)}function Nd({type:e,metrics:t}){return e==="simple"||e==="metadata"||e==="line-info-basic"?0:t.spacing}function Fb({type:e,hunkIndex:t,hunkSpecs:n}){switch(e){case"simple":return t>0;case"metadata":return n!=null;case"line-info":case"line-info-basic":case"custom":return!0}}function Bb(e){return e!=="simple"&&e!=="metadata"}function $t({type:e,metrics:t,hunkIndex:n,hunkSpecs:i}){if(!Fb({type:e,hunkIndex:n,hunkSpecs:i}))return;const r=Od({type:e,metrics:t}),o=Nd({type:e,metrics:t}),s=n>0?o:0,l=o;return{height:r,gapBefore:s,gapAfter:l,totalHeight:s+r+l}}function Ft({type:e,metrics:t}){if(!Bb(e))return;const n=Od({type:e,metrics:t}),i=Nd({type:e,metrics:t});return{height:n,gapBefore:i,gapAfter:0,totalHeight:i+n}}function jt({diff:e,diffStyle:t,startingLine:n=0,totalLines:i=1/0,expandedHunks:r,collapsedContextThreshold:o=fe,callback:s}){const l=Ub({diff:e,diffStyle:t,startingLine:n,expandedHunks:r,collapsedContextThreshold:o}),a={viewportStart:n,viewportEnd:n+i,isWindowedHighlight:n>0||i<1/0,splitCount:l.splitCount,unifiedCount:l.unifiedCount,finalHunkIndex:e.hunks.length-1,shouldBreak(){if(!a.isWindowedHighlight)return!1;const d=a.unifiedCount>=n+i,c=a.splitCount>=n+i;return t==="unified"?d:(t==="split"||d)&&c},shouldSkip(d,c){if(!a.isWindowedHighlight)return!1;const u=a.unifiedCount+d<n,h=a.splitCount+c<n;return t==="unified"?u:(t==="split"||u)&&h},incrementCounts(d,c){(t==="unified"||t==="both")&&(a.unifiedCount+=d),(t==="split"||t==="both")&&(a.splitCount+=c)},isInWindow(d,c){if(!a.isWindowedHighlight)return!0;const u=a.isInUnifiedWindow(d),h=a.isInSplitWindow(c);return t==="unified"?u:t==="split"?h:u||h},isInUnifiedWindow(d){return!a.isWindowedHighlight||a.unifiedCount>=n-d&&a.unifiedCount<n+i},isInSplitWindow(d){return!a.isWindowedHighlight||a.splitCount>=n-d&&a.splitCount<n+i},emit(d,c=!1){return c||(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 g=function(C,x){return h==null||h.collapsedLines<=0||h.fromStart+h.fromEnd>0?0:t==="unified"?C===c.unifiedLineStart+c.unifiedLineCount-1?h.collapsedLines:0:x===c.splitLineStart+c.splitLineCount-1?h.collapsedLines:0},_=function(){return y?0:(y=!0,u.collapsedLines)};const c=e.hunks[d];if(c==null)throw new Error("iterateOverDiff: invalid hunk index");if(a.shouldBreak())break;const u=dn({isPartial:e.isPartial,rangeSize:c.collapsedBefore,expandedHunks:r,hunkIndex:d,collapsedContextThreshold:o}),h=d===a.finalHunkIndex?cn({fileDiff:e,hunkIndex:d,expandedHunks:r,collapsedContextThreshold:o,errorPrefix:"iterateOverDiff"}):void 0,f=u.fromStart+u.fromEnd;let y=u.collapsedLines===0;if(a.shouldSkip(f,f))a.incrementCounts(f,f),_();else{let C=c.unifiedLineStart-u.rangeSize,x=c.splitLineStart-u.rangeSize,I=c.deletionLineIndex-u.rangeSize,P=c.additionLineIndex-u.rangeSize,A=c.deletionStart-u.rangeSize,L=c.additionStart-u.rangeSize;if(Pn(a,u.fromStart,t,R=>a.emit({hunkIndex:d,hunk:c,collapsedBefore:0,collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:A+R,lineIndex:I+R,noEOFCR:!1,unifiedLineIndex:C+R,splitLineIndex:x+R},additionLine:{unifiedLineIndex:C+R,splitLineIndex:x+R,lineIndex:P+R,lineNumber:L+R,noEOFCR:!1}}))||(C=c.unifiedLineStart-u.fromEnd,x=c.splitLineStart-u.fromEnd,I=c.deletionLineIndex-u.fromEnd,P=c.additionLineIndex-u.fromEnd,A=c.deletionStart-u.fromEnd,L=c.additionStart-u.fromEnd,Pn(a,u.fromEnd,t,R=>a.emit({hunkIndex:d,hunk:c,collapsedBefore:_(),collapsedAfter:0,type:"context-expanded",deletionLine:{lineNumber:A+R,lineIndex:I+R,noEOFCR:!1,unifiedLineIndex:C+R,splitLineIndex:x+R},additionLine:{unifiedLineIndex:C+R,splitLineIndex:x+R,lineIndex:P+R,lineNumber:L+R,noEOFCR:!1}}),()=>{_()})))break e}let b=c.unifiedLineStart,p=c.splitLineStart,v=c.deletionLineIndex,w=c.additionLineIndex,S=c.deletionStart,k=c.additionStart;const E=c.hunkContent.at(-1);for(const C of c.hunkContent){if(a.shouldBreak())break e;const x=C===E;if(C.type==="context"){if(a.shouldSkip(C.lines,C.lines))a.incrementCounts(C.lines,C.lines),_();else if(Pn(a,C.lines,t,I=>{const P=x&&I===C.lines-1,A=b+I,L=p+I;return a.emit({hunkIndex:d,hunk:c,collapsedBefore:_(),collapsedAfter:g(A,L),type:"context",deletionLine:{lineNumber:S+I,lineIndex:v+I,noEOFCR:P&&c.noEOFCRDeletions,unifiedLineIndex:A,splitLineIndex:L},additionLine:{unifiedLineIndex:A,splitLineIndex:L,lineIndex:w+I,lineNumber:k+I,noEOFCR:P&&c.noEOFCRAdditions}})},()=>{_()}))break e;b+=C.lines,p+=C.lines,v+=C.lines,w+=C.lines,S+=C.lines,k+=C.lines}else{const I=Math.max(C.deletions,C.additions),P=C.deletions+C.additions;if(!a.shouldSkip(P,I)){const A=qb(a,C,t);(A[0]?.[0]??0)>0&&_();for(const[L,R]of A)for(let D=L;D<R;D++){const H=g(b+D,t==="unified"?p+(D<C.deletions?D:D-C.deletions):p+D);if(a.emit(jb({hunkIndex:d,hunk:c,collapsedBefore:_(),collapsedAfter:H,diffStyle:t,index:D,unifiedLineIndex:b,splitLineIndex:p,additionLineIndex:w,deletionLineIndex:v,additionLineNumber:k,deletionLineNumber:S,content:C,isLastContent:x,unifiedCount:P,splitCount:I}),!0))break e}}_(),a.incrementCounts(P,I),b+=P,p+=I,v+=C.deletions,w+=C.additions,S+=C.deletions,k+=C.additions}}if(h!=null){const{collapsedLines:C,fromStart:x,fromEnd:I}=h,P=x+I;if(Pn(a,P,t,A=>{const L=A===P-1;return a.emit({hunkIndex:e.hunks.length,hunk:void 0,collapsedBefore:0,collapsedAfter:L?C:0,type:"context-expanded",deletionLine:{lineNumber:S+A,lineIndex:v+A,noEOFCR:!1,unifiedLineIndex:b+A,splitLineIndex:p+A},additionLine:{unifiedLineIndex:b+A,splitLineIndex:p+A,lineIndex:w+A,lineNumber:k+A,noEOFCR:!1}})},void 0,()=>a.shouldBreak()))break e}}}function Ub({diff:e,diffStyle:t,startingLine:n,expandedHunks:i,collapsedContextThreshold:r}){if(n<=0||t==="both")return{hunkIndex:0,splitCount:0,unifiedCount:0};const o=Gb({diff:e,expandedHunks:i,collapsedContextThreshold:r});let s=0,l=e.hunks.length-1,a=e.hunks.length;for(;s<=l;){const c=s+l>>1,u=o[c+1];if(u==null)throw new Error("iterateOverDiff: invalid hunk prefix index");(t==="unified"?u.unifiedCount:u.splitCount)>n?(a=c,l=c-1):s=c+1}if(a>=e.hunks.length){const c=o[e.hunks.length];if(c==null)throw new Error("iterateOverDiff: invalid terminal hunk prefix index");return{hunkIndex:e.hunks.length,splitCount:c.splitCount,unifiedCount:c.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 Gb({diff:e,expandedHunks:t,collapsedContextThreshold:n}){let i=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=dn({isPartial:e.isPartial,rangeSize:a.collapsedBefore,expandedHunks:t,hunkIndex:l,collapsedContextThreshold:n}),c=d.fromStart+d.fromEnd;i+=c+a.splitLineCount,r+=c+a.unifiedLineCount;const u=l===o?cn({fileDiff:e,hunkIndex:l,expandedHunks:t,collapsedContextThreshold:n,errorPrefix:"iterateOverDiff"}):void 0;if(u!=null){const h=u.fromStart+u.fromEnd;i+=h,r+=h}s.push({splitCount:i,unifiedCount:r})}return s}function Wb(e,t,n){if(!e.isWindowedHighlight||t<=0)return[0,t];const i=[];function r(l){const a=Math.max(0,e.viewportStart-l),d=Math.min(t,e.viewportEnd-l);d>a&&i.push([a,d])}if(n!=="split"&&r(e.unifiedCount),n!=="unified"&&r(e.splitCount),i.length===0)return[0,0];let o=i[0][0],s=i[0][1];for(let l=1;l<i.length;l++){const a=i[l];o=Math.min(o,a[0]),s=Math.max(s,a[1])}return[o,s]}function Pn(e,t,n,i,r,o){const[s,l]=Wb(e,t,n);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(i(a)===!0)return!0}else e.incrementCounts(1,1);a++}return!1}function qb(e,t,n){if(!e.isWindowedHighlight)return[[0,n==="unified"?t.deletions+t.additions:Math.max(t.deletions,t.additions)]];const i=n!=="split",r=n!=="unified",o=n==="unified"?"unified":"split",s=[];function l(u,h){if(u+h<=e.viewportStart||u>=e.viewportEnd)return;const f=Math.max(0,e.viewportStart-u),g=Math.min(h,e.viewportEnd-u);return g>f?[f,g]:void 0}function a(u,h){return o==="split"?u:h==="additions"?[u[0]+t.deletions,u[1]+t.deletions]:u}function d(u,h){if(u==null)return;const[f,g]=a(u,h);g>f&&s.push([f,g])}if(i&&(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((u,h)=>u[0]-h[0]);const c=[s[0]];for(const[u,h]of s.slice(1)){const f=c[c.length-1];u<=f[1]?f[1]=Math.max(f[1],h):c.push([u,h])}return c}function jb({hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,diffStyle:r,index:o,unifiedLineIndex:s,splitLineIndex:l,additionLineIndex:a,deletionLineIndex:d,additionLineNumber:c,deletionLineNumber:u,content:h,isLastContent:f,unifiedCount:g,splitCount:y}){const _=o<h.deletions?s+o:void 0,b=r==="unified"?o>=h.deletions?s+o:void 0:o<h.additions?s+h.deletions+o:void 0,p=r==="unified"?l+(o<h.deletions?o:o-h.deletions):l+o,v=o<h.deletions?d+o:void 0,w=o<h.deletions?u+o:void 0,S=r==="unified"?o>=h.deletions?a+(o-h.deletions):void 0:o<h.additions?a+o:void 0,k=r==="unified"?o>=h.deletions?c+(o-h.deletions):void 0:o<h.additions?c+o:void 0,E=r==="unified"?f&&o===h.deletions-1&&t.noEOFCRDeletions:f&&o===y-1&&t.noEOFCRDeletions,C=r==="unified"?f&&o===g-1&&t.noEOFCRAdditions:f&&o===y-1&&t.noEOFCRAdditions,x=v!=null&&w!=null&&_!=null?{lineNumber:w,lineIndex:v,noEOFCR:E,unifiedLineIndex:_,splitLineIndex:p}:void 0,I=S!=null&&k!=null&&b!=null?{unifiedLineIndex:b,splitLineIndex:p,lineIndex:S,lineNumber:k,noEOFCR:C}:void 0;if(x==null&&I!=null)return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,deletionLine:void 0,additionLine:I};if(x!=null&&I==null)return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,deletionLine:x,additionLine:void 0};if(x==null||I==null)throw new Error("iterateOverDiff: missing change line data");return{type:"change",hunkIndex:e,hunk:t,collapsedAfter:n,collapsedBefore:i,deletionLine:x,additionLine:I}}const Kb={forcePlainText:!1};function Hd(e,t,n,{forcePlainText:i,startingLine:r,totalLines:o,expandedHunks:s,collapsedContextThreshold:l=fe}=Kb){i?(r??=0,o??=1/0):(r=0,o=1/0);const a=r>0||o<1/0,d=typeof n.theme=="string"?t.getTheme(n.theme).type:void 0,c=pd({theme:n.theme,highlighter:t}),u=i&&!a&&(e.unifiedLineCount>1e3||e.splitLineCount>1e3)?"none":n.lineDiffType,h={deletionLines:[],additionLines:[]},{maxLineDiffLength:f}=n,g=!i&&!e.isPartial,y=i?s:void 0,_=new Map;function b(v){const w=g?0:v,S=_.get(w)??Qb();return _.set(w,S),S}function p(v,w,S,k){if(a){let E=S.at(-1);(E==null||E.targetIndex+E.count!==w)&&(E={targetIndex:w,originalOffset:k.length,count:0},S.push(E)),E.count++}k.push(v)}jt({diff:e,diffStyle:"both",startingLine:r,totalLines:o,expandedHunks:a?y:!0,collapsedContextThreshold:l,callback:({hunkIndex:v,additionLine:w,deletionLine:S,type:k})=>{const E=b(v),C=w!=null?w.splitLineIndex:S.splitLineIndex;k==="change"&&w!=null&&S!=null&&Xb({additionLine:e.additionLines[w.lineIndex],deletionLine:e.deletionLines[S.lineIndex],deletionLineIndex:E.deletionContent.length,additionLineIndex:E.additionContent.length,deletionDecorations:E.deletionDecorations,additionDecorations:E.additionDecorations,lineDiffType:u,maxLineDiffLength:f}),S!=null&&(p(e.deletionLines[S.lineIndex],S.lineIndex,E.deletionSegments,E.deletionContent),E.deletionInfo.push({type:k==="change"?"change-deletion":k,lineNumber:S.lineNumber,altLineNumber:k==="change"?void 0:w.lineNumber??void 0,lineIndex:`${S.unifiedLineIndex},${C}`})),w!=null&&(p(e.additionLines[w.lineIndex],w.lineIndex,E.additionSegments,E.additionContent),E.additionInfo.push({type:k==="change"?"change-addition":k,lineNumber:w.lineNumber,altLineNumber:k==="change"?void 0:S.lineNumber??void 0,lineIndex:`${w.unifiedLineIndex},${C}`}))}});for(const v of _.values()){if(v.deletionContent.length===0&&v.additionContent.length===0)continue;const w={name:e.prevName??e.name,contents:v.deletionContent.value},S={name:e.name,contents:v.additionContent.value},{deletionLines:k,additionLines:E}=Yb({deletionFile:w,deletionInfo:v.deletionInfo,deletionDecorations:v.deletionDecorations,additionFile:S,additionInfo:v.additionInfo,additionDecorations:v.additionDecorations,highlighter:t,options:n,languageOverride:i?"text":e.lang});if(g){h.deletionLines=k,h.additionLines=E;continue}if(v.deletionSegments.length>0)for(const C of v.deletionSegments)for(let x=0;x<C.count;x++)h.deletionLines[C.targetIndex+x]=k[C.originalOffset+x];else h.deletionLines.push(...k);if(v.additionSegments.length>0)for(const C of v.additionSegments)for(let x=0;x<C.count;x++)h.additionLines[C.targetIndex+x]=E[C.originalOffset+x];else h.additionLines.push(...E)}return{code:h,themeStyles:c,baseThemeType:d}}function Xb({deletionLine:e,additionLine:t,deletionLineIndex:n,additionLineIndex:i,deletionDecorations:r,additionDecorations:o,lineDiffType:s,maxLineDiffLength:l}){if(e==null||t==null||s==="none"||(e=mt(e),t=mt(t),e.length>l||t.length>l))return;const a=s==="char"?Lb(e,t):Ab(e,t),d=[],c=[],u=s==="word-alt",h=a.at(-1);for(const g of a){const y=g===h;!g.added&&!g.removed?(In({item:g,arr:d,enableJoin:u,isNeutral:!0,isLastItem:y}),In({item:g,arr:c,enableJoin:u,isNeutral:!0,isLastItem:y})):g.removed?In({item:g,arr:d,enableJoin:u,isLastItem:y}):In({item:g,arr:c,enableJoin:u,isLastItem:y})}let f=0;for(const g of d)g[0]===1&&r.push(Hs({line:n,spanStart:f,spanLength:g[1].length})),f+=g[1].length;f=0;for(const g of c)g[0]===1&&o.push(Hs({line:i,spanStart:f,spanLength:g[1].length})),f+=g[1].length}function Qb(){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 Yb({deletionFile:e,additionFile:t,deletionInfo:n,additionInfo:i,highlighter:r,deletionDecorations:o,additionDecorations:s,languageOverride:l,options:{theme:a=X,...d}}){const c=l??ae(e.name),u=l??ae(t.name),{state:h,transformers:f}=fd(d.useTokenTransformer),g=typeof a=="string"?{...d,lang:"text",theme:a,transformers:f,decorations:void 0,defaultColor:!1,cssVariablePrefix:pe("token")}:{...d,lang:"text",themes:a,transformers:f,decorations:void 0,defaultColor:!1,cssVariablePrefix:pe("token")};return{deletionLines:e.contents===""?[]:(g.lang=c,h.lineInfo=n,g.decorations=o,Gr(r.codeToHast(mt(e.contents),g))),additionLines:t.contents===""?[]:(g.lang=u,g.decorations=s,h.lineInfo=i,Gr(r.codeToHast(mt(t.contents),g)))}}function un(e){const t=e.lang??ae(e.name),n=e.lang??(e.prevName!=null?ae(e.prevName):"text");return t==="text"&&n==="text"}let Jb=-1;var Zb=class{__id=`diff-hunks-renderer:${++Jb}`;highlighter;diff;expandedHunks=new Map;deletionAnnotations={};additionAnnotations={};computedLang="text";renderCache;constructor(e={theme:X},t,n){this.options=e,this.onRenderUpdate=t,this.workerManager=n,n?.isWorkingPool()!==!0&&(this.highlighter=qt(e.theme??X)?ad():void 0)}cleanUp(){this.recycle(),this.expandedHunks.clear(),this.workerManager=void 0,this.onRenderUpdate=void 0}recycle(){this.highlighter=void 0,this.diff=void 0,this.clearRenderCache(),this.additionAnnotations={},this.deletionAnnotations={},this.workerManager?.cleanUpTasks(this)}clearRenderCache(){this.renderCache=void 0}setOptions(e){this.options=e}mergeOptions(e){this.options={...this.options,...e}}expandHunk(e,t,n=this.getOptionsWithDefaults().expansionLineCount){const i={...this.expandedHunks.get(e)??{fromStart:0,fromEnd:0}};(t==="up"||t==="both")&&(i.fromStart+=n),(t==="down"||t==="both")&&(i.fromEnd+=n),this.renderCache?.highlighted!==!0&&this.clearRenderCache(),this.expandedHunks.set(e,i)}getExpandedHunk(e){return this.expandedHunks.get(e)??Mc}getExpandedHunksMap(){return this.expandedHunks}setLineAnnotations(e){this.additionAnnotations={},this.deletionAnnotations={};for(const t of e){const n=(()=>{switch(t.side){case"deletions":return this.deletionAnnotations;case"additions":return this.additionAnnotations}})(),i=n[t.lineNumber]??[];n[t.lineNumber]=i,i.push(t)}}getUnifiedLineDecoration({lineType:e}){return{gutterLineType:e}}getSplitLineDecoration({side:e,type:t}){return t!=="change"?{gutterLineType:t}:{gutterLineType:e==="deletions"?"change-deletion":"change-addition"}}createAnnotationElement(e){return ld(e)}getOptionsWithDefaults(){const{diffIndicators:e="bars",diffStyle:t="split",disableBackground:n=!1,disableFileHeader:i=!1,disableLineNumbers:r=!1,disableVirtualizationBuffers:o=!1,collapsed:s=!1,expandUnchanged:l=!1,collapsedContextThreshold:a=fe,expansionLineCount:d=100,hunkSeparators:c="line-info",lineDiffType:u="word-alt",maxLineDiffLength:h=1e3,overflow:f="scroll",stickyHeader:g=!1,theme:y=X,headerRenderMode:_="default",tokenizeMaxLineLength:b=1e3,tokenizeMaxLength:p=Yt,useTokenTransformer:v=!1,useCSSClasses:w=!1}=this.options;return{diffIndicators:e,diffStyle:t,disableBackground:n,disableFileHeader:i,disableLineNumbers:r,disableVirtualizationBuffers:o,collapsed:s,expandUnchanged:l,collapsedContextThreshold:a,expansionLineCount:d,hunkSeparators:c,lineDiffType:u,maxLineDiffLength:h,overflow:f,stickyHeader:g,theme:this.workerManager?.getDiffRenderOptions().theme??y,headerRenderMode:_,tokenizeMaxLineLength:b,tokenizeMaxLength:p,useTokenTransformer:v,useCSSClasses:w}}async initializeHighlighter(){return this.highlighter=await ci(ud(this.computedLang,this.options)),this.highlighter}hydrate(e){if(e==null)return;this.diff=e;const{options:t}=this.getRenderOptions(e),n=dr(e,this.getTokenizeMaxLength());let i=this.workerManager?.getDiffResultCache(e);i!=null&&!We(t,i.options)&&(i=void 0),this.renderCache??={diff:e,highlighted:!n&&!un(e),options:t,result:n?void 0:i?.result,renderRange:void 0},this.workerManager?.isWorkingPool()===!0?this.renderCache.result==null&&!n&&this.workerManager.highlightDiffAST(this,this.diff):this.highlighter==null&&(this.computedLang=e.lang??ae(e.name),this.initializeHighlighter())}getRenderOptions(e){const t=(()=>{if(this.workerManager?.isWorkingPool()===!0)return this.workerManager.getDiffRenderOptions();const{theme:i,tokenizeMaxLineLength:r,lineDiffType:o,maxLineDiffLength:s}=this.getOptionsWithDefaults();return{theme:i,useTokenTransformer:bd(this.options),tokenizeMaxLineLength:r,lineDiffType:o,maxLineDiffLength:s}})();this.getOptionsWithDefaults();const{renderCache:n}=this;return n?.result==null?{options:t,forceHighlight:!0}:!Et(e,n.diff)||!We(t,n.options)?{options:t,forceHighlight:!0}:{options:t,forceHighlight:!1}}renderDiff(e=this.renderCache?.diff,t=Kn){if(e==null)return;const{expandUnchanged:n=!1,collapsedContextThreshold:i}=this.getOptionsWithDefaults();let{options:r,forceHighlight:o}=this.getRenderOptions(e);const s=this.getMatchingWorkerResultCache(e,r);s!=null&&!this.hasHighlightedRenderCache(e,r)&&(this.renderCache={diff:e,highlighted:!0,renderRange:void 0,...s},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||un(e)||dr(e,this.getTokenizeMaxLength()),d=!Et(e,this.renderCache.diff),c=!Pi(this.renderCache.renderRange,t);if(this.workerManager?.isWorkingPool()===!0)(a||this.renderCache.result==null||!this.renderCache.highlighted&&(d||c))&&(this.renderCache.diff=e,this.renderCache.options=r,this.renderCache.highlighted=!1,(this.renderCache.result==null||d||c||o)&&(this.renderCache.result=this.workerManager.getPlainDiffAST(e,t.startingLine,t.totalLines,$b(t)||n?!0:this.expandedHunks,i)),this.renderCache.renderRange=t),!a&&l&&(!this.renderCache.highlighted||o)&&this.workerManager.highlightDiffAST(this,e);else{this.computedLang=e.lang??ae(e.name);const u=this.highlighter!=null&&qt(r.theme),h=this.highlighter!=null&&Jn(this.computedLang),f=!a&&h;if(this.highlighter!=null&&u&&(o||a||!this.renderCache.highlighted&&f||this.renderCache.result==null)){const{result:g,options:y}=this.renderDiffWithHighlighter(e,this.highlighter,a||!h);this.renderCache={diff:e,options:y,highlighted:f,result:g,renderRange:void 0}}(!u||!a&&!h)&&this.asyncHighlight(e).then(({result:g,options:y})=>{this.renderCache!=null&&(this.renderCache.highlighted=!1),this.onHighlightSuccess(e,g,y,!a)})}return this.renderCache.result!=null?this.processDiffResult(this.renderCache.diff,t,this.renderCache.result):void 0}async asyncRender(e,t=Kn){const{result:n}=await this.asyncHighlight(e);return this.processDiffResult(e,t,n)}createPreElement(e,t,n){const{diffIndicators:i,disableBackground:r,disableLineNumbers:o,overflow:s}=this.getOptionsWithDefaults();return cd({type:"diff",diffIndicators:i,disableBackground:r,disableLineNumbers:o,overflow:s,split:e,totalLines:t,customProperties:n})}async asyncHighlight(e){const t=dr(e,this.getTokenizeMaxLength());this.computedLang=t?"text":e.lang??ae(e.name);const n=this.highlighter!=null&&qt(this.options.theme??X),i=t||this.highlighter!=null&&Jn(this.computedLang);return(this.highlighter==null||!n||!i)&&(this.highlighter=await this.initializeHighlighter()),this.renderDiffWithHighlighter(e,this.highlighter,t)}renderDiffWithHighlighter(e,t,n=!1){const{options:i}=this.getRenderOptions(e),{collapsedContextThreshold:r}=this.getOptionsWithDefaults();return{result:Hd(e,t,i,{forcePlainText:n,expandedHunks:n?!0:void 0,collapsedContextThreshold:r}),options:i}}onHighlightSuccess(e,t,n,i=!0){if(this.renderCache==null)return;const r=!this.renderCache.highlighted||!We(this.renderCache.options,n)||!Et(this.renderCache.diff,e);this.renderCache={diff:e,options:n,highlighted:i,result:t,renderRange:void 0},r&&this.onRenderUpdate?.()}getMatchingWorkerResultCache(e,t){const n=this.workerManager?.getDiffResultCache(e);if(!(n==null||!We(t,n.options)))return n}hasHighlightedRenderCache(e,t){const{renderCache:n}=this;return n?.result!=null&&n.highlighted&&Et(e,n.diff)&&We(t,n.options)}onHighlightError(e){console.error(e)}getTokenizeMaxLength(){return this.options.tokenizeMaxLength??Yt}processDiffResult(e,t,{code:n,themeStyles:i,baseThemeType:r}){const{diffStyle:o,disableFileHeader:s,expandUnchanged:l,expansionLineCount:a,collapsedContextThreshold:d,hunkSeparators:c}=this.getOptionsWithDefaults();this.diff=e;const u=o==="unified";let h=[],f=[],g=[];const y=[],{additionLines:_,deletionLines:b}=n,p={rowCount:0,hunkSeparators:c,additionsContentAST:h,deletionsContentAST:f,unifiedContentAST:g,unifiedGutterAST:kt(),deletionsGutterAST:kt(),additionsGutterAST:kt(),expansionLineCount:a,hunkData:y,incrementRowCount(L=1){p.rowCount+=L},pushToGutter(L,R){switch(L){case"unified":p.unifiedGutterAST.children.push(R);break;case"deletions":p.deletionsGutterAST.children.push(R);break;case"additions":p.additionsGutterAST.children.push(R);break}}},v=Md({fileDiff:e,errorPrefix:"DiffHunksRenderer.processDiffResult"}),w={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"?(p.pushToGutter("additions",ve(void 0,"buffer",this.size)),h?.push(Rn(this.size))):(p.pushToGutter("deletions",ve(void 0,"buffer",this.size)),f?.push(Rn(this.size))),this.size=0,this.side=void 0}}},S=(L,R,D,H,M)=>{p.pushToGutter(L,Sa(R,D,H,M))};function k(L){w.flush(),o==="unified"?lr("unified",L,p):(lr("deletions",L,p),lr("additions",L,p))}jt({diff:e,diffStyle:o,startingLine:t.startingLine,totalLines:t.totalLines,expandedHunks:l?!0:this.expandedHunks,collapsedContextThreshold:d,callback:({hunkIndex:L,hunk:R,collapsedBefore:D,collapsedAfter:H,additionLine:M,deletionLine:V,type:O})=>{const G=V!=null?V.splitLineIndex:M.splitLineIndex,j=M!=null?M.unifiedLineIndex:V.unifiedLineIndex;o==="split"&&O!=="change"&&w.flush(),D>0&&k({hunkIndex:L,collapsedLines:D,rangeSize:Math.max(R?.collapsedBefore??0,0),hunkSpecs:R?.hunkSpecs,isFirstHunk:L===0,isLastHunk:!1,isExpandable:!e.isPartial});const W=o==="unified"?j:G,ce={type:O,hunkIndex:L,lineIndex:W,unifiedLineIndex:j,splitLineIndex:G,deletionLine:V,additionLine:M};if(o==="unified"){const F=this.getUnifiedInjectedRowsForLine?.(ce);F?.before!=null&&zs(F.before,p);let q=V!=null?b[V.lineIndex]:void 0,ue=M!=null?_[M.lineIndex]:void 0;if(q==null&&ue==null){const Ke="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(Ke,{file:e.name}),new Error(Ke)}const $e=O==="change"?M!=null?"change-addition":"change-deletion":O,je=this.getUnifiedLineDecoration({type:O,lineType:$e,additionLineIndex:M?.lineIndex,deletionLineIndex:V?.lineIndex});S("unified",je.gutterLineType,M!=null?M.lineNumber:V.lineNumber,`${j},${G}`,je.gutterProperties),ue!=null?ue=Dn(ue,je.contentProperties):q!=null&&(q=Dn(q,je.contentProperties)),Fs({diffStyle:"unified",type:O,deletionLine:q,additionLine:ue,unifiedSpan:this.getAnnotations("unified",V?.lineNumber,M?.lineNumber,L,W),createAnnotationElement:Ke=>this.createAnnotationElement(Ke),context:p}),F?.after!=null&&zs(F.after,p)}else{const F=this.getSplitInjectedRowsForLine?.(ce);F?.before!=null&&$s(F.before,p,w);let q=V!=null?b[V.lineIndex]:void 0,ue=M!=null?_[M.lineIndex]:void 0;const $e=this.getSplitLineDecoration({side:"deletions",type:O,lineIndex:V?.lineIndex}),je=this.getSplitLineDecoration({side:"additions",type:O,lineIndex:M?.lineIndex});if(q==null&&ue==null){const Le="DiffHunksRenderer.processDiffResult: deletionLine and additionLine are null, something is wrong";throw console.error(Le,{file:e.name}),new Error(Le)}const Ke=(()=>{if(O==="change"){if(ue==null)return"additions";if(q==null)return"deletions"}})();if(Ke!=null){if(w.side!=null&&w.side!==Ke)throw new Error("DiffHunksRenderer.processDiffResult: iterateOverDiff, invalid pending splits");w.side=Ke,w.increment()}const Eo=this.getAnnotations("split",V?.lineNumber,M?.lineNumber,L,W);if(Eo!=null&&w.size>0&&w.flush(),V!=null){const Le=Dn(q,$e.contentProperties);S("deletions",$e.gutterLineType,V.lineNumber,`${V.unifiedLineIndex},${G}`,$e.gutterProperties),Le!=null&&(q=Le)}if(M!=null){const Le=Dn(ue,je.contentProperties);S("additions",je.gutterLineType,M.lineNumber,`${M.unifiedLineIndex},${G}`,je.gutterProperties),Le!=null&&(ue=Le)}Fs({diffStyle:"split",type:O,additionLine:ue,deletionLine:q,...Eo,createAnnotationElement:Le=>this.createAnnotationElement(Le),context:p}),F?.after!=null&&$s(F.after,p,w)}const nt=o==="split"&&R!=null&&G===R.splitLineStart+R.splitLineCount-1,Ve=nt?R.noEOFCRDeletions:!1,bt=nt?R.noEOFCRAdditions:!1,ze=(V?.noEOFCR??!1)||Ve,me=(M?.noEOFCR??!1)||bt;if(me||ze){if(o==="split"&&w.flush(),ze){const F=O==="context"||O==="context-expanded"?O:"change-deletion";o==="unified"?(p.unifiedContentAST.push(An(F)),p.pushToGutter("unified",ve(F,"metadata",1))):(p.deletionsContentAST.push(An(F)),p.pushToGutter("deletions",ve(F,"metadata",1)),me||(p.pushToGutter("additions",ve(void 0,"buffer",1)),p.additionsContentAST.push(Rn(1))))}if(me){const F=O==="context"||O==="context-expanded"?O:"change-addition";o==="unified"?(p.unifiedContentAST.push(An(F)),p.pushToGutter("unified",ve(F,"metadata",1))):(p.additionsContentAST.push(An(F)),p.pushToGutter("additions",ve(F,"metadata",1)),ze||(p.pushToGutter("deletions",ve(void 0,"buffer",1)),p.deletionsContentAST.push(Rn(1))))}p.incrementRowCount(1)}H>0&&c!=="simple"&&k({hunkIndex:O==="context-expanded"?L:L+1,collapsedLines:H,rangeSize:v,hunkSpecs:void 0,isFirstHunk:!1,isLastHunk:!0,isExpandable:!e.isPartial}),p.incrementRowCount(1)}}),o==="split"&&w.flush();const E=Math.max(zb(e.hunks),e.additionLines.length??0,e.deletionLines.length??0),C=t.bufferBefore>0||t.bufferAfter>0,x=!u&&e.type!=="deleted",I=!u&&e.type!=="new",P=p.rowCount>0||C;h=x&&P?h:void 0,f=I&&P?f:void 0,g=u&&P?g:void 0;const A=this.createPreElement(f!=null&&h!=null,E);return{unifiedGutterAST:u&&P?p.unifiedGutterAST.children:void 0,unifiedContentAST:g,deletionsGutterAST:I&&P?p.deletionsGutterAST.children:void 0,deletionsContentAST:f,additionsGutterAST:x&&P?p.additionsGutterAST.children:void 0,additionsContentAST:h,hunkData:y,preNode:A,themeStyles:i,baseThemeType:r,headerElement:s?void 0:this.renderHeader(this.diff),totalLines:E,rowCount:p.rowCount,bufferBefore:t.bufferBefore,bufferAfter:t.bufferAfter,css:""}}renderCodeAST(e,t){const n=e==="unified"?t.unifiedGutterAST:e==="deletions"?t.deletionsGutterAST:t.additionsGutterAST,i=e==="unified"?t.unifiedContentAST:e==="deletions"?t.deletionsContentAST:t.additionsContentAST;if(n==null||i==null)return;const r=kt(n);return r.properties.style=`grid-row: span ${t.rowCount}`,[r,gd(i,t.rowCount)]}renderFullAST(e,t=[]){const n=this.getOptionsWithDefaults().hunkSeparators==="line-info",i=this.renderCodeAST("unified",e);if(i!=null)return t.push($({tagName:"code",children:i,properties:{"data-code":"","data-container-size":n?"":void 0,"data-unified":""}})),{...e.preNode,children:t};const r=this.renderCodeAST("deletions",e);r!=null&&t.push($({tagName:"code",children:r,properties:{"data-code":"","data-container-size":n?"":void 0,"data-deletions":""}}));const o=this.renderCodeAST("additions",e);return o!=null&&t.push($({tagName:"code",children:o,properties:{"data-code":"","data-container-size":n?"":void 0,"data-additions":""}})),{...e.preNode,children:t}}renderFullHTML(e,t=[]){return Ne(this.renderFullAST(e,t))}renderPartialHTML(e,t){return t==null?Ne(e):Ne($({tagName:"code",children:e,properties:{"data-code":"","data-container-size":this.getOptionsWithDefaults().hunkSeparators==="line-info"?"":void 0,[`data-${t}`]:""}}))}getAnnotations(e,t,n,i,r){const o={type:"annotation",hunkIndex:i,lineIndex:r,annotations:[]};if(t!=null)for(const l of this.deletionAnnotations[t]??[])o.annotations.push(pt(l));const s={type:"annotation",hunkIndex:i,lineIndex:r,annotations:[]};if(n!=null)for(const l of this.additionAnnotations[n]??[])(e==="unified"?o:s).annotations.push(pt(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}}renderHeader(e){const{headerRenderMode:t,stickyHeader:n}=this.getOptionsWithDefaults();return dd({fileOrDiff:e,mode:t,stickyHeader:n})}};function Vs(e){return`${e} unmodified line${e>1?"s":""}`}function zs(e,t){for(const n of e)t.unifiedContentAST.push(n.content),t.pushToGutter("unified",n.gutter),t.incrementRowCount(1)}function $s(e,t,n){for(const{deletion:i,addition:r}of e){if(i==null&&r==null)continue;const o=i!=null&&r!=null?void 0:i==null?"deletions":"additions";(o==null||n.side!==o)&&n.flush(),i!=null&&(t.deletionsContentAST.push(i.content),t.pushToGutter("deletions",i.gutter)),r!=null&&(t.additionsContentAST.push(r.content),t.pushToGutter("additions",r.gutter)),o!=null&&(n.side=o,n.increment()),t.incrementRowCount(1)}}function Fs({diffStyle:e,type:t,deletionLine:n,additionLine:i,unifiedSpan:r,deletionSpan:o,additionSpan:s,createAnnotationElement:l,context:a}){let d=!1;if(e==="unified"){if(i!=null?a.unifiedContentAST.push(i):n!=null&&a.unifiedContentAST.push(n),r!=null){const c=t==="change"?n!=null?"change-deletion":"change-addition":t;a.unifiedContentAST.push(l(r)),a.pushToGutter("unified",ve(c,"annotation",1)),d=!0}}else if(e==="split"){if(n!=null&&a.deletionsContentAST.push(n),i!=null&&a.additionsContentAST.push(i),o!=null){const c=t==="change"?n!=null?"change-deletion":"context":t;a.deletionsContentAST.push(l(o)),a.pushToGutter("deletions",ve(c,"annotation",1)),d=!0}if(s!=null){const c=t==="change"?i!=null?"change-addition":"context":t;a.additionsContentAST.push(l(s)),a.pushToGutter("additions",ve(c,"annotation",1)),d=!0}}d&&a.incrementRowCount(1)}function lr(e,{hunkIndex:t,collapsedLines:n,rangeSize:i,hunkSpecs:r,isFirstHunk:o,isLastHunk:s,isExpandable:l},a){if(n<=0)return;const d=e==="unified"?a.unifiedContentAST:e==="deletions"?a.deletionsContentAST:a.additionsContentAST;if(a.hunkSeparators==="metadata"){r!=null&&(a.pushToGutter(e,_t({type:"metadata",content:r,isFirstHunk:o,isLastHunk:s})),d.push(_t({type:"metadata",content:r,isFirstHunk:o,isLastHunk:s})),e!=="additions"&&a.incrementRowCount(1));return}if(a.hunkSeparators==="simple"){t>0&&(a.pushToGutter(e,_t({type:"simple",isFirstHunk:o,isLastHunk:!1})),d.push(_t({type:"simple",isFirstHunk:o,isLastHunk:!1})),e!=="additions"&&a.incrementRowCount(1));return}const c=Vb(e,t),u=i>a.expansionLineCount,h=l?t:void 0;a.pushToGutter(e,_t({type:a.hunkSeparators,content:Vs(n),expandIndex:h,chunked:u,slotName:c,isFirstHunk:o,isLastHunk:s})),d.push(_t({type:a.hunkSeparators,content:Vs(n),expandIndex:h,chunked:u,slotName:c,isFirstHunk:o,isLastHunk:s})),e!=="additions"&&a.incrementRowCount(1),a.hunkData.push({slotName:c,hunkIndex:t,lines:n,type:e,expandable:l?{up:!o,down:!s,chunked:u}:void 0})}function Dn(e,t){return e==null||e.type!=="element"||t==null?e:{...e,properties:{...e.properties,...t}}}function dr(e,t){return Math.max(e.additionLines.length,e.deletionLines.length)>t}function ev(e,t){return e.lineNumber===t.lineNumber&&e.side===t.side&&e.metadata===t.metadata}function tv(e,t){return e.slotName===t.slotName&&e.hunkIndex===t.hunkIndex&&e.lines===t.lines&&e.type===t.type&&e.expandable?.chunked===t.expandable?.chunked&&e.expandable?.up===t.expandable?.up&&e.expandable?.down===t.expandable?.down}function nv(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:e?.useTokenTransformer,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,collapsedContextThreshold:e?.collapsedContextThreshold,lineDiffType:e?.lineDiffType,maxLineDiffLength:e?.maxLineDiffLength,expansionLineCount:e?.expansionLineCount,headerRenderMode:e?.renderCustomHeader!=null?"custom":"default"}}let iv=-1;var Vd=class{static LoadedCustomComponent=Id;__id=`file-diff:${++iv}`;type="file-diff";fileContainer;spriteSVG;pre;codeUnified;codeDeletions;codeAdditions;bufferBefore;bufferAfter;themeCSSStyle;appliedThemeCSS;hasAdoptedThemeCSS=!1;unsafeCSSStyle;appliedUnsafeCSS;gutterUtilityContent;headerElement;headerPrefix;headerMetadata;headerCustom;separatorCache=new Map;errorWrapper;placeHolder;hunksRenderer;resizeManager;scrollSyncManager;interactionManager;annotationCache=new Map;lineAnnotations=[];managersDirty=!1;deletionFile;additionFile;fileDiff;renderRange;appliedPreAttributes;lastRenderedHeaderHTML;cachedHeaderHTML;lastRowCount;mounted=!1;enabled=!0;constructor(e={theme:X},t,n=!1){this.options=e,this.workerManager=t,this.isContainerManaged=n,this.hunksRenderer=this.createHunksRenderer(e),this.resizeManager=new Ha,this.scrollSyncManager=new Hb,this.interactionManager=new Na("diff",Yn(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()};getHunksRendererOptions(e){return nv(e)}createHunksRenderer(e){return new Zb(this.getHunksRendererOptions(e),this.handleHighlightRender,this.workerManager)}getLineIndex=(e,t="additions")=>{if(this.fileDiff==null)return;const n=this.fileDiff.hunks.at(-1);let i,r;e:for(const o of this.fileDiff.hunks){let s=t==="deletions"?o.deletionStart:o.additionStart;const l=t==="deletions"?o.deletionCount:o.additionCount;let a=o.splitLineStart,d=o.unifiedLineStart;if(e<s){const c=s-e;i=Math.max(d-c,0),r=Math.max(a-c,0);break e}if(e>=s+l){if(o===n){const c=e-(s+l);i=d+o.unifiedLineCount+c,r=a+o.splitLineCount+c;break e}continue}for(const c of o.hunkContent)if(c.type==="context")if(e<s+c.lines){const u=e-s;r=a+u,i=d+u;break e}else s+=c.lines,a+=c.lines,d+=c.lines;else{const u=t==="deletions"?c.deletions:c.additions;if(e<s+u){const h=e-s;i=d+(t==="additions"?c.deletions:0)+h,r=a+h;break e}else s+=u,a+=Math.max(c.deletions,c.additions),d+=c.deletions+c.additions}break e}if(!(i==null||r==null))return[i,r]};setOptions(e){e!=null&&(this.options=e,this.cachedHeaderHTML=void 0,this.hunksRenderer.setOptions(this.getHunksRendererOptions(e)),this.syncInteractionOptions())}syncInteractionOptions(){this.interactionManager.setOptions(Yn(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&&!Rt(this.appliedThemeCSS.theme,this.options.theme??X)}getHoveredLine=()=>this.interactionManager.getHoveredLine();setLineAnnotations(e){this.lineAnnotations=e}canPartiallyRender(e,t,n){return!(e||t||n||typeof this.options.hunkSeparators=="function")}setSelectedLines(e,t){this.interactionManager.setSelection(e,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,t==="wrap"),t==="scroll"&&e==="split"?this.scrollSyncManager.setup(this.pre,this.codeDeletions,this.codeAdditions):this.scrollSyncManager.cleanUp(),this.managersDirty=!1}cleanUp(e=!1){this.emitPostRender(!0),this.resizeManager.cleanUp(),this.interactionManager.cleanUp(),this.scrollSyncManager.cleanUp(),this.managersDirty=!1,this.workerManager?.unsubscribeToThemeChanges(this),this.renderRange=void 0,this.isContainerManaged||this.fileContainer?.remove(),this.fileContainer=void 0,this.mounted=!1,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=void 0,this.bufferAfter=void 0,this.appliedPreAttributes=void 0,this.headerElement=void 0,this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0,this.placeHolder=void 0,this.lastRenderedHeaderHTML=void 0,e||(this.cachedHeaderHTML=void 0),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.deletionFile=void 0,this.additionFile=void 0),this.enabled=!1}virtualizedSetup(){this.enabled=!0,this.workerManager?.subscribeToThemeChanges(this)}hydrate(e){const{fileContainer:t,prerenderedHTML:n,preventEmit:i=!1,lineAnnotations:r,oldFile:o,newFile:s,fileDiff:l}=e;this.hydrateElements(t,n),sv(this.pre,rv({fileDiff:l,oldFile:o,newFile:s}),this.options.collapsed)||av(this.headerElement,ov({fileDiff:l,oldFile:o,newFile:s}),this.options.disableFileHeader)?this.render({...e,preventEmit:!0}):this.hydrationSetup({fileDiff:l,oldFile:o,newFile:s,lineAnnotations:r}),i||this.emitPostRender()}hydrateElements(e,t){this.fileContainer!==e&&this.emitPostRender(!0),Td(e,t);for(const n of e.shadowRoot?.children??[]){if(n instanceof SVGElement){this.spriteSVG=n;continue}if(n instanceof HTMLElement){if(n instanceof HTMLPreElement){this.pre=n;for(const i of n.children)!(i instanceof HTMLElement)||i.tagName.toLowerCase()!=="code"||("deletions"in i.dataset&&(this.codeDeletions=i),"additions"in i.dataset&&(this.codeAdditions=i),"unified"in i.dataset&&(this.codeUnified=i));continue}if("diffsHeader"in n.dataset){this.headerElement=n;continue}if(n instanceof HTMLStyleElement&&n.hasAttribute(Xt)){this.themeCSSStyle=n;continue}if(n instanceof HTMLStyleElement&&n.hasAttribute(Qt)){this.unsafeCSSStyle=n,this.appliedUnsafeCSS=n.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:n,lineAnnotations:i}){this.lineAnnotations=i??this.lineAnnotations,this.additionFile=n,this.deletionFile=t,this.fileDiff=e??(t!=null&&n!=null?Kr(t,n,this.options.parseDiffOptions):void 0),this.pre!=null&&(this.syncInteractionOptions(),this.hunksRenderer.hydrate(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,n)=>{this.expandHunk(e,t,n)};expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.rerender()};render({oldFile:e,newFile:t,fileDiff:n,deferManagers:i=!1,forceRender:r=!1,preventEmit:o=!1,lineAnnotations:s,fileContainer:l,containerWrapper:a,renderRange:d}){if(!this.enabled)throw new Error("FileDiff.render: attempting to call render after cleaned up");const{collapsed:c=!1,themeType:u="system"}=this.options,h=c?void 0:d,f=this.hasThemeChanged(),g=e!=null&&t!=null&&(!Me(e,this.deletionFile)||!Me(t,this.additionFile));let y=n!=null&&n!==this.fileDiff;const _=s!=null&&(s.length>0||this.lineAnnotations.length>0)?s!==this.lineAnnotations:!1;if(!c&&Pi(h,this.renderRange)&&!r&&!_&&!f&&(n!=null&&n===this.fileDiff||n==null&&!g))return this.applyCachedThemeState(u);const{renderRange:b}=this;if(this.renderRange=h,this.deletionFile=e,this.additionFile=t,n!=null?this.fileDiff=n:e!=null&&t!=null&&g&&(y=!0,this.fileDiff=Kr(e,t,this.options.parseDiffOptions)),y&&(this.cachedHeaderHTML=void 0),s!=null&&this.setLineAnnotations(s),this.fileDiff==null)return!1;this.hunksRenderer.setOptions(this.getHunksRendererOptions(this.options)),this.syncInteractionOptions(),this.hunksRenderer.setLineAnnotations(this.lineAnnotations);const{disableErrorHandling:p=!1,disableFileHeader:v=!1}=this.options;if(v&&(this.headerElement!=null&&(this.headerElement.remove(),this.headerElement=void 0,this.lastRenderedHeaderHTML=void 0),this.clearHeaderSlots()),l=this.getOrCreateFileContainer(l,a),this.applyCachedThemeState(u),c){this.removeRenderedCode(),this.clearAuxiliaryNodes();try{const w=this.hunksRenderer.renderDiff(this.fileDiff,_a);w!=null&&this.applyThemeState(l,w.themeStyles,u,w.baseThemeType),w?.headerElement!=null&&this.applyHeaderToDOM(w.headerElement,l),this.renderSeparators([]),this.injectUnsafeCSS()}catch(w){if(p)throw w;console.error(w),w instanceof Error&&this.applyErrorToDOM(w,l)}return o||this.emitPostRender(),!0}try{const w=this.getOrCreatePreNode(l);if(!(this.canPartiallyRender(r,_,g||y||f)&&this.applyPartialRender({previousRenderRange:b,renderRange:h}))){const S=this.hunksRenderer.renderDiff(this.fileDiff,h);if(S==null)return this.workerManager?.isInitialized()===!1&&this.workerManager.initialize().then(()=>this.rerender()),!1;this.applyThemeState(l,S.themeStyles,u,S.baseThemeType),S.headerElement!=null&&this.applyHeaderToDOM(S.headerElement,l),S.additionsContentAST!=null||S.deletionsContentAST!=null||S.unifiedContentAST!=null?this.applyHunksToDOM(w,S):this.pre!=null&&(this.pre.remove(),this.pre=void 0),this.renderSeparators(S.hunkData)}this.applyBuffers(w,h),this.injectUnsafeCSS(),this.renderAnnotations(),this.renderGutterUtility(),this.managersDirty=!0,i||this.flushManagers()}catch(w){if(p)throw w;console.error(w),w instanceof Error&&this.applyErrorToDOM(w,l)}return o||this.emitPostRender(),!0}emitPostRender(e=!1){const{fileContainer:t,options:{onPostRender:n}}=this;if(e){if(!this.mounted||(this.mounted=!1,t==null))return;this.options.onPostRender?.(t,this,"unmount");return}if(t==null)return;const i=this.mounted?"update":"mount";this.mounted=!0,n?.(t,this,i)}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.placeHolder.style.setProperty("height",`${e}px`),!0}primeHighlightCache(){const{fileDiff:e,workerManager:t}=this;if(e==null||t==null||un(e))return;const n=this.options.tokenizeMaxLength??Yt;Math.max(e.additionLines.length,e.deletionLines.length)>n||t.primeDiffHighlightCache(e)}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.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.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.lastRenderedHeaderHTML=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:i}of this.separatorCache.values())i.remove();this.separatorCache.clear();return}const n=new Map(this.separatorCache);for(const i of e){const r=i.slotName;let o=this.separatorCache.get(r);if(o==null||!tv(i,o.hunkData)){o?.element.remove();const s=document.createElement("div");s.style.display="contents",s.slot=i.slotName;const l=t(i,this);l!=null&&s.appendChild(l),this.fileContainer.appendChild(s),o={element:s,hunkData:i},this.separatorCache.set(r,o)}n.delete(r)}for(const[i,{element:r}]of n.entries())this.separatorCache.delete(i),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;if(t!=null&&this.lineAnnotations.length>0)for(const[n,i]of this.lineAnnotations.entries()){const r=`${n}-${pt(i)}`;let o=this.annotationCache.get(r);if(o==null||!ev(i,o.annotation)){o?.element.remove();const s=t(i);if(s==null)continue;o={element:_d(pt(i)),annotation:i},o.element.appendChild(s),this.fileContainer.appendChild(o.element),this.annotationCache.set(r,o)}e.delete(r)}for(const[n,{element:i}]of e.entries())this.annotationCache.delete(n),i.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 n=wd();n.appendChild(t),this.fileContainer.appendChild(n),this.gutterUtilityContent=n}getOrCreateFileContainer(e,t){const{fileContainer:n}=this,i=e??n??document.createElement(jn),r=n!==i;return r&&this.emitPostRender(!0),this.fileContainer=i,n!=null&&r&&(this.lastRenderedHeaderHTML=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 n of t.children)n instanceof SVGElement?this.spriteSVG??=n:hi(n)&&n.hasAttribute(Xt)?(this.themeCSSStyle??=n,this.hasAdoptedThemeCSS=!0):hi(n)&&n.hasAttribute(Qt)&&(this.unsafeCSSStyle??=n,this.appliedUnsafeCSS??=this.options.unsafeCSS??void 0)}ensureSpriteSVG(e){const t=e.shadowRoot??e.attachShadow({mode:"open"});if(this.spriteSVG==null){const n=document.createElement("div");n.innerHTML=vd;const i=n.firstChild;i instanceof SVGElement&&(this.spriteSVG=i)}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&&(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){this.cleanupErrorWrapper(),this.placeHolder?.remove(),this.placeHolder=void 0;const{fileDiff:n}=this,i=this.cachedHeaderHTML??Ne(e);if(this.cachedHeaderHTML=i,i!==this.lastRenderedHeaderHTML){const d=document.createElement("div");d.innerHTML=i;const c=d.firstElementChild;if(!(c instanceof HTMLElement))return;this.headerElement!=null?t.shadowRoot?.replaceChild(c,this.headerElement):t.shadowRoot?.prepend(c),this.headerElement=c,this.lastRenderedHeaderHTML=i}if(this.isContainerManaged||n==null)return;const{renderCustomHeader:r,renderHeaderPrefix:o,renderHeaderMetadata:s}=this.options;if(r!=null){const d=r(n)??void 0;this.headerCustom=this.upsertHeaderSlotElement(t,this.headerCustom,to,d),this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0;return}const l=o?.(n)??void 0,a=s?.(n)??void 0;this.headerPrefix=this.upsertHeaderSlotElement(t,this.headerPrefix,Zr,l),this.headerMetadata=this.upsertHeaderSlotElement(t,this.headerMetadata,eo,a),this.headerCustom?.remove(),this.headerCustom=void 0}clearHeaderSlots(){this.headerPrefix?.remove(),this.headerMetadata?.remove(),this.headerCustom?.remove(),this.headerPrefix=void 0,this.headerMetadata=void 0,this.headerCustom=void 0}upsertHeaderSlotElement(e,t,n,i){if(i==null){t?.remove();return}const r=t??this.createHeaderSlotElement(n);return t==null&&e.appendChild(r),this.replaceHeaderSlotContent(r,i),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??=Sd(),this.unsafeCSSStyle.parentNode!==t&&t.appendChild(this.unsafeCSSStyle),this.unsafeCSSStyle.textContent=Ed(e),this.appliedUnsafeCSS=e)}}applyThemeState(e,t,n,i){const r=e.shadowRoot??e.attachShadow({mode:"open"}),o=i??n,s=this.options.theme??X,l=typeof s=="string"?s:{...s},a=ln(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:i,scrollbarGutter:a};return}this.themeCSSStyle=Ad({shadowRoot:r,currentNode:this.themeCSSStyle,themeCSS:xd(t,o,a)}),this.appliedThemeCSS=this.themeCSSStyle!=null?{theme:l,themeStyles:t,themeType:o,baseThemeType:i,scrollbarGutter:a}:void 0}hydrateMeasuredScrollbar(){const e=this.fileContainer?.shadowRoot;e==null||this.themeCSSStyle==null||(this.themeCSSStyle.textContent=Ld(this.themeCSSStyle.textContent??"",ln(e)))}applyHunksToDOM(e,t){const{overflow:n="scroll"}=this.options,i=(this.options.hunkSeparators??"line-info")==="line-info",r=n==="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);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=qn({code:this.codeUnified,columnType:"unified",rowSpan:r,containerSize:i}),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=qn({code:this.codeDeletions,columnType:"deletions",rowSpan:r,containerSize:i}),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=qn({code:this.codeAdditions,columnType:"additions",rowSpan:r,containerSize:i}),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({previousRenderRange:e,renderRange:t}){const{pre:n,codeUnified:i,codeAdditions:r,codeDeletions:o,options:{diffStyle:s="split"}}=this;if(n==null||e==null||t==null||!Number.isFinite(e.totalLines)||!Number.isFinite(t.totalLines)||this.lastRowCount==null)return!1;const l=this.getCodeColumns(s,i,o,r);if(l==null)return!1;const a=e.startingLine,d=t.startingLine,c=a+e.totalLines,u=d+t.totalLines,h=Math.max(a,d),f=Math.min(c,u);if(f<=h)return!1;const g=Math.max(0,h-a),y=Math.max(0,c-f),_=this.trimColumns({columns:l,trimStart:g,trimEnd:y,previousStart:a,overlapStart:h,overlapEnd:f,diffStyle:s});if(_<0)throw new Error("applyPartialRender: failed to trim to overlap");if(this.lastRowCount<_)throw new Error("applyPartialRender: trimmed beyond DOM row count");let b=this.lastRowCount-_;const p=(k,E)=>{if(!(E<=0||this.fileDiff==null))return this.hunksRenderer.renderDiff(this.fileDiff,{startingLine:k,totalLines:E,bufferBefore:0,bufferAfter:0})},v=p(d,Math.max(h-d,0));if(v==null&&d<h)return!1;const w=p(f,Math.max(u-f,0));if(w==null&&u>f)return!1;const S=(k,E)=>{if(k!=null){if(s==="unified"&&!Array.isArray(l))this.insertPartialHTML(s,l,k,E);else if(s==="split"&&Array.isArray(l))this.insertPartialHTML(s,l,k,E);else throw new Error("FileDiff.applyPartialRender.applyChunk: invalid chunk application");b+=k.rowCount}};return this.cleanupErrorWrapper(),S(v,"afterbegin"),S(w,"beforeend"),this.lastRowCount!==b&&(this.applyRowSpan(s,l,b),this.lastRowCount=b),!0}insertPartialHTML(e,t,n,i){if(e==="unified"&&!Array.isArray(t)){const r=this.hunksRenderer.renderCodeAST("unified",n);this.renderPartialColumn(t,r,i)}else if(e==="split"&&Array.isArray(t)){const r=this.hunksRenderer.renderCodeAST("deletions",n),o=this.hunksRenderer.renderCodeAST("additions",n);this.renderPartialColumn(t[0],r,i),this.renderPartialColumn(t[1],o,i)}else throw new Error("FileDiff.insertPartialHTML: Invalid argument composition")}renderPartialColumn(e,t,n){if(e==null||t==null)return;const i=Bs(t[0]),r=Bs(t[1]);if(i==null||r==null)throw new Error("FileDiff.insertPartialHTML: Unexpected AST structure");const o=r.at(0);n==="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],i,r,!0);const s=r.at(-1);n==="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],i,r,!1),e.gutter.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(i)),e.content.insertAdjacentHTML(n,this.hunksRenderer.renderPartialHTML(r))}mergeBuffersIfNecessary(e,t,n,i,r,o){if(!(t instanceof HTMLElement)||!(n instanceof HTMLElement))return;const s=this.getBufferSize(t.dataset);s!=null&&(o?(i.shift(),r.shift()):(i.pop(),r.pop()),this.updateBufferSize(t,s+e),this.updateBufferSize(n,s+e))}applyRowSpan(e,t,n){const i=r=>{r!=null&&(r.gutter.style.setProperty("grid-row",`span ${n}`),r.content.style.setProperty("grid-row",`span ${n}`))};if(e==="unified"&&!Array.isArray(t))i(t);else if(e==="split"&&Array.isArray(t))i(t[0]),i(t[1]);else throw new Error("dun fuuuuked up")}trimColumnRows(e,t,n){let i=0,r=0,o=0,s=!1;const l=n>=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 c=d[o],u=a[o];if(o++,!(c instanceof HTMLElement)||!(u instanceof HTMLElement))throw console.error({gutterElement:c,contentElement:u}),new Error("FileDiff.trimColumnRows: invalid row elements");if(s&&(s=!1,c.dataset.gutterBuffer==="annotation"&&"lineAnnotation"in u.dataset||c.dataset.gutterBuffer==="metadata"&&"noNewline"in u.dataset)){c.remove(),u.remove(),r++;continue}if("lineIndex"in c.dataset&&"lineIndex"in u.dataset){(t>0||l&&i>=n)&&(c.remove(),u.remove(),t>0&&(t--,t===0&&(s=!0)),r++),i++;continue}if("separator"in c.dataset&&"separator"in u.dataset){(t>0||l&&i>=n)&&(c.remove(),u.remove(),r++);continue}if(c.dataset.gutterBuffer==="annotation"&&"lineAnnotation"in u.dataset){(t>0||l&&i>=n)&&(c.remove(),u.remove(),r++);continue}if(c.dataset.gutterBuffer==="metadata"&&"noNewline"in u.dataset){(t>0||l&&i>=n)&&(c.remove(),u.remove(),r++);continue}if(c.dataset.gutterBuffer==="buffer"&&"contentBuffer"in u.dataset){const h=this.getBufferSize(u.dataset);if(h==null)throw new Error("FileDiff.trimColumnRows: invalid element");if(t>0){const f=Math.min(t,h),g=h-f;g>0?(this.updateBufferSize(c,g),this.updateBufferSize(u,g),r+=f):(c.remove(),u.remove(),r+=h),t-=f,t===0&&g===0&&(s=!0)}else if(l){const f=i,g=i+h-1;if(n<=f)c.remove(),u.remove(),r+=h;else if(n<=g){const y=g-n+1,_=h-y;this.updateBufferSize(c,_),this.updateBufferSize(u,_),r+=y}}i+=h;continue}throw console.error({gutterElement:c,contentElement:u}),new Error("FileDiff.trimColumnRows: unknown row elements")}return r}trimColumns({columns:e,diffStyle:t,overlapEnd:n,overlapStart:i,previousStart:r,trimEnd:o,trimStart:s}){const l=Math.max(0,i-r),a=n-r;if(a<0)throw new Error("FileDiff.trimColumns: overlap ends before previous");const d=s>0,c=o>0;if(!d&&!c)return 0;const u=d?l:0,h=c?a:-1;if(t==="unified"&&!Array.isArray(e))return this.trimColumnRows(e,u,h);if(t==="split"&&Array.isArray(e)){const f=this.trimColumnRows(e[0],u,h),g=this.trimColumnRows(e[1],u,h);if(e[0]!=null&&e[1]!=null&&f!==g)throw new Error("FileDiff.trimColumns: split columns out of sync");return e[0]!=null?f:g}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)`)}getCodeColumns(e,t,n,i){function r(o){if(o==null)return;const s=o.children[0],l=o.children[1];if(!(!(s instanceof HTMLElement)||!(l instanceof HTMLElement)||s.dataset.gutter==null||l.dataset.content==null))return{gutter:s,content:l}}if(e==="unified")return r(t);{const o=r(n),s=r(i);return o!=null||s!=null?[o,s]:void 0}}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:n,totalLines:i},r){const{diffIndicators:o="bars",disableBackground:s=!1,disableLineNumbers:l=!1,overflow:a="scroll",diffStyle:d="split"}=this.options,c={type:"diff",diffIndicators:o,disableBackground:s,disableLineNumbers:l,overflow:a,split:d==="unified"?!1:t!=null&&n!=null,totalLines:i,customProperties:r};yd(c,this.appliedPreAttributes)||(Rd(e,c),this.appliedPreAttributes=c)}applyErrorToDOM(e,t){this.cleanupErrorWrapper(),this.pre?.remove(),this.pre=void 0,this.appliedPreAttributes=void 0;const n=t.shadowRoot??t.attachShadow({mode:"open"});this.errorWrapper??=document.createElement("div"),this.errorWrapper.dataset.errorWrapper="",this.errorWrapper.textContent="",n.appendChild(this.errorWrapper);const i=document.createElement("div");i.dataset.errorMessage="",i.innerText=e.message,this.errorWrapper.appendChild(i);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 rv({fileDiff:e,oldFile:t,newFile:n}){return e!=null&&e.hunks.length>0||t!=null||n!=null}function ov({fileDiff:e,oldFile:t,newFile:n}){return e!=null||t!=null||n!=null}function sv(e,t,n=!1){return!n&&e==null&&t}function av(e,t,n=!1){return e==null&&t&&!n}function Bs(e){if(!(e==null||e.type!=="element"))return e.children??[]}function lv({fileDiff:e,metrics:t,disableFileHeader:n,hunkSeparators:i,expandUnchanged:r,expandedHunks:o,collapsedContextThreshold:s}){let l=De(t,n),a=l;const d=r?!0:o,c=e.hunks.length-1;for(let u=0;u<e.hunks.length;u++){const h=e.hunks[u];if(h==null)throw new Error("computeEstimatedDiffHeights: invalid hunk index");const f=dn({isPartial:e.isPartial,rangeSize:h.collapsedBefore,expandedHunks:d,hunkIndex:u,collapsedContextThreshold:s}),g=(f.fromStart+f.fromEnd)*t.lineHeight;if(l+=g,a+=g,f.collapsedLines>0){const b=$t({type:i,metrics:t,hunkIndex:u,hunkSpecs:h.hunkSpecs})?.totalHeight??0;l+=b,a+=b}l+=h.splitLineCount*t.lineHeight,a+=h.unifiedLineCount*t.lineHeight;const y=dv(h);l+=y.split*t.lineHeight,a+=y.unified*t.lineHeight;const _=u===c?cn({fileDiff:e,hunkIndex:u,expandedHunks:d,collapsedContextThreshold:s,errorPrefix:"computeEstimatedDiffHeights"}):void 0;if(_!=null){const b=(_.fromStart+_.fromEnd)*t.lineHeight;if(l+=b,a+=b,_.collapsedLines>0){const p=Ft({type:i,metrics:t})?.totalHeight??0;l+=p,a+=p}}}if(e.hunks.length>0){const u=fi(t);l+=u,a+=u}return{splitHeight:l,unifiedHeight:a}}function dv(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 n=t.lines>0?1:0;return{split:n,unified:n}}return cv(e,t)}function cv(e,t){const n=(t.deletions>0&&e.noEOFCRDeletions?1:0)+(t.additions>0&&e.noEOFCRAdditions?1:0),i=t.deletions>0&&e.noEOFCRDeletions,r=t.additions>0&&e.noEOFCRAdditions;return{split:i||r?1:0,unified:n}}const Xr=5e3;let uv=-1;var hv=class extends Vd{__id=`little-virtualized-file-diff:${++uv}`;top;height=0;metrics;cache={heightDeltas:new Map,measuredHeightDeltaTotal:0,estimatedSplitHeight:void 0,estimatedUnifiedHeight:void 0,checkpoints:[],totalLines:0};isVisible=!1;isSetup=!1;virtualizer;layoutDirty=!0;forceRenderOverride;currentCollapsed;constructor(e,t,n,i,r=!1){super(e,i,r),this.virtualizer=t,this.metrics=rr(n)}setMetrics(e,t=!1){const n=rr(e);!t&&Xn(this.metrics,n)||(this.metrics=n,this.resetLayoutCache({includeEstimatedHeights:!0}))}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,n=!no(t,e),i=n&&bv(t,e);super.setOptions(e),i&&this.resetLayoutCache({forceSimpleRecompute:!0,includeEstimatedHeights:vv(t,e)}),n&&(this.forceRenderOverride=!0),n&&this.isSimpleMode()&&this.virtualizer.instanceChanged(this,i)}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}={}){this.layoutDirty=!0,this.cache.heightDeltas.size>0&&this.cache.heightDeltas.clear(),this.cache.measuredHeightDeltaTotal!==0&&(this.cache.measuredHeightDeltaTotal=0),this.cache.checkpoints.length>0&&(this.cache.checkpoints.length=0),this.cache.totalLines!==0&&(this.cache.totalLines=0),t&&(this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0),this.renderRange!=null&&(this.renderRange=void 0),e&&this.isSimpleMode()&&this.computeApproximateSize()}reconcileHeights(){let e=!1;const{overflow:t="scroll"}=this.options;if(this.fileContainer==null||this.fileDiff==null)return this.height!==0&&(e=!0),this.height=0,e;if(this.top=this.getVirtualizedTop(),t==="scroll"&&this.lineAnnotations.length===0&&!this.isResizeDebuggingEnabled())return e;const n=this.getDiffStyle(),i=n==="split"?[this.codeDeletions,this.codeAdditions]:[this.codeUnified];for(const r of i){if(r==null)continue;const o=r.children[1];if(o instanceof HTMLElement)for(const s of o.children){if(!(s instanceof HTMLElement))continue;const l=s.dataset.lineIndex;if(l==null)continue;const a=_v(l,n);let d=s.getBoundingClientRect().height,c=!1;s.nextElementSibling instanceof HTMLElement&&("lineAnnotation"in s.nextElementSibling.dataset||"noNewline"in s.nextElementSibling.dataset)&&("noNewline"in s.nextElementSibling.dataset&&(c=!0),d+=s.nextElementSibling.getBoundingClientRect().height);const u=this.getEstimatedLineHeight(c),h=this.cache.heightDeltas.get(a)??0,f=d-u;f!==h&&(e=!0,this.cache.measuredHeightDeltaTotal+=f-h,f===0?this.cache.heightDeltas.delete(a):this.cache.heightDeltas.set(a,f))}}return(e||this.isResizeDebuggingEnabled())&&this.computeApproximateSize(!0),e}onRender=e=>this.fileContainer==null?!1:(e&&(this.top=this.getVirtualizedTop()),this.render());prepareCodeViewItem(e,t,n){const i=!Et(this.fileDiff,e);let r=n?.resetDiffLayoutCache===!0||i,o=i||n?.resetDiffLayoutCache===!0&&n.includeEstimatedDiffHeights;n?.metrics!=null&&(this.metrics=rr(n.metrics),r=!0,o=!0);const{collapsed:s=!1}=this.options;return this.currentCollapsed!==s&&(this.currentCollapsed=s,r=!0),r&&this.resetLayoutCache({includeEstimatedHeights:o}),this.fileDiff=e,this.top=t,this.computeApproximateSize(),this.height}getLinePosition(e,t="additions"){if(this.fileDiff==null)return;const n=this.getLineIndex(e,t);if(n==null)return;const{disableFileHeader:i=!1,expandUnchanged:r=!1,collapsed:o=!1,collapsedContextThreshold:s=fe}=this.options,l=this.getDiffStyle(),a=this.getHunkSeparatorType(),d=l==="split"?n[1]:n[0];this.approximateLayoutCheckpoints();const c=this.getLayoutCheckpointBeforeLineIndex(d);let u=c?.top??De(this.metrics,i);if(o)return{top:u,height:0};let h;return jt({diff:this.fileDiff,diffStyle:l,startingLine:c?.renderedLineIndex??0,expandedHunks:r?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:s,callback:({hunkIndex:f,hunk:g,collapsedBefore:y,collapsedAfter:_,deletionLine:b,additionLine:p})=>{const v=l==="split"?p?.splitLineIndex??b?.splitLineIndex:p?.unifiedLineIndex??b?.unifiedLineIndex;if(v==null)throw new Error("VirtualizedFileDiff.getLinePosition: missing line index data");if(y>0){const S=$t({type:a,metrics:this.metrics,hunkIndex:f,hunkSpecs:g?.hunkSpecs});if(S!=null){if(u+=S.gapBefore,d>=v-y&&d<v)return h={top:u,height:S.height},!0;u+=S.height+S.gapAfter}}const w=this.getLineHeight(v,(p?.noEOFCR??!1)||(b?.noEOFCR??!1));if(v===d)return h={top:u,height:w},!0;if(u+=w,_>0){const S=Ft({type:a,metrics:this.metrics});if(S!=null){if(d>v&&d<=v+_)return h={top:u+S.gapBefore,height:S.height},!0;u+=S.totalHeight}}return!1}}),h}getNumericScrollAnchor(e){if(this.fileDiff==null)return;const{disableFileHeader:t=!1,expandUnchanged:n=!1,collapsed:i=!1,collapsedContextThreshold:r=fe}=this.options;if(i)return;const o=this.getDiffStyle(),s=this.getHunkSeparatorType();this.approximateLayoutCheckpoints();const l=this.getLayoutCheckpointBeforeTop(e);let a=l?.top??De(this.metrics,t),d;return jt({diff:this.fileDiff,diffStyle:o,startingLine:l?.renderedLineIndex??0,expandedHunks:n?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:r,callback:({hunkIndex:c,hunk:u,collapsedBefore:h,collapsedAfter:f,deletionLine:g,additionLine:y})=>{const _=o==="split"?y?.splitLineIndex??g?.splitLineIndex:y?.unifiedLineIndex??g?.unifiedLineIndex;if(_==null)throw new Error("VirtualizedFileDiff.getNumericScrollAnchor: missing line index data");if(h>0){const p=$t({type:s,metrics:this.metrics,hunkIndex:c,hunkSpecs:u?.hunkSpecs});p!=null&&(a+=p.totalHeight)}if(a>=e&&(g!=null?d={lineNumber:g.lineNumber,side:"deletions",top:a}:y!=null&&(d={lineNumber:y.lineNumber,side:"additions",top:a}),d!=null))return!0;const b=this.getLineHeight(_,(y?.noEOFCR??!1)||(g?.noEOFCR??!1));if(a+=b,f>0){const p=Ft({type:s,metrics:this.metrics});p!=null&&(a+=p.totalHeight)}return!1}}),d}getVirtualizedHeight(){return this.height}getAdvancedStickySpecs(e){if(this.top==null||this.fileDiff==null)return;if(this.options.collapsed===!0)return{topOffset:this.top,height:this.height};const t=e!=null?this.computeRenderRangeFromWindow(this.fileDiff,this.top,e):this.renderRange;if(t==null)return;const{bufferBefore:n,bufferAfter:i,totalLines:r}=t;let o=0;if(r===0){const s=e??this.virtualizer.getWindowSpecs();this.top<s.top&&(o=i)}return{topOffset:this.top+n+o,height:this.height-(n+i)}}cleanUp(e=!1){this.fileContainer!=null&&this.isSimpleMode()&&this.getSimpleVirtualizer()?.disconnect(this.fileContainer),e||this.resetLayoutCache({includeEstimatedHeights:!0}),this.isSetup=!1,super.cleanUp(e)}expandHunk=(e,t,n)=>{this.hunksRenderer.expandHunk(e,t,n),this.forceRenderOverride=!0,this.resetLayoutCache({includeEstimatedHeights:!0}),this.isSimpleMode()&&this.computeApproximateSize(),this.virtualizer.instanceChanged(this,!0)};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(){!this.enabled||this.fileDiff==null&&this.additionFile==null&&this.deletionFile==null||(this.forceRenderOverride=!0,this.virtualizer.instanceChanged(this,!1))}computeApproximateSize(e=!1){const t=this.isResizeDebuggingEnabled();if(!e&&!this.layoutDirty&&!t)return;const n=this.height===0;if(this.height=0,this.cache.checkpoints=[],this.cache.totalLines=0,this.fileDiff==null){this.layoutDirty=!1;return}const{disableFileHeader:i=!1,collapsed:r=!1}=this.options,o=De(this.metrics,i);if(this.height+=o,r){this.layoutDirty=!1;return}this.height=this.getActiveEstimatedHeight()+this.cache.measuredHeightDeltaTotal,t&&!n&&this.validateComputedHeight(),this.layoutDirty=!1}getActiveEstimatedHeight(){this.ensureEstimatedDiffHeights();const e=this.getDiffStyle()==="split"?this.cache.estimatedSplitHeight:this.cache.estimatedUnifiedHeight;if(e==null)throw new Error("VirtualizedFileDiff.getActiveEstimatedHeight: missing estimated height");return e}ensureEstimatedDiffHeights(){if(this.fileDiff==null){this.cache.estimatedSplitHeight=void 0,this.cache.estimatedUnifiedHeight=void 0;return}if(this.cache.estimatedSplitHeight!=null&&this.cache.estimatedUnifiedHeight!=null)return;const{disableFileHeader:e=!1,expandUnchanged:t=!1,collapsedContextThreshold:n=fe}=this.options,{splitHeight:i,unifiedHeight:r}=lv({fileDiff:this.fileDiff,metrics:this.metrics,disableFileHeader:e,hunkSeparators:this.getHunkSeparatorType(),expandUnchanged:t,expandedHunks:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:n});this.cache.estimatedSplitHeight=i,this.cache.estimatedUnifiedHeight=r}validateComputedHeight(){if(this.fileContainer==null||this.fileDiff==null)return;const e=this.fileContainer.getBoundingClientRect();e.height!==this.height?console.log("VirtualizedFileDiff.computeApproximateSize: computed height doesnt match",{name:this.fileDiff.name,elementHeight:e.height,computedHeight:this.height}):console.log("VirtualizedFileDiff.computeApproximateSize: computed height IS CORRECT")}render({fileContainer:e,oldFile:t,newFile:n,fileDiff:i,forceRender:r=!1,...o}={}){const{forceRenderOverride:s,isSetup:l}=this;if(this.forceRenderOverride=void 0,this.fileDiff??=i??(t!=null&&n!=null?Kr(t,n,this.options.parseDiffOptions):void 0),e=this.getOrCreateFileContainer(e),this.fileDiff==null)return console.error("VirtualizedFileDiff.render: attempting to virtually render when we dont have the correct data"),!1;if(l)this.top??=this.getVirtualizedTop();else{this.computeApproximateSize();const u=this.getSimpleVirtualizer();if(this.top??=this.getVirtualizedTop(),this.isAdvancedMode())this.isVisible=!0;else{if(u==null)throw new Error("VirtualizedFileDiff.render: simple virtualizer is not available");u.connect(e,this),this.isVisible=u.isInstanceVisible(this.top??0,this.height)}this.isSetup=!0}if(!this.isVisible&&this.isSimpleMode())return this.renderPlaceholder(this.height);const a=this.virtualizer.getWindowSpecs(),d=this.top??0,c=this.computeRenderRangeFromWindow(this.fileDiff,d,a);return super.render({fileDiff:this.fileDiff,fileContainer:e,renderRange:c,oldFile:t,newFile:n,forceRender:s??r,...o})}syncVirtualizedTop(){this.top=this.getVirtualizedTop()}shouldDisableVirtualizationBuffers(){return this.isAdvancedMode()||super.shouldDisableVirtualizationBuffers()}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}isResizeDebuggingEnabled(){return this.getSimpleVirtualizer()?.config.resizeDebugging??!1}getDiffStyle(){return this.options.diffStyle??"split"}getHunkSeparatorType(){return yv(this.options.hunkSeparators)}approximateLayoutCheckpoints(){if(this.cache.checkpoints.length>0||this.fileDiff==null||this.fileDiff.hunks.length===0||this.options.collapsed===!0)return;const{disableFileHeader:e=!1,expandUnchanged:t=!1,collapsedContextThreshold:n=fe}=this.options,i=this.fileDiff.hunks.length-1,r=this.getDiffStyle(),o=this.getHunkSeparatorType(),s=t?!0:this.hunksRenderer.getExpandedHunksMap(),l=fv(this.cache.heightDeltas);let a=De(this.metrics,e),d=0;const c=({rowCount:u,startLineIndex:h,preSeparatorHeight:f=0,postSeparatorHeight:g=0,metadataOffsets:y=[]})=>{if(u<=0)return;const _=d,b=d+u;let p=pv(_);for(;p<b;){const v=p-_,w=a+(v>0?f:0)+v*this.metrics.lineHeight+mv(y,v)*this.metrics.lineHeight+Us(l,h,h+v);this.cache.checkpoints.push({renderedLineIndex:p,lineIndex:h+v,top:w}),p+=Xr}a+=f+u*this.metrics.lineHeight+y.length*this.metrics.lineHeight+Us(l,h,h+u)+g,d=b};for(let u=0;u<this.fileDiff.hunks.length;u++){const h=this.fileDiff.hunks[u];if(h==null)throw new Error("VirtualizedFileDiff.approximateLayoutCheckpoints: invalid hunk index");const f=dn({isPartial:this.fileDiff.isPartial,rangeSize:h.collapsedBefore,expandedHunks:s,hunkIndex:u,collapsedContextThreshold:n}),g=f.collapsedLines>0?$t({type:o,metrics:this.metrics,hunkIndex:u,hunkSpecs:h.hunkSpecs})?.totalHeight??0:0;c({rowCount:f.fromStart,startLineIndex:(r==="split"?h.splitLineStart:h.unifiedLineStart)-f.rangeSize});let y=g;c({rowCount:f.fromEnd,startLineIndex:(r==="split"?h.splitLineStart:h.unifiedLineStart)-f.fromEnd,preSeparatorHeight:y}),f.fromEnd>0&&(y=0);const _=u===i?cn({fileDiff:this.fileDiff,hunkIndex:u,expandedHunks:s,collapsedContextThreshold:n,errorPrefix:"VirtualizedFileDiff"}):void 0,b=_!=null&&_.collapsedLines>0?Ft({type:o,metrics:this.metrics})?.totalHeight??0:0,p=_!=null?_.fromStart+_.fromEnd:0,v=r==="split"?h.splitLineCount:h.unifiedLineCount,w=r==="split"?h.splitLineStart:h.unifiedLineStart;c({rowCount:v,startLineIndex:w,preSeparatorHeight:y,postSeparatorHeight:p===0?b:0,metadataOffsets:gv({diffStyle:r,hunk:h,rowCount:v})}),_!=null&&p>0&&c({rowCount:p,startLineIndex:w+v,postSeparatorHeight:b})}this.cache.totalLines=d}getLayoutCheckpointBeforeLineIndex(e){if(e<=0||this.cache.checkpoints.length===0)return;let t=0,n=this.cache.checkpoints.length-1,i;for(;t<=n;){const r=t+n>>1,o=this.cache.checkpoints[r];if(o==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");o.lineIndex<=e?(i=o,t=r+1):n=r-1}return i}getLayoutCheckpointBeforeTop(e,t){let n=0,i=this.cache.checkpoints.length-1,r=-1;for(;n<=i;){const o=n+i>>1,s=this.cache.checkpoints[o];if(s==null)throw new Error("VirtualizedFileDiff: invalid checkpoint index");s.top<=e?(r=o,n=o+1):i=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 n=0;if(e.isPartial){for(const l of e.hunks)n+=t==="split"?l.splitLineCount:l.unifiedLineCount;return n}const{expandUnchanged:i=!1,collapsedContextThreshold:r=fe}=this.options,o=i?!0:this.hunksRenderer.getExpandedHunksMap();for(const[l,a]of e.hunks.entries()){const d=t==="split"?a.splitLineCount:a.unifiedLineCount;n+=d;const c=Math.max(a.collapsedBefore,0),{fromStart:u,fromEnd:h,renderAll:f}=dn({isPartial:e.isPartial,rangeSize:c,expandedHunks:o,hunkIndex:l,collapsedContextThreshold:r});c>0&&(n+=f?c:u+h)}const s=cn({fileDiff:e,hunkIndex:e.hunks.length-1,expandedHunks:o,collapsedContextThreshold:r,errorPrefix:"VirtualizedFileDiff"});return s!=null&&(n+=s.fromStart+s.fromEnd),n}computeRenderRangeFromWindow(e,t,{top:n,bottom:i}){const{disableFileHeader:r=!1,expandUnchanged:o=!1,collapsedContextThreshold:s=fe}=this.options,{hunkLineCount:l,lineHeight:a}=this.metrics,d=this.getDiffStyle(),c=this.getHunkSeparatorType(),u=this.height;let h=this.cache.totalLines>0?this.cache.totalLines:this.getExpandedLineCount(e,d);const f=De(this.metrics,r),g=e.hunks.length>0?fi(this.metrics):0;if(t<n-u||t>i)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:u-f-g};if(h<=l||e.hunks.length===0)return{startingLine:0,totalLines:l,bufferBefore:0,bufferAfter:0};this.approximateLayoutCheckpoints(),h=this.cache.totalLines>0?this.cache.totalLines:h;const y=Math.ceil(Math.max(i-n,0)/a),_=Math.ceil(y/l)*l+l,b=_/l,p=b,v=[],w=(n+i)/2,S=this.getLayoutCheckpointBeforeTop(Math.max(0,n-t-_*a*2),l);let k=t+(S?.top??f),E=S?.renderedLineIndex??0,C,x,I;if(jt({diff:e,diffStyle:d,startingLine:S?.renderedLineIndex??0,expandedHunks:o?!0:this.hunksRenderer.getExpandedHunksMap(),collapsedContextThreshold:s,callback:({hunkIndex:V,hunk:O,collapsedBefore:G,collapsedAfter:j,deletionLine:W,additionLine:ce})=>{const nt=ce!=null?ce.splitLineIndex:W.splitLineIndex,Ve=ce!=null?ce.unifiedLineIndex:W.unifiedLineIndex,bt=(ce?.noEOFCR??!1)||(W?.noEOFCR??!1),ze=(G>0?$t({type:c,metrics:this.metrics,hunkIndex:V,hunkSpecs:O?.hunkSpecs}):void 0)?.totalHeight??0;k+=ze;const me=E%l===0,F=Math.floor(E/l);if(me&&(v[F]=k-(t+f+ze),I!=null)){if(I<=0)return!0;I--}const q=this.getLineHeight(d==="split"?nt:Ve,bt);return k>n-q&&k<i&&(C??=F),x==null&&k+q>w&&(x=F),I==null&&k>=i&&me&&(I=p),E++,k+=q,j>0&&(k+=Ft({type:c,metrics:this.metrics})?.totalHeight??0),!1}}),C==null)return{startingLine:0,totalLines:0,bufferBefore:0,bufferAfter:u-f-g};x??=C;const P=Math.round(x-b/2),A=Math.max(0,Math.ceil(h/l)-b),L=Math.max(0,Math.min(P,A)),R=L*l,D=P<0?_+P*l:_,H=v[L]??0,M=L+D/l;return{startingLine:R,totalLines:D,bufferBefore:H,bufferAfter:M<v.length?u-f-v[M]-g:u-(k-t)-g}}};function fv(e){const t=Array.from(e).sort((o,s)=>o[0]-s[0]),n=[],i=[0];let r=0;for(const[o,s]of t)n.push(o),r+=s,i.push(r);return{lineIndexes:n,prefixTotals:i}}function Us({lineIndexes:e,prefixTotals:t},n,i){if(n>=i||e.length===0)return 0;const r=Gs(e,n);return(t[Gs(e,i)]??0)-(t[r]??0)}function Gs(e,t){let n=0,i=e.length;for(;n<i;){const r=n+i>>1,o=e[r];if(o==null)throw new Error("VirtualizedFileDiff: invalid prefix index");o<t?n=r+1:i=r}return n}function pv(e){return Math.ceil(e/Xr)*Xr}function mv(e,t){let n=0;for(const i of e)i<t&&n++;return n}function gv({diffStyle:e,hunk:t,rowCount:n}){if(n<=0||!t.noEOFCRAdditions&&!t.noEOFCRDeletions)return[];const i=t.hunkContent.at(-1);if(i==null)return[];if(i.type==="context")return[n-1];const r=Math.max(i.deletions,i.additions),o=i.deletions+i.additions;if(e==="split")return r>0&&(t.noEOFCRAdditions||t.noEOFCRDeletions)?[n-1]:[];const s=[],l=n-o;return i.deletions>0&&t.noEOFCRDeletions&&s.push(l+i.deletions-1),i.additions>0&&t.noEOFCRAdditions&&s.push(n-1),s}function bv(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.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??fe)!==(t.collapsedContextThreshold??fe)||e.unsafeCSS!==t.unsafeCSS}function vv(e,t){return(e.disableFileHeader??!1)!==(t.disableFileHeader??!1)||(e.hunkSeparators??"line-info")!==(t.hunkSeparators??"line-info")||(e.expandUnchanged??!1)!==(t.expandUnchanged??!1)||(e.collapsedContextThreshold??fe)!==(t.collapsedContextThreshold??fe)}function yv(e){return typeof e=="function"?"custom":e??"line-info"}function _v(e,t){const[n,i]=e.split(",").map(Number);return t==="split"?i:n}function wv(e,t){return e==null||t==null?e===t:e.top===t.top&&e.bottom===t.bottom}const zd=1e3,Sv=zd*4,Cv=[0,1e-6,.99999,1],kv={overscrollSize:zd,intersectionObserverMargin:Sv,resizeDebugging:!1};let Mn=0,Ev=-1;var $d=class Ie{static __STOP=!1;static __lastScrollPosition=0;__id=`virtualizer-${++Ev}`;config;type="simple";intersectionObserver;scrollTop=0;height=0;scrollHeight=0;windowSpecs={top:0,bottom:0};root;contentContainer;resizeObserver;observers=new Map;visibleInstances=new Map;visibleInstancesDirty=!1;instancesChanged=new Set;scrollDirty=!0;heightDirty=!0;scrollHeightDirty=!0;renderedObservers=0;connectQueue=new Map;constructor(t){this.config={...kv,...t}}setup(t,n){if(this.root==null){this.root=t,this.resizeObserver=new ResizeObserver(this.handleContainerResize),this.intersectionObserver=new IntersectionObserver(this.handleIntersectionChange,{root:this.root,threshold:Cv,rootMargin:`${this.config.intersectionObserverMargin}px 0px ${this.config.intersectionObserverMargin}px 0px`}),t instanceof Document?this.setupWindow():this.setupElement(n),window.__INSTANCE=this,window.__TOGGLE=()=>{Ie.__STOP?(Ie.__STOP=!1,(this.getScrollContainerElement()??window).scrollTo({top:Ie.__lastScrollPosition}),Ce(this.computeRenderRangeAndEmit)):(Ie.__lastScrollPosition=this.getScrollTop(),Ie.__STOP=!0)};for(const[i,r]of this.connectQueue.entries())this.connect(i,r);this.connectQueue.clear(),this.markDOMDirty(),Ce(this.computeRenderRangeAndEmit)}}instanceChanged(t,n){this.instancesChanged.add(t),n&&this.markDOMDirty(),Ce(this.computeRenderRangeAndEmit)}getWindowSpecs(){return this.windowSpecs.top===0&&this.windowSpecs.bottom===0&&(this.windowSpecs=Ro({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize})),this.windowSpecs}isInstanceVisible(t,n){const i=this.getScrollTop(),r=this.getHeight(),o=this.config.intersectionObserverMargin,s=i-o,l=i+r+o;return!(t<s-n||t>l)}handleContainerResize=t=>{if(this.root==null)return;let n=!1;for(const i of t){const r=i.borderBoxSize[0].blockSize;this.root instanceof Document?r!==this.scrollHeight&&(this.scrollHeightDirty=!0,n=!0,this.config.resizeDebugging&&(console.log("Virtualizer: content size change",this.__id,{sizeChange:r-Mn,newSize:r}),Mn=r)):i.target===this.root?r!==this.height&&(this.heightDirty=!0,n=!0):i.target===this.contentContainer&&(this.scrollHeightDirty=!0,n=!0,this.config.resizeDebugging&&(console.log("Virtualizer: scroller size change",this.__id,{sizeChange:r-Mn,newSize:r}),Mn=r))}n&&Ce(this.computeRenderRangeAndEmit)};setupWindow(){if(this.root==null||!(this.root instanceof Document))throw new Error("Virtualizer.setupWindow: Invalid setup method");window.addEventListener("scroll",this.handleWindowScroll,{passive:!0}),window.addEventListener("resize",this.handleWindowResize,{passive:!0}),this.resizeObserver?.observe(this.root.documentElement)}setupElement(t){if(this.root==null||this.root instanceof Document)throw new Error("Virtualizer.setupElement: Invalid setup method");this.root.addEventListener("scroll",this.handleElementScroll,{passive:!0}),this.resizeObserver?.observe(this.root),t??=this.root.firstElementChild??void 0,t instanceof HTMLElement&&(this.contentContainer=t,this.resizeObserver?.observe(t))}cleanUp(){this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.intersectionObserver?.disconnect(),this.intersectionObserver=void 0,this.root?.removeEventListener("scroll",this.handleElementScroll),window.removeEventListener("scroll",this.handleWindowScroll),window.removeEventListener("resize",this.handleWindowResize),this.root=void 0,this.contentContainer=void 0,this.observers.clear(),this.visibleInstances.clear(),this.instancesChanged.clear(),this.connectQueue.clear(),this.visibleInstancesDirty=!1,this.windowSpecs={top:0,bottom:0},this.scrollTop=0,this.height=0,this.scrollHeight=0}getOffsetInScrollContainer(t){return this.getScrollTop()+Nt(t,this.getScrollContainerElement())}connect(t,n){if(this.observers.has(t))throw new Error("Virtualizer.connect: instance is already connected...");return this.intersectionObserver==null?this.connectQueue.set(t,n):(this.intersectionObserver.observe(t),this.observers.set(t,n),this.instancesChanged.add(n),this.markDOMDirty(),Ce(this.computeRenderRangeAndEmit)),()=>this.disconnect(t)}disconnect(t){const n=this.observers.get(t);this.connectQueue.delete(t),n!=null&&(this.intersectionObserver?.unobserve(t),this.observers.delete(t),this.visibleInstances.delete(t)&&(this.visibleInstancesDirty=!0),this.markDOMDirty(),Ce(this.computeRenderRangeAndEmit))}handleWindowResize=()=>{Ie.__STOP||window.innerHeight===this.height||(this.heightDirty=!0,Ce(this.computeRenderRangeAndEmit))};handleWindowScroll=()=>{Ie.__STOP||this.root==null||!(this.root instanceof Document)||(this.scrollDirty=!0,Ce(this.computeRenderRangeAndEmit))};handleElementScroll=()=>{Ie.__STOP||this.root==null||this.root instanceof Document||(this.scrollDirty=!0,Ce(this.computeRenderRangeAndEmit))};computeRenderRangeAndEmit=()=>{if(Ie.__STOP)return;const t=this.heightDirty||this.scrollHeightDirty;if(!this.scrollDirty&&!this.scrollHeightDirty&&!this.heightDirty&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&this.instancesChanged.size===0)return;let n=this.instancesChanged.size>0;if(this.instancesChanged.size===0){const o=Ro({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize});if(!t&&wv(this.windowSpecs,o)&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty)return;this.windowSpecs=o}this.visibleInstancesDirty=!1,this.renderedObservers=this.observers.size;const i=this.getScrollAnchor(this.height),r=new Set;for(const o of t?this.observers.values():this.visibleInstances.values())o.onRender(t)&&r.add(o);for(const o of this.instancesChanged)r.has(o)||o.onRender(t)&&r.add(o);this.scrollFix(i);for(const o of r)o.reconcileHeights();n||=this.instancesChanged.size>0,n&&this.markDOMDirty(),(n||t)&&Ce(this.computeRenderRangeAndEmit),r.clear(),this.instancesChanged.clear()};scrollFix(t){if(t==null)return;const n=this.getScrollContainerElement(),{lineIndex:i,lineOffset:r,fileElement:o,fileOffset:s,fileTypeOffset:l}=t;if(i!=null&&r!=null){const d=o.shadowRoot?.querySelector(`[data-line][data-line-index="${i}"]`);if(d instanceof HTMLElement){const c=Nt(d,n);if(c!==r){const u=c-r;this.applyScrollFix(u)}return}}const a=Nt(o,n);if(l==="top")a!==s&&this.applyScrollFix(a-s);else{const d=a+o.getBoundingClientRect().height;d!==s&&this.applyScrollFix(d-s)}}applyScrollFix(t){this.root==null||this.root instanceof Document?window.scrollTo({top:window.scrollY+t,behavior:"instant"}):this.root.scrollTo({top:this.root.scrollTop+t,behavior:"instant"}),this.markDOMDirty()}getScrollAnchor(t){const n=this.getScrollContainerElement();let i;for(const[r]of this.visibleInstances.entries()){const o=Nt(r,n),s=o+r.offsetHeight;let l,a;s<=0?(l=s,a="bottom"):(l=o,a="top");let d,c;if(s>0&&o<t)for(const h of r.shadowRoot?.querySelectorAll("[data-line][data-line-index]")??[]){if(!(h instanceof HTMLElement))continue;const f=h.dataset.lineIndex;if(f==null)continue;const g=Nt(h,n);if(!(g<0)){d=f,c=g;break}}if(i?.lineOffset!=null&&c==null)continue;let u=!1;(i==null||c!=null&&(i.lineOffset==null||c<i.lineOffset)||c==null&&i.lineOffset==null&&(l>=0&&(i.fileOffset<0||l<i.fileOffset)||l<0&&i.fileOffset<0&&l>i.fileOffset))&&(u=!0),u&&(i={fileElement:r,fileTypeOffset:a,fileOffset:l,lineIndex:d,lineOffset:c})}return i}handleIntersectionChange=t=>{this.scrollDirty=!0;for(const{target:n,isIntersecting:i}of t){if(!(n instanceof HTMLElement))throw new Error("Virtualizer.handleIntersectionChange: target not an HTMLElement");const r=this.observers.get(n);r!=null&&(i&&!this.visibleInstances.has(n)?(r.setVisibility(!0),this.visibleInstances.set(n,r),this.visibleInstancesDirty=!0):!i&&this.visibleInstances.has(n)&&(r.setVisibility(!1),this.visibleInstances.delete(n),this.visibleInstancesDirty=!0))}this.visibleInstancesDirty&&Ce(this.computeRenderRangeAndEmit)};getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let t=this.root==null?0:this.root instanceof Document?window.scrollY:this.root.scrollTop;return t=Math.max(0,Math.min(t,this.getScrollHeight()-this.getHeight())),this.scrollTop=t,t}getScrollHeight(){return this.scrollHeightDirty?(this.scrollHeightDirty=!1,this.scrollHeight=this.root==null?0:this.root instanceof Document?this.root.documentElement.scrollHeight:this.root.scrollHeight,this.scrollHeight):this.scrollHeight}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root==null?0:this.root instanceof Document?globalThis.innerHeight:this.root.getBoundingClientRect().height,this.height):this.height}markDOMDirty(){this.scrollDirty=!0,this.scrollHeightDirty=!0,this.heightDirty=!0}getScrollContainerElement(){return this.root==null||this.root instanceof Document?void 0:this.root}};function Nt(e,t){const n=e.getBoundingClientRect(),i=t?.getBoundingClientRect().top??0;return n.top-i}function Ws(e){const t=[];for(const n of e){const i=ht.get(n);if(i==null)throw new Error(`getResolvedLanguages: ${n} is not resolved. Please resolve languages before calling getResolvedLanguages`);t.push(i)}return t}function qs(e){for(const t of Array.isArray(e)?e:[e])if(!ht.has(t))return!1;return!0}async function js(e){const t=[],n=[];for(const i of e){if(i==="text"||i==="ansi")continue;const r=Yl(i)??Ql(i);"then"in r?n.push(r):t.push(r)}return n.length>0&&await Promise.all(n).then(i=>{for(const r of i){if(r==null)throw new Error("resolvedLanguages: unable to resolve language");t.push(r)}}),t}function Ks(e){return Se.getResolvedThemes(e)}function cr(e,t){try{const n=So({name:e,load:t});Se.registerTheme(n.name,n.load)}catch(n){if(n instanceof ed){console.error("SharedHighlight.registerCustomTheme: theme name already registered",e);return}throw n}}async function Xs(e){for(const n of e)od(n);const t=await Se.resolveThemes(e);for(let n=0;n<e.length;n++)sd(e[n],t[n]);return t}function Qs(e){if(!e)return;let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function Ys(e,t=5e5){if(!e)return;if(e.length<=t)return Qs(e);const n=4096,r=[0,Math.floor(e.length*.25),Math.floor(e.length*.5),Math.floor(e.length*.75),e.length-n].map(o=>{const s=Math.max(0,Math.min(e.length-n,o-Math.floor(n/2)));return Qs(e.slice(s,s+n))??""}).join(":");return`${e.length}:${r}`}const xv=`
241
+ [data-annotation-slot] {
242
+ padding: 12px;
243
+ box-sizing: border-box;
244
+ }
245
+
246
+ [data-component="line-comment"] {
247
+ position: absolute;
248
+ right: 24px;
249
+ z-index: var(--line-comment-z, 30);
250
+ }
251
+
252
+ [data-component="line-comment"][data-inline] {
253
+ position: relative;
254
+ right: auto;
255
+ display: flex;
256
+ width: 100%;
257
+ min-width: 0;
258
+ align-items: flex-start;
259
+ }
260
+
261
+ [data-component="line-comment"][data-open] {
262
+ z-index: var(--line-comment-open-z, 100);
263
+ }
264
+
265
+ [data-component="line-comment"] [data-slot="line-comment-button"] {
266
+ width: 20px;
267
+ height: 20px;
268
+ border-radius: var(--radius-md);
269
+ display: flex;
270
+ align-items: center;
271
+ justify-content: center;
272
+ background: var(--icon-interactive-base);
273
+ box-shadow: var(--shadow-xs);
274
+ cursor: default;
275
+ border: none;
276
+ }
277
+
278
+ [data-component="line-comment"][data-variant="add"] [data-slot="line-comment-button"] {
279
+ background: var(--syntax-diff-add);
280
+ }
281
+
282
+ [data-component="line-comment"] [data-component="icon"] {
283
+ color: var(--white);
284
+ }
285
+
286
+ [data-component="line-comment"] [data-slot="line-comment-icon"] {
287
+ width: 12px;
288
+ height: 12px;
289
+ color: var(--white);
290
+ }
291
+
292
+ [data-component="line-comment"] [data-slot="line-comment-button"]:focus {
293
+ outline: none;
294
+ }
295
+
296
+ [data-component="line-comment"] [data-slot="line-comment-button"]:focus-visible {
297
+ box-shadow: var(--shadow-xs-border-focus);
298
+ }
299
+
300
+ [data-component="line-comment"] [data-slot="line-comment-popover"] {
301
+ position: absolute;
302
+ top: calc(100% + 4px);
303
+ right: -8px;
304
+ z-index: var(--line-comment-popover-z, 40);
305
+ min-width: 200px;
306
+ max-width: none;
307
+ box-sizing: border-box;
308
+ border-radius: 8px;
309
+ background: var(--surface-raised-stronger-non-alpha);
310
+ box-shadow: var(--shadow-xxs-border);
311
+ padding: 12px;
312
+ }
313
+
314
+ [data-component="line-comment"][data-inline] [data-slot="line-comment-popover"] {
315
+ position: relative;
316
+ top: auto;
317
+ right: auto;
318
+ margin-left: 8px;
319
+ flex: 1 1 0%;
320
+ width: auto;
321
+ max-width: 100%;
322
+ min-width: 0;
323
+ }
324
+
325
+ [data-component="line-comment"][data-inline] [data-slot="line-comment-popover"][data-inline-body] {
326
+ margin-left: 0;
327
+ }
328
+
329
+ [data-component="line-comment"][data-inline][data-variant="default"] [data-slot="line-comment-popover"][data-inline-body] {
330
+ cursor: pointer;
331
+ }
332
+
333
+ [data-component="line-comment"][data-variant="editor"] [data-slot="line-comment-popover"] {
334
+ width: 380px;
335
+ max-width: none;
336
+ padding: 8px;
337
+ border-radius: 14px;
338
+ }
339
+
340
+ [data-component="line-comment"][data-inline][data-variant="editor"] [data-slot="line-comment-popover"] {
341
+ width: 100%;
342
+ }
343
+
344
+ [data-component="line-comment"] [data-slot="line-comment-content"] {
345
+ display: flex;
346
+ flex-direction: column;
347
+ gap: 6px;
348
+ width: 100%;
349
+ min-width: 0;
350
+ }
351
+
352
+ [data-component="line-comment"] [data-slot="line-comment-head"] {
353
+ display: flex;
354
+ align-items: flex-start;
355
+ gap: 8px;
356
+ min-width: 0;
357
+ }
358
+
359
+ [data-component="line-comment"] [data-slot="line-comment-text"] {
360
+ flex: 1;
361
+ min-width: 0;
362
+ font-family: var(--font-family-sans);
363
+ font-size: var(--font-size-base);
364
+ font-weight: var(--font-weight-regular);
365
+ line-height: var(--line-height-x-large);
366
+ letter-spacing: var(--letter-spacing-normal);
367
+ color: var(--text-strong);
368
+ white-space: pre-wrap;
369
+ overflow-wrap: anywhere;
370
+ }
371
+
372
+ [data-component="line-comment"] [data-slot="line-comment-tools"] {
373
+ flex: 0 0 auto;
374
+ display: flex;
375
+ align-items: center;
376
+ justify-content: flex-end;
377
+ min-width: 0;
378
+ }
379
+
380
+ [data-component="line-comment"] [data-slot="line-comment-label"],
381
+ [data-component="line-comment"] [data-slot="line-comment-editor-label"] {
382
+ font-family: var(--font-family-sans);
383
+ font-size: var(--font-size-small);
384
+ font-weight: var(--font-weight-medium);
385
+ line-height: var(--line-height-large);
386
+ letter-spacing: var(--letter-spacing-normal);
387
+ color: var(--text-weak);
388
+ min-width: 0;
389
+ white-space: normal;
390
+ overflow-wrap: anywhere;
391
+ }
392
+
393
+ [data-component="line-comment"] [data-slot="line-comment-editor"] {
394
+ display: flex;
395
+ flex-direction: column;
396
+ gap: 8px;
397
+ width: 100%;
398
+ min-width: 0;
399
+ }
400
+
401
+ [data-component="line-comment"] [data-slot="line-comment-textarea"] {
402
+ width: 100%;
403
+ box-sizing: border-box;
404
+ resize: vertical;
405
+ padding: 8px;
406
+ border-radius: var(--radius-md);
407
+ background: var(--surface-base);
408
+ border: 1px solid var(--border-base);
409
+ color: var(--text-strong);
410
+ font-family: var(--font-family-sans);
411
+ font-size: var(--font-size-small);
412
+ line-height: var(--line-height-large);
413
+ }
414
+
415
+ [data-component="line-comment"] [data-slot="line-comment-textarea"]:focus {
416
+ outline: none;
417
+ box-shadow: var(--shadow-xs-border-select);
418
+ }
419
+
420
+ [data-component="line-comment"] [data-slot="line-comment-mention-list"] {
421
+ display: flex;
422
+ flex-direction: column;
423
+ gap: 4px;
424
+ max-height: 180px;
425
+ overflow: auto;
426
+ padding: 4px;
427
+ border: 1px solid var(--border-base);
428
+ border-radius: var(--radius-md);
429
+ background: var(--surface-base);
430
+ }
431
+
432
+ [data-component="line-comment"] [data-slot="line-comment-mention-item"] {
433
+ display: flex;
434
+ align-items: center;
435
+ gap: 8px;
436
+ width: 100%;
437
+ min-width: 0;
438
+ padding: 6px 8px;
439
+ border: 0;
440
+ border-radius: var(--radius-sm);
441
+ background: transparent;
442
+ color: var(--text-strong);
443
+ text-align: left;
444
+ }
445
+
446
+ [data-component="line-comment"] [data-slot="line-comment-mention-item"][data-active] {
447
+ background: var(--surface-raised-base-hover);
448
+ }
449
+
450
+ [data-component="line-comment"] [data-slot="line-comment-mention-path"] {
451
+ display: flex;
452
+ align-items: center;
453
+ min-width: 0;
454
+ font-family: var(--font-family-sans);
455
+ font-size: var(--font-size-small);
456
+ line-height: var(--line-height-large);
457
+ }
458
+
459
+ [data-component="line-comment"] [data-slot="line-comment-mention-dir"] {
460
+ min-width: 0;
461
+ color: var(--text-weak);
462
+ white-space: nowrap;
463
+ overflow: hidden;
464
+ text-overflow: ellipsis;
465
+ }
466
+
467
+ [data-component="line-comment"] [data-slot="line-comment-mention-file"] {
468
+ color: var(--text-strong);
469
+ white-space: nowrap;
470
+ }
471
+
472
+ [data-component="line-comment"] [data-slot="line-comment-actions"] {
473
+ display: flex;
474
+ align-items: center;
475
+ flex-wrap: wrap;
476
+ gap: 8px;
477
+ padding-left: 8px;
478
+ min-width: 0;
479
+ }
480
+
481
+ [data-component="line-comment"] [data-slot="line-comment-editor-label"] {
482
+ flex: 1 1 220px;
483
+ margin-right: auto;
484
+ }
485
+
486
+ [data-component="line-comment"] [data-slot="line-comment-action"] {
487
+ border: 1px solid var(--border-base);
488
+ background: var(--surface-base);
489
+ color: var(--text-strong);
490
+ border-radius: var(--radius-md);
491
+ height: 28px;
492
+ padding: 0 10px;
493
+ font-family: var(--font-family-sans);
494
+ font-size: var(--font-size-small);
495
+ font-weight: var(--font-weight-medium);
496
+ }
497
+
498
+ [data-component="line-comment"] [data-slot="line-comment-action"][data-variant="ghost"] {
499
+ background: transparent;
500
+ }
501
+
502
+ [data-component="line-comment"] [data-slot="line-comment-action"][data-variant="primary"] {
503
+ background: var(--text-strong);
504
+ border-color: var(--text-strong);
505
+ color: var(--background-base);
506
+ }
507
+
508
+ [data-component="line-comment"] [data-slot="line-comment-action"]:disabled {
509
+ opacity: 0.5;
510
+ pointer-events: none;
511
+ }
512
+ `,pi="Kilo",Js=(()=>{const e=Symbol.for("kilocode.ui.pierre.kilo-diff-theme"),t=Reflect.get(globalThis,e);if(t instanceof WeakSet)return t;const n=new WeakSet;return Reflect.set(globalThis,e,n),n})();function Lv(){Js.has(cr)||(cr(pi,()=>Promise.resolve({name:pi,colors:{"editor.background":"var(--color-background-stronger)","editor.foreground":"var(--text-base)","gitDecoration.addedResourceForeground":"var(--syntax-diff-add)","gitDecoration.deletedResourceForeground":"var(--syntax-diff-delete)","gitDecoration.modifiedResourceForeground":"var(--syntax-diff-unknown)"},tokenColors:[{scope:["comment","punctuation.definition.comment","string.comment"],settings:{foreground:"var(--syntax-comment)"}},{scope:["entity.other.attribute-name"],settings:{foreground:"var(--syntax-property)"}},{scope:["constant","entity.name.constant","variable.other.constant","variable.language","entity"],settings:{foreground:"var(--syntax-constant)"}},{scope:["entity.name","meta.export.default","meta.definition.variable"],settings:{foreground:"var(--syntax-type)"}},{scope:["meta.object.member"],settings:{foreground:"var(--syntax-primitive)"}},{scope:["variable.parameter.function","meta.jsx.children","meta.block","meta.tag.attributes","entity.name.constant","meta.embedded.expression","meta.template.expression","string.other.begin.yaml","string.other.end.yaml"],settings:{foreground:"var(--syntax-punctuation)"}},{scope:["entity.name.function","support.type.primitive"],settings:{foreground:"var(--syntax-primitive)"}},{scope:["support.class.component"],settings:{foreground:"var(--syntax-type)"}},{scope:"keyword",settings:{foreground:"var(--syntax-keyword)"}},{scope:["keyword.operator","storage.type.function.arrow","punctuation.separator.key-value.css","entity.name.tag.yaml","punctuation.separator.key-value.mapping.yaml"],settings:{foreground:"var(--syntax-operator)"}},{scope:["storage","storage.type"],settings:{foreground:"var(--syntax-keyword)"}},{scope:["storage.modifier.package","storage.modifier.import","storage.type.java"],settings:{foreground:"var(--syntax-primitive)"}},{scope:["string","punctuation.definition.string","string punctuation.section.embedded source","entity.name.tag"],settings:{foreground:"var(--syntax-string)"}},{scope:"support",settings:{foreground:"var(--syntax-primitive)"}},{scope:["support.type.object.module","variable.other.object","support.type.property-name.css"],settings:{foreground:"var(--syntax-object)"}},{scope:"meta.property-name",settings:{foreground:"var(--syntax-property)"}},{scope:"variable",settings:{foreground:"var(--syntax-variable)"}},{scope:"variable.other",settings:{foreground:"var(--syntax-variable)"}},{scope:["invalid.broken","invalid.illegal","invalid.unimplemented","invalid.deprecated","message.error","markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted","brackethighlighter.unmatched","token.error-token"],settings:{foreground:"var(--syntax-critical)"}},{scope:"carriage-return",settings:{foreground:"var(--syntax-keyword)"}},{scope:"string source",settings:{foreground:"var(--syntax-variable)"}},{scope:"string variable",settings:{foreground:"var(--syntax-constant)"}},{scope:["source.regexp","string.regexp","string.regexp.character-class","string.regexp constant.character.escape","string.regexp source.ruby.embedded","string.regexp string.regexp.arbitrary-repitition","string.regexp constant.character.escape"],settings:{foreground:"var(--syntax-regexp)"}},{scope:"support.constant",settings:{foreground:"var(--syntax-primitive)"}},{scope:"support.variable",settings:{foreground:"var(--syntax-variable)"}},{scope:"meta.module-reference",settings:{foreground:"var(--syntax-info)"}},{scope:"punctuation.definition.list.begin.markdown",settings:{foreground:"var(--syntax-punctuation)"}},{scope:["markup.heading","markup.heading entity.name"],settings:{fontStyle:"bold",foreground:"var(--syntax-info)"}},{scope:"markup.quote",settings:{foreground:"var(--syntax-info)"}},{scope:"markup.italic",settings:{fontStyle:"italic"}},{scope:"markup.bold",settings:{fontStyle:"bold",foreground:"var(--text-strong)"}},{scope:["markup.raw","markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted","markup.changed","punctuation.definition.changed","markup.ignored","markup.untracked"],settings:{foreground:"var(--text-base)"}},{scope:"meta.diff.range",settings:{fontStyle:"bold",foreground:"var(--syntax-unknown)"}},{scope:"meta.diff.header",settings:{foreground:"var(--syntax-unknown)"}},{scope:"meta.separator",settings:{fontStyle:"bold",foreground:"var(--syntax-unknown)"}},{scope:"meta.output",settings:{foreground:"var(--syntax-unknown)"}},{scope:"meta.export.default",settings:{foreground:"var(--syntax-unknown)"}},{scope:["brackethighlighter.tag","brackethighlighter.curly","brackethighlighter.round","brackethighlighter.square","brackethighlighter.angle","brackethighlighter.quote"],settings:{foreground:"var(--syntax-unknown)"}},{scope:["constant.other.reference.link","string.other.link"],settings:{fontStyle:"underline",foreground:"var(--syntax-unknown)"}},{scope:"token.info-token",settings:{foreground:"var(--syntax-info)"}},{scope:"token.warn-token",settings:{foreground:"var(--syntax-warning)"}},{scope:"token.debug-token",settings:{foreground:"var(--syntax-info)"}}],semanticTokenColors:{comment:"var(--syntax-comment)",string:"var(--syntax-string)",number:"var(--syntax-constant)",regexp:"var(--syntax-regexp)",keyword:"var(--syntax-keyword)",variable:"var(--syntax-variable)",parameter:"var(--syntax-variable)",property:"var(--syntax-property)",function:"var(--syntax-primitive)",method:"var(--syntax-primitive)",type:"var(--syntax-type)",class:"var(--syntax-type)",namespace:"var(--syntax-type)",enumMember:"var(--syntax-primitive)","variable.constant":"var(--syntax-constant)","variable.defaultLibrary":"var(--syntax-unknown)"}})),Js.add(cr))}const Tv=`
513
+ [data-diff],
514
+ [data-file] {
515
+ /* Pierre 1.2 mixes these override targets at 12% in light mode and 20% in dark mode. */
516
+ --diffs-bg-deletion-override: light-dark(
517
+ color-mix(in lab, var(--diffs-bg) 33.333%, var(--diffs-deletion-base)),
518
+ color-mix(in lab, var(--diffs-bg) 60%, var(--diffs-deletion-base))
519
+ );
520
+ --diffs-bg-addition-override: light-dark(
521
+ color-mix(in lab, var(--diffs-bg) 33.333%, var(--diffs-addition-base)),
522
+ color-mix(in lab, var(--diffs-bg) 60%, var(--diffs-addition-base))
523
+ );
524
+ --diffs-selection-base: var(--surface-warning-strong);
525
+ --diffs-selection-border: var(--border-warning-base);
526
+ --diffs-selection-number-fg: #1c1917;
527
+ /* Use explicit alpha instead of color-mix(..., transparent) to avoid Safari's non-premultiplied interpolation bugs. */
528
+ --diffs-bg-selection: var(--diffs-bg-selection-override, rgb(from var(--surface-warning-base) r g b / 0.65));
529
+ --diffs-bg-selection-number: var(
530
+ --diffs-bg-selection-number-override,
531
+ rgb(from var(--surface-warning-base) r g b / 0.85)
532
+ );
533
+ --diffs-bg-selection-text: rgb(from var(--surface-warning-strong) r g b / 0.2);
534
+ }
535
+
536
+ :host([data-color-scheme='dark']) [data-diff],
537
+ :host([data-color-scheme='dark']) [data-file] {
538
+ --diffs-selection-number-fg: #fdfbfb;
539
+ --diffs-bg-selection: var(--diffs-bg-selection-override, rgb(from var(--solaris-dark-6) r g b / 0.65));
540
+ --diffs-bg-selection-number: var(
541
+ --diffs-bg-selection-number-override,
542
+ rgb(from var(--solaris-dark-6) r g b / 0.85)
543
+ );
544
+ }
545
+
546
+ [data-diff] ::selection,
547
+ [data-file] ::selection {
548
+ background-color: var(--diffs-bg-selection-text);
549
+ }
550
+
551
+ ::highlight(opencode-find) {
552
+ background-color: rgb(from var(--surface-warning-base) r g b / 0.35);
553
+ }
554
+
555
+ ::highlight(opencode-find-current) {
556
+ background-color: rgb(from var(--surface-warning-strong) r g b / 0.55);
557
+ }
558
+
559
+ [data-diff] [data-line][data-comment-selected]:not([data-selected-line]) {
560
+ box-shadow: inset 0 0 0 9999px var(--diffs-bg-selection);
561
+ }
562
+
563
+ [data-file] [data-line][data-comment-selected]:not([data-selected-line]) {
564
+ box-shadow: inset 0 0 0 9999px var(--diffs-bg-selection);
565
+ }
566
+
567
+ [data-diff] [data-column-number][data-comment-selected]:not([data-selected-line]) {
568
+ box-shadow: inset 0 0 0 9999px var(--diffs-bg-selection-number);
569
+ color: var(--diffs-selection-number-fg);
570
+ }
571
+
572
+ [data-file] [data-column-number][data-comment-selected]:not([data-selected-line]) {
573
+ box-shadow: inset 0 0 0 9999px var(--diffs-bg-selection-number);
574
+ color: var(--diffs-selection-number-fg);
575
+ }
576
+
577
+ [data-diff] [data-line-annotation][data-comment-selected]:not([data-selected-line]) [data-annotation-content] {
578
+ box-shadow: inset 0 0 0 9999px var(--diffs-bg-selection);
579
+ }
580
+
581
+ [data-file] [data-line-annotation][data-comment-selected]:not([data-selected-line]) [data-annotation-content] {
582
+ box-shadow: inset 0 0 0 9999px var(--diffs-bg-selection);
583
+ }
584
+
585
+ [data-diff] [data-line][data-selected-line] {
586
+ background-color: var(--diffs-bg-selection);
587
+ box-shadow: inset 2px 0 0 var(--diffs-selection-border);
588
+ }
589
+
590
+ [data-file] [data-line][data-selected-line] {
591
+ background-color: var(--diffs-bg-selection);
592
+ box-shadow: inset 2px 0 0 var(--diffs-selection-border);
593
+ }
594
+
595
+ [data-diff] [data-column-number][data-selected-line] {
596
+ background-color: var(--diffs-bg-selection-number);
597
+ color: var(--diffs-selection-number-fg);
598
+ }
599
+
600
+ [data-file] [data-column-number][data-selected-line] {
601
+ background-color: var(--diffs-bg-selection-number);
602
+ color: var(--diffs-selection-number-fg);
603
+ }
604
+
605
+ [data-diff] [data-column-number][data-line-type='context'][data-selected-line],
606
+ [data-diff] [data-column-number][data-line-type='context-expanded'][data-selected-line],
607
+ [data-diff] [data-column-number][data-line-type='change-addition'][data-selected-line],
608
+ [data-diff] [data-column-number][data-line-type='change-deletion'][data-selected-line] {
609
+ color: var(--diffs-selection-number-fg);
610
+ }
611
+
612
+ /* The deletion word-diff emphasis is stronger than additions; soften it while selected so the selection highlight reads consistently. */
613
+ [data-diff] [data-line][data-line-type='change-deletion'][data-selected-line] {
614
+ --diffs-bg-deletion-emphasis: light-dark(
615
+ rgb(from var(--diffs-deletion-base) r g b / 0.07),
616
+ rgb(from var(--diffs-deletion-base) r g b / 0.1)
617
+ );
618
+ }
619
+
620
+ [data-diff-header],
621
+ [data-diff],
622
+ [data-file] {
623
+ [data-separator] {
624
+ height: 24px;
625
+ }
626
+ [data-column-number] {
627
+ background-color: var(--background-stronger);
628
+ cursor: default !important;
629
+ }
630
+
631
+ &[data-interactive-line-numbers] [data-column-number] {
632
+ cursor: default !important;
633
+ }
634
+
635
+ &[data-interactive-lines] [data-line] {
636
+ cursor: auto !important;
637
+ }
638
+ [data-code] {
639
+ overflow-x: auto !important;
640
+ overflow-y: clip !important;
641
+ }
642
+ }
643
+
644
+ ${xv}
645
+
646
+ `;function Fd(e){return{theme:pi,themeType:"system",disableLineNumbers:!1,overflow:"wrap",diffStyle:e??"unified",diffIndicators:"bars",lineHoverHighlight:"both",disableBackground:!1,expansionLineCount:20,hunkSeparators:"line-info-basic",lineDiffType:e==="split"?"word-alt":"none",maxLineDiffLength:1e3,maxLineLengthForHighlighting:1e3,disableFileHeader:!0,unsafeCSS:Tv}}const Rv={"--diffs-font-family":"var(--font-family-mono)","--diffs-font-size":"var(--font-size-small)","--diffs-line-height":"24px","--diffs-tab-size":2,"--diffs-font-features":"var(--font-family-mono--font-feature-settings)","--diffs-header-font-family":"var(--font-family-sans)","--diffs-gap-block":0,"--diffs-min-number-column-width":"4ch"};function Bd(e){const t=e.closest("[data-line], [data-alt-line]");if(t instanceof HTMLElement){const i=t.dataset.lineType;if(i==="change-deletion")return"deletions";if(i==="change-addition"||i==="change-additions")return"additions"}const n=e.closest("[data-code]");return n instanceof HTMLElement&&n.hasAttribute("data-deletions")?"deletions":"additions"}function Qr(e,t){const n=t.dataset.lineIndex;if(!n)return;const i=n.split(",").map(r=>parseInt(r,10)).filter(r=>!Number.isNaN(r));if(i.length!==0)return e&&i.length===2?i[1]:i[0]}function mi(e,t,n,i){const r=Array.from(e.querySelectorAll(`[data-line="${n}"], [data-alt-line="${n}"]`)).filter(s=>s instanceof HTMLElement);if(r.length===0)return;const o=i??"additions";for(const s of r)if(Bd(s)===o||parseInt(s.dataset.altLine??"",10)===n)return Qr(t,s)}function Zs(e,t){if(!t)return t;if(!e)return;const n=e.querySelector("[data-diff]");if(!(n instanceof HTMLElement))return;const i=n.dataset.diffType==="split",r=mi(e,i,t.start,t.side),o=mi(e,i,t.end,t.endSide??t.side);if(r===void 0||o===void 0)return e.querySelector("[data-line], [data-alt-line]")==null?void 0:null;if(r<=o)return t;const s=t.endSide??t.side,l={start:t.end,end:t.start};return s&&(l.side=s),t.endSide&&t.side&&(l.endSide=t.side),l}function Ud(e){const t=e.dataset.lineAnnotation?.split(",")[1];if(!t)return;const n=parseInt(t,10);if(!Number.isNaN(n))return n}function Gd(e){const t=Array.from(e.querySelectorAll("[data-comment-selected]"));for(const n of t)n instanceof HTMLElement&&n.removeAttribute("data-comment-selected")}function Av(e,t){Gd(e);const n=e.querySelector("[data-diff]");if(!(n instanceof HTMLElement))return;const i=n.dataset.diffType==="split",r=Array.from(n.querySelectorAll("[data-line-index]")).filter(s=>s instanceof HTMLElement);if(r.length===0)return;const o=Array.from(n.querySelectorAll("[data-line-annotation]")).filter(s=>s instanceof HTMLElement);for(const s of t){const l=mi(e,i,s.start,s.side);if(l===void 0)continue;const a=s.end===s.start&&(s.endSide==null||s.endSide===s.side)?l:mi(e,i,s.end,s.endSide??s.side);if(a===void 0)continue;const d=Math.min(l,a),c=Math.max(l,a);for(const u of r){const h=Qr(i,u);h===void 0||h<d||h>c||u.setAttribute("data-comment-selected","")}for(const u of o){const h=Ud(u);h===void 0||h<d||h>c||u.setAttribute("data-comment-selected","")}}}function Iv(e,t){Gd(e);const n=Array.from(e.querySelectorAll("[data-line-annotation]")).filter(i=>i instanceof HTMLElement);for(const i of t){const r=Math.max(1,Math.min(i.start,i.end)),o=Math.max(i.start,i.end);for(let s=r;s<=o;s++){const l=Array.from(e.querySelectorAll(`[data-line="${s}"], [data-column-number="${s}"]`));for(const a of l)a instanceof HTMLElement&&a.setAttribute("data-comment-selected","")}for(const s of n){const l=Ud(s);l===void 0||l<r||l>o||s.setAttribute("data-comment-selected","")}}}function Pv(e,t){const n=new ResizeObserver(e);return He(n.disconnect.bind(n)),{observe:i=>n.observe(i,t),unobserve:n.unobserve.bind(n)}}function Dv(e,t,n){const i=new WeakMap,{observe:r,unobserve:o}=Pv(s=>{for(const l of s){const{contentRect:a,target:d}=l,c=Math.round(a.width),u=Math.round(a.height),h=i.get(d);(!h||h.width!==c||h.height!==u)&&(t(a,d,l),i.set(d,{width:c,height:u}))}},n);we(s=>{const l=dc(gr(br(e)));return cc(l,s,r,o),l},[])}const gi=new Set;let Ye,be,ea=!1;function Mv(e){return e instanceof HTMLElement?e.closest("[data-prevent-autofocus]")||e.isContentEditable?!0:/^(INPUT|TEXTAREA|SELECT|BUTTON)$/.test(e.tagName):!1}function ta(e){if(e instanceof Node)for(const t of gi){const n=t.element();if(n&&n.isConnected&&n.contains(e))return t}}function Ov(){ea||typeof window>"u"||(ea=!0,window.addEventListener("keydown",e=>{if(e.defaultPrevented||Mv(e.target)||!(e.metaKey||e.ctrlKey))return;const n=e.key.toLowerCase();if(n==="g"){const o=be;if(!o||!o.isOpen())return;e.preventDefault(),e.stopPropagation(),o.next(e.shiftKey?-1:1);return}if(n!=="f")return;const i=be;if(i&&i.isOpen()){e.preventDefault(),e.stopPropagation(),i.open();return}const r=ta(document.activeElement)??ta(e.target)??Ye??Array.from(gi)[0];r&&(e.preventDefault(),e.stopPropagation(),r.open())},{capture:!0}))}function wt(){const e=globalThis.CSS?.highlights;e&&(e.delete("opencode-find"),e.delete("opencode-find-current"))}function na(){const e=globalThis;return typeof e.Highlight=="function"&&e.CSS?.highlights!=null}function ia(e){let t=e.parentElement;for(;t;){const n=getComputedStyle(t);if(n.overflowY==="auto"||n.overflowY==="scroll")return t;t=t.parentElement}}function Nv(e){let t,n,i="overlay",r=[];const[o,s]=fa([]),[l,a]=uc({open:!1,query:"",index:0,count:0,pos:{top:8,right:8}}),d=()=>l.open,c=()=>l.query,u=()=>l.index,h=()=>l.count,f=()=>l.pos,g=()=>{s([])},y=()=>{const L=e.overlay();L&&(n!==void 0&&(cancelAnimationFrame(n),n=void 0),L.innerHTML="")},_=()=>{if(i!=="overlay"){y();return}const L=e.wrapper(),R=e.overlay();if(!L||!R||(y(),r.length===0))return;const D=L.getBoundingClientRect(),H=u(),M=document.createDocumentFragment();for(let V=0;V<r.length;V++){const O=r[V],G=V===H;for(const j of Array.from(O.getClientRects())){if(!j.width||!j.height)continue;const W=document.createElement("div");W.style.position="absolute",W.style.left=`${Math.round(j.left-D.left)}px`,W.style.top=`${Math.round(j.top-D.top)}px`,W.style.width=`${Math.round(j.width)}px`,W.style.height=`${Math.round(j.height)}px`,W.style.borderRadius="2px",W.style.backgroundColor=G?"var(--surface-warning-strong)":"var(--surface-warning-base)",W.style.opacity=G?"0.55":"0.35",G&&(W.style.boxShadow="inset 0 0 0 1px var(--border-warning-base)"),M.appendChild(W)}}R.appendChild(M)};function b(){i==="overlay"&&d()&&n===void 0&&(n=requestAnimationFrame(()=>{n=void 0,_()}))}const p=()=>{if(i!=="overlay")return;const L=e.getRoot(),R=L?Array.from(L.querySelectorAll("[data-code]")).filter(H=>H instanceof HTMLElement):[],D=o();R.length===D.length&&R.every((H,M)=>H===D[M])||(g(),s(R))},v=()=>{wt(),y(),g(),r=[],a("count",0),a("index",0)},w=()=>{if(typeof window>"u")return;const L=e.wrapper();if(!L)return;const R=ia(L)??L,D=R.getBoundingClientRect(),H=parseFloat(getComputedStyle(R).getPropertyValue("--session-title-height")),M=Number.isNaN(H)?0:H;a("pos",{top:Math.round(D.top)+M-4,right:Math.round(window.innerWidth-D.right)+8})},S=(L,R)=>{const D=R.toLowerCase(),H=[],M=Array.from(L.querySelectorAll("[data-content] [data-line], [data-column-content]")).filter(V=>V instanceof HTMLElement);for(const V of M){const O=V.textContent;if(!O)continue;const G=O.toLowerCase();let j=G.indexOf(D);if(j===-1)continue;const W=[],ce=[],nt=document.createTreeWalker(V,NodeFilter.SHOW_TEXT);let Ve=nt.nextNode(),bt=0;for(;Ve;)Ve instanceof Text&&(bt+=Ve.data.length,W.push(Ve),ce.push(bt)),Ve=nt.nextNode();if(W.length===0)continue;const ze=me=>{let F=0,q=ce.length-1;for(;F<q;){const $e=F+q>>1;ce[$e]>=me?q=$e:F=$e+1}const ue=F===0?0:ce[F-1];return{node:W[F],offset:me-ue}};for(;j!==-1;){const me=ze(j),F=ze(j+R.length),q=document.createRange();q.setStart(me.node,me.offset),q.setEnd(F.node,F.offset),H.push(q),j=G.indexOf(D,j+R.length)}}return H},k=L=>{const R=L.startContainer;(R instanceof Element?R:R.parentElement)?.scrollIntoView({block:"center",inline:"center"})},E=(L,R)=>{const D=globalThis.CSS?.highlights,H=globalThis.Highlight;if(!D||typeof H!="function")return!1;D.delete("opencode-find"),D.delete("opencode-find-current");const M=L[R];M&&D.set("opencode-find-current",new H(M));const V=L.filter((O,G)=>G!==R);return V.length>0&&D.set("opencode-find",new H(...V)),!0},C=L=>{if(!d())return;const R=c().trim();if(!R){v();return}const D=e.getRoot();if(!D)return;i=na()?"highlights":"overlay";const H=S(D,R),M=H.length,V=L?.reset?0:u(),O=M?Math.min(V,M-1):0;r=H,a("count",M),a("index",O);const G=H[O];if(i==="highlights"){y(),g(),E(H,O)||(i="overlay",wt(),p(),b()),L?.scroll&&G&&k(G);return}wt(),p(),L?.scroll&&G&&k(G),b()},x=()=>{a("open",!1),a("query",""),v(),be===A&&(be=void 0)},I=()=>{be&&be!==A&&be.close(),be=A,Ye=A,d()||a("open",!0),requestAnimationFrame(()=>{C({scroll:!0}),t?.focus(),t?.select()})},P=L=>{if(!d())return;const R=h();if(R<=0)return;const D=(u()+L+R)%R;a("index",D);const H=r[D];if(H){if(i==="highlights"){if(!E(r,D)){i="overlay",C({reset:!0,scroll:!0});return}k(H);return}wt(),p(),k(H),b()}},A={element:e.wrapper,isOpen:()=>d(),next:P,open:I,close:x};return we(()=>{for(const L of o())Ze(L,"scroll",b,{passive:!0})}),pa(()=>{i=na()?"highlights":"overlay",Ov(),gi.add(A),Ye||(Ye=A),He(()=>{gi.delete(A),be===A&&(be=void 0,wt()),Ye===A&&(Ye=void 0)})}),we(()=>{if(!d())return;const L=()=>w();requestAnimationFrame(L),Ze(window,"resize",L,{passive:!0});const R=e.wrapper();if(!R)return;const D=ia(R)??R;Dv(D,L)}),He(()=>{g(),y(),be===A&&(be=void 0,wt())}),{open:d,query:c,count:h,index:u,pos:f,setInput:L=>{t=L},setQuery:L=>{a("query",L),a("index",0),C({reset:!0,scroll:!0})},focus:I,close:x,next:P,refresh:L=>C(L),onPointerDown:()=>{Ye=A,e.wrapper()?.focus({preventScroll:!0})},onFocus:()=>{Ye=A},onInputKeyDown:L=>{if(L.key==="Escape"){L.preventDefault(),x();return}L.key==="Enter"&&(L.preventDefault(),P(L.shiftKey?-1:1))}}}function Hv(){return{token:0}}function Kt(e){e.observer?.disconnect(),e.observer=void 0}function Wd(e){if(!e)return;const t=e.querySelector("diffs-container");if(t instanceof HTMLElement)return t}function Vv(e){return Wd(e)?.shadowRoot??void 0}function Yr(e){if(!e||typeof document>"u")return;const t=document.documentElement.dataset.colorScheme;if(t==="dark"||t==="light"){e.dataset.colorScheme=t;return}e.removeAttribute("data-color-scheme")}function zv(e){if(typeof document>"u")return()=>{};if(Yr(e()),typeof MutationObserver>"u")return()=>{};const t=document.documentElement,n=new MutationObserver(()=>Yr(e()));return n.observe(t,{attributes:!0,attributeFilter:["data-color-scheme"]}),()=>n.disconnect()}function $v(e){Kt(e.state),e.state.token+=1;const t=e.state.token,n=Math.max(0,e.settleFrames??0),i=()=>{const s=l=>{if(t===e.state.token){if(l<=0){e.onReady();return}requestAnimationFrame(()=>s(l-1))}};requestAnimationFrame(()=>s(n))},r=s=>{if(e.isReady(s)){i();return}typeof MutationObserver>"u"||(Kt(e.state),e.state.observer=new MutationObserver(()=>{t===e.state.token&&e.isReady(s)&&(Kt(e.state),i())}),e.state.observer.observe(s,{childList:!0,subtree:!0}))},o=e.getRoot();if(!o){if(typeof MutationObserver>"u")return;e.state.observer=new MutationObserver(()=>{if(t!==e.state.token)return;const s=e.getRoot();s&&r(s)}),e.state.observer.observe(e.container,{childList:!0,subtree:!0});return}r(o)}function Fv(e){return e?e.start===e.end&&(e.endSide==null||e.endSide===e.side):!1}function Bv(e){if(e instanceof Range)return e;const t=new Range;return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),t}function qd(e,t){!e||!t||requestAnimationFrame(()=>{const n=e.getSelection?.()??window.getSelection();if(n)try{n.removeAllRanges(),n.addRange(t)}catch{}})}function Uv(){let e="none",t,n=!1,i=!1;const r=()=>{e="none",t=void 0,n=!1};return{begin(o,s){if(!o){e="text";return}e="numbers",t=s,n=!1},track(o,s){return e!=="numbers"?!1:(o&1)===0?(r(),!0):(s!==void 0&&t!==void 0&&s!==t&&(n=!0),!0)},finish(){const o=e;return i=o==="numbers"&&n,r(),o},consume(o){const s=i&&!Fv(o);return i=!1,s},reset(){i=!1,r()}}}function Di(e){if(e)return e instanceof HTMLElement?e:e.parentElement??void 0}function Gv(e){const t=Di(e);if(!t)return;const n=t.closest("[data-line]");if(!(n instanceof HTMLElement))return;const i=parseInt(n.dataset.line??"",10);if(!Number.isNaN(i))return i}function ra(e){const t=Di(e);if(!t)return;const n=t.closest("[data-line], [data-alt-line]");if(!(n instanceof HTMLElement))return;const i=parseInt(n.dataset.line??"",10);if(!Number.isNaN(i))return i;const r=parseInt(n.dataset.altLine??"",10);if(!Number.isNaN(r))return r}function Wv(e){const t=Di(e);if(!t)return;const n=t.closest("[data-code]");if(n instanceof HTMLElement)return n.hasAttribute("data-deletions")?"deletions":"additions"}function jd(e){const t=e.root.getSelection?.()??window.getSelection();if(!t||t.isCollapsed)return;const n=t.getComposedRanges?.({shadowRoots:[e.root]})?.[0]??(t.rangeCount>0?t.getRangeAt(0):void 0),i=n?.startContainer??t.anchorNode,r=n?.endContainer??t.focusNode;if(!i||!r||!e.root.contains(i)||!e.root.contains(r))return;const o=e.lineForNode(i),s=e.lineForNode(r);if(o===void 0||s===void 0)return;const l=e.sideForNode?.(i),a=e.sideForNode?.(r),d=l??a,c={start:o,end:s};return d&&(c.side=d),a&&d&&a!==d&&(c.endSide=a),{range:c,text:e.preserveTextSelection&&n?Bv(n).cloneRange():void 0}}const On=new WeakMap,qv={lineHeight:24,hunkSeparatorHeight:24,spacing:0};function jv(e){return e==="auto"||e==="scroll"||e==="overlay"}function oa(e){let t=e.parentElement;for(;t;){const n=getComputedStyle(t);if(jv(n.overflowY))return t;t=t.parentElement}}function Kv(e){if(typeof document>"u")return;const t=e.closest("[data-component='session-review']");if(t instanceof HTMLElement){const i=oa(e)??t,r=t.querySelector("[data-slot='session-review-container']");return{key:t,root:i,content:r instanceof HTMLElement?r:void 0}}const n=oa(e);if(n){const i=n.querySelector("[role='log']");return{key:n,root:n,content:i instanceof HTMLElement?i:void 0}}return{key:document,root:document,content:void 0}}function Xv(e){const t=Kv(e);if(!t)return;let n=On.get(t.key);if(!n){const r=new $d;r.setup(t.root,t.content),n={virtualizer:r,refs:0},On.set(t.key,n)}n.refs+=1;let i=!1;return{virtualizer:n.virtualizer,release(){if(i)return;i=!0;const r=On.get(t.key);r&&(r.refs-=1,!(r.refs>0)&&(r.virtualizer.cleanUp(),On.delete(t.key)))}}}function Qv(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bt={exports:{}},Yv=Bt.exports,sa;function Jv(){return sa||(sa=1,(function(e,t){(function(n,i){i(t)})(Yv,function(n){const i=Symbol("newer"),r=Symbol("older");class o{constructor(u,h){typeof u!="number"&&(h=u,u=0),this.size=0,this.limit=u,this.oldest=this.newest=void 0,this._keymap=new Map,h&&(this.assign(h),u<1&&(this.limit=this.size))}_markEntryAsUsed(u){u!==this.newest&&(u[i]&&(u===this.oldest&&(this.oldest=u[i]),u[i][r]=u[r]),u[r]&&(u[r][i]=u[i]),u[i]=void 0,u[r]=this.newest,this.newest&&(this.newest[i]=u),this.newest=u)}assign(u){let h,f=this.limit||Number.MAX_VALUE;this._keymap.clear();let g=u[Symbol.iterator]();for(let y=g.next();!y.done;y=g.next()){let _=new s(y.value[0],y.value[1]);if(this._keymap.set(_.key,_),h?(h[i]=_,_[r]=h):this.oldest=_,h=_,f--==0)throw new Error("overflow")}this.newest=h,this.size=this._keymap.size}get(u){var h=this._keymap.get(u);return h?(this._markEntryAsUsed(h),h.value):void 0}set(u,h){var f=this._keymap.get(u);return f?(f.value=h,this._markEntryAsUsed(f),this):(this._keymap.set(u,f=new s(u,h)),this.newest?(this.newest[i]=f,f[r]=this.newest):this.oldest=f,this.newest=f,++this.size,this.size>this.limit&&this.shift(),this)}shift(){var u=this.oldest;if(u)return this.oldest[i]?(this.oldest=this.oldest[i],this.oldest[r]=void 0):(this.oldest=void 0,this.newest=void 0),u[i]=u[r]=void 0,this._keymap.delete(u.key),--this.size,[u.key,u.value]}find(u){let h=this._keymap.get(u);return h?h.value:void 0}has(u){return this._keymap.has(u)}delete(u){var h=this._keymap.get(u);return h?(this._keymap.delete(h.key),h[i]&&h[r]?(h[r][i]=h[i],h[i][r]=h[r]):h[i]?(h[i][r]=void 0,this.oldest=h[i]):h[r]?(h[r][i]=void 0,this.newest=h[r]):this.oldest=this.newest=void 0,this.size--,h.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new a(this.oldest)}values(){return new d(this.oldest)}entries(){return this}[Symbol.iterator](){return new l(this.oldest)}forEach(u,h){typeof h!="object"&&(h=this);let f=this.oldest;for(;f;)u.call(h,f.value,f.key,this),f=f[i]}toJSON(){for(var u=new Array(this.size),h=0,f=this.oldest;f;)u[h++]={key:f.key,value:f.value},f=f[i];return u}toString(){for(var u="",h=this.oldest;h;)u+=String(h.key)+":"+h.value,h=h[i],h&&(u+=" < ");return u}}n.LRUMap=o;function s(c,u){this.key=c,this.value=u,this[i]=void 0,this[r]=void 0}function l(c){this.entry=c}l.prototype[Symbol.iterator]=function(){return this},l.prototype.next=function(){let c=this.entry;return c?(this.entry=c[i],{done:!1,value:[c.key,c.value]}):{done:!0,value:void 0}};function a(c){this.entry=c}a.prototype[Symbol.iterator]=function(){return this},a.prototype.next=function(){let c=this.entry;return c?(this.entry=c[i],{done:!1,value:c.key}):{done:!0,value:void 0}};function d(c){this.entry=c}d.prototype[Symbol.iterator]=function(){return this},d.prototype.next=function(){let c=this.entry;return c?(this.entry=c[i],{done:!1,value:c.value}):{done:!0,value:void 0}}})})(Bt,Bt.exports)),Bt.exports}var Zv=Jv();const aa=Qv(Zv),Nn=Symbol("IGNORE_RESPONSE");var ur=class extends Error{constructor(){super("WorkerPoolManager: operation canceled because the pool terminated")}},e0=class{highlighter;preferredHighlighter;renderOptions;renderOptionsRequestVersion=0;renderOptionsVersion=0;initialized=!1;workers=[];queuedTasks=[];queuedTaskByInstance=new Map;taskByHighlightKey=new Map;activeTaskById=new Map;activeRequestByInstance=new Map;nextRequestId=0;themeSubscribers=new Set;workersFailed=!1;statSubscribers=new Set;fileCache;diffCache;_queuedBroadcast;lifecycleGeneration=0;constructor(e,{langs:t,theme:n=X,useTokenTransformer:i=!1,lineDiffType:r="word-alt",maxLineDiffLength:o=1e3,tokenizeMaxLineLength:s=1e3,preferredHighlighter:l="shiki-js"}){this.options=e,this.preferredHighlighter=l,this.renderOptions={theme:n,useTokenTransformer:i,lineDiffType:r,maxLineDiffLength:o,tokenizeMaxLineLength:s},this.fileCache=new aa.LRUMap(e.totalASTLRUCacheSize??100),this.diffCache=new aa.LRUMap(e.totalASTLRUCacheSize??100),this.queueInitialization(t)}isWorkingPool(){return!this.workersFailed}getFileResultCache(e){return e.cacheKey!=null?this.fileCache.get(e.cacheKey):void 0}getDiffResultCache(e){return e.cacheKey!=null?this.diffCache.get(e.cacheKey):void 0}inspectCaches(){const{fileCache:e,diffCache:t}=this;return{fileCache:e,diffCache:t}}evictFileFromCache(e){try{return this.fileCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}evictDiffFromCache(e){try{return this.diffCache.delete(e)!==void 0}finally{this.queueBroadcastStateChanges()}}async setRenderOptions({theme:e=this.renderOptions.theme??X,useTokenTransformer:t=this.renderOptions.useTokenTransformer??!1,lineDiffType:n=this.renderOptions.lineDiffType??"word-alt",maxLineDiffLength:i=this.renderOptions.maxLineDiffLength??1e3,tokenizeMaxLineLength:r=this.renderOptions.tokenizeMaxLineLength??1e3}){const{lifecycleGeneration:o}=this,s=++this.renderOptionsRequestVersion,l=()=>this.isCurrentLifecycle(o)&&this.renderOptionsRequestVersion===s;try{const a={theme:e,useTokenTransformer:t,lineDiffType:n,maxLineDiffLength:i,tokenizeMaxLineLength:r};if(this.isInitialized()||await this.initialize(),!l()||We(a,this.renderOptions))return;const d=sn(e);let c=[];if(Rt(a.theme,this.renderOptions.theme)||(Ur(d)?c=Ks(d):c=await Xs(d)),!l())return;if(this.highlighter!=null)Br(c,this.highlighter);else{const h=await ci({themes:d,langs:["text"],preferredHighlighter:this.preferredHighlighter});if(!l())return;this.highlighter=h}const u=this.setRenderOptionsOnWorkers(a,c);this.renderOptions=a,this.renderOptionsVersion++,this.diffCache.clear(),this.fileCache.clear(),this.invalidateRenderTasks();for(const h of this.themeSubscribers)h.onThemeChange();await u}catch(a){if(a instanceof ur||!l())return;throw a}}getFileRenderOptions(){const{tokenizeMaxLineLength:e,theme:t,useTokenTransformer:n}=this.renderOptions;return{theme:t,useTokenTransformer:n,tokenizeMaxLineLength:e}}getDiffRenderOptions(){return{...this.renderOptions}}async setRenderOptionsOnWorkers(e,t){if(this.workersFailed)return;this.isInitialized()||await this.initialize();const n=[];for(const i of this.workers){if(!i.initialized)throw console.log({managedWorker:i}),new Error("setRenderOptionsOnWorkers: Somehow we have an uninitialized worker");n.push(new Promise((r,o)=>{const s=this.generateRequestId(),l={type:"set-render-options",id:s,request:{type:"set-render-options",id:s,renderOptions:e,resolvedThemes:t},resolve:r,reject:o,requestStart:Date.now()};this.activeTaskById.set(s,l),i.pendingSetupRequestId=s,i.worker.postMessage(l.request)}))}await Promise.all(n)}subscribeToThemeChanges(e){return this.themeSubscribers.add(e),this.queueBroadcastStateChanges(),()=>{this.unsubscribeToThemeChanges(e),this.queueBroadcastStateChanges()}}unsubscribeToThemeChanges(e){this.themeSubscribers.delete(e),this.queueBroadcastStateChanges()}subscribeToStatChanges(e){return this.statSubscribers.add(e),e(this.getStats()),()=>{this.statSubscribers.delete(e)}}queueBroadcastStateChanges(){this._queuedBroadcast==null&&(this._queuedBroadcast=requestAnimationFrame(this._broadcastStateChanges))}_broadcastStateChanges=()=>{this._queuedBroadcast!=null&&(cancelAnimationFrame(this._queuedBroadcast),this._queuedBroadcast=void 0);const e=this.getStats();for(const t of this.statSubscribers)t(e)};cleanUpTasks(e){this.detachInstanceFromQueuedTasks(e);const t=this.activeRequestByInstance.get(e);if(t!=null){const n=this.activeTaskById.get(t);rt(n)?(this.detachInstanceFromRenderTask(n,e),!n.primeCache&&n.instances.size===0&&this.removeActiveTask(n)):this.activeTaskById.delete(t)}this.activeRequestByInstance.delete(e),this.queueBroadcastStateChanges()}isInitialized(){return this.initialized===!0}async initialize(e=[]){if(this.initialized!==!0)if(this.initialized===!1){const{lifecycleGeneration:t}=this;this.initialized=new Promise((n,i)=>{(async()=>{try{const r=sn(this.renderOptions.theme);let o=[];if(Ur(r)?o=Ks(r):o=await Xs(r),!this.isCurrentLifecycle(t)){n();return}let s=[];if(qs(e)?s=Ws(e):s=await js(e),!this.isCurrentLifecycle(t)){n();return}const[l]=await Promise.all([ci({themes:r,langs:["text",...e],preferredHighlighter:this.preferredHighlighter}),this.initializeWorkers(o,s)]);if(!this.isCurrentLifecycle(t)){this.terminateWorkers(),n();return}this.highlighter=l,this.initialized=!0,this.diffCache.clear(),this.fileCache.clear(),this.drainQueue(),this.queueBroadcastStateChanges(),n()}catch(r){if(r instanceof ur||!this.isCurrentLifecycle(t)){n();return}this.initialized=!1,this.workersFailed=!0,this.queueBroadcastStateChanges(),i(r)}})()}),this.queueBroadcastStateChanges()}else return this.initialized}async initializeWorkers(e,t){this.workersFailed=!1;const n=[],i=void 0;this.workers.length>0&&this.terminateWorkers();for(let r=0;r<(this.options.poolSize??8);r++){const o=this.options.workerFactory(),s={worker:o,requestId:void 0,pendingSetupRequestId:void 0,initialized:!1,langs:new Set(["text",...t.map(({name:l})=>l)]),customExtensionsVersion:0};o.addEventListener("message",l=>{this.handleWorkerMessage(s,l.data)}),o.addEventListener("error",l=>console.error("Worker error:",l,s)),this.workers.push(s),n.push(new Promise((l,a)=>{const d=this.generateRequestId(),c={type:"initialize",id:d,request:{type:"initialize",id:d,renderOptions:this.renderOptions,preferredHighlighter:this.preferredHighlighter,resolvedThemes:e,resolvedLanguages:t,customExtensionsVersion:void 0,customExtensionMap:i},resolve(){s.initialized=!0,l()},reject:a,requestStart:Date.now()};this.activeTaskById.set(d,c),this.executeTask(s,c)}))}await Promise.all(n)}drainQueue=()=>{if(this._queuedDrain=void 0,!(this.initialized!==!0||this.queuedTasks.length===0)){for(let e=0;e<this.queuedTasks.length;){const t=this.queuedTasks[e];if(this.hasActiveRequest(t)){e++;continue}const n=la(t),i=this.getAvailableWorker(n);if(i==null)break;this.queuedTasks.splice(e,1),this.assignWorkerToTask(t,i),this.resolveLanguagesAndExecuteTask(i,t,n)}this.queueBroadcastStateChanges()}};highlightFileAST(e,t){const n=this.getFileResultCache(t);an(t)||n!=null&&Je(n.options,this.getFileRenderOptions())||this.hasMatchingFileInstanceTask(e,t)||this.submitTask(e,{type:"file",file:t})}primeFileHighlightCache(e){if(e.cacheKey==null){console.warn(`WorkerPoolManager.primeFileHighlightCache: priming highlight cache requires file.cacheKey; skipping "${e.name}".`);return}const t=this.getFileResultCache(e),n=this.getFileHighlightKey(e);if(n==null||an(e)||t!=null&&Je(t.options,this.getFileRenderOptions()))return;const i=this.getTaskByHighlightKey(n);i!=null?i.primeCache=!0:this.submitCacheTask({type:"file",file:e},n)}getPlainFileAST(e,t,n,i){if(this.highlighter==null){this.queueInitialization();return}return md(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,lines:i})}highlightDiffAST(e,t){const n=this.getDiffResultCache(t);un(t)||n!=null&&We(n.options,this.getDiffRenderOptions())||this.hasMatchingDiffInstanceTask(e,t)||this.submitTask(e,{type:"diff",diff:t})}primeDiffHighlightCache(e){if(e.cacheKey==null){console.warn(`WorkerPoolManager.primeDiffHighlightCache: priming highlight cache requires diff.cacheKey; skipping "${e.prevName??e.name}" -> "${e.name}".`);return}const t=this.getDiffResultCache(e),n=this.getDiffHighlightKey(e);if(n==null||un(e)||t!=null&&We(t.options,this.getDiffRenderOptions()))return;const i=this.getTaskByHighlightKey(n);i!=null?i.primeCache=!0:this.submitCacheTask({type:"diff",diff:e},n)}getPlainDiffAST(e,t,n,i,r){return this.highlighter!=null?Hd(e,this.highlighter,this.renderOptions,{forcePlainText:!0,startingLine:t,totalLines:n,expandedHunks:i,collapsedContextThreshold:r}):void 0}terminate(){this.lifecycleGeneration++,this.cancelActiveWorkerTasks(),this.terminateWorkers(),this.fileCache.clear(),this.diffCache.clear(),this.activeRequestByInstance.clear(),this.queuedTasks.length=0,this.queuedTaskByInstance.clear(),this.taskByHighlightKey.clear(),this.activeTaskById.clear(),this.highlighter=void 0,this.initialized=!1,this.workersFailed=!1,this.queueBroadcastStateChanges()}isCurrentLifecycle(e){return this.lifecycleGeneration===e}queueInitialization(e){this.initialize(e).catch(t=>{console.error(t)})}cancelActiveWorkerTasks(){const e=new ur;for(const t of this.activeTaskById.values())"reject"in t&&t.reject(e)}terminateWorkers(){for(const e of this.workers)e.worker.terminate();this.workers.length=0}getStats(){return{managerState:this.initialized===!1?"waiting":this.initialized!==!0?"initializing":"initialized",totalWorkers:this.workers.length,workersFailed:this.workersFailed,busyWorkers:this.workers.filter(e=>e.requestId!=null||e.pendingSetupRequestId!=null).length,queuedTasks:this.queuedTasks.length,activeTasks:this.activeTaskById.size,themeSubscribers:this.themeSubscribers.size,fileCacheSize:this.fileCache.size,diffCacheSize:this.diffCache.size}}submitTask(e,t){this.initialized===!1&&this.queueInitialization();const n=this.getHighlightKeyForRequest(t),i=n!=null?this.getTaskByHighlightKey(n):void 0;if(i!=null){this.detachInstanceFromQueuedTasks(e,i),this.addInstanceToTask(i,e),this.queueBroadcastStateChanges();return}this.detachInstanceFromQueuedTasks(e);const r=this.generateRequestId(),o=Date.now(),{renderOptionsVersion:s}=this,l=(()=>{switch(t.type){case"file":return{type:"file",id:r,request:{...t,id:r},instances:new Set([e]),primeCache:!1,highlightKey:n,renderOptionsVersion:s,requestStart:o};case"diff":return{type:"diff",id:r,request:{...t,id:r},instances:new Set([e]),primeCache:!1,highlightKey:n,renderOptionsVersion:s,requestStart:o}}})();this.enqueueRenderTask(l,e)}submitCacheTask(e,t){this.initialized===!1&&this.queueInitialization();const n=this.generateRequestId(),i=Date.now(),{renderOptionsVersion:r}=this,o=(()=>{switch(e.type){case"file":return{type:"file",id:n,request:{...e,id:n},instances:new Set,primeCache:!0,highlightKey:t,renderOptionsVersion:r,requestStart:i};case"diff":return{type:"diff",id:n,request:{...e,id:n},instances:new Set,primeCache:!0,highlightKey:t,renderOptionsVersion:r,requestStart:i}}})();this.enqueueRenderTask(o)}enqueueRenderTask(e,t){this.queuedTasks.push(e),t!=null&&this.queuedTaskByInstance.set(t,e),e.highlightKey!=null&&this.taskByHighlightKey.set(e.highlightKey,e),this.queueDrain()}async resolveLanguagesAndExecuteTask(e,t,n){try{const i=n.filter(r=>!e.langs.has(r));if(i.length>0&&(qs(i)?t.request.resolvedLanguages=Ws(i):t.request.resolvedLanguages=await js(i)),!this.activeTaskById.has(t.id)){e.requestId===t.id&&(this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain());return}this.executeTask(e,t)}catch{this.cleanWorkerAndTask(e,t),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}}handleWorkerMessage(e,t){const n=this.activeTaskById.get(t.id);try{if(n==null)throw Nn;if(t.type==="error"){const i=new Error(t.error);if(t.stack&&(i.stack=t.stack),"reject"in n)n.reject(i);else if(rt(n))this.notifyHighlightError(n,i);else throw new Error("handleWorkerMessage: unknown task type");throw i}else switch(t.requestType){case"initialize":if(n.type!=="initialize")throw new Error("handleWorkerMessage: task/response dont match");this.syncCustomExtensionVersion(e,n.request),n.resolve();break;case"set-render-options":if(n.type!=="set-render-options")throw new Error("handleWorkerMessage: task/response dont match");n.resolve();break;case"file":{if(n.type!=="file")throw new Error("handleWorkerMessage: task/response dont match");const{result:i,options:r}=t;if(!this.isCurrentRenderTask(n)||!Je(r,this.getFileRenderOptions()))throw Nn;const{request:o}=n;this.syncCustomExtensionVersion(e,o),o.file.cacheKey!=null&&this.fileCache.set(o.file.cacheKey,{result:i,options:r}),this.notifyFileInstances(n,i,r);break}case"diff":{if(n.type!=="diff")throw new Error("handleWorkerMessage: task/response dont match");const{result:i,options:r}=t;if(!this.isCurrentRenderTask(n)||!We(r,this.getDiffRenderOptions()))throw Nn;const{request:o}=n;this.syncCustomExtensionVersion(e,o),o.diff.cacheKey!=null&&this.diffCache.set(o.diff.cacheKey,{result:i,options:r}),this.notifyDiffInstances(n,i,r);break}}}catch(i){i!==Nn&&console.error(i,n,t)}this.cleanWorkerAndTask(e,n,t.id),this.queueBroadcastStateChanges(),this.queuedTasks.length>0&&this.queueDrain()}_queuedDrain;queueDrain(){this._queuedDrain==null&&(this._queuedDrain=Promise.resolve().then(this.drainQueue),this.queueBroadcastStateChanges())}assignWorkerToTask(e,t){t.requestId=e.id,rt(e)&&(this.clearQueuedInstanceRequests(e),this.trackInstanceRequests(e)),this.activeTaskById.set(e.id,e)}cleanWorkerAndTask(e,t,n=t?.id){e.requestId===n&&(e.requestId=void 0),e.pendingSetupRequestId===n&&(e.pendingSetupRequestId=void 0),t!=null&&(rt(t)&&(this.clearInstanceRequests(t),this.clearHighlightKey(t)),this.activeTaskById.delete(t.id))}executeTask(e,t){t0(t.request)&&this.maybeAttachCustomExtensions(e,t.request),this.activeTaskById.has(t.id)||this.assignWorkerToTask(t,e);for(const n of la(t))e.langs.add(n);try{e.worker.postMessage(t.request)}catch(n){console.error("Failed to post message to worker:",n),rt(t)?this.notifyHighlightError(t,n):"reject"in t&&t.reject(n),this.cleanWorkerAndTask(e,t),this.queuedTasks.length>0&&this.queueDrain()}this.queueBroadcastStateChanges()}maybeAttachCustomExtensions(e,t){if(t.customExtensionsVersion!=null)return;const n=Dg();e.customExtensionsVersion>=n||(t.customExtensionsVersion=n,t.customExtensionMap=Mg())}syncCustomExtensionVersion(e,t){t.customExtensionsVersion!=null&&(e.customExtensionsVersion=t.customExtensionsVersion)}getAvailableWorker(e){let t;for(const n of this.workers){if(n.requestId!=null||n.pendingSetupRequestId!=null||!n.initialized)continue;if(t=n,e.length===0)break;let i=!0;for(const r of e)if(!n.langs.has(r)){i=!1;break}if(i)break}return t}getFileHighlightKey(e){if(e.cacheKey!=null)return`file:${e.cacheKey}:${this.renderOptionsVersion}`}getDiffHighlightKey(e){if(e.cacheKey!=null)return`diff:${e.cacheKey}:${this.renderOptionsVersion}`}getHighlightKeyForRequest(e){switch(e.type){case"file":return this.getFileHighlightKey(e.file);case"diff":return this.getDiffHighlightKey(e.diff)}}hasActiveRequest(e){for(const t of Ht(e))if(this.activeRequestByInstance.has(t))return!0;return!1}addInstanceToTask(e,t){e.type,e.instances.add(t),this.activeTaskById.has(e.id)?this.activeRequestByInstance.set(t,e.id):this.queuedTaskByInstance.set(t,e)}detachInstanceFromQueuedTasks(e,t){const n=this.queuedTaskByInstance.get(e);n==null||n===t||(this.queuedTaskByInstance.delete(e),this.detachInstanceFromRenderTask(n,e),!n.primeCache&&n.instances.size===0&&this.removeQueuedTask(n))}detachInstanceFromRenderTask(e,t){e.type,e.instances.delete(t)}removeQueuedTask(e){const t=this.queuedTasks.indexOf(e);t!==-1&&this.queuedTasks.splice(t,1),this.clearQueuedInstanceRequests(e),this.clearHighlightKey(e)}removeActiveTask(e){this.clearInstanceRequests(e),this.clearHighlightKey(e),this.activeTaskById.delete(e.id)}invalidateRenderTasks(){for(let e=this.queuedTasks.length-1;e>=0;e--){const t=this.queuedTasks[e];t.renderOptionsVersion!==this.renderOptionsVersion&&this.removeQueuedTask(t)}for(const e of Array.from(this.activeTaskById.values()))rt(e)&&e.renderOptionsVersion!==this.renderOptionsVersion&&this.removeActiveTask(e)}clearQueuedInstanceRequests(e){for(const t of Ht(e))this.queuedTaskByInstance.get(t)===e&&this.queuedTaskByInstance.delete(t)}clearHighlightKey(e){e.highlightKey!=null&&this.taskByHighlightKey.get(e.highlightKey)===e&&this.taskByHighlightKey.delete(e.highlightKey)}trackInstanceRequests(e){for(const t of Ht(e))this.activeRequestByInstance.set(t,e.id)}clearInstanceRequests(e){for(const t of Ht(e))this.activeRequestByInstance.get(t)===e.id&&this.activeRequestByInstance.delete(t)}notifyFileInstances(e,t,n){for(const i of e.instances)this.activeRequestByInstance.get(i)===e.id&&i.onHighlightSuccess(e.request.file,t,n)}notifyDiffInstances(e,t,n){for(const i of e.instances)this.activeRequestByInstance.get(i)===e.id&&i.onHighlightSuccess(e.request.diff,t,n)}notifyHighlightError(e,t){for(const n of Ht(e))this.activeRequestByInstance.get(n)===e.id&&n.onHighlightError(t)}hasMatchingFileInstanceTask(e,t){for(const n of this.iterateRenderTasks())if(n.type==="file"&&this.isCurrentRenderTask(n)&&n.instances.has(e)&&Me(t,n.request.file))return!0;return!1}hasMatchingDiffInstanceTask(e,t){for(const n of this.iterateRenderTasks())if(n.type==="diff"&&this.isCurrentRenderTask(n)&&n.instances.has(e)&&Et(n.request.diff,t))return!0;return!1}getTaskByHighlightKey(e){const t=this.taskByHighlightKey.get(e);return t!=null&&this.isCurrentRenderTask(t)?t:void 0}isCurrentRenderTask(e){return e.renderOptionsVersion===this.renderOptionsVersion}*iterateRenderTasks(){for(const e of this.queuedTasks)yield e;for(const e of this.activeTaskById.values())rt(e)&&(yield e)}generateRequestId(){return`req_${++this.nextRequestId}`}};function t0(e){return e.type==="initialize"||e.type==="file"||e.type==="diff"}function la(e){const t=new Set;if(e.type==="initialize"||e.type==="set-render-options")return[];switch(e.type){case"file":t.add(e.request.file.lang??ae(e.request.file.name));break;case"diff":t.add(e.request.diff.lang??ae(e.request.diff.name)),t.add(e.request.diff.lang??ae(e.request.diff.prevName??"-"));break}return t.delete("text"),Array.from(t)}function rt(e){return e?.type==="file"||e?.type==="diff"}function Ht(e){return e.instances}const n0="/console/assets/worker-BVEmEyu5.js";Lv();function i0(){return new Worker(n0,{type:"module"})}function da(e){const t=new e0({workerFactory:i0,poolSize:2},{theme:pi,lineDiffType:e,preferredHighlighter:"shiki-wasm"});return t.initialize(),t}let hr,fr;function Jr(e){if(!(typeof window>"u"))return e==="split"?(fr||(fr=da("word-alt")),fr):(hr||(hr=da("none")),hr)}const r0=new Set(["png","jpg","jpeg","gif","webp","avif","bmp","ico","tif","tiff","heic"]),o0=new Set(["mp3","wav","ogg","m4a","aac","flac","opus"]);function Mi(e){if(!(!e||typeof e!="object"))return e}function ko(e){if(!e)return;const t=e.split(";",1)[0]?.trim().toLowerCase();if(t)return t==="audio/x-aac"?"audio/aac":t==="audio/x-m4a"?"audio/mp4":t}function s0(e){if(!e)return"";const t=e.lastIndexOf(".");return t===-1?"":e.slice(t+1).toLowerCase()}function a0(e){const t=s0(e);if(t==="svg")return"svg";if(r0.has(t))return"image";if(o0.has(t))return"audio"}function l0(e){return Mi(e)?.type==="binary"}function d0(e,t){if(t==="svg")return e.startsWith("data:image/svg+xml")?e:void 0;if(t==="image")return e.startsWith("data:image/")?e:void 0;if(e.startsWith("data:audio/x-aac;"))return e.replace("data:audio/x-aac;","data:audio/aac;");if(e.startsWith("data:audio/x-m4a;"))return e.replace("data:audio/x-m4a;","data:audio/mp4;");if(e.startsWith("data:audio/"))return e}function pr(e,t){if(!e)return;if(typeof e=="string")return d0(e,t);const n=Mi(e);if(!n||typeof n.content!="string")return;const i=ko(typeof n.mimeType=="string"?n.mimeType:void 0);if(i){if(t==="svg")return i!=="image/svg+xml"?void 0:n.encoding==="base64"?`data:image/svg+xml;base64,${n.content}`:`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n.content)}`;if(!(t==="image"&&!i.startsWith("image/"))&&!(t==="audio"&&!i.startsWith("audio/"))&&n.encoding==="base64")return`data:${i};base64,${n.content}`}}function c0(e){if(typeof atob=="function")try{const t=atob(e),n=Uint8Array.from(t,i=>i.charCodeAt(0));return typeof TextDecoder=="function"?new TextDecoder().decode(n):t}catch{}}function u0(e){const t=Mi(e);if(!(!t||typeof t.content!="string"||ko(typeof t.mimeType=="string"?t.mimeType:void 0)!=="image/svg+xml"))return t.encoding==="base64"?c0(t.content):t.content}function mr(e){if(typeof e=="string")return e.length>0;const t=Mi(e);return t?typeof t.content=="string"&&t.content.length>0:!1}var h0=tt('<div class="flex min-h-56 flex-col items-center justify-center gap-2 px-6 py-10 text-center"><div class="text-14-semibold text-text-strong"></div><div class="text-14-regular text-text-weak">'),Hn=tt('<div class="flex min-h-40 items-center justify-center px-6 py-4 text-center text-text-weak">'),f0=tt('<div class="flex justify-center bg-background-stronger px-6 py-4"><img class="max-h-[60vh] max-w-full rounded border border-border-weak-base bg-background-base object-contain">'),p0=tt('<div class="flex justify-center bg-background-stronger px-6 py-4"><audio class="w-full max-w-xl"controls preload=metadata><source>'),m0=tt('<div class="flex flex-col gap-4 px-6 py-4">'),g0=tt('<div class="flex justify-center"><img class="max-h-[60vh] max-w-full rounded border border-border-weak-base bg-background-base object-contain">');function b0(e,t){return e.current!==void 0?e.current:e.after??e.before}function ca(e){const t=va(),n=()=>e.media,i=re(()=>{const p=n();if(!(!p||p.mode==="off"))return a0(p.path)}),r=re(()=>{const p=n();return!p||p.mode==="off"||i()?!1:l0(p.current)}),o=()=>e.media?.onLoad?.(),s=re(()=>{const p=n(),v=i();return!p||!v?!1:p.deleted?!0:v==="svg"||p.current!==void 0?!1:!mr(p.after)&&mr(p.before)}),l=re(()=>{const p=n(),v=i();if(!(!p||v!=="image"&&v!=="audio"))return pr(b0(p,v),v)}),a=re(()=>{const p=n(),v=i();if(!(!p||v!=="image"&&v!=="audio")&&p.current===void 0&&!s()&&!l()&&!(!p.path||!p.readFile))return{key:`${v}:${p.path}`,kind:v,path:p.path,readFile:p.readFile,onError:p.onError}}),[d]=hc(a,async p=>p.readFile(p.path).then(v=>{const w=pr(v,p.kind);return w?{key:p.key,src:w,mime:p.kind==="audio"?ko(v?.mimeType):void 0}:(p.onError?.({kind:p.kind}),{key:p.key,error:!0})},()=>(p.onError?.({kind:p.kind}),{key:p.key,error:!0}))),c=re(()=>{const p=a(),v=d();if(!(!p||!v||v.key!==p.key))return v}),u=re(()=>{const p=c();return l()??(p&&"src"in p?p.src:void 0)}),h=re(()=>l()?"ready":a()?d.loading?"loading":c()?.error?"error":u()?"ready":"idle":"idle"),f=re(()=>{const p=c();return p&&"mime"in p?p.mime:void 0}),g=re(()=>{const p=n();if(!(!p||i()!=="svg"))return u0(p.current)}),y=re(()=>{const p=n();if(!(!p||i()!=="svg"))return pr(p.current,"svg")}),_=re(()=>{const p=n();if(!(!p||i()!=="svg")&&g()===void 0&&mr(p.current))return[p.path,p.current]});we(fc(_,p=>{p&&n()?.onError?.({kind:"svg"})},{defer:!0}));const b=p=>t.t(p==="image"?"ui.fileMedia.kind.image":"ui.fileMedia.kind.audio");return Y(pc,{get children(){return[Y(mn,{get when(){return i()==="image"||i()==="audio"},get children(){return Y(Vn,{get when(){return u()},get fallback(){const p=n(),v=i();if(!p||v!=="image"&&v!=="audio")return e.fallback();const w=b(v);return s()?(()=>{var S=Hn();return le(S,()=>t.t("ui.fileMedia.state.removed",{kind:w})),S})():h()==="loading"?(()=>{var S=Hn();return le(S,()=>t.t("ui.fileMedia.state.loading",{kind:w})),S})():h()==="error"?(()=>{var S=Hn();return le(S,()=>t.t("ui.fileMedia.state.error",{kind:w})),S})():(()=>{var S=Hn();return le(S,()=>t.t("ui.fileMedia.state.unavailable",{kind:w})),S})()},children:p=>{const v=i();return v!=="image"&&v!=="audio"?e.fallback():v==="image"?(()=>{var w=f0(),S=w.firstChild;return S.addEventListener("load",o),ct(k=>{var E=p(),C=n()?.path;return E!==k.e&&ke(S,"src",k.e=E),C!==k.t&&ke(S,"alt",k.t=C),k},{e:void 0,t:void 0}),w})():(()=>{var w=p0(),S=w.firstChild,k=S.firstChild;return S.addEventListener("loadedmetadata",o),ct(E=>{var C=p(),x=f();return C!==E.e&&ke(k,"src",E.e=C),x!==E.t&&ke(k,"type",E.t=x),E},{e:void 0,t:void 0}),w})()}})}}),Y(mn,{get when(){return i()==="svg"},get children(){return g()===void 0&&y()==null?e.fallback():(()=>{var p=m0();return le(p,Y(Vn,{get when(){return g()!==void 0},get children(){return e.fallback()}}),null),le(p,Y(Vn,{get when(){return y()},children:v=>(()=>{var w=g0(),S=w.firstChild;return S.addEventListener("load",o),ct(k=>{var E=v(),C=n()?.path;return E!==k.e&&ke(S,"src",k.e=E),C!==k.t&&ke(S,"alt",k.t=C),k},{e:void 0,t:void 0}),w})()}),null),p})()}}),Y(mn,{get when(){return r()},get children(){var p=h0(),v=p.firstChild,w=v.nextSibling;return le(v,()=>n()?.path?.split("/").pop()??t.t("ui.fileMedia.binary.title")),le(w,()=>{const S=n()?.path;return S?t.t("ui.fileMedia.binary.description.path",{path:S}):t.t("ui.fileMedia.binary.description.default")}),p}}),Y(mn,{when:!0,get children(){return e.fallback()}})]}})}var v0=tt('<div class="fixed z-50 flex h-8 items-center gap-2 rounded-md border border-border-base bg-background-base px-3 shadow-md"><input class="w-40 bg-transparent outline-none text-14-regular text-text-strong placeholder:text-text-weak"><div class="shrink-0 text-12-regular text-text-weak tabular-nums text-right"style=width:10ch></div><div class="flex items-center"><button type=button class="size-6 grid place-items-center rounded text-text-weak hover:bg-surface-base-hover hover:text-text-strong disabled:opacity-40 disabled:pointer-events-none"></button><button type=button class="size-6 grid place-items-center rounded text-text-weak hover:bg-surface-base-hover hover:text-text-strong disabled:opacity-40 disabled:pointer-events-none"></button></div><button type=button class="size-6 grid place-items-center rounded text-text-weak hover:bg-surface-base-hover hover:text-text-strong">');function y0(e){const t=va();return Y(gc,{get children(){var n=v0(),i=n.firstChild,r=i.nextSibling,o=r.nextSibling,s=o.firstChild,l=s.nextSibling,a=o.nextSibling;n.$$pointerdown=c=>c.stopPropagation(),le(n,Y(gn,{name:"magnifying-glass",size:"small",class:"text-text-weak shrink-0"}),i),i.$$keydown=c=>e.onKeyDown(c),i.$$input=c=>e.onInput(c.currentTarget.value);var d=e.setInput;return typeof d=="function"?zn(d,i):e.setInput=i,le(r,(()=>{var c=mc(()=>!!e.count());return()=>c()?`${e.index()+1}/${e.count()}`:"0/0"})()),Ut(s,"click",e.onPrev,!0),le(s,Y(gn,{name:"chevron-down",size:"small",class:"rotate-180"})),Ut(l,"click",e.onNext,!0),le(l,Y(gn,{name:"chevron-down",size:"small"})),Ut(a,"click",e.onClose,!0),le(a,Y(gn,{name:"close-small",size:"small"})),ct(c=>{var u=`${e.pos().top}px`,h=`${e.pos().right}px`,f=t.t("ui.fileSearch.placeholder"),g=e.count()===0,y=t.t("ui.fileSearch.previousMatch"),_=e.count()===0,b=t.t("ui.fileSearch.nextMatch"),p=t.t("ui.fileSearch.close");return u!==c.e&&xo(n,"top",c.e=u),h!==c.t&&xo(n,"right",c.t=h),f!==c.a&&ke(i,"placeholder",c.a=f),g!==c.o&&(s.disabled=c.o=g),y!==c.i&&ke(s,"aria-label",c.i=y),_!==c.n&&(l.disabled=c.n=_),b!==c.s&&ke(l,"aria-label",c.s=b),p!==c.h&&ke(a,"aria-label",c.h=p),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0,h:void 0}),ct(()=>i.value=e.query()),n}})}ma(["pointerdown","input","keydown","click"]);var _0=tt('<div data-component=file class="relative outline-none"tabindex=0><div></div><div class="pointer-events-none absolute inset-0 z-0">');const w0=5e5,S0={...bi,lineHeight:24,spacing:0},Kd=["mode","media","class","classList","annotations","selectedLines","commentedLines","search","onLineSelected","onLineSelectionEnd","onLineNumberSelectionEnd","onRendered","preloadedDiff"],C0=["file",...Kd],k0=["fileDiff","before","after","virtualize",...Kd];function E0(e){let t,n,i,r,o,s,l,a=!1,d=null,c=!1;const u=Hv(),h=Uv(),[f,g]=fa(0),y=()=>Vv(n),_=()=>Wd(n),b=Nv({wrapper:()=>t,overlay:()=>i,getRoot:y}),p=()=>{r===void 0&&(r=requestAnimationFrame(()=>{r=void 0;const C=c;e.updateSelection(C),c&&(c=!1,e.onLineSelectionEnd(d))}))},v=()=>{o===void 0&&(o=requestAnimationFrame(()=>{o=void 0;const C=e.buildDragSelection();C&&e.setSelectedLines(C)}))},w=C=>{if(!e.enableLineSelection()||C.button!==0)return;const x=e.lineFromMouseEvent(C);if(x.numberColumn){h.begin(!0,x.line);return}x.line!==void 0&&(h.begin(!1,x.line),s=x.line,l=x.line,a=!1,e.onDragStart(x))},S=C=>{if(!e.enableLineSelection())return;const x=e.lineFromMouseEvent(C);if(!h.track(C.buttons,x.line)&&s!==void 0){if((C.buttons&1)===0){s=void 0,l=void 0,a=!1,e.onDragReset(),h.finish();return}x.line!==void 0&&(l=x.line,a=!0,e.onDragMove(x),v())}},k=()=>{if(e.enableLineSelection()&&h.finish()!=="numbers"&&s!==void 0){if(!a){c=!1;const C=e.buildClickSelection();C&&e.setSelectedLines(C),e.onLineSelectionEnd(d),s=void 0,l=void 0,a=!1,e.onDragReset();return}c=!0,v(),p(),s=void 0,l=void 0,a=!1,e.onDragReset()}},E=()=>{if(!e.enableLineSelection()||s===void 0)return;const C=window.getSelection();!C||C.isCollapsed||p()};return pa(()=>{He(zv(_))}),we(()=>{f();const C=e.commentedLines();requestAnimationFrame(()=>{const x=y();x&&e.markCommented(x,C)})}),we(()=>{e.setSelectedLines(e.selectedLines()??null)}),we(()=>{e.enableLineSelection()&&(Ze(n,"mousedown",w),Ze(n,"mousemove",S),Ze(window,"mouseup",k),Ze(document,"selectionchange",E))}),He(()=>{Kt(u),r!==void 0&&cancelAnimationFrame(r),o!==void 0&&cancelAnimationFrame(o),r=void 0,o=void 0,s=void 0,l=void 0,a=!1,h.reset(),d=null,c=!1}),{get wrapper(){return t},set wrapper(C){t=C},get container(){return n},set container(C){n=C},get overlay(){return i},set overlay(C){i=C},get dragStart(){return s},get dragEnd(){return l},get lastSelection(){return d},set lastSelection(C){d=C},ready:u,bridge:h,rendered:f,setRendered:g,getRoot:y,getHost:_,find:b,scheduleSelectionUpdate:p}}function Xd(e,t){return E0({enableLineSelection:e.enableLineSelection,selectedLines:e.selectedLines,commentedLines:()=>e.commentedLines()??[],onLineSelectionEnd:e.onLineSelectionEnd,...t})}function Qd(e){we(()=>{const t=e.search();if(!t)return;const n={focus:()=>e.find.focus()};t.register(n),He(()=>t.register(null))})}function Yd(e){const t=n=>{if(!e.normalize)return n;const i=e.normalize(n);return i!==void 0?i:n};return{onLineSelected:n=>{const i=t(n);e.viewer.lastSelection=i,e.onLineSelected?.(i)},onLineSelectionEnd:n=>{const i=t(n);e.viewer.lastSelection=i,e.onLineSelectionEnd?.(i),e.viewer.bridge.consume(i)&&requestAnimationFrame(()=>e.onLineNumberSelectionEnd?.(i))}}}function Jd(e){we(()=>{e.viewer.rendered();const t=e.current();t&&(t.setLineAnnotations(e.annotations()),t.rerender(),requestAnimationFrame(()=>e.viewer.find.refresh({reset:!0})))})}function Zd(e){$v({state:e.viewer.ready,container:e.viewer.container,getRoot:e.viewer.getRoot,isReady:e.isReady,settleFrames:e.settleFrames,onReady:e.onReady})}function ec(e){Kt(e.viewer.ready);const t=e.reset===!0&&e.current!==void 0;t&&e.current?.cleanUp();const n=t||!e.current?e.create():e.current;t||!e.current?(e.viewer.container.innerHTML="",e.assign(n)):e.update?.(n),e.draw(n),Yr(e.viewer.getHost()),e.viewer.setRendered(i=>i+1),e.onReady()}function x0(e){const t=tc(e.wrapper);if(!t)return()=>{};const n=e.container.getBoundingClientRect().height;if(!n)return()=>{};const i=e.wrapper.getBoundingClientRect().top-t.getBoundingClientRect().top,r=e.container.style.minHeight;e.container.style.minHeight=`${Math.ceil(n)}px`;let o=!1;return()=>{if(o)return;o=!0,e.container.style.minHeight=r;const l=e.wrapper.getBoundingClientRect().top-t.getBoundingClientRect().top-i;l&&(t.scrollTop+=l)}}function tc(e){let t=e.parentElement;for(;t;){const n=getComputedStyle(t);if(n.overflowY==="auto"||n.overflowY==="scroll")return t;t=t.parentElement}}function L0(e,t){let n,i;const r=()=>{n?.cleanUp(),n=void 0,i=void 0};return{get:()=>{if(!t()){r();return}if(typeof document>"u")return;const o=e();if(!o)return;const s=tc(o)??document;return n&&i===s||(r(),n=new $d,i=s,n.setup(s,s instanceof Document?void 0:o)),n},cleanup:r}}function T0(e,t){let n;const i=()=>{n?.release(),n=void 0};return{get:()=>{if(!t()){i();return}if(n)return n.virtualizer;const r=e();if(!r)return;const o=Xv(r);if(o)return n=o,o.virtualizer},cleanup:i}}function R0(e){if(!e.dataset.line)return;const t=parseInt(e.dataset.line,10);if(!Number.isNaN(t))return t}function nc(e,t,n){const i=e.composedPath();let r=!1,o,s;for(const l of i)if(l instanceof HTMLElement&&(r=r||l.dataset.columnNumber!=null,o===void 0&&(o=t(l)),s===void 0&&n&&(s=n(l)),r&&o!==void 0&&(n==null||s!==void 0)))break;return{line:o,numberColumn:r,side:s}}function A0(e){const t=e.dataset.lineType;if(t==="change-deletion")return"deletions";if(t==="change-addition"||t==="change-additions")return"additions";if(e.dataset.code!=null)return e.hasAttribute("data-deletions")?"deletions":"additions"}function I0(e){const t=Di(e);if(t)return Bd(t)}function ic(e){return(()=>{var t=_0(),n=t.firstChild,i=n.nextSibling;return Ut(t,"focus",e.viewer.find.onFocus),Ut(t,"pointerdown",e.viewer.find.onPointerDown,!0),zn(r=>e.viewer.wrapper=r,t),le(t,Y(Vn,{get when(){return e.viewer.find.open()},get children(){return Y(y0,{get pos(){return e.viewer.find.pos},get query(){return e.viewer.find.query},get count(){return e.viewer.find.count},get index(){return e.viewer.find.index},get setInput(){return e.viewer.find.setInput},get onInput(){return e.viewer.find.setQuery},get onKeyDown(){return e.viewer.find.onInputKeyDown},get onClose(){return e.viewer.find.close},onPrev:()=>e.viewer.find.next(-1),onNext:()=>e.viewer.find.next(1)})}}),n),zn(r=>e.viewer.container=r,n),zn(r=>e.viewer.overlay=r,i),ct(r=>{var o=e.mode,s=Rv,l={...e.classList,[e.class??""]:!!e.class};return o!==r.e&&ke(t,"data-mode",r.e=o),r.t=bc(t,s,r.t),r.a=vc(t,l,r.a),r},{e:void 0,t:void 0,a:void 0}),t})()}function P0(e){let t,n;const[i,r]=ga(e,C0),o=()=>{const b=i.file.contents;return typeof b=="string"?b:Array.isArray(b)?b.join(`
647
+ `):b==null?"":String(b)},s=()=>{const b=o(),p=b.split(`
648
+ `).length-(b.endsWith(`
649
+ `)?1:0);return Math.max(1,p)},l=re(()=>{const b=i.file.contents;return typeof b=="string"?b.length:Array.isArray(b)?b.reduce((p,v)=>p+(typeof v=="string"?v.length+1:String(v).length+1),0):b==null?0:String(b).length}),a=re(()=>l()>w0),d=L0(()=>n.wrapper,a),c=b=>nc(b,R0),u=b=>{const p=t;if(!p)return!1;if(a())return p.setSelectedLines(b),!0;const v=n.getRoot();if(!v)return!1;const w=s();if(v.querySelectorAll("[data-line]").length<w)return!1;if(!b)return p.setSelectedLines(null),!0;const S=Math.min(b.start,b.end),k=Math.max(b.start,b.end);if(S<1||k>w||!v.querySelector(`[data-line="${S}"]`)||!v.querySelector(`[data-line="${k}"]`))return p.setSelectedLines(null),!0;const E=b.endSide!=null?{start:b.start,end:b.end}:b.side!=="deletions"||v.querySelector("[data-deletions]")!=null?b:{start:b.start,end:b.end};return p.setSelectedLines(E),!0},h=b=>{n.lastSelection=b,u(b)};n=Xd({enableLineSelection:()=>e.enableLineSelection===!0,selectedLines:()=>i.selectedLines,commentedLines:()=>i.commentedLines,onLineSelectionEnd:b=>i.onLineSelectionEnd?.(b)},{lineFromMouseEvent:c,setSelectedLines:h,updateSelection:b=>{const p=n.getRoot();if(!p)return;const v=jd({root:p,lineForNode:Gv,sideForNode:Wv,preserveTextSelection:b});v&&(h(v.range),!(!b||!v.text)&&qd(p,v.text))},buildDragSelection:()=>{if(!(n.dragStart===void 0||n.dragEnd===void 0))return{start:Math.min(n.dragStart,n.dragEnd),end:Math.max(n.dragStart,n.dragEnd)}},buildClickSelection:()=>{if(n.dragStart!==void 0)return{start:n.dragStart,end:n.dragStart}},onDragStart:()=>{},onDragMove:()=>{},onDragReset:()=>{},markCommented:Iv});const g=Yd({viewer:n,onLineSelected:b=>i.onLineSelected?.(b),onLineSelectionEnd:b=>i.onLineSelectionEnd?.(b),onLineNumberSelectionEnd:b=>i.onLineNumberSelectionEnd?.(b)}),y=re(()=>({...Fd("unified"),...r,...g})),_=()=>{Zd({viewer:n,isReady:b=>a()?b.querySelector("[data-line]")!=null:b.querySelectorAll("[data-line]").length>=s(),onReady:()=>{u(n.lastSelection),n.find.refresh({reset:!0}),i.onRendered?.()}})};return Qd({search:()=>i.search,find:n.find}),we(()=>{const b=y(),p=Jr("unified"),v=d.get();ec({viewer:n,current:t,reset:t!==void 0,create:()=>v?new hb(b,v,S0,p):new Pd(b,p),assign:w=>{t=w},draw:w=>{const S=o();w.render({file:typeof i.file.contents=="string"?i.file:{...i.file,contents:S},lineAnnotations:[],containerWrapper:n.container})},onReady:_})}),Jd({viewer:n,current:()=>t,annotations:()=>i.annotations??[]}),He(()=>{t?.cleanUp(),t=void 0,d.cleanup()}),Y(ic,{mode:"text",viewer:n,get class(){return i.class},get classList(){return i.classList}})}function D0(e){let t,n,i,r,o,s,l,a,d,c;const[u,h]=ga(e,k0),f=ba("(max-width: 640px)"),g=E=>nc(E,ra,A0),y=(E,C)=>{const x=t;if(!x)return;const I=Zs(c.getRoot(),E);if(I===void 0){c.lastSelection=E;return}c.lastSelection=I,x.setSelectedLines(I),qd(C?.root,C?.text)};c=Xd({enableLineSelection:()=>e.enableLineSelection===!0,selectedLines:()=>u.selectedLines,commentedLines:()=>u.commentedLines,onLineSelectionEnd:E=>u.onLineSelectionEnd?.(E)},{lineFromMouseEvent:g,setSelectedLines:y,updateSelection:E=>{const C=c.getRoot();if(!C)return;const x=jd({root:C,lineForNode:ra,sideForNode:I0,preserveTextSelection:E});if(x){if(x.text){y(x.range,{root:C,text:x.text});return}y(x.range)}},buildDragSelection:()=>{if(c.dragStart===void 0||c.dragEnd===void 0)return;const E={start:c.dragStart,end:c.dragEnd};return a&&(E.side=a),d&&a&&d!==a&&(E.endSide=d),E},buildClickSelection:()=>{if(c.dragStart===void 0)return;const E={start:c.dragStart,end:c.dragStart};return a&&(E.side=a),E},onDragStart:E=>{a=E.side,d=E.side},onDragMove:E=>{d=E.side},onDragReset:()=>{a=void 0,d=void 0},markCommented:Av});const b=T0(()=>c.container,()=>u.virtualize!==!1),p=re(()=>{if(u.fileDiff){const x=u.fileDiff.deletionLines.join(""),I=u.fileDiff.additionLines.join("");return Math.max(x.length,I.length)>5e5}const E=typeof u.before?.contents=="string"?u.before.contents:"",C=typeof u.after?.contents=="string"?u.after.contents:"";return Math.max(E.length,C.length)>5e5}),v={lineDiffType:"none",maxLineDiffLength:0,tokenizeMaxLineLength:1},w=Yd({viewer:c,normalize:E=>Zs(c.getRoot(),E),onLineSelected:E=>u.onLineSelected?.(E),onLineSelectionEnd:E=>u.onLineSelectionEnd?.(E),onLineNumberSelectionEnd:E=>u.onLineNumberSelectionEnd?.(E)}),S=re(()=>{const E={...Fd(e.diffStyle),...h,...w},C=p()?{...E,...v}:E;return f()?{...C,disableLineNumbers:!0}:C}),k=E=>{Zd({viewer:c,isReady:C=>C.querySelector("[data-line]")!=null,settleFrames:1,onReady:()=>{E?.(),y(c.lastSelection),c.find.refresh({reset:!0}),u.onRendered?.()}})};return Qd({search:()=>u.search,find:c.find}),we(()=>{const E=S(),C=p()?Jr("unified"):Jr(e.diffStyle),x=b.get(),I=typeof u.before?.contents=="string"?u.before.contents:"",P=typeof u.after?.contents=="string"?u.after.contents:"",A=x0(c);He(A);const L=O=>p()?Ys(O):Ys(O,O.length),R=u.before?{...u.before,contents:I,cacheKey:L(I)}:void 0,D=u.after?{...u.after,contents:P,cacheKey:L(P)}:void 0,H=u.fileDiff!==void 0?o!==u.fileDiff:o!==void 0||R===void 0||D===void 0||s===void 0||l===void 0||!Me(s,R)||!Me(l,D),M=t!==void 0&&(n!==x||i!==C||x!==void 0&&(r!==E.hunkSeparators||H)),V=!M&&t!==void 0&&!no(t.options,E);ec({viewer:c,current:t,reset:M,create:()=>x?new hv(E,x,qv,C):new Vd(E,C),update:O=>O.setOptions(E),assign:O=>{t=O,n=x,i=C,r=x?E.hunkSeparators:void 0,o=u.fileDiff,s=R,l=D},draw:O=>{if(u.fileDiff){O.render({fileDiff:u.fileDiff,forceRender:V,lineAnnotations:[],containerWrapper:c.container});return}!R||!D||O.render({oldFile:R,newFile:D,forceRender:V,lineAnnotations:[],containerWrapper:c.container})},onReady:()=>k(A)})}),Jd({viewer:c,current:()=>t,annotations:()=>u.annotations??[]}),He(()=>{t?.cleanUp(),t=void 0,n=void 0,i=void 0,r=void 0,o=void 0,s=void 0,l=void 0,b.cleanup(),a=void 0,d=void 0}),Y(ic,{mode:"diff",viewer:c,get class(){return u.class},get classList(){return u.classList}})}function M0(e){return e.mode==="text"?Y(ca,{get media(){return e.media},fallback:()=>P0(e)}):Y(ca,{get media(){return e.media},fallback:()=>D0(e)})}ma(["pointerdown"]);const $0=Object.freeze(Object.defineProperty({__proto__:null,File:M0},Symbol.toStringTag,{value:"Module"}));export{M0 as F,Kr as a,Fd as b,N0 as c,Vd as d,Rv as e,jr as f,Jr as g,Dv as h,$0 as i,bb as p,Ns as s,va as u};